liupeng 4 yıl önce
ebeveyn
işleme
32aaef9115

+ 10 - 7
code/sapparent/sapservice/src/main/java/org/fouram/service/SapUserService.java

@@ -44,7 +44,6 @@ public class SapUserService extends BaseService {
 	@Autowired
 	@Autowired
 	private SapBlacklistService sapBlacklistService;
 	private SapBlacklistService sapBlacklistService;
 
 
-	private static boolean isTestWXSync = false;
 	private static boolean isTestMobile = true;
 	private static boolean isTestMobile = true;
 
 
 	public void saveOrUpdateSapUsers() throws Exception {
 	public void saveOrUpdateSapUsers() throws Exception {
@@ -151,12 +150,17 @@ public class SapUserService extends BaseService {
 	}
 	}
 
 
 	private String createOrUpdateWXUser(String personId) throws Exception {
 	private String createOrUpdateWXUser(String personId) throws Exception {
-		// 测试
-		if (isTestWXSync) {
-			return "TEST-" + SapUserResultEnum.SUCCESS.getCode();
-		}
 		List<SapUser> sapUsers = selectListByPersonId(personId);
 		List<SapUser> sapUsers = selectListByPersonId(personId);
 		SapUser wxSapUser = sapUsers.get(0);
 		SapUser wxSapUser = sapUsers.get(0);
+		String mobile = wxSapUser.getFormatBusinessPhone();
+		// 手机号码脱敏
+		if (isTestMobile) {
+			if (StringUtils.isNotBlank(mobile) && mobile.length() == 11) {
+				mobile = mobile.substring(0, 8) + "999";
+			} else {
+				mobile = "";
+			}
+		}
 		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()];
@@ -174,8 +178,7 @@ public class SapUserService extends BaseService {
 		}
 		}
 		return WXCpUserUtil.createOrUpdate(personId, wxSapUser.getName(), firstWxDepartIdList, secondWxDepartIdList,
 		return WXCpUserUtil.createOrUpdate(personId, wxSapUser.getName(), firstWxDepartIdList, secondWxDepartIdList,
 				thirdWxDepartIdList, fourthWxDepartIdList, wxSapUser.getFormatPosition(), wxSapUser.getFormatMobile(),
 				thirdWxDepartIdList, fourthWxDepartIdList, wxSapUser.getFormatPosition(), wxSapUser.getFormatMobile(),
-				wxSapUser.getGender(), wxSapUser.getUsername(), wxSapUser.getFormatBusinessPhone(),
-				wxSapUser.getFirstOrgName());
+				wxSapUser.getGender(), wxSapUser.getUsername(), mobile, wxSapUser.getFirstOrgName());
 	}
 	}
 
 
 	/**
 	/**