diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquPlanServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquPlanServiceImpl.java index cecda23b..b137c4ea 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquPlanServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquPlanServiceImpl.java @@ -264,26 +264,29 @@ public class EquPlanServiceImpl implements IEquPlanService { if (equCheckItemList.size() > 0) { List detailList = new ArrayList<>(); for (EquCheckItem checkItem : equCheckItemList) { - EquPlanDetail detail = new EquPlanDetail(); - BeanUtils.copyProperties(checkItem,detail); - - if (!detail.getItemCode().isEmpty()) { - itemTempName.append(detail.getItemName()).append(","); - // 获取检查项详情list - List equCheckItemDetailList = equCheckItemDetailMapper.selectCheckItemDetailByItemCode(detail.getItemCode()); - if (equCheckItemList.size() > 0) { - List standardList = new ArrayList<>(); - for (EquCheckItemDetail standardTemp : equCheckItemDetailList) { - EquPlanStandard standard = new EquPlanStandard(); - BeanUtils.copyProperties(standardTemp,standard); - - standard.setShowFlag(true); - standardList.add(standard); + // 只需要循环周期一致的检查项 + if(checkItem.getItemLoop() == data.getItemLoop() && checkItem.getItemLoopType().equals(data.getItemLoopType())) { + EquPlanDetail detail = new EquPlanDetail(); + BeanUtils.copyProperties(checkItem,detail); + + if (!detail.getItemCode().isEmpty()) { + itemTempName.append(detail.getItemName()).append(","); + // 获取检查项详情list + List equCheckItemDetailList = equCheckItemDetailMapper.selectCheckItemDetailByItemCode(detail.getItemCode()); + if (equCheckItemList.size() > 0) { + List standardList = new ArrayList<>(); + for (EquCheckItemDetail standardTemp : equCheckItemDetailList) { + EquPlanStandard standard = new EquPlanStandard(); + BeanUtils.copyProperties(standardTemp,standard); + + standard.setShowFlag(true); + standardList.add(standard); + } + detail.setEquPlanStandardList(standardList); } - detail.setEquPlanStandardList(standardList); } + detailList.add(detail); } - detailList.add(detail); } data.setEquPlanDetailList(detailList); data.setItemTempName(itemTempName.toString()); diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepServiceImpl.java index 77c4783d..ce0a9008 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquUpkeepServiceImpl.java @@ -182,26 +182,29 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService { if (equCheckItemList.size() > 0) { List detailList = new ArrayList<>(); for (EquCheckItem checkItem : equCheckItemList) { - EquPlanDetail detail = new EquPlanDetail(); - BeanUtils.copyProperties(checkItem,detail); - - if (!detail.getItemCode().isEmpty()) { - itemTempName.append(detail.getItemName()).append(","); - // 获取检查项详情list - List equCheckItemDetailList = equCheckItemDetailMapper.selectCheckItemDetailByItemCode(detail.getItemCode()); - if (equCheckItemList.size() > 0) { - List standardList = new ArrayList<>(); - for (EquCheckItemDetail standardTemp : equCheckItemDetailList) { - EquPlanStandard standard = new EquPlanStandard(); - BeanUtils.copyProperties(standardTemp,standard); - - standard.setShowFlag(true); - standardList.add(standard); + // 只需要循环周期一致的检查项 + if(checkItem.getItemLoop() == data.getItemLoop() && checkItem.getItemLoopType().equals(data.getItemLoopType())) { + EquPlanDetail detail = new EquPlanDetail(); + BeanUtils.copyProperties(checkItem,detail); + + if (!detail.getItemCode().isEmpty()) { + itemTempName.append(detail.getItemName()).append(","); + // 获取检查项详情list + List equCheckItemDetailList = equCheckItemDetailMapper.selectCheckItemDetailByItemCode(detail.getItemCode()); + if (equCheckItemList.size() > 0) { + List standardList = new ArrayList<>(); + for (EquCheckItemDetail standardTemp : equCheckItemDetailList) { + EquPlanStandard standard = new EquPlanStandard(); + BeanUtils.copyProperties(standardTemp,standard); + + standard.setShowFlag(true); + standardList.add(standard); + } + detail.setEquPlanStandardList(standardList); } - detail.setEquPlanStandardList(standardList); } + detailList.add(detail); } - detailList.add(detail); } data.setEquPlanDetailList(detailList); data.setItemTempName(itemTempName.toString());