| | |
| | | return R.ok().add(list); |
| | | } |
| | | |
| | | @PostMapping("/crn/table/crn/{id}/msg") |
| | | @ManagerAuth(memo = "堆垛机数据表") |
| | | public R crnMsgTable(@PathVariable("id") Integer id){ |
| | | BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>().eq("crn_no", id).orderBy("crn_no")); |
| | | // 表格行 |
| | | CrnMsgTableVo vo = new CrnMsgTableVo(); |
| | | vo.setCrnNo(basCrnp.getCrnNo()); // 堆垛机号 |
| | | // 获取堆垛机信息 |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, basCrnp.getCrnNo()); |
| | | if (crnThread == null) { |
| | | return R.error(); |
| | | } |
| | | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | | if (crnProtocol == null) { |
| | | return R.error(); |
| | | } |
| | | |
| | | vo.setWorkNo(crnProtocol.getTaskNo()); // 任务号 |
| | | if (crnProtocol.getTaskNo()>0) { |
| | | WrkMast wrkMast = wrkMastService.selectById(crnProtocol.getTaskNo()); |
| | | if (wrkMast != null) { |
| | | vo.setStatus(CrnStatusType.process(wrkMast.getIoType()).getDesc()); // 模式状态 |
| | | vo.setSourceStaNo(wrkMast.getSourceStaNo$()); // 源站 |
| | | vo.setStaNo(wrkMast.getStaNo$()); // 目标站 |
| | | vo.setSourceLocNo(wrkMast.getSourceLocNo()); // 源库位 |
| | | vo.setLocNo(wrkMast.getLocNo()); // 目标库位 |
| | | } |
| | | } else { |
| | | vo.setStatus(crnProtocol.modeType.equals(CrnModeType.AUTO)? CrnStatusType.MACHINE_AUTO.getDesc(): CrnStatusType.MACHINE_UN_AUTO.getDesc()); // 模式状态 |
| | | } |
| | | vo.setXspeed(crnProtocol.getXSpeed()); // 走行速度(m/min) |
| | | vo.setYspeed(crnProtocol.getYSpeed()); // 升降速度(m/min) |
| | | vo.setZspeed(crnProtocol.getZSpeed()); // 叉牙速度(m/min) |
| | | vo.setXdistance(crnProtocol.getXDistance()); // 走行距离(Km) |
| | | vo.setYdistance(crnProtocol.getYDistance()); // 升降距离(Km) |
| | | vo.setXduration(crnProtocol.getXDuration()); // 走行时长(H) |
| | | vo.setYduration(crnProtocol.getYDuration()); // 升降时长(H) |
| | | return R.ok().add(vo); |
| | | } |
| | | |
| | | @PostMapping("/crn/output/site") |
| | | @ManagerAuth(memo = "堆垛机报文日志输出") |
| | | public R crnOutput(){ |