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
56a6d2ab
Commit
56a6d2ab
authored
Mar 29, 2022
by
zhangyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:[none] 新增编辑端知识商城社群书获取接口
parent
cb24b852
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
135 additions
and
0 deletions
+135
-0
BookGroupBiz.java
...src/main/java/com/pcloud/book/group/biz/BookGroupBiz.java
+9
-0
BookGroupBizImpl.java
...java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
+49
-0
BookGroupFacade.java
...in/java/com/pcloud/book/group/facade/BookGroupFacade.java
+9
-0
BookGroupFacadeImpl.java
...om/pcloud/book/group/facade/impl/BookGroupFacadeImpl.java
+7
-0
BookMapper.java
...in/java/com/pcloud/book/mapper/clickhouse/BookMapper.java
+4
-0
BookMapper.xml
...ce-book/src/main/resources/clickhouse/book/BookMapper.xml
+57
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/BookGroupBiz.java
View file @
56a6d2ab
...
@@ -1093,4 +1093,13 @@ public interface BookGroupBiz {
...
@@ -1093,4 +1093,13 @@ public interface BookGroupBiz {
*获取所有rays码
*获取所有rays码
*/
*/
PageBeanNew
<
BookGroupDTO
>
getAllRaysScene
(
Integer
currentPage
,
Integer
numPerPage
);
PageBeanNew
<
BookGroupDTO
>
getAllRaysScene
(
Integer
currentPage
,
Integer
numPerPage
);
/**
* 编辑端知识商城获取社群书列表
* @param adviserId
* @param param
* @return
*/
PageBeanNew
<
ListBook4ChannelVO
>
listBookGroup4AdviserKStore
(
Long
adviserId
,
ListBookGroup4ChannelParamVO
param
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
View file @
56a6d2ab
...
@@ -1410,6 +1410,54 @@ public class BookGroupBizImpl implements BookGroupBiz {
...
@@ -1410,6 +1410,54 @@ public class BookGroupBizImpl implements BookGroupBiz {
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
totalCount
,
recordList
);
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
totalCount
,
recordList
);
}
}
@Override
public
PageBeanNew
<
ListBook4ChannelVO
>
listBookGroup4AdviserKStore
(
Long
adviserId
,
ListBookGroup4ChannelParamVO
listBookGroup4ChannelParamVO
)
{
Integer
currentPage
=
listBookGroup4ChannelParamVO
.
getCurrentPage
();
Integer
numPerPage
=
listBookGroup4ChannelParamVO
.
getNumPerPage
();
if
(
currentPage
==
null
||
numPerPage
==
null
||
currentPage
<
0
||
numPerPage
<
0
)
{
throw
BookBizException
.
PAGE_PARAM_DELETION
;
}
PageParam
pageParam
=
new
PageParam
(
currentPage
,
numPerPage
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"adviserId"
,
adviserId
);
paramMap
.
put
(
"keywords"
,
listBookGroup4ChannelParamVO
.
getKeywords
());
paramMap
.
put
(
"isFundBook"
,
listBookGroup4ChannelParamVO
.
getIsFundBook
());
String
startTime
=
listBookGroup4ChannelParamVO
.
getStartTime
();
String
endTime
=
listBookGroup4ChannelParamVO
.
getEndTime
();
if
(
startTime
!=
null
)
{
paramMap
.
put
(
"startTime"
,
startTime
+
" 00:00:00"
);
}
if
(
endTime
!=
null
)
{
paramMap
.
put
(
"endTime"
,
endTime
+
" 23:59:59"
);
}
paramMap
.
put
(
"offset"
,
currentPage
*
numPerPage
);
paramMap
.
put
(
"limit"
,
numPerPage
);
Integer
totalCount
=
bookMapper
.
countBookGroup4AdviserKStore
(
paramMap
);
if
(
totalCount
<
1
)
{
return
new
PageBeanNew
(
currentPage
,
numPerPage
,
new
ArrayList
<>());
}
List
<
ListBook4ChannelVO
>
recordList
=
bookMapper
.
listBookGroup4AdviserKStore
(
paramMap
);
List
<
Long
>
bookGroupIds
=
recordList
.
stream
().
filter
(
x
->
ObjectUtil
.
isAllNotEmpty
(
x
,
x
.
getBookGroupId
())).
map
(
ListBook4ChannelVO:
:
getBookGroupId
).
distinct
().
collect
(
Collectors
.
toList
());
if
(
ListUtils
.
isEmpty
(
bookGroupIds
))
{
return
new
PageBeanNew
(
currentPage
,
numPerPage
,
new
ArrayList
<>());
}
Map
<
Long
,
BookGroupStatisticDTO
>
statisMap
=
bookGroupClassifyDao
.
getClassifyCountAbout
(
bookGroupIds
);
recordList
.
forEach
(
e
->
{
if
(!
MapUtils
.
isEmpty
(
statisMap
)
&&
statisMap
.
containsKey
(
e
.
getBookGroupId
()))
{
BookGroupStatisticDTO
dto
=
statisMap
.
get
(
e
.
getBookGroupId
());
e
.
setClassifyNum
(
null
!=
dto
.
getClassifyCount
()
?
dto
.
getClassifyCount
().
longValue
()
:
0L
);
e
.
setTotalNum
(
null
!=
dto
.
getUserNumber
()
?
dto
.
getUserNumber
().
longValue
()
:
0L
);
}
else
{
e
.
setClassifyNum
(
0L
);
e
.
setTotalNum
(
0L
);
}
});
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
totalCount
,
recordList
);
}
/**
/**
* 获取社群书列表(编辑)
* 获取社群书列表(编辑)
*/
*/
...
@@ -6911,6 +6959,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
...
@@ -6911,6 +6959,7 @@ public class BookGroupBizImpl implements BookGroupBiz {
return
bookGroupDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
new
HashMap
<>(),
"getAllRaysScene"
);
return
bookGroupDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
new
HashMap
<>(),
"getAllRaysScene"
);
}
}
@Override
@Override
public
List
<
BookGroupScanStatisticsRespDTO
>
getBookGroupScanStatistics
(
BookGroupScanStatisticsRequestDTO
reqDTO
)
{
public
List
<
BookGroupScanStatisticsRespDTO
>
getBookGroupScanStatistics
(
BookGroupScanStatisticsRequestDTO
reqDTO
)
{
if
(
ObjectUtil
.
hasEmpty
(
reqDTO
,
reqDTO
.
getBookIds
(),
reqDTO
.
getAdviserIds
(),
reqDTO
.
getChannelIds
(),
reqDTO
.
getStart
(),
reqDTO
.
getEnd
()))
if
(
ObjectUtil
.
hasEmpty
(
reqDTO
,
reqDTO
.
getBookIds
(),
reqDTO
.
getAdviserIds
(),
reqDTO
.
getChannelIds
(),
reqDTO
.
getStart
(),
reqDTO
.
getEnd
()))
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/BookGroupFacade.java
View file @
56a6d2ab
...
@@ -156,6 +156,15 @@ public interface BookGroupFacade {
...
@@ -156,6 +156,15 @@ public interface BookGroupFacade {
ResponseDto
<
PageBeanNew
<
ListBook4ChannelVO
>>
listBookGroup4Channel
(
@RequestHeader
(
"token"
)
String
token
,
ResponseDto
<
PageBeanNew
<
ListBook4ChannelVO
>>
listBookGroup4Channel
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
ListBookGroup4ChannelParamVO
listBookGroup4ChannelParamVO
)
@RequestBody
ListBookGroup4ChannelParamVO
listBookGroup4ChannelParamVO
)
throws
BizException
,
PermissionException
;
throws
BizException
,
PermissionException
;
@ApiOperation
(
value
=
"获取社群书列表(编辑端知识商城)"
,
httpMethod
=
"POST"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"token"
,
value
=
"token"
,
dataType
=
"string"
,
paramType
=
"header"
),
@ApiImplicitParam
(
name
=
"listBookGroup4ChannelParamVO"
,
value
=
"ListBookGroup4ChannelParamVO"
,
dataType
=
"ListBookGroup4ChannelParamVO"
,
paramType
=
"body"
)
})
@RequestMapping
(
value
=
"listBookGroup4AdviserKStore"
,
method
=
RequestMethod
.
POST
)
ResponseDto
<
PageBeanNew
<
ListBook4ChannelVO
>>
listBookGroup4AdviserKStore
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
ListBookGroup4ChannelParamVO
listBookGroup4ChannelParamVO
)
throws
BizException
,
PermissionException
;
@ApiOperation
(
value
=
"获取用户购买或者参与过的社群书信息"
,
httpMethod
=
"GET"
)
@ApiOperation
(
value
=
"获取用户购买或者参与过的社群书信息"
,
httpMethod
=
"GET"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/facade/impl/BookGroupFacadeImpl.java
View file @
56a6d2ab
...
@@ -306,6 +306,13 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
...
@@ -306,6 +306,13 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
}
}
@Override
@Override
public
ResponseDto
<
PageBeanNew
<
ListBook4ChannelVO
>>
listBookGroup4AdviserKStore
(
String
token
,
ListBookGroup4ChannelParamVO
listBookGroup4ChannelParamVO
)
throws
BizException
,
PermissionException
{
Long
adviserId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
PageBeanNew
<
ListBook4ChannelVO
>
pageBean
=
bookGroupBiz
.
listBookGroup4AdviserKStore
(
adviserId
,
listBookGroup4ChannelParamVO
);
return
new
ResponseDto
<>(
pageBean
);
}
@Override
@RequestMapping
(
value
=
"getUserBrowseGroup4KnowLedgeMall"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"getUserBrowseGroup4KnowLedgeMall"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
getUserBrowseGroup4KnowLedgeMall
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
public
ResponseDto
<?>
getUserBrowseGroup4KnowLedgeMall
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestParam
(
value
=
"currentPage"
,
required
=
false
)
Integer
currentPage
,
@RequestParam
(
value
=
"currentPage"
,
required
=
false
)
Integer
currentPage
,
...
...
pcloud-service-book/src/main/java/com/pcloud/book/mapper/clickhouse/BookMapper.java
View file @
56a6d2ab
...
@@ -19,4 +19,8 @@ public interface BookMapper {
...
@@ -19,4 +19,8 @@ public interface BookMapper {
List
<
BookScanCountDto
>
getBookScanCounts
(
@Param
(
"list"
)
List
<
Long
>
bookIds
);
List
<
BookScanCountDto
>
getBookScanCounts
(
@Param
(
"list"
)
List
<
Long
>
bookIds
);
Integer
countBookGroup4AdviserKStore
(
Map
<
String
,
Object
>
paramMap
);
List
<
ListBook4ChannelVO
>
listBookGroup4AdviserKStore
(
Map
<
String
,
Object
>
params
);
}
}
pcloud-service-book/src/main/resources/clickhouse/book/BookMapper.xml
View file @
56a6d2ab
...
@@ -73,5 +73,62 @@
...
@@ -73,5 +73,62 @@
WHERE b.ISBN like concat('%',#{keywords},'%') OR b.BOOK_NAME like concat('%',#{keywords},'%') OR bg.group_qrcode_name like concat('%',#{keywords},'%')
WHERE b.ISBN like concat('%',#{keywords},'%') OR b.BOOK_NAME like concat('%',#{keywords},'%') OR bg.group_qrcode_name like concat('%',#{keywords},'%')
</if>
</if>
</select>
</select>
<select
id=
"countBookGroup4AdviserKStore"
resultType=
"java.lang.Integer"
>
SELECT uniqExact(b.BOOK_ID)
FROM (SELECT BOOK_ID, COVER_IMG, ISBN, BOOK_NAME
FROM book
WHERE IS_DELETE = 0
AND BOOK_NAME NOT LIKE concat('%', '红榜', '%')
AND BOOK_ID IN (SELECT toInt64(BOOK_ID) FROM book_adviser WHERE IS_PRINT = 1)
AND CHAR_LENGTH(BOOK_NAME) >= 8
) b
JOIN ( SELECT id, book_id, create_time, group_qrcode_name
FROM book_group
WHERE id IN (SELECT toInt64(book_group_id) FROM book_group_classify WHERE is_delete = 0)
AND is_delete = 0
<if
test=
"adviserId != null"
>
AND create_user = ${adviserId}
</if>
<if
test=
"startTime != null "
>
AND create_time
>
= #{startTime}
</if>
<if
test=
"endTime != null "
>
AND create_time
<
= #{endTime}
</if>
<if
test=
"isFundBook != null and isFundBook == 1"
>
AND book_id IN (SELECT BOOK_ID FROM book_fund WHERE END_TIME
<
now() AND START_TIME > now())
</if>
) bg ON b.BOOK_ID = bg.book_id
<if
test=
"keywords != null"
>
WHERE b.ISBN like concat('%',#{keywords},'%') OR b.BOOK_NAME like concat('%',#{keywords},'%') OR bg.group_qrcode_name like concat('%',#{keywords},'%')
</if>
</select>
<select
id=
"listBookGroup4AdviserKStore"
resultType=
"com.pcloud.book.group.vo.ListBook4ChannelVO"
parameterType=
"map"
>
SELECT b.BOOK_ID bookId,
any(b.COVER_IMG) coverImg,
any(bg.id) bookGroupId,
any(b.ISBN) isbn,
any(b.BOOK_NAME) bookName,
any(concat('BK', toString(b.BOOK_ID))) bookNumber
FROM (SELECT BOOK_ID, COVER_IMG, ISBN, BOOK_NAME
FROM book
WHERE IS_DELETE = 0
AND BOOK_NAME NOT LIKE concat('%', '红榜', '%')
AND BOOK_ID IN (SELECT toInt64(BOOK_ID) FROM book_adviser WHERE IS_PRINT = 1)
AND CHAR_LENGTH(BOOK_NAME) >= 8
) b
JOIN ( SELECT id, book_id, create_time, group_qrcode_name
FROM book_group
WHERE id IN (SELECT toInt64(book_group_id) FROM book_group_classify WHERE is_delete = 0)
AND is_delete = 0
<if
test=
"adviserId != null"
>
AND create_user = ${adviserId}
</if>
<if
test=
"startTime != null "
>
AND create_time
>
= #{startTime}
</if>
<if
test=
"endTime != null "
>
AND create_time
<
= #{endTime}
</if>
<if
test=
"isFundBook != null and isFundBook == 1"
>
AND book_id IN (SELECT BOOK_ID FROM book_fund WHERE END_TIME
<
now() AND START_TIME > now())
</if>
) bg ON b.BOOK_ID = bg.book_id
<if
test=
"keywords != null"
>
WHERE b.ISBN like concat('%',#{keywords},'%') OR b.BOOK_NAME like concat('%',#{keywords},'%') OR bg.group_qrcode_name like concat('%',#{keywords},'%')
</if>
GROUP BY b.BOOK_ID
ORDER BY b.BOOK_ID DESC
LIMIT ${offset}, ${limit}
</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