Commit d1d2375a authored by suhuiguang's avatar suhuiguang

refactor(大编辑):代码重构

1.公共编辑接口 2.公共详情接口
parent 96b228a1
package com.yeejoin.amos.boot.module.jg.api.dto; package com.yeejoin.amos.boot.module.jg.api.dto;
import com.yeejoin.amos.boot.module.common.api.dto.IBaseChangeData;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
@Data @Data
public class BaseChangeDataDto implements Serializable { public class BaseChangeDataDto implements Serializable, IBaseChangeData {
private String changeId; private String changeId;
} }
...@@ -56,20 +56,20 @@ public class BizDataChangeController { ...@@ -56,20 +56,20 @@ public class BizDataChangeController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/v2/{bizType}/detail") @GetMapping(value = "/v2/{bizType}/detail")
@ApiOperation(value = "编辑一级页面详情查询--通用", httpMethod = "GET") @ApiOperation(value = "编辑一级页面详情查询--通用", httpMethod = "GET")
public ResponseModel<IPage<?>> getDetailV2(@RequestParam String applyNo, public ResponseModel<IPage<?>> getDetailV2(@ApiParam(value = "单据编号或者设备装置唯一标识") @RequestParam String applyNo,
@PathVariable String bizType, @ApiParam(value = "业务类型") @PathVariable String bizType,
@RequestParam DetailType type, @ApiParam(value = "详情类型:设备、装置列表") @RequestParam DetailType type,
@RequestParam JSONObject searchParams) { @ApiParam(value = "查询参数") @RequestParam JSONObject searchParams) {
return ResponseHelper.buildResponse(bizDataChangeService.queryDetail(applyNo, bizType, type, searchParams)); return ResponseHelper.buildResponse(bizDataChangeService.queryDetail(applyNo, bizType, type, searchParams));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/v2/{bizType}/sub-detail") @GetMapping(value = "/v2/{bizType}/sub-detail")
@ApiOperation(value = "编辑二级页面详情查询--通用", httpMethod = "GET") @ApiOperation(value = "编辑二级页面详情查询--通用", httpMethod = "GET")
public ResponseModel<Map<String, ?>> getSubDetailV2(@RequestParam String bizId, public ResponseModel<Map<String, ?>> getSubDetailV2(@ApiParam(value = "设备或者装置唯一标识") @RequestParam String bizId,
@RequestParam(required = false) String applyNo, @ApiParam(value = "单据编号") @RequestParam(required = false) String applyNo,
@RequestParam DetailType type, @ApiParam(value = "详情类型:设备、装置") @RequestParam DetailType type,
@PathVariable String bizType) { @ApiParam(value = "业务类型") @PathVariable String bizType) {
return ResponseHelper.buildResponse(bizDataChangeService.querySubDetail(applyNo, bizId, bizType, type)); return ResponseHelper.buildResponse(bizDataChangeService.querySubDetail(applyNo, bizId, bizType, type));
} }
...@@ -89,8 +89,8 @@ public class BizDataChangeController { ...@@ -89,8 +89,8 @@ public class BizDataChangeController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/v2/{bizType}/change-logs") @GetMapping(value = "/v2/{bizType}/change-logs")
@ApiOperation(value = "编辑二级页面详情查询--通用", httpMethod = "GET") @ApiOperation(value = "编辑二级页面详情查询--通用", httpMethod = "GET")
public ResponseModel<IPage<?>> getChangeLogPage(@RequestParam String bizId, public ResponseModel<IPage<?>> getChangeLogPage(@ApiParam(value = "设备或者装置唯一标识") @RequestParam String bizId,
@PathVariable String bizType) { @ApiParam(required = true, value = "业务类型") @PathVariable String bizType) {
return ResponseHelper.buildResponse(bizDataChangeService.getChangeLogPage(bizId, bizType)); return ResponseHelper.buildResponse(bizDataChangeService.getChangeLogPage(bizId, bizType));
} }
} }
package com.yeejoin.amos.boot.module.jg.biz.edit.process.biz.installNotice; package com.yeejoin.amos.boot.module.jg.biz.edit.process.biz.installNotice;
import com.yeejoin.amos.boot.module.jg.api.dto.FieldChangeMeta; import com.yeejoin.amos.boot.module.jg.api.dto.FieldChangeMeta;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.biz.edit.core.RouterEventPublisher; import com.yeejoin.amos.boot.module.jg.biz.edit.core.RouterEventPublisher;
import com.yeejoin.amos.boot.module.jg.biz.edit.event.BaseBizDataChangeEvent; import com.yeejoin.amos.boot.module.jg.biz.edit.event.BaseBizDataChangeEvent;
import com.yeejoin.amos.boot.module.jg.biz.edit.process.biz.DefaultBizDataChangeHandler; import com.yeejoin.amos.boot.module.jg.biz.edit.process.biz.DefaultBizDataChangeHandler;
...@@ -20,7 +21,7 @@ public class InstallNoticeDataChangeHandler extends DefaultBizDataChangeHandler< ...@@ -20,7 +21,7 @@ public class InstallNoticeDataChangeHandler extends DefaultBizDataChangeHandler<
@Override @Override
public String canHandleBizType() { public String canHandleBizType() {
return "installationNotice"; return BusinessTypeEnum.JG_INSTALLATION_NOTIFICATION.name();
} }
@Override @Override
......
...@@ -63,8 +63,7 @@ public interface IBizDataChangeHandleStrategy { ...@@ -63,8 +63,7 @@ public interface IBizDataChangeHandleStrategy {
*/ */
enum ModelType { enum ModelType {
singleProject, singleProject,
singleEquip, singleEquip
singleCylinder
} }
void doSave(String applyNo, ModelType model, Map<String, Object> changeData); void doSave(String applyNo, ModelType model, Map<String, Object> changeData);
......
...@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; ...@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.jg.api.dto.FieldChangeMeta; import com.yeejoin.amos.boot.module.jg.api.dto.FieldChangeMeta;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration; import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationEq; import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationEq;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.biz.controller.BizDataChangeController; import com.yeejoin.amos.boot.module.jg.biz.controller.BizDataChangeController;
import com.yeejoin.amos.boot.module.jg.biz.edit.core.RouterEventPublisher; import com.yeejoin.amos.boot.module.jg.biz.edit.core.RouterEventPublisher;
import com.yeejoin.amos.boot.module.jg.biz.edit.event.BaseBizDataChangeEvent; import com.yeejoin.amos.boot.module.jg.biz.edit.event.BaseBizDataChangeEvent;
...@@ -31,7 +32,7 @@ public class UseRegisterDataChangeHandler extends DefaultBizDataChangeHandler<Ba ...@@ -31,7 +32,7 @@ public class UseRegisterDataChangeHandler extends DefaultBizDataChangeHandler<Ba
@Override @Override
public String canHandleBizType() { public String canHandleBizType() {
return "useRegistration"; return BusinessTypeEnum.JG_USAGE_REGISTRATION.name();
} }
......
...@@ -29,6 +29,7 @@ import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgDesignInfoMapper; ...@@ -29,6 +29,7 @@ import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgDesignInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgFactoryInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgFactoryInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgOtherInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgOtherInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgRegisterInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgRegisterInfoMapper;
import lombok.Getter;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -66,6 +67,7 @@ import static com.yeejoin.amos.boot.module.jg.biz.service.impl.JgCertificateRepl ...@@ -66,6 +67,7 @@ import static com.yeejoin.amos.boot.module.jg.biz.service.impl.JgCertificateRepl
@Component @Component
@RequiredArgsConstructor @RequiredArgsConstructor
@Slf4j @Slf4j
@Getter
public class CommonEquipDataProcessService { public class CommonEquipDataProcessService {
private final IdxBizJgDesignInfoMapper idxBizJgDesignInfoMapper; private final IdxBizJgDesignInfoMapper idxBizJgDesignInfoMapper;
...@@ -104,6 +106,7 @@ public class CommonEquipDataProcessService { ...@@ -104,6 +106,7 @@ public class CommonEquipDataProcessService {
private final JgUseRegistrationServiceImpl jgUseRegistrationService; private final JgUseRegistrationServiceImpl jgUseRegistrationService;
@PostConstruct @PostConstruct
public void init() { public void init() {
Set<Class<? extends IBaseChangeData>> subClasses = getAllSubClasses(); Set<Class<? extends IBaseChangeData>> subClasses = getAllSubClasses();
...@@ -148,6 +151,24 @@ public class CommonEquipDataProcessService { ...@@ -148,6 +151,24 @@ public class CommonEquipDataProcessService {
} }
} }
public void checkValidField2(String record, IBaseChangeData changeDataDto, String equList, String equCategory, String equDefine) {
// 注册信息
if (changeDataDto instanceof IdxBizJgRegisterInfo) {
IdxBizJgRegisterInfo registerChangeDataDto = (IdxBizJgRegisterInfo) changeDataDto;
equipChangeDataUpdateServiceImpl.checkRegisterChangeData(record, registerChangeDataDto);
}
// 制造信息
if (changeDataDto instanceof IdxBizJgFactoryInfo) {
IdxBizJgFactoryInfo equipFactoryChangeDataDto = (IdxBizJgFactoryInfo) changeDataDto;
equipChangeDataUpdateServiceImpl.checkFactoryChangeData(record, equipFactoryChangeDataDto, equList, equCategory, equDefine);
}
// 设计信息
if (changeDataDto instanceof IdxBizJgDesignInfo) {
IdxBizJgDesignInfo equipDesignChangeDataDto = (IdxBizJgDesignInfo) changeDataDto;
equipChangeDataUpdateServiceImpl.checkDesignChangeData(record, equipDesignChangeDataDto);
}
}
public void buildChangeFields(String record, EquipDesignChangeDataDto equipDesignChangeDataDto, EquipFactoryChangeDataDto equipFactoryChangeDataDto, EquipRegisterChangeDataDto registerChangeDataDto, EquipOtherInfoChangeDataDto otherInfoChangeDataDto, EquipUseInfoChangeDataDto useInfoChangeDataDto, List<FieldChangeMeta> allChangeColumns) { public void buildChangeFields(String record, EquipDesignChangeDataDto equipDesignChangeDataDto, EquipFactoryChangeDataDto equipFactoryChangeDataDto, EquipRegisterChangeDataDto registerChangeDataDto, EquipOtherInfoChangeDataDto otherInfoChangeDataDto, EquipUseInfoChangeDataDto useInfoChangeDataDto, List<FieldChangeMeta> allChangeColumns) {
// 构造新对象行转列 // 构造新对象行转列
...@@ -191,6 +212,7 @@ public class CommonEquipDataProcessService { ...@@ -191,6 +212,7 @@ public class CommonEquipDataProcessService {
allChangeColumns.addAll(mergeChangeFields(useInfoChangeNew, useInfoOld)); allChangeColumns.addAll(mergeChangeFields(useInfoChangeNew, useInfoOld));
} }
/** /**
* 业务处理-业务对象 * 业务处理-业务对象
* *
...@@ -319,8 +341,8 @@ public class CommonEquipDataProcessService { ...@@ -319,8 +341,8 @@ public class CommonEquipDataProcessService {
} }
void updateTechParamInfo(EquipRegisterChangeDataDto equipRegisterChangeDataDto, String record, Map<String, Object> changeData, List<FieldChangeMeta> allChange) { void updateTechParamInfo(String equListCode, String record, Map<String, Object> changeData, List<FieldChangeMeta> allChange) {
EquipmentClassifityEnum equipmentClassifityEnum = EquipmentClassifityEnum.getOne(equipRegisterChangeDataDto.getEquList()); EquipmentClassifityEnum equipmentClassifityEnum = EquipmentClassifityEnum.getOne(equListCode);
switch (Objects.requireNonNull(equipmentClassifityEnum)) { switch (Objects.requireNonNull(equipmentClassifityEnum)) {
case GL: case GL:
// 锅炉 // 锅炉
...@@ -861,4 +883,33 @@ public class CommonEquipDataProcessService { ...@@ -861,4 +883,33 @@ public class CommonEquipDataProcessService {
} }
return pageList; return pageList;
} }
public void updateEsDataOfEquip(String record, IBaseChangeData changeDataDto) {
// 注册信息
if (changeDataDto instanceof IdxBizJgRegisterInfo) {
IdxBizJgRegisterInfo registerChangeDataDto = (IdxBizJgRegisterInfo) changeDataDto;
equipChangeDataUpdateServiceImpl.updateRegisterEsData(record, registerChangeDataDto);
}
// 制造信息
if (changeDataDto instanceof IdxBizJgFactoryInfo) {
IdxBizJgFactoryInfo equipFactoryChangeDataDto = (IdxBizJgFactoryInfo) changeDataDto;
equipChangeDataUpdateServiceImpl.updateFactoryEsData(record, equipFactoryChangeDataDto);
}
// 设计信息
if (changeDataDto instanceof IdxBizJgDesignInfo) {
IdxBizJgDesignInfo equipDesignChangeDataDto = (IdxBizJgDesignInfo) changeDataDto;
equipChangeDataUpdateServiceImpl.checkDesignChangeData(record, equipDesignChangeDataDto);
}
// 使用信息
if (changeDataDto instanceof IdxBizJgUseInfo) {
IdxBizJgUseInfo equipUseInfoChangeDataDto = (IdxBizJgUseInfo) changeDataDto;
equipChangeDataUpdateServiceImpl.updateUseInfoEsData(record, equipUseInfoChangeDataDto);
}
// 检验信息
if (changeDataDto instanceof IdxBizJgInspectionDetectionInfo) {
IdxBizJgInspectionDetectionInfo equipUseInfoChangeDataDto = (IdxBizJgInspectionDetectionInfo) changeDataDto;
equipChangeDataUpdateServiceImpl.updateInspectInfoEs(record, equipUseInfoChangeDataDto);
}
}
} }
...@@ -119,8 +119,52 @@ public class EquipChangeDataUpdateServiceImpl { ...@@ -119,8 +119,52 @@ public class EquipChangeDataUpdateServiceImpl {
} }
} }
public void updateFactoryEsData(String record, IdxBizJgFactoryInfo equipFactoryChangeDataDto) {
// es 数据更新
Optional<ESEquipmentCategoryDto> optional = esEquipmentCategory.findById(record);
if (optional.isPresent()) {
ESEquipmentCategoryDto esEquipmentCategoryDto = optional.get();
esEquipmentCategoryDto.setPRODUCE_DATE(DateUtil.formatDate(equipFactoryChangeDataDto.getProduceDate()));
esEquipmentCategoryDto.setFACTORY_NUM(equipFactoryChangeDataDto.getFactoryNum());
esEquipmentCategoryDto.setPRODUCE_UNIT_NAME(equipFactoryChangeDataDto.getProduceUnitName());
esEquipmentCategory.save(esEquipmentCategoryDto);
}
}
public void updateRegisterEsData(String record, EquipRegisterChangeDataDto registerChangeDataDto) {
// es 数据更新
Optional<ESEquipmentCategoryDto> optional = esEquipmentCategory.findById(record);
if (optional.isPresent()) {
ESEquipmentCategoryDto esEquipmentCategoryDto = optional.get();
esEquipmentCategoryDto.setPRODUCT_NAME(registerChangeDataDto.getProductName());
esEquipmentCategoryDto.setEQU_CODE(registerChangeDataDto.getEquCode());
esEquipmentCategoryDto.setEQU_TYPE(registerChangeDataDto.getEquType());
esEquipmentCategoryDto.setEQU_CATEGORY_CODE(registerChangeDataDto.getEquCategory());
esEquipmentCategoryDto.setEQU_DEFINE_CODE(registerChangeDataDto.getEquDefine());
// 冗余设备类别名称
if (StringUtils.isEmpty(registerChangeDataDto.getEquCategory())) {
esEquipmentCategoryDto.setEQU_CATEGORY(null);
} else {
EquipmentCategory category = getEquipmentCategory(registerChangeDataDto.getEquCategory());
if (category != null) {
esEquipmentCategoryDto.setEQU_CATEGORY(category.getName());
}
}
// 冗余设备品种名称
if (StringUtils.isEmpty(registerChangeDataDto.getEquDefine())) {
esEquipmentCategoryDto.setEQU_DEFINE(null);
} else {
EquipmentCategory category = getEquipmentCategory(registerChangeDataDto.getEquDefine());
if (category != null) {
esEquipmentCategoryDto.setEQU_DEFINE(category.getName());
}
}
esEquipmentCategory.save(esEquipmentCategoryDto);
}
}
private void updateRegisterEsData(String record, EquipRegisterChangeDataDto registerChangeDataDto) { public void updateRegisterEsData(String record, IdxBizJgRegisterInfo registerChangeDataDto) {
// es 数据更新 // es 数据更新
Optional<ESEquipmentCategoryDto> optional = esEquipmentCategory.findById(record); Optional<ESEquipmentCategoryDto> optional = esEquipmentCategory.findById(record);
if (optional.isPresent()) { if (optional.isPresent()) {
...@@ -189,6 +233,16 @@ public class EquipChangeDataUpdateServiceImpl { ...@@ -189,6 +233,16 @@ public class EquipChangeDataUpdateServiceImpl {
} }
} }
public void checkFactoryChangeData(String record, IdxBizJgFactoryInfo equipFactoryChangeDataDto, String equList, String equCategory, String equDefine) {
// 气瓶时检验出厂编号-普通气瓶,车用气瓶不再此范围内
if (CylinderTypeEnum.CYLINDER.getCode().equals(equCategory) && StringUtils.isNotEmpty(equipFactoryChangeDataDto.getFactoryNum())) {
boolean isUsed = this.checkFactoryNumUnique(equipFactoryChangeDataDto.getFactoryNum(), record, equipFactoryChangeDataDto.getProduceUnitCreditCode());
if (isUsed) {
throw new BadRequest("出厂编号/产品编码在该企业中已存在!");
}
}
}
/** /**
* 普通气瓶检验-同制造单位下唯一 * 普通气瓶检验-同制造单位下唯一
* *
...@@ -211,6 +265,16 @@ public class EquipChangeDataUpdateServiceImpl { ...@@ -211,6 +265,16 @@ public class EquipChangeDataUpdateServiceImpl {
} }
} }
public void checkRegisterChangeData(String record, IdxBizJgRegisterInfo registerChangeDataDto) {
// 自行输入时,检验设备代码的全局唯一性
if (registerChangeDataDto.getEquCodeType().equals(EquCodeTypeEnum.INPUT.getCode()) && StringUtils.isNotEmpty(registerChangeDataDto.getEquCode())) {
Boolean isUsed = this.checkEquCodeUniqueness(registerChangeDataDto.getEquCode(), record);
if (isUsed) {
throw new BadRequest("设备代码:" + registerChangeDataDto.getEquCode() + "在系统中已存在!");
}
}
}
private Boolean checkEquCodeUniqueness(String equCode, String record) { private Boolean checkEquCodeUniqueness(String equCode, String record) {
// 根据设备代码检查唯一性 // 根据设备代码检查唯一性
...@@ -220,6 +284,9 @@ public class EquipChangeDataUpdateServiceImpl { ...@@ -220,6 +284,9 @@ public class EquipChangeDataUpdateServiceImpl {
public void checkDesignChangeData(String record, EquipDesignChangeDataDto equipDesignChangeDataDto) { public void checkDesignChangeData(String record, EquipDesignChangeDataDto equipDesignChangeDataDto) {
} }
public void checkDesignChangeData(String record, IdxBizJgDesignInfo equipDesignChangeDataDto) {
}
public void updatePieLineDesignData(String record, PieLineDesignChangeDataDto equipDesignChangeDataDto) { public void updatePieLineDesignData(String record, PieLineDesignChangeDataDto equipDesignChangeDataDto) {
LambdaUpdateWrapper<IdxBizJgDesignInfo> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<IdxBizJgDesignInfo> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(IdxBizJgDesignInfo::getRecord, record); updateWrapper.eq(IdxBizJgDesignInfo::getRecord, record);
...@@ -238,6 +305,18 @@ public class EquipChangeDataUpdateServiceImpl { ...@@ -238,6 +305,18 @@ public class EquipChangeDataUpdateServiceImpl {
this.updateUseInfoEsData(record, equipUseInfoChangeDataDto); this.updateUseInfoEsData(record, equipUseInfoChangeDataDto);
} }
public void updateUseInfoEsData(String record, IdxBizJgUseInfo equipUseInfoChangeDataDto) {
// es 数据更新
Optional<ESEquipmentCategoryDto> optional = esEquipmentCategory.findById(record);
if (optional.isPresent()) {
ESEquipmentCategoryDto esEquipmentCategoryDto = optional.get();
esEquipmentCategoryDto.setUSE_UNIT_CREDIT_CODE(equipUseInfoChangeDataDto.getUseUnitCreditCode());
esEquipmentCategoryDto.setUSC_UNIT_NAME(equipUseInfoChangeDataDto.getUseUnitName());
esEquipmentCategoryDto.setUSE_INNER_CODE(equipUseInfoChangeDataDto.getUseInnerCode());
esEquipmentCategory.save(esEquipmentCategoryDto);
}
}
private void updateUseInfoEsData(String record, EquipUseInfoChangeDataDto equipUseInfoChangeDataDto) { private void updateUseInfoEsData(String record, EquipUseInfoChangeDataDto equipUseInfoChangeDataDto) {
// es 数据更新 // es 数据更新
Optional<ESEquipmentCategoryDto> optional = esEquipmentCategory.findById(record); Optional<ESEquipmentCategoryDto> optional = esEquipmentCategory.findById(record);
...@@ -278,6 +357,16 @@ public class EquipChangeDataUpdateServiceImpl { ...@@ -278,6 +357,16 @@ public class EquipChangeDataUpdateServiceImpl {
} }
} }
public void updateInspectInfoEs(String record, IdxBizJgInspectionDetectionInfo equipUseInfoChangeDataDto) {
// es 数据更新
Optional<ESEquipmentCategoryDto> optional = esEquipmentCategory.findById(record);
if (optional.isPresent()) {
ESEquipmentCategoryDto esEquipmentCategoryDto = optional.get();
esEquipmentCategoryDto.setNEXT_INSPECT_DATE(DateUtil.parse(DateUtil.format(equipUseInfoChangeDataDto.getNextInspectDate(), DatePattern.NORM_DATE_PATTERN)).getTime());
esEquipmentCategory.save(esEquipmentCategoryDto);
}
}
public void updateOtherInfoChangeData(String record, EquipOtherInfoChangeDataDto otherInfoChangeDataDto) { public void updateOtherInfoChangeData(String record, EquipOtherInfoChangeDataDto otherInfoChangeDataDto) {
LambdaUpdateWrapper<IdxBizJgOtherInfo> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<IdxBizJgOtherInfo> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(IdxBizJgOtherInfo::getRecord, record); updateWrapper.eq(IdxBizJgOtherInfo::getRecord, record);
......
package com.yeejoin.amos.boot.module.jg.biz.edit.process.equip;
import com.yeejoin.amos.boot.module.jg.api.dto.*;
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.equip.strategy.IEquipChangeDataProcessStrategy;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 批量维护气瓶-策略实现类
*/
@Component
@RequiredArgsConstructor
public class SingleCylinderChangeProcess implements IEquipChangeDataProcessStrategy {
private final CommonEquipDataProcessService commonEquipDataProcessService;
@Override
public List<FieldChangeMeta> handle(Map<String, Object> changeData, String record) {
List<FieldChangeMeta> allChangeColumns = new ArrayList<>();
// 新数据解析
EquipRegisterChangeDataDto registerChangeDataDto = CommonEquipDataProcessService.castMap2Bean(changeData, EquipRegisterChangeDataDto.class);
EquipFactoryChangeDataDto factoryChangeDataDto = CommonEquipDataProcessService.castMap2Bean(changeData, EquipFactoryChangeDataDto.class);
EquipDesignChangeDataDto designChangeDataDto = CommonEquipDataProcessService.castMap2Bean(changeData, EquipDesignChangeDataDto.class);
EquipUseInfoChangeDataDto useInfoChangeDataDto = CommonEquipDataProcessService.castMap2Bean(changeData, EquipUseInfoChangeDataDto.class);
commonEquipDataProcessService.buildChangeFields(record, designChangeDataDto, factoryChangeDataDto, registerChangeDataDto, useInfoChangeDataDto, allChangeColumns);
// 前置校验
commonEquipDataProcessService.checkValidField(record, registerChangeDataDto, null, null, null);
commonEquipDataProcessService.checkValidField(record, factoryChangeDataDto, registerChangeDataDto.getEquList(), registerChangeDataDto.getEquCategory(), registerChangeDataDto.getEquDefine());
commonEquipDataProcessService.checkValidField(record, designChangeDataDto, registerChangeDataDto.getEquList(), registerChangeDataDto.getEquCategory(), registerChangeDataDto.getEquDefine());
// 设备制造、设计、注册信息业务处理落库
commonEquipDataProcessService.dealBizDataForEquip(record, registerChangeDataDto);
commonEquipDataProcessService.dealBizDataForEquip(record, factoryChangeDataDto);
commonEquipDataProcessService.dealBizDataForEquip(record, designChangeDataDto);
commonEquipDataProcessService.dealBizDataForEquip(record, useInfoChangeDataDto);
// 设备技术参数入库处理
commonEquipDataProcessService.updateTechParamInfo(registerChangeDataDto, record, changeData, allChangeColumns);
return allChangeColumns;
}
@Override
public IBizDataChangeHandleStrategy.ModelType canHandleMode() {
return DefaultBizDataChangeHandler.ModelType.singleCylinder;
}
}
package com.yeejoin.amos.boot.module.ymt.api.entity; package com.yeejoin.amos.boot.module.ymt.api.entity;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
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.entity.TzsBaseEntity; import com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity;
import com.yeejoin.amos.boot.module.common.api.dto.IBaseChangeData;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
...@@ -18,7 +22,8 @@ import java.util.Date; ...@@ -18,7 +22,8 @@ import java.util.Date;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Accessors(chain = true) @Accessors(chain = true)
@TableName("idx_biz_jg_design_info") @TableName("idx_biz_jg_design_info")
public class IdxBizJgDesignInfo extends TzsBaseEntity { @Group(value = "idx_biz_jg_design_info")
public class IdxBizJgDesignInfo extends TzsBaseEntity implements IBaseChangeData {
...@@ -44,72 +49,84 @@ public class IdxBizJgDesignInfo extends TzsBaseEntity { ...@@ -44,72 +49,84 @@ public class IdxBizJgDesignInfo extends TzsBaseEntity {
* *
*/ */
@TableField("\"DESIGN_UNIT_CREDIT_CODE\"") @TableField("\"DESIGN_UNIT_CREDIT_CODE\"")
@FieldDisplayDefine(value = "设计单位统一社会信用代码")
private String designUnitCreditCode; private String designUnitCreditCode;
/** /**
* *
*/ */
@TableField("\"DESIGN_UNIT_NAME\"") @TableField("\"DESIGN_UNIT_NAME\"")
@FieldDisplayDefine(value = "设计单位名称")
private String designUnitName; private String designUnitName;
/** /**
* *
*/ */
@TableField("\"DESIGN_LICENSE_NUM\"") @TableField("\"DESIGN_LICENSE_NUM\"")
@FieldDisplayDefine(value = "设计许可编号")
private String designLicenseNum; private String designLicenseNum;
/** /**
* *
*/ */
@TableField("\"DESIGN_USE_DATE\"") @TableField("\"DESIGN_USE_DATE\"")
@FieldDisplayDefine(value = "设计使用年限")
private String designUseDate; private String designUseDate;
/** /**
* *
*/ */
@TableField("\"DESIGN_DATE\"") @TableField("\"DESIGN_DATE\"")
@FieldDisplayDefine(value = "设计日期")
private Date designDate; private Date designDate;
/** /**
* *
*/ */
@TableField("\"DRAWING_DO\"") @TableField("\"DRAWING_DO\"")
@FieldDisplayDefine(value = "总图图号")
private String drawingDo; private String drawingDo;
/** /**
* *
*/ */
@TableField("\"DESIGN_DOC\"") @TableField("\"DESIGN_DOC\"")
@FieldDisplayDefine(value = "设计文件", type = JSON.class)
private String designDoc; private String designDoc;
/** /**
* *
*/ */
@TableField("\"APPRAISAL_UNIT\"") @TableField("\"APPRAISAL_UNIT\"")
@FieldDisplayDefine(value = "设计文件鉴定单位")
private String appraisalUnit; private String appraisalUnit;
/** /**
* *
*/ */
@TableField("\"APPRAISAL_DATE\"") @TableField("\"APPRAISAL_DATE\"")
@FieldDisplayDefine(value = "设计文件鉴定日期")
private String appraisalDate; private String appraisalDate;
/** /**
* *
*/ */
@TableField("\"DESIGN_STANDARD\"") @TableField("\"DESIGN_STANDARD\"")
@FieldDisplayDefine(value = "设计规范", type = JSON.class)
private String designStandard; private String designStandard;
/** /**
*其他附件 *其他附件
*/ */
@TableField("\"OTHER_ACCESSORIES_DES\"") @TableField("\"OTHER_ACCESSORIES_DES\"")
@FieldDisplayDefine(value = "其他附件", type = JSON.class)
private String otherAccessoriesDes; private String otherAccessoriesDes;
/** /**
* 资料是否完整齐全:1-齐全;2-不齐全【历史无证设备需要】 * 资料是否完整齐全:1-齐全;2-不齐全【历史无证设备需要】
*/ */
@TableField("\"DESIGN_IS_COMPLETE\"") @TableField("\"DESIGN_IS_COMPLETE\"")
@FieldDisplayDefine(value = "设计资料是否完整齐全")
private String designIsComplete; private String designIsComplete;
/** /**
......
...@@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
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.entity.TzsBaseEntity; import com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity;
import com.yeejoin.amos.boot.module.common.api.dto.IBaseChangeData;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
...@@ -29,7 +30,7 @@ import java.util.Date; ...@@ -29,7 +30,7 @@ import java.util.Date;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("idx_biz_jg_factory_info") @TableName("idx_biz_jg_factory_info")
@Group(value = "idx_biz_jg_factory_info") @Group(value = "idx_biz_jg_factory_info")
public class IdxBizJgFactoryInfo extends TzsBaseEntity { public class IdxBizJgFactoryInfo extends TzsBaseEntity implements IBaseChangeData {
......
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
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.entity.TzsBaseEntity; import com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity;
import com.yeejoin.amos.boot.module.common.api.dto.IBaseChangeData;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
...@@ -19,7 +20,7 @@ import java.util.Date; ...@@ -19,7 +20,7 @@ import java.util.Date;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Accessors(chain = true) @Accessors(chain = true)
@TableName("idx_biz_jg_other_info") @TableName("idx_biz_jg_other_info")
public class IdxBizJgOtherInfo extends TzsBaseEntity { public class IdxBizJgOtherInfo extends TzsBaseEntity implements IBaseChangeData {
/** /**
* *
......
...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableName; ...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
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.entity.TzsBaseEntity; import com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity;
import com.yeejoin.amos.boot.module.common.api.dto.IBaseChangeData;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
...@@ -21,7 +22,7 @@ import lombok.experimental.Accessors; ...@@ -21,7 +22,7 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("idx_biz_jg_register_info") @TableName("idx_biz_jg_register_info")
@Group(value = "idx_biz_jg_register_info") @Group(value = "idx_biz_jg_register_info")
public class IdxBizJgRegisterInfo extends TzsBaseEntity { public class IdxBizJgRegisterInfo extends TzsBaseEntity implements IBaseChangeData {
......
...@@ -11,29 +11,30 @@ import java.util.Map; ...@@ -11,29 +11,30 @@ import java.util.Map;
public enum EquipmentClassifityEnum { public enum EquipmentClassifityEnum {
/** /**
**设备分类 * *设备分类
*/ */
GL("锅炉","1000"), GL("锅炉", "1000"),
YLRQ("压力容器","2000"), YLRQ("压力容器", "2000"),
DT("电梯","3000"), DT("电梯", "3000"),
QZJX("起重机械","4000"), QZJX("起重机械", "4000"),
CC("场(厂)内专用机动车辆","5000"), CC("场(厂)内专用机动车辆", "5000"),
YLSS("大型游乐设施","6000"), YLSS("大型游乐设施", "6000"),
YLGDYJ("压力管道元件","7000"), YLGDYJ("压力管道元件", "7000"),
YLGD("压力管道","8000"), YLGD("压力管道", "8000"),
KYSD("客运索道","9000"), KYSD("客运索道", "9000"),
//树类型 //树类型
//设备认领状态 //设备认领状态
SBRLZT("设备认领状态","rlzt"), SBRLZT("设备认领状态", "rlzt"),
BDLS("八大类树","eightCategory"), BDLS("八大类树", "eightCategory"),
RENLING("其他","other"); RENLING("其他", "other");
private String name; private String name;
private String code; private String code;
public static Map<String,String> getName=new HashMap<>(); public static Map<String, String> getName = new HashMap<>();
public static Map<String,String> getCode=new HashMap<>(); public static Map<String, String> getCode = new HashMap<>();
static { static {
for (EquipmentClassifityEnum e : EquipmentClassifityEnum.values()){ for (EquipmentClassifityEnum e : EquipmentClassifityEnum.values()) {
getName.put(e.code, e.name); getName.put(e.code, e.name);
getCode.put(e.name, e.code); getCode.put(e.name, e.code);
} }
...@@ -41,18 +42,18 @@ public enum EquipmentClassifityEnum { ...@@ -41,18 +42,18 @@ public enum EquipmentClassifityEnum {
} }
public static String getNameByCode(String code){ public static String getNameByCode(String code) {
for (EquipmentClassifityEnum value : EquipmentClassifityEnum.values()) { for (EquipmentClassifityEnum value : EquipmentClassifityEnum.values()) {
if (value.getCode().equals(code)){ if (value.getCode().equals(code)) {
return value.getName(); return value.getName();
} }
} }
return ""; return "";
} }
public static EquipmentClassifityEnum getOne(String code){ public static EquipmentClassifityEnum getOne(String code) {
for (EquipmentClassifityEnum value : EquipmentClassifityEnum.values()) { for (EquipmentClassifityEnum value : EquipmentClassifityEnum.values()) {
if (value.getCode().equals(code)){ if (value.getCode().equals(code)) {
return value; return value;
} }
} }
......
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