lyh
11 小时以前 e5a85d904ce028a35229ab6245ab894afbca6531
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamRepairOrderServiceImpl.java
@@ -212,14 +212,16 @@
        }
        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;
    }
@@ -233,7 +235,27 @@
        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);
@@ -325,7 +347,7 @@
            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());
@@ -334,7 +356,7 @@
        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;
    }