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
d1066982
Commit
d1066982
authored
Mar 24, 2020
by
zhuyajie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1002600qq群发
parent
7a441403
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
296 additions
and
216 deletions
+296
-216
LargeTempletEnum.java
...in/java/com/pcloud/book/group/enums/LargeTempletEnum.java
+7
-2
WechatGroupConsr.java
...om/pcloud/book/consumer/wechatgroup/WechatGroupConsr.java
+22
-4
BookGroupBizImpl.java
...java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
+9
-2
UserSelectParamDTO.java
...in/java/com/pcloud/book/group/dto/UserSelectParamDTO.java
+10
-0
GroupSet.java
...ook/src/main/java/com/pcloud/book/group/set/GroupSet.java
+2
-2
PcloudRobotBiz.java
...ava/com/pcloud/book/pcloudkeyword/biz/PcloudRobotBiz.java
+2
-0
PcloudRobotBizImpl.java
...cloud/book/pcloudkeyword/biz/impl/PcloudRobotBizImpl.java
+18
-3
PcloudRobotDao.java
...ava/com/pcloud/book/pcloudkeyword/dao/PcloudRobotDao.java
+2
-0
PcloudRobotDaoImpl.java
...cloud/book/pcloudkeyword/dao/impl/PcloudRobotDaoImpl.java
+7
-0
PcloudRobotFacade.java
...m/pcloud/book/pcloudkeyword/facade/PcloudRobotFacade.java
+12
-0
SelfPushBizImpl.java
...n/java/com/pcloud/book/push/biz/impl/SelfPushBizImpl.java
+127
-53
PushCheck.java
...k/src/main/java/com/pcloud/book/push/check/PushCheck.java
+11
-2
SelfPushAddParamDTO.java
...in/java/com/pcloud/book/push/dto/SelfPushAddParamDTO.java
+4
-1
SelfPushRecordDTO.java
...main/java/com/pcloud/book/push/dto/SelfPushRecordDTO.java
+3
-0
SelfPush.java
...k/src/main/java/com/pcloud/book/push/entity/SelfPush.java
+3
-141
AltTypeEnum.java
...src/main/java/com/pcloud/book/push/enums/AltTypeEnum.java
+22
-0
ItemTypeEnum.java
...rc/main/java/com/pcloud/book/push/enums/ItemTypeEnum.java
+4
-0
SelfPlanBizImpl.java
...com/pcloud/book/timecontrol/biz/impl/SelfPlanBizImpl.java
+1
-1
PcloudRobot.Mapper.xml
...ain/resources/mapper/pcloudkeyword/PcloudRobot.Mapper.xml
+24
-0
SelfPushItemMapper.xml
...ook/src/main/resources/mapper/push/SelfPushItemMapper.xml
+2
-1
SelfPushMapper.xml
...ce-book/src/main/resources/mapper/push/SelfPushMapper.xml
+4
-4
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/group/enums/LargeTempletEnum.java
View file @
d1066982
...
...
@@ -25,9 +25,14 @@ public enum LargeTempletEnum {
*/
SPECIAL_AGENT
(
5
,
"特殊出版社"
),
/**
* 小睿
* 小睿
-微信
*/
XIAORUI
(
6
,
"小睿"
);
XIAORUI
(
6
,
"小睿(微信)"
),
/**
* 小睿-QQ
*/
XIAORUI_QQ
(
7
,
"小睿(QQ)"
);
public
final
Integer
code
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/consumer/wechatgroup/WechatGroupConsr.java
View file @
d1066982
...
...
@@ -28,7 +28,6 @@ import com.pcloud.wechatgroup.monitor.service.MonitorService;
import
com.pcloud.wechatgroup.selfrobot.dto.*
;
import
com.pcloud.wechatgroup.selfrobot.service.SelfRobotService
;
import
com.sdk.wxgroup.BaseVO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Component
;
...
...
@@ -620,10 +619,10 @@ public class WechatGroupConsr {
}
@ParamLog
(
"获取小号所有好友"
)
public
List
<
String
>
getFriendByRobotId
(
String
altId
)
{
public
List
<
String
>
getFriendByRobotId
(
String
altId
,
Integer
altType
)
{
List
<
String
>
ids
=
new
ArrayList
<>();
try
{
ids
=
ResponseHandleUtil
.
parseList
(
selfRobotService
.
getFriendByRobotId
(
altId
),
String
.
class
);
ids
=
ResponseHandleUtil
.
parseList
(
selfRobotService
.
getFriendByRobotId
AndType
(
altId
,
altType
),
String
.
class
);
}
catch
(
Exception
e
){
log
.
error
(
"[selfRobotService.getFriendByRobotId]调用失败"
+
e
.
getMessage
(),
e
);
}
...
...
@@ -631,13 +630,14 @@ public class WechatGroupConsr {
}
@ParamLog
(
"分页查小号好友id"
)
public
PageBeanNew
<
String
>
listPageFriend
(
Integer
currentPage
,
Integer
numPerPage
,
String
robotId
,
String
nam
e
){
public
PageBeanNew
<
String
>
listPageFriend
(
Integer
currentPage
,
Integer
numPerPage
,
String
robotId
,
String
name
,
Integer
groupRobotTyp
e
){
PageBeanNew
<
String
>
pageBeanNew
=
null
;
FriendParamDTO
friendParamDTO
=
new
FriendParamDTO
();
friendParamDTO
.
setCurrentPage
(
currentPage
);
friendParamDTO
.
setNumPerPage
(
numPerPage
);
friendParamDTO
.
setRobotId
(
robotId
);
friendParamDTO
.
setName
(
name
);
friendParamDTO
.
setGroupRobotType
(
groupRobotType
);
try
{
ResponseEntity
responseEntity
=
selfRobotService
.
listPageFriendId
(
friendParamDTO
);
Object
object
=
ResponseHandleUtil
.
parseResponse
(
responseEntity
);
...
...
@@ -699,4 +699,22 @@ public class WechatGroupConsr {
}
}
public
Map
<
String
,
GroupUserDTO
>
mapWxUserInfoByWxIdListAndType
(
List
<
String
>
wechatUserIds
,
Integer
groupRobotType
)
{
Map
<
String
,
GroupUserDTO
>
map
=
new
HashMap
<>();
try
{
map
=
ResponseHandleUtil
.
parseMapResponse
(
groupMemberService
.
mapWxUserInfoByWxIdListAndType
(
wechatUserIds
,
groupRobotType
),
String
.
class
,
GroupUserDTO
.
class
);
}
catch
(
Exception
e
)
{
log
.
error
(
"批量获取用户信息.[mapWxUserInfoByWxIdList]失败"
+
e
.
getMessage
(),
e
);
}
return
map
;
}
public
void
sendMessage4QQ
(
PrivateMsgSendVO
privateMsgSendVO
)
{
try
{
CoolQSDK
.
sendPrivateMsg
(
privateMsgSendVO
);
}
catch
(
Exception
e
)
{
log
.
error
(
"qq机器人给用户发送消息失败.[sendMessage]:"
+
e
.
getMessage
(),
e
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
View file @
d1066982
...
...
@@ -107,6 +107,7 @@ import com.pcloud.book.keywords.enums.ReplyTypeEnum;
import
com.pcloud.book.keywords.vo.ListKeywordVO
;
import
com.pcloud.book.pcloudkeyword.biz.PcloudRobotBiz
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobot
;
import
com.pcloud.book.push.enums.AltTypeEnum
;
import
com.pcloud.book.reading.dao.ReadingUserDao
;
import
com.pcloud.book.util.common.ThreadPoolUtils
;
import
com.pcloud.channelcenter.base.constants.ChannelConstants
;
...
...
@@ -161,6 +162,7 @@ import com.pcloud.settlementcenter.record.dto.ProductStaticUnderAppMapDTO;
import
com.pcloud.settlementcenter.record.service.SettlementService
;
import
com.pcloud.usercenter.party.adviser.dto.AdviserBaseInfoDto
;
import
com.pcloud.videolesson.schedule.service.ScheduleService
;
import
com.pcloud.wechatgroup.base.exception.WechatGroupBizException
;
import
com.pcloud.wechatgroup.group.dto.GroupMemberStatisDTO
;
import
com.pcloud.wechatgroup.group.dto.GroupRobotDTO
;
import
com.pcloud.wechatgroup.group.dto.GroupUserCountDTO
;
...
...
@@ -3819,18 +3821,23 @@ public class BookGroupBizImpl implements BookGroupBiz {
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
//判断robotid是否是小睿
String
robotId
=
userSelectParamDTO
.
getRobotId
();
Integer
groupRobotType
=
userSelectParamDTO
.
getGroupRobotType
();
List
<
UserBookInfoVO
>
list
=
new
ArrayList
<>();
Integer
totalCount
=
0
;
if
(
StringUtil
.
isEmpty
(
robotId
)){
throw
new
BizException
(
BizException
.
PARAM_IS_NULL
.
getCode
(),
"robotId为空"
);
}
if
(
null
==
groupRobotType
)
{
groupRobotType
=
AltTypeEnum
.
WECHAT
.
code
;
}
PcloudRobot
pcloudRobot
=
pcloudRobotBiz
.
getPcloudRobotByWxId
(
robotId
);
if
(
null
!=
pcloudRobot
){
PageBeanNew
<
String
>
wechatUserIdPage
=
wechatGroupConsr
.
listPageFriend
(
currentPage
,
numPerPage
,
robotId
,
userSelectParamDTO
.
getUserQuery
());
robotId
,
userSelectParamDTO
.
getUserQuery
()
,
groupRobotType
);
if
(!
ListUtils
.
isEmpty
(
wechatUserIdPage
.
getRecordList
())){
List
<
String
>
wechatUserIds
=
wechatUserIdPage
.
getRecordList
();
list
=
groupSet
.
setUserBookInfo4SelfPush4XIAORUI
(
wechatUserIds
);
list
=
groupSet
.
setUserBookInfo4SelfPush4XIAORUI
(
wechatUserIds
,
groupRobotType
);
totalCount
=
wechatUserIdPage
.
getTotalCount
();
}
}
else
{
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/dto/UserSelectParamDTO.java
View file @
d1066982
package
com
.
pcloud
.
book
.
group
.
dto
;
import
org.springframework.beans.factory.annotation.Value
;
import
java.util.List
;
import
javax.ws.rs.DefaultValue
;
import
feign.Client.Default
;
import
lombok.Data
;
/**
...
...
@@ -53,4 +58,9 @@ public class UserSelectParamDTO {
* 不展示活动已邀请的读者-共读活动
*/
private
Boolean
invitedFilter
;
/**
* 个人号类型 1 微信 2 qq
*/
private
Integer
groupRobotType
;
}
pcloud-service-book/src/main/java/com/pcloud/book/group/set/GroupSet.java
View file @
d1066982
...
...
@@ -802,10 +802,10 @@ public class GroupSet {
}
public
List
<
UserBookInfoVO
>
setUserBookInfo4SelfPush4XIAORUI
(
List
<
String
>
wechatUserIds
)
{
public
List
<
UserBookInfoVO
>
setUserBookInfo4SelfPush4XIAORUI
(
List
<
String
>
wechatUserIds
,
Integer
groupRobotType
)
{
List
<
UserBookInfoVO
>
userBookInfoVOS
=
new
ArrayList
<>();
if
(!
ListUtils
.
isEmpty
(
wechatUserIds
)){
Map
<
String
,
GroupUserDTO
>
userDTOMap
=
wechatGroupConsr
.
mapWxUserInfoByWxIdList
(
wechatUserIds
);
Map
<
String
,
GroupUserDTO
>
userDTOMap
=
wechatGroupConsr
.
mapWxUserInfoByWxIdList
AndType
(
wechatUserIds
,
groupRobotType
);
List
<
Long
>
labelIds
=
new
ArrayList
<>();
for
(
String
wechatUserId
:
wechatUserIds
)
{
//用户信息
...
...
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/biz/PcloudRobotBiz.java
View file @
d1066982
...
...
@@ -110,5 +110,7 @@ public interface PcloudRobotBiz {
void
handleMiniAppQr
();
PcloudRobotResponseVO
getSelfRobotClassify
(
String
robotId
);
void
sendQQWelcomeReply
(
Long
receiverId
,
Long
userId
,
List
<
PcloudRobotWelcome
>
robotWelcomeListByPcloudClassifyId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/biz/impl/PcloudRobotBizImpl.java
View file @
d1066982
...
...
@@ -17,6 +17,7 @@ import com.pcloud.book.consumer.resource.ProductConsr;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
import
com.pcloud.book.group.constant.BookBusinessConstants
;
import
com.pcloud.book.group.enums.AppAndProductTypeEnum
;
import
com.pcloud.book.group.enums.LargeTempletEnum
;
import
com.pcloud.book.group.tools.SendWeixinRequestTools
;
import
com.pcloud.book.guide.biz.PcloudGuideBiz
;
import
com.pcloud.book.guide.biz.PcloudRobotWakeUpBiz
;
...
...
@@ -50,6 +51,7 @@ import com.pcloud.book.push.biz.SelfPushBiz;
import
com.pcloud.book.push.dao.PersonalAppletsDao
;
import
com.pcloud.book.push.entity.PersonalApplets
;
import
com.pcloud.book.push.enums.ItemTypeEnum
;
import
com.pcloud.book.push.enums.AltTypeEnum
;
import
com.pcloud.book.skill.biz.PcloudSkillBiz
;
import
com.pcloud.book.skill.entity.PcloudSkill
;
import
com.pcloud.book.util.common.ThreadPoolUtils
;
...
...
@@ -422,7 +424,7 @@ public class PcloudRobotBizImpl implements PcloudRobotBiz {
index
++;
}
}
if
(
isOpenH5
==
1
)
{
if
(
robotClassify
!=
null
&&
robotClassify
.
getIsOpenPushH5url
()
!=
null
&&
robotClassify
.
getIsOpenPushH5url
()
==
1
)
{
//发送H5链接
String
endUrl
=
wechatLinkPrefix
+
"/dialog"
+
"?book_group_id="
+
0
+
"&wxId="
+
userWxId
+
"&robotWxId="
+
robotWxId
;
String
resultUrl
=
UrlUtils
.
getShortUrl4Own
(
endUrl
);
...
...
@@ -665,12 +667,19 @@ public class PcloudRobotBizImpl implements PcloudRobotBiz {
}
@Override
public
PageBeanNew
<
PcloudRobotResponseVO
>
listSelfRobotByClassify
(
Integer
largeTemplet
,
Long
classifyId
,
String
keyword
,
Integer
currentPage
,
Integer
numPerPage
)
{
public
PageBeanNew
<
PcloudRobotResponseVO
>
listSelfRobotByClassify
(
Integer
largeTemplet
,
Long
classifyId
,
String
keyword
,
Integer
currentPage
,
Integer
numPerPage
)
{
Integer
groupRobotType
=
null
;
if
(
largeTemplet
==
6
){
//小睿(微信)
groupRobotType
=
1
;
}
else
if
(
largeTemplet
==
7
){
//小睿(QQ)
groupRobotType
=
2
;
}
List
<
PcloudRobotResponseVO
>
vos
=
new
ArrayList
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"classifyId"
,
classifyId
);
paramMap
.
put
(
"keyword"
,
keyword
);
if
(!
new
Integer
(
6
)
.
equals
(
largeTemplet
)){
if
(!
LargeTempletEnum
.
XIAORUI
.
code
.
equals
(
largeTemplet
)
&&
!
LargeTempletEnum
.
XIAORUI_QQ
.
code
.
equals
(
largeTemplet
)){
List
<
RobotBaseInfoDTO
>
baseInfoDTOList
=
wechatGroupConsr
.
getRobotInfoByTemplet
(
largeTemplet
);
if
(
ListUtils
.
isEmpty
(
baseInfoDTOList
)){
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
0
,
new
ArrayList
<>());
...
...
@@ -704,6 +713,7 @@ public class PcloudRobotBizImpl implements PcloudRobotBiz {
}
paramMap
.
put
(
"wxIds"
,
wxIds
);
}
paramMap
.
put
(
"groupRobotType"
,
groupRobotType
);
PageBeanNew
<
RobotClassifyDTO
>
pageBeanNew
=
pcloudRobotDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
paramMap
,
"listSelfRobotByClassify"
);
List
<
RobotClassifyDTO
>
robotClassifyDTOS
=
pageBeanNew
.
getRecordList
();
if
(
ListUtils
.
isEmpty
(
robotClassifyDTOS
))
{
...
...
@@ -968,4 +978,9 @@ wechatGroupConsr.sendMessage(JSON.toJSONString(sendFileVO));
}
}
@Override
public
PcloudRobotResponseVO
getSelfRobotClassify
(
String
robotId
)
{
return
pcloudRobotDao
.
getSelfRobotClassify
(
robotId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/dao/PcloudRobotDao.java
View file @
d1066982
...
...
@@ -3,6 +3,7 @@ package com.pcloud.book.pcloudkeyword.dao;
import
com.pcloud.book.pcloudKeyword.dto.RobotClassifyDTO
;
import
com.pcloud.book.pcloudkeyword.dto.PcloudRobotCountDTO
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobot
;
import
com.pcloud.book.pcloudkeyword.facade.response.PcloudRobotResponseVO
;
import
com.pcloud.common.core.dao.BaseDao
;
import
java.util.List
;
...
...
@@ -52,4 +53,5 @@ public interface PcloudRobotDao extends BaseDao<PcloudRobot> {
List
<
PcloudRobotCountDTO
>
getPcloudRobotCount
(
List
<
Long
>
classifyIds
);
PcloudRobotResponseVO
getSelfRobotClassify
(
String
robotId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/dao/impl/PcloudRobotDaoImpl.java
View file @
d1066982
...
...
@@ -5,6 +5,7 @@ import com.pcloud.book.pcloudKeyword.dto.RobotClassifyDTO;
import
com.pcloud.book.pcloudkeyword.dao.PcloudRobotDao
;
import
com.pcloud.book.pcloudkeyword.dto.PcloudRobotCountDTO
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobot
;
import
com.pcloud.book.pcloudkeyword.facade.response.PcloudRobotResponseVO
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Component
;
...
...
@@ -112,4 +113,10 @@ public class PcloudRobotDaoImpl extends BaseDaoImpl<PcloudRobot> implements Pclo
map
.
put
(
"classifyIds"
,
classifyIds
);
return
getSessionTemplate
().
selectList
(
getStatement
(
"getPcloudRobotCount"
),
map
);
}
@Override
public
PcloudRobotResponseVO
getSelfRobotClassify
(
String
robotId
)
{
return
this
.
getSessionTemplate
().
selectOne
(
this
.
getStatement
(
"getSelfRobotClassify"
),
robotId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/facade/PcloudRobotFacade.java
View file @
d1066982
...
...
@@ -5,6 +5,7 @@ import com.pcloud.book.pcloudkeyword.dto.PcloudTdDTO;
import
com.pcloud.book.pcloudkeyword.entity.PcloudClassifyTemplate
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobot
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobotWelcome
;
import
com.pcloud.book.pcloudkeyword.facade.response.PcloudRobotResponseVO
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.permission.PermissionException
;
...
...
@@ -295,4 +296,15 @@ public class PcloudRobotFacade {
pcloudRobotBiz
.
updateUniqueNumber
(
id
,
uniqueNumber
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
value
=
"根据小号id获取小号信息"
)
@GetMapping
(
"getSelfRobotClassify"
)
ResponseDto
<?>
getSelfRobotClassify
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"robotId"
)
String
robotId
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
return
new
ResponseDto
<
PcloudRobotResponseVO
>(
pcloudRobotBiz
.
getSelfRobotClassify
(
robotId
));
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/biz/impl/SelfPushBizImpl.java
View file @
d1066982
package
com
.
pcloud
.
book
.
push
.
biz
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.pcloud.appcenter.app.dto.AppDto
;
import
com.dcg.coolq.sdk.message.MessageBuilder
;
import
com.dcg.coolq.sdk.message.components.ComponentImage
;
import
com.dcg.coolq.sdk.message.components.ComponentRecord
;
import
com.dcg.coolq.sdk.message.components.ComponentText
;
import
com.dcg.coolq.sdk.message.vos.send.PrivateMsgSendVO
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.consumer.content.ResourceConsr
;
import
com.pcloud.book.consumer.user.PartyConsr
;
...
...
@@ -16,12 +20,10 @@ import com.pcloud.book.group.enums.AppAndProductTypeEnum;
import
com.pcloud.book.group.enums.LargeTempletEnum
;
import
com.pcloud.book.group.set.GroupSet
;
import
com.pcloud.book.group.vo.UserBookInfoVO
;
import
com.pcloud.book.guide.dto.PcloudGuideMessageDTO
;
import
com.pcloud.book.keywords.enums.ReplyTypeEnum
;
import
com.pcloud.book.pcloudKeyword.dto.RobotClassifyDTO
;
import
com.pcloud.book.pcloudkeyword.biz.PcloudRobotBiz
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobot
;
import
com.pcloud.book.pcloudkeyword.enums.WelcomeReplyTypeEnum
;
import
com.pcloud.book.pcloudkeyword.set.PcloudRobotSet
;
import
com.pcloud.book.push.biz.SelfPushBiz
;
import
com.pcloud.book.push.constant.PushConstant
;
...
...
@@ -37,11 +39,11 @@ import com.pcloud.book.push.entity.PersonalApplets;
import
com.pcloud.book.push.entity.SelfPush
;
import
com.pcloud.book.push.entity.SelfPushItem
;
import
com.pcloud.book.push.entity.SelfPushUser
;
import
com.pcloud.book.push.enums.AltTypeEnum
;
import
com.pcloud.book.push.enums.ItemTypeEnum
;
import
com.pcloud.book.push.enums.PushStatusEnum
;
import
com.pcloud.book.skill.dto.AppOrProductReplyDTO
;
import
com.pcloud.book.util.common.ThreadPoolUtils
;
import
com.pcloud.channelcenter.wechat.dto.AccountSettingDto
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.constant.SystemCode
;
import
com.pcloud.common.page.PageBeanNew
;
...
...
@@ -53,7 +55,6 @@ import com.pcloud.contentcenter.resource.dto.ResourceDTO;
import
com.pcloud.facade.quartz.entity.CallBackParam
;
import
com.pcloud.facade.quartz.entity.ScheduleJob
;
import
com.pcloud.facade.quartz.service.ScheduleService
;
import
com.pcloud.resourcecenter.product.dto.ProductDto
;
import
com.pcloud.usercenter.user.entity.UserLogin
;
import
com.pcloud.wechatgroup.group.dto.GroupRobotDTO
;
import
com.pcloud.wechatgroup.group.dto.GroupUserDTO
;
...
...
@@ -131,6 +132,7 @@ public class SelfPushBizImpl implements SelfPushBiz {
SelfPush
selfPush
=
new
SelfPush
();
selfPush
.
setCreateUser
(
partyId
);
selfPush
.
setUpdateUser
(
partyId
);
selfPush
.
setAltType
(
addParamDTO
.
getAltType
());
if
(
SystemCode
.
adviser
.
code
.
equalsIgnoreCase
(
addParamDTO
.
getSystemCode
())){
selfPush
.
setBookGroupId
(
addParamDTO
.
getBookGroupId
());
selfPush
.
setSendAll
(
false
);
...
...
@@ -138,7 +140,7 @@ public class SelfPushBizImpl implements SelfPushBiz {
if
(
SystemCode
.
pcloud
.
code
.
equalsIgnoreCase
(
addParamDTO
.
getSystemCode
())){
selfPush
.
setAltId
(
addParamDTO
.
getAltId
());
if
(
addParamDTO
.
getSendAll
()){
//发送全部好友
List
<
String
>
userIdList
=
wechatGroupConsr
.
getFriendByRobotId
(
addParamDTO
.
getAltId
());
List
<
String
>
userIdList
=
wechatGroupConsr
.
getFriendByRobotId
(
addParamDTO
.
getAltId
()
,
addParamDTO
.
getAltType
()
);
addParamDTO
.
setUserIdList
(
userIdList
);
}
selfPush
.
setSendAll
(
addParamDTO
.
getSendAll
());
...
...
@@ -309,7 +311,7 @@ public class SelfPushBizImpl implements SelfPushBiz {
}
/**
*
微信群
消息推送
*
群发
消息推送
*/
private
void
msgPush
(
List
<
String
>
userIdList
,
List
<
SelfPushItem
>
itemList
,
Long
pushId
)
{
SelfPush
selfPush
=
selfPushDao
.
getById
(
pushId
);
...
...
@@ -327,7 +329,11 @@ public class SelfPushBizImpl implements SelfPushBiz {
for
(
String
userId
:
sendUserIds
)
{
String
uuid
=
UUID
.
randomUUID
().
toString
();
for
(
SelfPushItem
pushItem
:
itemList
)
{
if
(
AltTypeEnum
.
WECHAT
.
code
.
equals
(
selfPush
.
getAltType
())){
sendSelfMsg
(
userId
,
altId
,
pushItem
,
uuid
,
itemList
.
indexOf
(
pushItem
),
itemList
.
size
());
}
else
if
(
AltTypeEnum
.
QQ
.
code
.
equals
(
selfPush
.
getAltType
())){
sendSelfMsg4QQ
(
userId
,
altId
,
pushItem
);
}
}
}
selfPushItemDao
.
updatePushStatusByPushId
(
PushStatusEnum
.
SUCCESS
.
value
,
pushId
);
...
...
@@ -349,7 +355,11 @@ public class SelfPushBizImpl implements SelfPushBiz {
String
altId
=
bookGroupDTO
.
getWxId
();
String
uuid
=
UUID
.
randomUUID
().
toString
();
for
(
SelfPushItem
pushItem
:
itemList
)
{
if
(
AltTypeEnum
.
WECHAT
.
code
.
equals
(
selfPush
.
getAltType
()))
{
sendSelfMsg
(
userId
,
altId
,
pushItem
,
uuid
,
itemList
.
indexOf
(
pushItem
),
itemList
.
size
());
}
else
if
(
AltTypeEnum
.
QQ
.
code
.
equals
(
selfPush
.
getAltType
())){
sendSelfMsg4QQ
(
userId
,
altId
,
pushItem
);
}
}
}
selfPushItemDao
.
updatePushStatusByPushId
(
PushStatusEnum
.
SUCCESS
.
value
,
pushId
);
...
...
@@ -358,7 +368,43 @@ public class SelfPushBizImpl implements SelfPushBiz {
}
private
void
sendSelfMsg4QQ
(
String
userId
,
String
altId
,
SelfPushItem
selfPushItem
)
{
if
(
StringUtil
.
isEmpty
(
userId
)
||
StringUtil
.
isEmpty
(
altId
)){
return
;
}
if
(
pcloudRobotBiz
.
getUserTdState
(
altId
,
userId
)
==
1
)
{
return
;
}
Integer
itemType
=
selfPushItem
.
getItemType
();
PrivateMsgSendVO
privateMsgSendVO
=
new
PrivateMsgSendVO
();
privateMsgSendVO
.
setSenderQQCode
(
Long
.
valueOf
(
altId
));
privateMsgSendVO
.
setReceiverQQCode
(
Long
.
valueOf
(
userId
));
if
(
ItemTypeEnum
.
TEXT
.
value
.
equals
(
itemType
))
{
// 构造一个文本消息
String
message
=
new
MessageBuilder
().
add
(
new
ComponentText
(
selfPushItem
.
getTextContent
())).
toString
();
// 文本消息
privateMsgSendVO
.
setMessage
(
message
);
wechatGroupConsr
.
sendMessage4QQ
(
privateMsgSendVO
);
return
;
}
if
(
ItemTypeEnum
.
IMAGE
.
value
.
equals
(
itemType
))
{
// 构造一个图片消息
String
message
=
new
MessageBuilder
().
add
(
new
ComponentImage
(
selfPushItem
.
getImageUrl
()))
.
toString
();
// 图片消息
privateMsgSendVO
.
setMessage
(
message
);
wechatGroupConsr
.
sendMessage4QQ
(
privateMsgSendVO
);
return
;
}
if
(
ItemTypeEnum
.
AUDIO
.
value
.
equals
(
itemType
))
{
Map
<
Long
,
ResourceDTO
>
map
=
resourceConsr
.
mapByIds
(
Arrays
.
asList
(
selfPushItem
.
getResourceId
()));
ResourceDTO
resourceDTO
=
map
.
get
(
selfPushItem
.
getResourceId
());
if
(
resourceDTO
!=
null
&&
!
StringUtil
.
isEmpty
(
resourceDTO
.
getFileUrl
()))
{
// 构造一个文件消息
String
message
=
new
MessageBuilder
().
add
(
new
ComponentRecord
(
resourceDTO
.
getFileUrl
(),
false
)).
toString
();
privateMsgSendVO
.
setMessage
(
message
);
wechatGroupConsr
.
sendMessage4QQ
(
privateMsgSendVO
);
}
return
;
}
}
/**
* 群发项设置
...
...
@@ -596,7 +642,7 @@ public class SelfPushBizImpl implements SelfPushBiz {
}
if
(
isXIAORUI
){
//小睿无扫码书刊标签
List
<
String
>
wxUserIds
=
pageBeanNew
.
getRecordList
().
stream
().
filter
(
s
->
s
.
getWxUserId
()
!=
null
).
map
(
UserBookInfoVO:
:
getWxUserId
).
distinct
().
collect
(
Collectors
.
toList
());
Map
<
String
,
GroupUserDTO
>
userDTOMap
=
wechatGroupConsr
.
mapWxUserInfoByWxIdList
(
wxUserIds
);
Map
<
String
,
GroupUserDTO
>
userDTOMap
=
wechatGroupConsr
.
mapWxUserInfoByWxIdList
AndType
(
wxUserIds
,
selfPush
.
getAltType
()
);
for
(
UserBookInfoVO
userBookInfoVO
:
pageBeanNew
.
getRecordList
())
{
if
(!
MapUtils
.
isEmpty
(
userDTOMap
)
&&
userDTOMap
.
containsKey
(
userBookInfoVO
.
getWxUserId
()))
{
GroupUserDTO
userDTO
=
userDTOMap
.
get
(
userBookInfoVO
.
getWxUserId
());
...
...
@@ -622,44 +668,11 @@ public class SelfPushBizImpl implements SelfPushBiz {
if
(
null
==
pageBeanNew
||
ListUtils
.
isEmpty
(
pageBeanNew
.
getRecordList
()))
{
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
0
,
new
ArrayList
<>());
}
for
(
SelfPushRecordDTO
dto:
pageBeanNew
.
getRecordList
())
{
String
realSendTime
=
""
;
if
(
dto
.
getPushType
()!=
null
&&
dto
.
getPushType
()==
1
){
realSendTime
=
DateUtils
.
formatDate
(
dto
.
getStartTime
(),
"yyyy-MM-dd"
)+
"至"
+
DateUtils
.
formatDate
(
dto
.
getEndTime
(),
"yyyy-MM-dd"
)+
";"
;
realSendTime
=
realSendTime
+
"每天;"
+
dto
.
getPushSendTime
();
dto
.
setRealSendTime
(
realSendTime
);
}
else
if
(
dto
.
getPushType
()!=
null
&&
dto
.
getPushType
()==
2
){
String
weekDays
=
dto
.
getWeekDays
();
realSendTime
=
DateUtils
.
formatDate
(
dto
.
getStartTime
(),
"yyyy-MM-dd"
)+
"至"
+
DateUtils
.
formatDate
(
dto
.
getEndTime
(),
"yyyy-MM-dd"
)+
";"
;
if
(
weekDays
.
contains
(
"1"
)){
weekDays
=
weekDays
.
replace
(
"1"
,
"周一"
);
}
if
(
weekDays
.
contains
(
"2"
)){
weekDays
=
weekDays
.
replace
(
"2"
,
"周二"
);
}
if
(
weekDays
.
contains
(
"3"
)){
weekDays
=
weekDays
.
replace
(
"3"
,
"周三"
);
}
if
(
weekDays
.
contains
(
"4"
)){
weekDays
=
weekDays
.
replace
(
"4"
,
"周四"
);
}
if
(
weekDays
.
contains
(
"5"
)){
weekDays
=
weekDays
.
replace
(
"5"
,
"周五"
);
}
if
(
weekDays
.
contains
(
"6"
)){
weekDays
=
weekDays
.
replace
(
"6"
,
"周六"
);
}
if
(
weekDays
.
contains
(
"7"
)){
weekDays
=
weekDays
.
replace
(
"7"
,
"周日"
);
}
realSendTime
=
realSendTime
+
weekDays
+
";"
+
dto
.
getPushSendTime
();
dto
.
setRealSendTime
(
realSendTime
);
}
else
{
dto
.
setRealSendTime
(
DateUtils
.
formatDate
(
dto
.
getSendTime
(),
"yyyy-MM-dd HH:mm:ss"
));
}
}
//填充群发时间
setSelfPushTime
(
pageBeanNew
.
getRecordList
());
//填充群发人数和关联书刊
fillPushItemsAndBookName
(
pageBeanNew
.
getRecordList
());
//填充个人号信息、群发创建人信息
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
,
RobotClassifyDTO
>
robotClassifyDTOMap
=
new
HashMap
<>();
...
...
@@ -667,18 +680,16 @@ public class SelfPushBizImpl implements SelfPushBiz {
robotMap
=
wechatGroupConsr
.
mapRobotInfoByIdList
(
wxIds
);
robotClassifyDTOMap
=
pcloudRobotBiz
.
mapByIds4Classify
(
wxIds
);
}
List
<
Long
>
pcloudPartyIds
=
pageBeanNew
.
getRecordList
().
stream
().
filter
(
s
->!
StringUtil
.
isEmpty
(
s
.
getAltId
())).
map
(
SelfPushRecordDTO:
:
getCreateUser
).
distinct
().
collect
(
Collectors
.
toList
());
Map
<
Long
,
UserLogin
>
loginMap
=
new
HashMap
<>();
if
(!
ListUtils
.
isEmpty
(
pcloudPartyIds
)){
for
(
Long
id
:
pcloudPartyIds
){
if
(
id
==
0L
){
continue
;
}
if
(
id
!=
0L
){
UserLogin
userLogin
=
partyConsr
.
getUserLoginInfoByPartyId
(
id
,
SystemCode
.
pcloud
.
code
,
"0"
);
loginMap
.
put
(
id
,
userLogin
);
}
}
}
for
(
SelfPushRecordDTO
dto
:
pageBeanNew
.
getRecordList
())
{
if
(!
MapUtils
.
isEmpty
(
robotMap
)
&&
!
StringUtil
.
isEmpty
(
dto
.
getAltId
())
&&
robotMap
.
containsKey
(
dto
.
getAltId
()))
{
GroupUserDTO
userDTO
=
robotMap
.
get
(
dto
.
getAltId
());
...
...
@@ -702,6 +713,49 @@ public class SelfPushBizImpl implements SelfPushBiz {
return
pageBeanNew
;
}
private
void
setSelfPushTime
(
List
<
SelfPushRecordDTO
>
recordList
)
{
if
(
ListUtils
.
isEmpty
(
recordList
)){
return
;
}
for
(
SelfPushRecordDTO
dto:
recordList
)
{
String
realSendTime
=
""
;
if
(
dto
.
getPushType
()!=
null
&&
dto
.
getPushType
()==
1
){
realSendTime
=
DateUtils
.
formatDate
(
dto
.
getStartTime
(),
"yyyy-MM-dd"
)+
"至"
+
DateUtils
.
formatDate
(
dto
.
getEndTime
(),
"yyyy-MM-dd"
)+
";"
;
realSendTime
=
realSendTime
+
"每天;"
+
dto
.
getPushSendTime
();
dto
.
setRealSendTime
(
realSendTime
);
}
else
if
(
dto
.
getPushType
()!=
null
&&
dto
.
getPushType
()==
2
){
String
weekDays
=
dto
.
getWeekDays
();
realSendTime
=
DateUtils
.
formatDate
(
dto
.
getStartTime
(),
"yyyy-MM-dd"
)+
"至"
+
DateUtils
.
formatDate
(
dto
.
getEndTime
(),
"yyyy-MM-dd"
)+
";"
;
if
(
weekDays
.
contains
(
"1"
)){
weekDays
=
weekDays
.
replace
(
"1"
,
"周一"
);
}
if
(
weekDays
.
contains
(
"2"
)){
weekDays
=
weekDays
.
replace
(
"2"
,
"周二"
);
}
if
(
weekDays
.
contains
(
"3"
)){
weekDays
=
weekDays
.
replace
(
"3"
,
"周三"
);
}
if
(
weekDays
.
contains
(
"4"
)){
weekDays
=
weekDays
.
replace
(
"4"
,
"周四"
);
}
if
(
weekDays
.
contains
(
"5"
)){
weekDays
=
weekDays
.
replace
(
"5"
,
"周五"
);
}
if
(
weekDays
.
contains
(
"6"
)){
weekDays
=
weekDays
.
replace
(
"6"
,
"周六"
);
}
if
(
weekDays
.
contains
(
"7"
)){
weekDays
=
weekDays
.
replace
(
"7"
,
"周日"
);
}
realSendTime
=
realSendTime
+
weekDays
+
";"
+
dto
.
getPushSendTime
();
dto
.
setRealSendTime
(
realSendTime
);
}
else
{
dto
.
setRealSendTime
(
DateUtils
.
formatDate
(
dto
.
getSendTime
(),
"yyyy-MM-dd HH:mm:ss"
));
}
}
}
private
void
fillPushItemsAndBookName
(
List
<
SelfPushRecordDTO
>
recordList
)
{
List
<
Long
>
pushIds
=
new
ArrayList
<>();
List
<
Long
>
bookGroupIds
=
new
ArrayList
<>();
...
...
@@ -742,7 +796,8 @@ public class SelfPushBizImpl implements SelfPushBiz {
if
(
ListUtils
.
isEmpty
(
list
)){
return
;
}
List
<
Long
>
resourceIds
=
list
.
stream
().
filter
(
s
->
s
.
getItemType
().
equals
(
ItemTypeEnum
.
RESOURCE
.
value
)).
map
(
SelfPushItem:
:
getResourceId
).
distinct
().
collect
(
Collectors
.
toList
());
List
<
Long
>
resourceIds
=
list
.
stream
().
filter
(
s
->(
s
.
getItemType
().
equals
(
ItemTypeEnum
.
RESOURCE
.
value
)
||
s
.
getItemType
().
equals
(
ItemTypeEnum
.
AUDIO
.
value
))).
map
(
SelfPushItem:
:
getResourceId
).
distinct
().
collect
(
Collectors
.
toList
());
Map
<
Long
,
ResourceDTO
>
resourceDTOMap
=
new
HashMap
<>();
if
(!
ListUtils
.
isEmpty
(
resourceIds
)){
resourceDTOMap
=
resourceConsr
.
mapByIds
(
resourceIds
);
...
...
@@ -774,6 +829,21 @@ public class SelfPushBizImpl implements SelfPushBiz {
if
(
ItemTypeEnum
.
IMAGE
.
value
.
equals
(
selfPushItem
.
getItemType
())){
selfPushItem
.
setReplyType
(
ReplyTypeEnum
.
IMAGE
.
value
);
}
if
(
ItemTypeEnum
.
AUDIO
.
value
.
equals
(
selfPushItem
.
getItemType
())){
selfPushItem
.
setReplyType
(
ReplyTypeEnum
.
AUDIO
.
value
);
ResourceDTO
resourceDTO
=
resourceDTOMap
.
get
(
selfPushItem
.
getResourceId
());
if
(
resourceDTO
!=
null
){
selfPushItem
.
setResourceName
(
resourceDTO
.
getResourceName
());
selfPushItem
.
setResourceUrl
(
resourceDTO
.
getFileUrl
());
selfPushItem
.
setResourceTypeCode
(
resourceDTO
.
getTypeCode
());
selfPushItem
.
setResourceTypeName
(
resourceDTO
.
getTypeName
());
selfPushItem
.
setFileType
(
resourceDTO
.
getFileType
());
selfPushItem
.
setResourcePdfItems
(
resourceDTO
.
getResourcePdfItems
());
selfPushItem
.
setResourceOfficeItemDTOs
(
resourceDTO
.
getResourceOfficeItemDTOs
());
selfPushItem
.
setFileSize
(
resourceDTO
.
getFileSize
());
}
}
}
}
...
...
@@ -797,7 +867,7 @@ public class SelfPushBizImpl implements SelfPushBiz {
}
List
<
String
>
userIdList
=
selfPushUserDao
.
getUserIdListByPushId
(
pushId
);
if
(
selfPush
.
getSendAll
()
&&
!
StringUtil
.
isEmpty
(
selfPush
.
getAltId
())){
//群发所有好友,更新发送好友列表
userIdList
=
wechatGroupConsr
.
getFriendByRobotId
(
selfPush
.
getAltId
());
userIdList
=
wechatGroupConsr
.
getFriendByRobotId
(
selfPush
.
getAltId
()
,
selfPush
.
getAltType
()
);
selfPushUserDao
.
deleteByPushId
(
pushId
);
setSelfPushUser
(
userIdList
,
selfPush
.
getCreateUser
(),
pushId
);
}
...
...
@@ -885,7 +955,11 @@ public class SelfPushBizImpl implements SelfPushBiz {
if
(
pcloudRobot
!=
null
){
//小睿
altName
=
pcloudRobot
.
getNickName
();
altTypeName
=
"小睿"
;
if
(
AltTypeEnum
.
WECHAT
.
code
.
equals
(
selfPush
.
getAltType
())){
altTypeName
=
LargeTempletEnum
.
XIAORUI
.
name
;
}
else
if
(
AltTypeEnum
.
QQ
.
code
.
equals
(
selfPush
.
getAltType
())){
altTypeName
=
LargeTempletEnum
.
XIAORUI_QQ
.
name
;
}
}
else
{
//不是小睿
Map
<
String
,
RobotBaseInfoDTO
>
mapRobotInfo
=
wechatGroupConsr
.
mapRobotInfo
(
Arrays
.
asList
(
altId
));
...
...
pcloud-service-book/src/main/java/com/pcloud/book/push/check/PushCheck.java
View file @
d1066982
...
...
@@ -9,6 +9,7 @@ import com.pcloud.book.push.entity.Push;
import
com.pcloud.book.push.entity.PushGroup
;
import
com.pcloud.book.push.entity.PushItem
;
import
com.pcloud.book.push.entity.SelfPushItem
;
import
com.pcloud.book.push.enums.AltTypeEnum
;
import
com.pcloud.book.push.enums.ItemTypeEnum
;
import
com.pcloud.book.push.enums.PushTypeEnum
;
import
com.pcloud.common.core.aspect.ParamLog
;
...
...
@@ -308,6 +309,9 @@ public class PushCheck {
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"请选择群发对象"
);
}
}
if
(
null
==
addParamDTO
.
getAltType
()){
//默认微信发送
addParamDTO
.
setAltType
(
AltTypeEnum
.
WECHAT
.
code
);
}
if
(
null
==
addParamDTO
.
getSendNow
())
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"缺少立即发送字段"
);
}
...
...
@@ -333,8 +337,6 @@ public class PushCheck {
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"自定义发送周机不能为空"
);
}
}
}
if
(
ListUtils
.
isEmpty
(
addParamDTO
.
getReplyParamDTOS
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"发送消息为空"
);
...
...
@@ -370,6 +372,9 @@ public class PushCheck {
if
(
ReplyTypeEnum
.
RESOURCE
.
value
.
equals
(
replyParamDTO
.
getReplyType
())
&&
null
==
replyParamDTO
.
getResourceId
())
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"发送消息项内容类型为文件时,文件id不能为空!"
);
}
if
(
ReplyTypeEnum
.
AUDIO
.
value
.
equals
(
replyParamDTO
.
getReplyType
())
&&
null
==
replyParamDTO
.
getResourceId
())
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"发送消息项内容类型为语音时,文件id不能为空!"
);
}
//参数转换
List
<
SelfPushItem
>
items
=
paramChange
(
addParamDTO
.
getReplyParamDTOS
());
...
...
@@ -420,6 +425,10 @@ public class PushCheck {
item
.
setLinkUrl
(
paramDTO
.
getLinkUrl
());
item
.
setItemType
(
ItemTypeEnum
.
APP
.
value
);
}
if
(
ReplyTypeEnum
.
AUDIO
.
value
.
equals
(
paramDTO
.
getReplyType
())){
item
.
setResourceId
(
paramDTO
.
getResourceId
());
item
.
setItemType
(
ItemTypeEnum
.
AUDIO
.
value
);
}
itemList
.
add
(
item
);
}
return
itemList
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/push/dto/SelfPushAddParamDTO.java
View file @
d1066982
...
...
@@ -72,6 +72,9 @@ public class SelfPushAddParamDTO {
* 是否发送所有好友
*/
private
Boolean
sendAll
;
/**
* 个人号类型(1微信2QQ)
*/
private
Integer
altType
;
}
pcloud-service-book/src/main/java/com/pcloud/book/push/dto/SelfPushRecordDTO.java
View file @
d1066982
...
...
@@ -127,5 +127,8 @@ public class SelfPushRecordDTO extends BaseDto{
@ApiModelProperty
(
"资源id"
)
private
Long
resourceId
;
@ApiModelProperty
(
"个人号分类"
)
private
Integer
groupRobotType
;
}
pcloud-service-book/src/main/java/com/pcloud/book/push/entity/SelfPush.java
View file @
d1066982
...
...
@@ -11,6 +11,7 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
@ApiModel
(
"个人号群发"
)
@Data
public
class
SelfPush
extends
BaseEntity
{
@ApiModelProperty
(
"群发小号id"
)
...
...
@@ -55,8 +56,6 @@ public class SelfPush extends BaseEntity{
@ApiModelProperty
(
"计划发送时间(不带日期)"
)
private
String
pushSendTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"发送时间"
)
private
Date
sendTime
;
...
...
@@ -70,143 +69,7 @@ public class SelfPush extends BaseEntity{
@ApiModelProperty
(
"个人号发送项集合"
)
private
List
<
SelfPushItem
>
pushItems
;
public
Date
getStartTime
()
{
return
startTime
;
}
public
void
setStartTime
(
Date
startTime
)
{
this
.
startTime
=
startTime
;
}
public
Date
getEndTime
()
{
return
endTime
;
}
public
void
setEndTime
(
Date
endTime
)
{
this
.
endTime
=
endTime
;
}
public
Integer
getPushType
()
{
return
pushType
;
}
public
void
setPushType
(
Integer
pushType
)
{
this
.
pushType
=
pushType
;
}
public
String
getWeekDays
()
{
return
weekDays
;
}
public
void
setWeekDays
(
String
weekDays
)
{
this
.
weekDays
=
weekDays
;
}
public
String
getPushSendTime
()
{
return
pushSendTime
;
}
@ApiModelProperty
(
"个人号类型(1微信2QQ)"
)
private
Integer
altType
;
public
void
setPushSendTime
(
String
pushSendTime
)
{
this
.
pushSendTime
=
pushSendTime
;
}
public
String
getAltId
()
{
return
altId
;
}
public
void
setAltId
(
String
altId
)
{
this
.
altId
=
altId
;
}
public
String
getAltName
()
{
return
altName
;
}
public
void
setAltName
(
String
altName
)
{
this
.
altName
=
altName
;
}
public
String
getAltTypeName
()
{
return
altTypeName
;
}
public
void
setAltTypeName
(
String
altTypeName
)
{
this
.
altTypeName
=
altTypeName
;
}
public
List
<
SelfPushItem
>
getPushItems
()
{
return
pushItems
;
}
public
void
setPushItems
(
List
<
SelfPushItem
>
pushItems
)
{
this
.
pushItems
=
pushItems
;
}
public
Long
getCreateUser
()
{
return
createUser
;
}
public
void
setCreateUser
(
Long
createUser
)
{
this
.
createUser
=
createUser
;
}
@Override
public
Date
getCreateTime
()
{
return
createTime
;
}
@Override
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Long
getUpdateUser
()
{
return
updateUser
;
}
public
void
setUpdateUser
(
Long
updateUser
)
{
this
.
updateUser
=
updateUser
;
}
@Override
public
Date
getUpdateTime
()
{
return
updateTime
;
}
@Override
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
Boolean
getSendNow
()
{
return
sendNow
;
}
public
void
setSendNow
(
Boolean
sendNow
)
{
this
.
sendNow
=
sendNow
;
}
public
Date
getSendTime
()
{
return
sendTime
;
}
public
void
setSendTime
(
Date
sendTime
)
{
this
.
sendTime
=
sendTime
;
}
public
Long
getBookGroupId
()
{
return
bookGroupId
;
}
public
void
setBookGroupId
(
Long
bookGroupId
)
{
this
.
bookGroupId
=
bookGroupId
;
}
public
Boolean
getSendAll
()
{
return
sendAll
;
}
public
void
setSendAll
(
Boolean
sendAll
)
{
this
.
sendAll
=
sendAll
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/push/enums/AltTypeEnum.java
0 → 100644
View file @
d1066982
package
com
.
pcloud
.
book
.
push
.
enums
;
/**
* 个人号类型
*/
public
enum
AltTypeEnum
{
/**
* 1微信
*/
WECHAT
(
1
),
/**
* 2 QQ
*/
QQ
(
2
);
public
Integer
code
;
AltTypeEnum
(
Integer
code
)
{
this
.
code
=
code
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/push/enums/ItemTypeEnum.java
View file @
d1066982
...
...
@@ -27,6 +27,10 @@ public enum ItemTypeEnum {
* 资源
*/
RESOURCE
(
5
),
/**
* 语音
*/
AUDIO
(
6
),
/**
* 小程序
...
...
pcloud-service-book/src/main/java/com/pcloud/book/timecontrol/biz/impl/SelfPlanBizImpl.java
View file @
d1066982
...
...
@@ -329,7 +329,7 @@ public class SelfPlanBizImpl implements SelfPlanBiz {
PcloudRobot
pcloudRobot
=
pcloudRobotBiz
.
getPcloudRobotByWxId
(
robotId
);
if
(
null
!=
pcloudRobot
)
{
PageBeanNew
<
String
>
wechatUserIdPage
=
wechatGroupConsr
.
listPageFriend
(
currentPage
,
numPerPage
,
robotId
,
userSelectParamDTO
.
getUserQuery
());
robotId
,
userSelectParamDTO
.
getUserQuery
()
,
userSelectParamDTO
.
getGroupRobotType
()
);
if
(!
ListUtils
.
isEmpty
(
wechatUserIdPage
.
getRecordList
()))
{
List
<
String
>
wechatUserIds
=
wechatUserIdPage
.
getRecordList
();
Map
<
String
,
SelfPlanUserDto
>
selfPlanUserDtoMap
=
timeControlSelfPlanMapper
.
getSelfPlanUserDtoMap
(
wechatUserIds
);
...
...
pcloud-service-book/src/main/resources/mapper/pcloudkeyword/PcloudRobot.Mapper.xml
View file @
d1066982
...
...
@@ -16,10 +16,18 @@
<result
column=
"welcome_duration"
property=
"welcomeDuration"
jdbcType=
"INTEGER"
/>
<result
column=
"group_robot_type"
property=
"groupRobotType"
jdbcType=
"INTEGER"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, wx_id, nick_name, head, qrcode_url, robot_type, keyword_classify_id, state, real_status, wake_up, unique_number,welcome_duration,group_robot_type
</sql>
<sql
id=
"r_Base_Column_List"
>
r.id, r.wx_id, r.nick_name, r.head, r.qrcode_url, r.robot_type, r.keyword_classify_id, r.state, r.real_status, r.wake_up,
r.unique_number,r.welcome_duration,r.group_robot_type
</sql>
<insert
id=
"insert"
parameterType=
"PcloudRobot"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into pcloud_robot (
wx_id,
...
...
@@ -342,6 +350,9 @@
'${item}'
</foreach>
</if>
<if
test=
"groupRobotType != null"
>
AND p.group_robot_type = #{groupRobotType}
</if>
</select>
<select
id=
"listNoClassifyRobot"
resultMap=
"BaseResultMap"
>
...
...
@@ -384,4 +395,16 @@
GROUP BY CONCAT_WS("-",robot_type,group_robot_type)
</select>
<select
id=
"getSelfRobotClassify"
parameterType=
"string"
resultType=
"com.pcloud.book.pcloudkeyword.facade.response.PcloudRobotResponseVO"
>
select
r.wx_id wxId,
r.nick_name nickName,
r.unique_number uniqueNum,
r.robot_type classifyId,
rc.classify_name classifyName
from pcloud_robot r
left join pcloud_robot_classify rc on r.robot_type = rc.id
where
r.wx_id = #{robotId}
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/push/SelfPushItemMapper.xml
View file @
d1066982
...
...
@@ -126,7 +126,8 @@
p.push_send_time pushSendTime,
p.week_days weekDays,
p.push_type pushType,
i.resource_id resourceId
i.resource_id resourceId,
p.alt_type groupRobotType
FROM
self_push_item i
LEFT JOIN self_push p ON i.push_id = p.id
...
...
pcloud-service-book/src/main/resources/mapper/push/SelfPushMapper.xml
View file @
d1066982
...
...
@@ -17,23 +17,23 @@
<result
column=
"push_type"
property=
"pushType"
jdbcType=
"BIT"
/>
<result
column=
"week_days"
property=
"weekDays"
jdbcType=
"VARCHAR"
/>
<result
column=
"push_send_time"
property=
"pushSendTime"
jdbcType=
"VARCHAR"
/>
<result
column=
"alt_type"
property=
"altType"
jdbcType=
"INTEGER"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, alt_id, create_user, create_time, update_user, update_time, send_now, send_time, book_group_id, send_all,start_time,end_time,
push_type,week_days,push_send_time
push_type,week_days,push_send_time
,alt_type
</sql>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.push.entity.SelfPush"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into self_push (id, alt_id, create_user,
create_time, update_user, update_time, send_now, send_time, book_group_id, send_all,start_time,end_time,
push_type,week_days,push_send_time
push_type,week_days,push_send_time
,alt_type
)
values (#{id,jdbcType=BIGINT}, #{altId,jdbcType=VARCHAR}, #{createUser,jdbcType=BIGINT},
now(), #{updateUser,jdbcType=BIGINT}, now(), #{sendNow}, #{sendTime}, #{bookGroupId}, #{sendAll},#{startTime},
#{endTime},#{pushType},#{weekDays},#{pushSendTime}
#{endTime},#{pushType},#{weekDays},#{pushSendTime}
, #{altType}
)
</insert>
...
...
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