| | |
| | | if (workNo == 0 && stano == 0){ |
| | | continue; |
| | | } |
| | | if (!staProtocol.isPakMk()){ |
| | | continue; |
| | | } |
| | | // News.warn("扫码入库失败,{}入库站因{}异常,托盘已被退回", inSta.getStaNo(), errMsg); |
| | | staProtocol.setWorkNo(workNo); |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol)); |
| | | |
| | | TaskWrk taskWrk = taskWrkMapper.selectByWrkNo(Integer.valueOf(workNo)); |
| | | if (taskWrk != null) { |
| | | taskWrk.setMemo(errMsg);//将错误码存入备注字段进行展示 |
| | |
| | | staProtocol.setWorkNo(taskWrk.getWrkNo().shortValue()); |
| | | staProtocol.setStaNo(staDesc.getCrnStn().shortValue()); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol)); |
| | | Thread.sleep(200); |
| | | Thread.sleep(500); |
| | | }else { |
| | | //TaskWrk taskWrk = taskWrkService.selectByTaskNo(param.getTaskNo()); |
| | | toWmsDTO.setWarehouseId("1688469798893297665"); |
| | |
| | | if (commandInfos.isEmpty()) { |
| | | continue;//命令空 |
| | | } |
| | | |
| | | //判断末端命令是否执行 |
| | | CommandInfo commandInfo2 = commandInfos.get(commandInfos.size() - 1); |
| | | if (commandInfo2.getCommandStatus() != CommandStatusType.CREATE.id) { |
| | | continue;//指令已执行 |
| | | } |
| | | |
| | | CommandInfo commandInfo = commandInfos.get(commandStep); |
| | | CommandPackage commandPackage = JSON.parseObject(commandInfo.getCommand(), CommandPackage.class);//取出命令报文 |
| | | CrnCommand crnCommand = JSON.parseObject(commandPackage.getCommand().toString(), CrnCommand.class); |
| | |
| | | .eq("wrk_sts",11) |
| | | .eq("io_type",3)); |
| | | for (TaskWrk taskWrk : taskWrks){ |
| | | |
| | | // 双深库位且浅库位有货,则需先对浅库位进行库位移转 |
| | | if (Utils.isDeepLoc(slaveProperties, taskWrk.getStartPoint())) { |
| | | String shallowLocNo = Utils.getShallowLoc(slaveProperties, taskWrk.getStartPoint()); |
| | | TaskWrk hallowLocNoTask = taskWrkMapper.selectByStartPoint(shallowLocNo); |
| | | if (!Cools.isEmpty(hallowLocNoTask)){ |
| | | continue; |
| | | } |
| | | } |
| | | // 堆垛机控制过滤 |
| | | if (!crnProtocol.getStatusType().equals(CrnStatusType.IDLE) || crnProtocol.getTaskNo() != 0) { |
| | | continue; |
| | | } |
| | | |
| | | // 已经存在吊车执行任务时,则过滤 |
| | | if (taskWrkMapper.selectCrnWorking(slave.getId()) != null) { |
| | | continue; |
| | | } |
| | | if (Cools.isEmpty(taskWrk.getTargetPoint())){ |
| | | List<Integer> list = openServiceImpl.getInEnableRoadway(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | |
| | | // 堆垛机控制过滤 |
| | | if (!crnProtocol.getStatusType().equals(CrnStatusType.IDLE) || crnProtocol.getTaskNo() != 0) { |
| | | continue; |
| | | } |
| | | |
| | | // 已经存在吊车执行任务时,则过滤 |
| | | if (taskWrkMapper.selectCrnWorking(slave.getId()) != null) { |
| | | continue; |
| | | } |
| | | |
| | | |
| | | // 1.堆垛机开始移动 |
| | |
| | | taskOverToWms.setSourceLocationCode(taskWrk.getOriginStartPoint()); //源库位 |
| | | //判断托盘是否走到出库站 |
| | | BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", taskWrk.getTargetPoint())); |
| | | if (!basDevp.getWrkNo().equals(taskWrk.getWrkNo()) && !basDevp.getOutEnable().equals("Y")){ |
| | | if (!basDevp.getWrkNo().equals(taskWrk.getWrkNo()) || !basDevp.getOutEnable().equals("Y")){ |
| | | continue; |
| | | } |
| | | } else if (taskWrk.getIoType() ==3) { |
| | |
| | | import com.zy.core.properties.SlaveProperties; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/8/27 |
| | |
| | | */ |
| | | public static String getShallowLoc(SlaveProperties slaveProperties, String deepLoc) { |
| | | int row = getRow(deepLoc); |
| | | int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount()); |
| | | int shallowRow = remainder == 1 ? (row + 1) : (row - 1); |
| | | // int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount()); |
| | | int shallowRow = getShallowRow(row); |
| | | return zerofill(String.valueOf(shallowRow), 2) + deepLoc.substring(2); |
| | | } |
| | | public static int getShallowRow(Integer row){ |
| | | Map<Integer, Integer> map = new HashMap<>(); |
| | | map.put(1,2);map.put(4,3); |
| | | map.put(7,8);map.put(10,9); |
| | | map.put(11,12);map.put(14,13); |
| | | map.put(15,16);map.put(18,17); |
| | | map.put(19,20); |
| | | return map.get(row); |
| | | } |
| | | |
| | | /** |
| | | * 获取 深库位排对应的浅库位排 |
| | |
| | | return; |
| | | } else { |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】 输送线命令下发成功 [id:{1}] >>>>> {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(staProtocol))); |
| | | log.info("输送线命令下发 [id:{}] >>>>> 命令下发成功: {}", slave.getId(), JSON.toJSON(staProtocol)); |
| | | //log.info("输送线命令下发 [id:{}] >>>>> 命令下发成功: {}", slave.getId(), JSON.toJSON(staProtocol)); |
| | | |
| | | Integer siteId = staProtocol.getSiteId(); |
| | | staProtocol = station.get(siteId); |
| | |
| | | return; |
| | | } else { |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】 输送线命令下发成功 [id:{1}] >>>>> {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(staProtocol))); |
| | | log.info("输送线命令下发 [id:{}] >>>>> 命令下发成功: {}", slave.getId(), JSON.toJSON(staProtocol)); |
| | | //log.info("输送线命令下发 [id:{}] >>>>> 命令下发成功: {}", slave.getId(), JSON.toJSON(staProtocol)); |
| | | |
| | | Integer siteId = staProtocol.getSiteId(); |
| | | staProtocol = station.get(siteId); |