*
lsh
2025-12-18 e064028d87f0d9335d095c2f646a7ce7635e13f1
*
5个文件已修改
171 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/utils/RouteUtils.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/MainProcess.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SiemensDevpThread.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -369,6 +369,9 @@
                    if (wrkMast.getSourceStaNo()==145){
                        staNo = 147;
                    }
                    if (wrkMast.getSourceStaNo()==1908 || wrkMast.getSourceStaNo()==1901){
                        staNo = 1907;
                    }
                    staProtocol.setStaNo(staNo);
                    devpThread.setPakMk(staProtocol.getSiteId(), false);
                    boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
@@ -2244,7 +2247,7 @@
     */
    public synchronized void storeEmptyPlt() {
        for (DevpSlave devp : slaveProperties.getDevp()) {
            if (devp.getId()==1) continue;
//            if (devp.getId()==1) continue;
            // 遍历空板入库口
            for (DevpSlave.Sta emptyInSta : devp.getEmptyInSta()) {
                // 获取空板入库站信息
@@ -2259,27 +2262,34 @@
                // 站点条件判断
                if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable()
                        && staProtocol.isEmptyMk() && ((staProtocol.getWorkNo() > 32222 && staProtocol.getWorkNo() <= 63333) || staProtocol.getWorkNo()==0)  && staProtocol.isPakMk()) {
                    try {
                        LocTypeDto locTypeDto = new LocTypeDto(staProtocol);
                        SearchLocParam param = new SearchLocParam();
                        param.setIoType(10);
                        param.setSourceStaNo(emptyInSta.getStaNo());
                        param.setLocType1(locTypeDto.getLocType1());
                        String path = "/rpc/pakin/loc/v1";
                        if (staProtocol.getStaNo()==1908){
                            param.setRgvNo(1);
                            path = "/rpc/pakin/empty/loc/v1";
                        }
                        String response = new HttpHandler.Builder()
                                .setUri(wmsUrl)
                                .setPath("/rpc/pakin/loc/v1")
                                .setPath(path)
                                .setJson(JSON.toJSONString(param))
                                .build()
                                .doPost();
                        JSONObject jsonObject = JSON.parseObject(response);
                        if (jsonObject.getInteger("code").equals(200)) {
                            StartupDto dto = jsonObject.getObject("data", StartupDto.class);
                            Integer staNo = dto.getStaNo();
                            if (staProtocol.getStaNo()==1908){
                                staNo = 1907;
                            }
                            // 更新站点信息 且 下发plc命令
                            staProtocol.setWorkNo(dto.getWorkNo());
                            staProtocol.setStaNo(dto.getStaNo());
                            staProtocol.setStaNo(staNo);
                            devpThread.setPakMk(staProtocol.getSiteId(), false);
                            boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
                            if (!result) {
@@ -2297,42 +2307,42 @@
        }
    }
    /**
     * 入库  ===>> 空栈板初始化入库,1楼叠盘机叠盘
     */
    public synchronized void storeEmptyPlt2() {
        for (DevpSlave devp : slaveProperties.getDevp()) {
            if (devp.getId()==2) continue;
            // 遍历空板入库口
            for (DevpSlave.Sta emptyInSta : devp.getEmptyInSta()) {
                // 获取空板入库站信息
                SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
                StaProtocol staProtocol = devpThread.getStation().get(emptyInSta.getStaNo());
                if (staProtocol == null) {
                    continue;
                } else {
                    staProtocol = staProtocol.clone();
                }
                // 站点条件判断
                if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable()
                        && staProtocol.isEmptyMk() && ((staProtocol.getWorkNo() > 32222 && staProtocol.getWorkNo() <= 63333) || staProtocol.getWorkNo()==0) && staProtocol.isPakMk()) {
                    try {
                        WrkMastSta wrkMastSta = wrkMastStaMapper.selectByWrkNo(staProtocol.getSiteId() + 19999L);
                        if (Cools.isEmpty(wrkMastSta)){
                            WrkMastSta wrkMastSta1 = new WrkMastSta(new Date(),staProtocol.getSiteId());
                            wrkMastSta1.setType(2);
                            wrkMastSta1.setWrkType(1);//工作类型  1:取(叠盘)  2:拆盘  3:取放 5:满取  6:满放
                            wrkMastStaMapper.insert(wrkMastSta1);
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                        TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                    }
                }
            }
        }
    }
//    /**
//     * 入库  ===>> 空栈板初始化入库,1楼叠盘机叠盘
//     */
//    public synchronized void storeEmptyPlt2() {
//        for (DevpSlave devp : slaveProperties.getDevp()) {
//            if (devp.getId()==2) continue;
//            // 遍历空板入库口
//            for (DevpSlave.Sta emptyInSta : devp.getEmptyInSta()) {
//                // 获取空板入库站信息
//                SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
//                StaProtocol staProtocol = devpThread.getStation().get(emptyInSta.getStaNo());
//                if (staProtocol == null) {
//                    continue;
//                } else {
//                    staProtocol = staProtocol.clone();
//                }
//
//                // 站点条件判断
//                if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable()
//                        && staProtocol.isEmptyMk() && ((staProtocol.getWorkNo() > 32222 && staProtocol.getWorkNo() <= 63333) || staProtocol.getWorkNo()==0) && staProtocol.isPakMk()) {
//                    try {
//                        WrkMastSta wrkMastSta = wrkMastStaMapper.selectByWrkNo(staProtocol.getSiteId() + 19999L);
//                        if (Cools.isEmpty(wrkMastSta)){
//                            WrkMastSta wrkMastSta1 = new WrkMastSta(new Date(),staProtocol.getSiteId());
//                            wrkMastSta1.setType(2);
//                            wrkMastSta1.setWrkType(1);//工作类型  1:取(叠盘)  2:拆盘  3:取放 5:满取  6:满放
//                            wrkMastStaMapper.insert(wrkMastSta1);
//                        }
//                    } catch (Exception e) {
//                        e.printStackTrace();
//                        TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
//                    }
//                }
//            }
//        }
//    }
    /**
     * 空栈板初始化入库,叉车入库站放货
src/main/java/com/zy/asrs/utils/RouteUtils.java
@@ -465,44 +465,49 @@
            case 2:
                return 102;
            case 3:
                return 1907;
            case 4:
                return 122;
            case 5:
            case 6:
                return 105;
                return 104;
            case 7:
            case 8:
                return 105;
            case 9:
                return 118;
                return 122;
            case 10:
            case 11:
                return 119;
            case 12:
                return 107;
            case 13:
            case 14:
                return 110;
                return 118;
            case 15:
                return 120;
                return 108;
            case 16:
            case 17:
            case 18:
                return 111;
                return 110;
            case 19:
                return 121;
                return 120;
            case 20:
            case 21:
            case 22:
                return 113;
                return 111;
            case 23:
                return 121;
            case 24:
                return 123;
            case 25:
                return 114;
            case 26:
                return 113;
            case 27:
                return 1142;
            case 28:
                return 116;
                return 123;
            case 29:
                return 114;
            case 30:
            case 31:
                return 1142;
            default:
                return 1142;
        }
@@ -511,46 +516,53 @@
    public static short RgvPosStaTwo(Short posId){
        switch (posId.intValue()){
            case 1:
                return 116;
            case 28:
            case 2:
                return 1142;
                return 116;
            case 3:
            case 4:
                return 114;
                return 171;
            case 5:
                return 123;
            case 6:
                return 114;
            case 7:
                return 123;
            case 8:
                return 113;
            case 9:
            case 10:
                return 121;
                return 113;
            case 11:
            case 12:
                return 121;
            case 13:
                return 111;
            case 14:
                return 120;
            case 15:
            case 16:
                return 110;
                return 120;
            case 17:
                return 110;
            case 18:
                return 119;
            case 19:
                return 108;
            case 20:
                return 108;
            case 21:
                return 118;
            case 22:
                return 107;
            case 23:
            case 24:
                return 105;
                return 107;
            case 25:
            case 26:
                return 122;
            case 27:
                return 105;
            case 28:
            case 29:
            case 30:
                return 104;
            case 31:
            case 32:
                return 1901;
            default:
                return 104;
        }
src/main/java/com/zy/core/MainProcess.java
@@ -66,7 +66,7 @@
                    // 异常信息记录
                    mainService.recErr();
                    // 入库  ===>> 空栈板初始化入库,叉车入库站放货  2楼
                    // 入库  ===>> 空栈板初始化入库,叉车入库站放货
                    mainService.storeEmptyPlt();
                    // 出库  ===>> 工作档信息写入led显示器
                    mainService.ledExecute();
@@ -129,7 +129,7 @@
                    // 入库  ===>> 空栈板初始化入库,1楼叠盘机空板入库
                    mainService.storeEmptyPlt3();
                    // 入库  ===>> 空栈板初始化入库,1楼叠盘机叠盘
                    mainService.storeEmptyPlt2();
//                    mainService.storeEmptyPlt2();
                    // 拣料、并板、盘点再入库拆盘区   1楼拆垛位置  空板叠盘
                    mainService.storeEmptyPlt4();
                    //拆垛完成继续下一步  出库至月台出库口
@@ -137,7 +137,7 @@
                    //拆垛完成继续下一步  运行途中自动避让空板
                    mainService.stackingCompletionDriveTray4();
                    //退货码垛完成托盘继续下一步
                    mainService.stackingCompletionDriveTrayOk3();
//                    mainService.stackingCompletionDriveTrayOk3();
                } catch (Exception e) {
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -60,6 +60,7 @@
        add(152);add(153);
        add(170);
        add(171);
        add(1901);add(1902);add(1904);add(1905);add(1906);add(1907);add(1908);
    }};
    public static final ArrayList<Integer> staNos2 = new ArrayList<Integer>() {{
        add(200);add(201);add(202);add(203);
src/main/resources/application.yml
@@ -356,10 +356,10 @@
    slot: 0
    # WMS入库口1
    inWmsSta[0]:
      staNo: 145
      staNo: 1901
    # 空板入库口1
    emptyInSta[0]:
      staNo: 122
      staNo: 1908
    # 拆垛叠盘口1
    emptyInSta2[0]:
      staNo: 118
@@ -374,7 +374,7 @@
      staNo: 121
    # 出库口1
    outSta[0]:
      staNo: 122
      staNo: 1901
    # 拣料入库口1
    pickSta2[0]:
      staNo: 118