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
68a4c438
Commit
68a4c438
authored
May 28, 2021
by
吴博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: [1004746] 小程序改版
parent
e73bd2e4
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
497 additions
and
18 deletions
+497
-18
BaseTempletClassifyDTO.java
...va/com/pcloud/book/applet/dto/BaseTempletClassifyDTO.java
+25
-0
AppletRecordTypeEnum.java
...va/com/pcloud/book/applet/enums/AppletRecordTypeEnum.java
+3
-1
AppletService.java
...in/java/com/pcloud/book/applet/service/AppletService.java
+10
-0
AppletNotifySendDTO.java
...com/pcloud/book/cultivate/entity/AppletNotifySendDTO.java
+27
-0
NotifyMessageType.java
...va/com/pcloud/book/cultivate/enums/NotifyMessageType.java
+32
-0
NotifySendTypeEnum.java
...a/com/pcloud/book/cultivate/enums/NotifySendTypeEnum.java
+37
-0
CultivateNotifyService.java
...pcloud/book/cultivate/service/CultivateNotifyService.java
+9
-0
AppletRecordServeBiz.java
...java/com/pcloud/book/applet/biz/AppletRecordServeBiz.java
+10
-0
AppletUserBookcaseBiz.java
...ava/com/pcloud/book/applet/biz/AppletUserBookcaseBiz.java
+5
-0
AppletRecordServeBizImpl.java
...pcloud/book/applet/biz/impl/AppletRecordServeBizImpl.java
+11
-0
AppletUserBookcaseBizImpl.java
...cloud/book/applet/biz/impl/AppletUserBookcaseBizImpl.java
+19
-0
AppletRecordServeDao.java
...java/com/pcloud/book/applet/dao/AppletRecordServeDao.java
+3
-0
AppletUserBookcaseDao.java
...ava/com/pcloud/book/applet/dao/AppletUserBookcaseDao.java
+5
-0
AppletRecordServeDaoImpl.java
...pcloud/book/applet/dao/impl/AppletRecordServeDaoImpl.java
+9
-0
AppletUserBookcaseDaoImpl.java
...cloud/book/applet/dao/impl/AppletUserBookcaseDaoImpl.java
+11
-0
AppletRecordServeFacade.java
...om/pcloud/book/applet/facade/AppletRecordServeFacade.java
+16
-0
AppletServiceImpl.java
...om/pcloud/book/applet/service/impl/AppletServiceImpl.java
+17
-0
BookLabelBiz.java
.../src/main/java/com/pcloud/book/book/biz/BookLabelBiz.java
+7
-0
BookLabelBizImpl.java
.../java/com/pcloud/book/book/biz/impl/BookLabelBizImpl.java
+21
-2
BookLabelDao.java
.../src/main/java/com/pcloud/book/book/dao/BookLabelDao.java
+2
-1
BookLabelDaoImpl.java
.../java/com/pcloud/book/book/dao/impl/BookLabelDaoImpl.java
+5
-2
BookLabelFacadeImpl.java
...com/pcloud/book/book/facade/impl/BookLabelFacadeImpl.java
+10
-0
ReaderConsr.java
...ain/java/com/pcloud/book/consumer/reader/ReaderConsr.java
+17
-0
CultivateNotifyBiz.java
...ava/com/pcloud/book/cultivate/biz/CultivateNotifyBiz.java
+7
-0
CultivateNotifyBizImpl.java
...cloud/book/cultivate/biz/impl/CultivateNotifyBizImpl.java
+81
-9
CultivateNotifyItem.java
...com/pcloud/book/cultivate/entity/CultivateNotifyItem.java
+5
-1
CultivateNotifyFacade.java
...m/pcloud/book/cultivate/facade/CultivateNotifyFacade.java
+12
-0
CultivateNotifyServiceImpl.java
...ok/cultivate/service/impl/CultivateNotifyServiceImpl.java
+20
-0
AppletRecordServe.Mapper.xml
...main/resources/mapper/applet/AppletRecordServe.Mapper.xml
+17
-0
AppletUserBookcase.xml
...k/src/main/resources/mapper/applet/AppletUserBookcase.xml
+36
-0
BookLabel.Mapper.xml
...-book/src/main/resources/mapper/book/BookLabel.Mapper.xml
+5
-1
CultivateNotifySend.xml
...c/main/resources/mapper/cultivate/CultivateNotifySend.xml
+3
-1
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/applet/dto/BaseTempletClassifyDTO.java
0 → 100644
View file @
68a4c438
package
com
.
pcloud
.
book
.
applet
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
BaseTempletClassifyDTO
{
@ApiModelProperty
(
"第一级类型标识"
)
private
Long
firstClassify
;
@ApiModelProperty
(
"第二级类型标识"
)
private
Long
secondClassify
;
@ApiModelProperty
(
"第三级类型标识"
)
private
Long
thirdClassify
;
@ApiModelProperty
(
"年级标签id"
)
private
Long
gradeLabelId
;
@ApiModelProperty
(
"科目标签id"
)
private
Long
subjectLabelId
;
@ApiModelProperty
(
"上下册标签id"
)
private
Long
volLabelId
;
@ApiModelProperty
(
"版本标签"
)
private
Long
verLabelId
;
@ApiModelProperty
(
"agentId"
)
private
Long
agentId
;
}
pcloud-facade-book/src/main/java/com/pcloud/book/applet/enums/AppletRecordTypeEnum.java
View file @
68a4c438
...
...
@@ -24,7 +24,9 @@ public enum AppletRecordTypeEnum {
WX_WORK_TEACHER
(
10
,
"微信客服"
),
//第三方资源
THIRD_RESOURCE
(
11
,
"第三方资源"
);
THIRD_RESOURCE
(
11
,
"第三方资源"
),
RAISE_QUESTION
(
20
,
"小睿互助问题"
);
public
Integer
value
;
...
...
pcloud-facade-book/src/main/java/com/pcloud/book/applet/service/AppletService.java
View file @
68a4c438
...
...
@@ -7,15 +7,18 @@ import com.pcloud.book.applet.dto.AppletNewsVO;
import
com.pcloud.book.applet.dto.AppletOuterBookDTO
;
import
com.pcloud.book.applet.dto.AppletOuterBooklistDTO
;
import
com.pcloud.book.applet.dto.AppletThirdResourcesDTO
;
import
com.pcloud.book.applet.dto.BaseTempletClassifyDTO
;
import
com.pcloud.book.applet.dto.PcloudGroupActivityDTO
;
import
com.pcloud.book.applet.dto.ServeCollectDTO
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
org.springframework.cloud.netflix.feign.FeignClient
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
io.swagger.annotations.Api
;
...
...
@@ -134,4 +137,11 @@ public interface AppletService {
@GetMapping
(
"getThirdResourceById"
)
ResponseEntity
<
ResponseDto
<
AppletThirdResourcesDTO
>>
getThirdResourceById
(
@RequestParam
(
"thirdResourcesId"
)
Long
thirdResourcesId
);
@RequestMapping
(
"getLastReadBookInfo"
)
ResponseEntity
<
ResponseDto
<
BaseTempletClassifyDTO
>>
getLastReadBookInfo
(
@RequestBody
List
<
Long
>
wechatUserIds
);
@RequestMapping
(
"getSameClassifyUserIds"
)
ResponseEntity
<
ResponseDto
<
List
<
Long
>>>
getSameClassifyUserIds
(
@RequestBody
List
<
Long
>
wechatUserIds
);
}
pcloud-facade-book/src/main/java/com/pcloud/book/cultivate/entity/AppletNotifySendDTO.java
0 → 100644
View file @
68a4c438
package
com
.
pcloud
.
book
.
cultivate
.
entity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Builder
;
import
lombok.Data
;
import
java.util.Date
;
@Data
@Builder
public
class
AppletNotifySendDTO
{
@ApiModelProperty
(
"用户微信id"
)
private
Long
wechatUserId
;
@ApiModelProperty
(
"发送类型(1-指定用户,2-分类用户,3-按书籍查询,4-全局公告消息)"
)
private
Integer
sendType
;
@ApiModelProperty
(
"消息类型(1-系统消息,2-通知消息,3-提醒消息,4-活动消息)"
)
private
Integer
messageType
;
@ApiModelProperty
(
"标题"
)
private
String
title
;
@ApiModelProperty
(
"问题id"
)
private
Long
fromId
;
}
pcloud-facade-book/src/main/java/com/pcloud/book/cultivate/enums/NotifyMessageType.java
0 → 100644
View file @
68a4c438
package
com
.
pcloud
.
book
.
cultivate
.
enums
;
public
enum
NotifyMessageType
{
//消息类型(1-系统消息,2-通知消息,3-提醒消息,4-活动消息
SYSTEM
(
1
,
"系统消息"
),
NOTICE
(
2
,
"通知消息"
),
REMEMBER
(
3
,
"提醒消息"
),
ACTIVITY
(
4
,
"活动消息"
),
MORE
(
5
,
"更多消息"
);
public
Integer
code
;
public
String
desc
;
NotifyMessageType
(
Integer
code
,
String
desc
)
{
this
.
code
=
code
;
this
.
desc
=
desc
;
}
public
static
NotifyMessageType
geTypeByCode
(
Integer
code
)
{
if
(
null
==
code
)
{
return
null
;
}
for
(
NotifyMessageType
result
:
NotifyMessageType
.
values
())
{
if
(
result
.
code
.
equals
(
code
))
{
return
result
;
}
}
return
null
;
}
}
pcloud-facade-book/src/main/java/com/pcloud/book/cultivate/enums/NotifySendTypeEnum.java
0 → 100644
View file @
68a4c438
package
com
.
pcloud
.
book
.
cultivate
.
enums
;
public
enum
NotifySendTypeEnum
{
/**
* 指定用户
*/
APPOINT_USER
(
1
),
/**
* 分类用户
*/
CLASSIFY_USER
(
2
),
/**
* 书籍查询
*/
BOOK_USER
(
3
),
/**
* 全局公告消息
*/
ALL_USER
(
4
),
/**
*用户画像
*/
USER_PROFILE
(
5
),
/**
* 提出问题
*/
RAISE_QUESTIOIN
(
6
);
public
final
Integer
value
;
NotifySendTypeEnum
(
Integer
value
)
{
this
.
value
=
value
;
}
}
pcloud-facade-book/src/main/java/com/pcloud/book/cultivate/service/CultivateNotifyService.java
View file @
68a4c438
...
...
@@ -3,6 +3,7 @@ package com.pcloud.book.cultivate.service;
import
com.pcloud.book.copyright.dto.BookAuthInfoCountDTO
;
import
com.pcloud.book.copyright.dto.BookAuthTotalCountDTO
;
import
com.pcloud.book.copyright.dto.CheckUserAuthDTO
;
import
com.pcloud.book.cultivate.entity.AppletNotifySendDTO
;
import
com.pcloud.book.cultivate.entity.CultivateNotifySend
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.exceptions.BizException
;
...
...
@@ -33,4 +34,12 @@ public interface CultivateNotifyService {
void
batchSendMiniUser
(
@RequestBody
List
<
CultivateNotifySend
>
list
)
throws
BizException
;
@ApiOperation
(
value
=
"小睿互助发送站内信消息"
,
httpMethod
=
"POST"
)
@RequestMapping
(
value
=
"sendAppletUserNotify"
,
method
=
RequestMethod
.
POST
)
void
sendAppletUserNotify
(
@RequestBody
List
<
CultivateNotifySend
>
list
)
throws
BizException
;
@ApiOperation
(
value
=
"小睿互助创建站内信消息"
,
httpMethod
=
"POST"
)
@RequestMapping
(
value
=
"createNotify4Question"
,
method
=
RequestMethod
.
POST
)
ResponseEntity
<
ResponseDto
<
Long
>>
createNotify4Question
(
@RequestBody
AppletNotifySendDTO
newSendDTO
)
throws
BizException
;
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/AppletRecordServeBiz.java
View file @
68a4c438
...
...
@@ -3,6 +3,8 @@ package com.pcloud.book.applet.biz;
import
com.pcloud.book.applet.entity.AppletRecordServe
;
import
com.pcloud.common.page.PageBeanNew
;
import
java.util.List
;
/**
* (AppletRecordServe)表服务接口
*
...
...
@@ -47,4 +49,11 @@ public interface AppletRecordServeBiz {
*/
void
deleteById
(
Long
id
);
/**
* 根据类型获取用户足迹列表
* @param wechatUserId
* @param recordType
* @return
*/
List
<
AppletRecordServe
>
getUserRecordListByType
(
Long
wechatUserId
,
Integer
recordType
);
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/AppletUserBookcaseBiz.java
View file @
68a4c438
...
...
@@ -2,6 +2,7 @@ package com.pcloud.book.applet.biz;
import
com.pcloud.book.applet.dto.AppletTaskDTO
;
import
com.pcloud.book.applet.dto.AppletUserBookcaseDTO
;
import
com.pcloud.book.applet.dto.BaseTempletClassifyDTO
;
import
com.pcloud.book.applet.dto.UserLastBookReDTO
;
import
com.pcloud.book.applet.entity.AppletUserBookcase
;
import
com.pcloud.book.applet.entity.AppletUserClickRecord
;
...
...
@@ -99,4 +100,8 @@ public interface AppletUserBookcaseBiz {
AppletUserBookcaseDTO
getUserBookInfoByWechatUserId
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
Long
rightsSettingId
);
String
getResources4Books
(
MultipartHttpServletRequest
request
);
BaseTempletClassifyDTO
getLastReadBookInfo
(
List
<
Long
>
wechatUserIds
);
List
<
Long
>
getSameClassifyUserIds
(
List
<
Long
>
wechatUserIds
);
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/impl/AppletRecordServeBizImpl.java
View file @
68a4c438
...
...
@@ -14,6 +14,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -70,4 +71,13 @@ public class AppletRecordServeBizImpl implements AppletRecordServeBiz {
public
void
deleteById
(
Long
id
)
{
appletRecordServeDao
.
deleteById
(
id
);
}
@Override
public
List
<
AppletRecordServe
>
getUserRecordListByType
(
Long
wechatUserId
,
Integer
recordType
)
{
List
<
AppletRecordServe
>
appletRecordServes
=
appletRecordServeDao
.
getUserRecordListByType
(
wechatUserId
,
recordType
);
if
(
ListUtils
.
isEmpty
(
appletRecordServes
))
{
appletRecordServes
=
new
ArrayList
<>();
}
return
appletRecordServes
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/impl/AppletUserBookcaseBizImpl.java
View file @
68a4c438
...
...
@@ -11,6 +11,7 @@ import com.pcloud.book.applet.dto.AppletNewsDTO;
import
com.pcloud.book.applet.dto.AppletNewsServeDTO
;
import
com.pcloud.book.applet.dto.AppletTaskDTO
;
import
com.pcloud.book.applet.dto.AppletUserBookcaseDTO
;
import
com.pcloud.book.applet.dto.BaseTempletClassifyDTO
;
import
com.pcloud.book.applet.dto.BookResourceExcelDTO
;
import
com.pcloud.book.applet.dto.UserLastBookReDTO
;
import
com.pcloud.book.applet.entity.AppletThirdResources
;
...
...
@@ -627,6 +628,24 @@ public class AppletUserBookcaseBizImpl implements AppletUserBookcaseBiz {
return
excelUrl
;
}
@Override
public
BaseTempletClassifyDTO
getLastReadBookInfo
(
List
<
Long
>
wechatUserIds
)
{
return
appletUserBookcaseDao
.
getLastReadBookInfoByUsers
(
wechatUserIds
);
}
@Override
public
List
<
Long
>
getSameClassifyUserIds
(
List
<
Long
>
wechatUserIds
)
{
if
(
ListUtils
.
isEmpty
(
wechatUserIds
))
{
return
new
ArrayList
<>();
}
BaseTempletClassifyDTO
baseTempletClassifyDTO
=
appletUserBookcaseDao
.
getLastReadBookInfoByUsers
(
wechatUserIds
);
if
(
null
==
baseTempletClassifyDTO
||
null
==
baseTempletClassifyDTO
.
getFirstClassify
())
{
return
new
ArrayList
<>();
}
List
<
Long
>
wechatUserId
=
appletUserBookcaseDao
.
getSameClassifyUserIds
(
baseTempletClassifyDTO
);
return
wechatUserId
;
}
private
String
getExcelUrl4Resource
(
List
<
BookResourceExcelDTO
>
bookResourceDTOList4ResourceExcel
,
String
fileName
)
{
// 字段名
String
[]
rowsName
=
{
"书籍id"
,
"编辑id"
,
"渠道id"
,
"书籍名称"
,
"书籍二维码"
,
"资源id"
,
"资源名称"
,
"资源类型"
,
"资源具体类型"
,
"资源类型名称"
,
"资源价格"
,
"是否小睿书"
};
...
...
pcloud-service-book/src/main/java/com/pcloud/book/applet/dao/AppletRecordServeDao.java
View file @
68a4c438
...
...
@@ -23,4 +23,6 @@ public interface AppletRecordServeDao extends BaseDao<AppletRecordServe> {
List
<
AppletRecordDTO
>
getAppletRecordCatalogue
(
Map
<
String
,
Object
>
paramMap
);
void
batchUpdate
(
List
<
AppletRecordDTO
>
recordList
);
List
<
AppletRecordServe
>
getUserRecordListByType
(
Long
wechatUserId
,
Integer
recordType
);
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/dao/AppletUserBookcaseDao.java
View file @
68a4c438
package
com
.
pcloud
.
book
.
applet
.
dao
;
import
com.pcloud.book.applet.dto.AppletUserBookcaseDTO
;
import
com.pcloud.book.applet.dto.BaseTempletClassifyDTO
;
import
com.pcloud.book.applet.dto.UserLastBookReDTO
;
import
com.pcloud.book.applet.entity.AppletUserBookcase
;
import
com.pcloud.book.applet.entity.AppletUserClickRecord
;
...
...
@@ -107,4 +108,8 @@ public interface AppletUserBookcaseDao extends BaseDao<AppletUserBookcase> {
BaseTempletClassify
getLastReadBookInfo
(
Long
wechatUserId
);
UserLastBookReDTO
getUserLastGroupBook
(
Long
wechatUserId
);
BaseTempletClassifyDTO
getLastReadBookInfoByUsers
(
List
<
Long
>
wechatUserIds
);
List
<
Long
>
getSameClassifyUserIds
(
BaseTempletClassifyDTO
baseTempletClassifyDTO
);
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/dao/impl/AppletRecordServeDaoImpl.java
View file @
68a4c438
...
...
@@ -43,4 +43,12 @@ public class AppletRecordServeDaoImpl extends BaseDaoImpl<AppletRecordServe> imp
public
void
batchUpdate
(
List
<
AppletRecordDTO
>
recordList
)
{
getSessionTemplate
().
update
(
getStatement
(
"batchUpdate"
),
recordList
);
}
@Override
public
List
<
AppletRecordServe
>
getUserRecordListByType
(
Long
wechatUserId
,
Integer
recordType
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"wechatUserId"
,
wechatUserId
);
paramMap
.
put
(
"recordType"
,
recordType
);
return
getSessionTemplate
().
selectList
(
getStatement
(
"getUserRecordListByType"
),
paramMap
);
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/dao/impl/AppletUserBookcaseDaoImpl.java
View file @
68a4c438
...
...
@@ -2,6 +2,7 @@ package com.pcloud.book.applet.dao.impl;
import
com.pcloud.book.applet.dao.AppletUserBookcaseDao
;
import
com.pcloud.book.applet.dto.AppletUserBookcaseDTO
;
import
com.pcloud.book.applet.dto.BaseTempletClassifyDTO
;
import
com.pcloud.book.applet.dto.UserLastBookReDTO
;
import
com.pcloud.book.applet.entity.AppletUserBookcase
;
import
com.pcloud.book.applet.entity.AppletUserClickRecord
;
...
...
@@ -153,4 +154,14 @@ public class AppletUserBookcaseDaoImpl extends BaseDaoImpl<AppletUserBookcase> i
public
UserLastBookReDTO
getUserLastGroupBook
(
Long
wechatUserId
)
{
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getUserLastGroupBook"
),
wechatUserId
);
}
@Override
public
BaseTempletClassifyDTO
getLastReadBookInfoByUsers
(
List
<
Long
>
wechatUserIds
)
{
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getLastReadBookInfoByUsers"
),
wechatUserIds
);
}
@Override
public
List
<
Long
>
getSameClassifyUserIds
(
BaseTempletClassifyDTO
baseTempletClassifyDTO
)
{
return
getSessionTemplate
().
selectList
(
getStatement
(
"getSameClassifyUserIds"
),
baseTempletClassifyDTO
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/facade/AppletRecordServeFacade.java
View file @
68a4c438
...
...
@@ -7,8 +7,10 @@ import com.pcloud.common.dto.ResponseDto;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.permission.PermissionException
;
import
com.pcloud.common.utils.SessionUtil
;
import
com.pcloud.common.utils.cookie.Cookie
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.CookieValue
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
...
@@ -17,6 +19,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
/**
* (AppletRecordServe)表控制层
*
...
...
@@ -75,4 +79,15 @@ public class AppletRecordServeFacade {
return
new
ResponseDto
<>();
}
@ApiOperation
(
"根据类型获取用户足迹数据"
)
@GetMapping
(
"getUserRecordListByType"
)
public
ResponseDto
<?>
getUserRecordListByType
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestParam
(
value
=
"recordType"
,
required
=
false
)
Integer
recordType
)
throws
BizException
,
PermissionException
{
Long
wechatUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
List
<
AppletRecordServe
>
appletRecordServeList
=
appletRecordServeBiz
.
getUserRecordListByType
(
wechatUserId
,
recordType
);
return
new
ResponseDto
<>(
appletRecordServeList
);
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/applet/service/impl/AppletServiceImpl.java
View file @
68a4c438
...
...
@@ -10,6 +10,7 @@ import com.pcloud.book.applet.biz.AppletRecordBiz;
import
com.pcloud.book.applet.biz.AppletRecordStatisBiz
;
import
com.pcloud.book.applet.biz.AppletRecordAggrStatisBiz
;
import
com.pcloud.book.applet.biz.AppletThirdResourcesStaticBiz
;
import
com.pcloud.book.applet.biz.AppletUserBookcaseBiz
;
import
com.pcloud.book.applet.biz.ReadBookRecordBiz
;
import
com.pcloud.book.applet.biz.ServeCollectBiz
;
import
com.pcloud.book.applet.dto.AppletAppOrProductDTO
;
...
...
@@ -18,6 +19,7 @@ import com.pcloud.book.applet.dto.AppletNewsVO;
import
com.pcloud.book.applet.dto.AppletOuterBookDTO
;
import
com.pcloud.book.applet.dto.AppletOuterBooklistDTO
;
import
com.pcloud.book.applet.dto.AppletThirdResourcesDTO
;
import
com.pcloud.book.applet.dto.BaseTempletClassifyDTO
;
import
com.pcloud.book.applet.dto.PcloudGroupActivityDTO
;
import
com.pcloud.book.applet.dto.ServeCollectDTO
;
import
com.pcloud.book.applet.entity.ServeCollect
;
...
...
@@ -39,6 +41,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -85,6 +88,8 @@ public class AppletServiceImpl implements AppletService {
private
AppletBannerBiz
appletBannerBiz
;
@Autowired
private
ReadBookRecordBiz
readBookRecordBiz
;
@Autowired
private
AppletUserBookcaseBiz
appletUserBookcaseBiz
;
@Override
...
...
@@ -242,4 +247,16 @@ public class AppletServiceImpl implements AppletService {
AppletThirdResourcesDTO
appletThirdResourcesDTO
=
appletNewsBiz
.
getThirdResourceById
(
thirdResourcesId
);
return
ResponseHandleUtil
.
toResponse
(
appletThirdResourcesDTO
);
}
@Override
@RequestMapping
(
"getLastReadBookInfo"
)
public
ResponseEntity
<
ResponseDto
<
BaseTempletClassifyDTO
>>
getLastReadBookInfo
(
@RequestBody
List
<
Long
>
wechatUserIds
)
{
return
ResponseHandleUtil
.
toResponse
(
appletUserBookcaseBiz
.
getLastReadBookInfo
(
wechatUserIds
));
}
@RequestMapping
(
"getSameClassifyUserIds"
)
@Override
public
ResponseEntity
<
ResponseDto
<
List
<
Long
>>>
getSameClassifyUserIds
(
@RequestBody
List
<
Long
>
wechatUserIds
){
return
ResponseHandleUtil
.
toResponse
(
appletUserBookcaseBiz
.
getSameClassifyUserIds
(
wechatUserIds
));
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/BookLabelBiz.java
View file @
68a4c438
...
...
@@ -65,4 +65,11 @@ public interface BookLabelBiz {
* * @param null
*/
List
<
BookLabelVO
>
getLabelByIds
(
List
<
Long
>
labelIds
);
/**
* 根据类型获取已经通过审核的标签
* @param labelType
* @return
*/
List
<
BookLabel
>
getBookLabelsByType
(
Integer
labelType
);
}
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookLabelBizImpl.java
View file @
68a4c438
...
...
@@ -8,12 +8,14 @@ import com.pcloud.book.book.entity.BookLabel;
import
com.pcloud.book.book.enums.BookLabelAuditState
;
import
com.pcloud.book.book.vo.BookLabelVO
;
import
com.pcloud.book.consumer.user.AdviserConsr
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.constant.SystemCode
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.resourcecenter.base.enums.AuditStateEnum
;
import
com.pcloud.usercenter.party.adviser.dto.AdviserBaseInfoDto
;
import
org.apache.commons.collections.MapUtils
;
...
...
@@ -28,6 +30,8 @@ import java.util.List;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
static
com
.
pcloud
.
book
.
book
.
constant
.
BookConstant
.
BOOK_CACHE_SECOUND
;
@Component
(
"bookLabelBiz"
)
public
class
BookLabelBizImpl
implements
BookLabelBiz
{
...
...
@@ -39,7 +43,7 @@ public class BookLabelBizImpl implements BookLabelBiz {
@Override
public
void
applyBookLabel
(
BookLabel
bookLabel
,
String
systemCode
)
{
List
<
BookLabel
>
labels
=
bookLabelDao
.
getListByType
(
bookLabel
.
getType
());
List
<
BookLabel
>
labels
=
bookLabelDao
.
getListByType
(
bookLabel
.
getType
()
,
null
);
List
<
String
>
names
=
labels
.
stream
().
filter
(
s
->
s
.
getName
()!=
null
).
map
(
BookLabel:
:
getName
).
collect
(
Collectors
.
toList
());
if
(
names
.
contains
(
bookLabel
.
getName
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"标签名称重复或已申请"
);
...
...
@@ -67,7 +71,7 @@ public class BookLabelBizImpl implements BookLabelBiz {
updateLabel
.
setId
(
bookLabelVO
.
getLabelId
());
updateLabel
.
setAuditState
(
bookLabelVO
.
getAuditState
());
if
(
BookLabelAuditState
.
update_pass
.
code
.
equals
(
bookLabelVO
.
getAuditState
())){
//修改后入库
List
<
BookLabel
>
labels
=
bookLabelDao
.
getListByType
(
bookLabelVO
.
getType
());
List
<
BookLabel
>
labels
=
bookLabelDao
.
getListByType
(
bookLabelVO
.
getType
()
,
null
);
List
<
String
>
names
=
labels
.
stream
().
filter
(
s
->
s
.
getName
()!=
null
).
map
(
BookLabel:
:
getName
).
collect
(
Collectors
.
toList
());
if
(
names
.
contains
(
bookLabelVO
.
getName
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"标签名称重复或已申请"
);
...
...
@@ -172,4 +176,19 @@ public class BookLabelBizImpl implements BookLabelBiz {
}
return
labelVOS
;
}
@Override
@ParamLog
(
"根据类型获取已经通过审核的标签"
)
public
List
<
BookLabel
>
getBookLabelsByType
(
Integer
labelType
)
{
List
<
BookLabel
>
bookLabels
=
new
ArrayList
<>();
String
labelKey
=
BookConstant
.
BOOK_LABEL_CACHE
+
"RAYS_QUESTION"
;
bookLabels
=
JedisClusterUtils
.
getJsonList
(
labelKey
,
BookLabel
.
class
);
if
(
ListUtils
.
isEmpty
(
bookLabels
))
{
bookLabels
=
bookLabelDao
.
getListByType
(
labelType
,
AuditStateEnum
.
AUDIT_SUCCESS
.
value
);
if
(!
ListUtils
.
isEmpty
(
bookLabels
))
{
JedisClusterUtils
.
setJsonList
(
labelKey
,
bookLabels
,
BOOK_CACHE_SECOUND
);
}
}
return
ListUtils
.
isEmpty
(
bookLabels
)
?
new
ArrayList
<>()
:
bookLabels
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/dao/BookLabelDao.java
View file @
68a4c438
...
...
@@ -8,7 +8,7 @@ import java.util.Map;
public
interface
BookLabelDao
extends
BaseDao
<
BookLabel
>
{
List
<
BookLabel
>
getListByType
(
Integer
type
);
List
<
BookLabel
>
getListByType
(
Integer
type
,
Long
value
);
List
<
BookLabel
>
getAll
(
Long
partyId
);
...
...
@@ -19,4 +19,5 @@ public interface BookLabelDao extends BaseDao<BookLabel> {
Long
getByNameType
(
String
name
,
Integer
type
);
Integer
getMaxSeqByType
(
Integer
type
);
}
pcloud-service-book/src/main/java/com/pcloud/book/book/dao/impl/BookLabelDaoImpl.java
View file @
68a4c438
...
...
@@ -19,8 +19,11 @@ public class BookLabelDaoImpl extends BaseDaoImpl<BookLabel> implements BookLabe
@Override
public
List
<
BookLabel
>
getListByType
(
Integer
type
)
{
return
super
.
getSqlSession
().
selectList
(
super
.
getStatement
(
"getListByType"
),
type
);
public
List
<
BookLabel
>
getListByType
(
Integer
type
,
Long
auditState
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"type"
,
type
);
paramMap
.
put
(
"auditState"
,
auditState
);
return
super
.
getSqlSession
().
selectList
(
super
.
getStatement
(
"getListByType"
),
paramMap
);
}
@Override
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/facade/impl/BookLabelFacadeImpl.java
View file @
68a4c438
...
...
@@ -10,6 +10,7 @@ import com.pcloud.common.dto.ResponseDto;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.permission.PermissionException
;
import
com.pcloud.common.utils.SessionUtil
;
import
com.pcloud.common.utils.cookie.Cookie
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.usercenter.common.exception.BookcaseException
;
import
io.swagger.annotations.Api
;
...
...
@@ -19,6 +20,7 @@ import io.swagger.annotations.ApiParam;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
@Api
(
"书刊标签"
)
...
...
@@ -130,4 +132,12 @@ public class BookLabelFacadeImpl {
return
new
ResponseDto
<>(
pageBeanNew
);
}
@GetMapping
(
"getBookLabelsByType"
)
public
ResponseDto
<
List
<
BookLabel
>>
getBookLabelsByType
(
@CookieValue
(
"userInfo"
)
String
userInfo
,
@RequestParam
(
value
=
"labelType"
,
required
=
false
)
@ApiParam
(
"标签类型:1年级,2科目,3版本,4地域"
)
Integer
labelType
)
{
Cookie
.
getUserInfo
(
userInfo
);
List
<
BookLabel
>
bookLabels
=
bookLabelBiz
.
getBookLabelsByType
(
labelType
);
return
new
ResponseDto
<>(
bookLabels
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/consumer/reader/ReaderConsr.java
View file @
68a4c438
...
...
@@ -4,6 +4,8 @@ import cn.hutool.core.collection.CollUtil;
import
com.pcloud.book.applet.dto.SpecialBookDTO
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.channelcenter.base.exceptions.ChannelBizException
;
import
com.pcloud.readercenter.applet.entity.AppletQuestion
;
import
com.pcloud.readercenter.applet.service.AppletUserService
;
import
com.pcloud.readercenter.rmall.entity.RmallBookMoneyRecord
;
import
com.pcloud.readercenter.rmall.service.RmallBookMoneyRecordService
;
import
com.pcloud.readercenter.wechat.dto.NickNameAndOpenIdDto
;
...
...
@@ -58,6 +60,8 @@ public class ReaderConsr {
private
AgentService
agentService
;
@Autowired
private
RmallBookMoneyRecordService
rmallBookMoneyRecordService
;
@Autowired
private
AppletUserService
appletUserService
;
public
WechatUser
getWechatUser
(
Long
wechatUserId
)
throws
BizException
{
if
(
wechatUserId
==
null
)
{
...
...
@@ -361,6 +365,19 @@ public class ReaderConsr {
}
return
result
;
}
public
Map
<
Long
,
AppletQuestion
>
getQuestionMap
(
List
<
Long
>
list
)
{
if
(
CollUtil
.
isEmpty
(
list
))
{
return
null
;
}
Map
<
Long
,
AppletQuestion
>
appletQuestionMap
=
new
HashMap
<>();
try
{
appletQuestionMap
=
ResponseHandleUtil
.
parseMap
(
appletUserService
.
getQuestionMap
(
list
),
Long
.
class
,
AppletQuestion
.
class
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"根据问题获取问题详情失败:"
+
e
.
getMessage
(),
e
);
}
return
appletQuestionMap
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/biz/CultivateNotifyBiz.java
View file @
68a4c438
...
...
@@ -6,6 +6,7 @@ import com.pcloud.book.cultivate.dto.CultivateNotifyPageDTO;
import
com.pcloud.book.cultivate.dto.SearchNotifyDTO
;
import
com.pcloud.book.cultivate.dto.SearchSendUserDTO
;
import
com.pcloud.book.cultivate.dto.SendUserDetailDto
;
import
com.pcloud.book.cultivate.entity.AppletNotifySendDTO
;
import
com.pcloud.book.cultivate.entity.CultivateNotifySend
;
import
com.pcloud.common.page.PageBeanNew
;
...
...
@@ -33,4 +34,10 @@ public interface CultivateNotifyBiz {
PageBeanNew
<
AdviserBookInfoDTO
>
listPage4SearchBook
(
SearchSendUserDTO
searchSendUserDTO
);
void
batchSendMiniUser
(
List
<
CultivateNotifySend
>
list
);
void
sendAppletUserNotify
(
List
<
CultivateNotifySend
>
list
);
Long
createNotify4Question
(
AppletNotifySendDTO
newSendDTO
);
PageBeanNew
<
CultivateNotifyDTO
>
getLatestNotifyList
(
Long
wechatUserId
,
Integer
currentPage
,
Integer
numPerPage
);
}
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/biz/impl/CultivateNotifyBizImpl.java
View file @
68a4c438
...
...
@@ -2,6 +2,7 @@ package com.pcloud.book.cultivate.biz.impl;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.pcloud.appcenter.app.dto.AppDto
;
import
com.pcloud.book.applet.biz.AppletNewsBiz
;
...
...
@@ -32,6 +33,7 @@ import com.pcloud.book.cultivate.dto.CultivateNotifyTypeDTO;
import
com.pcloud.book.cultivate.dto.SearchNotifyDTO
;
import
com.pcloud.book.cultivate.dto.SearchSendUserDTO
;
import
com.pcloud.book.cultivate.dto.WechatUserDTO
;
import
com.pcloud.book.cultivate.entity.AppletNotifySendDTO
;
import
com.pcloud.book.cultivate.entity.CultivateNotify
;
import
com.pcloud.book.cultivate.entity.CultivateNotifyItem
;
import
com.pcloud.book.cultivate.entity.CultivateNotifySend
;
...
...
@@ -39,13 +41,16 @@ import com.pcloud.book.cultivate.enums.NotifySendTypeEnum;
import
com.pcloud.book.group.tools.SendWeixinRequestTools
;
import
com.pcloud.book.util.common.ThreadPoolUtils
;
import
com.pcloud.channelcenter.wechat.dto.AccountSettingDto
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.dto.AppletTemplateMessageDto
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.utils.DateUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ServeLinkUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.contentcenter.resource.dto.ResourceDTO
;
import
com.pcloud.readercenter.applet.entity.AppletQuestion
;
import
com.pcloud.readercenter.wechat.dto.MiniUserDto
;
import
com.pcloud.readercenter.wechat.dto.ReaderMessageDto
;
import
com.pcloud.resourcecenter.product.dto.ProductDto
;
...
...
@@ -53,6 +58,7 @@ import com.pcloud.usercenter.party.adviser.dto.AdviserBaseInfoDto;
import
com.pcloud.wechatgroup.selfrobot.dto.SendMessageDTO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
...
...
@@ -162,14 +168,16 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
cultivateNotifyDTO
.
setCultivateNotifyItems
(
list1
);
cultivateNotifyItemList
.
addAll
(
list1
);
}
//批量更新消息已读未读
List
<
CultivateNotifySend
>
notifySends
=
cultivateNotifySendDao
.
getNotifySendsByType
(
wechatUserId
,
messageType
);
for
(
CultivateNotifySend
notifySend:
notifySends
)
{
notifySend
.
setIsRead
(
true
);
notifySend
.
setReadTime
(
new
Date
());
notifySend
.
setUpdateTime
(
new
Date
());
cultivateNotifySendDao
.
update
(
notifySend
);
}
ThreadPoolUtils
.
OTHER_THREAD_POOL
.
execute
(()
->
{
//批量更新消息已读未读
List
<
CultivateNotifySend
>
notifySends
=
cultivateNotifySendDao
.
getNotifySendsByType
(
wechatUserId
,
messageType
);
for
(
CultivateNotifySend
notifySend:
notifySends
)
{
notifySend
.
setIsRead
(
true
);
notifySend
.
setReadTime
(
new
Date
());
notifySend
.
setUpdateTime
(
new
Date
());
cultivateNotifySendDao
.
update
(
notifySend
);
}
});
//填充资讯应用作品
fillAppOrProduct4Notify
(
cultivateNotifyItemList
);
return
pageBeanNew
;
...
...
@@ -421,8 +429,21 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
}
});
// 获取问题
Map
<
Long
,
AppletQuestion
>
questionMap
=
new
HashMap
<>();
CompletableFuture
<
List
<
Long
>>
questionFuture
=
CompletableFuture
.
supplyAsync
(()
->
cultivateNotifyItems
.
stream
()
.
filter
(
x
->
Objects
.
nonNull
(
x
)
&&
Objects
.
equals
(
x
.
getServeType
(),
AppletRecordTypeEnum
.
RAISE_QUESTION
.
value
))
.
map
(
CultivateNotifyItem:
:
getServeId
).
distinct
().
collect
(
Collectors
.
toList
())).
whenComplete
((
list
,
throwable
)
->
{
if
(
Objects
.
nonNull
(
throwable
))
{
log
.
error
(
"[fillServeInfo] 填充小睿互助问题信息失败,err:{}"
,
throwable
.
getMessage
(),
throwable
);
}
else
{
Map
<
Long
,
AppletQuestion
>
appletQuestionMap
=
!
ListUtils
.
isEmpty
(
list
)
?
readerConsr
.
getQuestionMap
(
list
)
:
new
HashMap
<>();
questionMap
.
putAll
(
appletQuestionMap
);
}
});
try
{
CompletableFuture
.
allOf
(
newsBannerFuture
,
appBannerFuture
,
productBannerFuture
).
get
();
CompletableFuture
.
allOf
(
newsBannerFuture
,
appBannerFuture
,
productBannerFuture
,
questionFuture
).
get
();
}
catch
(
InterruptedException
|
ExecutionException
e
)
{
log
.
error
(
"[fillServeInfo] banner 填充信息失败,err:{}"
,
e
.
getMessage
(),
e
);
}
...
...
@@ -464,6 +485,10 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
.
resultUrl
(
resultLinkUrl
).
hasThirdLink
(
StrUtil
.
isNotBlank
(
productDto
.
getSkipUrl
()))
.
serveTypeName
(
productDto
.
getShortName
()).
build
();
banner
.
setAppItem
(
build
);
}
else
if
(
Objects
.
equals
(
serveType
,
AppletRecordTypeEnum
.
RAISE_QUESTION
.
value
)
&&
Objects
.
nonNull
(
questionMap
.
get
(
banner
.
getServeId
())))
{
if
(
MapUtils
.
isNotEmpty
(
questionMap
)
&&
null
!=
questionMap
.
get
(
banner
.
getServeId
()))
{
banner
.
setAppletQuestion
(
questionMap
.
get
(
banner
.
getServeId
()));
}
}
}
}
...
...
@@ -520,4 +545,51 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
}
this
.
sendAppletTemplateMessage
(
list
,
cultivateNotify
.
getAgentId
());
}
@Override
public
void
sendAppletUserNotify
(
List
<
CultivateNotifySend
>
list
)
{
if
(
ListUtils
.
isEmpty
(
list
)){
return
;
}
cultivateNotifySendDao
.
insert
(
list
);
}
@Override
@ParamLog
(
"小睿互助新增站内信"
)
public
Long
createNotify4Question
(
AppletNotifySendDTO
newSendDTO
)
{
if
(
null
==
newSendDTO
||
null
==
newSendDTO
.
getSendType
()
||
null
==
newSendDTO
.
getMessageType
()
||
StringUtil
.
isEmpty
(
newSendDTO
.
getTitle
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"新建站内信消息参数为空"
);
}
CultivateNotify
cultivateNotify
=
new
CultivateNotify
();
cultivateNotify
.
setMessageType
(
newSendDTO
.
getMessageType
());
cultivateNotify
.
setTitle
(
newSendDTO
.
getTitle
());
cultivateNotify
.
setSendType
(
newSendDTO
.
getSendType
());
cultivateNotify
.
setAgentId
(
0L
);
cultivateNotifyDao
.
insert
(
cultivateNotify
);
CultivateNotifyItem
cultivateNotifyItem
=
new
CultivateNotifyItem
();
cultivateNotifyItem
.
setMessageId
(
cultivateNotify
.
getMessageId
());
cultivateNotifyItem
.
setContentType
(
4
);
cultivateNotifyItem
.
setServeId
(
newSendDTO
.
getFromId
());
cultivateNotifyItem
.
setServeType
(
AppletRecordTypeEnum
.
RAISE_QUESTION
.
value
);
cultivateNotifyItemDao
.
insert
(
Lists
.
newArrayList
(
cultivateNotifyItem
));
return
cultivateNotify
.
getMessageId
();
}
@Override
@ParamLog
(
"获取最近消息列表"
)
public
PageBeanNew
<
CultivateNotifyDTO
>
getLatestNotifyList
(
Long
wechatUserId
,
Integer
currentPage
,
Integer
numPerPage
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"wechatUserId"
,
wechatUserId
);
PageBeanNew
<
CultivateNotifyDTO
>
pageBeanNew
=
cultivateNotifySendDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"getNotifyListByType"
);
List
<
CultivateNotifyItem
>
cultivateNotifyItemList
=
new
ArrayList
<>();
for
(
CultivateNotifyDTO
cultivateNotifyDTO:
pageBeanNew
.
getRecordList
())
{
List
<
CultivateNotifyItem
>
list1
=
cultivateNotifyItemDao
.
getNotifyItemsByMessageId
(
cultivateNotifyDTO
.
getMessageId
());
fillResource
(
list1
);
cultivateNotifyDTO
.
setCultivateNotifyItems
(
list1
);
cultivateNotifyItemList
.
addAll
(
list1
);
}
//填充资讯应用作品问题
fillAppOrProduct4Notify
(
cultivateNotifyItemList
);
return
pageBeanNew
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/entity/CultivateNotifyItem.java
View file @
68a4c438
...
...
@@ -6,6 +6,7 @@ import com.pcloud.book.applet.dto.ServeItemInfoDTO;
import
com.pcloud.common.entity.BaseEntity
;
import
com.pcloud.contentcenter.resource.dto.ResourceOfficeItemDTO
;
import
com.pcloud.contentcenter.resource.dto.ResourcePdfItemDTO
;
import
com.pcloud.readercenter.applet.entity.AppletQuestion
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -21,7 +22,7 @@ public class CultivateNotifyItem extends BaseEntity {
@ApiModelProperty
(
"消息id"
)
private
Long
messageId
;
@ApiModelProperty
(
"发送内容(1-文本,2-图片,3-音频, 4-链接)"
)
@ApiModelProperty
(
"发送内容(1-文本,2-图片,3-音频, 4-链接
,5 问题
)"
)
private
Integer
contentType
;
@ApiModelProperty
(
"文字内容"
)
...
...
@@ -84,6 +85,9 @@ public class CultivateNotifyItem extends BaseEntity {
@ApiModelProperty
(
"咨询具体信息"
)
private
ServeItemInfoDTO
appItem
;
@ApiModelProperty
(
"小睿互助问题"
)
private
AppletQuestion
appletQuestion
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/facade/CultivateNotifyFacade.java
View file @
68a4c438
...
...
@@ -109,6 +109,18 @@ public class CultivateNotifyFacade {
return
new
ResponseDto
<>(
cultivateNotifyBiz
.
getNotifyListByType
(
wechatUserId
,
messageType
,
currentPage
,
numPerPage
));
}
@ApiOperation
(
"获取最新信息里列表"
)
@GetMapping
(
"getLatestNotifyList"
)
public
ResponseDto
<?>
getLatestNotifyList
(
@CookieValue
(
value
=
"userInfo"
,
required
=
false
)
String
userInfo
,
@RequestParam
(
value
=
"currentPage"
)
Integer
currentPage
,
@RequestParam
(
value
=
"numPerPage"
)
Integer
numPerPage
)
{
Long
wechatUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
if
(!
NumberUtil
.
isNumber
(
wechatUserId
))
{
throw
new
BizException
(
BizException
.
PARAM_IS_NULL
.
getCode
(),
"wechatUserId 不能为空"
);
}
return
new
ResponseDto
<>(
cultivateNotifyBiz
.
getLatestNotifyList
(
wechatUserId
,
currentPage
,
numPerPage
));
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/service/impl/CultivateNotifyServiceImpl.java
View file @
68a4c438
package
com
.
pcloud
.
book
.
cultivate
.
service
.
impl
;
import
com.pcloud.book.cultivate.biz.CultivateNotifyBiz
;
import
com.pcloud.book.cultivate.entity.AppletNotifySendDTO
;
import
com.pcloud.book.cultivate.entity.CultivateNotifySend
;
import
com.pcloud.book.cultivate.service.CultivateNotifyService
;
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.common.utils.bean.ResponesUtils
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
...
...
@@ -29,4 +35,18 @@ public class CultivateNotifyServiceImpl implements CultivateNotifyService {
cultivateNotifyBiz
.
batchSendMiniUser
(
list
);
}
}
@Override
@RequestMapping
(
value
=
"sendAppletUserNotify"
,
method
=
RequestMethod
.
POST
)
public
void
sendAppletUserNotify
(
@RequestBody
List
<
CultivateNotifySend
>
list
)
throws
BizException
{
if
(!
ListUtils
.
isEmpty
(
list
))
{
cultivateNotifyBiz
.
sendAppletUserNotify
(
list
);
}
}
@Override
@RequestMapping
(
value
=
"createNotify4Question"
,
method
=
RequestMethod
.
POST
)
public
ResponseEntity
<
ResponseDto
<
Long
>>
createNotify4Question
(
@RequestBody
AppletNotifySendDTO
newSendDTO
)
throws
BizException
{
return
ResponseHandleUtil
.
toResponse
(
cultivateNotifyBiz
.
createNotify4Question
(
newSendDTO
));
}
}
pcloud-service-book/src/main/resources/mapper/applet/AppletRecordServe.Mapper.xml
View file @
68a4c438
...
...
@@ -268,4 +268,20 @@
</foreach>
</where>
</update>
<select
id=
"getUserRecordListByType"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from
applet_record_serve
where
wechat_user_id = #{wechatUserId}
<if
test=
"recordType != null"
>
and
record_type = #{recordType}
</if>
and
is_delete = 0
order by create_time desc
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/applet/AppletUserBookcase.xml
View file @
68a4c438
...
...
@@ -359,4 +359,39 @@
LIMIT 1
</select>
<select
id=
"getLastReadBookInfoByUsers"
parameterType=
"list"
resultType=
"com.pcloud.book.applet.dto.BaseTempletClassifyDTO"
>
SELECT b.TEMPLET_ID firstClassify,
b.SECOND_TEMPLET_ID secondClassify,
b.third_TEMPLET_ID thirdClassify,
b.GRA_LABEL_ID gradeLabelId,
b.SUB_LABEL_ID subjectLabelId,
b.vol_label_id volLabelId
FROM applet_user_bookcase a
LEFT JOIN book_adviser b ON a.book_id = b.BOOK_ID
AND a.channel_id = b.CHANNEL_ID
AND a.adviser_id = b.ADVISER_ID
WHERE b.IS_DELETE = 0
AND a.wechat_user_id in
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
ORDER BY a.create_time DESC
LIMIT 1
</select>
<select
id=
"getSameClassifyUserIds"
parameterType=
"com.pcloud.book.applet.dto.BaseTempletClassifyDTO"
resultType=
"long"
>
SELECT
DISTINCT
A.wechat_user_id
FROM
`applet_user_bookcase` a
LEFT JOIN book_adviser b ON a.book_id = b.BOOK_ID
WHERE
b.IS_DELETE = 0
AND b.IS_MAIN_EDITOR = 1
AND b.TEMPLET_ID = #{firstClassify}
AND b.SECOND_TEMPLET_ID = #{secondClassify}
AND B.third_templet_id = #{thirdClassify};
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/book/BookLabel.Mapper.xml
View file @
68a4c438
...
...
@@ -60,12 +60,16 @@
SELECT MAX(seq) FROM book_label WHERE type=#{type}
</select>
<select
id=
"getListByType"
parameterType=
"
integer
"
resultMap=
"BaseResultMap"
>
<select
id=
"getListByType"
parameterType=
"
map
"
resultMap=
"BaseResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM
book_label
where type=#{type}
<if
test=
"auditState != null"
>
and audit_state = #{auditState}
</if>
and is_ray = 1
</select>
<!--获取全部-->
...
...
pcloud-service-book/src/main/resources/mapper/cultivate/CultivateNotifySend.xml
View file @
68a4c438
...
...
@@ -96,7 +96,9 @@
select a.message_id messageId ,a.title,a.message_type messageType ,c.create_time sendTime from cultivate_notify a, cultivate_notify_send c
where a.message_id=c.message_id
and c.wechat_user_id=#{wechatUserId}
and c.message_type=#{messageType}
<if
test=
"messageType != null"
>
and c.message_type=#{messageType}
</if>
order by c.create_time desc
</select>
...
...
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