Commit e2836439 authored by tianyiming's avatar tianyiming

fix(core): 修复设备编辑时候,同步将设备监管机构的code和name字段同步到新设备的数据es中

parent f7efaa2a
...@@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONObject; ...@@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo; import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
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.dao.EsEquipmentDao;
import com.yeejoin.amos.boot.module.common.api.entity.ESEquipmentInfo;
import com.yeejoin.amos.boot.module.common.api.enums.CylinderTypeEnum; import com.yeejoin.amos.boot.module.common.api.enums.CylinderTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.common.BizCommonConstant; import com.yeejoin.amos.boot.module.jg.api.common.BizCommonConstant;
import com.yeejoin.amos.boot.module.jg.api.dto.FieldChangeMeta; import com.yeejoin.amos.boot.module.jg.api.dto.FieldChangeMeta;
...@@ -32,6 +34,7 @@ import java.io.IOException; ...@@ -32,6 +34,7 @@ import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional;
/** /**
* 单个维护设备-策略实现类 * 单个维护设备-策略实现类
...@@ -48,6 +51,8 @@ public class SingleEquipChangeProcess implements IEquipChangeDataProcessStrategy ...@@ -48,6 +51,8 @@ public class SingleEquipChangeProcess implements IEquipChangeDataProcessStrategy
private final RestHighLevelClient restHighLevelClient; private final RestHighLevelClient restHighLevelClient;
private final EsEquipmentDao esEquipmentDao;
@Override @Override
public HandleResult handle(Map<String, Object> changeData, String record) { public HandleResult handle(Map<String, Object> changeData, String record) {
...@@ -149,6 +154,16 @@ public class SingleEquipChangeProcess implements IEquipChangeDataProcessStrategy ...@@ -149,6 +154,16 @@ public class SingleEquipChangeProcess implements IEquipChangeDataProcessStrategy
esUpdateService.updateEsData(record, factoryInfoNew); esUpdateService.updateEsData(record, factoryInfoNew);
esUpdateService.updateEsData(record, idxBizJgSupervisionInfoNew); esUpdateService.updateEsData(record, idxBizJgSupervisionInfoNew);
if("50*X".equals(idxBizJgSupervisionInfoOld.getOrgBranchCode()) && !"50*X".equals(idxBizJgSupervisionInfoNew.getOrgBranchCode())){
Optional<ESEquipmentInfo> esEquipmentDto = esEquipmentDao.findById(record);
if (esEquipmentDto.isPresent()) {
ESEquipmentInfo esEquipmentInfo = esEquipmentDto.get();
esEquipmentInfo.setORG_BRANCH_CODE(idxBizJgSupervisionInfoNew.getOrgBranchCode());
esEquipmentInfo.setORG_BRANCH_NAME(idxBizJgSupervisionInfoNew.getOrgBranchName());
esEquipmentDao.save(esEquipmentInfo);
}
}
// 如果是气瓶则按照证更新其他同证下的气瓶字段 // 如果是气瓶则按照证更新其他同证下的气瓶字段
this.updateOtherEquipInSameCert(useInfoNew, registerInfoNew, registerInfoOld, allChangeColumns); this.updateOtherEquipInSameCert(useInfoNew, registerInfoNew, registerInfoOld, allChangeColumns);
// 设备技术参数入库处理 // 设备技术参数入库处理
......
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