| | |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.thread.BarcodeThread; |
| | | import com.zy.core.thread.LedThread; |
| | | import com.zy.core.thread.ScaleThread; |
| | | import com.zy.core.thread.SiemensDevpThread; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | |
| | | errMsg = "扫码失败"; |
| | | back = true; |
| | | } |
| | | |
| | | // 判断是否满足入库条件 |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() |
| | | && staProtocol.isInEnable() |
| | |
| | | } |
| | | } |
| | | |
| | | ScaleThread scaleThread = (ScaleThread) SlaveConnection.get(SlaveType.Scale, inSta.getBarcode()); |
| | | if(scaleThread != null) { |
| | | storageEscalationParam.setWeight(scaleThread.getScale()); |
| | | } |
| | | |
| | | storageEscalationParam.setBoxNo(BoxNo); |
| | | //是否满板 1满板 0空板 |
| | |
| | | storageEscalationParam.setLocType(1); |
| | | }else if(staProtocol.isLow()){ |
| | | storageEscalationParam.setLocType(0); |
| | | }else if (staProtocol.isCentre()){ |
| | | storageEscalationParam.setLocType(2); |
| | | } |
| | | |
| | | storageEscalationParam.setTerminalNo(staProtocol.getSiteId()); |
| | |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | log.error("已有入库任务,wms--->任务号:{}",result.getTaskNo()); |
| | | } |
| | | |
| | | } else { |
| | |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | log.error("入库异常,wms返回值不符合条件,wms--->{}",response); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | log.error("任务已存在,wms--->任务号:{}",result.getTaskNo()); |
| | | } |
| | | |
| | | } else { |
| | |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | log.error("请求接口异常,wms--->{}",response); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | |
| | | crnCommand.setDestinationPosX(Utils.getRowShort(taskWrk.getTargetPoint())); // 目标库位列 |
| | | crnCommand.setDestinationPosY(Utils.getBayShort(taskWrk.getTargetPoint())); // 目标库位层 |
| | | crnCommand.setDestinationPosZ(Utils.getLevShort(taskWrk.getTargetPoint())); // 目标库位排 |
| | | crnCommand.setCommand((short) 1); |
| | | crnCommand.setCommand((short) 0); |
| | | log.info("堆垛机入库任务下发={}", crnCommand); |
| | | if (!CommandUtils.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(2, crnCommand), false)) { |
| | | log.error("堆垛机命令生成失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(crnCommand)); |
| | |
| | | if (!crnProtocol.getStatusType().equals(CrnStatusType.IDLE) || crnProtocol.getTaskNo() != 0) { |
| | | break; |
| | | } |
| | | // int storeCount = basDevpService.getStoreCount(); |
| | | // if (storeCount >= maxCount) { |
| | | // log.error("输送线暂存数达到上限{}", storeCount); |
| | | // break; |
| | | // } |
| | | |
| | | //输送线只允许存在一个托盘 |
| | | int storeCount = basDevpService.getStoreCount(); |
| | | if (storeCount >= maxCount) { |
| | | log.error("输送线暂存数达到上限,当前输送线托盘数量:{},最大暂存数量:{}", storeCount,maxCount); |
| | | break; |
| | | } |
| | | |
| | | |
| | | // 已经存在吊车执行任务时,则过滤 |
| | |
| | | command.setDestinationPosX(crnStn.getRow().shortValue()); // 目标库位排 |
| | | command.setDestinationPosY(crnStn.getBay().shortValue()); // 目标库位列 |
| | | command.setDestinationPosZ(crnStn.getLev().shortValue()); // 目标库位层 |
| | | command.setCommand((short) 1); |
| | | command.setCommand((short) 0); |
| | | |
| | | if (!CommandUtils.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(2, command), false)) { |
| | | log.error("堆垛机命令生成失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(command)); |
| | |
| | | taskWrk.setStatus(TaskStatusType.RECEIVE.id);//任务状态:接收 |
| | | taskWrk.setCreateTime(now); |
| | | taskWrk.setIoType(1);//任务类型 入库 |
| | | taskWrk.setIoPri(13);//优先级 |
| | | taskWrk.setIoPri(10);//优先级 |
| | | taskWrk.setBarcode(barcode);//条码 |
| | | taskWrk.setTargetPoint(locNo); |
| | | taskWrk.setStartPoint(staNo+""); |