Commit df590a18 authored by suhuiguang's avatar suhuiguang

fix(大编辑):自测联调修改

1.最新日期进行更新 2.更新人进行更新
parent 5caca3b5
...@@ -45,6 +45,7 @@ import org.elasticsearch.search.builder.SearchSourceBuilder; ...@@ -45,6 +45,7 @@ import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.search.sort.SortOrder;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
...@@ -106,6 +107,8 @@ public class CommonEquipDataProcessService { ...@@ -106,6 +107,8 @@ public class CommonEquipDataProcessService {
private final JgUseRegistrationServiceImpl jgUseRegistrationService; private final JgUseRegistrationServiceImpl jgUseRegistrationService;
public static final String BASE_COLUMN_REC_DATE = "\"REC_DATE\"";
public static final String BASE_COLUMN_REC_USERID = "\"REC_USER_ID\"";
@PostConstruct @PostConstruct
public void init() { public void init() {
...@@ -656,7 +659,7 @@ public class CommonEquipDataProcessService { ...@@ -656,7 +659,7 @@ public class CommonEquipDataProcessService {
Object newVal = field.get(newObj); Object newVal = field.get(newObj);
FieldDisplayDefine displayDefine = field.getAnnotation(FieldDisplayDefine.class); FieldDisplayDefine displayDefine = field.getAnnotation(FieldDisplayDefine.class);
TableField tableField = field.getAnnotation(TableField.class); TableField tableField = field.getAnnotation(TableField.class);
// 对比逻辑 // 业务字段对比处理逻辑
if (!Objects.equals(oldVal, newVal)) { if (!Objects.equals(oldVal, newVal)) {
if (displayDefine != null && displayDefine.isExist()) { if (displayDefine != null && displayDefine.isExist()) {
String columnName = tableField.value(); String columnName = tableField.value();
...@@ -690,7 +693,12 @@ public class CommonEquipDataProcessService { ...@@ -690,7 +693,12 @@ public class CommonEquipDataProcessService {
} }
// 执行更新 // 执行更新
if (!changeData.isEmpty()) { if (!changeData.isEmpty()) {
// 公共字段处理
wrapper.set(BASE_COLUMN_REC_DATE, new Date());
wrapper.set(BASE_COLUMN_REC_USERID, RequestContext.getExeUserId());
// 查询where
wrapper.eq(whereKey, whereValue); wrapper.eq(whereKey, whereValue);
// 更新
mapper.update(null, wrapper); mapper.update(null, wrapper);
} }
return changeData; return changeData;
......
...@@ -12,7 +12,6 @@ import lombok.RequiredArgsConstructor; ...@@ -12,7 +12,6 @@ import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -35,37 +34,31 @@ public class SingleEquipChangeProcess implements IEquipChangeDataProcessStrategy ...@@ -35,37 +34,31 @@ 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());
useInfoNew.setRecDate(new Date());
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);
CommonEquipDataProcessService.castMap2Bean(changeJson, registerInfoNew); CommonEquipDataProcessService.castMap2Bean(changeJson, registerInfoNew);
registerInfoNew.setSequenceNbr(registerInfoOld.getSequenceNbr()); registerInfoNew.setSequenceNbr(registerInfoOld.getSequenceNbr());
registerInfoNew.setRecDate(new Date());
IdxBizJgFactoryInfo factoryInfoOld = commonEquipDataProcessService.getJgFactoryInfoMapper().selectOne(new LambdaQueryWrapper<IdxBizJgFactoryInfo>().eq(IdxBizJgFactoryInfo::getRecord, record)); IdxBizJgFactoryInfo factoryInfoOld = commonEquipDataProcessService.getJgFactoryInfoMapper().selectOne(new LambdaQueryWrapper<IdxBizJgFactoryInfo>().eq(IdxBizJgFactoryInfo::getRecord, record));
IdxBizJgFactoryInfo factoryInfoNew = BeanUtil.copyProperties(factoryInfoOld, IdxBizJgFactoryInfo.class); IdxBizJgFactoryInfo factoryInfoNew = BeanUtil.copyProperties(factoryInfoOld, IdxBizJgFactoryInfo.class);
CommonEquipDataProcessService.castMap2Bean(changeJson, factoryInfoNew); CommonEquipDataProcessService.castMap2Bean(changeJson, factoryInfoNew);
factoryInfoNew.setSequenceNbr(factoryInfoOld.getSequenceNbr()); factoryInfoNew.setSequenceNbr(factoryInfoOld.getSequenceNbr());
factoryInfoNew.setRecDate(new Date());
IdxBizJgDesignInfo designInfoOld = commonEquipDataProcessService.getIdxBizJgDesignInfoMapper().selectOne(new LambdaQueryWrapper<IdxBizJgDesignInfo>().eq(IdxBizJgDesignInfo::getRecord, record)); IdxBizJgDesignInfo designInfoOld = commonEquipDataProcessService.getIdxBizJgDesignInfoMapper().selectOne(new LambdaQueryWrapper<IdxBizJgDesignInfo>().eq(IdxBizJgDesignInfo::getRecord, record));
IdxBizJgDesignInfo designInfoNew = BeanUtil.copyProperties(factoryInfoOld, IdxBizJgDesignInfo.class);; IdxBizJgDesignInfo designInfoNew = BeanUtil.copyProperties(designInfoOld, IdxBizJgDesignInfo.class);
CommonEquipDataProcessService.castMap2Bean(changeJson, designInfoNew); CommonEquipDataProcessService.castMap2Bean(changeJson, designInfoNew);
designInfoNew.setSequenceNbr(designInfoOld.getSequenceNbr()); designInfoNew.setSequenceNbr(designInfoOld.getSequenceNbr());
designInfoNew.setRecDate(new Date());
IdxBizJgOtherInfo otherInfoOld = commonEquipDataProcessService.getIdxBizJgOtherInfoMapper().selectOne(new LambdaQueryWrapper<IdxBizJgOtherInfo>().eq(IdxBizJgOtherInfo::getRecord, record)); IdxBizJgOtherInfo otherInfoOld = commonEquipDataProcessService.getIdxBizJgOtherInfoMapper().selectOne(new LambdaQueryWrapper<IdxBizJgOtherInfo>().eq(IdxBizJgOtherInfo::getRecord, record));
IdxBizJgOtherInfo otherInfoNew = BeanUtil.copyProperties(factoryInfoOld, IdxBizJgOtherInfo.class); IdxBizJgOtherInfo otherInfoNew = BeanUtil.copyProperties(otherInfoOld, IdxBizJgOtherInfo.class);
CommonEquipDataProcessService.castMap2Bean(changeJson, otherInfoNew); CommonEquipDataProcessService.castMap2Bean(changeJson, otherInfoNew);
otherInfoNew.setSequenceNbr(otherInfoOld.getSequenceNbr()); otherInfoNew.setSequenceNbr(otherInfoOld.getSequenceNbr());
otherInfoNew.setRecDate(new Date());
IdxBizJgSupervisionInfo idxBizJgSupervisionInfoOld = commonEquipDataProcessService.getJgUseRegistrationService().getIdxBizJgSupervisionInfoMapper().selectOne(new LambdaQueryWrapper<IdxBizJgSupervisionInfo>().eq(IdxBizJgSupervisionInfo::getRecord, record)); IdxBizJgSupervisionInfo idxBizJgSupervisionInfoOld = commonEquipDataProcessService.getJgUseRegistrationService().getIdxBizJgSupervisionInfoMapper().selectOne(new LambdaQueryWrapper<IdxBizJgSupervisionInfo>().eq(IdxBizJgSupervisionInfo::getRecord, record));
IdxBizJgSupervisionInfo idxBizJgSupervisionInfoNew = BeanUtil.copyProperties(factoryInfoOld, IdxBizJgSupervisionInfo.class); IdxBizJgSupervisionInfo idxBizJgSupervisionInfoNew = BeanUtil.copyProperties(idxBizJgSupervisionInfoOld, IdxBizJgSupervisionInfo.class);
CommonEquipDataProcessService.castMap2Bean(changeJson, idxBizJgSupervisionInfoNew); CommonEquipDataProcessService.castMap2Bean(changeJson, idxBizJgSupervisionInfoNew);
idxBizJgSupervisionInfoNew.setSequenceNbr(idxBizJgSupervisionInfoOld.getSequenceNbr()); idxBizJgSupervisionInfoNew.setSequenceNbr(idxBizJgSupervisionInfoOld.getSequenceNbr());
idxBizJgSupervisionInfoNew.setRecDate(new Date());
String jySeq = changeJson.getString("jySeq"); String jySeq = changeJson.getString("jySeq");
String maintenanceSeq = changeJson.getString("maintenanceSeq"); String maintenanceSeq = changeJson.getString("maintenanceSeq");
...@@ -73,9 +66,8 @@ public class SingleEquipChangeProcess implements IEquipChangeDataProcessStrategy ...@@ -73,9 +66,8 @@ public class SingleEquipChangeProcess implements IEquipChangeDataProcessStrategy
if (jySeq != null) { if (jySeq != null) {
IdxBizJgInspectionDetectionInfo inspectionDetectionInfoOld = commonEquipDataProcessService.getJgUseRegistrationService().getInspectionDetectionInfoService().getById(jySeq); IdxBizJgInspectionDetectionInfo inspectionDetectionInfoOld = commonEquipDataProcessService.getJgUseRegistrationService().getInspectionDetectionInfoService().getById(jySeq);
IdxBizJgInspectionDetectionInfo inspectionDetectionInfoNew = BeanUtil.copyProperties(inspectionDetectionInfoOld, IdxBizJgInspectionDetectionInfo.class); IdxBizJgInspectionDetectionInfo inspectionDetectionInfoNew = BeanUtil.copyProperties(inspectionDetectionInfoOld, IdxBizJgInspectionDetectionInfo.class);
CommonEquipDataProcessService.castMap2Bean(changeJson, idxBizJgSupervisionInfoNew); CommonEquipDataProcessService.castMap2Bean(changeJson, inspectionDetectionInfoNew);
inspectionDetectionInfoNew.setSequenceNbr(inspectionDetectionInfoOld.getSequenceNbr()); inspectionDetectionInfoNew.setSequenceNbr(inspectionDetectionInfoOld.getSequenceNbr());
inspectionDetectionInfoNew.setRecDate(new Date());
List<FieldChangeMeta> inspectionFieldChangeMetas = commonEquipDataProcessService.simpleTrackAndUpdate(commonEquipDataProcessService.getJgUseRegistrationService().getInspectionDetectionInfoService().getBaseMapper(), inspectionDetectionInfoOld, inspectionDetectionInfoNew, useInfoNew.getRecord(), "SEQUENCE_NBR", inspectionDetectionInfoOld.getSequenceNbr()); List<FieldChangeMeta> inspectionFieldChangeMetas = commonEquipDataProcessService.simpleTrackAndUpdate(commonEquipDataProcessService.getJgUseRegistrationService().getInspectionDetectionInfoService().getBaseMapper(), inspectionDetectionInfoOld, inspectionDetectionInfoNew, useInfoNew.getRecord(), "SEQUENCE_NBR", inspectionDetectionInfoOld.getSequenceNbr());
allChangeColumns.addAll(inspectionFieldChangeMetas); allChangeColumns.addAll(inspectionFieldChangeMetas);
commonEquipDataProcessService.updateEsDataOfEquip(record, inspectionDetectionInfoNew); commonEquipDataProcessService.updateEsDataOfEquip(record, inspectionDetectionInfoNew);
...@@ -85,7 +77,6 @@ public class SingleEquipChangeProcess implements IEquipChangeDataProcessStrategy ...@@ -85,7 +77,6 @@ public class SingleEquipChangeProcess implements IEquipChangeDataProcessStrategy
IdxBizJgMaintenanceRecordInfo idxBizJgMaintenanceRecordInfoNew = BeanUtil.copyProperties(idxBizJgMaintenanceRecordInfoOld, IdxBizJgMaintenanceRecordInfo.class); IdxBizJgMaintenanceRecordInfo idxBizJgMaintenanceRecordInfoNew = BeanUtil.copyProperties(idxBizJgMaintenanceRecordInfoOld, IdxBizJgMaintenanceRecordInfo.class);
CommonEquipDataProcessService.castMap2Bean(changeJson, idxBizJgMaintenanceRecordInfoNew); CommonEquipDataProcessService.castMap2Bean(changeJson, idxBizJgMaintenanceRecordInfoNew);
idxBizJgMaintenanceRecordInfoNew.setSequenceNbr(idxBizJgMaintenanceRecordInfoOld.getSequenceNbr()); idxBizJgMaintenanceRecordInfoNew.setSequenceNbr(idxBizJgMaintenanceRecordInfoOld.getSequenceNbr());
idxBizJgMaintenanceRecordInfoNew.setRecDate(new Date());
List<FieldChangeMeta> idxBizJgMaintenanceFieldChangeMetas = commonEquipDataProcessService.simpleTrackAndUpdate(commonEquipDataProcessService.getJgUseRegistrationService().getIdxBizJgMaintenanceRecordInfoService().getBaseMapper(), idxBizJgMaintenanceRecordInfoOld, idxBizJgMaintenanceRecordInfoNew, useInfoNew.getRecord(), "SEQUENCE_NBR", idxBizJgMaintenanceRecordInfoOld.getSequenceNbr()); List<FieldChangeMeta> idxBizJgMaintenanceFieldChangeMetas = commonEquipDataProcessService.simpleTrackAndUpdate(commonEquipDataProcessService.getJgUseRegistrationService().getIdxBizJgMaintenanceRecordInfoService().getBaseMapper(), idxBizJgMaintenanceRecordInfoOld, idxBizJgMaintenanceRecordInfoNew, useInfoNew.getRecord(), "SEQUENCE_NBR", idxBizJgMaintenanceRecordInfoOld.getSequenceNbr());
allChangeColumns.addAll(idxBizJgMaintenanceFieldChangeMetas); allChangeColumns.addAll(idxBizJgMaintenanceFieldChangeMetas);
} }
...@@ -94,7 +85,6 @@ public class SingleEquipChangeProcess implements IEquipChangeDataProcessStrategy ...@@ -94,7 +85,6 @@ public class SingleEquipChangeProcess implements IEquipChangeDataProcessStrategy
IdxBizJgConstructionInfo constructionInfoNew = BeanUtil.copyProperties(constructionInfoOld, IdxBizJgConstructionInfo.class); IdxBizJgConstructionInfo constructionInfoNew = BeanUtil.copyProperties(constructionInfoOld, IdxBizJgConstructionInfo.class);
CommonEquipDataProcessService.castMap2Bean(changeJson, constructionInfoNew); CommonEquipDataProcessService.castMap2Bean(changeJson, constructionInfoNew);
constructionInfoNew.setSequenceNbr(constructionInfoOld.getSequenceNbr()); constructionInfoNew.setSequenceNbr(constructionInfoOld.getSequenceNbr());
constructionInfoNew.setRecDate(new Date());
List<FieldChangeMeta> constructionInfoFieldChangeMetas = commonEquipDataProcessService.simpleTrackAndUpdate(commonEquipDataProcessService.getJgUseRegistrationService().getIdxBizJgConstructionInfoService().getBaseMapper(), constructionInfoOld, constructionInfoNew, useInfoNew.getRecord(), "SEQUENCE_NBR", constructionInfoOld.getSequenceNbr()); List<FieldChangeMeta> constructionInfoFieldChangeMetas = commonEquipDataProcessService.simpleTrackAndUpdate(commonEquipDataProcessService.getJgUseRegistrationService().getIdxBizJgConstructionInfoService().getBaseMapper(), constructionInfoOld, constructionInfoNew, useInfoNew.getRecord(), "SEQUENCE_NBR", constructionInfoOld.getSequenceNbr());
allChangeColumns.addAll(constructionInfoFieldChangeMetas); allChangeColumns.addAll(constructionInfoFieldChangeMetas);
} }
......
...@@ -174,5 +174,5 @@ public class IdxBizJgMaintenanceRecordInfo extends TzsBaseEntity implements IBas ...@@ -174,5 +174,5 @@ public class IdxBizJgMaintenanceRecordInfo extends TzsBaseEntity implements IBas
*/ */
@FieldDisplayDefine(value = "其他维保附件", type = JSON.class) @FieldDisplayDefine(value = "其他维保附件", type = JSON.class)
@TableField("\"ME_OTHER_ACCESSORIES\"") @TableField("\"ME_OTHER_ACCESSORIES\"")
private String ME_OTHER_ACCESSORIES; private String meOtherAccessories;
} }
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