From 57448954d59595b87cbb7efad52f59e61fd14d61 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@63.com> Date: 星期三, 01 二月 2023 09:19:05 +0800 Subject: [PATCH] # --- src/main/java/com/zy/common/service/CommonService.java | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java index 406773f..f70fdf4 100644 --- a/src/main/java/com/zy/common/service/CommonService.java +++ b/src/main/java/com/zy/common/service/CommonService.java @@ -314,7 +314,7 @@ if (locMast == null) { // 搴撳尯閿佸畾 - LocRule locRule = locRuleService.find(Cools.isEmpty(matNos) ? null : matNos.get(0), null); + LocRule locRule = locRuleService.find(Cools.isEmpty(matNos) ? null : matNos.get(0), null, start, end); if (!Cools.isEmpty(locRule)) { List<Integer> rows = Utils.getGroupLoc(locRule.getRowBeg()); List<LocMast> locMasts = locMastService.queryFreeLocMast1(rows, rows.size(), locTypeDto.getLocType1(), inoutEveryday @@ -356,12 +356,27 @@ // 2.鏃犲簱浣嶆椂锛屾棤瑙嗗尯鍩熼攣瀹氾紝閲嶆柊鏌ユ壘搴撲綅 if (Cools.isEmpty(locMast)){ List<LocMast> locMasts = locMastService.queryFreeLocMastEnd(curRow); + int sign=curRow; + while (true){ + if (locMasts.size()==0){ + sign = getCurRow(sign); + if (sign != 0){ + locMasts = locMastService.queryFreeLocMastEnd(sign); + }else { + break; + } + }else { + break; + } + } for (LocMast locMast1 : locMasts){ List<LocMast> locMasts1 = locMastService.queryFreeLocMastEnd0(locMast1.getBay1(), locMast1.getLev1(),locMast1.getRow1()); Integer innermostRow = Utils.getInnermostRow(locMasts1.get(0).getLocNo()); for (LocMast locMast2:locMasts1){ - if (locMast2.getRow1().equals(innermostRow)) { + if (locMast2.getLocSts().equals("O")){ locMast = locMast2; + break; + }else if (!locMast2.getLocSts().equals("F")){ break; } } @@ -413,4 +428,28 @@ } } + public int getCurRow(int curRow){ + switch (curRow){ + case 1: + case 2: + case 8: + case 9: + case 10: + case 15: + case 16: + case 17: + return curRow+1; + case 5: + case 6: + case 7: + case 13: + case 14: + case 20: + case 21: + return curRow-1; + default: + return 0; + } + } + } -- Gitblit v1.9.1