#
Junjie
2023-10-13 03e68b2be24ea024eae645c47da1d4cb1773302a
src/main/java/com/zy/asrs/controller/ShuttleController.java
@@ -17,6 +17,7 @@
import com.zy.asrs.service.WrkMastService;
import com.zy.asrs.utils.Utils;
import com.zy.common.model.NyShuttleOperaResult;
import com.zy.common.model.enums.NavigationMapType;
import com.zy.common.service.CommonService;
import com.zy.common.utils.NyHttpUtils;
import com.zy.common.utils.NyShuttleOperaUtils;
@@ -72,6 +73,10 @@
        ArrayList<JSONObject> list = new ArrayList<>();
        List<BasShuttle> shuttles = basShuttleService.selectList(new EntityWrapper<BasShuttle>().orderBy("shuttle_no"));
        for (BasShuttle basShuttle : shuttles) {
            // 表格行
            JSONObject baseObj = new JSONObject();
            baseObj.put("shuttleNo", basShuttle.getShuttleNo());
            list.add(baseObj);
            // 获取四向穿梭车信息
            NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, basShuttle.getShuttleNo());
            if (shuttleThread == null) {
@@ -81,7 +86,7 @@
            JSONObject shuttleData = JSON.parseObject(JSON.toJSONString(shuttleProtocol));
            if (shuttleProtocol == null || shuttleProtocol.getShuttleNo()==null) {
                if (shuttleData != null) {
                    list.add(shuttleData);
                    baseObj.putAll(shuttleData);
                }
                continue;
            }
@@ -96,7 +101,7 @@
                }
            }
            list.add(shuttleData);
            baseObj.putAll(shuttleData);
        }
        return R.ok().add(list);
    }
@@ -299,7 +304,11 @@
                    assignCommand.setNodes(result.getNodes());
                } else if (shuttleTaskModeType == ShuttleTaskModeType.MOVE_LOC_NO) {
                    //移动到目标库位
                    NyShuttleOperaResult result = NyShuttleOperaUtils.getStartToTargetCommands(shuttleSlave.getId(), assignCommand.getTaskNo().intValue(), shuttleProtocol.getCurrentLocNo(), param.getDistLocNo());
                    Integer mapType = NavigationMapType.NORMAL.id;
                    if (shuttleProtocol.getLiftPosition() == 2) {
                        mapType = NavigationMapType.DFX.id;
                    }
                    NyShuttleOperaResult result = NyShuttleOperaUtils.getStartToTargetCommands(shuttleSlave.getId(), assignCommand.getTaskNo().intValue(), shuttleProtocol.getCurrentLocNo(), param.getDistLocNo(), mapType);
                    if (result == null) {
                        throw new CoolException("路径计算失败");
                    }