自动化立体仓库 - WMS系统
#
18516761980
2022-10-07 dd2aa5252295dd138a225c101732bef9695567d1
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;
@@ -297,7 +298,23 @@
                    locMast.setIoTime(now);
                    locMast.setModiTime(now);
                    locMast.setFireStatus(0);
                    locMast.setPackStatus(4); //4:静置中
                    if (locMast.getLocType1()==sourceLoc.getLocType1()){
                        locMast.setPackStatus(sourceLoc.getPackStatus());
                    }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();