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
2370360e
Commit
2370360e
authored
Mar 12, 2021
by
田超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/1004412-new' into 'master'
feat: [1004412] 加权益数量和销售额 See merge request rays/pcloud-book!1225
parents
079bba7c
a82ed6c7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
1 deletions
+93
-1
BookAdviserBizImpl.java
...ava/com/pcloud/book/book/biz/impl/BookAdviserBizImpl.java
+54
-1
QrCodeVO.java
...-book/src/main/java/com/pcloud/book/book/vo/QrCodeVO.java
+5
-0
TradeConsr.java
.../main/java/com/pcloud/book/consumer/trade/TradeConsr.java
+34
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookAdviserBizImpl.java
View file @
2370360e
...
@@ -81,6 +81,10 @@ import com.pcloud.book.rightsSetting.biz.RightsSettingBiz;
...
@@ -81,6 +81,10 @@ import com.pcloud.book.rightsSetting.biz.RightsSettingBiz;
import
com.pcloud.book.rightsSetting.constants.RightsSettingConstant
;
import
com.pcloud.book.rightsSetting.constants.RightsSettingConstant
;
import
com.pcloud.book.rightsSetting.dao.RightsSettingDAO
;
import
com.pcloud.book.rightsSetting.dao.RightsSettingDAO
;
import
com.pcloud.book.rightsSetting.dto.RightsSettingDto
;
import
com.pcloud.book.rightsSetting.dto.RightsSettingDto
;
import
com.pcloud.book.rightsSetting.dto.RightsSettingQueryDTO
;
import
com.pcloud.book.rightsSetting.entity.RightsSetting
;
import
com.pcloud.book.rightsSetting.entity.RightsSettingNow
;
import
com.pcloud.book.rightsSetting.entity.RightsSettingTitle
;
import
com.pcloud.book.util.common.ThreadPoolUtils
;
import
com.pcloud.book.util.common.ThreadPoolUtils
;
import
com.pcloud.channelcenter.base.exceptions.ChannelBizException
;
import
com.pcloud.channelcenter.base.exceptions.ChannelBizException
;
import
com.pcloud.channelcenter.qrcode.dto.AdviserQrcodeSceneDTO
;
import
com.pcloud.channelcenter.qrcode.dto.AdviserQrcodeSceneDTO
;
...
@@ -1091,7 +1095,8 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -1091,7 +1095,8 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"参数为空"
);
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"参数为空"
);
}
}
//type 代表的是过滤二维码。如果是0,展示所有的二维码。如果是1(展示没有资源的码。但是要过滤小睿教育的书的非公众号二维码)
//type 代表的是过滤二维码。如果是0,展示所有的二维码。如果是1(展示没有资源的码。但是要过滤小睿教育的书的非公众号二维码)
//获取rays码的权益书。一本书的权益书都一样
Integer
rightsettingCounts
=
getRightsettingCounts
(
bookId
,
adviserId
,
channelId
);
List
<
Long
>
xiaoRuiEducation
=
channelConsr
.
isXiaoRuiEducation
(
Lists
.
newArrayList
(
bookId
));
List
<
Long
>
xiaoRuiEducation
=
channelConsr
.
isXiaoRuiEducation
(
Lists
.
newArrayList
(
bookId
));
//BookAdviserDto bookAdviserDto = bookAdviserDao.getBase(bookId, channelId, adviserId);
//BookAdviserDto bookAdviserDto = bookAdviserDao.getBase(bookId, channelId, adviserId);
//现在一本书下面可以配多个跳小睿的码
//现在一本书下面可以配多个跳小睿的码
...
@@ -1109,6 +1114,11 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -1109,6 +1114,11 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
Map
<
Long
,
BookGroupServeCountDTO
>
robotMap
=
CollUtil
.
isEmpty
(
robotList
)
?
new
HashMap
<>()
:
bookGroupServeDao
.
mapGroupQrcodeServeCount
(
robotList
);
Map
<
Long
,
BookGroupServeCountDTO
>
robotMap
=
CollUtil
.
isEmpty
(
robotList
)
?
new
HashMap
<>()
:
bookGroupServeDao
.
mapGroupQrcodeServeCount
(
robotList
);
//(**不包括群二维码)小睿二维码下资源数量
//(**不包括群二维码)小睿二维码下资源数量
Map
<
Long
,
BookGroupServeCountDTO
>
xiaoruiMap
=
CollUtil
.
isEmpty
(
xiaoruiList
)
?
new
HashMap
<>()
:
bookGroupServeDao
.
mapXiaoRuiGroupQrcodeServeCount
(
xiaoruiList
);
Map
<
Long
,
BookGroupServeCountDTO
>
xiaoruiMap
=
CollUtil
.
isEmpty
(
xiaoruiList
)
?
new
HashMap
<>()
:
bookGroupServeDao
.
mapXiaoRuiGroupQrcodeServeCount
(
xiaoruiList
);
//计算码的销售额
List
<
Long
>
bookGroupIds
=
CollUtil
.
isEmpty
(
bookGroupDTOList
)
?
new
ArrayList
<>()
:
bookGroupDTOList
.
stream
().
filter
(
a
->
null
!=
a
.
getId
()).
map
(
a
->
a
.
getId
()).
distinct
().
collect
(
Collectors
.
toList
());
Map
<
Long
,
BigDecimal
>
groupListSaleInfoMap
=
tradeConsr
.
getGroupListSaleInfo
(
bookGroupIds
);
List
<
QrCodeVO
>
qrCodeVOS
=
new
ArrayList
<>();
List
<
QrCodeVO
>
qrCodeVOS
=
new
ArrayList
<>();
QrCodeVO
qrCodeVO
;
QrCodeVO
qrCodeVO
;
for
(
BookGroupDTO
bookGroupDTO
:
bookGroupDTOList
)
{
for
(
BookGroupDTO
bookGroupDTO
:
bookGroupDTOList
)
{
...
@@ -1119,6 +1129,8 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -1119,6 +1129,8 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
qrCodeVO
.
setRightsCount
(
0
);
qrCodeVO
.
setRightsCount
(
0
);
qrCodeVO
.
setSceneId
(
bookGroupDTO
.
getId
());
qrCodeVO
.
setSceneId
(
bookGroupDTO
.
getId
());
qrCodeVO
.
setJoinGroupType
(
bookGroupDTO
.
getJoinGroupType
());
qrCodeVO
.
setJoinGroupType
(
bookGroupDTO
.
getJoinGroupType
());
qrCodeVO
.
setRightsCount
(
0
);
qrCodeVO
.
setSaleMoney
(
new
BigDecimal
(
0
));
if
(
JoinGroupTypeEnum
.
GROUP_QRCODE
.
getCode
().
equals
(
bookGroupDTO
.
getJoinGroupType
())){
if
(
JoinGroupTypeEnum
.
GROUP_QRCODE
.
getCode
().
equals
(
bookGroupDTO
.
getJoinGroupType
())){
if
(
CollUtil
.
isNotEmpty
(
groupQrCodeMap
)
&&
groupQrCodeMap
.
containsKey
(
bookGroupDTO
.
getId
())){
if
(
CollUtil
.
isNotEmpty
(
groupQrCodeMap
)
&&
groupQrCodeMap
.
containsKey
(
bookGroupDTO
.
getId
())){
BookGroupServeCountDTO
bookGroupServeCountDTO
=
groupQrCodeMap
.
get
(
bookGroupDTO
.
getId
());
BookGroupServeCountDTO
bookGroupServeCountDTO
=
groupQrCodeMap
.
get
(
bookGroupDTO
.
getId
());
...
@@ -1138,6 +1150,14 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -1138,6 +1150,14 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
}
}
}
}
}
}
//小睿的码才有权益
if
(
JoinGroupTypeEnum
.
XIAORUI
.
getCode
().
equals
(
bookGroupDTO
.
getJoinGroupType
())){
qrCodeVO
.
setRightsCount
(
rightsettingCounts
);
}
//设置销售额
if
(
CollUtil
.
isNotEmpty
(
groupListSaleInfoMap
)
&&
groupListSaleInfoMap
.
containsKey
(
bookGroupDTO
.
getId
())){
qrCodeVO
.
setSaleMoney
(
groupListSaleInfoMap
.
get
(
bookGroupDTO
.
getId
()));
}
qrCodeVO
.
setCodeType
(
"group"
);
qrCodeVO
.
setCodeType
(
"group"
);
qrCodeVO
.
setXiaoRuiEducation
(
false
);
qrCodeVO
.
setXiaoRuiEducation
(
false
);
if
(
CollUtil
.
isNotEmpty
(
xiaoRuiEducation
)
&&
xiaoRuiEducation
.
contains
(
bookId
)){
if
(
CollUtil
.
isNotEmpty
(
xiaoRuiEducation
)
&&
xiaoRuiEducation
.
contains
(
bookId
)){
...
@@ -1198,6 +1218,8 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -1198,6 +1218,8 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
List
<
Long
>
sceneIds
=
qrcodeSceneDtos
.
stream
().
map
(
x
->
x
.
getSceneId
()).
collect
(
Collectors
.
toList
());
List
<
Long
>
sceneIds
=
qrcodeSceneDtos
.
stream
().
map
(
x
->
x
.
getSceneId
()).
collect
(
Collectors
.
toList
());
// 企业微信群资源数
// 企业微信群资源数
Map
<
Long
,
BookGroupServeCountDTO
>
bookQrcodeWxworkMap
=
bookQrcodeWxworkBiz
.
mapWxWorkServeCount4SceneIds
(
sceneIds
,
BookQrcodeType
.
OFFICIAL_ACCOUNTS
.
getCode
());
Map
<
Long
,
BookGroupServeCountDTO
>
bookQrcodeWxworkMap
=
bookQrcodeWxworkBiz
.
mapWxWorkServeCount4SceneIds
(
sceneIds
,
BookQrcodeType
.
OFFICIAL_ACCOUNTS
.
getCode
());
//计算码的销售额
Map
<
Long
,
BigDecimal
>
sceneListSaleInfoMap
=
tradeConsr
.
getSceneListSaleInfo
(
sceneIds
);
for
(
QrcodeSceneDto
e
:
qrcodeSceneDtos
)
{
for
(
QrcodeSceneDto
e
:
qrcodeSceneDtos
)
{
QrCodeVO
qrCodeVO1
=
new
QrCodeVO
();
QrCodeVO
qrCodeVO1
=
new
QrCodeVO
();
qrCodeVO1
.
setQrCodeName
(
e
.
getSceneName
());
qrCodeVO1
.
setQrCodeName
(
e
.
getSceneName
());
...
@@ -1211,6 +1233,10 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -1211,6 +1233,10 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
qrCodeVO1
.
setXiaoRuiEducation
(
true
);
qrCodeVO1
.
setXiaoRuiEducation
(
true
);
}
}
qrCodeVO1
.
setSceneId
(
e
.
getSceneId
());
qrCodeVO1
.
setSceneId
(
e
.
getSceneId
());
qrCodeVO1
.
setSaleMoney
(
new
BigDecimal
(
0
));
if
(
CollUtil
.
isNotEmpty
(
sceneListSaleInfoMap
)
&&
sceneListSaleInfoMap
.
containsKey
(
e
.
getSceneId
())){
qrCodeVO1
.
setSaleMoney
(
sceneListSaleInfoMap
.
get
(
e
.
getSceneId
()));
}
qrCodeVOS
.
add
(
qrCodeVO1
);
qrCodeVOS
.
add
(
qrCodeVO1
);
}
}
}
}
...
@@ -1237,6 +1263,33 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -1237,6 +1263,33 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
qrCodeVOS
.
size
(),
record
);
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
qrCodeVOS
.
size
(),
record
);
}
}
private
Integer
getRightsettingCounts
(
Long
bookId
,
Long
adviserId
,
Long
channelId
)
{
Long
rightsSettingId
=
bookGroupBiz
.
getRightsSettingId4Book
(
adviserId
,
channelId
,
bookId
);
int
i
=
0
;
if
(
null
!=
rightsSettingId
){
RightsSettingQueryDTO
rightsSettingQueryDTO
=
new
RightsSettingQueryDTO
();
rightsSettingQueryDTO
.
setAdviserId
(
adviserId
);
rightsSettingQueryDTO
.
setBookId
(
bookId
);
rightsSettingQueryDTO
.
setChannelId
(
channelId
);
rightsSettingQueryDTO
.
setRightsSettingTypes
(
Lists
.
newArrayList
(
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
));
rightsSettingQueryDTO
.
setRightsSettingId
(
rightsSettingId
);
RightsSetting
rightsSetting
=
rightsSettingBiz
.
getRightsSettingItemsByTypeListNew
(
rightsSettingQueryDTO
);
if
(
null
!=
rightsSetting
&&
null
!=
rightsSetting
.
getRightsSettingNow
()){
RightsSettingNow
rightsSettingNow
=
rightsSetting
.
getRightsSettingNow
();
if
(
CollUtil
.
isNotEmpty
(
rightsSettingNow
.
getRightsSettingTitles
())){
for
(
RightsSettingTitle
rightsSettingTitle
:
rightsSettingNow
.
getRightsSettingTitles
())
{
if
(
CollUtil
.
isEmpty
(
rightsSettingTitle
.
getRightsSettingItemList
())){
continue
;
}
i
+=
rightsSettingTitle
.
getRightsSettingItemList
().
size
();
}
}
}
}
return
i
;
}
@Override
@Override
public
Map
<
String
,
BookResourceStatisticsDTO
>
mapResourceTotalCount
(
List
<
Long
>
adviserIds
,
List
<
Long
>
bookIds
,
List
<
Long
>
channelIds
){
public
Map
<
String
,
BookResourceStatisticsDTO
>
mapResourceTotalCount
(
List
<
Long
>
adviserIds
,
List
<
Long
>
bookIds
,
List
<
Long
>
channelIds
){
Map
<
String
,
BookResourceStatisticsDTO
>
mapBookResourceStatistics
=
new
HashMap
<>();
Map
<
String
,
BookResourceStatisticsDTO
>
mapBookResourceStatistics
=
new
HashMap
<>();
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/vo/QrCodeVO.java
View file @
2370360e
package
com
.
pcloud
.
book
.
book
.
vo
;
package
com
.
pcloud
.
book
.
book
.
vo
;
import
java.math.BigDecimal
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -27,4 +29,7 @@ public class QrCodeVO {
...
@@ -27,4 +29,7 @@ public class QrCodeVO {
@ApiModelProperty
(
"公众号码id"
)
@ApiModelProperty
(
"公众号码id"
)
private
Long
sceneId
;
private
Long
sceneId
;
@ApiModelProperty
(
"销售额"
)
private
BigDecimal
saleMoney
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/consumer/trade/TradeConsr.java
View file @
2370360e
...
@@ -278,4 +278,38 @@ public class TradeConsr {
...
@@ -278,4 +278,38 @@ public class TradeConsr {
}
}
return
new
ArrayList
<>();
return
new
ArrayList
<>();
}
}
/**
* 获取rays码销售额
* @param bookGroupIds
* @return
*/
public
Map
<
Long
,
BigDecimal
>
getGroupListSaleInfo
(
List
<
Long
>
bookGroupIds
)
{
if
(
CollUtil
.
isEmpty
(
bookGroupIds
))
{
return
new
HashMap
<>();
}
try
{
return
ResponseHandleUtil
.
parseMap
(
orderFormService
.
getGroupListSaleInfo
(
bookGroupIds
),
Long
.
class
,
BigDecimal
.
class
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"查询rays码销售额失败.[getGroupListSaleInfo]:{}"
,
e
.
getMessage
(),
e
);
}
return
new
HashMap
<>();
}
/**
* 获取二维码销售额
* @param sceneIds
* @return
*/
public
Map
<
Long
,
BigDecimal
>
getSceneListSaleInfo
(
List
<
Long
>
sceneIds
)
{
if
(
CollUtil
.
isEmpty
(
sceneIds
))
{
return
new
HashMap
<>();
}
try
{
return
ResponseHandleUtil
.
parseMap
(
orderFormService
.
getSceneListSaleInfo
(
sceneIds
),
Long
.
class
,
BigDecimal
.
class
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"查询二维码销售额失败.[getSceneListSaleInfo]:{}"
,
e
.
getMessage
(),
e
);
}
return
new
HashMap
<>();
}
}
}
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