Commit 8053f3d6 authored by suhuiguang's avatar suhuiguang

fix(大编辑):bug修复

1.字段处理,空制造bug修改 2.管道编辑公共部分开发
parent 6940b0f2
package com.yeejoin.amos.boot.module.jg.api.dto; package com.yeejoin.amos.boot.module.jg.api.dto;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.biz.common.annotation.FieldDisplayDefine; import com.yeejoin.amos.boot.biz.common.annotation.FieldDisplayDefine;
import com.yeejoin.amos.boot.biz.common.annotation.Group; import com.yeejoin.amos.boot.biz.common.annotation.Group;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.util.Date;
/** /**
* 安全追溯-压力管道 * 安全追溯-压力管道
* *
...@@ -21,4 +25,38 @@ public class PipelineChangeItemDto extends TechParamsPipelineChangeFieldDto { ...@@ -21,4 +25,38 @@ public class PipelineChangeItemDto extends TechParamsPipelineChangeFieldDto {
@FieldDisplayDefine(value = "设计单位名称") @FieldDisplayDefine(value = "设计单位名称")
private String designUnitName; private String designUnitName;
@FieldDisplayDefine(value = "检验检测流水id", isExist = false)
private String jySeq;
@FieldDisplayDefine(value = "安装信息流水", isExist = false)
private String constructionInfoSeq;
@FieldDisplayDefine(value ="检验类型", dictCode = "JYJC")
private String inspectType;
@FieldDisplayDefine(value ="检验机构统一信用代码")
private String inspectOrgCode;
@FieldDisplayDefine(value ="检验机构名称")
private String inspectOrgName;
@FieldDisplayDefine(value ="检验报告", type = JSON.class)
private String inspectReport;
@FieldDisplayDefine(value ="检验人员")
private String inspectStaff;
@FieldDisplayDefine(value ="检验日期")
private Date inspectDate;
@FieldDisplayDefine(value ="检验结论", dictCode = "JYJL")
private String inspectConclusion;
@FieldDisplayDefine(value = "下次检验日期")
private Date nextInspectDate;
@FieldDisplayDefine(value ="检验报告编号")
private String inspectReportNo;
} }
package com.yeejoin.amos.boot.module.jg.api.dto; package com.yeejoin.amos.boot.module.jg.api.dto;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.biz.common.annotation.FieldDisplayDefine; import com.yeejoin.amos.boot.biz.common.annotation.FieldDisplayDefine;
import com.yeejoin.amos.boot.biz.common.annotation.Group; import com.yeejoin.amos.boot.biz.common.annotation.Group;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -30,10 +31,27 @@ public class ProjectContraptionChangeDataDto extends BaseChangeDataDto { ...@@ -30,10 +31,27 @@ public class ProjectContraptionChangeDataDto extends BaseChangeDataDto {
@FieldDisplayDefine(value = "工程(装置)编号/项目编号") @FieldDisplayDefine(value = "工程(装置)编号/项目编号")
private String projectContraptionNo; private String projectContraptionNo;
@FieldDisplayDefine(value = "设备品种代码")
private String equDefineCode; @FieldDisplayDefine(value = "设备种类名称", isExist = false)
private String equListName;
@FieldDisplayDefine(value = "设备种类编码", isExist = false)
private String equList;
@FieldDisplayDefine(value = "设备类别名称", isExist = false)
private String equCategoryName;
@FieldDisplayDefine(value = "设备类别编码", isExist = false)
private String equCategory;
@FieldDisplayDefine(value = "设备品种名称") @FieldDisplayDefine(value = "设备品种名称")
private String equDefineName;
@FieldDisplayDefine(value = "设备品种代码", typeHandler = "equipCategoryTypeHandler")
private String equDefine; private String equDefine;
@FieldDisplayDefine(value = "装置管道总长度(m)", isExist = false) @FieldDisplayDefine(value = "装置管道总长度(m)", isExist = false)
...@@ -49,18 +67,18 @@ public class ProjectContraptionChangeDataDto extends BaseChangeDataDto { ...@@ -49,18 +67,18 @@ public class ProjectContraptionChangeDataDto extends BaseChangeDataDto {
private String productQualificationCertificate; private String productQualificationCertificate;
@FieldDisplayDefine(value = "使用地点代码_省") @FieldDisplayDefine(value = "使用地点代码_省",typeHandler = "regionCodeTypeHandler")
private String province; private String province;
@FieldDisplayDefine(value = "使用地点代码_市") @FieldDisplayDefine(value = "使用地点代码_市", typeHandler = "regionCodeTypeHandler")
private String city; private String city;
@FieldDisplayDefine(value = "使用地点代码_区(县)") @FieldDisplayDefine(value = "使用地点代码_区(县)", typeHandler = "regionCodeTypeHandler")
private String county; private String county;
@FieldDisplayDefine(value = "使用地点代码_街道(镇)") @FieldDisplayDefine(value = "使用地点代码_街道(镇)", typeHandler = "regionCodeTypeHandler")
private String street; private String street;
...@@ -68,6 +86,10 @@ public class ProjectContraptionChangeDataDto extends BaseChangeDataDto { ...@@ -68,6 +86,10 @@ public class ProjectContraptionChangeDataDto extends BaseChangeDataDto {
private String address; private String address;
@FieldDisplayDefine(value = "使用地点名称省")
private String provinceName;
@FieldDisplayDefine(value = "使用地点_市名称") @FieldDisplayDefine(value = "使用地点_市名称")
private String cityName; private String cityName;
...@@ -86,4 +108,19 @@ public class ProjectContraptionChangeDataDto extends BaseChangeDataDto { ...@@ -86,4 +108,19 @@ public class ProjectContraptionChangeDataDto extends BaseChangeDataDto {
@FieldDisplayDefine(value = " 装置结束位置", type = JSON.class) @FieldDisplayDefine(value = " 装置结束位置", type = JSON.class)
private String endLatitudeLongitude; private String endLatitudeLongitude;
@FieldDisplayDefine(value = "来源类型", isExist = false)
private String dataSource;
@FieldDisplayDefine(value = "使用单位名称", isExist = false)
private String useUnitCreditCode;
@FieldDisplayDefine(value = "使用单位统一信用代码", isExist = false)
private String useUnitName;
@FieldDisplayDefine(value = "施工单位统一信用代码", isExist = false)
private String uscUnitCreditCode;
@FieldDisplayDefine(value = "施工单位名称", isExist = false)
private String uscUnitName;
} }
...@@ -891,7 +891,15 @@ ...@@ -891,7 +891,15 @@
ibjtpp."REMARKS" AS remarks, ibjtpp."REMARKS" AS remarks,
ibjdi."DESIGN_UNIT_NAME" AS designUnitName, ibjdi."DESIGN_UNIT_NAME" AS designUnitName,
ibjui."USE_DATE" AS useDate, ibjui."USE_DATE" AS useDate,
ibjui."RECORD" AS record ibjui."RECORD" AS record,
(SELECT SEQUENCE_NBR from idx_biz_jg_construction_info where "RECORD" = ibjui."RECORD" ORDER BY USC_DATE DESC limit 1) constructionInfoSeq,
(SELECT USC_UNIT_NAME from idx_biz_jg_construction_info where "RECORD" = ibjui."RECORD" ORDER BY USC_DATE DESC limit 1) uscUnitName,
to_char((SELECT USC_DATE from idx_biz_jg_construction_info where "RECORD" = ibjui."RECORD" ORDER BY USC_DATE DESC limit 1), 'YYYY-MM') uscDate,
(select SEQUENCE_NBR from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) jySeq,
(select INSPECT_ORG_NAME from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) inspectOrgName,
(select INSPECT_CONCLUSION from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) inspectConclusion,
to_char((select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1), 'YYYY-MM-DD') nextInspectDate,
(select INSPECT_REPORT from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) inspectReport
FROM idx_biz_jg_use_info ibjui FROM idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_tech_params_pipeline ibjtpp ON ibjui.RECORD = ibjtpp.RECORD LEFT JOIN idx_biz_jg_tech_params_pipeline ibjtpp ON ibjui.RECORD = ibjtpp.RECORD
LEFT JOIN idx_biz_jg_design_info ibjdi ON ibjui.RECORD = ibjdi.RECORD LEFT JOIN idx_biz_jg_design_info ibjdi ON ibjui.RECORD = ibjdi.RECORD
......
...@@ -14,8 +14,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -14,8 +14,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.annotation.FieldDisplayDefine; import com.yeejoin.amos.boot.biz.common.annotation.FieldDisplayDefine;
import com.yeejoin.amos.boot.biz.common.annotation.Group; import com.yeejoin.amos.boot.biz.common.annotation.Group;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.typeHandler.TypeHandler;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.IBaseChangeData; import com.yeejoin.amos.boot.module.common.api.dto.IBaseChangeData;
import com.yeejoin.amos.boot.module.jg.api.dto.*; import com.yeejoin.amos.boot.module.jg.api.dto.*;
...@@ -23,10 +23,7 @@ import com.yeejoin.amos.boot.module.jg.api.enums.EquipSourceEnum; ...@@ -23,10 +23,7 @@ import com.yeejoin.amos.boot.module.jg.api.enums.EquipSourceEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper;
import com.yeejoin.amos.boot.module.jg.biz.edit.typeHandler.FormatService; import com.yeejoin.amos.boot.module.jg.biz.edit.typeHandler.FormatService;
import com.yeejoin.amos.boot.module.jg.biz.service.*; import com.yeejoin.amos.boot.module.jg.biz.service.*;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.CommonServiceImpl; import com.yeejoin.amos.boot.module.jg.biz.service.impl.*;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.IdxBizJgProjectContraptionServiceImpl;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.IdxBizJgUseInfoServiceImpl;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationServiceImpl;
import com.yeejoin.amos.boot.module.ymt.api.entity.*; import com.yeejoin.amos.boot.module.ymt.api.entity.*;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
...@@ -59,7 +56,6 @@ import java.lang.reflect.Field; ...@@ -59,7 +56,6 @@ import java.lang.reflect.Field;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
...@@ -77,6 +73,8 @@ import static com.yeejoin.amos.boot.module.jg.biz.service.impl.JgCertificateRepl ...@@ -77,6 +73,8 @@ import static com.yeejoin.amos.boot.module.jg.biz.service.impl.JgCertificateRepl
@Getter @Getter
public class CommonEquipDataProcessService { public class CommonEquipDataProcessService {
private final IdxBizJgConstructionInfoServiceImpl jgConstructionInfoService;
private final IdxBizJgDesignInfoMapper idxBizJgDesignInfoMapper; private final IdxBizJgDesignInfoMapper idxBizJgDesignInfoMapper;
private final IdxBizJgFactoryInfoMapper jgFactoryInfoMapper; private final IdxBizJgFactoryInfoMapper jgFactoryInfoMapper;
...@@ -121,6 +119,8 @@ public class CommonEquipDataProcessService { ...@@ -121,6 +119,8 @@ public class CommonEquipDataProcessService {
private final FormatService formatService; private final FormatService formatService;
private final IdxBizJgRegisterInfoServiceImpl jgRegisterInfoService;
public static final String BASE_COLUMN_REC_DATE = "\"REC_DATE\""; public static final String BASE_COLUMN_REC_DATE = "\"REC_DATE\"";
public static final String BASE_COLUMN_REC_USERID = "\"REC_USER_ID\""; public static final String BASE_COLUMN_REC_USERID = "\"REC_USER_ID\"";
...@@ -289,7 +289,7 @@ public class CommonEquipDataProcessService { ...@@ -289,7 +289,7 @@ public class CommonEquipDataProcessService {
} }
}); });
List<FieldChangeMeta> up = changeDataNew.stream().filter(n -> !StringUtils.equals(n.getColumnNewValue(), n.getColumnOldValue())).collect(Collectors.toList()); List<FieldChangeMeta> up = changeDataNew.stream().filter(n -> !StringUtils.equals(n.getColumnNewValue(), n.getColumnOldValue())).collect(Collectors.toList());
up.forEach(fieldChangeMeta->{ up.forEach(fieldChangeMeta -> {
fieldChangeMeta.setDisplayOldValue(formatService.format(fieldChangeMeta.getFieldDisplayDefine(), fieldChangeMeta.getColumnOldValue())); fieldChangeMeta.setDisplayOldValue(formatService.format(fieldChangeMeta.getFieldDisplayDefine(), fieldChangeMeta.getColumnOldValue()));
fieldChangeMeta.setDisplayNewValue(formatService.format(fieldChangeMeta.getFieldDisplayDefine(), fieldChangeMeta.getColumnNewValue())); fieldChangeMeta.setDisplayNewValue(formatService.format(fieldChangeMeta.getFieldDisplayDefine(), fieldChangeMeta.getColumnNewValue()));
}); });
...@@ -914,7 +914,7 @@ public class CommonEquipDataProcessService { ...@@ -914,7 +914,7 @@ public class CommonEquipDataProcessService {
Page<IdxBizJgProjectContraption> page = new Page<>(); Page<IdxBizJgProjectContraption> page = new Page<>();
page.setCurrent(params.getLong("current")); page.setCurrent(params.getLong("current"));
page.setSize(params.getLong("size")); page.setSize(params.getLong("size"));
if(projectContraptionIds.isEmpty()){ if (projectContraptionIds.isEmpty()) {
return page; return page;
} }
// 工程装置名称 // 工程装置名称
...@@ -979,4 +979,45 @@ public class CommonEquipDataProcessService { ...@@ -979,4 +979,45 @@ public class CommonEquipDataProcessService {
equipChangeDataUpdateServiceImpl.updateInspectInfoEs(record, equipUseInfoChangeDataDto); equipChangeDataUpdateServiceImpl.updateInspectInfoEs(record, equipUseInfoChangeDataDto);
} }
} }
public void setNameByCode2UseInfo(IdxBizJgUseInfo useInfoNew) {
// 1.使用地点name冗余
// 市
List<LinkedHashMap> city = (List<LinkedHashMap>) this.getRedisUtils().get("CITY");
// 区
List<LinkedHashMap> region = (List<LinkedHashMap>) this.getRedisUtils().get("REGION");
// 街道
List<LinkedHashMap> street = (List<LinkedHashMap>) this.getRedisUtils().get("STREET");
// 城市
if (StringUtils.isNotEmpty(useInfoNew.getCity()) && !org.apache.commons.lang3.ObjectUtils.isEmpty(city)) {
city.forEach(item -> {
if (String.valueOf(item.get("regionCode")).equals(useInfoNew.getCity())) {
useInfoNew.setCityName(String.valueOf(item.get("regionName")));
}
});
}
// 区县
if (StringUtils.isNotEmpty(useInfoNew.getCounty()) && !org.apache.commons.lang3.ObjectUtils.isEmpty(region)) {
region.forEach(item -> {
if (String.valueOf(item.get("regionCode")).equals(useInfoNew.getCounty())) {
useInfoNew.setCountyName(String.valueOf(item.get("regionName")));
}
});
}
// 街道
if (StringUtils.isNotEmpty(useInfoNew.getFactoryUseSiteStreet()) && !org.apache.commons.lang3.ObjectUtils.isEmpty(street)) {
street.forEach(item -> {
if (String.valueOf(item.get("regionCode")).equals(useInfoNew.getFactoryUseSiteStreet())) {
useInfoNew.setStreetName(String.valueOf(item.get("regionName")));
}
});
}
// 2.产权单位名称冗余
// 产权单位信息
if (StringUtils.isNotEmpty(useInfoNew.getEstateUnitCreditCode())) {
CompanyBo companyBo = this.getCommonMapper().queryCompanyByCode(useInfoNew.getEstateUnitCreditCode());
Optional.ofNullable(companyBo).ifPresent(item -> useInfoNew.setEstateUnitName(companyBo.getCompanyName()));
}
}
} }
...@@ -37,7 +37,7 @@ public class SingleEquipChangeProcess implements IEquipChangeDataProcessStrategy ...@@ -37,7 +37,7 @@ public class SingleEquipChangeProcess implements IEquipChangeDataProcessStrategy
IdxBizJgUseInfo useInfoNew = BeanUtil.copyProperties(useInfoOld, IdxBizJgUseInfo.class); IdxBizJgUseInfo useInfoNew = BeanUtil.copyProperties(useInfoOld, IdxBizJgUseInfo.class);
CommonEquipDataProcessService.castMap2Bean(changeJson, useInfoNew); CommonEquipDataProcessService.castMap2Bean(changeJson, useInfoNew);
useInfoNew.setSequenceNbr(useInfoOld.getSequenceNbr()); useInfoNew.setSequenceNbr(useInfoOld.getSequenceNbr());
this.setNameByCode2UseInfo(useInfoNew); commonEquipDataProcessService.setNameByCode2UseInfo(useInfoNew);
IdxBizJgRegisterInfo registerInfoOld = commonEquipDataProcessService.getJgUseRegistrationService().getIdxBizJgRegisterInfoService().getOne(new LambdaQueryWrapper<IdxBizJgRegisterInfo>().eq(IdxBizJgRegisterInfo::getRecord, record)); IdxBizJgRegisterInfo registerInfoOld = commonEquipDataProcessService.getJgUseRegistrationService().getIdxBizJgRegisterInfoService().getOne(new LambdaQueryWrapper<IdxBizJgRegisterInfo>().eq(IdxBizJgRegisterInfo::getRecord, record));
IdxBizJgRegisterInfo registerInfoNew = BeanUtil.copyProperties(registerInfoOld, IdxBizJgRegisterInfo.class); IdxBizJgRegisterInfo registerInfoNew = BeanUtil.copyProperties(registerInfoOld, IdxBizJgRegisterInfo.class);
...@@ -140,46 +140,7 @@ public class SingleEquipChangeProcess implements IEquipChangeDataProcessStrategy ...@@ -140,46 +140,7 @@ public class SingleEquipChangeProcess implements IEquipChangeDataProcessStrategy
} }
} }
private void setNameByCode2UseInfo(IdxBizJgUseInfo useInfoNew) {
// 1.使用地点name冗余
// 市
List<LinkedHashMap> city = (List<LinkedHashMap>) commonEquipDataProcessService.getRedisUtils().get("CITY");
// 区
List<LinkedHashMap> region = (List<LinkedHashMap>) commonEquipDataProcessService.getRedisUtils().get("REGION");
// 街道
List<LinkedHashMap> street = (List<LinkedHashMap>) commonEquipDataProcessService.getRedisUtils().get("STREET");
// 城市
if (StringUtils.isNotEmpty(useInfoNew.getCity()) && !ObjectUtils.isEmpty(city)) {
city.forEach(item -> {
if (String.valueOf(item.get("regionCode")).equals(useInfoNew.getCity())) {
useInfoNew.setCityName(String.valueOf(item.get("regionName")));
}
});
}
// 区县
if (StringUtils.isNotEmpty(useInfoNew.getCounty()) && !ObjectUtils.isEmpty(region)) {
region.forEach(item -> {
if (String.valueOf(item.get("regionCode")).equals(useInfoNew.getCounty())) {
useInfoNew.setCountyName(String.valueOf(item.get("regionName")));
}
});
}
// 街道
if (StringUtils.isNotEmpty(useInfoNew.getFactoryUseSiteStreet()) && !ObjectUtils.isEmpty(street)) {
street.forEach(item -> {
if (String.valueOf(item.get("regionCode")).equals(useInfoNew.getFactoryUseSiteStreet())) {
useInfoNew.setStreetName(String.valueOf(item.get("regionName")));
}
});
}
// 2.产权单位名称冗余
// 产权单位信息
if (StringUtils.isNotEmpty(useInfoNew.getEstateUnitCreditCode())) {
CompanyBo companyBo = commonEquipDataProcessService.getCommonMapper().queryCompanyByCode(useInfoNew.getEstateUnitCreditCode());
Optional.ofNullable(companyBo).ifPresent(item -> useInfoNew.setEstateUnitName(companyBo.getCompanyName()));
}
}
private void beforeCheckForUseOrgCode(IdxBizJgUseInfo useInfoOld, IdxBizJgRegisterInfo registerInfoNew) { private void beforeCheckForUseOrgCode(IdxBizJgUseInfo useInfoOld, IdxBizJgRegisterInfo registerInfoNew) {
// 1.使用登记证编辑时重复性校验 // 1.使用登记证编辑时重复性校验
......
...@@ -4,14 +4,14 @@ import cn.hutool.core.bean.BeanUtil; ...@@ -4,14 +4,14 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.text.CharSequenceUtil; import cn.hutool.core.text.CharSequenceUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.jg.api.dto.FieldChangeMeta; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.jg.api.dto.PipelineChangeItemDto; import com.yeejoin.amos.boot.module.jg.api.dto.*;
import com.yeejoin.amos.boot.module.jg.api.dto.ProjectContraptionChangeDataDto;
import com.yeejoin.amos.boot.module.jg.api.dto.TechParamsPipelineChangeFieldDto;
import com.yeejoin.amos.boot.module.jg.api.dto.RequestChangeData;
import com.yeejoin.amos.boot.module.jg.biz.edit.process.biz.DefaultBizDataChangeHandler; import com.yeejoin.amos.boot.module.jg.biz.edit.process.biz.DefaultBizDataChangeHandler;
import com.yeejoin.amos.boot.module.jg.biz.edit.process.biz.strategy.IBizDataChangeHandleStrategy; import com.yeejoin.amos.boot.module.jg.biz.edit.process.biz.strategy.IBizDataChangeHandleStrategy;
import com.yeejoin.amos.boot.module.jg.biz.edit.process.equip.strategy.IEquipChangeDataProcessStrategy; import com.yeejoin.amos.boot.module.jg.biz.edit.process.equip.strategy.IEquipChangeDataProcessStrategy;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgConstructionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -58,13 +58,19 @@ public class SingleProjectEquipChangeProcess implements IEquipChangeDataProcessS ...@@ -58,13 +58,19 @@ public class SingleProjectEquipChangeProcess implements IEquipChangeDataProcessS
items.forEach(item -> { items.forEach(item -> {
String record = item.getRecord(); String record = item.getRecord();
if (record == null) { // 新增的管道逻辑 if (record == null) { // 新增的管道逻辑
pieLineDataChangeService.newPieLine(projectContraptionChangeDataDto.getProjectContraptionId(), item, allChangeColumns, projectContraptionId); pieLineDataChangeService.newPieLine(projectContraptionChangeDataDto, item, allChangeColumns);
} else { // 更新逻辑 } else { // 更新管道逻辑
// 基本信息
this.updateUseInfo(item, projectContraptionChangeDataDto, allChangeColumns);
// 安装信息
this.updateConstructionInfo(item, projectContraptionChangeDataDto, allChangeColumns);
// 检验信息
this.updateInspectInfo(item, projectContraptionChangeDataDto, allChangeColumns);
// 设计信息更新 // 设计信息更新
pieLineDataChangeService.saveDesignForPieLine(record, allChangeColumns, item); pieLineDataChangeService.saveDesignForPieLine(record, allChangeColumns, item);
// 技术参数入库保存 // 技术参数入库保存
TechParamsPipelineChangeFieldDto paramsPipelineChangeFieldDto = new TechParamsPipelineChangeFieldDto(); TechParamsPipelineChangeFieldDto paramsPipelineChangeFieldDto = new TechParamsPipelineChangeFieldDto();
BeanUtil.copyProperties(item, paramsPipelineChangeFieldDto, false); BeanUtil.copyProperties(item, paramsPipelineChangeFieldDto, true);
commonEquipDataProcessService.savePieLineTechParam(record, allChangeColumns, paramsPipelineChangeFieldDto); commonEquipDataProcessService.savePieLineTechParam(record, allChangeColumns, paramsPipelineChangeFieldDto);
} }
}); });
...@@ -73,6 +79,62 @@ public class SingleProjectEquipChangeProcess implements IEquipChangeDataProcessS ...@@ -73,6 +79,62 @@ public class SingleProjectEquipChangeProcess implements IEquipChangeDataProcessS
return allChangeColumns; return allChangeColumns;
} }
private void updateInspectInfo(PipelineChangeItemDto item, ProjectContraptionChangeDataDto projectContraptionChangeDataDto, List<FieldChangeMeta> allChangeColumns) {
String jySeq = item.getJySeq();
if (jySeq != null) {
IdxBizJgInspectionDetectionInfo inspectionDetectionInfoOld = commonEquipDataProcessService.getJgUseRegistrationService().getInspectionDetectionInfoService().getById(jySeq);
IdxBizJgInspectionDetectionInfo inspectionDetectionInfoNew = new IdxBizJgInspectionDetectionInfo();
BeanUtil.copyProperties(inspectionDetectionInfoOld, inspectionDetectionInfoNew, true);
BeanUtil.copyProperties(item, inspectionDetectionInfoNew, true);
inspectionDetectionInfoNew.setSequenceNbr(inspectionDetectionInfoOld.getSequenceNbr());
List<FieldChangeMeta> inspectionFieldChangeMetas = commonEquipDataProcessService.simpleTrackAndUpdate(commonEquipDataProcessService.getJgUseRegistrationService().getInspectionDetectionInfoService().getBaseMapper(), inspectionDetectionInfoOld, inspectionDetectionInfoNew, projectContraptionChangeDataDto.getProjectContraptionId() + "/" + item.getRecord(), "SEQUENCE_NBR", inspectionDetectionInfoOld.getSequenceNbr());
allChangeColumns.addAll(inspectionFieldChangeMetas);
commonEquipDataProcessService.updateEsDataOfEquip(item.getRecord(), inspectionDetectionInfoNew);
}
}
private void updateConstructionInfo(PipelineChangeItemDto item, ProjectContraptionChangeDataDto projectContraptionChangeDataDto, List<FieldChangeMeta> allChangeColumns) {
String constructionInfoSeq = item.getConstructionInfoSeq();
if (constructionInfoSeq != null) {
IdxBizJgConstructionInfo constructionInfoOld = commonEquipDataProcessService.getJgUseRegistrationService().getIdxBizJgConstructionInfoService().getById(constructionInfoSeq);
IdxBizJgConstructionInfo constructionInfoNew = new IdxBizJgConstructionInfo();
BeanUtil.copyProperties(constructionInfoOld, constructionInfoNew, true);
BeanUtil.copyProperties(item, constructionInfoNew, true);
constructionInfoNew.setSequenceNbr(constructionInfoOld.getSequenceNbr());
List<FieldChangeMeta> constructionInfoFieldChangeMetas = commonEquipDataProcessService.simpleTrackAndUpdate(commonEquipDataProcessService.getJgUseRegistrationService().getIdxBizJgConstructionInfoService().getBaseMapper(), constructionInfoOld, constructionInfoNew, projectContraptionChangeDataDto.getProjectContraptionId() + "/" + item.getRecord(), "SEQUENCE_NBR", constructionInfoOld.getSequenceNbr());
allChangeColumns.addAll(constructionInfoFieldChangeMetas);
}
}
private void updateUseInfo(PipelineChangeItemDto updatePieLine, ProjectContraptionChangeDataDto projectContraptionChangeDataDto, List<FieldChangeMeta> allChangeColumns) {
IdxBizJgUseInfo useInfoOld = commonEquipDataProcessService.getJgUseRegistrationService().getUseInfoMapper().selectOne(new LambdaQueryWrapper<IdxBizJgUseInfo>().eq(IdxBizJgUseInfo::getRecord, updatePieLine.getRecord()));
IdxBizJgUseInfo useInfoNew = new IdxBizJgUseInfo();
BeanUtil.copyProperties(useInfoOld, useInfoNew, true);
BeanUtil.copyProperties(updatePieLine, useInfoNew, true);
useInfoNew.setSequenceNbr(useInfoOld.getSequenceNbr());
setNewUseAddressInfo(projectContraptionChangeDataDto, useInfoNew);
// 冗余的字典名称字段更新
commonEquipDataProcessService.setNameByCode2UseInfo(useInfoNew);
List<FieldChangeMeta> useInfoFieldChangeMetas = commonEquipDataProcessService.simpleTrackAndUpdate(commonEquipDataProcessService.getJgUseRegistrationService().getUseInfoMapper(), useInfoOld, useInfoNew, projectContraptionChangeDataDto.getProjectContraptionId() + "/" + useInfoNew.getRecord(), "record", useInfoNew.getRecord());
allChangeColumns.addAll(useInfoFieldChangeMetas);
}
static void setNewUseAddressInfo(ProjectContraptionChangeDataDto projectContraptionChangeDataDto, IdxBizJgUseInfo useInfoNew) {
useInfoNew.setUseUnitCreditCode(projectContraptionChangeDataDto.getUseUnitCreditCode());
useInfoNew.setUseUnitName(projectContraptionChangeDataDto.getUseUnitName());
useInfoNew.setProjectContraption(projectContraptionChangeDataDto.getProjectContraption());
useInfoNew.setProjectContraptionId(projectContraptionChangeDataDto.getProjectContraptionId());
useInfoNew.setProvince(projectContraptionChangeDataDto.getProvince());
useInfoNew.setProvinceName(projectContraptionChangeDataDto.getProvinceName());
useInfoNew.setCity(projectContraptionChangeDataDto.getCity());
useInfoNew.setCityName(projectContraptionChangeDataDto.getCityName());
useInfoNew.setCounty(projectContraptionChangeDataDto.getCounty());
useInfoNew.setCountyName(projectContraptionChangeDataDto.getCountyName());
useInfoNew.setFactoryUseSiteStreet(projectContraptionChangeDataDto.getStreet());
useInfoNew.setStreetName(projectContraptionChangeDataDto.getStreetName());
useInfoNew.setAddress(projectContraptionChangeDataDto.getAddress());
}
private void setNameForDictKey(ProjectContraptionChangeDataDto projectContraptionChangeDataDto) { private void setNameForDictKey(ProjectContraptionChangeDataDto projectContraptionChangeDataDto) {
// 1.使用地点name冗余 // 1.使用地点name冗余
// 市 // 市
......
...@@ -22,9 +22,9 @@ public class EquipCategoryTypeHandler implements TypeHandler<String> { ...@@ -22,9 +22,9 @@ public class EquipCategoryTypeHandler implements TypeHandler<String> {
@Override @Override
public String handle(String code) { public String handle(String code) {
return CODE_NAME_MAP.computeIfAbsent(code, (k) -> { return code != null ? CODE_NAME_MAP.computeIfAbsent(code, (k) -> {
EquipmentCategory equipmentCategory = equipmentCategoryMapper.selectOne(new LambdaQueryWrapper<EquipmentCategory>().eq(EquipmentCategory::getCode, code).select(EquipmentCategory::getName, EquipmentCategory::getId)); EquipmentCategory equipmentCategory = equipmentCategoryMapper.selectOne(new LambdaQueryWrapper<EquipmentCategory>().eq(EquipmentCategory::getCode, code).select(EquipmentCategory::getName, EquipmentCategory::getId));
return equipmentCategory == null ? "" : equipmentCategory.getName(); return equipmentCategory == null ? "" : equipmentCategory.getName();
}); }) : null;
} }
} }
...@@ -20,6 +20,7 @@ public class EstateUnitTypeHandler implements TypeHandler<String> { ...@@ -20,6 +20,7 @@ public class EstateUnitTypeHandler implements TypeHandler<String> {
@Override @Override
public String handle(String unitCreditCode) { public String handle(String unitCreditCode) {
return CODE_NAME_MAP.computeIfAbsent(unitCreditCode, (k) -> commonMapper.queryUnitNameByCreditCode(unitCreditCode)); return unitCreditCode != null ? CODE_NAME_MAP.computeIfAbsent(unitCreditCode,
(k) -> commonMapper.queryUnitNameByCreditCode(unitCreditCode)) : null;
} }
} }
...@@ -22,13 +22,13 @@ public class RegionCodeTypeHandler implements TypeHandler<String> { ...@@ -22,13 +22,13 @@ public class RegionCodeTypeHandler implements TypeHandler<String> {
@Override @Override
public String handle(String regionCode) { public String handle(String regionCode) {
return CODE_NAME_MAP.computeIfAbsent(regionCode, (k) -> { return regionCode != null ? CODE_NAME_MAP.computeIfAbsent(regionCode, (k) -> {
List<LinkedHashMap> list1 = (List<LinkedHashMap>) redisUtils.get(CommonServiceImpl.PROVINCE); List<LinkedHashMap> list1 = (List<LinkedHashMap>) redisUtils.get(CommonServiceImpl.PROVINCE);
List<LinkedHashMap> list2 = (List<LinkedHashMap>) redisUtils.get(CommonServiceImpl.CITY); List<LinkedHashMap> list2 = (List<LinkedHashMap>) redisUtils.get(CommonServiceImpl.CITY);
List<LinkedHashMap> list3 = (List<LinkedHashMap>) redisUtils.get(CommonServiceImpl.REGION); List<LinkedHashMap> list3 = (List<LinkedHashMap>) redisUtils.get(CommonServiceImpl.REGION);
List<LinkedHashMap> list4 = (List<LinkedHashMap>) redisUtils.get(CommonServiceImpl.STREET); List<LinkedHashMap> list4 = (List<LinkedHashMap>) redisUtils.get(CommonServiceImpl.STREET);
Optional<LinkedHashMap> op = Stream.of(list1, list2, list3, list4).flatMap(Collection::stream).filter(item -> String.valueOf(item.get("regionCode")).trim().equals(regionCode)).findFirst(); Optional<LinkedHashMap> op = Stream.of(list1, list2, list3, list4).flatMap(Collection::stream).filter(item -> String.valueOf(item.get("regionCode")).trim().equals(regionCode)).findFirst();
return op.map(linkedHashMap -> linkedHashMap.get("regionName").toString()).orElse(null); return op.map(linkedHashMap -> linkedHashMap.get("regionName").toString()).orElse(null);
}); }) : null;
} }
} }
...@@ -77,6 +77,7 @@ public class IdxBizJgInspectionDetectionInfo extends TzsBaseEntity implements IB ...@@ -77,6 +77,7 @@ public class IdxBizJgInspectionDetectionInfo extends TzsBaseEntity implements IB
* *
*/ */
@TableField("\"INSPECT_STAFF\"") @TableField("\"INSPECT_STAFF\"")
@FieldDisplayDefine(value ="检验人员")
private String inspectStaff; private String inspectStaff;
/** /**
......
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