自动化立体仓库 - WCS系统
zjj
2024-08-01 8ef3eccb7d244c89d0422d06f5274da1e408e9d6
Merge remote-tracking branch 'origin/gdykwcs' into gdykwcs
5个文件已修改
75 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/model/SearchLocParam.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/model/DevpSlave.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SiemensDevpThread.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -112,6 +112,7 @@
            for (DevpSlave.Sta inSta : devp.getInSta()) {
                // 获取条码扫描仪信息
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode());
                BarcodeThread barcodeThreadMat = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcodeMat());
                LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed());
                SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
                StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo());
@@ -124,7 +125,14 @@
                if (barcodeThread == null) {
                    continue;
                }
                if (barcodeThreadMat == null) {
                    continue;
                }
                String barcode = barcodeThread.getBarcode();
                String barcodeMat = barcodeThreadMat.getBarcode();
                // 尺寸检测异常
                boolean back = false;
                String errMsg = "";
@@ -184,6 +192,18 @@
                        && staProtocol.isPakMk()) {
                    if(Cools.isEmpty(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode) || "00000000".equals(barcode)) {
                        News.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcode(), barcode);
                        staProtocol.setWorkNo(wrkNo);
                        News.info("{}入库回退:{},任务号:{}", inSta.getStaNo(), errMsg,wrkNo);
                        wrkNo++;
                        staProtocol.setStaNo(inSta.getBackSta().shortValue());
                        devpThread.setPakMk(staProtocol.getSiteId(), false);
                        MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                        log.error("输送线下发1:"+wrkNo+","+inSta.getBackSta());
                        continue;
                    }
                    if(Cools.isEmpty(barcodeMat) || "NG".endsWith(barcodeMat) || "NoRead".equals(barcodeMat) || "00000000".equals(barcodeMat)) {
                        News.info("{}号条码扫描器检测条码信息:{}", inSta.getBarcodeMat(), barcodeMat);
                        staProtocol.setWorkNo(wrkNo);
                        News.info("{}入库回退:{},任务号:{}", inSta.getStaNo(), errMsg,wrkNo);
@@ -263,6 +283,25 @@
                                throw new CoolException("更新plc站点信息失败");
                            }
                        } else if (jsonObject.getInteger("code").equals(700)) {
                            SearchLocParam param2 = new SearchLocParam();
                            param2.setBarcode(barcode);
                            param2.setBarcodeMat(barcodeMat);
                            param2.setSourceStaNo(inSta.getStaNo());
                            param2.setLocType1(locTypeDto.getLocType1());
                            String response2 = new HttpHandler.Builder()
                                    .setUri(wmsUrl)
                                    .setPath("/rpc/pakin/yk/loc/v33")
                                    .setJson(JSON.toJSONString(param2))
                                    .build()
                                    .doPost();
                            JSONObject jsonObject2 = JSON.parseObject(response2);
                            if (jsonObject2.getInteger("code").equals(200)) {
                                log.info("自动组托成功!!");
                            } else {
                                MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, "自动组托失败!!!barcodeMat==>"+barcodeMat));
                                News.error(methodName + "==>组托失败:请求接口失败!!!url:{};request:{};response:{}", wmsUrl + "/rpc/pakin/yk/loc/v33", JSON.toJSONString(param), response);
                            }
                        } else {
                            staProtocol.setWorkNo(wrkNo);
                            wrkNo++;
src/main/java/com/zy/common/model/SearchLocParam.java
@@ -14,6 +14,7 @@
    private Integer sourceStaNo;
    private String barcode;
    private String barcodeMat;
    // 库位规格( 0:未知, 1:低库位, 2:中库位, 3:高库位 )
    private Short locType1;
src/main/java/com/zy/core/model/DevpSlave.java
@@ -33,6 +33,7 @@
        private Integer staNo;
        private Integer barcode;
        private Integer barcodeMat;
        private Integer backSta;
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -74,6 +74,9 @@
    public static final ArrayList<Integer> BarcodeList = new ArrayList<Integer>() {{
        add(0); add(1); add(2);
    }};
    public static final ArrayList<Integer> BarcodeListMat = new ArrayList<Integer>() {{
        add(3); add(4); add(5);
    }};
    public static final ArrayList<Integer> staNosErrList = new ArrayList<Integer>() {{
        add(106); add(107); add(159);
    }};
@@ -299,6 +302,19 @@
                }
            }
        }
        //条码扫描器
        ArrayList<Integer> barcodeListMat = BarcodeListMat;
        OperateResultExOne<byte[]> result2Mat = siemensS7Net.Read("DB101.840", (short) (barcodeListMat.size() * 8));
        if (result2Mat.IsSuccess) {
            for (int i = 0; i < barcodeListMat.size(); i++) {
                Integer barcodeId = barcodeListMat.get(i);
                String barcode = siemensS7Net.getByteTransform().TransString(result2Mat.Content,i*8,8, "UTF-8");
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, barcodeId + 1);
                if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) {
                    barcodeThread.setBarcode(barcode);
                }
            }
        }
        //外形检测
        ArrayList<Integer> staNoErrs = staNosErrList;
        int staNoErrsSize = staNoErrs.size();
src/main/resources/application.yml
@@ -236,6 +236,7 @@
    inSta[0]:
      staNo: 106
      barcode: ${wcs-slave.barcode[0].id}
      barcodeMat: ${wcs-slave.barcode[3].id}
      backSta: 105
      led: ${wcs-slave.led[1].id}
    # 空板入库口1
@@ -254,6 +255,7 @@
    inSta[1]:
      staNo: 107
      barcode: ${wcs-slave.barcode[1].id}
      barcodeMat: ${wcs-slave.barcode[4].id}
      backSta: 108
      led: ${wcs-slave.led[2].id}
    # 空板入库口1
@@ -265,6 +267,7 @@
    inSta[2]:
      staNo: 159
      barcode: ${wcs-slave.barcode[2].id}
      barcodeMat: ${wcs-slave.barcode[5].id}
      backSta: 160
      led: ${wcs-slave.led[5].id}
#    # 拣料入库口1
@@ -299,6 +302,21 @@
    id: 3
    ip: 10.10.10.123
    port: 51236
  # 条码扫描仪1mat
  barcode[3]:
    id: 4
    ip: 10.10.10.121
    port: 51236
  # 条码扫描仪2mat
  barcode[4]:
    id: 5
    ip: 10.10.10.122
    port: 51236
  # 条码扫描仪3mat
  barcode[5]:
    id: 6
    ip: 10.10.10.123
    port: 51236
   # LED1
  led[0]:
    id: 1