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
2e69890a
Commit
2e69890a
authored
Mar 16, 2021
by
郑勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug: [1028321] 未配置资源二维码弹框,翻页到最后一页无法翻页,getQrList接口500
parent
50855c42
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
19 deletions
+73
-19
BookAdviserBiz.java
...rc/main/java/com/pcloud/book/book/biz/BookAdviserBiz.java
+5
-0
BookAdviserBizImpl.java
...ava/com/pcloud/book/book/biz/impl/BookAdviserBizImpl.java
+24
-19
RightsSettingDAO.java
...a/com/pcloud/book/rightsSetting/dao/RightsSettingDAO.java
+3
-0
RightsSettingDAOImpl.java
...oud/book/rightsSetting/dao/impl/RightsSettingDAOImpl.java
+8
-0
BookRightsCountsDto.java
...om/pcloud/book/rightsSetting/dto/BookRightsCountsDto.java
+18
-0
RightsSettingMapper.xml
...in/resources/mapper/rightssetting/RightsSettingMapper.xml
+15
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/BookAdviserBiz.java
View file @
2e69890a
...
@@ -377,4 +377,9 @@ public interface BookAdviserBiz {
...
@@ -377,4 +377,9 @@ public interface BookAdviserBiz {
List
<
Long
>
getBooksByAgentToken
(
Long
agentId
,
int
index
);
List
<
Long
>
getBooksByAgentToken
(
Long
agentId
,
int
index
);
BookServeInfo
listBookServes4Book
(
String
cursor
,
Integer
limit
);
BookServeInfo
listBookServes4Book
(
String
cursor
,
Integer
limit
);
/**
* 小睿书下面的书刊权益数量
*/
Map
<
Long
,
Integer
>
rightsCountByBookIds
(
List
<
Long
>
bookIds
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookAdviserBizImpl.java
View file @
2e69890a
...
@@ -80,6 +80,7 @@ import com.pcloud.book.group.enums.JoinGroupTypeEnum;
...
@@ -80,6 +80,7 @@ import com.pcloud.book.group.enums.JoinGroupTypeEnum;
import
com.pcloud.book.rightsSetting.biz.RightsSettingBiz
;
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.BookRightsCountsDto
;
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.dto.RightsSettingQueryDTO
;
import
com.pcloud.book.rightsSetting.entity.RightsSetting
;
import
com.pcloud.book.rightsSetting.entity.RightsSetting
;
...
@@ -1251,21 +1252,14 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -1251,21 +1252,14 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
new
ArrayList
<>());
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
new
ArrayList
<>());
}
}
List
<
QrCodeVO
>
record
=
new
ArrayList
<>();
List
<
QrCodeVO
>
record
=
new
ArrayList
<>();
//type 代表的是过滤二维码。如果是0,展示所有的二维码。如果是1(展示没有资源的码。但是要过滤小睿教育的书的非公众号二维码)
if
(
null
!=
type
&&
1
==
type
)
{
qrCodeVOS
=
qrCodeVOS
.
stream
().
filter
(
a
->
(
null
==
a
.
getServeCount
()
||
0
==
a
.
getServeCount
())
&&
!(
null
!=
a
.
getXiaoRuiEducation
()
&&
a
.
getXiaoRuiEducation
()
&&
!
"wechat"
.
equalsIgnoreCase
(
a
.
getCodeType
()))).
collect
(
Collectors
.
toList
());
}
if
(
qrCodeVOS
.
size
()
>
(
currentPage
+
1
)
*
numPerPage
){
if
(
qrCodeVOS
.
size
()
>
(
currentPage
+
1
)
*
numPerPage
){
//type 代表的是过滤二维码。如果是0,展示所有的二维码。如果是1(展示没有资源的码。但是要过滤小睿教育的书的非公众号二维码)
record
=
qrCodeVOS
.
subList
(
currentPage
*
numPerPage
,(
currentPage
+
1
)
*
numPerPage
);
if
(
null
!=
type
&&
1
==
type
){
qrCodeVOS
=
qrCodeVOS
.
stream
().
filter
(
a
->
(
null
==
a
.
getServeCount
()
||
0
==
a
.
getServeCount
())
&&
!(
null
!=
a
.
getXiaoRuiEducation
()
&&
a
.
getXiaoRuiEducation
()
&&
!
"wechat"
.
equalsIgnoreCase
(
a
.
getCodeType
()))).
collect
(
Collectors
.
toList
());
record
=
qrCodeVOS
.
subList
(
currentPage
*
numPerPage
,(
currentPage
+
1
)
*
numPerPage
);
}
else
{
record
=
qrCodeVOS
.
subList
(
currentPage
*
numPerPage
,(
currentPage
+
1
)
*
numPerPage
);
}
}
else
{
}
else
{
if
(
null
!=
type
&&
1
==
type
){
record
=
qrCodeVOS
.
subList
(
currentPage
*
numPerPage
,
qrCodeVOS
.
size
());
qrCodeVOS
=
qrCodeVOS
.
stream
().
filter
(
a
->
(
null
==
a
.
getServeCount
()
||
0
==
a
.
getServeCount
())
&&
!(
null
!=
a
.
getXiaoRuiEducation
()
&&
a
.
getXiaoRuiEducation
()
&&
!
"wechat"
.
equalsIgnoreCase
(
a
.
getCodeType
()))).
collect
(
Collectors
.
toList
());
record
=
qrCodeVOS
.
subList
(
currentPage
*
numPerPage
,
qrCodeVOS
.
size
());
}
else
{
record
=
qrCodeVOS
.
subList
(
currentPage
*
numPerPage
,
qrCodeVOS
.
size
());
}
}
}
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
qrCodeVOS
.
size
(),
record
);
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
qrCodeVOS
.
size
(),
record
);
}
}
...
@@ -1307,13 +1301,13 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -1307,13 +1301,13 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
Future
<
Map
<
String
,
BookGroupServeCountDTO
>>
mapBookGroupServeCountSubmit
=
ThreadPoolUtils
.
OTHER_POOL
.
submit
(()
->
bookGroupBiz
.
mapBookGroupServeCount
(
adviserIds
,
bookIds
,
channelIds
));
Future
<
Map
<
String
,
BookGroupServeCountDTO
>>
mapBookGroupServeCountSubmit
=
ThreadPoolUtils
.
OTHER_POOL
.
submit
(()
->
bookGroupBiz
.
mapBookGroupServeCount
(
adviserIds
,
bookIds
,
channelIds
));
Future
<
Map
<
String
,
BookGroupServeCountDTO
>>
mapBookGroupQrcodeSubmit
=
ThreadPoolUtils
.
OTHER_POOL
.
submit
(()
->
bookGroupBiz
.
mapBookGroupQrcodeServeCount
(
adviserIds
,
bookIds
,
channelIds
,
JoinGroupTypeEnum
.
GROUP_QRCODE
.
getCode
()));
Future
<
Map
<
String
,
BookGroupServeCountDTO
>>
mapBookGroupQrcodeSubmit
=
ThreadPoolUtils
.
OTHER_POOL
.
submit
(()
->
bookGroupBiz
.
mapBookGroupQrcodeServeCount
(
adviserIds
,
bookIds
,
channelIds
,
JoinGroupTypeEnum
.
GROUP_QRCODE
.
getCode
()));
Future
<
Map
<
String
,
BookGroupServeCountDTO
>>
mapBookGroupRobotServeCountSubmit
=
ThreadPoolUtils
.
OTHER_POOL
.
submit
(()->
bookGroupBiz
.
mapBookGroupQrcodeServeCount
(
adviserIds
,
bookIds
,
channelIds
,
JoinGroupTypeEnum
.
ROBOT
.
getCode
()));
Future
<
Map
<
String
,
BookGroupServeCountDTO
>>
mapBookGroupRobotServeCountSubmit
=
ThreadPoolUtils
.
OTHER_POOL
.
submit
(()->
bookGroupBiz
.
mapBookGroupQrcodeServeCount
(
adviserIds
,
bookIds
,
channelIds
,
JoinGroupTypeEnum
.
ROBOT
.
getCode
()));
Future
<
Map
<
Long
,
RightsSettingDto
>>
rightsMapSubmit
=
ThreadPoolUtils
.
OTHER_POOL
.
submit
(()->
rightsSettingDAO
.
lis
tByBookIds
(
bookIds
));
Future
<
Map
<
Long
,
Integer
>>
rightsMapSubmit
=
ThreadPoolUtils
.
OTHER_POOL
.
submit
(()->
bookAdviserBiz
.
rightsCoun
tByBookIds
(
bookIds
));
Map
<
String
,
QrcodeMessageDTO
>
mapQrcodeMessage
=
new
HashMap
<>();
Map
<
String
,
QrcodeMessageDTO
>
mapQrcodeMessage
=
new
HashMap
<>();
Map
<
String
,
BookGroupServeCountDTO
>
mapWxworkServeCount
=
new
HashMap
<>();
Map
<
String
,
BookGroupServeCountDTO
>
mapWxworkServeCount
=
new
HashMap
<>();
Map
<
String
,
BookGroupServeCountDTO
>
mapBookGroupServeCount
=
new
HashMap
<>();
Map
<
String
,
BookGroupServeCountDTO
>
mapBookGroupServeCount
=
new
HashMap
<>();
Map
<
String
,
BookGroupServeCountDTO
>
mapBookGroupQrcodeServeCount
=
new
HashMap
<>();
Map
<
String
,
BookGroupServeCountDTO
>
mapBookGroupQrcodeServeCount
=
new
HashMap
<>();
Map
<
String
,
BookGroupServeCountDTO
>
mapBookGroupRobotServeCount
=
new
HashMap
<>();
Map
<
String
,
BookGroupServeCountDTO
>
mapBookGroupRobotServeCount
=
new
HashMap
<>();
Map
<
Long
,
RightsSettingDto
>
rightsMap
=
new
HashMap
<>();
Map
<
Long
,
Integer
>
rightsMap
=
new
HashMap
<>();
try
{
try
{
mapQrcodeMessage
=
mapQrcodeMessageSubmit
.
get
(
ThreadPoolUtils
.
REMOTE_TIME_OUT
,
TimeUnit
.
SECONDS
);
mapQrcodeMessage
=
mapQrcodeMessageSubmit
.
get
(
ThreadPoolUtils
.
REMOTE_TIME_OUT
,
TimeUnit
.
SECONDS
);
}
catch
(
InterruptedException
|
ExecutionException
|
TimeoutException
e
)
{
}
catch
(
InterruptedException
|
ExecutionException
|
TimeoutException
e
)
{
...
@@ -1370,10 +1364,8 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -1370,10 +1364,8 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
continue
;
continue
;
}
}
// 如果是小睿码,则显示权益数
// 如果是小睿码,则显示权益数
RightsSettingDto
rightsSettingDto
=
rightsMap
.
get
(
bookGroupServeCountDTO
.
getBookId
());
Integer
count
=
rightsMap
.
get
(
bookGroupServeCountDTO
.
getBookId
());
if
(
rightsSettingDto
!=
null
){
bookGroupServeCountDTO
.
setRightsCount
(
count
);
bookGroupServeCountDTO
.
setRightsCount
(
rightsSettingDto
.
getCount
());
}
}
}
}
}
...
@@ -2716,4 +2708,17 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -2716,4 +2708,17 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
}
}
return
list
;
return
list
;
}
}
/**
* 小睿书下面的书刊权益数量
*/
@Override
public
Map
<
Long
,
Integer
>
rightsCountByBookIds
(
List
<
Long
>
bookIds
)
{
if
(
CollUtil
.
isEmpty
(
bookIds
)){
return
new
HashMap
<>();
}
List
<
BookRightsCountsDto
>
bookRightsCountsDtos
=
rightsSettingDAO
.
rightsCountByBookIds
(
bookIds
);
Map
<
Long
,
Integer
>
result
=
CollUtil
.
isEmpty
(
bookRightsCountsDtos
)
?
new
HashMap
<>()
:
bookRightsCountsDtos
.
stream
().
collect
(
Collectors
.
toMap
(
a
->
a
.
getBookId
(),
a
->
a
.
getCount
(),
(
k1
,
k2
)
->
k2
));
return
result
;
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/RightsSettingDAO.java
View file @
2e69890a
package
com
.
pcloud
.
book
.
rightsSetting
.
dao
;
package
com
.
pcloud
.
book
.
rightsSetting
.
dao
;
import
com.pcloud.book.rightsSetting.dto.BookRightsCountsDto
;
import
com.pcloud.book.rightsSetting.dto.RightsSettingDto
;
import
com.pcloud.book.rightsSetting.dto.RightsSettingDto
;
import
com.pcloud.book.rightsSetting.dto.RightsSettingShowStateDTO
;
import
com.pcloud.book.rightsSetting.dto.RightsSettingShowStateDTO
;
import
com.pcloud.book.rightsSetting.entity.RightsSetting
;
import
com.pcloud.book.rightsSetting.entity.RightsSetting
;
...
@@ -34,6 +35,8 @@ public interface RightsSettingDAO extends BaseDao<RightsSetting> {
...
@@ -34,6 +35,8 @@ public interface RightsSettingDAO extends BaseDao<RightsSetting> {
Map
<
Long
,
RightsSettingDto
>
listByBookIds
(
List
<
Long
>
bookIds
);
Map
<
Long
,
RightsSettingDto
>
listByBookIds
(
List
<
Long
>
bookIds
);
List
<
BookRightsCountsDto
>
rightsCountByBookIds
(
List
<
Long
>
bookIds
);
void
updateUser
(
RightsSetting
rightsSetting
);
void
updateUser
(
RightsSetting
rightsSetting
);
RightsSettingDto
getDTOById
(
Long
id
);
RightsSettingDto
getDTOById
(
Long
id
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/impl/RightsSettingDAOImpl.java
View file @
2e69890a
package
com
.
pcloud
.
book
.
rightsSetting
.
dao
.
impl
;
package
com
.
pcloud
.
book
.
rightsSetting
.
dao
.
impl
;
import
com.pcloud.book.rightsSetting.dao.RightsSettingDAO
;
import
com.pcloud.book.rightsSetting.dao.RightsSettingDAO
;
import
com.pcloud.book.rightsSetting.dto.BookRightsCountsDto
;
import
com.pcloud.book.rightsSetting.dto.RightsSettingDto
;
import
com.pcloud.book.rightsSetting.dto.RightsSettingDto
;
import
com.pcloud.book.rightsSetting.dto.RightsSettingShowStateDTO
;
import
com.pcloud.book.rightsSetting.dto.RightsSettingShowStateDTO
;
import
com.pcloud.book.rightsSetting.entity.RightsSetting
;
import
com.pcloud.book.rightsSetting.entity.RightsSetting
;
...
@@ -97,4 +98,11 @@ public class RightsSettingDAOImpl extends BaseDaoImpl<RightsSetting> implement
...
@@ -97,4 +98,11 @@ public class RightsSettingDAOImpl extends BaseDaoImpl<RightsSetting> implement
public
RightsSettingDto
getDTOById
(
Long
id
)
{
public
RightsSettingDto
getDTOById
(
Long
id
)
{
return
super
.
getSqlSession
().
selectOne
(
getStatement
(
"getDTOById"
),
id
);
return
super
.
getSqlSession
().
selectOne
(
getStatement
(
"getDTOById"
),
id
);
}
}
@Override
public
List
<
BookRightsCountsDto
>
rightsCountByBookIds
(
List
<
Long
>
bookIds
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"bookIds"
,
bookIds
);
return
getSessionTemplate
().
selectList
(
getStatement
(
"rightsCountByBookIds"
),
paramMap
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dto/BookRightsCountsDto.java
0 → 100644
View file @
2e69890a
package
com
.
pcloud
.
book
.
rightsSetting
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* 书刊权益数量(只是书刊权益)
*/
@Data
public
class
BookRightsCountsDto
{
@ApiModelProperty
(
"书刊id"
)
private
Long
bookId
;
@ApiModelProperty
(
"书刊权益数量"
)
private
Integer
count
;
}
pcloud-service-book/src/main/resources/mapper/rightssetting/RightsSettingMapper.xml
View file @
2e69890a
...
@@ -431,4 +431,19 @@
...
@@ -431,4 +431,19 @@
id = #{id,jdbcType=BIGINT}
id = #{id,jdbcType=BIGINT}
</select>
</select>
<select
id=
"rightsCountByBookIds"
resultType=
"com.pcloud.book.rightsSetting.dto.BookRightsCountsDto"
>
SELECT
a.book_id bookId,
ifnull(count(1),0) count
FROM
rights_setting_book_relation a
INNER JOIN rights_now_item b ON a.rights_setting_id = b.rights_setting_id
WHERE
a.book_id IN
<foreach
collection=
"bookIds"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
GROUP BY a.book_id
</select>
</mapper>
</mapper>
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