From ddc0f14384619b9618f26a3f363f679833a68b3d Mon Sep 17 00:00:00 2001 From: yangbin <yangbin@qq.com> Date: 星期三, 16 四月 2025 09:51:32 +0800 Subject: [PATCH] 自动化产线集成模块添加数据查询 --- lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamWeekMaintenanceOrderController.java | 64 +++++++++++++++++++++++++++++++ 1 files changed, 63 insertions(+), 1 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 51ee76c..13b404e 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 @@ -10,6 +10,7 @@ import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.modules.eam.constant.BusinessCodeConst; +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; @@ -20,6 +21,7 @@ import javax.servlet.http.HttpServletRequest; import java.util.Arrays; +import java.util.List; /** * @Description: 鍛ㄤ繚宸ュ崟 @@ -53,7 +55,7 @@ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { // QueryWrapper<EamWeekMaintenanceOrder> queryWrapper = QueryGenerator.initQueryWrapper(eamWeekMaintenanceOrder, req.getParameterMap()); - Page<EamWeekMaintenanceOrder> page = new Page<EamWeekMaintenanceOrder>(pageNo, pageSize); + Page<EamWeekMaintenanceOrder> page = new Page<>(pageNo, pageSize); IPage<EamWeekMaintenanceOrder> pageList = eamWeekMaintenanceOrderService.queryPageList(page, query); return Result.OK(pageList); } @@ -121,6 +123,45 @@ } /** + * 閫氳繃id浣滃簾 + * + * @param id + * @return + */ + @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(!WeekMaintenanceStatusEnum.WAIT_MAINTENANCE.name().equals(entity.getMaintenanceStatus())) { + return Result.error("璇ョ姸鎬佺殑鏁版嵁涓嶅厑璁歌繘琛屼綔搴燂紒"); + } + 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("棰嗗彇鎴愬姛!"); + } + + /** * 鎵归噺鍒犻櫎 * * @param ids @@ -135,6 +176,27 @@ } /** + * 閫氳繃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(",")); + 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); + } + }); + return Result.OK("鎵归噺浣滃簾鎴愬姛锛�"); + } + + /** * 閫氳繃id鏌ヨ * * @param id -- Gitblit v1.9.3