Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 039115af
authored
Oct 20, 2021
by
danmo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
拉取企业的全部群发记录群发记录
1 parent
f320bfee
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
680 additions
and
4 deletions
linkwe-common/src/main/java/com/linkwechat/common/enums/MessageType.java
linkwe-quartz/src/main/java/com/linkwechat/quartz/task/PullGroupMessageTask.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeCustomerMessagePushClient.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeGroupMessageAttachments.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeGroupMessageList.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeGroupMessageSendResult.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/message/WeGroupMsgDto.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/query/WeGroupMsgListQuery.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeGroupMessageAttachmentsMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeGroupMessageListMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeGroupMessageSendResultMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeGroupMessageAttachmentsService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeGroupMessageListService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeGroupMessageSendResultService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeGroupMessageAttachmentsServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeGroupMessageListServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeGroupMessageSendResultServiceImpl.java
linkwe-wecom/src/main/resources/mapper/wecom/WeGroupMessageAttachmentsMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeGroupMessageListMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeGroupMessageSendResultMapper.xml
linkwe-common/src/main/java/com/linkwechat/common/enums/MessageType.java
View file @
039115a
...
@@ -63,6 +63,16 @@ public enum MessageType {
...
@@ -63,6 +63,16 @@ public enum MessageType {
*/
*/
TASKCARD
(
"10"
,
"taskcard"
),
TASKCARD
(
"10"
,
"taskcard"
),
/**
* 群发图文消息
*/
LINK
(
"11"
,
"link"
),
/**
* 群发小程序
*/
MINIPROGRAM
(
"12"
,
"miniprogram"
),
;
;
/**
/**
* 媒体类型
* 媒体类型
...
...
linkwe-quartz/src/main/java/com/linkwechat/quartz/task/PullGroupMessageTask.java
0 → 100644
View file @
039115a
This diff is collapsed.
Click to expand it.
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeCustomerMessagePushClient.java
View file @
039115a
...
@@ -55,7 +55,7 @@ public interface WeCustomerMessagePushClient {
...
@@ -55,7 +55,7 @@ public interface WeCustomerMessagePushClient {
* @return {@link WeGroupMsgListDto}
* @return {@link WeGroupMsgListDto}
*/
*/
@Request
(
url
=
"/externalcontact/get_groupmsg_list_v2"
,
type
=
"POST"
)
@Request
(
url
=
"/externalcontact/get_groupmsg_list_v2"
,
type
=
"POST"
)
WeGroupMsgListDto
getGroupMsg
Resul
t
(
@JSONBody
WeGroupMsgListQuery
query
);
WeGroupMsgListDto
getGroupMsg
Lis
t
(
@JSONBody
WeGroupMsgListQuery
query
);
/**
/**
* 获取群发成员发送任务列表
* 获取群发成员发送任务列表
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeGroupMessageAttachments.java
0 → 100644
View file @
039115a
package
com
.
linkwechat
.
wecom
.
domain
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.linkwechat.common.annotation.Excel
;
import
com.linkwechat.common.core.domain.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* 群发消息附件对象 we_group_message_attachments
*
* @author ruoyi
* @date 2021-10-19
*/
@ApiModel
@Data
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@TableName
(
"we_group_message_attachments"
)
public
class
WeGroupMessageAttachments
extends
BaseEntity
{
/** 主键id */
@ApiModelProperty
(
"id"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/** 企业群发消息的id */
@ApiModelProperty
(
"企业群发消息的id"
)
@Excel
(
name
=
"企业群发消息的id"
)
private
String
msgId
;
@ApiModelProperty
(
"消息类型 文本:text 图片:image 图文:link 小程序:miniprogram 视频:video 文件:file "
)
/** 消息类型 文本:text 图片:image 图文:link 小程序:miniprogram 视频:video 文件:file */
@Excel
(
name
=
"消息类型 文本:text 图片:image 图文:link 小程序:miniprogram 视频:video 文件:file "
)
private
String
msgType
;
/** 消息内容 */
@ApiModelProperty
(
"消息内容"
)
@Excel
(
name
=
"消息内容"
)
private
String
content
;
/** 媒体id */
@ApiModelProperty
(
"媒体id"
)
@Excel
(
name
=
"媒体id"
)
private
String
mediaId
;
/** 消息标题 */
@ApiModelProperty
(
"消息标题"
)
@Excel
(
name
=
"消息标题"
)
private
String
title
;
/** 消息描述 */
@ApiModelProperty
(
"消息描述"
)
@Excel
(
name
=
"消息描述"
)
private
String
description
;
/** 消息链接 */
@ApiModelProperty
(
"消息链接"
)
@Excel
(
name
=
"消息链接"
)
private
String
linkUrl
;
/** 消息图片地址 */
@ApiModelProperty
(
"消息图片地址"
)
@Excel
(
name
=
"消息图片地址"
)
private
String
picUrl
;
/** 小程序appid */
@ApiModelProperty
(
"小程序appid"
)
@Excel
(
name
=
"小程序appid"
)
private
String
appId
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeGroupMessageList.java
0 → 100644
View file @
039115a
package
com
.
linkwechat
.
wecom
.
domain
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.linkwechat.common.annotation.Excel
;
import
com.linkwechat.common.core.domain.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
/**
* 群发消息列对象 we_group_message_list
*
* @author ruoyi
* @date 2021-10-19
*/
@ApiModel
@Data
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@TableName
(
"we_group_message_list"
)
public
class
WeGroupMessageList
extends
BaseEntity
{
/**
* 主键id
*/
@ApiModelProperty
(
"id"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/**
* 企业群发消息的id
*/
@ApiModelProperty
(
"企业群发消息的id"
)
@Excel
(
name
=
"企业群发消息的id"
)
private
String
msgId
;
/**
* 群发任务的类型,默认为single,表示发送给客户,group表示发送给客户群
*/
@ApiModelProperty
(
"群发任务的类型,默认为single,表示发送给客户,group表示发送给客户群"
)
@Excel
(
name
=
"群发任务的类型,默认为single,表示发送给客户,group表示发送给客户群"
)
private
String
chatType
;
/**
* 群发消息创建者userid
*/
@ApiModelProperty
(
"群发消息创建者userid"
)
@Excel
(
name
=
"群发消息创建者userid"
)
private
String
userId
;
/**
* 发送时间
*/
@ApiModelProperty
(
"发送时间"
)
@Excel
(
name
=
"发送时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
sendTime
;
/**
* 群发消息创建来源。0:企业 1:个人
*/
@ApiModelProperty
(
"群发消息创建来源。0:企业 1:个人"
)
@Excel
(
name
=
"群发消息创建来源。0:企业 1:个人"
)
private
Integer
createType
;
/**
* 是否定时任务 0 常规 1 定时发送
*/
@ApiModelProperty
(
"是否定时任务 0 常规 1 定时发送"
)
@Excel
(
name
=
"是否定时任务 0 常规 1 定时发送"
)
private
Integer
isTask
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeGroupMessageSendResult.java
0 → 100644
View file @
039115a
package
com
.
linkwechat
.
wecom
.
domain
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.linkwechat.common.annotation.Excel
;
import
com.linkwechat.common.core.domain.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
/**
* 群发消息成员执行结果对象 we_group_message_send_result
*
* @author ruoyi
* @date 2021-10-19
*/
@ApiModel
@Data
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@TableName
(
"we_group_message_send_result"
)
public
class
WeGroupMessageSendResult
extends
BaseEntity
{
/**
* 主键id
*/
@ApiModelProperty
(
"id"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/**
* 企业群发消息的id
*/
@ApiModelProperty
(
"企业群发消息的id"
)
@Excel
(
name
=
"企业群发消息的id"
)
private
String
msgId
;
/**
* 企业服务人员的userid
*/
@ApiModelProperty
(
"企业服务人员的userid"
)
@Excel
(
name
=
"企业服务人员的userid"
)
private
String
userId
;
/**
* 外部联系人userid
*/
@ApiModelProperty
(
"外部联系人userid"
)
@Excel
(
name
=
"外部联系人userid"
)
private
String
externalUserid
;
/**
* 外部客户群id
*/
@ApiModelProperty
(
"外部客户群id"
)
@Excel
(
name
=
"外部客户群id"
)
private
String
chatId
;
/**
* 发送状态:0-未发送 1-已发送 2-因客户不是好友导致发送失败 3-因客户已经收到其他群发消息导致发送失败
*/
@ApiModelProperty
(
"发送状态:0-未发送 1-已发送 2-因客户不是好友导致发送失败 3-因客户已经收到其他群发消息导致发送失败"
)
@Excel
(
name
=
"发送状态:0-未发送 1-已发送 2-因客户不是好友导致发送失败 3-因客户已经收到其他群发消息导致发送失败"
)
private
Integer
status
;
/**
* 发送时间,发送状态为1时返回
*/
@ApiModelProperty
(
"发送时间"
)
@Excel
(
name
=
"发送时间,发送状态为1时返回"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
sendTime
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/dto/message/WeGroupMsgDto.java
View file @
039115a
...
@@ -27,7 +27,7 @@ public class WeGroupMsgDto {
...
@@ -27,7 +27,7 @@ public class WeGroupMsgDto {
private
Long
createTime
;
private
Long
createTime
;
@ApiModelProperty
(
"群发消息创建来源。0:企业 1:个人"
)
@ApiModelProperty
(
"群发消息创建来源。0:企业 1:个人"
)
private
String
createType
;
private
Integer
createType
;
@ApiModelProperty
(
"消息文本内容,最多4000个字节"
)
@ApiModelProperty
(
"消息文本内容,最多4000个字节"
)
private
WeAddMsgTemplateQuery
.
Text
text
;
private
WeAddMsgTemplateQuery
.
Text
text
;
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/query/WeGroupMsgListQuery.java
View file @
039115a
...
@@ -25,10 +25,10 @@ public class WeGroupMsgListQuery {
...
@@ -25,10 +25,10 @@ public class WeGroupMsgListQuery {
private
String
creator
;
private
String
creator
;
@ApiModelProperty
(
"创建人类型。0:企业发表 1:个人发表 2:所有,包括个人创建以及企业创建,默认情况下为所有类型"
)
@ApiModelProperty
(
"创建人类型。0:企业发表 1:个人发表 2:所有,包括个人创建以及企业创建,默认情况下为所有类型"
)
private
Integer
filter_type
;
private
Integer
filter_type
=
2
;
@ApiModelProperty
(
"返回的最大记录数,整型,最大值100,默认值50"
)
@ApiModelProperty
(
"返回的最大记录数,整型,最大值100,默认值50"
)
private
Integer
limit
;
private
Integer
limit
=
100
;
@ApiModelProperty
(
"用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填"
)
@ApiModelProperty
(
"用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填"
)
private
String
cursor
;
private
String
cursor
;
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeGroupMessageAttachmentsMapper.java
0 → 100644
View file @
039115a
package
com
.
linkwechat
.
wecom
.
mapper
;
import
com.linkwechat.wecom.domain.WeGroupMessageAttachments
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* 群发消息附件Mapper接口
*
* @author ruoyi
* @date 2021-10-19
*/
public
interface
WeGroupMessageAttachmentsMapper
extends
BaseMapper
<
WeGroupMessageAttachments
>
{
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeGroupMessageListMapper.java
0 → 100644
View file @
039115a
package
com
.
linkwechat
.
wecom
.
mapper
;
import
com.linkwechat.wecom.domain.WeGroupMessageList
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* 群发消息列Mapper接口
*
* @author ruoyi
* @date 2021-10-19
*/
public
interface
WeGroupMessageListMapper
extends
BaseMapper
<
WeGroupMessageList
>
{
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeGroupMessageSendResultMapper.java
0 → 100644
View file @
039115a
package
com
.
linkwechat
.
wecom
.
mapper
;
import
com.linkwechat.wecom.domain.WeGroupMessageSendResult
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* 群发消息成员执行结果Mapper接口
*
* @author ruoyi
* @date 2021-10-19
*/
public
interface
WeGroupMessageSendResultMapper
extends
BaseMapper
<
WeGroupMessageSendResult
>
{
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeGroupMessageAttachmentsService.java
0 → 100644
View file @
039115a
package
com
.
linkwechat
.
wecom
.
service
;
import
com.linkwechat.wecom.domain.WeGroupMessageAttachments
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.util.List
;
/**
* 群发消息附件Service接口
*
* @author ruoyi
* @date 2021-10-19
*/
public
interface
IWeGroupMessageAttachmentsService
extends
IService
<
WeGroupMessageAttachments
>
{
/**
* 查询列表
*/
List
<
WeGroupMessageAttachments
>
queryList
(
WeGroupMessageAttachments
weGroupMessageAttachments
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeGroupMessageListService.java
0 → 100644
View file @
039115a
package
com
.
linkwechat
.
wecom
.
service
;
import
com.linkwechat.wecom.domain.WeGroupMessageList
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.linkwechat.wecom.domain.dto.message.WeGroupMsgListDto
;
import
java.util.List
;
/**
* 群发消息列Service接口
*
* @author ruoyi
* @date 2021-10-19
*/
public
interface
IWeGroupMessageListService
extends
IService
<
WeGroupMessageList
>
{
/**
* 查询列表
*/
List
<
WeGroupMessageList
>
queryList
(
WeGroupMessageList
weGroupMessageList
);
/**
* 获取群发记录列表
*
* @param chatType 群发任务的类型,single,表示发送给客户,group表示发送给客户群
* @param startTime 群发任务记录开始时间
* @param endTime 群发任务记录结束时间
* @param cursor 用于分页查询的游标
* @return WeGroupMsgListDto 群发记录列表
*/
WeGroupMsgListDto
getGroupMsgList
(
String
chatType
,
Long
startTime
,
Long
endTime
,
String
cursor
);
/**
* 获取群发成员发送任务列表
*
* @param msgId 群发消息的id
* @param cursor 用于分页查询的游标
* @return WeGroupMsgListDto 群发成员发送任务列表
*/
WeGroupMsgListDto
getGroupMsgTask
(
String
msgId
,
String
cursor
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeGroupMessageSendResultService.java
0 → 100644
View file @
039115a
package
com
.
linkwechat
.
wecom
.
service
;
import
com.linkwechat.wecom.domain.WeGroupMessageSendResult
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.linkwechat.wecom.domain.dto.message.WeGroupMsgListDto
;
import
java.util.List
;
/**
* 群发消息成员执行结果Service接口
*
* @author ruoyi
* @date 2021-10-19
*/
public
interface
IWeGroupMessageSendResultService
extends
IService
<
WeGroupMessageSendResult
>
{
/**
* 查询列表
*/
List
<
WeGroupMessageSendResult
>
queryList
(
WeGroupMessageSendResult
weGroupMessageSendResult
);
/**
* 获取企业群发成员执行结果
*
* @param msgId 群发消息的id
* @param userId 发送成员userid
* @param cursor 用于分页查询的游标
* @return WeGroupMsgListDto 群成员发送结果列表
*/
WeGroupMsgListDto
getGroupMsgSendResult
(
String
msgId
,
String
userId
,
String
cursor
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeGroupMessageAttachmentsServiceImpl.java
0 → 100644
View file @
039115a
package
com
.
linkwechat
.
wecom
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.linkwechat.wecom.domain.WeGroupMessageAttachments
;
import
com.linkwechat.wecom.mapper.WeGroupMessageAttachmentsMapper
;
import
com.linkwechat.wecom.service.IWeGroupMessageAttachmentsService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* 群发消息附件Service业务层处理
*
* @author ruoyi
* @date 2021-10-19
*/
@Service
public
class
WeGroupMessageAttachmentsServiceImpl
extends
ServiceImpl
<
WeGroupMessageAttachmentsMapper
,
WeGroupMessageAttachments
>
implements
IWeGroupMessageAttachmentsService
{
@Override
public
List
<
WeGroupMessageAttachments
>
queryList
(
WeGroupMessageAttachments
weGroupMessageAttachments
)
{
LambdaQueryWrapper
<
WeGroupMessageAttachments
>
lqw
=
Wrappers
.
lambdaQuery
();
if
(
StringUtils
.
isNotBlank
(
weGroupMessageAttachments
.
getMsgId
())){
lqw
.
eq
(
WeGroupMessageAttachments:
:
getMsgId
,
weGroupMessageAttachments
.
getMsgId
());
}
if
(
StringUtils
.
isNotBlank
(
weGroupMessageAttachments
.
getMsgType
())){
lqw
.
eq
(
WeGroupMessageAttachments:
:
getMsgType
,
weGroupMessageAttachments
.
getMsgType
());
}
if
(
StringUtils
.
isNotBlank
(
weGroupMessageAttachments
.
getContent
())){
lqw
.
eq
(
WeGroupMessageAttachments:
:
getContent
,
weGroupMessageAttachments
.
getContent
());
}
if
(
StringUtils
.
isNotBlank
(
weGroupMessageAttachments
.
getMediaId
())){
lqw
.
eq
(
WeGroupMessageAttachments:
:
getMediaId
,
weGroupMessageAttachments
.
getMediaId
());
}
if
(
StringUtils
.
isNotBlank
(
weGroupMessageAttachments
.
getTitle
())){
lqw
.
eq
(
WeGroupMessageAttachments:
:
getTitle
,
weGroupMessageAttachments
.
getTitle
());
}
if
(
StringUtils
.
isNotBlank
(
weGroupMessageAttachments
.
getDescription
())){
lqw
.
eq
(
WeGroupMessageAttachments:
:
getDescription
,
weGroupMessageAttachments
.
getDescription
());
}
if
(
StringUtils
.
isNotBlank
(
weGroupMessageAttachments
.
getLinkUrl
())){
lqw
.
eq
(
WeGroupMessageAttachments:
:
getLinkUrl
,
weGroupMessageAttachments
.
getLinkUrl
());
}
if
(
StringUtils
.
isNotBlank
(
weGroupMessageAttachments
.
getPicUrl
())){
lqw
.
eq
(
WeGroupMessageAttachments:
:
getPicUrl
,
weGroupMessageAttachments
.
getPicUrl
());
}
if
(
StringUtils
.
isNotBlank
(
weGroupMessageAttachments
.
getAppId
())){
lqw
.
eq
(
WeGroupMessageAttachments:
:
getAppId
,
weGroupMessageAttachments
.
getAppId
());
}
return
this
.
list
(
lqw
);
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeGroupMessageListServiceImpl.java
0 → 100644
View file @
039115a
package
com
.
linkwechat
.
wecom
.
service
.
impl
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.linkwechat.common.utils.StringUtils
;
import
com.linkwechat.wecom.client.WeCustomerMessagePushClient
;
import
com.linkwechat.wecom.domain.WeGroupMessageList
;
import
com.linkwechat.wecom.domain.dto.message.WeGroupMsgDto
;
import
com.linkwechat.wecom.domain.dto.message.WeGroupMsgListDto
;
import
com.linkwechat.wecom.domain.dto.message.WeGroupMsgTaskDto
;
import
com.linkwechat.wecom.domain.query.WeGetGroupMsgListQuery
;
import
com.linkwechat.wecom.domain.query.WeGroupMsgListQuery
;
import
com.linkwechat.wecom.mapper.WeGroupMessageListMapper
;
import
com.linkwechat.wecom.service.IWeGroupMessageListService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* 群发消息列Service业务层处理
*
* @author ruoyi
* @date 2021-10-19
*/
@Service
public
class
WeGroupMessageListServiceImpl
extends
ServiceImpl
<
WeGroupMessageListMapper
,
WeGroupMessageList
>
implements
IWeGroupMessageListService
{
@Autowired
private
WeCustomerMessagePushClient
messagePushClient
;
@Override
public
List
<
WeGroupMessageList
>
queryList
(
WeGroupMessageList
weGroupMessageList
)
{
LambdaQueryWrapper
<
WeGroupMessageList
>
lqw
=
Wrappers
.
lambdaQuery
();
if
(
StringUtils
.
isNotBlank
(
weGroupMessageList
.
getMsgId
()))
{
lqw
.
eq
(
WeGroupMessageList:
:
getMsgId
,
weGroupMessageList
.
getMsgId
());
}
if
(
StringUtils
.
isNotBlank
(
weGroupMessageList
.
getChatType
()))
{
lqw
.
eq
(
WeGroupMessageList:
:
getChatType
,
weGroupMessageList
.
getChatType
());
}
if
(
StringUtils
.
isNotBlank
(
weGroupMessageList
.
getUserId
()))
{
lqw
.
eq
(
WeGroupMessageList:
:
getUserId
,
weGroupMessageList
.
getUserId
());
}
if
(
weGroupMessageList
.
getSendTime
()
!=
null
)
{
lqw
.
eq
(
WeGroupMessageList:
:
getSendTime
,
weGroupMessageList
.
getSendTime
());
}
if
(
weGroupMessageList
.
getCreateType
()
!=
null
)
{
lqw
.
eq
(
WeGroupMessageList:
:
getCreateType
,
weGroupMessageList
.
getCreateType
());
}
if
(
weGroupMessageList
.
getIsTask
()
!=
null
)
{
lqw
.
eq
(
WeGroupMessageList:
:
getIsTask
,
weGroupMessageList
.
getIsTask
());
}
return
this
.
list
(
lqw
);
}
@Override
public
WeGroupMsgListDto
getGroupMsgList
(
String
chatType
,
Long
startTime
,
Long
endTime
,
String
cursor
){
WeGroupMsgListQuery
query
=
new
WeGroupMsgListQuery
();
query
.
setChat_type
(
chatType
);
query
.
setStart_time
(
startTime
);
query
.
setEnd_time
(
endTime
);
WeGroupMsgListDto
groupMsgList
=
messagePushClient
.
getGroupMsgList
(
query
);
if
(
groupMsgList
!=
null
&&
ObjectUtil
.
equal
(
0
,
groupMsgList
.
getErrcode
())){
if
(
StringUtils
.
isNotEmpty
(
groupMsgList
.
getNextCursor
())){
WeGroupMsgListDto
clildMsgList
=
getGroupMsgList
(
query
.
getChat_type
(),
query
.
getStart_time
(),
query
.
getEnd_time
(),
groupMsgList
.
getNextCursor
());
List
<
WeGroupMsgDto
>
list
=
groupMsgList
.
getGroupMsgList
();
list
.
addAll
(
clildMsgList
.
getGroupMsgList
());
groupMsgList
.
setGroupMsgList
(
list
);
groupMsgList
.
setNextCursor
(
clildMsgList
.
getNextCursor
());
}
}
return
groupMsgList
;
}
@Override
public
WeGroupMsgListDto
getGroupMsgTask
(
String
msgId
,
String
cursor
)
{
WeGetGroupMsgListQuery
query
=
new
WeGetGroupMsgListQuery
();
query
.
setMsgId
(
msgId
);
query
.
setCursor
(
cursor
);
WeGroupMsgListDto
groupMsgTask
=
messagePushClient
.
getGroupMsgTask
(
query
);
if
(
groupMsgTask
!=
null
&&
ObjectUtil
.
equal
(
0
,
groupMsgTask
.
getErrcode
())){
if
(
StringUtils
.
isNotEmpty
(
groupMsgTask
.
getNextCursor
())){
WeGroupMsgListDto
clildMsgList
=
getGroupMsgTask
(
msgId
,
groupMsgTask
.
getNextCursor
());
List
<
WeGroupMsgTaskDto
>
taskList
=
clildMsgList
.
getTaskList
();
taskList
.
addAll
(
clildMsgList
.
getTaskList
());
groupMsgTask
.
setTaskList
(
taskList
);
groupMsgTask
.
setNextCursor
(
clildMsgList
.
getNextCursor
());
}
}
return
groupMsgTask
;
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeGroupMessageSendResultServiceImpl.java
0 → 100644
View file @
039115a
package
com
.
linkwechat
.
wecom
.
service
.
impl
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.linkwechat.common.utils.StringUtils
;
import
com.linkwechat.wecom.client.WeCustomerMessagePushClient
;
import
com.linkwechat.wecom.domain.WeGroupMessageSendResult
;
import
com.linkwechat.wecom.domain.dto.message.WeGroupMsgListDto
;
import
com.linkwechat.wecom.domain.dto.message.WeGroupMsgSendDto
;
import
com.linkwechat.wecom.domain.dto.message.WeGroupMsgTaskDto
;
import
com.linkwechat.wecom.domain.query.WeGetGroupMsgListQuery
;
import
com.linkwechat.wecom.mapper.WeGroupMessageSendResultMapper
;
import
com.linkwechat.wecom.service.IWeGroupMessageSendResultService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* 群发消息成员执行结果Service业务层处理
*
* @author ruoyi
* @date 2021-10-19
*/
@Service
public
class
WeGroupMessageSendResultServiceImpl
extends
ServiceImpl
<
WeGroupMessageSendResultMapper
,
WeGroupMessageSendResult
>
implements
IWeGroupMessageSendResultService
{
@Autowired
private
WeCustomerMessagePushClient
messagePushClient
;
@Override
public
List
<
WeGroupMessageSendResult
>
queryList
(
WeGroupMessageSendResult
weGroupMessageSendResult
)
{
LambdaQueryWrapper
<
WeGroupMessageSendResult
>
lqw
=
Wrappers
.
lambdaQuery
();
if
(
StringUtils
.
isNotBlank
(
weGroupMessageSendResult
.
getMsgId
()))
{
lqw
.
eq
(
WeGroupMessageSendResult:
:
getMsgId
,
weGroupMessageSendResult
.
getMsgId
());
}
if
(
StringUtils
.
isNotBlank
(
weGroupMessageSendResult
.
getUserId
()))
{
lqw
.
eq
(
WeGroupMessageSendResult:
:
getUserId
,
weGroupMessageSendResult
.
getUserId
());
}
if
(
StringUtils
.
isNotBlank
(
weGroupMessageSendResult
.
getExternalUserid
()))
{
lqw
.
eq
(
WeGroupMessageSendResult:
:
getExternalUserid
,
weGroupMessageSendResult
.
getExternalUserid
());
}
if
(
StringUtils
.
isNotBlank
(
weGroupMessageSendResult
.
getChatId
()))
{
lqw
.
eq
(
WeGroupMessageSendResult:
:
getChatId
,
weGroupMessageSendResult
.
getChatId
());
}
if
(
weGroupMessageSendResult
.
getStatus
()
!=
null
)
{
lqw
.
eq
(
WeGroupMessageSendResult:
:
getStatus
,
weGroupMessageSendResult
.
getStatus
());
}
if
(
weGroupMessageSendResult
.
getSendTime
()
!=
null
)
{
lqw
.
eq
(
WeGroupMessageSendResult:
:
getSendTime
,
weGroupMessageSendResult
.
getSendTime
());
}
return
this
.
list
(
lqw
);
}
@Override
public
WeGroupMsgListDto
getGroupMsgSendResult
(
String
msgId
,
String
userId
,
String
cursor
)
{
WeGetGroupMsgListQuery
query
=
new
WeGetGroupMsgListQuery
();
query
.
setMsgId
(
msgId
);
query
.
setUserId
(
userId
);
query
.
setCursor
(
cursor
);
WeGroupMsgListDto
groupMsgSendResult
=
messagePushClient
.
getGroupMsgSendResult
(
query
);
if
(
groupMsgSendResult
!=
null
&&
ObjectUtil
.
equal
(
0
,
groupMsgSendResult
.
getErrcode
())){
if
(
StringUtils
.
isNotEmpty
(
groupMsgSendResult
.
getNextCursor
())){
WeGroupMsgListDto
clildMsgList
=
getGroupMsgSendResult
(
msgId
,
userId
,
groupMsgSendResult
.
getNextCursor
());
List
<
WeGroupMsgSendDto
>
sendList
=
clildMsgList
.
getSendList
();
sendList
.
addAll
(
clildMsgList
.
getSendList
());
groupMsgSendResult
.
setSendList
(
sendList
);
groupMsgSendResult
.
setNextCursor
(
clildMsgList
.
getNextCursor
());
}
}
return
groupMsgSendResult
;
}
}
linkwe-wecom/src/main/resources/mapper/wecom/WeGroupMessageAttachmentsMapper.xml
0 → 100644
View file @
039115a
<?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.linkwechat.wecom.mapper.WeGroupMessageAttachmentsMapper"
>
<resultMap
type=
"WeGroupMessageAttachments"
id=
"WeGroupMessageAttachmentsResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"msgId"
column=
"msg_id"
/>
<result
property=
"msgType"
column=
"msg_type"
/>
<result
property=
"content"
column=
"content"
/>
<result
property=
"mediaId"
column=
"media_id"
/>
<result
property=
"title"
column=
"title"
/>
<result
property=
"description"
column=
"description"
/>
<result
property=
"linkUrl"
column=
"link_url"
/>
<result
property=
"picUrl"
column=
"pic_url"
/>
<result
property=
"appId"
column=
"app_id"
/>
<result
property=
"createBy"
column=
"create_by"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateBy"
column=
"update_by"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
</resultMap>
</mapper>
\ No newline at end of file
\ No newline at end of file
linkwe-wecom/src/main/resources/mapper/wecom/WeGroupMessageListMapper.xml
0 → 100644
View file @
039115a
<?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.linkwechat.wecom.mapper.WeGroupMessageListMapper"
>
<resultMap
type=
"WeGroupMessageList"
id=
"WeGroupMessageListResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"msgId"
column=
"msg_id"
/>
<result
property=
"chatType"
column=
"chat_type"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"sendTime"
column=
"send_time"
/>
<result
property=
"createType"
column=
"create_type"
/>
<result
property=
"isTask"
column=
"is_task"
/>
<result
property=
"createBy"
column=
"create_by"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateBy"
column=
"update_by"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
</resultMap>
</mapper>
\ No newline at end of file
\ No newline at end of file
linkwe-wecom/src/main/resources/mapper/wecom/WeGroupMessageSendResultMapper.xml
0 → 100644
View file @
039115a
<?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.linkwechat.wecom.mapper.WeGroupMessageSendResultMapper"
>
<resultMap
type=
"WeGroupMessageSendResult"
id=
"WeGroupMessageSendResultResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"msgId"
column=
"msg_id"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"externalUserid"
column=
"external_userid"
/>
<result
property=
"chatId"
column=
"chat_id"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"sendTime"
column=
"send_time"
/>
<result
property=
"createBy"
column=
"create_by"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateBy"
column=
"update_by"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
</resultMap>
</mapper>
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment