#
野心家
2023-11-08 94e6a3b240b6a972408dcb6719ba2a1df0e7746e
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -575,7 +575,6 @@
                    && crnProtocol.getLoaded() == 0 && crnProtocol.getForkPos() == 0) {
                // 库位移转
                this.stnToStn(crn, crnProtocol);
                this.locToLoc(crn, crnProtocol);
                // 如果最近一次是入库模式
                if (crnProtocol.getLastIo().equals("I")) {
                    if (basCrnp.getInEnable().equals("Y")) {
@@ -598,6 +597,7 @@
                }
            }
            // 库位移转
            this.locToLoc(crn, crnProtocol);
//            this.crnRebackHp(crnProtocol, crnThread);
        }
@@ -1063,10 +1063,21 @@
     * 库位移转
     */
    public void locToLoc(CrnSlave slave, CrnProtocol crnProtocol){
        //获取所有移库任务
        List<WrkMast> wrkMasts=wrkMastMapper.selectLocMoves(slave.getId());
        // 获取工作档信息
        WrkMast wrkMast = wrkMastMapper.selectLocMove(slave.getId());
        if(Cools.isEmpty(wrkMasts)){
            return;
        }
        if (null == wrkMast) {
            return;
        }
        for (WrkMast wm: wrkMasts) {
            if(wm.getMk().equals('Y')){
                wrkMast=wm;
                break;
            }
        }
        // 获取源库位信息
        LocMast sourceSta = locMastService.selectById(wrkMast.getSourceLocNo());
@@ -2378,7 +2389,9 @@
                                locMast.setPackStatus(2);
                                testMast.setModiTime(new Date());
                                //NG转OK需要还原源库位和目标库位状态,OK转NG 删除任务档
                                WrkMast wrkMast=wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("source_loc_no",locMast.getLocNo()));
                                WrkMast wrkMast=wrkMastService.selectOne(new EntityWrapper<WrkMast>()
                                        .eq("source_loc_no",locMast.getLocNo())
                                        .eq("wrk_sts",11));
                                if(!Cools.isEmpty(wrkMast)){
                                    if(wrkMast.getWrkSts()==11){
                                    if(wrkMast.getIoType()==11){
@@ -2386,9 +2399,10 @@
                                        locMast1.setLocSts("O");
                                        locMastService.update(locMast1,new EntityWrapper<LocMast>().eq("loc_no",wrkMast.getLocNo()));
                                    }
                                    wrkMastMapper.delete(new EntityWrapper<WrkMast>().eq("source_loc_no",locMast.getLocNo()));
                                    wrkMastMapper.delete(new EntityWrapper<WrkMast>()
                                                .eq("wrk_no",wrkMast.getWrkNo()));
                                    locMast.setLocSts("F");
                                    wrkDetlService.delete(new EntityWrapper<WrkDetl>().eq("zpallet",locMast.getBarcode()));
                                    wrkDetlService.delete(new EntityWrapper<WrkDetl>().eq("wrk_no",wrkMast.getWrkNo()));
                                    if(!locMastService.update(locMast,new EntityWrapper<LocMast>()
                                            .eq("channel",i+1))){
                                        log.error("修改测试库位状态失败"+locMast.getLocNo(),locMast);
@@ -2416,6 +2430,14 @@
                            //通道启动按钮状态,1:可以启动出库或者移库,0:不能启动出库或者移库
                            locMast.setCtnKind(devpThread.startSignal[i][2]);
                            if(devpThread.startSignal[i][2]==1){
                                WrkMast wrkMast=wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("source_loc_no",locMast.getLocNo()));
                                if(!Cools.isEmpty(wrkMast)){
                                    wrkMast.setMk("Y");
                                    if(!wrkMastService.update(wrkMast,new EntityWrapper<WrkMast>()
                                            .eq("source_loc_no",locMast.getLocNo()))){
                                        log.error("修改任务档启动按钮状态,任务档状态失败"+wrkMast.getSourceLocNo(),wrkMast);
                                    }
                                }
                                if(!locMastService.update(locMast,new EntityWrapper<LocMast>()
                                        .eq("loc_sts","R")
                                        .eq("channel",i+1))){