From 80baf88fae7bb8ba8dc8be9919e51b817726e394 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期三, 26 三月 2025 16:57:10 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/common/service/CommonService.java | 96 ++++++++++++++++++++++++++++--------------------
1 files changed, 56 insertions(+), 40 deletions(-)
diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java
index 09ce68b..b69b5b2 100644
--- a/src/main/java/com/zy/common/service/CommonService.java
+++ b/src/main/java/com/zy/common/service/CommonService.java
@@ -208,7 +208,7 @@
}
//姝ょ▼搴忕敤浜庝紭鍖栧爢鍨涙満寮傚父鏃剁殑杩愯鏃堕棿
- for (int i = times; i < crnNumber*2; i++) {
+ for (int i = times; i <= crnNumber*2; i++) {
int[] locNecessaryParameters = Utils.LocNecessaryParameters(rowLastno, curRow, crnNumber,whsType);
curRow = locNecessaryParameters[1];
crnNo = locNecessaryParameters[2];
@@ -450,12 +450,12 @@
times = times + 1;
return getLocNoRun(whsType, staDescId, sourceStaNo, matnr, batch, grade,moveCrnNo, locTypeDto, times);
}
-// // 2.搴撲綅褰撳墠鎵�灞炲昂瀵告棤绌哄簱浣嶆椂锛岃皟鏁村昂瀵稿弬鏁帮紝鍚戜笂鍏煎妫�绱㈠簱浣�
-// if (locTypeDto.getLocType1() < 2) {
-// int i = locTypeDto.getLocType1() + 1;
-// locTypeDto.setLocType1((short)i);
-// return getLocNo(1, staDescId, sourceStaNo, matnr,batch,grade, locTypeDto, 0);
-// }
+ // 2.搴撲綅褰撳墠鎵�灞炲昂瀵告棤绌哄簱浣嶆椂锛岃皟鏁村昂瀵稿弬鏁帮紝鍚戜笂鍏煎妫�绱㈠簱浣�
+ if (locTypeDto.getLocType1() < 3) {
+ int i = locTypeDto.getLocType1() + 1;
+ locTypeDto.setLocType1((short)i);
+ return getLocNoRun(whsType,staDescId,sourceStaNo,matnr,batch,grade,0,locTypeDto,0);
+ }
log.error("绯荤粺娌℃湁绌哄簱浣嶏紒锛侊紒 灏哄瑙勬牸锛� {}锛� 杞娆℃暟锛歿}", JSON.toJSONString(locTypeDto), times);
throw new CoolException("娌℃湁绌哄簱浣�");
}
@@ -570,46 +570,62 @@
if (Cools.isEmpty(locMast) && crnNo != 0) {
List<LocMast> locMasts = new ArrayList<>();
int floor = 0;
- if (locTypeDto.getLocType1() == 1){
- int F1count = locMastService.selectCount(new EntityWrapper<LocMast>()
- .in("loc_sts", "O").eq("whs_type", rowLastnoType.getType().longValue())
- .eq("crn_no", 7)
- .eq("loc_type1", locTypeDto.getLocType1())
- .eq("lev1", 1));
- if (F1count <= 10) {
- int F2count = locMastService.selectCount(new EntityWrapper<LocMast>()
+ if (locTypeDto.getLev1() == null){
+ if (locTypeDto.getLocType1() == 1){
+ int F1count = locMastService.selectCount(new EntityWrapper<LocMast>()
.in("loc_sts", "O").eq("whs_type", rowLastnoType.getType().longValue())
.eq("crn_no", 7)
.eq("loc_type1", locTypeDto.getLocType1())
- .eq("lev1", 2));
- if (F2count <= 10) {
- throw new CoolException("搴撲綅涓嶈冻");
+ .eq("lev1", 1));
+ if (F1count <= 10) {
+ int F2count = locMastService.selectCount(new EntityWrapper<LocMast>()
+ .in("loc_sts", "O").eq("whs_type", rowLastnoType.getType().longValue())
+ .eq("crn_no", 7)
+ .eq("loc_type1", locTypeDto.getLocType1())
+ .eq("lev1", 2));
+ if (F2count <= 10) {
+ throw new CoolException("搴撲綅涓嶈冻");
+ }else {
+ floor = 2;
+ }
}else {
- floor = 2;
+ floor = 1;
}
- }else {
- floor = 1;
- }
- }else if (locTypeDto.getLocType1() == 2){
- int F3count = locMastService.selectCount(new EntityWrapper<LocMast>()
- .in("loc_sts", "O").eq("whs_type", rowLastnoType.getType().longValue())
- .eq("crn_no", 7)
- .eq("loc_type1", locTypeDto.getLocType1())
- .eq("lev1", 3));
- if (F3count <= 10) {
- throw new CoolException("搴撲綅涓嶈冻");
+ }else if (locTypeDto.getLocType1() == 2){
+ int F3count = locMastService.selectCount(new EntityWrapper<LocMast>()
+ .in("loc_sts", "O").eq("whs_type", rowLastnoType.getType().longValue())
+ .eq("crn_no", 7)
+ .eq("loc_type1", locTypeDto.getLocType1())
+ .eq("lev1", 3));
+ if (F3count <= 10) {
+ throw new CoolException("搴撲綅涓嶈冻");
+ }
+ floor = 3;
+ }else {
+ throw new CoolException("搴撲綅楂樺害鏁版嵁寮傚父");
}
- floor = 3;
- }else {
- throw new CoolException("搴撲綅楂樺害鏁版嵁寮傚父");
}
- locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
- .eq("bay1", nearRow)
- .in("loc_sts", "O").eq("whs_type",rowLastnoType.getType().longValue())
- .eq("crn_no",7)
- .eq("loc_type1",locTypeDto.getLocType1())
- .eq("lev1",floor).orderBy("row1",false));//鏈�娴呭簱浣�
+
+ if (locTypeDto.getLev1() != null){
+ locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
+ .eq("bay1", nearRow)
+ .in("loc_sts", "O").eq("whs_type",rowLastnoType.getType().longValue())
+ .eq("crn_no",7)
+ .eq("loc_type1",locTypeDto.getLocType1())
+ .eq("lev1",locTypeDto.getLev1()).orderBy("row1",false));//鏈�娴呭簱浣�
+ }else {
+ if (floor == 0){
+ throw new CoolException("搴撲綅宸叉弧");
+ }
+ locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
+ .eq("bay1", nearRow)
+ .in("loc_sts", "O").eq("whs_type",rowLastnoType.getType().longValue())
+ .eq("crn_no",7)
+ .eq("loc_type1",locTypeDto.getLocType1())
+ .eq("lev1",floor).orderBy("row1",false));//鏈�娴呭簱浣�
+ }
+
for (LocMast locMast1 : locMasts) {
if (locMast != null){
@@ -636,7 +652,7 @@
continue;
}
for (LocMast locMastGro1 : locMasts1) {
- if (locMastGro1.getLocSts().equals("P") || locMastGro1.getLocSts().equals("Q") || locMastGro1.getLocSts().equals("R")) {
+ if (locMastGro1.getLocSts().equals("P") || locMastGro1.getLocSts().equals("Q") || locMastGro1.getLocSts().equals("R") || locMastGro1.getLocSts().equals("X")) {
break;
}
if (locMastGro1.getLocSts().equals("O")){
--
Gitblit v1.9.1