Commit 433754c7 authored by tianbo's avatar tianbo

feat(jg): 添加组织名称变更监听处理功能

- 新增 orgName 字段到变更监听常量配置 - 实现 updateUseRegistrationManagementByProjectContraptionId 方法处理项目设备ID更新 - 修改 updateUseRegistrationManagementByEquId 方法参数名称并添加空值检查 - 更新 ChangeEquipImpactCertListener 中的字段映射逻辑支持 orgName 变更 - 添加基于项目设备ID查询组织信息的功能实现
parent c72db860
......@@ -11,7 +11,7 @@ public class ChangeFieldWatchConstants {
Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
"equDefine", "equCode", "useInnerCode", "factoryNum",
"province", "city", "county", "street", "factoryUseSiteStreet", "address", "useOrgCode", "carNumber", "useRegistrationCode",
"receiveCompanyCode", "orgBranchName"
"receiveCompanyCode", "orgBranchName", "orgName"
)));
/**
......
......@@ -187,20 +187,36 @@ public class ChangeEquipImpactCertListener {
.add(new BigDecimal(afterValue).subtract(new BigDecimal(beforeValue))).toPlainString());
break;
case "orgBranchName":
this.updateUseRegistrationManagement(manage, meta.getChangeId());
this.updateUseRegistrationManagementByEquId(manage, meta.getChangeId());
break;
case "orgName":
this.updateUseRegistrationManagementByProjectContraptionId(manage, meta.getChangeId());
break;
default:
log.warn("未处理的USE_CERT字段:[{}]", columnKey);
break;
}
}
private void updateUseRegistrationManagement(JgUseRegistrationManage manage, Object changeId) {
LambdaQueryWrapper<IdxBizJgSupervisionInfo> lambda = new QueryWrapper<IdxBizJgSupervisionInfo>().lambda().select(IdxBizJgSupervisionInfo::getOrgBranchCode, IdxBizJgSupervisionInfo::getOrgBranchName).eq(IdxBizJgSupervisionInfo::getRecord, changeId);
private void updateUseRegistrationManagementByEquId(JgUseRegistrationManage manage, Object record) {
LambdaQueryWrapper<IdxBizJgSupervisionInfo> lambda = new QueryWrapper<IdxBizJgSupervisionInfo>().lambda().select(IdxBizJgSupervisionInfo::getOrgBranchCode, IdxBizJgSupervisionInfo::getOrgBranchName).eq(IdxBizJgSupervisionInfo::getRecord, record);
IdxBizJgSupervisionInfo supervisionInfo = supervisionInfoMapper.selectOne(lambda);
if (supervisionInfo == null) {
return;
}
manage.setSuperviseOrgCode(supervisionInfo.getOrgBranchCode());
manage.setSuperviseOrgName(supervisionInfo.getOrgBranchName());
}
private void updateUseRegistrationManagementByProjectContraptionId(JgUseRegistrationManage manage, Object projectId) {
IdxBizJgProjectContraption projectContraption = jgProjectContraptionService.lambdaQuery().select(IdxBizJgProjectContraption::getOrgCode, IdxBizJgProjectContraption::getOrgName).eq(IdxBizJgProjectContraption::getSequenceNbr, projectId).one();
if (projectContraption == null) {
return;
}
manage.setSuperviseOrgCode(projectContraption.getOrgCode());
manage.setSuperviseOrgName(projectContraption.getOrgName());
}
private void updateEquUseAddressByChangeId(JgUseRegistrationManage manage, Object changeId) {
LambdaQueryWrapper<IdxBizJgUseInfo> lambda = new QueryWrapper<IdxBizJgUseInfo>().lambda();
lambda.eq(IdxBizJgUseInfo::getRecord, String.valueOf(changeId));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment