| | |
| | | } |
| | | eamReportRepair.setReportStatus(EamRepairOrderRepairStatusEnum.UNDER_MAINTENANCE.name()); |
| | | eamReportRepairService.updateById(eamReportRepair); |
| | | List<EamRepairPerson> eamRepairPersonList=new ArrayList<>(); |
| | | iEamRepairPersonService.remove(new QueryWrapper<EamRepairPerson>().eq("repair_id",eamRepairOrderDto.getId())); |
| | | if(CollectionUtils.isNotEmpty(eamRepairOrderDto.getEamRepairPersonList())) { |
| | | List<EamRepairPerson> persons = eamRepairOrderDto.getEamRepairPersonList().stream() |
| | | .map(person -> new EamRepairPerson() |
| | | .setRepairId(eamRepairOrder.getId()) |
| | | .setDelFlag(CommonConstant.DEL_FLAG_0)) |
| | | .collect(Collectors.toList()); |
| | | iEamRepairPersonService.saveBatch(persons); |
| | | if (CollectionUtils.isNotEmpty(eamRepairOrderDto.getEamRepairPersonList())) { |
| | | eamRepairOrderDto.getEamRepairPersonList().forEach(eamRepairPerson -> { |
| | | eamRepairPerson.setId(null); |
| | | eamRepairPerson.setRepairId(eamRepairOrder.getId()); |
| | | eamRepairPerson.setDelFlag(CommonConstant.DEL_FLAG_0); |
| | | eamRepairPersonList.add(eamRepairPerson); |
| | | }); |
| | | iEamRepairPersonService.saveBatch(eamRepairPersonList); |
| | | } |
| | | return true; |
| | | } |
| | |
| | | if (CollectionUtils.isEmpty(eamRepairPersonList)) { |
| | | throw new RuntimeException("维修人员不能为空"); |
| | | } |
| | | if (StrUtil.isEmpty(eamRepairOrder.getRepairCode())) {} |
| | | if (StrUtil.isEmpty(eamRepairOrder.getRepairCode())) { |
| | | throw new RuntimeException("工单编号为空"); |
| | | } |
| | | if (eamRepairOrder.getActualStartTime()==null){ |
| | | throw new RuntimeException("维修开始时间为空"); |
| | | } |
| | | if (eamRepairOrder.getActualEndTime()==null){ |
| | | throw new RuntimeException("维修结束时间为空"); |
| | | } |
| | | if (StrUtil.isEmpty(eamRepairOrder.getFaultReason())){ |
| | | throw new RuntimeException("故障原因为空"); |
| | | } |
| | | if (StrUtil.isEmpty(eamRepairOrder.getFaultAnalysis())){ |
| | | throw new RuntimeException("故障分析为空"); |
| | | } |
| | | if (StrUtil.isEmpty(eamRepairOrder.getFaultProcess())){ |
| | | throw new RuntimeException("排故过程为空"); |
| | | } |
| | | if (StrUtil.isEmpty(eamRepairOrder.getFaultPrevent())){ |
| | | throw new RuntimeException("故障预防为空"); |
| | | } |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | EamEquipment eamEquipment = eamEquipmentService.getById(eamRepairOrder.getEquipmentId()); |
| | | List<UserSelector> userSelectorList = sysUserService.selectOperatorList(eamEquipment.getEquipmentCode(), eamEquipment.getFactoryOrgCode(), BusinessCodeConst.PCR0001); |
| | |
| | | if ("1".equals(request.getConfirmResult())) { |
| | | order.setRepairStatus(EamRepairOrderRepairStatusEnum.REPAIR_COMPLETED.name()); |
| | | }else { |
| | | order.setRepairStatus(EamRepairOrderRepairStatusEnum.UNDER_MAINTENANCE.name()); |
| | | order.setRepairStatus(EamRepairOrderRepairStatusEnum.REJECTED.name()); |
| | | } |
| | | } |
| | | order.setConfirmer(user.getUsername()); |
| | |
| | | order.setConfirmComment(request.getConfirmComment()); |
| | | this.baseMapper.updateById(order); |
| | | EamReportRepair eamReportRepair=eamReportRepairService.getById(order.getReportId()); |
| | | eamReportRepair.setReportStatus(EamRepairOrderRepairStatusEnum.UNDER_MAINTENANCE.name()); |
| | | eamReportRepair.setReportStatus(order.getRepairStatus()); |
| | | eamReportRepairService.updateById(eamReportRepair); |
| | | return order; |
| | | } |