From 8f227a0901d120f6f364712800e7a5d5d985e908 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期一, 06 二月 2023 11:11:21 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/common/service/CommonService.java | 96 +++++++++++++++++++++++++++---------------------
1 files changed, 54 insertions(+), 42 deletions(-)
diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java
index 6f2f89f..423aee2 100644
--- a/src/main/java/com/zy/common/service/CommonService.java
+++ b/src/main/java/com/zy/common/service/CommonService.java
@@ -210,8 +210,31 @@
}
}
- // 濡傛灉娌℃湁鐩歌繎鐗╂枡锛屽垯鎸夎鍒欒疆璇㈣揣鏋�
+ // 搴撳尯閿佸畾
+ if (Cools.isEmpty(locMast)) {
+ LocRule locRule = locRuleService.find(Cools.isEmpty(matNos) ? null : matNos.get(0), null, start, end);
+ if (!Cools.isEmpty(locRule)) {
+ List<LocMast> locMasts = locMastService.queryFreeLocMast2(locTypeDto.getLocType1()
+ , locRule.getRowBeg(), locRule.getRowEnd(), locRule.getBayBeg(), locRule.getBayEnd(), locRule.getLevBeg(), locRule.getLevEnd());
+ for (LocMast one : locMasts) {
+ List<String> groupLoc = Utils.getGroupLoc(one.getLocNo());
+ LocMast locMast0 = locMastService.findOutMost(groupLoc);
+ if (null != locMast0) {
+ // 娴呭簱浣嶇鍚堝昂瀵告娴�
+ if (VersionUtils.locMoveCheckLocType(locMast0, locTypeDto)) {
+ // 娴呭簱浣嶅搴斿爢鍨涙満蹇呴』鍙敤涓旀棤寮傚父
+ if (basCrnpService.checkSiteError(locMast0.getCrnNo(), true)) {
+ crnNo = locMast0.getCrnNo();
+ locMast = locMast0;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ // 濡傛灉娌℃湁鐩歌繎鐗╂枡锛屽垯鎸夎鍒欒疆璇㈣揣鏋�
int currentRow = 1;
if (null == locMast) {
Shelves shelves = new Shelves(rowCount, crn_qty);
@@ -312,60 +335,49 @@
// 1.褰撴绱㈠簱鎺掍负娴呭簱浣嶆帓鏃讹紝浼樺厛瀵绘壘褰撳墠搴撴帓鐨勬繁搴撲綅鎺�
if (locMast == 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
- , locRule.getRowBeg(), locRule.getRowEnd(), locRule.getBayBeg(), locRule.getBayEnd(), locRule.getLevBeg(), locRule.getLevEnd());
- if (!Cools.isEmpty(locMasts)) {
- Integer innermostRow = Utils.getInnermostRow(locMasts.get(0).getLocNo());
- for (LocMast one : locMasts) {
- if (one.getRow1().equals(innermostRow)) {
- locMast = one;
- break;
- }
+ List<Integer> rows = Utils.getGroupLoc(curRow);
+ List<LocMast> locMasts = locMastService.queryFreeLocMast0(rows, rows.size(), locTypeDto.getLocType1(), inoutEveryday);
+ if (!Cools.isEmpty(locMasts)) {
+ Integer innermostRow = Utils.getInnermostRow(locMasts.get(0).getLocNo());
+ for (LocMast one : locMasts) {
+ if (one.getRow1().equals(innermostRow)) {
+ locMast = one;
+ break;
}
}
}
- if (locMast == null) {
- List<Integer> rows = Utils.getGroupLoc(curRow);
- List<LocMast> locMasts = locMastService.queryFreeLocMast0(rows, rows.size(), locTypeDto.getLocType1(), inoutEveryday);
- if (!Cools.isEmpty(locMasts)) {
- Integer innermostRow = Utils.getInnermostRow(locMasts.get(0).getLocNo());
- for (LocMast one : locMasts) {
- if (one.getRow1().equals(innermostRow)) {
- locMast = one;
- break;
- }
- }
- }
- }
-// LocMast locMast0 = locMastService.findOutMost(locMasts.stream().map(LocMast::getLocNo).distinct().collect(Collectors.toList()));
-// if (!Cools.isEmpty(locMast0)) {
-// locMast = locMast0;
-// }
- // 鍥犲簱浣嶇Щ杞�侀渶棰勭暀绌哄簱浣� todo:luxiaotao
-// if (!locMastService.checkEmptyCount(locMast)) {
-// locMast = null;
-// }
+ // 鍥犲簱浣嶇Щ杞�侀渶棰勭暀绌哄簱浣�
+ if (!locMastService.checkEmptyCount(locMast, 10)) { locMast = null; }
}
// 2.鏃犲簱浣嶆椂锛屾棤瑙嗗尯鍩熼攣瀹氾紝閲嶆柊鏌ユ壘搴撲綅
-
-
if (Cools.isEmpty(locMast)) {
int sign = curRow;
- while (sign != 0) {
+ while (sign != 0 && Cools.isEmpty(locMast)) {
List<LocMast> locMasts = locMastService.queryFreeLocMastEnd(sign, locTypeDto.getLocType1());
for (LocMast loc : locMasts) {
// 鍚屽簱浣嶇粍瀵瑰簲鍏堕挶搴撲綅鏄惁涓� O.绌哄簱浣�
boolean success = true;
- List<String> outerLoc = Utils.getGroupOuterLoc(loc.getLocNo());
- for (String outerLocNo : outerLoc) {
- if (!locMastService.selectById(outerLocNo).getLocSts().equals("O")) {
+ // 娴呭簱浣�
+ List<String> outerLocList = Utils.getGroupOuterLoc(loc.getLocNo());
+ for (String outerLocNo : outerLocList) {
+ LocMast outerLoc = locMastService.selectById(outerLocNo);
+ if (Cools.isEmpty(outerLoc)) {
+ continue;
+ }
+ if (!outerLoc.getLocSts().equals("O")) {
+ success = false; break;
+ }
+ }
+ // 娣卞簱浣�
+ List<String> insideLocList = Utils.getGroupInsideLoc(loc.getLocNo());
+ for (String insideLocNo : insideLocList) {
+ LocMast insideLoc = locMastService.selectById(insideLocNo);
+ if (Cools.isEmpty(insideLoc)) {
+ continue;
+ }
+ if (insideLoc.getLocSts().equals("R") || insideLoc.getLocSts().equals("P")) {
success = false; break;
}
}
--
Gitblit v1.9.1