#
luxiaotao1123
2021-01-12 f939d20b9e587fa438a8b06848ab85e903ddbd46
src/main/java/com/zy/asrs/controller/CrnController.java
@@ -14,11 +14,14 @@
import com.zy.asrs.domain.vo.CrnStateTableVo;
import com.zy.asrs.entity.BasCrnError;
import com.zy.asrs.entity.BasCrnp;
import com.zy.asrs.entity.LocMast;
import com.zy.asrs.entity.WrkMast;
import com.zy.asrs.mapper.BasCrnErrorMapper;
import com.zy.asrs.service.BasCrnpService;
import com.zy.asrs.service.LocMastService;
import com.zy.asrs.service.WrkMastService;
import com.zy.asrs.service.impl.MainServiceImpl;
import com.zy.asrs.utils.VersionUtils;
import com.zy.core.CrnThread;
import com.zy.core.cache.MessageQueue;
import com.zy.core.cache.OutputQueue;
@@ -61,6 +64,8 @@
    private BasCrnpService basCrnpService;
    @Autowired
    private MainServiceImpl mainService;
    @Autowired
    private LocMastService locMastService;
    @ManagerAuth(memo = "进行中的命令")
@@ -127,13 +132,24 @@
            vo.setLoading(crnProtocol.getLoaded()==1?"有物":"无物");  //  有物
            vo.setBay(crnProtocol.getBay());    //  列
            vo.setLev(crnProtocol.getLevel());  //  层
            vo.setXOrigin(crnProtocol.getBay()==1?"是":"否");     //  走行原点
            vo.setYOrigin(crnProtocol.getLevel()==1?"是":"否");     // 升降原点
            vo.setLiftPos(crnProtocol.getLiftPosType().desc);
            if (crnProtocol.getPlatformHigh()) {
                vo.setSitePos("站台高位");
            }
            if (crnProtocol.getPlatformLow()) {
                vo.setSitePos("站台高位");
            }
//            vo.setXOrigin(crnProtocol.getBay()==1?"是":"否");     //  走行原点
//            vo.setYOrigin(crnProtocol.getLevel()==1?"是":"否");     // 升降原点
            vo.setForkOffset(crnProtocol.getForkPosType().desc);    // 货叉位置
            vo.setXLocation(crnProtocol.getWalkPos() == 1?"是":"否");      // 走行定位
            vo.setYLocation(crnProtocol.getLiftPosType().equals(CrnLiftPosType.NONE)?"否":"是");      // 升降定位
//            vo.setStop(crnProtocol.getCrnError1().controlStop||crnProtocol.getCrnError1().mainStop||crnProtocol.getCrnError1().remoteStop?"是":"否");       //  急停
            vo.setWarnCode(String.valueOf(crnProtocol.getAlarm1()));  //  异常码
            vo.setAlarm1(String.valueOf(crnProtocol.getAlarm1()));
            vo.setAlarm2(String.valueOf(crnProtocol.getAlarm2()));
            vo.setAlarm3(String.valueOf(crnProtocol.getAlarm3()));
            vo.setAlarm4(String.valueOf(crnProtocol.getAlarm4()));
//            vo.setWarnCode(String.valueOf(crnProtocol.getAlarm1()));  //  异常码
        }
        return R.ok().add(list);
@@ -236,7 +252,6 @@
        command.setDestinationPosX(param.getRow());     // 目标库位排
        command.setDestinationPosY(param.getBay());     // 目标库位列
        command.setDestinationPosZ(param.getLev());     // 目标库位层
        staNoProcess(param, command);
        return crnControl(command)?R.ok():R.error();
    }
@@ -254,7 +269,6 @@
        command.setDestinationPosX(param.getRow());     // 目标库位排
        command.setDestinationPosY(param.getBay());     // 目标库位列
        command.setDestinationPosZ(param.getLev());     // 目标库位层
        staNoProcess(param, command);
        return crnControl(command)?R.ok():R.error();
    }
@@ -272,7 +286,11 @@
        command.setDestinationPosX(param.getRow());     // 目标库位排
        command.setDestinationPosY(param.getBay());     // 目标库位列
        command.setDestinationPosZ(param.getLev());     // 目标库位层
        staNoProcess(param, command);
        LocMast sourceLoc = locMastService.selectOne(new EntityWrapper<LocMast>().eq("row1", command.getSourcePosX())
                .eq("bay1", command.getSourcePosY()).eq("lev1", command.getSourcePosZ()));
        LocMast loc = locMastService.selectOne(new EntityWrapper<LocMast>().eq("row1", command.getDestinationPosX())
                .eq("bay1", command.getDestinationPosY()).eq("lev1", command.getDestinationPosZ()));
        VersionUtils.locMoveCheckLocType(sourceLoc, loc);
        return crnControl(command)?R.ok():R.error();
    }
@@ -290,7 +308,6 @@
        command.setDestinationPosX(param.getStaNo());     // 目标库位排
        command.setDestinationPosY((short) 0);     // 目标库位列
        command.setDestinationPosZ((short) 1);     // 目标库位层
        staNoProcess(param, command);
        return crnControl(command)?R.ok():R.error();
    }