| | |
| | | import com.zy.asrs.domain.param.CrnDemoParam; |
| | | import com.zy.asrs.domain.param.CrnOperatorParam; |
| | | import com.zy.asrs.domain.vo.CommandLogVo; |
| | | import com.zy.asrs.domain.vo.CrnListVo; |
| | | import com.zy.asrs.domain.vo.CrnMsgTableVo; |
| | | import com.zy.asrs.domain.vo.CrnStateTableVo; |
| | | import com.zy.asrs.entity.*; |
| | |
| | | return R.ok().add(vo); |
| | | } |
| | | |
| | | @GetMapping("/crn/list/auth") |
| | | @ManagerAuth(memo = "堆垛机数据表") |
| | | public R crnList(){ |
| | | List<CrnListVo> list = new ArrayList<>(); |
| | | List<BasCrnp> crnps = basCrnpService.selectList(new EntityWrapper<BasCrnp>().orderBy("crn_no")); |
| | | for (BasCrnp basCrnp : crnps) { |
| | | // 表格行 |
| | | CrnListVo vo = new CrnListVo(); |
| | | vo.setCrnNo(basCrnp.getCrnNo()); // 堆垛机号 |
| | | list.add(vo); |
| | | // 获取堆垛机信息 |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, basCrnp.getCrnNo()); |
| | | if (crnThread == null) { |
| | | continue; |
| | | } |
| | | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | | if (crnProtocol == null) { |
| | | continue; |
| | | } |
| | | |
| | | vo.setWorkNo(crnProtocol.getTaskNo()); // 任务号 |
| | | if (crnProtocol.getTaskNo()>0) { |
| | | WrkMast wrkMast = wrkMastService.selectById(crnProtocol.getTaskNo()); |
| | | if (wrkMast != null) { |
| | | vo.setDeviceStatus(CrnStatusType.process(wrkMast.getIoType()).getDesc()); // 模式状态 |
| | | vo.setSourceStaNo(wrkMast.getSourceStaNo$()); // 源站 |
| | | vo.setStaNo(wrkMast.getStaNo$()); // 目标站 |
| | | vo.setSourceLocNo(wrkMast.getSourceLocNo()); // 源库位 |
| | | vo.setLocNo(wrkMast.getLocNo()); // 目标库位 |
| | | } |
| | | } else { |
| | | vo.setDeviceStatus(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) |
| | | |
| | | vo.setStatusType(crnProtocol.modeType.desc); // 模式状态 |
| | | vo.setWrkStatus(crnProtocol.getStatusType().desc); // 任务状态 |
| | | vo.setLoading((crnProtocol.getLoaded() != null && crnProtocol.getLoaded() == 1) ? "有物" : "无物"); // 有物 |
| | | vo.setBay(crnProtocol.getBay()); // 列 |
| | | vo.setLev(crnProtocol.getLevel()); // 层 |
| | | |
| | | vo.setForkOffset(crnProtocol.getForkPosType().desc); // 货叉位置 |
| | | vo.setLiftPos(crnProtocol.getLiftPosType().desc); |
| | | vo.setWalkPos(crnProtocol.getWalkPos()==1?"不在定位":"在定位"); |
| | | vo.setWarnCode(String.valueOf(crnProtocol.getAlarm1())); |
| | | if (crnProtocol.getAlarm1() > 0) { |
| | | BasCrnError crnError = basCrnErrorMapper.selectById(crnProtocol.getAlarm1()); |
| | | vo.setAlarm(crnError==null?"未知异常":crnError.getErrName()); |
| | | } |
| | | } |
| | | return R.ok().add(list); |
| | | } |
| | | |
| | | @PostMapping("/crn/output/site") |
| | | @ManagerAuth(memo = "堆垛机报文日志输出") |
| | | public R crnOutput(){ |