|
@@ -3,6 +3,7 @@ package org.fouram.service;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.Iterator;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.fouram.constants.WebConstants;
|
|
import org.fouram.constants.WebConstants;
|
|
@@ -195,32 +196,34 @@ public class SapUserService extends BaseService {
|
|
private String createOrUpdateWXUser(String personId) throws Exception {
|
|
private String createOrUpdateWXUser(String personId) throws Exception {
|
|
List<SapUser> sapUsers = selectListByPersonId(personId);
|
|
List<SapUser> sapUsers = selectListByPersonId(personId);
|
|
SapUser primarySapUser = sapUsers.get(0);
|
|
SapUser primarySapUser = sapUsers.get(0);
|
|
- String mobile = primarySapUser.getFormatBusinessPhone();
|
|
|
|
|
|
+ String formatMobile = primarySapUser.getFormatMobile();
|
|
// 测试企业微信,手机号码脱敏
|
|
// 测试企业微信,手机号码脱敏
|
|
// fouram wxCp.corpId = ww51602aeb8dab7a95
|
|
// fouram wxCp.corpId = ww51602aeb8dab7a95
|
|
// prod wxCp.corpId = ww911e29458d3a46fd
|
|
// prod wxCp.corpId = ww911e29458d3a46fd
|
|
if (!ConfConfig.getConfigString("wxCp.corpId").equals("ww911e29458d3a46fd")) {
|
|
if (!ConfConfig.getConfigString("wxCp.corpId").equals("ww911e29458d3a46fd")) {
|
|
- if (StringUtils.isNotBlank(mobile) && mobile.length() == 11) {
|
|
|
|
- mobile = mobile.substring(0, 8) + "999";
|
|
|
|
|
|
+ if (StringUtils.isNotBlank(formatMobile) && formatMobile.length() == 11) {
|
|
|
|
+ formatMobile = formatMobile.substring(0, 8) + "999";
|
|
} else {
|
|
} else {
|
|
- mobile = "";
|
|
|
|
|
|
+ formatMobile = "";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
Long[] firstWxDepartIdList = new Long[sapUsers.size()];
|
|
Long[] firstWxDepartIdList = new Long[sapUsers.size()];
|
|
Long[] secondWxDepartIdList = new Long[sapUsers.size()];
|
|
Long[] secondWxDepartIdList = new Long[sapUsers.size()];
|
|
Long[] thirdWxDepartIdList = new Long[sapUsers.size()];
|
|
Long[] thirdWxDepartIdList = new Long[sapUsers.size()];
|
|
Long[] fourthWxDepartIdList = new Long[sapUsers.size()];
|
|
Long[] fourthWxDepartIdList = new Long[sapUsers.size()];
|
|
for (int i = 0; i < sapUsers.size(); i++) {
|
|
for (int i = 0; i < sapUsers.size(); i++) {
|
|
SapUser sapUser = sapUsers.get(i);
|
|
SapUser sapUser = sapUsers.get(i);
|
|
- firstWxDepartIdList[i] = sapUser.getFirstWxDepartId();
|
|
|
|
- secondWxDepartIdList[i] = sapUser.getSecondWxDepartId();
|
|
|
|
- thirdWxDepartIdList[i] = sapUser.getThirdWxDepartId();
|
|
|
|
- fourthWxDepartIdList[i] = sapUser.getFourthWxDepartId();
|
|
|
|
|
|
+ Map<String, Long> map = sapOrgService.updateWxDepartId(sapUser);
|
|
|
|
+ firstWxDepartIdList[i] = map.get(sapUser.getFirstOrgId());
|
|
|
|
+ secondWxDepartIdList[i] = map.get(sapUser.getSecondOrgId());
|
|
|
|
+ thirdWxDepartIdList[i] = map.get(sapUser.getThirdOrgId());
|
|
|
|
+ fourthWxDepartIdList[i] = map.get(sapUser.getFourthOrgId());
|
|
}
|
|
}
|
|
return WXCpUserUtil.createOrUpdate(personId, primarySapUser.getName(), firstWxDepartIdList,
|
|
return WXCpUserUtil.createOrUpdate(personId, primarySapUser.getName(), firstWxDepartIdList,
|
|
secondWxDepartIdList, thirdWxDepartIdList, fourthWxDepartIdList, primarySapUser.getFormatPosition(),
|
|
secondWxDepartIdList, thirdWxDepartIdList, fourthWxDepartIdList, primarySapUser.getFormatPosition(),
|
|
- primarySapUser.getFormatMobile(), primarySapUser.getGender(), primarySapUser.getUsername(), mobile,
|
|
|
|
- primarySapUser.getFirstOrgName());
|
|
|
|
|
|
+ formatMobile, primarySapUser.getGender(), primarySapUser.getUsername(),
|
|
|
|
+ primarySapUser.getFormatBusinessPhone(), primarySapUser.getFirstOrgName());
|
|
}
|
|
}
|
|
|
|
|
|
public SapUser selectByUserId(String userId) throws Exception {
|
|
public SapUser selectByUserId(String userId) throws Exception {
|
|
@@ -331,7 +334,7 @@ public class SapUserService extends BaseService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public void updateResultByUserId(String result, String userId) throws Exception {
|
|
public void updateResultByUserId(String result, String userId) throws Exception {
|
|
SapUser sapUser = SapUser.builder().userId(userId).result(result).build();
|
|
SapUser sapUser = SapUser.builder().userId(userId).result(result).build();
|
|
update("SapUserMapper.updateResultByUserId", sapUser);
|
|
update("SapUserMapper.updateResultByUserId", sapUser);
|