From 288e45a990a5abf4ab50f820ed4e870e8314468e Mon Sep 17 00:00:00 2001 From: 野心家 <1051256694@qq.com> Date: 星期六, 21 六月 2025 15:14:10 +0800 Subject: [PATCH] 完善 --- src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java | 50 ++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 38 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java index 4b82962..27bc55b 100644 --- a/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java @@ -201,15 +201,25 @@ for (OutLocDto dto : dtos) { // 鍒ゆ柇鍏ュ嚭搴撶被鍨嬶細101.鍏ㄦ澘鍑哄簱 or 103.鎷f枡鍑哄簱 if (ioWorkType == null) { - ioType = dto.isAll() ? 101 : 103; +// ioType = dto.isAll() ? 101 : 103; + ioType = 101; } else if (ioWorkType.equals(IoWorkType.CHECK_OUT)) { ioType = 107; } assert ioType != null; // 鑾峰彇搴撲綅 LocMast locMast = locMastService.selectById(dto.getLocNo()); + if (Cools.isEmpty(locMast)){ + throw new CoolException("鏈壘鍒板簱浣�"); + } + if (locMast.getPackStatus()==2 ){ + throw new CoolException("浜у搧鍦ㄦ祴璇曚腑锛岀姝㈠嚭搴�"); + } + + Integer outSta = staNo.getDevNo(); + // 鑾峰彇璺緞 - StaDesc staDesc = staDescService.queryCrnStn(ioType, locMast.getCrnNo(), staNo.getDevNo()); + StaDesc staDesc = staDescService.queryCrnStn(ioType, locMast.getCrnNo(), outSta); // 鐢熸垚宸ヤ綔鍙� int workNo = commonService.getWorkNo(WorkNoType.getWorkNoType(ioType)); // 鐢熸垚宸ヤ綔妗� @@ -221,7 +231,7 @@ wrkMast.setIoPri(13D); // 浼樺厛绾э細13 wrkMast.setCrnNo(locMast.getCrnNo()); wrkMast.setSourceStaNo(staDesc.getCrnStn()); // 婧愮珯 - wrkMast.setStaNo(staDesc.getStnNo()); // 鐩爣绔� + wrkMast.setStaNo(104); // 鐩爣绔� wrkMast.setSourceLocNo(dto.getLocNo()); // 婧愬簱浣� wrkMast.setFullPlt("Y"); // 婊℃澘锛歒 wrkMast.setPicking("N"); // 鎷f枡 @@ -233,6 +243,7 @@ wrkMast.setAppeTime(now); wrkMast.setModiUser(userId); wrkMast.setModiTime(now); + wrkMast.setMemo(outSta+""); if (!wrkMastService.insert(wrkMast)) { throw new CoolException("淇濆瓨宸ヤ綔妗eけ璐ワ紝鍑哄簱搴撲綅鍙凤細"+dto.getLocNo()); } @@ -503,9 +514,18 @@ LocMast loc = locMastService.selectById(locNo); if (Cools.isEmpty(loc)){ throw new CoolException("鏈壘鍒板簱浣�"); - } - if (!sourceLoc.getCrnNo().equals(loc.getCrnNo())) { - throw new CoolException("绉昏浆搴撲綅灞炰簬涓嶅悓鍫嗗灈鏈�"); + }else if (sourceLoc.getPackStatus()==2){ + throw new CoolException("浜у搧鍦ㄦ祴璇曚腑锛岀姝㈠簱浣嶇Щ鏍�"); +// }else if (!sourceLoc.getCrnNo().equals(loc.getCrnNo())) { +// throw new CoolException("绉昏浆搴撲綅灞炰簬涓嶅悓鍫嗗灈鏈�"); + }else if(sourceLoc.getPackStatus()==3||sourceLoc.getPackStatus()==4){ + if(sourceLoc.getLocType1()==loc.getLocType1()){ + throw new CoolException("婧愬簱涓轰笌鐩爣搴撲綅鐨勫簱浣嶇被鍨嬬浉鍚�"); + } + }else if (sourceLoc.getPackStatus()==5){ + if(sourceLoc.getLocType1()!=loc.getLocType1()){ + throw new CoolException("婧愬簱涓洪潤缃揣鐗╀笌鐩爣搴撲綅鐨勫簱浣嶇被鍨嬩笉鐩稿悓"); + } } Date now = new Date(); // 鑾峰彇宸ヤ綔鍙� @@ -516,8 +536,8 @@ wrkMast.setIoTime(now); wrkMast.setWrkSts(11L); // 宸ヤ綔鐘舵�侊細11.鐢熸垚鍑哄簱ID wrkMast.setIoType(11); // 鍏ュ嚭搴撶姸鎬侊細 11.搴撴牸绉昏浇 - wrkMast.setIoPri(10D); - wrkMast.setCrnNo(sourceLoc.getCrnNo()); + wrkMast.setIoPri(sourceLoc.getPackStatus()==4? 9D:10D); + wrkMast.setCrnNo(1); wrkMast.setSourceLocNo(sourceLocNo); // 婧愬簱浣� wrkMast.setLocNo(locNo); // 鐩爣搴撲綅 wrkMast.setFullPlt(Cools.isEmpty(locDetls)?"N":"Y"); // 婊℃澘锛歒 @@ -778,13 +798,19 @@ //鍙栨秷鍏ュ簱宸ヤ綔妗f椂锛屾煡璇㈢粍鎵樿〃锛屽鏋滄湁灏嗙姸鎬佹敼涓哄緟澶勭悊 if(wrkMast.getIoType() == 1) { - WaitPakin waitPakin = waitPakinService.selectOne(new EntityWrapper<WaitPakin>().eq("zpallet", wrkMast.getBarcode())); - if (!Cools.isEmpty(waitPakin)) { - waitPakin.setIoStatus("N"); - waitPakinService.update(waitPakin, new EntityWrapper<WaitPakin>().eq("zpallet", wrkMast.getBarcode())); + List<WaitPakin> waitPakins=waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", wrkMast.getBarcode())); + for (WaitPakin waitPakin:waitPakins){ + if (!Cools.isEmpty(waitPakin)) { + waitPakin.setIoStatus("N"); + waitPakin.setLocNo(""); + waitPakin.setZpallet(""); + boolean result = waitPakinService.update(waitPakin, new EntityWrapper<WaitPakin>() + .eq("zpallet", wrkMast.getBarcode())); + } } } + //鍙栨秷鍑哄簱宸ヤ綔妗f椂锛屾煡璇㈠崟鎹鐞嗚〃锛屽洖婊氫綔涓氫腑鏁伴噺 if(wrkMast.getIoType() == 101 || wrkMast.getIoType() == 103) { List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo()); for (WrkDetl wrkDetl : wrkDetls) { -- Gitblit v1.9.1