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
23290a6b
Commit
23290a6b
authored
Apr 22, 2021
by
朱亚洁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:[1004264]H5落地页改版旧数据处理
parent
8e42307c
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
322 additions
and
22 deletions
+322
-22
BookGroupServeDTO.java
...ain/java/com/pcloud/book/group/dto/BookGroupServeDTO.java
+8
-0
BookGroupService.java
.../java/com/pcloud/book/group/service/BookGroupService.java
+4
-0
BookAdviserBizImpl.java
...ava/com/pcloud/book/book/biz/impl/BookAdviserBizImpl.java
+45
-20
ResourcePageBiz.java
.../main/java/com/pcloud/book/group/biz/ResourcePageBiz.java
+26
-0
ResourcePageBizImpl.java
...a/com/pcloud/book/group/biz/impl/ResourcePageBizImpl.java
+93
-0
ResourcePageItemDao.java
...n/java/com/pcloud/book/group/dao/ResourcePageItemDao.java
+18
-0
ResourcePageItemDaoImpl.java
...m/pcloud/book/group/dao/impl/ResourcePageItemDaoImpl.java
+10
-0
BookGroupServe.java
...ain/java/com/pcloud/book/group/entity/BookGroupServe.java
+2
-0
ResourcePageFacade.java
...com/pcloud/book/group/facade/impl/ResourcePageFacade.java
+7
-0
BookGroupServiceImpl.java
.../pcloud/book/group/service/impl/BookGroupServiceImpl.java
+9
-0
ResourcePageItemVO.java
...ain/java/com/pcloud/book/group/vo/ResourcePageItemVO.java
+3
-0
ResourcePageOneServe.java
...n/java/com/pcloud/book/group/vo/ResourcePageOneServe.java
+54
-0
ResourcePageItemDao.xml
...k/src/main/resources/mapper/group/ResourcePageItemDao.xml
+43
-2
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/group/dto/BookGroupServeDTO.java
View file @
23290a6b
...
@@ -67,4 +67,12 @@ public class BookGroupServeDTO extends BaseDto {
...
@@ -67,4 +67,12 @@ public class BookGroupServeDTO extends BaseDto {
@ApiModelProperty
(
"类型"
)
@ApiModelProperty
(
"类型"
)
private
String
typeCode
;
private
String
typeCode
;
@ApiModelProperty
(
"大图"
)
private
String
transverseImg
;
@ApiModelProperty
(
"应用类型名称"
)
private
String
typeName
;
private
Long
sceneId
;
}
}
pcloud-facade-book/src/main/java/com/pcloud/book/group/service/BookGroupService.java
View file @
23290a6b
...
@@ -268,4 +268,8 @@ public interface BookGroupService {
...
@@ -268,4 +268,8 @@ public interface BookGroupService {
@RequestParam
(
"bookId"
)
Long
bookId
,
@RequestParam
(
"adviserId"
)
Long
adviserId
,
@RequestParam
(
"bookId"
)
Long
bookId
,
@RequestParam
(
"adviserId"
)
Long
adviserId
,
@RequestParam
(
"channelId"
)
Long
channelId
,
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
,
@RequestParam
(
"channelId"
)
Long
channelId
,
@RequestParam
(
value
=
"name"
,
required
=
false
)
String
name
,
@RequestParam
(
value
=
"rank"
,
required
=
false
)
Integer
rank
);
@RequestParam
(
value
=
"rank"
,
required
=
false
)
Integer
rank
);
@ApiOperation
(
"自有码配置的资源列表"
)
@PostMapping
(
"mapSceneServeList"
)
ResponseEntity
<
ResponseDto
<
Map
<
Long
,
List
<
BookGroupServeDTO
>>>>
mapSceneServeList
(
@RequestBody
List
<
Long
>
sceneIds
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookAdviserBizImpl.java
View file @
23290a6b
...
@@ -70,10 +70,10 @@ import com.pcloud.book.consumer.user.ChannelConsr;
...
@@ -70,10 +70,10 @@ import com.pcloud.book.consumer.user.ChannelConsr;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
import
com.pcloud.book.es.biz.ESBookAndAdviserBiz
;
import
com.pcloud.book.es.biz.ESBookAndAdviserBiz
;
import
com.pcloud.book.group.biz.BookGroupBiz
;
import
com.pcloud.book.group.biz.BookGroupBiz
;
import
com.pcloud.book.group.biz.ResourcePageBiz
;
import
com.pcloud.book.group.dao.BookAppletSceneDao
;
import
com.pcloud.book.group.dao.BookAppletSceneDao
;
import
com.pcloud.book.group.dao.BookGroupDao
;
import
com.pcloud.book.group.dao.BookGroupDao
;
import
com.pcloud.book.group.dao.BookGroupServeDao
;
import
com.pcloud.book.group.dao.BookGroupServeDao
;
import
com.pcloud.book.group.dao.ResourcePageItemDao
;
import
com.pcloud.book.group.dto.BookAppletSceneDTO
;
import
com.pcloud.book.group.dto.BookAppletSceneDTO
;
import
com.pcloud.book.group.dto.BookGroupDTO
;
import
com.pcloud.book.group.dto.BookGroupDTO
;
import
com.pcloud.book.group.dto.BookGroupServeCountDTO
;
import
com.pcloud.book.group.dto.BookGroupServeCountDTO
;
...
@@ -250,7 +250,7 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -250,7 +250,7 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
@Autowired
@Autowired
private
BookGroupServeDao
bookGroupServeDao
;
private
BookGroupServeDao
bookGroupServeDao
;
@Autowired
@Autowired
private
ResourcePage
ItemDao
resourcePageItemDao
;
private
ResourcePage
Biz
resourcePageBiz
;
@Override
@Override
public
List
<
BookDto
>
listByAdviserId
(
Long
adviserId
)
{
public
List
<
BookDto
>
listByAdviserId
(
Long
adviserId
)
{
...
@@ -2860,7 +2860,8 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -2860,7 +2860,8 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
// 区分二维码来源 分别去book 和 channel 填充信息
// 区分二维码来源 分别去book 和 channel 填充信息
List
<
Long
>
bookGroupIds
=
Optional
.
ofNullable
(
map
).
map
(
x
->
x
.
get
(
"bookGroup"
)).
orElse
(
new
ArrayList
<>());
List
<
Long
>
bookGroupIds
=
Optional
.
ofNullable
(
map
).
map
(
x
->
x
.
get
(
"bookGroup"
)).
orElse
(
new
ArrayList
<>());
List
<
Long
>
qrcodeSceneIds
=
Optional
.
ofNullable
(
map
).
map
(
x
->
x
.
get
(
"qrcodeScene"
)).
orElse
(
new
ArrayList
<>());
List
<
Long
>
qrcodeSceneIds
=
Optional
.
ofNullable
(
map
).
map
(
x
->
x
.
get
(
"qrcodeScene"
)).
orElse
(
new
ArrayList
<>());
//渠道中的自有码id
List
<
Long
>
aliQrcodeSceneIds
=
pageList
.
stream
().
filter
(
s
->
"ali"
.
equals
(
s
.
getQrcodeType
())).
map
(
BookQrcodeVO:
:
getSceneId
).
collect
(
Collectors
.
toList
());
// 获取渠道中二维码信息-包含 自有码和公众号码 返回结果对二维码类型进行了纠正
// 获取渠道中二维码信息-包含 自有码和公众号码 返回结果对二维码类型进行了纠正
CompletableFuture
<
Map
<
Long
,
BookQrcodeVO
>>
qrcodeSceneFuture
=
CompletableFuture
.
supplyAsync
(()
->
CompletableFuture
<
Map
<
Long
,
BookQrcodeVO
>>
qrcodeSceneFuture
=
CompletableFuture
.
supplyAsync
(()
->
...
@@ -2868,7 +2869,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -2868,7 +2869,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
.
map
(
x
->
x
.
stream
().
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
toMap
(
BookQrcodeVO:
:
getSceneId
,
Function
.
identity
())))
.
map
(
x
->
x
.
stream
().
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
toMap
(
BookQrcodeVO:
:
getSceneId
,
Function
.
identity
())))
.
orElse
(
new
HashMap
<>()));
.
orElse
(
new
HashMap
<>()));
if
(
CollUtil
.
isEmpty
(
bookGroupIds
)){
if
(
CollUtil
.
isEmpty
(
bookGroupIds
)){
Map
<
Long
,
BookQrcodeVO
>
qrcodeVOMap
=
null
;
Map
<
Long
,
BookQrcodeVO
>
qrcodeVOMap
=
null
;
try
{
try
{
...
@@ -2919,7 +2919,7 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -2919,7 +2919,7 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
// 填充配置的服务信息
// 填充配置的服务信息
// 查询 book_group_serve
// 查询 book_group_serve
CompletableFuture
<
List
<
BookGroupServe
>>
bookGroupServeFuture
=
CompletableFuture
.
completedFuture
(
CompletableFuture
<
List
<
BookGroupServe
>>
bookGroupServeFuture
=
CompletableFuture
.
completedFuture
(
Optional
.
ofNullable
(
resourcePage
ItemDao
.
getServeListByBookGroupIds
(
bookGroup
Ids
)).
orElse
(
new
ArrayList
<>()));
Optional
.
ofNullable
(
resourcePage
Biz
.
getServeListByBookGroupAndSceneIds
(
bookGroupIds
,
aliQrcodeScene
Ids
)).
orElse
(
new
ArrayList
<>()));
// 查询 book_group_serve 作品信息
// 查询 book_group_serve 作品信息
// 查询作品ID
// 查询作品ID
...
@@ -2957,8 +2957,12 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -2957,8 +2957,12 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
Map
<
Long
,
BookQrcodeVO
>
qrcodeVOMap
=
Optional
.
ofNullable
(
qrcodeSceneFuture
.
get
()).
orElse
(
new
HashMap
<>());
Map
<
Long
,
BookQrcodeVO
>
qrcodeVOMap
=
Optional
.
ofNullable
(
qrcodeSceneFuture
.
get
()).
orElse
(
new
HashMap
<>());
Map
<
Long
,
String
>
labelNameMap
=
Optional
.
ofNullable
(
bookGroupLabelMapFuture
.
get
()).
orElse
(
new
HashMap
<>());
Map
<
Long
,
String
>
labelNameMap
=
Optional
.
ofNullable
(
bookGroupLabelMapFuture
.
get
()).
orElse
(
new
HashMap
<>());
Map
<
Long
,
GroupUserCountDTO
>
bookGroupStatsMap
=
Optional
.
ofNullable
(
bookGroupStatsMapFuture
.
get
()).
orElse
(
new
HashMap
<>());
Map
<
Long
,
GroupUserCountDTO
>
bookGroupStatsMap
=
Optional
.
ofNullable
(
bookGroupStatsMapFuture
.
get
()).
orElse
(
new
HashMap
<>());
Map
<
Long
,
List
<
BookGroupServe
>>
bookGroupServeMap
=
Optional
.
ofNullable
(
bookGroupServeFuture
.
get
()).
map
(
x
->
x
.
stream
()
Map
<
Long
,
List
<
BookGroupServe
>>
bookGroupServeMap
=
Optional
.
ofNullable
(
bookGroupServeFuture
.
get
()).
map
(
x
->
x
.
stream
()
.
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
groupingBy
(
BookGroupServe:
:
getBookGroupId
))).
orElse
(
new
HashMap
<>());
.
filter
(
s
->
s
.
getBookGroupId
()!=
null
).
collect
(
Collectors
.
groupingBy
(
BookGroupServe:
:
getBookGroupId
))).
orElse
(
new
HashMap
<>());
Map
<
Long
,
List
<
BookGroupServe
>>
aliSceneServeMap
=
Optional
.
ofNullable
(
bookGroupServeFuture
.
get
()).
map
(
x
->
x
.
stream
()
.
filter
(
s
->
s
.
getSceneId
()!=
null
).
collect
(
Collectors
.
groupingBy
(
BookGroupServe:
:
getSceneId
))).
orElse
(
new
HashMap
<>());
Map
<
Long
,
String
>
bookGroupLocationMap
=
Optional
.
ofNullable
(
bookGroupLocationMapFuture
.
get
()).
orElse
(
new
HashMap
<>());
Map
<
Long
,
String
>
bookGroupLocationMap
=
Optional
.
ofNullable
(
bookGroupLocationMapFuture
.
get
()).
orElse
(
new
HashMap
<>());
Map
<
Long
,
AppDto
>
bookGroupAppMap
=
Optional
.
ofNullable
(
bookGroupServesAppMapFuture
.
get
()).
orElse
(
new
HashMap
<>());
Map
<
Long
,
AppDto
>
bookGroupAppMap
=
Optional
.
ofNullable
(
bookGroupServesAppMapFuture
.
get
()).
orElse
(
new
HashMap
<>());
Map
<
Long
,
Boolean
>
isSuperMap
=
Optional
.
ofNullable
(
isSuperMapFuture
.
get
()).
orElse
(
new
HashMap
<>());
Map
<
Long
,
Boolean
>
isSuperMap
=
Optional
.
ofNullable
(
isSuperMapFuture
.
get
()).
orElse
(
new
HashMap
<>());
...
@@ -2969,8 +2973,25 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -2969,8 +2973,25 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
if
(
Objects
.
isNull
(
bookQrcodeVO
)
||
Objects
.
isNull
(
bookQrcodeVO
.
getSceneId
()))
continue
;
if
(
Objects
.
isNull
(
bookQrcodeVO
)
||
Objects
.
isNull
(
bookQrcodeVO
.
getSceneId
()))
continue
;
if
(
Objects
.
equals
(
bookQrcodeVO
.
getSource
(),
"qrcodeScene"
))
{
if
(
Objects
.
equals
(
bookQrcodeVO
.
getSource
(),
"qrcodeScene"
))
{
// 填充渠道中的码(同时纠正码的类型)
// 填充渠道中的码(同时纠正码的类型)
if
(
Objects
.
nonNull
(
qrcodeVOMap
.
get
(
bookQrcodeVO
.
getSceneId
())))
if
(
Objects
.
nonNull
(
qrcodeVOMap
.
get
(
bookQrcodeVO
.
getSceneId
())))
{
BeanUtils
.
copyProperties
(
qrcodeVOMap
.
get
(
bookQrcodeVO
.
getSceneId
()),
bookQrcodeVO
);
BeanUtils
.
copyProperties
(
qrcodeVOMap
.
get
(
bookQrcodeVO
.
getSceneId
()),
bookQrcodeVO
);
if
(
"ali"
.
equals
(
bookQrcodeVO
.
getQrcodeType
()))
{
//渠道中的自建码资源从H5资源页查
Long
sceneId
=
bookQrcodeVO
.
getSceneId
();
BookQrcodeVO
qrcodeVO
=
Optional
.
ofNullable
(
qrcodeVOMap
.
get
(
sceneId
)).
orElse
(
new
BookQrcodeVO
());
// 填充资源列表
if
(
CollUtil
.
isEmpty
(
aliSceneServeMap
)
||
CollUtil
.
isEmpty
(
aliSceneServeMap
.
get
(
sceneId
))){
bookQrcodeVO
.
setMessages
(
new
ArrayList
<>());
continue
;
}
// 填充资源明细
List
<
BookGroupServe
>
bookGroupServes
=
aliSceneServeMap
.
get
(
sceneId
);
List
<
MessageDto
>
messageDtos
=
this
.
getMessageDTOList
(
bookGroupServes
,
bookGroupProductMap
,
isSuperMap
,
bookGroupAppMap
,
qrcodeVO
);
bookQrcodeVO
.
setMessages
(
messageDtos
);
}
}
}
else
if
(
Objects
.
equals
(
bookQrcodeVO
.
getSource
(),
"bookGroup"
))
{
}
else
if
(
Objects
.
equals
(
bookQrcodeVO
.
getSource
(),
"bookGroup"
))
{
// 社群码将ID赋值给BookGroupId
// 社群码将ID赋值给BookGroupId
...
@@ -3010,6 +3031,22 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -3010,6 +3031,22 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
// 填充资源明细
// 填充资源明细
List
<
BookGroupServe
>
bookGroupServes
=
bookGroupServeMap
.
get
(
sceneId
);
List
<
BookGroupServe
>
bookGroupServes
=
bookGroupServeMap
.
get
(
sceneId
);
List
<
MessageDto
>
messageDtos
=
this
.
getMessageDTOList
(
bookGroupServes
,
bookGroupProductMap
,
isSuperMap
,
bookGroupAppMap
,
qrcodeVO
);
bookQrcodeVO
.
setMessages
(
messageDtos
);
}
}
}
catch
(
InterruptedException
|
ExecutionException
e
)
{
LOGGER
.
warn
(
"[fillPageList] 异步获取信息失败"
);
}
}
private
List
<
MessageDto
>
getMessageDTOList
(
List
<
BookGroupServe
>
bookGroupServes
,
Map
<
Long
,
ProductDto
>
bookGroupProductMap
,
Map
<
Long
,
Boolean
>
isSuperMap
,
Map
<
Long
,
AppDto
>
bookGroupAppMap
,
BookQrcodeVO
qrcodeVO
)
{
List
<
MessageDto
>
messageDtos
=
new
ArrayList
<>(
bookGroupServes
.
size
());
List
<
MessageDto
>
messageDtos
=
new
ArrayList
<>(
bookGroupServes
.
size
());
for
(
BookGroupServe
bookGroupServe
:
bookGroupServes
)
{
for
(
BookGroupServe
bookGroupServe
:
bookGroupServes
)
{
MessageDto
messageDto
=
new
MessageDto
();
MessageDto
messageDto
=
new
MessageDto
();
...
@@ -3045,21 +3082,9 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -3045,21 +3082,9 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
String
.
valueOf
(
qrcodeVO
.
getAdviserId
()),
null
);
String
.
valueOf
(
qrcodeVO
.
getAdviserId
()),
null
);
messageDto
.
setUrl
(
serveLink
);
messageDto
.
setUrl
(
serveLink
);
}
}
messageDtos
.
add
(
messageDto
);
messageDtos
.
add
(
messageDto
);
}
}
bookQrcodeVO
.
setMessages
(
messageDtos
);
return
messageDtos
;
}
}
}
catch
(
InterruptedException
|
ExecutionException
e
)
{
LOGGER
.
warn
(
"[fillPageList] 异步获取信息失败"
);
}
}
}
@Override
@Override
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/ResourcePageBiz.java
View file @
23290a6b
package
com
.
pcloud
.
book
.
group
.
biz
;
package
com
.
pcloud
.
book
.
group
.
biz
;
import
com.pcloud.book.group.dto.BookGroupServeDTO
;
import
com.pcloud.book.group.entity.BookGroupServe
;
import
com.pcloud.book.group.entity.BookGroupServe
;
import
com.pcloud.book.group.entity.ResourcePage
;
import
com.pcloud.book.group.entity.ResourcePage
;
import
com.pcloud.book.group.vo.ResourceColumnAndServeVO
;
import
com.pcloud.book.group.vo.ResourceColumnAndServeVO
;
import
com.pcloud.book.group.vo.ResourcePageItemVO
;
import
com.pcloud.book.group.vo.ResourcePageItemVO
;
import
com.pcloud.book.group.vo.ResourcePageOneServe
;
import
com.pcloud.book.group.vo.ResourcePageVO
;
import
com.pcloud.book.group.vo.ResourcePageVO
;
import
com.pcloud.book.group.vo.UpdateResourceColumnVO
;
import
com.pcloud.book.group.vo.UpdateResourceColumnVO
;
import
com.pcloud.book.group.vo.UpdateResourcePageVO
;
import
com.pcloud.book.group.vo.UpdateResourcePageVO
;
...
@@ -152,4 +154,27 @@ public interface ResourcePageBiz {
...
@@ -152,4 +154,27 @@ public interface ResourcePageBiz {
* @return
* @return
*/
*/
ResourcePageVO
getResourcePageByBookIdAndChannelId
(
Long
adviserBookId
,
Long
channelId
);
ResourcePageVO
getResourcePageByBookIdAndChannelId
(
Long
adviserBookId
,
Long
channelId
);
/**
* 查资源配置
* @author:zhuyajie
* @date:2021/4/21 14:42
* * @param null
*/
List
<
BookGroupServe
>
getServeListByBookGroupAndSceneIds
(
List
<
Long
>
bookGroupIds
,
List
<
Long
>
sceneIds
);
/**
* 是否只配了一个应用/作品
* @author:zhuyajie
* @date:2021/4/21 15:09
* * @param null
*/
ResourcePageOneServe
hasOneResource
(
Long
bookGroupId
,
Long
sceneId
);
/**
* 自有码配置的资源列表
* @author:zhuyajie
* @date:2021/4/21 17:52
* * @param null
*/
Map
<
Long
,
List
<
BookGroupServeDTO
>>
mapSceneServeList
(
List
<
Long
>
sceneIds
);
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/ResourcePageBizImpl.java
View file @
23290a6b
...
@@ -27,6 +27,7 @@ import com.pcloud.book.group.dao.ResourcePageColumnDao;
...
@@ -27,6 +27,7 @@ import com.pcloud.book.group.dao.ResourcePageColumnDao;
import
com.pcloud.book.group.dao.ResourcePageDao
;
import
com.pcloud.book.group.dao.ResourcePageDao
;
import
com.pcloud.book.group.dao.ResourcePageItemDao
;
import
com.pcloud.book.group.dao.ResourcePageItemDao
;
import
com.pcloud.book.group.dto.BookGroupDTO
;
import
com.pcloud.book.group.dto.BookGroupDTO
;
import
com.pcloud.book.group.dto.BookGroupServeDTO
;
import
com.pcloud.book.group.entity.BookAppletScene
;
import
com.pcloud.book.group.entity.BookAppletScene
;
import
com.pcloud.book.group.entity.BookGroup
;
import
com.pcloud.book.group.entity.BookGroup
;
import
com.pcloud.book.group.entity.BookGroupServe
;
import
com.pcloud.book.group.entity.BookGroupServe
;
...
@@ -37,6 +38,7 @@ import com.pcloud.book.group.enums.QrcodeJumpType;
...
@@ -37,6 +38,7 @@ import com.pcloud.book.group.enums.QrcodeJumpType;
import
com.pcloud.book.group.tools.SendWeixinRequestTools
;
import
com.pcloud.book.group.tools.SendWeixinRequestTools
;
import
com.pcloud.book.group.vo.ResourceColumnAndServeVO
;
import
com.pcloud.book.group.vo.ResourceColumnAndServeVO
;
import
com.pcloud.book.group.vo.ResourcePageItemVO
;
import
com.pcloud.book.group.vo.ResourcePageItemVO
;
import
com.pcloud.book.group.vo.ResourcePageOneServe
;
import
com.pcloud.book.group.vo.ResourcePageVO
;
import
com.pcloud.book.group.vo.ResourcePageVO
;
import
com.pcloud.book.group.vo.UpdateResourceColumnVO
;
import
com.pcloud.book.group.vo.UpdateResourceColumnVO
;
import
com.pcloud.book.group.vo.UpdateResourcePageVO
;
import
com.pcloud.book.group.vo.UpdateResourcePageVO
;
...
@@ -1352,6 +1354,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
...
@@ -1352,6 +1354,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
return
resourcePageVO
;
return
resourcePageVO
;
}
}
private
String
getDefaultBigPic
(
String
productTypeCode
)
{
private
String
getDefaultBigPic
(
String
productTypeCode
)
{
if
(
StringUtil
.
isEmpty
(
productTypeCode
))
{
if
(
StringUtil
.
isEmpty
(
productTypeCode
))
{
return
null
;
return
null
;
...
@@ -1368,4 +1371,94 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
...
@@ -1368,4 +1371,94 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
return
null
;
return
null
;
}
}
@Override
public
List
<
BookGroupServe
>
getServeListByBookGroupAndSceneIds
(
List
<
Long
>
bookGroupIds
,
List
<
Long
>
sceneIds
)
{
List
<
BookGroupServe
>
list
=
new
ArrayList
<>();
List
<
BookGroupServe
>
bookGroupServeList
=
new
ArrayList
<>();
if
(!
ListUtils
.
isEmpty
(
bookGroupIds
))
{
bookGroupServeList
=
resourcePageItemDao
.
getServeListByBookGroupIds
(
bookGroupIds
);
}
List
<
BookGroupServe
>
sceneServeList
=
new
ArrayList
<>();
if
(!
ListUtils
.
isEmpty
(
sceneIds
))
{
sceneServeList
=
resourcePageItemDao
.
getServeListBySceneIds
(
sceneIds
);
}
list
.
addAll
(
ListUtils
.
isEmpty
(
bookGroupServeList
)
?
new
ArrayList
<>()
:
bookGroupServeList
);
list
.
addAll
(
ListUtils
.
isEmpty
(
sceneServeList
)
?
new
ArrayList
<>()
:
sceneServeList
);
return
list
;
}
@Override
public
ResourcePageOneServe
hasOneResource
(
Long
bookGroupId
,
Long
sceneId
)
{
ResourcePageOneServe
pageOneServe
=
new
ResourcePageOneServe
();
pageOneServe
.
setBookGroupId
(
bookGroupId
);
pageOneServe
.
setSceneId
(
sceneId
);
pageOneServe
.
setOneServe
(
false
);
ResourcePage
resourcePage
=
null
;
if
(
null
!=
bookGroupId
)
{
resourcePage
=
resourcePageDao
.
getByBookGroupId
(
bookGroupId
);
BookGroupDTO
bookGroupDTO
=
bookGroupDao
.
getDTOById
(
bookGroupId
);
pageOneServe
.
setJumpType
(
null
==
bookGroupDTO
?
null
:
bookGroupDTO
.
getJumpType
());
}
else
if
(
null
!=
sceneId
)
{
resourcePage
=
resourcePageDao
.
getBySceneId
(
sceneId
);
}
if
(
null
!=
resourcePage
)
{
Long
resourcePageId
=
resourcePage
.
getId
();
pageOneServe
.
setResourcePageId
(
resourcePageId
);
//只配置了1个应用作品,且不开启小睿
ResourcePageItemVO
itemVO
=
resourcePageItemDao
.
checkOneServeItemByPageId
(
resourcePageId
);
if
(
null
!=
itemVO
)
{
pageOneServe
.
setOneServe
(
true
);
fillAppProductServe
(
Arrays
.
asList
(
itemVO
),
true
);
pageOneServe
.
setServeId
(
itemVO
.
getServeId
());
pageOneServe
.
setServeType
(
itemVO
.
getServeType
());
pageOneServe
.
setLinkUrl
(
itemVO
.
getLinkUrl
());
pageOneServe
.
setTypeCode
(
itemVO
.
getTypeCode
());
pageOneServe
.
setResultUrl
(
itemVO
.
getResultUrl
());
pageOneServe
.
setHasThirdLink
(
itemVO
.
getHasThirdLink
());
pageOneServe
.
setServeName
(
itemVO
.
getServeName
());
pageOneServe
.
setPrice
(
itemVO
.
getPrice
());
}
}
return
pageOneServe
;
}
@Override
public
Map
<
Long
,
List
<
BookGroupServeDTO
>>
mapSceneServeList
(
List
<
Long
>
sceneIds
)
{
Map
<
Long
,
List
<
BookGroupServeDTO
>>
map
=
new
HashMap
<>();
if
(
ListUtils
.
isEmpty
(
sceneIds
))
{
return
map
;
}
List
<
BookGroupServe
>
sceneServeList
=
resourcePageItemDao
.
getServeListBySceneIds
(
sceneIds
);
if
(
ListUtils
.
isEmpty
(
sceneServeList
))
{
return
map
;
}
List
<
ResourcePageItemVO
>
itemVOS
=
new
ArrayList
<>();
sceneServeList
.
stream
().
forEach
(
s
->{
ResourcePageItemVO
itemVO
=
new
ResourcePageItemVO
();
itemVO
.
setServeId
(
s
.
getServeId
());
itemVO
.
setServeType
(
s
.
getServeType
());
itemVO
.
setLinkUrl
(
s
.
getServeUrl
());
itemVO
.
setTypeCode
(
s
.
getTypeCode
());
itemVO
.
setSceneId
(
s
.
getSceneId
());
itemVOS
.
add
(
itemVO
);
});
fillAppProductServe
(
itemVOS
,
false
);
List
<
BookGroupServeDTO
>
serveDTOS
=
new
ArrayList
<>();
for
(
ResourcePageItemVO
itemVO:
itemVOS
)
{
BookGroupServeDTO
serveDTO
=
new
BookGroupServeDTO
();
serveDTO
.
setServeId
(
itemVO
.
getServeId
());
serveDTO
.
setServeType
(
itemVO
.
getServeType
());
serveDTO
.
setServeUrl
(
itemVO
.
getLinkUrl
());
serveDTO
.
setTypeCode
(
itemVO
.
getTypeCode
());
serveDTO
.
setServeName
(
itemVO
.
getServeName
());
serveDTO
.
setPicUrl
(
itemVO
.
getServePic
());
serveDTO
.
setTransverseImg
(
itemVO
.
getTransverseImg
());
serveDTO
.
setTypeName
(
itemVO
.
getTypeName
());
serveDTO
.
setSceneId
(
itemVO
.
getSceneId
());
serveDTOS
.
add
(
serveDTO
);
}
map
=
serveDTOS
.
stream
().
collect
(
Collectors
.
groupingBy
(
BookGroupServeDTO:
:
getSceneId
));
return
map
;
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/ResourcePageItemDao.java
View file @
23290a6b
package
com
.
pcloud
.
book
.
group
.
dao
;
package
com
.
pcloud
.
book
.
group
.
dao
;
import
com.pcloud.book.group.dto.BookGroupServeDTO
;
import
com.pcloud.book.group.entity.BookGroupServe
;
import
com.pcloud.book.group.entity.BookGroupServe
;
import
com.pcloud.book.group.entity.ResourcePageItem
;
import
com.pcloud.book.group.entity.ResourcePageItem
;
import
com.pcloud.book.group.vo.ResourcePageItemVO
;
import
com.pcloud.book.group.vo.ResourcePageItemVO
;
...
@@ -57,4 +58,20 @@ public interface ResourcePageItemDao extends BaseDao<ResourcePageItem>{
...
@@ -57,4 +58,20 @@ public interface ResourcePageItemDao extends BaseDao<ResourcePageItem>{
void
deleteByPageId
(
Long
resourcePageId
);
void
deleteByPageId
(
Long
resourcePageId
);
List
<
BookGroupServe
>
getServeListByBookGroupIds
(
List
<
Long
>
bookGroupIds
);
List
<
BookGroupServe
>
getServeListByBookGroupIds
(
List
<
Long
>
bookGroupIds
);
/**
* 查应用作品资源
* @author:zhuyajie
* @date:2021/4/21 10:11
* * @param null
*/
List
<
BookGroupServe
>
getServeListBySceneIds
(
List
<
Long
>
sceneIds
);
/**
* 检查是否只有一个应用/作品
* @author:zhuyajie
* @date:2021/4/21 15:29
* * @param null
*/
ResourcePageItemVO
checkOneServeItemByPageId
(
Long
resourcePageId
);
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/ResourcePageItemDaoImpl.java
View file @
23290a6b
...
@@ -61,4 +61,14 @@ public class ResourcePageItemDaoImpl extends BaseDaoImpl<ResourcePageItem> imple
...
@@ -61,4 +61,14 @@ public class ResourcePageItemDaoImpl extends BaseDaoImpl<ResourcePageItem> imple
public
List
<
BookGroupServe
>
getServeListByBookGroupIds
(
List
<
Long
>
bookGroupIds
)
{
public
List
<
BookGroupServe
>
getServeListByBookGroupIds
(
List
<
Long
>
bookGroupIds
)
{
return
getSessionTemplate
().
selectList
(
getStatement
(
"getServeListByBookGroupIds"
),
bookGroupIds
);
return
getSessionTemplate
().
selectList
(
getStatement
(
"getServeListByBookGroupIds"
),
bookGroupIds
);
}
}
@Override
public
List
<
BookGroupServe
>
getServeListBySceneIds
(
List
<
Long
>
sceneIds
)
{
return
getSessionTemplate
().
selectList
(
getStatement
(
"getServeListBySceneIds"
),
sceneIds
);
}
@Override
public
ResourcePageItemVO
checkOneServeItemByPageId
(
Long
resourcePageId
)
{
return
getSessionTemplate
().
selectOne
(
getStatement
(
"checkOneServeItemByPageId"
),
resourcePageId
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/entity/BookGroupServe.java
View file @
23290a6b
...
@@ -71,4 +71,6 @@ public class BookGroupServe extends BaseEntity {
...
@@ -71,4 +71,6 @@ public class BookGroupServe extends BaseEntity {
@ApiModelProperty
(
"作者id"
)
@ApiModelProperty
(
"作者id"
)
private
Long
merchantId
;
private
Long
merchantId
;
private
Long
sceneId
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/impl/ResourcePageFacade.java
View file @
23290a6b
...
@@ -159,4 +159,11 @@ public class ResourcePageFacade {
...
@@ -159,4 +159,11 @@ public class ResourcePageFacade {
resourcePageBiz
.
batchUpdateResourceQrcode
(
qrcodeIdList
,
qrcodeType
);
resourcePageBiz
.
batchUpdateResourceQrcode
(
qrcodeIdList
,
qrcodeType
);
return
new
ResponseDto
<>();
return
new
ResponseDto
<>();
}
}
@ApiOperation
(
"是否只有一个资源"
)
@GetMapping
(
"hasOneResource"
)
public
ResponseDto
<?>
hasOneResource
(
@RequestParam
(
value
=
"bookGroupId"
,
required
=
false
)
Long
bookGroupId
,
@RequestParam
(
value
=
"sceneId"
,
required
=
false
)
Long
sceneId
)
{
return
new
ResponseDto
<>(
resourcePageBiz
.
hasOneResource
(
bookGroupId
,
sceneId
));
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/service/impl/BookGroupServiceImpl.java
View file @
23290a6b
...
@@ -2,6 +2,7 @@ package com.pcloud.book.group.service.impl;
...
@@ -2,6 +2,7 @@ package com.pcloud.book.group.service.impl;
import
com.pcloud.book.group.biz.BookGroupAppBiz
;
import
com.pcloud.book.group.biz.BookGroupAppBiz
;
import
com.pcloud.book.group.biz.BookGroupBiz
;
import
com.pcloud.book.group.biz.BookGroupBiz
;
import
com.pcloud.book.group.biz.ResourcePageBiz
;
import
com.pcloud.book.group.dto.AltAndCountDTO
;
import
com.pcloud.book.group.dto.AltAndCountDTO
;
import
com.pcloud.book.group.dto.BookAppletSceneDTO
;
import
com.pcloud.book.group.dto.BookAppletSceneDTO
;
import
com.pcloud.book.group.dto.BookGroup4CatalogDTO
;
import
com.pcloud.book.group.dto.BookGroup4CatalogDTO
;
...
@@ -68,6 +69,8 @@ public class BookGroupServiceImpl implements BookGroupService {
...
@@ -68,6 +69,8 @@ public class BookGroupServiceImpl implements BookGroupService {
private
BookGroupBiz
bookGroupBiz
;
private
BookGroupBiz
bookGroupBiz
;
@Autowired
@Autowired
private
BookGroupAppBiz
bookGroupAppBiz
;
private
BookGroupAppBiz
bookGroupAppBiz
;
@Autowired
private
ResourcePageBiz
resourcePageBiz
;
/**
/**
* 获取社群书基本信息
* 获取社群书基本信息
...
@@ -462,4 +465,10 @@ public class BookGroupServiceImpl implements BookGroupService {
...
@@ -462,4 +465,10 @@ public class BookGroupServiceImpl implements BookGroupService {
@RequestParam
(
value
=
"rank"
,
required
=
false
)
Integer
rank
)
{
@RequestParam
(
value
=
"rank"
,
required
=
false
)
Integer
rank
)
{
return
ResponseHandleUtil
.
toResponse
(
bookGroupBiz
.
listBookGroup4BookCatalog
(
bookId
,
adviserId
,
channelId
,
name
,
rank
));
return
ResponseHandleUtil
.
toResponse
(
bookGroupBiz
.
listBookGroup4BookCatalog
(
bookId
,
adviserId
,
channelId
,
name
,
rank
));
}
}
@Override
@PostMapping
(
"mapSceneServeList"
)
public
ResponseEntity
<
ResponseDto
<
Map
<
Long
,
List
<
BookGroupServeDTO
>>>>
mapSceneServeList
(
@RequestBody
List
<
Long
>
sceneIds
)
{
return
ResponseHandleUtil
.
toResponse
(
resourcePageBiz
.
mapSceneServeList
(
sceneIds
));
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/vo/ResourcePageItemVO.java
View file @
23290a6b
...
@@ -86,4 +86,7 @@ public class ResourcePageItemVO extends BaseDto{
...
@@ -86,4 +86,7 @@ public class ResourcePageItemVO extends BaseDto{
private
GroupActivity4AppletDTO
activity4AppletDTO
;
private
GroupActivity4AppletDTO
activity4AppletDTO
;
@ApiModelProperty
(
"第三方资源"
)
@ApiModelProperty
(
"第三方资源"
)
private
AppletThirdResources
appletThirdResources
;
private
AppletThirdResources
appletThirdResources
;
private
Long
sceneId
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/vo/ResourcePageOneServe.java
0 → 100644
View file @
23290a6b
package
com
.
pcloud
.
book
.
group
.
vo
;
import
com.pcloud.common.dto.BaseDto
;
import
lombok.Data
;
/**
* @ClassName com.pcloud.book.group.vo.ResourcePageOneServe
* @Author zhuyajie
* @Description 只有一个资源
* @Date 2021/4/21 15:06
* @Version 1.0
**/
@Data
public
class
ResourcePageOneServe
extends
BaseDto
{
private
Long
bookGroupId
;
private
Long
sceneId
;
private
Long
resourcePageId
;
/**
* 资源id
*/
private
Long
serveId
;
/**
* 资源类型
*/
private
String
serveType
;
/**
* 链接url
*/
private
String
linkUrl
;
/**
* 资源类型
*/
private
String
typeCode
;
/**
* 跳转结果链接
*/
private
String
resultUrl
;
/**
* 是否只有一个资源
*/
private
Boolean
oneServe
;
private
Boolean
hasThirdLink
;
private
String
serveName
;
private
Double
price
;
private
Integer
jumpType
;
}
pcloud-service-book/src/main/resources/mapper/group/ResourcePageItemDao.xml
View file @
23290a6b
...
@@ -142,7 +142,7 @@
...
@@ -142,7 +142,7 @@
p.book_group_id = #{bookGroupId}
p.book_group_id = #{bookGroupId}
AND i.serve_type IN ('APP', 'PRODUCT')
AND i.serve_type IN ('APP', 'PRODUCT')
ORDER BY
ORDER BY
c.column_seq ASC
c.column_seq ASC
, i.seq_num ASC, i.id ASC
</select>
</select>
<delete
id=
"deleteByPageId"
parameterType=
"long"
>
<delete
id=
"deleteByPageId"
parameterType=
"long"
>
...
@@ -167,7 +167,47 @@
...
@@ -167,7 +167,47 @@
</foreach>
</foreach>
AND i.serve_type IN ('APP', 'PRODUCT')
AND i.serve_type IN ('APP', 'PRODUCT')
ORDER BY
ORDER BY
c.column_seq ASC
c.column_seq ASC
, i.seq_num ASC, i.id ASC
</select>
</select>
<select
id=
"getServeListBySceneIds"
parameterType=
"list"
resultType=
"com.pcloud.book.group.entity.BookGroupServe"
>
SELECT
i.serve_id serveId,
i.serve_type serveType,
i.link_url serveUrl,
p.create_user createUser,
i.type_code typeCode,
p.scene_id sceneId
FROM
resource_page_item i
LEFT JOIN resource_page p ON i.resource_page_id = p.id
LEFT JOIN resource_page_column c ON i.resource_page_column_id = c.id
WHERE
p.scene_id IN
<foreach
collection=
"list"
index=
"index"
separator=
","
open=
"("
close=
")"
item=
"item"
>
#{item}
</foreach>
AND i.serve_type IN ('APP', 'PRODUCT')
ORDER BY
c.column_seq ASC, i.seq_num ASC, i.id ASC
</select>
<!--只配置了1个应用作品,且不开启小睿-->
<select
id=
"checkOneServeItemByPageId"
resultType=
"com.pcloud.book.group.vo.ResourcePageItemVO"
parameterType=
"map"
>
SELECT
i.serve_id serveId,
i.serve_type serveType,
i.link_url linkUrl,
i.type_code typeCode,
i.create_user createUser
FROM
resource_page p
LEFT JOIN resource_page_item i ON i.resource_page_id = p.id
WHERE
resource_page_id = #{resourcePageId}
AND p.open_rays = 0
HAVING
COUNT(i.id) = 1
AND i.serve_type IN ("APP", "PRODUCT")
</select>
</mapper>
</mapper>
\ No newline at end of file
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