From 74863c38a407b1e0f36250dfa0c63e5da7fe5f66 Mon Sep 17 00:00:00 2001
From: pang.jiabao <pang_jiabao@163.com>
Date: 星期一, 19 一月 2026 18:06:51 +0800
Subject: [PATCH] WMS功能完善

---
 src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java |   65 ++++++++++++++++++++++++++++++++
 1 files changed, 65 insertions(+), 0 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 494de65..e3c903e 100644
--- a/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -24,6 +24,7 @@
 import com.zy.common.service.CommonService;
 import com.zy.common.web.WcsController;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -209,6 +210,70 @@
     }
 
     @Override
+    public void webComb(FullStoreParam param, Long userId) {
+        if (Cools.isEmpty(param.getBarcode(), param.getList())) {
+            throw new CoolException(BaseRes.PARAM);
+        }
+        if (param.getList().size() < 1) {
+            throw new CoolException("璇锋彁鍙栦竴涓晢鍝侊紝鎴栬�呭埛鏂伴噸鏂扮粍鎵橈紒");
+        }
+        // 鍒ゆ柇鏄惁鏈夌浉鍚屾潯鐮佺殑鏁版嵁
+        if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>().
+                eq("zpallet", param.getBarcode())
+                .eq("io_status", "N")) > 0) {
+            throw new CoolException(param.getBarcode() + "鏁版嵁姝e湪杩涜鍏ュ簱");
+        }
+
+        if (param.getBarcode().length() != 8) {
+            throw new CoolException("鏉$爜闀垮害涓嶆槸8浣�===>>" + param.getBarcode());
+        }
+
+        int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet", param.getBarcode()));
+        int countWrk = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("barcode",param.getBarcode()).ne("wrk_sts",15));
+        int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode()));
+        if (countLoc > 0 || countWrk > 0 || countwait > 0) {
+            throw new CoolException("缁勬墭妗�/宸ヤ綔妗�/搴撳瓨鏉$爜鏁版嵁宸插瓨鍦�===>>" + param.getBarcode());
+        }
+
+        Date now = new Date();
+
+        List<DetlDto> detlDtos = new ArrayList<>();
+        param.getList().forEach(elem -> {
+            DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(),
+                    elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme());
+            if (DetlDto.has(detlDtos, detlDto)) {
+                DetlDto one = DetlDto.findDto(detlDtos, detlDto);
+                assert one != null;
+                one.setAnfme(one.getAnfme() + detlDto.getAnfme());
+            } else {
+                detlDtos.add(detlDto);
+            }
+        });
+
+        for (DetlDto detlDto : detlDtos) {
+            Mat mat = matService.selectByMatnr(detlDto.getMatnr());
+            if (Cools.isEmpty(mat)) {
+                throw new CoolException(detlDto.getMatnr() + "鍟嗗搧妗f涓嶅瓨鍦�");
+            }
+            WaitPakin waitPakin = new WaitPakin();
+            BeanUtils.copyProperties(mat, waitPakin);
+            waitPakin.setMemo("");
+            waitPakin.setBatch(detlDto.getBatch());
+            waitPakin.setZpallet(param.getBarcode());
+            waitPakin.setIoStatus("N");
+            waitPakin.setAnfme(detlDto.getAnfme());
+            waitPakin.setStatus("Y");
+            waitPakin.setAppeUser(userId);
+            waitPakin.setAppeTime(now);
+            waitPakin.setModiUser(userId);
+            waitPakin.setModiTime(now);
+            if (!waitPakinService.insert(waitPakin)) {
+                throw new CoolException("淇濆瓨鍏ュ簱閫氱煡妗eけ璐�");
+            }
+        }
+    }
+
+    @Override
     @Transactional
     public void turnOverOut(EmptyPlateOutParam param, Long userId) {
         try {

--
Gitblit v1.9.1