| | |
| | | |
| | | //保存设备保养 |
| | | List<EquipmentTakecareDetail> takecareDetailList = infoDto.getTakecareDetailList(); |
| | | takecareDetailList.forEach(f->{ |
| | | f.setEquipmentId(equipmentInfo.getId()); |
| | | f.setInfoTpe(equipmentInfo.getInfoType()); |
| | | }); |
| | | equipmentTakecareDetailBaseService.saveOrUpdateBatch(takecareDetailList); |
| | | if(StringUtils.hasText(infoDto.getDelTakecareDetails())){ |
| | | List<Long> idList = Arrays.stream(infoDto.getDelTakecareDetails().split(",")).map(s-> Long.parseLong(s.trim())) |
| | | .collect(Collectors.toList()); |
| | | |
| | | List<EquipmentTakecareDetail> delList = new ArrayList<>(); |
| | | idList.forEach(f->{ |
| | | EquipmentTakecareDetail info = new EquipmentTakecareDetail(); |
| | | info.setDelFlag(1); |
| | | info.setId(f); |
| | | delList.add(info); |
| | | if(takecareDetailList != null && !takecareDetailList.isEmpty()){ |
| | | takecareDetailList.forEach(f->{ |
| | | f.setEquipmentId(equipmentInfo.getId()); |
| | | f.setInfoTpe(equipmentInfo.getInfoType()); |
| | | }); |
| | | equipmentTakecareDetailBaseService.updateBatchById(delList); |
| | | equipmentTakecareDetailBaseService.saveOrUpdateBatch(takecareDetailList); |
| | | } |
| | | if(infoDto.getTakecareDetailList() != null){ |
| | | if(StringUtils.hasText(infoDto.getDelTakecareDetails())){ |
| | | List<Long> idList = Arrays.stream(infoDto.getDelTakecareDetails().split(",")).map(s-> Long.parseLong(s.trim())) |
| | | .collect(Collectors.toList()); |
| | | |
| | | if(idList != null && !idList.isEmpty()){ |
| | | List<EquipmentTakecareDetail> delList = new ArrayList<>(); |
| | | idList.forEach(f->{ |
| | | EquipmentTakecareDetail info = new EquipmentTakecareDetail(); |
| | | info.setDelFlag(1); |
| | | info.setId(f); |
| | | delList.add(info); |
| | | }); |
| | | equipmentTakecareDetailBaseService.updateBatchById(delList); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //保存设备检测 |
| | | List<EquipmentTestDetail> testDetailList = infoDto.getTestDetailList(); |
| | | testDetailList.forEach(f->{ |
| | | f.setEquipmentId(equipmentInfo.getId()); |
| | | f.setInfoTpe(equipmentInfo.getInfoType()); |
| | | }); |
| | | equipmentTestDetailBaseService.saveOrUpdateBatch(testDetailList); |
| | | if(StringUtils.hasText(infoDto.getDelTestDetails())){ |
| | | List<Long> idList = Arrays.stream(infoDto.getDelTestDetails().split(",")).map(s-> Long.parseLong(s.trim())) |
| | | .collect(Collectors.toList()); |
| | | List<EquipmentTestDetail> delList = new ArrayList<>(); |
| | | idList.forEach(f->{ |
| | | EquipmentTestDetail info = new EquipmentTestDetail(); |
| | | info.setDelFlag(1); |
| | | info.setId(f); |
| | | delList.add(info); |
| | | if(testDetailList != null && !testDetailList.isEmpty()){ |
| | | testDetailList.forEach(f->{ |
| | | f.setEquipmentId(equipmentInfo.getId()); |
| | | f.setInfoTpe(equipmentInfo.getInfoType()); |
| | | }); |
| | | equipmentTestDetailBaseService.updateBatchById(delList); |
| | | equipmentTestDetailBaseService.saveOrUpdateBatch(testDetailList); |
| | | } |
| | | if(infoDto.getDelTestDetails() != null && !infoDto.getDelTestDetails().isEmpty()){ |
| | | if(StringUtils.hasText(infoDto.getDelTestDetails())){ |
| | | List<Long> idList = Arrays.stream(infoDto.getDelTestDetails().split(",")).map(s-> Long.parseLong(s.trim())) |
| | | .collect(Collectors.toList()); |
| | | List<EquipmentTestDetail> delList = new ArrayList<>(); |
| | | idList.forEach(f->{ |
| | | EquipmentTestDetail info = new EquipmentTestDetail(); |
| | | info.setDelFlag(1); |
| | | info.setId(f); |
| | | delList.add(info); |
| | | }); |
| | | equipmentTestDetailBaseService.updateBatchById(delList); |
| | | } |
| | | } |
| | | |
| | | //设备检查 TODO |
| | |
| | | |
| | | //保存设备维修 |
| | | List<EquipmentRepairDetail> repaireDetailList = infoDto.getRepaireDetailList(); |
| | | repaireDetailList.forEach(f->{ |
| | | f.setEquipmentId(equipmentInfo.getId()); |
| | | f.setInfoTpe(equipmentInfo.getInfoType()); |
| | | }); |
| | | equipmentRepairDetailBaseService.saveOrUpdateBatch(repaireDetailList); |
| | | if(StringUtils.hasText(infoDto.getDelRepaireDetails())){ |
| | | List<Long> idList = Arrays.stream(infoDto.getDelRepaireDetails().split(",")).map(s-> Long.parseLong(s.trim())) |
| | | .collect(Collectors.toList()); |
| | | List<EquipmentRepairDetail> delList = new ArrayList<>(); |
| | | idList.forEach(f->{ |
| | | EquipmentRepairDetail info = new EquipmentRepairDetail(); |
| | | info.setDelFlag(1); |
| | | info.setId(f); |
| | | delList.add(info); |
| | | if(repaireDetailList != null && !repaireDetailList.isEmpty()){ |
| | | repaireDetailList.forEach(f->{ |
| | | f.setEquipmentId(equipmentInfo.getId()); |
| | | f.setInfoTpe(equipmentInfo.getInfoType()); |
| | | }); |
| | | equipmentRepairDetailBaseService.updateBatchById(delList); |
| | | equipmentRepairDetailBaseService.saveOrUpdateBatch(repaireDetailList); |
| | | } |
| | | if(infoDto.getDelRepaireDetails() != null && !infoDto.getDelRepaireDetails().isEmpty()){ |
| | | if(StringUtils.hasText(infoDto.getDelRepaireDetails())){ |
| | | List<Long> idList = Arrays.stream(infoDto.getDelRepaireDetails().split(",")).map(s-> Long.parseLong(s.trim())) |
| | | .collect(Collectors.toList()); |
| | | List<EquipmentRepairDetail> delList = new ArrayList<>(); |
| | | idList.forEach(f->{ |
| | | EquipmentRepairDetail info = new EquipmentRepairDetail(); |
| | | info.setDelFlag(1); |
| | | info.setId(f); |
| | | delList.add(info); |
| | | }); |
| | | equipmentRepairDetailBaseService.updateBatchById(delList); |
| | | } |
| | | } |
| | | |
| | | |
| | | //保存检查标准 |
| | | List<EquipmentCheckStandardDetail> checkStandardeDetailList = infoDto.getCheckStandardeDetailList(); |
| | | checkStandardeDetailList.forEach(f->{ |
| | | f.setEquipmentId(equipmentInfo.getId()); |
| | | f.setInfoTpe(equipmentInfo.getInfoType()); |
| | | }); |
| | | equipmentCheckStandardDetailBaseService.saveOrUpdateBatch(checkStandardeDetailList); |
| | | if(StringUtils.hasText(infoDto.getDelCheckStandardeDetails())){ |
| | | List<Long> idList = Arrays.stream(infoDto.getDelCheckStandardeDetails().split(",")).map(s-> Long.parseLong(s.trim())) |
| | | .collect(Collectors.toList()); |
| | | List<EquipmentCheckStandardDetail> delList = new ArrayList<>(); |
| | | idList.forEach(f->{ |
| | | EquipmentCheckStandardDetail info = new EquipmentCheckStandardDetail(); |
| | | info.setDelFlag(1); |
| | | info.setId(f); |
| | | delList.add(info); |
| | | if(checkStandardeDetailList != null && !checkStandardeDetailList.isEmpty()){ |
| | | checkStandardeDetailList.forEach(f->{ |
| | | f.setEquipmentId(equipmentInfo.getId()); |
| | | f.setInfoTpe(equipmentInfo.getInfoType()); |
| | | }); |
| | | equipmentCheckStandardDetailBaseService.updateBatchById(delList); |
| | | equipmentCheckStandardDetailBaseService.saveOrUpdateBatch(checkStandardeDetailList); |
| | | } |
| | | if(infoDto.getDelCheckStandardeDetails() != null && !infoDto.getDelCheckStandardeDetails().isEmpty()){ |
| | | if(StringUtils.hasText(infoDto.getDelCheckStandardeDetails())){ |
| | | List<Long> idList = Arrays.stream(infoDto.getDelCheckStandardeDetails().split(",")).map(s-> Long.parseLong(s.trim())) |
| | | .collect(Collectors.toList()); |
| | | List<EquipmentCheckStandardDetail> delList = new ArrayList<>(); |
| | | idList.forEach(f->{ |
| | | EquipmentCheckStandardDetail info = new EquipmentCheckStandardDetail(); |
| | | info.setDelFlag(1); |
| | | info.setId(f); |
| | | delList.add(info); |
| | | }); |
| | | equipmentCheckStandardDetailBaseService.updateBatchById(delList); |
| | | } |
| | | } |
| | | |
| | | |
| | | //保存保养标准 |
| | | List<EquipmentTakecareStardardDetail> takecareStardardeDetailList = infoDto.getTakecareStardardeDetailList(); |
| | | takecareStardardeDetailList.forEach(f->{ |
| | | f.setEquipmentId(equipmentInfo.getId()); |
| | | f.setInfoTpe(equipmentInfo.getInfoType()); |
| | | }); |
| | | equipmentTakecareStardardDetailBaseService.saveOrUpdateBatch(takecareStardardeDetailList); |
| | | if(StringUtils.hasText(infoDto.getDelTakecareStardardeDetails())){ |
| | | List<Long> idList = Arrays.stream(infoDto.getDelTakecareStardardeDetails().split(",")).map(s-> Long.parseLong(s.trim())) |
| | | .collect(Collectors.toList()); |
| | | List<EquipmentTakecareStardardDetail> delList = new ArrayList<>(); |
| | | idList.forEach(f->{ |
| | | EquipmentTakecareStardardDetail info = new EquipmentTakecareStardardDetail(); |
| | | info.setDelFlag(1); |
| | | info.setId(f); |
| | | delList.add(info); |
| | | if(takecareStardardeDetailList != null && !takecareStardardeDetailList.isEmpty()){ |
| | | takecareStardardeDetailList.forEach(f->{ |
| | | f.setEquipmentId(equipmentInfo.getId()); |
| | | f.setInfoTpe(equipmentInfo.getInfoType()); |
| | | }); |
| | | equipmentTakecareStardardDetailBaseService.updateBatchById(delList); |
| | | equipmentTakecareStardardDetailBaseService.saveOrUpdateBatch(takecareStardardeDetailList); |
| | | } |
| | | |
| | | if(infoDto.getDelTakecareStardardeDetails() != null && !infoDto.getDelTakecareStardardeDetails().isEmpty()){ |
| | | if(StringUtils.hasText(infoDto.getDelTakecareStardardeDetails())){ |
| | | List<Long> idList = Arrays.stream(infoDto.getDelTakecareStardardeDetails().split(",")).map(s-> Long.parseLong(s.trim())) |
| | | .collect(Collectors.toList()); |
| | | List<EquipmentTakecareStardardDetail> delList = new ArrayList<>(); |
| | | idList.forEach(f->{ |
| | | EquipmentTakecareStardardDetail info = new EquipmentTakecareStardardDetail(); |
| | | info.setDelFlag(1); |
| | | info.setId(f); |
| | | delList.add(info); |
| | | }); |
| | | equipmentTakecareStardardDetailBaseService.updateBatchById(delList); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |