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
05feca4c
Commit
05feca4c
authored
Oct 18, 2019
by
阮思源
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into feat-1001857
parents
c7dd0d00
b382a120
Show whitespace changes
Inline
Side-by-side
Showing
54 changed files
with
610 additions
and
498 deletions
+610
-498
AdNewsBizImpl.java
...n/java/com/pcloud/book/adnews/biz/impl/AdNewsBizImpl.java
+203
-35
AdNewsDao.java
...k/src/main/java/com/pcloud/book/adnews/dao/AdNewsDao.java
+26
-0
AdNewsDaoImpl.java
...n/java/com/pcloud/book/adnews/dao/impl/AdNewsDaoImpl.java
+26
-0
AdNewsSet.java
...rc/main/java/com/pcloud/book/adnews/entity/AdNewsSet.java
+3
-0
AdNewsSendRuleEnum.java
...java/com/pcloud/book/adnews/enums/AdNewsSendRuleEnum.java
+30
-0
AdvertisingSpaceBizImpl.java
...ud/book/advertising/biz/impl/AdvertisingSpaceBizImpl.java
+3
-5
AdvertisingDetailFile.java
...pcloud/book/advertising/entity/AdvertisingDetailFile.java
+4
-3
BookAppealBizImpl.java
...va/com/pcloud/book/appeal/biz/impl/BookAppealBizImpl.java
+0
-1
BookAdviserBizImpl.java
...ava/com/pcloud/book/book/biz/impl/BookAdviserBizImpl.java
+0
-11
BookAppBizImpl.java
...in/java/com/pcloud/book/book/biz/impl/BookAppBizImpl.java
+15
-21
BookBizImpl.java
.../main/java/com/pcloud/book/book/biz/impl/BookBizImpl.java
+19
-51
BookFreezeBizImpl.java
...java/com/pcloud/book/book/biz/impl/BookFreezeBizImpl.java
+0
-3
BookFundBizImpl.java
...n/java/com/pcloud/book/book/biz/impl/BookFundBizImpl.java
+23
-31
BookKeywordWarehouseBizImpl.java
...cloud/book/book/biz/impl/BookKeywordWarehouseBizImpl.java
+0
-1
BookProductBizImpl.java
...ava/com/pcloud/book/book/biz/impl/BookProductBizImpl.java
+23
-33
BookResourceBizImpl.java
...va/com/pcloud/book/book/biz/impl/BookResourceBizImpl.java
+16
-20
BookTypeBizImpl.java
...n/java/com/pcloud/book/book/biz/impl/BookTypeBizImpl.java
+1
-2
BookSet.java
...-book/src/main/java/com/pcloud/book/book/set/BookSet.java
+2
-19
BookScanCountConsr.java
...loud/book/consumer/analysisengine/BookScanCountConsr.java
+7
-8
BrowseRecordConsr.java
...cloud/book/consumer/analysisengine/BrowseRecordConsr.java
+1
-4
SceneRecordConsr.java
...pcloud/book/consumer/analysisengine/SceneRecordConsr.java
+5
-6
QrcodeSceneConsr.java
...va/com/pcloud/book/consumer/channel/QrcodeSceneConsr.java
+0
-8
IsbnConsr.java
...rc/main/java/com/pcloud/book/consumer/isbn/IsbnConsr.java
+0
-3
LabelConsr.java
.../main/java/com/pcloud/book/consumer/label/LabelConsr.java
+0
-5
MessageConsr.java
...n/java/com/pcloud/book/consumer/message/MessageConsr.java
+7
-7
TemplateConsr.java
.../java/com/pcloud/book/consumer/message/TemplateConsr.java
+5
-8
MainLineConsr.java
...java/com/pcloud/book/consumer/raystask/MainLineConsr.java
+5
-8
ProductConsr.java
.../java/com/pcloud/book/consumer/resource/ProductConsr.java
+0
-16
BookConsr.java
...n/java/com/pcloud/book/consumer/settlement/BookConsr.java
+11
-15
AdviserConsr.java
...main/java/com/pcloud/book/consumer/user/AdviserConsr.java
+8
-16
AgentConsr.java
...c/main/java/com/pcloud/book/consumer/user/AgentConsr.java
+9
-9
BookcaseConsr.java
...ain/java/com/pcloud/book/consumer/user/BookcaseConsr.java
+7
-11
ChannelConsr.java
...main/java/com/pcloud/book/consumer/user/ChannelConsr.java
+1
-5
PartyConsr.java
...c/main/java/com/pcloud/book/consumer/user/PartyConsr.java
+0
-2
WechatGroupConsr.java
...om/pcloud/book/consumer/wechatgroup/WechatGroupConsr.java
+0
-11
BookAuthCodeBizImpl.java
...m/pcloud/book/copyright/biz/impl/BookAuthCodeBizImpl.java
+14
-20
ESNewsBizImpl.java
.../main/java/com/pcloud/book/es/biz/impl/ESNewsBizImpl.java
+0
-5
AppClickRecordBizImpl.java
...com/pcloud/book/group/biz/impl/AppClickRecordBizImpl.java
+1
-2
BookGroupBizImpl.java
...java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
+1
-2
GroupQrcodeFoAdDTO.java
...in/java/com/pcloud/book/group/dto/GroupQrcodeFoAdDTO.java
+26
-41
BookGroupClassifyFacade.java
...com/pcloud/book/group/facade/BookGroupClassifyFacade.java
+24
-3
BookGroupFacadeImpl.java
...om/pcloud/book/group/facade/impl/BookGroupFacadeImpl.java
+1
-1
GroupSet.java
...ook/src/main/java/com/pcloud/book/group/set/GroupSet.java
+1
-2
SendWeixinRequestTools.java
...a/com/pcloud/book/group/tools/SendWeixinRequestTools.java
+9
-19
BookKeywordBizImpl.java
...com/pcloud/book/keywords/biz/impl/BookKeywordBizImpl.java
+1
-1
ConvertFileListener.java
...in/java/com/pcloud/book/mq/topic/ConvertFileListener.java
+1
-2
PayMentListener.java
...c/main/java/com/pcloud/book/mq/topic/PayMentListener.java
+0
-3
WXGroupLearningReportListener.java
...m/pcloud/book/mq/topic/WXGroupLearningReportListener.java
+1
-3
WxGroupSendTextListener.java
...ava/com/pcloud/book/mq/topic/WxGroupSendTextListener.java
+2
-7
PushBizImpl.java
.../main/java/com/pcloud/book/push/biz/impl/PushBizImpl.java
+0
-1
AdNewsMapper.xml
...ce-book/src/main/resources/mapper/adnews/AdNewsMapper.xml
+53
-4
AdNewsSetMapper.xml
...book/src/main/resources/mapper/adnews/AdNewsSetMapper.xml
+7
-1
AdvertisingDetailFileMapper.xml
...ources/mapper/advertising/AdvertisingDetailFileMapper.xml
+2
-2
GroupQrcode.Mapper.xml
...ok/src/main/resources/mapper/group/GroupQrcode.Mapper.xml
+6
-1
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/adnews/biz/impl/AdNewsBizImpl.java
View file @
05feca4c
...
@@ -2,12 +2,31 @@ package com.pcloud.book.adnews.biz.impl;
...
@@ -2,12 +2,31 @@ package com.pcloud.book.adnews.biz.impl;
import
com.pcloud.book.adnews.biz.AdNewsBiz
;
import
com.pcloud.book.adnews.biz.AdNewsBiz
;
import
com.pcloud.book.adnews.check.AdNewsCheck
;
import
com.pcloud.book.adnews.check.AdNewsCheck
;
import
com.pcloud.book.adnews.dao.*
;
import
com.pcloud.book.adnews.dao.AdNewsBanDao
;
import
com.pcloud.book.adnews.entity.*
;
import
com.pcloud.book.adnews.dao.AdNewsChooseDao
;
import
com.pcloud.book.adnews.dao.AdNewsClickRecordDao
;
import
com.pcloud.book.adnews.dao.AdNewsDao
;
import
com.pcloud.book.adnews.dao.AdNewsGroupDao
;
import
com.pcloud.book.adnews.dao.AdNewsGroupRecordDao
;
import
com.pcloud.book.adnews.dao.AdNewsMessageStatisticDao
;
import
com.pcloud.book.adnews.dao.AdNewsSetDao
;
import
com.pcloud.book.adnews.dao.AdNewsWechatChooseDao
;
import
com.pcloud.book.adnews.dao.AdNewsWechatDao
;
import
com.pcloud.book.adnews.entity.AdNews
;
import
com.pcloud.book.adnews.entity.AdNewsBan
;
import
com.pcloud.book.adnews.entity.AdNewsChoose
;
import
com.pcloud.book.adnews.entity.AdNewsClickRecord
;
import
com.pcloud.book.adnews.entity.AdNewsGroup
;
import
com.pcloud.book.adnews.entity.AdNewsGroupRecord
;
import
com.pcloud.book.adnews.entity.AdNewsMessageStatistic
;
import
com.pcloud.book.adnews.entity.AdNewsSet
;
import
com.pcloud.book.adnews.entity.AdNewsWechat
;
import
com.pcloud.book.adnews.entity.AdNewsWechatChoose
;
import
com.pcloud.book.adnews.enums.AdContentFromEnum
;
import
com.pcloud.book.adnews.enums.AdContentFromEnum
;
import
com.pcloud.book.adnews.enums.AdNewsBanEnum
;
import
com.pcloud.book.adnews.enums.AdNewsBanEnum
;
import
com.pcloud.book.adnews.dto.AdNewsListParam
;
import
com.pcloud.book.adnews.dto.AdNewsListParam
;
import
com.pcloud.book.adnews.enums.AdNewsContentTypeEnum
;
import
com.pcloud.book.adnews.enums.AdNewsContentTypeEnum
;
import
com.pcloud.book.adnews.enums.AdNewsSendRuleEnum
;
import
com.pcloud.book.adnews.vo.AdNewsGroupRecordVO
;
import
com.pcloud.book.adnews.vo.AdNewsGroupRecordVO
;
import
com.pcloud.book.adnews.vo.AdNewsMessageStatisticVO
;
import
com.pcloud.book.adnews.vo.AdNewsMessageStatisticVO
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
...
@@ -89,6 +108,9 @@ public class AdNewsBizImpl implements AdNewsBiz {
...
@@ -89,6 +108,9 @@ public class AdNewsBizImpl implements AdNewsBiz {
private
static
final
String
AD_EVENING_NEWS_SCHEDULE_PRE
=
"AD_EVENING_NEWS_SCHEDULE_"
;
private
static
final
String
AD_EVENING_NEWS_SCHEDULE_PRE
=
"AD_EVENING_NEWS_SCHEDULE_"
;
// 发送消息的长度限制
private
static
final
Integer
SEND_MESSAGE_LENGTH
=
1000
;
@Value
(
"${wechat.group.link.prefix}"
)
@Value
(
"${wechat.group.link.prefix}"
)
private
String
wechatGroupLinkPrefix
;
private
String
wechatGroupLinkPrefix
;
...
@@ -237,30 +259,19 @@ public class AdNewsBizImpl implements AdNewsBiz {
...
@@ -237,30 +259,19 @@ public class AdNewsBizImpl implements AdNewsBiz {
AdNewsMessageStatistic
adNewsMessageStatistic
;
AdNewsMessageStatistic
adNewsMessageStatistic
;
if
(
adNewsSet
.
getContentFrom
()
==
AdContentFromEnum
.
WECHAT
.
key
)
{
if
(
adNewsSet
.
getContentFrom
()
==
AdContentFromEnum
.
WECHAT
.
key
)
{
// 填充要发送的早晚报
setPushAdNewsList
(
adNewsSet
,
groupQrcodeFoAdDTOS
);
// 查询要发的记录
// 构建早晚报发送记录对象
List
<
AdNews
>
adNewsList
=
null
;
for
(
GroupQrcodeFoAdDTO
groupQrcodeFoAdDTO
:
groupQrcodeFoAdDTOS
)
{
if
(
ListUtils
.
isEmpty
(
groupQrcodeFoAdDTO
.
getAdNewsList
()))
{
adNewsList
=
adNewsDao
.
getNewsToSendBySetIdAndAdviser4Own
(
adNewsSetId
,
adNewsSet
.
getCreateUser
(),
adNewsSet
.
getSendCount
());
LOGGER
.
info
(
"BookGroupId:"
+
groupQrcodeFoAdDTO
.
getBookGroupId
()
+
" 没有可供发送的早晚报!"
);
// 如果自有公众号的数据为空,则查询系统推荐公众号数据
continue
;
if
(
ListUtils
.
isEmpty
(
adNewsList
))
{
adNewsList
=
adNewsDao
.
getNewsToSendBySetIdAndAdviser
(
adNewsSetId
,
adNewsSet
.
getCreateUser
(),
adNewsSet
.
getSendCount
());
}
else
if
(
adNewsList
.
size
()
<
adNewsSet
.
getSendCount
())
{
// 如果自有公众号的数据条数少于要发送的条数,则用系统推荐公众号的补齐剩余的条数
List
<
AdNews
>
_adNewsList
=
adNewsDao
.
getNewsToSendBySetIdAndAdviser
(
adNewsSetId
,
adNewsSet
.
getCreateUser
(),
adNewsSet
.
getSendCount
()-
adNewsList
.
size
());
if
(!
ListUtils
.
isEmpty
(
_adNewsList
)){
adNewsList
.
addAll
(
_adNewsList
);
}
}
}
if
(
ListUtils
.
isEmpty
(
adNewsList
))
{
this
.
replaceUnescaped
(
groupQrcodeFoAdDTO
.
getAdNewsList
());
LOGGER
.
info
(
"记录为空,没有可供发送的早晚报!"
);
return
;
}
// 构建记录对象
for
(
AdNews
adNews
:
groupQrcodeFoAdDTO
.
getAdNewsList
())
{
for
(
GroupQrcodeFoAdDTO
groupQrcodeFoAdDTO
:
groupQrcodeFoAdDTOS
)
{
for
(
AdNews
adNews
:
adNewsList
)
{
adNewsGroupRecord
=
new
AdNewsGroupRecord
();
adNewsGroupRecord
=
new
AdNewsGroupRecord
();
adNewsGroupRecord
.
setAdNewsId
(
adNews
.
getId
());
adNewsGroupRecord
.
setAdNewsId
(
adNews
.
getId
());
adNewsGroupRecord
.
setAdNewsSetId
(
adNewsSetId
);
adNewsGroupRecord
.
setAdNewsSetId
(
adNewsSetId
);
...
@@ -280,14 +291,15 @@ public class AdNewsBizImpl implements AdNewsBiz {
...
@@ -280,14 +291,15 @@ public class AdNewsBizImpl implements AdNewsBiz {
adNewsMessageStatistic
.
setClassifyId
(
groupQrcodeFoAdDTO
.
getClassifyId
());
adNewsMessageStatistic
.
setClassifyId
(
groupQrcodeFoAdDTO
.
getClassifyId
());
adNewsMessageStatistic
.
setQrcodeId
(
groupQrcodeFoAdDTO
.
getQrcodeId
());
adNewsMessageStatistic
.
setQrcodeId
(
groupQrcodeFoAdDTO
.
getQrcodeId
());
adNewsMessageStatistic
.
setCreateUser
(
adNewsSet
.
getCreateUser
());
adNewsMessageStatistic
.
setCreateUser
(
adNewsSet
.
getCreateUser
());
adNewsMessageStatistic
.
setMessageCount
(
adNewsList
.
size
());
adNewsMessageStatistic
.
setMessageCount
(
groupQrcodeFoAdDTO
.
getAdNewsList
()
.
size
());
adNewsMessageStatistic
.
setInsertMark
(
groupQrcodeFoAdDTOS
.
indexOf
(
groupQrcodeFoAdDTO
));
adNewsMessageStatistic
.
setInsertMark
(
groupQrcodeFoAdDTOS
.
indexOf
(
groupQrcodeFoAdDTO
));
adNewsMessageStatistics
.
add
(
adNewsMessageStatistic
);
adNewsMessageStatistics
.
add
(
adNewsMessageStatistic
);
}
}
// 因为拼短链接需要主键,所以需要先入库拿到主键后然后拼接Url,最后再发送微信消息;
// 因为拼短链接需要主键,所以需要先入库拿到主键后然后拼接Url,最后再发送微信消息;
// 记录入库
// 记录入库
this
.
insertRecord
(
adNewsGroupRecords
,
adNewsMessageStatistics
);
int
flag
=
this
.
insertRecord
(
adNewsGroupRecords
,
adNewsMessageStatistics
);
if
(
flag
==
0
){
return
;
}
// 拼接中转链接
// 拼接中转链接
String
transferUrl
;
String
transferUrl
;
...
@@ -299,7 +311,7 @@ public class AdNewsBizImpl implements AdNewsBiz {
...
@@ -299,7 +311,7 @@ public class AdNewsBizImpl implements AdNewsBiz {
// 获取对应当前群的记录详情
// 获取对应当前群的记录详情
if
(
groupQrcodeFoAdDTO
.
getQrcodeId
()
==
item
.
getQrcodeId
())
{
if
(
groupQrcodeFoAdDTO
.
getQrcodeId
()
==
item
.
getQrcodeId
())
{
// 将对应当前群里的需要发送的新闻链接拼接完成
// 将对应当前群里的需要发送的新闻链接拼接完成
adNews
=
adNewsList
.
stream
().
filter
(
x
->
x
.
getId
()
==
item
.
getAdNewsId
()).
findFirst
().
get
();
adNews
=
groupQrcodeFoAdDTO
.
getAdNewsList
()
.
stream
().
filter
(
x
->
x
.
getId
()
==
item
.
getAdNewsId
()).
findFirst
().
get
();
transferUrl
=
wechatGroupLinkPrefix
transferUrl
=
wechatGroupLinkPrefix
.
concat
(
"/link"
)
.
concat
(
"/link"
)
.
concat
(
"?message_statistic_id="
).
concat
(
item
.
getMessageStatisticId
().
toString
())
.
concat
(
"?message_statistic_id="
).
concat
(
item
.
getMessageStatisticId
().
toString
())
...
@@ -308,8 +320,8 @@ public class AdNewsBizImpl implements AdNewsBiz {
...
@@ -308,8 +320,8 @@ public class AdNewsBizImpl implements AdNewsBiz {
adNews
.
setShortUrl
(
UrlUtils
.
getShortUrl4Own
(
transferUrl
));
adNews
.
setShortUrl
(
UrlUtils
.
getShortUrl4Own
(
transferUrl
));
}
}
}
}
// 将多条需要发送的早晚报拼接成
300字符
一组的消息
// 将多条需要发送的早晚报拼接成
小于字数限制
一组的消息
contents
=
this
.
concatContent
(
adNewsList
);
contents
=
this
.
concatContent
(
groupQrcodeFoAdDTO
.
getAdNewsList
()
);
// 将对应群的消息发送出去
// 将对应群的消息发送出去
this
.
sendAdNewsToWechatGroup
(
adNewsSet
,
new
ArrayList
<
GroupQrcodeFoAdDTO
>()
{{
this
.
sendAdNewsToWechatGroup
(
adNewsSet
,
new
ArrayList
<
GroupQrcodeFoAdDTO
>()
{{
add
(
groupQrcodeFoAdDTO
);
add
(
groupQrcodeFoAdDTO
);
...
@@ -359,19 +371,157 @@ public class AdNewsBizImpl implements AdNewsBiz {
...
@@ -359,19 +371,157 @@ public class AdNewsBizImpl implements AdNewsBiz {
}
}
}
}
// 设置群标签名称
private
void
setGroupLabelName
(
List
<
GroupQrcodeFoAdDTO
>
groupQrcodeFoAdDTOS
)
{
List
<
Long
>
labelIds
=
new
ArrayList
<>();
for
(
GroupQrcodeFoAdDTO
item
:
groupQrcodeFoAdDTOS
)
{
if
(
item
.
getProLabelId
()
!=
null
)
{
labelIds
.
add
(
item
.
getProLabelId
());
}
if
(
item
.
getDepLabelId
()
!=
null
)
{
labelIds
.
add
(
item
.
getDepLabelId
());
}
if
(
item
.
getPurLabelId
()
!=
null
)
{
labelIds
.
add
(
item
.
getPurLabelId
());
}
}
Map
<
Long
,
String
>
labelMap
=
new
HashMap
<>();
if
(!
ListUtils
.
isEmpty
(
labelIds
))
{
labelMap
=
ResponseHandleUtil
.
parseMap
(
labelService
.
getLabelName
(
labelIds
),
Long
.
class
,
String
.
class
);
}
if
(!
MapUtils
.
isEmpty
(
labelMap
))
{
for
(
GroupQrcodeFoAdDTO
item
:
groupQrcodeFoAdDTOS
)
{
if
(
item
.
getProLabelId
()
!=
null
)
{
item
.
setProLabelName
(
labelMap
.
get
(
item
.
getProLabelId
()));
}
if
(
item
.
getDepLabelId
()
!=
null
)
{
item
.
setDepLabelName
(
labelMap
.
get
(
item
.
getDepLabelId
()));
}
if
(
item
.
getPurLabelId
()
!=
null
)
{
item
.
setPurLabelName
(
labelMap
.
get
(
item
.
getPurLabelId
()));
}
}
}
}
/**
* 根据规则获取推送的新闻
*
* 规则:优先推送自有公众号的内容,如果自有公众号的内容不够,再从公共库里进行挑选;
* 公共库需要用群的标签匹配新闻的标题,如果匹配不到再进行公众号的名称匹配,如果还是没有,最后则直接推送最新入库的数据
*
* @param adNewsSet
* @param groupQrcodeFoAdDTOS
* @return
*/
private
void
setPushAdNewsList
(
AdNewsSet
adNewsSet
,
List
<
GroupQrcodeFoAdDTO
>
groupQrcodeFoAdDTOS
)
{
// 获取自有公众号的新闻
List
<
AdNews
>
adNewsList
=
adNewsDao
.
getNewsToSendBySetIdAndAdviser4Own
(
adNewsSet
.
getId
(),
adNewsSet
.
getCreateUser
(),
adNewsSet
.
getSendCount
());
if
(
ListUtils
.
isEmpty
(
adNewsList
)){
adNewsList
=
new
ArrayList
<>();
}
// 初始化 groupQrcodeFoAdDTOS.adNewsList
for
(
GroupQrcodeFoAdDTO
groupQrcodeFoAdDTO
:
groupQrcodeFoAdDTOS
)
{
groupQrcodeFoAdDTO
.
setAdNewsList
(
adNewsList
.
stream
().
collect
(
Collectors
.
toList
()));
}
// 如果自有公众号的数据条数少于要发送的条数,则用系统推荐公众号的补齐剩余的条数
if
(
adNewsList
.
size
()
<
adNewsSet
.
getSendCount
()){
List
<
AdNews
>
_adNewsList
=
new
ArrayList
<>();
if
(
AdNewsSendRuleEnum
.
MATCH_LABEL
.
key
==
adNewsSet
.
getSendRule
()){
// 根据群批量查找社群码的标签
setGroupLabelName
(
groupQrcodeFoAdDTOS
);
// 标签去重进行匹配新闻
List
<
Long
>
bookGroupIds
=
groupQrcodeFoAdDTOS
.
stream
().
map
(
x
->
x
.
getBookGroupId
()).
distinct
().
collect
(
Collectors
.
toList
());
// 三天前
String
beginTime
=
DateUtils
.
formatDate
(
DateUtils
.
subDays
(
3
),
DateUtils
.
DATE_FORMAT_DATEONLY
);
for
(
GroupQrcodeFoAdDTO
groupQrcodeFoAdDTO
:
groupQrcodeFoAdDTOS
){
_adNewsList
=
adNewsDao
.
getNewsByLabelName
(
adNewsSet
.
getId
(),
adNewsSet
.
getCreateUser
(),
beginTime
,
groupQrcodeFoAdDTO
.
getProLabelName
(),
groupQrcodeFoAdDTO
.
getDepLabelName
(),
groupQrcodeFoAdDTO
.
getPurLabelName
(),
adNewsSet
.
getSendCount
()
-
groupQrcodeFoAdDTO
.
getAdNewsList
().
size
());
if
(!
ListUtils
.
isEmpty
(
_adNewsList
)){
groupQrcodeFoAdDTO
.
getAdNewsList
().
addAll
(
_adNewsList
);
}
// 如果筛选新闻条数还不够,继续再公众号匹配
if
(
groupQrcodeFoAdDTO
.
getAdNewsList
().
size
()
<
adNewsSet
.
getSendCount
())
{
_adNewsList
=
adNewsDao
.
getNews4WechatByLabelName
(
adNewsSet
.
getId
(),
adNewsSet
.
getCreateUser
(),
beginTime
,
groupQrcodeFoAdDTO
.
getProLabelName
(),
groupQrcodeFoAdDTO
.
getDepLabelName
(),
groupQrcodeFoAdDTO
.
getPurLabelName
(),
adNewsSet
.
getSendCount
()
-
groupQrcodeFoAdDTO
.
getAdNewsList
().
size
());
if
(!
ListUtils
.
isEmpty
(
_adNewsList
)){
groupQrcodeFoAdDTO
.
getAdNewsList
().
addAll
(
_adNewsList
);
}
}
// 继续筛选新闻条数不够的群,根据时间排序补齐剩余
if
(
groupQrcodeFoAdDTO
.
getAdNewsList
().
size
()
<
adNewsSet
.
getSendCount
())
{
_adNewsList
=
adNewsDao
.
getNewsToSendBySetIdAndAdviser
(
adNewsSet
.
getId
(),
adNewsSet
.
getCreateUser
(),
adNewsSet
.
getSendCount
()
-
groupQrcodeFoAdDTO
.
getAdNewsList
().
size
());
if
(!
ListUtils
.
isEmpty
(
_adNewsList
))
{
groupQrcodeFoAdDTO
.
getAdNewsList
().
addAll
(
_adNewsList
);
}
}
}
}
else
{
// 直接用最新数据补齐剩余条数
_adNewsList
=
adNewsDao
.
getNewsToSendBySetIdAndAdviser
(
adNewsSet
.
getId
(),
adNewsSet
.
getCreateUser
(),
adNewsSet
.
getSendCount
()
-
adNewsList
.
size
());
if
(!
ListUtils
.
isEmpty
(
_adNewsList
))
{
for
(
GroupQrcodeFoAdDTO
groupQrcodeFoAdDTO
:
groupQrcodeFoAdDTOS
)
{
groupQrcodeFoAdDTO
.
getAdNewsList
().
addAll
(
_adNewsList
);
}
}
}
}
}
/**
* 替换转义符
* @param adNewsList
*/
private
void
replaceUnescaped
(
List
<
AdNews
>
adNewsList
)
{
for
(
AdNews
adNews
:
adNewsList
)
{
if
(!
StringUtil
.
isEmpty
(
adNews
.
getTitle
()))
{
adNews
.
setTitle
(
adNews
.
getTitle
()
.
replaceAll
(
"&quot;"
,
"\""
)
.
replaceAll
(
" "
,
" "
));
}
}
}
/**
* 替换转义符
* @param adNewsGroupRecordVOS
*/
private
void
replaceUnescaped4Record
(
List
<
AdNewsGroupRecordVO
>
adNewsGroupRecordVOS
)
{
for
(
AdNewsGroupRecordVO
adNewsGroupRecordVO
:
adNewsGroupRecordVOS
)
{
if
(!
StringUtil
.
isEmpty
(
adNewsGroupRecordVO
.
getTitle
()))
{
adNewsGroupRecordVO
.
setTitle
(
adNewsGroupRecordVO
.
getTitle
()
.
replaceAll
(
"&quot;"
,
"\""
)
.
replaceAll
(
" "
,
" "
));
}
}
}
/**
/**
* 将发送记录入库
* 将发送记录入库
*
*
* @param adNewsGroupRecords
* @param adNewsGroupRecords
* @param adNewsMessageStatistics
* @param adNewsMessageStatistics
*/
*/
private
void
insertRecord
(
List
<
AdNewsGroupRecord
>
adNewsGroupRecords
,
List
<
AdNewsMessageStatistic
>
adNewsMessageStatistics
)
{
private
int
insertRecord
(
List
<
AdNewsGroupRecord
>
adNewsGroupRecords
,
List
<
AdNewsMessageStatistic
>
adNewsMessageStatistics
)
{
if
(
ListUtils
.
isEmpty
(
adNewsGroupRecords
)
||
ListUtils
.
isEmpty
(
adNewsMessageStatistics
)){
LOGGER
.
info
(
"没有可入库的数据,没有可供发送的早晚报内容"
);
return
0
;
}
adNewsMessageStatisticDao
.
batchInsert
(
adNewsMessageStatistics
);
adNewsMessageStatisticDao
.
batchInsert
(
adNewsMessageStatistics
);
// 将主键赋值给从表外键;(不会mybatis的主从表批量插入,所以只能这么做)
// 将主键赋值给从表外键;(不会mybatis的主从表批量插入,所以只能这么做)
for
(
AdNewsMessageStatistic
item
:
adNewsMessageStatistics
)
{
for
(
AdNewsMessageStatistic
item
:
adNewsMessageStatistics
)
{
adNewsGroupRecords
.
stream
().
filter
(
x
->
x
.
getInsertMark
()
==
item
.
getInsertMark
()).
forEach
(
x
->
x
.
setMessageStatisticId
(
item
.
getId
()));
adNewsGroupRecords
.
stream
().
filter
(
x
->
x
.
getInsertMark
()
==
item
.
getInsertMark
()).
forEach
(
x
->
x
.
setMessageStatisticId
(
item
.
getId
()));
}
}
adNewsGroupRecordDao
.
batchInsert
(
adNewsGroupRecords
);
adNewsGroupRecordDao
.
batchInsert
(
adNewsGroupRecords
);
return
1
;
}
}
/**
/**
...
@@ -396,7 +546,23 @@ public class AdNewsBizImpl implements AdNewsBiz {
...
@@ -396,7 +546,23 @@ public class AdNewsBizImpl implements AdNewsBiz {
String
robotId
=
wechatGroupConsr
.
getRobotIdByGroupId
(
weixinGroupId
);
String
robotId
=
wechatGroupConsr
.
getRobotIdByGroupId
(
weixinGroupId
);
if
(
StringUtil
.
isEmpty
(
robotId
))
{
if
(
StringUtil
.
isEmpty
(
robotId
))
{
LOGGER
.
info
(
"发送编辑端早晚报未找到小号"
+
weixinGroupId
);
LOGGER
.
info
(
"发送编辑端早晚报未找到小号"
+
weixinGroupId
);
continue
;
}
}
// 如果正文内容的长度小于1,说明文字少于限制数,那么就可以合并发送
if
(
contents
.
size
()==
1
){
String
temp
=
contents
.
get
(
0
);
if
(!
StringUtil
.
isEmpty
(
startContent
))
{
temp
=
startContent
.
concat
(
"\n\n"
).
concat
(
temp
);
}
if
(!
StringUtil
.
isEmpty
(
endContent
))
{
temp
=
temp
.
concat
(
"\n"
).
concat
(
endContent
);
}
// 合并后的字数长度小于限制则发送
if
(
temp
.
length
()
<=
SEND_MESSAGE_LENGTH
){
// 直接发送合并后的消息
sendAdNewsText
(
temp
,
robotId
,
weixinGroupId
);
continue
;
}
}
if
(!
StringUtil
.
isEmpty
(
startContent
))
{
if
(!
StringUtil
.
isEmpty
(
startContent
))
{
//发送开场语
//发送开场语
sendAdNewsText
(
startContent
,
robotId
,
weixinGroupId
);
sendAdNewsText
(
startContent
,
robotId
,
weixinGroupId
);
...
@@ -432,10 +598,10 @@ public class AdNewsBizImpl implements AdNewsBiz {
...
@@ -432,10 +598,10 @@ public class AdNewsBizImpl implements AdNewsBiz {
}
}
/**
/**
* 将内容拼接为
300字符一条数据项的数组【微信目前单次消息发送字符长度为300
】
* 将内容拼接为
SEND_MESSAGE_LENGTH 字符一条数据项的数组【微信目前单次消息发送字符长度存在字数限制
】
* 拼接内容大致为
* 拼接内容大致为
* 1.xxxxxxxxxxx 2.xxxxxxxxxx 3.xxxxxxxx 【假设此条数据加下一条数据【4.xxx】 就大于
300字符
,那就先将之前的存一条到数组】
* 1.xxxxxxxxxxx 2.xxxxxxxxxx 3.xxxxxxxx 【假设此条数据加下一条数据【4.xxx】 就大于
限制数
,那就先将之前的存一条到数组】
* 4.xxxxx 5.xxxxxxx 【多余
300
字符再重新拼接,以此循环下去】
* 4.xxxxx 5.xxxxxxx 【多余
限制数的
字符再重新拼接,以此循环下去】
*
*
* @param adNewsList
* @param adNewsList
* @return
* @return
...
@@ -446,8 +612,8 @@ public class AdNewsBizImpl implements AdNewsBiz {
...
@@ -446,8 +612,8 @@ public class AdNewsBizImpl implements AdNewsBiz {
int
i
=
1
;
int
i
=
1
;
for
(
AdNews
adNews
:
adNewsList
)
{
for
(
AdNews
adNews
:
adNewsList
)
{
String
temp
=
content
+
i
+
"."
+
adNews
.
getTitle
()
+
adNews
.
getShortUrl
()
+
"\n"
;
String
temp
=
content
+
i
+
"."
+
adNews
.
getTitle
()
+
adNews
.
getShortUrl
()
+
"\n"
;
if
(
temp
.
length
()
>=
1000
)
{
if
(
temp
.
length
()
>=
SEND_MESSAGE_LENGTH
)
{
// 如果本次拼接后的长度大于
300
,那么将之前拼接的内容存入数组
// 如果本次拼接后的长度大于
限制数
,那么将之前拼接的内容存入数组
contents
.
add
(
content
);
contents
.
add
(
content
);
// 重置 content 的内容
// 重置 content 的内容
content
=
i
+
"."
+
adNews
.
getTitle
()
+
adNews
.
getShortUrl
()
+
"\n"
;
content
=
i
+
"."
+
adNews
.
getTitle
()
+
adNews
.
getShortUrl
()
+
"\n"
;
...
@@ -524,6 +690,7 @@ public class AdNewsBizImpl implements AdNewsBiz {
...
@@ -524,6 +690,7 @@ public class AdNewsBizImpl implements AdNewsBiz {
map
.
put
(
"adNewsWechatIds"
,
adNewsListParam
.
getAdNewsWechatIds
());
map
.
put
(
"adNewsWechatIds"
,
adNewsListParam
.
getAdNewsWechatIds
());
map
.
put
(
"contentFrom"
,
adNewsListParam
.
getContentFrom
());
map
.
put
(
"contentFrom"
,
adNewsListParam
.
getContentFrom
());
PageBeanNew
<
AdNews
>
pageBeanNew
=
adNewsDao
.
listPageNew
(
pageParam
,
map
,
"getAdNewsList"
);
PageBeanNew
<
AdNews
>
pageBeanNew
=
adNewsDao
.
listPageNew
(
pageParam
,
map
,
"getAdNewsList"
);
this
.
replaceUnescaped
(
pageBeanNew
.
getRecordList
());
return
pageBeanNew
;
return
pageBeanNew
;
}
}
...
@@ -560,7 +727,6 @@ public class AdNewsBizImpl implements AdNewsBiz {
...
@@ -560,7 +727,6 @@ public class AdNewsBizImpl implements AdNewsBiz {
sendTextMessageVO
.
setWxGroupId
(
weixinGroupId
);
sendTextMessageVO
.
setWxGroupId
(
weixinGroupId
);
sendTextMessageVO
.
setIp
(
findIp
(
weixinGroupId
));
sendTextMessageVO
.
setIp
(
findIp
(
weixinGroupId
));
WxGroupSDK
.
sendTextMessage
(
sendTextMessageVO
);
WxGroupSDK
.
sendTextMessage
(
sendTextMessageVO
);
LOGGER
.
info
(
"发送编辑端早晚报"
+
sendTextMessageVO
.
toString
());
}
}
@ParamLog
(
"删除创建编辑早晚报定时任务"
)
@ParamLog
(
"删除创建编辑早晚报定时任务"
)
...
@@ -725,7 +891,9 @@ public class AdNewsBizImpl implements AdNewsBiz {
...
@@ -725,7 +891,9 @@ public class AdNewsBizImpl implements AdNewsBiz {
@Override
@Override
@ParamLog
(
"查询早晚报发送详情"
)
@ParamLog
(
"查询早晚报发送详情"
)
public
List
<
AdNewsGroupRecordVO
>
getAdNewsGroupRecord
(
Long
partyId
,
Long
messageStatisticId
)
{
public
List
<
AdNewsGroupRecordVO
>
getAdNewsGroupRecord
(
Long
partyId
,
Long
messageStatisticId
)
{
return
adNewsGroupRecordDao
.
getAdNewsGroupRecord
(
partyId
,
messageStatisticId
);
List
<
AdNewsGroupRecordVO
>
adNewsGroupRecordVOS
=
adNewsGroupRecordDao
.
getAdNewsGroupRecord
(
partyId
,
messageStatisticId
);
this
.
replaceUnescaped4Record
(
adNewsGroupRecordVOS
);
return
adNewsGroupRecordVOS
;
}
}
@Override
@Override
...
...
pcloud-service-book/src/main/java/com/pcloud/book/adnews/dao/AdNewsDao.java
View file @
05feca4c
...
@@ -17,4 +17,30 @@ public interface AdNewsDao extends BaseDao<AdNews> {
...
@@ -17,4 +17,30 @@ public interface AdNewsDao extends BaseDao<AdNews> {
* @return
* @return
*/
*/
List
<
AdNews
>
getNewsToSendBySetIdAndAdviser4Own
(
Long
adNewsSetId
,
Long
adviserId
,
Integer
top
);
List
<
AdNews
>
getNewsToSendBySetIdAndAdviser4Own
(
Long
adNewsSetId
,
Long
adviserId
,
Integer
top
);
/**
* 根据标签匹配新闻————新闻标题
* @param adNewsSetId
* @param adviserId
* @param beginTime
* @param proLabelName
* @param depLabelName
* @param purLabelName
* @param top
* @return
*/
List
<
AdNews
>
getNewsByLabelName
(
Long
adNewsSetId
,
Long
adviserId
,
String
beginTime
,
String
proLabelName
,
String
depLabelName
,
String
purLabelName
,
Integer
top
);
/**
* 根据标签匹配新闻————公众号名称
* @param adNewsSetId
* @param adviserId
* @param beginTime
* @param proLabelName
* @param depLabelName
* @param purLabelName
* @param top
* @return
*/
List
<
AdNews
>
getNews4WechatByLabelName
(
Long
adNewsSetId
,
Long
adviserId
,
String
beginTime
,
String
proLabelName
,
String
depLabelName
,
String
purLabelName
,
Integer
top
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/adnews/dao/impl/AdNewsDaoImpl.java
View file @
05feca4c
...
@@ -33,4 +33,30 @@ public class AdNewsDaoImpl extends BaseDaoImpl<AdNews> implements AdNewsDao {
...
@@ -33,4 +33,30 @@ public class AdNewsDaoImpl extends BaseDaoImpl<AdNews> implements AdNewsDao {
map
.
put
(
"top"
,
top
);
map
.
put
(
"top"
,
top
);
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getNewsToSendBySetIdAndAdviser4Own"
),
map
);
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getNewsToSendBySetIdAndAdviser4Own"
),
map
);
}
}
@Override
public
List
<
AdNews
>
getNewsByLabelName
(
Long
adNewsSetId
,
Long
adviserId
,
String
beginTime
,
String
proLabelName
,
String
depLabelName
,
String
purLabelName
,
Integer
top
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"adNewsSetId"
,
adNewsSetId
);
map
.
put
(
"adviserId"
,
adviserId
);
map
.
put
(
"beginTime"
,
beginTime
);
map
.
put
(
"proLabelName"
,
proLabelName
);
map
.
put
(
"depLabelName"
,
depLabelName
);
map
.
put
(
"purLabelName"
,
purLabelName
);
map
.
put
(
"top"
,
top
);
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getNewsByLabelName"
),
map
);
}
@Override
public
List
<
AdNews
>
getNews4WechatByLabelName
(
Long
adNewsSetId
,
Long
adviserId
,
String
beginTime
,
String
proLabelName
,
String
depLabelName
,
String
purLabelName
,
Integer
top
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"adNewsSetId"
,
adNewsSetId
);
map
.
put
(
"adviserId"
,
adviserId
);
map
.
put
(
"beginTime"
,
beginTime
);
map
.
put
(
"proLabelName"
,
proLabelName
);
map
.
put
(
"depLabelName"
,
depLabelName
);
map
.
put
(
"purLabelName"
,
purLabelName
);
map
.
put
(
"top"
,
top
);
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getNews4WechatByLabelName"
),
map
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/adnews/entity/AdNewsSet.java
View file @
05feca4c
...
@@ -33,6 +33,9 @@ public class AdNewsSet extends BaseEntity {
...
@@ -33,6 +33,9 @@ public class AdNewsSet extends BaseEntity {
@ApiModelProperty
(
"发送次数"
)
@ApiModelProperty
(
"发送次数"
)
private
Integer
sendCount
;
private
Integer
sendCount
;
@ApiModelProperty
(
"发送规则"
)
private
Integer
sendRule
;
@ApiModelProperty
(
"开场语"
)
@ApiModelProperty
(
"开场语"
)
private
String
startContent
;
private
String
startContent
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/adnews/enums/AdNewsSendRuleEnum.java
0 → 100644
View file @
05feca4c
package
com
.
pcloud
.
book
.
adnews
.
enums
;
/**
* @author zhengyongqiang
* @date 2019/10/9 9:39
*/
public
enum
AdNewsSendRuleEnum
{
LAST_UPDATE
(
0
,
"最近更新"
),
MATCH_LABEL
(
1
,
"匹配标签"
);
public
final
Integer
key
;
public
final
String
description
;
AdNewsSendRuleEnum
(
Integer
key
,
String
description
)
{
this
.
key
=
key
;
this
.
description
=
description
;
}
public
static
String
getDescriptionByKey
(
Integer
key
)
{
AdNewsSendRuleEnum
[]
var1
=
values
();
int
var2
=
var1
.
length
;
for
(
int
var3
=
0
;
var3
<
var2
;
++
var3
)
{
AdNewsSendRuleEnum
methodEnum
=
var1
[
var3
];
if
(
methodEnum
.
key
.
equals
(
key
))
{
return
methodEnum
.
description
;
}
}
return
null
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/advertising/biz/impl/AdvertisingSpaceBizImpl.java
View file @
05feca4c
...
@@ -294,7 +294,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
...
@@ -294,7 +294,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
Long
seconds
=
detailFile
.
getFilePilotSecond
();
Long
seconds
=
detailFile
.
getFilePilotSecond
();
String
title
=
detailFile
.
getTitle
();
String
title
=
detailFile
.
getTitle
();
//总时长
//总时长
Integer
duration
=
null
;
BigDecimal
duration
=
null
;
if
(!
StringUtil
.
isEmpty
(
fileId
))
{
if
(!
StringUtil
.
isEmpty
(
fileId
))
{
//获取转码路径
//获取转码路径
FileUploadInfo
fileUploadInfo
=
convertConsr
.
getByFileId
(
fileId
);
FileUploadInfo
fileUploadInfo
=
convertConsr
.
getByFileId
(
fileId
);
...
@@ -305,7 +305,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
...
@@ -305,7 +305,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
duration
=
fileUploadInfo
.
getDuration
();
duration
=
fileUploadInfo
.
getDuration
();
detailFile
.
setFileUrl
(
fileUrl
);
detailFile
.
setFileUrl
(
fileUrl
);
if
(
null
!=
duration
)
{
if
(
null
!=
duration
)
{
detailFile
.
setFileDuration
(
duration
.
longValue
()
);
detailFile
.
setFileDuration
(
duration
);
}
}
}
}
/* if (StringUtil.isEmpty(fileUrl) && !StringUtil.isEmpty(fileId)) {
/* if (StringUtil.isEmpty(fileUrl) && !StringUtil.isEmpty(fileId)) {
...
@@ -314,7 +314,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
...
@@ -314,7 +314,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
advertisingSpace.setAdDetailFileConvertState(0);
advertisingSpace.setAdDetailFileConvertState(0);
return advertisingSpace;
return advertisingSpace;
}*/
}*/
if
(
null
!=
duration
&&
null
!=
seconds
&&
seconds
>=
duration
)
{
if
(
null
!=
duration
&&
null
!=
seconds
&&
BigDecimal
.
valueOf
(
seconds
.
doubleValue
()).
compareTo
(
duration
)
>=
0
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"资源"
+
title
+
"时长"
+
duration
+
"s,试听/试看时长超过该时长,请重新设置"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"资源"
+
title
+
"时长"
+
duration
+
"s,试听/试看时长超过该时长,请重新设置"
);
}
}
if
(!
StringUtil
.
isEmpty
(
fileUrl
))
{
//剪切文件
if
(!
StringUtil
.
isEmpty
(
fileUrl
))
{
//剪切文件
...
@@ -349,7 +349,6 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
...
@@ -349,7 +349,6 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【文件转换(消)】向文件转换中心发送通知.[sendConvertFileQueue]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【文件转换(消)】向文件转换中心发送通知.[sendConvertFileQueue]:"
+
e
.
getMessage
(),
e
);
}
}
LOGGER
.
info
(
"【文件转换(消)】向文件转换中心发送通知,<END>"
);
}
}
/**
/**
...
@@ -655,7 +654,6 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
...
@@ -655,7 +654,6 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
// 获取群信息
// 获取群信息
GroupQrcode
groupQrcode
=
groupQrcodeDao
.
getById
(
group
.
getQrcodeId
());
GroupQrcode
groupQrcode
=
groupQrcodeDao
.
getById
(
group
.
getQrcodeId
());
String
groupId
=
groupQrcode
.
getWeixinGroupId
();
String
groupId
=
groupQrcode
.
getWeixinGroupId
();
ClassifyDTO
classifyDTO
=
bookGroupClassifyDao
.
getById
(
group
.
getClassifyId
());
// 获取机器人微信号
// 获取机器人微信号
String
altId
=
wechatGroupConsr
.
getSendAdRobotByGroupId
(
groupId
);
String
altId
=
wechatGroupConsr
.
getSendAdRobotByGroupId
(
groupId
);
if
(
StringUtil
.
isEmpty
(
altId
))
{
if
(
StringUtil
.
isEmpty
(
altId
))
{
...
...
pcloud-service-book/src/main/java/com/pcloud/book/advertising/entity/AdvertisingDetailFile.java
View file @
05feca4c
...
@@ -3,6 +3,7 @@ package com.pcloud.book.advertising.entity;
...
@@ -3,6 +3,7 @@ package com.pcloud.book.advertising.entity;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pcloud.common.entity.BaseEntity
;
import
com.pcloud.common.entity.BaseEntity
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.Date
;
/**
/**
...
@@ -35,7 +36,7 @@ public class AdvertisingDetailFile extends BaseEntity{
...
@@ -35,7 +36,7 @@ public class AdvertisingDetailFile extends BaseEntity{
/**
/**
*文件时长
*文件时长
*/
*/
private
Long
fileDuration
;
private
BigDecimal
fileDuration
;
/**
/**
*文件路径
*文件路径
*/
*/
...
@@ -116,11 +117,11 @@ public class AdvertisingDetailFile extends BaseEntity{
...
@@ -116,11 +117,11 @@ public class AdvertisingDetailFile extends BaseEntity{
this
.
fileName
=
fileName
==
null
?
null
:
fileName
.
trim
();
this
.
fileName
=
fileName
==
null
?
null
:
fileName
.
trim
();
}
}
public
Long
getFileDuration
()
{
public
BigDecimal
getFileDuration
()
{
return
fileDuration
;
return
fileDuration
;
}
}
public
void
setFileDuration
(
Long
fileDuration
)
{
public
void
setFileDuration
(
BigDecimal
fileDuration
)
{
this
.
fileDuration
=
fileDuration
;
this
.
fileDuration
=
fileDuration
;
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/appeal/biz/impl/BookAppealBizImpl.java
View file @
05feca4c
...
@@ -334,7 +334,6 @@ public class BookAppealBizImpl implements BookAppealBiz {
...
@@ -334,7 +334,6 @@ public class BookAppealBizImpl implements BookAppealBiz {
insertBookAppealResult
(
bookAppealDto
.
getBookId
(),
bookAppealDto
.
getBookAppealId
());
insertBookAppealResult
(
bookAppealDto
.
getBookId
(),
bookAppealDto
.
getBookAppealId
());
// 发送模板消息
// 发送模板消息
sendAppealTemplate
(
isOnlyOneAdviser
,
appealAdviserId
,
adviserBooks
,
bookId
,
bookAppealDto
.
getChannelId
(),
mainAdviserId
);
sendAppealTemplate
(
isOnlyOneAdviser
,
appealAdviserId
,
adviserBooks
,
bookId
,
bookAppealDto
.
getChannelId
(),
mainAdviserId
);
LOGGER
.
info
(
"【书籍申诉-平台】设置主编辑,<END>."
);
}
}
/**
/**
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookAdviserBizImpl.java
View file @
05feca4c
...
@@ -147,7 +147,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -147,7 +147,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
// 默认是主编辑
// 默认是主编辑
bookAdviser
.
setIsMainEditor
(
true
);
bookAdviser
.
setIsMainEditor
(
true
);
bookAdviserDao
.
insert
(
bookAdviser
);
bookAdviserDao
.
insert
(
bookAdviser
);
LOGGER
.
info
(
"【书籍-编辑】编辑设置书籍推广信息,<END>"
);
}
catch
(
DataIntegrityViolationException
e
)
{
}
catch
(
DataIntegrityViolationException
e
)
{
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"该书刊已经被别的编辑添加过"
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"该书刊已经被别的编辑添加过"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -235,7 +234,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -235,7 +234,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
}
}
LOGGER
.
info
(
"【书籍-编辑】删除编辑和书籍的推广信息,<START>.[bookId]="
+
bookId
);
LOGGER
.
info
(
"【书籍-编辑】删除编辑和书籍的推广信息,<START>.[bookId]="
+
bookId
);
bookAdviserDao
.
deleteByBook
(
bookId
);
bookAdviserDao
.
deleteByBook
(
bookId
);
LOGGER
.
info
(
"【书籍-编辑】删除编辑和书籍的推广信息,<END>"
);
}
}
/**
/**
...
@@ -251,7 +249,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -251,7 +249,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
try
{
try
{
LOGGER
.
info
(
"【书籍-编辑】批量删除书刊的推广信息,<START>.[bookIds]="
+
bookIds
.
toString
());
LOGGER
.
info
(
"【书籍-编辑】批量删除书刊的推广信息,<START>.[bookIds]="
+
bookIds
.
toString
());
bookAdviserDao
.
deleteByBooks
(
bookIds
);
bookAdviserDao
.
deleteByBooks
(
bookIds
);
LOGGER
.
info
(
"【书籍-编辑】批量删除书刊的推广信息,<END>"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【书籍-编辑】批量删除书刊的推广信息,<ERROR>.[bookAdviserDao.deleteByBooks]"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【书籍-编辑】批量删除书刊的推广信息,<ERROR>.[bookAdviserDao.deleteByBooks]"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"批量删除书刊的推广信息失败"
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"批量删除书刊的推广信息失败"
);
...
@@ -480,7 +477,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -480,7 +477,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
LOGGER
.
info
(
"【书籍-编辑】编辑设置书籍推广信息,<START>.[bookAdviser]="
+
bookAdviser
.
toString
());
LOGGER
.
info
(
"【书籍-编辑】编辑设置书籍推广信息,<START>.[bookAdviser]="
+
bookAdviser
.
toString
());
// 默认是主编辑
// 默认是主编辑
bookAdviserDao
.
insert
(
bookAdviser
);
bookAdviserDao
.
insert
(
bookAdviser
);
LOGGER
.
info
(
"【书籍-编辑】编辑设置书籍推广信息,<END>"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
warn
(
"【书籍-编辑】编辑设置书籍推广信息,<ERROR>.[BookAdviserDao.insert]"
+
e
.
getMessage
(),
e
);
LOGGER
.
warn
(
"【书籍-编辑】编辑设置书籍推广信息,<ERROR>.[BookAdviserDao.insert]"
+
e
.
getMessage
(),
e
);
}
}
...
@@ -620,7 +616,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -620,7 +616,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
deleteBook4ViceAdviser
(
bookId
,
adviserId
,
channelId
);
deleteBook4ViceAdviser
(
bookId
,
adviserId
,
channelId
);
}
}
LOGGER
.
info
(
"删除书籍(编辑端)<END>"
);
}
}
/**
/**
...
@@ -645,7 +640,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -645,7 +640,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
// 删除读者端的书架的书籍
// 删除读者端的书架的书籍
bookcaseConsr
.
deleteBookForAdviser
(
bookId
,
channelId
,
adviserId
);
bookcaseConsr
.
deleteBookForAdviser
(
bookId
,
channelId
,
adviserId
);
}
}
LOGGER
.
info
(
"删除主编辑书籍<END>."
);
}
}
/**
/**
...
@@ -667,7 +661,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -667,7 +661,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
updateBookAdviserStatus
(
bookId
,
adviserId
,
channelId
,
null
,
null
,
BookConstant
.
BOOK_ADVISER_DELETE
,
null
);
updateBookAdviserStatus
(
bookId
,
adviserId
,
channelId
,
null
,
null
,
BookConstant
.
BOOK_ADVISER_DELETE
,
null
);
// 删除读者端的书架的书籍
// 删除读者端的书架的书籍
bookcaseConsr
.
deleteBookForAdviser
(
bookId
,
channelId
,
adviserId
);
bookcaseConsr
.
deleteBookForAdviser
(
bookId
,
channelId
,
adviserId
);
LOGGER
.
info
(
"删除副编辑书籍<END>."
);
}
}
/**
/**
...
@@ -686,7 +679,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -686,7 +679,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
qrcodeSceneConsr
.
recoverByBook
(
bookId
,
channelId
,
adviserId
);
qrcodeSceneConsr
.
recoverByBook
(
bookId
,
channelId
,
adviserId
);
}
}
LOGGER
.
info
(
"恢复书籍-编辑 ,<END>"
);
}
}
/**
/**
...
@@ -713,7 +705,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -713,7 +705,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
if
(
BookConstant
.
BOOK_ADVISER_DELETE
.
equals
(
deleteStatus
))
{
if
(
BookConstant
.
BOOK_ADVISER_DELETE
.
equals
(
deleteStatus
))
{
bookGroupBiz
.
deleteByBookId
(
bookId
,
channelId
,
adviserId
);
bookGroupBiz
.
deleteByBookId
(
bookId
,
channelId
,
adviserId
);
}
}
LOGGER
.
info
(
"修改书籍编辑的状态(删除或者恢复) <END>"
);
}
}
/**
/**
...
@@ -727,7 +718,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -727,7 +718,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
countDto
.
setCount
(
count
);
countDto
.
setCount
(
count
);
Integer
bookGroupCount
=
bookGroupDao
.
getBookGroupCount
(
adviserId
);
Integer
bookGroupCount
=
bookGroupDao
.
getBookGroupCount
(
adviserId
);
countDto
.
setBookGroupCount
(
bookGroupCount
);
countDto
.
setBookGroupCount
(
bookGroupCount
);
LOGGER
.
info
(
"获取编辑的图书总数 ,<END>"
);
return
countDto
;
return
countDto
;
}
}
...
@@ -738,7 +728,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -738,7 +728,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
public
void
setBookTemplet
(
BookAdviser
bookAdviser
)
{
public
void
setBookTemplet
(
BookAdviser
bookAdviser
)
{
LOGGER
.
info
(
"设置图书使用模板【START】bookAdviser="
+
bookAdviser
);
LOGGER
.
info
(
"设置图书使用模板【START】bookAdviser="
+
bookAdviser
);
bookAdviserDao
.
updateBookTemplet
(
bookAdviser
);
bookAdviserDao
.
updateBookTemplet
(
bookAdviser
);
LOGGER
.
info
(
"设置图书使用模板【END】"
);
}
}
@Override
@Override
@ParamLog
(
value
=
"获取图书基本信息"
,
isBefore
=
false
,
isAfterReturn
=
false
)
@ParamLog
(
value
=
"获取图书基本信息"
,
isBefore
=
false
,
isAfterReturn
=
false
)
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookAppBizImpl.java
View file @
05feca4c
...
@@ -3,19 +3,8 @@
...
@@ -3,19 +3,8 @@
*/
*/
package
com
.
pcloud
.
book
.
book
.
biz
.
impl
;
package
com
.
pcloud
.
book
.
book
.
biz
.
impl
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.dao.DataIntegrityViolationException
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.book.biz.BookAppBiz
;
import
com.pcloud.book.book.biz.BookAppBiz
;
import
com.pcloud.book.book.cache.BookAppCache
;
import
com.pcloud.book.book.cache.BookAppCache
;
...
@@ -26,6 +15,18 @@ import com.pcloud.book.book.set.BookSet;
...
@@ -26,6 +15,18 @@ import com.pcloud.book.book.set.BookSet;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.dao.DataIntegrityViolationException
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @描述:
* @描述:
* @作者:songx
* @作者:songx
...
@@ -55,13 +56,12 @@ public class BookAppBizImpl implements BookAppBiz {
...
@@ -55,13 +56,12 @@ public class BookAppBizImpl implements BookAppBiz {
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
create
(
BookApp
bookApp
)
throws
BizException
{
public
void
create
(
BookApp
bookApp
)
throws
BizException
{
LOGGER
.
info
(
"【书籍-应用-编辑】创建书刊应用关联,bookApp:{}"
,
bookApp
);
// 校验参数
// 校验参数
this
.
checkParam
(
bookApp
);
this
.
checkParam
(
bookApp
);
try
{
try
{
LOGGER
.
info
(
"【书籍-应用-编辑】创建书刊应用关联,<START>.[bookApp]="
+
bookApp
.
toString
());
bookAppDao
.
insert
(
bookApp
);
bookAppDao
.
insert
(
bookApp
);
LOGGER
.
info
(
"【书籍-应用-编辑】创建书刊应用关联,<END>"
);
}
catch
(
DataIntegrityViolationException
e
)
{
}
catch
(
DataIntegrityViolationException
e
)
{
LOGGER
.
error
(
"【书籍-应用-编辑】创建书刊应用关联,已关联过>>>>>>"
+
e
.
getMessage
());
LOGGER
.
error
(
"【书籍-应用-编辑】创建书刊应用关联,已关联过>>>>>>"
+
e
.
getMessage
());
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"请稍等,正在处理中..."
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"请稍等,正在处理中..."
);
...
@@ -153,7 +153,6 @@ public class BookAppBizImpl implements BookAppBiz {
...
@@ -153,7 +153,6 @@ public class BookAppBizImpl implements BookAppBiz {
try
{
try
{
LOGGER
.
info
(
"【书籍-应用-编辑】删除书刊应用关联,<START>.[bookAppId]="
+
bookAppId
);
LOGGER
.
info
(
"【书籍-应用-编辑】删除书刊应用关联,<START>.[bookAppId]="
+
bookAppId
);
bookAppDao
.
deleteById
(
bookAppId
);
bookAppDao
.
deleteById
(
bookAppId
);
LOGGER
.
info
(
"【书籍-应用-编辑】删除书刊应用关联,<END>"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【书籍-应用-编辑】删除书刊应用关联,<ERROR>.[bookDao.deleteById]"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【书籍-应用-编辑】删除书刊应用关联,<ERROR>.[bookDao.deleteById]"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"删除书刊应用关联失败~!"
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"删除书刊应用关联失败~!"
);
...
@@ -183,7 +182,6 @@ public class BookAppBizImpl implements BookAppBiz {
...
@@ -183,7 +182,6 @@ public class BookAppBizImpl implements BookAppBiz {
try
{
try
{
LOGGER
.
info
(
"【书籍-应用-编辑】根据书籍删除关联的应用,<START>.[bookId]="
+
bookId
);
LOGGER
.
info
(
"【书籍-应用-编辑】根据书籍删除关联的应用,<START>.[bookId]="
+
bookId
);
bookAppDao
.
deleteByBook
(
bookId
);
bookAppDao
.
deleteByBook
(
bookId
);
LOGGER
.
info
(
"【书籍-应用-编辑】根据书籍删除关联的应用,<END>"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【书籍-应用-编辑】根据书籍删除关联的应用,<ERROR>.[bookDao.deleteByBook]"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【书籍-应用-编辑】根据书籍删除关联的应用,<ERROR>.[bookDao.deleteByBook]"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"根据书籍删除关联的应用失败~!"
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"根据书籍删除关联的应用失败~!"
);
...
@@ -204,7 +202,6 @@ public class BookAppBizImpl implements BookAppBiz {
...
@@ -204,7 +202,6 @@ public class BookAppBizImpl implements BookAppBiz {
try
{
try
{
LOGGER
.
info
(
"【书籍-应用-编辑】批量删除应用关联关系,<START>.[bookIds]="
+
bookIds
.
toString
());
LOGGER
.
info
(
"【书籍-应用-编辑】批量删除应用关联关系,<START>.[bookIds]="
+
bookIds
.
toString
());
bookAppDao
.
deleteByBooks
(
bookIds
);
bookAppDao
.
deleteByBooks
(
bookIds
);
LOGGER
.
info
(
"【书籍-应用-编辑】批量删除应用关联关系,<END>"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【书籍-应用-编辑】批量删除应用关联关系,<ERROR>.[bookDao.deleteByBooks]"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【书籍-应用-编辑】批量删除应用关联关系,<ERROR>.[bookDao.deleteByBooks]"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"批量删除应用关联关系失败~!"
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"批量删除应用关联关系失败~!"
);
...
@@ -223,6 +220,7 @@ public class BookAppBizImpl implements BookAppBiz {
...
@@ -223,6 +220,7 @@ public class BookAppBizImpl implements BookAppBiz {
*/
*/
@Override
@Override
public
List
<
BookAppDto
>
listBaseById
(
BookApp
bookApp
)
throws
BizException
{
public
List
<
BookAppDto
>
listBaseById
(
BookApp
bookApp
)
throws
BizException
{
LOGGER
.
info
(
"【书籍-应用-编辑】获取单个书籍和应用关联关系,[bookApp]:{}"
,
bookApp
);
// 校验参数
// 校验参数
if
(
bookApp
.
getBookId
()
==
null
)
{
if
(
bookApp
.
getBookId
()
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"书籍标识不能为空~!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"书籍标识不能为空~!"
);
...
@@ -233,19 +231,16 @@ public class BookAppBizImpl implements BookAppBiz {
...
@@ -233,19 +231,16 @@ public class BookAppBizImpl implements BookAppBiz {
if
(
bookApp
.
getChannelId
()
==
null
)
{
if
(
bookApp
.
getChannelId
()
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"渠道标识不能为空~!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"渠道标识不能为空~!"
);
}
}
//从缓存中读取书籍与应用关联关系
//从缓存中读取书籍与应用关联关系
List
<
BookAppDto
>
listBookAppAssoc
=
bookAppCache
.
listBookAppAssoc
(
bookApp
.
getBookId
(),
bookApp
.
getChannelId
(),
bookApp
.
getCreatedUser
());
List
<
BookAppDto
>
listBookAppAssoc
=
bookAppCache
.
listBookAppAssoc
(
bookApp
.
getBookId
(),
bookApp
.
getChannelId
(),
bookApp
.
getCreatedUser
());
if
(
ListUtils
.
isEmpty
(
listBookAppAssoc
)){
if
(
ListUtils
.
isEmpty
(
listBookAppAssoc
)){
try
{
try
{
LOGGER
.
info
(
"【书籍-应用-编辑】获取单个书籍和应用关联关系,<PARAM>.[bookApp]="
+
bookApp
.
toString
());
listBookAppAssoc
=
bookAppDao
.
listBaseById
(
bookApp
);
listBookAppAssoc
=
bookAppDao
.
listBaseById
(
bookApp
);
if
(
listBookAppAssoc
==
null
)
{
if
(
listBookAppAssoc
==
null
)
{
listBookAppAssoc
=
new
ArrayList
<>();
listBookAppAssoc
=
new
ArrayList
<>();
}
else
{
}
else
{
bookAppCache
.
setBookAppAssoc
(
bookApp
.
getBookId
(),
bookApp
.
getChannelId
(),
bookApp
.
getCreatedUser
(),
listBookAppAssoc
);
bookAppCache
.
setBookAppAssoc
(
bookApp
.
getBookId
(),
bookApp
.
getChannelId
(),
bookApp
.
getCreatedUser
(),
listBookAppAssoc
);
}
}
LOGGER
.
info
(
"【书籍-应用-编辑】获取单个书籍和应用关联关系,<END>.[listBookAppAssoc]="
+
listBookAppAssoc
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【书籍-应用-编辑】获取单个书籍和应用关联关系,<ERROR>.[bookAppDao.getById]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【书籍-应用-编辑】获取单个书籍和应用关联关系,<ERROR>.[bookAppDao.getById]:"
+
e
.
getMessage
(),
e
);
throw
BizException
.
DB_SELECT_IS_FAIL
;
throw
BizException
.
DB_SELECT_IS_FAIL
;
...
@@ -345,7 +340,6 @@ public class BookAppBizImpl implements BookAppBiz {
...
@@ -345,7 +340,6 @@ public class BookAppBizImpl implements BookAppBiz {
LOGGER
.
error
(
"修改书籍应用关系,<ERROR>.[updateBookAppStatus]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"修改书籍应用关系,<ERROR>.[updateBookAppStatus]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"修改书籍应用关系失败"
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"修改书籍应用关系失败"
);
}
}
LOGGER
.
info
(
"修改书籍应用关系,<END>"
);
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookBizImpl.java
View file @
05feca4c
...
@@ -74,10 +74,12 @@ import org.springframework.beans.BeanUtils;
...
@@ -74,10 +74,12 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
...
@@ -151,7 +153,7 @@ public class BookBizImpl implements BookBiz {
...
@@ -151,7 +153,7 @@ public class BookBizImpl implements BookBiz {
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BookDto
create
(
Book
book
,
String
systemCode
)
throws
BizException
{
public
BookDto
create
(
Book
book
,
String
systemCode
)
throws
BizException
{
LOGGER
.
info
(
"【书籍基础】创建书籍基础信息,<START>.[book]
="
+
book
);
LOGGER
.
info
(
"【书籍基础】创建书籍基础信息,<START>.[book]
:{};systemCode:{}"
,
book
,
systemCode
);
this
.
checkAddParam
(
book
);
this
.
checkAddParam
(
book
);
// 判断书籍ISBN码是否存在,同时判断书籍ISBN码是否符合规范
// 判断书籍ISBN码是否存在,同时判断书籍ISBN码是否符合规范
if
(
this
.
isbnExists
(
book
.
getTypeCode
(),
book
.
getIsbn
(),
book
.
getSerialNumber
()))
{
if
(
this
.
isbnExists
(
book
.
getTypeCode
(),
book
.
getIsbn
(),
book
.
getSerialNumber
()))
{
...
@@ -174,7 +176,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -174,7 +176,6 @@ public class BookBizImpl implements BookBiz {
}
}
// 书籍总数缓存加1
// 书籍总数缓存加1
bookCache
.
incrObject
(
BookConstant
.
BOOK_CACHE
+
"PLATFORM_BOOK_COUNT"
);
bookCache
.
incrObject
(
BookConstant
.
BOOK_CACHE
+
"PLATFORM_BOOK_COUNT"
);
LOGGER
.
info
(
"【书籍基础】创建书籍基础信息,<END>"
);
return
bookDto
;
return
bookDto
;
}
}
...
@@ -205,7 +206,7 @@ public class BookBizImpl implements BookBiz {
...
@@ -205,7 +206,7 @@ public class BookBizImpl implements BookBiz {
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
update
(
Book
book
)
throws
BizException
{
public
void
update
(
Book
book
)
throws
BizException
{
LOGGER
.
info
(
"【书籍基础】修改书籍基础信息,<PARAM>.[book]=
"
+
book
.
toString
()
);
LOGGER
.
info
(
"【书籍基础】修改书籍基础信息,<PARAM>.[book]=
{}"
,
book
);
// 校验参数
// 校验参数
this
.
checkParam
(
book
);
this
.
checkParam
(
book
);
//获取图书基本信息
//获取图书基本信息
...
@@ -215,7 +216,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -215,7 +216,6 @@ public class BookBizImpl implements BookBiz {
bookDao
.
update
(
book
);
bookDao
.
update
(
book
);
// 清除redis中数据
// 清除redis中数据
bookCache
.
clearRedisByBook
(
book
.
getBookId
(),
book
.
getIsbn
(),
book
.
getSerialNumber
());
bookCache
.
clearRedisByBook
(
book
.
getBookId
(),
book
.
getIsbn
(),
book
.
getSerialNumber
());
LOGGER
.
info
(
"【书籍基础】修改书籍基础信息,<END>"
);
}
}
@ParamLog
(
"校验是否修改图书名称并发送修改名称topic"
)
@ParamLog
(
"校验是否修改图书名称并发送修改名称topic"
)
...
@@ -244,7 +244,7 @@ public class BookBizImpl implements BookBiz {
...
@@ -244,7 +244,7 @@ public class BookBizImpl implements BookBiz {
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateCoverImg
(
Book
book
)
throws
BizException
{
public
void
updateCoverImg
(
Book
book
)
throws
BizException
{
LOGGER
.
info
(
"【书籍基础】修改书籍基础信息,<PARAM>.[book]="
+
book
.
toString
()
);
LOGGER
.
info
(
"【书籍基础】修改书籍基础信息,<PARAM>.[book]="
+
book
);
// 获取图书基本信息校验是否默认图书
// 获取图书基本信息校验是否默认图书
BookDto
bookDto
=
this
.
getBaseById
(
book
.
getBookId
());
BookDto
bookDto
=
this
.
getBaseById
(
book
.
getBookId
());
if
(
BookConstant
.
DEFAULT_BOOK_ISBN
.
equals
(
bookDto
.
getIsbn
())
if
(
BookConstant
.
DEFAULT_BOOK_ISBN
.
equals
(
bookDto
.
getIsbn
())
...
@@ -255,7 +255,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -255,7 +255,6 @@ public class BookBizImpl implements BookBiz {
checkIsUpdateCoverImgAndSendTopic
(
bookDto
,
book
.
getCoverImg
());
checkIsUpdateCoverImgAndSendTopic
(
bookDto
,
book
.
getCoverImg
());
// 清除redis中数据
// 清除redis中数据
bookCache
.
clearRedisByBook
(
bookDto
.
getBookId
(),
bookDto
.
getIsbn
(),
bookDto
.
getSerialNumber
());
bookCache
.
clearRedisByBook
(
bookDto
.
getBookId
(),
bookDto
.
getIsbn
(),
bookDto
.
getSerialNumber
());
LOGGER
.
info
(
"【书籍基础】修改书籍基础信息,<END>"
);
}
}
/**
/**
...
@@ -264,7 +263,7 @@ public class BookBizImpl implements BookBiz {
...
@@ -264,7 +263,7 @@ public class BookBizImpl implements BookBiz {
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BookDto
updateByAdviser
(
Book
book
)
throws
BizException
{
public
BookDto
updateByAdviser
(
Book
book
)
throws
BizException
{
LOGGER
.
info
(
"【书籍基础】修改书籍基础信息,<PARAM>.[book]="
+
book
.
toString
()
);
LOGGER
.
info
(
"【书籍基础】修改书籍基础信息,<PARAM>.[book]="
+
book
);
checkParam
(
book
);
checkParam
(
book
);
// 设置编辑书刊关联关系
// 设置编辑书刊关联关系
setBookAdviserRelation
(
book
);
setBookAdviserRelation
(
book
);
...
@@ -281,7 +280,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -281,7 +280,6 @@ public class BookBizImpl implements BookBiz {
bookCache
.
clearRedisByBook
(
book
.
getBookId
(),
book
.
getIsbn
(),
book
.
getSerialNumber
());
bookCache
.
clearRedisByBook
(
book
.
getBookId
(),
book
.
getIsbn
(),
book
.
getSerialNumber
());
checkIsUpdateCoverImgAndSendTopic
(
bookDto
,
book
.
getCoverImg
());
checkIsUpdateCoverImgAndSendTopic
(
bookDto
,
book
.
getCoverImg
());
checkIsUpdateBookNameAndSendTopic
(
bookDto
,
book
.
getBookName
());
checkIsUpdateBookNameAndSendTopic
(
bookDto
,
book
.
getBookName
());
LOGGER
.
info
(
"【书籍基础】修改书籍基础信息,<END>"
);
return
bookDto
;
return
bookDto
;
}
}
...
@@ -360,7 +358,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -360,7 +358,6 @@ public class BookBizImpl implements BookBiz {
bookCache
.
decrObject
(
BookConstant
.
BOOK_CACHE
+
"PLATFORM_BOOK_COUNT"
);
bookCache
.
decrObject
(
BookConstant
.
BOOK_CACHE
+
"PLATFORM_BOOK_COUNT"
);
// 清除缓存
// 清除缓存
bookCache
.
clearRedisByBook
(
bookId
,
book
.
getIsbn
(),
book
.
getSerialNumber
());
bookCache
.
clearRedisByBook
(
bookId
,
book
.
getIsbn
(),
book
.
getSerialNumber
());
LOGGER
.
info
(
"【书籍基础】删除书籍,<END>.[result]="
+
result
);
}
}
/**
/**
...
@@ -375,7 +372,7 @@ public class BookBizImpl implements BookBiz {
...
@@ -375,7 +372,7 @@ public class BookBizImpl implements BookBiz {
}
}
List
<
Long
>
bookIds
=
Arrays
.
asList
(
bookIdStrs
.
split
(
","
)).
stream
().
map
(
s
->
Long
.
parseLong
(
s
.
trim
()))
List
<
Long
>
bookIds
=
Arrays
.
asList
(
bookIdStrs
.
split
(
","
)).
stream
().
map
(
s
->
Long
.
parseLong
(
s
.
trim
()))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
if
(
bookIds
==
null
||
bookIds
.
isEmpty
(
))
{
if
(
CollectionUtils
.
isEmpty
(
bookIds
))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"请选择要删除的书刊"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"请选择要删除的书刊"
);
}
}
...
@@ -401,7 +398,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -401,7 +398,6 @@ public class BookBizImpl implements BookBiz {
// 清除并将数据存入redis
// 清除并将数据存入redis
bookCache
.
delBookCountToRedis
();
bookCache
.
delBookCountToRedis
();
bookCache
.
setBookCountToRedis
(
bookCount
);
bookCache
.
setBookCountToRedis
(
bookCount
);
LOGGER
.
info
(
"【书籍基础】批量删除书籍,<END>.[result]="
+
result
);
}
}
/**
/**
...
@@ -485,10 +481,7 @@ public class BookBizImpl implements BookBiz {
...
@@ -485,10 +481,7 @@ public class BookBizImpl implements BookBiz {
// 校验书号
// 校验书号
bookSet
.
checkISBN
(
typeCode
,
isbn
);
bookSet
.
checkISBN
(
typeCode
,
isbn
);
BookDto
bookDto
=
bookDao
.
getByIsbnAndSnum
(
isbn
,
serialNumber
);
BookDto
bookDto
=
bookDao
.
getByIsbnAndSnum
(
isbn
,
serialNumber
);
if
(
bookDto
==
null
)
{
return
bookDto
!=
null
;
return
false
;
}
return
true
;
}
}
/**
/**
...
@@ -527,7 +520,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -527,7 +520,6 @@ public class BookBizImpl implements BookBiz {
bookDto
.
setUniqueNumber
(
"BK"
+
bookDto
.
getBookId
());
bookDto
.
setUniqueNumber
(
"BK"
+
bookDto
.
getBookId
());
// 设置二维码个数
// 设置二维码个数
bookDto
.
setQrcodeCount
(
qrcodeSceneConsr
.
getBookQRCountByMap
(
adviserId
,
channelId
,
bookId
));
bookDto
.
setQrcodeCount
(
qrcodeSceneConsr
.
getBookQRCountByMap
(
adviserId
,
channelId
,
bookId
));
LOGGER
.
info
(
"【书籍基础】获取单个书籍基础信息(包含统计信息),<END>"
);
return
bookDto
;
return
bookDto
;
}
}
...
@@ -555,11 +547,10 @@ public class BookBizImpl implements BookBiz {
...
@@ -555,11 +547,10 @@ public class BookBizImpl implements BookBiz {
String
adviserName
=
adviserConsr
.
getNameById
(
adviserId
);
String
adviserName
=
adviserConsr
.
getNameById
(
adviserId
);
bookDto
.
setAdviserName
(
adviserName
);
bookDto
.
setAdviserName
(
adviserName
);
Long
agentId
=
adviserConsr
.
getAgentIdByAdviser
(
adviserId
);
Long
agentId
=
adviserConsr
.
getAgentIdByAdviser
(
adviserId
);
Map
<
Long
,
String
>
agentNameMap
=
agentConsr
.
getNames
(
Arrays
.
as
List
(
agentId
));
Map
<
Long
,
String
>
agentNameMap
=
agentConsr
.
getNames
(
Collections
.
singleton
List
(
agentId
));
if
(!
MapUtils
.
isEmpty
(
agentNameMap
)
&&
agentNameMap
.
containsKey
(
agentId
))
{
if
(!
MapUtils
.
isEmpty
(
agentNameMap
)
&&
agentNameMap
.
containsKey
(
agentId
))
{
bookDto
.
setAgentName
(
agentNameMap
.
get
(
agentId
));
bookDto
.
setAgentName
(
agentNameMap
.
get
(
agentId
));
}
}
LOGGER
.
info
(
"【书籍基础】获取单个书籍基础信息(包含统计信息),<END>"
);
return
bookDto
;
return
bookDto
;
}
}
...
@@ -582,7 +573,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -582,7 +573,6 @@ public class BookBizImpl implements BookBiz {
LOGGER
.
error
(
"【书籍基础】批量获取书籍信息,<ERROR>.[bookDao.getMapByIds]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【书籍基础】批量获取书籍信息,<ERROR>.[bookDao.getMapByIds]:"
+
e
.
getMessage
(),
e
);
throw
BizException
.
DB_SELECT_IS_FAIL
;
throw
BizException
.
DB_SELECT_IS_FAIL
;
}
}
LOGGER
.
info
(
"【书籍基础】批量获取书籍信息,<END>"
);
return
bookMap
;
return
bookMap
;
}
}
...
@@ -591,11 +581,11 @@ public class BookBizImpl implements BookBiz {
...
@@ -591,11 +581,11 @@ public class BookBizImpl implements BookBiz {
*/
*/
@Override
@Override
public
Map
<
Long
,
BookDto
>
listBaseByIds
(
List
<
Long
>
bookIds
)
throws
BizException
{
public
Map
<
Long
,
BookDto
>
listBaseByIds
(
List
<
Long
>
bookIds
)
throws
BizException
{
LOGGER
.
info
(
"【书籍基础】批量获取书籍信息(书名 与书刊序号 封面图),<PARAM>.[bookIds]="
+
bookIds
.
toString
()
);
LOGGER
.
info
(
"【书籍基础】批量获取书籍信息(书名 与书刊序号 封面图),<PARAM>.[bookIds]="
+
bookIds
);
if
(
bookIds
==
null
||
bookIds
.
isEmpty
())
{
if
(
bookIds
==
null
||
bookIds
.
isEmpty
())
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"请选择书刊"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"请选择书刊"
);
}
}
Map
<
Long
,
BookDto
>
bookMap
=
null
;
Map
<
Long
,
BookDto
>
bookMap
;
try
{
try
{
bookMap
=
bookDao
.
listBaseMapByIds
(
bookIds
);
bookMap
=
bookDao
.
listBaseMapByIds
(
bookIds
);
if
(
bookMap
==
null
)
{
if
(
bookMap
==
null
)
{
...
@@ -605,7 +595,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -605,7 +595,6 @@ public class BookBizImpl implements BookBiz {
LOGGER
.
error
(
"【书籍基础】批量获取书籍信息(书名 与书刊序号 封面图),<ERROR>.[bookDao.listBaseByIds]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【书籍基础】批量获取书籍信息(书名 与书刊序号 封面图),<ERROR>.[bookDao.listBaseByIds]:"
+
e
.
getMessage
(),
e
);
throw
BizException
.
DB_SELECT_IS_FAIL
;
throw
BizException
.
DB_SELECT_IS_FAIL
;
}
}
LOGGER
.
info
(
"【书籍基础】批量获取书籍信息(书名 与书刊序号 封面图),<END>"
);
return
bookMap
;
return
bookMap
;
}
}
...
@@ -634,8 +623,7 @@ public class BookBizImpl implements BookBiz {
...
@@ -634,8 +623,7 @@ public class BookBizImpl implements BookBiz {
@Override
@Override
public
PageBeanNew
<
BookDto
>
getListPage
(
String
isbn
,
String
bookName
,
String
publish
,
String
fundName
,
public
PageBeanNew
<
BookDto
>
getListPage
(
String
isbn
,
String
bookName
,
String
publish
,
String
fundName
,
String
serialNumber
,
Integer
isCurrentMonth
,
Integer
currentPage
,
Integer
numPerPage
)
throws
BizException
{
String
serialNumber
,
Integer
isCurrentMonth
,
Integer
currentPage
,
Integer
numPerPage
)
throws
BizException
{
LOGGER
.
info
(
"【书籍-应用-顾问】获取书籍列表,<START>."
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
paramMap
.
put
(
"isbn"
,
isbn
!=
null
&&
""
.
equals
(
isbn
.
trim
())
?
null
:
isbn
);
paramMap
.
put
(
"isbn"
,
isbn
!=
null
&&
""
.
equals
(
isbn
.
trim
())
?
null
:
isbn
);
paramMap
.
put
(
"bookName"
,
bookName
!=
null
&&
""
.
equals
(
bookName
.
trim
())
?
null
:
bookName
);
paramMap
.
put
(
"bookName"
,
bookName
!=
null
&&
""
.
equals
(
bookName
.
trim
())
?
null
:
bookName
);
paramMap
.
put
(
"publish"
,
publish
!=
null
&&
""
.
equals
(
publish
.
trim
())
?
null
:
publish
);
paramMap
.
put
(
"publish"
,
publish
!=
null
&&
""
.
equals
(
publish
.
trim
())
?
null
:
publish
);
...
@@ -652,7 +640,7 @@ public class BookBizImpl implements BookBiz {
...
@@ -652,7 +640,7 @@ public class BookBizImpl implements BookBiz {
for
(
BookDto
bookDto
:
bookList
)
{
for
(
BookDto
bookDto
:
bookList
)
{
List
<
BookFundDto
>
bookFunds
=
bookDto
.
getBookFunds
();
List
<
BookFundDto
>
bookFunds
=
bookDto
.
getBookFunds
();
Integer
freezeStatus
=
BookFreezeEnum
.
WAIT_FREEZE
.
value
;
Integer
freezeStatus
=
BookFreezeEnum
.
WAIT_FREEZE
.
value
;
B
oolean
isFundSupport
=
false
;
b
oolean
isFundSupport
=
false
;
BookFreezeDto
bf
=
bookFreezeBiz
.
getById
(
bookDto
.
getBookId
());
BookFreezeDto
bf
=
bookFreezeBiz
.
getById
(
bookDto
.
getBookId
());
String
transferor
=
bf
==
null
?
null
:
bf
.
getTransferor
();
String
transferor
=
bf
==
null
?
null
:
bf
.
getTransferor
();
if
(!
ListUtils
.
isEmpty
(
bookFunds
))
{
if
(!
ListUtils
.
isEmpty
(
bookFunds
))
{
...
@@ -672,7 +660,7 @@ public class BookBizImpl implements BookBiz {
...
@@ -672,7 +660,7 @@ public class BookBizImpl implements BookBiz {
bookFundDto
.
setButton
(
0
);
bookFundDto
.
setButton
(
0
);
}
}
Long
opearateUserId
=
bookFundDto
.
getLastModifiedUser
();
Long
opearateUserId
=
bookFundDto
.
getLastModifiedUser
();
if
(
bookFundDto
!=
null
&&
pcloudUserMap
.
containsKey
(
opearateUserId
))
{
if
(
pcloudUserMap
.
containsKey
(
opearateUserId
))
{
bookFundDto
.
setOperateUserName
(
pcloudUserMap
.
get
(
opearateUserId
));
bookFundDto
.
setOperateUserName
(
pcloudUserMap
.
get
(
opearateUserId
));
}
}
if
(
new
Date
().
before
(
endTime
))
{
if
(
new
Date
().
before
(
endTime
))
{
...
@@ -686,7 +674,7 @@ public class BookBizImpl implements BookBiz {
...
@@ -686,7 +674,7 @@ public class BookBizImpl implements BookBiz {
bookDto
.
setFreezeStatus
(
freezeStatus
);
bookDto
.
setFreezeStatus
(
freezeStatus
);
}
}
}
}
int
totalCount
=
0
;
int
totalCount
;
if
(
StringUtil
.
isEmpty
(
isbn
)
&&
StringUtil
.
isEmpty
(
bookName
)
&&
StringUtil
.
isEmpty
(
publish
)
if
(
StringUtil
.
isEmpty
(
isbn
)
&&
StringUtil
.
isEmpty
(
bookName
)
&&
StringUtil
.
isEmpty
(
publish
)
&&
StringUtil
.
isEmpty
(
fundName
)
&&
StringUtil
.
isEmpty
(
serialNumber
)
&&
null
==
isCurrentMonth
)
{
&&
StringUtil
.
isEmpty
(
fundName
)
&&
StringUtil
.
isEmpty
(
serialNumber
)
&&
null
==
isCurrentMonth
)
{
totalCount
=
this
.
getAllBookCount
();
totalCount
=
this
.
getAllBookCount
();
...
@@ -696,7 +684,7 @@ public class BookBizImpl implements BookBiz {
...
@@ -696,7 +684,7 @@ public class BookBizImpl implements BookBiz {
if
(!
ListUtils
.
isEmpty
(
bookList
))
{
if
(!
ListUtils
.
isEmpty
(
bookList
))
{
bookSet
.
setPageDetailInfo4Platform
(
bookList
);
bookSet
.
setPageDetailInfo4Platform
(
bookList
);
}
}
PageBeanNew
<
BookDto
>
result
=
new
PageBeanNew
<
BookDto
>();
PageBeanNew
<
BookDto
>
result
=
new
PageBeanNew
<>();
result
.
setCurrentPage
(
currentPage
);
result
.
setCurrentPage
(
currentPage
);
result
.
setNumPerPage
(
numPerPage
);
result
.
setNumPerPage
(
numPerPage
);
result
.
setRecordList
(
bookList
);
result
.
setRecordList
(
bookList
);
...
@@ -728,7 +716,7 @@ public class BookBizImpl implements BookBiz {
...
@@ -728,7 +716,7 @@ public class BookBizImpl implements BookBiz {
*/
*/
@Override
@Override
public
PageBean
getListPage4Adviser
(
Map
<
String
,
Object
>
paramMap
,
PageParam
pageParam
,
Long
adviserId
,
Integer
hasQrcode
)
throws
BizException
{
public
PageBean
getListPage4Adviser
(
Map
<
String
,
Object
>
paramMap
,
PageParam
pageParam
,
Long
adviserId
,
Integer
hasQrcode
)
throws
BizException
{
LOGGER
.
info
(
"【书籍应用】获取书籍列表,<START>.[paramMap]="
+
paramMap
.
toString
()
);
LOGGER
.
info
(
"【书籍应用】获取书籍列表,<START>.[paramMap]="
+
paramMap
);
PageBean
pageBean
=
bookDao
.
listPage
(
pageParam
,
paramMap
,
"getListPage4Adviser"
);
PageBean
pageBean
=
bookDao
.
listPage
(
pageParam
,
paramMap
,
"getListPage4Adviser"
);
if
(
pageBean
==
null
||
ListUtils
.
isEmpty
(
pageBean
.
getRecordList
()))
{
if
(
pageBean
==
null
||
ListUtils
.
isEmpty
(
pageBean
.
getRecordList
()))
{
return
new
PageBean
(
0
,
0
,
new
ArrayList
<>());
return
new
PageBean
(
0
,
0
,
new
ArrayList
<>());
...
@@ -758,11 +746,10 @@ public class BookBizImpl implements BookBiz {
...
@@ -758,11 +746,10 @@ public class BookBizImpl implements BookBiz {
bookSet
.
setBookIncome
(
pageBean
.
getRecordList
());
bookSet
.
setBookIncome
(
pageBean
.
getRecordList
());
// 设置二维码相关信息
// 设置二维码相关信息
bookSet
.
setQrInfo
(
pageBean
.
getRecordList
());
bookSet
.
setQrInfo
(
pageBean
.
getRecordList
());
LOGGER
.
info
(
"【书籍应用】获取书籍列表,<END>"
);
return
pageBean
;
return
pageBean
;
}
}
@ParamLog
(
description
=
"首页展示正在做的图书"
)
@ParamLog
(
description
=
"首页展示正在做的图书"
,
isAfterReturn
=
false
)
@Override
@Override
public
List
<
BookDto
>
getList4Adviser
(
Long
adviserId
,
Integer
num
)
throws
BizException
{
public
List
<
BookDto
>
getList4Adviser
(
Long
adviserId
,
Integer
num
)
throws
BizException
{
Map
<
String
,
Object
>
paramMap
=
Maps
.
newHashMap
();
Map
<
String
,
Object
>
paramMap
=
Maps
.
newHashMap
();
...
@@ -796,7 +783,7 @@ public class BookBizImpl implements BookBiz {
...
@@ -796,7 +783,7 @@ public class BookBizImpl implements BookBiz {
@Override
@Override
public
PageBean
getListPage4Wechat
(
Map
<
String
,
Object
>
paramMap
,
PageParam
pageParam
,
Long
adviserId
)
public
PageBean
getListPage4Wechat
(
Map
<
String
,
Object
>
paramMap
,
PageParam
pageParam
,
Long
adviserId
)
throws
BizException
{
throws
BizException
{
LOGGER
.
info
(
"【书籍应用】微信端获取书籍列表,<START>.[paramMap]="
+
paramMap
.
toString
()
);
LOGGER
.
info
(
"【书籍应用】微信端获取书籍列表,<START>.[paramMap]="
+
paramMap
);
PageBean
pageBean
=
bookDao
.
listPage
(
pageParam
,
paramMap
,
"getListPage4Adviser"
);
PageBean
pageBean
=
bookDao
.
listPage
(
pageParam
,
paramMap
,
"getListPage4Adviser"
);
if
(
pageBean
==
null
||
ListUtils
.
isEmpty
(
pageBean
.
getRecordList
()))
{
if
(
pageBean
==
null
||
ListUtils
.
isEmpty
(
pageBean
.
getRecordList
()))
{
return
new
PageBean
(
0
,
0
,
new
ArrayList
<>());
return
new
PageBean
(
0
,
0
,
new
ArrayList
<>());
...
@@ -809,7 +796,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -809,7 +796,6 @@ public class BookBizImpl implements BookBiz {
bookSet
.
setTemplateName
(
pageBean
.
getRecordList
());
bookSet
.
setTemplateName
(
pageBean
.
getRecordList
());
// 设置冻结状态
// 设置冻结状态
bookSet
.
setFreezeStatus
(
pageBean
.
getRecordList
());
bookSet
.
setFreezeStatus
(
pageBean
.
getRecordList
());
LOGGER
.
info
(
"【书籍应用】微信端获取书籍列表,<END>"
);
return
pageBean
;
return
pageBean
;
}
}
...
@@ -840,7 +826,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -840,7 +826,6 @@ public class BookBizImpl implements BookBiz {
}
}
// 填充书籍关联的问答
// 填充书籍关联的问答
bookDto
.
setProducts
(
bookProductBiz
.
getQaListById
(
bookId
,
adviserId
,
channelId
));
bookDto
.
setProducts
(
bookProductBiz
.
getQaListById
(
bookId
,
adviserId
,
channelId
));
LOGGER
.
info
(
"【书籍应用】获取书籍详细信息,<END>"
);
return
bookDto
;
return
bookDto
;
}
}
...
@@ -863,7 +848,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -863,7 +848,6 @@ public class BookBizImpl implements BookBiz {
LOGGER
.
error
(
"【书籍-顾问】根据名称获取ID,<ERROR>.[getIdsByName]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【书籍-顾问】根据名称获取ID,<ERROR>.[getIdsByName]:"
+
e
.
getMessage
(),
e
);
throw
BizException
.
DB_SELECT_IS_FAIL
;
throw
BizException
.
DB_SELECT_IS_FAIL
;
}
}
LOGGER
.
info
(
"【书籍顾问】根据名称获取ID,<END>"
);
return
bookIds
;
return
bookIds
;
}
}
...
@@ -892,7 +876,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -892,7 +876,6 @@ public class BookBizImpl implements BookBiz {
LOGGER
.
error
(
"【书籍-顾问】根据名称获取ID,<ERROR>.[getIdsByNameMap]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【书籍-顾问】根据名称获取ID,<ERROR>.[getIdsByNameMap]:"
+
e
.
getMessage
(),
e
);
throw
BizException
.
DB_SELECT_IS_FAIL
;
throw
BizException
.
DB_SELECT_IS_FAIL
;
}
}
LOGGER
.
info
(
"【书籍顾问】根据名称获取ID,<END>"
);
return
bookIds
;
return
bookIds
;
}
}
...
@@ -921,7 +904,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -921,7 +904,6 @@ public class BookBizImpl implements BookBiz {
}
}
// 设置渠道名称
// 设置渠道名称
bookDto
.
setChannelName
(
channelConsr
.
getNameById
(
channelId
));
bookDto
.
setChannelName
(
channelConsr
.
getNameById
(
channelId
));
LOGGER
.
info
(
"【图书收益】获取单个书籍基础信息(包含统计信息),<END>"
);
return
bookDto
;
return
bookDto
;
}
}
...
@@ -989,7 +971,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -989,7 +971,6 @@ public class BookBizImpl implements BookBiz {
}
}
// 获取书籍基本信息
// 获取书籍基本信息
BookDto
bookDto
=
this
.
getBaseById
(
bookId
);
BookDto
bookDto
=
this
.
getBaseById
(
bookId
);
LOGGER
.
info
(
"【书籍-应用-微信】获取书籍基本信息,<END>"
);
return
bookDto
;
return
bookDto
;
}
}
...
@@ -1015,7 +996,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -1015,7 +996,6 @@ public class BookBizImpl implements BookBiz {
bookSet
.
setIsHaveAddBookcase
(
pageBean
.
getRecordList
(),
wechatUserId
);
bookSet
.
setIsHaveAddBookcase
(
pageBean
.
getRecordList
(),
wechatUserId
);
// 设置模板名称
// 设置模板名称
bookSet
.
setTemplateName
(
pageBean
.
getRecordList
());
bookSet
.
setTemplateName
(
pageBean
.
getRecordList
());
LOGGER
.
info
(
"【书籍-书刊管理-微信】根据ISBN获取期刊分页列表getJournalPageByIsbn,<END>.[isbn]="
+
isbn
);
return
pageBean
;
return
pageBean
;
}
}
...
@@ -1077,7 +1057,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -1077,7 +1057,6 @@ public class BookBizImpl implements BookBiz {
bookSet
.
setBookSvUvPv4Object
(
books
);
bookSet
.
setBookSvUvPv4Object
(
books
);
// 设置模板名称(图书类型)
// 设置模板名称(图书类型)
bookSet
.
setTemplateName
(
books
);
bookSet
.
setTemplateName
(
books
);
LOGGER
.
info
(
"【书籍-首页】获取书籍列表,<END>"
);
return
books
;
return
books
;
}
}
...
@@ -1106,7 +1085,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -1106,7 +1085,6 @@ public class BookBizImpl implements BookBiz {
bookSet
.
setBookSvUvPv4Object
(
pageBean
.
getRecordList
());
bookSet
.
setBookSvUvPv4Object
(
pageBean
.
getRecordList
());
// 设置基金状态
// 设置基金状态
bookSet
.
setFreezeStatus
(
pageBean
.
getRecordList
());
bookSet
.
setFreezeStatus
(
pageBean
.
getRecordList
());
LOGGER
.
info
(
"【书籍-首页】获取书籍列表,<END>"
);
return
pageBean
;
return
pageBean
;
}
}
...
@@ -1141,7 +1119,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -1141,7 +1119,6 @@ public class BookBizImpl implements BookBiz {
// 设置待审核二维码个数
// 设置待审核二维码个数
bookSet
.
setAuditWaitNum
(
pageBean
.
getRecordList
());
bookSet
.
setAuditWaitNum
(
pageBean
.
getRecordList
());
}
}
LOGGER
.
info
(
"书刊列表-出版端,<END>"
);
return
pageBean
;
return
pageBean
;
}
}
...
@@ -1183,7 +1160,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -1183,7 +1160,6 @@ public class BookBizImpl implements BookBiz {
bookSet
.
setBookSvUvPv4Object
(
pageBean
.
getRecordList
());
bookSet
.
setBookSvUvPv4Object
(
pageBean
.
getRecordList
());
// 设置图书类型
// 设置图书类型
bookSet
.
setTemplateName
(
pageBean
.
getRecordList
());
bookSet
.
setTemplateName
(
pageBean
.
getRecordList
());
LOGGER
.
info
(
"【编辑书刊】书刊回收站列表,<END>"
);
return
pageBean
;
return
pageBean
;
}
}
...
@@ -1198,7 +1174,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -1198,7 +1174,6 @@ public class BookBizImpl implements BookBiz {
bookAssocCount
.
setProductCount
(
bookProductBiz
.
getProCount
(
adviserId
,
bookId
,
channelId
));
bookAssocCount
.
setProductCount
(
bookProductBiz
.
getProCount
(
adviserId
,
bookId
,
channelId
));
bookAssocCount
.
setSuperProCount
(
bookProductBiz
.
getSuperProCount
(
adviserId
,
bookId
,
channelId
));
bookAssocCount
.
setSuperProCount
(
bookProductBiz
.
getSuperProCount
(
adviserId
,
bookId
,
channelId
));
bookAssocCount
.
setAppCount
(
bookAppBiz
.
getAppCount
(
adviserId
,
bookId
,
channelId
));
bookAssocCount
.
setAppCount
(
bookAppBiz
.
getAppCount
(
adviserId
,
bookId
,
channelId
));
LOGGER
.
info
(
"【编辑书刊】书刊回收站列表<END>"
);
return
bookAssocCount
;
return
bookAssocCount
;
}
}
...
@@ -1293,7 +1268,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -1293,7 +1268,6 @@ public class BookBizImpl implements BookBiz {
}
else
{
}
else
{
pageBean
=
new
PageBean
();
pageBean
=
new
PageBean
();
}
}
LOGGER
.
info
(
"图书列表(平台端)<END>"
);
return
pageBean
;
return
pageBean
;
}
}
...
@@ -1302,7 +1276,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -1302,7 +1276,6 @@ public class BookBizImpl implements BookBiz {
*/
*/
@Override
@Override
public
void
exportBookToExcel4Platform
()
{
public
void
exportBookToExcel4Platform
()
{
LOGGER
.
info
(
"导出平台下所有书刊excel表(平台端)<START>"
);
List
<
Object
>
platformBook
=
bookDao
.
listBy
(
null
,
"getAllBook4Platform"
);
List
<
Object
>
platformBook
=
bookDao
.
listBy
(
null
,
"getAllBook4Platform"
);
if
(
ListUtils
.
isEmpty
(
platformBook
))
{
if
(
ListUtils
.
isEmpty
(
platformBook
))
{
...
@@ -1375,7 +1348,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -1375,7 +1348,6 @@ public class BookBizImpl implements BookBiz {
}
}
});
});
LOGGER
.
info
(
"导出平台下所有书刊excel表(平台端)<END>"
);
}
}
...
@@ -1394,7 +1366,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -1394,7 +1366,6 @@ public class BookBizImpl implements BookBiz {
// 设置图书类型名称
// 设置图书类型名称
bookSet
.
setTemplateName
(
bookDto
);
bookSet
.
setTemplateName
(
bookDto
);
}
}
LOGGER
.
info
(
"获取图书基本信息(编辑 - 运营 - 图书)<END>"
);
return
bookDto
;
return
bookDto
;
}
}
...
@@ -1413,7 +1384,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -1413,7 +1384,6 @@ public class BookBizImpl implements BookBiz {
insertBook(isbn);
insertBook(isbn);
bookDto = bookDao.getByIsbn(isbn);
bookDto = bookDao.getByIsbn(isbn);
}*/
}*/
LOGGER
.
info
(
"【书刊基础】根据ISBN获取书刊信息,<END>.[bookDto]="
+
bookDto
);
return
bookDto
;
return
bookDto
;
}
}
...
@@ -1475,7 +1445,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -1475,7 +1445,6 @@ public class BookBizImpl implements BookBiz {
if
(
null
!=
book
.
getIsBookGroup
()
&&
book
.
getIsBookGroup
()
&&
null
!=
book
.
getBookGroupId
())
{
if
(
null
!=
book
.
getIsBookGroup
()
&&
book
.
getIsBookGroup
()
&&
null
!=
book
.
getBookGroupId
())
{
bookGroupBiz
.
linkBookGroup
(
book
.
getBookId
(),
book
.
getBookGroupId
(),
book
.
getCreatedUser
());
bookGroupBiz
.
linkBookGroup
(
book
.
getBookId
(),
book
.
getBookGroupId
(),
book
.
getCreatedUser
());
}
}
LOGGER
.
info
(
"【书籍基础】创建书籍基础信息,<END>"
);
bookDto
.
setIsDelete
(
null
==
dtoByBookId
?
1
:
dtoByBookId
.
getIsDelete
()
?
1
:
0
);
bookDto
.
setIsDelete
(
null
==
dtoByBookId
?
1
:
dtoByBookId
.
getIsDelete
()
?
1
:
0
);
return
bookDto
;
return
bookDto
;
}
}
...
@@ -1743,7 +1712,6 @@ public class BookBizImpl implements BookBiz {
...
@@ -1743,7 +1712,6 @@ public class BookBizImpl implements BookBiz {
LOGGER
.
error
(
"【书籍-顾问】根据书名或ISBN编号获取书id集合,<ERROR>.[getIdsByNameOrISBN]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【书籍-顾问】根据书名或ISBN编号获取书id集合,<ERROR>.[getIdsByNameOrISBN]:"
+
e
.
getMessage
(),
e
);
throw
BizException
.
DB_SELECT_IS_FAIL
;
throw
BizException
.
DB_SELECT_IS_FAIL
;
}
}
LOGGER
.
info
(
"【书籍顾问】根据书名或ISBN编号获取书id集合,<END>"
);
return
bookIds
;
return
bookIds
;
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookFreezeBizImpl.java
View file @
05feca4c
...
@@ -51,7 +51,6 @@ public class BookFreezeBizImpl implements BookFreezeBiz {
...
@@ -51,7 +51,6 @@ public class BookFreezeBizImpl implements BookFreezeBiz {
public
Boolean
isFreeze
(
Long
bookId
)
{
public
Boolean
isFreeze
(
Long
bookId
)
{
LOGGER
.
info
(
"获取图书是否被冻结参数:bookId="
+
bookId
);
LOGGER
.
info
(
"获取图书是否被冻结参数:bookId="
+
bookId
);
Boolean
isFreeze
=
bookFreezeDao
.
isFreeze
(
bookId
);
Boolean
isFreeze
=
bookFreezeDao
.
isFreeze
(
bookId
);
LOGGER
.
info
(
"获取图书是否被冻结参数:isFreeze="
+
isFreeze
);
return
isFreeze
;
return
isFreeze
;
}
}
...
@@ -210,7 +209,6 @@ public class BookFreezeBizImpl implements BookFreezeBiz {
...
@@ -210,7 +209,6 @@ public class BookFreezeBizImpl implements BookFreezeBiz {
if
(
bookFundList
==
null
)
{
if
(
bookFundList
==
null
)
{
bookFundList
=
new
ArrayList
<>();
bookFundList
=
new
ArrayList
<>();
}
}
LOGGER
.
info
(
"该书刊当前和以后基金冻结信息<END>,bookFundList="
+
bookFundList
);
return
bookFundList
;
return
bookFundList
;
}
}
...
@@ -227,7 +225,6 @@ public class BookFreezeBizImpl implements BookFreezeBiz {
...
@@ -227,7 +225,6 @@ public class BookFreezeBizImpl implements BookFreezeBiz {
if
(
bookFundList
==
null
)
{
if
(
bookFundList
==
null
)
{
bookFundList
=
new
ArrayList
<>();
bookFundList
=
new
ArrayList
<>();
}
}
LOGGER
.
info
(
"批量获取书刊当前和以后基金冻结信息<END>,bookFundList="
+
bookFundList
);
return
bookFundList
;
return
bookFundList
;
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookFundBizImpl.java
View file @
05feca4c
package
com
.
pcloud
.
book
.
book
.
biz
.
impl
;
package
com
.
pcloud
.
book
.
book
.
biz
.
impl
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.pcloud.book.book.dto.BookFundInfoDto
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.book.biz.BookFundBiz
;
import
com.pcloud.book.book.biz.BookFundBiz
;
import
com.pcloud.book.book.dao.BookFundDao
;
import
com.pcloud.book.book.dao.BookFundDao
;
import
com.pcloud.book.book.dto.BookFundDto
;
import
com.pcloud.book.book.dto.BookFundDto
;
import
com.pcloud.book.book.dto.BookFundInfoDto
;
import
com.pcloud.book.book.entity.BookFund
;
import
com.pcloud.book.book.entity.BookFund
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.page.PageBean
;
import
com.pcloud.common.page.PageBean
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.page.PageParam
;
...
@@ -26,6 +14,18 @@ import com.pcloud.common.utils.DateUtils;
...
@@ -26,6 +14,18 @@ import com.pcloud.common.utils.DateUtils;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @描述:书刊基金业务实现层
* @描述:书刊基金业务实现层
* @作者:lihao
* @作者:lihao
...
@@ -45,7 +45,7 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -45,7 +45,7 @@ public class BookFundBizImpl implements BookFundBiz {
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
create
(
BookFund
bookFund
)
{
public
void
create
(
BookFund
bookFund
)
{
LOGGER
.
info
(
"【书刊管理(平台端)】创建书刊基金状态,<START>.[bookFund]
="
+
bookFund
.
toString
()
);
LOGGER
.
info
(
"【书刊管理(平台端)】创建书刊基金状态,<START>.[bookFund]
:{}"
,
bookFund
);
// 参数校验
// 参数校验
this
.
checkAddParam
(
bookFund
);
this
.
checkAddParam
(
bookFund
);
// 判断有效期是否重复
// 判断有效期是否重复
...
@@ -64,7 +64,7 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -64,7 +64,7 @@ public class BookFundBizImpl implements BookFundBiz {
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
update
(
BookFund
bookFund
)
{
public
void
update
(
BookFund
bookFund
)
{
LOGGER
.
info
(
"【书刊管理(平台端)】修改刊基金状态,<START>.[bookFund]
="
+
bookFund
.
toString
()
);
LOGGER
.
info
(
"【书刊管理(平台端)】修改刊基金状态,<START>.[bookFund]
:{}"
,
bookFund
);
if
(
null
==
bookFund
.
getBookFundId
())
{
if
(
null
==
bookFund
.
getBookFundId
())
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"基金标识不能为空!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"基金标识不能为空!"
);
}
}
...
@@ -171,12 +171,11 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -171,12 +171,11 @@ public class BookFundBizImpl implements BookFundBiz {
*/
*/
@Override
@Override
public
List
<
BookFundDto
>
getByBookId
(
Long
bookId
)
{
public
List
<
BookFundDto
>
getByBookId
(
Long
bookId
)
{
LOGGER
.
info
(
"【书刊管理(平台端)】根据BookId
获取基金状态,<START>.[bookId]="
+
bookId
);
LOGGER
.
info
(
"【书刊管理(平台端)】根据BookId
:{}获取基金状态,"
,
bookId
);
if
(
null
==
bookId
)
{
if
(
null
==
bookId
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"书籍标识不能为空!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"书籍标识不能为空!"
);
}
}
List
<
BookFundDto
>
bookFundDtos
=
bookFundDao
.
getByBookId
(
bookId
);
List
<
BookFundDto
>
bookFundDtos
=
bookFundDao
.
getByBookId
(
bookId
);
LOGGER
.
info
(
"【书刊管理(平台端)】根据BookId获取基金状态,<END>"
);
return
bookFundDtos
;
return
bookFundDtos
;
}
}
...
@@ -185,7 +184,6 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -185,7 +184,6 @@ public class BookFundBizImpl implements BookFundBiz {
*/
*/
@Override
@Override
public
Boolean
isFundOccupy
(
Long
bookId
,
String
date
)
{
public
Boolean
isFundOccupy
(
Long
bookId
,
String
date
)
{
LOGGER
.
info
(
"【书刊管理(内部)】判断书刊基金是否被买断,<START>.[bookId]="
+
bookId
+
",[date]="
+
date
);
if
(
null
==
bookId
||
null
==
date
)
{
if
(
null
==
bookId
||
null
==
date
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数缺失!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数缺失!"
);
}
}
...
@@ -197,7 +195,7 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -197,7 +195,7 @@ public class BookFundBizImpl implements BookFundBiz {
if
(
null
!=
bookFundDto
&&
bookFundDto
.
size
()
!=
0
)
{
if
(
null
!=
bookFundDto
&&
bookFundDto
.
size
()
!=
0
)
{
isOcuppy
=
true
;
isOcuppy
=
true
;
}
}
LOGGER
.
info
(
"【书刊管理(内部)】判断书刊基金是否被买断,
<END>bookFundDto="
+
bookFundDto
+
"isOcuppy="
+
isOcuppy
);
LOGGER
.
info
(
"【书刊管理(内部)】判断书刊基金是否被买断,
bookId:{};date:{};bookFundDto:{};isOcuppy:{}"
,
bookId
,
date
,
bookFundDto
,
isOcuppy
);
return
isOcuppy
;
return
isOcuppy
;
}
}
...
@@ -206,7 +204,7 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -206,7 +204,7 @@ public class BookFundBizImpl implements BookFundBiz {
*/
*/
@Override
@Override
public
Map
<
String
,
Object
>
getFundList4Adviser
(
Long
bookId
)
{
public
Map
<
String
,
Object
>
getFundList4Adviser
(
Long
bookId
)
{
LOGGER
.
info
(
"【书刊管理(编辑端)】编辑端获取基金买断信息,
<START>.[bookId]="
+
bookId
);
LOGGER
.
info
(
"【书刊管理(编辑端)】编辑端获取基金买断信息,
bookId:{}"
,
bookId
);
if
(
null
==
bookId
)
{
if
(
null
==
bookId
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"书籍标识不能为空!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"书籍标识不能为空!"
);
}
}
...
@@ -224,7 +222,6 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -224,7 +222,6 @@ public class BookFundBizImpl implements BookFundBiz {
reultMap
.
put
(
"isOcuppy"
,
isOcuppy
);
reultMap
.
put
(
"isOcuppy"
,
isOcuppy
);
reultMap
.
put
(
"bookFundDto"
,
new
ArrayList
<>());
reultMap
.
put
(
"bookFundDto"
,
new
ArrayList
<>());
}
}
LOGGER
.
info
(
"【书刊管理(编辑端)】编辑端获取基金买断信息,<END>"
);
return
reultMap
;
return
reultMap
;
}
}
...
@@ -233,7 +230,7 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -233,7 +230,7 @@ public class BookFundBizImpl implements BookFundBiz {
*/
*/
@Override
@Override
public
Map
<
Long
,
BigDecimal
>
getBookFundMoney
(
List
<
Long
>
bookIds
)
{
public
Map
<
Long
,
BigDecimal
>
getBookFundMoney
(
List
<
Long
>
bookIds
)
{
LOGGER
.
info
(
"【书刊管理(编辑端)】批量获取书刊基金总额,
<START>.[bookIds]="
+
bookIds
);
LOGGER
.
info
(
"【书刊管理(编辑端)】批量获取书刊基金总额,
bookIds:{}"
,
bookIds
);
if
(
null
==
bookIds
||
bookIds
.
size
()
==
0
)
{
if
(
null
==
bookIds
||
bookIds
.
size
()
==
0
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"书籍标识不能为空!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"书籍标识不能为空!"
);
}
}
...
@@ -244,7 +241,6 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -244,7 +241,6 @@ public class BookFundBizImpl implements BookFundBiz {
bookFundMap
.
put
(
entry
.
getKey
(),
entry
.
getValue
().
getFundMoneySum
());
bookFundMap
.
put
(
entry
.
getKey
(),
entry
.
getValue
().
getFundMoneySum
());
}
}
}
}
LOGGER
.
info
(
"【书刊管理(编辑端)】批量获取书刊基金总额,<END>"
);
return
bookFundMap
;
return
bookFundMap
;
}
}
...
@@ -268,14 +264,13 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -268,14 +264,13 @@ public class BookFundBizImpl implements BookFundBiz {
*/
*/
@Override
@Override
public
PageBean
listByBookId
(
PageParam
pageParam
,
Long
bookId
)
{
public
PageBean
listByBookId
(
PageParam
pageParam
,
Long
bookId
)
{
LOGGER
.
info
(
"根据BookId获取基金状态,
<START>.[bookId]="
+
bookId
);
LOGGER
.
info
(
"根据BookId获取基金状态,
bookId:{}"
,
bookId
);
if
(
null
==
bookId
)
{
if
(
null
==
bookId
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"书籍标识不能为空!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"书籍标识不能为空!"
);
}
}
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"bookId"
,
bookId
);
paramMap
.
put
(
"bookId"
,
bookId
);
PageBean
pageBean
=
bookFundDao
.
listPage
(
pageParam
,
paramMap
,
"listByBookId"
);
PageBean
pageBean
=
bookFundDao
.
listPage
(
pageParam
,
paramMap
,
"listByBookId"
);
LOGGER
.
info
(
"根据BookId获取基金状态,<END>"
);
return
pageBean
;
return
pageBean
;
}
}
...
@@ -284,7 +279,7 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -284,7 +279,7 @@ public class BookFundBizImpl implements BookFundBiz {
*/
*/
@Override
@Override
public
Long
getHaveFundBook
(
List
<
Long
>
bookIds
)
{
public
Long
getHaveFundBook
(
List
<
Long
>
bookIds
)
{
LOGGER
.
info
(
"正在基金支持的图书,<START>.[bookIds]
="
+
bookIds
);
LOGGER
.
info
(
"正在基金支持的图书,<START>.[bookIds]
:{}"
,
bookIds
);
if
(
ListUtils
.
isEmpty
(
bookIds
))
{
if
(
ListUtils
.
isEmpty
(
bookIds
))
{
return
null
;
return
null
;
}
}
...
@@ -323,12 +318,11 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -323,12 +318,11 @@ public class BookFundBizImpl implements BookFundBiz {
*/
*/
@Override
@Override
public
List
<
Long
>
listHaveFundBooks
(
List
<
Long
>
bookIds
)
{
public
List
<
Long
>
listHaveFundBooks
(
List
<
Long
>
bookIds
)
{
LOGGER
.
info
(
"正在基金支持的图书列表,
<START>.[bookIds]="
+
bookIds
);
LOGGER
.
info
(
"正在基金支持的图书列表,
bookIds:{}"
,
bookIds
);
if
(
ListUtils
.
isEmpty
(
bookIds
))
{
if
(
ListUtils
.
isEmpty
(
bookIds
))
{
return
null
;
return
null
;
}
}
List
<
Long
>
fundBookIds
=
bookFundDao
.
listHaveFundBooks
(
bookIds
);
List
<
Long
>
fundBookIds
=
bookFundDao
.
listHaveFundBooks
(
bookIds
);
LOGGER
.
info
(
"正在基金支持的图书列表,<END>"
);
return
fundBookIds
;
return
fundBookIds
;
}
}
...
@@ -337,9 +331,7 @@ public class BookFundBizImpl implements BookFundBiz {
...
@@ -337,9 +331,7 @@ public class BookFundBizImpl implements BookFundBiz {
*/
*/
@Override
@Override
public
List
<
Long
>
listAllHaveFundBooks
()
{
public
List
<
Long
>
listAllHaveFundBooks
()
{
LOGGER
.
info
(
"获取所有正在基金支持的书,<START>."
);
List
<
Long
>
fundBookIds
=
bookFundDao
.
listAllHaveFundBooks
();
List
<
Long
>
fundBookIds
=
bookFundDao
.
listAllHaveFundBooks
();
LOGGER
.
info
(
"获取所有正在基金支持的书,<END>."
);
return
fundBookIds
;
return
fundBookIds
;
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookKeywordWarehouseBizImpl.java
View file @
05feca4c
...
@@ -209,7 +209,6 @@ public class BookKeywordWarehouseBizImpl implements BookKeywordWarehouseBiz {
...
@@ -209,7 +209,6 @@ public class BookKeywordWarehouseBizImpl implements BookKeywordWarehouseBiz {
@Transactional
(
rollbackFor
=
{
Exception
.
class
})
@Transactional
(
rollbackFor
=
{
Exception
.
class
})
public
void
deleteBookKeyword
(
Long
keywordId
,
Long
adviserId
)
{
public
void
deleteBookKeyword
(
Long
keywordId
,
Long
adviserId
)
{
if
(
null
==
keywordId
||
null
==
adviserId
)
{
if
(
null
==
keywordId
||
null
==
adviserId
)
{
log
.
info
(
"[deleteBookKeyword] keywordId is null"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数错误"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数错误"
);
}
}
final
KeywordWarehouse
keywordWarehouse
=
keywordWarehouseDao
.
selectByPrimaryKey
(
keywordId
);
final
KeywordWarehouse
keywordWarehouse
=
keywordWarehouseDao
.
selectByPrimaryKey
(
keywordId
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookProductBizImpl.java
View file @
05feca4c
...
@@ -3,19 +3,8 @@
...
@@ -3,19 +3,8 @@
*/
*/
package
com
.
pcloud
.
book
.
book
.
biz
.
impl
;
package
com
.
pcloud
.
book
.
book
.
biz
.
impl
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.commons.collections.MapUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.dao.DataIntegrityViolationException
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.book.biz.BookProductBiz
;
import
com.pcloud.book.book.biz.BookProductBiz
;
import
com.pcloud.book.book.cache.BookProductCache
;
import
com.pcloud.book.book.cache.BookProductCache
;
...
@@ -34,6 +23,18 @@ import com.pcloud.resourcecenter.base.constants.ProCons;
...
@@ -34,6 +23,18 @@ import com.pcloud.resourcecenter.base.constants.ProCons;
import
com.pcloud.resourcecenter.product.dto.ProductDto
;
import
com.pcloud.resourcecenter.product.dto.ProductDto
;
import
com.pcloud.resourcecenter.product.dto.ProductTypeDto
;
import
com.pcloud.resourcecenter.product.dto.ProductTypeDto
;
import
org.apache.commons.collections.MapUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.dao.DataIntegrityViolationException
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @描述:
* @描述:
*
*
...
@@ -72,12 +73,11 @@ public class BookProductBizImpl implements BookProductBiz {
...
@@ -72,12 +73,11 @@ public class BookProductBizImpl implements BookProductBiz {
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
create
(
BookProduct
bookProduct
)
throws
BizException
{
public
void
create
(
BookProduct
bookProduct
)
throws
BizException
{
LOGGER
.
info
(
"【书籍-作品-编辑】添加书籍作品关联关系,bookProduct:{}"
,
bookProduct
);
// 参数校验
// 参数校验
this
.
checkParam
(
bookProduct
);
this
.
checkParam
(
bookProduct
);
try
{
try
{
LOGGER
.
info
(
"【书籍-作品-编辑】添加书籍作品关联关系,<START>.[bookProduct]="
+
bookProduct
.
toString
());
bookProductDao
.
insert
(
bookProduct
);
bookProductDao
.
insert
(
bookProduct
);
LOGGER
.
info
(
"【书籍-作品-编辑】添加书籍作品关联关系,<END>"
);
}
catch
(
DataIntegrityViolationException
e
)
{
}
catch
(
DataIntegrityViolationException
e
)
{
LOGGER
.
error
(
"【书籍-作品-编辑】添加书籍作品关联关系>>>>>>"
+
e
.
getMessage
());
LOGGER
.
error
(
"【书籍-作品-编辑】添加书籍作品关联关系>>>>>>"
+
e
.
getMessage
());
throw
new
BizException
(
BookBizException
.
FREQUENTLY_REQUEST
,
"请稍等,正在处理中..."
);
throw
new
BizException
(
BookBizException
.
FREQUENTLY_REQUEST
,
"请稍等,正在处理中..."
);
...
@@ -118,6 +118,7 @@ public class BookProductBizImpl implements BookProductBiz {
...
@@ -118,6 +118,7 @@ public class BookProductBizImpl implements BookProductBiz {
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
delete
(
Long
bookId
,
Long
productId
,
Long
adviserId
,
Long
channelId
)
throws
BizException
{
public
void
delete
(
Long
bookId
,
Long
productId
,
Long
adviserId
,
Long
channelId
)
throws
BizException
{
LOGGER
.
info
(
"【书籍-作品-编辑】删除书籍作品关联关系,bookId:{};productId:{};adviserId:{};channelId:{}"
,
bookId
,
productId
,
adviserId
,
channelId
);
if
(
bookId
==
null
)
{
if
(
bookId
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"书籍标识不能为空~!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"书籍标识不能为空~!"
);
}
}
...
@@ -138,11 +139,9 @@ public class BookProductBizImpl implements BookProductBiz {
...
@@ -138,11 +139,9 @@ public class BookProductBizImpl implements BookProductBiz {
bookProduct
.
setChannelId
(
channelId
);
bookProduct
.
setChannelId
(
channelId
);
try
{
try
{
LOGGER
.
info
(
"【书籍-作品-编辑】删除书籍作品关联关系,<START>.[bookProduct]="
+
bookProduct
.
toString
());
bookProductDao
.
delete
(
bookProduct
);
bookProductDao
.
delete
(
bookProduct
);
LOGGER
.
info
(
"【书籍-作品-编辑】删除书籍作品关联关系,<END>"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【书籍-作品-编辑】删除书籍作品关联关系,
<ERROR>.[bookProductDao.delete]"
+
e
.
getMessage
()
,
e
);
LOGGER
.
error
(
"【书籍-作品-编辑】删除书籍作品关联关系,
bookProduct:{}<ERROR>:{}.[bookProductDao.delete]"
,
bookProduct
,
e
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"删除书籍作品关联关系失败~!"
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"删除书籍作品关联关系失败~!"
);
}
}
// 清除图书应用关联关系
// 清除图书应用关联关系
...
@@ -159,16 +158,15 @@ public class BookProductBizImpl implements BookProductBiz {
...
@@ -159,16 +158,15 @@ public class BookProductBizImpl implements BookProductBiz {
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
deleteByBook
(
Long
bookId
)
throws
BizException
{
public
void
deleteByBook
(
Long
bookId
)
throws
BizException
{
LOGGER
.
info
(
"【书籍-作品-编辑】根据书籍删除作品关联关系,bookId:{}"
,
bookId
);
if
(
bookId
==
null
)
{
if
(
bookId
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"书籍标识不能为空~!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"书籍标识不能为空~!"
);
}
}
try
{
try
{
LOGGER
.
info
(
"【书籍-作品-编辑】根据书籍删除作品关联关系,<START>.[bookId]="
+
bookId
);
bookProductDao
.
deleteByBook
(
bookId
);
bookProductDao
.
deleteByBook
(
bookId
);
LOGGER
.
info
(
"【书籍-作品-编辑】根据书籍删除作品关联关系,<END>"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【书籍-作品-编辑】根据书籍删除作品关联关系,
<ERROR>.[bookDao.insert]"
+
e
.
getMessage
()
,
e
);
LOGGER
.
error
(
"【书籍-作品-编辑】根据书籍删除作品关联关系,
bookId:{}<ERROR>:{}.[bookDao.insert]"
,
bookId
,
e
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"删除作品关联关系失败~!"
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"删除作品关联关系失败~!"
);
}
}
// 清除图书应用关联关系
// 清除图书应用关联关系
...
@@ -185,16 +183,15 @@ public class BookProductBizImpl implements BookProductBiz {
...
@@ -185,16 +183,15 @@ public class BookProductBizImpl implements BookProductBiz {
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
deleteByBooks
(
List
<
Long
>
bookIds
)
throws
BizException
{
public
void
deleteByBooks
(
List
<
Long
>
bookIds
)
throws
BizException
{
LOGGER
.
info
(
"【书籍-作品-编辑】批量删除作品关联关系,bookIds:{}"
,
bookIds
);
if
(
bookIds
==
null
||
bookIds
.
isEmpty
())
{
if
(
bookIds
==
null
||
bookIds
.
isEmpty
())
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"书籍标识不能为空~!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"书籍标识不能为空~!"
);
}
}
try
{
try
{
LOGGER
.
info
(
"【书籍-作品-编辑】批量删除作品关联关系,<START>.[bookIds]="
+
bookIds
.
toString
());
bookProductDao
.
deleteByBooks
(
bookIds
);
bookProductDao
.
deleteByBooks
(
bookIds
);
LOGGER
.
info
(
"【书籍-作品-编辑】批量删除作品关联关系,<END>"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【书籍-作品-编辑】批量删除作品关联关系,
<ERROR>.[bookProductDao.deleteByBooks]"
+
e
.
getMessage
()
,
e
);
LOGGER
.
error
(
"【书籍-作品-编辑】批量删除作品关联关系,
bookIds:{}<ERROR>:{}.[bookProductDao.deleteByBooks]"
,
bookIds
,
e
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"批量删除作品关联关系失败~!"
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"批量删除作品关联关系失败~!"
);
}
}
try
{
try
{
...
@@ -211,6 +208,7 @@ public class BookProductBizImpl implements BookProductBiz {
...
@@ -211,6 +208,7 @@ public class BookProductBizImpl implements BookProductBiz {
*/
*/
@Override
@Override
public
List
<
BookProductDto
>
getListById
(
Long
bookId
,
Long
adviserId
,
Long
channelId
)
throws
BizException
{
public
List
<
BookProductDto
>
getListById
(
Long
bookId
,
Long
adviserId
,
Long
channelId
)
throws
BizException
{
LOGGER
.
info
(
"【书籍-作品-编辑】获取书籍关联的作品,bookId:{};adviserId:{};channelId:{}"
,
bookId
,
adviserId
,
channelId
);
if
(
bookId
==
null
)
{
if
(
bookId
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"书籍标识不能为空~!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"书籍标识不能为空~!"
);
}
}
...
@@ -228,14 +226,12 @@ public class BookProductBizImpl implements BookProductBiz {
...
@@ -228,14 +226,12 @@ public class BookProductBizImpl implements BookProductBiz {
bookProduct
.
setChannelId
(
channelId
);
bookProduct
.
setChannelId
(
channelId
);
bookProduct
.
setCreatedUser
(
adviserId
);
bookProduct
.
setCreatedUser
(
adviserId
);
try
{
try
{
LOGGER
.
info
(
"【书籍-作品-编辑】获取书籍关联的作品,<START>.[bookProduct]="
+
bookProduct
.
toString
());
listBookProductAssoc
=
bookProductDao
.
getListById
(
bookProduct
);
listBookProductAssoc
=
bookProductDao
.
getListById
(
bookProduct
);
if
(
listBookProductAssoc
==
null
)
{
if
(
listBookProductAssoc
==
null
)
{
listBookProductAssoc
=
new
ArrayList
<>();
listBookProductAssoc
=
new
ArrayList
<>();
}
else
{
}
else
{
bookProductCache
.
setBookProductAssoc
(
bookId
,
channelId
,
adviserId
,
listBookProductAssoc
);
bookProductCache
.
setBookProductAssoc
(
bookId
,
channelId
,
adviserId
,
listBookProductAssoc
);
}
}
LOGGER
.
info
(
"【书籍-作品-编辑】获取书籍关联的作品,<END>.[listBookProductAssoc]="
+
listBookProductAssoc
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【书籍-作品-编辑】获取书籍关联的作品,<ERROR>.[bookProductDao.getListById]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【书籍-作品-编辑】获取书籍关联的作品,<ERROR>.[bookProductDao.getListById]:"
+
e
.
getMessage
(),
e
);
throw
BizException
.
DB_SELECT_IS_FAIL
;
throw
BizException
.
DB_SELECT_IS_FAIL
;
...
@@ -414,8 +410,6 @@ public class BookProductBizImpl implements BookProductBiz {
...
@@ -414,8 +410,6 @@ public class BookProductBizImpl implements BookProductBiz {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"清除录音失败"
);
LOGGER
.
error
(
"清除录音失败"
);
}
}
LOGGER
.
info
(
"【图书商品】修改录音.<END>"
);
}
}
/**
/**
...
@@ -423,7 +417,6 @@ public class BookProductBizImpl implements BookProductBiz {
...
@@ -423,7 +417,6 @@ public class BookProductBizImpl implements BookProductBiz {
*/
*/
@Override
@Override
public
void
updateProductType
()
{
public
void
updateProductType
()
{
LOGGER
.
info
(
"【图书商品】更新商品类型.<START>."
);
// 获取所有图书关联商品
// 获取所有图书关联商品
List
<
BookProductDto
>
allBookProduct
=
bookProductDao
.
getAllBookProduct
();
List
<
BookProductDto
>
allBookProduct
=
bookProductDao
.
getAllBookProduct
();
if
(
ListUtils
.
isEmpty
(
allBookProduct
))
{
if
(
ListUtils
.
isEmpty
(
allBookProduct
))
{
...
@@ -450,7 +443,6 @@ public class BookProductBizImpl implements BookProductBiz {
...
@@ -450,7 +443,6 @@ public class BookProductBizImpl implements BookProductBiz {
}
}
}
}
bookProductDao
.
updateProductType
(
allBookProduct
);
bookProductDao
.
updateProductType
(
allBookProduct
);
}
}
/**
/**
...
@@ -458,8 +450,7 @@ public class BookProductBizImpl implements BookProductBiz {
...
@@ -458,8 +450,7 @@ public class BookProductBizImpl implements BookProductBiz {
*/
*/
@Override
@Override
public
List
<
BookProductDto
>
list4Adviser
(
Long
bookId
,
Long
channelId
,
Long
adviserId
)
{
public
List
<
BookProductDto
>
list4Adviser
(
Long
bookId
,
Long
channelId
,
Long
adviserId
)
{
LOGGER
.
info
(
LOGGER
.
info
(
"【书刊】获取图书关联作品,<START>.[bookId]="
+
bookId
+
",[channelId]="
+
channelId
+
"[adviserId]="
+
adviserId
);
"【书刊】获取图书关联作品,<START>.[bookId]="
+
bookId
+
",[channelId]="
+
channelId
+
"[adviserId]="
+
adviserId
);
// 获取图书
// 获取图书
List
<
BookProductDto
>
bookProductAssoc
=
getListById
(
bookId
,
adviserId
,
channelId
);
List
<
BookProductDto
>
bookProductAssoc
=
getListById
(
bookId
,
adviserId
,
channelId
);
// 设置作者录音
// 设置作者录音
...
@@ -493,8 +484,7 @@ public class BookProductBizImpl implements BookProductBiz {
...
@@ -493,8 +484,7 @@ public class BookProductBizImpl implements BookProductBiz {
*/
*/
@Override
@Override
public
Integer
getProCount
(
Long
adviserId
,
Long
bookId
,
Long
channelId
)
{
public
Integer
getProCount
(
Long
adviserId
,
Long
bookId
,
Long
channelId
)
{
LOGGER
.
info
(
"【编辑书刊】 获取图书关联商品个数,<START>.[bookId]="
+
bookId
+
",[channelId]="
+
channelId
+
"[adviserId]="
LOGGER
.
info
(
"【编辑书刊】 获取图书关联商品个数,<START>.[bookId]="
+
bookId
+
",[channelId]="
+
channelId
+
"[adviserId]="
+
adviserId
);
+
adviserId
);
try
{
try
{
Map
<
String
,
Object
>
paramMap
=
Maps
.
newHashMap
();
Map
<
String
,
Object
>
paramMap
=
Maps
.
newHashMap
();
paramMap
.
put
(
"bookId"
,
bookId
);
paramMap
.
put
(
"bookId"
,
bookId
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookResourceBizImpl.java
View file @
05feca4c
...
@@ -3,18 +3,8 @@
...
@@ -3,18 +3,8 @@
*/
*/
package
com
.
pcloud
.
book
.
book
.
biz
.
impl
;
package
com
.
pcloud
.
book
.
book
.
biz
.
impl
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.dao.DataIntegrityViolationException
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.book.biz.BookProductBiz
;
import
com.pcloud.book.book.biz.BookProductBiz
;
import
com.pcloud.book.book.biz.BookResourceBiz
;
import
com.pcloud.book.book.biz.BookResourceBiz
;
...
@@ -27,6 +17,17 @@ import com.pcloud.book.book.set.BookSet;
...
@@ -27,6 +17,17 @@ import com.pcloud.book.book.set.BookSet;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.dao.DataIntegrityViolationException
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @描述:
* @描述:
* @作者:songx
* @作者:songx
...
@@ -58,13 +59,12 @@ public class BookResourceBizImpl implements BookResourceBiz {
...
@@ -58,13 +59,12 @@ public class BookResourceBizImpl implements BookResourceBiz {
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
create
(
BookResource
bookResource
)
throws
BizException
{
public
void
create
(
BookResource
bookResource
)
throws
BizException
{
LOGGER
.
info
(
"【书籍-资源-编辑】创建书刊资源关联,bookResource:{}"
,
bookResource
);
// 校验参数
// 校验参数
this
.
checkParam
(
bookResource
);
this
.
checkParam
(
bookResource
);
try
{
try
{
LOGGER
.
info
(
"【书籍-资源-编辑】创建书刊资源关联,<START>.[bookResource]="
+
bookResource
.
toString
());
bookResourceDao
.
insert
(
bookResource
);
bookResourceDao
.
insert
(
bookResource
);
LOGGER
.
info
(
"【书籍-资源-编辑】创建书刊资源关联,<END>"
);
}
catch
(
DataIntegrityViolationException
e
)
{
}
catch
(
DataIntegrityViolationException
e
)
{
LOGGER
.
error
(
"【书籍-资源-编辑】创建书刊资源关联,已关联过"
+
e
.
getMessage
());
LOGGER
.
error
(
"【书籍-资源-编辑】创建书刊资源关联,已关联过"
+
e
.
getMessage
());
throw
new
BizException
(
BookBizException
.
FREQUENTLY_REQUEST
,
"请稍等,正在处理中..."
);
throw
new
BizException
(
BookBizException
.
FREQUENTLY_REQUEST
,
"请稍等,正在处理中..."
);
...
@@ -97,7 +97,7 @@ public class BookResourceBizImpl implements BookResourceBiz {
...
@@ -97,7 +97,7 @@ public class BookResourceBizImpl implements BookResourceBiz {
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
delete
(
Long
bookResourceId
)
throws
BizException
{
public
void
delete
(
Long
bookResourceId
)
throws
BizException
{
LOGGER
.
info
(
"【书籍-资源-编辑】删除书刊资源关联,
<START>.[bookResourceId]="
+
bookResourceId
);
LOGGER
.
info
(
"【书籍-资源-编辑】删除书刊资源关联,
bookResourceId:{}"
,
bookResourceId
);
if
(
bookResourceId
==
null
)
{
if
(
bookResourceId
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"请选择资源"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"请选择资源"
);
}
}
...
@@ -106,7 +106,6 @@ public class BookResourceBizImpl implements BookResourceBiz {
...
@@ -106,7 +106,6 @@ public class BookResourceBizImpl implements BookResourceBiz {
try
{
try
{
bookResourceDao
.
deleteById
(
bookResourceId
);
bookResourceDao
.
deleteById
(
bookResourceId
);
LOGGER
.
info
(
"【书籍-资源-编辑】删除书刊资源关联,<END>"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【书籍-资源-编辑】删除书刊资源关联,<ERROR>.[bookResourceDto.deleteById]"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【书籍-资源-编辑】删除书刊资源关联,<ERROR>.[bookResourceDto.deleteById]"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"删除书刊资源关联失败~!"
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"删除书刊资源关联失败~!"
);
...
@@ -120,14 +119,13 @@ public class BookResourceBizImpl implements BookResourceBiz {
...
@@ -120,14 +119,13 @@ public class BookResourceBizImpl implements BookResourceBiz {
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
deleteByBook
(
Long
bookId
)
throws
BizException
{
public
void
deleteByBook
(
Long
bookId
)
throws
BizException
{
LOGGER
.
info
(
"【书籍-资源-编辑】根据书籍删除关联的应用,
<START>.[bookId]="
+
bookId
);
LOGGER
.
info
(
"【书籍-资源-编辑】根据书籍删除关联的应用,
bookId:{}"
,
bookId
);
if
(
bookId
==
null
)
{
if
(
bookId
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"请选择书籍"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"请选择书籍"
);
}
}
try
{
try
{
bookResourceDao
.
deleteByBook
(
bookId
);
bookResourceDao
.
deleteByBook
(
bookId
);
LOGGER
.
info
(
"【书籍-资源-编辑】根据书籍删除关联的应用,<END>"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【书籍-资源-编辑】根据书籍删除关联的应用,<ERROR>.[bookResourceDto.deleteByBook]"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【书籍-资源-编辑】根据书籍删除关联的应用,<ERROR>.[bookResourceDto.deleteByBook]"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"根据书籍删除关联的应用~!"
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"根据书籍删除关联的应用~!"
);
...
@@ -147,14 +145,13 @@ public class BookResourceBizImpl implements BookResourceBiz {
...
@@ -147,14 +145,13 @@ public class BookResourceBizImpl implements BookResourceBiz {
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
deleteByBooks
(
List
<
Long
>
bookIds
)
throws
BizException
{
public
void
deleteByBooks
(
List
<
Long
>
bookIds
)
throws
BizException
{
LOGGER
.
info
(
"【书籍-资源-编辑】批量删除资源关联关系,
<START>.[bookIds]="
+
bookIds
.
toString
()
);
LOGGER
.
info
(
"【书籍-资源-编辑】批量删除资源关联关系,
bookIds:{}"
,
bookIds
);
if
(
bookIds
==
null
||
bookIds
.
isEmpty
())
{
if
(
bookIds
==
null
||
bookIds
.
isEmpty
())
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"书籍标识不能为空~!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"书籍标识不能为空~!"
);
}
}
try
{
try
{
bookResourceDao
.
deleteByBooks
(
bookIds
);
bookResourceDao
.
deleteByBooks
(
bookIds
);
LOGGER
.
info
(
"【书籍-资源-编辑】批量删除资源关联关系,<END>"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【书籍-资源-编辑】批量删除资源关联关系,<ERROR>.[bookResourceDto.deleteByBooks]"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【书籍-资源-编辑】批量删除资源关联关系,<ERROR>.[bookResourceDto.deleteByBooks]"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"批量删除应用关联关系失败~!"
);
throw
new
BookBizException
(
BookBizException
.
DB_DML_FAIL
,
"批量删除应用关联关系失败~!"
);
...
@@ -212,7 +209,6 @@ public class BookResourceBizImpl implements BookResourceBiz {
...
@@ -212,7 +209,6 @@ public class BookResourceBizImpl implements BookResourceBiz {
}
else
{
}
else
{
bookResourceCache
.
setBookResourceAssoc
(
bookId
,
channelId
,
adviserId
,
bookResources
);
bookResourceCache
.
setBookResourceAssoc
(
bookId
,
channelId
,
adviserId
,
bookResources
);
}
}
LOGGER
.
info
(
"【书籍-资源-编辑】获取书籍关联的资源,<END>.[bookResources]="
+
bookResources
.
toString
());
return
bookResources
;
return
bookResources
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【书籍-资源-编辑】获取书籍关联的资源,<ERROR>.[bookResourceDto.getListById]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【书籍-资源-编辑】获取书籍关联的资源,<ERROR>.[bookResourceDto.getListById]:"
+
e
.
getMessage
(),
e
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookTypeBizImpl.java
View file @
05feca4c
...
@@ -41,7 +41,6 @@ public class BookTypeBizImpl implements BookTypeBiz {
...
@@ -41,7 +41,6 @@ public class BookTypeBizImpl implements BookTypeBiz {
@Override
@Override
public
List
<
BookTypeDto
>
getList
()
throws
BizException
{
public
List
<
BookTypeDto
>
getList
()
throws
BizException
{
try
{
try
{
LOGGER
.
info
(
"【书籍-类型-编辑】获取书籍类型列表,<START>"
);
return
bookTypeDao
.
getList
();
return
bookTypeDao
.
getList
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【书籍-类型-编辑】获取书籍类型列表,<ERROR>.[bookDao.insert]"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【书籍-类型-编辑】获取书籍类型列表,<ERROR>.[bookDao.insert]"
+
e
.
getMessage
(),
e
);
...
@@ -55,7 +54,7 @@ public class BookTypeBizImpl implements BookTypeBiz {
...
@@ -55,7 +54,7 @@ public class BookTypeBizImpl implements BookTypeBiz {
@Override
@Override
public
List
<
BookTypeDto
>
getPercent4Type
(
Long
adviserId
)
throws
BizException
{
public
List
<
BookTypeDto
>
getPercent4Type
(
Long
adviserId
)
throws
BizException
{
try
{
try
{
LOGGER
.
info
(
"【书籍-类型-编辑】获取图书和期刊占比,<START>
"
);
LOGGER
.
info
(
"【书籍-类型-编辑】获取图书和期刊占比,<START>
adviserId:{}"
,
adviserId
);
List
<
BookTypeDto
>
bookTypes
=
bookTypeDao
.
getPercent4Type
(
adviserId
);
List
<
BookTypeDto
>
bookTypes
=
bookTypeDao
.
getPercent4Type
(
adviserId
);
bookSet
.
setPercent
(
bookTypes
);
bookSet
.
setPercent
(
bookTypes
);
return
bookTypes
;
return
bookTypes
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/set/BookSet.java
View file @
05feca4c
...
@@ -241,7 +241,6 @@ public class BookSet {
...
@@ -241,7 +241,6 @@ public class BookSet {
* 批量填充渠道信息
* 批量填充渠道信息
*/
*/
public
void
setChannelInfoList
(
List
<
Object
>
objects
)
throws
BizException
{
public
void
setChannelInfoList
(
List
<
Object
>
objects
)
throws
BizException
{
LOGGER
.
info
(
"【书刊基础】批量填充渠道信息,<START>"
);
// 组装运营标识(去重)
// 组装运营标识(去重)
List
<
Long
>
channelIds
=
BookTools
.
listChannelIds
(
objects
);
List
<
Long
>
channelIds
=
BookTools
.
listChannelIds
(
objects
);
// 从用户中心批量获取渠道名称
// 从用户中心批量获取渠道名称
...
@@ -251,14 +250,12 @@ public class BookSet {
...
@@ -251,14 +250,12 @@ public class BookSet {
}
}
// 批量填充运营信息
// 批量填充运营信息
BookTools
.
setChannelNames
(
objects
,
channelNameMap
);
BookTools
.
setChannelNames
(
objects
,
channelNameMap
);
LOGGER
.
info
(
"【书刊基础】批量填充渠道信息,<END>"
);
}
}
/**
/**
* 批量填充渠道公众号信息
* 批量填充渠道公众号信息
*/
*/
public
void
setChannelOfficialAccountInfoList
(
List
<
Object
>
objects
)
throws
BizException
{
public
void
setChannelOfficialAccountInfoList
(
List
<
Object
>
objects
)
throws
BizException
{
LOGGER
.
info
(
"【书刊基础】批量填充渠道公众号信息,<START>"
);
// 组装运营标识(去重)
// 组装运营标识(去重)
List
<
Long
>
channelIds
=
BookTools
.
listChannelIds
(
objects
);
List
<
Long
>
channelIds
=
BookTools
.
listChannelIds
(
objects
);
if
(
ListUtils
.
isEmpty
(
channelIds
))
{
if
(
ListUtils
.
isEmpty
(
channelIds
))
{
...
@@ -271,14 +268,12 @@ public class BookSet {
...
@@ -271,14 +268,12 @@ public class BookSet {
}
}
// 批量填充运营公众号信息
// 批量填充运营公众号信息
BookTools
.
setChannelOfficialAccountsNames
(
objects
,
officialAccountNameMap
);
BookTools
.
setChannelOfficialAccountsNames
(
objects
,
officialAccountNameMap
);
LOGGER
.
info
(
"【书刊基础】批量填充渠道公众号信息,<END>"
);
}
}
/**
/**
* 批量填充顾问名称
* 批量填充顾问名称
*/
*/
public
void
setAdviserName4BookDto
(
List
<
Object
>
objects
)
{
public
void
setAdviserName4BookDto
(
List
<
Object
>
objects
)
{
LOGGER
.
info
(
"【书刊基础】批量填充顾问名称,<START>"
);
// 组装编辑标识(去重)
// 组装编辑标识(去重)
List
<
Long
>
adviserIds
=
BookTools
.
listAdviserIds
(
objects
);
List
<
Long
>
adviserIds
=
BookTools
.
listAdviserIds
(
objects
);
// 从用户中心批量获取编辑名称
// 从用户中心批量获取编辑名称
...
@@ -288,14 +283,12 @@ public class BookSet {
...
@@ -288,14 +283,12 @@ public class BookSet {
}
}
// 批量填充编辑名称
// 批量填充编辑名称
BookTools
.
setAdviserNames
(
objects
,
adviserNameMap
);
BookTools
.
setAdviserNames
(
objects
,
adviserNameMap
);
LOGGER
.
info
(
"【书刊基础】批量填充顾问名称,<END>"
);
}
}
/**
/**
* 批量填充出版ID
* 批量填充出版ID
*/
*/
public
void
setAgentId4BookDto
(
List
<
Object
>
objects
)
{
public
void
setAgentId4BookDto
(
List
<
Object
>
objects
)
{
LOGGER
.
info
(
"【书刊基础】批量填充出版ID,<START>"
);
for
(
Object
object
:
objects
)
{
for
(
Object
object
:
objects
)
{
BookDto
bookDto
=
(
BookDto
)
object
;
BookDto
bookDto
=
(
BookDto
)
object
;
Long
adviserId
=
bookDto
.
getAdviserId
();
Long
adviserId
=
bookDto
.
getAdviserId
();
...
@@ -304,14 +297,12 @@ public class BookSet {
...
@@ -304,14 +297,12 @@ public class BookSet {
bookDto
.
setAgentId
(
agentId
);
bookDto
.
setAgentId
(
agentId
);
}
}
}
}
LOGGER
.
info
(
"【书刊基础】批量填充出版ID,<END>"
);
}
}
/**
/**
* 批量填充出版名称
* 批量填充出版名称
*/
*/
public
void
setAgentName4BookDto
(
List
<
Object
>
objects
)
{
public
void
setAgentName4BookDto
(
List
<
Object
>
objects
)
{
LOGGER
.
info
(
"【书刊基础】批量填充出版名称,<START>"
);
// 组装出版标识(去重)
// 组装出版标识(去重)
List
<
Long
>
agentIds
=
BookTools
.
listAgentIds
(
objects
);
List
<
Long
>
agentIds
=
BookTools
.
listAgentIds
(
objects
);
// 从用户中心批量获取出版名称
// 从用户中心批量获取出版名称
...
@@ -321,7 +312,6 @@ public class BookSet {
...
@@ -321,7 +312,6 @@ public class BookSet {
}
}
// 批量填充出版名称
// 批量填充出版名称
BookTools
.
setAgentNames
(
objects
,
agentNameMap
);
BookTools
.
setAgentNames
(
objects
,
agentNameMap
);
LOGGER
.
info
(
"【书刊基础】批量填充出版名称,<END>"
);
}
}
...
@@ -329,7 +319,6 @@ public class BookSet {
...
@@ -329,7 +319,6 @@ public class BookSet {
* 批量填充顾问名称
* 批量填充顾问名称
*/
*/
public
void
setAdviserName
(
List
<
Object
>
objects
)
{
public
void
setAdviserName
(
List
<
Object
>
objects
)
{
LOGGER
.
info
(
"【书刊基础】批量填充顾问名称,<START>"
);
// 组装编辑标识(去重)
// 组装编辑标识(去重)
List
<
Long
>
adviserIds
=
BookAppealTools
.
listAdviserIds
(
objects
);
List
<
Long
>
adviserIds
=
BookAppealTools
.
listAdviserIds
(
objects
);
// 从用户中心批量获取编辑名称
// 从用户中心批量获取编辑名称
...
@@ -339,7 +328,6 @@ public class BookSet {
...
@@ -339,7 +328,6 @@ public class BookSet {
}
}
// 批量填充编辑名称
// 批量填充编辑名称
BookAppealTools
.
setAdviserNames
(
objects
,
adviserNameMap
);
BookAppealTools
.
setAdviserNames
(
objects
,
adviserNameMap
);
LOGGER
.
info
(
"【书刊基础】批量填充顾问名称,<END>"
);
}
}
/**
/**
...
@@ -347,7 +335,6 @@ public class BookSet {
...
@@ -347,7 +335,6 @@ public class BookSet {
* @param bookAppealDto
* @param bookAppealDto
*/
*/
public
void
setAdviserInfo
(
BookAppealDto
bookAppealDto
)
{
public
void
setAdviserInfo
(
BookAppealDto
bookAppealDto
)
{
LOGGER
.
info
(
"【书刊基础】设置申诉方及被诉方基本信息(objects),<START>"
);
List
<
Long
>
adviserIds
=
new
ArrayList
<>();
List
<
Long
>
adviserIds
=
new
ArrayList
<>();
List
<
Long
>
channelIds
=
new
ArrayList
<>();
List
<
Long
>
channelIds
=
new
ArrayList
<>();
Long
channelId
=
bookAppealDto
.
getChannelId
();
Long
channelId
=
bookAppealDto
.
getChannelId
();
...
@@ -469,7 +456,7 @@ public class BookSet {
...
@@ -469,7 +456,7 @@ public class BookSet {
* @param bookId 书籍标识
* @param bookId 书籍标识
*/
*/
public
void
sendBookDeleteTopic
(
Long
bookId
)
{
public
void
sendBookDeleteTopic
(
Long
bookId
)
{
LOGGER
.
info
(
"【书籍基础】发送书籍删除topic,<START>
"
);
LOGGER
.
info
(
"【书籍基础】发送书籍删除topic,<START>
bookId:{}"
,
bookId
);
BookDeleteDto
bookDeleteDto
=
new
BookDeleteDto
();
BookDeleteDto
bookDeleteDto
=
new
BookDeleteDto
();
List
<
Long
>
bookIds
=
new
ArrayList
<>();
List
<
Long
>
bookIds
=
new
ArrayList
<>();
bookIds
.
add
(
bookId
);
bookIds
.
add
(
bookId
);
...
@@ -479,7 +466,6 @@ public class BookSet {
...
@@ -479,7 +466,6 @@ public class BookSet {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【书籍基础】发送书籍删除topic,<ERROR>"
,
e
);
LOGGER
.
error
(
"【书籍基础】发送书籍删除topic,<ERROR>"
,
e
);
}
}
LOGGER
.
info
(
"【书籍基础】发送书籍删除topic,<END>"
);
}
}
/**
/**
...
@@ -487,7 +473,7 @@ public class BookSet {
...
@@ -487,7 +473,7 @@ public class BookSet {
* @param bookIds
* @param bookIds
*/
*/
public
void
sendBooksDeleteTopic
(
List
<
Long
>
bookIds
)
{
public
void
sendBooksDeleteTopic
(
List
<
Long
>
bookIds
)
{
LOGGER
.
info
(
"【书籍基础】发送批量删除书籍topic,<START>
"
);
LOGGER
.
info
(
"【书籍基础】发送批量删除书籍topic,<START>
bookIds:{}"
,
bookIds
);
BookDeleteDto
bookDeleteDto
=
new
BookDeleteDto
();
BookDeleteDto
bookDeleteDto
=
new
BookDeleteDto
();
bookDeleteDto
.
setBookIds
(
bookIds
);
bookDeleteDto
.
setBookIds
(
bookIds
);
try
{
try
{
...
@@ -495,7 +481,6 @@ public class BookSet {
...
@@ -495,7 +481,6 @@ public class BookSet {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【书籍基础】发送批量删除书籍topic,<ERROR>"
,
e
);
LOGGER
.
error
(
"【书籍基础】发送批量删除书籍topic,<ERROR>"
,
e
);
}
}
LOGGER
.
info
(
"【书籍基础】发送批量删除书籍topic,<END>"
);
}
}
/**
/**
...
@@ -1634,7 +1619,6 @@ public class BookSet {
...
@@ -1634,7 +1619,6 @@ public class BookSet {
}
}
public
void
setAdviserInfo4BookDto
(
List
<
Object
>
objects
)
{
public
void
setAdviserInfo4BookDto
(
List
<
Object
>
objects
)
{
LOGGER
.
info
(
"【书刊基础】批量填充顾问名称、手机号,<START>"
);
// 组装编辑标识(去重)
// 组装编辑标识(去重)
List
<
Long
>
adviserIds
=
BookTools
.
listAdviserIds
(
objects
);
List
<
Long
>
adviserIds
=
BookTools
.
listAdviserIds
(
objects
);
// 从用户中心批量获取编辑名称
// 从用户中心批量获取编辑名称
...
@@ -1654,6 +1638,5 @@ public class BookSet {
...
@@ -1654,6 +1638,5 @@ public class BookSet {
bookDto
.
setPhone
(
""
);
bookDto
.
setPhone
(
""
);
}
}
}
}
LOGGER
.
info
(
"【书刊基础】批量填充顾问名称、手机号,<END>"
);
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/consumer/analysisengine/BookScanCountConsr.java
View file @
05feca4c
...
@@ -3,19 +3,19 @@
...
@@ -3,19 +3,19 @@
*/
*/
package
com
.
pcloud
.
book
.
consumer
.
analysisengine
;
package
com
.
pcloud
.
book
.
consumer
.
analysisengine
;
import
java.util.HashMap
;
import
com.pcloud.analysisengine.qrcode.service.BookScanCountService
;
import
java.util.List
;
import
com.pcloud.common.exceptions.BizException
;
import
java.util.Map
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
com.pcloud.analysisengine.qrcode.service.BookScanCountService
;
import
java.util.HashMap
;
import
com.pcloud.common.exceptions.BizException
;
import
java.util.List
;
import
com.pcloud.common.utils.ListUtils
;
import
java.util.Map
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
/**
/**
* @描述:书籍统计中间件
* @描述:书籍统计中间件
...
@@ -57,7 +57,6 @@ public class BookScanCountConsr {
...
@@ -57,7 +57,6 @@ public class BookScanCountConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【二维码-渠道(消)】获取书籍扫描数,<ERROR>.[create]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【二维码-渠道(消)】获取书籍扫描数,<ERROR>.[create]:"
+
e
.
getMessage
(),
e
);
}
}
LOGGER
.
info
(
"【二维码-渠道(消)】获取书籍扫描数,<END>"
);
return
bookScanCount
;
return
bookScanCount
;
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/consumer/analysisengine/BrowseRecordConsr.java
View file @
05feca4c
...
@@ -39,7 +39,7 @@ public class BrowseRecordConsr {
...
@@ -39,7 +39,7 @@ public class BrowseRecordConsr {
* 获取资源文件浏览量
* 获取资源文件浏览量
*/
*/
public
Map
<
Long
,
Long
>
getPvOfAdviserRes
(
List
<
Long
>
resourceFileIds
)
throws
BizException
{
public
Map
<
Long
,
Long
>
getPvOfAdviserRes
(
List
<
Long
>
resourceFileIds
)
throws
BizException
{
LOGGER
.
info
(
"
【分析引擎(消)】获取资源文件浏览量,<START>.[resourceIds]="
+
resourceFileIds
);
LOGGER
.
info
(
"
[getPvOfAdviserRes] resourceFileIds:{}"
,
resourceFileIds
);
if
(
ListUtils
.
isEmpty
(
resourceFileIds
))
{
if
(
ListUtils
.
isEmpty
(
resourceFileIds
))
{
return
null
;
return
null
;
}
}
...
@@ -52,7 +52,6 @@ public class BrowseRecordConsr {
...
@@ -52,7 +52,6 @@ public class BrowseRecordConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【分析引擎(消)】获取资源文件浏览量.[getPvOfAdviserRes]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【分析引擎(消)】获取资源文件浏览量.[getPvOfAdviserRes]:"
+
e
.
getMessage
(),
e
);
}
}
LOGGER
.
info
(
"【分析引擎(消)】获取资源文件浏览量,<END>.[resultMap]="
+
(
resultMap
==
null
?
null
:
resultMap
.
toString
()));
return
resultMap
;
return
resultMap
;
}
}
...
@@ -82,7 +81,6 @@ public class BrowseRecordConsr {
...
@@ -82,7 +81,6 @@ public class BrowseRecordConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【分析引擎(消)】图书的:扫描量、读者量.[getBookScanAndUv]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【分析引擎(消)】图书的:扫描量、读者量.[getBookScanAndUv]:"
+
e
.
getMessage
(),
e
);
}
}
LOGGER
.
info
(
"【分析引擎(消)】图书的:扫描量、读者量END"
);
return
resultMap
;
return
resultMap
;
}
}
...
@@ -111,7 +109,6 @@ public class BrowseRecordConsr {
...
@@ -111,7 +109,6 @@ public class BrowseRecordConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【分析引擎(消)】图书的:扫描量、读者量、浏览量.[getBookScanAndUv]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【分析引擎(消)】图书的:扫描量、读者量、浏览量.[getBookScanAndUv]:"
+
e
.
getMessage
(),
e
);
}
}
LOGGER
.
info
(
"【分析引擎(消)】图书的:扫描量、读者量、浏览量END"
);
return
resultMap
;
return
resultMap
;
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/consumer/analysisengine/SceneRecordConsr.java
View file @
05feca4c
...
@@ -3,17 +3,17 @@
...
@@ -3,17 +3,17 @@
*/
*/
package
com
.
pcloud
.
book
.
consumer
.
analysisengine
;
package
com
.
pcloud
.
book
.
consumer
.
analysisengine
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
com.pcloud.analysisengine.qrcode.dto.BookTimeSourceDto
;
import
com.pcloud.analysisengine.qrcode.dto.BookTimeSourceDto
;
import
com.pcloud.analysisengine.qrcode.service.SceneRecordService
;
import
com.pcloud.analysisengine.qrcode.service.SceneRecordService
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
/**
/**
* @描述:二维码记录中间件
* @描述:二维码记录中间件
* @作者:songx
* @作者:songx
...
@@ -51,7 +51,6 @@ public class SceneRecordConsr {
...
@@ -51,7 +51,6 @@ public class SceneRecordConsr {
LOGGER
.
error
(
"【二维码-渠道(消)】获取第一次扫描时间,<ERROR>.[getBookScanInfo]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【二维码-渠道(消)】获取第一次扫描时间,<ERROR>.[getBookScanInfo]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_USER_ERROR
,
"获取第一次扫描时间失败~!"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_USER_ERROR
,
"获取第一次扫描时间失败~!"
);
}
}
LOGGER
.
info
(
"【二维码-渠道(消)】获取第一次扫描时间,<END>"
);
return
bookTimeSourceDto
;
return
bookTimeSourceDto
;
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/consumer/channel/QrcodeSceneConsr.java
View file @
05feca4c
...
@@ -63,7 +63,6 @@ public class QrcodeSceneConsr {
...
@@ -63,7 +63,6 @@ public class QrcodeSceneConsr {
}
}
try
{
try
{
qrcodeSceneService
.
deleteBook
(
bookId
,
channelId
,
adviserId
);
qrcodeSceneService
.
deleteBook
(
bookId
,
channelId
,
adviserId
);
LOGGER
.
info
(
"【二维码-渠道(消)】删除书籍关联的二维码关联关系,<END>"
);
}
catch
(
BizException
e
)
{
}
catch
(
BizException
e
)
{
LOGGER
.
warn
(
"【二维码-渠道(消)】删除书籍关联的二维码关联关系,<ERROR>.[qrcodeSceneService.deleteBook]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
warn
(
"【二维码-渠道(消)】删除书籍关联的二维码关联关系,<ERROR>.[qrcodeSceneService.deleteBook]:"
+
e
.
getMessage
(),
e
);
throw
new
BizException
(
e
.
getCode
(),
e
.
getMessage
());
throw
new
BizException
(
e
.
getCode
(),
e
.
getMessage
());
...
@@ -82,7 +81,6 @@ public class QrcodeSceneConsr {
...
@@ -82,7 +81,6 @@ public class QrcodeSceneConsr {
try
{
try
{
ResponseEntity
<
ResponseDto
<
Map
<
String
,
Object
>>>
qr4Book
=
qrcodeSceneService
.
getQr4Book
(
bookId
);
ResponseEntity
<
ResponseDto
<
Map
<
String
,
Object
>>>
qr4Book
=
qrcodeSceneService
.
getQr4Book
(
bookId
);
result
=
ResponseHandleUtil
.
parseMap
(
qr4Book
,
String
.
class
,
Object
.
class
);
result
=
ResponseHandleUtil
.
parseMap
(
qr4Book
,
String
.
class
,
Object
.
class
);
LOGGER
.
info
(
"【二维码-渠道(消)】 获取书籍对应二维码关系,<END>"
);
}
catch
(
BizException
e
)
{
}
catch
(
BizException
e
)
{
LOGGER
.
warn
(
"【二维码-渠道(消)】 获取书籍对应二维码关系,<ERROR>.[qrcodeSceneService.getQr4Book]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
warn
(
"【二维码-渠道(消)】 获取书籍对应二维码关系,<ERROR>.[qrcodeSceneService.getQr4Book]:"
+
e
.
getMessage
(),
e
);
throw
new
BizException
(
e
.
getCode
(),
e
.
getMessage
());
throw
new
BizException
(
e
.
getCode
(),
e
.
getMessage
());
...
@@ -105,7 +103,6 @@ public class QrcodeSceneConsr {
...
@@ -105,7 +103,6 @@ public class QrcodeSceneConsr {
try
{
try
{
qrcodeSceneService
.
deleteAdviserBookQrRelation
(
adviserId
,
bookId
);
qrcodeSceneService
.
deleteAdviserBookQrRelation
(
adviserId
,
bookId
);
LOGGER
.
info
(
"【二维码-渠道(消)】删除编辑二维码关联关系,<END>"
);
}
catch
(
BizException
e
)
{
}
catch
(
BizException
e
)
{
LOGGER
.
warn
(
"【二维码-渠道(消)】删除编辑二维码关联关系,<ERROR>.[qrcodeSceneService.deleteBook]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
warn
(
"【二维码-渠道(消)】删除编辑二维码关联关系,<ERROR>.[qrcodeSceneService.deleteBook]:"
+
e
.
getMessage
(),
e
);
throw
new
BizException
(
e
.
getCode
(),
e
.
getMessage
());
throw
new
BizException
(
e
.
getCode
(),
e
.
getMessage
());
...
@@ -140,7 +137,6 @@ public class QrcodeSceneConsr {
...
@@ -140,7 +137,6 @@ public class QrcodeSceneConsr {
LOGGER
.
error
(
"【二维码-渠道(消)】获取书籍二维码个数,<ERROR>.:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【二维码-渠道(消)】获取书籍二维码个数,<ERROR>.:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_CHANNEL_ERROR
,
"获取书籍二维码个数失败~!"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_CHANNEL_ERROR
,
"获取书籍二维码个数失败~!"
);
}
}
LOGGER
.
info
(
"【二维码-渠道(消)】获取书籍二维码个数,<END>"
);
return
bookQrCount
;
return
bookQrCount
;
}
}
...
@@ -163,7 +159,6 @@ public class QrcodeSceneConsr {
...
@@ -163,7 +159,6 @@ public class QrcodeSceneConsr {
e
);
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_CHANNEL_ERROR
,
" 根据图书删除二维码失败~!"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_CHANNEL_ERROR
,
" 根据图书删除二维码失败~!"
);
}
}
LOGGER
.
info
(
"【二维码-渠道(消)】 根据图书删除二维码,<END>"
);
}
}
/**
/**
...
@@ -185,7 +180,6 @@ public class QrcodeSceneConsr {
...
@@ -185,7 +180,6 @@ public class QrcodeSceneConsr {
e
);
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_CHANNEL_ERROR
,
" 根据图书恢复二维码失败~!"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_CHANNEL_ERROR
,
" 根据图书恢复二维码失败~!"
);
}
}
LOGGER
.
info
(
"【二维码-渠道(消)】 根据图书恢复二维码,<END>"
);
}
}
/**
/**
...
@@ -207,7 +201,6 @@ public class QrcodeSceneConsr {
...
@@ -207,7 +201,6 @@ public class QrcodeSceneConsr {
e
);
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_CHANNEL_ERROR
,
" 获取图书待审核二维码失败~!"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_CHANNEL_ERROR
,
" 获取图书待审核二维码失败~!"
);
}
}
LOGGER
.
info
(
"【二维码-渠道(消)】 获取图书待审核二维码,<END>"
);
return
result
;
return
result
;
}
}
...
@@ -230,7 +223,6 @@ public class QrcodeSceneConsr {
...
@@ -230,7 +223,6 @@ public class QrcodeSceneConsr {
e
);
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_CHANNEL_ERROR
,
" 获取图书最近关联二维码信息失败~!"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_CHANNEL_ERROR
,
" 获取图书最近关联二维码信息失败~!"
);
}
}
LOGGER
.
info
(
"【二维码-渠道(消)】 获取图书最近关联二维码信息,<END>"
);
return
result
;
return
result
;
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/consumer/isbn/IsbnConsr.java
View file @
05feca4c
...
@@ -238,7 +238,6 @@ public class IsbnConsr {
...
@@ -238,7 +238,6 @@ public class IsbnConsr {
}
}
}
}
LOGGER
.
info
(
"【外部】根据isbn获取书籍信息,<END>"
);
return
result
;
return
result
;
}
}
...
@@ -274,7 +273,6 @@ public class IsbnConsr {
...
@@ -274,7 +273,6 @@ public class IsbnConsr {
httpClient
.
close
();
httpClient
.
close
();
}
}
}
}
LOGGER
.
info
(
"【外部】根据isbn获取书籍信息,<END>result="
+
result
);
return
result
;
return
result
;
}
}
...
@@ -312,7 +310,6 @@ public class IsbnConsr {
...
@@ -312,7 +310,6 @@ public class IsbnConsr {
LOGGER
.
error
(
"查询书籍失败"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"查询书籍失败"
+
e
.
getMessage
(),
e
);
}
}
LOGGER
.
info
(
"【外部】根据isbn获取书籍信息,<END>"
);
return
result
;
return
result
;
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/consumer/label/LabelConsr.java
View file @
05feca4c
...
@@ -10,8 +10,6 @@ import com.pcloud.common.utils.ListUtils;
...
@@ -10,8 +10,6 @@ import com.pcloud.common.utils.ListUtils;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
com.pcloud.labelcenter.label.service.LabelService
;
import
com.pcloud.labelcenter.label.service.LabelService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -50,7 +48,6 @@ public class LabelConsr {
...
@@ -50,7 +48,6 @@ public class LabelConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"【标签中心(消)】标签使用量.[sendMessageQueue]:"
+
e
.
getMessage
(),
e
);
log
.
error
(
"【标签中心(消)】标签使用量.[sendMessageQueue]:"
+
e
.
getMessage
(),
e
);
}
}
log
.
info
(
"【标签中心(消)】标签使用量,<END>"
);
}
}
/**
/**
...
@@ -67,7 +64,6 @@ public class LabelConsr {
...
@@ -67,7 +64,6 @@ public class LabelConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"【标签中心(消)】获取标签的名称.[getLabelName]:"
+
e
.
getMessage
(),
e
);
log
.
error
(
"【标签中心(消)】获取标签的名称.[getLabelName]:"
+
e
.
getMessage
(),
e
);
}
}
log
.
info
(
"【标签中心(消)】获取标签的名称,<END>.[labelNameMap]="
+
(
labelNameMap
==
null
?
null
:
labelNameMap
.
toString
()));
return
labelNameMap
;
return
labelNameMap
;
}
}
...
@@ -87,7 +83,6 @@ public class LabelConsr {
...
@@ -87,7 +83,6 @@ public class LabelConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"【标签中心(消)】根据标签名称获取标签id.[getLableIdByName]:"
+
e
.
getMessage
(),
e
);
log
.
error
(
"【标签中心(消)】根据标签名称获取标签id.[getLableIdByName]:"
+
e
.
getMessage
(),
e
);
}
}
log
.
info
(
"【标签中心(消)】根据标签名称获取标签id,<START>.[labelId]="
+
labelId
);
return
labelId
;
return
labelId
;
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/consumer/message/MessageConsr.java
View file @
05feca4c
...
@@ -3,16 +3,18 @@
...
@@ -3,16 +3,18 @@
*/
*/
package
com
.
pcloud
.
book
.
consumer
.
message
;
package
com
.
pcloud
.
book
.
consumer
.
message
;
import
java.util.Date
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
com.pcloud.common.core.biz.MessageBiz
;
import
com.pcloud.common.core.biz.MessageBiz
;
import
com.pcloud.common.core.dto.SendNotifyDto
;
import
com.pcloud.common.core.dto.SendNotifyDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.Date
;
/**
/**
* @描述:消息中心中间件
* @描述:消息中心中间件
* @作者:songx
* @作者:songx
...
@@ -56,7 +58,6 @@ public class MessageConsr {
...
@@ -56,7 +58,6 @@ public class MessageConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【站内信(消)】发送站内信.[sendLetter]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【站内信(消)】发送站内信.[sendLetter]:"
+
e
.
getMessage
(),
e
);
}
}
LOGGER
.
info
(
"【站内信(消)】发送站内信,<END>"
);
}
}
/**
/**
...
@@ -87,7 +88,6 @@ public class MessageConsr {
...
@@ -87,7 +88,6 @@ public class MessageConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【站内信(消)】发送站内信.[sendLetter]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【站内信(消)】发送站内信.[sendLetter]:"
+
e
.
getMessage
(),
e
);
}
}
LOGGER
.
info
(
"【站内信(消)】发送站内信,<END>"
);
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/consumer/message/TemplateConsr.java
View file @
05feca4c
...
@@ -3,18 +3,17 @@
...
@@ -3,18 +3,17 @@
*/
*/
package
com
.
pcloud
.
book
.
consumer
.
message
;
package
com
.
pcloud
.
book
.
consumer
.
message
;
import
java.util.Map
;
import
com.pcloud.common.core.biz.TemplateQueueBiz
;
import
com.pcloud.common.core.constant.WechatCode
;
import
com.pcloud.common.core.dto.TemplateMessageDto
;
import
com.pcloud.common.exceptions.BizException
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
com.pcloud.common.core.biz.TemplateQueueBiz
;
import
java.util.Map
;
import
com.pcloud.common.core.constant.SendType
;
import
com.pcloud.common.core.constant.WechatCode
;
import
com.pcloud.common.core.dto.TemplateMessageDto
;
import
com.pcloud.common.exceptions.BizException
;
/**
/**
* @描述:发送模板消息
* @描述:发送模板消息
...
@@ -56,7 +55,6 @@ public class TemplateConsr {
...
@@ -56,7 +55,6 @@ public class TemplateConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【模板消息(消)】发送模板消息topic(管理公众号),<ERROR>.[sendMessageQueue]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【模板消息(消)】发送模板消息topic(管理公众号),<ERROR>.[sendMessageQueue]:"
+
e
.
getMessage
(),
e
);
}
}
LOGGER
.
info
(
"【模板消息(消)】发送模板消息topic(管理公众号),<END>"
);
}
}
public
void
sendOperate
(
String
SceneCode
,
Long
sendPartyId
,
Long
wechatUserId
,
String
url
,
public
void
sendOperate
(
String
SceneCode
,
Long
sendPartyId
,
Long
wechatUserId
,
String
url
,
...
@@ -76,7 +74,6 @@ public class TemplateConsr {
...
@@ -76,7 +74,6 @@ public class TemplateConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【模板消息(消)】发送模板消息topic(运营号),<ERROR>.[sendMessageQueue]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【模板消息(消)】发送模板消息topic(运营号),<ERROR>.[sendMessageQueue]:"
+
e
.
getMessage
(),
e
);
}
}
LOGGER
.
info
(
"【模板消息(消)】发送模板消息topic(运营号),<END>"
);
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/consumer/raystask/MainLineConsr.java
View file @
05feca4c
...
@@ -8,17 +8,14 @@ import com.pcloud.common.core.biz.WeektaskQueueBiz;
...
@@ -8,17 +8,14 @@ import com.pcloud.common.core.biz.WeektaskQueueBiz;
import
com.pcloud.common.core.constant.WeektaskBehaviorCode
;
import
com.pcloud.common.core.constant.WeektaskBehaviorCode
;
import
com.pcloud.common.core.constant.WeektaskCode
;
import
com.pcloud.common.core.constant.WeektaskCode
;
import
com.pcloud.common.core.dto.WeektaskMessageDto
;
import
com.pcloud.common.core.dto.WeektaskMessageDto
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.raystask.entity.AdviserDefault
;
import
com.pcloud.raystask.entity.AdviserDefault
;
import
com.pcloud.raystask.task.service.MainLineService
;
import
com.pcloud.raystask.task.service.MainLineService
;
import
java.util.concurrent.ExecutorService
;
import
org.slf4j.Logger
;
import
java.util.concurrent.Executors
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
/**
/**
* @描述:
* @描述:
...
@@ -44,7 +41,7 @@ public class MainLineConsr {
...
@@ -44,7 +41,7 @@ public class MainLineConsr {
* 设置默认应用标识
* 设置默认应用标识
*/
*/
public
void
sendDefaultId
(
AdviserDefault
adviserDefault
)
throws
BizException
{
public
void
sendDefaultId
(
AdviserDefault
adviserDefault
)
throws
BizException
{
LOGGER
.
info
(
"【rays小游戏(消)】设置默认应用标识,<START>
"
);
LOGGER
.
info
(
"【rays小游戏(消)】设置默认应用标识,<START>
adviserDefault:{}"
,
adviserDefault
);
try
{
try
{
mainLineService
.
sendDefaultId
(
adviserDefault
);
mainLineService
.
sendDefaultId
(
adviserDefault
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
pcloud-service-book/src/main/java/com/pcloud/book/consumer/resource/ProductConsr.java
View file @
05feca4c
...
@@ -58,8 +58,6 @@ public class ProductConsr {
...
@@ -58,8 +58,6 @@ public class ProductConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【资源中心(消)】微信端,获取商品信息.[listProDetail4Wechat]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【资源中心(消)】微信端,获取商品信息.[listProDetail4Wechat]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
}
finally
{
LOGGER
.
info
(
"【资源中心(消)】微信端,获取商品信息,<END>"
);
}
}
}
}
...
@@ -80,8 +78,6 @@ public class ProductConsr {
...
@@ -80,8 +78,6 @@ public class ProductConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【资源中心(消)】获取商品ID集合获取商品的标签.[listProDetail4Wechat]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【资源中心(消)】获取商品ID集合获取商品的标签.[listProDetail4Wechat]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
}
finally
{
LOGGER
.
info
(
"【资源中心(消)】获取商品ID集合获取商品的标签信息,<END>"
);
}
}
}
}
...
@@ -102,8 +98,6 @@ public class ProductConsr {
...
@@ -102,8 +98,6 @@ public class ProductConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【资源中心(消)】获取商品基本信息.[getProBasesByIds]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【资源中心(消)】获取商品基本信息.[getProBasesByIds]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
}
finally
{
LOGGER
.
info
(
"【资源中心(消)】获取商品基本信息,<END>"
);
}
}
}
}
...
@@ -124,8 +118,6 @@ public class ProductConsr {
...
@@ -124,8 +118,6 @@ public class ProductConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【资源中心(消)】获取商品基本信息.[getProInfoListWithScene]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【资源中心(消)】获取商品基本信息.[getProInfoListWithScene]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
}
finally
{
LOGGER
.
info
(
"【资源中心(消)】获取商品基本信息,<END>"
);
}
}
}
}
...
@@ -145,7 +137,6 @@ public class ProductConsr {
...
@@ -145,7 +137,6 @@ public class ProductConsr {
productDtoMap
=
ResponseHandleUtil
.
parseMapResponse
(
productDtoMap
=
ResponseHandleUtil
.
parseMapResponse
(
productService
.
getQaProRetailBase4Group
(
productIds
,
channelId
,
agentId
),
Long
.
class
,
productService
.
getQaProRetailBase4Group
(
productIds
,
channelId
,
agentId
),
Long
.
class
,
ProductDto
.
class
);
ProductDto
.
class
);
LOGGER
.
info
(
"【资源中心(消)】获取问答商品信息结束[productService.getQaProductInfoByIds]:"
+
productDtoMap
);
}
catch
(
BizException
e
)
{
}
catch
(
BizException
e
)
{
LOGGER
.
warn
(
"【资源中心(消)】获取问答商品信息失败:"
+
e
.
getMessage
(),
e
);
LOGGER
.
warn
(
"【资源中心(消)】获取问答商品信息失败:"
+
e
.
getMessage
(),
e
);
throw
new
BizException
(
e
.
getCode
(),
e
.
getMessage
());
throw
new
BizException
(
e
.
getCode
(),
e
.
getMessage
());
...
@@ -184,7 +175,6 @@ public class ProductConsr {
...
@@ -184,7 +175,6 @@ public class ProductConsr {
LOGGER
.
error
(
"【资源中心(消)】获取商品基本信息.[getProBasesByIds]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【资源中心(消)】获取商品基本信息.[getProBasesByIds]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
}
finally
{
}
finally
{
LOGGER
.
info
(
"【资源中心(消)】获取商品基本信息,<END>"
);
}
}
}
}
...
@@ -206,8 +196,6 @@ public class ProductConsr {
...
@@ -206,8 +196,6 @@ public class ProductConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【资源中心(消)】自动上架.[productAutoOnShelves]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【资源中心(消)】自动上架.[productAutoOnShelves]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
}
finally
{
LOGGER
.
info
(
"【资源中心(消)】自动上架,<END>"
);
}
}
return
resultMap
;
return
resultMap
;
}
}
...
@@ -230,8 +218,6 @@ public class ProductConsr {
...
@@ -230,8 +218,6 @@ public class ProductConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【资源中心(消)】判断是否是超级作者.[getIsSuperByProductIdList]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【资源中心(消)】判断是否是超级作者.[getIsSuperByProductIdList]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
}
finally
{
LOGGER
.
info
(
"【资源中心(消)】判断是否是超级作者,<END>"
);
}
}
return
resultMap
;
return
resultMap
;
}
}
...
@@ -262,8 +248,6 @@ public class ProductConsr {
...
@@ -262,8 +248,6 @@ public class ProductConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【资源中心(消)】获取商品基本信息.[getProBasesInfoById]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【资源中心(消)】获取商品基本信息.[getProBasesInfoById]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
}
finally
{
LOGGER
.
info
(
"【资源中心(消)】获取商品基本信息,<END>"
);
}
}
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/consumer/settlement/BookConsr.java
View file @
05feca4c
package
com
.
pcloud
.
book
.
consumer
.
settlement
;
package
com
.
pcloud
.
book
.
consumer
.
settlement
;
import
java.math.BigDecimal
;
import
com.pcloud.book.base.exception.BookBizException
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
com.pcloud.settlementcenter.record.dto.BookIncomeDto
;
import
com.pcloud.settlementcenter.record.dto.GetGroupClassifyIncomeDTO
;
import
com.pcloud.settlementcenter.record.dto.GetGroupClassifyIncomeDTO
;
import
com.pcloud.settlementcenter.record.dto.GetGroupQrcodeIncomeDTO
;
import
com.pcloud.settlementcenter.record.dto.GetGroupQrcodeIncomeDTO
;
import
com.pcloud.settlementcenter.record.dto.GroupRescourceIncomeParamDTO
;
import
com.pcloud.settlementcenter.record.dto.GroupRescourceIncomeParamDTO
;
import
com.pcloud.settlementcenter.record.service.BookService
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
com.pcloud.book.base.exception.BookBizException
;
import
java.math.BigDecimal
;
import
com.pcloud.common.exceptions.BizException
;
import
java.util.HashMap
;
import
com.pcloud.common.utils.ListUtils
;
import
java.util.List
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
java.util.Map
;
import
com.pcloud.settlementcenter.record.dto.BookIncomeDto
;
import
com.pcloud.settlementcenter.record.service.BookService
;
/**
/**
* @描述:书刊收益中间件
* @描述:书刊收益中间件
...
@@ -65,7 +64,6 @@ public class BookConsr {
...
@@ -65,7 +64,6 @@ public class BookConsr {
LOGGER
.
error
(
"【书刊-结算(消)】书籍收益信息,<ERROR>.[getBookIncomeInfo]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【书刊-结算(消)】书籍收益信息,<ERROR>.[getBookIncomeInfo]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_USER_ERROR
,
"书籍收益信息失败~!"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_USER_ERROR
,
"书籍收益信息失败~!"
);
}
}
LOGGER
.
info
(
"【书刊-结算(消)】书籍收益信息,<END>"
);
return
bookIncomeMap
;
return
bookIncomeMap
;
}
}
...
@@ -89,7 +87,6 @@ public class BookConsr {
...
@@ -89,7 +87,6 @@ public class BookConsr {
LOGGER
.
warn
(
"【书刊-结算(消)】获取图书收益,<ERROR>.[getBookIncome]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
warn
(
"【书刊-结算(消)】获取图书收益,<ERROR>.[getBookIncome]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_USER_ERROR
,
"获取图书收益失败~!"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_USER_ERROR
,
"获取图书收益失败~!"
);
}
}
LOGGER
.
info
(
"【书刊-结算(消)】获取图书收益,<END>"
);
return
bookIncome
;
return
bookIncome
;
}
}
...
@@ -106,7 +103,6 @@ public class BookConsr {
...
@@ -106,7 +103,6 @@ public class BookConsr {
paramMap
.
put
(
"adviserIdList"
,
adviserIdList
);
paramMap
.
put
(
"adviserIdList"
,
adviserIdList
);
Map
<
String
,
BigDecimal
>
resultMap
=
ResponseHandleUtil
.
parseMap
(
bookService
.
getBookIncome
(
paramMap
),
Map
<
String
,
BigDecimal
>
resultMap
=
ResponseHandleUtil
.
parseMap
(
bookService
.
getBookIncome
(
paramMap
),
String
.
class
,
BigDecimal
.
class
);
String
.
class
,
BigDecimal
.
class
);
LOGGER
.
info
(
"【书刊-结算(消)】批量获取书刊总收益,<END>"
);
return
resultMap
;
return
resultMap
;
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/consumer/user/AdviserConsr.java
View file @
05feca4c
...
@@ -3,14 +3,6 @@
...
@@ -3,14 +3,6 @@
*/
*/
package
com
.
pcloud
.
book
.
consumer
.
user
;
package
com
.
pcloud
.
book
.
consumer
.
user
;
import
java.util.List
;
import
java.util.Map
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
...
@@ -18,6 +10,14 @@ import com.pcloud.usercenter.party.adviser.dto.AdviserBaseInfoDto;
...
@@ -18,6 +10,14 @@ import com.pcloud.usercenter.party.adviser.dto.AdviserBaseInfoDto;
import
com.pcloud.usercenter.party.adviser.entity.Adviser
;
import
com.pcloud.usercenter.party.adviser.entity.Adviser
;
import
com.pcloud.usercenter.party.adviser.service.AdviserService
;
import
com.pcloud.usercenter.party.adviser.service.AdviserService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @描述:顾问用户中间类
* @描述:顾问用户中间类
* @作者:lili
* @作者:lili
...
@@ -48,7 +48,6 @@ public class AdviserConsr {
...
@@ -48,7 +48,6 @@ public class AdviserConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【顾问用户(消)】获取顾问名称.[getNameById]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【顾问用户(消)】获取顾问名称.[getNameById]:"
+
e
.
getMessage
(),
e
);
}
}
LOGGER
.
info
(
"【顾问用户(消)】获取顾问名称,<END>.[adviserName]="
+
adviserName
);
return
adviserName
==
null
?
""
:
adviserName
;
return
adviserName
==
null
?
""
:
adviserName
;
}
}
...
@@ -67,7 +66,6 @@ public class AdviserConsr {
...
@@ -67,7 +66,6 @@ public class AdviserConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【顾问用户(消)】批量获取顾问名称.[getNames]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【顾问用户(消)】批量获取顾问名称.[getNames]:"
+
e
.
getMessage
(),
e
);
}
}
LOGGER
.
info
(
"【顾问用户(消)】批量获取顾问名称,<END>"
);
return
adviserMap
;
return
adviserMap
;
}
}
...
@@ -85,7 +83,6 @@ public class AdviserConsr {
...
@@ -85,7 +83,6 @@ public class AdviserConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【顾问用户(消)】获取顾问基本信息.[getById]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【顾问用户(消)】获取顾问基本信息.[getById]:"
+
e
.
getMessage
(),
e
);
}
}
LOGGER
.
info
(
"【顾问用户(消)】获取顾问基本信息,<END>"
);
return
adviser
;
return
adviser
;
}
}
...
@@ -103,7 +100,6 @@ public class AdviserConsr {
...
@@ -103,7 +100,6 @@ public class AdviserConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【顾问用户(消)】获取顾问所属出版.[getAgentIdByAdviser]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【顾问用户(消)】获取顾问所属出版.[getAgentIdByAdviser]:"
+
e
.
getMessage
(),
e
);
}
}
LOGGER
.
info
(
"【顾问用户(消)】获取顾问所属出版,<END>.[agentId]="
+
agentId
);
return
agentId
;
return
agentId
;
}
}
...
@@ -122,7 +118,6 @@ public class AdviserConsr {
...
@@ -122,7 +118,6 @@ public class AdviserConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【顾问用户(消)】获取顾问信息(包含所属出版社).[getAdviserId2AdviserInfoDtoMap]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【顾问用户(消)】获取顾问信息(包含所属出版社).[getAdviserId2AdviserInfoDtoMap]:"
+
e
.
getMessage
(),
e
);
}
}
LOGGER
.
info
(
"【顾问用户(消)】获取顾问信息(包含所属出版社),<END>"
);
return
resultMap
;
return
resultMap
;
}
}
...
@@ -143,7 +138,6 @@ public class AdviserConsr {
...
@@ -143,7 +138,6 @@ public class AdviserConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【顾问用户(消)】根据代理标识获取编辑标识列表.[getByAgentId]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【顾问用户(消)】根据代理标识获取编辑标识列表.[getByAgentId]:"
+
e
.
getMessage
(),
e
);
}
}
LOGGER
.
info
(
"【顾问用户(消)】根据代理标识获取编辑标识列表,<END>"
);
return
adviserIds
;
return
adviserIds
;
}
}
...
@@ -165,7 +159,6 @@ public class AdviserConsr {
...
@@ -165,7 +159,6 @@ public class AdviserConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【顾问用户(消)】根据名称代理标识获取编辑标识列表.[getIdsByNameAndAgentId]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【顾问用户(消)】根据名称代理标识获取编辑标识列表.[getIdsByNameAndAgentId]:"
+
e
.
getMessage
(),
e
);
}
}
LOGGER
.
info
(
"【顾问用户(消)】根据名称代理标识获取编辑标识列表,<END>"
);
return
adviserIds
;
return
adviserIds
;
}
}
...
@@ -182,7 +175,6 @@ public class AdviserConsr {
...
@@ -182,7 +175,6 @@ public class AdviserConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【顾问用户(消)】获取默认运营.[getNameById]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【顾问用户(消)】获取默认运营.[getNameById]:"
+
e
.
getMessage
(),
e
);
}
}
LOGGER
.
info
(
"【顾问用户(消)】获取默认运营,<END>."
);
return
channelId
;
return
channelId
;
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/consumer/user/AgentConsr.java
View file @
05feca4c
...
@@ -3,13 +3,6 @@
...
@@ -3,13 +3,6 @@
*/
*/
package
com
.
pcloud
.
book
.
consumer
.
user
;
package
com
.
pcloud
.
book
.
consumer
.
user
;
import
java.util.List
;
import
java.util.Map
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Component
;
import
com.pcloud.channelcenter.base.exceptions.ChannelBizException
;
import
com.pcloud.channelcenter.base.exceptions.ChannelBizException
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
...
@@ -18,6 +11,15 @@ import com.pcloud.common.utils.ResponseHandleUtil;
...
@@ -18,6 +11,15 @@ import com.pcloud.common.utils.ResponseHandleUtil;
import
com.pcloud.usercenter.party.agent.entity.Agent
;
import
com.pcloud.usercenter.party.agent.entity.Agent
;
import
com.pcloud.usercenter.party.agent.service.AgentService
;
import
com.pcloud.usercenter.party.agent.service.AgentService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @描述:代理工具类
* @描述:代理工具类
* @作者:songx
* @作者:songx
...
@@ -45,7 +47,6 @@ public class AgentConsr {
...
@@ -45,7 +47,6 @@ public class AgentConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【代理用户(消)】获取代理类型,<ERROR>.[getAgentType]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【代理用户(消)】获取代理类型,<ERROR>.[getAgentType]:"
+
e
.
getMessage
(),
e
);
}
}
LOGGER
.
info
(
"【代理用户(消)】获取代理类型,<END>.[agentType]="
+
agentType
);
return
agentType
==
null
?
null
:
agentType
;
return
agentType
==
null
?
null
:
agentType
;
}
}
...
@@ -91,7 +92,6 @@ public class AgentConsr {
...
@@ -91,7 +92,6 @@ public class AgentConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【出版用户(消)】批量获取出版名称.[getNames]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【出版用户(消)】批量获取出版名称.[getNames]:"
+
e
.
getMessage
(),
e
);
}
}
LOGGER
.
info
(
"【出版用户(消)】批量获取出版名称,<END>"
);
return
agentMap
;
return
agentMap
;
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/consumer/user/BookcaseConsr.java
View file @
05feca4c
...
@@ -3,19 +3,19 @@
...
@@ -3,19 +3,19 @@
*/
*/
package
com
.
pcloud
.
book
.
consumer
.
user
;
package
com
.
pcloud
.
book
.
consumer
.
user
;
import
java.util.List
;
import
com.pcloud.book.base.exception.BookBizException
;
import
java.util.Map
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
com.pcloud.usercenter.common.dto.BookCaseParamDto
;
import
com.pcloud.usercenter.common.service.BookcaseService
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
com.pcloud.book.base.exception.BookBizException
;
import
java.util.List
;
import
com.pcloud.common.exceptions.BizException
;
import
java.util.Map
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
com.pcloud.usercenter.common.dto.BookCaseParamDto
;
import
com.pcloud.usercenter.common.service.BookcaseService
;
/**
/**
* @描述:书架中间类
* @描述:书架中间类
...
@@ -48,7 +48,6 @@ public class BookcaseConsr {
...
@@ -48,7 +48,6 @@ public class BookcaseConsr {
LOGGER
.
error
(
"【书架-用户(消)】更换书架书籍所属权,<ERROR>.[changeBookAdviser]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【书架-用户(消)】更换书架书籍所属权,<ERROR>.[changeBookAdviser]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_USER_ERROR
,
"更换书架书籍所属权失败~!"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_USER_ERROR
,
"更换书架书籍所属权失败~!"
);
}
}
LOGGER
.
info
(
"【书架-用户(消)】更换书架书籍所属权,<END>"
);
}
}
/**
/**
...
@@ -67,7 +66,6 @@ public class BookcaseConsr {
...
@@ -67,7 +66,6 @@ public class BookcaseConsr {
LOGGER
.
error
(
"【书架-用户(消)】获取书籍是否加入书架,<ERROR>.[changeBookAdviser]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【书架-用户(消)】获取书籍是否加入书架,<ERROR>.[changeBookAdviser]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_USER_ERROR
,
"获取书籍是否加入书架失败~!"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_USER_ERROR
,
"获取书籍是否加入书架失败~!"
);
}
}
LOGGER
.
info
(
"【书架-用户(消)】获取书籍是否加入书架,<END>"
);
return
resultMap
;
return
resultMap
;
}
}
...
@@ -86,6 +84,5 @@ public class BookcaseConsr {
...
@@ -86,6 +84,5 @@ public class BookcaseConsr {
LOGGER
.
error
(
"【书架-用户(消)】删除读者书架上的书籍,<ERROR>.[deleteBookForAdviser]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【书架-用户(消)】删除读者书架上的书籍,<ERROR>.[deleteBookForAdviser]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_USER_ERROR
,
"删除读者书架上的书籍失败~!"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_USER_ERROR
,
"删除读者书架上的书籍失败~!"
);
}
}
LOGGER
.
info
(
"【书架-用户(消)】删除读者书架上的书籍,<END>"
);
}
}
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/consumer/user/ChannelConsr.java
View file @
05feca4c
...
@@ -46,8 +46,7 @@ public class ChannelConsr {
...
@@ -46,8 +46,7 @@ public class ChannelConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【渠道用户(消)】获取渠道名称,<ERROR>.[getNameById]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【渠道用户(消)】获取渠道名称,<ERROR>.[getNameById]:"
+
e
.
getMessage
(),
e
);
}
}
LOGGER
.
info
(
"【渠道用户(消)】获取渠道名称,<END>.[channelName]="
+
channelName
);
return
channelName
;
return
channelName
==
null
?
null
:
channelName
;
}
}
/**
/**
...
@@ -65,7 +64,6 @@ public class ChannelConsr {
...
@@ -65,7 +64,6 @@ public class ChannelConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【渠道用户(消)】获取渠道信息,<ERROR>.[getNamesByIdList]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【渠道用户(消)】获取渠道信息,<ERROR>.[getNamesByIdList]:"
+
e
.
getMessage
(),
e
);
}
}
LOGGER
.
info
(
"【渠道用户(消)】获取渠道信息,<END>"
);
return
channelMap
;
return
channelMap
;
}
}
...
@@ -83,7 +81,6 @@ public class ChannelConsr {
...
@@ -83,7 +81,6 @@ public class ChannelConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【渠道用户(消)】获取代理标识,<ERROR>.[getParentId]:"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"【渠道用户(消)】获取代理标识,<ERROR>.[getParentId]:"
+
e
.
getMessage
(),
e
);
}
}
LOGGER
.
info
(
"【渠道用户(消)】获取渠道标识,<END>.[agentId]="
+
agentId
);
return
agentId
;
return
agentId
;
}
}
...
@@ -101,7 +98,6 @@ public class ChannelConsr {
...
@@ -101,7 +98,6 @@ public class ChannelConsr {
try
{
try
{
status
=
ResponseHandleUtil
status
=
ResponseHandleUtil
.
parseResponse
(
channelService
.
judgeChannelAdviserRelationship
(
channelId
,
adviserId
),
Boolean
.
class
);
.
parseResponse
(
channelService
.
judgeChannelAdviserRelationship
(
channelId
,
adviserId
),
Boolean
.
class
);
LOGGER
.
info
(
"验证编辑渠道是否为一个出版社结束[channelService.judgeChannelAdviserRelationship]"
);
}
catch
(
BizException
e
)
{
}
catch
(
BizException
e
)
{
LOGGER
.
warn
(
"验证编辑渠道是否为一个出版社失败:"
+
e
.
getMessage
(),
e
);
LOGGER
.
warn
(
"验证编辑渠道是否为一个出版社失败:"
+
e
.
getMessage
(),
e
);
throw
new
BizException
(
e
.
getCode
(),
e
.
getMessage
());
throw
new
BizException
(
e
.
getCode
(),
e
.
getMessage
());
...
...
pcloud-service-book/src/main/java/com/pcloud/book/consumer/user/PartyConsr.java
View file @
05feca4c
...
@@ -52,7 +52,6 @@ public class PartyConsr {
...
@@ -52,7 +52,6 @@ public class PartyConsr {
}
}
Map
<
Long
,
Agent
>
agentInfoMap
=
ResponseHandleUtil
Map
<
Long
,
Agent
>
agentInfoMap
=
ResponseHandleUtil
.
parseMapResponse
(
partyService
.
getAgentByPartyId
(
partyIds
,
roleCode
),
Long
.
class
,
Agent
.
class
);
.
parseMapResponse
(
partyService
.
getAgentByPartyId
(
partyIds
,
roleCode
),
Long
.
class
,
Agent
.
class
);
LOGGER
.
info
(
"【用户中心(消)】批量获取代理基本信息,<END>"
);
return
agentInfoMap
;
return
agentInfoMap
;
}
}
...
@@ -66,7 +65,6 @@ public class PartyConsr {
...
@@ -66,7 +65,6 @@ public class PartyConsr {
}
}
Map
<
Long
,
String
>
resultMap
=
ResponseHandleUtil
Map
<
Long
,
String
>
resultMap
=
ResponseHandleUtil
.
parseMapResponse
(
userLoginService
.
getAllUserLoginName
(
partyId
,
systemCode
),
Long
.
class
,
String
.
class
);
.
parseMapResponse
(
userLoginService
.
getAllUserLoginName
(
partyId
,
systemCode
),
Long
.
class
,
String
.
class
);
LOGGER
.
info
(
"【用户中心(消)】获取平台端所有账号的用户名,<END>.result = "
+
resultMap
.
toString
());
return
resultMap
;
return
resultMap
;
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/consumer/wechatgroup/WechatGroupConsr.java
View file @
05feca4c
...
@@ -58,8 +58,6 @@ public class WechatGroupConsr {
...
@@ -58,8 +58,6 @@ public class WechatGroupConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"根据机器人id和用户微信id获取最新暗号.[getCipherByRobotAndUserWxId]:"
+
e
.
getMessage
(),
e
);
log
.
error
(
"根据机器人id和用户微信id获取最新暗号.[getCipherByRobotAndUserWxId]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
}
finally
{
log
.
info
(
"【根据机器人id和用户微信id获取最新暗号,<END>"
);
}
}
}
}
...
@@ -77,7 +75,6 @@ public class WechatGroupConsr {
...
@@ -77,7 +75,6 @@ public class WechatGroupConsr {
log
.
error
(
"是否群机器人.[isGroupRobot]:"
+
e
.
getMessage
(),
e
);
log
.
error
(
"是否群机器人.[isGroupRobot]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
}
finally
{
}
finally
{
log
.
info
(
"【是否群机器人,<END>"
);
}
}
}
}
...
@@ -98,7 +95,6 @@ public class WechatGroupConsr {
...
@@ -98,7 +95,6 @@ public class WechatGroupConsr {
log
.
error
(
"是否黑名单.[isKickUser]:"
+
e
.
getMessage
(),
e
);
log
.
error
(
"是否黑名单.[isKickUser]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
}
finally
{
}
finally
{
log
.
info
(
"【是否黑名单,<END>"
);
}
}
}
}
...
@@ -120,7 +116,6 @@ public class WechatGroupConsr {
...
@@ -120,7 +116,6 @@ public class WechatGroupConsr {
log
.
error
(
"根据群号获取机器人微信号.[getRobotIdByGroupId]:"
+
e
.
getMessage
(),
e
);
log
.
error
(
"根据群号获取机器人微信号.[getRobotIdByGroupId]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
}
finally
{
}
finally
{
log
.
info
(
"【根据群号获取机器人微信号,<END>"
);
}
}
}
}
...
@@ -138,8 +133,6 @@ public class WechatGroupConsr {
...
@@ -138,8 +133,6 @@ public class WechatGroupConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"根据群号获取发广告机器人微信号.[getSendAdRobotByGroupId]:"
+
e
.
getMessage
(),
e
);
log
.
error
(
"根据群号获取发广告机器人微信号.[getSendAdRobotByGroupId]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
}
finally
{
log
.
info
(
"【根据群号获取发广告机器人微信号,<END>"
);
}
}
}
}
...
@@ -161,8 +154,6 @@ public class WechatGroupConsr {
...
@@ -161,8 +154,6 @@ public class WechatGroupConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"根据昵称获取微信id.[getWxUserIdsByNickName]:"
+
e
.
getMessage
(),
e
);
log
.
error
(
"根据昵称获取微信id.[getWxUserIdsByNickName]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
}
finally
{
log
.
info
(
"【根据昵称获取微信id,<END>"
);
}
}
}
}
...
@@ -275,8 +266,6 @@ public class WechatGroupConsr {
...
@@ -275,8 +266,6 @@ public class WechatGroupConsr {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"根据群号获取群主微信号.[getMasterIdByGroupId]:"
+
e
.
getMessage
(),
e
);
log
.
error
(
"根据群号获取群主微信号.[getMasterIdByGroupId]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
}
finally
{
log
.
info
(
"【根据群号获取群主微信号,<END>--masterId="
+
masterId
);
}
}
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/copyright/biz/impl/BookAuthCodeBizImpl.java
View file @
05feca4c
...
@@ -45,8 +45,6 @@ import com.pcloud.common.utils.json.JSONUtils;
...
@@ -45,8 +45,6 @@ import com.pcloud.common.utils.json.JSONUtils;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.readercenter.wechat.entity.WechatUser
;
import
com.pcloud.readercenter.wechat.entity.WechatUser
;
import
com.pcloud.resourcecenter.base.exceptions.ResBizException
;
import
com.pcloud.resourcecenter.base.exceptions.ResBizException
;
import
com.pcloud.resourcecenter.product.dto.ProductFreeCodeDto
;
import
com.pcloud.resourcecenter.product.entity.ProductFreeCode
;
import
com.pcloud.settlementcenter.record.exceptions.RecordException
;
import
com.pcloud.settlementcenter.record.exceptions.RecordException
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -167,7 +165,7 @@ public class BookAuthCodeBizImpl implements BookAuthCodeBiz {
...
@@ -167,7 +165,7 @@ public class BookAuthCodeBizImpl implements BookAuthCodeBiz {
}
}
@Override
@Override
@ParamLog
(
"校验服务是否需要验证"
)
@ParamLog
(
value
=
"校验服务是否需要验证"
,
isAfterReturn
=
false
)
public
Boolean
checkServe
(
CheckIsAuthServeParam
checkIsAuthServeParam
,
Long
channelId
,
Long
wechatUserId
)
{
public
Boolean
checkServe
(
CheckIsAuthServeParam
checkIsAuthServeParam
,
Long
channelId
,
Long
wechatUserId
)
{
Long
serveId
=
checkIsAuthServeParam
.
getServeId
();
Long
serveId
=
checkIsAuthServeParam
.
getServeId
();
String
serveType
=
checkIsAuthServeParam
.
getServeType
();
String
serveType
=
checkIsAuthServeParam
.
getServeType
();
...
@@ -194,11 +192,7 @@ public class BookAuthCodeBizImpl implements BookAuthCodeBiz {
...
@@ -194,11 +192,7 @@ public class BookAuthCodeBizImpl implements BookAuthCodeBiz {
}
}
//校验用户是否已经授权过
//校验用户是否已经授权过
Boolean
isHaveAuth
=
bookAuthUserBiz
.
checkIsHaveAuth
(
bookId
,
channelId
,
adviserId
,
wechatUserId
,
null
);
Boolean
isHaveAuth
=
bookAuthUserBiz
.
checkIsHaveAuth
(
bookId
,
channelId
,
adviserId
,
wechatUserId
,
null
);
if
(
isHaveAuth
)
{
return
!
isHaveAuth
;
return
false
;
}
else
{
return
true
;
}
}
}
@Override
@Override
...
@@ -371,7 +365,7 @@ public class BookAuthCodeBizImpl implements BookAuthCodeBiz {
...
@@ -371,7 +365,7 @@ public class BookAuthCodeBizImpl implements BookAuthCodeBiz {
}
}
//表名
//表名
String
title
=
"《"
+
bookDto
.
getBookName
()
+
"》"
+
"的授权码"
;
String
title
=
"《"
+
bookDto
.
getBookName
()
+
"》"
+
"的授权码"
;
String
[]
rowsName
=
{
"序号"
,
"
授权码"
,
"
完整授权码"
,
"生成方式"
,
"状态"
,
"创建时间"
};
String
[]
rowsName
=
{
"序号"
,
"完整授权码"
,
"生成方式"
,
"状态"
,
"创建时间"
};
String
fileUrl
=
""
;
String
fileUrl
=
""
;
String
finalTitle
=
title
;
String
finalTitle
=
title
;
//不管是全部导出还是导出部分,都使用异步处理
//不管是全部导出还是导出部分,都使用异步处理
...
@@ -443,13 +437,13 @@ public class BookAuthCodeBizImpl implements BookAuthCodeBiz {
...
@@ -443,13 +437,13 @@ public class BookAuthCodeBizImpl implements BookAuthCodeBiz {
}
}
Object
[]
objs
=
new
Object
[
rowsNameList
.
size
()];
Object
[]
objs
=
new
Object
[
rowsNameList
.
size
()];
objs
[
0
]
=
i
+
1
;
objs
[
0
]
=
i
+
1
;
objs
[
1
]
=
bookAuthCode
.
getAuthCode
();
//
objs[1] = bookAuthCode.getAuthCode();
objs
[
2
]
=
bookAuthCode
.
getFullCode
();
objs
[
1
]
=
bookAuthCode
.
getFullCode
();
CopyrightConstants
.
CreateType
createType
=
CopyrightConstants
.
CreateType
.
CRATE_TYPE_MAP
.
get
(
bookAuthCode
.
getCreateType
());
CopyrightConstants
.
CreateType
createType
=
CopyrightConstants
.
CreateType
.
CRATE_TYPE_MAP
.
get
(
bookAuthCode
.
getCreateType
());
objs
[
3
]
=
null
==
createType
?
"-"
:
createType
.
getName
();
objs
[
2
]
=
null
==
createType
?
"-"
:
createType
.
getName
();
objs
[
4
]
=
bookAuthCode
.
getUseCount
()
>
0
?
"已使用"
:
"未使用"
;
objs
[
3
]
=
bookAuthCode
.
getUseCount
()
>
0
?
"已使用"
:
"未使用"
;
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
objs
[
5
]
=
bookAuthCode
.
getCreatedDate
()
!=
null
?
df
.
format
(
bookAuthCode
.
getCreatedDate
())
:
""
;
objs
[
4
]
=
bookAuthCode
.
getCreatedDate
()
!=
null
?
df
.
format
(
bookAuthCode
.
getCreatedDate
())
:
""
;
dataList
.
add
(
objs
);
dataList
.
add
(
objs
);
fileUrl
=
exportConsr
.
exportExcel
(
title
,
rowsName
,
dataList
);
fileUrl
=
exportConsr
.
exportExcel
(
title
,
rowsName
,
dataList
);
}
}
...
@@ -516,20 +510,20 @@ public class BookAuthCodeBizImpl implements BookAuthCodeBiz {
...
@@ -516,20 +510,20 @@ public class BookAuthCodeBizImpl implements BookAuthCodeBiz {
SXSSFCell
cell0
=
srow
.
createCell
(
0
);
SXSSFCell
cell0
=
srow
.
createCell
(
0
);
cell0
.
setCellStyle
(
dataStyle
);
cell0
.
setCellStyle
(
dataStyle
);
cell0
.
setCellValue
(
k
++);
cell0
.
setCellValue
(
k
++);
SXSSFCell
cell1
=
srow
.
createCell
(
1
);
/*
SXSSFCell cell1 = srow.createCell(1);
cell1.setCellStyle(dataStyle);
cell1.setCellStyle(dataStyle);
cell1
.
setCellValue
(
bookAuthCodeDTO
.
getAuthCode
());
cell1.setCellValue(bookAuthCodeDTO.getAuthCode());
*/
SXSSFCell
cell2
=
srow
.
createCell
(
2
);
SXSSFCell
cell2
=
srow
.
createCell
(
1
);
cell2
.
setCellStyle
(
dataStyle
);
cell2
.
setCellStyle
(
dataStyle
);
cell2
.
setCellValue
(
bookAuthCodeDTO
.
getFullCode
());
cell2
.
setCellValue
(
bookAuthCodeDTO
.
getFullCode
());
SXSSFCell
cell3
=
srow
.
createCell
(
3
);
SXSSFCell
cell3
=
srow
.
createCell
(
2
);
cell3
.
setCellStyle
(
dataStyle
);
cell3
.
setCellStyle
(
dataStyle
);
CopyrightConstants
.
CreateType
createType
=
CopyrightConstants
.
CreateType
.
CRATE_TYPE_MAP
.
get
(
bookAuthCodeDTO
.
getCreateType
());
CopyrightConstants
.
CreateType
createType
=
CopyrightConstants
.
CreateType
.
CRATE_TYPE_MAP
.
get
(
bookAuthCodeDTO
.
getCreateType
());
cell3
.
setCellValue
(
null
==
createType
?
"-"
:
createType
.
getName
());
cell3
.
setCellValue
(
null
==
createType
?
"-"
:
createType
.
getName
());
SXSSFCell
cell4
=
srow
.
createCell
(
4
);
SXSSFCell
cell4
=
srow
.
createCell
(
3
);
cell4
.
setCellStyle
(
dataStyle
);
cell4
.
setCellStyle
(
dataStyle
);
cell4
.
setCellValue
(
bookAuthCodeDTO
.
getUseCount
()
>
0
?
"已使用"
:
"未使用"
);
cell4
.
setCellValue
(
bookAuthCodeDTO
.
getUseCount
()
>
0
?
"已使用"
:
"未使用"
);
SXSSFCell
cell5
=
srow
.
createCell
(
5
);
SXSSFCell
cell5
=
srow
.
createCell
(
4
);
cell5
.
setCellStyle
(
dataStyle
);
cell5
.
setCellStyle
(
dataStyle
);
cell5
.
setCellValue
(
bookAuthCodeDTO
.
getCreatedDate
()
!=
null
?
df
.
format
(
bookAuthCodeDTO
.
getCreatedDate
())
:
""
);
cell5
.
setCellValue
(
bookAuthCodeDTO
.
getCreatedDate
()
!=
null
?
df
.
format
(
bookAuthCodeDTO
.
getCreatedDate
())
:
""
);
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/es/biz/impl/ESNewsBizImpl.java
View file @
05feca4c
...
@@ -51,17 +51,12 @@ public class ESNewsBizImpl implements ESNewsBiz {
...
@@ -51,17 +51,12 @@ public class ESNewsBizImpl implements ESNewsBiz {
Integer
index
=
0
;
Integer
index
=
0
;
Integer
offset
=
10000
;
Integer
offset
=
10000
;
while
(
index
*
offset
<
count
)
{
while
(
index
*
offset
<
count
)
{
Date
date
=
new
Date
();
List
<
ESNews
>
list
=
newsDao
.
findAll
(
maxId
,
offset
);
List
<
ESNews
>
list
=
newsDao
.
findAll
(
maxId
,
offset
);
LOGGER
.
info
(
"查询10000用时"
+
(
new
Date
().
getTime
()
-
date
.
getTime
()));
if
(
ListUtils
.
isEmpty
(
list
))
{
if
(
ListUtils
.
isEmpty
(
list
))
{
break
;
break
;
}
}
Date
date1
=
new
Date
();
newsRepository
.
save
(
list
);
newsRepository
.
save
(
list
);
LOGGER
.
info
(
"插入es10000用时"
+
(
new
Date
().
getTime
()
-
date1
.
getTime
()));
maxId
=
Long
.
valueOf
(
list
.
get
(
list
.
size
()
-
1
).
getId
());
maxId
=
Long
.
valueOf
(
list
.
get
(
list
.
size
()
-
1
).
getId
());
LOGGER
.
info
(
"导入数据至"
+
maxId
);
index
+=
1
;
index
+=
1
;
}
}
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/AppClickRecordBizImpl.java
View file @
05feca4c
...
@@ -6,8 +6,8 @@ import com.pcloud.book.group.dao.AppClickRecordDao;
...
@@ -6,8 +6,8 @@ import com.pcloud.book.group.dao.AppClickRecordDao;
import
com.pcloud.book.group.dao.GroupQrcodeDao
;
import
com.pcloud.book.group.dao.GroupQrcodeDao
;
import
com.pcloud.book.group.entity.AppClickRecord
;
import
com.pcloud.book.group.entity.AppClickRecord
;
import
com.pcloud.book.group.entity.GroupQrcode
;
import
com.pcloud.book.group.entity.GroupQrcode
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -25,7 +25,6 @@ public class AppClickRecordBizImpl implements AppClickRecordBiz {
...
@@ -25,7 +25,6 @@ public class AppClickRecordBizImpl implements AppClickRecordBiz {
private
GroupQrcodeDao
groupQrcodeDao
;
private
GroupQrcodeDao
groupQrcodeDao
;
@ParamLog
(
"新增应用作品点击记录"
)
@Override
@Override
public
Long
createAppClickRecord
(
AppClickRecord
appClickRecord
)
{
public
Long
createAppClickRecord
(
AppClickRecord
appClickRecord
)
{
if
(
appClickRecord
.
getQrcodeId
()
==
null
)
{
if
(
appClickRecord
.
getQrcodeId
()
==
null
)
{
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
View file @
05feca4c
...
@@ -2012,9 +2012,8 @@ public class BookGroupBizImpl implements BookGroupBiz {
...
@@ -2012,9 +2012,8 @@ public class BookGroupBizImpl implements BookGroupBiz {
dataMap
.
put
(
"productSumStatistics"
,
productSumStatistics
);
dataMap
.
put
(
"productSumStatistics"
,
productSumStatistics
);
String
today
=
DateUtils
.
formatDate
(
DateUtils
.
nowTimeStamp
(),
DateUtils
.
DATE_FORMAT_DATEONLY
);
String
today
=
DateUtils
.
formatDate
(
DateUtils
.
nowTimeStamp
(),
DateUtils
.
DATE_FORMAT_DATEONLY
);
String
fileName
=
title
+
"-"
+
today
;
String
fileName
=
title
+
"-"
+
today
;
String
filePath
=
""
;
String
filePath
;
try
{
try
{
LOGGER
.
info
(
"生成Excel【START】"
);
filePath
=
ExcelExportor
.
uploadExcel
(
this
.
getClass
(),
dataMap
,
"template_bookGroupStatistics.ftl"
);
filePath
=
ExcelExportor
.
uploadExcel
(
this
.
getClass
(),
dataMap
,
"template_bookGroupStatistics.ftl"
);
LOGGER
.
info
(
"生成Excel【END】"
+
filePath
);
LOGGER
.
info
(
"生成Excel【END】"
+
filePath
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/dto/GroupQrcodeFoAdDTO.java
View file @
05feca4c
package
com
.
pcloud
.
book
.
group
.
dto
;
package
com
.
pcloud
.
book
.
group
.
dto
;
import
com.pcloud.book.adnews.entity.AdNews
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.List
;
/**
/**
* @Description
* @Description
* @Author ruansiyuan
* @Author ruansiyuan
* @Date 2019/7/18 15:09
* @Date 2019/7/18 15:09
**/
**/
@Data
public
class
GroupQrcodeFoAdDTO
implements
Serializable
{
public
class
GroupQrcodeFoAdDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
7018070035247234809L
;
private
static
final
long
serialVersionUID
=
7018070035247234809L
;
...
@@ -18,45 +23,25 @@ public class GroupQrcodeFoAdDTO implements Serializable {
...
@@ -18,45 +23,25 @@ public class GroupQrcodeFoAdDTO implements Serializable {
private
String
weixinGroupId
;
private
String
weixinGroupId
;
public
Long
getQrcodeId
()
{
// 专业id
return
qrcodeId
;
private
Long
proLabelId
;
}
// 深度id
public
void
setQrcodeId
(
Long
qrcodeId
)
{
private
Long
depLabelId
;
this
.
qrcodeId
=
qrcodeId
;
}
// 目的id
private
Long
purLabelId
;
public
Long
getClassifyId
()
{
return
classifyId
;
// 专业
}
private
String
proLabelName
;
public
void
setClassifyId
(
Long
classifyId
)
{
// 深度
this
.
classifyId
=
classifyId
;
private
String
depLabelName
;
}
// 目的
public
Long
getBookGroupId
()
{
private
String
purLabelName
;
return
bookGroupId
;
}
// 需要发送的早晚报
private
List
<
AdNews
>
adNewsList
;
public
void
setBookGroupId
(
Long
bookGroupId
)
{
this
.
bookGroupId
=
bookGroupId
;
}
public
String
getWeixinGroupId
()
{
return
weixinGroupId
;
}
public
void
setWeixinGroupId
(
String
weixinGroupId
)
{
this
.
weixinGroupId
=
weixinGroupId
;
}
@Override
public
String
toString
()
{
return
"GroupQrcodeFoAdDTO{"
+
"qrcodeId="
+
qrcodeId
+
", classifyId="
+
classifyId
+
", bookGroupId="
+
bookGroupId
+
", weixinGroupId='"
+
weixinGroupId
+
'\''
+
'}'
;
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/BookGroupClassifyFacade.java
View file @
05feca4c
package
com
.
pcloud
.
book
.
group
.
facade
;
package
com
.
pcloud
.
book
.
group
.
facade
;
import
com.pcloud.book.group.vo.*
;
import
com.pcloud.book.group.vo.AddClassifyVO
;
import
com.pcloud.book.group.vo.AdviserClassifyParam
;
import
com.pcloud.book.group.vo.AdviserClassifyVO
;
import
com.pcloud.book.group.vo.BookGroupClassifyVO
;
import
com.pcloud.book.group.vo.BookGroupQrcodeStatisticVO
;
import
com.pcloud.book.group.vo.ClassifyAndGroupCountVO
;
import
com.pcloud.book.group.vo.ClassifyAndUserCountVO
;
import
com.pcloud.book.group.vo.ClassifyNameVO
;
import
com.pcloud.book.group.vo.ClassifyVO
;
import
com.pcloud.book.group.vo.GroupQrcode4ClassifyVO
;
import
com.pcloud.book.group.vo.ListBookGroupQrcodeExportParamVO
;
import
com.pcloud.book.group.vo.ListBookGroupQrcodeParamVO
;
import
com.pcloud.book.group.vo.ListClassify4WechatVO
;
import
com.pcloud.book.group.vo.ListClassifyVO
;
import
com.pcloud.book.group.vo.ListGroupClassifyParam
;
import
com.pcloud.book.group.vo.StatisticVO
;
import
com.pcloud.book.group.vo.UpdateClassifyVO
;
import
com.pcloud.book.group.vo.UpdateRankVO
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.permission.PermissionException
;
import
com.pcloud.common.permission.PermissionException
;
import
io.swagger.annotations.*
;
import
org.springframework.web.bind.annotation.CookieValue
;
import
org.springframework.web.bind.annotation.CookieValue
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
@@ -18,6 +34,12 @@ import org.springframework.web.bind.annotation.RequestParam;
...
@@ -18,6 +34,12 @@ import org.springframework.web.bind.annotation.RequestParam;
import
java.util.List
;
import
java.util.List
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
/**
/**
* @author lily
* @author lily
* @date 2019/4/16 21:00
* @date 2019/4/16 21:00
...
@@ -141,7 +163,6 @@ public interface BookGroupClassifyFacade {
...
@@ -141,7 +163,6 @@ public interface BookGroupClassifyFacade {
ResponseDto
<?>
bookGroupQrcodeStatisticExport
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
ListBookGroupQrcodeExportParamVO
listBookGroupQrcodeExportParamVO
)
throws
PermissionException
;
ResponseDto
<?>
bookGroupQrcodeStatisticExport
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
ListBookGroupQrcodeExportParamVO
listBookGroupQrcodeExportParamVO
)
throws
PermissionException
;
@ApiOperation
(
value
=
"获取编辑社群码统计数据"
,
httpMethod
=
"GET"
)
@ApiOperation
(
value
=
"获取编辑社群码统计数据"
,
httpMethod
=
"GET"
)
@RequestMapping
(
value
=
"getStatistic4Adviser"
,
method
=
RequestMethod
.
GET
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"token"
,
value
=
"token"
,
dataType
=
"String"
,
paramType
=
"header"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"token"
,
value
=
"token"
,
dataType
=
"String"
,
paramType
=
"header"
)
})
})
@GetMapping
(
"getStatistic4Adviser"
)
@GetMapping
(
"getStatistic4Adviser"
)
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/impl/BookGroupFacadeImpl.java
View file @
05feca4c
...
@@ -301,7 +301,7 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
...
@@ -301,7 +301,7 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
@RequestMapping
(
value
=
"isSpecialAgent"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"isSpecialAgent"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<
Boolean
>
isSpecialAgent
(
@RequestHeader
(
"token"
)
String
token
)
throws
BizException
,
PermissionException
{
public
ResponseDto
<
Boolean
>
isSpecialAgent
(
@RequestHeader
(
"token"
)
String
token
)
throws
BizException
,
PermissionException
{
Long
agentId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
TENANT_ID
);
Long
agentId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
TENANT_ID
);
return
new
ResponseDto
<
Boolean
>(
bookGroupBiz
.
isSpecialAgent
(
agentId
));
return
new
ResponseDto
<>(
bookGroupBiz
.
isSpecialAgent
(
agentId
));
}
}
@ApiOperation
(
"获取应用作品统计"
)
@ApiOperation
(
"获取应用作品统计"
)
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/set/GroupSet.java
View file @
05feca4c
...
@@ -27,7 +27,7 @@ public class GroupSet {
...
@@ -27,7 +27,7 @@ public class GroupSet {
* @param classifyId
* @param classifyId
*/
*/
public
void
sendGroupClassifyDeleteTopic
(
Long
classifyId
)
{
public
void
sendGroupClassifyDeleteTopic
(
Long
classifyId
)
{
LOGGER
.
info
(
"【社群书】发送群分类删除topic,<START>
"
);
LOGGER
.
info
(
"【社群书】发送群分类删除topic,<START>
classifyId:{}"
,
classifyId
);
GroupTopicDTO
groupTopicDTO
=
new
GroupTopicDTO
();
GroupTopicDTO
groupTopicDTO
=
new
GroupTopicDTO
();
groupTopicDTO
.
setClassifyId
(
classifyId
);
groupTopicDTO
.
setClassifyId
(
classifyId
);
try
{
try
{
...
@@ -35,7 +35,6 @@ public class GroupSet {
...
@@ -35,7 +35,6 @@ public class GroupSet {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"【社群书】发送群分类删除topic,<ERROR>"
,
e
);
LOGGER
.
error
(
"【社群书】发送群分类删除topic,<ERROR>"
,
e
);
}
}
LOGGER
.
info
(
"【社群书】发送群分类删除topic,<END>"
);
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/tools/SendWeixinRequestTools.java
View file @
05feca4c
...
@@ -411,7 +411,7 @@ public class SendWeixinRequestTools {
...
@@ -411,7 +411,7 @@ public class SendWeixinRequestTools {
// 1001745 包含图片和文字则不合并关键词详情,其他情况走之前的模式
// 1001745 包含图片和文字则不合并关键词详情,其他情况走之前的模式
if
(
CollectionUtils
.
isEmpty
(
collect
))
{
if
(
CollectionUtils
.
isEmpty
(
collect
))
{
isOld
=
false
;
isOld
=
false
;
sb
.
append
(
"\n\n本群配有以下资源服务,
戳
链接或回复相应关键词立即获取:\n"
);
sb
.
append
(
"\n\n本群配有以下资源服务,
点击
链接或回复相应关键词立即获取:\n"
);
for
(
KeywordDTO
keyword
:
keywords
)
{
for
(
KeywordDTO
keyword
:
keywords
)
{
if
(
sb
.
length
()
+
(
keyword
.
getKeywords
()
+
"\n"
).
length
()
>=
730
)
{
if
(
sb
.
length
()
+
(
keyword
.
getKeywords
()
+
"\n"
).
length
()
>=
730
)
{
break
;
break
;
...
@@ -419,7 +419,7 @@ public class SendWeixinRequestTools {
...
@@ -419,7 +419,7 @@ public class SendWeixinRequestTools {
sb
.
append
(
"关键词:"
).
append
(
keyword
.
getKeywords
()).
append
(
"\n"
);
sb
.
append
(
"关键词:"
).
append
(
keyword
.
getKeywords
()).
append
(
"\n"
);
if
(
ReplyTypeEnum
.
LINK
.
value
.
equals
(
keyword
.
getReplyType
())
||
ReplyTypeEnum
.
APP
.
value
.
equals
(
keyword
.
getReplyType
()))
{
if
(
ReplyTypeEnum
.
LINK
.
value
.
equals
(
keyword
.
getReplyType
())
||
ReplyTypeEnum
.
APP
.
value
.
equals
(
keyword
.
getReplyType
()))
{
String
linkUrl
=
SendWeixinRequestTools
.
splitUrlNew
(
accountSettingDto
,
keyword
.
getLinkUrl
(),
classifyQrcodeInfo
.
getBookGroupId
(),
classifyQrcodeInfo
.
getClassifyId
(),
classifyQrcodeInfo
.
getGroupQrcodeId
());
String
linkUrl
=
SendWeixinRequestTools
.
splitUrlNew
(
accountSettingDto
,
keyword
.
getLinkUrl
(),
classifyQrcodeInfo
.
getBookGroupId
(),
classifyQrcodeInfo
.
getClassifyId
(),
classifyQrcodeInfo
.
getGroupQrcodeId
());
sb
.
append
(
" "
).
append
(
keyword
.
getContent
()).
append
(
UrlUtils
.
getShortUrl4Own
(
linkUrl
)).
append
(
"\n\n"
);
sb
.
append
(
" "
).
append
(
keyword
.
getContent
()).
append
(
"\n->"
).
append
(
UrlUtils
.
getShortUrl4Own
(
linkUrl
)).
append
(
"\n\n"
);
}
}
}
}
}
else
{
}
else
{
...
@@ -442,7 +442,7 @@ public class SendWeixinRequestTools {
...
@@ -442,7 +442,7 @@ public class SendWeixinRequestTools {
String
feedbackUrl
=
"*common/C"
+
classifyQrcodeInfo
.
getChannelId
()
+
"/A0/feedback/suggest?groupQrcodeId="
+
classifyQrcodeInfo
.
getGroupQrcodeId
();
String
feedbackUrl
=
"*common/C"
+
classifyQrcodeInfo
.
getChannelId
()
+
"/A0/feedback/suggest?groupQrcodeId="
+
classifyQrcodeInfo
.
getGroupQrcodeId
();
String
url
=
splitUrl
(
accountSettingDto
,
feedbackUrl
);
String
url
=
splitUrl
(
accountSettingDto
,
feedbackUrl
);
LOGGER
.
info
(
"发送欢迎语反馈链接feedbackUrl:{}, url:{}"
,
feedbackUrl
,
url
);
LOGGER
.
info
(
"发送欢迎语反馈链接feedbackUrl:{}, url:{}"
,
feedbackUrl
,
url
);
groupKeyword
.
append
(
"
\n\n
群资源与书上介绍不符?点这里反馈\n->"
).
append
(
UrlUtils
.
getShortUrl4Own
(
url
));
groupKeyword
.
append
(
"群资源与书上介绍不符?点这里反馈\n->"
).
append
(
UrlUtils
.
getShortUrl4Own
(
url
));
return
groupKeyword
;
return
groupKeyword
;
}
}
...
@@ -461,7 +461,6 @@ public class SendWeixinRequestTools {
...
@@ -461,7 +461,6 @@ public class SendWeixinRequestTools {
}
}
if
(
isOld
)
{
if
(
isOld
)
{
// 旧流程直接输出关键词, 不用考虑换行问题
if
(
dto
.
getReportOpen
())
{
if
(
dto
.
getReportOpen
())
{
sb
.
append
(
"【学习报告】"
);
sb
.
append
(
"【学习报告】"
);
}
}
...
@@ -471,33 +470,24 @@ public class SendWeixinRequestTools {
...
@@ -471,33 +470,24 @@ public class SendWeixinRequestTools {
if
(
dto
.
getClockOpen
())
{
if
(
dto
.
getClockOpen
())
{
sb
.
append
(
"【"
).
append
(
dto
.
getClockKeyword
()).
append
(
"】"
);
sb
.
append
(
"【"
).
append
(
dto
.
getClockKeyword
()).
append
(
"】"
);
}
}
// 最后加入空白行
sb
.
append
(
"\n\n"
);
}
}
else
{
else
{
//新流程在每个关键词开头检查前面是否有关键词输出, 并决定是否需要添加空行
boolean
hasItem
=
false
;
if
(
dto
.
getReportOpen
())
{
if
(
dto
.
getReportOpen
())
{
sb
.
append
(
"关键词:学习报告\n回复学习报告,获取个人学习报告,与群成员PK元气值"
);
sb
.
append
(
"关键词:学习报告\n 回复学习报告,获取个人学习报告,与群成员PK元气值\n\n"
);
hasItem
=
true
;
}
}
if
(
dto
.
getRiddleOpen
())
{
if
(
dto
.
getRiddleOpen
())
{
addEmptyLineWhenHasItem
(
hasItem
,
sb
);
sb
.
append
(
"关键词:猜谜语\n 回复猜谜语,开启群游戏,连续答对5题,所有群成员可获得精美礼券\n\n"
);
sb
.
append
(
"关键词:猜谜语\n回复猜谜语,开启群游戏,连续答对5题,所有群成员可获得精美礼券"
);
hasItem
=
true
;
}
}
if
(
dto
.
getClockOpen
())
{
if
(
dto
.
getClockOpen
())
{
addEmptyLineWhenHasItem
(
hasItem
,
sb
);
sb
.
append
(
"关键词:"
).
append
(
dto
.
getClockKeyword
()).
append
(
"\n "
).
append
(
dto
.
getClockGuide
()).
append
(
"\n\n"
);
sb
.
append
(
"关键词:"
).
append
(
dto
.
getClockKeyword
()).
append
(
"\n"
).
append
(
dto
.
getClockGuide
());
}
}
}
}
return
sb
;
return
sb
;
}
}
private
static
void
addEmptyLineWhenHasItem
(
boolean
hasItem
,
StringBuilder
sb
)
{
if
(
hasItem
){
sb
.
append
(
"\n\n"
);
}
}
private
static
String
getNickNameStr
(
String
weixinGroupId
)
{
private
static
String
getNickNameStr
(
String
weixinGroupId
)
{
StringBuilder
nameStr
=
new
StringBuilder
();
StringBuilder
nameStr
=
new
StringBuilder
();
Map
<
String
,
Integer
>
nickNames
=
JedisClusterUtils
.
getJson
(
"BOOK:WEIXINGROUP:GUIDEUSER"
+
weixinGroupId
,
Map
.
class
);
Map
<
String
,
Integer
>
nickNames
=
JedisClusterUtils
.
getJson
(
"BOOK:WEIXINGROUP:GUIDEUSER"
+
weixinGroupId
,
Map
.
class
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/BookKeywordBizImpl.java
View file @
05feca4c
...
@@ -392,7 +392,7 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
...
@@ -392,7 +392,7 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
}
}
@Override
@Override
@ParamLog
(
"获取关键词列表"
)
@ParamLog
(
value
=
"获取关键词列表"
,
isAfterReturn
=
false
)
public
PageBeanNew
<
ListKeywordVO
>
listKeywordsByClassify
(
ListKeywordParam
listKeywordParam
)
{
public
PageBeanNew
<
ListKeywordVO
>
listKeywordsByClassify
(
ListKeywordParam
listKeywordParam
)
{
PageParam
pageParam
=
new
PageParam
(
listKeywordParam
.
getCurrentPage
(),
listKeywordParam
.
getNumPerPage
());
PageParam
pageParam
=
new
PageParam
(
listKeywordParam
.
getCurrentPage
(),
listKeywordParam
.
getNumPerPage
());
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
...
...
pcloud-service-book/src/main/java/com/pcloud/book/mq/topic/ConvertFileListener.java
View file @
05feca4c
...
@@ -50,7 +50,6 @@ public class ConvertFileListener {
...
@@ -50,7 +50,6 @@ public class ConvertFileListener {
@Override
@Override
public
void
run
()
{
public
void
run
()
{
while
(
true
)
{
while
(
true
)
{
LOGGER
.
info
(
"开始轮询cqds"
);
//如果cqds没有记录,休眠60秒
//如果cqds没有记录,休眠60秒
if
(
MapUtils
.
isEmpty
(
cqds
))
{
if
(
MapUtils
.
isEmpty
(
cqds
))
{
try
{
try
{
...
@@ -62,7 +61,7 @@ public class ConvertFileListener {
...
@@ -62,7 +61,7 @@ public class ConvertFileListener {
for
(
Map
.
Entry
<
String
,
ConvertQueueDto
>
e
:
cqds
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
ConvertQueueDto
>
e
:
cqds
.
entrySet
())
{
if
(
e
.
getValue
()
!=
null
)
{
if
(
e
.
getValue
()
!=
null
)
{
ConvertQueueDto
convertFileDto
=
e
.
getValue
();
ConvertQueueDto
convertFileDto
=
e
.
getValue
();
LOGGER
.
warn
(
"转码后信息>>>>>"
+
convertFileDto
.
toString
());
LOGGER
.
info
(
"转码后信息>>>>>"
+
convertFileDto
.
toString
());
String
fileCategory
=
FileUtils
.
getGatherName
(
convertFileDto
.
getFileType
());
String
fileCategory
=
FileUtils
.
getGatherName
(
convertFileDto
.
getFileType
());
String
fileId
=
convertFileDto
.
getFileId
();
String
fileId
=
convertFileDto
.
getFileId
();
String
fileUrl
=
convertFileDto
.
getFileUrl
();
String
fileUrl
=
convertFileDto
.
getFileUrl
();
...
...
pcloud-service-book/src/main/java/com/pcloud/book/mq/topic/PayMentListener.java
View file @
05feca4c
...
@@ -41,18 +41,15 @@ public class PayMentListener {
...
@@ -41,18 +41,15 @@ public class PayMentListener {
public
void
onMessage
(
OrderTopicDto
dto
)
throws
BizException
{
public
void
onMessage
(
OrderTopicDto
dto
)
throws
BizException
{
LOGGER
.
info
(
"【接收交易中心支付消息】[Message]={}"
,
dto
);
LOGGER
.
info
(
"【接收交易中心支付消息】[Message]={}"
,
dto
);
if
(
dto
==
null
||
dto
.
getOrderNum
()
==
null
)
{
if
(
dto
==
null
||
dto
.
getOrderNum
()
==
null
)
{
LOGGER
.
error
(
"【接收支付信息】订单为空,<ERROR>.[orderNum]={}"
,
dto
.
getOrderNum
());
throw
new
BookBizException
(
BookBizException
.
CONSUMER_TOPIC_ERROR
,
"订单为空"
);
throw
new
BookBizException
(
BookBizException
.
CONSUMER_TOPIC_ERROR
,
"订单为空"
);
}
}
// 判断是不是群分类作品,如果不是跳过不处理
// 判断是不是群分类作品,如果不是跳过不处理
List
<
OrderItemTopicDto
>
itemList
=
dto
.
getItemList
();
List
<
OrderItemTopicDto
>
itemList
=
dto
.
getItemList
();
if
(
CollectionUtils
.
isEmpty
(
itemList
))
{
if
(
CollectionUtils
.
isEmpty
(
itemList
))
{
LOGGER
.
info
(
"【接收支付信息】不是有效的作品订单消息,<ERROR>"
);
return
;
return
;
}
}
OrderItemTopicDto
orderItemTopicDto
=
itemList
.
get
(
0
);
OrderItemTopicDto
orderItemTopicDto
=
itemList
.
get
(
0
);
if
(!
ProductTypeConstant
.
BOOK_GROUP
.
equals
(
orderItemTopicDto
.
getProductTypeCode
()))
{
if
(!
ProductTypeConstant
.
BOOK_GROUP
.
equals
(
orderItemTopicDto
.
getProductTypeCode
()))
{
LOGGER
.
info
(
"【接收支付信息】不是有效的群分类作品订单消息,<ERROR>"
);
return
;
return
;
}
}
// BigDecimal actualPay = dto.getActualPay();
// BigDecimal actualPay = dto.getActualPay();
...
...
pcloud-service-book/src/main/java/com/pcloud/book/mq/topic/WXGroupLearningReportListener.java
View file @
05feca4c
...
@@ -108,7 +108,6 @@ public class WXGroupLearningReportListener {
...
@@ -108,7 +108,6 @@ public class WXGroupLearningReportListener {
sendTextMessageVO
.
setAltId
(
alt
);
sendTextMessageVO
.
setAltId
(
alt
);
sendTextMessageVO
.
setContent
(
"个人专属学习报告,及群成员元气排行榜。点击获取"
+
resultUrl
);
sendTextMessageVO
.
setContent
(
"个人专属学习报告,及群成员元气排行榜。点击获取"
+
resultUrl
);
sendTextMessageVO
.
setIp
(
findIp
(
wechatGroupId
));
sendTextMessageVO
.
setIp
(
findIp
(
wechatGroupId
));
LOGGER
.
info
(
"发送文字消息开始"
+
sendTextMessageVO
.
toString
());
WxGroupSDK
.
sendTextMessage
(
sendTextMessageVO
);
WxGroupSDK
.
sendTextMessage
(
sendTextMessageVO
);
LOGGER
.
info
(
"发送文字消息结束"
+
sendTextMessageVO
.
toString
());
LOGGER
.
info
(
"发送文字消息结束"
+
sendTextMessageVO
.
toString
());
if
(
ListUtils
.
isEmpty
(
learningScoreDTOS
))
{
if
(
ListUtils
.
isEmpty
(
learningScoreDTOS
))
{
...
@@ -120,9 +119,8 @@ public class WXGroupLearningReportListener {
...
@@ -120,9 +119,8 @@ public class WXGroupLearningReportListener {
sendPicMessageVO
.
setWxGroupId
(
wechatGroupId
);
sendPicMessageVO
.
setWxGroupId
(
wechatGroupId
);
sendPicMessageVO
.
setAltId
(
alt
);
sendPicMessageVO
.
setAltId
(
alt
);
sendPicMessageVO
.
setIp
(
findIp
(
wechatGroupId
));
sendPicMessageVO
.
setIp
(
findIp
(
wechatGroupId
));
LOGGER
.
info
(
"发送分享图消息开始"
+
sendPicMessageVO
.
toString
());
WxGroupSDK
.
sendPicMessage
(
sendPicMessageVO
);
WxGroupSDK
.
sendPicMessage
(
sendPicMessageVO
);
LOGGER
.
info
(
"发送分享图消息
开始
"
+
sendPicMessageVO
.
toString
());
LOGGER
.
info
(
"发送分享图消息
结束
"
+
sendPicMessageVO
.
toString
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"接收学习报告topic失败"
+
e
.
getMessage
(),
e
);
LOGGER
.
error
(
"接收学习报告topic失败"
+
e
.
getMessage
(),
e
);
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/mq/topic/WxGroupSendTextListener.java
View file @
05feca4c
package
com
.
pcloud
.
book
.
mq
.
topic
;
package
com
.
pcloud
.
book
.
mq
.
topic
;
import
com.pcloud.book.clock.biz.BookClockKeywordBiz
;
import
com.pcloud.book.clock.check.BookClockCheck
;
import
com.pcloud.book.clock.dto.BookClockInfoDTO
;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
import
com.pcloud.book.group.biz.BookGroupClassifyBiz
;
import
com.pcloud.book.group.biz.BookGroupClassifyBiz
;
import
com.pcloud.book.group.biz.GroupQrcodeBiz
;
import
com.pcloud.book.group.biz.GroupQrcodeBiz
;
...
@@ -12,22 +9,21 @@ import com.pcloud.book.mq.config.MQTopicConumer;
...
@@ -12,22 +9,21 @@ import com.pcloud.book.mq.config.MQTopicConumer;
import
com.pcloud.book.riddle.biz.RiddleRecordBiz
;
import
com.pcloud.book.riddle.biz.RiddleRecordBiz
;
import
com.pcloud.book.util.common.ThreadPoolUtils
;
import
com.pcloud.book.util.common.ThreadPoolUtils
;
import
com.pcloud.book.weixinclock.biz.WeixinClockBiz
;
import
com.pcloud.book.weixinclock.biz.WeixinClockBiz
;
import
com.pcloud.common.constant.CacheConstant
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.wechatgroup.message.dto.SendTextDTO
;
import
com.pcloud.wechatgroup.message.dto.SendTextDTO
;
import
com.sdk.wxgroup.SendMessageTypeEnum
;
import
com.sdk.wxgroup.SendMessageTypeEnum
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.amqp.rabbit.annotation.RabbitHandler
;
import
org.springframework.amqp.rabbit.annotation.RabbitHandler
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -75,7 +71,6 @@ public class WxGroupSendTextListener {
...
@@ -75,7 +71,6 @@ public class WxGroupSendTextListener {
}
else
{
}
else
{
final
long
l
=
System
.
currentTimeMillis
();
final
long
l
=
System
.
currentTimeMillis
();
bookKeywordBiz
.
sendKeywordMessage
(
sendTextDTO
);
bookKeywordBiz
.
sendKeywordMessage
(
sendTextDTO
);
log
.
info
(
"[接收用户发送文本消息] 总耗时:{}ms "
,
System
.
currentTimeMillis
()
-
l
);
}
}
//猜谜语
//猜谜语
riddleRecordBiz
.
riddleProcess
(
sendTextDTO
);
riddleRecordBiz
.
riddleProcess
(
sendTextDTO
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/push/biz/impl/PushBizImpl.java
View file @
05feca4c
...
@@ -325,7 +325,6 @@ public class PushBizImpl implements PushBiz {
...
@@ -325,7 +325,6 @@ public class PushBizImpl implements PushBiz {
//遍历发送消息
//遍历发送消息
for
(
PushItem
pushItem
:
pushItemList
)
{
for
(
PushItem
pushItem
:
pushItemList
)
{
try
{
try
{
LOGGER
.
info
(
"发送一个群里的一个消息开始pushGroup="
+
pushGroup
.
toString
()
+
"pushItem="
+
pushItem
.
toString
()
+
"altId="
+
altId
);
sendWechatMessage
(
pushGroup
,
pushItem
,
pushGroupRecord
.
getId
(),
altId
);
sendWechatMessage
(
pushGroup
,
pushItem
,
pushGroupRecord
.
getId
(),
altId
);
LOGGER
.
info
(
"发送一个群里的一个消息结束,休眠1秒pushGroup="
+
pushGroup
.
toString
()
+
"pushItem="
+
pushItem
.
toString
()
+
"altId="
+
altId
);
LOGGER
.
info
(
"发送一个群里的一个消息结束,休眠1秒pushGroup="
+
pushGroup
.
toString
()
+
"pushItem="
+
pushItem
.
toString
()
+
"altId="
+
altId
);
Thread
.
sleep
(
1000
);
Thread
.
sleep
(
1000
);
...
...
pcloud-service-book/src/main/resources/mapper/adnews/AdNewsMapper.xml
View file @
05feca4c
...
@@ -120,7 +120,7 @@
...
@@ -120,7 +120,7 @@
NOT EXISTS ( SELECT 1 FROM ad_news_ban e WHERE a.id = e.ad_news_id AND e.adviser_id = c.adviser_id )
NOT EXISTS ( SELECT 1 FROM ad_news_ban e WHERE a.id = e.ad_news_id AND e.adviser_id = c.adviser_id )
AND NOT EXISTS (SELECT 1 from ad_news_group_record f WHERE f.ad_news_id=a.id and f.ad_news_set_id=#{adNewsSetId})
AND NOT EXISTS (SELECT 1 from ad_news_group_record f WHERE f.ad_news_id=a.id and f.ad_news_set_id=#{adNewsSetId})
ORDER BY
ORDER BY
a.
id
DESC
a.
create_time
DESC
LIMIT #{top}
LIMIT #{top}
</select>
</select>
...
@@ -139,7 +139,55 @@
...
@@ -139,7 +139,55 @@
NOT EXISTS ( SELECT 1 FROM ad_news_ban e WHERE a.id = e.ad_news_id AND e.adviser_id = #{adviserId} )
NOT EXISTS ( SELECT 1 FROM ad_news_ban e WHERE a.id = e.ad_news_id AND e.adviser_id = #{adviserId} )
AND NOT EXISTS (SELECT 1 from ad_news_group_record f WHERE f.ad_news_id=a.id and f.ad_news_set_id=#{adNewsSetId})
AND NOT EXISTS (SELECT 1 from ad_news_group_record f WHERE f.ad_news_id=a.id and f.ad_news_set_id=#{adNewsSetId})
ORDER BY
ORDER BY
a.id DESC
a.create_time DESC
LIMIT #{top}
</select>
<!--查找要发送的新闻(新闻标题匹配标签)-->
<!--
1、ad_news_ban 排除掉禁止发送的
2、ad_news_group_record 排除掉已发送的
-->
<select
id=
"getNewsByLabelName"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
SELECT
a.id, a.type, a.news_from, a.title, a.publisher, a.url, a.short_url, a.news_date, a.create_time,0 content_from
FROM
ad_news a
INNER JOIN ad_news_wechat b ON a.news_from = b.news_from AND b.is_delete = 0
INNER JOIN ad_news_wechat_choose c ON c.ad_news_wechat_id = b.id AND c.is_delete = 0 AND c.adviser_id = #{adviserId}
WHERE
NOT EXISTS ( SELECT 1 FROM ad_news_ban e WHERE a.id = e.ad_news_id AND e.adviser_id = c.adviser_id )
AND NOT EXISTS (SELECT 1 from ad_news_group_record f WHERE f.ad_news_id=a.id and f.ad_news_set_id=#{adNewsSetId})
AND a.create_time >= #{beginTime}
AND (a.title LIKE CONCAT('%', #{proLabelName},'%')
OR a.title LIKE CONCAT('%', #{depLabelName},'%')
OR a.title LIKE CONCAT('%', #{purLabelName},'%'))
ORDER BY
a.create_time DESC
LIMIT #{top}
</select>
<!--查找要发送的新闻(公众号名称匹配标签)-->
<!--
1、ad_news_ban 排除掉禁止发送的
2、ad_news_group_record 排除掉已发送的
-->
<select
id=
"getNews4WechatByLabelName"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
SELECT
a.id, a.type, a.news_from, a.title, a.publisher, a.url, a.short_url, a.news_date, a.create_time,0 content_from
FROM
ad_news a
INNER JOIN ad_news_wechat b ON a.news_from = b.news_from AND b.is_delete = 0
INNER JOIN ad_news_wechat_choose c ON c.ad_news_wechat_id = b.id AND c.is_delete = 0 AND c.adviser_id = #{adviserId}
WHERE
NOT EXISTS ( SELECT 1 FROM ad_news_ban e WHERE a.id = e.ad_news_id AND e.adviser_id = c.adviser_id )
AND NOT EXISTS (SELECT 1 from ad_news_group_record f WHERE f.ad_news_id=a.id and f.ad_news_set_id=#{adNewsSetId})
AND a.create_time >= #{beginTime}
AND (b.wechat_name LIKE CONCAT('%', #{proLabelName},'%')
OR b.wechat_name LIKE CONCAT('%', #{depLabelName},'%')
OR b.wechat_name LIKE CONCAT('%', #{purLabelName},'%'))
ORDER BY
a.create_time DESC
LIMIT #{top}
LIMIT #{top}
</select>
</select>
...
@@ -180,10 +228,10 @@
...
@@ -180,10 +228,10 @@
AND a.title like concat('%', #{title},'%')
AND a.title like concat('%', #{title},'%')
</if>
</if>
<if
test=
"beginTime!=null"
>
<if
test=
"beginTime!=null"
>
AND a.
news_dat
e
<![CDATA[>=]]>
#{beginTime}
AND a.
create_tim
e
<![CDATA[>=]]>
#{beginTime}
</if>
</if>
<if
test=
"endTime!=null"
>
<if
test=
"endTime!=null"
>
AND a.
news_dat
e
<![CDATA[<=]]>
#{endTime}
AND a.
create_tim
e
<![CDATA[<=]]>
#{endTime}
</if>
</if>
<if
test=
"hasBan==0"
>
<if
test=
"hasBan==0"
>
AND NOT EXISTS (SELECT 1 FROM ad_news_ban WHERE ad_news_id=a.id and adviser_id=#{partyId} LIMIT 1)
AND NOT EXISTS (SELECT 1 FROM ad_news_ban WHERE ad_news_id=a.id and adviser_id=#{partyId} LIMIT 1)
...
@@ -197,6 +245,7 @@
...
@@ -197,6 +245,7 @@
<if
test=
"hasUsed==1"
>
<if
test=
"hasUsed==1"
>
AND EXISTS (SELECT 1 FROM ad_news_group_record WHERE ad_news_id=a.id and create_user=#{partyId} LIMIT 1)
AND EXISTS (SELECT 1 FROM ad_news_group_record WHERE ad_news_id=a.id and create_user=#{partyId} LIMIT 1)
</if>
</if>
ORDER BY a.create_time DESC,a.id DESC
</select>
</select>
<!--获取编辑选择的素材-->
<!--获取编辑选择的素材-->
...
...
pcloud-service-book/src/main/resources/mapper/adnews/AdNewsSetMapper.xml
View file @
05feca4c
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
<result
column=
"has_morning_open"
property=
"hasMorningOpen"
jdbcType=
"BOOLEAN"
/>
<result
column=
"has_morning_open"
property=
"hasMorningOpen"
jdbcType=
"BOOLEAN"
/>
<result
column=
"has_evening_open"
property=
"hasEveningOpen"
jdbcType=
"BOOLEAN"
/>
<result
column=
"has_evening_open"
property=
"hasEveningOpen"
jdbcType=
"BOOLEAN"
/>
<result
column=
"send_count"
property=
"sendCount"
jdbcType=
"INTEGER"
/>
<result
column=
"send_count"
property=
"sendCount"
jdbcType=
"INTEGER"
/>
<result
column=
"send_rule"
property=
"sendRule"
jdbcType=
"INTEGER"
/>
<result
column=
"start_content"
property=
"startContent"
jdbcType=
"VARCHAR"
/>
<result
column=
"start_content"
property=
"startContent"
jdbcType=
"VARCHAR"
/>
<result
column=
"end_content"
property=
"endContent"
jdbcType=
"VARCHAR"
/>
<result
column=
"end_content"
property=
"endContent"
jdbcType=
"VARCHAR"
/>
<result
column=
"has_start_content"
property=
"hasStartContent"
jdbcType=
"BOOLEAN"
/>
<result
column=
"has_start_content"
property=
"hasStartContent"
jdbcType=
"BOOLEAN"
/>
...
@@ -22,7 +23,7 @@
...
@@ -22,7 +23,7 @@
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, morning_time, evening_time, has_morning_open, has_evening_open, send_count, start_content,
id, morning_time, evening_time, has_morning_open, has_evening_open, send_count,
send_rule,
start_content,
end_content, has_start_content, has_end_content, create_user, create_time, update_user, update_time
end_content, has_start_content, has_end_content, create_user, create_time, update_user, update_time
,content_from,morning_content,evening_content
,content_from,morning_content,evening_content
</sql>
</sql>
...
@@ -42,6 +43,7 @@
...
@@ -42,6 +43,7 @@
has_morning_open,
has_morning_open,
has_evening_open,
has_evening_open,
send_count,
send_count,
send_rule,
start_content,
start_content,
end_content,
end_content,
has_start_content,
has_start_content,
...
@@ -60,6 +62,7 @@
...
@@ -60,6 +62,7 @@
#{hasMorningOpen,jdbcType=BOOLEAN},
#{hasMorningOpen,jdbcType=BOOLEAN},
#{hasEveningOpen,jdbcType=BOOLEAN},
#{hasEveningOpen,jdbcType=BOOLEAN},
#{sendCount,jdbcType=INTEGER},
#{sendCount,jdbcType=INTEGER},
#{sendRule,jdbcType=INTEGER},
#{startContent,jdbcType=VARCHAR},
#{startContent,jdbcType=VARCHAR},
#{endContent,jdbcType=VARCHAR},
#{endContent,jdbcType=VARCHAR},
#{hasStartContent,jdbcType=BOOLEAN},
#{hasStartContent,jdbcType=BOOLEAN},
...
@@ -92,6 +95,9 @@
...
@@ -92,6 +95,9 @@
<if
test=
"sendCount != null"
>
<if
test=
"sendCount != null"
>
send_count = #{sendCount,jdbcType=INTEGER},
send_count = #{sendCount,jdbcType=INTEGER},
</if>
</if>
<if
test=
"sendRule != null"
>
send_rule = #{sendRule,jdbcType=INTEGER},
</if>
<if
test=
"startContent != null"
>
<if
test=
"startContent != null"
>
start_content = #{startContent,jdbcType=VARCHAR},
start_content = #{startContent,jdbcType=VARCHAR},
</if>
</if>
...
...
pcloud-service-book/src/main/resources/mapper/advertising/AdvertisingDetailFileMapper.xml
View file @
05feca4c
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<result
column=
"file_convert_state"
property=
"fileConvertState"
jdbcType=
"INTEGER"
/>
<result
column=
"file_convert_state"
property=
"fileConvertState"
jdbcType=
"INTEGER"
/>
<result
column=
"file_size"
property=
"fileSize"
jdbcType=
"BIGINT"
/>
<result
column=
"file_size"
property=
"fileSize"
jdbcType=
"BIGINT"
/>
<result
column=
"file_name"
property=
"fileName"
jdbcType=
"VARCHAR"
/>
<result
column=
"file_name"
property=
"fileName"
jdbcType=
"VARCHAR"
/>
<result
column=
"file_duration"
property=
"fileDuration"
jdbcType=
"
BIGINT
"
/>
<result
column=
"file_duration"
property=
"fileDuration"
jdbcType=
"
DECIMAL
"
/>
<result
column=
"file_url"
property=
"fileUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"file_url"
property=
"fileUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"file_pilot_second"
property=
"filePilotSecond"
jdbcType=
"BIGINT"
/>
<result
column=
"file_pilot_second"
property=
"filePilotSecond"
jdbcType=
"BIGINT"
/>
<result
column=
"file_pilot_url"
property=
"filePilotUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"file_pilot_url"
property=
"filePilotUrl"
jdbcType=
"VARCHAR"
/>
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
(
(
#{item.adId,jdbcType=BIGINT}, #{item.fileId,jdbcType=VARCHAR},
#{item.adId,jdbcType=BIGINT}, #{item.fileId,jdbcType=VARCHAR},
#{item.fileConvertState,jdbcType=INTEGER}, #{item.fileSize,jdbcType=BIGINT}, #{item.fileName,jdbcType=VARCHAR},
#{item.fileConvertState,jdbcType=INTEGER}, #{item.fileSize,jdbcType=BIGINT}, #{item.fileName,jdbcType=VARCHAR},
#{item.fileDuration,jdbcType=
BIGINT
}, #{item.fileUrl,jdbcType=VARCHAR}, #{item.filePilotSecond,jdbcType=BIGINT},
#{item.fileDuration,jdbcType=
DECIMAL
}, #{item.fileUrl,jdbcType=VARCHAR}, #{item.filePilotSecond,jdbcType=BIGINT},
#{item.filePilotUrl,jdbcType=VARCHAR}, #{item.filePilotFinishTip,jdbcType=VARCHAR}, #{item.title,jdbcType=VARCHAR},
#{item.filePilotUrl,jdbcType=VARCHAR}, #{item.filePilotFinishTip,jdbcType=VARCHAR}, #{item.title,jdbcType=VARCHAR},
#{item.coverPic,jdbcType=VARCHAR}, NOW(), #{item.cpaId}
#{item.coverPic,jdbcType=VARCHAR}, NOW(), #{item.cpaId}
)
)
...
...
pcloud-service-book/src/main/resources/mapper/group/GroupQrcode.Mapper.xml
View file @
05feca4c
...
@@ -537,13 +537,18 @@
...
@@ -537,13 +537,18 @@
t.id qrcodeId,
t.id qrcodeId,
t.weixin_group_id weixinGroupId,
t.weixin_group_id weixinGroupId,
t1.id classifyId,
t1.id classifyId,
t1.book_group_id bookGroupId
t1.book_group_id bookGroupId,
t2.pro_label_id proLabelId,
t2.dep_label_id depLabelId,
t2.pur_label_id purLabelId
FROM
FROM
book_group_qrcode t
book_group_qrcode t
INNER JOIN book_group_classify t1 ON t.classify_id = t1.id
INNER JOIN book_group_classify t1 ON t.classify_id = t1.id
INNER JOIN book_group t2 ON t2.id = t1.book_group_id
WHERE
WHERE
t.is_delete = 0
t.is_delete = 0
AND t1.is_delete = 0
AND t1.is_delete = 0
AND t2.is_delete = 0
AND t1.id IN
AND t1.id IN
<foreach
collection =
"list"
index=
"index"
item =
"item"
open =
"("
separator=
","
close =
")"
>
<foreach
collection =
"list"
index=
"index"
item =
"item"
open =
"("
separator=
","
close =
")"
>
#{item}
#{item}
...
...
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