| | |
| | | if (request == null) { |
| | | return Result.error("添加的对象不能为空!"); |
| | | } |
| | | if (CollectionUtil.isEmpty(request.getTableDetailList())) { |
| | | if (StrUtil.isEmpty(request.getStandardId())) { |
| | | return Result.error("保养项不能为空!"); |
| | | } |
| | | String codeSeq = businessCodeRuleService.generateBusinessCodeSeq(BusinessCodeConst.SECOND_MAINTENANCE_CODE_RULE); |
| | |
| | | if (request == null) { |
| | | return Result.error("添加的对象不能为空!"); |
| | | } |
| | | if (CollectionUtil.isEmpty(request.getTableDetailList())) { |
| | | if (StrUtil.isEmpty(request.getStandardId())) { |
| | | return Result.error("保养项不能为空!"); |
| | | } |
| | | boolean b = eamSecondMaintenanceOrderService.editMaintenance(request); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 通过id作废 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设备二级保养-作废") |
| | | @ApiOperation(value = "设备二级保养-作废", notes = "设备二级保养-作废") |
| | | @DeleteMapping(value = "/abolish") |
| | | public Result<?> abolish(@RequestParam(name = "id", required = true) String id) { |
| | | EamSecondMaintenanceOrder entity = eamSecondMaintenanceOrderService.getById(id); |
| | | if (entity == null) { |
| | | return Result.error("要作废的数据不存在,请刷新重试!"); |
| | | } |
| | | if (!SecondMaintenanceStatusEnum.WAIT_MAINTENANCE.name().equals(entity.getMaintenanceStatus())) { |
| | | return Result.error("该状态的数据不允许进行作废!"); |
| | | } |
| | | entity.setMaintenanceStatus(SecondMaintenanceStatusEnum.ABOLISH.name()); |
| | | eamSecondMaintenanceOrderService.updateById(entity); |
| | | return Result.OK("作废成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 通过id领取 |
| | | * |
| | | * @param id |
| | |
| | | Result.OK("领取失败!"); |
| | | } |
| | | return Result.OK("领取成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 通过id批量作废 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "周保工单-批量作废") |
| | | @ApiOperation(value = "周保工单-批量作废", notes = "周保工单-批量作废") |
| | | @DeleteMapping(value = "/abolishBatch") |
| | | public Result<?> abolishBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | | List<String> list = Arrays.asList(ids.split(",")); |
| | | AtomicInteger i = new AtomicInteger(); |
| | | list.forEach(id -> { |
| | | EamSecondMaintenanceOrder entity = eamSecondMaintenanceOrderService.getById(id); |
| | | if (entity != null && SecondMaintenanceStatusEnum.WAIT_MAINTENANCE.name().equals(entity.getMaintenanceStatus())) { |
| | | entity.setMaintenanceStatus(SecondMaintenanceStatusEnum.ABOLISH.name()); |
| | | eamSecondMaintenanceOrderService.updateById(entity); |
| | | i.getAndIncrement(); |
| | | } |
| | | }); |
| | | return Result.OK("批量作废成功 " + i.get() + " 条工单!"); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (request == null) { |
| | | return Result.error("审批的对象不能为空!"); |
| | | } |
| | | if (CollectionUtil.isEmpty(request.getTableDetailList())) { |
| | | if (StrUtil.isEmpty(request.getStandardId())) { |
| | | return Result.error("保养项不能为空!"); |
| | | } |
| | | // 检查请求参数 |