zhangherong
5 天以前 6722e123b7a54dcc6c6937bc4324c67293f233db
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamSecondMaintenanceOrderServiceImpl.java
@@ -183,6 +183,7 @@
            eamMaintenanceStandardDetailList.forEach(item -> {
                EamSecondMaintenanceOrderDetail detail = new EamSecondMaintenanceOrderDetail();
                BeanUtils.copyProperties(item, detail);
                detail.setId(null);
                detail.setOrderId(order.getId());
                requestTableDetailList.add(detail);
            });
@@ -379,7 +380,7 @@
                    values.put("comment", "二保操作工执行结束");
                    request.setComment("二保操作工执行结束");
                    //处理对应详情
                    if (CollectionUtils.isNotEmpty(request.getOperatorDetailList())){
                    if (CollectionUtils.isNotEmpty(request.getTableDetailList())){
                        //删除原有数据
                        List<EamSecondMaintenanceOrderDetail> addList = new ArrayList<>();
                        //先删除原有
@@ -387,7 +388,7 @@
                        queryWrapper.eq(EamSecondMaintenanceOrderDetail::getOrderId, entity.getId());
                        queryWrapper.eq(EamSecondMaintenanceOrderDetail::getItemCategory,EamMaintenanceStandardDetailCategory.OPERATOR_MAINTENANCE.name());
                        secondMaintenanceOrderDetailService.remove(queryWrapper);
                        request.getOperatorDetailList().forEach(tableDetail -> {
                        request.getTableDetailList().forEach(tableDetail -> {
                            EamSecondMaintenanceOrderDetail eamMaintenanceStandardDetail=new EamSecondMaintenanceOrderDetail();
                            BeanUtils.copyProperties(tableDetail, eamMaintenanceStandardDetail);
                            eamMaintenanceStandardDetail.setOrderId(entity.getId());
@@ -401,7 +402,7 @@
                    values.put("comment", "二保维修工执行结束");
                    request.setComment("二保维修工执行结束");
                    //处理对应详情
                    if (CollectionUtils.isNotEmpty(request.getRepairmanDetailList())){
                    if (CollectionUtils.isNotEmpty(request.getTableDetailList())){
                        //删除原有数据
                        List<EamSecondMaintenanceOrderDetail> addList = new ArrayList<>();
                        //先删除原有
@@ -409,7 +410,7 @@
                        queryWrapper.eq(EamSecondMaintenanceOrderDetail::getOrderId, entity.getId());
                        queryWrapper.eq(EamSecondMaintenanceOrderDetail::getItemCategory,EamMaintenanceStandardDetailCategory.REPAIRER_MAINTENANCE.name());
                        secondMaintenanceOrderDetailService.remove(queryWrapper);
                        request.getRepairmanDetailList().forEach(tableDetail -> {
                        request.getTableDetailList().forEach(tableDetail -> {
                            EamSecondMaintenanceOrderDetail eamMaintenanceStandardDetail=new EamSecondMaintenanceOrderDetail();
                            BeanUtils.copyProperties(tableDetail, eamMaintenanceStandardDetail);
                            eamMaintenanceStandardDetail.setOrderId(entity.getId());
@@ -422,35 +423,37 @@
                break;
            case WAIT_ADMIN_CONFIRM:
                //管理员确认
                userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getFactoryOrgCode(), BusinessCodeConst.PCR0003);
                userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getFactoryOrgCode(), BusinessCodeConst.PCR0006);
                if (CollectionUtil.isEmpty(userSelectors)) {
                    throw new JeecgBootException("设备未存在检查人,无法进入下级审批!");
                }else{
                    userApprovalList= userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList());
                    values.put("NextAssignee", userApprovalList);
                    values.put("dataId", entity.getId());
                    values.put("organization",request.getComment());
                    values.put("comment", request.getComment());
                    values.put("organization",request.getDealDescription());
                    values.put("comment", request.getDealDescription());
                    values.put("manageUserResult",request.getManageUserResult());
                    entity.setMaintenanceStatus(SecondMaintenanceStatusEnum.WAIT_INSPECTOR_CONFIRM.name());
                    entity.setManageUser(user.getUsername());
                    entity.setProblemDescription(request.getProblemDescription());
                    entity.setManageUserResult(request.getManageUserResult());
                    entity.setDealDescription(request.getComment());
                    entity.setDealDescription(request.getDealDescription());
                    entity.setConfirmTime(new Date());
                    request.setComment(request.getDealDescription());
                }
                break;
            case WAIT_INSPECTOR_CONFIRM:
                //检查人确认
                values.put("dataId", entity.getId());
                values.put("organization",request.getComment());
                values.put("comment", request.getComment());
                values.put("organization",request.getInspectConfirmComment());
                values.put("comment", request.getInspectConfirmComment());
                values.put("inspectorResult",request.getInspectorResult());
                entity.setMaintenanceStatus(SecondMaintenanceStatusEnum.COMPLETE.name());
                entity.setInspector(user.getUsername());
                entity.setInspectorResult(request.getInspectorResult());
                entity.setInspectConfirmComment(request.getInspectConfirmComment());
                entity.setInspectConfirmTime(new Date());
                request.setComment(request.getDealDescription());
                break;
            default:
                throw  new JeecgBootException("审批失败");