Commit 99ca7203 authored by suhuiguang's avatar suhuiguang

1.刷管道历史数据接口,增加装置名称记录到use_info

parent b0543304
......@@ -666,6 +666,7 @@ public class DataHandlerServiceImpl {
}
// 更新设备es的装置id、使用信息的装置id
projectContraptionIdRecordsMap.forEach((k,v)->{
IdxBizJgProjectContraption idxBizJgProjectContraption = projectContraptionService.getById(k);
Iterable<ESEquipmentCategoryDto> equipmentCategories = esEquipmentCategory.findAllById(v);
equipmentCategories.forEach(e-> e.setProjectContraptionId(k + ""));
esEquipmentCategory.saveAll(equipmentCategories);
......@@ -674,6 +675,7 @@ public class DataHandlerServiceImpl {
LambdaUpdateWrapper<IdxBizJgUseInfo> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(IdxBizJgUseInfo::getRecord, u.getRecord());
updateWrapper.set(IdxBizJgUseInfo::getProjectContraptionId, k);
updateWrapper.set(IdxBizJgUseInfo::getProjectContraption, idxBizJgProjectContraption.getProjectContraption());
useInfoService.update(updateWrapper);
});
});
......@@ -870,10 +872,14 @@ public class DataHandlerServiceImpl {
eqs.forEach(eq->{
Optional<ESEquipmentCategoryDto> equInfosWithEs = esEquipmentCategory.findById(eq.getEquId());
equInfosWithEs.ifPresent(equInfoEs -> {
LambdaUpdateWrapper<IdxBizJgUseInfo> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(IdxBizJgUseInfo::getRecord, equInfoEs.getSEQUENCE_NBR());
updateWrapper.set(IdxBizJgUseInfo::getProjectContraptionId, equInfoEs.getProjectContraptionId());
useInfoService.update(updateWrapper);
if(StringUtils.isNotEmpty(equInfoEs.getProjectContraptionId())){
IdxBizJgProjectContraption idxBizJgProjectContraption = projectContraptionService.getById(equInfoEs.getProjectContraptionId());
LambdaUpdateWrapper<IdxBizJgUseInfo> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(IdxBizJgUseInfo::getRecord, equInfoEs.getSEQUENCE_NBR());
updateWrapper.set(IdxBizJgUseInfo::getProjectContraptionId, idxBizJgProjectContraption.getSequenceNbr());
updateWrapper.set(IdxBizJgUseInfo::getProjectContraption, idxBizJgProjectContraption.getProjectContraption());
useInfoService.update(updateWrapper);
}
});
});
List<JgInstallationNoticeEq> eqsAfter = jgInstallationNoticeEqMapper.selectPCIdNeErrorPieLineInUseInfo();
......
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