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 9a844dc7
authored
Nov 17, 2021
by
danmo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复活码相关bug
1 parent
76676182
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
9 deletions
linkwe-framework/src/main/java/com/linkwechat/framework/listener/EmpleCodeExpiredListener.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeExternalContactClient.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/IWeQrScopeServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeEmpleCodeServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeQrCodeServiceImpl.java
linkwe-wecom/src/main/resources/mapper/wecom/WeQrCodeMapper.xml
linkwe-framework/src/main/java/com/linkwechat/framework/listener/EmpleCodeExpiredListener.java
View file @
9a844dc
...
@@ -28,7 +28,7 @@ public class EmpleCodeExpiredListener extends KeyExpirationEventMessageListener
...
@@ -28,7 +28,7 @@ public class EmpleCodeExpiredListener extends KeyExpirationEventMessageListener
public
void
onMessage
(
Message
message
,
byte
[]
pattern
)
{
public
void
onMessage
(
Message
message
,
byte
[]
pattern
)
{
System
.
out
.
println
(
"过期key:"
+
message
.
toString
());
System
.
out
.
println
(
"过期key:"
+
message
.
toString
());
if
(
message
.
toString
().
contains
(
WeConstans
.
WE_EMPLE_CODE_KEY
)){
if
(
message
.
toString
().
contains
(
WeConstans
.
WE_EMPLE_CODE_KEY
)){
weExternalContactClient
.
delContactWay
(
message
.
toString
().
split
(
":"
)[
1
]);
//
weExternalContactClient.delContactWay(message.toString().split(":")[1]);
}
}
}
}
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/client/WeExternalContactClient.java
View file @
9a844dc
...
@@ -24,7 +24,7 @@ public interface WeExternalContactClient {
...
@@ -24,7 +24,7 @@ public interface WeExternalContactClient {
WeExternalContactDto
updateContactWay
(
@JSONBody
WeExternalContactDto
.
WeContactWay
weContactWay
);
WeExternalContactDto
updateContactWay
(
@JSONBody
WeExternalContactDto
.
WeContactWay
weContactWay
);
@Request
(
url
=
"/externalcontact/del_contact_way"
,
type
=
"POST"
)
@Request
(
url
=
"/externalcontact/del_contact_way"
,
type
=
"POST"
)
WeExternalContactDto
delContactWay
(
@
Query
(
"configId"
)
String
configId
);
WeExternalContactDto
delContactWay
(
@
JSONBody
WeExternalContactDto
query
);
@Request
(
url
=
"/externalcontact/get_contact_way"
,
type
=
"POST"
)
@Request
(
url
=
"/externalcontact/get_contact_way"
,
type
=
"POST"
)
WeContactWayDto
getContactWay
(
@Query
(
"configId"
)
String
configId
);
WeContactWayDto
getContactWay
(
@Query
(
"configId"
)
String
configId
);
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/IWeQrScopeServiceImpl.java
View file @
9a844dc
...
@@ -48,7 +48,9 @@ public class IWeQrScopeServiceImpl extends ServiceImpl<WeQrScopeMapper, WeQrScop
...
@@ -48,7 +48,9 @@ public class IWeQrScopeServiceImpl extends ServiceImpl<WeQrScopeMapper, WeQrScop
weQrScope
.
setScopeId
(
uuId
);
weQrScope
.
setScopeId
(
uuId
);
weQrScope
.
setUserId
(
userId
);
weQrScope
.
setUserId
(
userId
);
weQrScope
.
setScopeType
(
1
);
weQrScope
.
setScopeType
(
1
);
if
(
CollectionUtil
.
isNotEmpty
(
userInfo
.
getWorkCycle
())){
weQrScope
.
setWorkCycle
(
userInfo
.
getWorkCycle
().
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
weQrScope
.
setWorkCycle
(
userInfo
.
getWorkCycle
().
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
}
weQrScope
.
setBeginTime
(
userInfo
.
getBeginTime
());
weQrScope
.
setBeginTime
(
userInfo
.
getBeginTime
());
weQrScope
.
setEndTime
(
userInfo
.
getEndTime
());
weQrScope
.
setEndTime
(
userInfo
.
getEndTime
());
return
weQrScope
;
return
weQrScope
;
...
@@ -61,7 +63,9 @@ public class IWeQrScopeServiceImpl extends ServiceImpl<WeQrScopeMapper, WeQrScop
...
@@ -61,7 +63,9 @@ public class IWeQrScopeServiceImpl extends ServiceImpl<WeQrScopeMapper, WeQrScop
weQrScope
.
setScopeId
(
uuId
);
weQrScope
.
setScopeId
(
uuId
);
weQrScope
.
setParty
(
String
.
valueOf
(
party
));
weQrScope
.
setParty
(
String
.
valueOf
(
party
));
weQrScope
.
setScopeType
(
2
);
weQrScope
.
setScopeType
(
2
);
if
(
CollectionUtil
.
isNotEmpty
(
userInfo
.
getWorkCycle
())){
weQrScope
.
setWorkCycle
(
userInfo
.
getWorkCycle
().
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
weQrScope
.
setWorkCycle
(
userInfo
.
getWorkCycle
().
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
}
weQrScope
.
setBeginTime
(
userInfo
.
getBeginTime
());
weQrScope
.
setBeginTime
(
userInfo
.
getBeginTime
());
weQrScope
.
setEndTime
(
userInfo
.
getEndTime
());
weQrScope
.
setEndTime
(
userInfo
.
getEndTime
());
return
weQrScope
;
return
weQrScope
;
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeEmpleCodeServiceImpl.java
View file @
9a844dc
...
@@ -241,7 +241,9 @@ public class WeEmpleCodeServiceImpl extends ServiceImpl<WeEmpleCodeMapper, WeEmp
...
@@ -241,7 +241,9 @@ public class WeEmpleCodeServiceImpl extends ServiceImpl<WeEmpleCodeMapper, WeEmp
public
int
deleteWeEmpleCodeById
(
Long
id
)
{
public
int
deleteWeEmpleCodeById
(
Long
id
)
{
WeEmpleCode
weEmpleCode
=
getById
(
id
);
WeEmpleCode
weEmpleCode
=
getById
(
id
);
if
(
weEmpleCode
!=
null
&&
weEmpleCode
.
getConfigId
()
!=
null
)
{
if
(
weEmpleCode
!=
null
&&
weEmpleCode
.
getConfigId
()
!=
null
)
{
weExternalContactClient
.
delContactWay
(
weEmpleCode
.
getConfigId
());
WeExternalContactDto
externalContactDto
=
new
WeExternalContactDto
();
externalContactDto
.
setConfig_id
(
weEmpleCode
.
getConfigId
());
weExternalContactClient
.
delContactWay
(
externalContactDto
);
}
}
// 删除对应的新科拉群信息
// 删除对应的新科拉群信息
communityNewGroupMapper
.
removeWeCommunityNewGroupByEmplCodeId
(
id
);
communityNewGroupMapper
.
removeWeCommunityNewGroupByEmplCodeId
(
id
);
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeQrCodeServiceImpl.java
View file @
9a844dc
...
@@ -108,7 +108,15 @@ public class WeQrCodeServiceImpl extends ServiceImpl<WeQrCodeMapper, WeQrCode> i
...
@@ -108,7 +108,15 @@ public class WeQrCodeServiceImpl extends ServiceImpl<WeQrCodeMapper, WeQrCode> i
@Override
@Override
public
List
<
WeQrCodeDetailVo
>
getQrDetailByQrIds
(
List
<
Long
>
qrIds
)
{
public
List
<
WeQrCodeDetailVo
>
getQrDetailByQrIds
(
List
<
Long
>
qrIds
)
{
return
this
.
baseMapper
.
getQrDetailByQrIds
(
qrIds
);
List
<
WeQrCodeDetailVo
>
qrDetailByQrIds
=
this
.
baseMapper
.
getQrDetailByQrIds
(
qrIds
);
List
<
WeQrScopeVo
>
weQrScopeVoList
=
scopeService
.
getWeQrScopeByQrIds
(
qrIds
);
Map
<
Long
,
List
<
WeQrScopeVo
>>
weQrScopeMap
=
Optional
.
ofNullable
(
weQrScopeVoList
).
orElseGet
(
ArrayList:
:
new
).
stream
().
collect
(
Collectors
.
groupingBy
(
WeQrScopeVo:
:
getQrId
));
for
(
WeQrCodeDetailVo
qrCodeDetail:
qrDetailByQrIds
)
{
if
(
weQrScopeMap
.
get
(
qrCodeDetail
.
getId
())
!=
null
){
qrCodeDetail
.
setQrUserInfos
(
weQrScopeMap
.
get
(
qrCodeDetail
.
getId
()));
}
}
return
qrDetailByQrIds
;
}
}
@Override
@Override
...
@@ -151,7 +159,9 @@ public class WeQrCodeServiceImpl extends ServiceImpl<WeQrCodeMapper, WeQrCode> i
...
@@ -151,7 +159,9 @@ public class WeQrCodeServiceImpl extends ServiceImpl<WeQrCodeMapper, WeQrCode> i
//异步删除企微活码---最好使用mq
//异步删除企微活码---最好使用mq
ThreadUtil
.
execute
(()
->
weQrCodes
.
forEach
(
item
->
{
ThreadUtil
.
execute
(()
->
weQrCodes
.
forEach
(
item
->
{
if
(
StringUtils
.
isNotEmpty
(
item
.
getConfigId
()))
{
if
(
StringUtils
.
isNotEmpty
(
item
.
getConfigId
()))
{
externalContactClient
.
delContactWay
(
item
.
getConfigId
());
WeExternalContactDto
externalContactDto
=
new
WeExternalContactDto
();
externalContactDto
.
setConfig_id
(
item
.
getConfigId
());
externalContactClient
.
delContactWay
(
externalContactDto
);
}
}
}));
}));
}
}
...
@@ -203,10 +213,10 @@ public class WeQrCodeServiceImpl extends ServiceImpl<WeQrCodeMapper, WeQrCode> i
...
@@ -203,10 +213,10 @@ public class WeQrCodeServiceImpl extends ServiceImpl<WeQrCodeMapper, WeQrCode> i
long
userSum
=
qrUserInfoList
.
get
(
i
).
getUserIds
().
stream
()
long
userSum
=
qrUserInfoList
.
get
(
i
).
getUserIds
().
stream
()
.
filter
(
one
->
qrUserInfoList
.
get
(
finalJ
).
getUserIds
().
stream
()
.
filter
(
one
->
qrUserInfoList
.
get
(
finalJ
).
getUserIds
().
stream
()
.
anyMatch
(
two
->
ObjectUtil
.
equal
(
two
,
one
))).
count
();
.
anyMatch
(
two
->
ObjectUtil
.
equal
(
two
,
one
))).
count
();
long
partySum
=
qrUserInfoList
.
get
(
i
).
getPartys
().
stream
()
/*
long partySum = qrUserInfoList.get(i).getPartys().stream()
.filter(one -> qrUserInfoList.get(finalJ).getPartys().stream()
.filter(one -> qrUserInfoList.get(finalJ).getPartys().stream()
.
anyMatch
(
two
->
ObjectUtil
.
equal
(
two
,
one
))).
count
();
.anyMatch(two -> ObjectUtil.equal(two, one))).count();
*/
if
(
userSum
>
0
||
partySum
>
0
)
{
if
(
userSum
>
0
/*|| partySum > 0*/
)
{
long
workCycleSum
=
qrUserInfoList
.
get
(
i
).
getWorkCycle
().
stream
()
long
workCycleSum
=
qrUserInfoList
.
get
(
i
).
getWorkCycle
().
stream
()
.
filter
(
one
->
qrUserInfoList
.
get
(
finalJ
).
getWorkCycle
().
stream
()
.
filter
(
one
->
qrUserInfoList
.
get
(
finalJ
).
getWorkCycle
().
stream
()
.
anyMatch
(
two
->
ObjectUtil
.
equal
(
two
,
one
))).
count
();
.
anyMatch
(
two
->
ObjectUtil
.
equal
(
two
,
one
))).
count
();
...
...
linkwe-wecom/src/main/resources/mapper/wecom/WeQrCodeMapper.xml
View file @
9a844dc
...
@@ -24,14 +24,17 @@
...
@@ -24,14 +24,17 @@
<result
property=
"id"
column=
"id"
jdbcType=
"INTEGER"
/>
<result
property=
"id"
column=
"id"
jdbcType=
"INTEGER"
/>
<result
property=
"name"
column=
"name"
jdbcType=
"VARCHAR"
/>
<result
property=
"name"
column=
"name"
jdbcType=
"VARCHAR"
/>
<result
property=
"groupId"
column=
"group_id"
jdbcType=
"INTEGER"
/>
<result
property=
"groupId"
column=
"group_id"
jdbcType=
"INTEGER"
/>
<result
property=
"qrGroupName"
column=
"group_name"
jdbcType=
"INTEGER"
/>
<result
property=
"autoAdd"
column=
"auto_add"
jdbcType=
"INTEGER"
/>
<result
property=
"autoAdd"
column=
"auto_add"
jdbcType=
"INTEGER"
/>
<result
property=
"type"
column=
"type"
jdbcType=
"INTEGER"
/>
<result
property=
"type"
column=
"type"
jdbcType=
"INTEGER"
/>
<result
property=
"ruleType"
column=
"rule_type"
jdbcType=
"INTEGER"
/>
<result
property=
"ruleType"
column=
"rule_type"
jdbcType=
"INTEGER"
/>
<result
property=
"state"
column=
"state"
jdbcType=
"VARCHAR"
/>
<result
property=
"state"
column=
"state"
jdbcType=
"VARCHAR"
/>
<result
property=
"configId"
column=
"config_id"
jdbcType=
"VARCHAR"
/>
<result
property=
"configId"
column=
"config_id"
jdbcType=
"VARCHAR"
/>
<result
property=
"qrCode"
column=
"qr_code"
jdbcType=
"VARCHAR"
/>
<result
property=
"qrCode"
column=
"qr_code"
jdbcType=
"VARCHAR"
/>
<result
property=
"updateTime"
column=
"update_time"
jdbcType=
"TIMESTAMP"
/>
<collection
property=
"qrTags"
ofType=
"com.linkwechat.wecom.domain.vo.tag.WeTagVo"
>
<collection
property=
"qrTags"
ofType=
"com.linkwechat.wecom.domain.vo.tag.WeTagVo"
>
<result
property=
"tagId"
column=
"tag_id"
jdbcType=
"INTEGER"
/>
<result
property=
"tagId"
column=
"tag_id"
jdbcType=
"INTEGER"
/>
<result
property=
"tagName"
column=
"tag_name"
jdbcType=
"VARCHAR"
/>
</collection>
</collection>
<collection
property=
"qrAttachments"
ofType=
"com.linkwechat.wecom.domain.WeQrAttachments"
>
<collection
property=
"qrAttachments"
ofType=
"com.linkwechat.wecom.domain.WeQrAttachments"
>
<result
property=
"msgType"
column=
"msg_type"
jdbcType=
"VARCHAR"
/>
<result
property=
"msgType"
column=
"msg_type"
jdbcType=
"VARCHAR"
/>
...
@@ -63,6 +66,7 @@
...
@@ -63,6 +66,7 @@
wqc.scan_num,
wqc.scan_num,
wqc.config_id,
wqc.config_id,
wqc.qr_code,
wqc.qr_code,
wqc.update_time,
wqtr.tag_id,
wqtr.tag_id,
(select name from we_tag wt where wt.tag_id = wqtr.tag_id limit 1) as tag_name,
(select name from we_tag wt where wt.tag_id = wqtr.tag_id limit 1) as tag_name,
wqa.msg_type,
wqa.msg_type,
...
@@ -108,7 +112,7 @@
...
@@ -108,7 +112,7 @@
left join we_qr_attachments wqa on wqa.qr_id = wqc.id and wqs.del_flag = 0
left join we_qr_attachments wqa on wqa.qr_id = wqc.id and wqs.del_flag = 0
where 1=1
where 1=1
<if
test=
"groupId != null and groupId != ''"
>
<if
test=
"groupId != null and groupId != ''"
>
and wqc.group_id =
groupId
and wqc.group_id =
#{groupId}
</if>
</if>
<if
test=
"qrName != null and qrName != ''"
>
<if
test=
"qrName != null and qrName != ''"
>
and wqc.name like concat('%', #{qrName}, '%')
and wqc.name like concat('%', #{qrName}, '%')
...
...
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