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
bb956790
Commit
bb956790
authored
Feb 03, 2020
by
zhuyajie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
多条关键词回复
parent
4a4d9f5f
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
438 additions
and
219 deletions
+438
-219
BookGroupAppBizImpl.java
...a/com/pcloud/book/group/biz/impl/BookGroupAppBizImpl.java
+7
-7
BookGuideBizImpl.java
...a/com/pcloud/book/keywords/biz/impl/BookGuideBizImpl.java
+17
-35
BookKeywordBizImpl.java
...com/pcloud/book/keywords/biz/impl/BookKeywordBizImpl.java
+70
-25
SelfRobotKeywordBizImpl.java
...cloud/book/keywords/biz/impl/SelfRobotKeywordBizImpl.java
+91
-46
SelfRobotKeywordReplyDao.java
...om/pcloud/book/keywords/dao/SelfRobotKeywordReplyDao.java
+20
-0
SelfRobotKeywordReplyDaoImpl.java
.../book/keywords/dao/impl/SelfRobotKeywordReplyDaoImpl.java
+32
-0
SelfRobotKeyword.java
...ava/com/pcloud/book/keywords/entity/SelfRobotKeyword.java
+2
-56
SelfRobotKeywordReply.java
...om/pcloud/book/keywords/entity/SelfRobotKeywordReply.java
+86
-0
SelfRobotKeyword.xml
...book/src/main/resources/mapper/group/SelfRobotKeyword.xml
+8
-50
SelfRobotKeywordReply.xml
...src/main/resources/mapper/group/SelfRobotKeywordReply.xml
+105
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupAppBizImpl.java
View file @
bb956790
...
...
@@ -29,10 +29,7 @@ import com.pcloud.book.group.enums.AppAndProductTypeEnum;
import
com.pcloud.book.group.enums.BookGroupAppOriginTypeEnum
;
import
com.pcloud.book.keywords.dao.BookGuideDao
;
import
com.pcloud.book.keywords.dao.BookKeywordDao
;
import
com.pcloud.book.keywords.entity.BookGuide
;
import
com.pcloud.book.keywords.entity.BookGuideReply
;
import
com.pcloud.book.keywords.entity.BookKeyword
;
import
com.pcloud.book.keywords.entity.SelfRobotKeyword
;
import
com.pcloud.book.keywords.entity.*
;
import
com.pcloud.book.keywords.enums.ReplyTypeEnum
;
import
com.pcloud.book.push.dao.PushGroupDao
;
import
com.pcloud.book.push.entity.PushGroup
;
...
...
@@ -360,11 +357,13 @@ public class BookGroupAppBizImpl implements BookGroupAppBiz {
}
List
<
BookGroupApp
>
bookGroupApps
=
new
ArrayList
<>();
for
(
SelfRobotKeyword
selfRobotKeyword
:
selfRobotKeywords
)
{
if
(
ReplyTypeEnum
.
APP
.
value
.
equals
(
selfRobotKeyword
.
getType
()))
{
List
<
SelfRobotKeywordReply
>
replyList
=
selfRobotKeyword
.
getKeywordReplyList
();
for
(
SelfRobotKeywordReply
keywordReply
:
replyList
){
if
(
ReplyTypeEnum
.
APP
.
value
.
equals
(
keywordReply
.
getType
()))
{
BookGroupApp
bookGroupApp
=
new
BookGroupApp
();
bookGroupApp
.
setOriginType
(
BookGroupAppOriginTypeEnum
.
SELF_KEYWORD
.
code
);
bookGroupApp
.
setServeId
(
selfRobotKeyword
.
getServeId
());
bookGroupApp
.
setServeType
(
selfRobotKeyword
.
getServeType
());
bookGroupApp
.
setServeId
(
keywordReply
.
getServeId
());
bookGroupApp
.
setServeType
(
keywordReply
.
getServeType
());
bookGroupApp
.
setClassifyId
(
0L
);
bookGroupApp
.
setBookGroupId
(
selfRobotKeyword
.
getBookGroupId
());
bookGroupApp
.
setCreateUser
(
selfRobotKeyword
.
getCreateUser
());
...
...
@@ -376,6 +375,7 @@ public class BookGroupAppBizImpl implements BookGroupAppBiz {
bookGroupApps
.
add
(
bookGroupApp
);
}
}
}
if
(
ListUtils
.
isEmpty
(
bookGroupApps
))
{
return
;
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/BookGuideBizImpl.java
View file @
bb956790
...
...
@@ -25,18 +25,12 @@ import com.pcloud.book.group.tools.SendWeixinRequestTools;
import
com.pcloud.book.group.vo.GroupQrcodeBaseInfoVO
;
import
com.pcloud.book.keywords.biz.BookGuideBiz
;
import
com.pcloud.book.keywords.biz.BookKeywordBiz
;
import
com.pcloud.book.keywords.dao.BookGuideDao
;
import
com.pcloud.book.keywords.dao.BookGuideReplyDao
;
import
com.pcloud.book.keywords.dao.KeywordDao
;
import
com.pcloud.book.keywords.dao.SelfRobotKeywordDao
;
import
com.pcloud.book.keywords.dao.*
;
import
com.pcloud.book.keywords.dto.GuideDTO
;
import
com.pcloud.book.keywords.dto.KeywordDTO
;
import
com.pcloud.book.keywords.dto.KeywordStatusDTO
;
import
com.pcloud.book.keywords.dto.ReplyKeywordDTO
;
import
com.pcloud.book.keywords.entity.BookGuide
;
import
com.pcloud.book.keywords.entity.BookGuideReply
;
import
com.pcloud.book.keywords.entity.Keyword
;
import
com.pcloud.book.keywords.entity.SelfRobotKeyword
;
import
com.pcloud.book.keywords.entity.*
;
import
com.pcloud.book.keywords.enums.ReplyTypeEnum
;
import
com.pcloud.book.keywords.vo.GuideVO
;
import
com.pcloud.book.keywords.vo.ReplyMessageVO
;
...
...
@@ -125,6 +119,8 @@ public class BookGuideBizImpl implements BookGuideBiz {
@Value
(
"${system.env}"
)
private
String
envStr
;
@Autowired
private
SelfRobotKeywordReplyDao
selfRobotKeywordReplyDao
;
@ParamLog
(
"同意加好友发送欢迎语"
)
@Override
...
...
@@ -157,41 +153,18 @@ public class BookGuideBizImpl implements BookGuideBiz {
bookGroupCipherUser
.
setAltId
(
agreeAddUserDTO
.
getRobotWxId
());
//新增暗号对应记录
bookGroupCipherUserDao
.
insert
(
bookGroupCipherUser
);
/* SendTextMessageVO addFriendVo = new SendTextMessageVO();
addFriendVo.setContent(dto.getAddFriendGuide());
addFriendVo.setCode(SendMessageTypeEnum.SELF.getCode());
addFriendVo.setWxId(agreeAddUserDTO.getRobotWxId());
addFriendVo.setAltId(agreeAddUserDTO.getRobotWxId());
addFriendVo.setWxGroupId(agreeAddUserDTO.getUserWxId());
addFriendVo.setIp(agreeAddUserDTO.getIp());
WxGroupSDK.sendTextMessage(addFriendVo);
log.info("临时demo发送个人号加好友欢迎语信息"+addFriendVo.toString());*/
//好友引导语
sendFriendGuide
(
bookGroupId
,
agreeAddUserDTO
);
//回复关键词引导语
List
<
SelfRobotKeyword
>
selfRobotKeywords
=
selfRobotKeywordDao
.
getListByBookGroupId
(
bookGroupId
);
if
(!
ListUtils
.
isEmpty
(
selfRobotKeywords
)){
/* try {
String content="现在你试试回复我定制一套【背单词】读书计划【 】内关键词来唤醒我";
SendTextMessageVO voh = new SendTextMessageVO();
voh.setContent(content);
voh.setCode(SendMessageTypeEnum.SELF.getCode());
voh.setWxId(agreeAddUserDTO.getRobotWxId());
voh.setAltId(agreeAddUserDTO.getRobotWxId());
voh.setWxGroupId(agreeAddUserDTO.getUserWxId());
voh.setIp(agreeAddUserDTO.getIp());
WxGroupSDK.sendTextMessage(voh);
log.info("临时demo发送个人号加好友信息唤醒"+voh.toString());
Thread.sleep(5000);
} catch (InterruptedException e) {
log.error("发消息休眠5秒出错", e);
}*/
ThreadPoolUtils
.
SEND_MESSAGE_THREAD_POOL
.
execute
(()->{
for
(
SelfRobotKeyword
selfRobotKeyword:
selfRobotKeywords
){
try
{
if
(
"长江作业本"
.
equals
(
selfRobotKeyword
.
getKeyword
())){
Thread
.
sleep
(
1000
*
60
*
10
);
}
if
(!
StringUtil
.
isEmpty
(
selfRobotKeyword
.
getGuide
())){
SendTextMessageVO
vo
=
new
SendTextMessageVO
();
vo
.
setContent
(
selfRobotKeyword
.
getGuide
());
vo
.
setCode
(
SendMessageTypeEnum
.
SELF
.
getCode
());
...
...
@@ -200,6 +173,8 @@ public class BookGuideBizImpl implements BookGuideBiz {
vo
.
setWxGroupId
(
agreeAddUserDTO
.
getUserWxId
());
vo
.
setIp
(
agreeAddUserDTO
.
getIp
());
WxGroupSDK
.
sendTextMessage
(
vo
);
log
.
info
(
"临时demo发送个人号加好友信息"
+
vo
.
toString
());
}
if
(
"学前"
.
equals
(
selfRobotKeyword
.
getKeyword
())
&&
envStr
.
toUpperCase
().
equals
(
"PRO"
)&&
agreeAddUserDTO
.
getRobotWxId
().
equals
(
"wxid_x8i897ryabo722"
)){
SendGroupInviteVO
sendGroupInviteVO
=
new
SendGroupInviteVO
();
...
...
@@ -211,9 +186,15 @@ public class BookGuideBizImpl implements BookGuideBiz {
log
.
info
(
"临时发送入群连接 sendGroupInviteVO:{}"
,
sendGroupInviteVO
);
}
if
(
"教辅书单"
.
equals
(
selfRobotKeyword
.
getKeyword
())){
List
<
SelfRobotKeywordReply
>
replyList
=
selfRobotKeywordReplyDao
.
getListByKeywordId
(
selfRobotKeyword
.
getId
());
if
(
ListUtils
.
isEmpty
(
replyList
)){
continue
;
}
for
(
SelfRobotKeywordReply
keywordReply
:
replyList
){
if
(
ReplyTypeEnum
.
RESOURCE
.
value
.
equals
(
keywordReply
.
getType
())){
SendFileVO
sendFileVO
=
new
SendFileVO
();
Map
<
Long
,
ResourceDTO
>
map
=
resourceConsr
.
mapByIds
(
Arrays
.
asList
(
selfRobotKeyword
.
getResourceId
()));
ResourceDTO
resourceDTO
=
map
.
get
(
selfRobotKeyword
.
getResourceId
());
Map
<
Long
,
ResourceDTO
>
map
=
resourceConsr
.
mapByIds
(
Arrays
.
asList
(
keywordReply
.
getResourceId
()));
ResourceDTO
resourceDTO
=
map
.
get
(
keywordReply
.
getResourceId
());
if
(
resourceDTO
!=
null
)
{
sendFileVO
.
setFileUrl
(
resourceDTO
.
getFileUrl
());
sendFileVO
.
setFileName
(
resourceDTO
.
getResourceName
());
...
...
@@ -223,7 +204,8 @@ public class BookGuideBizImpl implements BookGuideBiz {
sendFileVO
.
setWxId
(
agreeAddUserDTO
.
getUserWxId
());
WxGroupSDK
.
sendFile
(
sendFileVO
);
}
log
.
info
(
"临时demo发送个人号加好友信息"
+
vo
.
toString
());
}
}
Thread
.
sleep
(
1000
*
40
);
}
catch
(
InterruptedException
e
)
{
log
.
error
(
"发消息休眠5秒出错"
,
e
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/BookKeywordBizImpl.java
View file @
bb956790
...
...
@@ -45,18 +45,12 @@ import com.pcloud.book.group.vo.ClassifyVO;
import
com.pcloud.book.group.vo.GroupQrcode4ClassifyVO
;
import
com.pcloud.book.group.vo.ListClassifyVO
;
import
com.pcloud.book.keywords.biz.BookKeywordBiz
;
import
com.pcloud.book.keywords.dao.BookKeywordDao
;
import
com.pcloud.book.keywords.dao.BookKeywordRecordDao
;
import
com.pcloud.book.keywords.dao.KeywordDao
;
import
com.pcloud.book.keywords.dao.SelfRobotKeywordDao
;
import
com.pcloud.book.keywords.dao.*
;
import
com.pcloud.book.keywords.dto.KeywordDTO
;
import
com.pcloud.book.keywords.dto.KeywordStatisticsDTO
;
import
com.pcloud.book.keywords.dto.ReplyKeywordDTO
;
import
com.pcloud.book.keywords.dto.ServiceResourceDTO
;
import
com.pcloud.book.keywords.entity.BookKeyword
;
import
com.pcloud.book.keywords.entity.BookKeywordRecord
;
import
com.pcloud.book.keywords.entity.Keyword
;
import
com.pcloud.book.keywords.entity.SelfRobotKeyword
;
import
com.pcloud.book.keywords.entity.*
;
import
com.pcloud.book.keywords.enums.ReplyTypeEnum
;
import
com.pcloud.book.keywords.vo.DeleteKeywordVO
;
import
com.pcloud.book.keywords.vo.KeywordVO
;
...
...
@@ -182,6 +176,8 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
private
ResourceConsr
resourceConsr
;
@Value
(
"${system.env}"
)
private
String
envStr
;
@Autowired
private
SelfRobotKeywordReplyDao
selfRobotKeywordReplyDao
;
/**
* 字符串切割长度
*/
...
...
@@ -609,10 +605,15 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
String
ip
=
sendTextDTO
.
getIp
();
Integer
code
=
sendTextDTO
.
getCode
();
String
robotId
=
sendTextDTO
.
getWxId
();
Integer
type
=
selfRobotKeyword
.
getType
();
List
<
SelfRobotKeywordReply
>
replyList
=
selfRobotKeywordReplyDao
.
getListByKeywordId
(
selfRobotKeyword
.
getId
());
if
(
ListUtils
.
isEmpty
(
replyList
)){
return
;
}
for
(
SelfRobotKeywordReply
keywordReply
:
replyList
){
Integer
type
=
keywordReply
.
getType
();
if
(
ReplyTypeEnum
.
TEXT
.
value
.
equals
(
type
))
{
SendTextMessageVO
sendTextMessageVO
=
new
SendTextMessageVO
();
sendTextMessageVO
.
setContent
(
selfRobotKeyword
.
getContent
());
sendTextMessageVO
.
setContent
(
keywordReply
.
getContent
());
sendTextMessageVO
.
setAltId
(
robotId
);
sendTextMessageVO
.
setWxGroupId
(
userWxId
);
sendTextMessageVO
.
setIp
(
ip
);
...
...
@@ -623,57 +624,96 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
SendPicMessageVO
sendPicMessageVO
=
new
SendPicMessageVO
();
sendPicMessageVO
.
setWxGroupId
(
userWxId
);
sendPicMessageVO
.
setAltId
(
robotId
);
sendPicMessageVO
.
setPicUrl
(
selfRobotKeyword
.
getPicUrl
());
sendPicMessageVO
.
setPicUrl
(
keywordReply
.
getPicUrl
());
sendPicMessageVO
.
setIp
(
ip
);
sendPicMessageVO
.
setCode
(
code
);
WxGroupSDK
.
sendPicMessage
(
sendPicMessageVO
);
}
if
(
ReplyTypeEnum
.
LINK
.
value
.
equals
(
type
))
{
SendTextMessageVO
sendTextMessageVO
=
new
SendTextMessageVO
();
String
content
=
selfRobotKeyword
.
getGuide
()
+
",点击这里进入:"
+
selfRobotKeyword
.
getLinkUrl
();
/* SendTextMessageVO sendTextMessageVO = new SendTextMessageVO();
String content;
if (!StringUtil.isEmpty(selfRobotKeyword.getGuide())){
content = selfRobotKeyword.getGuide() + ",点击这里进入:" + keywordReply.getLinkUrl();
}else {
content = "点击这里进入:" + keywordReply.getLinkUrl();
}
sendTextMessageVO.setContent(content);
sendTextMessageVO.setAltId(robotId);
sendTextMessageVO.setWxGroupId(userWxId);
sendTextMessageVO.setIp(ip);
sendTextMessageVO.setCode(code);
WxGroupSDK
.
sendTextMessage
(
sendTextMessageVO
);
WxGroupSDK.sendTextMessage(sendTextMessageVO);*/
SendArticleMessageVO
sendArticleMessageVO
=
new
SendArticleMessageVO
();
sendArticleMessageVO
.
setCode
(
code
);
sendArticleMessageVO
.
setAltId
(
robotId
);
sendArticleMessageVO
.
setDescription
(
keywordReply
.
getDescription
());
sendArticleMessageVO
.
setWxGroupId
(
userWxId
);
sendArticleMessageVO
.
setLinkUrl
(
keywordReply
.
getLinkUrl
());
sendArticleMessageVO
.
setPicUrl
(
keywordReply
.
getPicUrl
());
sendArticleMessageVO
.
setTitle
(
keywordReply
.
getContent
());
sendArticleMessageVO
.
setIp
(
ip
);
WxGroupSDK
.
sendArticleMessage
(
sendArticleMessageVO
);
}
if
(
ReplyTypeEnum
.
APP
.
value
.
equals
(
type
))
{
BookGroupDTO
bookGroupDTO
=
bookGroupDao
.
getDTOById
(
selfRobotKeyword
.
getBookGroupId
());
AccountSettingDto
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
bookGroupDTO
.
getChannelId
());
if
(
AppAndProductTypeEnum
.
APP
.
value
.
equals
(
selfRobotKeyword
.
getServeType
()))
{
AppDto
appDto
=
appConsr
.
getBaseById
(
selfRobotKeyword
.
getServeId
());
if
(
AppAndProductTypeEnum
.
APP
.
value
.
equals
(
keywordReply
.
getServeType
()))
{
AppDto
appDto
=
appConsr
.
getBaseById
(
keywordReply
.
getServeId
());
if
(
appDto
!=
null
)
{
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
appDto
.
getChannelId
());
}
}
// 处理链接地址
String
endUrl
=
selfRobotKeyword
.
getLinkUrl
()
+
"&book_group_id="
+
selfRobotKeyword
.
getBookGroupId
()
+
"&wxId="
+
userWxId
+
"&robotWxId="
+
robotId
;
String
endUrl
=
keywordReply
.
getLinkUrl
()
+
"&book_group_id="
+
selfRobotKeyword
.
getBookGroupId
()
+
"&wxId="
+
userWxId
+
"&robotWxId="
+
robotId
;
String
linkUrl
=
SendWeixinRequestTools
.
splitUrl
(
accountSettingDto
,
endUrl
);
String
resultUrl
=
UrlUtils
.
getShortUrl4Own
(
linkUrl
);
SendTextMessageVO
sendTextMessageVO
=
new
SendTextMessageVO
();
String
content
=
selfRobotKeyword
.
getGuide
()
+
",点击这里进入:"
+
resultUrl
;
/* SendTextMessageVO sendTextMessageVO = new SendTextMessageVO();
String content;
if (!StringUtil.isEmpty(selfRobotKeyword.getGuide())){
content = selfRobotKeyword.getGuide() + ",点击这里进入:" + resultUrl;
}else {
content = "点击这里进入:" + resultUrl;
}
sendTextMessageVO.setContent(content);
sendTextMessageVO.setAltId(robotId);
sendTextMessageVO.setWxGroupId(userWxId);
sendTextMessageVO.setIp(ip);
sendTextMessageVO.setCode(code);
WxGroupSDK
.
sendTextMessage
(
sendTextMessageVO
);
WxGroupSDK.sendTextMessage(sendTextMessageVO);*/
SendArticleMessageVO
sendArticleMessageVO
=
new
SendArticleMessageVO
();
sendArticleMessageVO
.
setCode
(
code
);
sendArticleMessageVO
.
setAltId
(
robotId
);
sendArticleMessageVO
.
setDescription
(
keywordReply
.
getDescription
());
sendArticleMessageVO
.
setWxGroupId
(
userWxId
);
sendArticleMessageVO
.
setLinkUrl
(
resultUrl
);
sendArticleMessageVO
.
setPicUrl
(
keywordReply
.
getPicUrl
());
sendArticleMessageVO
.
setTitle
(
keywordReply
.
getContent
());
sendArticleMessageVO
.
setIp
(
ip
);
WxGroupSDK
.
sendArticleMessage
(
sendArticleMessageVO
);
}
if
(
ReplyTypeEnum
.
RESOURCE
.
value
.
equals
(
type
))
{
SendFileVO
sendFileVO
=
new
SendFileVO
();
Map
<
Long
,
ResourceDTO
>
map
=
resourceConsr
.
mapByIds
(
Arrays
.
asList
(
selfRobotKeyword
.
getResourceId
()));
ResourceDTO
resourceDTO
=
map
.
get
(
selfRobotKeyword
.
getResourceId
());
Map
<
Long
,
ResourceDTO
>
map
=
resourceConsr
.
mapByIds
(
Arrays
.
asList
(
keywordReply
.
getResourceId
()));
ResourceDTO
resourceDTO
=
map
.
get
(
keywordReply
.
getResourceId
());
if
(
resourceDTO
!=
null
)
{
sendFileVO
.
setFileUrl
(
resourceDTO
.
getFileUrl
());
sendFileVO
.
setFileName
(
resourceDTO
.
getResourceName
());
String
fileName
=
resourceDTO
.
getResourceName
();
String
fileType
=
resourceDTO
.
getFileType
();
log
.
info
(
"fileName="
+
fileName
+
"+fileType+"
+
fileType
);
if
(
fileName
.
contains
(
fileType
)){
//去掉后缀
fileName
=
fileName
.
substring
(
0
,
fileName
.
indexOf
(
fileType
)-
1
);
}
log
.
info
(
"fileName="
+
fileName
);
sendFileVO
.
setFileName
(
fileName
);
}
sendFileVO
.
setIp
(
ip
);
sendFileVO
.
setAltId
(
robotId
);
sendFileVO
.
setWxId
(
userWxId
);
WxGroupSDK
.
sendFile
(
sendFileVO
);
}
}
}
@ParamLog
(
"获取的关键词是否为社群书的简称"
)
...
...
@@ -710,7 +750,12 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
SelfRobotKeyword
selfRobotKeyword
=
selfRobotKeywords
.
get
(
i
);
String
toAddIn
=
selfRobotKeyword
.
getGuide
()
+
",请回复“"
+
selfRobotKeyword
.
getKeyword
()
+
"”\n"
;
String
toAddIn
;
if
(!
StringUtil
.
isEmpty
(
selfRobotKeyword
.
getGuide
())){
toAddIn
=
selfRobotKeyword
.
getGuide
()
+
",请回复“"
+
selfRobotKeyword
.
getKeyword
()
+
"”\n"
;
}
else
{
toAddIn
=
"请回复“"
+
selfRobotKeyword
.
getKeyword
()
+
"”\n"
;
}
//最后一个
if
(
i
+
1
==
size
)
{
// 拼接反馈链接
...
...
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/SelfRobotKeywordBizImpl.java
View file @
bb956790
...
...
@@ -13,8 +13,10 @@ import com.pcloud.book.group.enums.AppAndProductTypeEnum;
import
com.pcloud.book.group.tools.SendWeixinRequestTools
;
import
com.pcloud.book.keywords.biz.SelfRobotKeywordBiz
;
import
com.pcloud.book.keywords.dao.SelfRobotKeywordDao
;
import
com.pcloud.book.keywords.dao.SelfRobotKeywordReplyDao
;
import
com.pcloud.book.keywords.dto.MaxSeqNAndBGDTO
;
import
com.pcloud.book.keywords.entity.SelfRobotKeyword
;
import
com.pcloud.book.keywords.entity.SelfRobotKeywordReply
;
import
com.pcloud.book.keywords.enums.ReplyTypeEnum
;
import
com.pcloud.channelcenter.wechat.dto.AccountSettingDto
;
import
com.pcloud.common.core.aspect.ParamLog
;
...
...
@@ -58,6 +60,8 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
private
ResourceConsr
resourceConsr
;
@Autowired
private
QrcodeSceneConsr
qrcodeSceneConsr
;
@Autowired
private
SelfRobotKeywordReplyDao
selfRobotKeywordReplyDao
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
@ParamLog
(
"批量新增个人号关键词"
)
...
...
@@ -88,20 +92,33 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
selfRobotKeyword
.
setSeqNum
(
maxSeqNum
+
1
);
maxSeqNum
=
maxSeqNum
+
1
;
maxSeqMap
.
put
(
bookGroupId
,
maxSeqNum
);
}
//新增
selfRobotKeywordDao
.
batchInsert
(
selfRobotKeywords
);
selfRobotKeywordDao
.
insert
(
selfRobotKeyword
);
Long
keywordId
=
selfRobotKeyword
.
getId
();
List
<
SelfRobotKeywordReply
>
replyList
=
selfRobotKeyword
.
getKeywordReplyList
();
replyList
.
forEach
(
selfRobotKeywordReply
->
{
selfRobotKeywordReply
.
setKeywordId
(
keywordId
);
selfRobotKeywordReply
.
setCreateUser
(
partyId
);
});
selfRobotKeywordReplyDao
.
insert
(
replyList
);
}
//将作品应用关键词加到社群书应用
bookGroupAppBiz
.
addSelfKeywordToBookGroupApp
(
selfRobotKeywords
);
Map
<
Long
,
List
<
SelfRobotKeyword
>>
listMap
=
selfRobotKeywords
.
stream
().
filter
(
s
->
AppAndProductTypeEnum
.
PRODUCT
.
value
.
equalsIgnoreCase
(
s
.
getServeType
())).
collect
(
Collectors
.
groupingBy
(
s
->
s
.
getBookGroupId
()));
for
(
Long
bookGroupId
:
bookGroupIds
)
{
List
<
SelfRobotKeyword
>
list
=
listMap
.
get
(
bookGroupId
);
if
(!
ListUtils
.
isEmpty
(
list
))
{
List
<
Long
>
productIds
=
list
.
stream
().
filter
(
s
->
s
.
getServeId
()
!=
null
).
map
(
SelfRobotKeyword:
:
getServeId
).
collect
(
Collectors
.
toList
());
List
<
SelfRobotKeyword
>
list
=
selfRobotKeywordDao
.
getListByBookGroupId
(
bookGroupId
);
for
(
SelfRobotKeyword
keyword
:
list
){
List
<
SelfRobotKeywordReply
>
replyList
=
selfRobotKeywordReplyDao
.
getListByKeywordId
(
keyword
.
getId
());
if
(!
ListUtils
.
isEmpty
(
replyList
))
{
List
<
SelfRobotKeywordReply
>
replyProductList
=
replyList
.
stream
().
filter
(
s
->
AppAndProductTypeEnum
.
PRODUCT
.
value
.
equalsIgnoreCase
(
s
.
getServeType
())).
collect
(
Collectors
.
toList
());
if
(
ListUtils
.
isEmpty
(
replyProductList
)){
continue
;
}
List
<
Long
>
productIds
=
replyProductList
.
stream
().
filter
(
s
->
s
.
getServeId
()
!=
null
).
map
(
SelfRobotKeywordReply:
:
getServeId
).
collect
(
Collectors
.
toList
());
//自动上架
productConsr
.
productAutoOnShelves
(
btcMap
.
get
(
bookGroupId
),
productIds
);
}
}
}
}
...
...
@@ -115,10 +132,19 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"未找到该社群书!"
);
}
selfRobotKeywordDao
.
updateSelfRobotKeyword
(
selfRobotKeyword
);
if
(
ReplyTypeEnum
.
APP
.
value
.
equals
(
selfRobotKeyword
.
getType
())
&&
AppAndProductTypeEnum
.
PRODUCT
.
value
.
equals
(
selfRobotKeyword
.
getServeType
()))
{
selfRobotKeywordReplyDao
.
deleteByKeywordId
(
selfRobotKeyword
.
getId
());
List
<
SelfRobotKeywordReply
>
replyList
=
selfRobotKeyword
.
getKeywordReplyList
();
replyList
.
forEach
(
selfRobotKeywordReply
->
{
selfRobotKeywordReply
.
setKeywordId
(
selfRobotKeyword
.
getId
());
selfRobotKeywordReply
.
setCreateUser
(
partyId
);
});
selfRobotKeywordReplyDao
.
insert
(
replyList
);
for
(
SelfRobotKeywordReply
selfRobotKeywordReply:
replyList
){
if
(
ReplyTypeEnum
.
APP
.
value
.
equals
(
selfRobotKeywordReply
.
getType
())
&&
AppAndProductTypeEnum
.
PRODUCT
.
value
.
equals
(
selfRobotKeywordReply
.
getServeType
()))
{
//上架
productConsr
.
productAutoOnShelves
(
dto
.
getChannelId
(),
Arrays
.
asList
(
selfRobotKeyword
.
getServeId
()));
productConsr
.
productAutoOnShelves
(
dto
.
getChannelId
(),
Arrays
.
asList
(
selfRobotKeywordReply
.
getServeId
()));
}
}
}
...
...
@@ -127,6 +153,7 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
@Override
public
void
deleteSelfRobotKeyword
(
Long
id
)
{
selfRobotKeywordDao
.
deleteById
(
id
);
selfRobotKeywordReplyDao
.
deleteByKeywordId
(
id
);
}
@ParamLog
(
"获取个人号关键词列表"
)
...
...
@@ -189,18 +216,24 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
List
<
Long
>
appIds
=
new
ArrayList
<>();
List
<
Long
>
productIds
=
new
ArrayList
<>();
List
<
Long
>
resourceIds
=
new
ArrayList
<>();
for
(
SelfRobotKeyword
selfRobotKeyword:
selfRobotKeywords
){
Integer
type
=
selfRobotKeyword
.
getType
();
for
(
SelfRobotKeyword
selfRobotKeyword
:
selfRobotKeywords
){
List
<
SelfRobotKeywordReply
>
replyList
=
selfRobotKeywordReplyDao
.
getListByKeywordId
(
selfRobotKeyword
.
getId
());
if
(
ListUtils
.
isEmpty
(
replyList
)){
continue
;
}
for
(
SelfRobotKeywordReply
keywordReply
:
replyList
){
Integer
type
=
keywordReply
.
getType
();
if
(
ReplyTypeEnum
.
APP
.
value
.
equals
(
type
)){
if
(
AppAndProductTypeEnum
.
APP
.
value
.
equals
(
selfRobotKeyword
.
getServeType
())){
appIds
.
add
(
selfRobotKeyword
.
getServeId
());
if
(
AppAndProductTypeEnum
.
APP
.
value
.
equals
(
keywordReply
.
getServeType
())){
appIds
.
add
(
keywordReply
.
getServeId
());
}
if
(
AppAndProductTypeEnum
.
PRODUCT
.
value
.
equals
(
selfRobotKeyword
.
getServeType
())){
productIds
.
add
(
selfRobotKeyword
.
getServeId
());
if
(
AppAndProductTypeEnum
.
PRODUCT
.
value
.
equals
(
keywordReply
.
getServeType
())){
productIds
.
add
(
keywordReply
.
getServeId
());
}
}
if
(
ReplyTypeEnum
.
RESOURCE
.
value
.
equals
(
type
)){
resourceIds
.
add
(
selfRobotKeyword
.
getResourceId
());
resourceIds
.
add
(
keywordReply
.
getResourceId
());
}
}
}
Map
<
Long
,
AppDto
>
appDtoMap
=
new
HashMap
<>();
...
...
@@ -216,43 +249,50 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
resourceDTOMap
=
resourceConsr
.
mapByIds
(
resourceIds
);
}
for
(
SelfRobotKeyword
selfRobotKeyword:
selfRobotKeywords
){
Integer
type
=
selfRobotKeyword
.
getType
();
List
<
SelfRobotKeywordReply
>
replyList
=
selfRobotKeywordReplyDao
.
getListByKeywordId
(
selfRobotKeyword
.
getId
());
if
(
ListUtils
.
isEmpty
(
replyList
)){
continue
;
}
for
(
SelfRobotKeywordReply
keywordReply
:
replyList
){
Integer
type
=
keywordReply
.
getType
();
if
(
ReplyTypeEnum
.
APP
.
value
.
equals
(
type
)){
Long
serveId
=
selfRobotKeyword
.
getServeId
();
if
(
AppAndProductTypeEnum
.
APP
.
value
.
equals
(
selfRobotKeyword
.
getServeType
())){
Long
serveId
=
keywordReply
.
getServeId
();
if
(
AppAndProductTypeEnum
.
APP
.
value
.
equals
(
keywordReply
.
getServeType
())){
AppDto
appDto
=
appDtoMap
.
get
(
serveId
);
if
(
appDto
!=
null
){
selfRobotKeyword
.
setServePic
(
appDto
.
getSquareImg
());
selfRobotKeyword
.
setServeName
(
appDto
.
getTitle
());
selfRobotKeyword
.
setServeTypeCode
(
appDto
.
getTypeCode
());
selfRobotKeyword
.
setServeTypeName
(
appDto
.
getTypeName
());
keywordReply
.
setServePic
(
appDto
.
getSquareImg
());
keywordReply
.
setServeName
(
appDto
.
getTitle
());
keywordReply
.
setServeTypeCode
(
appDto
.
getTypeCode
());
keywordReply
.
setServeTypeName
(
appDto
.
getTypeName
());
}
}
if
(
AppAndProductTypeEnum
.
PRODUCT
.
value
.
equals
(
selfRobotKeyword
.
getServeType
())){
if
(
AppAndProductTypeEnum
.
PRODUCT
.
value
.
equals
(
keywordReply
.
getServeType
())){
ProductDto
productDto
=
productDtoMap
.
get
(
serveId
);
if
(
productDto
!=
null
){
selfRobotKeyword
.
setServePic
(
productDto
.
getCoverImg
());
selfRobotKeyword
.
setServeName
(
productDto
.
getProductName
());
keywordReply
.
setServePic
(
productDto
.
getCoverImg
());
keywordReply
.
setServeName
(
productDto
.
getProductName
());
ProductTypeDto
productTypeDto
=
productDto
.
getProductTypeDto
();
if
(
productTypeDto
!=
null
){
selfRobotKeyword
.
setServeTypeCode
(
productTypeDto
.
getTypeCode
());
selfRobotKeyword
.
setServeTypeName
(
productTypeDto
.
getTypeName
());
keywordReply
.
setServeTypeCode
(
productTypeDto
.
getTypeCode
());
keywordReply
.
setServeTypeName
(
productTypeDto
.
getTypeName
());
}
}
}
}
if
(
ReplyTypeEnum
.
RESOURCE
.
value
.
equals
(
type
)){
ResourceDTO
resourceDTO
=
resourceDTOMap
.
get
(
selfRobotKeyword
.
getResourceId
());
ResourceDTO
resourceDTO
=
resourceDTOMap
.
get
(
keywordReply
.
getResourceId
());
if
(
resourceDTO
!=
null
){
selfRobotKeyword
.
setResourceName
(
resourceDTO
.
getResourceName
());
selfRobotKeyword
.
setResourceUrl
(
resourceDTO
.
getFileUrl
());
selfRobotKeyword
.
setResourceTypeCode
(
resourceDTO
.
getTypeCode
());
selfRobotKeyword
.
setResourceTypeName
(
resourceDTO
.
getTypeName
());
selfRobotKeyword
.
setFileType
(
resourceDTO
.
getFileType
());
selfRobotKeyword
.
setResourcePdfItems
(
resourceDTO
.
getResourcePdfItems
());
selfRobotKeyword
.
setResourceOfficeItemDTOs
(
resourceDTO
.
getResourceOfficeItemDTOs
());
keywordReply
.
setResourceName
(
resourceDTO
.
getResourceName
());
keywordReply
.
setResourceUrl
(
resourceDTO
.
getFileUrl
());
keywordReply
.
setResourceTypeCode
(
resourceDTO
.
getTypeCode
());
keywordReply
.
setResourceTypeName
(
resourceDTO
.
getTypeName
());
keywordReply
.
setFileType
(
resourceDTO
.
getFileType
());
keywordReply
.
setResourcePdfItems
(
resourceDTO
.
getResourcePdfItems
());
keywordReply
.
setResourceOfficeItemDTOs
(
resourceDTO
.
getResourceOfficeItemDTOs
());
}
}
}
selfRobotKeyword
.
setKeywordReplyList
(
replyList
);
}
}
...
...
@@ -310,30 +350,35 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
if
(
selfRobotKeyword
.
getBookGroupId
()
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"社群码id不能为空!"
);
}
if
(
selfRobotKeyword
.
getType
()
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"
类型
不能为空!"
);
if
(
ListUtils
.
isEmpty
(
selfRobotKeyword
.
getKeywordReplyList
())
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"
回复
不能为空!"
);
}
if
(
StringUtil
.
isEmpty
(
selfRobotKeyword
.
getGuide
()))
{
/*
if (StringUtil.isEmpty(selfRobotKeyword.getGuide())) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "引导语不能为空!");
}
}
*/
if
(
StringUtil
.
isEmpty
(
selfRobotKeyword
.
getKeyword
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"关键词不能为空!"
);
}
Integer
type
=
selfRobotKeyword
.
getType
();
if
(
ReplyTypeEnum
.
TEXT
.
value
.
equals
(
type
)
&&
StringUtil
.
isEmpty
(
selfRobotKeyword
.
getContent
()))
{
for
(
SelfRobotKeywordReply
selfRobotKeywordReply:
selfRobotKeyword
.
getKeywordReplyList
()){
if
(
null
==
selfRobotKeywordReply
.
getType
()){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"回复类型不能为空!"
);
}
Integer
type
=
selfRobotKeywordReply
.
getType
();
if
(
ReplyTypeEnum
.
TEXT
.
value
.
equals
(
type
)
&&
StringUtil
.
isEmpty
(
selfRobotKeywordReply
.
getContent
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"内容不能为空!"
);
}
if
(
ReplyTypeEnum
.
IMAGE
.
value
.
equals
(
type
)
&&
StringUtil
.
isEmpty
(
selfRobotKeyword
.
getPicUrl
()))
{
if
(
ReplyTypeEnum
.
IMAGE
.
value
.
equals
(
type
)
&&
StringUtil
.
isEmpty
(
selfRobotKeywordReply
.
getPicUrl
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"图片地址不能为空!"
);
}
if
(
ReplyTypeEnum
.
LINK
.
value
.
equals
(
type
)
&&
StringUtil
.
isEmpty
(
selfRobotKeyword
.
getLinkUrl
()))
{
if
(
ReplyTypeEnum
.
LINK
.
value
.
equals
(
type
)
&&
StringUtil
.
isEmpty
(
selfRobotKeywordReply
.
getLinkUrl
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"链接地址不能为空!"
);
}
if
(
ReplyTypeEnum
.
APP
.
value
.
equals
(
type
)
&&
(
StringUtil
.
isEmpty
(
selfRobotKeyword
.
getServeType
())
||
selfRobotKeyword
.
getServeId
()
==
null
))
{
if
(
ReplyTypeEnum
.
APP
.
value
.
equals
(
type
)
&&
(
StringUtil
.
isEmpty
(
selfRobotKeywordReply
.
getServeType
())
||
selfRobotKeywordReply
.
getServeId
()
==
null
))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"应用或作品id和类型不能为空!"
);
}
if
(
ReplyTypeEnum
.
RESOURCE
.
value
.
equals
(
type
)
&&
selfRobotKeyword
.
getResourceId
()
==
null
)
{
if
(
ReplyTypeEnum
.
RESOURCE
.
value
.
equals
(
type
)
&&
selfRobotKeywordReply
.
getResourceId
()
==
null
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"资源id和连接不能为空!"
);
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/keywords/dao/SelfRobotKeywordReplyDao.java
0 → 100644
View file @
bb956790
package
com
.
pcloud
.
book
.
keywords
.
dao
;
import
com.pcloud.book.keywords.dto.MaxSeqNAndBGDTO
;
import
com.pcloud.book.keywords.entity.SelfRobotKeyword
;
import
com.pcloud.book.keywords.entity.SelfRobotKeywordReply
;
import
com.pcloud.common.core.dao.BaseDao
;
import
java.util.List
;
/**
* @Description
* @Author zhuyajie
* @Date 2020/02/03 11:39
**/
public
interface
SelfRobotKeywordReplyDao
extends
BaseDao
<
SelfRobotKeywordReply
>
{
void
deleteByKeywordId
(
Long
keywordId
);
List
<
SelfRobotKeywordReply
>
getListByKeywordId
(
Long
keywordId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/keywords/dao/impl/SelfRobotKeywordReplyDaoImpl.java
0 → 100644
View file @
bb956790
package
com
.
pcloud
.
book
.
keywords
.
dao
.
impl
;
import
com.pcloud.book.keywords.dao.SelfRobotKeywordDao
;
import
com.pcloud.book.keywords.dao.SelfRobotKeywordReplyDao
;
import
com.pcloud.book.keywords.dto.MaxSeqNAndBGDTO
;
import
com.pcloud.book.keywords.entity.SelfRobotKeyword
;
import
com.pcloud.book.keywords.entity.SelfRobotKeywordReply
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Component
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @Description
* @Author zhuyajie
* @Date 2020/02/03 11:39
**/
@Component
(
"selfRobotKeywordReplyDao"
)
public
class
SelfRobotKeywordReplyDaoImpl
extends
BaseDaoImpl
<
SelfRobotKeywordReply
>
implements
SelfRobotKeywordReplyDao
{
@Override
public
void
deleteByKeywordId
(
Long
keywordId
)
{
getSessionTemplate
().
delete
(
getStatement
(
"deleteByKeywordId"
),
keywordId
);
}
@Override
public
List
<
SelfRobotKeywordReply
>
getListByKeywordId
(
Long
keywordId
)
{
return
getSessionTemplate
().
selectList
(
getStatement
(
"getListByKeywordId"
),
keywordId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/keywords/entity/SelfRobotKeyword.java
View file @
bb956790
...
...
@@ -27,66 +27,12 @@ public class SelfRobotKeyword extends BaseEntity {
@ApiModelProperty
(
"关键词"
)
private
String
keyword
;
@ApiModelProperty
(
"类型 1 文字 2 图片 3 链接 4应用 5素材"
)
private
Integer
type
;
@ApiModelProperty
(
"内容"
)
private
String
content
;
@ApiModelProperty
(
"描述"
)
private
String
description
;
@ApiModelProperty
(
"链接地址"
)
private
String
linkUrl
;
@ApiModelProperty
(
"图片地址"
)
private
String
picUrl
;
@ApiModelProperty
(
"应用或作品id"
)
private
Long
serveId
;
@ApiModelProperty
(
"应用或作品类型"
)
private
String
serveType
;
@ApiModelProperty
(
"资源id"
)
private
Long
resourceId
;
@ApiModelProperty
(
"排序值"
)
private
Integer
seqNum
;
@ApiModelProperty
(
"创建人"
)
private
Long
createUser
;
@ApiModelProperty
(
"应用或作品图片"
)
private
String
servePic
;
@ApiModelProperty
(
"应用或作品名称"
)
private
String
serveName
;
@ApiModelProperty
(
"应用或作品类型名称"
)
private
String
serveTypeName
;
@ApiModelProperty
(
"应用或作品类型编码"
)
private
String
serveTypeCode
;
@ApiModelProperty
(
"资源链接"
)
private
String
resourceUrl
;
@ApiModelProperty
(
"资源名称"
)
private
String
resourceName
;
@ApiModelProperty
(
"资源类型编码"
)
private
String
resourceTypeCode
;
@ApiModelProperty
(
"资源类型名称"
)
private
String
resourceTypeName
;
@ApiModelProperty
(
"文件类型"
)
private
String
fileType
;
@ApiModelProperty
(
"pdf转码后的单张图片集合"
)
private
List
<
ResourcePdfItemDTO
>
resourcePdfItems
;
@ApiModelProperty
(
"文件转码后的单张图片集合"
)
private
List
<
ResourceOfficeItemDTO
>
resourceOfficeItemDTOs
;
@ApiModelProperty
(
"关键词回复列表"
)
private
List
<
SelfRobotKeywordReply
>
keywordReplyList
;
}
pcloud-service-book/src/main/java/com/pcloud/book/keywords/entity/SelfRobotKeywordReply.java
0 → 100644
View file @
bb956790
package
com
.
pcloud
.
book
.
keywords
.
entity
;
import
com.pcloud.common.entity.BaseEntity
;
import
com.pcloud.contentcenter.resource.dto.ResourceOfficeItemDTO
;
import
com.pcloud.contentcenter.resource.dto.ResourcePdfItemDTO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* @Description
* @Author zhuyajie
* @Date 2020/02/03 11:39
**/
@Data
@ApiModel
(
"个人号关键词回复"
)
public
class
SelfRobotKeywordReply
extends
BaseEntity
{
@ApiModelProperty
(
"关键词id"
)
private
Long
keywordId
;
@ApiModelProperty
(
"类型 1 文字 2 图片 3 链接 4应用 5素材"
)
private
Integer
type
;
@ApiModelProperty
(
"内容"
)
private
String
content
;
@ApiModelProperty
(
"描述"
)
private
String
description
;
@ApiModelProperty
(
"链接地址"
)
private
String
linkUrl
;
@ApiModelProperty
(
"图片地址"
)
private
String
picUrl
;
@ApiModelProperty
(
"应用或作品id"
)
private
Long
serveId
;
@ApiModelProperty
(
"应用或作品类型"
)
private
String
serveType
;
@ApiModelProperty
(
"资源id"
)
private
Long
resourceId
;
@ApiModelProperty
(
"排序值"
)
private
Integer
seqNum
;
@ApiModelProperty
(
"创建人"
)
private
Long
createUser
;
@ApiModelProperty
(
"应用或作品图片"
)
private
String
servePic
;
@ApiModelProperty
(
"应用或作品名称"
)
private
String
serveName
;
@ApiModelProperty
(
"应用或作品类型名称"
)
private
String
serveTypeName
;
@ApiModelProperty
(
"应用或作品类型编码"
)
private
String
serveTypeCode
;
@ApiModelProperty
(
"资源链接"
)
private
String
resourceUrl
;
@ApiModelProperty
(
"资源名称"
)
private
String
resourceName
;
@ApiModelProperty
(
"资源类型编码"
)
private
String
resourceTypeCode
;
@ApiModelProperty
(
"资源类型名称"
)
private
String
resourceTypeName
;
@ApiModelProperty
(
"文件类型"
)
private
String
fileType
;
@ApiModelProperty
(
"pdf转码后的单张图片集合"
)
private
List
<
ResourcePdfItemDTO
>
resourcePdfItems
;
@ApiModelProperty
(
"文件转码后的单张图片集合"
)
private
List
<
ResourceOfficeItemDTO
>
resourceOfficeItemDTOs
;
}
pcloud-service-book/src/main/resources/mapper/group/SelfRobotKeyword.xml
View file @
bb956790
...
...
@@ -6,14 +6,6 @@
<result
column=
"book_group_id"
property=
"bookGroupId"
jdbcType=
"BIGINT"
/>
<result
column=
"guide"
property=
"guide"
jdbcType=
"VARCHAR"
/>
<result
column=
"keyword"
property=
"keyword"
jdbcType=
"VARCHAR"
/>
<result
column=
"type"
property=
"type"
jdbcType=
"INTEGER"
/>
<result
column=
"content"
property=
"content"
jdbcType=
"VARCHAR"
/>
<result
column=
"description"
property=
"description"
jdbcType=
"VARCHAR"
/>
<result
column=
"link_url"
property=
"linkUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"pic_url"
property=
"picUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"serve_id"
property=
"serveId"
jdbcType=
"BIGINT"
/>
<result
column=
"serve_type"
property=
"serveType"
jdbcType=
"VARCHAR"
/>
<result
column=
"resource_id"
property=
"resourceId"
jdbcType=
"BIGINT"
/>
<result
column=
"seq_num"
property=
"seqNum"
jdbcType=
"INTEGER"
/>
<result
column=
"create_user"
property=
"createUser"
jdbcType=
"BIGINT"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
...
...
@@ -21,8 +13,7 @@
<sql
id=
"Base_Column_List"
>
id, book_group_id, guide, keyword, type, content, description, link_url, pic_url, serve_id,
serve_type, resource_id,seq_num,create_user, create_time
id, book_group_id, guide, keyword, seq_num, create_user, create_time
</sql>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.keywords.entity.SelfRobotKeyword"
useGeneratedKeys=
"true"
...
...
@@ -32,14 +23,6 @@
book_group_id,
guide,
keyword,
type,
content,
description,
link_url,
pic_url,
serve_id,
serve_type,
resource_id,
seq_num,
create_user,
create_time
...
...
@@ -48,14 +31,6 @@
#{bookGroupId,jdbcType=BIGINT},
#{guide,jdbcType=VARCHAR},
#{keyword,jdbcType=VARCHAR},
#{type,jdbcType=INTEGER},
#{content,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR},
#{linkUrl,jdbcType=VARCHAR},
#{picUrl,jdbcType=VARCHAR},
#{serveId,jdbcType=BIGINT},
#{serveType,jdbcType=VARCHAR},
#{resourceId,jdbcType=BIGINT},
#{seqNum,jdbcType=INTEGER},
#{createUser,jdbcType=BIGINT},
NOW()
...
...
@@ -68,14 +43,6 @@
book_group_id,
guide,
keyword,
type,
content,
description,
link_url,
pic_url,
serve_id,
serve_type,
resource_id,
seq_num,
create_user,
create_time
...
...
@@ -85,14 +52,6 @@
#{item.bookGroupId,jdbcType=BIGINT},
#{item.guide,jdbcType=VARCHAR},
#{item.keyword,jdbcType=VARCHAR},
#{item.type,jdbcType=INTEGER},
#{item.content,jdbcType=VARCHAR},
#{item.description,jdbcType=VARCHAR},
#{item.linkUrl,jdbcType=VARCHAR},
#{item.picUrl,jdbcType=VARCHAR},
#{item.serveId,jdbcType=BIGINT},
#{item.serveType,jdbcType=VARCHAR},
#{item.resourceId,jdbcType=BIGINT},
#{item.seqNum,jdbcType=INTEGER},
#{item.createUser,jdbcType=BIGINT},
NOW()
...
...
@@ -106,14 +65,6 @@
book_group_id = #{bookGroupId,jdbcType=BIGINT},
guide = #{guide,jdbcType=VARCHAR},
keyword = #{keyword,jdbcType=VARCHAR},
type = #{type,jdbcType=INTEGER},
content = #{content,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
link_url = #{linkUrl,jdbcType=VARCHAR},
pic_url = #{picUrl,jdbcType=VARCHAR},
serve_id = #{serveId,jdbcType=BIGINT},
serve_type = #{serveType,jdbcType=VARCHAR},
resource_id = #{resourceId,jdbcType=BIGINT},
seq_num = #{seqNum,jdbcType=INTEGER}
</set>
where id = #{id,jdbcType=BIGINT}
...
...
@@ -203,4 +154,10 @@
${item}
</foreach>
</select>
<select
id=
"getById"
parameterType=
"long"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from self_robot_keyword
where id=#{id}
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/group/SelfRobotKeywordReply.xml
0 → 100644
View file @
bb956790
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.pcloud.book.keywords.dao.impl.SelfRobotKeywordReplyDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.keywords.entity.SelfRobotKeywordReply"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"keyword_id"
property=
"keywordId"
jdbcType=
"BIGINT"
/>
<result
column=
"type"
property=
"type"
jdbcType=
"INTEGER"
/>
<result
column=
"content"
property=
"content"
jdbcType=
"VARCHAR"
/>
<result
column=
"description"
property=
"description"
jdbcType=
"VARCHAR"
/>
<result
column=
"link_url"
property=
"linkUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"pic_url"
property=
"picUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"serve_id"
property=
"serveId"
jdbcType=
"BIGINT"
/>
<result
column=
"serve_type"
property=
"serveType"
jdbcType=
"VARCHAR"
/>
<result
column=
"resource_id"
property=
"resourceId"
jdbcType=
"BIGINT"
/>
<result
column=
"seq_num"
property=
"seqNum"
jdbcType=
"INTEGER"
/>
<result
column=
"create_user"
property=
"createUser"
jdbcType=
"BIGINT"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, keyword_id, type, content, description, link_url, pic_url, serve_id,
serve_type, resource_id, seq_num, create_user, create_time
</sql>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.keywords.entity.SelfRobotKeywordReply"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into self_robot_keyword_reply
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
keyword_id,
type,
content,
description,
link_url,
pic_url,
serve_id,
serve_type,
resource_id,
seq_num,
create_user,
create_time
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
#{keywordId,jdbcType=BIGINT},
#{type,jdbcType=INTEGER},
#{content,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR},
#{linkUrl,jdbcType=VARCHAR},
#{picUrl,jdbcType=VARCHAR},
#{serveId,jdbcType=BIGINT},
#{serveType,jdbcType=VARCHAR},
#{resourceId,jdbcType=BIGINT},
#{seqNum,jdbcType=INTEGER},
#{createUser,jdbcType=BIGINT},
NOW()
</trim>
</insert>
<!--批量插入-->
<insert
id=
"batchInsert"
parameterType=
"com.pcloud.book.keywords.entity.SelfRobotKeywordReply"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into self_robot_keyword_reply (
keyword_id,
type,
content,
description,
link_url,
pic_url,
serve_id,
serve_type,
resource_id,
seq_num,
create_user,
create_time
) values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.keywordId,jdbcType=BIGINT},
#{item.type,jdbcType=INTEGER},
#{item.content,jdbcType=VARCHAR},
#{item.description,jdbcType=VARCHAR},
#{item.linkUrl,jdbcType=VARCHAR},
#{item.picUrl,jdbcType=VARCHAR},
#{item.serveId,jdbcType=BIGINT},
#{item.serveType,jdbcType=VARCHAR},
#{item.resourceId,jdbcType=BIGINT},
#{item.seqNum,jdbcType=INTEGER},
#{item.createUser,jdbcType=BIGINT},
NOW()
)
</foreach>
</insert>
<delete
id=
"deleteByKeywordId"
parameterType=
"map"
>
delete from self_robot_keyword_reply
where keyword_id = #{keywordId}
</delete>
<select
id=
"getListByKeywordId"
parameterType=
"long"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from self_robot_keyword_reply
where keyword_id = #{keywordId}
order by seq_num, id
</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