Commit fe01441b authored by tianbo's avatar tianbo

fix(jg): 修复设备注册信息处理中的空指针异常

- 在查找设备ES信息时增加了空值检查,防止record为空时抛出异常 - 施工类型单位添加设备时使用信息表设置信用代码和名称 - 注释掉了西安数据对接中不必要的96333码验证规则
parent ce6f07c9
......@@ -701,7 +701,7 @@ public class XiAnDataDockServiceImpl {
checkNotBlank(data.getEquCodeType(), "有无设备代码不能为空;", rowError);
// 需要历史登记数据,使用登记证编号不能为空
if (isRegistration) {
checkNotBlank(data.getCode96333(), "96333码不能为空;", rowError);
// checkNotBlank(data.getCode96333(), "96333码不能为空;", rowError);
checkNotBlank(data.getUseOrgCode(), "使用登记证编号不能为空;", rowError);
if (useOrgCodeList.contains(data.getUseOrgCode())) {
rowError.append("使用登记证编号不能重复;").append(data.getUseOrgCode());
......
......@@ -936,7 +936,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
operateType = isCopy ? OPERATESAVE : operateType;
String submitType = String.valueOf(paramMap.get("submitType"));
String record = (String) equipmentInfoForm.get(RECORD);
ESEquipmentCategoryDto esEquipmentCategoryDto = esEquipmentCategory.findById(record).orElse(null);
ESEquipmentCategoryDto esEquipmentCategoryDto = !ValidationUtil.isEmpty(record) ? esEquipmentCategory.findById(record).orElse(null) : null;
try {
// 设备代码 字段的唯一性校验
checkEquCodeUniqueness(equipmentInfoForm);
......@@ -3761,6 +3761,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
// 删除使用信息中的省、市、区下滑线数据,来源详情的getEquipInfoMap的放入
this.removeDescAfterCode(useInfo);
// 单位信息
String companyName = companyInfoMap.get("companyName").toString();
String companyCode = companyInfoMap.get("creditCode").toString();
// 使用信息
useInfo.setRecord(record);
useInfo.setRecDate(date);
......@@ -3771,6 +3776,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
useInfo.setUseUnitCreditCode(companyInfoMap.get("creditCode").toString());
useInfo.setUseUnitName(companyInfoMap.get("companyName").toString());
}
if (companyTypeStr.contains(CompanyTypeEnum.CONSTRUCTION.getCode())) {
useInfo.setUSC_UNIT_CREDIT_CODE(companyCode);
useInfo.setUSC_UNIT_NAME(companyName);
}
if (OPERATESAVE.equals(operateType)) {
useInfo.setCreateDate(date);
}
......@@ -3814,8 +3823,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
iIdxBizJgFactoryInfoService.saveOrUpdateData(factoryInfo);
// 施工信息
String companyName = companyInfoMap.get("companyName").toString();
String companyCode = companyInfoMap.get("creditCode").toString();
constructionInfo.setRecord(record);
constructionInfo.setRecDate(date);
if (!registerInfo.getEquList().equals("5000") && !registerInfo.getEquCategory().equals("4400") && !registerInfo.getEquCategory().equals("2300")) {
......
......@@ -2097,7 +2097,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
}
Lists.partition(Lists.newArrayList(equipIds), 1000).forEach(ids -> {
LambdaUpdateWrapper<IdxBizJgUseInfo> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.in(IdxBizJgUseInfo::getRecord, Collections.singletonList(ids));
updateWrapper.in(IdxBizJgUseInfo::getRecord, ids);
// 强制更新字段为 NULL
updateWrapper.set(IdxBizJgUseInfo::getUseUnitCreditCode, null);
updateWrapper.set(IdxBizJgUseInfo::getUseUnitName, null);
......
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