REQ-2960 还原代码

This commit is contained in:
zhongpeng 2024-09-10 11:42:42 +08:00
parent 7446737eab
commit 75660ae017
2 changed files with 32 additions and 13 deletions

View File

@ -40,7 +40,7 @@ public class DingTalkUtil {
OapiRobotSendResponse response = client.execute(req); OapiRobotSendResponse response = client.execute(req);
log.info("发送钉钉消息结果:{}", response); log.info("发送钉钉消息结果:{}", response);
} catch (Exception error) { } catch (Exception error) {
log.info("发送钉钉消息失败:{}", error.getMessage()); log.error("发送钉钉消息失败:{}", error.getMessage());
} }
} }

View File

@ -5,6 +5,7 @@ import cn.axzo.basics.profiles.dto.basic.PersonProfileDto;
import cn.axzo.framework.domain.ServiceException; import cn.axzo.framework.domain.ServiceException;
import cn.axzo.riven.client.common.enums.ThirdCodeEnum; import cn.axzo.riven.client.common.enums.ThirdCodeEnum;
import cn.axzo.riven.third.common.AesUtil; import cn.axzo.riven.third.common.AesUtil;
import cn.axzo.riven.third.common.DingTalkUtil;
import cn.axzo.riven.third.common.enums.SyncTypeEnum; import cn.axzo.riven.third.common.enums.SyncTypeEnum;
import cn.axzo.riven.third.dao.ThirdPersonDao; import cn.axzo.riven.third.dao.ThirdPersonDao;
import cn.axzo.riven.third.dao.ThirdProjectDao; import cn.axzo.riven.third.dao.ThirdProjectDao;
@ -363,7 +364,9 @@ public class TaiZhouServiceImpl implements TaiZhouService {
//合并账号前验证用户信息确认泰州和安心筑实名账号是同一个人 //合并账号前验证用户信息确认泰州和安心筑实名账号是同一个人
if (!comparePersonInfo(currentBindPerson, thirdPerson)) { if (!comparePersonInfo(currentBindPerson, thirdPerson)) {
log.error("泰州人员:{} 基本信息和安心筑信息不一致(姓名或者脱敏身份证不一致),不能合并账号", thirdPerson.getThirdPersonName()); String errorLog = String.format("泰州人员:%s 基本信息和安心筑信息不一致(姓名或者脱敏身份证不一致),不修改安心筑手机号 ", thirdPerson.getThirdPersonName());
DingTalkUtil.sendMessage(errorLog, taiZhouConfig.getDingTalkBotAccessToken(), taiZhouConfig.getDingTalkBotSecret());
log.error(errorLog);
return; return;
} }
//合并账号 //合并账号
@ -378,7 +381,9 @@ public class TaiZhouServiceImpl implements TaiZhouService {
//修改绑定关系 //修改绑定关系
//合并账号前验证用户信息确认泰州和安心筑实名账号是同一个人 //合并账号前验证用户信息确认泰州和安心筑实名账号是同一个人
if (!comparePersonInfo(newPerson, thirdPerson)) { if (!comparePersonInfo(newPerson, thirdPerson)) {
log.error("泰州人员:{} 基本信息和新手机号对应的实名安心筑信息不一致(姓名或者脱敏身份证不一致),不修改绑定关系", thirdPerson.getThirdPersonName()); String errorLog = String.format("泰州人员:%s 基本信息和安心筑信息不一致(姓名或者脱敏身份证不一致),不修改绑定关系 ", thirdPerson.getThirdPersonName());
DingTalkUtil.sendMessage(errorLog, taiZhouConfig.getDingTalkBotAccessToken(), taiZhouConfig.getDingTalkBotSecret());
log.error(errorLog);
return; return;
} }
@ -394,7 +399,9 @@ public class TaiZhouServiceImpl implements TaiZhouService {
//如果老的关联账号没有实名新的账号实名了 //如果老的关联账号没有实名新的账号实名了
if (VerifyStatus.VERIFY_SUCCESS == currentBindPerson.getVerification().getVerifyStatus() && if (VerifyStatus.VERIFY_SUCCESS == currentBindPerson.getVerification().getVerifyStatus() &&
VerifyStatus.VERIFY_SUCCESS == newPerson.getVerification().getVerifyStatus()) { VerifyStatus.VERIFY_SUCCESS == newPerson.getVerification().getVerifyStatus()) {
log.error("泰州人员:{} 手机号变更,发现新老手机号对应的安心筑账号均实名,异常", thirdPerson.getThirdPersonName()); String errorLog = String.format("泰州人员:%s 手机号变更(姓名或者脱敏身份证不一致),发现新老手机号对应的安心筑账号均实名,异常", thirdPerson.getThirdPersonName());
DingTalkUtil.sendMessage(errorLog, taiZhouConfig.getDingTalkBotAccessToken(), taiZhouConfig.getDingTalkBotSecret());
log.error(errorLog);
return; return;
} }
} }
@ -405,6 +412,7 @@ public class TaiZhouServiceImpl implements TaiZhouService {
/** /**
* 将新手机关了的安心筑账号ID更新到中间表中 * 将新手机关了的安心筑账号ID更新到中间表中
* 新手机号必须有对应的工人角色新手机号对应的安心筑账号是查询出来的可能没有工人角色需要补充 * 新手机号必须有对应的工人角色新手机号对应的安心筑账号是查询出来的可能没有工人角色需要补充
*
* @param thirdPerson * @param thirdPerson
*/ */
private void updateTaiZhouPersonRel(ThirdPerson thirdPerson) { private void updateTaiZhouPersonRel(ThirdPerson thirdPerson) {
@ -424,10 +432,11 @@ public class TaiZhouServiceImpl implements TaiZhouService {
/** /**
* 更新安心筑手机号操作 * 更新安心筑手机号操作
* 1泰州新手机号必须在安心筑没有注册方法进入前置判断 * 1泰州新手机号必须在安心筑没有注册方法进入前置判断
* 2泰州新手机号必须与当前泰州数据关联的安心筑手机号不一致如果一致跳过处理 * 2泰州新手机号必须与当前泰州数据关联的安心筑手机号不一致如果一致跳过处理
* 3如果已经绑定的安心筑信息未实名直接修改安心筑信息的手机号为新手机号 * 3如果已经绑定的安心筑信息未实名直接修改安心筑信息的手机号为新手机号
* 4如果已经绑定的安心筑信息已经实名则比对泰州和安心筑人员的几把呢信息比对姓名脱敏身份证比对成功则修改安心筑手机号比对失败告警 * 4如果已经绑定的安心筑信息已经实名则比对泰州和安心筑人员的几把呢信息比对姓名脱敏身份证比对成功则修改安心筑手机号比对失败告警
*
* @param thirdPerson * @param thirdPerson
* @param oldThirdPerson * @param oldThirdPerson
* @param currentBindPerson * @param currentBindPerson
@ -451,7 +460,9 @@ public class TaiZhouServiceImpl implements TaiZhouService {
log.info("泰州人员:{} 同步数据新手机号在安心筑账号为空且历史绑定数据实名且与泰州信息一致需要覆盖安心筑手机号安心筑personId{}originPhone:{},newPhone:{}", thirdPerson.getThirdPersonName(), currentBindPerson.getId(), currentBindPerson.getPhone(), thirdPerson.getThirdPersonPhone()); log.info("泰州人员:{} 同步数据新手机号在安心筑账号为空且历史绑定数据实名且与泰州信息一致需要覆盖安心筑手机号安心筑personId{}originPhone:{},newPhone:{}", thirdPerson.getThirdPersonName(), currentBindPerson.getId(), currentBindPerson.getPhone(), thirdPerson.getThirdPersonPhone());
userCenterRpc.updateUserPhone(oldThirdPerson.getPersonId(), thirdPerson.getThirdPersonPhone()); userCenterRpc.updateUserPhone(oldThirdPerson.getPersonId(), thirdPerson.getThirdPersonPhone());
} else { } else {
log.error("泰州人员:{} 基本信息和安心筑信息不一致(姓名或者脱敏身份证不一致),不修改安心筑手机号", thirdPerson.getThirdPersonName()); String errorLog = String.format("泰州人员:%s 基本信息和安心筑信息不一致(姓名或者脱敏身份证不一致),不修改安心筑手机号 ", thirdPerson.getThirdPersonName());
DingTalkUtil.sendMessage(errorLog, taiZhouConfig.getDingTalkBotAccessToken(), taiZhouConfig.getDingTalkBotSecret());
log.error(errorLog);
} }
} }
@ -483,7 +494,9 @@ public class TaiZhouServiceImpl implements TaiZhouService {
//检查泰州手机号是否重复 //检查泰州手机号是否重复
if (checkRepeatPhone(thirdPerson)) { if (checkRepeatPhone(thirdPerson)) {
throw new ServiceException("泰州人员:" + thirdPerson.getThirdPersonName() + " 与其他泰州人员手机号重复,手机号为:" + thirdPerson.getThirdPersonPhone()); String errorLog = String.format("泰州人员:%s 与其他泰州人员手机号重复,手机号为: %s ", thirdPerson.getThirdPersonName(), thirdPerson.getThirdPersonPhone());
DingTalkUtil.sendMessage(errorLog, taiZhouConfig.getDingTalkBotAccessToken(), taiZhouConfig.getDingTalkBotSecret());
throw new ServiceException(errorLog);
} }
//项目开关同步检查 //项目开关同步检查
if (createAccountCheck(thirdPerson, taiZhouProject)) { if (createAccountCheck(thirdPerson, taiZhouProject)) {
@ -504,7 +517,9 @@ public class TaiZhouServiceImpl implements TaiZhouService {
.list(); .list();
if (!CollectionUtils.isEmpty(list)) { if (!CollectionUtils.isEmpty(list)) {
throw new ServiceException("安心筑PersonID" + personId + " 已经绑定了其他泰州信息,不能多次绑定:"); String errorLog = String.format("安心筑PersonID%s 已经绑定了其他泰州信息,不能多次绑定。 ", personId);
DingTalkUtil.sendMessage(errorLog, taiZhouConfig.getDingTalkBotAccessToken(), taiZhouConfig.getDingTalkBotSecret());
throw new ServiceException(errorLog);
} }
} }
@ -519,11 +534,15 @@ public class TaiZhouServiceImpl implements TaiZhouService {
private void taiZhouSyncBasicPersonCheck(ThirdPerson thirdPerson, ThirdPerson db) { private void taiZhouSyncBasicPersonCheck(ThirdPerson thirdPerson, ThirdPerson db) {
//姓名变更 //姓名变更
if (!db.getThirdPersonName().equals(thirdPerson.getThirdPersonName())) { if (!db.getThirdPersonName().equals(thirdPerson.getThirdPersonName())) {
throw new ServiceException("泰州PersonID" + thirdPerson.getThirdUniquePersonId() + "姓名发生变化:" + db.getThirdPersonName() + "->" + thirdPerson.getThirdPersonName()); String errorLog = String.format("泰州PersonID%s 姓名发生变化:%s -> %s ", thirdPerson.getThirdUniquePersonId(), db.getThirdPersonName(), thirdPerson.getThirdPersonName());
DingTalkUtil.sendMessage(errorLog, taiZhouConfig.getDingTalkBotAccessToken(), taiZhouConfig.getDingTalkBotSecret());
throw new ServiceException(errorLog);
} }
//身份证变更 //身份证变更
if (!db.getThirdIdNumber().equals(thirdPerson.getThirdIdNumber())) { if (!db.getThirdIdNumber().equals(thirdPerson.getThirdIdNumber())) {
throw new ServiceException("泰州PersonID" + thirdPerson.getThirdUniquePersonId() + "身份证发生变化:" + db.getThirdIdNumber() + "->" + thirdPerson.getThirdIdNumber()); String errorLog = String.format("泰州PersonID%s 身份证发生变化:%s -> %s ", thirdPerson.getThirdUniquePersonId(), db.getThirdIdNumber(), thirdPerson.getThirdIdNumber());
DingTalkUtil.sendMessage(errorLog, taiZhouConfig.getDingTalkBotAccessToken(), taiZhouConfig.getDingTalkBotSecret());
throw new ServiceException(errorLog);
} }
} }