|
|
@@ -56,38 +56,39 @@ public class CorpCustomerAcquistionServiceImpl implements CorpCustomerAcquistion
|
|
|
if (corpCustomerAcquisitionLink == null) {
|
|
|
throw BusinessRuntimeException.getInstance("获客链接不存在.");
|
|
|
}
|
|
|
- List<String> dutyServices = sysConfigService.getDutyServices();
|
|
|
- //值班
|
|
|
- if (CollUtil.isNotEmpty(dutyServices)) {
|
|
|
- String userList = corpCustomerAcquisitionLink.getUserList();
|
|
|
+ String userList = corpCustomerAcquisitionLink.getUserList();
|
|
|
|
|
|
- List<String> users = Jsons.parseList(userList, String.class);
|
|
|
+ List<String> users = Jsons.parseList(userList, String.class);
|
|
|
+ if (users.size() > 1) {
|
|
|
+ List<String> dutyServices = sysConfigService.getDutyServices();
|
|
|
+ //值班
|
|
|
+ if (CollUtil.isNotEmpty(dutyServices)) {
|
|
|
|
|
|
- String chooseDutyUsers = corpCustomerAcquisitionLink.getChooseDutyUsers();
|
|
|
- if (chooseDutyUsers == null) {
|
|
|
- chooseDutyUsers = userList;
|
|
|
- }
|
|
|
- List<String> chooseUserList = Jsons.parseList(chooseDutyUsers, String.class);
|
|
|
+ String chooseDutyUsers = corpCustomerAcquisitionLink.getChooseDutyUsers();
|
|
|
+ if (chooseDutyUsers == null) {
|
|
|
+ chooseDutyUsers = userList;
|
|
|
+ }
|
|
|
+ List<String> chooseUserList = Jsons.parseList(chooseDutyUsers, String.class);
|
|
|
|
|
|
- Set<String> fitUsers = dutyServices.stream().filter(e -> users.contains(e)).collect(Collectors.toSet());
|
|
|
- if (CollUtil.isNotEmpty(fitUsers) && (fitUsers.size() != chooseUserList.size() || !chooseUserList.containsAll(fitUsers))) {
|
|
|
+ Set<String> fitUsers = dutyServices.stream().filter(e -> users.contains(e)).collect(Collectors.toSet());
|
|
|
+ if (CollUtil.isNotEmpty(fitUsers) && (fitUsers.size() != chooseUserList.size() || !chooseUserList.containsAll(fitUsers))) {
|
|
|
|
|
|
- corpCustomerAcquisitionLink.setChooseDutyUsers(Jsons.toJson(fitUsers));
|
|
|
+ corpCustomerAcquisitionLink.setChooseDutyUsers(Jsons.toJson(fitUsers));
|
|
|
|
|
|
- //更新获客链接
|
|
|
- WxCpLinkUpd wxCpLinkUpd = new WxCpLinkUpd();
|
|
|
- wxCpLinkUpd.setLinkName(corpCustomerAcquisitionLink.getLinkName());
|
|
|
- wxCpLinkUpd.setLinkId(corpCustomerAcquisitionLink.getLinkId());
|
|
|
- wxCpLinkUpd.setSkipVerify(corpCustomerAcquisitionLink.getSkipVerify());
|
|
|
- Range range = new Range();
|
|
|
- range.setUserList(JSONUtil.parseArray(corpCustomerAcquisitionLink.getChooseDutyUsers()).toList(String.class));
|
|
|
- wxCpLinkUpd.setRange(range);
|
|
|
+ //更新获客链接
|
|
|
+ WxCpLinkUpd wxCpLinkUpd = new WxCpLinkUpd();
|
|
|
+ wxCpLinkUpd.setLinkName(corpCustomerAcquisitionLink.getLinkName());
|
|
|
+ wxCpLinkUpd.setLinkId(corpCustomerAcquisitionLink.getLinkId());
|
|
|
+ wxCpLinkUpd.setSkipVerify(corpCustomerAcquisitionLink.getSkipVerify());
|
|
|
+ Range range = new Range();
|
|
|
+ range.setUserList(JSONUtil.parseArray(corpCustomerAcquisitionLink.getChooseDutyUsers()).toList(String.class));
|
|
|
+ wxCpLinkUpd.setRange(range);
|
|
|
|
|
|
- corpOps.customerAcquisitionUpdateLink(null, wxCpLinkUpd);
|
|
|
- }
|
|
|
+ corpOps.customerAcquisitionUpdateLink(null, wxCpLinkUpd);
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
return corpCustomerAcquisitionLink.getUrl();
|
|
|
}
|
|
|
|