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 adbcb5ab
authored
Nov 29, 2021
by
danmo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改活码刷新定时任务
1 parent
f5bdcca2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
36 deletions
linkwe-quartz/src/main/java/com/linkwechat/quartz/task/WeQrCodeUpdateTask.java
linkwe-wecom/src/main/resources/mapper/wecom/WeQrScopeMapper.xml
linkwe-quartz/src/main/java/com/linkwechat/quartz/task/WeQrCodeUpdateTask.java
View file @
adbcb5a
...
@@ -49,44 +49,53 @@ public class WeQrCodeUpdateTask {
...
@@ -49,44 +49,53 @@ public class WeQrCodeUpdateTask {
List
<
WeQrScopeVo
>
weQrScopeList
=
weQrScopeService
.
getWeQrScopeByTime
(
week
.
getValue
(),
formatTime
);
List
<
WeQrScopeVo
>
weQrScopeList
=
weQrScopeService
.
getWeQrScopeByTime
(
week
.
getValue
(),
formatTime
);
if
(
CollectionUtil
.
isNotEmpty
(
weQrScopeList
))
{
if
(
CollectionUtil
.
isNotEmpty
(
weQrScopeList
))
{
for
(
WeQrScopeVo
weQrScope
:
weQrScopeList
)
{
List
<
WeQrScopeVo
>
weCustomizeQrScopeList
=
weQrScopeList
.
stream
().
filter
(
item
->
ObjectUtil
.
equal
(
1
,
item
.
getType
())).
collect
(
Collectors
.
toList
());
WeQrCode
weQrCode
=
weQrCodeService
.
getById
(
weQrScope
.
getQrId
());
if
(
CollectionUtil
.
isNotEmpty
(
weCustomizeQrScopeList
))
{
String
configId
=
weQrCode
.
getConfigId
();
weCustomizeQrScopeList
.
forEach
(
this
::
extracted
);
WeContactWayDto
contactWay
=
externalContactClient
.
getContactWay
(
configId
);
}
else
{
if
(
contactWay
!=
null
&&
ObjectUtil
.
equal
(
0
,
contactWay
.
getErrcode
()))
{
WeQrScopeVo
weDefaultQrScope
=
weQrScopeList
.
stream
().
filter
(
item
->
ObjectUtil
.
equal
(
0
,
item
.
getType
())).
findFirst
().
orElse
(
null
);
String
userIds
=
""
;
if
(
weDefaultQrScope
!=
null
)
{
String
partys
=
""
;
extracted
(
weDefaultQrScope
);
String
qrUserIds
=
""
;
String
qrPartys
=
""
;
if
(
CollectionUtil
.
isNotEmpty
(
contactWay
.
getContactWay
().
getUser
()))
{
userIds
=
String
.
join
(
","
,
contactWay
.
getContactWay
().
getUser
());
}
if
(
CollectionUtil
.
isNotEmpty
(
contactWay
.
getContactWay
().
getParty
()))
{
partys
=
contactWay
.
getContactWay
().
getParty
().
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
));
}
if
(
CollectionUtil
.
isNotEmpty
(
weQrScope
.
getWeQrUserList
()))
{
qrUserIds
=
weQrScope
.
getWeQrUserList
().
stream
().
map
(
WeQrScopeUserVo:
:
getUserId
).
collect
(
Collectors
.
joining
(
","
));
}
if
(
CollectionUtil
.
isNotEmpty
(
weQrScope
.
getWeQrPartyList
()))
{
qrPartys
=
weQrScope
.
getWeQrPartyList
().
stream
().
map
(
WeQrScopePartyVo:
:
getParty
).
collect
(
Collectors
.
joining
(
","
));
}
if
(!
ObjectUtil
.
equal
(
qrUserIds
,
userIds
)
||
!
ObjectUtil
.
equal
(
qrPartys
,
partys
))
{
WeExternalContactDto
.
WeContactWay
weContactWay
=
new
WeExternalContactDto
.
WeContactWay
();
weContactWay
.
setConfig_id
(
configId
);
if
(
StringUtils
.
isNotEmpty
(
qrUserIds
))
{
weContactWay
.
setUser
(
qrUserIds
.
split
(
","
));
}
if
(
StringUtils
.
isNotEmpty
(
qrPartys
))
{
Long
[]
qrPartyList
=
Arrays
.
stream
(
qrPartys
.
split
(
","
))
.
map
(
s
->
Long
.
parseLong
(
s
.
trim
())).
toArray
(
Long
[]::
new
);
weContactWay
.
setParty
(
qrPartyList
);
}
externalContactClient
.
updateContactWay
(
weContactWay
);
}
}
}
}
}
}
}
private
void
extracted
(
WeQrScopeVo
weQrScope
)
{
WeQrCode
weQrCode
=
weQrCodeService
.
getById
(
weQrScope
.
getQrId
());
String
configId
=
weQrCode
.
getConfigId
();
WeContactWayDto
contactWay
=
externalContactClient
.
getContactWay
(
configId
);
if
(
contactWay
!=
null
&&
ObjectUtil
.
equal
(
0
,
contactWay
.
getErrcode
()))
{
String
userIds
=
""
;
String
partys
=
""
;
String
qrUserIds
=
""
;
String
qrPartys
=
""
;
if
(
CollectionUtil
.
isNotEmpty
(
contactWay
.
getContactWay
().
getUser
()))
{
userIds
=
String
.
join
(
","
,
contactWay
.
getContactWay
().
getUser
());
}
if
(
CollectionUtil
.
isNotEmpty
(
contactWay
.
getContactWay
().
getParty
()))
{
partys
=
contactWay
.
getContactWay
().
getParty
().
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
));
}
if
(
CollectionUtil
.
isNotEmpty
(
weQrScope
.
getWeQrUserList
()))
{
qrUserIds
=
weQrScope
.
getWeQrUserList
().
stream
().
map
(
WeQrScopeUserVo:
:
getUserId
).
collect
(
Collectors
.
joining
(
","
));
}
if
(
CollectionUtil
.
isNotEmpty
(
weQrScope
.
getWeQrPartyList
()))
{
qrPartys
=
weQrScope
.
getWeQrPartyList
().
stream
().
map
(
WeQrScopePartyVo:
:
getParty
).
collect
(
Collectors
.
joining
(
","
));
}
if
(!
ObjectUtil
.
equal
(
qrUserIds
,
userIds
)
||
!
ObjectUtil
.
equal
(
qrPartys
,
partys
))
{
WeExternalContactDto
.
WeContactWay
weContactWay
=
new
WeExternalContactDto
.
WeContactWay
();
weContactWay
.
setConfig_id
(
configId
);
if
(
StringUtils
.
isNotEmpty
(
qrUserIds
))
{
weContactWay
.
setUser
(
qrUserIds
.
split
(
","
));
}
if
(
StringUtils
.
isNotEmpty
(
qrPartys
))
{
Long
[]
qrPartyList
=
Arrays
.
stream
(
qrPartys
.
split
(
","
))
.
map
(
s
->
Long
.
parseLong
(
s
.
trim
())).
toArray
(
Long
[]::
new
);
weContactWay
.
setParty
(
qrPartyList
);
}
externalContactClient
.
updateContactWay
(
weContactWay
);
}
}
}
}
}
}
}
linkwe-wecom/src/main/resources/mapper/wecom/WeQrScopeMapper.xml
View file @
adbcb5a
...
@@ -79,7 +79,7 @@
...
@@ -79,7 +79,7 @@
where find_in_set(#{value},wqs.work_cycle)
where find_in_set(#{value},wqs.work_cycle)
and str_to_date(wqs.begin_time,'%H:%i:%S')
<
= str_to_date(#{formatTime},'%H:%i:%S')
and str_to_date(wqs.begin_time,'%H:%i:%S')
<
= str_to_date(#{formatTime},'%H:%i:%S')
and str_to_date(wqs.end_time ,'%H:%i:%S')
>
= str_to_date(#{formatTime},'%H:%i:%S')
and str_to_date(wqs.end_time ,'%H:%i:%S')
>
= str_to_date(#{formatTime},'%H:%i:%S')
and wqs.`type` = 1
/*and wqs.`type` = 1*/
and wqs.del_flag = 0
and wqs.del_flag = 0
</select>
</select>
</mapper>
</mapper>
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