Commit 9902ced9 by wangweidong

土工平台修改

parent e53b7120
......@@ -1352,6 +1352,8 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
List<SoilExperimentVO> voList = soilExperimentService.listVOByIds(ids);
boolean chong = "检测报告(力学试验)落锥".equals(template.getName())||"检测报告(力学试验)实验室微型十字板".equals(template.getName());
if (CollectionUtils.isEmpty(voList)){
RestAssert.fail("试验项目不存在");
......@@ -1368,21 +1370,82 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
return e.getId();
}).collect(Collectors.toList());
List<SoilItem> soilItemList = soilItemService.list(Condition.create().in("experiment_id",expIdsList));
for (SoilExperimentVO vo:voList) {
if (StringUtils.isNotBlank(vo.getShortName())){
if ("CD".equals(vo.getShortName())||"CU".equals(vo.getShortName())){
SoilItem item =new SoilItem();
item.setName("破坏类型");
item.setTestValue("AB");
item.setExperimentId(vo.getId());
soilItemList.add(item);
if (StringUtils.isNotBlank(vo.getShortName())){
if ("CD".equals(vo.getShortName())||"CU".equals(vo.getShortName())){
SoilItem item =new SoilItem();
item.setName("破坏类型");
item.setTestValue("AB");
item.setExperimentId(vo.getId());
soilItemList.add(item);
}
}
}
if (chong){
Map<String,Integer> checkChongSuMap = new HashMap<>();
for (SoilExperimentVO vo : voList) {
String name = vo.getName().replace("-重塑","");
if (checkChongSuMap.containsKey(name)){
Integer num = checkChongSuMap.get(name);
num=num+1;
checkChongSuMap.put(name,num);
}else{
checkChongSuMap.put(name,1);
}
}
}
List<SoilExperimentVO> newVOList = new ArrayList<>();
Map<String,SoilExperimentVO> newChongSuMap = new HashMap<>();
for (SoilExperimentVO vo:voList) {
String name = vo.getName().replace("-重塑","");
if (!vo.getName().contains("重塑")){
newVOList.add(vo);
}else{
Integer num = checkChongSuMap.get(name);
if (null==num||num == 1) {
newVOList.add(vo);
}
newChongSuMap.put(vo.getName(),vo);
}
}
voList = newVOList;
for (SoilExperimentVO vo:voList) {
SoilExperimentVO chongSu = newChongSuMap.get(vo.getName()+"-重塑");
if (null!=chongSu){
for (SoilItem item : soilItemList) {
if (item.getExperimentId().equals(chongSu)){
SoilItem soilItem = item.convert(SoilItem.class);
soilItem.setExperimentId(vo.getId());
soilItemList.add(soilItem);
}
}
}
}
}
Map<Long,List<SoilItem>> expItemMap = new HashMap<>();
for (SoilItem item:soilItemList) {
if (!expItemMap.containsKey(item.getExperimentId())){
......
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