|
@@ -100,12 +100,36 @@ public class SapUserService extends BaseService {
|
|
this.updateSapUser(sapUser);
|
|
this.updateSapUser(sapUser);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // 验证sap是否为垃圾数据
|
|
|
|
+ sapUserDb = this.selectByUserId(sapUser.getUserId());
|
|
|
|
+ String checkResult = checkUserGarbageOrBlacklist(sapUserDb);
|
|
|
|
+ if (StringUtils.isNotBlank(checkResult)) {
|
|
|
|
+ updateResultByUserId(checkResult, sapUserDb.getUserId());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// 更新所有无效数据为LEAVE
|
|
// 更新所有无效数据为LEAVE
|
|
this.updateResultByDelFlag(SapUserResultEnum.LEAVE, DelFlagEnum.UNABLE);
|
|
this.updateResultByDelFlag(SapUserResultEnum.LEAVE, DelFlagEnum.UNABLE);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * 判断是不是垃圾数据或者黑名单
|
|
|
|
+ *
|
|
|
|
+ * @param sapUser
|
|
|
|
+ * @return
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ public String checkUserGarbageOrBlacklist(SapUser sapUser) throws Exception {
|
|
|
|
+ if (Tools.isEmpty(sapUser.getPersonId()) || Tools.isEmpty(sapUser.getFirstOrgName())
|
|
|
|
+ || WebConstants.INGORE_PERSONIDS.contains("," + sapUser.getPersonId() + ",")) {
|
|
|
|
+ return SapUserResultEnum.GARBAGE.getCode();
|
|
|
|
+ } else if (sapBlacklistService.findByUserId(sapUser.getPersonId()) != null) {
|
|
|
|
+ return SapUserResultEnum.BLACKLIST.getCode();
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
* 更新异常情况,敏感数据、入职
|
|
* 更新异常情况,敏感数据、入职
|
|
*
|
|
*
|
|
* @throws Exception
|
|
* @throws Exception
|
|
@@ -116,8 +140,7 @@ public class SapUserService extends BaseService {
|
|
for (SapUser sapUser : normalList) {
|
|
for (SapUser sapUser : normalList) {
|
|
resultEnum = checkSensitiveOrEntryData(sapUser);
|
|
resultEnum = checkSensitiveOrEntryData(sapUser);
|
|
if (resultEnum != null) {
|
|
if (resultEnum != null) {
|
|
- sapUser.setResult(resultEnum.getCode());
|
|
|
|
- this.updateResult(sapUser);
|
|
|
|
|
|
+ this.updateResultByPersonId(resultEnum.getCode(), sapUser.getPersonId());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -166,8 +189,7 @@ public class SapUserService extends BaseService {
|
|
|
|
|
|
public void updateSyncWxResult(String personId) throws Exception {
|
|
public void updateSyncWxResult(String personId) throws Exception {
|
|
String result = createOrUpdateWXUser(personId);
|
|
String result = createOrUpdateWXUser(personId);
|
|
- SapUser entity = SapUser.builder().personId(personId).result(result).build();
|
|
|
|
- update("SapUserMapper.updateResult", entity);
|
|
|
|
|
|
+ updateResultByPersonId(result, personId);
|
|
}
|
|
}
|
|
|
|
|
|
private String createOrUpdateWXUser(String personId) throws Exception {
|
|
private String createOrUpdateWXUser(String personId) throws Exception {
|
|
@@ -190,10 +212,6 @@ public class SapUserService extends BaseService {
|
|
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);
|
|
- String checkResult = checkSapUser(sapUser);
|
|
|
|
- if (StringUtils.isNotBlank(checkResult)) {
|
|
|
|
- return checkResult;
|
|
|
|
- }
|
|
|
|
firstWxDepartIdList[i] = sapUser.getFirstWxDepartId();
|
|
firstWxDepartIdList[i] = sapUser.getFirstWxDepartId();
|
|
secondWxDepartIdList[i] = sapUser.getSecondWxDepartId();
|
|
secondWxDepartIdList[i] = sapUser.getSecondWxDepartId();
|
|
thirdWxDepartIdList[i] = sapUser.getThirdWxDepartId();
|
|
thirdWxDepartIdList[i] = sapUser.getThirdWxDepartId();
|
|
@@ -205,23 +223,6 @@ public class SapUserService extends BaseService {
|
|
primarySapUser.getFirstOrgName());
|
|
primarySapUser.getFirstOrgName());
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 判断是不是垃圾数据或者黑名单
|
|
|
|
- *
|
|
|
|
- * @param sapUser
|
|
|
|
- * @return
|
|
|
|
- * @throws Exception
|
|
|
|
- */
|
|
|
|
- public String checkSapUser(SapUser sapUser) throws Exception {
|
|
|
|
- if (Tools.isEmpty(sapUser.getPersonId()) || Tools.isEmpty(sapUser.getFirstOrgName())
|
|
|
|
- || WebConstants.INGORE_PERSONIDS.contains("," + sapUser.getPersonId() + ",")) {
|
|
|
|
- return SapUserResultEnum.GARBAGE.getCode();
|
|
|
|
- } else if (sapBlacklistService.findByUserId(sapUser.getPersonId()) != null) {
|
|
|
|
- return SapUserResultEnum.BLACKLIST.getCode();
|
|
|
|
- }
|
|
|
|
- return null;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
public SapUser selectByUserId(String userId) throws Exception {
|
|
public SapUser selectByUserId(String userId) throws Exception {
|
|
return (SapUser) findObject("SapUserMapper.selectByUserId", userId);
|
|
return (SapUser) findObject("SapUserMapper.selectByUserId", userId);
|
|
}
|
|
}
|
|
@@ -330,9 +331,15 @@ public class SapUserService extends BaseService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public void updateResultByUserId(String result, String userId) throws Exception {
|
|
|
|
+ SapUser sapUser = SapUser.builder().userId(userId).result(result).build();
|
|
|
|
+ update("SapUserMapper.updateResultByUserId", sapUser);
|
|
|
|
+ }
|
|
|
|
|
|
- public void updateResult(SapUser sapUser) throws Exception {
|
|
|
|
- update("SapUserMapper.updateResult", sapUser);
|
|
|
|
|
|
+ public void updateResultByPersonId(String result, String personId) throws Exception {
|
|
|
|
+ SapUser sapUser = SapUser.builder().personId(personId).result(result).build();
|
|
|
|
+ update("SapUserMapper.updateResultByPersonId", sapUser);
|
|
}
|
|
}
|
|
|
|
|
|
public void deleteQuitUserByUserId(String userId, String oprUserId) throws Exception {
|
|
public void deleteQuitUserByUserId(String userId, String oprUserId) throws Exception {
|
|
@@ -352,8 +359,7 @@ public class SapUserService extends BaseService {
|
|
}
|
|
}
|
|
|
|
|
|
public void updateIngore(String personId) throws Exception {
|
|
public void updateIngore(String personId) throws Exception {
|
|
- SapUser sapUser = SapUser.builder().personId(personId).result(SapUserResultEnum.INGORE.getCode()).build();
|
|
|
|
- update("SapUserMapper.updateResult", sapUser);
|
|
|
|
|
|
+ updateResultByPersonId(SapUserResultEnum.INGORE.getCode(), personId);
|
|
}
|
|
}
|
|
|
|
|
|
public void updateAllNormalSyncWxResult() throws Exception {
|
|
public void updateAllNormalSyncWxResult() throws Exception {
|