| | |
| | | @TableField("control_rows") |
| | | private String controlRows; |
| | | |
| | | @ApiModelProperty(value= "深库位排号") |
| | | @TableField("deep_rows") |
| | | private String deepRows; |
| | | |
| | | /** |
| | | * 入站列表 |
| | | */ |
| | |
| | | if (annotation != null && !Cools.isEmpty(annotation.memo())) { |
| | | saveErrLog(joinPoint, request, errorResponse, ex, annotation.memo()); |
| | | } |
| | | throw ex; |
| | | return errorResponse; |
| | | } finally { |
| | | long end = System.currentTimeMillis(); |
| | | // log.info("请求日志的打印"); |
| | |
| | | |
| | | private Object buildErrorResponse(Throwable ex) { |
| | | if (ex instanceof CoolException) { |
| | | return R.parse(ex.getMessage()); |
| | | return R.error(ex.getMessage()); |
| | | } |
| | | return R.error(); |
| | | } |
| | |
| | | |
| | | @ExceptionHandler(CoolException.class) |
| | | public R handleRRException(CoolException e) { |
| | | return R.parse(e.getMessage()); |
| | | return R.error(e.getMessage()); |
| | | } |
| | | |
| | | } |
| | |
| | | @Autowired |
| | | private NavigateUtils navigateUtils; |
| | | @Autowired |
| | | private CommonService commonService; |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | /** |
| | |
| | | ioPri = param.getTaskPri().doubleValue(); |
| | | } |
| | | |
| | | Integer sourceCrnNo = commonService.findCrnNoByLocNo(sourceLocMast.getLocNo()); |
| | | Integer sourceCrnNo = this.findCrnNoByLocNo(sourceLocMast.getLocNo()); |
| | | if (sourceCrnNo == null) { |
| | | throw new CoolException("未找到对应堆垛机"); |
| | | } |
| | | |
| | | Integer crnNo = commonService.findCrnNoByLocNo(locMast.getLocNo()); |
| | | Integer crnNo = this.findCrnNoByLocNo(locMast.getLocNo()); |
| | | if (crnNo == null) { |
| | | throw new CoolException("未找到对应堆垛机"); |
| | | } |
| | |
| | | ioPri = param.getTaskPri().doubleValue(); |
| | | } |
| | | |
| | | Integer crnNo = commonService.findCrnNoByLocNo(locMast.getLocNo()); |
| | | Integer crnNo = this.findCrnNoByLocNo(locMast.getLocNo()); |
| | | if (crnNo == null) { |
| | | throw new CoolException("未找到对应堆垛机"); |
| | | } |
| | |
| | | ioPri = param.getTaskPri().doubleValue(); |
| | | } |
| | | |
| | | Integer crnNo = commonService.findCrnNoByLocNo(locMast.getLocNo()); |
| | | Integer crnNo = this.findCrnNoByLocNo(locMast.getLocNo()); |
| | | if (crnNo == null) { |
| | | throw new CoolException("未找到对应堆垛机"); |
| | | } |
| | | |
| | | Integer sourceStationId = commonService.findOutStationId(crnNo, param.getStaNo()); |
| | | Integer sourceStationId = this.findOutStationId(crnNo, param.getStaNo()); |
| | | if (sourceStationId == null) { |
| | | throw new CoolException("未找到输送目标站点可走行路径"); |
| | | } |
| | |
| | | StationCommand command = stationThread.getMoveCommand(9998, wrkMast.getSourceStaNo(), 0, 0); |
| | | MessageQueue.offer(SlaveType.Devp, stationObjModel.getDeviceNo(), new Task(2, command)); |
| | | } |
| | | }else if(wrkMast.getWrkSts() == WrkStsType.LOC_MOVE_RUN.sts){ |
| | | updateWrkSts = WrkStsType.COMPLETE_LOC_MOVE.sts; |
| | | }else{ |
| | | News.error("堆垛机处于等待确认且任务完成状态,但工作状态异常。堆垛机号={},工作号={}", basCrnp.getCrnNo(), crnProtocol.getTaskNo()); |
| | | continue; |
| | |
| | | crnProtocol.setLastIo("O"); |
| | | } |
| | | } |
| | | |
| | | //库位移转 |
| | | this.crnExecuteLocTransfer(basCrnp, crnThread); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | private synchronized void crnExecuteLocTransfer(BasCrnp basCrnp, CrnThread crnThread) { |
| | | CrnProtocol crnProtocol = crnThread.getStatus(); |
| | | if(crnProtocol == null){ |
| | | return; |
| | | } |
| | | |
| | | Integer crnNo = basCrnp.getCrnNo(); |
| | | |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | .eq("crn_no", crnNo) |
| | | .eq("wrk_sts", WrkStsType.NEW_LOC_MOVE.sts) |
| | | ); |
| | | |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | // 获取源库位信息 |
| | | LocMast sourceLocMast = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | if (sourceLocMast == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "源库位:{} 信息不存在", wrkMast.getSourceLocNo()); |
| | | continue; |
| | | } |
| | | |
| | | if(!sourceLocMast.getLocSts().equals("R")){ |
| | | News.taskInfo(wrkMast.getWrkNo(), "源库位:{} 状态异常,不属于出库预约状态", wrkMast.getSourceLocNo()); |
| | | continue; |
| | | } |
| | | |
| | | // 获取库位信息 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getLocNo()); |
| | | if (locMast == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "库位:{} 信息不存在", wrkMast.getLocNo()); |
| | | continue; |
| | | } |
| | | |
| | | if (!locMast.getLocSts().equals("S")) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "库位:{} 状态异常,不属于入库预约状态", wrkMast.getLocNo()); |
| | | continue; |
| | | } |
| | | |
| | | CrnCommand command = crnThread.getPickAndPutCommand(wrkMast.getSourceLocNo(), wrkMast.getLocNo(), wrkMast.getWrkNo(), crnNo); |
| | | |
| | | wrkMast.setWrkSts(WrkStsType.LOC_MOVE_RUN.sts); |
| | | wrkMast.setCrnNo(crnNo); |
| | | wrkMast.setSystemMsg(""); |
| | | wrkMast.setIoTime(new Date()); |
| | | if (wrkMastService.updateById(wrkMast)) { |
| | | MessageQueue.offer(SlaveType.Crn, crnNo, new Task(2, command)); |
| | | News.info("堆垛机命令下发成功,堆垛机号={},任务数据={}", crnNo, JSON.toJSON(command)); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | |
| | | //堆垛机任务执行完成 |
| | | public synchronized void crnIoExecuteFinish() { |
| | | List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<>()); |
| | |
| | | updateWrkSts = WrkStsType.COMPLETE_INBOUND.sts; |
| | | }else if(wrkMast.getWrkSts() == WrkStsType.OUTBOUND_RUN.sts){ |
| | | updateWrkSts = WrkStsType.OUTBOUND_RUN_COMPLETE.sts; |
| | | }else if(wrkMast.getWrkSts() == WrkStsType.LOC_MOVE_RUN.sts){ |
| | | updateWrkSts = WrkStsType.COMPLETE_LOC_MOVE.sts; |
| | | }else{ |
| | | News.error("堆垛机处于等待确认且任务完成状态,但工作状态异常。堆垛机号={},工作号={}", basCrnp.getCrnNo(), crnProtocol.getTaskNo()); |
| | | continue; |
| | |
| | | <result column="out_station_list" property="outStationList" /> |
| | | <result column="max_in_task" property="maxInTask" /> |
| | | <result column="max_out_task" property="maxOutTask" /> |
| | | <result column="deep_rows" property="deepRows" /> |
| | | |
| | | </resultMap> |
| | | |
| | |
| | | ,{field: 'inEnable', align: 'center',title: '可入(checkBox)'} |
| | | ,{field: 'outEnable', align: 'center',title: '可出(checkBox)'} |
| | | ,{field: 'controlRows', align: 'center',title: '控制库位排号'} |
| | | ,{field: 'deepRows', align: 'center',title: '深库位排号'} |
| | | ,{field: 'inStationList', align: 'center',title: '入库站列表'} |
| | | ,{field: 'outStationList', align: 'center',title: '出库站列表'} |
| | | ,{field: 'maxInTask', align: 'center',title: '最大入库任务数'} |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">深库位排号: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="deepRows" placeholder="请输入深库位排号"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">入库站列表: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="inStationList" placeholder="请输入入库站列表"> |