Junjie
昨天 2825b82e8a4eca618ab3c2306de2db74a2ecbd1d
src/main/java/com/zy/asrs/controller/OpenController.java
@@ -27,12 +27,15 @@
import com.zy.core.thread.StationThread;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
import com.zy.system.service.HighPrivilegeGrantService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import jakarta.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.HashMap;
@@ -60,6 +63,10 @@
    private ConfigService configService;
    @Autowired
    private DeviceConfigService deviceConfigService;
    @Autowired
    private HighPrivilegeGrantService highPrivilegeGrantService;
    @Autowired
    private HttpServletRequest request;
    // 移库任务
    @PostMapping("/createLocMoveTask")
@@ -137,7 +144,13 @@
        if (param == null) {
            return R.error("参数不能为空");
        }
        boolean completeTask = commonService.cancelTask(param);
        boolean directCancel = false;
        try {
            highPrivilegeGrantService.assertGranted(request.getHeader("token"), "取消任务");
            directCancel = true;
        } catch (CoolException ignore) {
        }
        boolean completeTask = commonService.cancelTask(param, directCancel);
        if (completeTask) {
            return R.ok();
        }
@@ -163,7 +176,13 @@
        if (param == null) {
            return R.error("参数不能为空");
        }
        CancelTaskBatchResult result = commonService.cancelTaskBatch(param);
        boolean directCancel = false;
        try {
            highPrivilegeGrantService.assertGranted(request.getHeader("token"), "取消任务");
            directCancel = true;
        } catch (CoolException ignore) {
        }
        CancelTaskBatchResult result = commonService.cancelTaskBatch(param, directCancel);
        return R.ok().add(result);
    }