Commit 4668c066 authored by suhuiguang's avatar suhuiguang

1.压力管道编辑保存时同步更新装置下的搜索管道es的装置名称

parent 4ef5bc4a
...@@ -5,6 +5,9 @@ import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto; ...@@ -5,6 +5,9 @@ import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List;
@Repository @Repository
public interface ESEquipmentCategory extends PagingAndSortingRepository<ESEquipmentCategoryDto, String> { public interface ESEquipmentCategory extends PagingAndSortingRepository<ESEquipmentCategoryDto, String> {
List<ESEquipmentCategoryDto> findAllByPROJECT_CONTRAPTION_ID(String PROJECT_CONTRAPTION_ID);
} }
...@@ -86,13 +86,13 @@ public class BatchDataChangeProcessStrategy implements IChangeDataProcessStrateg ...@@ -86,13 +86,13 @@ public class BatchDataChangeProcessStrategy implements IChangeDataProcessStrateg
String record = item.getRecord(); String record = item.getRecord();
// 设计信息更新 // 设计信息更新
pieLineDataChangeService.saveDesignForPieLine(record, allChangeColumns, item); pieLineDataChangeService.saveDesignForPieLine(record, allChangeColumns, item);
// 更新es的冗余的管道名称字段
pieLineDataChangeService.updateEs(record, projectContraptionChangeDataDto);
// 技术参数入库保存 // 技术参数入库保存
TechParamsPipelineChangeFieldDto paramsPipelineChangeFieldDto = new TechParamsPipelineChangeFieldDto(); TechParamsPipelineChangeFieldDto paramsPipelineChangeFieldDto = new TechParamsPipelineChangeFieldDto();
BeanUtil.copyProperties(item, paramsPipelineChangeFieldDto, false); BeanUtil.copyProperties(item, paramsPipelineChangeFieldDto, false);
commonEquipDataProcessService.savePieLineTechParam(record, allChangeColumns, paramsPipelineChangeFieldDto); commonEquipDataProcessService.savePieLineTechParam(record, allChangeColumns, paramsPipelineChangeFieldDto);
}); });
// 4.更新所有管道的的冗余的管道名称字段(重点注意包括本次没做使用登记的管道也要更新)
pieLineDataChangeService.updateEs(projectContraptionChangeDataDto);
} else { // 气瓶逻辑 } else { // 气瓶逻辑
List<MultiChangeItemData> items = equips.toJavaList(MultiChangeItemData.class); List<MultiChangeItemData> items = equips.toJavaList(MultiChangeItemData.class);
// 校验 // 校验
......
...@@ -137,15 +137,14 @@ public class EquipChangeDataUpdateService { ...@@ -137,15 +137,14 @@ public class EquipChangeDataUpdateService {
} }
} }
public void updateRegisterEsDataPieLine(String record, ProjectContraptionChangeDataDto registerChangeDataDto) { public void updateRegisterEsDataPieLine(ProjectContraptionChangeDataDto registerChangeDataDto) {
// es 数据更新 // es 数据更新
Optional<ESEquipmentCategoryDto> optional = esEquipmentCategory.findById(record); List<ESEquipmentCategoryDto> pieLines = esEquipmentCategory.findAllByPROJECT_CONTRAPTION_ID(registerChangeDataDto.getProjectContraptionId());
if (optional.isPresent()) { for(ESEquipmentCategoryDto esEquipmentCategoryDto: pieLines) {
ESEquipmentCategoryDto esEquipmentCategoryDto = optional.get();
esEquipmentCategoryDto.setPROJECT_CONTRAPTION(registerChangeDataDto.getProjectContraption()); esEquipmentCategoryDto.setPROJECT_CONTRAPTION(registerChangeDataDto.getProjectContraption());
// 冗余更新 正常 应该是在加设备时写入 }
esEquipmentCategoryDto.setPROJECT_CONTRAPTION_ID(registerChangeDataDto.getProjectContraptionId()) ; if(!pieLines.isEmpty()){
esEquipmentCategory.save(esEquipmentCategoryDto); esEquipmentCategory.saveAll(pieLines);
} }
} }
......
...@@ -64,7 +64,7 @@ public class PieLineDataChangeServiceImpl { ...@@ -64,7 +64,7 @@ public class PieLineDataChangeServiceImpl {
equipChangeDataUpdateService.updatePieLineDesignData(record, pieLineDesignChangeDataDto); equipChangeDataUpdateService.updatePieLineDesignData(record, pieLineDesignChangeDataDto);
} }
public void updateEs(String record, ProjectContraptionChangeDataDto projectContraptionChangeDataDto) { public void updateEs(ProjectContraptionChangeDataDto projectContraptionChangeDataDto) {
equipChangeDataUpdateService.updateRegisterEsDataPieLine(record, projectContraptionChangeDataDto); equipChangeDataUpdateService.updateRegisterEsDataPieLine(projectContraptionChangeDataDto);
} }
} }
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