自动化立体仓库 - WMS系统
#1
dubin
2025-10-30 5ee8d702138b67a8070e850ba622aa4b07d64fb9
src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
@@ -36,8 +36,6 @@
    private WaitPakinService waitPakinService;
    @Autowired
    private OrderDetlService orderDetlService;
    @Autowired
    private InOutService inOutService;
    public ReturnT<String> start(WrkMast wrkMast) {
        // 4.入库完成
@@ -69,15 +67,6 @@
                            throw new CoolException("空板入库条码不能为空");
                        }
                        locMast.setBarcode(wrkMast.getBarcode());
                        if (Integer.parseInt(wrkMast.getBarcode().substring(0,1))==5){
                            locMast.setLocType2((short)5);
                        }else if (Integer.parseInt(wrkMast.getBarcode().substring(0,1))==6){
                            locMast.setLocType2((short)6);
                        }else if(Integer.parseInt(wrkMast.getBarcode().substring(0,1))==7){
                            locMast.setLocType2((short)7);
                        }else if(Integer.parseInt(wrkMast.getBarcode().substring(0,1))==8){
                            locMast.setLocType2((short)8);
                        }
                        locMast.setLocSts("D");
                        locMast.setIoTime(now);
                        locMast.setModiTime(now);
@@ -122,14 +111,7 @@
                            locDetl.setAppeTime(now);
                            locDetl.setModel(wrkDetl.getModel());
                            InOut inOut=inOutService.selectByMatnr(wrkDetl.getMatnr());
                            if (inOut != null){
                                inOut.setTemp1("在库");
//                                inOut.setModiTime(now.toString());
                            }
                            if (!inOutService.updateById(inOut)){
                                return FAIL.setMsg("更新模具属性失败");
                            }
                            locDetl.setSPgNO(wrkDetl.getZpallet().substring(0,1));//并板出库根据托盘类型去选择
                            if (!locDetlService.insert(locDetl)) {
//                                exceptionHandle("全板入库 ===>> 添加库存明细失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo());
@@ -181,17 +163,6 @@
                        LocDetl locDetl = locDetlService.selectItem(locMast.getLocNo(), wrkDetl);
                        if (locDetl != null) {
                            InOut inOut=inOutService.selectByMatnr(wrkDetl.getMatnr());
                            if (inOut != null){
                                inOut.setTemp1("不在库");
//                                inOut.setModiTime(now.toString());
                            }
                            if (!inOutService.updateById(inOut)){
                                return FAIL.setMsg("更新模具属性失败");
                            }
                            if (!locDetlService.updateAnfme(locDetl.getAnfme() - wrkDetl.getAnfme(), locMast.getLocNo(), wrkDetl)) {
//                                exceptionHandle("拣料入库 ===>> 修改库存明细数量失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo());
                                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -249,16 +220,6 @@
                                return FAIL.setMsg("并板入库 ===>> 修改库存明细数量失败; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getLocNo() + "]");
                            }
                        } else {
                            InOut inOut=inOutService.selectByMatnr(wrkDetl.getMatnr());
                            if (inOut != null){
                                inOut.setTemp1("在库");
//                                inOut.setModiTime(now.toString());
                            }
                            if (!inOutService.updateById(inOut)){
                                return FAIL.setMsg("更新模具属性失败");
                            }
                            locDetl = new LocDetl();
                            locDetl.sync(wrkDetl);
                            locDetl.setLocNo(wrkMast.getLocNo()); // 库位号
@@ -266,6 +227,9 @@
                            locDetl.setZpallet(wrkDetl.getZpallet()); // 托盘条码
                            locDetl.setModiTime(now);
                            locDetl.setAppeTime(now);
                            locDetl.setSPgNO(wrkDetl.getZpallet().substring(0,1));//并板出库根据托盘类型去选择
                            if (!locDetlService.insert(locDetl)) {
//                                exceptionHandle("并板入库 ===>> 新增库存明细失败;[workNo={0}],[matnr={1}]", wrkMast.getWrkNo(), wrkDetl.getMatnr());
                                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -390,18 +354,6 @@
                        TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                        return FAIL.setMsg("全板出库 ===>> 工作明细档为空; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getSourceLocNo() + "]");
                    }
                    for (WrkDetl wrkDetl : wrkDetls101) {
                        InOut inOut=inOutService.selectByMatnr(wrkDetl.getMatnr());
                        if (inOut != null){
                            inOut.setTemp1("不在库");
//                            inOut.setModiTime(now.toString());
                        }
                        if (!inOutService.updateById(inOut)){
                            return FAIL.setMsg("更新模具属性失败");
                        }
                    }
                    for (WrkDetl wrkDetl : wrkDetls101) {
                        // 更新订单完成数量
                        OrderDetl orderDetl = orderDetlService.selectItem(wrkDetl);
@@ -427,7 +379,6 @@
                    // 修改源库位状态 R ===>> O
                    if (locMast.getLocSts().equals("R")) {
                        locMast.setLocSts("O");
                        locMast.setBarcode("");//托盘与库位绑定
                        locMast.setModiTime(now);
                        locMast.setIoTime(now);
                        if (!locMastService.updateById(locMast)) {
@@ -442,8 +393,6 @@
                    // 修改库位状态 R ===>> O
                    if (locMast.getLocSts().equals("R")) {
                        locMast.setLocSts("O");
                        locMast.setBarcode("");//托盘与库位绑定
                        locMast.setLocType2((short)0);
                        locMast.setModiTime(now);
                        locMast.setIoTime(now);
                        if (!locMastService.updateById(locMast)) {