#
野心家
2023-11-08 94e6a3b240b6a972408dcb6719ba2a1df0e7746e
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -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,23 +2389,27 @@
                                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){
                                        LocMast locMast1=locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no",wrkMast.getLocNo()));
                                        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);
                                    }else{
                                        fig=true;
                                    }
                                }
                                }}
                            }else if(devpThread.startSignal[i][0]==3){
                                locMast.setPackStatus(7);
                                testMast.setModiTime(new Date());
@@ -2415,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))){
@@ -2444,7 +2467,7 @@
                        TestMast testMast=testMastService.selectOne(new EntityWrapper<TestMast>()
                                .eq("loc_no",locMast.getLocNo())
                                .eq("user_id",locMast.getBarcode()));
                        if(locMast.getLocSts().equals("O")&&devpThread.startSignal[i][0]!=8){
                        if((locMast.getLocSts().equals("O")||locMast.getLocSts().equals("S"))&&devpThread.startSignal[i][0]!=8){
                            Thread.sleep(1000);
                            MessageQueue.offer(SlaveType.Devp, 1, new Task(6,locMast.getChannel()-1));
                        }