| | |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | | |
| | | public Integer wrkNo = 9997; |
| | | public Integer wrkNo = 9999; |
| | | |
| | | /** |
| | | * 组托 |
| | |
| | | back = true; |
| | | } |
| | | // 退回 |
| | | if (back && (staProtocol.getWorkNo() == 9999 || staProtocol.getWorkNo() == 9998) && staProtocol.isInEnable() && staProtocol.isLoading() && staProtocol.isPakMk()) { |
| | | if (back && (staProtocol.getWorkNo() >= 9993 && staProtocol.getWorkNo() <= 9995) && staProtocol.isLoading() && staProtocol.isPakMk()) { |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errMsg)); |
| | | staProtocol.setWorkNo(wrkNo); |
| | | News.info("{}入库回退:{},任务号:{}", inSta.getStaNo(), errMsg,wrkNo); |
| | |
| | | && staProtocol.isLoading() |
| | | && staProtocol.isInEnable() |
| | | && !staProtocol.isEmptyMk() |
| | | && staProtocol.isPakMk() && staProtocol.getWorkNo() == 9999) { |
| | | && staProtocol.isPakMk() && staProtocol.getWorkNo() >= 9993 && staProtocol.getWorkNo() <= 9995) { // 9990-9992空托,9993-9995 满托,9999回退 |
| | | if(Cools.isEmpty(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode) || "00000000".equals(barcode)) { |
| | | News.info("{}条码扫描错误:{}",barcodeThread.getSlave().getId(),barcode); |
| | | continue; |
| | |
| | | param.setIoType(1); |
| | | param.setSourceStaNo(inSta.getStaNo()); |
| | | param.setLocType1(locTypeDto.getLocType1()); |
| | | param.setLocType2(locTypeDto.getLocType2()); |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/rpc/pakin/loc/v1") |
| | |
| | | crnCommand.setTaskMode(CrnTaskModeType.LOC_MOVE); // 任务模式: 库位移转 |
| | | crnCommand.setSourcePosX(crnStn.getRow().shortValue()); // 源库位排 |
| | | crnCommand.setSourcePosY(crnStn.getBay().shortValue()); // 源库位列 |
| | | if(crnStn.getBay() == 1 && locMast.getBay1() >= 15) { // 入库 长库位则取货位置为0列 |
| | | crnCommand.setSourcePosY((short) 0); |
| | | } |
| | | crnCommand.setSourcePosZ(crnStn.getLev().shortValue()); // 源库位层 |
| | | crnCommand.setDestinationPosX(locMast.getRow1().shortValue()); // 目标库位排 |
| | | crnCommand.setDestinationPosY(locMast.getBay1().shortValue()); // 目标库位列 |
| | |
| | | crnCommand.setSourcePosZ(sourceSta.getLev1().shortValue()); // 源库位层 |
| | | crnCommand.setDestinationPosX(crnStn.getRow().shortValue()); // 目标库位排 |
| | | crnCommand.setDestinationPosY(crnStn.getBay().shortValue()); // 目标库位列 |
| | | if(crnStn.getBay() == 1 && sourceSta.getBay1() >= 15) { // 长库位 出库放货列 为0 |
| | | crnCommand.setDestinationPosY((short) 0); |
| | | } |
| | | crnCommand.setDestinationPosZ(crnStn.getLev().shortValue()); // 目标库位层 |
| | | crnCommand.setTraySize(sourceSta.getLocType1() == 2); //库位类型 |
| | | if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) { |
| | |
| | | && staProtocol.isInEnable() |
| | | && staProtocol.isEmptyMk() |
| | | && staProtocol.isPakMk() |
| | | && staProtocol.getWorkNo() == 9998 // 9997 回退 9998 空 9999 满 |
| | | && staProtocol.getWorkNo() >= 9990 && staProtocol.getWorkNo() <= 9992 // 9990-9992空托,9993-9995 满托,9999回退 |
| | | ) { |
| | | News.warnNoLog(""+mark+" - 0"+" - 开始执行:空栈板初始化入库,叉车入库站放货"); |
| | | |
| | |
| | | param.setIoType(10); |
| | | param.setSourceStaNo(emptyInSta.getStaNo()); |
| | | param.setLocType1(locTypeDto.getLocType1()); |
| | | param.setLocType2(locTypeDto.getLocType2()); |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/rpc/pakin/loc/v1") |
| | |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | log.info("空托入库请求wms原始返回:" + jsonObject); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | |
| | |
| | | log.error("输送线下发6:"+dto.getWorkNo()+","+staProtocol.getSiteId()); |
| | | if (!result) { |
| | | News.errorNoLog(""+mark+" - 1"+" - 更新plc站点信息失败"); |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | throw new CoolException("SiemensDevp - 5"); |
| | | } |
| | | |
| | | if (ledThread != null) { |
| | |
| | | CrnCommand crnCommand = new CrnCommand(); |
| | | crnCommand.setCrnNo(crn.getId()); // 堆垛机编号 |
| | | crnCommand.setTaskNo((short) 9999); // 工作号 |
| | | crnCommand.setTaskMode(CrnTaskModeType.GO_ORIGIN); // 任务模式: 回原点 |
| | | crnCommand.setSourcePosX((short) (crn.getId() == 1 ? 3 : 6)); // 源库位排 |
| | | crnCommand.setTaskMode((short)8); // 任务模式: 回原点 |
| | | crnCommand.setSourcePosX((short) 1); // 源库位排 |
| | | crnCommand.setSourcePosY((short) 1); // 源库位列 |
| | | crnCommand.setSourcePosZ((short) 1); // 源库位层 |
| | | crnCommand.setDestinationPosX((short) 0); // 目标库位排 |