|
|
@@ -152,6 +152,41 @@ public class ActHxpapplyServiceImpl implements IActHxpapplyService
|
|
|
return actAuditconfigInfoVo;
|
|
|
}).collect(Collectors.toList());
|
|
|
actHxpapplyInfoVo.setConfigInfoList(configInfoList);
|
|
|
+ }else{
|
|
|
+ //todo 如果是草稿箱的,需要查询机柜化学品剩余量的计算值
|
|
|
+ List <Long> cabinetCollect = Optional.ofNullable(actHxpapplyDetailVos).orElseGet(Collections::emptyList)
|
|
|
+ .stream()
|
|
|
+ .map(ActHxpapplyDetailVo::getCabinetId)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ List <Long> chemicalCollect = Optional.ofNullable(actHxpapplyDetailVos).orElseGet(Collections::emptyList)
|
|
|
+ .stream()
|
|
|
+ .map(ActHxpapplyDetailVo::getChemicalId)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
+ ActRestStockManySearch actRestStockVo = new ActRestStockManySearch();
|
|
|
+ actRestStockVo.setChemicalIds(chemicalCollect);
|
|
|
+ actRestStockVo.setCabinetIds(cabinetCollect);
|
|
|
+ List <ActRestStockManyVo> restStockByManyCabinetAndChemical = this.getRestStockByManyCabinetAndChemical(actRestStockVo);
|
|
|
+
|
|
|
+// for(ActHxpapplyDetailVo detailVo:actHxpapplyDetailVos){
|
|
|
+// for(ActRestStockManyVo manyVo:restStockByManyCabinetAndChemical){
|
|
|
+// if(detailVo.getCabinetId()==manyVo.getCabinetId() && detailVo.getChemicalId()==manyVo.getChemicalId()){
|
|
|
+// detailVo.setRemainingStorage(manyVo.getRestStock());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+ Optional.ofNullable(actHxpapplyDetailVos)
|
|
|
+ .orElseGet(Collections::emptyList)
|
|
|
+ .stream()
|
|
|
+ .forEach(a->Optional.ofNullable(restStockByManyCabinetAndChemical)
|
|
|
+ .orElseGet(Collections::emptyList)
|
|
|
+ .stream()
|
|
|
+ .filter(b->(b.getCabinetId().longValue()==a.getCabinetId().longValue()&&b.getChemicalId().longValue()==a.getChemicalId().longValue()))
|
|
|
+ .forEach(c->{
|
|
|
+ a.setRemainingStorage(c.getRestStock()+"g");
|
|
|
+ }));
|
|
|
+
|
|
|
}
|
|
|
return actHxpapplyInfoVo;
|
|
|
}
|
|
|
@@ -511,4 +546,18 @@ public class ActHxpapplyServiceImpl implements IActHxpapplyService
|
|
|
|
|
|
return actRestStockManyVoList;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取化学品剩余可存放量(多个化学品和多个机柜返回的计算)
|
|
|
+ *
|
|
|
+ * @param actRestStockVo 机柜主键主键
|
|
|
+ * @return 化学品申购
|
|
|
+ */
|
|
|
+ public List<ActRestStockManyVo> getRestStockByManyCabinetAndChemical(ActRestStockManySearch actRestStockVo)
|
|
|
+ {
|
|
|
+ List <ActRestStockManyVo> restStockByManyCabinet = actHxpapplyMapper.getRestStockByManyCabinetAndChemical(actRestStockVo);
|
|
|
+ return restStockByManyCabinet;
|
|
|
+ }
|
|
|
}
|