From 8bf05b0864422c94384b7155ec04660f5c21094a Mon Sep 17 00:00:00 2001
From: yangyang
Date: 星期二, 15 七月 2025 14:48:44 +0800
Subject: [PATCH] 库位管理添加库位状态筛选功能
---
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/MobileServiceImpl.java | 32 ++++++++++++++++++++++++++------
1 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/MobileServiceImpl.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/MobileServiceImpl.java
index c569d81..effb1d3 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/MobileServiceImpl.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/MobileServiceImpl.java
@@ -10,6 +10,7 @@
import com.zy.asrs.wms.apis.wcs.entity.response.CommonReponse;
import com.zy.asrs.wms.apis.wcs.utils.HttpEssUtils;
import com.zy.asrs.wms.asrs.entity.*;
+import com.zy.asrs.wms.asrs.entity.dto.MatnrDetlDto;
import com.zy.asrs.wms.asrs.entity.dto.PickSheetDetlDto;
import com.zy.asrs.wms.asrs.entity.dto.ShippingOrderDetlDto;
import com.zy.asrs.wms.asrs.entity.enums.*;
@@ -466,7 +467,7 @@
public void sowLightMange(String siteNo, Order order, String light) {
// 鍒拌揪鎷i�変綅锛屾帶鍒舵挱绉嶅浜伅
CacheSite cacheSite = cacheSiteService.getOne(new LambdaQueryWrapper<CacheSite>()
- .eq(CacheSite::getSiteNo, siteNo));
+ .eq(CacheSite::getSiteNo, siteNo));
if (Objects.isNull(cacheSite)) {
log.error("鏉$爜锛歿}锛屾湭鎵惧埌鎾澧欎寒鐏�", siteNo);
throw new CoolException("鏈壘鍒版挱绉嶅");
@@ -475,7 +476,7 @@
if (Objects.isNull(detls)) {
throw new CoolException("鏁版嵁閿欒锛岃鍗曟槑缁嗕笉瀛樺湪锛侊紒");
}
- int anfme = (int)detls.stream().mapToDouble(OrderDetl::getAnfme).sum();
+ int anfme = (int) detls.stream().mapToDouble(OrderDetl::getAnfme).sum();
SlapLightControlParam slapLightControlParam = new SlapLightControlParam();
slapLightControlParam
.setControllerCode(cacheSite.getMemo())
@@ -489,7 +490,7 @@
log.info("鎾澧欎寒鐏笅鍙�", JSONObject.toJSONString(slapLightControlParam));
CommonReponse response = HttpEssUtils.post("鍒拌揪鎷i�変綅锛屾挱绉嶅浜伅", HttpEssUtils.PLT_SEND_COMMAND, slapLightControlParam);
if (response.getCode().equals(0)) {
- log.info("鎾澧檣}浜伅鎴愬姛", cacheSite.getSiteNo());
+ log.info("鎾澧檣}浜伅鎴愬姛", cacheSite.getSiteNo());
} else {
log.info("鎾澧檣}浜伅澶辫触", cacheSite.getSiteNo());
}
@@ -680,7 +681,13 @@
List<LocDetl> detls = locDetlService.list(new LambdaQueryWrapper<LocDetl>()
.eq(LocDetl::getLocNo, barcode));
for (int i = 0; i < detls.size(); i++) {
-// detls.get(i).setMats(matService.getOne(new LambdaQueryWrapper<Mat>().eq(Mat::getMatnr, detls.get(i).getMatnr())));
+ Mat mat = matService.getOne(new LambdaQueryWrapper<Mat>().eq(Mat::getId, detls.get(i).getMatId()));
+ MatnrDetlDto detlDto = new MatnrDetlDto();
+ detlDto.setTspec(mat.getSpecs())
+ .setType(mat.getModel())
+ .setMatnrName(mat.getMaktx())
+ .setMatnrNo(mat.getMatnr());
+ detls.get(i).setMats(detlDto);
}
return detls;
}
@@ -697,7 +704,7 @@
.eq(Loc::getLocStsId, LocStsType.F.val())
.eq(Loc::getLocNo, param.get("barcode")));
if (Objects.isNull(barcode)) {
- throw new CoolException("婧愬簱浣嶆槑缁嗕笉瀛樺湪锛侊紒");
+ throw new CoolException(param.get("barcode") + "搴撲綅鐘舵�佷笉鍙墽琛屾鎿嶄綔锛侊紒");
}
Loc tarCode = locService.getOne(new LambdaQueryWrapper<Loc>()
.eq(Loc::getLocStsId, LocStsType.O.val())
@@ -711,7 +718,7 @@
List<LocArea> locAreas = locAreaService.list(new LambdaQueryWrapper<LocArea>()
.in(LocArea::getLocId, ids)
.eq(LocArea::getTypeId, LocAreaTypeSts.LOC_AREA_TYPE_FLAT.id));
- if (!locAreas.isEmpty() && locAreas.size() == ids.size()) {
+ if (!locAreas.isEmpty() && locAreas.size() != ids.size()) {
throw new CoolException("闈炲钩搴撲笉鍙墽琛屾鎿嶄綔锛侊紒");
}
@@ -720,6 +727,19 @@
return R.error("搴撲綅鏄庣粏涓嶅瓨鍦紒锛�");
}
+ if (!locService.update(new LambdaUpdateWrapper<Loc>()
+ .eq(Loc::getLocNo, barcode.getLocNo())
+ .set(Loc::getBarcode, null)
+ .set(Loc::getLocStsId, LocStsType.O.val()))) {
+ throw new CoolException("婧愬簱浣嶇姸鎬佷慨鏀瑰け璐ワ紒锛�");
+ }
+
+ if (!locService.update(new LambdaUpdateWrapper<Loc>().eq(Loc::getLocNo, tarCode.getLocNo())
+ .set(Loc::getBarcode, barcode.getBarcode())
+ .set(Loc::getLocStsId, LocStsType.F.val()))) {
+ throw new CoolException("鐩爣搴撲綅淇敼澶辫触锛侊紒");
+ }
+
if (!locDetlService.update(new LambdaUpdateWrapper<LocDetl>()
.eq(LocDetl::getLocId, barcode.getId())
.set(LocDetl::getLocId, tarCode.getId())
--
Gitblit v1.9.1