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
f05647f4
Commit
f05647f4
authored
Feb 16, 2020
by
吴博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
唤醒
parent
159d33f4
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
645 additions
and
72 deletions
+645
-72
RobotWakeUpConfigVO.java
...in/java/com/pcloud/book/guide/vo/RobotWakeUpConfigVO.java
+3
-0
RobotWakeUpMsgVO.java
.../main/java/com/pcloud/book/guide/vo/RobotWakeUpMsgVO.java
+6
-0
RobotWakeUpShowVO.java
...main/java/com/pcloud/book/guide/vo/RobotWakeUpShowVO.java
+8
-0
PcloudRobotWakeUpBiz.java
.../java/com/pcloud/book/guide/biz/PcloudRobotWakeUpBiz.java
+11
-2
PcloudRobotWakeUpBizImpl.java
.../pcloud/book/guide/biz/impl/PcloudRobotWakeUpBizImpl.java
+321
-64
WakeUpInfoDto.java
...rc/main/java/com/pcloud/book/guide/dto/WakeUpInfoDto.java
+1
-0
PcloudRobotWakeup.java
.../java/com/pcloud/book/guide/entity/PcloudRobotWakeup.java
+4
-0
PcloudRobotWakeupClassify.java
...m/pcloud/book/guide/entity/PcloudRobotWakeupClassify.java
+25
-0
PcloudWakeupMessage.java
...ava/com/pcloud/book/guide/entity/PcloudWakeupMessage.java
+10
-0
PcloudRobotWakeUpFacadeImpl.java
...d/book/guide/facade/impl/PcloudRobotWakeUpFacadeImpl.java
+42
-3
PcloudRobotWakeupClassifyMapper.java
...ud/book/guide/mapper/PcloudRobotWakeupClassifyMapper.java
+26
-0
PcloudRobotWakeupMapper.java
...com/pcloud/book/guide/mapper/PcloudRobotWakeupMapper.java
+9
-0
PcloudWakeupMessageMapper.java
...m/pcloud/book/guide/mapper/PcloudWakeupMessageMapper.java
+7
-0
PcloudRobotWakeUpServiceImpl.java
...loud/book/guide/service/PcloudRobotWakeUpServiceImpl.java
+4
-2
PcloudRobotDao.java
...ava/com/pcloud/book/pcloudkeyword/dao/PcloudRobotDao.java
+3
-0
PcloudRobotDaoImpl.java
...cloud/book/pcloudkeyword/dao/impl/PcloudRobotDaoImpl.java
+7
-0
PcloudRobotWakeupMapper.xml
...c/main/resources/mapper/guide/PcloudRobotWakeupMapper.xml
+37
-1
PcloudRobotWakeupMapperClassify.xml
...esources/mapper/guide/PcloudRobotWakeupMapperClassify.xml
+62
-0
PcloudWakeupMessageMapper.xml
...main/resources/mapper/guide/PcloudWakeupMessageMapper.xml
+45
-0
PcloudRobot.Mapper.xml
...ain/resources/mapper/pcloudkeyword/PcloudRobot.Mapper.xml
+14
-0
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/guide/vo/RobotWakeUpConfigVO.java
View file @
f05647f4
...
@@ -12,6 +12,9 @@ import java.util.List;
...
@@ -12,6 +12,9 @@ import java.util.List;
@ApiModel
(
description
=
"机器人唤醒配置"
)
@ApiModel
(
description
=
"机器人唤醒配置"
)
public
class
RobotWakeUpConfigVO
{
public
class
RobotWakeUpConfigVO
{
@ApiModelProperty
(
"唤醒id"
)
private
Integer
wakeUpId
;
@ApiModelProperty
(
"开始时间"
)
@ApiModelProperty
(
"开始时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
startTime
;
private
Date
startTime
;
...
...
pcloud-facade-book/src/main/java/com/pcloud/book/guide/vo/RobotWakeUpMsgVO.java
View file @
f05647f4
...
@@ -13,6 +13,9 @@ public class RobotWakeUpMsgVO {
...
@@ -13,6 +13,9 @@ public class RobotWakeUpMsgVO {
@ApiModelProperty
(
"消息类型 text image file"
)
@ApiModelProperty
(
"消息类型 text image file"
)
private
Integer
replyType
;
private
Integer
replyType
;
@ApiModelProperty
(
"消息类型 text image file"
)
private
String
type
;
@ApiModelProperty
(
"文本内容"
)
@ApiModelProperty
(
"文本内容"
)
private
String
content
;
private
String
content
;
...
@@ -22,6 +25,9 @@ public class RobotWakeUpMsgVO {
...
@@ -22,6 +25,9 @@ public class RobotWakeUpMsgVO {
@ApiModelProperty
(
"文件地址"
)
@ApiModelProperty
(
"文件地址"
)
private
String
fileUrl
;
private
String
fileUrl
;
@ApiModelProperty
(
"文件地址"
)
private
String
fileName
;
@ApiModelProperty
(
"排序值"
)
@ApiModelProperty
(
"排序值"
)
private
Integer
seqNum
;
private
Integer
seqNum
;
...
...
pcloud-facade-book/src/main/java/com/pcloud/book/guide/vo/RobotWakeUpShowVO.java
View file @
f05647f4
package
com
.
pcloud
.
book
.
guide
.
vo
;
package
com
.
pcloud
.
book
.
guide
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pcloud.book.pcloudKeyword.dto.RobotClassifyDTO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -12,6 +14,10 @@ import java.util.List;
...
@@ -12,6 +14,10 @@ import java.util.List;
@Data
@Data
public
class
RobotWakeUpShowVO
{
public
class
RobotWakeUpShowVO
{
@ApiModelProperty
(
"唤醒id"
)
private
Integer
wakeUpId
;
@ApiModelProperty
(
"开始时间"
)
@ApiModelProperty
(
"开始时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
startTime
;
private
Date
startTime
;
...
@@ -28,5 +34,7 @@ public class RobotWakeUpShowVO {
...
@@ -28,5 +34,7 @@ public class RobotWakeUpShowVO {
@ApiModelProperty
(
"回复消息列表"
)
@ApiModelProperty
(
"回复消息列表"
)
private
List
<
RobotWakeUpMsgVO
>
msgList
;
private
List
<
RobotWakeUpMsgVO
>
msgList
;
@ApiModelProperty
(
"机器人分类列表"
)
private
List
<
RobotClassifyDTO
>
classifyDTOList
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/guide/biz/PcloudRobotWakeUpBiz.java
View file @
f05647f4
...
@@ -3,6 +3,7 @@ package com.pcloud.book.guide.biz;
...
@@ -3,6 +3,7 @@ package com.pcloud.book.guide.biz;
import
com.pcloud.book.guide.vo.RobotWakeUpConfigVO
;
import
com.pcloud.book.guide.vo.RobotWakeUpConfigVO
;
import
com.pcloud.book.guide.vo.RobotWakeUpShowVO
;
import
com.pcloud.book.guide.vo.RobotWakeUpShowVO
;
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
;
...
@@ -13,11 +14,19 @@ public interface PcloudRobotWakeUpBiz {
...
@@ -13,11 +14,19 @@ public interface PcloudRobotWakeUpBiz {
void
robotWakeUpRemove
();
void
robotWakeUpRemove
();
RobotWakeUpShowVO
getRobotWakeUpConfig
();
RobotWakeUpShowVO
getRobotWakeUpConfig
(
Integer
wakeUpId
);
void
doJob
();
void
doJob
(
Integer
wakeUpId
);
List
<
PcloudRobotClassifyResponseVO
>
listAllClassify
();
List
<
PcloudRobotClassifyResponseVO
>
listAllClassify
();
void
copyRobotWakeUp
(
String
sourceWxId
,
String
targetWxId
);
void
copyRobotWakeUp
(
String
sourceWxId
,
String
targetWxId
);
void
addrobotWakeUpConfig
(
RobotWakeUpConfigVO
robotWakeUpConfigVO
);
PageBeanNew
<
RobotWakeUpShowVO
>
getRobotWakeUpConfigList
(
Integer
currentPage
,
Integer
numPerPage
);
void
deleterobotWakeUp
(
Integer
wakeUpid
);
void
updaterobotWakeUp
(
RobotWakeUpConfigVO
robotWakeUpConfigVO
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/guide/biz/impl/PcloudRobotWakeUpBizImpl.java
View file @
f05647f4
package
com
.
pcloud
.
book
.
guide
.
biz
.
impl
;
package
com
.
pcloud
.
book
.
guide
.
biz
.
impl
;
import
com.google.common.collect.Lists
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.guide.biz.PcloudRobotWakeUpBiz
;
import
com.pcloud.book.guide.biz.PcloudRobotWakeUpBiz
;
import
com.pcloud.book.guide.dto.WakeUpInfoDto
;
import
com.pcloud.book.guide.dto.WakeUpInfoDto
;
import
com.pcloud.book.guide.entity.PcloudRobotWakeup
;
import
com.pcloud.book.guide.entity.PcloudRobotWakeup
;
import
com.pcloud.book.guide.entity.PcloudRobotWakeupClassify
;
import
com.pcloud.book.guide.entity.PcloudWakeupMessage
;
import
com.pcloud.book.guide.entity.PcloudWakeupMessage
;
import
com.pcloud.book.guide.mapper.PcloudRobotWakeupClassifyMapper
;
import
com.pcloud.book.guide.mapper.PcloudRobotWakeupMapper
;
import
com.pcloud.book.guide.mapper.PcloudRobotWakeupMapper
;
import
com.pcloud.book.guide.mapper.PcloudWakeupMessageMapper
;
import
com.pcloud.book.guide.mapper.PcloudWakeupMessageMapper
;
import
com.pcloud.book.guide.vo.ClassifyInfoVO
;
import
com.pcloud.book.guide.vo.RobotWakeUpConfigVO
;
import
com.pcloud.book.guide.vo.RobotWakeUpConfigVO
;
import
com.pcloud.book.guide.vo.RobotWakeUpMsgVO
;
import
com.pcloud.book.guide.vo.RobotWakeUpMsgVO
;
import
com.pcloud.book.guide.vo.RobotWakeUpShowVO
;
import
com.pcloud.book.guide.vo.RobotWakeUpShowVO
;
import
com.pcloud.book.pcloudKeyword.dto.RobotClassifyDTO
;
import
com.pcloud.book.pcloudkeyword.biz.PcloudRobotBiz
;
import
com.pcloud.book.pcloudkeyword.biz.PcloudRobotBiz
;
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.facade.response.PcloudRobotClassifyResponseVO
;
import
com.pcloud.book.pcloudkeyword.facade.response.PcloudRobotClassifyResponseVO
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.ParamCheck
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.utils.DateUtils
;
import
com.pcloud.common.utils.DateUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
...
@@ -28,12 +36,15 @@ import com.sdk.wxgroup.SendPicMessageVO;
...
@@ -28,12 +36,15 @@ import com.sdk.wxgroup.SendPicMessageVO;
import
com.sdk.wxgroup.SendTextMessageVO
;
import
com.sdk.wxgroup.SendTextMessageVO
;
import
com.sdk.wxgroup.WxGroupSDK
;
import
com.sdk.wxgroup.WxGroupSDK
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.codehaus.jackson.JsonParseException
;
import
org.codehaus.jackson.JsonParseException
;
import
org.quartz.SchedulerException
;
import
org.quartz.SchedulerException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
static
com
.
pcloud
.
book
.
guide
.
constant
.
PcloudGuideRedisConstant
.*;
import
static
com
.
pcloud
.
book
.
guide
.
constant
.
PcloudGuideRedisConstant
.*;
...
@@ -55,6 +66,8 @@ public class PcloudRobotWakeUpBizImpl implements PcloudRobotWakeUpBiz {
...
@@ -55,6 +66,8 @@ public class PcloudRobotWakeUpBizImpl implements PcloudRobotWakeUpBiz {
@Autowired
@Autowired
private
PcloudRobotBiz
pcloudRobotBiz
;
private
PcloudRobotBiz
pcloudRobotBiz
;
@Autowired
private
PcloudRobotWakeupClassifyMapper
pcloudRobotWakeupClassifyMapper
;
@Override
@Override
public
void
robotWakeUpConfig
(
RobotWakeUpConfigVO
robotWakeUpConfigVO
)
{
public
void
robotWakeUpConfig
(
RobotWakeUpConfigVO
robotWakeUpConfigVO
)
{
...
@@ -118,16 +131,16 @@ public class PcloudRobotWakeUpBizImpl implements PcloudRobotWakeUpBiz {
...
@@ -118,16 +131,16 @@ public class PcloudRobotWakeUpBizImpl implements PcloudRobotWakeUpBiz {
String
cron
=
"0 0 0/$ * * ? "
;
String
cron
=
"0 0 0/$ * * ? "
;
cron
=
cron
.
replace
(
"$"
,
String
.
valueOf
(
cycle
));
cron
=
cron
.
replace
(
"$"
,
String
.
valueOf
(
cycle
));
createCronJob
(
cron
);
createCronJob
(
cron
,
null
);
}
}
private
void
createCronJob
(
String
cronStr
)
{
private
void
createCronJob
(
String
cronStr
,
Integer
wakeUpId
)
{
try
{
try
{
scheduleService
.
deleteJob
(
PCLOUD_WAKE_UP_CRON_JOB
,
"book"
)
;
String
jobName
=
PCLOUD_WAKE_UP_CRON_JOB
+
":"
+
wakeUpId
;
ScheduleJob
job
=
new
ScheduleJob
();
ScheduleJob
job
=
new
ScheduleJob
();
//定时器任务
//定时器任务
job
.
setJobName
(
PCLOUD_WAKE_UP_CRON_JOB
);
job
.
setJobName
(
jobName
);
//cron表达式
//cron表达式
job
.
setCronExpression
(
cronStr
);
job
.
setCronExpression
(
cronStr
);
//定时器分组
//定时器分组
...
@@ -140,7 +153,8 @@ public class PcloudRobotWakeUpBizImpl implements PcloudRobotWakeUpBiz {
...
@@ -140,7 +153,8 @@ public class PcloudRobotWakeUpBizImpl implements PcloudRobotWakeUpBiz {
//设置回调参数
//设置回调参数
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"jobName"
,
PCLOUD_WAKE_UP_CRON_JOB
);
map
.
put
(
"jobName"
,
jobName
);
map
.
put
(
"wakeUpId"
,
wakeUpId
);
param
.
setParamMap
(
map
);
param
.
setParamMap
(
map
);
Map
<
String
,
Object
>
scheduleMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
scheduleMap
=
new
HashMap
<>();
scheduleMap
.
put
(
"scheduleJob"
,
job
);
scheduleMap
.
put
(
"scheduleJob"
,
job
);
...
@@ -164,69 +178,37 @@ public class PcloudRobotWakeUpBizImpl implements PcloudRobotWakeUpBiz {
...
@@ -164,69 +178,37 @@ public class PcloudRobotWakeUpBizImpl implements PcloudRobotWakeUpBiz {
}
}
@Override
@Override
public
RobotWakeUpShowVO
getRobotWakeUpConfig
()
{
public
RobotWakeUpShowVO
getRobotWakeUpConfig
(
Integer
wakeUpId
)
{
RobotWakeUpShowVO
robotWakeUpShowVO
=
new
RobotWakeUpShowVO
();
RobotWakeUpShowVO
robotWakeUpShowVO
=
pcloudRobotWakeupMapper
.
getRobotWakeUpConfigById
(
wakeUpId
);
// 配置信息
setDays
(
Lists
.
newArrayList
(
robotWakeUpShowVO
));
PcloudRobotWakeup
pcloudRobotWakeup
=
pcloudRobotWakeupMapper
.
selectOne
();
setMessage
(
Lists
.
newArrayList
(
robotWakeUpShowVO
));
if
(
pcloudRobotWakeup
==
null
)
{
return
robotWakeUpShowVO
;
}
robotWakeUpShowVO
.
setCycle
(
pcloudRobotWakeup
.
getCycle
());
Integer
last
=
pcloudRobotWakeup
.
getLast
();
if
(
last
==
3
)
{
last
=
1
;
}
else
if
(
last
==
7
)
{
last
=
2
;
}
else
{
last
=
3
;
}
robotWakeUpShowVO
.
setLastDay
(
last
);
robotWakeUpShowVO
.
setStartTime
(
pcloudRobotWakeup
.
getStartTime
());
// 分类信息
List
<
Integer
>
classifyInfoVOList
=
pcloudWakeupMessageMapper
.
getAllClassifyInfo
();
robotWakeUpShowVO
.
setClassifyList
(
classifyInfoVOList
);
// 消息列表
List
<
PcloudWakeupMessage
>
list
=
pcloudWakeupMessageMapper
.
selectAll
();
List
<
RobotWakeUpMsgVO
>
robotWakeUpMsgVOList
=
new
ArrayList
<>();
for
(
PcloudWakeupMessage
pcloudWakeupMessage
:
list
)
{
RobotWakeUpMsgVO
robotWakeUpMsgVO
=
new
RobotWakeUpMsgVO
();
robotWakeUpMsgVO
.
setSeqNum
(
pcloudWakeupMessage
.
getSeqNum
());
robotWakeUpMsgVO
.
setId
(
pcloudWakeupMessage
.
getId
());
if
(
"text"
.
equals
(
pcloudWakeupMessage
.
getType
()))
{
robotWakeUpMsgVO
.
setReplyType
(
1
);
robotWakeUpMsgVO
.
setContent
(
pcloudWakeupMessage
.
getTextContent
());
}
else
if
(
"image"
.
equals
(
pcloudWakeupMessage
.
getType
()))
{
robotWakeUpMsgVO
.
setReplyType
(
2
);
robotWakeUpMsgVO
.
setPicUrl
(
pcloudWakeupMessage
.
getImgUrl
());
}
else
if
(
"file"
.
equals
(
pcloudWakeupMessage
.
getType
()))
{
List
<
String
>
array
=
JSONObject
.
parseArray
(
pcloudWakeupMessage
.
getTextContent
(),
String
.
class
);
if
(
array
.
size
()
>
1
)
{
robotWakeUpMsgVO
.
setResourceTypeCode
(
array
.
get
(
0
));
robotWakeUpMsgVO
.
setSize
(
array
.
get
(
1
));
}
robotWakeUpMsgVO
.
setReplyType
(
5
);
robotWakeUpMsgVO
.
setContent
(
pcloudWakeupMessage
.
getFileName
());
robotWakeUpMsgVO
.
setFileUrl
(
pcloudWakeupMessage
.
getFileUrl
());
}
robotWakeUpMsgVOList
.
add
(
robotWakeUpMsgVO
);
}
robotWakeUpShowVO
.
setMsgList
(
robotWakeUpMsgVOList
);
return
robotWakeUpShowVO
;
return
robotWakeUpShowVO
;
}
}
@Override
@Override
public
void
doJob
()
{
public
void
doJob
(
Integer
wakeUpId
)
{
// 1. 查询所有开启自动提醒的小号
// 1. 查询所有开启自动提醒的小号
List
<
String
>
allRobot
=
pcloudRobotWakeupMapper
.
listAllRobot
();
PcloudRobotWakeup
pcloudRobotWakeup
=
pcloudRobotWakeupMapper
.
selectByPrimaryKey
(
wakeUpId
);
if
(
null
==
pcloudRobotWakeup
){
log
.
info
(
"唤醒wakeUpId为:{}的任务查询不到"
);
return
;
}
List
<
RobotClassifyDTO
>
allRobotClassify
=
pcloudRobotWakeupClassifyMapper
.
getRobotClassifyByWakeUpId
(
wakeUpId
);
// 2. 查询提醒时间
// 2. 查询提醒时间
PcloudRobotWakeup
pcloudRobotWakeup
=
pcloudRobotWakeupMapper
.
selectOne
();
if
(
ListUtils
.
isEmpty
(
allRobotClassify
)){
log
.
info
(
"唤醒wakeUpId为:{}的任务查询不到个人号"
,
wakeUpId
);
return
;
}
List
<
Integer
>
classifyIds
=
allRobotClassify
.
stream
().
map
(
e
->
e
.
getClassifyId
()).
collect
(
Collectors
.
toList
());
List
<
String
>
allRobot
=
pcloudRobotDao
.
getPcloudRobotByTypes
(
classifyIds
);
if
(
ListUtils
.
isEmpty
(
allRobot
)){
log
.
info
(
"任务:{},没有可用的机器人"
,
wakeUpId
);
return
;
}
if
(
pcloudRobotWakeup
==
null
||
pcloudRobotWakeup
.
getLast
()
==
null
)
{
if
(
pcloudRobotWakeup
==
null
||
pcloudRobotWakeup
.
getLast
()
==
null
)
{
return
;
return
;
}
}
List
<
PcloudWakeupMessage
>
list
=
pcloudWakeupMessageMapper
.
selectAll
(
);
List
<
RobotWakeUpMsgVO
>
list
=
pcloudWakeupMessageMapper
.
selectByWakeUpId
(
wakeUpId
);
if
(
ListUtils
.
isEmpty
(
list
))
{
if
(
ListUtils
.
isEmpty
(
list
))
{
return
;
return
;
}
}
...
@@ -245,14 +227,17 @@ public class PcloudRobotWakeUpBizImpl implements PcloudRobotWakeUpBiz {
...
@@ -245,14 +227,17 @@ public class PcloudRobotWakeUpBizImpl implements PcloudRobotWakeUpBiz {
WakeUpInfoDto
dto
=
JSONObject
.
parseObject
(
userInfo
.
get
(
wxid
),
WakeUpInfoDto
.
class
);
WakeUpInfoDto
dto
=
JSONObject
.
parseObject
(
userInfo
.
get
(
wxid
),
WakeUpInfoDto
.
class
);
Date
date
=
dto
.
getTime
();
Date
date
=
dto
.
getTime
();
String
ip
=
dto
.
getIp
();
String
ip
=
dto
.
getIp
();
if
(
DateUtils
.
getDateDiff
(
date
,
new
Dat
e
())
>
pcloudRobotWakeup
.
getLast
())
{
if
(
DateUtils
.
getDateDiff
(
date
,
pcloudRobotWakeup
.
getStartTim
e
())
>
pcloudRobotWakeup
.
getLast
())
{
//修改全局订阅状态
//修改全局订阅状态
pcloudRobotBiz
.
updateUserTdState
(
robot
,
wxid
,
0
);
pcloudRobotBiz
.
updateUserTdState
(
robot
,
wxid
,
0
);
for
(
PcloudWakeupMessage
msg
:
list
)
{
int
a
=
(
int
)
Math
.
floor
(
Math
.
random
()*
list
.
size
());
list
=
Arrays
.
asList
(
list
.
get
(
a
));
for
(
RobotWakeUpMsgVO
msg
:
list
)
{
if
(
"text"
.
equals
(
msg
.
getType
()))
{
if
(
"text"
.
equals
(
msg
.
getType
()))
{
SendTextMessageVO
txt
=
new
SendTextMessageVO
();
SendTextMessageVO
txt
=
new
SendTextMessageVO
();
txt
.
setAltId
(
robot
);
txt
.
setAltId
(
robot
);
txt
.
setContent
(
msg
.
get
Text
Content
());
txt
.
setContent
(
msg
.
getContent
());
txt
.
setWxGroupId
(
wxid
);
txt
.
setWxGroupId
(
wxid
);
txt
.
setIp
(
ip
);
txt
.
setIp
(
ip
);
WxGroupSDK
.
sendTextMessage
(
txt
);
WxGroupSDK
.
sendTextMessage
(
txt
);
...
@@ -260,7 +245,7 @@ public class PcloudRobotWakeUpBizImpl implements PcloudRobotWakeUpBiz {
...
@@ -260,7 +245,7 @@ public class PcloudRobotWakeUpBizImpl implements PcloudRobotWakeUpBiz {
if
(
"image"
.
equals
(
msg
.
getType
()))
{
if
(
"image"
.
equals
(
msg
.
getType
()))
{
SendPicMessageVO
pic
=
new
SendPicMessageVO
();
SendPicMessageVO
pic
=
new
SendPicMessageVO
();
pic
.
setAltId
(
robot
);
pic
.
setAltId
(
robot
);
pic
.
setPicUrl
(
msg
.
get
Img
Url
());
pic
.
setPicUrl
(
msg
.
get
Pic
Url
());
pic
.
setWxId
(
wxid
);
pic
.
setWxId
(
wxid
);
pic
.
setWxGroupId
(
wxid
);
pic
.
setWxGroupId
(
wxid
);
pic
.
setIp
(
ip
);
pic
.
setIp
(
ip
);
...
@@ -300,4 +285,276 @@ public class PcloudRobotWakeUpBizImpl implements PcloudRobotWakeUpBiz {
...
@@ -300,4 +285,276 @@ public class PcloudRobotWakeUpBizImpl implements PcloudRobotWakeUpBiz {
}
}
}
}
@Override
@ParamLog
(
"新增小号唤醒配置"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
addrobotWakeUpConfig
(
RobotWakeUpConfigVO
robotWakeUpConfigVO
)
{
Integer
lastDay
=
robotWakeUpConfigVO
.
getLastDay
();
if
(
lastDay
==
1
)
{
lastDay
=
3
;
}
else
if
(
lastDay
==
2
)
{
lastDay
=
7
;
}
else
if
(
lastDay
==
3
)
{
lastDay
=
DateUtils
.
getDayOfMonth
(
new
Date
());
}
checkStartTime
(
robotWakeUpConfigVO
.
getStartTime
());
PcloudRobotWakeup
pcloudRobotWakeup
=
new
PcloudRobotWakeup
();
pcloudRobotWakeup
.
setCreateTime
(
new
Date
());
pcloudRobotWakeup
.
setLast
(
lastDay
);
pcloudRobotWakeup
.
setStartTime
(
robotWakeUpConfigVO
.
getStartTime
());
pcloudRobotWakeupMapper
.
insertSelective
(
pcloudRobotWakeup
);
List
<
Integer
>
classifyList
=
robotWakeUpConfigVO
.
getClassifyList
();
if
(
ListUtils
.
isEmpty
(
classifyList
)){
throw
new
BizException
(
BizException
.
PARAM_IS_NULL
.
getCode
(),
"个人号不能为空"
);
}
List
<
PcloudRobotWakeupClassify
>
pcloudRobotWakeupClassifies
=
new
ArrayList
<>();
classifyList
.
stream
().
forEach
(
e
->{
PcloudRobotWakeupClassify
pcloudRobotWakeupClassify
=
new
PcloudRobotWakeupClassify
();
pcloudRobotWakeupClassify
.
setWakeUpId
(
pcloudRobotWakeup
.
getId
());
pcloudRobotWakeupClassify
.
setRobotClassifyId
(
e
);
pcloudRobotWakeupClassify
.
setCreateTime
(
new
Date
());
pcloudRobotWakeupClassifies
.
add
(
pcloudRobotWakeupClassify
);
});
pcloudRobotWakeupClassifyMapper
.
batchInsert
(
pcloudRobotWakeupClassifies
);
List
<
RobotWakeUpMsgVO
>
list
=
robotWakeUpConfigVO
.
getMsgVOList
();
if
(
ListUtils
.
isEmpty
(
list
))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"消息不能为空"
);
}
if
(
list
.
size
()
>
10
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"最多配置十条消息"
);
}
List
<
PcloudWakeupMessage
>
pcloudWakeupMessages
=
new
ArrayList
<>();
for
(
RobotWakeUpMsgVO
robotWakeUpMsgVO
:
list
)
{
PcloudWakeupMessage
pcloudWakeupMessage
=
new
PcloudWakeupMessage
();
pcloudWakeupMessage
.
setCreateTime
(
new
Date
());
if
(
robotWakeUpMsgVO
.
getReplyType
()
==
1
)
{
pcloudWakeupMessage
.
setType
(
"text"
);
pcloudWakeupMessage
.
setTextContent
(
robotWakeUpMsgVO
.
getContent
());
}
else
if
(
robotWakeUpMsgVO
.
getReplyType
()
==
2
)
{
pcloudWakeupMessage
.
setType
(
"image"
);
pcloudWakeupMessage
.
setImgUrl
(
robotWakeUpMsgVO
.
getPicUrl
());
}
else
if
(
robotWakeUpMsgVO
.
getReplyType
()
==
5
)
{
String
code
=
StringUtil
.
isEmpty
(
robotWakeUpMsgVO
.
getResourceTypeCode
())
?
" "
:
robotWakeUpMsgVO
.
getResourceTypeCode
();
String
size
=
StringUtil
.
isEmpty
(
robotWakeUpMsgVO
.
getSize
())
?
" "
:
robotWakeUpMsgVO
.
getSize
();
List
<
String
>
infos
=
new
ArrayList
<>();
infos
.
add
(
code
);
infos
.
add
(
size
);
pcloudWakeupMessage
.
setType
(
"file"
);
pcloudWakeupMessage
.
setTextContent
(
JSONObject
.
toJSONString
(
infos
));
pcloudWakeupMessage
.
setFileUrl
(
robotWakeUpMsgVO
.
getFileUrl
());
pcloudWakeupMessage
.
setFileName
(
robotWakeUpMsgVO
.
getContent
());
}
pcloudWakeupMessage
.
setSeqNum
(
robotWakeUpMsgVO
.
getSeqNum
());
pcloudWakeupMessage
.
setId
(
null
);
pcloudWakeupMessage
.
setWakeUpId
(
pcloudRobotWakeup
.
getId
());
pcloudWakeupMessages
.
add
(
pcloudWakeupMessage
);
}
pcloudWakeupMessageMapper
.
batchInsert
(
pcloudWakeupMessages
);
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
robotWakeUpConfigVO
.
getStartTime
());
//放入Date类型数据
Integer
year
=
calendar
.
get
(
Calendar
.
YEAR
);
//获取年份
Integer
month
=
calendar
.
get
(
Calendar
.
MONTH
)
+
1
;
//获取月份
Integer
date
=
calendar
.
get
(
Calendar
.
DATE
);
//获取日
Integer
hour
=
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
);
//时(24小时制)
Integer
minute
=
calendar
.
get
(
Calendar
.
MINUTE
);
//分
Integer
second
=
calendar
.
get
(
Calendar
.
SECOND
);
String
cron
=
second
+
" "
+
minute
+
" "
+
hour
+
" "
+
date
+
" "
+
month
+
" "
+
"? "
+
year
;
createCronJob
(
cron
,
pcloudRobotWakeup
.
getId
());
}
private
void
checkStartTime
(
Date
startTime
)
{
Date
newDate
=
new
Date
();
if
(
startTime
.
before
(
newDate
)){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"唤醒发送时间不得早于当前时间"
);
}
}
@Override
@ParamLog
(
"获取机器人小号配置列表分页"
)
public
PageBeanNew
<
RobotWakeUpShowVO
>
getRobotWakeUpConfigList
(
Integer
currentPage
,
Integer
numPerPage
)
{
ParamCheck
.
pageParam
(
currentPage
,
numPerPage
);
Integer
totalCount
=
pcloudRobotWakeupMapper
.
getRobotWakeUpConfigListCount
();
List
<
RobotWakeUpShowVO
>
robotWakeUpShowVOS
=
new
ArrayList
<>();
if
(
totalCount
>
0
){
robotWakeUpShowVOS
=
pcloudRobotWakeupMapper
.
getRobotWakeUpConfigList
(
currentPage
*
numPerPage
,
numPerPage
);
}
PageBeanNew
<
RobotWakeUpShowVO
>
robotWakeUpShowVOPageBeanNew
=
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
totalCount
,
robotWakeUpShowVOS
);
if
(!
ListUtils
.
isEmpty
(
robotWakeUpShowVOS
)){
setDays
(
robotWakeUpShowVOS
);
setMessage
(
robotWakeUpShowVOS
);
}
return
robotWakeUpShowVOPageBeanNew
;
}
private
void
setMessage
(
List
<
RobotWakeUpShowVO
>
robotWakeUpShowVOS
)
{
robotWakeUpShowVOS
.
stream
().
forEach
(
robotWakeUpShowVO
->{
List
<
RobotWakeUpMsgVO
>
robotWakeUpMsgVOS
=
robotWakeUpShowVO
.
getMsgList
();
if
(!
ListUtils
.
isEmpty
(
robotWakeUpMsgVOS
)){
robotWakeUpMsgVOS
.
stream
().
forEach
(
pcloudWakeupMessage
->{
if
(
"text"
.
equals
(
pcloudWakeupMessage
.
getType
()))
{
pcloudWakeupMessage
.
setReplyType
(
1
);
}
else
if
(
"image"
.
equals
(
pcloudWakeupMessage
.
getType
()))
{
pcloudWakeupMessage
.
setReplyType
(
2
);
}
else
if
(
"file"
.
equals
(
pcloudWakeupMessage
.
getType
()))
{
List
<
String
>
array
=
JSONObject
.
parseArray
(
pcloudWakeupMessage
.
getContent
(),
String
.
class
);
if
(
array
.
size
()
>
1
)
{
pcloudWakeupMessage
.
setResourceTypeCode
(
array
.
get
(
0
));
pcloudWakeupMessage
.
setSize
(
array
.
get
(
1
));
}
pcloudWakeupMessage
.
setReplyType
(
5
);
pcloudWakeupMessage
.
setContent
(
pcloudWakeupMessage
.
getFileName
());
}
});
}
}
);
}
private
void
setDays
(
List
<
RobotWakeUpShowVO
>
robotWakeUpShowVOS
)
{
robotWakeUpShowVOS
.
stream
().
forEach
(
robotWakeUpShowVO
->{
Integer
last
=
robotWakeUpShowVO
.
getLastDay
();
if
(
last
==
3
)
{
last
=
1
;
}
else
if
(
last
==
7
)
{
last
=
2
;
}
else
{
last
=
3
;
}
robotWakeUpShowVO
.
setLastDay
(
last
);
}
);
}
@Override
@ParamLog
(
"删除机器人小号唤醒配置"
)
public
void
deleterobotWakeUp
(
Integer
wakeUpid
)
{
//1. 唤醒删除
pcloudRobotWakeupMapper
.
deleteByPrimaryKey
(
wakeUpid
);
pcloudRobotWakeupClassifyMapper
.
deleteByWakeUpId
(
wakeUpid
);
pcloudWakeupMessageMapper
.
delectByWakeUpId
(
wakeUpid
);
}
@Override
@ParamLog
(
"更新机器人小号唤醒配置"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updaterobotWakeUp
(
RobotWakeUpConfigVO
robotWakeUpConfigVO
)
{
Integer
wakeUpId
=
robotWakeUpConfigVO
.
getWakeUpId
();
Integer
lastDay
=
robotWakeUpConfigVO
.
getLastDay
();
if
(
lastDay
==
1
)
{
lastDay
=
3
;
}
else
if
(
lastDay
==
2
)
{
lastDay
=
7
;
}
else
if
(
lastDay
==
3
)
{
lastDay
=
DateUtils
.
getDayOfMonth
(
new
Date
());
}
checkStartTime
(
robotWakeUpConfigVO
.
getStartTime
());
PcloudRobotWakeup
pcloudRobotWakeup
=
new
PcloudRobotWakeup
();
pcloudRobotWakeup
.
setId
(
robotWakeUpConfigVO
.
getWakeUpId
());
pcloudRobotWakeup
.
setLast
(
lastDay
);
pcloudRobotWakeup
.
setStartTime
(
robotWakeUpConfigVO
.
getStartTime
());
pcloudRobotWakeup
.
setUpdateTime
(
new
Date
());
pcloudRobotWakeupMapper
.
updateByPrimaryKeySelective
(
pcloudRobotWakeup
);
List
<
Integer
>
classifyList
=
robotWakeUpConfigVO
.
getClassifyList
();
if
(
ListUtils
.
isEmpty
(
classifyList
)){
throw
new
BizException
(
BizException
.
PARAM_IS_NULL
.
getCode
(),
"个人号不能为空"
);
}
List
<
PcloudRobotWakeupClassify
>
pcloudRobotWakeupClassifies
=
new
ArrayList
<>();
classifyList
.
stream
().
forEach
(
e
->{
PcloudRobotWakeupClassify
pcloudRobotWakeupClassify
=
new
PcloudRobotWakeupClassify
();
pcloudRobotWakeupClassify
.
setWakeUpId
(
pcloudRobotWakeup
.
getId
());
pcloudRobotWakeupClassify
.
setRobotClassifyId
(
e
);
pcloudRobotWakeupClassify
.
setCreateTime
(
new
Date
());
pcloudRobotWakeupClassifies
.
add
(
pcloudRobotWakeupClassify
);
});
pcloudRobotWakeupClassifyMapper
.
deleteByWakeUpId
(
wakeUpId
);
pcloudRobotWakeupClassifyMapper
.
batchInsert
(
pcloudRobotWakeupClassifies
);
//更新资源
List
<
RobotWakeUpMsgVO
>
list
=
robotWakeUpConfigVO
.
getMsgVOList
();
if
(
ListUtils
.
isEmpty
(
list
))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"消息不能为空"
);
}
if
(
list
.
size
()
>
10
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"最多配置十条消息"
);
}
List
<
PcloudWakeupMessage
>
pcloudWakeupMessages
=
new
ArrayList
<>();
for
(
RobotWakeUpMsgVO
robotWakeUpMsgVO
:
list
)
{
PcloudWakeupMessage
pcloudWakeupMessage
=
new
PcloudWakeupMessage
();
pcloudWakeupMessage
.
setCreateTime
(
new
Date
());
if
(
robotWakeUpMsgVO
.
getReplyType
()
==
1
)
{
pcloudWakeupMessage
.
setType
(
"text"
);
pcloudWakeupMessage
.
setTextContent
(
robotWakeUpMsgVO
.
getContent
());
}
else
if
(
robotWakeUpMsgVO
.
getReplyType
()
==
2
)
{
pcloudWakeupMessage
.
setType
(
"image"
);
pcloudWakeupMessage
.
setImgUrl
(
robotWakeUpMsgVO
.
getPicUrl
());
}
else
if
(
robotWakeUpMsgVO
.
getReplyType
()
==
5
)
{
String
code
=
StringUtil
.
isEmpty
(
robotWakeUpMsgVO
.
getResourceTypeCode
())
?
" "
:
robotWakeUpMsgVO
.
getResourceTypeCode
();
String
size
=
StringUtil
.
isEmpty
(
robotWakeUpMsgVO
.
getSize
())
?
" "
:
robotWakeUpMsgVO
.
getSize
();
List
<
String
>
infos
=
new
ArrayList
<>();
infos
.
add
(
code
);
infos
.
add
(
size
);
pcloudWakeupMessage
.
setType
(
"file"
);
pcloudWakeupMessage
.
setTextContent
(
JSONObject
.
toJSONString
(
infos
));
pcloudWakeupMessage
.
setFileUrl
(
robotWakeUpMsgVO
.
getFileUrl
());
pcloudWakeupMessage
.
setFileName
(
robotWakeUpMsgVO
.
getContent
());
}
pcloudWakeupMessage
.
setSeqNum
(
robotWakeUpMsgVO
.
getSeqNum
());
pcloudWakeupMessage
.
setId
(
null
);
pcloudWakeupMessage
.
setWakeUpId
(
pcloudRobotWakeup
.
getId
());
pcloudWakeupMessages
.
add
(
pcloudWakeupMessage
);
}
pcloudWakeupMessageMapper
.
delectByWakeUpId
(
wakeUpId
);
pcloudWakeupMessageMapper
.
batchInsert
(
pcloudWakeupMessages
);
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
robotWakeUpConfigVO
.
getStartTime
());
//放入Date类型数据
Integer
year
=
calendar
.
get
(
Calendar
.
YEAR
);
//获取年份
Integer
month
=
calendar
.
get
(
Calendar
.
MONTH
)
+
1
;
//获取月份
Integer
date
=
calendar
.
get
(
Calendar
.
DATE
);
//获取日
Integer
hour
=
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
);
//时(24小时制)
Integer
minute
=
calendar
.
get
(
Calendar
.
MINUTE
);
//分
Integer
second
=
calendar
.
get
(
Calendar
.
SECOND
);
String
cron
=
second
+
" "
+
minute
+
" "
+
hour
+
" "
+
date
+
" "
+
month
+
" "
+
"? "
+
year
;
UpdateCronJob
(
cron
,
wakeUpId
);
}
private
void
UpdateCronJob
(
String
cronStr
,
Integer
wakeUpId
)
{
try
{
String
jobName
=
PCLOUD_WAKE_UP_CRON_JOB
+
":"
+
wakeUpId
;
ScheduleJob
job
=
new
ScheduleJob
();
//先删,再添加
scheduleService
.
deleteJob
(
jobName
,
"book"
);
//定时器任务
job
.
setJobName
(
jobName
);
//cron表达式
job
.
setCronExpression
(
cronStr
);
//定时器分组
job
.
setJobGroup
(
"book"
);
CallBackParam
param
=
new
CallBackParam
();
//service名称
param
.
setBeanName
(
"pcloudRobotWakeUpService"
);
//回调内部接口方法名称
param
.
setMethodName
(
"doJob"
);
//设置回调参数
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"jobName"
,
jobName
);
map
.
put
(
"wakeUpId"
,
wakeUpId
);
param
.
setParamMap
(
map
);
Map
<
String
,
Object
>
scheduleMap
=
new
HashMap
<>();
scheduleMap
.
put
(
"scheduleJob"
,
job
);
scheduleMap
.
put
(
"callBackParam"
,
param
);
log
.
info
(
"[*********************]{}"
,
JSONObject
.
toJSONString
(
scheduleMap
));
scheduleService
.
addCronJob
(
scheduleMap
);
}
catch
(
SchedulerException
|
JsonParseException
e
)
{
log
.
info
(
"【PcloudRobotWakeUpBizImpl.createCronJob】创建定时任务失败"
,
e
);
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/guide/dto/WakeUpInfoDto.java
View file @
f05647f4
...
@@ -8,4 +8,5 @@ import java.util.Date;
...
@@ -8,4 +8,5 @@ import java.util.Date;
public
class
WakeUpInfoDto
{
public
class
WakeUpInfoDto
{
private
String
ip
;
private
String
ip
;
private
Date
time
;
private
Date
time
;
private
Integer
wakeUpId
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/guide/entity/PcloudRobotWakeup.java
View file @
f05647f4
...
@@ -67,4 +67,7 @@ public class PcloudRobotWakeup {
...
@@ -67,4 +67,7 @@ public class PcloudRobotWakeup {
public
void
setUpdateTime
(
Date
updateTime
)
{
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
this
.
updateTime
=
updateTime
;
}
}
public
void
deleteByWakeUpId
(
Integer
wakeUpId
)
{
}
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/guide/entity/PcloudRobotWakeupClassify.java
0 → 100644
View file @
f05647f4
package
com
.
pcloud
.
book
.
guide
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
java.util.Date
;
import
lombok.Data
;
@Data
public
class
PcloudRobotWakeupClassify
{
private
Integer
id
;
private
Integer
wakeUpId
;
private
Integer
robotClassifyId
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
updateTime
;
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/guide/entity/PcloudWakeupMessage.java
View file @
f05647f4
...
@@ -7,6 +7,8 @@ import java.util.Date;
...
@@ -7,6 +7,8 @@ import java.util.Date;
public
class
PcloudWakeupMessage
{
public
class
PcloudWakeupMessage
{
private
Integer
id
;
private
Integer
id
;
private
Integer
wakeUpId
;
private
String
type
;
private
String
type
;
private
String
textContent
;
private
String
textContent
;
...
@@ -25,6 +27,14 @@ public class PcloudWakeupMessage {
...
@@ -25,6 +27,14 @@ public class PcloudWakeupMessage {
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
updateTime
;
private
Date
updateTime
;
public
Integer
getWakeUpId
()
{
return
wakeUpId
;
}
public
void
setWakeUpId
(
Integer
wakeUpId
)
{
this
.
wakeUpId
=
wakeUpId
;
}
public
Integer
getId
()
{
public
Integer
getId
()
{
return
id
;
return
id
;
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/guide/facade/impl/PcloudRobotWakeUpFacadeImpl.java
View file @
f05647f4
...
@@ -7,9 +7,12 @@ import com.pcloud.book.guide.vo.RobotWakeUpShowVO;
...
@@ -7,9 +7,12 @@ import com.pcloud.book.guide.vo.RobotWakeUpShowVO;
import
com.pcloud.book.pcloudkeyword.biz.PcloudRobotClassifyBiz
;
import
com.pcloud.book.pcloudkeyword.biz.PcloudRobotClassifyBiz
;
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
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.permission.PermissionException
;
import
com.pcloud.common.permission.PermissionException
;
import
com.pcloud.common.utils.SessionUtil
;
import
com.pcloud.common.utils.SessionUtil
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.models.auth.In
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -33,6 +36,7 @@ public class PcloudRobotWakeUpFacadeImpl {
...
@@ -33,6 +36,7 @@ public class PcloudRobotWakeUpFacadeImpl {
return
new
ResponseDto
<>();
return
new
ResponseDto
<>();
}
}
@ApiOperation
(
value
=
"解除机器人小号唤醒配置"
)
@ApiOperation
(
value
=
"解除机器人小号唤醒配置"
)
@PostMapping
(
"remove"
)
@PostMapping
(
"remove"
)
ResponseDto
<?>
robotWakeUpClose
(
@RequestHeader
String
token
)
throws
PermissionException
{
ResponseDto
<?>
robotWakeUpClose
(
@RequestHeader
String
token
)
throws
PermissionException
{
...
@@ -42,10 +46,10 @@ public class PcloudRobotWakeUpFacadeImpl {
...
@@ -42,10 +46,10 @@ public class PcloudRobotWakeUpFacadeImpl {
}
}
@ApiOperation
(
value
=
"获取机器人小号配置"
)
@ApiOperation
(
value
=
"获取机器人小号配置"
)
@GetMapping
(
"get"
)
@GetMapping
(
"get
RobotWakeUpConfig
"
)
ResponseDto
<?>
getRobotWakeUpConfig
(
@RequestHeader
String
token
)
throws
PermissionException
{
ResponseDto
<?>
getRobotWakeUpConfig
(
@RequestHeader
String
token
,
@RequestParam
(
"wakeUpId"
)
Integer
wakeUpId
)
throws
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
SessionUtil
.
getToken4Redis
(
token
);
return
new
ResponseDto
<>(
pcloudRobotWakeUpBiz
.
getRobotWakeUpConfig
());
return
new
ResponseDto
<>(
pcloudRobotWakeUpBiz
.
getRobotWakeUpConfig
(
wakeUpId
));
}
}
...
@@ -56,4 +60,39 @@ public class PcloudRobotWakeUpFacadeImpl {
...
@@ -56,4 +60,39 @@ public class PcloudRobotWakeUpFacadeImpl {
List
<
PcloudRobotClassifyResponseVO
>
classify
=
pcloudRobotWakeUpBiz
.
listAllClassify
();
List
<
PcloudRobotClassifyResponseVO
>
classify
=
pcloudRobotWakeUpBiz
.
listAllClassify
();
return
new
ResponseDto
<>(
classify
);
return
new
ResponseDto
<>(
classify
);
}
}
@ApiOperation
(
value
=
"新增机器人小号唤醒配置"
)
@PostMapping
(
"addrobotWakeUpConfig"
)
ResponseDto
<?>
addrobotWakeUpConfig
(
@RequestHeader
String
token
,
@RequestBody
RobotWakeUpConfigVO
robotWakeUpConfigVO
)
throws
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
pcloudRobotWakeUpBiz
.
addrobotWakeUpConfig
(
robotWakeUpConfigVO
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
value
=
"获取机器人小号配置列表"
)
@GetMapping
(
"getRobotWakeUpConfigList"
)
ResponseDto
<
PageBeanNew
<
RobotWakeUpShowVO
>>
getRobotWakeUpConfigList
(
@RequestHeader
String
token
,
@RequestParam
(
"currentPage"
)
Integer
currentPage
,
@RequestParam
(
"numPerPage"
)
Integer
numPerPage
)
throws
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
return
new
ResponseDto
<
PageBeanNew
<
RobotWakeUpShowVO
>>(
pcloudRobotWakeUpBiz
.
getRobotWakeUpConfigList
(
currentPage
,
numPerPage
));
}
@ApiOperation
(
value
=
"删除机器人小号唤醒配置"
)
@GetMapping
(
"deleterobotWakeUp"
)
ResponseDto
<?>
deleterobotWakeUp
(
@RequestHeader
String
token
,
@RequestParam
(
"wakeUpId"
)
Integer
wakeUpid
)
throws
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
pcloudRobotWakeUpBiz
.
deleterobotWakeUp
(
wakeUpid
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
value
=
"更新机器人小号唤醒配置"
)
@PostMapping
(
"updaterobotWakeUp"
)
ResponseDto
<?>
updaterobotWakeUp
(
@RequestHeader
String
token
,
@RequestBody
RobotWakeUpConfigVO
robotWakeUpConfigVO
)
throws
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
pcloudRobotWakeUpBiz
.
updaterobotWakeUp
(
robotWakeUpConfigVO
);
return
new
ResponseDto
<>();
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/guide/mapper/PcloudRobotWakeupClassifyMapper.java
0 → 100644
View file @
f05647f4
package
com
.
pcloud
.
book
.
guide
.
mapper
;
import
com.pcloud.book.guide.entity.PcloudRobotWakeup
;
import
com.pcloud.book.guide.entity.PcloudRobotWakeupClassify
;
import
com.pcloud.book.pcloudKeyword.dto.RobotClassifyDTO
;
import
com.pcloud.book.pcloudkeyword.facade.response.PcloudRobotClassifyResponseVO
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
@Component
public
interface
PcloudRobotWakeupClassifyMapper
{
int
insert
(
PcloudRobotWakeupClassify
pcloudRobotWakeupClassify
);
int
batchInsert
(
List
<
PcloudRobotWakeupClassify
>
pcloudRobotWakeupClassifies
);
void
deleteAll
();
List
<
RobotClassifyDTO
>
getRobotClassifyByWakeUpId
(
Integer
wakeUpId
);
void
deleteByWakeUpId
(
Integer
wakeUpId
);
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/guide/mapper/PcloudRobotWakeupMapper.java
View file @
f05647f4
...
@@ -3,6 +3,8 @@ package com.pcloud.book.guide.mapper;
...
@@ -3,6 +3,8 @@ package com.pcloud.book.guide.mapper;
import
com.pcloud.book.guide.entity.PcloudRobotWakeup
;
import
com.pcloud.book.guide.entity.PcloudRobotWakeup
;
import
com.pcloud.book.guide.vo.RobotWakeUpShowVO
;
import
com.pcloud.book.guide.vo.RobotWakeUpShowVO
;
import
com.pcloud.book.pcloudkeyword.facade.response.PcloudRobotClassifyResponseVO
;
import
com.pcloud.book.pcloudkeyword.facade.response.PcloudRobotClassifyResponseVO
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
import
java.util.List
;
...
@@ -28,4 +30,10 @@ public interface PcloudRobotWakeupMapper {
...
@@ -28,4 +30,10 @@ public interface PcloudRobotWakeupMapper {
List
<
String
>
listAllRobot
();
List
<
String
>
listAllRobot
();
List
<
PcloudRobotClassifyResponseVO
>
listAllClassify
();
List
<
PcloudRobotClassifyResponseVO
>
listAllClassify
();
Integer
getRobotWakeUpConfigListCount
();
List
<
RobotWakeUpShowVO
>
getRobotWakeUpConfigList
(
@Param
(
"currentPage"
)
Integer
currentPage
,
@Param
(
"numPerPage"
)
Integer
numPerPage
);
RobotWakeUpShowVO
getRobotWakeUpConfigById
(
Integer
wakeUpId
);
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/guide/mapper/PcloudWakeupMessageMapper.java
View file @
f05647f4
...
@@ -28,4 +28,10 @@ public interface PcloudWakeupMessageMapper {
...
@@ -28,4 +28,10 @@ public interface PcloudWakeupMessageMapper {
List
<
Integer
>
getAllClassifyInfo
();
List
<
Integer
>
getAllClassifyInfo
();
Integer
countAll
();
Integer
countAll
();
int
batchInsert
(
List
<
PcloudWakeupMessage
>
pcloudWakeupMessages
);
List
<
RobotWakeUpMsgVO
>
selectByWakeUpId
(
Integer
wakeUpId
);
void
delectByWakeUpId
(
Integer
wakeUpId
);
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/guide/service/PcloudRobotWakeUpServiceImpl.java
View file @
f05647f4
...
@@ -31,7 +31,8 @@ public class PcloudRobotWakeUpServiceImpl implements PcloudRobotWakeUpService {
...
@@ -31,7 +31,8 @@ public class PcloudRobotWakeUpServiceImpl implements PcloudRobotWakeUpService {
@PostMapping
(
"/doJob"
)
@PostMapping
(
"/doJob"
)
public
void
doJob
(
@RequestBody
Map
<
String
,
Object
>
map
)
throws
BizException
{
public
void
doJob
(
@RequestBody
Map
<
String
,
Object
>
map
)
throws
BizException
{
log
.
info
(
"PcloudRobotWakeUpServiceImpl.doJob 开始执行定时任务"
);
log
.
info
(
"PcloudRobotWakeUpServiceImpl.doJob 开始执行定时任务"
);
pcloudRobotWakeUpBiz
.
doJob
();
Integer
wakeUpId
=
(
Integer
)
map
.
get
(
"wakeUpId"
);
pcloudRobotWakeUpBiz
.
doJob
(
wakeUpId
);
}
}
...
@@ -40,7 +41,8 @@ public class PcloudRobotWakeUpServiceImpl implements PcloudRobotWakeUpService {
...
@@ -40,7 +41,8 @@ public class PcloudRobotWakeUpServiceImpl implements PcloudRobotWakeUpService {
public
ResponseDto
<?>
hset
(
@RequestParam
(
"wxid"
)
String
wxid
,
public
ResponseDto
<?>
hset
(
@RequestParam
(
"wxid"
)
String
wxid
,
@RequestParam
(
"robotId"
)
String
robotId
,
@RequestParam
(
"robotId"
)
String
robotId
,
@RequestParam
(
"ip"
)
String
ip
,
@RequestParam
(
"ip"
)
String
ip
,
@RequestParam
(
"day"
)
Integer
day
){
@RequestParam
(
"day"
)
Integer
day
,
@RequestParam
(
"wakeUpId"
)
Integer
wakeUpId
){
WakeUpInfoDto
wakeUpInfoDto
=
new
WakeUpInfoDto
();
WakeUpInfoDto
wakeUpInfoDto
=
new
WakeUpInfoDto
();
wakeUpInfoDto
.
setIp
(
ip
);
wakeUpInfoDto
.
setIp
(
ip
);
wakeUpInfoDto
.
setTime
(
DateUtils
.
addDay
(
new
Date
(),
day
));
wakeUpInfoDto
.
setTime
(
DateUtils
.
addDay
(
new
Date
(),
day
));
...
...
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/dao/PcloudRobotDao.java
View file @
f05647f4
...
@@ -29,4 +29,7 @@ public interface PcloudRobotDao extends BaseDao<PcloudRobot> {
...
@@ -29,4 +29,7 @@ public interface PcloudRobotDao extends BaseDao<PcloudRobot> {
PcloudRobot
getByUniqueNumber
(
String
uniqueNumber
);
PcloudRobot
getByUniqueNumber
(
String
uniqueNumber
);
void
updatePcloudRobotByWxId
(
PcloudRobot
pcloudRobot
);
void
updatePcloudRobotByWxId
(
PcloudRobot
pcloudRobot
);
List
<
String
>
getPcloudRobotByTypes
(
List
<
Integer
>
classifyIds
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/dao/impl/PcloudRobotDaoImpl.java
View file @
f05647f4
...
@@ -48,8 +48,15 @@ public class PcloudRobotDaoImpl extends BaseDaoImpl<PcloudRobot> implements Pclo
...
@@ -48,8 +48,15 @@ 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
public
List
<
String
>
getPcloudRobotByTypes
(
List
<
Integer
>
classifyIds
)
{
return
this
.
getSessionTemplate
().
selectList
(
this
.
getStatement
(
"getPcloudRobotByTypes"
),
classifyIds
);
}
}
}
pcloud-service-book/src/main/resources/mapper/guide/PcloudRobotWakeupMapper.xml
View file @
f05647f4
...
@@ -9,6 +9,14 @@
...
@@ -9,6 +9,14 @@
<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"
/>
</resultMap>
</resultMap>
<resultMap
id=
"RobotWakeUpShowVOMap"
type=
"com.pcloud.book.guide.vo.RobotWakeUpShowVO"
>
<id
column=
"id"
property=
"wakeUpId"
jdbcType=
"BIGINT"
/>
<result
column=
"start_time"
property=
"startTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"last"
property=
"lastDay"
jdbcType=
"BIGINT"
/>
<collection
property=
"classifyDTOList"
column=
"id"
select=
"com.pcloud.book.guide.mapper.PcloudRobotWakeupClassifyMapper.getRobotClassifyByWakeUpId"
/>
<collection
property=
"msgList"
column=
"id"
select=
"com.pcloud.book.guide.mapper.PcloudWakeupMessageMapper.selectByWakeUpId"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, start_time, cycle, last, create_time, update_time
id, start_time, cycle, last, create_time, update_time
</sql>
</sql>
...
@@ -30,7 +38,7 @@
...
@@ -30,7 +38,7 @@
#{last,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
#{last,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
)
</insert>
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.pcloud.book.guide.entity.PcloudRobotWakeup"
>
<insert
id=
"insertSelective"
parameterType=
"com.pcloud.book.guide.entity.PcloudRobotWakeup"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into pcloud_robot_wakeup
insert into pcloud_robot_wakeup
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
<if
test=
"id != null"
>
...
@@ -127,5 +135,32 @@
...
@@ -127,5 +135,32 @@
AND is_delete = 0
AND is_delete = 0
</select>
</select>
<select
id=
"getRobotWakeUpConfigListCount"
resultType=
"integer"
>
select
count(id)
from
pcloud_robot_wakeup
</select>
<select
id=
"getRobotWakeUpConfigList"
resultMap=
"RobotWakeUpShowVOMap"
>
select
id,
start_time,
last
from pcloud_robot_wakeup
order by create_time desc
<if
test=
"currentPage!=null"
>
limit #{currentPage},#{numPerPage}
</if>
</select>
<select
id=
"getRobotWakeUpConfigById"
parameterType=
"integer"
resultMap=
"RobotWakeUpShowVOMap"
>
select
id,
start_time,
last
from pcloud_robot_wakeup
where id = #{wakeUpId}
</select>
</mapper>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/guide/PcloudRobotWakeupMapperClassify.xml
0 → 100644
View file @
f05647f4
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.pcloud.book.guide.mapper.PcloudRobotWakeupClassifyMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.guide.entity.PcloudRobotWakeupClassify"
>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"wake_up_id"
property=
"wakeUpId"
jdbcType=
"INTEGER"
/>
<result
column=
"robot_classify_id"
property=
"robotClassifyId"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, wake_up_id, robot_classify_id,create_time, update_time
</sql>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.guide.entity.PcloudRobotWakeupClassify"
>
insert into pcloud_robot_wakeup_classify (wake_up_id, robot_classify_id, create_time
)
values (#{wakeUpId,jdbcType=INTEGER}, #{robotClassifyId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}
)
</insert>
<insert
id=
"batchInsert"
parameterType=
"com.pcloud.book.guide.entity.PcloudRobotWakeupClassify"
>
insert into pcloud_robot_wakeup_classify (wake_up_id, robot_classify_id, create_time
)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.wakeUpId},
#{item.robotClassifyId},
#{item.createTime}
)
</foreach>
</insert>
<delete
id=
"deleteAll"
>
delete from pcloud_robot_wakeup_classify
</delete>
<select
id=
"getRobotClassifyByWakeUpId"
parameterType=
"integer"
resultType=
"com.pcloud.book.pcloudKeyword.dto.RobotClassifyDTO"
>
select
prwc.robot_classify_id classifyId,
prc.classify_name classifyName
from
pcloud_robot_wakeup_classify prwc
left join pcloud_robot_classify prc
on prwc.robot_classify_id = prc.id
where prwc.wake_up_id = #{_parameter}
</select>
<select
id=
"deleteByWakeUpId"
parameterType=
"integer"
>
delete
from
pcloud_robot_wakeup_classify
where
wake_up_id = #{wakeUpId}
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/guide/PcloudWakeupMessageMapper.xml
View file @
f05647f4
...
@@ -12,6 +12,16 @@
...
@@ -12,6 +12,16 @@
<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"
/>
</resultMap>
</resultMap>
<resultMap
id=
"BaseResultMap4VO"
type=
"com.pcloud.book.guide.vo.RobotWakeUpMsgVO"
>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"type"
property=
"type"
jdbcType=
"VARCHAR"
/>
<result
column=
"text_content"
property=
"content"
jdbcType=
"VARCHAR"
/>
<result
column=
"img_url"
property=
"picUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"file_url"
property=
"fileUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"file_name"
property=
"fileName"
jdbcType=
"VARCHAR"
/>
<result
column=
"seq_num"
property=
"seqNum"
jdbcType=
"BIT"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, type, text_content, img_url, file_url, file_name, seq_num, create_time, update_time
id, type, text_content, img_url, file_url, file_name, seq_num, create_time, update_time
</sql>
</sql>
...
@@ -96,6 +106,23 @@
...
@@ -96,6 +106,23 @@
</if>
</if>
</trim>
</trim>
</insert>
</insert>
<insert
id=
"batchInsert"
parameterType=
"com.pcloud.book.guide.entity.PcloudWakeupMessage"
>
insert into pcloud_wakeup_message ( type, text_content,
img_url, file_url, file_name,
seq_num, create_time, update_time,wake_up_id
)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.type,jdbcType=VARCHAR}, #{item.textContent,jdbcType=VARCHAR},
#{item.imgUrl,jdbcType=VARCHAR}, #{item.fileUrl,jdbcType=VARCHAR}, #{item.fileName,jdbcType=VARCHAR},
#{item.seqNum,jdbcType=BIT}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateTime,jdbcType=TIMESTAMP},
#{item.wakeUpId}
)
</foreach>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pcloud.book.guide.entity.PcloudWakeupMessage"
>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pcloud.book.guide.entity.PcloudWakeupMessage"
>
update pcloud_wakeup_message
update pcloud_wakeup_message
<set
>
<set
>
...
@@ -161,5 +188,22 @@
...
@@ -161,5 +188,22 @@
select count(0) from pcloud_robot_classify
select count(0) from pcloud_robot_classify
</select>
</select>
<select
id=
"selectByWakeUpId"
resultMap=
"BaseResultMap4VO"
parameterType=
"integer"
>
select
id, type, text_content, img_url, file_url, file_name, seq_num
from
pcloud_wakeup_message
where
wake_up_id = #{_parameter}
</select>
<delete
id=
"delectByWakeUpId"
parameterType=
"integer"
>
delete
from
pcloud_wakeup_message
where
wake_up_id = #{wakeUpId}
</delete>
</mapper>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/pcloudkeyword/PcloudRobot.Mapper.xml
View file @
f05647f4
...
@@ -239,4 +239,17 @@
...
@@ -239,4 +239,17 @@
limit 1
limit 1
</select>
</select>
<select
id=
"getPcloudRobotByTypes"
parameterType=
"list"
resultType=
"string"
>
select
DISTINCT wx_id
from
pcloud_robot p
where
robot_type in
<foreach
collection=
"list"
index=
"index"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
and state = 1
</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