| | |
| | | // 判断重复工作档 |
| | | WrkMast wrkMast = wrkMastMapper.selectPakInStep1(inSta.getStaNo(), barcode); |
| | | if (wrkMast != null) { |
| | | log.error("工作档中已存在该站状态为( 2.设备上走 )的数据,工作号={}", wrkMast.getWrkNo()); |
| | | continue; |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | barcodeThread.setBarcode(""); |
| | | staProtocol.setWorkNo(wrkMast.getWrkNo()); |
| | | staProtocol.setStaNo(wrkMast.getStaNo()); |
| | | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | return; |
| | | } |
| | | // // 获取入库通知档 |
| | | // List<WaitPakin> waitPakins = waitPakinMapper.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", barcode).eq("io_status", "N")); |
| | |
| | | // throw new CoolException("更新plc站点信息失败"); |
| | | // } |
| | | continue; |
| | | } |
| | | |
| | | // 判断重复工作档 |
| | | WrkMast wrkMast111 = wrkMastMapper.selectPakInStep111(inSta.getStaNo(), barcode); |
| | | if (wrkMast111 != null) { |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | barcodeThread.setBarcode(""); |
| | | staProtocol.setWorkNo(wrkMast111.getWrkNo()); |
| | | staProtocol.setStaNo(wrkMast111.getStaNo()); |
| | | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | return; |
| | | } |
| | | |
| | | // 判断重复工作档 |
| | |
| | | // } |
| | | continue; |
| | | } |
| | | |
| | | // |
| | | // // 判断重复工作档 |
| | | // WrkMast wrkMast = wrkMastMapper.selectPakInStep1(inSta.getStaNo(), barcode); |
| | | // if (wrkMast != null) { |
| | | // log.error("工作档中已存在该站状态为( 2.设备上走 )的数据,工作号={}", wrkMast.getWrkNo()); |
| | | // continue; |
| | | // } |
| | | // 判断重复工作档 |
| | | WrkMast wrkMast = wrkMastMapper.selectPakInStep1(inSta.getStaNo(), barcode); |
| | | if (wrkMast != null) { |
| | | log.error("工作档中已存在该站状态为( 2.设备上走 )的数据,工作号={}", wrkMast.getWrkNo()); |
| | | continue; |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | barcodeThread.setBarcode(""); |
| | | staProtocol.setWorkNo(wrkMast.getWrkNo()); |
| | | staProtocol.setStaNo(wrkMast.getStaNo()); |
| | | |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | return; |
| | | } |
| | | // // 获取入库通知档 |
| | | // List<WaitPakin> waitPakins = waitPakinMapper.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", barcode).eq("io_status", "N")); |
| | |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | SearchLocParam param2 = new SearchLocParam(); |
| | | param2.setBarcode(barcode); |
| | | param2.setSourceStaNo(inSta.getStaNo()); |
| | | param2.setLocType1(locTypeDto.getLocType1()); |
| | | String response2 = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/rpc/pakin/yx/loc/v33") |
| | | .setJson(JSON.toJSONString(param2)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject2 = JSON.parseObject(response2); |
| | | if (jsonObject2.getInteger("code").equals(200)) { |
| | | log.info("大料箱自动组托成功!!"); |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | | |
| | | if (ledThread != null) { |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, "入库失败!")); |
| | | if (ledThread != null) { |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, "入库失败!")); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | case 3: |
| | | case 4: |
| | | case 5: |
| | | crnStnToOutStnTwo(crnStn,1); |
| | | crnStnToOutStnTwo(crnSlave.getId(),crnStn,1); |
| | | continue; |
| | | case 6: |
| | | case 7: |
| | |
| | | return false; |
| | | } |
| | | |
| | | public synchronized boolean crnStnToOutStnTwo(CrnSlave.CrnStn crnStn ,Integer conStation) { |
| | | public synchronized boolean crnStnToOutStnTwo(Integer crnNo,CrnSlave.CrnStn crnStn ,Integer conStation) { |
| | | try{ |
| | | Date now = new Date(); |
| | | // 获取堆垛机出库站信息 |
| | |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && (staProtocol.getWorkNo() == 0 || staProtocol.getStaNo() == null)) { |
| | | // 查询工作档 |
| | | WrkMast wrkMast = wrkMastMapper.selectPakOutStep2(staProtocol.getSiteId()); |
| | | if (wrkMast == null) { |
| | | return false; |
| | | } |
| | | // 判断工作档条件 |
| | | if (wrkMast.getIoType() < 100 || wrkMast.getStaNo() == null || wrkMast.getSourceStaNo() == null) { |
| | | return false; |
| | | } |
| | | |
| | | // 判断吊车是否实际已完成,且电脑状态在move中,以备电脑进行更新工作档 |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, wrkMast.getCrnNo()); |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn,crnNo); |
| | | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | | |
| | | if (conStation==1){ |
| | | // 查询工作档 |
| | | WrkMast wrkMast = wrkMastMapper.selectPakOutStep2345(staProtocol.getSiteId(),crnProtocol.getTaskNo().intValue()); |
| | | if (wrkMast == null) { |
| | | return false; |
| | | } |
| | | // 判断工作档条件 |
| | | if (wrkMast.getIoType() < 100 || wrkMast.getStaNo() == null || wrkMast.getSourceStaNo() == null) { |
| | | return false; |
| | | } |
| | | if (crnProtocol.statusType == CrnStatusType.FETCHING || crnProtocol.statusType == CrnStatusType.PUTTING) { |
| | | // 移动中 |
| | | return false; |
| | |
| | | } |
| | | } |
| | | }else if (conStation==2){ |
| | | // 查询工作档 |
| | | WrkMast wrkMast = wrkMastMapper.selectPakOutStep2345(staProtocol.getSiteId(),crnProtocol.getTaskNoTwo().intValue()); |
| | | if (wrkMast == null) { |
| | | return false; |
| | | } |
| | | // 判断工作档条件 |
| | | if (wrkMast.getIoType() < 100 || wrkMast.getStaNo() == null || wrkMast.getSourceStaNo() == null) { |
| | | return false; |
| | | } |
| | | if (crnProtocol.statusTypeTwo == CrnStatusType.FETCHING || crnProtocol.statusTypeTwo == CrnStatusType.PUTTING) { |
| | | // 移动中 |
| | | return false; |
| | |
| | | case 3: |
| | | case 4: |
| | | case 5: |
| | | crnStnToOutStnTwo(crnStn,2); |
| | | crnStnToOutStnTwo(crnSlave.getId(),crnStn,2); |
| | | continue; |
| | | default: |
| | | break; |