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
da97c757
Commit
da97c757
authored
Feb 16, 2020
by
阮思源
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat-1002348' into 'master'
关联7个分类 See merge request rays/pcloud-book!422
parents
a02d31b7
bea8e465
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
618 additions
and
78 deletions
+618
-78
Create4ClassifyVO.java
...main/java/com/pcloud/book/guide/vo/Create4ClassifyVO.java
+14
-0
RobotSilenceVO.java
...rc/main/java/com/pcloud/book/guide/vo/RobotSilenceVO.java
+1
-1
PcloudGuideBiz.java
...c/main/java/com/pcloud/book/guide/biz/PcloudGuideBiz.java
+3
-1
PcloudGuideBizImpl.java
...va/com/pcloud/book/guide/biz/impl/PcloudGuideBizImpl.java
+49
-9
PcloudGuide.java
...c/main/java/com/pcloud/book/guide/entity/PcloudGuide.java
+3
-0
PcloudRobotSilence.java
...java/com/pcloud/book/guide/entity/PcloudRobotSilence.java
+11
-0
PcloudGuideFacadeImpl.java
.../pcloud/book/guide/facade/impl/PcloudGuideFacadeImpl.java
+22
-2
PcloudGuideMapper.java
.../java/com/pcloud/book/guide/mapper/PcloudGuideMapper.java
+6
-3
PcloudRobotSilenceMapper.java
...om/pcloud/book/guide/mapper/PcloudRobotSilenceMapper.java
+6
-2
PcloudGuideSilenceRunnerImpl.java
...cloud/book/guide/runner/PcloudGuideSilenceRunnerImpl.java
+8
-4
BookGuideBizImpl.java
...a/com/pcloud/book/keywords/biz/impl/BookGuideBizImpl.java
+1
-1
BookKeywordBizImpl.java
...com/pcloud/book/keywords/biz/impl/BookKeywordBizImpl.java
+16
-2
WxGroupSendNotTextListener.java
.../com/pcloud/book/mq/topic/WxGroupSendNotTextListener.java
+11
-1
PcloudKeywordClassifyBiz.java
...loud/book/pcloudkeyword/biz/PcloudKeywordClassifyBiz.java
+7
-0
PcloudRobotBiz.java
...ava/com/pcloud/book/pcloudkeyword/biz/PcloudRobotBiz.java
+3
-1
PcloudRobotClassifyBiz.java
...pcloud/book/pcloudkeyword/biz/PcloudRobotClassifyBiz.java
+21
-0
PcloudKeywordClassifyBizImpl.java
.../pcloudkeyword/biz/impl/PcloudKeywordClassifyBizImpl.java
+16
-0
PcloudRobotBizImpl.java
...cloud/book/pcloudkeyword/biz/impl/PcloudRobotBizImpl.java
+0
-0
PcloudRobotClassifyBizImpl.java
...ok/pcloudkeyword/biz/impl/PcloudRobotClassifyBizImpl.java
+65
-0
PcloudRobotClassifyDao.java
...pcloud/book/pcloudkeyword/dao/PcloudRobotClassifyDao.java
+3
-0
PcloudRobotDao.java
...ava/com/pcloud/book/pcloudkeyword/dao/PcloudRobotDao.java
+2
-0
PcloudRobotWelcomeDao.java
.../pcloud/book/pcloudkeyword/dao/PcloudRobotWelcomeDao.java
+4
-0
PcloudRobotClassifyDaoImpl.java
...ok/pcloudkeyword/dao/impl/PcloudRobotClassifyDaoImpl.java
+18
-0
PcloudRobotDaoImpl.java
...cloud/book/pcloudkeyword/dao/impl/PcloudRobotDaoImpl.java
+7
-3
PcloudRobotWelcomeDaoImpl.java
...ook/pcloudkeyword/dao/impl/PcloudRobotWelcomeDaoImpl.java
+10
-0
ClassifyWelcomeDTO.java
...com/pcloud/book/pcloudkeyword/dto/ClassifyWelcomeDTO.java
+22
-0
PcloudRobotClassify.java
...pcloud/book/pcloudkeyword/entity/PcloudRobotClassify.java
+9
-13
PcloudRobotWelcome.java
.../pcloud/book/pcloudkeyword/entity/PcloudRobotWelcome.java
+3
-0
PcloudKeywordFacade.java
...pcloud/book/pcloudkeyword/facade/PcloudKeywordFacade.java
+8
-0
PcloudRobotClassifyFacade.java
.../book/pcloudkeyword/facade/PcloudRobotClassifyFacade.java
+47
-6
PcloudRobotFacade.java
...m/pcloud/book/pcloudkeyword/facade/PcloudRobotFacade.java
+14
-1
PcloudRobotClassifyResponseVO.java
...eyword/facade/response/PcloudRobotClassifyResponseVO.java
+8
-0
PcloudRobotSet.java
...ava/com/pcloud/book/pcloudkeyword/set/PcloudRobotSet.java
+57
-0
SelfPushBizImpl.java
...n/java/com/pcloud/book/push/biz/impl/SelfPushBizImpl.java
+3
-3
PcloudGuideMapper.xml
...ook/src/main/resources/mapper/guide/PcloudGuideMapper.xml
+27
-5
PcloudRobotSilenceMapper.xml
.../main/resources/mapper/guide/PcloudRobotSilenceMapper.xml
+24
-8
PcloudRobot.Mapper.xml
...ain/resources/mapper/pcloudkeyword/PcloudRobot.Mapper.xml
+17
-6
PcloudRobotClassify.Mapper.xml
...urces/mapper/pcloudkeyword/PcloudRobotClassify.Mapper.xml
+56
-5
PcloudRobotWelcome.Mapper.xml
...ources/mapper/pcloudkeyword/PcloudRobotWelcome.Mapper.xml
+16
-1
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/guide/vo/Create4ClassifyVO.java
0 → 100644
View file @
da97c757
package
com
.
pcloud
.
book
.
guide
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
@Data
public
class
Create4ClassifyVO
implements
Serializable
{
private
Integer
pcloudClassifyId
;
private
List
<
Integer
>
pcloudGuideIds
;
}
pcloud-facade-book/src/main/java/com/pcloud/book/guide/vo/RobotSilenceVO.java
View file @
da97c757
...
@@ -9,5 +9,5 @@ public class RobotSilenceVO {
...
@@ -9,5 +9,5 @@ public class RobotSilenceVO {
private
Integer
silenceDuration
;
private
Integer
silenceDuration
;
private
Integer
pcloudClassifyId
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/guide/biz/PcloudGuideBiz.java
View file @
da97c757
...
@@ -13,7 +13,7 @@ public interface PcloudGuideBiz {
...
@@ -13,7 +13,7 @@ public interface PcloudGuideBiz {
PcloudGuideVO
getPcloudGuide
(
Integer
pcloudGuideId
);
PcloudGuideVO
getPcloudGuide
(
Integer
pcloudGuideId
);
PageBeanNew
<
PcloudGuideVO
>
listPcloudGuide
(
Integer
currentPage
,
Integer
numPerPage
,
String
robotWxId
,
String
search
);
PageBeanNew
<
PcloudGuideVO
>
listPcloudGuide
(
Integer
currentPage
,
Integer
numPerPage
,
String
robotWxId
,
String
search
,
Integer
pcloudClassfyId
);
void
updateSeqNum
(
UpdateSeqNumVO
updateSeqNumVO
);
void
updateSeqNum
(
UpdateSeqNumVO
updateSeqNumVO
);
...
@@ -22,4 +22,6 @@ public interface PcloudGuideBiz {
...
@@ -22,4 +22,6 @@ public interface PcloudGuideBiz {
void
setSilenceDuration
(
RobotSilenceVO
robotSilenceVO
);
void
setSilenceDuration
(
RobotSilenceVO
robotSilenceVO
);
void
copyGuideSetting
(
String
fromRobotWxId
,
String
toRobotWxId
);
void
copyGuideSetting
(
String
fromRobotWxId
,
String
toRobotWxId
);
void
add4Classify
(
Create4ClassifyVO
create4ClassifyVO
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/guide/biz/impl/PcloudGuideBizImpl.java
View file @
da97c757
...
@@ -4,6 +4,7 @@ import com.pcloud.book.base.exception.BookBizException;
...
@@ -4,6 +4,7 @@ import com.pcloud.book.base.exception.BookBizException;
import
com.pcloud.book.guide.biz.PcloudGuideBiz
;
import
com.pcloud.book.guide.biz.PcloudGuideBiz
;
import
com.pcloud.book.guide.entity.PcloudGuide
;
import
com.pcloud.book.guide.entity.PcloudGuide
;
import
com.pcloud.book.guide.entity.PcloudGuideMessage
;
import
com.pcloud.book.guide.entity.PcloudGuideMessage
;
import
com.pcloud.book.guide.entity.PcloudRobotSilence
;
import
com.pcloud.book.guide.mapper.PcloudGuideMapper
;
import
com.pcloud.book.guide.mapper.PcloudGuideMapper
;
import
com.pcloud.book.guide.mapper.PcloudGuideMessageMapper
;
import
com.pcloud.book.guide.mapper.PcloudGuideMessageMapper
;
import
com.pcloud.book.guide.mapper.PcloudRobotSilenceMapper
;
import
com.pcloud.book.guide.mapper.PcloudRobotSilenceMapper
;
...
@@ -43,7 +44,7 @@ public class PcloudGuideBizImpl implements PcloudGuideBiz {
...
@@ -43,7 +44,7 @@ public class PcloudGuideBizImpl implements PcloudGuideBiz {
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"最多添加3条回复内容"
);
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"最多添加3条回复内容"
);
}
}
Integer
maxSeqNum
=
pcloudGuideMapper
.
getMaxSeqNum
(
null
);
Integer
maxSeqNum
=
pcloudGuideMapper
.
getMaxSeqNum
(
null
,
null
);
PcloudGuide
pcloudGuide
=
new
PcloudGuide
();
PcloudGuide
pcloudGuide
=
new
PcloudGuide
();
pcloudGuide
.
setType
(
0
);
pcloudGuide
.
setType
(
0
);
pcloudGuide
.
setRobotWxId
(
null
);
pcloudGuide
.
setRobotWxId
(
null
);
...
@@ -113,13 +114,13 @@ public class PcloudGuideBizImpl implements PcloudGuideBiz {
...
@@ -113,13 +114,13 @@ public class PcloudGuideBizImpl implements PcloudGuideBiz {
}
}
@Override
@Override
public
PageBeanNew
<
PcloudGuideVO
>
listPcloudGuide
(
Integer
currentPage
,
Integer
numPerPage
,
String
robotWxId
,
String
search
)
{
public
PageBeanNew
<
PcloudGuideVO
>
listPcloudGuide
(
Integer
currentPage
,
Integer
numPerPage
,
String
robotWxId
,
String
search
,
Integer
pcloudClassfyId
)
{
Integer
count
=
pcloudGuideMapper
.
getCount
(
robotWxId
,
search
);
Integer
count
=
pcloudGuideMapper
.
getCount
(
robotWxId
,
search
,
pcloudClassfyId
);
List
<
PcloudGuideVO
>
list
=
new
ArrayList
<>();
List
<
PcloudGuideVO
>
list
=
new
ArrayList
<>();
if
(
count
<=
0
)
{
if
(
count
<=
0
)
{
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
list
);
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
list
);
}
}
list
=
pcloudGuideMapper
.
listPcloudGuide
(
currentPage
*
numPerPage
,
numPerPage
,
robotWxId
,
search
);
list
=
pcloudGuideMapper
.
listPcloudGuide
(
currentPage
*
numPerPage
,
numPerPage
,
robotWxId
,
search
,
pcloudClassfyId
);
list
.
forEach
(
item
->
{
list
.
forEach
(
item
->
{
item
.
setMessageVOList
(
pcloudGuideMessageMapper
.
listByGuideId
(
item
.
getPcloudGuideId
()));
item
.
setMessageVOList
(
pcloudGuideMessageMapper
.
listByGuideId
(
item
.
getPcloudGuideId
()));
});
});
...
@@ -140,10 +141,11 @@ public class PcloudGuideBizImpl implements PcloudGuideBiz {
...
@@ -140,10 +141,11 @@ public class PcloudGuideBizImpl implements PcloudGuideBiz {
continue
;
continue
;
}
}
String
robotWxId
=
create4RobotVO
.
getRobotWxId
();
String
robotWxId
=
create4RobotVO
.
getRobotWxId
();
Integer
maxSeqNum
=
pcloudGuideMapper
.
getMaxSeqNum
(
robotWxId
);
Integer
maxSeqNum
=
pcloudGuideMapper
.
getMaxSeqNum
(
robotWxId
,
null
);
pcloudGuide
.
setType
(
1
);
pcloudGuide
.
setType
(
1
);
pcloudGuide
.
setRobotWxId
(
robotWxId
);
pcloudGuide
.
setRobotWxId
(
robotWxId
);
pcloudGuide
.
setSeqNum
(
maxSeqNum
+
1
);
pcloudGuide
.
setSeqNum
(
maxSeqNum
+
1
);
pcloudGuide
.
setTimeSpan
(
pcloudGuide
.
getTimeSpan
());
pcloudGuideMapper
.
insert
(
pcloudGuide
);
pcloudGuideMapper
.
insert
(
pcloudGuide
);
List
<
PcloudGuideMessageVO
>
messageVOList
=
pcloudGuideMessageMapper
.
listByGuideId
(
pcloudGuideId
);
List
<
PcloudGuideMessageVO
>
messageVOList
=
pcloudGuideMessageMapper
.
listByGuideId
(
pcloudGuideId
);
List
<
PcloudGuideMessage
>
list
=
new
ArrayList
<>();
List
<
PcloudGuideMessage
>
list
=
new
ArrayList
<>();
...
@@ -159,10 +161,20 @@ public class PcloudGuideBizImpl implements PcloudGuideBiz {
...
@@ -159,10 +161,20 @@ public class PcloudGuideBizImpl implements PcloudGuideBiz {
@Override
@Override
public
void
setSilenceDuration
(
RobotSilenceVO
robotSilenceVO
)
{
public
void
setSilenceDuration
(
RobotSilenceVO
robotSilenceVO
)
{
if
(
StringUtil
.
isEmpty
(
robotSilenceVO
.
getRobotWxId
()))
{
if
(
StringUtil
.
isEmpty
(
robotSilenceVO
.
getRobotWxId
())
&&
null
==
robotSilenceVO
.
getPcloudClassifyId
()
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数错误!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数错误!"
);
}
}
pcloudRobotSilenceMapper
.
setSilenceDuration
(
robotSilenceVO
.
getRobotWxId
(),
robotSilenceVO
.
getSilenceDuration
());
PcloudRobotSilence
pcloudRobotSilence
=
pcloudRobotSilenceMapper
.
get
(
robotSilenceVO
.
getRobotWxId
(),
robotSilenceVO
.
getPcloudClassifyId
());
if
(
null
!=
pcloudRobotSilence
)
{
pcloudRobotSilence
.
setSilenceDuration
(
robotSilenceVO
.
getSilenceDuration
());
pcloudRobotSilenceMapper
.
updateByPrimaryKey
(
pcloudRobotSilence
);
}
else
{
pcloudRobotSilence
=
new
PcloudRobotSilence
();
pcloudRobotSilence
.
setPcloudClassifyId
(
robotSilenceVO
.
getPcloudClassifyId
());
pcloudRobotSilence
.
setRobotWxId
(
robotSilenceVO
.
getRobotWxId
());
pcloudRobotSilence
.
setSilenceDuration
(
robotSilenceVO
.
getSilenceDuration
());
pcloudRobotSilenceMapper
.
insert
(
pcloudRobotSilence
);
}
}
}
/**
/**
...
@@ -178,9 +190,37 @@ public class PcloudGuideBizImpl implements PcloudGuideBiz {
...
@@ -178,9 +190,37 @@ public class PcloudGuideBizImpl implements PcloudGuideBiz {
create4Robot
(
create4RobotVO
);
create4Robot
(
create4RobotVO
);
}
}
//设置缄默时长
//设置缄默时长
Integer
silenceDurationByRobotWxId
=
pcloudRobotSilenceMapper
.
getSilenceDurationByRobotWxId
(
fromRobotWxId
);
Integer
silenceDurationByRobotWxId
=
pcloudRobotSilenceMapper
.
getSilenceDurationByRobotWxId
(
fromRobotWxId
,
null
);
if
(
null
!=
silenceDurationByRobotWxId
)
{
if
(
null
!=
silenceDurationByRobotWxId
)
{
pcloudRobotSilenceMapper
.
setSilenceDuration
(
toRobotWxId
,
silenceDurationByRobotWxId
);
pcloudRobotSilenceMapper
.
setSilenceDuration
(
toRobotWxId
,
silenceDurationByRobotWxId
,
null
);
}
}
@Override
public
void
add4Classify
(
Create4ClassifyVO
create4ClassifyVO
)
{
List
<
Integer
>
pcloudGuideIds
=
create4ClassifyVO
.
getPcloudGuideIds
();
for
(
Integer
pcloudGuideId
:
pcloudGuideIds
)
{
PcloudGuide
pcloudGuide
=
pcloudGuideMapper
.
selectByPrimaryKey
(
pcloudGuideId
);
if
(
null
==
pcloudGuide
)
{
continue
;
}
Integer
pcloudClassifyId
=
create4ClassifyVO
.
getPcloudClassifyId
();
Integer
maxSeqNum
=
pcloudGuideMapper
.
getMaxSeqNum
(
null
,
pcloudClassifyId
);
pcloudGuide
.
setType
(
2
);
pcloudGuide
.
setRobotWxId
(
null
);
pcloudGuide
.
setPcloudClassifyId
(
pcloudClassifyId
);
pcloudGuide
.
setSeqNum
(
maxSeqNum
+
1
);
pcloudGuide
.
setTimeSpan
(
pcloudGuide
.
getTimeSpan
());
pcloudGuideMapper
.
insert
(
pcloudGuide
);
List
<
PcloudGuideMessageVO
>
messageVOList
=
pcloudGuideMessageMapper
.
listByGuideId
(
pcloudGuideId
);
List
<
PcloudGuideMessage
>
list
=
new
ArrayList
<>();
messageVOList
.
forEach
(
item
->
{
PcloudGuideMessage
pcloudGuideMessage
=
new
PcloudGuideMessage
();
BeanUtils
.
copyProperties
(
item
,
pcloudGuideMessage
);
pcloudGuideMessage
.
setPcloudGuideId
(
pcloudGuide
.
getId
());
list
.
add
(
pcloudGuideMessage
);
});
pcloudGuideMessageMapper
.
batchInsert
(
list
);
}
}
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/guide/entity/PcloudGuide.java
View file @
da97c757
...
@@ -21,4 +21,6 @@ public class PcloudGuide {
...
@@ -21,4 +21,6 @@ public class PcloudGuide {
private
Integer
seqNum
;
private
Integer
seqNum
;
private
Integer
pcloudClassifyId
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/guide/entity/PcloudRobotSilence.java
View file @
da97c757
...
@@ -13,6 +13,8 @@ public class PcloudRobotSilence {
...
@@ -13,6 +13,8 @@ public class PcloudRobotSilence {
private
Date
updateTime
;
private
Date
updateTime
;
private
Integer
pcloudClassifyId
;
public
Integer
getId
()
{
public
Integer
getId
()
{
return
id
;
return
id
;
}
}
...
@@ -52,4 +54,12 @@ public class PcloudRobotSilence {
...
@@ -52,4 +54,12 @@ public class PcloudRobotSilence {
public
void
setUpdateTime
(
Date
updateTime
)
{
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
this
.
updateTime
=
updateTime
;
}
}
public
Integer
getPcloudClassifyId
()
{
return
pcloudClassifyId
;
}
public
void
setPcloudClassifyId
(
Integer
pcloudClassifyId
)
{
this
.
pcloudClassifyId
=
pcloudClassifyId
;
}
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/guide/facade/impl/PcloudGuideFacadeImpl.java
View file @
da97c757
...
@@ -2,6 +2,8 @@ package com.pcloud.book.guide.facade.impl;
...
@@ -2,6 +2,8 @@ package com.pcloud.book.guide.facade.impl;
import
com.pcloud.book.guide.biz.PcloudGuideBiz
;
import
com.pcloud.book.guide.biz.PcloudGuideBiz
;
import
com.pcloud.book.guide.mapper.PcloudRobotSilenceMapper
;
import
com.pcloud.book.guide.vo.Create4ClassifyVO
;
import
com.pcloud.book.guide.vo.Create4RobotVO
;
import
com.pcloud.book.guide.vo.Create4RobotVO
;
import
com.pcloud.book.guide.vo.CreatePcloudGuideVO
;
import
com.pcloud.book.guide.vo.CreatePcloudGuideVO
;
import
com.pcloud.book.guide.vo.PcloudGuideVO
;
import
com.pcloud.book.guide.vo.PcloudGuideVO
;
...
@@ -31,6 +33,8 @@ public class PcloudGuideFacadeImpl {
...
@@ -31,6 +33,8 @@ public class PcloudGuideFacadeImpl {
@Autowired
@Autowired
private
PcloudGuideBiz
pcloudGuideBiz
;
private
PcloudGuideBiz
pcloudGuideBiz
;
@Autowired
private
PcloudRobotSilenceMapper
pcloudRobotSilenceMapper
;
@ApiOperation
(
value
=
"新增全平台引导语"
)
@ApiOperation
(
value
=
"新增全平台引导语"
)
@PostMapping
(
"addPcloudGuide"
)
@PostMapping
(
"addPcloudGuide"
)
...
@@ -65,9 +69,10 @@ public class PcloudGuideFacadeImpl {
...
@@ -65,9 +69,10 @@ public class PcloudGuideFacadeImpl {
@ApiOperation
(
value
=
"获取引导语列表"
)
@ApiOperation
(
value
=
"获取引导语列表"
)
@GetMapping
(
"listPcloudGuide"
)
@GetMapping
(
"listPcloudGuide"
)
ResponseDto
<?>
listPcloudGuide
(
@RequestHeader
String
token
,
@RequestParam
Integer
currentPage
,
@RequestParam
Integer
numPerPage
,
ResponseDto
<?>
listPcloudGuide
(
@RequestHeader
String
token
,
@RequestParam
Integer
currentPage
,
@RequestParam
Integer
numPerPage
,
@RequestParam
(
value
=
"robotWxId"
,
required
=
false
)
String
robotWxId
,
@RequestParam
(
value
=
"search"
,
required
=
false
)
String
search
)
throws
PermissionException
{
@RequestParam
(
value
=
"robotWxId"
,
required
=
false
)
String
robotWxId
,
@RequestParam
(
value
=
"search"
,
required
=
false
)
String
search
,
@RequestParam
(
value
=
"pcloudClassfyId"
,
required
=
false
)
Integer
pcloudClassfyId
)
throws
PermissionException
{
SessionUtil
.
getInfoToken4Redis
(
token
);
SessionUtil
.
getInfoToken4Redis
(
token
);
PageBeanNew
<
PcloudGuideVO
>
page
=
pcloudGuideBiz
.
listPcloudGuide
(
currentPage
,
numPerPage
,
robotWxId
,
search
);
PageBeanNew
<
PcloudGuideVO
>
page
=
pcloudGuideBiz
.
listPcloudGuide
(
currentPage
,
numPerPage
,
robotWxId
,
search
,
pcloudClassfyId
);
return
new
ResponseDto
<>(
page
);
return
new
ResponseDto
<>(
page
);
}
}
...
@@ -98,4 +103,19 @@ public class PcloudGuideFacadeImpl {
...
@@ -98,4 +103,19 @@ public class PcloudGuideFacadeImpl {
return
new
ResponseDto
<>();
return
new
ResponseDto
<>();
}
}
@ApiOperation
(
value
=
"新增分类引导语"
,
httpMethod
=
"POST"
)
@PostMapping
(
"add4Classify"
)
ResponseDto
<?>
add4Classify
(
@RequestHeader
String
token
,
@RequestBody
Create4ClassifyVO
create4ClassifyVO
)
throws
PermissionException
{
SessionUtil
.
getInfoToken4Redis
(
token
);
pcloudGuideBiz
.
add4Classify
(
create4ClassifyVO
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
value
=
"获取缄默时长设置"
,
httpMethod
=
"GET"
)
@GetMapping
(
"getSilenceDuration"
)
ResponseDto
<?>
getSilenceDuration
(
@RequestHeader
String
token
,
@RequestParam
Integer
pcloudClassifyId
)
throws
PermissionException
{
SessionUtil
.
getInfoToken4Redis
(
token
);
return
new
ResponseDto
<>(
pcloudRobotSilenceMapper
.
get
(
null
,
pcloudClassifyId
));
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/guide/mapper/PcloudGuideMapper.java
View file @
da97c757
...
@@ -21,12 +21,12 @@ public interface PcloudGuideMapper {
...
@@ -21,12 +21,12 @@ public interface PcloudGuideMapper {
int
updateByPrimaryKey
(
PcloudGuide
record
);
int
updateByPrimaryKey
(
PcloudGuide
record
);
Integer
getMaxSeqNum
(
@Param
(
"robotWxId"
)
String
robotWxId
);
Integer
getMaxSeqNum
(
@Param
(
"robotWxId"
)
String
robotWxId
,
@Param
(
"pcloudClassifyId"
)
Integer
pcloudClassifyId
);
Integer
getCount
(
@Param
(
"robotWxId"
)
String
robotWxId
,
@Param
(
"search"
)
String
search
);
Integer
getCount
(
@Param
(
"robotWxId"
)
String
robotWxId
,
@Param
(
"search"
)
String
search
,
@Param
(
"pcloudClassifyId"
)
Integer
pcloudClassifyId
);
List
<
PcloudGuideVO
>
listPcloudGuide
(
@Param
(
"pageNum"
)
Integer
pageNum
,
@Param
(
"numPerPage"
)
Integer
numPerPage
,
List
<
PcloudGuideVO
>
listPcloudGuide
(
@Param
(
"pageNum"
)
Integer
pageNum
,
@Param
(
"numPerPage"
)
Integer
numPerPage
,
@Param
(
"robotWxId"
)
String
robotWxId
,
@Param
(
"search"
)
String
search
);
@Param
(
"robotWxId"
)
String
robotWxId
,
@Param
(
"search"
)
String
search
,
@Param
(
"pcloudClassifyId"
)
Integer
pcloudClassifyId
);
void
updateSeqNum
(
@Param
(
"id"
)
Integer
pcloudGuideId
,
@Param
(
"seqNum"
)
Integer
seqNum
);
void
updateSeqNum
(
@Param
(
"id"
)
Integer
pcloudGuideId
,
@Param
(
"seqNum"
)
Integer
seqNum
);
...
@@ -35,4 +35,6 @@ public interface PcloudGuideMapper {
...
@@ -35,4 +35,6 @@ public interface PcloudGuideMapper {
PcloudGuide
getFirstByRobotId
(
@Param
(
"robotId"
)
String
robotId
,
@Param
(
"num"
)
int
num
);
PcloudGuide
getFirstByRobotId
(
@Param
(
"robotId"
)
String
robotId
,
@Param
(
"num"
)
int
num
);
List
<
Integer
>
listPcloudGuideIds
(
String
robotWxId
);
List
<
Integer
>
listPcloudGuideIds
(
String
robotWxId
);
PcloudGuide
getFirstByClassifyId
(
@Param
(
"pcloudClassifyId"
)
Integer
pcloudClassifyId
,
@Param
(
"num"
)
int
num
);
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/guide/mapper/PcloudRobotSilenceMapper.java
View file @
da97c757
...
@@ -28,10 +28,13 @@ public interface PcloudRobotSilenceMapper {
...
@@ -28,10 +28,13 @@ public interface PcloudRobotSilenceMapper {
/**
/**
* 根据机器人wxid获取缄默时长
* 根据机器人wxid获取缄默时长
*/
*/
Integer
getSilenceDurationByRobotWxId
(
@Param
(
"wxId"
)
String
wxId
);
Integer
getSilenceDurationByRobotWxId
(
@Param
(
"wxId"
)
String
wxId
,
@Param
(
"pcloudClassifyId"
)
Integer
pcloudClassifyId
);
/**
/**
* 设置机器人缄默时长
* 设置机器人缄默时长
*/
*/
void
setSilenceDuration
(
@Param
(
"robotWxId"
)
String
robotWxId
,
@Param
(
"silenceDuration"
)
Integer
silenceDuration
);
void
setSilenceDuration
(
@Param
(
"robotWxId"
)
String
robotWxId
,
@Param
(
"silenceDuration"
)
Integer
silenceDuration
,
@Param
(
"pcloudClassifyId"
)
Integer
pcloudClassifyId
);
PcloudRobotSilence
get
(
@Param
(
"wxId"
)
String
wxId
,
@Param
(
"pcloudClassifyId"
)
Integer
pcloudClassifyId
);
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/guide/runner/PcloudGuideSilenceRunnerImpl.java
View file @
da97c757
...
@@ -8,6 +8,8 @@ import com.pcloud.book.guide.mapper.PcloudGuideMessageMapper;
...
@@ -8,6 +8,8 @@ import com.pcloud.book.guide.mapper.PcloudGuideMessageMapper;
import
com.pcloud.book.guide.mapper.PcloudRobotSilenceMapper
;
import
com.pcloud.book.guide.mapper.PcloudRobotSilenceMapper
;
import
com.pcloud.book.guide.vo.PcloudGuideMessageVO
;
import
com.pcloud.book.guide.vo.PcloudGuideMessageVO
;
import
com.pcloud.book.keywords.enums.ReplyTypeEnum
;
import
com.pcloud.book.keywords.enums.ReplyTypeEnum
;
import
com.pcloud.book.pcloudKeyword.dto.RobotClassifyDTO
;
import
com.pcloud.book.pcloudkeyword.dao.PcloudRobotDao
;
import
com.pcloud.common.utils.DateUtils
;
import
com.pcloud.common.utils.DateUtils
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.sdk.wxgroup.SendPicMessageVO
;
import
com.sdk.wxgroup.SendPicMessageVO
;
...
@@ -40,6 +42,8 @@ public class PcloudGuideSilenceRunnerImpl implements ApplicationRunner {
...
@@ -40,6 +42,8 @@ public class PcloudGuideSilenceRunnerImpl implements ApplicationRunner {
private
PcloudGuideMapper
pcloudGuideMapper
;
private
PcloudGuideMapper
pcloudGuideMapper
;
@Autowired
@Autowired
private
PcloudGuideMessageMapper
pcloudGuideMessageMapper
;
private
PcloudGuideMessageMapper
pcloudGuideMessageMapper
;
@Autowired
private
PcloudRobotDao
pcloudRobotDao
;
@Override
@Override
...
@@ -63,9 +67,9 @@ public class PcloudGuideSilenceRunnerImpl implements ApplicationRunner {
...
@@ -63,9 +67,9 @@ public class PcloudGuideSilenceRunnerImpl implements ApplicationRunner {
while
(
true
)
{
while
(
true
)
{
try
{
try
{
Thread
.
sleep
(
1000
);
Thread
.
sleep
(
1000
);
List
<
String
>
robots
=
pcloudRobotSilenceMapper
.
listRobots
();
List
<
RobotClassifyDTO
>
allPcloudRobot
=
pcloudRobotDao
.
getAllPcloudRobot
();
for
(
String
robotWxid
:
robots
)
{
for
(
RobotClassifyDTO
robotClassifyDTO:
allPcloudRobot
)
{
Map
<
String
,
String
>
friends
=
JedisClusterUtils
.
hgetAll
(
robot
Wxid
+
PCLOUD_GUIDE_SUFFIX
);
Map
<
String
,
String
>
friends
=
JedisClusterUtils
.
hgetAll
(
robot
ClassifyDTO
.
getWxId
()
+
PCLOUD_GUIDE_SUFFIX
);
if
(
friends
==
null
)
{
if
(
friends
==
null
)
{
continue
;
continue
;
}
}
...
@@ -99,7 +103,7 @@ public class PcloudGuideSilenceRunnerImpl implements ApplicationRunner {
...
@@ -99,7 +103,7 @@ public class PcloudGuideSilenceRunnerImpl implements ApplicationRunner {
}
}
// 向缓存中写入下一条
// 向缓存中写入下一条
PcloudGuide
pcloudGuide
=
pcloudGuideMapper
.
getFirstBy
RobotId
(
pcloudGuideDelayDto
.
getRobotWx
Id
(),
pcloudGuideDelayDto
.
getNum
()
+
1
);
PcloudGuide
pcloudGuide
=
pcloudGuideMapper
.
getFirstBy
ClassifyId
(
robotClassifyDTO
.
getClassify
Id
(),
pcloudGuideDelayDto
.
getNum
()
+
1
);
if
(
pcloudGuide
!=
null
)
{
if
(
pcloudGuide
!=
null
)
{
List
<
PcloudGuideMessageVO
>
messageVOList
=
pcloudGuideMessageMapper
.
listByGuideId
(
pcloudGuide
.
getId
());
List
<
PcloudGuideMessageVO
>
messageVOList
=
pcloudGuideMessageMapper
.
listByGuideId
(
pcloudGuide
.
getId
());
...
...
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/BookGuideBizImpl.java
View file @
da97c757
...
@@ -272,7 +272,7 @@ public class BookGuideBizImpl implements BookGuideBiz {
...
@@ -272,7 +272,7 @@ public class BookGuideBizImpl implements BookGuideBiz {
paramMap
.
put
(
"robotWxId"
,
robotId
);
paramMap
.
put
(
"robotWxId"
,
robotId
);
PcloudRobot
pcloudRobot
=
(
PcloudRobot
)
pcloudRobotDao
.
getBy
(
paramMap
,
"getByRobotWxId"
);
PcloudRobot
pcloudRobot
=
(
PcloudRobot
)
pcloudRobotDao
.
getBy
(
paramMap
,
"getByRobotWxId"
);
if
(
null
!=
pcloudRobot
)
{
if
(
null
!=
pcloudRobot
)
{
PcloudGuide
pcloudGuide
=
pcloudGuideMapper
.
getFirstBy
RobotId
(
robotId
,
0
);
PcloudGuide
pcloudGuide
=
pcloudGuideMapper
.
getFirstBy
ClassifyId
(
pcloudRobot
.
getRobotType
()
,
0
);
log
.
info
(
"[sendFriendGuide] 新增好友,推送引导语: {}"
,
pcloudGuide
);
log
.
info
(
"[sendFriendGuide] 新增好友,推送引导语: {}"
,
pcloudGuide
);
if
(
pcloudGuide
!=
null
)
{
if
(
pcloudGuide
!=
null
)
{
List
<
PcloudGuideMessageVO
>
messageVOList
=
pcloudGuideMessageMapper
.
listByGuideId
(
pcloudGuide
.
getId
());
List
<
PcloudGuideMessageVO
>
messageVOList
=
pcloudGuideMessageMapper
.
listByGuideId
(
pcloudGuide
.
getId
());
...
...
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/BookKeywordBizImpl.java
View file @
da97c757
...
@@ -67,12 +67,14 @@ import com.pcloud.book.pcloudkeyword.dao.PcloudKeywordClassifyDao;
...
@@ -67,12 +67,14 @@ import com.pcloud.book.pcloudkeyword.dao.PcloudKeywordClassifyDao;
import
com.pcloud.book.pcloudkeyword.dao.PcloudKeywordDao
;
import
com.pcloud.book.pcloudkeyword.dao.PcloudKeywordDao
;
import
com.pcloud.book.pcloudkeyword.dao.PcloudKeywordReplyDao
;
import
com.pcloud.book.pcloudkeyword.dao.PcloudKeywordReplyDao
;
import
com.pcloud.book.pcloudkeyword.dao.PcloudNotKeywordDao
;
import
com.pcloud.book.pcloudkeyword.dao.PcloudNotKeywordDao
;
import
com.pcloud.book.pcloudkeyword.dao.PcloudRobotClassifyDao
;
import
com.pcloud.book.pcloudkeyword.dao.PcloudRobotDao
;
import
com.pcloud.book.pcloudkeyword.dao.PcloudRobotDao
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudKeyword
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudKeyword
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudKeywordClassify
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudKeywordClassify
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudKeywordReply
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudKeywordReply
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudNotKeyword
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudNotKeyword
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobot
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobot
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobotClassify
;
import
com.pcloud.book.pcloudkeyword.enums.KeywordTypeEnum
;
import
com.pcloud.book.pcloudkeyword.enums.KeywordTypeEnum
;
import
com.pcloud.book.pcloudkeyword.enums.MethodEnum
;
import
com.pcloud.book.pcloudkeyword.enums.MethodEnum
;
import
com.pcloud.book.pcloudkeyword.enums.RelevanceTypeEnum
;
import
com.pcloud.book.pcloudkeyword.enums.RelevanceTypeEnum
;
...
@@ -223,6 +225,8 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
...
@@ -223,6 +225,8 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
private
String
wechatGroupLinkPrefix
;
private
String
wechatGroupLinkPrefix
;
@Autowired
@Autowired
private
PcloudRobotBiz
pcloudRobotBiz
;
private
PcloudRobotBiz
pcloudRobotBiz
;
@Autowired
private
PcloudRobotClassifyDao
pcloudRobotClassifyDao
;
/**
/**
* 字符串切割长度
* 字符串切割长度
*/
*/
...
@@ -677,7 +681,13 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
...
@@ -677,7 +681,13 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
String
ip
=
sendTextDTO
.
getIp
();
String
ip
=
sendTextDTO
.
getIp
();
Integer
code
=
sendTextDTO
.
getCode
();
Integer
code
=
sendTextDTO
.
getCode
();
String
robotId
=
sendTextDTO
.
getWxId
();
String
robotId
=
sendTextDTO
.
getWxId
();
Long
pcloudClassifyId
=
pcloudRobot
.
getKeywordClassifyId
();
Long
robotClassifyId
=
pcloudRobot
.
getRobotType
().
longValue
();
PcloudRobotClassify
robotClassify
=
pcloudRobotClassifyDao
.
getById
(
robotClassifyId
);
if
(
robotClassify
==
null
||
robotClassify
.
getKeywordClassifyId
()==
null
){
return
;
}
Long
pcloudClassifyId
=
robotClassify
.
getKeywordClassifyId
();
//查询该小号对应小号分类的关键词分类
PcloudKeywordClassify
pcloudKeywordClassify
=
pcloudKeywordClassifyDao
.
getById
(
pcloudClassifyId
);
PcloudKeywordClassify
pcloudKeywordClassify
=
pcloudKeywordClassifyDao
.
getById
(
pcloudClassifyId
);
if
(
null
==
pcloudKeywordClassify
||
!
pcloudKeywordClassify
.
getOpen
()){
//分类未启用
if
(
null
==
pcloudKeywordClassify
||
!
pcloudKeywordClassify
.
getOpen
()){
//分类未启用
log
.
info
(
"查询小号关键词分类为空或未启用sendTextDTO="
+
sendTextDTO
.
toString
()+
"pcloudRobot="
+
pcloudRobot
.
toString
());
log
.
info
(
"查询小号关键词分类为空或未启用sendTextDTO="
+
sendTextDTO
.
toString
()+
"pcloudRobot="
+
pcloudRobot
.
toString
());
...
@@ -1893,7 +1903,11 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
...
@@ -1893,7 +1903,11 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
if
(
SendMessageTypeEnum
.
SELF
.
getCode
().
equals
(
code
)
&&
!
userWxId
.
equals
(
robotId
))
{
if
(
SendMessageTypeEnum
.
SELF
.
getCode
().
equals
(
code
)
&&
!
userWxId
.
equals
(
robotId
))
{
// 从缓存中获取缄默信息
// 从缓存中获取缄默信息
if
(
JedisClusterUtils
.
hexists
(
robotId
+
PCLOUD_GUIDE_SUFFIX
,
userWxId
)){
if
(
JedisClusterUtils
.
hexists
(
robotId
+
PCLOUD_GUIDE_SUFFIX
,
userWxId
)){
Integer
duration
=
pcloudRobotSilenceMapper
.
getSilenceDurationByRobotWxId
(
robotId
);
PcloudRobot
pcloudRobot
=
pcloudRobotDao
.
getByWxId
(
robotId
);
if
(
pcloudRobot
==
null
)
{
return
;
}
Integer
duration
=
pcloudRobotSilenceMapper
.
getSilenceDurationByRobotWxId
(
null
,
pcloudRobot
.
getRobotType
());
if
(
duration
==
null
)
{
if
(
duration
==
null
)
{
duration
=
0
;
duration
=
0
;
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/mq/topic/WxGroupSendNotTextListener.java
View file @
da97c757
...
@@ -2,8 +2,10 @@ package com.pcloud.book.mq.topic;
...
@@ -2,8 +2,10 @@ package com.pcloud.book.mq.topic;
import
com.pcloud.book.keywords.biz.BookKeywordBiz
;
import
com.pcloud.book.keywords.biz.BookKeywordBiz
;
import
com.pcloud.book.mq.config.MQTopicConumer
;
import
com.pcloud.book.mq.config.MQTopicConumer
;
import
com.pcloud.book.pcloudkeyword.dao.PcloudRobotClassifyDao
;
import
com.pcloud.book.pcloudkeyword.dao.PcloudRobotDao
;
import
com.pcloud.book.pcloudkeyword.dao.PcloudRobotDao
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobot
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobot
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobotClassify
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
...
@@ -28,6 +30,8 @@ public class WxGroupSendNotTextListener {
...
@@ -28,6 +30,8 @@ public class WxGroupSendNotTextListener {
private
BookKeywordBiz
bookKeywordBiz
;
private
BookKeywordBiz
bookKeywordBiz
;
@Autowired
@Autowired
private
PcloudRobotDao
pcloudRobotDao
;
private
PcloudRobotDao
pcloudRobotDao
;
@Autowired
private
PcloudRobotClassifyDao
pcloudRobotClassifyDao
;
@ParamLog
(
"接收用户发送非文本消息"
)
@ParamLog
(
"接收用户发送非文本消息"
)
@RabbitHandler
@RabbitHandler
...
@@ -48,7 +52,13 @@ public class WxGroupSendNotTextListener {
...
@@ -48,7 +52,13 @@ public class WxGroupSendNotTextListener {
PcloudRobot
pcloudRobot
=
pcloudRobotDao
.
getByWxId
(
sendNotTextDTO
.
getWxId
());
PcloudRobot
pcloudRobot
=
pcloudRobotDao
.
getByWxId
(
sendNotTextDTO
.
getWxId
());
if
(
pcloudRobot
!=
null
){
if
(
pcloudRobot
!=
null
){
//发送非关键词
//发送非关键词
Long
pcloudClassifyId
=
pcloudRobot
.
getKeywordClassifyId
();
//查询该小号对应小号分类的关键词分类
Long
robotClassifyId
=
pcloudRobot
.
getRobotType
().
longValue
();
PcloudRobotClassify
robotClassify
=
pcloudRobotClassifyDao
.
getById
(
robotClassifyId
);
if
(
robotClassify
==
null
||
robotClassify
.
getKeywordClassifyId
()==
null
){
return
;
}
Long
pcloudClassifyId
=
robotClassify
.
getKeywordClassifyId
();
bookKeywordBiz
.
sendPcloudNotKeyWord
(
userWxId
,
ip
,
code
,
robotId
,
pcloudClassifyId
);
bookKeywordBiz
.
sendPcloudNotKeyWord
(
userWxId
,
ip
,
code
,
robotId
,
pcloudClassifyId
);
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/biz/PcloudKeywordClassifyBiz.java
View file @
da97c757
...
@@ -39,4 +39,11 @@ public interface PcloudKeywordClassifyBiz {
...
@@ -39,4 +39,11 @@ public interface PcloudKeywordClassifyBiz {
* @return
* @return
*/
*/
List
<
PcloudKeywordClassifyDTO
>
list
(
String
classify
);
List
<
PcloudKeywordClassifyDTO
>
list
(
String
classify
);
/**
* 根据小号分类获取平台端关键词分类
* @param robotClassifyId
* @return
*/
PcloudKeywordClassify
getKeywordClassifyByRobotClassifyId
(
Long
robotClassifyId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/biz/PcloudRobotBiz.java
View file @
da97c757
...
@@ -19,7 +19,9 @@ public interface PcloudRobotBiz {
...
@@ -19,7 +19,9 @@ public interface PcloudRobotBiz {
void
updatePcloudRobotByWxId
(
PcloudRobot
pcloudRobot
);
void
updatePcloudRobotByWxId
(
PcloudRobot
pcloudRobot
);
PageBeanNew
<
PcloudRobot
>
getPcloudRobotList
(
String
nickName
,
Integer
currentPage
,
Integer
numPerPage
);
void
updateRobotState
(
Long
id
,
Integer
state
);
PageBeanNew
<
PcloudRobot
>
getPcloudRobotList
(
Integer
classifyId
,
String
nickName
,
Integer
currentPage
,
Integer
numPerPage
);
void
batchUpdatePcloudRobotWelcome
(
List
<
PcloudRobotWelcome
>
robotWelcomeList
);
void
batchUpdatePcloudRobotWelcome
(
List
<
PcloudRobotWelcome
>
robotWelcomeList
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/biz/PcloudRobotClassifyBiz.java
View file @
da97c757
package
com
.
pcloud
.
book
.
pcloudkeyword
.
biz
;
package
com
.
pcloud
.
book
.
pcloudkeyword
.
biz
;
import
com.pcloud.book.pcloudkeyword.dto.ClassifyWelcomeDTO
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobotClassify
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobotClassify
;
import
com.pcloud.book.pcloudkeyword.facade.response.PcloudRobotClassifyResponseVO
;
import
com.pcloud.book.pcloudkeyword.facade.response.PcloudRobotClassifyResponseVO
;
import
com.pcloud.common.page.PageBeanNew
;
import
java.util.List
;
import
java.util.List
;
...
@@ -22,4 +24,23 @@ public interface PcloudRobotClassifyBiz {
...
@@ -22,4 +24,23 @@ public interface PcloudRobotClassifyBiz {
*/
*/
void
updateRobotClassify
(
PcloudRobotClassify
classify
);
void
updateRobotClassify
(
PcloudRobotClassify
classify
);
/**
* 获取分类
*/
PcloudRobotClassify
getClassifyById
(
Long
id
);
/**
* 分页查询所有小号分类
*/
PageBeanNew
<
PcloudRobotClassifyResponseVO
>
listClassifyByPage
(
Integer
currentPage
,
Integer
numPerPage
);
ClassifyWelcomeDTO
getClassifyWelcome
(
Long
classifyId
);
void
updateClassifyWelcome
(
ClassifyWelcomeDTO
classifyWelcomeDTO
);
/**
* 更新分类的关键词分类
*/
void
updateRobotClassifyKeywordClassify
(
PcloudRobotClassify
classify
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/biz/impl/PcloudKeywordClassifyBizImpl.java
View file @
da97c757
...
@@ -3,8 +3,10 @@ package com.pcloud.book.pcloudkeyword.biz.impl;
...
@@ -3,8 +3,10 @@ package com.pcloud.book.pcloudkeyword.biz.impl;
import
com.pcloud.book.pcloudkeyword.biz.PcloudKeywordBiz
;
import
com.pcloud.book.pcloudkeyword.biz.PcloudKeywordBiz
;
import
com.pcloud.book.pcloudkeyword.biz.PcloudKeywordClassifyBiz
;
import
com.pcloud.book.pcloudkeyword.biz.PcloudKeywordClassifyBiz
;
import
com.pcloud.book.pcloudkeyword.dao.PcloudKeywordClassifyDao
;
import
com.pcloud.book.pcloudkeyword.dao.PcloudKeywordClassifyDao
;
import
com.pcloud.book.pcloudkeyword.dao.PcloudRobotClassifyDao
;
import
com.pcloud.book.pcloudkeyword.dto.PcloudKeywordClassifyDTO
;
import
com.pcloud.book.pcloudkeyword.dto.PcloudKeywordClassifyDTO
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudKeywordClassify
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudKeywordClassify
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobotClassify
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ListUtils
;
...
@@ -23,6 +25,8 @@ public class PcloudKeywordClassifyBizImpl implements PcloudKeywordClassifyBiz {
...
@@ -23,6 +25,8 @@ public class PcloudKeywordClassifyBizImpl implements PcloudKeywordClassifyBiz {
private
PcloudKeywordClassifyDao
pcloudKeywordClassifyDao
;
private
PcloudKeywordClassifyDao
pcloudKeywordClassifyDao
;
@Autowired
@Autowired
private
PcloudKeywordBiz
pcloudKeywordBiz
;
private
PcloudKeywordBiz
pcloudKeywordBiz
;
@Autowired
private
PcloudRobotClassifyDao
pcloudRobotClassifyDao
;
@Override
@Override
public
Long
insert
(
PcloudKeywordClassify
pcloudKeywordClassify
)
{
public
Long
insert
(
PcloudKeywordClassify
pcloudKeywordClassify
)
{
...
@@ -53,4 +57,16 @@ public class PcloudKeywordClassifyBizImpl implements PcloudKeywordClassifyBiz {
...
@@ -53,4 +57,16 @@ public class PcloudKeywordClassifyBizImpl implements PcloudKeywordClassifyBiz {
List
<
PcloudKeywordClassifyDTO
>
list
=
pcloudKeywordClassifyDao
.
list
(
classify
);
List
<
PcloudKeywordClassifyDTO
>
list
=
pcloudKeywordClassifyDao
.
list
(
classify
);
return
list
;
return
list
;
}
}
@Override
public
PcloudKeywordClassify
getKeywordClassifyByRobotClassifyId
(
Long
robotClassifyId
)
{
PcloudRobotClassify
robotClassify
=
pcloudRobotClassifyDao
.
getById
(
robotClassifyId
);
if
(
robotClassify
==
null
||
robotClassify
.
getKeywordClassifyId
()==
null
){
return
new
PcloudKeywordClassify
();
}
Long
pcloudClassifyId
=
robotClassify
.
getKeywordClassifyId
();
//查询该小号对应小号分类的关键词分类
PcloudKeywordClassify
pcloudKeywordClassify
=
pcloudKeywordClassifyDao
.
getById
(
pcloudClassifyId
);
return
pcloudKeywordClassify
;
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/biz/impl/PcloudRobotBizImpl.java
View file @
da97c757
This diff is collapsed.
Click to expand it.
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/biz/impl/PcloudRobotClassifyBizImpl.java
View file @
da97c757
package
com
.
pcloud
.
book
.
pcloudkeyword
.
biz
.
impl
;
package
com
.
pcloud
.
book
.
pcloudkeyword
.
biz
.
impl
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.pcloudkeyword.biz.PcloudRobotClassifyBiz
;
import
com.pcloud.book.pcloudkeyword.biz.PcloudRobotClassifyBiz
;
import
com.pcloud.book.pcloudkeyword.dao.PcloudRobotClassifyDao
;
import
com.pcloud.book.pcloudkeyword.dao.PcloudRobotClassifyDao
;
import
com.pcloud.book.pcloudkeyword.dao.PcloudRobotWelcomeDao
;
import
com.pcloud.book.pcloudkeyword.dto.ClassifyWelcomeDTO
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobotClassify
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobotClassify
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobotWelcome
;
import
com.pcloud.book.pcloudkeyword.facade.response.PcloudRobotClassifyResponseVO
;
import
com.pcloud.book.pcloudkeyword.facade.response.PcloudRobotClassifyResponseVO
;
import
com.pcloud.book.pcloudkeyword.set.PcloudRobotSet
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.QrcodeUtils
;
import
com.pcloud.common.utils.httpclient.UrlUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
...
@@ -17,6 +30,12 @@ public class PcloudRobotClassifyBizImpl implements PcloudRobotClassifyBiz {
...
@@ -17,6 +30,12 @@ public class PcloudRobotClassifyBizImpl implements PcloudRobotClassifyBiz {
@Resource
@Resource
private
PcloudRobotClassifyDao
pcloudRobotClassifyDao
;
private
PcloudRobotClassifyDao
pcloudRobotClassifyDao
;
@Value
(
"${wechat.group.link.prefix}"
)
private
String
wechatLinkPrefix
;
@Resource
private
PcloudRobotWelcomeDao
pcloudRobotWelcomeDao
;
@Autowired
private
PcloudRobotSet
pcloudRobotSet
;
@Override
@Override
public
List
<
PcloudRobotClassifyResponseVO
>
listAllRobotClassify
()
{
public
List
<
PcloudRobotClassifyResponseVO
>
listAllRobotClassify
()
{
...
@@ -29,6 +48,11 @@ public class PcloudRobotClassifyBizImpl implements PcloudRobotClassifyBiz {
...
@@ -29,6 +48,11 @@ public class PcloudRobotClassifyBizImpl implements PcloudRobotClassifyBiz {
classify
.
setClassifyName
(
classifyName
);
classify
.
setClassifyName
(
classifyName
);
classify
.
setIsDelete
(
0
);
classify
.
setIsDelete
(
0
);
pcloudRobotClassifyDao
.
insert
(
classify
);
pcloudRobotClassifyDao
.
insert
(
classify
);
String
linkUrl
=
wechatLinkPrefix
+
"/group/info?classify_id="
+
classify
.
getId
();
String
codeUrl
=
QrcodeUtils
.
create
(
UrlUtils
.
getShortUrl4Own
(
linkUrl
));
classify
.
setLinkUrl
(
linkUrl
);
classify
.
setQrcodeUrl
(
codeUrl
);
pcloudRobotClassifyDao
.
update
(
classify
);
}
}
@Override
@Override
...
@@ -36,4 +60,45 @@ public class PcloudRobotClassifyBizImpl implements PcloudRobotClassifyBiz {
...
@@ -36,4 +60,45 @@ public class PcloudRobotClassifyBizImpl implements PcloudRobotClassifyBiz {
pcloudRobotClassifyDao
.
update
(
classify
);
pcloudRobotClassifyDao
.
update
(
classify
);
}
}
@Override
public
PcloudRobotClassify
getClassifyById
(
Long
id
)
{
return
pcloudRobotClassifyDao
.
getById
(
id
);
}
@Override
public
PageBeanNew
<
PcloudRobotClassifyResponseVO
>
listClassifyByPage
(
Integer
currentPage
,
Integer
numPerPage
)
{
return
pcloudRobotClassifyDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
new
HashMap
<>(),
"listClassifyByPage"
);
}
@Override
public
ClassifyWelcomeDTO
getClassifyWelcome
(
Long
classifyId
)
{
ClassifyWelcomeDTO
classifyWelcomeDTO
=
new
ClassifyWelcomeDTO
();
PcloudRobotClassify
robotClassify
=
pcloudRobotClassifyDao
.
getById
(
classifyId
);
classifyWelcomeDTO
.
setWelcomeDuration
(
robotClassify
.
getWelcomeDuration
());
List
<
PcloudRobotWelcome
>
pcloudRobotWelcomeList
=
pcloudRobotWelcomeDao
.
getRobotWelcomeListByPcloudClassifyId
(
classifyId
);
pcloudRobotSet
.
fillRobotWelcome
(
pcloudRobotWelcomeList
);
classifyWelcomeDTO
.
setPcloudRobotWelcomeList
(
pcloudRobotWelcomeList
);
return
classifyWelcomeDTO
;
}
@Override
public
void
updateClassifyWelcome
(
ClassifyWelcomeDTO
classifyWelcomeDTO
)
{
pcloudRobotClassifyDao
.
updateWelcomeDuration
(
classifyWelcomeDTO
.
getPcloudClassifyId
(),
classifyWelcomeDTO
.
getWelcomeDuration
());
List
<
PcloudRobotWelcome
>
robotWelcomeList
=
classifyWelcomeDTO
.
getPcloudRobotWelcomeList
();
pcloudRobotWelcomeDao
.
deleteByPcloudClassifyId
(
classifyWelcomeDTO
.
getPcloudClassifyId
());
if
(
ListUtils
.
isEmpty
(
robotWelcomeList
))
{
return
;
}
pcloudRobotWelcomeDao
.
batchInsert
(
robotWelcomeList
);
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
updateRobotClassifyKeywordClassify
(
PcloudRobotClassify
classify
)
{
if
(
classify
==
null
||
classify
.
getId
()==
null
||
classify
.
getKeywordClassifyId
()==
null
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数为空!"
);
}
pcloudRobotClassifyDao
.
updateRobotClassifyKeywordClassify
(
classify
.
getId
(),
classify
.
getKeywordClassifyId
());
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/dao/PcloudRobotClassifyDao.java
View file @
da97c757
...
@@ -10,4 +10,7 @@ public interface PcloudRobotClassifyDao extends BaseDao<PcloudRobotClassify> {
...
@@ -10,4 +10,7 @@ public interface PcloudRobotClassifyDao extends BaseDao<PcloudRobotClassify> {
List
<
PcloudRobotClassifyResponseVO
>
listAllRobotClassify
();
List
<
PcloudRobotClassifyResponseVO
>
listAllRobotClassify
();
void
updateRobotClassifyKeywordClassify
(
Long
id
,
Long
keywordClassifyId
);
void
updateWelcomeDuration
(
Long
id
,
Integer
welcomeDuration
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/dao/PcloudRobotDao.java
View file @
da97c757
...
@@ -32,4 +32,6 @@ public interface PcloudRobotDao extends BaseDao<PcloudRobot> {
...
@@ -32,4 +32,6 @@ public interface PcloudRobotDao extends BaseDao<PcloudRobot> {
List
<
String
>
getPcloudRobotByTypes
(
List
<
Integer
>
classifyIds
);
List
<
String
>
getPcloudRobotByTypes
(
List
<
Integer
>
classifyIds
);
void
updateRobotState
(
Map
<
String
,
Object
>
map
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/dao/PcloudRobotWelcomeDao.java
View file @
da97c757
...
@@ -12,4 +12,8 @@ public interface PcloudRobotWelcomeDao extends BaseDao<PcloudRobotWelcome> {
...
@@ -12,4 +12,8 @@ public interface PcloudRobotWelcomeDao extends BaseDao<PcloudRobotWelcome> {
void
deleteByPcloudRobotId
(
Long
pcloudRobotId
);
void
deleteByPcloudRobotId
(
Long
pcloudRobotId
);
void
batchInsert
(
List
<
PcloudRobotWelcome
>
robotWelcomeList
);
void
batchInsert
(
List
<
PcloudRobotWelcome
>
robotWelcomeList
);
List
<
PcloudRobotWelcome
>
getRobotWelcomeListByPcloudClassifyId
(
Long
pcloudClassifyId
);
void
deleteByPcloudClassifyId
(
Long
pcloudClassifyId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/dao/impl/PcloudRobotClassifyDaoImpl.java
View file @
da97c757
...
@@ -7,7 +7,9 @@ import com.pcloud.common.core.dao.BaseDaoImpl;
...
@@ -7,7 +7,9 @@ import com.pcloud.common.core.dao.BaseDaoImpl;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
@Component
@Component
public
class
PcloudRobotClassifyDaoImpl
extends
BaseDaoImpl
<
PcloudRobotClassify
>
implements
PcloudRobotClassifyDao
{
public
class
PcloudRobotClassifyDaoImpl
extends
BaseDaoImpl
<
PcloudRobotClassify
>
implements
PcloudRobotClassifyDao
{
...
@@ -16,4 +18,20 @@ public class PcloudRobotClassifyDaoImpl extends BaseDaoImpl<PcloudRobotClassify>
...
@@ -16,4 +18,20 @@ public class PcloudRobotClassifyDaoImpl extends BaseDaoImpl<PcloudRobotClassify>
public
List
<
PcloudRobotClassifyResponseVO
>
listAllRobotClassify
()
{
public
List
<
PcloudRobotClassifyResponseVO
>
listAllRobotClassify
()
{
return
this
.
getSqlSession
().
selectList
(
"listAllRobotClassify"
);
return
this
.
getSqlSession
().
selectList
(
"listAllRobotClassify"
);
}
}
@Override
public
void
updateRobotClassifyKeywordClassify
(
Long
id
,
Long
keywordClassifyId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"id"
,
id
);
map
.
put
(
"keywordClassifyId"
,
keywordClassifyId
);
getSessionTemplate
().
update
(
getStatement
(
"updateRobotClassifyKeywordClassify"
),
map
);
}
@Override
public
void
updateWelcomeDuration
(
Long
id
,
Integer
welcomeDuration
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"id"
,
id
);
map
.
put
(
"welcomeDuration"
,
welcomeDuration
);
getSessionTemplate
().
update
(
getStatement
(
"updateWelcomeDuration"
),
map
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/dao/impl/PcloudRobotDaoImpl.java
View file @
da97c757
...
@@ -48,15 +48,19 @@ public class PcloudRobotDaoImpl extends BaseDaoImpl<PcloudRobot> implements Pclo
...
@@ -48,15 +48,19 @@ public class PcloudRobotDaoImpl extends BaseDaoImpl<PcloudRobot> implements Pclo
}
}
@Override
@Override
public
void
updatePcloudRobotByWxId
(
PcloudRobot
pcloudRobot
)
{
public
void
updatePcloudRobotByWxId
(
PcloudRobot
pcloudRobot
)
{
this
.
getSessionTemplate
().
update
(
this
.
getStatement
(
"updatePcloudRobotByWxId"
),
pcloudRobot
);
this
.
getSessionTemplate
().
update
(
this
.
getStatement
(
"updatePcloudRobotByWxId"
),
pcloudRobot
);
}
}
@Override
@Override
public
List
<
String
>
getPcloudRobotByTypes
(
List
<
Integer
>
classifyIds
)
{
public
List
<
String
>
getPcloudRobotByTypes
(
List
<
Integer
>
classifyIds
)
{
return
this
.
getSessionTemplate
().
selectList
(
this
.
getStatement
(
"getPcloudRobotByTypes"
),
classifyIds
);
return
this
.
getSessionTemplate
().
selectList
(
this
.
getStatement
(
"getPcloudRobotByTypes"
),
classifyIds
);
}
}
@Override
public
void
updateRobotState
(
Map
<
String
,
Object
>
map
)
{
this
.
getSessionTemplate
().
update
(
this
.
getStatement
(
"updateRobotState"
),
map
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/dao/impl/PcloudRobotWelcomeDaoImpl.java
View file @
da97c757
...
@@ -25,4 +25,14 @@ public class PcloudRobotWelcomeDaoImpl extends BaseDaoImpl<PcloudRobotWelcome> i
...
@@ -25,4 +25,14 @@ public class PcloudRobotWelcomeDaoImpl extends BaseDaoImpl<PcloudRobotWelcome> i
super
.
getSqlSession
().
insert
(
getStatement
(
"batchInsert"
),
robotWelcomeList
);
super
.
getSqlSession
().
insert
(
getStatement
(
"batchInsert"
),
robotWelcomeList
);
}
}
@Override
public
List
<
PcloudRobotWelcome
>
getRobotWelcomeListByPcloudClassifyId
(
Long
pcloudClassifyId
)
{
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getRobotWelcomeListByPcloudClassifyId"
),
pcloudClassifyId
);
}
@Override
public
void
deleteByPcloudClassifyId
(
Long
pcloudClassifyId
)
{
super
.
getSqlSession
().
delete
(
getStatement
(
"deleteByPcloudClassifyId"
),
pcloudClassifyId
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/dto/ClassifyWelcomeDTO.java
0 → 100644
View file @
da97c757
package
com
.
pcloud
.
book
.
pcloudkeyword
.
dto
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobotWelcome
;
import
com.pcloud.wechatgroup.base.dto.BaseDTO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
@Data
@ApiModel
(
"全平台关键词分类"
)
public
class
ClassifyWelcomeDTO
extends
BaseDTO
{
private
Long
pcloudClassifyId
;
@ApiModelProperty
(
"欢迎语间隔时长"
)
private
Integer
welcomeDuration
;
private
List
<
PcloudRobotWelcome
>
pcloudRobotWelcomeList
;
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/entity/PcloudRobotClassify.java
View file @
da97c757
package
com
.
pcloud
.
book
.
pcloudkeyword
.
entity
;
package
com
.
pcloud
.
book
.
pcloudkeyword
.
entity
;
import
com.pcloud.common.entity.BaseEntity
;
import
com.pcloud.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
PcloudRobotClassify
extends
BaseEntity
{
public
class
PcloudRobotClassify
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
-
7926050288611663469L
;
private
static
final
long
serialVersionUID
=
-
7926050288611663469L
;
private
String
classifyName
;
private
String
classifyName
;
private
Integer
isDelete
;
private
String
linkUrl
;
public
String
getClassifyName
()
{
private
String
qrcodeUrl
;
return
classifyName
;
}
public
void
setClassifyName
(
String
classifyName
)
{
private
Integer
isDelete
;
this
.
classifyName
=
classifyName
;
}
public
Integer
getIsDelete
()
{
private
Integer
welcomeDuration
;
return
isDelete
;
}
public
void
setIsDelete
(
Integer
isDelete
)
{
@ApiModelProperty
(
"关键词分类ID"
)
this
.
isDelete
=
isDelete
;
private
Long
keywordClassifyId
;
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/entity/PcloudRobotWelcome.java
View file @
da97c757
...
@@ -16,6 +16,9 @@ public class PcloudRobotWelcome extends BaseEntity {
...
@@ -16,6 +16,9 @@ public class PcloudRobotWelcome extends BaseEntity {
@ApiModelProperty
(
"全平台个人号id"
)
@ApiModelProperty
(
"全平台个人号id"
)
private
Long
pcloudRobotId
;
private
Long
pcloudRobotId
;
@ApiModelProperty
(
"全平台分类id"
)
private
Long
pcloudClassifyId
;
@ApiModelProperty
(
"类型 1 文字 2 图片 3音频 4PDF"
)
@ApiModelProperty
(
"类型 1 文字 2 图片 3音频 4PDF"
)
private
Integer
replyType
;
private
Integer
replyType
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/facade/PcloudKeywordFacade.java
View file @
da97c757
...
@@ -196,4 +196,12 @@ public class PcloudKeywordFacade {
...
@@ -196,4 +196,12 @@ public class PcloudKeywordFacade {
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
return
new
ResponseDto
<>(
pcloudKeywordBiz
.
getPcloudNotKeywordList
(
keywordClassifyId
,
currentPage
,
numPerPage
));
return
new
ResponseDto
<>(
pcloudKeywordBiz
.
getPcloudNotKeywordList
(
keywordClassifyId
,
currentPage
,
numPerPage
));
}
}
@ApiOperation
(
"根据小号分类获取平台端关键词分类"
)
@GetMapping
(
"getKeywordClassifyByRobotClassifyId"
)
public
ResponseDto
<?>
getKeywordClassifyByRobotClassifyId
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
"robotClassifyId"
)
Long
robotClassifyId
)
throws
PermissionException
{
SessionUtil
.
getInfoToken4Redis
(
token
);
PcloudKeywordClassify
classify
=
pcloudKeywordClassifyBiz
.
getKeywordClassifyByRobotClassifyId
(
robotClassifyId
);
return
new
ResponseDto
<>(
classify
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/facade/PcloudRobotClassifyFacade.java
View file @
da97c757
package
com
.
pcloud
.
book
.
pcloudkeyword
.
facade
;
package
com
.
pcloud
.
book
.
pcloudkeyword
.
facade
;
import
com.pcloud.book.pcloudkeyword.biz.PcloudRobotClassifyBiz
;
import
com.pcloud.book.pcloudkeyword.biz.PcloudRobotClassifyBiz
;
import
com.pcloud.book.pcloudkeyword.dto.ClassifyWelcomeDTO
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobotClassify
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobotClassify
;
import
com.pcloud.book.pcloudkeyword.facade.response.PcloudRobotClassifyResponseVO
;
import
com.pcloud.book.pcloudkeyword.facade.response.PcloudRobotClassifyResponseVO
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.dto.ResponseDto
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
com.pcloud.common.exceptions.BizException
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
com.pcloud.common.permission.PermissionException
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
com.pcloud.common.utils.SessionUtil
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.Request
Param
;
import
io.swagger.annotations.Api
Param
;
import
org.springframework.web.bind.annotation.
RestController
;
import
org.springframework.web.bind.annotation.
*
;
import
java.util.List
;
import
java.util.List
;
...
@@ -41,4 +42,44 @@ public class PcloudRobotClassifyFacade {
...
@@ -41,4 +42,44 @@ public class PcloudRobotClassifyFacade {
return
new
ResponseDto
<>();
return
new
ResponseDto
<>();
}
}
@GetMapping
(
"getClassifyById"
)
public
ResponseDto
<
PcloudRobotClassify
>
getClassifyById
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
"id"
)
Long
id
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
return
new
ResponseDto
<>(
pcloudRobotClassifyBiz
.
getClassifyById
(
id
));
}
@GetMapping
(
"listClassifyByPage"
)
public
ResponseDto
<?>
listClassifyByPage
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
"currentPage"
)
Integer
currentPage
,
@RequestParam
(
"numPerPage"
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
return
new
ResponseDto
<>(
pcloudRobotClassifyBiz
.
listClassifyByPage
(
currentPage
,
numPerPage
));
}
@GetMapping
(
"getClassifyWelcome"
)
public
ResponseDto
<?>
getClassifyWelcome
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
"classifyId"
)
@ApiParam
(
"分类ID"
)
Long
classifyId
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
return
new
ResponseDto
<>(
pcloudRobotClassifyBiz
.
getClassifyWelcome
(
classifyId
));
}
@PostMapping
(
"updateClassifyWelcome"
)
public
ResponseDto
<?>
updateClassifyWelcome
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestBody
ClassifyWelcomeDTO
classifyWelcomeDTO
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
pcloudRobotClassifyBiz
.
updateClassifyWelcome
(
classifyWelcomeDTO
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
"更新小号分类关键词分类"
)
@PostMapping
(
"updateRobotClassifyKeywordClassify"
)
public
ResponseDto
<?>
updateRobotClassifyKeywordClassify
(
@RequestBody
PcloudRobotClassify
classify
)
{
pcloudRobotClassifyBiz
.
updateRobotClassifyKeywordClassify
(
classify
);
return
new
ResponseDto
<>();
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/facade/PcloudRobotFacade.java
View file @
da97c757
...
@@ -48,16 +48,29 @@ public class PcloudRobotFacade {
...
@@ -48,16 +48,29 @@ public class PcloudRobotFacade {
return
new
ResponseDto
<>();
return
new
ResponseDto
<>();
}
}
@ApiOperation
(
"修改机器人状态"
)
@GetMapping
(
"/updateRobotState"
)
ResponseDto
<?>
updateRobotState
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
value
=
"id"
)
@ApiParam
(
"ID"
)
Long
id
,
@RequestParam
(
value
=
"state"
)
@ApiParam
(
"状态"
)
Integer
state
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
pcloudRobotBiz
.
updateRobotState
(
id
,
state
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
"获取全平台个人号列表"
)
@ApiOperation
(
"获取全平台个人号列表"
)
@GetMapping
(
"/getPcloudRobotList"
)
@GetMapping
(
"/getPcloudRobotList"
)
ResponseDto
<?>
getPcloudRobotList
(
ResponseDto
<?>
getPcloudRobotList
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
value
=
"classifyId"
,
required
=
false
)
@ApiParam
(
"分类"
)
Integer
classifyId
,
@RequestParam
(
value
=
"nickName"
,
required
=
false
)
@ApiParam
(
"昵称"
)
String
nickName
,
@RequestParam
(
value
=
"nickName"
,
required
=
false
)
@ApiParam
(
"昵称"
)
String
nickName
,
@RequestParam
(
"currentPage"
)
Integer
currentPage
,
@RequestParam
(
"currentPage"
)
Integer
currentPage
,
@RequestParam
(
"numPerPage"
)
Integer
numPerPage
@RequestParam
(
"numPerPage"
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
{
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
return
new
ResponseDto
<>(
pcloudRobotBiz
.
getPcloudRobotList
(
nickName
,
currentPage
,
numPerPage
));
return
new
ResponseDto
<>(
pcloudRobotBiz
.
getPcloudRobotList
(
classifyId
,
nickName
,
currentPage
,
numPerPage
));
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/facade/response/PcloudRobotClassifyResponseVO.java
View file @
da97c757
package
com
.
pcloud
.
book
.
pcloudkeyword
.
facade
.
response
;
package
com
.
pcloud
.
book
.
pcloudkeyword
.
facade
.
response
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
import
lombok.Data
;
@ApiModel
@ApiModel
@Data
@Data
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
PcloudRobotClassifyResponseVO
{
public
class
PcloudRobotClassifyResponseVO
{
private
Long
id
;
private
Long
id
;
private
String
classifyName
;
private
String
classifyName
;
private
String
linkUrl
;
private
String
qrcodeUrl
;
private
Integer
robotCount
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/set/PcloudRobotSet.java
0 → 100644
View file @
da97c757
package
com
.
pcloud
.
book
.
pcloudkeyword
.
set
;
import
com.pcloud.book.consumer.content.ResourceConsr
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobotWelcome
;
import
com.pcloud.book.pcloudkeyword.enums.WelcomeReplyTypeEnum
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.contentcenter.resource.dto.ResourceDTO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Component
(
"pcloudRobotSet"
)
public
class
PcloudRobotSet
{
@Autowired
private
ResourceConsr
resourceConsr
;
@ParamLog
(
"填充欢迎语回复"
)
public
void
fillRobotWelcome
(
List
<
PcloudRobotWelcome
>
robotWelcomeList
)
{
if
(
ListUtils
.
isEmpty
(
robotWelcomeList
)){
return
;
}
List
<
Long
>
resourceIds
=
new
ArrayList
<>();
for
(
PcloudRobotWelcome
robotWelcome
:
robotWelcomeList
){
Integer
type
=
robotWelcome
.
getReplyType
();
if
(
WelcomeReplyTypeEnum
.
RESOURCE
.
value
.
equals
(
type
)){
resourceIds
.
add
(
robotWelcome
.
getResourceId
());
}
}
Map
<
Long
,
ResourceDTO
>
resourceDTOMap
=
new
HashMap
<>();
if
(!
ListUtils
.
isEmpty
(
resourceIds
)){
resourceDTOMap
=
resourceConsr
.
mapByIds
(
resourceIds
);
}
for
(
PcloudRobotWelcome
robotWelcome
:
robotWelcomeList
){
Integer
type
=
robotWelcome
.
getReplyType
();
if
(
WelcomeReplyTypeEnum
.
RESOURCE
.
value
.
equals
(
type
)){
ResourceDTO
resourceDTO
=
resourceDTOMap
.
get
(
robotWelcome
.
getResourceId
());
if
(
resourceDTO
!=
null
){
robotWelcome
.
setResourceName
(
resourceDTO
.
getResourceName
());
robotWelcome
.
setResourceUrl
(
resourceDTO
.
getFileUrl
());
robotWelcome
.
setResourceTypeCode
(
resourceDTO
.
getTypeCode
());
robotWelcome
.
setResourceTypeName
(
resourceDTO
.
getTypeName
());
robotWelcome
.
setFileType
(
resourceDTO
.
getFileType
());
robotWelcome
.
setFileSize
(
resourceDTO
.
getFileSize
());
robotWelcome
.
setResourcePdfItems
(
resourceDTO
.
getResourcePdfItems
());
robotWelcome
.
setResourceOfficeItemDTOs
(
resourceDTO
.
getResourceOfficeItemDTOs
());
}
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/biz/impl/SelfPushBizImpl.java
View file @
da97c757
...
@@ -445,6 +445,9 @@ public class SelfPushBizImpl implements SelfPushBiz {
...
@@ -445,6 +445,9 @@ public class SelfPushBizImpl implements SelfPushBiz {
map
.
put
(
"pushStatus"
,
status
);
map
.
put
(
"pushStatus"
,
status
);
map
.
put
(
"partyId"
,
partyId
);
map
.
put
(
"partyId"
,
partyId
);
PageBeanNew
<
SelfPushRecordDTO
>
pageBeanNew
=
selfPushItemDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"listSelfPushRecord"
);
PageBeanNew
<
SelfPushRecordDTO
>
pageBeanNew
=
selfPushItemDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"listSelfPushRecord"
);
if
(
null
==
pageBeanNew
||
ListUtils
.
isEmpty
(
pageBeanNew
.
getRecordList
()))
{
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
0
,
new
ArrayList
<>());
}
for
(
SelfPushRecordDTO
dto:
pageBeanNew
.
getRecordList
())
{
for
(
SelfPushRecordDTO
dto:
pageBeanNew
.
getRecordList
())
{
String
realSendTime
=
""
;
String
realSendTime
=
""
;
if
(
dto
.
getPushType
()!=
null
&&
dto
.
getPushType
()==
1
){
if
(
dto
.
getPushType
()!=
null
&&
dto
.
getPushType
()==
1
){
...
@@ -485,9 +488,6 @@ public class SelfPushBizImpl implements SelfPushBiz {
...
@@ -485,9 +488,6 @@ public class SelfPushBizImpl implements SelfPushBiz {
dto
.
setSelfPushItemList
(
selfPushItemList
);
dto
.
setSelfPushItemList
(
selfPushItemList
);
}
}
if
(
null
==
pageBeanNew
||
ListUtils
.
isEmpty
(
pageBeanNew
.
getRecordList
()))
{
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
0
,
new
ArrayList
<>());
}
List
<
String
>
wxIds
=
pageBeanNew
.
getRecordList
().
stream
().
filter
(
s
->
!
StringUtil
.
isEmpty
(
s
.
getAltId
())).
map
(
SelfPushRecordDTO:
:
getAltId
).
distinct
().
collect
(
Collectors
.
toList
());
List
<
String
>
wxIds
=
pageBeanNew
.
getRecordList
().
stream
().
filter
(
s
->
!
StringUtil
.
isEmpty
(
s
.
getAltId
())).
map
(
SelfPushRecordDTO:
:
getAltId
).
distinct
().
collect
(
Collectors
.
toList
());
Map
<
String
,
GroupUserDTO
>
robotMap
=
new
HashMap
<>();
Map
<
String
,
GroupUserDTO
>
robotMap
=
new
HashMap
<>();
if
(!
ListUtils
.
isEmpty
(
wxIds
)){
if
(!
ListUtils
.
isEmpty
(
wxIds
)){
...
...
pcloud-service-book/src/main/resources/mapper/guide/PcloudGuideMapper.xml
View file @
da97c757
...
@@ -26,10 +26,10 @@
...
@@ -26,10 +26,10 @@
<insert
id=
"insert"
parameterType=
"com.pcloud.book.guide.entity.PcloudGuide"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.guide.entity.PcloudGuide"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into pcloud_guide (type, create_time,
insert into pcloud_guide (type, create_time,
update_time, robot_wx_id, time_span,
update_time, robot_wx_id, time_span,
seq_num)
seq_num
, pcloud_classify_id
)
values (#{type,jdbcType=VARCHAR}, now(),
values (#{type,jdbcType=VARCHAR}, now(),
now(), #{robotWxId,jdbcType=INTEGER}, #{timeSpan,jdbcType=INTEGER},
now(), #{robotWxId,jdbcType=INTEGER}, #{timeSpan,jdbcType=INTEGER},
#{seqNum,jdbcType=INTEGER})
#{seqNum,jdbcType=INTEGER}
, #{pcloudClassifyId}
)
</insert>
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.pcloud.book.guide.entity.PcloudGuide"
>
<insert
id=
"insertSelective"
parameterType=
"com.pcloud.book.guide.entity.PcloudGuide"
>
insert into pcloud_guide
insert into pcloud_guide
...
@@ -118,7 +118,10 @@
...
@@ -118,7 +118,10 @@
<if
test=
"robotWxId != null"
>
<if
test=
"robotWxId != null"
>
and robot_wx_id = #{robotWxId}
and robot_wx_id = #{robotWxId}
</if>
</if>
<if
test=
"robotWxId == null"
>
<if
test=
"pcloudClassifyId != null"
>
and pcloud_classify_id = #{pcloudClassifyId}
</if>
<if
test=
"robotWxId == null and pcloudClassifyId == null"
>
and type = 0
and type = 0
</if>
</if>
</select>
</select>
...
@@ -137,12 +140,15 @@
...
@@ -137,12 +140,15 @@
<if
test=
"robotWxId != null"
>
<if
test=
"robotWxId != null"
>
and robot_wx_id = #{robotWxId}
and robot_wx_id = #{robotWxId}
</if>
</if>
<if
test=
"robotWxId == null"
>
<if
test=
"robotWxId == null
and pcloudClassifyId == null
"
>
and type = 0
and type = 0
</if>
</if>
<if
test=
"search != null"
>
<if
test=
"search != null"
>
and content like concat('%', #{search}, '%')
and content like concat('%', #{search}, '%')
</if>
</if>
<if
test=
"pcloudClassifyId != null"
>
and pcloud_classify_id = #{pcloudClassifyId}
</if>
GROUP BY a.id
GROUP BY a.id
) s
) s
</select>
</select>
...
@@ -161,12 +167,15 @@
...
@@ -161,12 +167,15 @@
<if
test=
"robotWxId != null"
>
<if
test=
"robotWxId != null"
>
and robot_wx_id = #{robotWxId}
and robot_wx_id = #{robotWxId}
</if>
</if>
<if
test=
"robotWxId == null"
>
<if
test=
"robotWxId == null
and pcloudClassifyId == null
"
>
and type = 0
and type = 0
</if>
</if>
<if
test=
"search != null"
>
<if
test=
"search != null"
>
and content like concat('%', #{search}, '%')
and content like concat('%', #{search}, '%')
</if>
</if>
<if
test=
"pcloudClassifyId != null"
>
and pcloud_classify_id = #{pcloudClassifyId}
</if>
GROUP BY a.id
GROUP BY a.id
ORDER BY seq_num ASC
ORDER BY seq_num ASC
limit #{pageNum}, #{numPerPage}
limit #{pageNum}, #{numPerPage}
...
@@ -202,4 +211,16 @@
...
@@ -202,4 +211,16 @@
<select
id=
"listPcloudGuideIds"
resultType=
"Integer"
>
<select
id=
"listPcloudGuideIds"
resultType=
"Integer"
>
select id from pcloud_guide where robot_wx_id = #{robotWxId}
select id from pcloud_guide where robot_wx_id = #{robotWxId}
</select>
</select>
<select
id=
"getFirstByClassifyId"
resultMap=
"BaseResultMap"
>
SELECT
id, time_span, seq_num
FROM
pcloud_guide
WHERE
pcloud_classify_id = #{pcloudClassifyId}
ORDER BY
seq_num ASC
LIMIT #{num}, 1
</select>
</mapper>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/guide/PcloudRobotSilenceMapper.xml
View file @
da97c757
...
@@ -7,9 +7,10 @@
...
@@ -7,9 +7,10 @@
<result
column=
"silence_duration"
property=
"silenceDuration"
jdbcType=
"INTEGER"
/>
<result
column=
"silence_duration"
property=
"silenceDuration"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"pcloud_classify_id"
property=
"pcloudClassifyId"
jdbcType=
"INTEGER"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, robot_wx_id, silence_duration, create_time, update_time
id, robot_wx_id, silence_duration, create_time, update_time
, pcloud_classify_id
</sql>
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Integer"
>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Integer"
>
select
select
...
@@ -23,9 +24,9 @@
...
@@ -23,9 +24,9 @@
</delete>
</delete>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.guide.entity.PcloudRobotSilence"
>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.guide.entity.PcloudRobotSilence"
>
insert into pcloud_robot_silence (id, robot_wx_id, silence_duration,
insert into pcloud_robot_silence (id, robot_wx_id, silence_duration,
create_time, update_time)
create_time, update_time
, pcloud_classify_id
)
values (#{id,jdbcType=INTEGER}, #{robotWxId,jdbcType=VARCHAR}, #{silenceDuration,jdbcType=INTEGER},
values (#{id,jdbcType=INTEGER}, #{robotWxId,jdbcType=VARCHAR}, #{silenceDuration,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
, #{pcloudClassifyId}
)
</insert>
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.pcloud.book.guide.entity.PcloudRobotSilence"
>
<insert
id=
"insertSelective"
parameterType=
"com.pcloud.book.guide.entity.PcloudRobotSilence"
>
insert into pcloud_robot_silence
insert into pcloud_robot_silence
...
@@ -84,9 +85,7 @@
...
@@ -84,9 +85,7 @@
</update>
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.pcloud.book.guide.entity.PcloudRobotSilence"
>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.pcloud.book.guide.entity.PcloudRobotSilence"
>
update pcloud_robot_silence
update pcloud_robot_silence
set robot_wx_id = #{robotWxId,jdbcType=VARCHAR},
set silence_duration = #{silenceDuration,jdbcType=INTEGER},
silence_duration = #{silenceDuration,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</update>
...
@@ -98,14 +97,30 @@
...
@@ -98,14 +97,30 @@
<!--根据机器人wxid获取缄默时长-->
<!--根据机器人wxid获取缄默时长-->
<select
id=
"getSilenceDurationByRobotWxId"
resultType=
"java.lang.Integer"
>
<select
id=
"getSilenceDurationByRobotWxId"
resultType=
"java.lang.Integer"
>
SELECT silence_duration FROM pcloud_robot_silence WHERE robot_wx_id = #{wxId}
SELECT silence_duration FROM pcloud_robot_silence WHERE 1=1
<if
test=
"wxId != null"
>
and robot_wx_id = #{wxId}
</if>
<if
test=
"pcloudClassifyId != null"
>
and pcloud_classify_id = #{pcloudClassifyId}
</if>
</select>
</select>
<!--设置机器人缄默时长-->
<!--设置机器人缄默时长-->
<update
id=
"setSilenceDuration"
>
<update
id=
"setSilenceDuration"
>
INSERT INTO pcloud_robot_silence (robot_wx_id,silence_duration,create_time) VALUE(#{robotWxId},#{silenceDuration},NOW())
INSERT INTO pcloud_robot_silence (robot_wx_id,silence_duration,create_time, pcloud_classify_id)
VALUE(#{robotWxId},#{silenceDuration},NOW(), #{pcloudClassifyId})
ON DUPLICATE KEY UPDATE robot_wx_id=#{robotWxId},silence_duration=#{silenceDuration},update_time=NOW()
ON DUPLICATE KEY UPDATE robot_wx_id=#{robotWxId},silence_duration=#{silenceDuration},update_time=NOW()
</update>
</update>
<select
id=
"get"
resultMap=
"BaseResultMap"
>
SELECT id, robot_wx_id, silence_duration, create_time, update_time, pcloud_classify_id FROM pcloud_robot_silence WHERE 1=1
<if
test=
"wxId != null"
>
and robot_wx_id = #{wxId}
</if>
<if
test=
"pcloudClassifyId != null"
>
and pcloud_classify_id = #{pcloudClassifyId}
</if>
</select>
</mapper>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/pcloudkeyword/PcloudRobot.Mapper.xml
View file @
da97c757
...
@@ -135,20 +135,18 @@
...
@@ -135,20 +135,18 @@
r.head head,
r.head head,
r.qrcode_url qrcodeUrl,
r.qrcode_url qrcodeUrl,
r.robot_type robotType,
r.robot_type robotType,
r.keyword_classify_id keywordClassifyId,
r.state state,
r.state state,
r.unique_number uniqueNumber,
r.unique_number uniqueNumber
r.welcome_duration welcomeDuration,
rc.classify_name classifyName
FROM
FROM
pcloud_robot r
pcloud_robot r
left join pcloud_robot_classify rc
on r.robot_type = rc.id
WHERE
WHERE
1=1
1=1
<if
test=
"nickName!=null"
>
<if
test=
"nickName!=null"
>
and r.nick_name like concat('%', #{nickName}, '%')
and r.nick_name like concat('%', #{nickName}, '%')
</if>
</if>
<if
test=
"classifyId!=null"
>
and r.robot_type = #{classifyId}
</if>
</select>
</select>
<select
id=
"getPcloudKeywordRobotCount"
parameterType=
"map"
resultType=
"integer"
>
<select
id=
"getPcloudKeywordRobotCount"
parameterType=
"map"
resultType=
"integer"
>
...
@@ -252,4 +250,16 @@
...
@@ -252,4 +250,16 @@
and state = 1
and state = 1
</select>
</select>
<select
id=
"getRobotCountByClassifyId"
parameterType=
"long"
resultType=
"int"
>
select COUNT(DISTINCT wx_id)
from pcloud_robot
where robot_type = #{classifyId}
</select>
<update
id=
"updateRobotState"
parameterType=
"map"
>
update pcloud_robot set
state = #{state}
where id=#{id}
</update>
</mapper>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/pcloudkeyword/PcloudRobotClassify.Mapper.xml
View file @
da97c757
...
@@ -5,10 +5,21 @@
...
@@ -5,10 +5,21 @@
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"classify_name"
property=
"classifyName"
jdbcType=
"VARCHAR"
/>
<result
column=
"classify_name"
property=
"classifyName"
jdbcType=
"VARCHAR"
/>
<result
column=
"is_delete"
property=
"isDelete"
jdbcType=
"INTEGER"
/>
<result
column=
"is_delete"
property=
"isDelete"
jdbcType=
"INTEGER"
/>
<result
column=
"link_url"
property=
"linkUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"qrcode_url"
property=
"qrcodeUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"keyword_classify_id"
property=
"keywordClassifyId"
jdbcType=
"VARCHAR"
/>
<result
column=
"welcome_duration"
property=
"welcomeDuration"
jdbcType=
"INTEGER"
/>
</resultMap>
</resultMap>
<resultMap
id=
"pageResultMap"
type=
"com.pcloud.book.pcloudkeyword.facade.response.PcloudRobotClassifyResponseVO"
>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"classify_name"
property=
"classifyName"
jdbcType=
"VARCHAR"
/>
<result
column=
"qrcode_url"
property=
"qrcodeUrl"
jdbcType=
"VARCHAR"
/>
<association
property=
"robotCount"
column=
"id"
fetchType=
"eager"
select=
"com.pcloud.book.pcloudkeyword.dao.impl.PcloudRobotDaoImpl.getRobotCountByClassifyId"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, classify_name,
is_delete
id, classify_name,
link_url, qrcode_url,keyword_classify_id, is_delete, welcome_duration
</sql>
</sql>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.pcloudkeyword.entity.PcloudRobotClassify"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.pcloudkeyword.entity.PcloudRobotClassify"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
...
@@ -23,9 +34,24 @@
...
@@ -23,9 +34,24 @@
</insert>
</insert>
<update
id=
"update"
parameterType=
"com.pcloud.book.pcloudkeyword.entity.PcloudRobotClassify"
>
<update
id=
"update"
parameterType=
"com.pcloud.book.pcloudkeyword.entity.PcloudRobotClassify"
>
update pcloud_robot set
update pcloud_robot
classify_name = #{classifyName},
<set>
is_delete = #{isDelete}
<if
test=
"classifyName != null"
>
classify_name = #{classifyName},
</if>
<if
test=
"linkUrl != null"
>
link_url = #{linkUrl},
</if>
<if
test=
"qrcodeUrl != null"
>
qrcode_url = #{qrcodeUrl},
</if>
<if
test=
"isDelete != null"
>
is_delete = #{isDelete},
</if>
<if
test=
"welcomeDuration != null"
>
welcome_duration = #{welcomeDuration},
</if>
</set>
where id=#{id}
where id=#{id}
</update>
</update>
...
@@ -35,4 +61,28 @@
...
@@ -35,4 +61,28 @@
from pcloud_robot_classify where is_delete = 0
from pcloud_robot_classify where is_delete = 0
</select>
</select>
<select
id=
"getById"
parameterType=
"long"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from pcloud_robot_classify where id=#{id}
</select>
<select
id=
"listClassifyByPage"
resultMap=
"pageResultMap"
>
select
id, classify_name, qrcode_url
from pcloud_robot_classify
where is_delete = 0
</select>
<update
id=
"updateRobotClassifyKeywordClassify"
parameterType=
"map"
>
update pcloud_robot_classify
set keyword_classify_id=#{keywordClassifyId}
where id=#{id}
</update>
<update
id=
"updateWelcomeDuration"
parameterType=
"map"
>
update pcloud_robot_classify
set welcome_duration = #{welcomeDuration}
where id=#{id}
</update>
</mapper>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/pcloudkeyword/PcloudRobotWelcome.Mapper.xml
View file @
da97c757
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
<resultMap
id=
"BaseResultMap"
type=
"PcloudRobotWelcome"
>
<resultMap
id=
"BaseResultMap"
type=
"PcloudRobotWelcome"
>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"pcloud_robot_id"
property=
"pcloudRobotId"
jdbcType=
"BIGINT"
/>
<result
column=
"pcloud_robot_id"
property=
"pcloudRobotId"
jdbcType=
"BIGINT"
/>
<result
column=
"pcloud_classify_id"
property=
"pcloudClassifyId"
jdbcType=
"BIGINT"
/>
<result
column=
"reply_type"
property=
"replyType"
jdbcType=
"INTEGER"
/>
<result
column=
"reply_type"
property=
"replyType"
jdbcType=
"INTEGER"
/>
<result
column=
"content"
property=
"content"
jdbcType=
"VARCHAR"
/>
<result
column=
"content"
property=
"content"
jdbcType=
"VARCHAR"
/>
<result
column=
"pic_url"
property=
"picUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"pic_url"
property=
"picUrl"
jdbcType=
"VARCHAR"
/>
...
@@ -16,7 +17,7 @@
...
@@ -16,7 +17,7 @@
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, pcloud_robot_id, reply_type, content, pic_url, file_name, file_type, file_url,
id, pcloud_robot_id,
pcloud_classify_id,
reply_type, content, pic_url, file_name, file_type, file_url,
file_size, resource_id, create_time
file_size, resource_id, create_time
</sql>
</sql>
...
@@ -24,6 +25,7 @@
...
@@ -24,6 +25,7 @@
<insert
id=
"batchInsert"
parameterType=
"PcloudRobotWelcome"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"batchInsert"
parameterType=
"PcloudRobotWelcome"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into pcloud_robot_welcome (
insert into pcloud_robot_welcome (
pcloud_robot_id,
pcloud_robot_id,
pcloud_classify_id,
reply_type,
reply_type,
content,
content,
pic_url,
pic_url,
...
@@ -37,6 +39,7 @@
...
@@ -37,6 +39,7 @@
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
(
#{item.pcloudRobotId,jdbcType=BIGINT},
#{item.pcloudRobotId,jdbcType=BIGINT},
#{item.pcloudClassifyId,jdbcType=BIGINT},
#{item.replyType,jdbcType=INTEGER},
#{item.replyType,jdbcType=INTEGER},
#{item.content,jdbcType=VARCHAR},
#{item.content,jdbcType=VARCHAR},
#{item.picUrl,jdbcType=VARCHAR},
#{item.picUrl,jdbcType=VARCHAR},
...
@@ -55,9 +58,20 @@
...
@@ -55,9 +58,20 @@
where pcloud_robot_id = #{pcloudRobotId}
where pcloud_robot_id = #{pcloudRobotId}
</delete>
</delete>
<delete
id=
"deleteByPcloudClassifyId"
parameterType=
"long"
>
delete from pcloud_robot_welcome
where pcloud_classify_id = #{pcloudClassifyId}
</delete>
<select
id=
"getRobotWelcomeListByPcloudRobotId"
parameterType=
"long"
resultMap=
"BaseResultMap"
>
<select
id=
"getRobotWelcomeListByPcloudRobotId"
parameterType=
"long"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
select
<include
refid=
"Base_Column_List"
/>
from pcloud_robot_welcome
from pcloud_robot_welcome
where pcloud_robot_id = #{pcloudRobotId}
where pcloud_robot_id = #{pcloudRobotId}
</select>
</select>
<select
id=
"getRobotWelcomeListByPcloudClassifyId"
parameterType=
"long"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from pcloud_robot_welcome
where pcloud_classify_id = #{pcloudClassifyId}
</select>
</mapper>
</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