zhangherong
2025-04-23 6be893ccb873b171c3e6cf3c9dd83955dcaaf368
art: 设备管理-周保工单-批量领取接口添加
已修改1个文件
30 ■■■■■ 文件已修改
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamWeekMaintenanceOrderController.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamWeekMaintenanceOrderController.java
@@ -29,6 +29,7 @@
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
/**
 * @Description: 周保工单
@@ -198,14 +199,40 @@
    @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() + " 条工单!");
    }
    /**
@@ -241,6 +268,7 @@
    /**
     * 我的待办,审批动作
     *
     * @param request
     * @return
     */