#
lsh
2024-07-12 6db4a007c34ece48ffac0a2b6c2f700d7b15c6e5
#
5个文件已修改
84 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/mapper/WrkMastMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SiemensDevpThread.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/WrkMastMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/mapper/WrkMastMapper.java
@@ -25,6 +25,8 @@
//    @Select("select top 1 * from asr_wrk_mast where source_sta_no=#{sourceStaNo} and wrk_sts=2 and barcode=#{barcode} and (io_type=1 or io_type=10) order by io_pri desc,io_time,wrk_no ASC")
    WrkMast selectPakInStep1(@Param("sourceStaNo")Integer sourceStaNo, @Param("barcode")String barcode);
    WrkMast selectPakInStep111(@Param("sourceStaNo")Integer sourceStaNo, @Param("barcode")String barcode);
    WrkMast selectPakInStep11(@Param("sourceStaNo")Integer sourceStaNo);
    // 入库第二步,当托盘物料在堆垛机入库站时时查询
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -224,8 +224,17 @@
                    // 判断重复工作档
                    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"));
@@ -388,6 +397,22 @@
//                            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;
                    }
                    // 判断重复工作档
@@ -558,12 +583,27 @@
//                        }
                        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"));
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -133,7 +133,7 @@
    /**
     * 条码数量
     */
    private int barcodeSize = 5;
    private int barcodeSize = 9;
    /**
     * 入出库模式
@@ -351,7 +351,7 @@
        Thread.sleep(200);
        OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.2440",(short)(barcodeSize*8));
        if (result2.IsSuccess) {
            int[] staNosRgv = {281,292,173,214,120};
            int[] staNosRgv = {281,292,173,214,120,100,101,102,103};
            for (int i = 0; i < barcodeSize; i++) {  //1:281  2:292  3:174(173) 4:214  5:120
                String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*8,8, "UTF-8");
src/main/resources/application.yml
@@ -255,9 +255,11 @@
    # 大料箱 双工位单伸 入库口1
    inLargeSta[0]:
      staNo: 292
      barcode: ${wcs-slave.barcode[1].id}
    # 大料箱 双工位单伸 入库口1
    inLargeSta[1]:
      staNo: 281
      barcode: ${wcs-slave.barcode[0].id}
    # 大料箱 双工位单伸 空板入库口1
    emptyInLargeSta[0]:
      staNo: 292
@@ -280,9 +282,11 @@
    # 入库口1
    inSta[0]:
      staNo: 460
      barcode: ${wcs-slave.barcode[3].id}
    # 入库口2
    inSta[1]:
      staNo: 453
      barcode: ${wcs-slave.barcode[4].id}
    # 入硫化罐RGV
    enterRgv[0]:
      rgvNo: 623
@@ -359,6 +363,26 @@
    id: 5
    ip: 10.10.10.52
    port: 51236
  # 条码扫描仪
  barcode[5]:
    id: 6
    ip: 10.10.10.52
    port: 51236
  # 条码扫描仪
  barcode[6]:
    id: 7
    ip: 10.10.10.52
    port: 51236
  # 条码扫描仪
  barcode[7]:
    id: 8
    ip: 10.10.10.52
    port: 51236
  # 条码扫描仪
  barcode[8]:
    id: 9
    ip: 10.10.10.52
    port: 51236
   # LED1
  led[0]:
    id: 1
src/main/resources/mapper/WrkMastMapper.xml
@@ -91,6 +91,10 @@
        select top 1 * from asr_wrk_mast where source_sta_no=#{sourceStaNo} and wrk_sts=2 and barcode=#{barcode} and (io_type=1 or io_type=10) order by io_pri desc,io_time,wrk_no ASC
    </select>
    <select id="selectPakInStep111" resultMap="BaseResultMap">
        select top 1 * from asr_wrk_mast where source_sta_no=#{sourceStaNo} and barcode=#{barcode} and ((io_type=202 and wrk_sts=51) or (io_type=1 and wrk_sts=2)) order by io_pri desc,io_time,wrk_no ASC
    </select>
    <select id="selectPakInStep11" resultMap="BaseResultMap">
        select top 1 * from asr_wrk_mast where source_sta_no=#{sourceStaNo} and wrk_sts=1 and (io_type=1 or io_type=10) order by io_pri desc,io_time,wrk_no ASC
    </select>