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