parent
285764928c
commit
a75871b388
|
|
@ -89,7 +89,7 @@ public class UserAddExe {
|
||||||
private final UserCorpRecordGateway userCorpRecordGateway;
|
private final UserCorpRecordGateway userCorpRecordGateway;
|
||||||
private ZcloudRedisUtil zcloudRedisUtil;
|
private ZcloudRedisUtil zcloudRedisUtil;
|
||||||
private final UserCorpRecordRepository userCorpRecordRepository;
|
private final UserCorpRecordRepository userCorpRecordRepository;
|
||||||
@DubboReference(check = false)
|
@DubboReference
|
||||||
private UserFacade userFacade;
|
private UserFacade userFacade;
|
||||||
// private final String sourceCode;
|
// private final String sourceCode;
|
||||||
// @Value("${seng.message:MS000087}")
|
// @Value("${seng.message:MS000087}")
|
||||||
|
|
@ -100,7 +100,7 @@ public class UserAddExe {
|
||||||
private final UserExpandInfoRepository userExpandInfoRepository;
|
private final UserExpandInfoRepository userExpandInfoRepository;
|
||||||
private final ImgFilesRepository imgFilesRepository;
|
private final ImgFilesRepository imgFilesRepository;
|
||||||
private final DaHuaConfig daHuaConfig;
|
private final DaHuaConfig daHuaConfig;
|
||||||
@DubboReference(version = "1.0.0", group = "primeport")
|
@DubboReference
|
||||||
private ZcloudDaHuaFacade zcloudDaHuaFacade;
|
private ZcloudDaHuaFacade zcloudDaHuaFacade;
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
|
@ -452,12 +452,41 @@ public class UserAddExe {
|
||||||
if (plainIdCard != null && plainIdCard.length() >= 14) {
|
if (plainIdCard != null && plainIdCard.length() >= 14) {
|
||||||
maskedIdCard = plainIdCard.substring(0, 6) + "********" + plainIdCard.substring(plainIdCard.length() - 4);
|
maskedIdCard = plainIdCard.substring(0, 6) + "********" + plainIdCard.substring(plainIdCard.length() - 4);
|
||||||
}
|
}
|
||||||
log.info("Dubbo调用primeport.zcloudDaHuaFacade.syncPerson, name={}, departmentId(corpId)={}, idCardMask={}",
|
log.info("========== 开始Dubbo调用primeport.zcloudDaHuaFacade.syncPerson ==========");
|
||||||
cmd.getName(), cmd.getDepartmentId(), maskedIdCard);
|
log.info("Dubbo调用参数: name={}, departmentId(corpId)={}, idCardMask={}, phone={}, code={}",
|
||||||
|
cmd.getName(), cmd.getDepartmentId(), maskedIdCard, cmd.getPhone(), cmd.getCode());
|
||||||
|
log.info("Dubbo调用参数: paperType={}, departmentType={}, type={}, nation={}, nationName={}",
|
||||||
|
cmd.getPaperType(), cmd.getDepartmentType(), cmd.getType(), cmd.getNation(), cmd.getNationName());
|
||||||
if (cmd.getPersonBiosignatures() != null) {
|
if (cmd.getPersonBiosignatures() != null) {
|
||||||
log.info("Dubbo调用携带人脸生物特征, size={}", cmd.getPersonBiosignatures().size());
|
log.info("Dubbo调用携带人脸生物特征, size={}", cmd.getPersonBiosignatures().size());
|
||||||
|
} else {
|
||||||
|
log.info("Dubbo调用未携带人脸生物特征");
|
||||||
|
}
|
||||||
|
log.info("Dubbo调用 cmd对象完整打印: {}", JSONUtil.toJsonStr(cmd));
|
||||||
|
|
||||||
|
SingleResponse<Object> syncResp = null;
|
||||||
|
try {
|
||||||
|
log.info("即将执行 zcloudDaHuaFacade.syncPerson(cmd)...");
|
||||||
|
syncResp = zcloudDaHuaFacade.syncPerson(cmd);
|
||||||
|
log.info("zcloudDaHuaFacade.syncPerson(cmd) 执行完成,已返回");
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("========== Dubbo调用primeport.zcloudDaHuaFacade.syncPerson 发生异常 ==========", e);
|
||||||
|
log.error("异常类型: {}", e.getClass().getName());
|
||||||
|
log.error("异常信息: {}", e.getMessage());
|
||||||
|
if (throwOnFail) {
|
||||||
|
throw new BizException("同步大华平台失败,Dubbo调用异常:" + e.getMessage());
|
||||||
|
} else {
|
||||||
|
log.warn("同步大华平台Dubbo调用异常(不影响本地数据保存): {}", e.getMessage());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info("========== Dubbo调用返回结果 ==========");
|
||||||
|
log.info("返回对象: syncResp={}", syncResp);
|
||||||
|
if (syncResp != null) {
|
||||||
|
log.info("返回详情: success={}, errCode={}, errMessage={}, data={}",
|
||||||
|
syncResp.isSuccess(), syncResp.getErrCode(), syncResp.getErrMessage(), syncResp.getData());
|
||||||
}
|
}
|
||||||
SingleResponse<Object> syncResp = zcloudDaHuaFacade.syncPerson(cmd);
|
|
||||||
result.setDahuaCode(plainIdCard);
|
result.setDahuaCode(plainIdCard);
|
||||||
userE.setDahuaCode(plainIdCard);
|
userE.setDahuaCode(plainIdCard);
|
||||||
if (syncResp == null || !syncResp.isSuccess()) {
|
if (syncResp == null || !syncResp.isSuccess()) {
|
||||||
|
|
@ -476,7 +505,12 @@ public class UserAddExe {
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
if (data instanceof Map) {
|
if (data instanceof Map) {
|
||||||
Map<String, Object> dataMap = (Map<String, Object>) data;
|
Map<String, Object> dataMap = (Map<String, Object>) data;
|
||||||
Object idObj = dataMap.get("id");
|
log.info("大华返回data Map内容: {}", dataMap);
|
||||||
|
// primeport返回的是personId,不是id
|
||||||
|
Object idObj = dataMap.get("personId");
|
||||||
|
if (idObj == null) {
|
||||||
|
idObj = dataMap.get("id");
|
||||||
|
}
|
||||||
if (idObj != null) {
|
if (idObj != null) {
|
||||||
try {
|
try {
|
||||||
Integer dahuaId = Integer.valueOf(idObj.toString());
|
Integer dahuaId = Integer.valueOf(idObj.toString());
|
||||||
|
|
@ -486,10 +520,16 @@ public class UserAddExe {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.warn("转换大华返回id为Integer失败, idObj={}", idObj);
|
log.warn("转换大华返回id为Integer失败, idObj={}", idObj);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
log.warn("大华返回数据中未找到personId或id字段, dataMap keys={}", dataMap.keySet());
|
||||||
}
|
}
|
||||||
} else if (data instanceof cn.hutool.json.JSONObject) {
|
} else if (data instanceof cn.hutool.json.JSONObject) {
|
||||||
cn.hutool.json.JSONObject dataJson = (cn.hutool.json.JSONObject) data;
|
cn.hutool.json.JSONObject dataJson = (cn.hutool.json.JSONObject) data;
|
||||||
Object idObj = dataJson.get("id");
|
log.info("大华返回data JSONObject内容: {}", dataJson);
|
||||||
|
Object idObj = dataJson.get("personId");
|
||||||
|
if (idObj == null) {
|
||||||
|
idObj = dataJson.get("id");
|
||||||
|
}
|
||||||
if (idObj != null) {
|
if (idObj != null) {
|
||||||
try {
|
try {
|
||||||
Integer dahuaId = Integer.valueOf(idObj.toString());
|
Integer dahuaId = Integer.valueOf(idObj.toString());
|
||||||
|
|
@ -499,6 +539,8 @@ public class UserAddExe {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.warn("转换大华返回id为Integer失败, idObj={}", idObj);
|
log.warn("转换大华返回id为Integer失败, idObj={}", idObj);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
log.warn("大华返回数据中未找到personId或id字段");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,13 +49,13 @@ public class UserRemoveExe {
|
||||||
private final UserChangeRecordGateway userChangeRecordGateway;
|
private final UserChangeRecordGateway userChangeRecordGateway;
|
||||||
private final UserJobHandoverRepository userJobHandoverRepository;
|
private final UserJobHandoverRepository userJobHandoverRepository;
|
||||||
private final HumanUserUpdateExe humanUserUpdateExe;
|
private final HumanUserUpdateExe humanUserUpdateExe;
|
||||||
@DubboReference(check = false)
|
@DubboReference
|
||||||
private UserFacade userFacade;
|
private UserFacade userFacade;
|
||||||
// @Autowired
|
// @Autowired
|
||||||
private final ZcloudRedisUtil zcloudRedisUtil;
|
private final ZcloudRedisUtil zcloudRedisUtil;
|
||||||
private final UserCorpRecordRepository userCorpRecordRepository;
|
private final UserCorpRecordRepository userCorpRecordRepository;
|
||||||
private final DaHuaConfig daHuaConfig;
|
private final DaHuaConfig daHuaConfig;
|
||||||
@DubboReference(version = "1.0.0", group = "primeport")
|
@DubboReference
|
||||||
private ZcloudDaHuaFacade zcloudDaHuaFacade;
|
private ZcloudDaHuaFacade zcloudDaHuaFacade;
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ public class UserUpdateExe {
|
||||||
@DubboReference
|
@DubboReference
|
||||||
private ZcloudRiskFacade zcloudRiskFacade;
|
private ZcloudRiskFacade zcloudRiskFacade;
|
||||||
private final DaHuaConfig daHuaConfig;
|
private final DaHuaConfig daHuaConfig;
|
||||||
@DubboReference(version = "1.0.0", group = "primeport")
|
@DubboReference
|
||||||
private ZcloudDaHuaFacade zcloudDaHuaFacade;
|
private ZcloudDaHuaFacade zcloudDaHuaFacade;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -355,11 +355,23 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
||||||
roleDeptAddCmd.setDeptId(userDO.getDepartmentId());
|
roleDeptAddCmd.setDeptId(userDO.getDepartmentId());
|
||||||
List<RoleDeptAddCmd> roleDeptAddCmdList = Collections.singletonList(roleDeptAddCmd);
|
List<RoleDeptAddCmd> roleDeptAddCmdList = Collections.singletonList(roleDeptAddCmd);
|
||||||
userAddCmd.setRoleDepts(roleDeptAddCmdList);
|
userAddCmd.setRoleDepts(roleDeptAddCmdList);
|
||||||
log.info("GBS新增用户开始,用户信息:{}", JSONUtil.toJsonStr(userAddCmd));
|
|
||||||
|
// 打印详细参数,方便排查底座报错原因
|
||||||
|
log.info("【普通用户-底座新增】开始");
|
||||||
|
log.info("【普通用户-底座新增】参数详情: account={}, name={}, password={}, tenantId(corpinfoId)={}, roleId={}, departmentId={}",
|
||||||
|
userAddCmd.getAccount(), userAddCmd.getName(),
|
||||||
|
userDO.getPassword() != null ? "已设置(长度:" + userDO.getPassword().length() + ")" : "null",
|
||||||
|
userDO.getCorpinfoId(), userDO.getRoleId(), userDO.getDepartmentId());
|
||||||
|
log.info("【普通用户-底座新增】完整JSON: {}", JSONUtil.toJsonStr(userAddCmd));
|
||||||
|
log.info("【普通用户-底座新增】userDO完整JSON: {}", JSONUtil.toJsonStr(userDO));
|
||||||
|
|
||||||
SingleResponse<Long> gbsResult = userFacade.add(userAddCmd);
|
SingleResponse<Long> gbsResult = userFacade.add(userAddCmd);
|
||||||
log.info("GBS新增用户结束,用户id:{},结果:{}", gbsResult.getData(), JSONUtil.toJsonStr(gbsResult));
|
log.info("【普通用户-底座新增】结束,用户id:{},结果:{}", gbsResult.getData(), JSONUtil.toJsonStr(gbsResult));
|
||||||
if (!gbsResult.isSuccess()) {
|
if (!gbsResult.isSuccess()) {
|
||||||
throw new RuntimeException("GBS新增用户失败,用户id:" + gbsResult.getData());
|
String errMsg = String.format("【普通用户-底座新增失败】errCode=%s, errMessage=%s, 用户id=%s",
|
||||||
|
gbsResult.getErrCode(), gbsResult.getErrMessage(), gbsResult.getData());
|
||||||
|
log.error(errMsg);
|
||||||
|
throw new RuntimeException(errMsg);
|
||||||
}
|
}
|
||||||
userDO.setId(gbsResult.getData());
|
userDO.setId(gbsResult.getData());
|
||||||
if (userDO.getSort() == null) {
|
if (userDO.getSort() == null) {
|
||||||
|
|
@ -386,11 +398,14 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
||||||
roleDeptAddCmd.setDeptId(userDO.getDepartmentId());
|
roleDeptAddCmd.setDeptId(userDO.getDepartmentId());
|
||||||
List<RoleDeptAddCmd> roleDeptAddCmdList = Collections.singletonList(roleDeptAddCmd);
|
List<RoleDeptAddCmd> roleDeptAddCmdList = Collections.singletonList(roleDeptAddCmd);
|
||||||
userAddCmd.setRoleDepts(roleDeptAddCmdList);
|
userAddCmd.setRoleDepts(roleDeptAddCmdList);
|
||||||
log.info("GBS新增用户开始,用户信息:{}", JSONUtil.toJsonStr(userAddCmd));
|
log.info("【演示用户-底座新增】开始,用户信息:{}", JSONUtil.toJsonStr(userAddCmd));
|
||||||
SingleResponse<Long> gbsResult = userFacade.add(userAddCmd);
|
SingleResponse<Long> gbsResult = userFacade.add(userAddCmd);
|
||||||
log.info("GBS新增用户结束,用户id:{},结果:{}", gbsResult.getData(), JSONUtil.toJsonStr(gbsResult));
|
log.info("【演示用户-底座新增】结束,用户id:{},结果:{}", gbsResult.getData(), JSONUtil.toJsonStr(gbsResult));
|
||||||
if (!gbsResult.isSuccess()) {
|
if (!gbsResult.isSuccess()) {
|
||||||
throw new RuntimeException("GBS新增用户失败,用户id:" + gbsResult.getData());
|
String errMsg = String.format("【演示用户-底座新增失败】errCode=%s, errMessage=%s, 用户id=%s",
|
||||||
|
gbsResult.getErrCode(), gbsResult.getErrMessage(), gbsResult.getData());
|
||||||
|
log.error(errMsg);
|
||||||
|
throw new RuntimeException(errMsg);
|
||||||
}
|
}
|
||||||
userDO.setId(gbsResult.getData());
|
userDO.setId(gbsResult.getData());
|
||||||
if (userDO.getSort() == null) {
|
if (userDO.getSort() == null) {
|
||||||
|
|
@ -455,11 +470,14 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
||||||
userAddCmd.setRoleDepts(roleDeptAddCmdList);
|
userAddCmd.setRoleDepts(roleDeptAddCmdList);
|
||||||
userAddCmd.setId(userDO.getId());
|
userAddCmd.setId(userDO.getId());
|
||||||
userAddCmd.setPassword(userDO.getPassword());
|
userAddCmd.setPassword(userDO.getPassword());
|
||||||
log.info("GBS新增用户开始,用户信息:{}", JSONUtil.toJsonStr(userAddCmd));
|
log.info("【相关方用户-底座新增】开始,用户信息:{}", JSONUtil.toJsonStr(userAddCmd));
|
||||||
SingleResponse<Long> gbsResult = userFacade.add(userAddCmd);
|
SingleResponse<Long> gbsResult = userFacade.add(userAddCmd);
|
||||||
log.info("GBS新增用户结束,用户id:{},结果:{}", gbsResult.getData(), JSONUtil.toJsonStr(gbsResult));
|
log.info("【相关方用户-底座新增】结束,用户id:{},结果:{}", gbsResult.getData(), JSONUtil.toJsonStr(gbsResult));
|
||||||
if (!gbsResult.isSuccess()) {
|
if (!gbsResult.isSuccess()) {
|
||||||
throw new RuntimeException("GBS新增用户失败,用户id:" + gbsResult.getData());
|
String errMsg = String.format("【相关方用户-底座新增失败】errCode=%s, errMessage=%s, 用户id=%s",
|
||||||
|
gbsResult.getErrCode(), gbsResult.getErrMessage(), gbsResult.getData());
|
||||||
|
log.error(errMsg);
|
||||||
|
throw new RuntimeException(errMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -772,11 +790,14 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
||||||
List<RoleDeptAddCmd> roleDeptAddCmdList = Collections.singletonList(roleDeptAddCmd);
|
List<RoleDeptAddCmd> roleDeptAddCmdList = Collections.singletonList(roleDeptAddCmd);
|
||||||
userAddCmd.setRoleDepts(roleDeptAddCmdList);
|
userAddCmd.setRoleDepts(roleDeptAddCmdList);
|
||||||
userAddCmd.setId(userE.getId());
|
userAddCmd.setId(userE.getId());
|
||||||
log.info("GBS新增用户开始,用户信息:{}", JSONUtil.toJsonStr(userAddCmd));
|
log.info("【用户恢复入职-底座新增】开始,用户信息:{}", JSONUtil.toJsonStr(userAddCmd));
|
||||||
SingleResponse<Long> gbsResult = userFacade.add(userAddCmd);
|
SingleResponse<Long> gbsResult = userFacade.add(userAddCmd);
|
||||||
log.info("GBS新增用户结束,用户id:{},结果:{}", gbsResult.getData(), JSONUtil.toJsonStr(gbsResult));
|
log.info("【用户恢复入职-底座新增】结束,用户id:{},结果:{}", gbsResult.getData(), JSONUtil.toJsonStr(gbsResult));
|
||||||
if (!gbsResult.isSuccess()) {
|
if (!gbsResult.isSuccess()) {
|
||||||
throw new RuntimeException("GBS新增用户失败,用户id:" + gbsResult.getData());
|
String errMsg = String.format("【用户恢复入职-底座新增失败】errCode=%s, errMessage=%s, 用户id=%s",
|
||||||
|
gbsResult.getErrCode(), gbsResult.getErrMessage(), gbsResult.getData());
|
||||||
|
log.error(errMsg);
|
||||||
|
throw new RuntimeException(errMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue