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 36d4e1dc
authored
Apr 12, 2021
by
李昂
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'back_end_dev' of
https://gitee.com/LinkWeChat/link-wechat
into back_end_dev
2 parents
63fe90fb
4a48bccd
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
149 additions
and
50 deletions
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeAppController.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeTaskFissionController.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeTaskFissionRewardController.java
linkwe-framework/src/main/java/com/linkwechat/framework/config/SecurityConfig.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeApp.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeTaskFission.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/factory/impl/customer/WeCallBackAddExternalContactImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/interceptor/WeiXinAuthInterceptor.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerMessagePushServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeTaskFissionRewardServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeTaskFissionServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeTaskFissionStaffServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/wxclient/WxAuthClient.java
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeAppController.java
0 → 100644
View file @
36d4e1d
package
com
.
linkwechat
.
web
.
controller
.
wecom
;
import
com.linkwechat.common.core.controller.BaseController
;
import
com.linkwechat.common.core.domain.AjaxResult
;
import
com.linkwechat.wecom.domain.WeApp
;
import
com.linkwechat.wecom.service.IWeAppService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
@RestController
@RequestMapping
(
"/wecom/weapp"
)
public
class
WeAppController
extends
BaseController
{
@Autowired
IWeAppService
iWeAppService
;
@GetMapping
(
"/list"
)
public
AjaxResult
list
()
{
return
AjaxResult
.
success
(
iWeAppService
.
list
()
);
}
@PutMapping
(
"/updateWeApp"
)
public
AjaxResult
updateWeApp
(
@RequestBody
WeApp
weApp
){
iWeAppService
.
updateById
(
weApp
);
return
AjaxResult
.
success
();
}
}
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeTaskFissionController.java
View file @
36d4e1d
...
...
@@ -2,6 +2,7 @@ package com.linkwechat.web.controller.wecom;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSONObject
;
//import com.alibaba.nacos.common.utils.CollectionUtils;
import
com.google.common.collect.Lists
;
...
...
@@ -151,6 +152,12 @@ public class WeTaskFissionController extends BaseController {
CopyOptions
options
=
CopyOptions
.
create
();
options
.
setIgnoreNullValue
(
true
);
BeanUtil
.
copyProperties
(
weTaskFission
,
fissionTask
,
options
);
if
(
CollectionUtil
.
isNotEmpty
(
weTaskFission
.
getTaskFissionStaffs
()))
{
fissionTask
.
setTaskFissionStaffs
(
weTaskFission
.
getTaskFissionStaffs
());
}
if
(
CollectionUtil
.
isNotEmpty
(
weTaskFission
.
getTaskFissionWeGroups
()))
{
fissionTask
.
setTaskFissionWeGroups
(
weTaskFission
.
getTaskFissionWeGroups
());
}
Long
id
=
weTaskFissionService
.
updateWeTaskFission
(
fissionTask
);
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"id"
,
id
);
...
...
@@ -222,7 +229,7 @@ public class WeTaskFissionController extends BaseController {
public
AjaxResult
<
JSONObject
>
upload
(
@RequestParam
(
value
=
"file"
)
MultipartFile
file
)
throws
IOException
{
String
url
=
FileUploadUtils
.
upload2Cos
(
file
,
cosConfig
);
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"rewardImageUrl"
,
url
);
json
.
put
(
"rewardImageUrl"
,
cosConfig
.
getImgUrlPrefix
()+
url
);
return
AjaxResult
.
success
(
json
);
}
...
...
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeTaskFissionRewardController.java
View file @
36d4e1d
...
...
@@ -106,9 +106,9 @@ public class WeTaskFissionRewardController extends BaseController {
*/
@ApiOperation
(
value
=
"根据微信用户id和任务id获取任务裂变奖励详细信息"
,
httpMethod
=
"GET"
)
// @PreAuthorize("@ss.hasPermi('wecom:getRewardByFissionId:query')")
@GetMapping
(
value
=
"/getRewardByFissionId/{fissionId}/{
ei
d}"
)
@GetMapping
(
value
=
"/getRewardByFissionId/{fissionId}/{
unionI
d}"
)
public
AjaxResult
<
WeTaskFissionRewardVo
>
getRewardByFissionId
(
@ApiParam
(
"任务id"
)
@PathVariable
(
"fissionId"
)
String
fissionId
,
@PathVariable
(
"
eid"
)
@ApiParam
(
"客户id"
)
String
ei
d
)
{
return
AjaxResult
.
success
(
weTaskFissionRewardService
.
getRewardByFissionId
(
fissionId
,
ei
d
));
,
@PathVariable
(
"
unionId"
)
@ApiParam
(
"客户id"
)
String
unionI
d
)
{
return
AjaxResult
.
success
(
weTaskFissionRewardService
.
getRewardByFissionId
(
fissionId
,
unionI
d
));
}
}
linkwe-framework/src/main/java/com/linkwechat/framework/config/SecurityConfig.java
View file @
36d4e1d
...
...
@@ -124,7 +124,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
// .antMatchers("/common/uploadFile2Cos").anonymous()
// .antMatchers("/wecom/material/temporaryMaterialMediaId").anonymous()
.
antMatchers
(
"/wecom/portrait/**"
).
anonymous
()
.
antMatchers
(
"/wecom/fission/poster"
,
"/wecom/fission/*/progress/*"
).
anonymous
()
.
antMatchers
(
"/wecom/fission/poster"
,
"/wecom/fission/*/progress/*"
,
"/wecom/reward/getRewardByFissionId/**"
).
anonymous
()
// 获取实际群活码和社群运营H5页面不需要登录
.
antMatchers
(
"/wecom/groupCode/getActualCode/**"
).
anonymous
()
.
antMatchers
(
"/wecom/community/h5/**"
).
anonymous
()
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeApp.java
View file @
36d4e1d
package
com
.
linkwechat
.
wecom
.
domain
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.linkwechat.common.utils.SnowFlakeUtil
;
import
lombok.AllArgsConstructor
;
...
...
@@ -29,11 +30,40 @@ public class WeApp {
/**应用id**/
private
String
agentId
;
/**应用名称**/
private
String
agentName
;
/**应用密钥**/
private
String
agentSecret
;
/**应用描述**/
private
String
description
;
/**应用图标**/
private
String
squareLogoUrl
;
/**企业应用是否被停用(1:是;0:否)**/
private
Integer
close
;
/**企业应用可信域名**/
private
String
redirectDomain
;
/**企业应用是否打开地理位置上报 0:不上报;1:进入会话上报;**/
private
Integer
reportLocationFlag
;
/**是否上报用户进入应用事件。0:不接收;1:接收**/
private
Integer
isreportenter
;
/**应用主页url**/
private
String
homeUrl
;
/**应用类型(1:自建应用;)**/
private
Integer
appType
;
...
...
@@ -52,6 +82,11 @@ public class WeApp {
private
String
status
;
/**企业应用头像的mediaid,通过素材管理接口上传图片获得mediaid,上传后会自动裁剪成方形和圆形两个头像**/
@TableField
(
exist
=
false
)
private
String
logoMediaid
;
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeTaskFission.java
View file @
36d4e1d
...
...
@@ -59,16 +59,16 @@ public class WeTaskFission extends BaseEntity {
/**
* 活动开始时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"活动开始时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
)
@Excel
(
name
=
"活动开始时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd
HH:mm:ss
"
)
@ApiModelProperty
(
value
=
"活动开始时间"
)
private
Date
startTime
;
/**
* 活动结束时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"活动结束时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
)
@Excel
(
name
=
"活动结束时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd
HH:mm:ss
"
)
@ApiModelProperty
(
value
=
"活动结束时间"
)
private
Date
overTime
;
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/factory/impl/customer/WeCallBackAddExternalContactImpl.java
View file @
36d4e1d
...
...
@@ -48,10 +48,15 @@ public class WeCallBackAddExternalContactImpl extends WeEventStrategy {
private
IWeTaskFissionRewardService
weTaskFissionRewardService
;
@Autowired
private
IWeTaskFissionService
weTaskFissionService
;
private
ThreadLocal
<
WeFlowerCustomerRel
>
weFlowerCustomerRelThreadLocal
=
new
ThreadLocal
<>();
@Override
public
void
eventHandle
(
WxCpXmlMessageVO
message
)
{
if
(
message
.
getExternalUserId
()
!=
null
)
{
WeFlowerCustomerRel
weFlowerCustomerRel
=
weFlowerCustomerRelService
.
getOne
(
new
LambdaQueryWrapper
<
WeFlowerCustomerRel
>()
.
eq
(
WeFlowerCustomerRel:
:
getExternalUserid
,
message
.
getExternalUserId
())
.
eq
(
WeFlowerCustomerRel:
:
getUserId
,
message
.
getUserId
()));
weFlowerCustomerRelThreadLocal
.
set
(
weFlowerCustomerRel
);
weCustomerService
.
getCustomersInfoAndSynchWeCustomer
(
message
.
getExternalUserId
());
}
if
(
message
.
getState
()
!=
null
&&
message
.
getWelcomeCode
()
!=
null
)
{
...
...
@@ -65,6 +70,7 @@ public class WeCallBackAddExternalContactImpl extends WeEventStrategy {
//裂变任务处理
private
void
taskFissionRecordHandle
(
String
state
,
String
wecomCode
,
String
userId
,
String
externalUserId
)
{
log
.
info
(
"裂变任务处理 >>>>>>>>>>start"
);
//查询裂变客户任务记录
String
fissionRecordId
=
state
.
substring
(
WeConstans
.
FISSION_PREFIX
.
length
());
WeTaskFissionRecord
weTaskFissionRecord
=
weTaskFissionRecordService
.
selectWeTaskFissionRecordById
(
Long
.
valueOf
(
fissionRecordId
));
...
...
@@ -72,20 +78,23 @@ public class WeCallBackAddExternalContactImpl extends WeEventStrategy {
//查询裂变任务详情
WeTaskFission
weTaskFission
=
weTaskFissionService
.
selectWeTaskFissionById
(
weTaskFissionRecord
.
getTaskFissionId
());
Long
fissNum
=
weTaskFissionRecord
.
getFissNum
()
+
1
;
weTaskFissionRecord
.
setFissNum
(
fissNum
);
Long
fissNum
=
weTaskFissionRecord
.
getFissNum
();
if
(
weFlowerCustomerRelThreadLocal
.
get
()
==
null
){
fissNum
++;
weTaskFissionRecord
.
setFissNum
(
fissNum
);
}
log
.
info
(
"查询裂变任务详情 >>>>>>>>>>{}"
,
JSONObject
.
toJSONString
(
weTaskFissionRecord
));
if
(
weTaskFission
!=
null
){
//发送欢迎语
String
welcomeMsg
=
weTaskFission
.
getWelcomeMsg
(
);
WeWelcomeMsg
.
WeWelcomeMsgBuilder
weWelcomeMsgBuilder
=
JSONObject
.
parseObject
(
welcomeMsg
,
WeWelcomeMsg
.
WeWelcomeMsgBuilder
.
class
);
weWelcomeMsgBuilder
.
welcome_code
(
wecomCode
);
WeWelcomeMsg
.
WeWelcomeMsgBuilder
weWelcomeMsgBuilder
=
WeWelcomeMsg
.
builder
().
welcome_code
(
wecomCode
);
weWelcomeMsgBuilder
.
text
(
WeWelcomeMsg
.
Text
.
builder
()
.
content
(
weTaskFission
.
getWelcomeMsg
()).
build
()
);
weCustomerService
.
sendWelcomeMsg
(
weWelcomeMsgBuilder
.
build
());
}
//裂变数量完成任务处理,消费兑换码
if
(
fissNum
>=
weTaskFission
.
getFissNum
()){
log
.
info
(
"裂变数量完成任务处理,消费兑换码 >>>>>>>>>>{}"
,
fissNum
);
weTaskFissionRecord
.
setCompleteTime
(
new
Date
());
WeTaskFissionReward
reward
=
new
WeTaskFissionReward
();
reward
.
setTaskFissionId
(
weTaskFissionRecord
.
getTaskFissionId
());
...
...
@@ -96,8 +105,9 @@ public class WeCallBackAddExternalContactImpl extends WeEventStrategy {
fissionReward
.
setRewardUserId
(
weTaskFissionRecord
.
getCustomerId
());
weTaskFissionRewardService
.
updateWeTaskFissionReward
(
fissionReward
);
}
log
.
info
(
"裂变任务处理变更 >>>>>>>>>>{}"
,
JSONObject
.
toJSONString
(
weTaskFissionRecord
));
weTaskFissionRecordService
.
updateWeTaskFissionRecord
(
weTaskFissionRecord
);
log
.
info
(
"裂变任务处理 >>>>>>>>>>end"
);
}
}
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/interceptor/WeiXinAuthInterceptor.java
View file @
36d4e1d
...
...
@@ -56,21 +56,20 @@ public class WeiXinAuthInterceptor implements Interceptor {
private
String
findAccessToken
(
String
openId
){
//获取用户token
String
accessToken
=
redisCache
.
getCacheObject
(
WeConstans
.
WX_AUTH_ACCESS_TOKEN
+
":"
+
openId
);
if
(
StringUtils
.
isEmpty
(
accessToken
)
){
WxTokenDto
wxTokenDto
=
redisCache
.
getCacheObject
(
WeConstans
.
WX_AUTH_ACCESS_TOKEN
+
":"
+
openId
);
if
(
wxTokenDto
==
null
){
//当用户token失效,则获取refreshToken
String
refreshToken
=
redisCache
.
getCacheObject
(
WeConstans
.
WX_AUTH_REFRESH_ACCESS_TOKEN
+
":"
+
openId
);
if
(
StringUtils
.
isEmpty
(
refreshToken
)){
throw
new
WeComException
(
1001
,
"token失效,请重新授权"
);
}
else
{
WxTokenDto
wxTokenDto
=
wxAuthClient
.
refreshToken
(
appId
,
secret
,
grantType
,
refreshToken
);
wxTokenDto
=
wxAuthClient
.
refreshToken
(
appId
,
grantType
,
refreshToken
);
if
(
wxTokenDto
!=
null
&&
StringUtils
.
isNotEmpty
(
wxTokenDto
.
getAccessToken
())){
redisCache
.
setCacheObject
(
WeConstans
.
WX_AUTH_ACCESS_TOKEN
+
":"
+
openId
,
wxTokenDto
.
getAccessToken
(),
wxTokenDto
.
getExpiresIn
(),
TimeUnit
.
SECONDS
);
accessToken
=
wxTokenDto
.
getAccessToken
();
redisCache
.
setCacheObject
(
WeConstans
.
WX_AUTH_ACCESS_TOKEN
+
":"
+
openId
,
wxTokenDto
,
wxTokenDto
.
getExpiresIn
(),
TimeUnit
.
SECONDS
);
}
}
}
return
accessToken
;
return
wxTokenDto
.
getAccessToken
()
;
}
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerMessagePushServiceImpl.java
View file @
36d4e1d
...
...
@@ -74,15 +74,15 @@ public class WeCustomerMessagePushServiceImpl implements IWeCustomerMessagePushS
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
addWeCustomerMessagePush
(
CustomerMessagePushDto
customerMessagePushDto
)
throws
JsonProcessingException
,
ParseException
{
//
if ((null != customerMessagePushDto.getSettingTime() && !"".equals(customerMessagePushDto.getSettingTime()))
//
&& DateUtils.diffTime(new Date(), DateUtil.parse(customerMessagePushDto.getSettingTime(), "yyyy-MM-dd HH:mm")) > 0) {
//
throw new WeComException("发送时间不能小于当前时间");
//
}
if
((
null
!=
customerMessagePushDto
.
getSettingTime
()
&&
!
""
.
equals
(
customerMessagePushDto
.
getSettingTime
()))
&&
DateUtils
.
diffTime
(
new
Date
(),
DateUtil
.
parse
(
customerMessagePushDto
.
getSettingTime
(),
"yyyy-MM-dd HH:mm"
))
>
0
)
{
throw
new
WeComException
(
"发送时间不能小于当前时间"
);
}
if
(
StrUtil
.
isBlank
(
customerMessagePushDto
.
getSettingTime
())){
/*
if(StrUtil.isBlank(customerMessagePushDto.getSettingTime())){
throw new WeComException("发送时间不能为空");
}
}
*/
List
<
WeCustomer
>
customers
=
Lists
.
newArrayList
();
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCustomerServiceImpl.java
View file @
36d4e1d
...
...
@@ -482,6 +482,8 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
//客户入库
WeCustomer
weCustomer
=
new
WeCustomer
();
BeanUtils
.
copyPropertiesASM
(
externalUserDetail
.
getExternal_contact
(),
weCustomer
);
weCustomer
.
setCreateTime
(
new
Date
());
weCustomer
.
setUpdateTime
(
new
Date
());
this
.
saveOrUpdate
(
weCustomer
);
//客户与通讯录客户关系
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeTaskFissionRewardServiceImpl.java
View file @
36d4e1d
...
...
@@ -106,27 +106,29 @@ public class WeTaskFissionRewardServiceImpl implements IWeTaskFissionRewardServi
}
@Override
public
WeTaskFissionRewardVo
getRewardByFissionId
(
String
fissionId
,
String
ei
d
)
{
public
WeTaskFissionRewardVo
getRewardByFissionId
(
String
fissionId
,
String
unionI
d
)
{
WeTaskFissionRewardVo
weTaskFissionRewardVo
=
new
WeTaskFissionRewardVo
();
WeCustomer
weCustomer
=
weCustomerService
.
getOne
(
new
LambdaQueryWrapper
<
WeCustomer
>().
eq
(
WeCustomer:
:
get
ExternalUserid
,
ei
d
));
String
externalUseriId
=
Optional
.
ofNullable
(
weCustomer
).
map
(
WeCustomer:
:
getExternalUser
id
)
WeCustomer
weCustomer
=
weCustomerService
.
getOne
(
new
LambdaQueryWrapper
<
WeCustomer
>().
eq
(
WeCustomer:
:
get
Unionid
,
unionI
d
));
String
customerUnionId
=
Optional
.
ofNullable
(
weCustomer
).
map
(
WeCustomer:
:
getUnion
id
)
.
orElseThrow
(()
->
new
WeComException
(
"用户信息不存在"
));
WeTaskFissionRecord
record
=
weTaskFissionRecordService
.
selectWeTaskFissionRecordByIdAndCustomerId
(
Long
.
valueOf
(
fissionId
),
externalUseriId
);
Date
completeTime
=
Optional
.
ofNullable
(
record
).
map
(
WeTaskFissionRecord:
:
getCompleteTime
)
.
orElseThrow
(()
->
new
WeComException
(
"任务信息不存在"
));
WeTaskFissionRecord
record
=
weTaskFissionRecordService
.
selectWeTaskFissionRecordByIdAndCustomerId
(
Long
.
valueOf
(
fissionId
),
customerUnionId
);
if
(
record
==
null
){
throw
new
WeComException
(
"任务信息不存在"
);
}
Date
completeTime
=
record
.
getCompleteTime
();
WeTaskFission
weTaskFission
=
weTaskFissionService
.
selectWeTaskFissionById
(
Long
.
valueOf
(
fissionId
));
Optional
.
ofNullable
(
weTaskFission
).
ifPresent
(
fission
->
{
weTaskFissionRewardVo
.
setRewardRule
(
fission
.
getRewardRule
());
weTaskFissionRewardVo
.
setRewardImageUrl
(
fission
.
getRewardImageUrl
());
weTaskFissionRewardVo
.
setRewardUrl
(
fission
.
getRewardUrl
());
});
if
(
completeTime
!=
null
)
{
Optional
.
ofNullable
(
weTaskFission
).
ifPresent
(
fission
->
{
weTaskFissionRewardVo
.
setRewardUrl
(
fission
.
getRewardUrl
());
weTaskFissionRewardVo
.
setRewardImageUrl
(
fission
.
getRewardImageUrl
());
});
WeTaskFissionReward
fissionReward
=
weTaskFissionRewardMapper
.
selectOne
(
new
LambdaQueryWrapper
<
WeTaskFissionReward
>()
.
eq
(
WeTaskFissionReward:
:
getTaskFissionId
,
fissionId
)
.
eq
(
WeTaskFissionReward:
:
getRewardUserId
,
externalUseri
Id
));
.
eq
(
WeTaskFissionReward:
:
getRewardUserId
,
customerUnion
Id
));
weTaskFissionRewardVo
.
setWeTaskFissionReward
(
fissionReward
);
//发放兑奖码之后,置为已使用
Optional
.
ofNullable
(
fissionReward
).
ifPresent
(
reward
->
weTaskFissionRewardMapper
.
update
(
reward
,
new
LambdaUpdateWrapper
<
WeTaskFissionReward
>()
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeTaskFissionServiceImpl.java
View file @
36d4e1d
...
...
@@ -153,6 +153,7 @@ public class WeTaskFissionServiceImpl implements IWeTaskFissionService {
int
updateResult
=
weTaskFissionMapper
.
updateWeTaskFission
(
weTaskFission
);
if
(
updateResult
>
0
)
{
if
(
CollectionUtils
.
isNotEmpty
(
weTaskFission
.
getTaskFissionStaffs
()))
{
log
.
info
(
"发起成员信息:【{}】"
,
JSONObject
.
toJSONString
(
weTaskFission
.
getTaskFissionStaffs
()));
List
<
WeTaskFissionStaff
>
staffList
=
weTaskFissionStaffService
.
selectWeTaskFissionStaffByTaskId
(
weTaskFission
.
getId
());
if
(
CollectionUtils
.
isNotEmpty
(
staffList
))
{
weTaskFissionStaffService
.
deleteWeTaskFissionStaffByIds
(
staffList
.
stream
().
map
(
WeTaskFissionStaff:
:
getId
).
toArray
(
Long
[]::
new
));
...
...
@@ -301,18 +302,18 @@ public class WeTaskFissionServiceImpl implements IWeTaskFissionService {
.
map
(
record
->
weCustomerService
.
selectWeCustomerById
(
record
.
getCustomerId
()))
.
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
toList
());
}
else
{
WeCustomer
weCustomer
=
weCustomerService
.
getOne
(
new
LambdaQueryWrapper
<
WeCustomer
>().
eq
(
WeCustomer:
:
getUnionid
,
unionId
));
String
uid
=
Optional
.
ofNullable
(
weCustomer
).
map
(
WeCustomer:
:
getUnionid
)
.
orElseThrow
(()
->
new
WeComException
(
"用户信息不存在"
));
weTaskFissionRecord
=
weTaskFissionRecordService
.
selectWeTaskFissionRecordByIdAndCustomerId
(
Long
.
valueOf
(
fissionId
),
uid
);
Optional
.
ofNullable
(
weTaskFissionRecord
).
map
(
WeTaskFissionRecord:
:
getId
)
.
orElseThrow
(()
->
new
WeComException
(
"任务记录信息不存在"
));
.
selectWeTaskFissionRecordByIdAndCustomerId
(
Long
.
valueOf
(
fissionId
),
unionId
);
Optional
.
ofNullable
(
weTaskFissionRecord
).
orElseThrow
(()
->
new
WeComException
(
"任务记录信息不存在"
));
List
<
WeFlowerCustomerRel
>
list
=
weFlowerCustomerRelService
.
list
(
new
LambdaQueryWrapper
<
WeFlowerCustomerRel
>()
.
eq
(
WeFlowerCustomerRel:
:
getState
,
WeConstans
.
FISSION_PREFIX
+
weTaskFissionRecord
.
getId
()));
List
<
String
>
eidList
=
Optional
.
ofNullable
(
list
).
orElseGet
(
ArrayList:
:
new
).
stream
()
.
map
(
WeFlowerCustomerRel:
:
getExternalUserid
).
collect
(
Collectors
.
toList
());
return
weCustomerService
.
listByIds
(
eidList
);
if
(
CollectionUtil
.
isNotEmpty
(
eidList
)){
return
weCustomerService
.
listByIds
(
eidList
);
}
else
{
return
null
;
}
}
}
...
...
@@ -430,7 +431,8 @@ public class WeTaskFissionServiceImpl implements IWeTaskFissionService {
WeTaskFissionRecord
record
=
WeTaskFissionRecord
.
builder
()
.
taskFissionId
(
taskFissionId
)
.
customerId
(
customerId
)
.
customerName
(
customerName
).
build
();
.
customerName
(
customerName
)
.
createTime
(
new
Date
()).
build
();
List
<
WeTaskFissionRecord
>
searchExists
=
weTaskFissionRecordService
.
selectWeTaskFissionRecordList
(
record
);
WeTaskFissionRecord
recordInfo
;
if
(
CollectionUtils
.
isNotEmpty
(
searchExists
))
{
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeTaskFissionStaffServiceImpl.java
View file @
36d4e1d
...
...
@@ -54,7 +54,7 @@ public class WeTaskFissionStaffServiceImpl implements IWeTaskFissionStaffService
@Override
public
int
insertWeTaskFissionStaffList
(
List
<
WeTaskFissionStaff
>
weTaskFissionStaffs
)
{
return
0
;
return
weTaskFissionStaffMapper
.
insertWeTaskFissionStaffList
(
weTaskFissionStaffs
)
;
}
/**
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/wxclient/WxAuthClient.java
View file @
36d4e1d
...
...
@@ -39,7 +39,7 @@ public interface WxAuthClient {
* @return
*/
@Request
(
url
=
"/oauth2/refresh_token"
,
type
=
"GET"
)
WxTokenDto
refreshToken
(
String
id
,
@Query
(
"appid"
)
String
appId
,
@Query
(
"grant_type"
)
String
grantType
,
WxTokenDto
refreshToken
(
@Query
(
"appid"
)
String
appId
,
@Query
(
"grant_type"
)
String
grantType
,
@Query
(
"refresh_token"
)
String
refreshToken
);
/**
...
...
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