| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | |
| | | /** |
| | | * @Description: 周保工单 |
| | |
| | | @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 -> { |
| | | EamWeekMaintenanceOrder entity = eamWeekMaintenanceOrderService.getById(id); |
| | | if (entity != null && WeekMaintenanceStatusEnum.WAIT_MAINTENANCE.name().equals(entity.getMaintenanceStatus())) { |
| | | entity.setMaintenanceStatus(WeekMaintenanceStatusEnum.ABOLISH.name()); |
| | | eamWeekMaintenanceOrderService.updateById(entity); |
| | | i.getAndIncrement(); |
| | | } |
| | | }); |
| | | return Result.OK("批量作废成功!"); |
| | | return Result.OK("批量作废成功 " + i.get() + " 条工单!"); |
| | | } |
| | | |
| | | /** |
| | | * 通过id批量领取 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "周保工单-批量领取") |
| | | @ApiOperation(value = "周保工单-批量领取", notes = "周保工单-批量领取") |
| | | @DeleteMapping(value = "/collectBatch") |
| | | public Result<?> collectBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | | List<String> list = Arrays.asList(ids.split(",")); |
| | | AtomicInteger i = new AtomicInteger(); |
| | | list.forEach(id -> { |
| | | EamWeekMaintenanceOrder entity = eamWeekMaintenanceOrderService.getById(id); |
| | | if (entity != null && WeekMaintenanceStatusEnum.WAIT_MAINTENANCE.name().equals(entity.getMaintenanceStatus())) { |
| | | boolean b = eamWeekMaintenanceOrderService.collect(id); |
| | | if (b) { |
| | | i.getAndIncrement(); |
| | | } |
| | | } |
| | | }); |
| | | return Result.OK("批量领取成功 " + i.get() + " 条工单!"); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 我的待办,审批动作 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |