#
1
3 天以前 cb67fb9d5f84c03bfe9b0e6a250553520729a317
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -4749,20 +4749,26 @@
                    // 获取站点信息
                    SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
                    StaProtocol staProtocol = devpThread.getStation().get(armSta.getStaNo());
                    if (staProtocol == null) {
                        continue;
                    } else {
                        staProtocol = staProtocol.clone();
                    StaProtocol staProtocol = null;
                    String barcode = null;
                    // 可以轮询读取,确保条码稳定不变
                    for(int retry=0; retry<3; retry++){
                        staProtocol = devpThread.getStation().get(armSta.getStaNo());
                        barcode = staProtocol.getBarcode();
                        if (staProtocol == null) {
                            continue;
                        } else {
                            staProtocol = staProtocol.clone();
                        }
                        Thread.sleep(150); // 小延时等待PLC刷新
                    }
                    String barcode = staProtocol.getBarcode();
                    if(!Cools.isEmpty(barcode)) {
                        if("NG".endsWith(barcode) || "NoRead".equals(barcode) || "0".equals(barcode) || barcode.length()<5) {
                            armTaskAssignmentCallApiLogSave(staProtocol, "托盘条码为空", staProtocol.getSiteId()+"码垛位置,===》托盘条码为空", false);
                            armTaskAssignmentCallApiLogSave(staProtocol, "拆垛条码为空", staProtocol.getSiteId()+"码垛位置,===》托盘条码为空", false);
                            continue;
                        }
                    } else {
                        armTaskAssignmentCallApiLogSave(staProtocol, "托盘条码为空", staProtocol.getSiteId()+"码垛位置,===》托盘条码为空", false);
                        armTaskAssignmentCallApiLogSave(staProtocol, "拆垛条码为空", staProtocol.getSiteId()+"码垛位置,===》托盘条码为空", false);
                        continue;
                    }
                    String[] barcodeList = barcode.split(";");
@@ -4792,9 +4798,9 @@
                    List<BasArm> basArmList = basArmService.selectList(new EntityWrapper<BasArm>().eq("arm_no",armSta.getArmNo()));
                    boolean sign = true;
                    for (BasArm basArm : basArmList){
                        if (basArm.getStaNo()==2){//NG
                            continue;
                        }
//                        if (basArm.getStaNo()==2){//NG
//                            continue;
//                        }
                        LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", basArm.getStaNoSou()));
                        if (Cools.isEmpty(locMast) || !locMast.getLocSts().equals("D")){
                            continue;
@@ -4820,22 +4826,22 @@
                        sign = false;
                        break;
                    }
                    if (sign){
                        for (BasArm basArm : basArmList){
                            if (basArm.getStaNo()==2){//NG
                                LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", basArm.getStaNoSou()));
                                if (Cools.isEmpty(locMast) || !locMast.getLocSts().equals("D")){
                                    continue;
                                }
                                BasArmMast basArmMast = new BasArmMast(armBarcodeTwoParam);
                                basArmMast.setArmNo(basArm.getArmNo());
                                basArmMast.setStaNo(basArm.getStaNoSou());
                                basArmMast.setSortingLine(basArm.getSortingLineSou());
                                basArmMastService.insert(basArmMast);
                                break;
                            }
                        }
                    }
//                    if (sign){
//                        for (BasArm basArm : basArmList){
//                            if (basArm.getStaNo()==2){//NG
//                                LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", basArm.getStaNoSou()));
//                                if (Cools.isEmpty(locMast) || !locMast.getLocSts().equals("D")){
//                                    continue;
//                                }
//                                BasArmMast basArmMast = new BasArmMast(armBarcodeTwoParam);
//                                basArmMast.setArmNo(basArm.getArmNo());
//                                basArmMast.setStaNo(basArm.getStaNoSou());
//                                basArmMast.setSortingLine(basArm.getSortingLineSou());
//                                basArmMastService.insert(basArmMast);
//                                break;
//                            }
//                        }
//                    }
                }
            }
        } catch (Exception e){