| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import HslCommunication.Profinet.Siemens.SiemensS7Net; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | |
| | | @Slf4j |
| | | @RestController |
| | | public class CrnController { |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private SlaveProperties slaveProperties; |
| | |
| | | vo.setYduration(crnProtocol.getYDuration()); // 升降时长(H) |
| | | |
| | | vo.setStatusType(crnProtocol.modeType.desc); // 模式状态 |
| | | vo.setWrkStatus(crnProtocol.getStatusType().desc); // 任务状态 |
| | | vo.setWrkStatus(crnProtocol.getStatusType().id); // 任务状态 |
| | | vo.setLoading((crnProtocol.getLoaded() != null && crnProtocol.getLoaded() == 1) ? "有物" : "无物"); // 有物 |
| | | vo.setBay(crnProtocol.getBay()); // 列 |
| | | vo.setLev(crnProtocol.getLevel()); // 层 |
| | |
| | | BasCrnError crnError = basCrnErrorMapper.selectById(crnProtocol.getAlarm1()); |
| | | vo.setAlarm(crnError==null?"未知异常":crnError.getErrName()); |
| | | } |
| | | vo.setInEnable(basCrnp.getInEnable()); |
| | | vo.setOutEnable(basCrnp.getOutEnable()); |
| | | } |
| | | return R.ok().add(list); |
| | | } |
| | |
| | | return R.error(); |
| | | } |
| | | |
| | | @ManagerAuth(memo = "切换联机模式") |
| | | @PostMapping("/crn/operator/auto") |
| | | public R crnAuto(CrnOperatorParam param){ |
| | | short[] array = new short[9]; |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | | // command.setAckFinish((short) 0); // 任务完成确认位 |
| | | // command.setTaskMode(CrnTaskModeType.PAKIN); // 任务模式 |
| | | // command.setSourcePosX(param.getSourceRow()); // 源库位排 |
| | | // command.setSourcePosY(param.getSourceBay()); // 源库位列 |
| | | // command.setSourcePosZ(param.getSourceLev()); // 源库位层 |
| | | // command.setDestinationPosX(param.getRow()); // 目标库位排 |
| | | // command.setDestinationPosY(param.getBay()); // 目标库位列 |
| | | // command.setDestinationPosZ(param.getLev()); // 目标库位层 |
| | | command.setAuto((short)1); |
| | | |
| | | return crnControl(command)?R.ok():R.error(); |
| | | } |
| | | |
| | | |
| | | private boolean crnControl(CrnCommand command){ |
| | | if (command.getCrnNo() == null) { |
| | | throw new CoolException("请选择堆垛机"); |