自动化立体仓库 - WMS系统
野心家
2023-06-20 5ce6bfb2e237b9fbf092a03cf80e86d928ac7ca6
src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
@@ -334,7 +334,6 @@
                        sourceLoc.setLocSts("O");
                        sourceLoc.setModiTime(now);
                        sourceLoc.setIoTime(now);
                        sourceLoc.setFireStatus(0);
                        sourceLoc.setPackStatus(0);
                        if (!locMastService.updateById(sourceLoc)) {
//                            exceptionHandle("库位移转 ===>> 修改源库位状态失败;[workNo={0}],[sourceLoc={1}]", wrkMast.getWrkNo(), wrkMast.getSourceLocNo());
@@ -347,34 +346,59 @@
                    locMast.setBarcode(wrkMast.getBarcode());
                    locMast.setIoTime(now);
                    locMast.setModiTime(now);
                    locMast.setFireStatus(0);
                    LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo()));
                    boolean sign =false;
                    if (locMast.getLocType1().equals(sourceLoc.getLocType1())){
                        locMast.setPackStatus(packStatus);
                        //待测库位转测试库位
                    }else if (locMast.getLocType1().equals((short)1) && sourceLoc.getLocType1().equals((short)3)){
                        locMast.setPackStatus(1);
                        TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>()
                                .eq("loc_no",sourceLoc.getLocNo())
                                .eq("user_id",locMast.getBarcode())
                                .eq("barcode",locDetl.getMatnr())
                        );
                        if(!Cools.isEmpty(testMast)){
                            testMast.setChannel(locMast.getChannel());
                            testMast.setLocNo(wrkMast.getLocNo());
                            testMast.setModiTime(new Date());
                            testMast.setBarcode(locDetl.getMatnr());
                            if (!testMastService.update(testMast,new EntityWrapper<TestMast>()
                                    .eq("loc_no",sourceLoc.getLocNo())
                                    .eq("user_id",locMast.getBarcode())
                                    .eq("barcode",locDetl.getMatnr()))){
                                throw new CoolException("更改测试状态失败");
                            }
                        }else {
                            throw new CoolException("待测库位无物");
                        }
                    }else {
                        //测试库位转静置库位和NG库位
                        if (locMast.getLocType1().equals((short)4)){
                            locMast.setPackStatus(4); //4:NG
                        }else {
                            locMast.setPackStatus(5); //5:静置中
                        }
                        sign=true;
                        if (locMast.getLocType1()==1 && sourceLoc.getLocType1()==2){
                            TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>()
                                    .eq("loc_no",sourceLoc.getLocNo())
                                    .eq("barcode",locMast.getBarcode())
                                    .eq("barcode",locDetl.getMatnr())
                                    .eq("status",4)
                            );
                            testMast.setStatus(5);
                            testMast.setLocNo(locMast.getLocNo());
                            testMast.setModiTime(new Date());
                            if (!testMastService.update(testMast,new EntityWrapper<TestMast>().eq("loc_no",sourceLoc.getLocNo()).eq("barcode",locMast.getBarcode()).eq("status",4))){
                            if (!testMastService.update(testMast,new EntityWrapper<TestMast>()
                                    .eq("loc_no",sourceLoc.getLocNo())
                                    .eq("barcode",locDetl.getMatnr())
                                    .eq("status",4))){
                                throw new CoolException("更改测试状态失败");
                            }
                        }
                    }
                    if (!locMastService.updateById(locMast)) {
//                        exceptionHandle("库位移转 ===>> 修改目标库位状态失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo());
@@ -470,7 +494,6 @@
                        locMast.setBarcode("");
                        locMast.setModiTime(now);
                        locMast.setIoTime(now);
                        locMast.setFireStatus(0);
                        locMast.setPackStatus(0);
                        if (!locMastService.updateById(locMast)) {
//                            exceptionHandle("全板出库 ===>> 修改源库位状态失败;[workNo={0}],[sourceLocNo={1}]", wrkMast.getWrkNo(), wrkMast.getSourceLocNo());
@@ -487,8 +510,19 @@
                                combParam.setPackSts(1);//OK
                                combParam.setStepSts(7);//测试库出库完成
                            }else if(wrkMast.getStaNo()==204){//NG 出库
                                //NG出库修改测试档的状态为5.已移库
                                TestMast testMast=testMastService.selectOne(new EntityWrapper<TestMast>()
                                        .eq("user_id",wrkMast.getBarcode())
                                        .eq("barcode",wrkDetls101.get(0).getMatnr()));
                                combParam.setPackSts(2);//NG
                                combParam.setStepSts(8);//NG出库完成
                                testMast.setStatus(5);
                                if(!testMastService.update(testMast,new EntityWrapper<TestMast>()
                                        .eq("user_id",wrkMast.getBarcode())
                                        .eq("barcode",wrkDetls101.get(0).getMatnr()))){
                                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                                    return FAIL.setMsg("全板出库 ===>> 修改测试表状态为5失败; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getSourceLocNo() + "]");
                                }
                            }else if(wrkMast.getStaNo()==103){//目标站103出库
                                combParam.setPackSts(1);//OK
                                combParam.setStepSts(6);//静置库出库完成
@@ -506,7 +540,6 @@
                        locMast.setBarcode("");
                        locMast.setModiTime(now);
                        locMast.setIoTime(now);
                        locMast.setFireStatus(0);
                        locMast.setPackStatus(0);
                        if (!locMastService.updateById(locMast)) {
//                            exceptionHandle("空板出库 ===>> 修改源库位状态失败;[workNo={0}],[sourceLocNo={1}]", wrkMast.getWrkNo(), wrkMast.getSourceLocNo());