自动化立体仓库 - WMS系统
18516761980
2022-10-10 113756e1bfdb3de594b46d5676e3a7fff01499f7
src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.Cools;
import com.core.exception.CoolException;
import com.zy.asrs.entity.*;
import com.zy.asrs.service.*;
import com.zy.asrs.task.AbstractHandler;
@@ -32,7 +33,7 @@
    @Autowired
    private LocDetlService locDetlService;
    @Autowired
    private WaitPakinService waitPakinService;
    private TestMastService testMastService;
    @Autowired
    private OrderDetlService orderDetlService;
@@ -107,6 +108,7 @@
                            locDetl.setZpallet(wrkDetl.getZpallet()); // 托盘条码
                            locDetl.setModiTime(now);
                            locDetl.setAppeTime(now);
                            locDetl.setDeadWarn(wrkDetl.getDeadWarn());
                            if (!locDetlService.insert(locDetl)) {
//                                exceptionHandle("全板入库 ===>> 添加库存明细失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo());
                                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -135,6 +137,8 @@
                        locMast.setBarcode(wrkMast.getBarcode());
                        locMast.setIoTime(now);
                        locMast.setModiTime(now);
                        locMast.setFireStatus(0);
                        locMast.setPackStatus(1);
                        if (!locMastService.updateById(locMast)) {
//                            exceptionHandle("全板入库 ===>> 修改库位状态失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo());
                            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -275,11 +279,14 @@
                    }
                    // 修改源库位状态 ==> O
                    LocMast sourceLoc = locMastService.selectById(wrkMast.getSourceLocNo());
                    Integer packStatus =sourceLoc.getPackStatus();
                    if (null != sourceLoc) {
                        sourceLoc.setBarcode("");
                        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());
                            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -291,6 +298,24 @@
                    locMast.setBarcode(wrkMast.getBarcode());
                    locMast.setIoTime(now);
                    locMast.setModiTime(now);
                    locMast.setFireStatus(0);
                    if (locMast.getLocType1()==sourceLoc.getLocType1()){
                        locMast.setPackStatus(packStatus);
                    }else {
                        locMast.setPackStatus(4); //4:静置中
                        if (locMast.getLocType1()==1 && sourceLoc.getLocType1()==2){
                            TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>()
                                    .eq("loc_no",sourceLoc.getLocNo())
                                    .eq("barcode",locMast.getBarcode())
                                    .eq("status",4)
                            );
                            testMast.setStatus(5);
                            testMast.setModiTime(new Date());
                            if (!testMastService.update(testMast,new EntityWrapper<TestMast>().eq("loc_no",sourceLoc.getLocNo()).eq("barcode",locMast.getBarcode()).eq("status",4))){
                                throw new CoolException("更改测试状态失败");
                            }
                        }
                    }
                    if (!locMastService.updateById(locMast)) {
//                        exceptionHandle("库位移转 ===>> 修改目标库位状态失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo());
                        TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -368,6 +393,8 @@
                        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());
                            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();