From 611118f04720931e31f87ae5d395318c4085db5e Mon Sep 17 00:00:00 2001
From: zwl <1051256694@qq.com>
Date: 星期一, 27 四月 2026 23:40:38 +0800
Subject: [PATCH] 1.双伸空托盘入库规则完善 2.完善双伸只找一边的问题 3.完善重新分配库位问题
---
src/test/java/com/zy/common/service/CommonServiceLocTypeStrategyTest.java | 24 ++++++++++++++++++------
1 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/src/test/java/com/zy/common/service/CommonServiceLocTypeStrategyTest.java b/src/test/java/com/zy/common/service/CommonServiceLocTypeStrategyTest.java
index 90feea6..88fdb96 100644
--- a/src/test/java/com/zy/common/service/CommonServiceLocTypeStrategyTest.java
+++ b/src/test/java/com/zy/common/service/CommonServiceLocTypeStrategyTest.java
@@ -142,7 +142,7 @@
@Test
@SuppressWarnings("unchecked")
- void buildEmptyPalletSearchLocTypes_forLowLoc_returnsConfiguredFallbackOrder() {
+ void buildEmptyPalletSearchLocTypes_forLowLoc_fallsBackToLocType1ThreeAfterNarrowLocs() {
LocTypeDto locTypeDto = new LocTypeDto();
locTypeDto.setLocType1((short) 1);
locTypeDto.setLocType2((short) 1);
@@ -151,15 +151,27 @@
List<LocTypeDto> stages = ReflectionTestUtils.invokeMethod(
commonService, "buildEmptyPalletSearchLocTypes", locTypeDto);
- assertEquals(4, stages.size());
+ assertEquals(3, stages.size());
assertEquals(Short.valueOf((short) 1), stages.get(0).getLocType1());
assertEquals(Short.valueOf((short) 1), stages.get(0).getLocType2());
assertEquals(Short.valueOf((short) 2), stages.get(1).getLocType1());
assertEquals(Short.valueOf((short) 1), stages.get(1).getLocType2());
- assertEquals(Short.valueOf((short) 1), stages.get(2).getLocType1());
+ assertEquals(Short.valueOf((short) 3), stages.get(2).getLocType1());
assertEquals(Short.valueOf((short) 0), stages.get(2).getLocType2());
- assertEquals(Short.valueOf((short) 2), stages.get(3).getLocType1());
- assertEquals(Short.valueOf((short) 0), stages.get(3).getLocType2());
- assertEquals(Short.valueOf((short) 2), stages.get(3).getLocType3());
+ assertEquals(Short.valueOf((short) 2), stages.get(2).getLocType3());
+ }
+
+ @Test
+ void matchesTargetLev_shouldOnlyAcceptRequestedLevel() {
+ LocMast locMast = new LocMast();
+ locMast.setLev1(8);
+
+ Boolean matchEight = ReflectionTestUtils.invokeMethod(commonService, "matchesTargetLev", locMast, 8);
+ Boolean matchSeven = ReflectionTestUtils.invokeMethod(commonService, "matchesTargetLev", locMast, 7);
+ Boolean matchNull = ReflectionTestUtils.invokeMethod(commonService, "matchesTargetLev", locMast, null);
+
+ assertTrue(Boolean.TRUE.equals(matchEight));
+ assertFalse(Boolean.TRUE.equals(matchSeven));
+ assertTrue(Boolean.TRUE.equals(matchNull));
}
}
--
Gitblit v1.9.1