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
f2fea78a
Commit
f2fea78a
authored
Mar 05, 2020
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1002503需求定制服务方案单二期
parent
7600ada0
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
479 additions
and
20 deletions
+479
-20
CustomPlanBiz.java
...c/main/java/com/pcloud/book/custom/biz/CustomPlanBiz.java
+12
-0
CustomPlanBizImpl.java
...va/com/pcloud/book/custom/biz/impl/CustomPlanBizImpl.java
+101
-1
CustomPlan.java
...c/main/java/com/pcloud/book/custom/entity/CustomPlan.java
+5
-0
CustomPlanModule.java
.../java/com/pcloud/book/custom/entity/CustomPlanModule.java
+3
-0
CustomPlanModuleSuggestion.java
...pcloud/book/custom/entity/CustomPlanModuleSuggestion.java
+29
-0
CustomPlanFacade.java
.../java/com/pcloud/book/custom/facade/CustomPlanFacade.java
+42
-3
CustomPlanModuleSuggestionMapper.java
.../book/custom/mapper/CustomPlanModuleSuggestionMapper.java
+33
-0
AddCustomPlan4UserVO.java
.../java/com/pcloud/book/custom/vo/AddCustomPlan4UserVO.java
+15
-0
AddSuggestionListVO.java
...n/java/com/pcloud/book/custom/vo/AddSuggestionListVO.java
+13
-0
AddSuggestionVO.java
.../main/java/com/pcloud/book/custom/vo/AddSuggestionVO.java
+19
-0
CustomPlanModuleVO.java
...in/java/com/pcloud/book/custom/vo/CustomPlanModuleVO.java
+3
-0
ModuleSuggestionVO.java
...in/java/com/pcloud/book/custom/vo/ModuleSuggestionVO.java
+19
-0
SuggestionListVO.java
...main/java/com/pcloud/book/custom/vo/SuggestionListVO.java
+32
-0
PersonalStageBizImpl.java
...oud/book/personalstage/biz/impl/PersonalStageBizImpl.java
+24
-7
PersonalStageConstant.java
...ud/book/personalstage/constant/PersonalStageConstant.java
+4
-0
CustomPlanMapper.xml
...ook/src/main/resources/mapper/custom/CustomPlanMapper.xml
+11
-6
CustomPlanModuleMapper.xml
...c/main/resources/mapper/custom/CustomPlanModuleMapper.xml
+4
-3
CustomPlanModuleSuggestionMapper.xml
...ources/mapper/custom/CustomPlanModuleSuggestionMapper.xml
+110
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/custom/biz/CustomPlanBiz.java
View file @
f2fea78a
package
com
.
pcloud
.
book
.
custom
.
biz
;
import
com.pcloud.book.custom.entity.CustomPlan
;
import
com.pcloud.book.custom.vo.AddCustomPlan4UserVO
;
import
com.pcloud.book.custom.vo.AddSuggestionVO
;
import
com.pcloud.book.custom.vo.CustomPlanModuleVO
;
import
com.pcloud.book.custom.vo.CustomPlanPaperVO
;
import
com.pcloud.book.custom.vo.EditCustomPlanModuleVO
;
import
com.pcloud.book.custom.vo.ModuleSuggestionVO
;
import
com.pcloud.book.custom.vo.SuggestionListVO
;
import
com.pcloud.common.page.PageBeanNew
;
import
java.util.List
;
...
...
@@ -30,4 +34,12 @@ public interface CustomPlanBiz {
PageBeanNew
<
CustomPlanPaperVO
>
listPlanPaperByPage
(
Integer
currentPage
,
Integer
numPerPage
,
Integer
paperState
,
String
content
);
Map
<
String
,
Object
>
getShortLinkUrl
(
Long
appId
,
Long
productId
,
String
linkUrl
);
PageBeanNew
<
SuggestionListVO
>
listSuggestion4Plan
(
Integer
currentPage
,
Integer
numPerPage
,
String
startTime
,
String
endTime
,
String
search
,
Integer
planId
);
List
<
ModuleSuggestionVO
>
getSuggestionInfo
(
Integer
batchId
,
Integer
planId
);
Integer
addSuggestion4Module
(
AddSuggestionVO
addSuggestionVO
);
Integer
addCustomPlan4User
(
AddCustomPlan4UserVO
addCustomPlan4UserVO
);
}
pcloud-service-book/src/main/java/com/pcloud/book/custom/biz/impl/CustomPlanBizImpl.java
View file @
f2fea78a
...
...
@@ -7,29 +7,43 @@ import com.pcloud.book.consumer.app.AppConsr;
import
com.pcloud.book.consumer.channel.QrcodeSceneConsr
;
import
com.pcloud.book.consumer.feedback.FeedbackConsr
;
import
com.pcloud.book.consumer.shareimage.ShareImageConsr
;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
import
com.pcloud.book.custom.biz.CustomPlanBiz
;
import
com.pcloud.book.custom.entity.CustomPlan
;
import
com.pcloud.book.custom.entity.CustomPlanModule
;
import
com.pcloud.book.custom.entity.CustomPlanModuleSuggestion
;
import
com.pcloud.book.custom.enums.PlanModuleTypeEnum
;
import
com.pcloud.book.custom.enums.PlanUseStateEnum
;
import
com.pcloud.book.custom.mapper.CustomPlanMapper
;
import
com.pcloud.book.custom.mapper.CustomPlanModuleMapper
;
import
com.pcloud.book.custom.mapper.CustomPlanModuleSuggestionMapper
;
import
com.pcloud.book.custom.vo.AddCustomPlan4UserVO
;
import
com.pcloud.book.custom.vo.AddSuggestionListVO
;
import
com.pcloud.book.custom.vo.AddSuggestionVO
;
import
com.pcloud.book.custom.vo.CustomPlanModuleVO
;
import
com.pcloud.book.custom.vo.CustomPlanPaperVO
;
import
com.pcloud.book.custom.vo.EditCustomPlanModuleVO
;
import
com.pcloud.book.custom.vo.ModuleSuggestionVO
;
import
com.pcloud.book.custom.vo.SuggestionListVO
;
import
com.pcloud.book.custom.vo.ToPdfVO
;
import
com.pcloud.book.group.biz.WeixinQrcodeBiz
;
import
com.pcloud.book.group.tools.Kit
;
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.page.PageBeanNew
;
import
com.pcloud.common.utils.BeanUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.QrcodeUtils
;
import
com.pcloud.common.utils.UUIDUitl
;
import
com.pcloud.common.utils.httpclient.UrlUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.feedback.paper.dto.PaperDto
;
import
com.sdk.wxgroup.GroupInfoVO
;
import
com.pcloud.wechatgroup.group.dto.GroupRobotDTO
;
import
com.pcloud.wechatgroup.group.dto.GroupUserDTO
;
import
com.sdk.wxgroup.SendMessageTypeEnum
;
import
com.sdk.wxgroup.SendTextMessageVO
;
import
com.sdk.wxgroup.WxGroupSDK
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -42,6 +56,7 @@ import java.util.ArrayList;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Component
public
class
CustomPlanBizImpl
implements
CustomPlanBiz
{
...
...
@@ -62,6 +77,12 @@ public class CustomPlanBizImpl implements CustomPlanBiz {
private
AppConsr
appConsr
;
@Autowired
private
QrcodeSceneConsr
qrcodeSceneConsr
;
@Autowired
private
CustomPlanModuleSuggestionMapper
customPlanModuleSuggestionMapper
;
@Autowired
private
WechatGroupConsr
wechatGroupConsr
;
@Autowired
private
WeixinQrcodeBiz
weixinQrcodeBiz
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -260,4 +281,83 @@ public class CustomPlanBizImpl implements CustomPlanBiz {
}
return
resultMap
;
}
@Override
public
PageBeanNew
<
SuggestionListVO
>
listSuggestion4Plan
(
Integer
currentPage
,
Integer
numPerPage
,
String
startTime
,
String
endTime
,
String
search
,
Integer
planId
)
{
List
<
SuggestionListVO
>
list
=
new
ArrayList
<>();
List
<
String
>
wxIdList
=
null
;
if
(!
StringUtil
.
isEmpty
(
search
))
{
wxIdList
=
wechatGroupConsr
.
getByUserQuery
(
search
);
if
(
ListUtils
.
isEmpty
(
wxIdList
))
{
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
list
);
}
}
Integer
count
=
customPlanModuleSuggestionMapper
.
getSuggestionCount
(
startTime
,
endTime
,
wxIdList
,
planId
);
if
(
count
<=
0
)
{
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
list
);
}
list
=
customPlanModuleSuggestionMapper
.
listSuggestion4Plan
(
currentPage
*
numPerPage
,
numPerPage
,
startTime
,
endTime
,
wxIdList
,
planId
);
List
<
String
>
userIds
=
list
.
stream
().
map
(
SuggestionListVO:
:
getWxId
).
distinct
().
collect
(
Collectors
.
toList
());
Map
<
String
,
GroupUserDTO
>
userDTOMap
=
wechatGroupConsr
.
mapWxUserInfoByWxIdList
(
userIds
);
list
.
forEach
(
suggestionListVO
->
{
//封装用户信息
String
wxId
=
suggestionListVO
.
getWxId
();
if
(
userDTOMap
!=
null
&&
userDTOMap
.
get
(
wxId
)
!=
null
)
{
GroupUserDTO
groupUserDTO
=
userDTOMap
.
get
(
wxId
);
suggestionListVO
.
setNickName
(
groupUserDTO
.
getNickName
());
suggestionListVO
.
setHeadUrl
(
groupUserDTO
.
getHeadPic
());
suggestionListVO
.
setSex
(
groupUserDTO
.
getSex
());
}
});
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
count
,
list
);
}
@Override
public
List
<
ModuleSuggestionVO
>
getSuggestionInfo
(
Integer
batchId
,
Integer
planId
)
{
return
customPlanModuleSuggestionMapper
.
getSuggestionInfo
(
batchId
,
planId
);
}
@Override
public
Integer
addSuggestion4Module
(
AddSuggestionVO
addSuggestionVO
)
{
String
wxId
=
addSuggestionVO
.
getWxId
();
Integer
planId
=
addSuggestionVO
.
getPlanId
();
int
maxBatchId
=
customPlanModuleSuggestionMapper
.
getMaxBatchId
();
List
<
AddSuggestionListVO
>
suggestionList
=
addSuggestionVO
.
getSuggestionList
();
List
<
CustomPlanModuleSuggestion
>
list
=
new
ArrayList
<>();
suggestionList
.
forEach
(
addSuggestionListVO
->
{
if
(
null
==
addSuggestionListVO
.
getSuggestionLevel
())
{
addSuggestionListVO
.
setSuggestionLevel
(
0
);
addSuggestionListVO
.
setSuggestion
(
null
);
}
CustomPlanModuleSuggestion
suggestion
=
CustomPlanModuleSuggestion
.
builder
().
wxId
(
wxId
).
planId
(
planId
)
.
suggestionLevel
(
addSuggestionListVO
.
getSuggestionLevel
()).
suggestion
(
addSuggestionListVO
.
getSuggestion
())
.
batchId
(
maxBatchId
+
1
).
moduleId
(
addSuggestionListVO
.
getModuleId
()).
build
();
list
.
add
(
suggestion
);
});
customPlanModuleSuggestionMapper
.
batchInsert
(
list
);
ThreadPoolUtils
.
OTHER_THREAD_POOL
.
execute
(()
->
{
CustomPlan
customPlan
=
customPlanMapper
.
getById
(
planId
);
if
(!
StringUtil
.
isEmpty
(
customPlan
.
getConfirmFeedbackReply
())
&&
addSuggestionVO
.
getRobotWxId
()
!=
null
)
{
//发送return消息
String
robotWxId
=
addSuggestionVO
.
getRobotWxId
();
GroupRobotDTO
groupRobotDTO
=
wechatGroupConsr
.
getGroupRobotByWxId
(
robotWxId
);
String
ip
=
weixinQrcodeBiz
.
getRobotIpByGeneration
(
groupRobotDTO
.
getVersion
());
SendTextMessageVO
sendTextMessageVO
=
new
SendTextMessageVO
();
sendTextMessageVO
.
setContent
(
customPlan
.
getConfirmFeedbackReply
());
sendTextMessageVO
.
setCode
(
SendMessageTypeEnum
.
SELF
.
getCode
());
sendTextMessageVO
.
setWxId
(
robotWxId
);
sendTextMessageVO
.
setAltId
(
robotWxId
);
sendTextMessageVO
.
setWxGroupId
(
wxId
);
sendTextMessageVO
.
setIp
(
ip
);
WxGroupSDK
.
sendTextMessage
(
sendTextMessageVO
);
}
});
return
maxBatchId
+
1
;
}
@Override
public
Integer
addCustomPlan4User
(
AddCustomPlan4UserVO
addCustomPlan4UserVO
)
{
return
customPlanModuleSuggestionMapper
.
addCustomPlan4User
(
addCustomPlan4UserVO
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/custom/entity/CustomPlan.java
View file @
f2fea78a
...
...
@@ -39,4 +39,8 @@ public class CustomPlan {
private
Date
createTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
updateTime
;
private
Integer
suggestionCount
;
private
String
confirmFeedbackReply
;
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/custom/entity/CustomPlanModule.java
View file @
f2fea78a
...
...
@@ -44,4 +44,6 @@ public class CustomPlanModule {
private
Date
createTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
updateTime
;
private
Integer
openFeedback
;
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/custom/entity/CustomPlanModuleSuggestion.java
0 → 100644
View file @
f2fea78a
package
com
.
pcloud
.
book
.
custom
.
entity
;
import
lombok.Builder
;
import
lombok.Data
;
import
java.util.Date
;
@Data
@Builder
public
class
CustomPlanModuleSuggestion
{
private
Integer
id
;
private
Integer
batchId
;
private
Integer
planId
;
private
Integer
moduleId
;
private
String
wxId
;
private
Integer
suggestionLevel
;
private
String
suggestion
;
private
Date
createTime
;
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/custom/facade/CustomPlanFacade.java
View file @
f2fea78a
...
...
@@ -4,17 +4,26 @@ import com.pcloud.book.custom.biz.CustomPlanBiz;
import
com.pcloud.book.custom.biz.CustomPlanEmailBiz
;
import
com.pcloud.book.custom.dto.CustomPlanEmailDto
;
import
com.pcloud.book.custom.entity.CustomPlan
;
import
com.pcloud.book.custom.vo.CustomPlanModuleVO
;
import
com.pcloud.book.custom.vo.AddCustomPlan4UserVO
;
import
com.pcloud.book.custom.vo.AddSuggestionVO
;
import
com.pcloud.book.custom.vo.EditCustomPlanModuleVO
;
import
com.pcloud.book.timecontrol.vo.CreateSelfPlanVO
;
import
com.pcloud.book.custom.vo.ModuleSuggestionVO
;
import
com.pcloud.book.custom.vo.SuggestionListVO
;
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.page.PageBeanNew
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
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.RequestHeader
;
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
;
...
...
@@ -124,4 +133,34 @@ public class CustomPlanFacade {
return
new
ResponseDto
<>(
customPlanEmailBiz
.
getCustomPlanEmailByPlanId
(
customPlanId
));
}
@GetMapping
(
"listSuggestion4Plan"
)
@ApiOperation
(
value
=
"获取方案满意度记录"
,
httpMethod
=
"GET"
)
ResponseDto
<?>
listSuggestion4Plan
(
@RequestHeader
String
token
,
@RequestParam
Integer
currentPage
,
@RequestParam
Integer
numPerPage
,
@RequestParam
(
value
=
"startTime"
,
required
=
false
)
String
startTime
,
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
String
endTime
,
@RequestParam
(
value
=
"search"
,
required
=
false
)
String
search
,
@RequestParam
Integer
planId
)
{
PageBeanNew
<
SuggestionListVO
>
page
=
customPlanBiz
.
listSuggestion4Plan
(
currentPage
,
numPerPage
,
startTime
,
endTime
,
search
,
planId
);
return
new
ResponseDto
<>(
page
);
}
@ApiOperation
(
"查看评价详情"
)
@GetMapping
(
"getSuggestionInfo"
)
ResponseDto
<?>
getSuggestionInfo
(
@RequestHeader
String
token
,
@RequestParam
Integer
batchId
,
@RequestParam
Integer
planId
){
List
<
ModuleSuggestionVO
>
resultList
=
customPlanBiz
.
getSuggestionInfo
(
batchId
,
planId
);
return
new
ResponseDto
<>(
resultList
);
}
@ApiOperation
(
value
=
"客户端提交方案的意见反馈"
,
httpMethod
=
"POST"
)
@PostMapping
(
"addSuggestion4Module"
)
ResponseDto
<?>
addSuggestion4Module
(
@RequestBody
@Validated
AddSuggestionVO
addSuggestionVO
){
Integer
batchId
=
customPlanBiz
.
addSuggestion4Module
(
addSuggestionVO
);
return
new
ResponseDto
<>(
batchId
);
}
@ApiOperation
(
value
=
"给用户发送方案后的埋点"
,
httpMethod
=
"POST"
)
@PostMapping
(
"addCustomPlan4User"
)
ResponseDto
<?>
addCustomPlan4User
(
@RequestBody
@Validated
AddCustomPlan4UserVO
addCustomPlan4UserVO
){
Integer
id
=
customPlanBiz
.
addCustomPlan4User
(
addCustomPlan4UserVO
);
return
new
ResponseDto
<>(
id
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/custom/mapper/CustomPlanModuleSuggestionMapper.java
0 → 100644
View file @
f2fea78a
package
com
.
pcloud
.
book
.
custom
.
mapper
;
import
com.pcloud.book.custom.entity.CustomPlanModuleSuggestion
;
import
com.pcloud.book.custom.vo.AddCustomPlan4UserVO
;
import
com.pcloud.book.custom.vo.ModuleSuggestionVO
;
import
com.pcloud.book.custom.vo.SuggestionListVO
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
@Component
public
interface
CustomPlanModuleSuggestionMapper
{
Integer
getSuggestionCount
(
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"endTime"
)
String
endTime
,
@Param
(
"wxIdList"
)
List
<
String
>
wxIdList
,
@Param
(
"planId"
)
Integer
planId
);
List
<
SuggestionListVO
>
listSuggestion4Plan
(
@Param
(
"pageNum"
)
int
pageNum
,
@Param
(
"numPerPage"
)
int
numPerPage
,
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"endTime"
)
String
endTime
,
@Param
(
"wxIdList"
)
List
<
String
>
wxIdList
,
@Param
(
"planId"
)
Integer
planId
);
List
<
ModuleSuggestionVO
>
getSuggestionInfo
(
@Param
(
"batchId"
)
Integer
batchId
,
@Param
(
"planId"
)
Integer
planId
);
Integer
getMaxBatchId
();
void
batchInsert
(
@Param
(
"list"
)
List
<
CustomPlanModuleSuggestion
>
list
);
Integer
addCustomPlan4User
(
AddCustomPlan4UserVO
addCustomPlan4UserVO
);
Integer
getLatestPlanId
(
String
wxId
);
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/custom/vo/AddCustomPlan4UserVO.java
0 → 100644
View file @
f2fea78a
package
com
.
pcloud
.
book
.
custom
.
vo
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
@Data
public
class
AddCustomPlan4UserVO
{
@NotNull
private
String
wxId
;
@NotNull
private
Integer
planId
;
}
pcloud-service-book/src/main/java/com/pcloud/book/custom/vo/AddSuggestionListVO.java
0 → 100644
View file @
f2fea78a
package
com
.
pcloud
.
book
.
custom
.
vo
;
import
lombok.Data
;
@Data
public
class
AddSuggestionListVO
{
private
Integer
moduleId
;
private
Integer
suggestionLevel
;
private
String
suggestion
;
}
pcloud-service-book/src/main/java/com/pcloud/book/custom/vo/AddSuggestionVO.java
0 → 100644
View file @
f2fea78a
package
com
.
pcloud
.
book
.
custom
.
vo
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
@Data
public
class
AddSuggestionVO
{
@NotNull
private
String
wxId
;
@NotNull
private
Integer
planId
;
private
String
robotWxId
;
private
List
<
AddSuggestionListVO
>
suggestionList
;
}
pcloud-service-book/src/main/java/com/pcloud/book/custom/vo/CustomPlanModuleVO.java
View file @
f2fea78a
...
...
@@ -42,4 +42,6 @@ public class CustomPlanModuleVO {
private
String
linkUrl
;
private
List
<
CustomPlanModuleVO
>
customPlanModuleVOList
;
private
Integer
openFeedback
;
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/custom/vo/ModuleSuggestionVO.java
0 → 100644
View file @
f2fea78a
package
com
.
pcloud
.
book
.
custom
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
ModuleSuggestionVO
implements
Serializable
{
private
Integer
moduleId
;
private
Integer
openFeedback
;
private
Integer
moduleType
;
private
Integer
suggestionLevel
;
private
String
suggestion
;
}
pcloud-service-book/src/main/java/com/pcloud/book/custom/vo/SuggestionListVO.java
0 → 100644
View file @
f2fea78a
package
com
.
pcloud
.
book
.
custom
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
@Data
public
class
SuggestionListVO
implements
Serializable
{
private
Integer
planId
;
private
Integer
batchId
;
private
String
wxId
;
private
String
nickName
;
private
Integer
sex
;
private
String
headUrl
;
private
Integer
goodCount
;
private
Integer
badCount
;
private
Integer
defaultCount
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
}
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/biz/impl/PersonalStageBizImpl.java
View file @
f2fea78a
package
com
.
pcloud
.
book
.
personalstage
.
biz
.
impl
;
import
com.google.common.collect.Lists
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.consumer.content.ResourceConsr
;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
import
com.pcloud.book.custom.mapper.CustomPlanModuleSuggestionMapper
;
import
com.pcloud.book.keywords.enums.ReplyTypeEnum
;
import
com.pcloud.book.mq.delay.DelayMessageSender
;
import
com.pcloud.book.pcloudkeyword.dao.PcloudRobotClassifyDao
;
...
...
@@ -15,7 +15,15 @@ import com.pcloud.book.personalstage.biz.PersonalStageBiz;
import
com.pcloud.book.personalstage.biz.PersonalStageJumpBiz
;
import
com.pcloud.book.personalstage.check.PersonalStageCheck
;
import
com.pcloud.book.personalstage.constant.PersonalStageConstant
;
import
com.pcloud.book.personalstage.dao.*
;
import
com.pcloud.book.personalstage.dao.PersonalStageDao
;
import
com.pcloud.book.personalstage.dao.PersonalStageJumpDao
;
import
com.pcloud.book.personalstage.dao.PersonalStageJumpKeywordDao
;
import
com.pcloud.book.personalstage.dao.PersonalStageJumpLinkupDao
;
import
com.pcloud.book.personalstage.dao.PersonalStageProgressMessageDao
;
import
com.pcloud.book.personalstage.dao.PersonalStageReplyDao
;
import
com.pcloud.book.personalstage.dao.PersonalStageReplyItemDao
;
import
com.pcloud.book.personalstage.dao.PersonalStageUserDao
;
import
com.pcloud.book.personalstage.dao.PersonalStageWakeupDao
;
import
com.pcloud.book.personalstage.dto.FusingFinishDelayDTO
;
import
com.pcloud.book.personalstage.dto.PersonalStageDTO
;
import
com.pcloud.book.personalstage.dto.PersonalStageJumpKeywordDto
;
...
...
@@ -35,6 +43,9 @@ import com.pcloud.book.personalstage.utils.CacheUtils;
import
com.pcloud.book.personalstage.vo.request.AddScoreRequestVO
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.mq.DelayQueueDTO
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.page.PageBean
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.utils.DateUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
...
...
@@ -54,9 +65,6 @@ import org.apache.commons.collections.MapUtils;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.page.PageBean
;
import
com.pcloud.common.page.PageParam
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -64,9 +72,8 @@ import org.springframework.transaction.annotation.Transactional;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Random
;
import
java.util.stream.Collectors
;
...
...
@@ -108,6 +115,8 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
private
PersonalStageJumpLinkupDao
personalStageJumpLinkupDao
;
@Autowired
private
ResourceConsr
resourceConsr
;
@Autowired
private
CustomPlanModuleSuggestionMapper
customPlanModuleSuggestionMapper
;
@Value
(
"${wechat.group.link.prefix}"
)
private
String
wechatLinkPrefix
;
...
...
@@ -730,6 +739,14 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
//添加进度单回复延迟队列
personalStageJumpBiz
.
addProgressDelay
(
userWxId
,
robotId
,
ip
,
PersonalStageConstant
.
PERSONAL_STAGE_PROGRESS_3
);
}
if
(
content
.
indexOf
(
PersonalStageConstant
.
CUSTOM_PLAN
)
>
-
1
)
{
String
url
=
wechatLinkPrefix
+
"/personalCenter/madeProject?"
;
Integer
planId
=
customPlanModuleSuggestionMapper
.
getLatestPlanId
(
userWxId
);
if
(
null
!=
planId
)
{
String
longUrl
=
url
+
"planId="
+
planId
+
"&wxId="
+
userWxId
+
"&robotWxId="
+
robotId
;
content
=
content
.
replace
(
PersonalStageConstant
.
CUSTOM_PLAN
,
UrlUtils
.
getShortUrl4Own
(
longUrl
));
}
}
content
=
replaceUserSendContent
(
content
,
robotId
,
userWxId
);
content
=
replaceReadingStyle
(
content
,
robotId
,
userWxId
);
return
content
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/constant/PersonalStageConstant.java
View file @
f2fea78a
...
...
@@ -31,5 +31,9 @@ public class PersonalStageConstant {
* 需求定制单延迟
*/
public
static
final
String
PERSONALSTAGE_DELAY_PAPER
=
"PERSONALSTAGE_DELAY_PAPER"
;
//定制方案占位符
public
static
final
String
CUSTOM_PLAN
=
"${CUSTOM_PLAN}"
;
}
pcloud-service-book/src/main/resources/mapper/custom/CustomPlanMapper.xml
View file @
f2fea78a
...
...
@@ -17,12 +17,14 @@
<result
column=
"preview_qrcode_url"
jdbcType=
"VARCHAR"
property=
"previewQrcodeUrl"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"suggestion_count"
jdbcType=
"INTEGER"
property=
"suggestionCount"
/>
<result
column=
"confirm_feedback_reply"
jdbcType=
"VARCHAR"
property=
"confirmFeedbackReply"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, plan_number, plan_name, create_user_name, description, open_feedback, paper_id,
paper_title, paper_desc, use_state, pdf_url, h5_url, preview_qrcode_url, create_time,
update_time
update_time
, confirm_feedback_reply
</sql>
<insert
id=
"insert"
parameterType=
"CustomPlan"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
...
...
@@ -30,12 +32,12 @@
description, open_feedback, paper_id,
paper_title, paper_desc, use_state,
pdf_url, h5_url, preview_qrcode_url,
create_time, update_time)
create_time, update_time
, confirm_feedback_reply
)
values (#{planNumber,jdbcType=VARCHAR}, #{planName,jdbcType=VARCHAR}, #{createUserName,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{openFeedback,jdbcType=INTEGER}, #{paperId,jdbcType=INTEGER},
#{paperTitle,jdbcType=VARCHAR}, #{paperDesc,jdbcType=VARCHAR}, #{useState,jdbcType=INTEGER},
#{pdfUrl,jdbcType=VARCHAR}, #{h5Url,jdbcType=VARCHAR}, #{previewQrcodeUrl,jdbcType=VARCHAR},
NOW(), NOW())
NOW(), NOW()
, #{confirmFeedbackReply}
)
</insert>
<update
id=
"update"
parameterType=
"CustomPlan"
>
...
...
@@ -77,7 +79,7 @@
<if
test=
"previewQrcodeUrl != null"
>
preview_qrcode_url = #{previewQrcodeUrl,jdbcType=VARCHAR},
</if>
update_time = NOW(),
update_time = NOW(),
confirm_feedback_reply = #{confirmFeedbackReply}
</set>
where id = #{id,jdbcType=INTEGER}
</update>
...
...
@@ -111,8 +113,10 @@
<select
id=
"listCustomPlanByPage"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from custom_plan
a.id, plan_number, plan_name, create_user_name, description, open_feedback,
use_state, pdf_url, h5_url, preview_qrcode_url, a.create_time, COUNT(DISTINCT b.batch_id) suggestion_count
from custom_plan a left join custom_plan_module_suggestion b
on a.id = b.plan_id
where 1= 1
<if
test=
"content != null"
>
and (plan_number like concat('%', #{content}, '%')
...
...
@@ -122,6 +126,7 @@
<if
test=
"useState != null"
>
and use_state = #{useState}
</if>
GROUP BY a.id
ORDER BY update_time DESC
LIMIT #{pageNum}, #{numPerPage}
</select>
...
...
pcloud-service-book/src/main/resources/mapper/custom/CustomPlanModuleMapper.xml
View file @
f2fea78a
...
...
@@ -18,11 +18,12 @@
<result
column=
"merchant_name"
jdbcType=
"VARCHAR"
property=
"merchantName"
/>
<result
column=
"product_unique_number"
jdbcType=
"VARCHAR"
property=
"productUniqueNumber"
/>
<result
column=
"link_url"
jdbcType=
"VARCHAR"
property=
"linkUrl"
/>
<result
column=
"open_feedback"
jdbcType=
"INTEGER"
property=
"openFeedback"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, plan_id, parent_id, module_type, pic_url, type_name, title, content, skill_id, skill_cover,
app_id, agent_name, product_id, merchant_name, product_unique_number, link_url, create_time, update_time
app_id, agent_name, product_id, merchant_name, product_unique_number, link_url, create_time, update_time
, open_feedback
</sql>
<insert
id=
"insert"
parameterType=
"CustomPlanModule"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
...
...
@@ -30,12 +31,12 @@
type_name, title, content,
skill_id, skill_cover, app_id, agent_name,
product_id, merchant_name, product_unique_number, link_url, create_time,
update_time)
update_time
, open_feedback
)
values (#{planId,jdbcType=INTEGER}, #{parentId,jdbcType=INTEGER}, #{moduleType,jdbcType=INTEGER}, #{picUrl,jdbcType=VARCHAR},
#{typeName,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR},
#{skillId,jdbcType=INTEGER}, #{skillCover,jdbcType=VARCHAR}, #{appId,jdbcType=BIGINT}, #{agentName,jdbcType=VARCHAR},
#{productId,jdbcType=BIGINT}, #{merchantName,jdbcType=VARCHAR}, #{productUniqueNumber,jdbcType=VARCHAR}, #{linkUrl,jdbcType=VARCHAR},
NOW(), NOW())
NOW(), NOW()
, #{openFeedback}
)
</insert>
<update
id=
"update"
parameterType=
"CustomPlanModule"
>
...
...
pcloud-service-book/src/main/resources/mapper/custom/CustomPlanModuleSuggestionMapper.xml
0 → 100644
View file @
f2fea78a
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.pcloud.book.custom.mapper.CustomPlanModuleSuggestionMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.custom.entity.CustomPlanModuleSuggestion"
>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"batch_id"
jdbcType=
"INTEGER"
property=
"batchId"
/>
<result
column=
"wx_id"
jdbcType=
"VARCHAR"
property=
"wx_id"
/>
<result
column=
"plan_id"
jdbcType=
"INTEGER"
property=
"planId"
/>
<result
column=
"module_id"
jdbcType=
"INTEGER"
property=
"moduleId"
/>
<result
column=
"suggestion_level"
jdbcType=
"INTEGER"
property=
"suggestionLevel"
/>
<result
column=
"suggestion"
jdbcType=
"VARCHAR"
property=
"suggestion"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"planId"
/>
</resultMap>
<select
id=
"getSuggestionCount"
resultType=
"int"
>
SELECT
COUNT(DISTINCT batch_id)
FROM
custom_plan_module_suggestion a
LEFT JOIN custom_plan b ON a.plan_id = b.id
WHERE
plan_id = #{planId}
<if
test=
"startTime != null and endTime != null"
>
and a.create_time between #{startTime} and #{endTime}
</if>
<if
test=
"wxIdList != null"
>
and wx_id in
<foreach
collection=
"wxIdList"
open=
"("
close=
")"
separator=
","
item=
"item"
>
#{item}
</foreach>
</if>
</select>
<select
id=
"listSuggestion4Plan"
resultType=
"com.pcloud.book.custom.vo.SuggestionListVO"
>
SELECT
batch_id batchId,
wx_id wxId,
SUM(suggestion_level = 0) defaultCount,
SUM(suggestion_level = 1) goodCount,
SUM(suggestion_level = 2) badCount,
a.create_time createTime,
a.plan_id planId
FROM
custom_plan_module_suggestion a
LEFT JOIN custom_plan b ON a.plan_id = b.id
WHERE
plan_id = #{planId}
<if
test=
"startTime != null and endTime != null"
>
and a.create_time between #{startTime} and #{endTime}
</if>
<if
test=
"wxIdList != null"
>
and wx_id in
<foreach
collection=
"wxIdList"
open=
"("
close=
")"
separator=
","
item=
"item"
>
#{item}
</foreach>
</if>
GROUP BY batch_id
order by batchId desc
limit #{pageNum}, #{numPerPage}
</select>
<select
id=
"getSuggestionInfo"
resultType=
"com.pcloud.book.custom.vo.ModuleSuggestionVO"
>
SELECT
e.id moduleId,
e.module_type moduleType,
e.open_feedback openFeedback,
s.suggestion_level suggestionLevel,
s.suggestion
FROM
custom_plan_module e
LEFT JOIN (
SELECT
a.id,
suggestion_level,
suggestion
FROM
custom_plan_module a
LEFT JOIN custom_plan_module_suggestion b ON a.id = b.module_id
WHERE
batch_id = #{batchId}
) s ON e.id = s.id
WHERE
e.plan_id = #{planId}
</select>
<select
id=
"getMaxBatchId"
resultType=
"Integer"
>
select ifnull(max(batch_id), 0) from custom_plan_module_suggestion
</select>
<insert
id=
"batchInsert"
parameterType=
"com.pcloud.book.custom.entity.CustomPlanModuleSuggestion"
>
insert into custom_plan_module_suggestion(batch_id, wx_id, plan_id, module_Id, suggestion_Level, suggestion, create_time)
values
<foreach
collection=
"list"
separator=
","
item=
"item"
>
(#{item.batchId}, #{item.wxId}, #{item.planId}, #{item.moduleId}, #{item.suggestionLevel}, #{item.suggestion}, now())
</foreach>
</insert>
<insert
id=
"addCustomPlan4User"
parameterType=
"com.pcloud.book.custom.vo.AddCustomPlan4UserVO"
>
insert into custom_plan_user(wx_id, plan_id, create_time)
values (#{wxId}, #{planId}, now())
</insert>
<select
id=
"getLatestPlanId"
resultType=
"Integer"
>
select plan_id from custom_plan_user
where wx_id =#{wxId}
order by create_time desc
limit 1
</select>
</mapper>
\ No newline at end of file
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