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
a5bc3788
Commit
a5bc3788
authored
Sep 10, 2021
by
田超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/1005387' into 'master'
feat:[1005387]本书服务页优化 See merge request rays/pcloud-book!1409
parents
debe368e
4cd4f800
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
183 additions
and
40 deletions
+183
-40
AppConsr.java
.../src/main/java/com/pcloud/book/consumer/app/AppConsr.java
+13
-0
TradeConsr.java
.../main/java/com/pcloud/book/consumer/trade/TradeConsr.java
+42
-0
ResourcePageBiz.java
.../main/java/com/pcloud/book/group/biz/ResourcePageBiz.java
+3
-3
ResourcePageBizImpl.java
...a/com/pcloud/book/group/biz/impl/ResourcePageBizImpl.java
+111
-29
ResourcePageFacade.java
...com/pcloud/book/group/facade/impl/ResourcePageFacade.java
+9
-7
ResourcePageItemVO.java
...ain/java/com/pcloud/book/group/vo/ResourcePageItemVO.java
+4
-0
RightsSettingBizImpl.java
...oud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
+1
-1
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/consumer/app/AppConsr.java
View file @
a5bc3788
...
...
@@ -6,6 +6,7 @@ import com.pcloud.appcenter.app.dto.AppDto;
import
com.pcloud.appcenter.app.dto.AppIdTypeDTO
;
import
com.pcloud.appcenter.app.dto.AppRaysDTO
;
import
com.pcloud.appcenter.app.dto.AppTypeDto
;
import
com.pcloud.appcenter.app.dto.app.MapBaseStatusDTO
;
import
com.pcloud.appcenter.app.service.AppService
;
import
com.pcloud.appcenter.app.service.AppTypeService
;
import
com.pcloud.appcenter.base.dto.AppPriceCacheDTO
;
...
...
@@ -293,4 +294,16 @@ public class AppConsr {
}
return
new
HashMap
<>();
}
@ParamLog
(
description
=
"获取应用状态与价格"
,
isAfterReturn
=
false
)
public
Map
<
Long
,
MapBaseStatusDTO
>
mapBaseStatusById
(
List
<
Long
>
appIds
){
if
(
ListUtils
.
isEmpty
(
appIds
))
return
null
;
try
{
Map
<
Long
,
MapBaseStatusDTO
>
appBaseStatus
=
ResponseHandleUtil
.
parseMap
(
appService
.
mapBaseStatusById
(
appIds
),
Long
.
class
,
MapBaseStatusDTO
.
class
);
return
appBaseStatus
;
}
catch
(
Exception
e
){
LOGGER
.
error
(
"获取应用状态与价格失败"
+
e
.
getMessage
(),
e
);
}
return
null
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/consumer/trade/TradeConsr.java
View file @
a5bc3788
...
...
@@ -329,4 +329,46 @@ public class TradeConsr {
}
return
new
HashMap
<>();
}
/**
* 应用作品购买状态
* @author:zhuyajie
* @date:2021/9/6 15:48
* * @param null
*/
public
Map
<
Long
,
Boolean
>
mapAppProductBuyState
(
Long
wechatUserId
,
List
<
Long
>
appIds
,
List
<
Long
>
productIds
)
{
if
(
null
==
wechatUserId
||
(
ListUtils
.
isEmpty
(
appIds
)
&&
ListUtils
.
isEmpty
(
productIds
)))
{
return
new
HashMap
<>();
}
OrderSearchDto
orderSearchDto
=
new
OrderSearchDto
();
orderSearchDto
.
setAppIds
(
appIds
);
orderSearchDto
.
setProductIds
(
productIds
);
orderSearchDto
.
setWechatUserId
(
wechatUserId
);
try
{
return
ResponseHandleUtil
.
parseMap
(
orderFormService
.
mapAppProductBuyState
(
orderSearchDto
),
Long
.
class
,
Boolean
.
class
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"调用orderFormService.mapAppProductBuyState失败"
+
e
.
getMessage
(),
e
);
}
return
null
;
}
/**
* 课程单节课购买状态
* @author:zhuyajie
* @date:2021/9/7 12:37
* * @param null
*/
public
Map
<
Long
,
Boolean
>
mapCourseProductBuyState
(
Long
wechatUserId
,
List
<
Long
>
productIds
)
{
if
(
null
==
wechatUserId
||
ListUtils
.
isEmpty
(
productIds
))
{
return
new
HashMap
<>();
}
OrderSearchDto
orderSearchDto
=
new
OrderSearchDto
();
orderSearchDto
.
setProductIds
(
productIds
);
orderSearchDto
.
setWechatUserId
(
wechatUserId
);
try
{
return
ResponseHandleUtil
.
parseMap
(
orderFormService
.
mapCourseProductBuyState
(
orderSearchDto
),
Long
.
class
,
Boolean
.
class
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"调用orderFormService.mapCourseProductBuyState失败"
+
e
.
getMessage
(),
e
);
}
return
null
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/ResourcePageBiz.java
View file @
a5bc3788
...
...
@@ -66,7 +66,7 @@ public interface ResourcePageBiz {
* @date:2021/3/29 11:49
* * @param null
*/
List
<
ResourceColumnAndServeVO
>
getColumnAndServeListByPageId
(
Long
resourcePageId
,
Boolean
isWechat
,
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Integer
enableAdverting
,
Long
navigationId
);
List
<
ResourceColumnAndServeVO
>
getColumnAndServeListByPageId
(
Long
resourcePageId
,
Long
wechatUserId
,
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Integer
enableAdverting
,
Long
navigationId
);
/**
* 根据书刊查资源页基本配置
* @author:zhuyajie
...
...
@@ -81,7 +81,7 @@ public interface ResourcePageBiz {
* @date:2021/3/31 19:06
* * @param null
*/
PageBeanNew
<
ResourcePageItemVO
>
listPageResourcePageItem
(
Integer
currentPage
,
Integer
numPerPage
,
Long
resourcePageColumnId
);
PageBeanNew
<
ResourcePageItemVO
>
listPageResourcePageItem
(
Integer
currentPage
,
Integer
numPerPage
,
Long
resourcePageColumnId
,
Long
wechatUserId
);
/**
* 根据社群码id查询
...
...
@@ -173,7 +173,7 @@ public interface ResourcePageBiz {
* @date:2021/4/21 15:09
* * @param null
*/
ResourcePageOneServe
hasOneResource
(
Long
bookGroupId
,
Long
sceneId
);
ResourcePageOneServe
hasOneResource
(
Long
bookGroupId
,
Long
sceneId
,
Long
wechatUserId
);
/**
* 自有码配置的资源列表
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/ResourcePageBizImpl.java
View file @
a5bc3788
...
...
@@ -11,6 +11,7 @@ import com.pcloud.advertising.advertising.dto.AdvertisingSpaceDTO;
import
com.pcloud.advertising.advertising.dto.AdvertisingSpaceItemDTO
;
import
com.pcloud.analysisengine.browse.dto.BrowseRecordStatisticDTO
;
import
com.pcloud.appcenter.app.dto.AppDto
;
import
com.pcloud.appcenter.app.dto.app.MapBaseStatusDTO
;
import
com.pcloud.book.applet.biz.AppletBooklistBiz
;
import
com.pcloud.book.applet.biz.AppletGroupSearchRecordBiz
;
import
com.pcloud.book.applet.biz.AppletRecordAggrStatisBiz
;
...
...
@@ -34,6 +35,7 @@ import com.pcloud.book.consumer.channel.QrcodeSceneConsr;
import
com.pcloud.book.consumer.raystask.AdviserTaskConsr
;
import
com.pcloud.book.consumer.reader.ReaderConsr
;
import
com.pcloud.book.consumer.resource.ProductConsr
;
import
com.pcloud.book.consumer.trade.TradeConsr
;
import
com.pcloud.book.consumer.user.AdviserConsr
;
import
com.pcloud.book.consumer.user.AgentConsr
;
import
com.pcloud.book.consumer.user.ChannelConsr
;
...
...
@@ -84,7 +86,12 @@ import org.springframework.stereotype.Component;
import
org.springframework.transaction.annotation.Transactional
;
import
java.io.File
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.concurrent.ExecutionException
;
import
java.util.concurrent.Future
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeoutException
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -164,6 +171,8 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
private
ResourcePageNavigationDao
resourcePageNavigationDao
;
@Autowired
private
ResourcePagePicDao
resourcePagePicDao
;
@Autowired
private
TradeConsr
tradeConsr
;
@Override
public
Long
updateResourcePage
(
UpdateResourcePageVO
updateResourcePageVO
)
{
...
...
@@ -679,11 +688,11 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
@Override
public
List
<
ResourceColumnAndServeVO
>
getColumnAndServeListByPageId
(
Long
resourcePageId
,
Boolean
isWechat
,
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Integer
enableAdverting
,
Long
navigationId
)
{
public
List
<
ResourceColumnAndServeVO
>
getColumnAndServeListByPageId
(
Long
resourcePageId
,
Long
wechatUserId
,
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Integer
enableAdverting
,
Long
navigationId
)
{
List
<
ResourceColumnAndServeVO
>
serveVOS
=
resourcePageColumnDao
.
getColumnListByPageId
(
resourcePageId
,
navigationId
);
if
(
CollUtil
.
isNotEmpty
(
serveVOS
))
{
List
<
ResourcePageItemVO
>
itemVOList
;
if
(
isWechat
)
{
if
(
null
!=
wechatUserId
)
{
itemVOList
=
resourcePageItemDao
.
getResourcePageItemByPageId
(
resourcePageId
,
true
);
}
else
{
itemVOList
=
resourcePageItemDao
.
getResourcePageItemByPageId
(
resourcePageId
,
null
);
...
...
@@ -695,7 +704,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
itemVOList
=
new
ArrayList
<>();
//过滤一些资源,重新排序
for
(
Map
.
Entry
<
String
,
List
<
ResourcePageItemVO
>>
entry
:
listMap
.
entrySet
())
{
this
.
fillResourceByType
(
entry
.
getValue
(),
isWechat
,
entry
.
getKey
());
this
.
fillResourceByType
(
entry
.
getValue
(),
wechatUserId
,
entry
.
getKey
());
itemVOList
.
addAll
(
entry
.
getValue
());
}
itemVOList
.
sort
(
Comparator
.
comparing
(
ResourcePageItemVO:
:
getId
));
...
...
@@ -808,24 +817,24 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
@ParamLog
(
"按类型填充资源"
)
private
void
fillResourceByType
(
List
<
ResourcePageItemVO
>
itemVOS
,
Boolean
isWechat
,
String
serveType
)
{
private
void
fillResourceByType
(
List
<
ResourcePageItemVO
>
itemVOS
,
Long
wechatUserId
,
String
serveType
)
{
if
(
ListUtils
.
isEmpty
(
itemVOS
))
{
return
;
}
if
(
ResourcePageConstants
.
ServeTypeEnum
.
APP
.
getValue
().
equals
(
serveType
))
{
fillAppProductServe
(
itemVOS
,
isWechat
);
fillAppProductServe
(
itemVOS
,
wechatUserId
);
}
else
if
(
ResourcePageConstants
.
ServeTypeEnum
.
PRODUCT
.
getValue
().
equals
(
serveType
))
{
fillAppProductServe
(
itemVOS
,
isWechat
);
fillAppProductServe
(
itemVOS
,
wechatUserId
);
}
else
if
(
ResourcePageConstants
.
ServeTypeEnum
.
OFFICIAL_ACCOUNT
.
getValue
().
equals
(
serveType
))
{
fillOfficialAccount
(
itemVOS
,
isWechat
);
fillOfficialAccount
(
itemVOS
,
wechatUserId
);
}
else
if
(
ResourcePageConstants
.
ServeTypeEnum
.
BOOKLIST
.
getValue
().
equals
(
serveType
))
{
fillBooklistServe
(
itemVOS
,
isWechat
);
fillBooklistServe
(
itemVOS
);
}
else
if
(
ResourcePageConstants
.
ServeTypeEnum
.
ADVISER_BOOK
.
getValue
().
equals
(
serveType
))
{
fillAdviserBook
(
itemVOS
,
isWechat
);
fillAdviserBook
(
itemVOS
);
}
else
if
(
ResourcePageConstants
.
ServeTypeEnum
.
GROUP_ACTIVITY
.
getValue
().
equals
(
serveType
))
{
fillGroupServe
(
itemVOS
,
isWechat
);
fillGroupServe
(
itemVOS
);
}
else
if
(
ResourcePageConstants
.
ServeTypeEnum
.
THIRD_RESOURCE
.
getValue
().
equals
(
serveType
))
{
fillThirdResource
(
itemVOS
,
isWechat
);
fillThirdResource
(
itemVOS
);
}
else
if
(
ResourcePageConstants
.
ServeTypeEnum
.
WXWORK_GROUP
.
getValue
().
equals
(
serveType
))
{
fillWxworkGroup
(
itemVOS
);
}
...
...
@@ -873,7 +882,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
@ParamLog
(
"填充第三方资源"
)
private
void
fillThirdResource
(
List
<
ResourcePageItemVO
>
itemVOS
,
Boolean
isWechat
)
{
private
void
fillThirdResource
(
List
<
ResourcePageItemVO
>
itemVOS
)
{
log
.
info
(
"填充第三方资源"
);
if
(
ListUtils
.
isEmpty
(
itemVOS
))
{
return
;
...
...
@@ -893,7 +902,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
@ParamLog
(
"填充编辑书刊链接"
)
private
void
fillAdviserBook
(
List
<
ResourcePageItemVO
>
itemVOS
,
Boolean
isWechat
)
{
private
void
fillAdviserBook
(
List
<
ResourcePageItemVO
>
itemVOS
)
{
log
.
info
(
"填充编辑书刊链接"
);
if
(
ListUtils
.
isEmpty
(
itemVOS
))
{
return
;
...
...
@@ -919,7 +928,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
@ParamLog
(
"填充公众号二维码"
)
private
void
fillOfficialAccount
(
List
<
ResourcePageItemVO
>
itemVOS
,
Boolean
isWechat
)
{
private
void
fillOfficialAccount
(
List
<
ResourcePageItemVO
>
itemVOS
,
Long
wechatUserId
)
{
log
.
info
(
"填充公众号二维码"
);
if
(
ListUtils
.
isEmpty
(
itemVOS
))
{
return
;
...
...
@@ -937,7 +946,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
}
else
{
//弹窗方式,在客户端栏目中不展示
if
(
isWechat
)
{
if
(
null
!=
wechatUserId
)
{
removeList
.
add
(
itemVO
);
continue
;
}
...
...
@@ -959,7 +968,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
@ParamLog
(
"填充应用作品"
)
private
void
fillAppProductServe
(
List
<
ResourcePageItemVO
>
itemVOS
,
Boolean
isWechat
)
{
private
void
fillAppProductServe
(
List
<
ResourcePageItemVO
>
itemVOS
,
Long
wechatUserId
)
{
log
.
info
(
"填充应用作品"
);
if
(
ListUtils
.
isEmpty
(
itemVOS
))
{
return
;
...
...
@@ -967,22 +976,79 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
Long
adviserId
=
itemVOS
.
get
(
0
).
getCreateUser
();
List
<
Long
>
appIds
=
new
ArrayList
<>();
List
<
Long
>
productIds
=
new
ArrayList
<>();
List
<
Long
>
courseProductIds
=
new
ArrayList
<>();
List
<
Long
>
nonCourseProductIds
=
new
ArrayList
<>();
List
<
String
>
courseProductTypeCodes
=
Arrays
.
asList
(
"VIDEO_SCHEDULE"
,
"VIDEO_COURSE"
,
"AUDIO_COURSE"
,
"AUDIO_SCHEDULE"
,
"LIVE"
);
for
(
ResourcePageItemVO
vo
:
itemVOS
)
{
Long
serveId
=
vo
.
getServeId
();
if
(
ResourcePageConstants
.
ServeTypeEnum
.
APP
.
getValue
().
equals
(
vo
.
getServeType
())
&&
!
appIds
.
contains
(
serveId
))
{
appIds
.
add
(
serveId
);
}
else
if
(
ResourcePageConstants
.
ServeTypeEnum
.
PRODUCT
.
getValue
().
equals
(
vo
.
getServeType
())
&&
!
productIds
.
contains
(
serveId
))
{
productIds
.
add
(
serveId
);
continue
;
}
if
(
ResourcePageConstants
.
ServeTypeEnum
.
PRODUCT
.
getValue
().
equals
(
vo
.
getServeType
()))
{
if
(!
productIds
.
contains
(
serveId
))
{
productIds
.
add
(
serveId
);
}
if
(
courseProductTypeCodes
.
contains
(
vo
.
getTypeCode
()))
{
courseProductIds
.
add
(
serveId
);
}
else
{
nonCourseProductIds
.
add
(
serveId
);
}
}
}
Map
<
Long
,
AppDto
>
appDtoMap
=
appConsr
.
mapBaseByIds
(
appIds
);
Map
<
Long
,
ProductDto
>
productDtoMap
=
productConsr
.
getProBasesByIds
(
productIds
);
Map
<
Long
,
AppDto
>
appDtoMap
=
new
HashMap
<>();
Map
<
Long
,
ProductDto
>
productDtoMap
=
new
HashMap
<>();
Map
<
Long
,
MapBaseStatusDTO
>
appPriceMap
=
new
HashMap
<>();
Future
<
Map
<
Long
,
AppDto
>>
appMapSubmit
=
ThreadPoolUtils
.
OTHER_POOL
.
submit
(()
->{
return
appConsr
.
mapBaseByIds
(
appIds
);
});
Future
<
Map
<
Long
,
ProductDto
>>
productMapSubmit
=
ThreadPoolUtils
.
OTHER_POOL
.
submit
(()
->{
return
productConsr
.
getProBasesByIds
(
productIds
);
});
Future
<
Map
<
Long
,
MapBaseStatusDTO
>>
appPriceMapSubmit
=
ThreadPoolUtils
.
OTHER_POOL
.
submit
(()
->{
return
appConsr
.
mapBaseStatusById
(
appIds
);
});
try
{
appDtoMap
=
appMapSubmit
.
get
(
ThreadPoolUtils
.
REMOTE_TIME_OUT
,
TimeUnit
.
SECONDS
);
}
catch
(
InterruptedException
|
ExecutionException
|
TimeoutException
e
)
{
log
.
error
(
"调用应用中心获取应用信息错误:"
+
e
.
getMessage
(),
e
);
}
try
{
productDtoMap
=
productMapSubmit
.
get
(
ThreadPoolUtils
.
REMOTE_TIME_OUT
,
TimeUnit
.
SECONDS
);
}
catch
(
InterruptedException
|
ExecutionException
|
TimeoutException
e
)
{
log
.
error
(
"调用资源中心获取商品信息错误:"
+
e
.
getMessage
(),
e
);
}
try
{
appPriceMap
=
appPriceMapSubmit
.
get
(
ThreadPoolUtils
.
REMOTE_TIME_OUT
,
TimeUnit
.
SECONDS
);
}
catch
(
InterruptedException
|
ExecutionException
|
TimeoutException
e
)
{
log
.
error
(
"调用应用中心获取应用价格信息错误:"
+
e
.
getMessage
(),
e
);
}
Map
<
Long
,
AccountSettingDto
>
channelAccountSettingDtoMap
=
new
HashMap
<>();
Map
<
Long
,
AccountSetting
>
accountSettingMap
=
new
HashMap
<>();
//应用配置公众号工具
Map
<
Long
,
Long
>
appOfficialAccountToolMap
=
new
HashMap
<>();
if
(
isWechat
)
{
//是否购买
Map
<
Long
,
Boolean
>
buyStateMap
=
new
HashMap
<>();
//课程是否购买(单节/整套)
Map
<
Long
,
Boolean
>
courseBuyStateMap
=
new
HashMap
<>();
if
(
null
!=
wechatUserId
)
{
appOfficialAccountToolMap
=
appConsr
.
getPayOfficialAccountsToolByAppIds
(
appIds
);
Future
<
Map
<
Long
,
Boolean
>>
buyStateSubmit
=
ThreadPoolUtils
.
OTHER_POOL
.
submit
(()
->{
return
tradeConsr
.
mapAppProductBuyState
(
wechatUserId
,
appIds
,
nonCourseProductIds
);
});
Future
<
Map
<
Long
,
Boolean
>>
courseBuyStateSubmit
=
ThreadPoolUtils
.
OTHER_POOL
.
submit
(()
->{
return
tradeConsr
.
mapCourseProductBuyState
(
wechatUserId
,
courseProductIds
);
});
try
{
buyStateMap
=
buyStateSubmit
.
get
(
ThreadPoolUtils
.
REMOTE_TIME_OUT
,
TimeUnit
.
SECONDS
);
}
catch
(
InterruptedException
|
ExecutionException
|
TimeoutException
e
)
{
log
.
error
(
"调用交易中心查询是否购买失败:"
+
e
.
getMessage
(),
e
);
}
try
{
courseBuyStateMap
=
courseBuyStateSubmit
.
get
(
ThreadPoolUtils
.
REMOTE_TIME_OUT
,
TimeUnit
.
SECONDS
);
}
catch
(
InterruptedException
|
ExecutionException
|
TimeoutException
e
)
{
log
.
error
(
"调用交易中心查询课程是否购买错误失败:"
+
e
.
getMessage
(),
e
);
}
}
for
(
ResourcePageItemVO
itemVO
:
itemVOS
)
{
Long
serveId
=
itemVO
.
getServeId
();
...
...
@@ -997,6 +1063,10 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
itemVO
.
setTransverseImg
(
appDto
.
getTransverseImg
());
itemVO
.
setPrice
(
appDto
.
getPrice
());
itemVO
.
setHasThirdLink
(!
StringUtil
.
isEmpty
(
appDto
.
getTurnUrl
())?
true
:
false
);
if
(!
MapUtils
.
isEmpty
(
appPriceMap
)
&&
appPriceMap
.
containsKey
(
serveId
))
{
BigDecimal
price
=
appPriceMap
.
get
(
serveId
).
getRetailPrice
();
itemVO
.
setPrice
(
null
==
price
?
Double
.
valueOf
(
0
d
):
price
.
doubleValue
());
}
}
else
if
(
ResourcePageConstants
.
ServeTypeEnum
.
PRODUCT
.
getValue
().
equals
(
serveType
)
&&
!
MapUtils
.
isEmpty
(
productDtoMap
)
&&
productDtoMap
.
containsKey
(
serveId
))
{
ProductDto
productDto
=
productDtoMap
.
get
(
itemVO
.
getServeId
());
...
...
@@ -1015,14 +1085,25 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
else
{
continue
;
}
if
(
null
==
itemVO
.
getPrice
())
{
itemVO
.
setPrice
(
Double
.
valueOf
(
0
d
));
}
Long
channelId
=
getChannelIdFromUrl
(
itemVO
.
getLinkUrl
());
if
(
null
==
channelId
)
{
log
.
info
(
itemVO
.
getServeName
()
+
"无运营平台, serveId="
+
itemVO
.
getServeId
());
channelId
=
adviserConsr
.
getDefaultChannel
(
adviserId
);
}
itemVO
.
setChannelId
(
channelId
);
if
(
isWechat
)
{
if
(
null
!=
wechatUserId
)
{
setResourceLink4Wechat
(
itemVO
,
channelAccountSettingDtoMap
,
appOfficialAccountToolMap
,
accountSettingMap
);
itemVO
.
setBuyState
(
false
);
if
(!
MapUtils
.
isEmpty
(
buyStateMap
)
&&
buyStateMap
.
containsKey
(
serveId
))
{
itemVO
.
setBuyState
(
buyStateMap
.
get
(
serveId
));
}
if
(!
MapUtils
.
isEmpty
(
courseBuyStateMap
)
&&
courseBuyStateMap
.
containsKey
(
serveId
)
&&
ResourcePageConstants
.
ServeTypeEnum
.
PRODUCT
.
getValue
().
equals
(
itemVO
.
getServeType
()))
{
itemVO
.
setBuyState
(
courseBuyStateMap
.
get
(
serveId
));
}
}
}
}
...
...
@@ -1081,7 +1162,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
@ParamLog
(
"填充社群"
)
private
void
fillGroupServe
(
List
<
ResourcePageItemVO
>
itemVOS
,
Boolean
isWechat
)
{
private
void
fillGroupServe
(
List
<
ResourcePageItemVO
>
itemVOS
)
{
log
.
info
(
"填充社群"
);
if
(
ListUtils
.
isEmpty
(
itemVOS
))
{
return
;
...
...
@@ -1108,7 +1189,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
@ParamLog
(
"填充平台书单"
)
private
void
fillBooklistServe
(
List
<
ResourcePageItemVO
>
itemVOS
,
Boolean
isWechat
)
{
private
void
fillBooklistServe
(
List
<
ResourcePageItemVO
>
itemVOS
)
{
log
.
info
(
"填充平台书单"
);
if
(
ListUtils
.
isEmpty
(
itemVOS
))
{
return
;
...
...
@@ -1166,7 +1247,8 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
@Override
public
PageBeanNew
<
ResourcePageItemVO
>
listPageResourcePageItem
(
Integer
currentPage
,
Integer
numPerPage
,
Long
resourcePageColumnId
)
{
public
PageBeanNew
<
ResourcePageItemVO
>
listPageResourcePageItem
(
Integer
currentPage
,
Integer
numPerPage
,
Long
resourcePageColumnId
,
Long
wechatUserId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"resourcePageColumnId"
,
resourcePageColumnId
);
PageBeanNew
<
ResourcePageItemVO
>
pageBeanNew
=
resourcePageItemDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
paramMap
,
"getResourcePageItemByColumnId"
);
...
...
@@ -1175,7 +1257,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
Map
<
String
,
List
<
ResourcePageItemVO
>>
listMap
=
pageBeanNew
.
getRecordList
().
stream
().
collect
(
Collectors
.
groupingBy
(
ResourcePageItemVO:
:
getServeType
));
for
(
Map
.
Entry
<
String
,
List
<
ResourcePageItemVO
>>
entry
:
listMap
.
entrySet
())
{
fillResourceByType
(
entry
.
getValue
(),
true
,
entry
.
getKey
());
fillResourceByType
(
entry
.
getValue
(),
wechatUserId
,
entry
.
getKey
());
}
return
pageBeanNew
;
}
...
...
@@ -1561,7 +1643,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
@Override
public
ResourcePageOneServe
hasOneResource
(
Long
bookGroupId
,
Long
sceneId
)
{
public
ResourcePageOneServe
hasOneResource
(
Long
bookGroupId
,
Long
sceneId
,
Long
wechatUserId
)
{
ResourcePageOneServe
pageOneServe
=
new
ResourcePageOneServe
();
pageOneServe
.
setBookGroupId
(
bookGroupId
);
pageOneServe
.
setSceneId
(
sceneId
);
...
...
@@ -1584,7 +1666,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
ResourcePageItemVO
itemVO
=
resourcePageItemDao
.
checkOneServeItemByPageId
(
resourcePageId
);
if
(
null
!=
itemVO
)
{
pageOneServe
.
setOneServe
(
true
);
fillAppProductServe
(
Arrays
.
asList
(
itemVO
),
true
);
fillAppProductServe
(
Arrays
.
asList
(
itemVO
),
wechatUserId
);
pageOneServe
.
setServeId
(
itemVO
.
getServeId
());
pageOneServe
.
setServeType
(
itemVO
.
getServeType
());
pageOneServe
.
setLinkUrl
(
itemVO
.
getLinkUrl
());
...
...
@@ -1619,7 +1701,7 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
itemVO
.
setSceneId
(
s
.
getSceneId
());
itemVOS
.
add
(
itemVO
);
});
fillAppProductServe
(
itemVOS
,
false
);
fillAppProductServe
(
itemVOS
,
null
);
List
<
BookGroupServeDTO
>
serveDTOS
=
new
ArrayList
<>();
for
(
ResourcePageItemVO
itemVO:
itemVOS
)
{
BookGroupServeDTO
serveDTO
=
new
BookGroupServeDTO
();
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/impl/ResourcePageFacade.java
View file @
a5bc3788
...
...
@@ -75,7 +75,7 @@ public class ResourcePageFacade {
@RequestParam
(
"resourcePageId"
)
Long
resourcePageId
,
@RequestParam
(
value
=
"navigationId"
,
required
=
false
)
Long
navigationId
){
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
return
new
ResponseDto
<>(
resourcePageBiz
.
getColumnAndServeListByPageId
(
resourcePageId
,
false
,
null
,
null
,
null
,
null
,
navigationId
));
return
new
ResponseDto
<>(
resourcePageBiz
.
getColumnAndServeListByPageId
(
resourcePageId
,
null
,
null
,
null
,
null
,
null
,
navigationId
));
}
@ApiOperation
(
"客户端-根据书刊查资源页基本配置"
)
...
...
@@ -97,8 +97,8 @@ public class ResourcePageFacade {
@RequestParam
(
value
=
"channelId"
,
required
=
false
)
Long
channelId
,
@RequestParam
(
value
=
"enableAdverting"
,
required
=
false
)
Integer
enableAdverting
,
@RequestParam
(
value
=
"navigationId"
,
required
=
false
)
Long
navigationId
){
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
return
new
ResponseDto
<>(
resourcePageBiz
.
getColumnAndServeListByPageId
(
resourcePageId
,
true
,
bookId
,
adviserId
,
channelId
,
enableAdverting
,
navigationId
));
Long
wechatUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
return
new
ResponseDto
<>(
resourcePageBiz
.
getColumnAndServeListByPageId
(
resourcePageId
,
wechatUserId
,
bookId
,
adviserId
,
channelId
,
enableAdverting
,
navigationId
));
}
@ApiOperation
(
"客户端分页查栏目资源"
)
...
...
@@ -107,8 +107,8 @@ public class ResourcePageFacade {
@RequestParam
(
"currentPage"
)
Integer
currentPage
,
@RequestParam
(
"numPerPage"
)
Integer
numPerPage
,
@RequestParam
(
"resourcePageColumnId"
)
Long
resourcePageColumnId
)
{
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
return
new
ResponseDto
<>(
resourcePageBiz
.
listPageResourcePageItem
(
currentPage
,
numPerPage
,
resourcePageColumnId
));
Long
wechatUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
return
new
ResponseDto
<>(
resourcePageBiz
.
listPageResourcePageItem
(
currentPage
,
numPerPage
,
resourcePageColumnId
,
wechatUserId
));
}
@ApiOperation
(
"获取栏目及资源类型"
)
...
...
@@ -163,9 +163,11 @@ public class ResourcePageFacade {
@ApiOperation
(
"是否只有一个资源"
)
@GetMapping
(
"hasOneResource"
)
public
ResponseDto
<?>
hasOneResource
(
@RequestParam
(
value
=
"bookGroupId"
,
required
=
false
)
Long
bookGroupId
,
public
ResponseDto
<?>
hasOneResource
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestParam
(
value
=
"bookGroupId"
,
required
=
false
)
Long
bookGroupId
,
@RequestParam
(
value
=
"sceneId"
,
required
=
false
)
Long
sceneId
)
{
return
new
ResponseDto
<>(
resourcePageBiz
.
hasOneResource
(
bookGroupId
,
sceneId
));
Long
wechatUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
return
new
ResponseDto
<>(
resourcePageBiz
.
hasOneResource
(
bookGroupId
,
sceneId
,
wechatUserId
));
}
@ApiOperation
(
"添加收藏记录"
)
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/vo/ResourcePageItemVO.java
View file @
a5bc3788
...
...
@@ -116,4 +116,8 @@ public class ResourcePageItemVO extends BaseDto{
* 二维码公众号弹出状态
*/
private
Boolean
popupState
;
/**
* 是否购买
*/
private
Boolean
buyState
;
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
View file @
a5bc3788
...
...
@@ -1201,7 +1201,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
if
(
null
==
resourcePageVO
||
null
==
resourcePageVO
.
getId
())
{
return
;
}
List
<
ResourceColumnAndServeVO
>
serveVOList
=
resourcePageBiz
.
getColumnAndServeListByPageId
(
resourcePageVO
.
getId
(),
false
,
null
,
null
,
null
,
null
,
null
);
List
<
ResourceColumnAndServeVO
>
serveVOList
=
resourcePageBiz
.
getColumnAndServeListByPageId
(
resourcePageVO
.
getId
(),
null
,
null
,
null
,
null
,
null
,
null
);
UpdateResourceColumnVO
columnVO
=
new
UpdateResourceColumnVO
();
columnVO
.
setColumnFormat
(
3
);
columnVO
.
setColumnName
(
"精品资讯"
);
...
...
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