自动化立体仓库 - WCS系统
Junjie
2023-10-31 d2fd7cfc1a426baabe4fac47f88b4db03432e22b
src/main/java/com/zy/asrs/controller/ShuttleController.java
@@ -7,6 +7,7 @@
import com.core.common.BaseRes;
import com.core.common.Cools;
import com.core.common.R;
import com.core.common.SpringUtils;
import com.core.exception.CoolException;
import com.zy.asrs.domain.param.ShuttleOperatorParam;
import com.zy.asrs.domain.vo.*;
@@ -71,10 +72,13 @@
    @ManagerAuth(memo = "四向穿梭车信息表")
    public R shuttleStateTable(){
        ArrayList<JSONObject> list = new ArrayList<>();
        List<BasShuttle> shuttles = basShuttleService.selectList(new EntityWrapper<BasShuttle>().orderBy("shuttle_no"));
        for (BasShuttle basShuttle : shuttles) {
        for (ShuttleSlave slave : slaveProperties.getShuttle()) {
            // 表格行
            JSONObject baseObj = new JSONObject();
            baseObj.put("shuttleNo", slave.getId());
            list.add(baseObj);
            // 获取四向穿梭车信息
            NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, basShuttle.getShuttleNo());
            NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, slave.getId());
            if (shuttleThread == null) {
                continue;
            }
@@ -82,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;
            }
@@ -97,7 +101,13 @@
                }
            }
            list.add(shuttleData);
            Integer chargeLine = basShuttleService.selectById(slave.getId()).getChargeLine();
            String lowerPower = "N";
            if (chargeLine != null && shuttleProtocol.getPowerPercent() != null) {
                lowerPower = shuttleProtocol.getPowerPercent() <= chargeLine ? "Y" : "N";
            }
            shuttleData.put("lowerPower", lowerPower);//是否低电量
            baseObj.putAll(shuttleData);
        }
        return R.ok().add(list);
    }
@@ -106,14 +116,13 @@
    @ManagerAuth(memo = "四向穿梭车数据表")
    public R steMsgTable(){
        List<ShuttleMsgTableVo> list = new ArrayList<>();
        List<BasShuttle> shuttles = basShuttleService.selectList(new EntityWrapper<BasShuttle>().orderBy("shuttle_no"));
        for (BasShuttle basShuttle : shuttles) {
        for (ShuttleSlave slave : slaveProperties.getShuttle()) {
            // 表格行
            ShuttleMsgTableVo vo = new ShuttleMsgTableVo();
            vo.setShuttleNo(basShuttle.getShuttleNo());   //  四向穿梭车号
            vo.setShuttleNo(slave.getId());   //  四向穿梭车号
            list.add(vo);
            // 获取穿梭车信息
            ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, basShuttle.getShuttleNo());
            ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, slave.getId());
            if (shuttleThread == null) {
                continue;
            }
@@ -147,8 +156,11 @@
            vo.setPakMk(shuttleProtocol.getPakMk()?"Y" : "N");    // 作业标记
            vo.setLocNo(shuttleProtocol.getLocNo());//四向穿梭车当前库位号
            vo.setLev(shuttleProtocol.getLocNo() == null ? 0 : Utils.getLev(shuttleProtocol.getLocNo()));//四向穿梭车当前层高
//            vo.setRunSpeed(basShuttle.getRunSpeed());//四向穿梭车运行速度(设置)
            vo.setChargeLine(basShuttle.getChargeLine());//充电阈值
            BasShuttle basShuttle = basShuttleService.selectById(slave.getId());
            if (basShuttle != null) {
                vo.setChargeLine(basShuttle.getChargeLine());//充电阈值
            }
        }
        return R.ok().add(list);
    }