cpT
2025-06-27 5796d43a6bedd35edb3c04b73c8aae43cae1a29c
src/main/java/com/zy/asrs/controller/RgvController.java
@@ -2,9 +2,11 @@
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.annotations.ManagerAuth;
import com.core.common.Cools;
import com.core.common.R;
import com.zy.asrs.entity.BasDevpPosition;
import com.zy.asrs.service.BasDevpPositionService;
import com.zy.core.cache.RgvErrCache;
import com.zy.core.cache.RgvStatusCache;
import com.zy.core.cache.SlaveConnection;
import com.zy.core.cache.TaskProtocolCache;
@@ -46,6 +48,7 @@
            map2.put("rgvPos", rgvProtocol.getRgvPos());
            map2.put("rgvPosDestination", rgvProtocol.getRgvPosDestination());
            map2.put("loaded", rgvProtocol.getLoaded().equals((short)-1)? "未知":rgvProtocol.getLoaded()==1? "有物":"无物");
            map2.put("errorRgv", RgvErrCache.getErrorDev(rgvProtocol.getRgvNo()));
            res.add(map2);
        }
        return R.ok().add(res);
@@ -98,6 +101,23 @@
        return R.ok("任务清空成功");
    }
    @PostMapping("/run/del2")//Take  Put  Walk
    @ManagerAuth(memo = "清除作业启动中")
    public R rgvRunDel2(@RequestParam(defaultValue = "0")  Integer rgvNo
    ) {
        if (rgvNo==null || rgvNo==0){
            return R.error("请选择小车");
        }
        RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgvNo);
        try {
            rgvThread.setWrkSign();
        } catch (Exception e) {
            return R.error("清除作业启动中失败"+e.getMessage());
        }
        return R.ok("任务清空成功");
    }
    @PostMapping("/run/walk")//Take  Put  Walk
    @ManagerAuth(memo = "小车行走")
    public R rgvRunWalk(@RequestParam(defaultValue = "0")  Integer rgvNo,
@@ -113,6 +133,9 @@
        }
        if (rgvPosDestination == null || rgvPosDestination == 0){
            BasDevpPosition basDevpPosition = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("DEV_NO", rgvStaNoPut));
            if (Cools.isEmpty(basDevpPosition)){
                return R.error("目标站点不存在");
            }
            rgvPosDestination = basDevpPosition.getPlcPosition();
        }
        RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgvNo);
@@ -168,6 +191,9 @@
            }
            BasDevpPosition basDevpPosition = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("DEV_NO", rgvStaNoPut));
            if (Cools.isEmpty(basDevpPosition)){
                return R.error("目标站点不存在");
            }
            //执行
            issuedPut.setTaskNo(Long.valueOf(taskNo));
            issuedPut.setTaskStatus(3);
@@ -210,6 +236,9 @@
            }
            BasDevpPosition basDevpPosition = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("DEV_NO", rgvStaNoTake));
            if (Cools.isEmpty(basDevpPosition)){
                return R.error("取货站点不存在");
            }
            //执行
            issuedTake.setTaskNo(Long.valueOf(taskNo));
            issuedTake.setTaskStatus(2);
@@ -257,6 +286,9 @@
            }
            BasDevpPosition basDevpPositionTake = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("DEV_NO", rgvStaNoTake));
            if (Cools.isEmpty(basDevpPositionTake)){
                return R.error("取货站点不存在");
            }
            //执行
            issuedTake.setTaskNo(Long.valueOf(taskNo));
            issuedTake.setTaskStatus(2);
@@ -268,6 +300,9 @@
            issuedTake.setDirection(basDevpPositionTake.getRgvSign()==1);
            BasDevpPosition basDevpPositionPut = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("DEV_NO", rgvStaNoPut));
            if (Cools.isEmpty(basDevpPositionPut)){
                return R.error("目标站点不存在");
            }
            //执行
            issuedPut.setTaskNo(Long.valueOf(taskNo));
            issuedPut.setTaskStatus(3);