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
ebfabc95
Commit
ebfabc95
authored
Nov 18, 2020
by
田超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/1003816' into 'master'
feat:[1003816] 小程序问卷 See merge request rays/pcloud-book!1042
parents
c7c3f9d5
648155fb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
7 deletions
+64
-7
RightsSettingBizImpl.java
...oud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
+45
-2
RightsSettingItem.java
...m/pcloud/book/rightsSetting/entity/RightsSettingItem.java
+5
-0
RightsSettingItemDetail.java
...ud/book/rightsSetting/entity/RightsSettingItemDetail.java
+4
-0
RightsSettingItemDetail.Mapper.xml
...s/mapper/rightssetting/RightsSettingItemDetail.Mapper.xml
+10
-5
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
View file @
ebfabc95
...
...
@@ -542,13 +542,14 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
List
<
AppletNewsDTO
>
appletNewsDTOS
;
List
<
CustomPlan
>
customPlanList
;
List
<
AppletOuterBooklistDTO
>
outerBooklistDTOS
;
List
<
RightsNowItem
>
rightsSettingItemList4Serve
;
// 处理资讯、社群等子项列表数据
for
(
RightsSettingItem
rightsItem
:
rightsSettingItemList
)
{
groupActivity4AppletList
=
rightsItem
.
getGroupActivity4AppletList
();
appletNewsDTOS
=
rightsItem
.
getAppletNewsDTOS
();
customPlanList
=
rightsItem
.
getCustomPlanList
();
outerBooklistDTOS
=
rightsItem
.
getOuterBooklistDTOS
();
rightsSettingItemList4Serve
=
rightsItem
.
getRightsSettingItemList4Serve
();
Long
rightsSettingItemId
=
mapRightsSettingItem
.
get
(
rightsItem
.
getUuid
());
if
(!
NumberUtil
.
isNumber
(
rightsSettingItemId
))
{
continue
;
...
...
@@ -600,6 +601,18 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
rightsSettingItemDetail
.
setServeId
(
booklistDTO
.
getId
());
rightsSettingItemDetailList
.
add
(
rightsSettingItemDetail
);
}
}
else
if
(
BookConstant
.
APP_PRODUCT
.
equalsIgnoreCase
(
rightsItem
.
getServeType
())){
if
(
ListUtils
.
isEmpty
(
rightsSettingItemList4Serve
)){
continue
;
}
for
(
RightsNowItem
rightsNowItem
:
rightsSettingItemList4Serve
){
rightsSettingItemDetail
=
new
RightsSettingItemDetail
();
rightsSettingItemDetail
.
setRightsSettingItemId
(
rightsSettingItemId
);
rightsSettingItemDetail
.
setServeType
(
rightsNowItem
.
getServeType
());
rightsSettingItemDetail
.
setServeId
(
rightsNowItem
.
getServeId
());
rightsSettingItemDetail
.
setLinkUrl
(
rightsNowItem
.
getLinkUrl
());
rightsSettingItemDetailList
.
add
(
rightsSettingItemDetail
);
}
}
}
}
...
...
@@ -967,11 +980,13 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
// 按 rightsSettingItemId 分组
Map
<
Long
,
List
<
RightsSettingItemDetail
>>
itemDetailMap
=
allItemDetailList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
RightsSettingItemDetail:
:
getRightsSettingItemId
));
//填充应用或作品
fillProductAndApp4Week
(
rightsSettingItemList
,
itemDetailMap
);
List
<
Long
>
groupIds
=
new
ArrayList
<>();
List
<
Long
>
appletNewsId
=
new
ArrayList
<>();
List
<
Long
>
planIds
=
new
ArrayList
<>();
List
<
Long
>
booklistIds
=
new
ArrayList
<>();
for
(
RightsSettingItemDetail
item
:
allItemDetailList
)
{
if
(
item
.
getServeId
()
!=
null
&&
RightsServeTypeEnum
.
GROUP
.
name
().
equals
(
item
.
getServeType
())
&&
!
groupIds
.
contains
(
item
.
getServeId
()))
{
...
...
@@ -1067,6 +1082,34 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
}
}
private
void
fillProductAndApp4Week
(
List
<
RightsSettingItem
>
rightsSettingItemList
,
Map
<
Long
,
List
<
RightsSettingItemDetail
>>
itemDetailMap
)
{
if
(
ListUtils
.
isEmpty
(
rightsSettingItemList
))
{
return
;
}
List
<
RightsSettingItemDetail
>
itemDetailList
=
new
ArrayList
<>();
List
<
RightsNowItem
>
rightsSettingItemList4Serve
=
new
ArrayList
<>();
for
(
RightsSettingItem
rightsSettingItem
:
rightsSettingItemList
)
{
// 默认值
rightsSettingItem
.
setRightsSettingItemList4Serve
(
Lists
.
newArrayList
());
itemDetailList
=
itemDetailMap
.
get
(
rightsSettingItem
.
getId
());
if
(!
ListUtils
.
isEmpty
(
itemDetailList
)
&&
(
RightsServeTypeEnum
.
PRODUCT
.
name
().
equalsIgnoreCase
(
itemDetailList
.
get
(
0
).
getServeType
())
||
RightsServeTypeEnum
.
APP
.
name
().
equalsIgnoreCase
(
itemDetailList
.
get
(
0
).
getServeType
())
))
{
for
(
RightsSettingItemDetail
itemDetail
:
itemDetailList
)
{
RightsNowItem
rightsNowItem
=
new
RightsNowItem
();
rightsNowItem
.
setServeId
(
itemDetail
.
getServeId
());
rightsNowItem
.
setServeType
(
itemDetail
.
getServeType
());
rightsNowItem
.
setType
(
RightsNowItemTypeNew
.
LEARNING_TOOL
.
value
);
rightsNowItem
.
setLinkUrl
(
itemDetail
.
getLinkUrl
());
rightsSettingItemList4Serve
.
add
(
rightsNowItem
);
}
fillProductAndApp
(
rightsSettingItemList4Serve
);
rightsSettingItem
.
setRightsSettingItemList4Serve
(
rightsSettingItemList4Serve
);
}
}
}
@Override
public
void
fillGroupActivityHead
(
List
<
GroupActivity4AppletDTO
>
groupActivity4AppletList
)
{
if
(!
ListUtils
.
isEmpty
(
groupActivity4AppletList
))
{
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/entity/RightsSettingItem.java
View file @
ebfabc95
...
...
@@ -58,6 +58,11 @@ public class RightsSettingItem extends BaseEntity {
* 权益标题
*/
private
String
title
;
/**
* 列表
*/
private
List
<
RightsNowItem
>
rightsSettingItemList4Serve
;
/**
* 资讯
*/
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/entity/RightsSettingItemDetail.java
View file @
ebfabc95
...
...
@@ -36,5 +36,8 @@ public class RightsSettingItemDetail extends BaseEntity {
@ApiModelProperty
(
"群类型 2:编辑端群"
)
private
Integer
groupType
;
@ApiModelProperty
(
"应用链接"
)
private
String
linkUrl
;
}
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/rightssetting/RightsSettingItemDetail.Mapper.xml
View file @
ebfabc95
...
...
@@ -9,10 +9,11 @@
<result
column=
"serve_type"
property=
"serveType"
jdbcType=
"VARCHAR"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"group_type"
property=
"groupType"
jdbcType=
"TINYINT"
/>
<result
column=
"link_url"
property=
"linkUrl"
jdbcType=
"VARCHAR"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, rights_setting_item_id, serve_id, serve_type, create_time, group_type
id, rights_setting_item_id, serve_id, serve_type, create_time, group_type
, link_url
</sql>
<select
id=
"getById"
resultMap=
"BaseResultMap"
>
...
...
@@ -44,13 +45,15 @@
serve_id,
serve_type,
create_time,
group_type
group_type,
link_url
) VALUES (
#{rightsSettingItemId, jdbcType=BIGINT},
#{serveId, jdbcType=BIGINT},
#{serveType, jdbcType=VARCHAR},
NOW(),
group_type
group_type,
#{linkUrl}
)
</insert>
...
...
@@ -60,7 +63,8 @@
serve_id,
serve_type,
create_time,
group_type
group_type,
link_url
) VALUES
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(
...
...
@@ -68,7 +72,8 @@
#{item.serveId, jdbcType=BIGINT},
#{item.serveType, jdbcType=VARCHAR},
NOW(),
#{item.groupType}
#{item.groupType},
#{item.linkUrl}
)
</foreach>
</insert>
...
...
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