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
a3d6b3c0
Commit
a3d6b3c0
authored
Dec 14, 2020
by
tc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug[none]优化首页接口
parent
b770f792
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
200 additions
and
27 deletions
+200
-27
ServeCollectBiz.java
...main/java/com/pcloud/book/applet/biz/ServeCollectBiz.java
+3
-0
ServeCollectBizImpl.java
.../com/pcloud/book/applet/biz/impl/ServeCollectBizImpl.java
+5
-0
ServeCollectDao.java
...main/java/com/pcloud/book/applet/dao/ServeCollectDao.java
+3
-0
ServeCollectDaoImpl.java
.../com/pcloud/book/applet/dao/impl/ServeCollectDaoImpl.java
+6
-0
BookGroupBiz.java
...src/main/java/com/pcloud/book/group/biz/BookGroupBiz.java
+2
-0
BookGroupBizImpl.java
...java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
+86
-0
RightsSettingBiz.java
...a/com/pcloud/book/rightsSetting/biz/RightsSettingBiz.java
+1
-1
RightsSettingBizImpl.java
...oud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
+78
-23
RightsSettingFacede.java
...pcloud/book/rightsSetting/facade/RightsSettingFacede.java
+1
-1
application.yml
pcloud-service-book/src/main/resources/application.yml
+1
-1
AppletNews.xml
...vice-book/src/main/resources/mapper/applet/AppletNews.xml
+1
-1
ServeCollect.Mapper.xml
.../src/main/resources/mapper/applet/ServeCollect.Mapper.xml
+13
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/ServeCollectBiz.java
View file @
a3d6b3c0
...
...
@@ -83,4 +83,6 @@ public interface ServeCollectBiz {
* @return
*/
List
<
ServeCollectDTO
>
getList4Collect
(
List
<
ServeCollectDTO
>
serveCollects
);
List
<
ServeCollect
>
getList4RightsSettingByWechatUserId
(
Long
wechatUserId
);
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/impl/ServeCollectBizImpl.java
View file @
a3d6b3c0
...
...
@@ -333,6 +333,11 @@ public class ServeCollectBizImpl implements ServeCollectBiz {
}
@Override
public
List
<
ServeCollect
>
getList4RightsSettingByWechatUserId
(
Long
wechatUserId
)
{
return
serveCollectDao
.
getList4RightsSettingByWechatUserId
(
wechatUserId
);
}
@Override
public
List
<
Long
>
getAllCollect
(
Long
wechatUserId
)
{
return
serveCollectDao
.
getAllCollect
(
wechatUserId
);
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/applet/dao/ServeCollectDao.java
View file @
a3d6b3c0
...
...
@@ -23,4 +23,6 @@ public interface ServeCollectDao extends BaseDao<ServeCollect> {
List
<
Long
>
getAllCollect
(
Long
wechatUserId
);
List
<
ServeCollectDTO
>
getList4Collect
(
List
<
ServeCollectDTO
>
serveCollects
);
List
<
ServeCollect
>
getList4RightsSettingByWechatUserId
(
Long
wechatUserId
);
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/dao/impl/ServeCollectDaoImpl.java
View file @
a3d6b3c0
...
...
@@ -32,6 +32,12 @@ public class ServeCollectDaoImpl extends BaseDaoImpl<ServeCollect> implements Se
return
getSessionTemplate
().
selectList
(
getStatement
(
"getList4RightsSetting"
),
serveCollects
);
}
@Override
public
List
<
ServeCollect
>
getList4RightsSettingByWechatUserId
(
Long
wechatUserId
)
{
return
getSessionTemplate
().
selectList
(
getStatement
(
"getList4RightsSettingByWechatUserId"
),
wechatUserId
);
}
@Override
public
List
<
Long
>
getAllCollect
(
Long
wechatUserId
)
{
return
getSessionTemplate
().
selectList
(
getStatement
(
"getAllCollect"
),
wechatUserId
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/BookGroupBiz.java
View file @
a3d6b3c0
...
...
@@ -1006,4 +1006,6 @@ public interface BookGroupBiz {
*社群码下载选择样式
*/
BackgroundGroupQrcodeDTO
getBackgroundGroupQr
(
BackgroundGroupQrcodeDTO
backgroundGroupQrcodeDTO
);
List
<
BookServeDTO
>
getBookAndBookGroupServeIdsFive
(
Long
adviserId
,
Long
bookId
,
Long
channelId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
View file @
a3d6b3c0
...
...
@@ -5204,7 +5204,93 @@ public class BookGroupBizImpl implements BookGroupBiz {
}
@Override
public
List
<
BookServeDTO
>
getBookAndBookGroupServeIdsFive
(
Long
adviserId
,
Long
bookId
,
Long
channelId
)
{
List
<
BookServeDTO
>
serveDTOList
=
new
ArrayList
<>();
BookGroupDTO
bookGroupDTO
=
bookGroupDao
.
getDTOByBookId
(
bookId
,
channelId
,
adviserId
);
List
<
Long
>
appIds
=
new
ArrayList
<>();
List
<
Long
>
productIds
=
new
ArrayList
<>();
AccountSettingDto
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
channelId
);
if
(
null
==
accountSettingDto
){
return
new
ArrayList
<>();
}
//先排纸书二维码资源,后排社群书资源,张文庆
//现代纸书二维码配置资源
BookServeParamVO
serveParamVO
=
new
BookServeParamVO
();
serveParamVO
.
setAdviserId
(
adviserId
);
serveParamVO
.
setBookId
(
bookId
);
serveParamVO
.
setChannelId
(
channelId
);
List
<
BookServeVO
>
bookServeVOS
=
qrcodeSceneConsr
.
listBookServeIds
(
serveParamVO
);
if
(!
ListUtils
.
isEmpty
(
bookServeVOS
))
{
for
(
BookServeVO
bookServeVO
:
bookServeVOS
)
{
if
(
serveDTOList
.
size
()>=
5
){
break
;
}
Long
serveId
=
bookServeVO
.
getServeId
();
BookServeDTO
bookServeDTO
=
new
BookServeDTO
();
bookServeDTO
.
setTypeCode
(
bookServeVO
.
getTypeCode
());
bookServeDTO
.
setFromType
(
bookServeVO
.
getFromType
());
bookServeDTO
.
setFromTypeName
(
bookServeVO
.
getFromTypeName
());
String
url
=
SendWeixinRequestTools
.
splitUrl
(
accountSettingDto
,
bookServeVO
.
getUrl
());
if
(
AppAndProductTypeEnum
.
APP
.
value
.
equals
(
bookServeVO
.
getTypeCode
())
&&
!
appIds
.
contains
(
serveId
))
{
bookServeDTO
.
setServeId
(
serveId
);
bookServeDTO
.
setServeType
(
bookServeVO
.
getTypeCode
());
bookServeDTO
.
setUrl
(
url
);
serveDTOList
.
add
(
bookServeDTO
);
appIds
.
add
(
serveId
);
}
else
if
(
AppAndProductTypeEnum
.
PRODUCT
.
value
.
equals
(
bookServeVO
.
getTypeCode
())
&&
!
productIds
.
contains
(
serveId
))
{
bookServeDTO
.
setServeId
(
serveId
);
bookServeDTO
.
setServeType
(
bookServeVO
.
getTypeCode
());
bookServeDTO
.
setUrl
(
url
);
serveDTOList
.
add
(
bookServeDTO
);
productIds
.
add
(
serveId
);
}
}
}
if
(
null
!=
bookGroupDTO
&&
serveDTOList
.
size
()<
5
)
{
//有社群书
//社群书配置资源
List
<
BookGroupServe
>
bookGroupServes
=
bookGroupServeDao
.
getListByBookGroupId
(
bookGroupDTO
.
getId
());
if
(!
ListUtils
.
isEmpty
(
bookGroupServes
))
{
for
(
BookGroupServe
bookGroupServe
:
bookGroupServes
)
{
if
(
serveDTOList
.
size
()>=
5
){
break
;
}
BookServeDTO
bookServeDTO
=
new
BookServeDTO
();
BeanUtils
.
copyProperties
(
bookGroupServe
,
bookServeDTO
);
String
url
=
SendWeixinRequestTools
.
splitUrl
(
accountSettingDto
,
bookGroupServe
.
getServeUrl
());
bookServeDTO
.
setUrl
(
url
);
bookServeDTO
.
setTypeCode
(
bookServeDTO
.
getServeType
());
bookServeDTO
.
setFromType
(
bookGroupServe
.
getTypeCode
());
bookServeDTO
.
setFromTypeName
(
bookGroupServe
.
getFromType
());
Long
serveId
=
bookGroupServe
.
getServeId
();
if
(
AppAndProductTypeEnum
.
APP
.
value
.
equals
(
bookServeDTO
.
getServeType
())
&&
!
appIds
.
contains
(
serveId
))
{
serveDTOList
.
add
(
bookServeDTO
);
appIds
.
add
(
serveId
);
}
else
if
(
AppAndProductTypeEnum
.
PRODUCT
.
value
.
equals
(
bookServeDTO
.
getServeType
())
&&
!
productIds
.
contains
(
serveId
)){
serveDTOList
.
add
(
bookServeDTO
);
productIds
.
add
(
serveId
);
}
}
}
}
return
serveDTOList
;
}
@Override
public
List
<
BookServeDTO
>
getBookAndBookGroupServeIds
(
Long
adviserId
,
Long
bookId
,
Long
channelId
)
{
List
<
BookServeDTO
>
result
=
new
ArrayList
();
String
key
=
"getBookAndBookGroupServeIds"
+
adviserId
+
"_"
+
bookId
+
"_"
+
channelId
;
if
(
JedisClusterUtils
.
exists
(
key
)){
result
=
JedisClusterUtils
.
getJsonList
(
key
,
BookServeDTO
.
class
);
}
else
{
result
=
getBookServes
(
adviserId
,
bookId
,
channelId
);
JedisClusterUtils
.
setJsonList
(
key
,
result
,
300
);
}
return
result
;
}
private
List
<
BookServeDTO
>
getBookServes
(
Long
adviserId
,
Long
bookId
,
Long
channelId
)
{
List
<
BookServeDTO
>
serveDTOList
=
new
ArrayList
<>();
BookGroupDTO
bookGroupDTO
=
bookGroupDao
.
getDTOByBookId
(
bookId
,
channelId
,
adviserId
);
List
<
Long
>
appIds
=
new
ArrayList
<>();
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/biz/RightsSettingBiz.java
View file @
a3d6b3c0
...
...
@@ -120,7 +120,7 @@ public interface RightsSettingBiz {
FillRightsSettingAppletsDTO
getFillRightsSettingApplets
(
Long
rightsSettingId
,
Long
wechatUserId
,
Long
rightsClassifyId
,
Integer
top
,
Long
bookId
,
Long
officialAccountsId
);
List
<
RightsItemGroup
>
getRightsItemGroups
(
Long
rightsSettingId
,
Long
adviserId
,
Long
bookId
,
Long
channelId
,
Boolean
removeCanNotBuy
,
Integer
readType
,
Long
wechatUserId
);
List
<
RightsItemGroup
>
getRightsItemGroups
(
Long
rightsSettingId
,
Long
adviserId
,
Long
bookId
,
Long
channelId
,
Boolean
removeCanNotBuy
,
Integer
readType
,
Long
wechatUserId
,
boolean
homePage
);
RightsSettingDto
getRightSettingByBookId
(
Long
bookId
,
Long
adviserId
,
Long
channelId
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
View file @
a3d6b3c0
...
...
@@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollUtil;
import
cn.hutool.core.math.MathUtil
;
import
cn.hutool.core.util.RandomUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.google.common.collect.Lists
;
import
com.pcloud.appcenter.app.dto.AppDto
;
import
com.pcloud.appcenter.assist.dto.AssistTempletDTO
;
...
...
@@ -141,6 +142,9 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Random
;
import
java.util.concurrent.Callable
;
import
java.util.concurrent.ExecutionException
;
import
java.util.concurrent.FutureTask
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
...
...
@@ -149,6 +153,7 @@ import java.util.stream.Collectors;
@Slf4j
public
class
RightsSettingBizImpl
implements
RightsSettingBiz
{
@Autowired
private
RightsSettingDAO
rightsSettingDAO
;
@Autowired
...
...
@@ -898,7 +903,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
}
}
rightsSettingNow
.
setRightsSettingTitles
(
rightsSettingTitles
);
rightsSettingNow
.
setRightsItemGroups
(
getRightsItemGroups
(
rightsSetting
.
getId
(),
null
,
null
,
null
,
false
,
null
,
null
));
rightsSettingNow
.
setRightsItemGroups
(
getRightsItemGroups
(
rightsSetting
.
getId
(),
null
,
null
,
null
,
false
,
null
,
null
,
false
));
rightsSettingNow
.
setServesTitle
(
servesTitle
);
rightsSetting
.
setRightsSettingNow
(
rightsSettingNow
);
List
<
RightsSettingTitle
>
newRightsSettingTitles
=
new
ArrayList
<>
(
rightsSettingTitles
);
...
...
@@ -1498,12 +1503,35 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
Map
<
Long
,
GroupActivity4AppletDTO
>
groupDtoMap
=
new
HashMap
<>();
Map
<
Long
,
AppletNewsDTO
>
newsDtoMap
=
new
HashMap
<>();
List
<
RightsNowItem
>
list_remove
=
new
ArrayList
<>();
//存储已经删除群的群分类; 精选文章类型并且跳转链接包含qrcode.5rs.me
FutureTask
<
Map
<
Long
,
ProductDto
>>
task
=
null
;
FutureTask
<
Map
<
Long
,
AppDto
>>
task2
=
null
;
if
(!
ListUtils
.
isEmpty
(
productIds
))
{
productDtoMap
=
productConsr
.
getProBasesByIds
(
productIds
);
Callable
<
Map
<
Long
,
ProductDto
>>
callable
=
()
->
productConsr
.
getProBasesByIds
(
productIds
);
task
=
new
FutureTask
<>(
callable
);
new
Thread
(
task
).
start
();
}
if
(!
ListUtils
.
isEmpty
(
appIds
))
{
appDtoMap
=
appConsr
.
mapByIds4AuditPass
(
appIds
);
Callable
<
Map
<
Long
,
AppDto
>>
callable
=
()
->
appConsr
.
mapByIds4AuditPass
(
appIds
);
task2
=
new
FutureTask
<>(
callable
);
new
Thread
(
task2
).
start
();
}
if
(
task
!=
null
)
{
try
{
productDtoMap
=
task
.
get
();
}
catch
(
InterruptedException
e
)
{
log
.
error
(
"获取商品失败fillProductAndApp"
);
}
catch
(
ExecutionException
e
)
{
log
.
error
(
"获取商品失败fillProductAndApp"
);
}
}
if
(
task2
!=
null
)
{
try
{
appDtoMap
=
task2
.
get
();
}
catch
(
InterruptedException
e
)
{
log
.
error
(
"获取应用失败fillProductAndApp"
);
}
catch
(
ExecutionException
e
)
{
log
.
error
(
"获取应用失败fillProductAndApp"
);
}
}
if
(!
ListUtils
.
isEmpty
(
groupIds
))
{
groupDtoMap
=
pcloudGroupActivityBiz
.
getByIds4Now
(
groupIds
);
...
...
@@ -1511,6 +1539,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
if
(!
ListUtils
.
isEmpty
(
appletNewsId
))
{
newsDtoMap
=
appletNewsBiz
.
getByIds
(
appletNewsId
);
}
Map
<
Long
,
AccountSettingDto
>
offMap
=
new
HashMap
<>();
for
(
RightsNowItem
item
:
nowItems
)
{
Integer
type
=
item
.
getType
();
if
(
RightsNowItemTypeNew
.
ONLINE_COURSE
.
value
.
equals
(
type
)
...
...
@@ -1542,7 +1571,12 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
}
}
if
(
null
!=
channelId
)
{
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
channelId
);
accountSettingDto
=
offMap
.
get
(
channelId
);
if
(
accountSettingDto
==
null
){
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
channelId
);
offMap
.
put
(
channelId
,
accountSettingDto
);
}
// accountSettingDto = qrcodeSceneConsr.getWechatInfo(channelId);
if
(
null
==
accountSettingDto
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"运营平台未配置公众号"
);
}
...
...
@@ -1572,7 +1606,11 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
item
.
setServeTypeCode
(
appDto
.
getTypeCode
());
item
.
setServeTypeName
(
appDto
.
getTypeName
());
item
.
setTransverseImg
(
appDto
.
getTransverseImg
());
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
appDto
.
getChannelId
());
accountSettingDto
=
offMap
.
get
(
appDto
.
getChannelId
());
if
(
accountSettingDto
==
null
){
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
appDto
.
getChannelId
());
offMap
.
put
(
appDto
.
getChannelId
(),
accountSettingDto
);
}
if
(
null
==
accountSettingDto
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"运营平台未配置公众号"
);
}
...
...
@@ -2377,7 +2415,16 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
}
// 获取配套资料
if
(
RightsNowItemTypeNew
.
SERVES
.
value
.
equals
(
type
))
{
RightsSetting
rightsSetting4Serves
=
setServe
(
rightsSetting
,
adviserId
,
bookId
,
channelId
,
readType
);
String
key
=
"SERVER_TYPE:"
+
rightsSettingId
+
"_"
+
adviserId
+
"_"
+
bookId
+
"_"
+
channelId
+
"_"
+
readType
;
RightsSetting
rightsSetting4Serves
;
if
(
JedisClusterUtils
.
exists
(
key
)){
String
s
=
JedisClusterUtils
.
get
(
key
);
rightsSetting4Serves
=
JSON
.
parseObject
(
s
,
RightsSetting
.
class
);
}
else
{
rightsSetting4Serves
=
setServe
(
rightsSetting
,
adviserId
,
bookId
,
channelId
,
readType
);
JedisClusterUtils
.
set
(
key
,
JSON
.
toJSONString
(
rightsSetting4Serves
),
10
*
60
);
}
// rightsSetting4Serves = setServe(rightsSetting, adviserId, bookId, channelId, readType);
fillCollect
(
wechatUserId
,
rightsSetting4Serves
,
type
);
}
// 获取抽奖权益
...
...
@@ -2473,15 +2520,16 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
if
(
ListUtils
.
isEmpty
(
rightsNowItems
))
{
return
true
;
}
List
<
ServeCollect
>
serveCollects
=
new
ArrayList
<>();
rightsNowItems
.
forEach
(
e
->
{
ServeCollect
serveCollect
=
new
ServeCollect
();
serveCollect
.
setWechatUserId
(
wechatUserId
);
serveCollect
.
setServeId
(
e
.
getServeId
());
serveCollect
.
setServeType
(
Objects
.
equals
(
e
.
getServeType
(),
AppAndProductTypeEnum
.
PRODUCT
.
value
)
?
AppletRecordTypeEnum
.
PRODUCT
.
value
:
AppletRecordTypeEnum
.
APP
.
value
);
serveCollects
.
add
(
serveCollect
);
});
List
<
ServeCollect
>
serveCollectList
=
serveCollectBiz
.
getList4RightsSetting
(
serveCollects
);
// List<ServeCollect> serveCollects = new ArrayList<>();
// rightsNowItems.forEach(e -> {
// ServeCollect serveCollect = new ServeCollect();
// serveCollect.setWechatUserId(wechatUserId);
// serveCollect.setServeId(e.getServeId());
// serveCollect.setServeType(Objects.equals(e.getServeType(), AppAndProductTypeEnum.PRODUCT.value) ? AppletRecordTypeEnum.PRODUCT.value : AppletRecordTypeEnum.APP.value);
// serveCollects.add(serveCollect);
// });
// List<ServeCollect> serveCollectList = serveCollectBiz.getList4RightsSetting(serveCollects);
List
<
ServeCollect
>
serveCollectList
=
serveCollectBiz
.
getList4RightsSettingByWechatUserId
(
wechatUserId
);
if
(
ListUtils
.
isEmpty
(
serveCollectList
))
{
return
true
;
}
...
...
@@ -2527,7 +2575,8 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
serveCollect
.
setServeType
(
Objects
.
equals
(
e
.
getServeType
(),
AppAndProductTypeEnum
.
PRODUCT
.
value
)
?
AppletRecordTypeEnum
.
PRODUCT
.
value
:
AppletRecordTypeEnum
.
APP
.
value
);
serveCollects
.
add
(
serveCollect
);
});
List
<
ServeCollect
>
serveCollectList
=
serveCollectBiz
.
getList4RightsSetting
(
serveCollects
);
// List<ServeCollect> serveCollectList = serveCollectBiz.getList4RightsSetting(serveCollects);
List
<
ServeCollect
>
serveCollectList
=
serveCollectBiz
.
getList4RightsSettingByWechatUserId
(
wechatUserId
);
if
(
ListUtils
.
isEmpty
(
serveCollectList
))
{
return
;
}
...
...
@@ -2710,7 +2759,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
RightsSettingTitle
rightsSettingTitle
=
rightsSettingTitleMapper
.
getByRightSettingIdAndType
(
rightsSetting
.
getId
(),
RightsNowItemTypeNew
.
SERVES
.
value
,
null
);
rightsSetting
.
setServesTitle
(
rightsSettingTitle
!=
null
?
rightsSettingTitle
:
new
RightsSettingTitle
());
rightsSetting
.
setRightsItemGroups
(
getRightsItemGroups
(
rightsSetting
.
getId
(),
adviserId
,
bookId
,
channelId
,
true
,
readType
,
null
));
rightsSetting
.
setRightsItemGroups
(
getRightsItemGroups
(
rightsSetting
.
getId
(),
adviserId
,
bookId
,
channelId
,
true
,
readType
,
null
,
true
));
return
rightsSetting
;
}
...
...
@@ -2821,7 +2870,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
@ParamLog
(
"根据权益id获取即享权益配套资料分组集合"
)
@Override
public
List
<
RightsItemGroup
>
getRightsItemGroups
(
Long
rightsSettingId
,
Long
adviserId
,
Long
bookId
,
Long
channelId
,
Boolean
removeCanNotBuy
,
Integer
readType
,
Long
wechatUserId
)
{
Boolean
removeCanNotBuy
,
Integer
readType
,
Long
wechatUserId
,
boolean
homePage
)
{
if
(
rightsSettingId
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数有误!"
);
}
...
...
@@ -2860,7 +2909,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
if
(!
ListUtils
.
isEmpty
(
originals
)
&&
adviserId
!=
null
&&
bookId
!=
null
&&
channelId
!=
null
)
{
//获取原有的资源
RightsItemGroup
originalGroup
=
originals
.
get
(
0
);
List
<
RightsNowItem
>
originalItems
=
getOriginalItems
(
originalGroup
.
getId
(),
adviserId
,
bookId
,
channelId
,
rightsSettingId
);
List
<
RightsNowItem
>
originalItems
=
getOriginalItems
(
originalGroup
.
getId
(),
adviserId
,
bookId
,
channelId
,
rightsSettingId
,
homePage
);
nowItems
.
addAll
(
originalItems
);
}
//填充应用和作品
...
...
@@ -3032,12 +3081,17 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
}
@ParamLog
(
"获取原有配套资料"
)
private
List
<
RightsNowItem
>
getOriginalItems
(
Long
originalGroupId
,
Long
adviserId
,
Long
bookId
,
Long
channelId
,
Long
rightsSettingId
)
{
private
List
<
RightsNowItem
>
getOriginalItems
(
Long
originalGroupId
,
Long
adviserId
,
Long
bookId
,
Long
channelId
,
Long
rightsSettingId
,
boolean
homePage
)
{
List
<
RightsNowItem
>
nowItems
=
new
ArrayList
<>();
if
(
originalGroupId
==
null
||
rightsSettingId
==
null
)
{
return
nowItems
;
}
List
<
BookServeDTO
>
bookServeVOS
=
bookGroupBiz
.
getBookAndBookGroupServeIds
(
adviserId
,
bookId
,
channelId
);
List
<
BookServeDTO
>
bookServeVOS
=
new
ArrayList
<>();
if
(
homePage
){
bookServeVOS
=
bookGroupBiz
.
getBookAndBookGroupServeIdsFive
(
adviserId
,
bookId
,
channelId
);
}
else
{
bookServeVOS
=
bookGroupBiz
.
getBookAndBookGroupServeIds
(
adviserId
,
bookId
,
channelId
);
}
if
(!
ListUtils
.
isEmpty
(
bookServeVOS
))
{
for
(
BookServeDTO
vo
:
bookServeVOS
)
{
RightsNowItem
item
=
new
RightsNowItem
();
...
...
@@ -3449,7 +3503,8 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
*/
private
List
<
RightsNowItem
>
getOriginServeRightsNowItem
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
Boolean
fillCollect
,
Long
wechatUserId
){
List
<
RightsNowItem
>
itemList
=
new
ArrayList
<>();
List
<
BookServeDTO
>
bookServeVOS
=
bookGroupBiz
.
getBookAndBookGroupServeIds
(
adviserId
,
bookId
,
channelId
);
List
<
BookServeDTO
>
bookServeVOS
=
new
ArrayList
<>();
bookServeVOS
=
bookGroupBiz
.
getBookAndBookGroupServeIds
(
adviserId
,
bookId
,
channelId
);
if
(
fillCollect
&&
null
!=
wechatUserId
){
bookGroupBiz
.
fillCollect4Book
(
wechatUserId
,
bookServeVOS
);
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/facade/RightsSettingFacede.java
View file @
a3d6b3c0
...
...
@@ -233,7 +233,7 @@ public class RightsSettingFacede {
if
(
null
==
rightsSettingId
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数缺失!"
);
}
return
new
ResponseDto
<>(
rightsSettingBiz
.
getRightsItemGroups
(
rightsSettingId
,
adviserId
,
bookId
,
channelId
,
true
,
readType
,
wechatUserId
));
return
new
ResponseDto
<>(
rightsSettingBiz
.
getRightsItemGroups
(
rightsSettingId
,
adviserId
,
bookId
,
channelId
,
true
,
readType
,
wechatUserId
,
false
));
}
@ApiOperation
(
"根据书刊的分类获取对应的分类权益信息"
)
...
...
pcloud-service-book/src/main/resources/application.yml
View file @
a3d6b3c0
...
...
@@ -6,7 +6,7 @@ eureka:
instance
:
status-page-url-path
:
/book/v1.0/swagger-ui.html
client
:
register-with-eureka
:
fals
e
#禁止自己当做服务注册
register-with-eureka
:
tru
e
#禁止自己当做服务注册
spring
:
application
:
...
...
pcloud-service-book/src/main/resources/mapper/applet/AppletNews.xml
View file @
a3d6b3c0
...
...
@@ -342,7 +342,7 @@
n.pic1,
n.pic2,
n.pic3,
n.content,
--
n.content,
n.show_state showState,
n.create_time createTime,
n.first_classify firstClassify,
...
...
pcloud-service-book/src/main/resources/mapper/applet/ServeCollect.Mapper.xml
View file @
a3d6b3c0
...
...
@@ -183,6 +183,19 @@
and serve_type = 1
</update>
<select
id=
"getList4RightsSettingByWechatUserId"
parameterType=
"list"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from
serve_collect
where
is_delete = 0
and
wechat_user_id = #{wechatUserId}
</select>
<select
id=
"getList4RightsSetting"
parameterType=
"list"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
...
...
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