| | |
| | | && !staProtocol.isEmptyMk() && (workNo == 0 || (workNo >= 9990 && workNo <= 9999)) |
| | | && staProtocol.isPakMk()) { |
| | | |
| | | //20230201. 2号堆垛机有出库任务时,禁止新板入库 |
| | | if (staProtocol.getWorkNo() == 9995) { |
| | | if ( inSta.getStaNo()==103 && devpThread.ioModeOf1F == IoModeType.PAKOUT_MODE) { |
| | | //有出库任务,退库到入库口 |
| | | staProtocol.setWorkNo((short) 9999); |
| | | staProtocol.setStaNo((short)100); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | News.error("MainServiceImpl generateStoreWrkFile"+"103为出库模式,禁止入库,退回入库口。!!!"); |
| | | continue; |
| | | } |
| | | if ( inSta.getStaNo()==203 && devpThread.ioModeOf2F == IoModeType.PAKOUT_MODE) { |
| | | //有出库任务,退库到入库口 |
| | | staProtocol.setWorkNo((short) 9999); |
| | | staProtocol.setStaNo((short)200); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | News.error("MainServiceImpl generateStoreWrkFile"+"203为出库模式,禁止入库,退回入库口。!!!"); |
| | | continue; |
| | | } |
| | | if ( inSta.getStaNo()==113 && devpThread.ioModeOf3F == IoModeType.PAKOUT_MODE) { |
| | | //有出库任务,退库到入库口 |
| | | staProtocol.setWorkNo((short) 9999); |
| | | staProtocol.setStaNo((short)114); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | News.error("MainServiceImpl generateStoreWrkFile"+"103为出库模式,禁止入库,退回入库口。!!!"); |
| | | continue; |
| | | } |
| | | if ( inSta.getStaNo()==213 && devpThread.ioModeOf4F == IoModeType.PAKOUT_MODE) { |
| | | //有出库任务,退库到入库口 |
| | | staProtocol.setWorkNo((short) 9999); |
| | | staProtocol.setStaNo((short)214); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | News.error("MainServiceImpl generateStoreWrkFile"+"203为出库模式,禁止入库,退回入库口。!!!"); |
| | | continue; |
| | | } |
| | | } |
| | | // //20230201. 2号堆垛机有出库任务时,禁止新板入库 |
| | | // if (staProtocol.getWorkNo() == 9995) { |
| | | // if ( inSta.getStaNo()==103 && devpThread.ioModeOf1F == IoModeType.PAKOUT_MODE) { |
| | | // //有出库任务,退库到入库口 |
| | | // staProtocol.setWorkNo((short) 9999); |
| | | // staProtocol.setStaNo((short)100); |
| | | // devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | // boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | // News.error("MainServiceImpl generateStoreWrkFile"+"103为出库模式,禁止入库,退回入库口。!!!"); |
| | | // continue; |
| | | // } |
| | | // if ( inSta.getStaNo()==203 && devpThread.ioModeOf2F == IoModeType.PAKOUT_MODE) { |
| | | // //有出库任务,退库到入库口 |
| | | // staProtocol.setWorkNo((short) 9999); |
| | | // staProtocol.setStaNo((short)200); |
| | | // devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | // boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | // News.error("MainServiceImpl generateStoreWrkFile"+"203为出库模式,禁止入库,退回入库口。!!!"); |
| | | // continue; |
| | | // } |
| | | // if ( inSta.getStaNo()==113 && devpThread.ioModeOf3F == IoModeType.PAKOUT_MODE) { |
| | | // //有出库任务,退库到入库口 |
| | | // staProtocol.setWorkNo((short) 9999); |
| | | // staProtocol.setStaNo((short)114); |
| | | // devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | // boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | // News.error("MainServiceImpl generateStoreWrkFile"+"103为出库模式,禁止入库,退回入库口。!!!"); |
| | | // continue; |
| | | // } |
| | | // if ( inSta.getStaNo()==213 && devpThread.ioModeOf4F == IoModeType.PAKOUT_MODE) { |
| | | // //有出库任务,退库到入库口 |
| | | // staProtocol.setWorkNo((short) 9999); |
| | | // staProtocol.setStaNo((short)214); |
| | | // devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | // boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | // News.error("MainServiceImpl generateStoreWrkFile"+"203为出库模式,禁止入库,退回入库口。!!!"); |
| | | // continue; |
| | | // } |
| | | // } |
| | | |
| | | // 获取条码扫描仪信息 |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode()); |
| | |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | } else if (code == 500){ |
| | | if (ledThread != null) { |
| | | String errorMsg = jsonObject.getString("msg"); |
| | | if (!Cools.isEmpty(errorMsg)) { |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | } |
| | | News.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | // } else if (code == 500){ |
| | | // if (ledThread != null) { |
| | | // String errorMsg = jsonObject.getString("msg"); |
| | | // if (!Cools.isEmpty(errorMsg)) { |
| | | // MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | // } |
| | | // } |
| | | // News.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | } else if (code == 700) { |
| | | staProtocol.setWorkNo((short) 9995); |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | } else if (code == 1000){ |
| | | } else if (code == 500){ |
| | | if (inSta.getStaNo().equals(103)){ |
| | | staProtocol.setWorkNo((short)9996); |
| | | staProtocol.setStaNo((short)203); |
| | | }else { |
| | | } |
| | | if (inSta.getStaNo().equals(203)){ |
| | | staProtocol.setWorkNo((short)9996); |
| | | staProtocol.setStaNo((short)103); |
| | | }if (inSta.getStaNo().equals(113)){ |
| | | staProtocol.setWorkNo((short)9995); |
| | | staProtocol.setStaNo((short)114); |
| | | }else if (inSta.getStaNo().equals(213)){ |
| | | staProtocol.setWorkNo((short)9995); |
| | | staProtocol.setStaNo((short)214); |
| | | }else { |
| | | staProtocol.setWorkNo((short)9995); |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | } |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | |
| | | // led 异常显示 |
| | | if (ledThread != null) { |
| | | String errorMsg = barcode + "需要换入库站。目标站:"+staProtocol.getStaNo(); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | String data = jsonObject.getString("data"); |
| | | String msg = jsonObject.getString("msg"); |
| | | if (code == 500){ |
| | | // led 异常显示 |
| | | if (ledThread != null) { |
| | | String errorMsg ="入库站:" + staProtocol.getStaNo() + "---" + barcode + "检索库位失败,请检查库存剩余。===>>" + data + "--" + msg; |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | } else if (code == 1000){ |
| | | // led 异常显示 |
| | | if (ledThread != null) { |
| | | String errorMsg ="入库站:" + staProtocol.getStaNo() + "---" + barcode + "需要换入库站。"; |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | } |
| | | } |
| | | if(flag){ |
| | | return false; |
| | | continue; |
| | | // return false; |
| | | } |
| | | |
| | | // 判断是否已存在小车绑定任务 |