#
Junjie
2025-05-01 e9efb50ea62a9ad58e652446c6528f1b49fcc39a
src/main/java/com/zy/asrs/controller/OpenController.java
@@ -15,13 +15,9 @@
import com.zy.asrs.entity.param.*;
import com.zy.asrs.service.*;
import com.zy.asrs.utils.NotifyUtils;
import com.zy.asrs.utils.Utils;
import com.zy.common.service.CommonService;
import com.zy.common.utils.HttpHandler;
import com.zy.common.web.BaseController;
import com.zy.core.cache.MessageQueue;
import com.zy.core.enums.SlaveType;
import com.zy.core.model.Task;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -68,6 +64,8 @@
    private CommonService commonService;
    @Autowired
    private NotifyUtils notifyUtils;
    @Autowired
    private BasDevpService basDevpService;
    private static final boolean auth = true;
@@ -293,10 +291,14 @@
                result =  R.error("未查到当前任务---" + param);
                return result;
            }
            boolean sign =false;
            boolean sign = false;
            switch (param.getTaskStatus()) {
                case 1://正常取消
                    if (taskWrk.getStatus() > 1) {
                        if (taskWrk.getIoType() == 1 && taskWrk.getWrkSts() <= 2) {//入库
                            break;
                        }
                        result = R.error("任务已开始执行");
                        return result;
                    }
@@ -347,22 +349,20 @@
    @GetMapping("/deviceStatus")
    @Transactional
    public R deviceStatus() {
        List<CrnStatusParam> crnStatusParams=new ArrayList<>();
        List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<>());
        for (BasCrnp basCrnp:basCrnps){
            CrnStatusParam crnStatusParam=new CrnStatusParam();
            crnStatusParam.setCrnNo(basCrnp.getCrnNo());
            crnStatusParam.setCrnSts(basCrnp.getCrnSts());
            crnStatusParam.setErrorCode(basCrnp.getCrnErr());
            BasCrnError error=basCrnErrorService.selectOne(new EntityWrapper<BasCrnError>().eq("error_code",basCrnp.getCrnErr()));
            if(Cools.isEmpty(error)){
                crnStatusParam.setErrorMsg("");
            }else {
                crnStatusParam.setErrorMsg(error.getErrName());
            }
            crnStatusParams.add(crnStatusParam);
        }
        return R.ok(crnStatusParams);
        List<CrnStatusParam> crnStatusParams = openService.getCrnStatus();
        List<StationStatusParam> stationStatus = openService.getStationStatus();
        HashMap<String, Object> map = new HashMap<>();
        map.put("crn", crnStatusParams);
        map.put("station", stationStatus);
        return R.ok().add(map);
    }
    //输送站点状态查询接口
    @GetMapping("/stationStatus")
    @Transactional
    public R stationStatus() {
        List<StationStatusParam> data = openService.getStationStatus();
        return R.ok().add(data);
    }
    //模拟输送线入库