From 327c8b8a906eee5f626a9c3a718cc610a466e622 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期五, 21 十月 2022 08:56:18 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/common/service/CommonService.java | 80 +++++++++------------------------------
1 files changed, 19 insertions(+), 61 deletions(-)
diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java
index d1705b5..fcadb9d 100644
--- a/src/main/java/com/zy/common/service/CommonService.java
+++ b/src/main/java/com/zy/common/service/CommonService.java
@@ -111,21 +111,20 @@
*/
public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, List<String> matNos, LocTypeDto locTypeDto, LocTypeDto oldLocType, int times) {
StartupDto startupDto = new StartupDto();
- int start;
- int end;
+ int start = 2;
+ int end = 30;
switch (sourceStaNo) {
- case 103:
- whsType = 1;
- start = 1;
- end = 14;
- break;
- case 203:
+ case 107:
whsType = 2;
- start = 8;
- end = 21;
+ end = 17;
+ break;
+ case 118:
+ whsType = 3;
+ start = 18;
break;
default:
- throw new CoolException("妫�绱㈠簱浣嶅け璐ワ紝璇疯仈绯荤鐞嗗憳");
+ whsType = 1;
+ break;
}
// 鐢熸垚宸ヤ綔鍙�
int workNo = getWorkNo(0);
@@ -144,11 +143,10 @@
LocMast locMast = null;
// 闈犺繎鎽嗘斁瑙勫垯 --- 鍚屽ぉ鍚岃鏍肩墿鏂�
- if (!Cools.isEmpty(matNos)) {
+ if (!Cools.isEmpty(matNos) && matNos.size() == 1) {
List<String> locNos = locDetlService.getSameDetl(matNos.get(0), start, end);
for (String locNo : locNos) {
- List<String> groupLoc = Utils.getGroupLoc(locNo);
- LocMast locMast0 = locMastService.findOutMost(groupLoc);
+ LocMast locMast0 = locMastService.findOutMost(locNo);
if (null != locMast0) {
// 娴呭簱浣嶇鍚堝昂瀵告娴�
if (VersionUtils.locMoveCheckLocType(locMast0, locTypeDto)) {
@@ -169,8 +167,7 @@
.eq("loc_sts", "D").ge("row1", start).le("row1", end));
if (locMasts.size() > 0) {
for (LocMast loc : locMasts) {
- List<String> groupLoc = Utils.getGroupLoc(loc.getLocNo());
- LocMast locMast0 = locMastService.findOutMost(groupLoc);
+ LocMast locMast0 = locMastService.findOutMost(loc.getLocNo());
if (null != locMast0) {
// 娴呭簱浣嶇鍚堝昂瀵告娴�
if (VersionUtils.locMoveCheckLocType(locMast0, locTypeDto)) {
@@ -187,55 +184,16 @@
}
// 濡傛灉娌℃湁鐩歌繎鐗╂枡锛屽垯鎸夎鍒欒疆璇㈣揣鏋�
-
- int currentRow = 1;
if (null == locMast) {
Shelves shelves = new Shelves(rowCount, crn_qty);
for (int i = 0; i < shelves.group; i ++) {
- if (i > 0) {
- curRow = currentRow;
- }
curRow = shelves.start(curRow);
if (curRow < 0) {
throw new CoolException("妫�绱㈠簱浣嶅け璐ワ紝璇疯仈绯荤鐞嗗憳");
}
- currentRow = curRow;
- int crnNo1 = shelves.get(curRow);
- if (whsType == 1) {
- switch (curRow) {
- case 1:
- curRow = 1;
- break;
- case 2:
- curRow = 7;
- break;
- case 3:
- curRow = 8;
- break;
- case 4:
- curRow = 14;
- break;
- default:
- throw new CoolException("妫�绱㈠簱浣嶅け璐ワ紝璇疯仈绯荤鐞嗗憳");
- }
- } else {
- switch (curRow) {
- case 1:
- curRow = 8;
- break;
- case 2:
- curRow = 14;
- break;
- case 3:
- curRow = 15;
- break;
- case 4:
- curRow = 21;
- break;
- default:
- throw new CoolException("妫�绱㈠簱浣嶅け璐ワ紝璇疯仈绯荤鐞嗗憳");
- }
- crnNo1 = crnNo1 + 1;
+ Integer crnNo1 = shelves.get(curRow) + 1;
+ if (whsType != 1) {
+ crnNo1 = whsType;
}
if (basCrnpService.checkSiteError(crnNo1, true)) {
crnNo = crnNo1;
@@ -265,7 +223,7 @@
}
// 鏇存柊搴撲綅鎺掑彿
- rowLastno.setCurrentRow(currentRow);
+ rowLastno.setCurrentRow(curRow);
rowLastnoService.updateById(rowLastno);
// 寮�濮嬫煡鎵惧簱浣� ==============================>>
@@ -276,7 +234,7 @@
List<LocMast> locMasts = locMastService.queryFreeLocMast(rows, rows.size(), locTypeDto.getLocType1());
if (!Cools.isEmpty(locMasts)) {
- Integer innermostRow = Utils.getInnermostRow(locMasts.get(0).getLocNo());
+ Integer innermostRow = Utils.getOutLayerRow(locMasts.get(0).getLocNo(), false);
for (LocMast one : locMasts) {
if (one.getRow1().equals(innermostRow)) {
locMast = one;
@@ -284,7 +242,7 @@
}
}
}
- // 鍥犲簱浣嶇Щ杞�侀渶棰勭暀绌哄簱浣�
+ // 鍥犲簱浣嶇Щ杞�侀渶棰勭暀绌哄簱浣� todo:luxiaotao
// if (!locMastService.checkEmptyCount(locMast)) {
// locMast = null;
// }
--
Gitblit v1.9.1