From 029ffbf20db7196d4f460bc741fd5f36a80689ae Mon Sep 17 00:00:00 2001
From: skyouc <creaycat@gmail.com>
Date: 星期四, 15 一月 2026 19:55:45 +0800
Subject: [PATCH] 空板回库称重再校验
---
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java | 95 ++++++++++++++++++++++++++++-------------------
1 files changed, 56 insertions(+), 39 deletions(-)
diff --git a/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
index 4270b32..91df095 100644
--- a/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -453,43 +453,50 @@
throw new CoolException("鏈哄彴淇℃伅涓嶅瓨鍦ㄦ垨宸茬鐢紒锛�");
}
- List<LocAroundBind> binds = locAroundBindService.selectList(new EntityWrapper<LocAroundBind>()
- .eq("dev_no", basDevice.getDevNo())
- .eq("is_default", 1));
+ LocAroundBind binds = locAroundBindService.selectOne(new EntityWrapper<LocAroundBind>()
+ .eq("dev_no", basDevice.getDevNo()).orderBy("is_default", false));
- if (Objects.isNull(binds) || binds.isEmpty()) {
+ if (Objects.isNull(binds)) {
throw new CoolException("鏈哄彴鏈缃粯璁ゅ伐浣滀綅锛侊紒");
}
+//
+// Set<String> locs = binds.stream().map(LocAroundBind::getBlocNo).collect(Collectors.toSet());
- Set<String> locs = binds.stream().map(LocAroundBind::getBLocNo).collect(Collectors.toSet());
+// LocMast locMasts = locMastService.selectOne(new EntityWrapper<LocMast>()
+// .in("loc_no", locs)
+// .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type)
+// .orderAsc(Arrays.asList("loc_no")));
+
+// if (Objects.isNull(locMasts)) {
+// binds = locAroundBindService.selectList(new EntityWrapper<LocAroundBind>()
+// .eq("dev_no", basDevice.getDevNo()));
+//
+// Set<String> nlocs = binds.stream().map(LocAroundBind::getBlocNo).collect(Collectors.toSet());
+//
+// locMasts = locMastService.selectOne(new EntityWrapper<LocMast>()
+// .in("loc_no", nlocs)
+// .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type)
+// .orderAsc(Arrays.asList("loc_no")));
+// if (Objects.isNull(locMasts)) {
+// throw new CoolException("鏆傛棤鍙敤宸ヤ綔浣嶏紒锛�");
+// }
+// }
+
+ LocAroundBind bLocNo = locAroundBindService.selectOne(new EntityWrapper<LocAroundBind>().eq("b_loc_no", binds.getBlocNo()));
+ bLocNo.setLocType(LocStsType.LOC_STS_TYPE_S.type);
+
+ if (!locAroundBindService.updateById(bLocNo)) {
+ throw new CoolException("宸ヤ綅棰勭害澶辫触锛侊紒");
+ }
LocMast locMasts = locMastService.selectOne(new EntityWrapper<LocMast>()
- .in("loc_no", locs)
- .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type)
- .orderAsc(Arrays.asList("loc_no"))
- .last("OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY"));
+ .eq("loc_no", bLocNo.getBlocNo()));
- if (Objects.isNull(locMasts)) {
- binds = locAroundBindService.selectList(new EntityWrapper<LocAroundBind>()
- .eq("dev_no", basDevice.getDevNo()));
-
- Set<String> nlocs = binds.stream().map(LocAroundBind::getBLocNo).collect(Collectors.toSet());
-
- locMasts = locMastService.selectOne(new EntityWrapper<LocMast>()
- .in("loc_no", nlocs)
- .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type)
- .orderAsc(Arrays.asList("loc_no"))
- .last("OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY"));
- if (Objects.isNull(locMasts)) {
- throw new CoolException("鏆傛棤鍙敤宸ヤ綔浣嶏紒锛�");
- }
-
- LocAroundBind bLocNo = locAroundBindService.selectOne(new EntityWrapper<LocAroundBind>().eq("b_loc_no", locMasts.getLocNo()));
- bLocNo.setLocType(LocStsType.LOC_STS_TYPE_R.type);
-
- if (!locAroundBindService.updateById(bLocNo)) {
- throw new CoolException("宸ヤ綅棰勭害澶辫触锛侊紒");
- }
+ locMasts.setLocSts(LocStsType.LOC_STS_TYPE_S.type);
+ locMasts.setModiUser(userId);
+ locMasts.setModiTime(now);
+ if (!locMastService.updateById(locMasts)) {
+ throw new CoolException("棰勭害搴撲綅鐘舵�佸け璐ワ紝搴撲綅鍙凤細" + locMasts.getLocNo());
}
List<Integer> staNos = staDescService.queryOutStaNosByLocNo(locMasts.getLocNo(), 1);
@@ -542,7 +549,7 @@
wrkDetl.setIoTime(now);
wrkDetl.setWrkNo(workNo);
wrkDetl.setOrderNo(locDto.getOrderNo());
- wrkDetl.setAnfme(locDto.getAnfme()); // 鏁伴噺
+// wrkDetl.setAnfme(locDto.getAnfme()); // 鏁伴噺
wrkDetl.setStandby1(locDto.getStandby1());
LocDetl locDel = locDetlService.selectOne(new EntityWrapper<LocDetl>()
.eq("loc_no", locDto.getLocNo())
@@ -557,7 +564,7 @@
wrkDetl.setUnit(locDel.getUnit());
wrkDetl.setSpecs(locDel.getSpecs());
wrkDetl.setBatch(locDel.getBatch());
-// wrkDetl.setAnfme(locDel.getAnfme());
+ wrkDetl.setAnfme(locDel.getAnfme());
wrkDetl.setAppeTime(now);
wrkDetl.setAppeUser(userId);
wrkDetl.setModiTime(now);
@@ -1206,9 +1213,18 @@
if (!Objects.isNull(wrkMast.getWrkCode())) {
LocAroundBind aroundBind = locAroundBindService.selectOne(new EntityWrapper<LocAroundBind>().eq("b_loc_no", wrkMast.getSourceLocNo()));
if (!Objects.isNull(aroundBind)) {
- aroundBind.setLocType(LocStsType.LOC_STS_TYPE_O.type);
+ aroundBind.setLocType(LocStsType.LOC_STS_TYPE_F.type);
if (!locAroundBindService.updateById(aroundBind)) {
throw new CoolException("宸ヤ綅鐘舵�佷慨鏀瑰け璐ワ紒锛�");
+ }
+ }
+
+
+ LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", wrkMast.getSourceLocNo()));
+ if (!Objects.isNull(locMast)) {
+ locMast.setLocSts(LocStsType.LOC_STS_TYPE_F.type);
+ if (!locMastService.updateById(locMast)) {
+ throw new CoolException("搴撲綅鐘舵�佷慨鏀瑰け璐ワ紒锛�");
}
}
}
@@ -1519,11 +1535,12 @@
if (!locMastService.updateById(locMast)) {
throw new CoolException("淇敼搴撲綅鐘舵�佸け璐�");
}
-// wrkMast.setWrkCode(null);
-//
-// if (!wrkMastService.updateById(wrkMast)) {
-// throw new CoolException("浠诲姟妗f洿鏂板け璐ワ紒锛�");
-// }
+
+ wrkMast.setWrkCode(null);
+
+ if (!wrkMastService.updateById(wrkMast)) {
+ throw new CoolException("浠诲姟妗f洿鏂板け璐ワ紒锛�");
+ }
}
@@ -1714,7 +1731,7 @@
if (Objects.isNull(binds) || binds.isEmpty()) {
throw new CoolException("鏈哄彴鏈粦瀹氬伐浣滅珯鍙帮紒锛�");
}
- Set<String> locs = binds.stream().map(LocAroundBind::getBLocNo).collect(Collectors.toSet());
+ Set<String> locs = binds.stream().map(LocAroundBind::getBlocNo).collect(Collectors.toSet());
LocMast locMasts = locMastService.selectOne(new EntityWrapper<LocMast>()
.in("loc_no", locs)
--
Gitblit v1.9.1