From 35c1ce18a53a2d328c2f1adb7f0b110ff65d7962 Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期四, 10 四月 2025 10:42:00 +0800 Subject: [PATCH] 点检工单流程 --- lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamWeekMaintenanceOrderController.java | 38 ++++++++++++++++++++++++++------------ 1 files changed, 26 insertions(+), 12 deletions(-) diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamWeekMaintenanceOrderController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamWeekMaintenanceOrderController.java index e465d8b..3678b95 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamWeekMaintenanceOrderController.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamWeekMaintenanceOrderController.java @@ -8,12 +8,9 @@ import lombok.extern.slf4j.Slf4j; import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; -import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.modules.eam.constant.BusinessCodeConst; -import org.jeecg.modules.eam.constant.MaintenanceStandardStatusEnum; -import org.jeecg.modules.eam.constant.MaintenanceStatusEnum; -import org.jeecg.modules.eam.entity.EamMaintenanceStandard; +import org.jeecg.modules.eam.constant.WeekMaintenanceStatusEnum; import org.jeecg.modules.eam.entity.EamWeekMaintenanceOrder; import org.jeecg.modules.eam.request.EamWeekMaintenanceQuery; import org.jeecg.modules.eam.request.EamWeekMaintenanceRequest; @@ -131,20 +128,37 @@ * @param id * @return */ - @AutoLog(value = "淇濆吇鏍囧噯-浣滃簾") - @ApiOperation(value = "淇濆吇鏍囧噯-浣滃簾", notes = "淇濆吇鏍囧噯-浣滃簾") + @AutoLog(value = "鍛ㄤ繚宸ュ崟-浣滃簾") + @ApiOperation(value = "鍛ㄤ繚宸ュ崟-浣滃簾", notes = "鍛ㄤ繚宸ュ崟-浣滃簾") @DeleteMapping(value = "/abolish") public Result<?> abolish(@RequestParam(name = "id", required = true) String id) { EamWeekMaintenanceOrder entity = eamWeekMaintenanceOrderService.getById(id); if(entity == null) { return Result.error("瑕佷綔搴熺殑鏁版嵁涓嶅瓨鍦紝璇峰埛鏂伴噸璇曪紒"); } - if(!MaintenanceStatusEnum.WAIT_MAINTENANCE.name().equals(entity.getMaintenanceStatus())) { + if(!WeekMaintenanceStatusEnum.WAIT_MAINTENANCE.name().equals(entity.getMaintenanceStatus())) { return Result.error("璇ョ姸鎬佺殑鏁版嵁涓嶅厑璁歌繘琛屼綔搴燂紒"); } - entity.setMaintenanceStatus(MaintenanceStatusEnum.ABOLISH.name()); + entity.setMaintenanceStatus(WeekMaintenanceStatusEnum.ABOLISH.name()); eamWeekMaintenanceOrderService.updateById(entity); return Result.OK("浣滃簾鎴愬姛!"); + } + + /** + * 閫氳繃id棰嗗彇 + * + * @param id + * @return + */ + @AutoLog(value = "鍛ㄤ繚宸ュ崟-棰嗗彇") + @ApiOperation(value = "鍛ㄤ繚宸ュ崟-棰嗗彇", notes = "鍛ㄤ繚宸ュ崟-棰嗗彇") + @GetMapping(value = "/collect") + public Result<?> collect(@RequestParam(name = "id", required = true) String id) { + boolean b = eamWeekMaintenanceOrderService.collect(id); + if(!b) { + Result.OK("棰嗗彇澶辫触!"); + } + return Result.OK("棰嗗彇鎴愬姛!"); } /** @@ -167,15 +181,15 @@ * @param ids * @return */ - @AutoLog(value = "淇濆吇鏍囧噯-鎵归噺浣滃簾") - @ApiOperation(value = "淇濆吇鏍囧噯-鎵归噺浣滃簾", notes = "淇濆吇鏍囧噯-鎵归噺浣滃簾") + @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(",")); list.forEach(id -> { EamWeekMaintenanceOrder entity = eamWeekMaintenanceOrderService.getById(id); - if (entity != null && MaintenanceStatusEnum.WAIT_MAINTENANCE.name().equals(entity.getMaintenanceStatus())) { - entity.setMaintenanceStatus(MaintenanceStatusEnum.ABOLISH.name()); + if (entity != null && WeekMaintenanceStatusEnum.WAIT_MAINTENANCE.name().equals(entity.getMaintenanceStatus())) { + entity.setMaintenanceStatus(WeekMaintenanceStatusEnum.ABOLISH.name()); eamWeekMaintenanceOrderService.updateById(entity); } }); -- Gitblit v1.9.3