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 d612f5da
authored
Nov 01, 2021
by
linkwechat8856@163.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
客户详情编辑bug修复
1 parent
3633c89d
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
427 additions
and
198 deletions
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerController.java
linkwe-common/src/main/java/com/linkwechat/common/config/ElasticSearchConfig.java
linkwe-common/src/main/java/com/linkwechat/common/constant/WeConstans.java
linkwe-common/src/main/java/com/linkwechat/common/core/domain/entity/WeCorpAccount.java
linkwe-common/src/main/java/com/linkwechat/common/core/redis/RedisCache.java
linkwe-common/src/main/java/com/linkwechat/common/enums/MessageType.java
linkwe-common/src/main/java/com/linkwechat/common/utils/file/FileUploadUtils.java
linkwe-common/src/main/java/com/linkwechat/common/utils/wecom/RSAUtil.java
linkwe-quartz/src/main/java/com/linkwechat/quartz/task/PullGroupMessageTask.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeFlowerCustomerTagRel.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/vo/WeGroupMessageDetailVo.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeGroupMessageSendResultMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeGroupMessageTaskMapper.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCustomerService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeGroupMessageSendResultService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeGroupMessageTaskService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeGroupMessageTemplateService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeGroupMessageSendResultServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeGroupMessageTaskServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeGroupMessageTemplateServiceImpl.java
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeGroupMessageSendResultMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeGroupMessageTaskMapper.xml
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCustomerController.java
View file @
d612f5d
...
@@ -111,14 +111,17 @@ public class WeCustomerController extends BaseController
...
@@ -111,14 +111,17 @@ public class WeCustomerController extends BaseController
/**
/**
* 修改企业微信客户
* 修改企业微信客户
(目前只更新生日)
*/
*/
// @PreAuthorize("@ss.hasPermi('wecom:customer:edit')")
// @PreAuthorize("@ss.hasPermi('wecom:customer:edit')")
@Log
(
title
=
"企业微信客户"
,
businessType
=
BusinessType
.
UPDATE
)
@Log
(
title
=
"企业微信客户"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
@PutMapping
public
AjaxResult
edit
(
@Validated
@RequestBody
WeCustomer
weCustomer
)
public
AjaxResult
edit
(
@Validated
@RequestBody
WeCustomer
weCustomer
)
{
{
weCustomerService
.
saveOrUpdate
(
weCustomer
);
weCustomerService
.
update
(
weCustomer
,
new
LambdaQueryWrapper
<
WeCustomer
>()
.
eq
(
WeCustomer:
:
getExternalUserid
,
weCustomer
.
getExternalUserid
())
.
eq
(
WeCustomer:
:
getFirstUserId
,
weCustomer
.
getFirstUserId
()));
return
AjaxResult
.
success
();
return
AjaxResult
.
success
();
}
}
...
...
linkwe-common/src/main/java/com/linkwechat/common/config/ElasticSearchConfig.java
View file @
d612f5d
/*
package
com
.
linkwechat
.
common
.
config
;
/*
package com.linkwechat.common.config;
package com.linkwechat.common.config;
import org.apache.http.HttpHost;
import org.apache.http.HttpHost;
...
...
linkwe-common/src/main/java/com/linkwechat/common/constant/WeConstans.java
View file @
d612f5d
...
@@ -408,4 +408,14 @@ public class WeConstans {
...
@@ -408,4 +408,14 @@ public class WeConstans {
* 会话消息订阅的频道
* 会话消息订阅的频道
*/
*/
public
static
final
String
CONVERSATION_MSG_CHANNEL
=
"CONVERSATION_MSG_CHANNEL"
;
public
static
final
String
CONVERSATION_MSG_CHANNEL
=
"CONVERSATION_MSG_CHANNEL"
;
/**
* 群发消息任务key
*/
public
static
final
String
WEGROUPMSGTIMEDTASK_KEY
=
"weGroupMessageTimedTask"
;
/**
* 群发消息任务开关
*/
public
static
Boolean
WEGROUPMSGTIMEDTASK_SWITCH
=
true
;
}
}
linkwe-common/src/main/java/com/linkwechat/common/core/domain/entity/WeCorpAccount.java
View file @
d612f5d
...
@@ -35,105 +35,45 @@ public class WeCorpAccount extends BaseEntity
...
@@ -35,105 +35,45 @@ public class WeCorpAccount extends BaseEntity
@ApiModelProperty
(
"主键"
)
@ApiModelProperty
(
"主键"
)
private
Long
id
=
SnowFlakeUtil
.
nextId
();
private
Long
id
=
SnowFlakeUtil
.
nextId
();
/*****************************************
*******************企业配置****************
******************************************/
/** 企业ID */
@ApiModelProperty
(
"企业corpId"
)
@NotBlank
(
message
=
"企业ID不能为空"
)
private
String
corpId
;
/** 企业名称 */
/** 企业名称 */
@ApiModelProperty
(
"企业名称"
)
@ApiModelProperty
(
"企业名称"
)
@NotBlank
(
message
=
"企业名称不能为空"
)
@NotBlank
(
message
=
"企业名称不能为空"
)
private
String
companyName
;
private
String
companyName
;
/** 企业ID */
@ApiModelProperty
(
"企业corpId"
)
@NotBlank
(
message
=
"企业ID不能为空"
)
private
String
corpId
;
/** 应用的密钥凭证 */
/*****************************************
*******************通讯录配置****************
******************************************/
/** 通讯录 Secret */
@ApiModelProperty
(
"企业为corpSecret"
)
@ApiModelProperty
(
"企业为corpSecret"
)
@NotBlank
(
message
=
"应用的密钥凭证不能为空"
)
@NotBlank
(
message
=
"应用的密钥凭证不能为空"
)
private
String
corpSecret
;
private
String
corpSecret
;
/** 帐号状态(0正常 1停用) */
@ApiModelProperty
(
"帐号状态(0正常 1停用)"
)
private
String
status
;
/**
***************************************
/**
删除标志(0代表存在 2代表删除) */
*******************客户联系配置****************
@ApiModelProperty
(
"删除标志(0代表存在 2代表删除)"
)
******************************************/
private
String
delFlag
=
new
String
(
"0"
);
@ApiModelProperty
(
"客户联系配置"
)
@ApiModelProperty
(
"外部联系人密钥"
)
@NotBlank
(
message
=
"外部联系人密钥凭证不能为空"
)
@NotBlank
(
message
=
"外部联系人密钥凭证不能为空"
)
private
String
contactSecret
;
private
String
contactSecret
;
/*****************************************
*******************应用配置****************
******************************************/
@ApiModelProperty
(
"应用id"
)
@ApiModelProperty
(
"应用id"
)
private
String
agentId
;
private
String
agentId
;
@ApiModelProperty
(
"应用密钥"
)
@ApiModelProperty
(
"应用密钥"
)
private
String
agentSecret
;
private
String
agentSecret
;
@ApiModelProperty
(
"会话存档私钥"
)
private
String
financePrivateKey
;
@ApiModelProperty
(
"会话存档密钥"
)
private
String
chatSecret
;
/*****************************************
*******************接受事件服务器****************
******************************************/
/**回调URL*/
private
String
backOffUrl
;
/**回调token*/
private
String
token
;
/**回调EncodingAESKey*/
private
String
encodingAesKey
;
/** 帐号状态(0正常 1停用) */
@ApiModelProperty
(
"帐号状态(0正常 1停用)"
)
private
String
status
;
/** 删除标志(0代表存在 1代表删除) */
@ApiModelProperty
(
"删除标志(0代表存在 1代表删除)"
)
private
Integer
delFlag
;
@ApiModelProperty
(
"服务商密钥"
)
@ApiModelProperty
(
"服务商密钥"
)
private
String
providerSecret
;
private
String
providerSecret
;
@ApiModelProperty
(
"会话存档密钥"
)
private
String
chatSecret
;
@ApiModelProperty
(
"企业微信扫码登陆回调地址"
)
@ApiModelProperty
(
"企业微信扫码登陆回调地址"
)
...
@@ -142,7 +82,8 @@ public class WeCorpAccount extends BaseEntity
...
@@ -142,7 +82,8 @@ public class WeCorpAccount extends BaseEntity
@ApiModelProperty
(
"客户流失通知开关 0:关闭 1:开启"
)
@ApiModelProperty
(
"客户流失通知开关 0:关闭 1:开启"
)
private
String
customerChurnNoticeSwitch
=
Constants
.
NORMAL_CODE
;
private
String
customerChurnNoticeSwitch
=
Constants
.
NORMAL_CODE
;
@ApiModelProperty
(
"会话存档私钥"
)
private
String
financePrivateKey
;
@ApiModelProperty
(
"企业管理员账号"
)
@ApiModelProperty
(
"企业管理员账号"
)
private
String
corpAccount
;
private
String
corpAccount
;
...
...
linkwe-common/src/main/java/com/linkwechat/common/core/redis/RedisCache.java
View file @
d612f5d
package
com
.
linkwechat
.
common
.
core
.
redis
;
package
com
.
linkwechat
.
common
.
core
.
redis
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.concurrent.TimeUnit
;
import
com.alibaba.fastjson.JSON
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.HashOperations
;
import
org.springframework.data.redis.core.HashOperations
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.ValueOperations
;
import
org.springframework.data.redis.core.ValueOperations
;
import
org.springframework.data.redis.core.ZSetOperations
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StringUtils
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.concurrent.TimeUnit
;
/**
/**
* spring redis 工具类
* spring redis 工具类
*
*
* @author ruoyi
* @author ruoyi
**/
**/
@SuppressWarnings
(
value
=
{
"unchecked"
,
"rawtypes"
})
@SuppressWarnings
(
value
=
{
"unchecked"
,
"rawtypes"
})
@Component
@Component
public
class
RedisCache
public
class
RedisCache
{
{
@Autowired
@Autowired
public
RedisTemplate
redisTemplate
;
public
RedisTemplate
redisTemplate
;
...
@@ -32,8 +30,7 @@ public class RedisCache
...
@@ -32,8 +30,7 @@ public class RedisCache
* @param key 缓存的键值
* @param key 缓存的键值
* @param value 缓存的值
* @param value 缓存的值
*/
*/
public
<
T
>
void
setCacheObject
(
final
String
key
,
final
T
value
)
public
<
T
>
void
setCacheObject
(
final
String
key
,
final
T
value
)
{
{
redisTemplate
.
opsForValue
().
set
(
key
,
value
);
redisTemplate
.
opsForValue
().
set
(
key
,
value
);
}
}
...
@@ -45,8 +42,7 @@ public class RedisCache
...
@@ -45,8 +42,7 @@ public class RedisCache
* @param timeout 时间
* @param timeout 时间
* @param timeUnit 时间颗粒度
* @param timeUnit 时间颗粒度
*/
*/
public
<
T
>
void
setCacheObject
(
final
String
key
,
final
T
value
,
final
Integer
timeout
,
final
TimeUnit
timeUnit
)
public
<
T
>
void
setCacheObject
(
final
String
key
,
final
T
value
,
final
Integer
timeout
,
final
TimeUnit
timeUnit
)
{
{
redisTemplate
.
opsForValue
().
set
(
key
,
value
,
timeout
,
timeUnit
);
redisTemplate
.
opsForValue
().
set
(
key
,
value
,
timeout
,
timeUnit
);
}
}
...
@@ -57,8 +53,7 @@ public class RedisCache
...
@@ -57,8 +53,7 @@ public class RedisCache
* @param timeout 超时时间
* @param timeout 超时时间
* @return true=设置成功;false=设置失败
* @return true=设置成功;false=设置失败
*/
*/
public
boolean
expire
(
final
String
key
,
final
long
timeout
)
public
boolean
expire
(
final
String
key
,
final
long
timeout
)
{
{
return
expire
(
key
,
timeout
,
TimeUnit
.
SECONDS
);
return
expire
(
key
,
timeout
,
TimeUnit
.
SECONDS
);
}
}
...
@@ -70,8 +65,7 @@ public class RedisCache
...
@@ -70,8 +65,7 @@ public class RedisCache
* @param unit 时间单位
* @param unit 时间单位
* @return true=设置成功;false=设置失败
* @return true=设置成功;false=设置失败
*/
*/
public
boolean
expire
(
final
String
key
,
final
long
timeout
,
final
TimeUnit
unit
)
public
boolean
expire
(
final
String
key
,
final
long
timeout
,
final
TimeUnit
unit
)
{
{
return
redisTemplate
.
expire
(
key
,
timeout
,
unit
);
return
redisTemplate
.
expire
(
key
,
timeout
,
unit
);
}
}
...
@@ -81,8 +75,7 @@ public class RedisCache
...
@@ -81,8 +75,7 @@ public class RedisCache
* @param key 缓存键值
* @param key 缓存键值
* @return 缓存键值对应的数据
* @return 缓存键值对应的数据
*/
*/
public
<
T
>
T
getCacheObject
(
final
String
key
)
public
<
T
>
T
getCacheObject
(
final
String
key
)
{
{
ValueOperations
<
String
,
T
>
operation
=
redisTemplate
.
opsForValue
();
ValueOperations
<
String
,
T
>
operation
=
redisTemplate
.
opsForValue
();
return
operation
.
get
(
key
);
return
operation
.
get
(
key
);
}
}
...
@@ -92,8 +85,7 @@ public class RedisCache
...
@@ -92,8 +85,7 @@ public class RedisCache
*
*
* @param key
* @param key
*/
*/
public
boolean
deleteObject
(
final
String
key
)
public
boolean
deleteObject
(
final
String
key
)
{
{
return
redisTemplate
.
delete
(
key
);
return
redisTemplate
.
delete
(
key
);
}
}
...
@@ -103,8 +95,7 @@ public class RedisCache
...
@@ -103,8 +95,7 @@ public class RedisCache
* @param collection 多个对象
* @param collection 多个对象
* @return
* @return
*/
*/
public
long
deleteObject
(
final
Collection
collection
)
public
long
deleteObject
(
final
Collection
collection
)
{
{
return
redisTemplate
.
delete
(
collection
);
return
redisTemplate
.
delete
(
collection
);
}
}
...
@@ -115,8 +106,7 @@ public class RedisCache
...
@@ -115,8 +106,7 @@ public class RedisCache
* @param dataList 待缓存的List数据
* @param dataList 待缓存的List数据
* @return 缓存的对象
* @return 缓存的对象
*/
*/
public
<
T
>
long
setCacheList
(
final
String
key
,
final
List
<
T
>
dataList
)
public
<
T
>
long
setCacheList
(
final
String
key
,
final
List
<
T
>
dataList
)
{
{
Long
count
=
redisTemplate
.
opsForList
().
rightPushAll
(
key
,
dataList
);
Long
count
=
redisTemplate
.
opsForList
().
rightPushAll
(
key
,
dataList
);
return
count
==
null
?
0
:
count
;
return
count
==
null
?
0
:
count
;
}
}
...
@@ -127,8 +117,7 @@ public class RedisCache
...
@@ -127,8 +117,7 @@ public class RedisCache
* @param key 缓存的键值
* @param key 缓存的键值
* @return 缓存键值对应的数据
* @return 缓存键值对应的数据
*/
*/
public
<
T
>
List
<
T
>
getCacheList
(
final
String
key
)
public
<
T
>
List
<
T
>
getCacheList
(
final
String
key
)
{
{
return
redisTemplate
.
opsForList
().
range
(
key
,
0
,
-
1
);
return
redisTemplate
.
opsForList
().
range
(
key
,
0
,
-
1
);
}
}
...
@@ -139,8 +128,7 @@ public class RedisCache
...
@@ -139,8 +128,7 @@ public class RedisCache
* @param dataSet 缓存的数据
* @param dataSet 缓存的数据
* @return 缓存数据的对象
* @return 缓存数据的对象
*/
*/
public
<
T
>
long
setCacheSet
(
final
String
key
,
final
Set
<
T
>
dataSet
)
public
<
T
>
long
setCacheSet
(
final
String
key
,
final
Set
<
T
>
dataSet
)
{
{
Long
count
=
redisTemplate
.
opsForSet
().
add
(
key
,
dataSet
);
Long
count
=
redisTemplate
.
opsForSet
().
add
(
key
,
dataSet
);
return
count
==
null
?
0
:
count
;
return
count
==
null
?
0
:
count
;
}
}
...
@@ -151,8 +139,7 @@ public class RedisCache
...
@@ -151,8 +139,7 @@ public class RedisCache
* @param key
* @param key
* @return
* @return
*/
*/
public
<
T
>
Set
<
T
>
getCacheSet
(
final
String
key
)
public
<
T
>
Set
<
T
>
getCacheSet
(
final
String
key
)
{
{
return
redisTemplate
.
opsForSet
().
members
(
key
);
return
redisTemplate
.
opsForSet
().
members
(
key
);
}
}
...
@@ -162,8 +149,7 @@ public class RedisCache
...
@@ -162,8 +149,7 @@ public class RedisCache
* @param key
* @param key
* @param dataMap
* @param dataMap
*/
*/
public
<
T
>
void
setCacheMap
(
final
String
key
,
final
Map
<
String
,
T
>
dataMap
)
public
<
T
>
void
setCacheMap
(
final
String
key
,
final
Map
<
String
,
T
>
dataMap
)
{
{
if
(
dataMap
!=
null
)
{
if
(
dataMap
!=
null
)
{
redisTemplate
.
opsForHash
().
putAll
(
key
,
dataMap
);
redisTemplate
.
opsForHash
().
putAll
(
key
,
dataMap
);
}
}
...
@@ -175,8 +161,7 @@ public class RedisCache
...
@@ -175,8 +161,7 @@ public class RedisCache
* @param key
* @param key
* @return
* @return
*/
*/
public
<
T
>
Map
<
String
,
T
>
getCacheMap
(
final
String
key
)
public
<
T
>
Map
<
String
,
T
>
getCacheMap
(
final
String
key
)
{
{
return
redisTemplate
.
opsForHash
().
entries
(
key
);
return
redisTemplate
.
opsForHash
().
entries
(
key
);
}
}
...
@@ -187,8 +172,7 @@ public class RedisCache
...
@@ -187,8 +172,7 @@ public class RedisCache
* @param hKey Hash键
* @param hKey Hash键
* @param value 值
* @param value 值
*/
*/
public
<
T
>
void
setCacheMapValue
(
final
String
key
,
final
String
hKey
,
final
T
value
)
public
<
T
>
void
setCacheMapValue
(
final
String
key
,
final
String
hKey
,
final
T
value
)
{
{
redisTemplate
.
opsForHash
().
put
(
key
,
hKey
,
value
);
redisTemplate
.
opsForHash
().
put
(
key
,
hKey
,
value
);
}
}
...
@@ -199,8 +183,7 @@ public class RedisCache
...
@@ -199,8 +183,7 @@ public class RedisCache
* @param hKey Hash键
* @param hKey Hash键
* @return Hash中的对象
* @return Hash中的对象
*/
*/
public
<
T
>
T
getCacheMapValue
(
final
String
key
,
final
String
hKey
)
public
<
T
>
T
getCacheMapValue
(
final
String
key
,
final
String
hKey
)
{
{
HashOperations
<
String
,
String
,
T
>
opsForHash
=
redisTemplate
.
opsForHash
();
HashOperations
<
String
,
String
,
T
>
opsForHash
=
redisTemplate
.
opsForHash
();
return
opsForHash
.
get
(
key
,
hKey
);
return
opsForHash
.
get
(
key
,
hKey
);
}
}
...
@@ -212,8 +195,7 @@ public class RedisCache
...
@@ -212,8 +195,7 @@ public class RedisCache
* @param hKeys Hash键集合
* @param hKeys Hash键集合
* @return Hash对象集合
* @return Hash对象集合
*/
*/
public
<
T
>
List
<
T
>
getMultiCacheMapValue
(
final
String
key
,
final
Collection
<
Object
>
hKeys
)
public
<
T
>
List
<
T
>
getMultiCacheMapValue
(
final
String
key
,
final
Collection
<
Object
>
hKeys
)
{
{
return
redisTemplate
.
opsForHash
().
multiGet
(
key
,
hKeys
);
return
redisTemplate
.
opsForHash
().
multiGet
(
key
,
hKeys
);
}
}
...
@@ -223,8 +205,7 @@ public class RedisCache
...
@@ -223,8 +205,7 @@ public class RedisCache
* @param pattern 字符串前缀
* @param pattern 字符串前缀
* @return 对象列表
* @return 对象列表
*/
*/
public
Collection
<
String
>
keys
(
final
String
pattern
)
public
Collection
<
String
>
keys
(
final
String
pattern
)
{
{
return
redisTemplate
.
keys
(
pattern
);
return
redisTemplate
.
keys
(
pattern
);
}
}
...
@@ -235,8 +216,151 @@ public class RedisCache
...
@@ -235,8 +216,151 @@ public class RedisCache
* @param channel 要发布到的频道
* @param channel 要发布到的频道
* @param message 消息内容
* @param message 消息内容
*/
*/
public
void
convertAndSend
(
String
channel
,
Object
message
)
public
void
convertAndSend
(
String
channel
,
Object
message
)
{
{
redisTemplate
.
convertAndSend
(
channel
,
message
);
redisTemplate
.
convertAndSend
(
channel
,
message
);
}
/**
* 添加一个元素, zset与set最大的区别就是每个元素都有一个score,因此有个排序的辅助功能;
*
* @param key
* @param value
* @param score
*/
public
Boolean
setCacheZSet
(
String
key
,
String
value
,
double
score
)
{
return
redisTemplate
.
opsForZSet
().
add
(
key
,
value
,
score
);
}
/**
* 删除元素 zrem
*
* @param key
* @param start
* @param end
*/
public
Long
removeRangeCacheZSet
(
String
key
,
long
start
,
long
end
)
{
return
redisTemplate
.
opsForZSet
().
removeRange
(
key
,
start
,
end
);
}
}
/**
* 删除元素 zrem
*
* @param key
* @param value
*/
public
long
removeCacheZSet
(
String
key
,
String
value
)
{
return
redisTemplate
.
opsForZSet
().
remove
(
key
,
value
);
}
/**
* score的增加or减少 zincrby
*
* @param key
* @param value
* @param score
*/
public
Double
incrScoreCacheZSet
(
String
key
,
String
value
,
double
score
)
{
return
redisTemplate
.
opsForZSet
().
incrementScore
(
key
,
value
,
score
);
}
/**
* 查询value对应的score zscore
*
* @param key
* @param value
* @return
*/
public
Double
getCacheZSetScore
(
String
key
,
String
value
)
{
return
redisTemplate
.
opsForZSet
().
score
(
key
,
value
);
}
/**
* 判断value在zset中的排名 zrank
*
* @param key
* @param value
* @return
*/
public
Long
rankCacheZSet
(
String
key
,
String
value
)
{
return
redisTemplate
.
opsForZSet
().
rank
(
key
,
value
);
}
/**
* 返回集合的长度
*
* @param key
* @return
*/
public
Long
getCacheZSetSize
(
String
key
)
{
return
redisTemplate
.
opsForZSet
().
zCard
(
key
);
}
/**
* 查询集合中指定顺序的值, 0 -1 表示获取全部的集合内容 zrange
*
* 返回有序的集合,score小的在前面
*
* @param key
* @param start
* @param end
* @return
*/
public
Set
<
String
>
rangeCacheZSet
(
String
key
,
int
start
,
int
end
)
{
return
redisTemplate
.
opsForZSet
().
range
(
key
,
start
,
end
);
}
/**
* 查询集合中指定顺序的值和score,0, -1 表示获取全部的集合内容
*
* @param key
* @param start
* @param end
* @return
*/
public
Set
<
ZSetOperations
.
TypedTuple
<
String
>>
rangeWithScore
(
String
key
,
int
start
,
int
end
)
{
return
redisTemplate
.
opsForZSet
().
rangeWithScores
(
key
,
start
,
end
);
}
/**
* 查询集合中指定顺序的值 zrevrange
*
* 返回有序的集合中,score大的在前面
*
* @param key
* @param start
* @param end
* @return
*/
public
Set
<
String
>
revRangeCacheZSet
(
String
key
,
int
start
,
int
end
)
{
return
redisTemplate
.
opsForZSet
().
reverseRange
(
key
,
start
,
end
);
}
/**
* 根据score的值,来获取满足条件的集合 zrangebyscore
*
* @param key
* @param min
* @param max
* @return
*/
public
Set
<
String
>
sortRangeCacheZSet
(
String
key
,
double
min
,
double
max
)
{
return
redisTemplate
.
opsForZSet
().
rangeByScore
(
key
,
min
,
max
);
}
/**
* 根据score的值,来获取满足条件的集合
*
* @param key
* @param min
* @param max
* @return
*/
public
Set
<
ZSetOperations
.
TypedTuple
<
String
>>
sortRangeWithScoresCacheZSet
(
String
key
,
double
min
,
double
max
)
{
return
redisTemplate
.
opsForZSet
().
rangeByScoreWithScores
(
key
,
min
,
max
);
}
}
}
linkwe-common/src/main/java/com/linkwechat/common/enums/MessageType.java
View file @
d612f5d
...
@@ -93,4 +93,8 @@ public enum MessageType {
...
@@ -93,4 +93,8 @@ public enum MessageType {
return
Stream
.
of
(
values
()).
filter
(
s
->
s
.
type
.
equals
(
type
)).
findFirst
();
return
Stream
.
of
(
values
()).
filter
(
s
->
s
.
type
.
equals
(
type
)).
findFirst
();
}
}
public
static
MessageType
messageTypeOf
(
String
messageType
)
{
return
Stream
.
of
(
values
()).
filter
(
s
->
s
.
messageType
.
equals
(
messageType
)).
findFirst
().
get
();
}
}
}
linkwe-common/src/main/java/com/linkwechat/common/utils/file/FileUploadUtils.java
View file @
d612f5d
...
@@ -4,6 +4,7 @@ import java.io.File;
...
@@ -4,6 +4,7 @@ import java.io.File;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
cn.hutool.core.io.FileUtil
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.linkwechat.common.config.CosConfig
;
import
com.linkwechat.common.config.CosConfig
;
import
com.linkwechat.common.config.RuoYiConfig
;
import
com.linkwechat.common.config.RuoYiConfig
;
...
@@ -73,6 +74,14 @@ public class FileUploadUtils {
...
@@ -73,6 +74,14 @@ public class FileUploadUtils {
}
}
}
}
public
static
final
String
upload
(
InputStream
inputStream
,
String
fileName
)
throws
IOException
{
try
{
return
upload
(
getDefaultBaseDir
(),
inputStream
,
fileName
);
}
catch
(
Exception
e
)
{
throw
new
IOException
(
e
.
getMessage
(),
e
);
}
}
/**
/**
* 以默认配置进行文件上传
* 以默认配置进行文件上传
...
@@ -135,6 +144,12 @@ public class FileUploadUtils {
...
@@ -135,6 +144,12 @@ public class FileUploadUtils {
return
pathFileName
;
return
pathFileName
;
}
}
public
static
final
String
upload
(
String
baseDir
,
InputStream
inputStream
,
String
fileName
)
throws
IOException
{
File
desc
=
getAbsoluteFile
(
baseDir
,
fileName
);
File
file
=
FileUtil
.
writeFromStream
(
inputStream
,
desc
);
return
file
.
getAbsolutePath
();
}
/**
/**
* 上传到腾讯对象云存储中
* 上传到腾讯对象云存储中
*
*
...
...
linkwe-common/src/main/java/com/linkwechat/common/utils/wecom/RSAUtil.java
View file @
d612f5d
...
@@ -64,7 +64,7 @@ public class RSAUtil {
...
@@ -64,7 +64,7 @@ public class RSAUtil {
*/
*/
public
static
String
decryptRSA
(
String
str
,
PrivateKey
privateKey
)
throws
NoSuchPaddingException
,
public
static
String
decryptRSA
(
String
str
,
PrivateKey
privateKey
)
throws
NoSuchPaddingException
,
NoSuchAlgorithmException
,
InvalidKeyException
,
BadPaddingException
,
IllegalBlockSizeException
,
NoSuchProviderException
{
NoSuchAlgorithmException
,
InvalidKeyException
,
BadPaddingException
,
IllegalBlockSizeException
,
NoSuchProviderException
{
Security
.
addProvider
(
new
org
.
bouncycastle
.
jce
.
provider
.
BouncyCastleProvider
());
Security
.
addProvider
(
new
BouncyCastleProvider
());
Cipher
rsa
=
Cipher
.
getInstance
(
"RSA/ECB/PKCS1Padding"
,
"BC"
);
Cipher
rsa
=
Cipher
.
getInstance
(
"RSA/ECB/PKCS1Padding"
,
"BC"
);
rsa
.
init
(
Cipher
.
DECRYPT_MODE
,
privateKey
);
rsa
.
init
(
Cipher
.
DECRYPT_MODE
,
privateKey
);
byte
[]
utf8
=
rsa
.
doFinal
(
Base64
.
getDecoder
().
decode
(
str
));
byte
[]
utf8
=
rsa
.
doFinal
(
Base64
.
getDecoder
().
decode
(
str
));
...
...
linkwe-quartz/src/main/java/com/linkwechat/quartz/task/PullGroupMessageTask.java
View file @
d612f5d
...
@@ -16,6 +16,7 @@ import com.linkwechat.wecom.domain.query.WeAddMsgTemplateQuery;
...
@@ -16,6 +16,7 @@ import com.linkwechat.wecom.domain.query.WeAddMsgTemplateQuery;
import
com.linkwechat.wecom.service.IWeGroupMessageAttachmentsService
;
import
com.linkwechat.wecom.service.IWeGroupMessageAttachmentsService
;
import
com.linkwechat.wecom.service.IWeGroupMessageListService
;
import
com.linkwechat.wecom.service.IWeGroupMessageListService
;
import
com.linkwechat.wecom.service.IWeGroupMessageSendResultService
;
import
com.linkwechat.wecom.service.IWeGroupMessageSendResultService
;
import
com.linkwechat.wecom.service.IWeGroupMessageTaskService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -43,6 +44,9 @@ public class PullGroupMessageTask {
...
@@ -43,6 +44,9 @@ public class PullGroupMessageTask {
@Autowired
@Autowired
private
IWeGroupMessageSendResultService
sendResultService
;
private
IWeGroupMessageSendResultService
sendResultService
;
@Autowired
private
IWeGroupMessageTaskService
iWeGroupMessageTaskService
;
/**
/**
* 同步开始时间
* 同步开始时间
*/
*/
...
@@ -180,7 +184,7 @@ public class PullGroupMessageTask {
...
@@ -180,7 +184,7 @@ public class PullGroupMessageTask {
List
<
WeGroupMessageSendResult
>
list
=
new
ArrayList
<>();
List
<
WeGroupMessageSendResult
>
list
=
new
ArrayList
<>();
Optional
.
ofNullable
(
groupMsgList
).
map
(
WeGroupMsgListDto:
:
getGroupMsgList
)
Optional
.
ofNullable
(
groupMsgList
).
map
(
WeGroupMsgListDto:
:
getGroupMsgList
)
.
orElseGet
(
ArrayList:
:
new
).
forEach
(
weGroupMsg
->
{
.
orElseGet
(
ArrayList:
:
new
).
forEach
(
weGroupMsg
->
{
WeGroupMsgListDto
groupMsgTask
=
groupMessageList
Service
.
getGroupMsgTask
(
weGroupMsg
.
getMsgId
(),
null
);
WeGroupMsgListDto
groupMsgTask
=
iWeGroupMessageTask
Service
.
getGroupMsgTask
(
weGroupMsg
.
getMsgId
(),
null
);
Optional
.
ofNullable
(
groupMsgTask
).
map
(
WeGroupMsgListDto:
:
getTaskList
).
orElseGet
(
ArrayList:
:
new
).
forEach
(
msgTask
->
{
Optional
.
ofNullable
(
groupMsgTask
).
map
(
WeGroupMsgListDto:
:
getTaskList
).
orElseGet
(
ArrayList:
:
new
).
forEach
(
msgTask
->
{
WeGroupMsgListDto
groupMsgSendResult
=
sendResultService
.
getGroupMsgSendResult
(
weGroupMsg
.
getMsgId
(),
msgTask
.
getUserId
(),
null
);
WeGroupMsgListDto
groupMsgSendResult
=
sendResultService
.
getGroupMsgSendResult
(
weGroupMsg
.
getMsgId
(),
msgTask
.
getUserId
(),
null
);
Optional
.
ofNullable
(
groupMsgSendResult
).
map
(
WeGroupMsgListDto:
:
getSendList
).
orElseGet
(
ArrayList:
:
new
).
forEach
(
sendResult
->
{
Optional
.
ofNullable
(
groupMsgSendResult
).
map
(
WeGroupMsgListDto:
:
getSendList
).
orElseGet
(
ArrayList:
:
new
).
forEach
(
sendResult
->
{
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeFlowerCustomerTagRel.java
View file @
d612f5d
...
@@ -43,8 +43,8 @@ public class WeFlowerCustomerTagRel
...
@@ -43,8 +43,8 @@ public class WeFlowerCustomerTagRel
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
String
tagName
;
private
String
tagName
;
/**0:移动端打的标签;1:pc端打的标签**/
//
/**0:移动端打的标签;1:pc端打的标签**/
private
Integer
relTagType
;
//
private Integer relTagType;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
private
Date
createTime
;
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/vo/WeGroupMessageDetailVo.java
View file @
d612f5d
...
@@ -2,8 +2,6 @@ package com.linkwechat.wecom.domain.vo;
...
@@ -2,8 +2,6 @@ package com.linkwechat.wecom.domain.vo;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.linkwechat.wecom.domain.WeGroupMessageAttachments
;
import
com.linkwechat.wecom.domain.WeGroupMessageAttachments
;
import
com.linkwechat.wecom.domain.WeGroupMessageSendResult
;
import
com.linkwechat.wecom.domain.WeGroupMessageTask
;
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
;
...
@@ -29,21 +27,25 @@ public class WeGroupMessageDetailVo {
...
@@ -29,21 +27,25 @@ public class WeGroupMessageDetailVo {
@ApiModelProperty
(
"发送时间"
)
@ApiModelProperty
(
"发送时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
sendTime
;
private
Date
sendTime
;
/**
* 附件
*/
@ApiModelProperty
(
"附件"
)
@ApiModelProperty
(
"附件"
)
private
List
<
WeGroupMessageAttachments
>
attachments
;
private
List
<
WeGroupMessageAttachments
>
attachments
;
/**
@ApiModelProperty
(
"待发送者数"
)
* 待发送者列表
private
Integer
toBeSendNum
;
*/
@ApiModelProperty
(
"待发送者列表"
)
@ApiModelProperty
(
"待发送者列表"
)
private
List
<
WeGroupMessageTaskVo
>
toBeSentList
;
private
List
<
WeGroupMessageTaskVo
>
toBeSendList
;
@ApiModelProperty
(
"已发送者数量"
)
private
Integer
alreadySendNum
;
/**
* 已发送者列表
*/
@ApiModelProperty
(
"已发送者列表"
)
@ApiModelProperty
(
"已发送者列表"
)
private
List
<
WeGroupMessageTaskVo
>
alreadySentList
;
private
List
<
WeGroupMessageTaskVo
>
alreadySendList
;
@ApiModelProperty
(
"已送达客户数"
)
private
Integer
alreadySendCustomerNum
;
@ApiModelProperty
(
"未送达客户数"
)
private
Integer
toBeSendCustomerNum
;
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeGroupMessageSendResultMapper.java
View file @
d612f5d
...
@@ -3,6 +3,8 @@ package com.linkwechat.wecom.mapper;
...
@@ -3,6 +3,8 @@ package com.linkwechat.wecom.mapper;
import
com.linkwechat.wecom.domain.WeGroupMessageSendResult
;
import
com.linkwechat.wecom.domain.WeGroupMessageSendResult
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
java.util.List
;
/**
/**
* 群发消息成员执行结果Mapper接口
* 群发消息成员执行结果Mapper接口
*
*
...
@@ -11,4 +13,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
@@ -11,4 +13,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
*/
public
interface
WeGroupMessageSendResultMapper
extends
BaseMapper
<
WeGroupMessageSendResult
>
{
public
interface
WeGroupMessageSendResultMapper
extends
BaseMapper
<
WeGroupMessageSendResult
>
{
List
<
WeGroupMessageSendResult
>
groupMsgSendResultList
(
WeGroupMessageSendResult
sendResult
);
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeGroupMessageTaskMapper.java
View file @
d612f5d
...
@@ -3,6 +3,8 @@ package com.linkwechat.wecom.mapper;
...
@@ -3,6 +3,8 @@ package com.linkwechat.wecom.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.linkwechat.wecom.domain.WeGroupMessageTask
;
import
com.linkwechat.wecom.domain.WeGroupMessageTask
;
import
java.util.List
;
/**
/**
* 群发消息成员发送任务表Mapper接口
* 群发消息成员发送任务表Mapper接口
*
*
...
@@ -11,4 +13,5 @@ import com.linkwechat.wecom.domain.WeGroupMessageTask;
...
@@ -11,4 +13,5 @@ import com.linkwechat.wecom.domain.WeGroupMessageTask;
*/
*/
public
interface
WeGroupMessageTaskMapper
extends
BaseMapper
<
WeGroupMessageTask
>
{
public
interface
WeGroupMessageTaskMapper
extends
BaseMapper
<
WeGroupMessageTask
>
{
List
<
WeGroupMessageTask
>
groupMsgTaskList
(
WeGroupMessageTask
task
);
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeCustomerService.java
View file @
d612f5d
...
@@ -29,14 +29,14 @@ public interface IWeCustomerService extends IService<WeCustomer>
...
@@ -29,14 +29,14 @@ public interface IWeCustomerService extends IService<WeCustomer>
*/
*/
public
WeCustomer
selectWeCustomerById
(
String
externalUserId
);
public
WeCustomer
selectWeCustomerById
(
String
externalUserId
);
/**
//
/**
* 新增/修改企业微信客户
//
* 新增/修改企业微信客户
*
//
*
* @param weCustomer 企业微信客户
//
* @param weCustomer 企业微信客户
* @return 修改结果
//
* @return 修改结果
*/
//
*/
@Override
//
@Override
public
boolean
saveOrUpdate
(
WeCustomer
weCustomer
);
//
public boolean saveOrUpdate(WeCustomer weCustomer);
/**
/**
* 查询企业微信客户列表
* 查询企业微信客户列表
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeGroupMessageSendResultService.java
View file @
d612f5d
...
@@ -32,4 +32,6 @@ public interface IWeGroupMessageSendResultService extends IService<WeGroupMessag
...
@@ -32,4 +32,6 @@ public interface IWeGroupMessageSendResultService extends IService<WeGroupMessag
void
addOrUpdateBatchByCondition
(
List
<
WeGroupMessageSendResult
>
taskList
);
void
addOrUpdateBatchByCondition
(
List
<
WeGroupMessageSendResult
>
taskList
);
List
<
WeGroupMessageSendResult
>
groupMsgSendResultList
(
WeGroupMessageSendResult
sendResult
);
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeGroupMessageTaskService.java
View file @
d612f5d
...
@@ -28,4 +28,6 @@ public interface IWeGroupMessageTaskService extends IService<WeGroupMessageTask>
...
@@ -28,4 +28,6 @@ public interface IWeGroupMessageTaskService extends IService<WeGroupMessageTask>
* @param taskList
* @param taskList
*/
*/
void
addOrUpdateBatchByCondition
(
List
<
WeGroupMessageTask
>
taskList
);
void
addOrUpdateBatchByCondition
(
List
<
WeGroupMessageTask
>
taskList
);
List
<
WeGroupMessageTask
>
groupMsgTaskList
(
WeGroupMessageTask
task
);
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeGroupMessageTemplateService.java
View file @
d612f5d
package
com
.
linkwechat
.
wecom
.
service
;
package
com
.
linkwechat
.
wecom
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.linkwechat.wecom.domain.WeGroupMessageSendResult
;
import
com.linkwechat.wecom.domain.WeGroupMessageTask
;
import
com.linkwechat.wecom.domain.WeGroupMessageTemplate
;
import
com.linkwechat.wecom.domain.WeGroupMessageTemplate
;
import
com.linkwechat.wecom.domain.query.WeAddGroupMessageQuery
;
import
com.linkwechat.wecom.domain.query.WeAddGroupMessageQuery
;
import
com.linkwechat.wecom.domain.vo.WeGroupMessageDetailVo
;
import
com.linkwechat.wecom.domain.vo.WeGroupMessageDetailVo
;
...
@@ -27,6 +29,7 @@ public interface IWeGroupMessageTemplateService extends IService<WeGroupMessageT
...
@@ -27,6 +29,7 @@ public interface IWeGroupMessageTemplateService extends IService<WeGroupMessageT
*/
*/
WeGroupMessageDetailVo
getGroupMsgTemplateDetail
(
Long
id
);
WeGroupMessageDetailVo
getGroupMsgTemplateDetail
(
Long
id
);
/**
/**
* 创建群发消息
* 创建群发消息
* @param query
* @param query
...
@@ -44,4 +47,16 @@ public interface IWeGroupMessageTemplateService extends IService<WeGroupMessageT
...
@@ -44,4 +47,16 @@ public interface IWeGroupMessageTemplateService extends IService<WeGroupMessageT
* @param asList
* @param asList
*/
*/
void
syncGroupMsgSendResultByIds
(
List
<
Long
>
asList
);
void
syncGroupMsgSendResultByIds
(
List
<
Long
>
asList
);
/**
* 群发成员发送任务列表
* @param task
*/
List
<
WeGroupMessageTask
>
groupMsgTaskList
(
WeGroupMessageTask
task
);
/**
* 企业群发成员执行结果
* @param sendResult
*/
List
<
WeGroupMessageSendResult
>
groupMsgSendResultList
(
WeGroupMessageSendResult
sendResult
);
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
View file @
d612f5d
...
@@ -371,9 +371,9 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
...
@@ -371,9 +371,9 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
@Override
@Override
public
List
<
WeUser
>
getCustomersByUserId
(
String
externalUserid
)
{
public
List
<
WeUser
>
getCustomersByUserId
(
String
externalUserid
)
{
String
userId
=
null
;
String
userId
=
null
;
if
(
Constants
.
USER_TYPE_WECOME
.
equals
(
SecurityUtils
.
getLoginUser
().
getUser
().
getUserType
())){
//
if(Constants.USER_TYPE_WECOME.equals(SecurityUtils.getLoginUser().getUser().getUserType())){
userId
=
SecurityUtils
.
getLoginUser
().
getUser
().
getWeUserId
();
//
userId=SecurityUtils.getLoginUser().getUser().getWeUserId();
}
//
}
return
this
.
baseMapper
.
getCustomersByUserId
(
externalUserid
,
userId
);
return
this
.
baseMapper
.
getCustomersByUserId
(
externalUserid
,
userId
);
}
}
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeGroupMessageSendResultServiceImpl.java
View file @
d612f5d
...
@@ -93,4 +93,9 @@ public class WeGroupMessageSendResultServiceImpl extends ServiceImpl<WeGroupMess
...
@@ -93,4 +93,9 @@ public class WeGroupMessageSendResultServiceImpl extends ServiceImpl<WeGroupMess
});
});
}
}
}
}
@Override
public
List
<
WeGroupMessageSendResult
>
groupMsgSendResultList
(
WeGroupMessageSendResult
sendResult
)
{
return
this
.
baseMapper
.
groupMsgSendResultList
(
sendResult
);
}
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeGroupMessageTaskServiceImpl.java
View file @
d612f5d
...
@@ -64,4 +64,9 @@ public class WeGroupMessageTaskServiceImpl extends ServiceImpl<WeGroupMessageTas
...
@@ -64,4 +64,9 @@ public class WeGroupMessageTaskServiceImpl extends ServiceImpl<WeGroupMessageTas
});
});
}
}
}
}
@Override
public
List
<
WeGroupMessageTask
>
groupMsgTaskList
(
WeGroupMessageTask
task
)
{
return
this
.
baseMapper
.
groupMsgTaskList
(
task
);
}
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeGroupMessageTemplateServiceImpl.java
View file @
d612f5d
...
@@ -97,6 +97,14 @@ public class WeGroupMessageTemplateServiceImpl extends ServiceImpl<WeGroupMessag
...
@@ -97,6 +97,14 @@ public class WeGroupMessageTemplateServiceImpl extends ServiceImpl<WeGroupMessag
List
<
WeGroupMessageTask
>
alreadySent
=
groupMsgDetail
.
stream
().
map
(
WeGroupMessageListVo:
:
getSenders
)
List
<
WeGroupMessageTask
>
alreadySent
=
groupMsgDetail
.
stream
().
map
(
WeGroupMessageListVo:
:
getSenders
)
.
flatMap
(
Collection:
:
stream
).
filter
(
item
->
ObjectUtil
.
equal
(
2
,
item
.
getStatus
())).
collect
(
Collectors
.
toList
());
.
flatMap
(
Collection:
:
stream
).
filter
(
item
->
ObjectUtil
.
equal
(
2
,
item
.
getStatus
())).
collect
(
Collectors
.
toList
());
//未发送客户数
Long
toBeCustomerNum
=
groupMsgDetail
.
stream
().
map
(
WeGroupMessageListVo:
:
getExtralInfos
).
flatMap
(
Collection:
:
stream
)
.
filter
(
item
->
ObjectUtil
.
equal
(
0
,
item
.
getStatus
())).
count
();
detailVo
.
setToBeSendCustomerNum
(
toBeCustomerNum
.
intValue
());
//已发送客户数
Long
alreadyCustomerNum
=
groupMsgDetail
.
stream
().
map
(
WeGroupMessageListVo:
:
getExtralInfos
).
flatMap
(
Collection:
:
stream
)
.
filter
(
item
->
!
ObjectUtil
.
equal
(
1
,
item
.
getStatus
())).
count
();
detailVo
.
setAlreadySendCustomerNum
(
alreadyCustomerNum
.
intValue
());
//未发送查询每个人员对应客户信息
//未发送查询每个人员对应客户信息
if
(
CollectionUtil
.
isNotEmpty
(
toBeSent
))
{
if
(
CollectionUtil
.
isNotEmpty
(
toBeSent
))
{
List
<
WeGroupMessageTaskVo
>
toBeSentList
=
toBeSent
.
stream
().
map
(
userInfo
->
{
List
<
WeGroupMessageTaskVo
>
toBeSentList
=
toBeSent
.
stream
().
map
(
userInfo
->
{
...
@@ -118,7 +126,8 @@ public class WeGroupMessageTemplateServiceImpl extends ServiceImpl<WeGroupMessag
...
@@ -118,7 +126,8 @@ public class WeGroupMessageTemplateServiceImpl extends ServiceImpl<WeGroupMessag
}
}
return
weGroupMessageTaskVo
;
return
weGroupMessageTaskVo
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
detailVo
.
setToBeSentList
(
toBeSentList
);
detailVo
.
setToBeSendList
(
toBeSentList
);
detailVo
.
setToBeSendNum
(
toBeSentList
.
size
());
}
}
//已发送查询每个人员对应客户信息
//已发送查询每个人员对应客户信息
if
(
CollectionUtil
.
isNotEmpty
(
alreadySent
))
{
if
(
CollectionUtil
.
isNotEmpty
(
alreadySent
))
{
...
@@ -142,7 +151,8 @@ public class WeGroupMessageTemplateServiceImpl extends ServiceImpl<WeGroupMessag
...
@@ -142,7 +151,8 @@ public class WeGroupMessageTemplateServiceImpl extends ServiceImpl<WeGroupMessag
}
}
return
weGroupMessageTaskVo
;
return
weGroupMessageTaskVo
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
detailVo
.
setAlreadySentList
(
alreadySentList
);
detailVo
.
setAlreadySendList
(
alreadySentList
);
detailVo
.
setAlreadySendNum
(
alreadySentList
.
size
());
}
}
}
}
return
detailVo
;
return
detailVo
;
...
@@ -288,4 +298,13 @@ public class WeGroupMessageTemplateServiceImpl extends ServiceImpl<WeGroupMessag
...
@@ -288,4 +298,13 @@ public class WeGroupMessageTemplateServiceImpl extends ServiceImpl<WeGroupMessag
messageSendResultService
.
addOrUpdateBatchByCondition
(
sendResultlist
);
messageSendResultService
.
addOrUpdateBatchByCondition
(
sendResultlist
);
}
}
@Override
public
List
<
WeGroupMessageTask
>
groupMsgTaskList
(
WeGroupMessageTask
task
)
{
return
messageTaskService
.
groupMsgTaskList
(
task
);
}
@Override
public
List
<
WeGroupMessageSendResult
>
groupMsgSendResultList
(
WeGroupMessageSendResult
sendResult
)
{
return
messageSendResultService
.
groupMsgSendResultList
(
sendResult
);
}
}
}
linkwe-wecom/src/main/resources/mapper/wecom/WeCustomerMapper.xml
View file @
d612f5d
...
@@ -129,23 +129,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -129,23 +129,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"userName"
column=
"user_name"
/>
<result
property=
"userName"
column=
"user_name"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"isOpenChat"
column=
"is_open_chat"
jdbcType=
"INTEGER"
/>
<result
property=
"isOpenChat"
column=
"is_open_chat"
jdbcType=
"INTEGER"
/>
<collection
property=
"weFlowerCustomerRels"
ofType=
"com.linkwechat.wecom.domain.WeFlowerCustomerRel"
>
<!-- <collection property="weFlowerCustomerRels" ofType="com.linkwechat.wecom.domain.WeFlowerCustomerRel">--
>
<result
property=
"id"
column=
"wfcrId"
/
>
<!-- <result property="id" column="wfcrId" />--
>
<result
property=
"userId"
column=
"user_id"
/
>
<!-- <result property="userId" column="user_id" />--
>
<result
property=
"remark"
column=
"remark"
/
>
<!-- <result property="remark" column="remark" />--
>
<result
property=
"description"
column=
"description"
/
>
<!-- <result property="description" column="description" />--
>
<result
property=
"createTime"
column=
"create_time"
/
>
<!-- <result property="createTime" column="create_time" />--
>
<result
property=
"remarkCorpName"
column=
"remark_corp_name"
/
>
<!-- <result property="remarkCorpName" column="remark_corp_name" />--
>
<result
property=
"operUserid"
column=
"oper_userid"
/
>
<!-- <result property="operUserid" column="oper_userid" />--
>
<result
property=
"addWay"
column=
"add_way"
/
>
<!-- <result property="addWay" column="add_way" />--
>
<result
property=
"state"
column=
"state"
/
>
<!-- <result property="state" column="state" />--
>
<result
property=
"status"
column=
"status"
/
>
<!-- <result property="status" column="status" />--
>
<result
property=
"userName"
column=
"user_name"
/
>
<!-- <result property="userName" column="user_name"/>--
>
<result
property=
"department"
column=
"department"
/
>
<!-- <result property="department" column="department"/>--
>
<collection
property=
"weFlowerCustomerTagRels"
javaType=
"ArrayList"
<!-- <collection property="weFlowerCustomerTagRels" javaType="ArrayList"-->
column=
"{id = wfcrId}"
select=
"selectWeCustomerTags"
>
<!-- column="{id = wfcrId}" select="selectWeCustomerTags">--
>
</collection
>
<!-- </collection>--
>
</collection
>
<!-- </collection>--
>
</resultMap>
</resultMap>
...
@@ -298,7 +298,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -298,7 +298,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM
FROM
we_customer wc
we_customer wc
LEFT JOIN we_user wu ON wc.first_user_id=wu.user_id
LEFT JOIN we_user wu ON wc.first_user_id=wu.user_id
LEFT JOIN we_flower_customer_tag_rel wfctr ON wfctr.external_userid=wc.external_userid AND wfctr.user_id=wc.first_user_id
LEFT JOIN we_flower_customer_tag_rel wfctr ON wfctr.
del_flag=0 AND wfctr.
external_userid=wc.external_userid AND wfctr.user_id=wc.first_user_id
LEFT JOIN we_tag wt ON wt.tag_id=wfctr.tag_id
LEFT JOIN we_tag wt ON wt.tag_id=wfctr.tag_id
<where>
<where>
<if
test=
"delFlag != null"
>
<if
test=
"delFlag != null"
>
...
@@ -419,32 +419,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -419,32 +419,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
wc.corp_full_name,
wc.corp_full_name,
wc.position,
wc.position,
wc.is_open_chat,
wc.is_open_chat,
wfcr.id as wfcrId,
wfcr.user_id,
wfcr.remark,
wfcr.description,
wfcr.create_time,
wfcr.remark_corp_name,
wfcr.oper_userid,
wfcr.add_way,
wfcr.state,
wu.user_name,
wu.user_name,
wfcrf.flower_customer_rel_id,
wt.tag_id,
wt.tag_id,
wt.create_time,
wt.create_time,
wt.`name` as tagName,
wt.`name` as tagName,
(SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department
(SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department
FROM
FROM
we_customer wc
we_customer wc
LEFT JOIN we_flower_customer_rel wfcr ON wc.first_user_id=wfcr.user_id
LEFT JOIN we_user wu ON wu.user_id=wc.first_user_id
LEFT JOIN we_user wu ON wu.user_id=wfcr.user_id
LEFT JOIN we_flower_customer_tag_rel wfcrf ON wfcrf.user_id = wc.first_user_id
LEFT JOIN we_flower_customer_tag_rel wfcrf ON wfcrf.flower_customer_rel_id = wfcr.id
LEFT JOIN we_tag wt ON wt.tag_id = wfcrf.tag_id
LEFT JOIN we_tag wt ON wt.tag_id = wfcrf.tag_id
WHERE wc.external_userid=#{externalUserid}
WHERE wc.external_userid=#{externalUserid}
<if
test=
"userId != null and userId !=''"
>
<if
test=
"userId != null and userId !=''"
>
AND w
fcr.
user_id=#{userId}
AND w
c.first_
user_id=#{userId}
</if>
</if>
ORDER BY w
fcr
.create_time ASC limit 1
ORDER BY w
c
.create_time ASC limit 1
</select>
</select>
...
...
linkwe-wecom/src/main/resources/mapper/wecom/WeGroupMessageSendResultMapper.xml
View file @
d612f5d
...
@@ -9,15 +9,66 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -9,15 +9,66 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"msgTemplateId"
column=
"msg_template_id"
/>
<result
property=
"msgTemplateId"
column=
"msg_template_id"
/>
<result
property=
"msgId"
column=
"msg_id"
/>
<result
property=
"msgId"
column=
"msg_id"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"userName"
column=
"user_name"
/>
<result
property=
"externalUserid"
column=
"external_userid"
/>
<result
property=
"externalUserid"
column=
"external_userid"
/>
<result
property=
"customerName"
column=
"customer_name"
/>
<result
property=
"chatId"
column=
"chat_id"
/>
<result
property=
"chatId"
column=
"chat_id"
/>
<result
property=
"chatName"
column=
"chat_name"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"sendTime"
column=
"send_time"
/>
<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>
</resultMap>
<select
id=
"groupMsgSendResultList"
resultMap=
"WeGroupMessageSendResultResult"
>
select
wgmsr.id,
wgmsr.msg_id,
wgmsr.msg_template_id,
wgmsr.external_userid,
wc.name as customer_name,
wgmsr.user_id,
wu.user_name,
wgmsr.chat_id,
wg.group_name as chat_name,
wgmsr.status,
wgmsr.send_time
from
we_group_message_send_result wgmsr
left join we_user wu on
wu.user_id = wgmsr.user_id
left join we_customer wc on
wc.external_userid = wgmsr.external_userid
left join we_group wg on
wg.chat_id = wgmsr.chat_id
<where>
<if
test=
"id !=null"
>
and wgmsr.id = #{id}
</if>
<if
test=
"msgTemplateId != null and msgTemplateId != ''"
>
and wgmsr.msg_template_id = #{msgTemplateId}
</if>
<if
test=
"msgId != null and msgId != ''"
>
and wgmsr.msg_id = #{msgId}
</if>
<if
test=
"status != null and status != ''"
>
and wgmsr.status = #{status}
</if>
<if
test=
"customerName != null and customerName != ''"
>
and wc.name like concat('%', #{customerName}, '%')
</if>
<if
test=
"userName != null and userName != ''"
>
and wu.user_name like concat('%', #{userName}, '%')
</if>
<if
test=
"chatName != null and chatName != ''"
>
and wg.group_name like concat('%', #{chatName}, '%')
</if>
<if
test=
"beginTime != null and beginTime != ''"
>
<!-- 开始时间检索 -->
AND date_format(wgmsr.send_time,'%y%m%d')
>
= date_format(#{beginTime},'%y%m%d')
</if>
<if
test=
"endTime != null and endTime != ''"
>
<!-- 结束时间检索 -->
AND date_format(wgmsr.send_time,'%y%m%d')
<
= date_format(#{endTime},'%y%m%d')
</if>
</where>
</select>
</mapper>
</mapper>
\ No newline at end of file
\ No newline at end of file
linkwe-wecom/src/main/resources/mapper/wecom/WeGroupMessageTaskMapper.xml
View file @
d612f5d
...
@@ -9,13 +9,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -9,13 +9,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"msgTemplateId"
column=
"msg_template_id"
/>
<result
property=
"msgTemplateId"
column=
"msg_template_id"
/>
<result
property=
"msgId"
column=
"msg_id"
/>
<result
property=
"msgId"
column=
"msg_id"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"userName"
column=
"user_name"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"sendTime"
column=
"send_time"
/>
<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>
</resultMap>
<select
id=
"groupMsgTaskList"
resultMap=
"WeGroupMessageTaskResult"
>
select
wgmt.id,
wgmt.msg_template_id,
wgmt.msg_id,
wgmt.user_id,
wu.user_name,
wgmt.status,
wgmt.send_time
from we_group_message_task wgmt
left join we_user wu on wu.user_id = wgmt.user_id
<where>
<if
test=
"id != null"
>
and wgmt.id = #{id}
</if>
<if
test=
"msgId != null and msgId != ''"
>
and wgmt.msg_id = #{msgId}
</if>
<if
test=
"msgTemplateId != null and msgTemplateId != ''"
>
and wgmt.msg_template_id = #{msgTemplateId}
</if>
<if
test=
"userName != null and userName != ''"
>
and wu.user_name like concat('%', #{userName}, '%')
</if>
<if
test=
"status != null"
>
and wgmt.status = #{status}
</if>
<if
test=
"beginTime != null and beginTime != ''"
>
<!-- 开始时间检索 -->
AND date_format(wgmt.send_time,'%y%m%d')
>
= date_format(#{beginTime},'%y%m%d')
</if>
<if
test=
"endTime != null and endTime != ''"
>
<!-- 结束时间检索 -->
AND date_format(wgmt.send_time,'%y%m%d')
<
= date_format(#{endTime},'%y%m%d')
</if>
</where>
</select>
</mapper>
</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