大华口门部门id修改

dahua_koumen
zhangxiongfeng 2026-08-03 10:51:53 +08:00
parent 4e3ee4e7ac
commit c83d18b8a1
2 changed files with 13 additions and 8 deletions

View File

@ -254,7 +254,8 @@ public class UserAddExe {
personMap.put("paperType", 111); personMap.put("paperType", 111);
personMap.put("paperNumber", plainIdCard); personMap.put("paperNumber", plainIdCard);
personMap.put("phone", userE.getPhone()); personMap.put("phone", userE.getPhone());
personMap.put("departmentId", 1L); Long realCorpId = userE.getCorpinfoId() != null ? userE.getCorpinfoId() : 1L;
personMap.put("departmentId", realCorpId);
personMap.put("departmentType", 2); personMap.put("departmentType", 2);
personMap.put("type", 3); personMap.put("type", 3);
if (userE.getNation() != null && !userE.getNation().trim().isEmpty()) { if (userE.getNation() != null && !userE.getNation().trim().isEmpty()) {

View File

@ -266,23 +266,26 @@ public class UserUpdateExe {
String newNation = userUpdateCmd.getNation() != null ? userUpdateCmd.getNation() : userDO.getNation(); String newNation = userUpdateCmd.getNation() != null ? userUpdateCmd.getNation() : userDO.getNation();
String newNationName = userUpdateCmd.getNationName() != null ? userUpdateCmd.getNationName() : userDO.getNationName(); String newNationName = userUpdateCmd.getNationName() != null ? userUpdateCmd.getNationName() : userDO.getNationName();
Object newFaceFile = userUpdateCmd.getUserImg() != null ? userUpdateCmd.getUserImg() : userUpdateCmd.getFaceFile(); Object newFaceFile = userUpdateCmd.getUserImg() != null ? userUpdateCmd.getUserImg() : userUpdateCmd.getFaceFile();
log.info("【本次请求入参】name是否传={}, phone是否传={}, userIdCard是否传={}, nation是否传={}, nationName是否传={}, userImg是否传={}, faceFile是否传={}", Long newCorpId = userUpdateCmd.getCorpinfoId() != null ? userUpdateCmd.getCorpinfoId() : userDO.getCorpinfoId();
log.info("【本次请求入参】name是否传={}, phone是否传={}, userIdCard是否传={}, nation是否传={}, nationName是否传={}, userImg是否传={}, faceFile是否传={}, corpinfoId是否传={}",
userUpdateCmd.getName() != null, userUpdateCmd.getPhone() != null, userUpdateCmd.getUserIdCard() != null, userUpdateCmd.getName() != null, userUpdateCmd.getPhone() != null, userUpdateCmd.getUserIdCard() != null,
userUpdateCmd.getNation() != null, userUpdateCmd.getNationName() != null, userUpdateCmd.getNation() != null, userUpdateCmd.getNationName() != null,
userUpdateCmd.getUserImg() != null, userUpdateCmd.getFaceFile() != null); userUpdateCmd.getUserImg() != null, userUpdateCmd.getFaceFile() != null,
userUpdateCmd.getCorpinfoId() != null);
boolean nameChanged = !Objects.equals(newName, userDO.getName()); boolean nameChanged = !Objects.equals(newName, userDO.getName());
boolean idCardChanged = !Objects.equals(newIdCard, userDO.getUserIdCard()); boolean idCardChanged = !Objects.equals(newIdCard, userDO.getUserIdCard());
boolean phoneChanged = !Objects.equals(newPhone, userDO.getPhone()); boolean phoneChanged = !Objects.equals(newPhone, userDO.getPhone());
boolean nationChanged = !Objects.equals(newNation, userDO.getNation()) || !Objects.equals(newNationName, userDO.getNationName()); boolean nationChanged = !Objects.equals(newNation, userDO.getNation()) || !Objects.equals(newNationName, userDO.getNationName());
boolean faceChanged = newFaceFile != null; boolean faceChanged = newFaceFile != null;
log.info("【变化检测】nameChanged={}({}→{}), idCardChanged={}, phoneChanged={}, nationChanged={}({}/{}→{}/{}), faceChanged={}", boolean corpChanged = !Objects.equals(newCorpId, userDO.getCorpinfoId());
log.info("【变化检测】nameChanged={}({}→{}), idCardChanged={}, phoneChanged={}, nationChanged={}({}/{}→{}/{}), faceChanged={}, corpChanged={}({}→{})",
nameChanged, userDO.getName(), newName, nameChanged, userDO.getName(), newName,
idCardChanged, phoneChanged, idCardChanged, phoneChanged,
nationChanged, userDO.getNation(), userDO.getNationName(), newNation, newNationName, nationChanged, userDO.getNation(), userDO.getNationName(), newNation, newNationName,
faceChanged); faceChanged, corpChanged, userDO.getCorpinfoId(), newCorpId);
if (!nameChanged && !idCardChanged && !phoneChanged && !nationChanged && !faceChanged) { if (!nameChanged && !idCardChanged && !phoneChanged && !nationChanged && !faceChanged && !corpChanged) {
log.info("【跳过同步大华】姓名/身份证/手机号/民族/人脸图 5项都没变化,按优化逻辑不调更新接口"); log.info("【跳过同步大华】姓名/身份证/手机号/民族/人脸图/企业 6项都没变化,按优化逻辑不调更新接口");
return; return;
} }
@ -308,7 +311,8 @@ public class UserUpdateExe {
personMap.put("paperType", 111); personMap.put("paperType", 111);
personMap.put("paperNumber", plainIdCard); personMap.put("paperNumber", plainIdCard);
personMap.put("phone", newPhone); personMap.put("phone", newPhone);
personMap.put("departmentId", 1); Long realCorpId = newCorpId != null ? newCorpId : 1L;
personMap.put("departmentId", realCorpId);
personMap.put("nationName", newNationName != null && !newNationName.trim().isEmpty() ? newNationName : "汉族"); personMap.put("nationName", newNationName != null && !newNationName.trim().isEmpty() ? newNationName : "汉族");
try { try {
if (newNation != null && !newNation.trim().isEmpty()) { if (newNation != null && !newNation.trim().isEmpty()) {