Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
徐少华
midjourney-proxy
Commits
a66c0ac8
Commit
a66c0ac8
authored
Aug 30, 2021
by
田超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/1005330' into 'master'
feat:[1005330]导航分成互助打卡 See merge request rays/pcloud-book!1392
parents
8875f119
1348bb6c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
56 deletions
+59
-56
ResourcePageBiz.java
.../main/java/com/pcloud/book/group/biz/ResourcePageBiz.java
+0
-8
ResourcePageBizImpl.java
...a/com/pcloud/book/group/biz/impl/ResourcePageBizImpl.java
+43
-39
ResourcePageConstants.java
...com/pcloud/book/group/constant/ResourcePageConstants.java
+16
-2
ResourcePageFacade.java
...com/pcloud/book/group/facade/impl/ResourcePageFacade.java
+0
-7
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/ResourcePageBiz.java
View file @
a66c0ac8
...
...
@@ -405,14 +405,6 @@ public interface ResourcePageBiz {
List
<
BookServeDTO
>
getBookAllServeIdsIncludeUrl
(
Long
adviserId
,
Long
bookId
,
Long
channelId
);
/**
* 处理旧数据导航
* @author:zhuyajie
* @date:2021/8/16 10:51
* * @param null
*/
void
dealOldNavigation
();
/**
* 保存导航
* @author:zhuyajie
* @date:2021/8/17 16:42
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/ResourcePageBizImpl.java
View file @
a66c0ac8
...
...
@@ -285,11 +285,11 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
//同一本书其他码下关闭小睿流程
resourcePageDao
.
setOtherPageRaysClose
(
resourcePage
.
getBookId
(),
resourcePage
.
getChannelId
(),
resourcePage
.
getCreateUser
(),
sceneId
,
null
);
//添加
书友社区
导航
this
.
addDefaultApplet
QA
Navigation
(
resourcePage
.
getId
());
//添加
小程序默认
导航
this
.
addDefaultAppletNavigation
(
resourcePage
.
getId
());
}
else
{
//删除
书友社区
导航
resourcePageNavigationDao
.
deleteNavigation
(
resourcePage
.
getId
(),
ResourcePageConstants
.
NavigationTypeEnum
.
APPLET_QA
.
getCode
());
//删除
小程序默认
导航
this
.
deleteAppletDefaultNavigation
(
resourcePage
.
getId
());
//导航重新排序
this
.
updateNavigationSeq4Batch
(
resourcePage
.
getId
());
}
...
...
@@ -350,11 +350,11 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
//同一本书其他码下关闭小睿流程
resourcePageDao
.
setOtherPageRaysClose
(
resourcePage
.
getBookId
(),
resourcePage
.
getChannelId
(),
resourcePage
.
getCreateUser
(),
null
,
bookGroupId
);
//添加
书友社区
导航
this
.
addDefaultApplet
QA
Navigation
(
resourcePage
.
getId
());
//添加
小程序默认
导航
this
.
addDefaultAppletNavigation
(
resourcePage
.
getId
());
}
else
{
//删除
书友社区
导航
resourcePageNavigationDao
.
deleteNavigation
(
resourcePage
.
getId
(),
ResourcePageConstants
.
NavigationTypeEnum
.
APPLET_QA
.
getCode
());
//删除
小程序默认
导航
this
.
deleteAppletDefaultNavigation
(
resourcePage
.
getId
());
//导航重新排序
this
.
updateNavigationSeq4Batch
(
resourcePage
.
getId
());
}
...
...
@@ -389,7 +389,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
//添加默认导航
this
.
addDefaultBookServeNavigation
(
resourcePage
.
getId
());
if
(
openRays
==
1
)
{
this
.
addDefaultApplet
QA
Navigation
(
resourcePage
.
getId
());
this
.
addDefaultAppletNavigation
(
resourcePage
.
getId
());
}
return
resourcePage
;
}
...
...
@@ -2132,49 +2132,53 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
}
@Override
public
void
dealOldNavigation
()
{
List
<
Long
>
resourcePageIds
=
resourcePageNavigationDao
.
getNoNavigationPages
(
null
);
if
(!
ListUtils
.
isEmpty
(
resourcePageIds
))
{
for
(
Long
resourcePageId
:
resourcePageIds
)
{
Long
navigationId
=
this
.
addDefaultBookServeNavigation
(
resourcePageId
);
if
(
null
!=
navigationId
)
{
resourcePageColumnDao
.
updateNavigationId
(
navigationId
,
resourcePageId
);
}
}
}
List
<
Long
>
openRaysPageIds
=
resourcePageNavigationDao
.
getNoNavigationPages
(
1
);
if
(!
ListUtils
.
isEmpty
(
openRaysPageIds
))
{
for
(
Long
resourcePageId
:
openRaysPageIds
)
{
this
.
addDefaultAppletQANavigation
(
resourcePageId
);
}
/**
* 删除小程序默认导航
* @author:zhuyajie
* @date:2021/8/27 16:01
* * @param null
*/
private
void
deleteAppletDefaultNavigation
(
Long
resourcePageId
)
{
//书友互助、阅读打卡
List
<
Integer
>
types
=
ResourcePageConstants
.
APPLET_DEFAULT_NAVIGATIONS
;
for
(
Integer
type
:
types
){
resourcePageNavigationDao
.
deleteNavigation
(
resourcePageId
,
type
);
}
}
/**
* 添加
书友社区导航
* 添加
小程序默认导航(互助、打卡)
* @author:zhuyajie
* @date:2021/8/16 14:39
* * @param null
*/
private
void
addDefaultAppletQANavigation
(
Long
resourcePageId
)
{
ResourcePageNavigation
resourcePageNavigation
=
resourcePageNavigationDao
.
getByType
(
resourcePageId
,
ResourcePageConstants
.
NavigationTypeEnum
.
APPLET_QA
.
getCode
());
if
(
null
!=
resourcePageNavigation
)
{
return
;
}
private
void
addDefaultAppletNavigation
(
Long
resourcePageId
)
{
ResourcePage
resourcePage
=
resourcePageDao
.
getById
(
resourcePageId
);
if
(
null
==
resourcePage
)
{
return
;
}
//书友互助、阅读打卡
List
<
Integer
>
types
=
ResourcePageConstants
.
APPLET_DEFAULT_NAVIGATIONS
;
Integer
maxSeq
=
resourcePageNavigationDao
.
getMaxSeq
(
resourcePageId
);
ResourcePageNavigation
navigation
=
new
ResourcePageNavigation
();
navigation
.
setCreateUser
(
resourcePage
.
getCreateUser
());
navigation
.
setNavigationName
(
ResourcePageConstants
.
NavigationTypeEnum
.
APPLET_QA
.
getName
());
navigation
.
setNavigationSeq
(
maxSeq
+
1
);
navigation
.
setNavigationType
(
ResourcePageConstants
.
NavigationTypeEnum
.
APPLET_QA
.
getCode
());
navigation
.
setResourcePageId
(
resourcePageId
);
resourcePageNavigationDao
.
insert
(
navigation
);
Integer
addSeq
=
0
;
List
<
ResourcePageNavigation
>
navigations
=
new
ArrayList
<>();
for
(
Integer
type
:
types
){
ResourcePageNavigation
resourcePageNavigation
=
resourcePageNavigationDao
.
getByType
(
resourcePageId
,
type
);
if
(
null
!=
resourcePageNavigation
)
{
continue
;
}
addSeq
=
addSeq
+
1
;
ResourcePageNavigation
navigation
=
new
ResourcePageNavigation
();
navigation
.
setCreateUser
(
resourcePage
.
getCreateUser
());
navigation
.
setNavigationName
(
ResourcePageConstants
.
NavigationTypeEnum
.
getNameByCode
(
type
));
navigation
.
setNavigationSeq
(
maxSeq
+
addSeq
);
navigation
.
setNavigationType
(
type
);
navigation
.
setResourcePageId
(
resourcePageId
);
navigations
.
add
(
navigation
);
}
if
(!
ListUtils
.
isEmpty
(
navigations
))
{
resourcePageNavigationDao
.
insert
(
navigations
);
}
}
/**
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/constant/ResourcePageConstants.java
View file @
a66c0ac8
...
...
@@ -337,8 +337,9 @@ public class ResourcePageConstants {
*/
public
enum
NavigationTypeEnum
{
BOOK_SERVE
(
1
,
"本书配套"
),
APPLET_QA
(
2
,
"书友社区"
),
CUSTOM
(
3
,
"自定义"
);
APPLET_QA
(
2
,
"书友互助"
),
CUSTOM
(
3
,
"自定义"
),
CLOCK
(
4
,
"阅读打卡"
);
private
Integer
code
;
private
String
name
;
...
...
@@ -362,5 +363,18 @@ public class ResourcePageConstants {
this
.
code
=
code
;
this
.
name
=
name
;
}
public
static
String
getNameByCode
(
Integer
code
)
{
for
(
NavigationTypeEnum
navigationTypeEnum:
NavigationTypeEnum
.
values
()){
if
(
navigationTypeEnum
.
code
.
equals
(
code
)){
return
navigationTypeEnum
.
name
;
}
}
return
null
;
}
}
//小程序默认导航,书友互助、阅读打卡
public
static
List
<
Integer
>
APPLET_DEFAULT_NAVIGATIONS
=
Arrays
.
asList
(
ResourcePageConstants
.
NavigationTypeEnum
.
APPLET_QA
.
getCode
(),
ResourcePageConstants
.
NavigationTypeEnum
.
CLOCK
.
getCode
());
}
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/impl/ResourcePageFacade.java
View file @
a66c0ac8
...
...
@@ -283,13 +283,6 @@ public class ResourcePageFacade {
return
new
ResponseDto
<>();
}
@ApiOperation
(
"处理旧数据导航"
)
@GetMapping
(
"dealOldNavigation"
)
public
ResponseDto
<?>
dealOldNavigation
()
{
resourcePageBiz
.
dealOldNavigation
();
return
new
ResponseDto
<>();
}
@ApiOperation
(
"保存导航"
)
@PostMapping
(
"saveNavigation"
)
public
ResponseDto
<?>
saveNavigation
(
@RequestHeader
(
"token"
)
String
token
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment