Commit df590a18 authored by suhuiguang's avatar suhuiguang

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

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