自动化立体仓库 - WMS系统
#
Administrator
5 天以前 b9c8e8d4960afceaf7dd56f4acc566c98b02355c
src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
@@ -194,13 +194,6 @@
                            }
                        }
                    }
                    if(wrkMast.getSourceStaNo().equals("1070")){
                        WrkMast wrkMastOld = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode",wrkMast.getBarcode()).eq("loc_no",wrkMast.getSourceLocNo()));
                        wrkMastOld.setOveMk("Y");
                        if(!wrkMastService.updateById(wrkMastOld)){
                            return FAIL.setMsg("出库回库 ===>> 原任务完成失败; [workNo=" + wrkMastOld.getWrkNo() + "],[locNo=" + wrkMastOld.getLocNo() + "]");
                        }
                    }
                    // 修改库位状态 S ====>> F
                    if (locMast.getLocSts().equals("S")) {
                        locMast.setLocSts("F");
@@ -457,6 +450,18 @@
//                    }
                    movLoc(wrkMast);
                    break;
                case 2:
                    WrkMast wrkMast1 = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode",wrkMast.getBarcode()).eq("io_type",101));
                    if(Objects.isNull(wrkMast1.getIsSuplus())){
                        break;
                    }
                    if(!Cools.isEmpty(wrkMast1)) {
                        wrkMast1.setOveMk("Y");
                    }
                    if(!wrkMastService.updateById(wrkMast1)) {
                        TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                        return FAIL.setMsg("更新退库跨区域完成状态失败; [workNo=" + wrkMast1.getWrkNo());
                    }break;
                default:
                    break;
            }
@@ -504,6 +509,7 @@
    public void movLoc(WrkMast wrkMast) {
        LocMast locMast = locMastService.selectById(wrkMast.getLocNo());
        if (Objects.isNull(locMast)) {
            throw new CoolException("目标库位不存在!!");
        }
@@ -607,19 +613,39 @@
                            throw new CoolException("工位状态修改失败!!");
                        }
                    } else {
                        if(!Objects.isNull(wrkMast.getPacked())){ //不是本巷道的出库至1070,之前的跨巷道出库进行完结操作
                            WrkMast wrkMast1 = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no",wrkMast.getPacked()));
                            if(!Objects.isNull(wrkMast1)) {
                                wrkMast1.setOveMk("Y");
                                wrkMastService.updateById(wrkMast1);
                        if(!Objects.isNull(wrkMast.getPacked()) || !Objects.isNull(wrkMast.getExitMk())){ //标记
                            if(!Objects.isNull(wrkMast.getPacked())){
                                WrkMast wrkMast1 = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no",wrkMast.getPacked()));
                                if(!Objects.isNull(wrkMast1)) {
                                    wrkMast1.setOveMk("Y");
                                    wrkMastService.updateById(wrkMast1);
                                }
                            }
                            LocAroundBind bLocNo = locAroundBindService.selectOne(new EntityWrapper<LocAroundBind>().eq("b_loc_no", wrkMast.getLocNo()));
                            if (Objects.isNull(bLocNo)) {
                                throw new CoolException("数据错误, 目标工位不存在!!");
                            if(!Objects.isNull(wrkMast.getLocNo())){
                                movLoc(wrkMast);
                                LocMast locMastTarget = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no",wrkMast.getLocNo()));
                                // 修改库位状态 S ====>> F
                                if (locMastTarget.getLocSts().equals("S")) {
                                    locMastTarget.setLocSts("F");
                                    locMastTarget.setBarcode(wrkMast.getBarcode());
                                    locMastTarget.setIoTime(now);
                                    locMastTarget.setModiTime(now);
                                    if (!locMastService.updateById(locMastTarget)) {
                                        TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                                        return FAIL.setMsg("退库跨区域入库 ===>> 修改库位状态失败; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getLocNo() + "]");
                                    }
                                }
                            }
                            bLocNo.setLocType(LocStsType.LOC_STS_TYPE_O.type);
                            if (!locAroundBindService.updateById(bLocNo)) {
                                throw new CoolException("工位状态修改失败!!");
                            if(!Objects.isNull(wrkMast.getPacked())){
                                LocAroundBind bLocNo = locAroundBindService.selectOne(new EntityWrapper<LocAroundBind>().eq("b_loc_no", wrkMast.getSourceLocNo()));
                                if (Objects.isNull(bLocNo)) {
                                    throw new CoolException("数据错误, 目标工位不存在!!");
                                }
                                bLocNo.setLocType(LocStsType.LOC_STS_TYPE_O.type);
                                if (!locAroundBindService.updateById(bLocNo)) {
                                    throw new CoolException("工位状态修改失败!!");
                                }
                            }
                        }
//                    // 出库确认信号位