#
whycq
2022-11-29 bbc298ef75c0eef33d8eded259749b3b5993ccd7
#
3个文件已修改
91 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SiemensDevpThread.java 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -325,20 +325,20 @@
        for (DevpSlave devp : slaveProperties.getDevp()) {
            // 遍历拣料入库口
            for (DevpSlave.Sta pickSta : devp.getPickSta()) {
//                // 获取条码扫描仪信息
//                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, pickSta.getBarcode());
//                if (barcodeThread == null) {
//                    continue;
//                }
//                String barcode = barcodeThread.getBarcode();
//                if(!Cools.isEmpty(barcode)) {
//                    log.info("{}号条码扫描器检测条码信息:{}", pickSta.getBarcode(), barcode);
//                    if("NG".endsWith(barcode) || "NoRead".equals(barcode)) {
//                        continue;
//                    }
//                } else {
//                    continue;
//                }
               // 获取条码扫描仪信息
               BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, pickSta.getBarcode());
               if (barcodeThread == null) {
                   continue;
               }
               String barcode = barcodeThread.getBarcode();
               if(!Cools.isEmpty(barcode)) {
                   log.info("{}号条码扫描器检测条码信息:{}", pickSta.getBarcode(), barcode);
                   if("NG".endsWith(barcode) || "NoRead".equals(barcode)) {
                       continue;
                   }
               } else {
                   continue;
               }
                // 获取拣料入库站信息
                SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
@@ -353,14 +353,17 @@
//                if (devpThread.ioMode != IoModeType.PAKIN_MODE) { continue; }
                if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable() && staProtocol.isPakMk()){
//                    WrkMast wrkMast = wrkMastMapper.selectPickStep(barcode);
                    WrkMast wrkMast = wrkMastMapper.selectPakInStep3(staProtocol.getWorkNo().intValue());
                   WrkMast wrkMast = wrkMastMapper.selectPakInStep3(staProtocol.getWorkNo().intValue());
//                     WrkMast wrkMast = wrkMastMapper.selectPakInStep3(staProtocol.getWorkNo().intValue());
                    if(wrkMast == null){
                        wrkMast = wrkMastMapper.selectPakInStep3(staProtocol.getWorkNo().intValue());
                    }
                    if (wrkMast == null) {
                        // 无拣料数据
                        continue;
                    }
                    if ((wrkMast.getIoType() != 103 && wrkMast.getIoType() != 104 && wrkMast.getIoType() != 107)
                        || Cools.isEmpty(wrkMast.getStaNo()) || Cools.isEmpty(wrkMast.getSourceStaNo()) ) {
                            || Cools.isEmpty(wrkMast.getStaNo()) || Cools.isEmpty(wrkMast.getSourceStaNo()) ) {
                        continue;
                    }
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -250,16 +250,30 @@
        }
        Thread.sleep(200);
        OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB100.150",(short)(barcodeSize*8));
        if (result2.IsSuccess) {
            for (int i = 0; i < barcodeSize; i++) {
                String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*8,8, "UTF-8");
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i + 1);
                if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) {
                    barcodeThread.setBarcode(barcode);
        if(slave.getId()==1) {
            OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB100.150", (short) (barcodeSize * 8));
            if (result2.IsSuccess) {
                for (int i = 0; i < barcodeSize; i++) {
                    String barcode = siemensS7Net.getByteTransform().TransString(result2.Content, i * 8, 8, "UTF-8");
                    BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i + 1);
                    if (!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) {
                        barcodeThread.setBarcode(barcode);
                    }
                }
            }
            }
        } else if(slave.getId()==2) {
            OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB100.150", (short) (1 * 8));
            if (result2.IsSuccess) {
                for (int i = 0; i < 1; i++) {
                    String barcode = siemensS7Net.getByteTransform().TransString(result2.Content, i * 8, 8, "UTF-8");
                    BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i + 4);
                    if (!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) {
                        barcodeThread.setBarcode(barcode);
                    }
                }
            }
        }
//        OperateResultExOne<Short> result2 = siemensS7Net.ReadInt16("DB200.0");
src/main/resources/application.yml
@@ -34,7 +34,7 @@
  enable: false
wms:
  url: 10.10.10.210:8080/lywms
  url: 127.0.0.1:8080/lywms
# 下位机配置
wcs-slave:
@@ -146,7 +146,7 @@
  # 堆垛机4
  crn[3]:
    id: 4
    ip: 10.10.10.200
    ip: 10.10.10.130
    port: 102
    rack: 0
    slot: 0
@@ -155,22 +155,22 @@
    demo: false
    # 堆垛机入库站点
    crnInStn[0]:
      devpPlcId: ${wcs-slave.devp[0].id}
      staNo: 401
      devpPlcId: ${wcs-slave.devp[1].id}
      staNo: 402
      row: 14
      bay: 1
      lev: 1
    # 堆垛机入库站点
    crnInStn[1]:
      devpPlcId: ${wcs-slave.devp[0].id}
      staNo: 401
      devpPlcId: ${wcs-slave.devp[1].id}
      staNo: 402
      row: 14
      bay: 1
      lev: 1
    # 堆垛机出库站点
    crnOutStn[0]:
      devpPlcId: ${wcs-slave.devp[0].id}
      staNo: 401
      devpPlcId: ${wcs-slave.devp[1].id}
      staNo: 402
      row: 14
      bay: 1
      lev: 1
@@ -232,14 +232,14 @@
    slot: 0
    # 入库口1
    inSta[0]:
      staNo: 401
      staNo: 402
      barcode: ${wcs-slave.barcode[3].id}
    # 空板入库口1
    emptyInSta[0]:
      staNo: 401
      staNo: 402
    # 出库口1
    outSta[0]:
      staNo: 402
      staNo: 401
    # 拣料入库口1
    pickSta[0]:
      staNo: 402
@@ -260,7 +260,7 @@
    port: 51236
  barcode[3]:
    id: 4
    ip: 10.10.10.94
    ip: 10.10.10.95
    port: 51236
   # LED1
  led[0]: