From 608fb6f9529ce51291ef682638a5efc7dd51ac63 Mon Sep 17 00:00:00 2001
From: zwl <1051256694@qq.com>
Date: 星期二, 18 十一月 2025 08:21:08 +0800
Subject: [PATCH] 1.完善找库位 2.新增erp订单删除后,wms订单跟着删除功能 3.新增订单完成后,上报erp,erp报错后显现在出货单中 4.新增一键查询到异常完成订单 5.对销售单据和其他单据进行区分出库 6.对中间表订单状态进行完善 7.新增锁单功能 8.新增任务查询维护加上订单号

---
 src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java |   75 +++++++++++++++++++++++++++++++++----
 1 files changed, 67 insertions(+), 8 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
index c7dd5c4..f31590c 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -23,6 +23,15 @@
 import com.zy.common.model.MesCombParam;
 import com.zy.common.service.CommonService;
 import com.zy.common.utils.HttpHandler;
+import com.zy.third.entity.ExdInstockSource;
+import com.zy.third.entity.ExdStock;
+import com.zy.third.entity.ExdvYanbu;
+import com.zy.third.mapper.ExdMaterialMapper;
+import com.zy.third.mapper.ExdStockMapper;
+import com.zy.third.service.ExdInstockSourceService;
+import com.zy.third.service.ExdMaterialService;
+import com.zy.third.service.ExdStockService;
+import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -46,6 +55,8 @@
     private OrderService orderService;
     @Autowired
     private OrderDetlService orderDetlService;
+    @Autowired
+    private OrderDetl1Service orderDetl1Service;
     @Autowired
     private BasDevpService basDevpService;
     @Autowired
@@ -76,11 +87,22 @@
     private ManLocDetlService manLocDetlService;
     @Autowired
     private ManLocDetlMapper manLocDetlMapper;
+    @Autowired
+    private ExdMaterialMapper exdMaterialMapper;
+    @Autowired
+    private ExdStockMapper exdStockMapper;
+    @Autowired
+    private ExdStockService exdStockService;
+    @Autowired
+    private ExdInstockSourceService  exdInstockSourceService;
 
 
     @Override
     @Transactional
     public void comb(CombParam param, Long userId, String fxId) {
+        if (Cools.isEmpty(fxId)){
+            throw new CoolException("璇风敤鑷繁鐨勮处鍙风粍鎵�");
+        }
         if (Cools.isEmpty(param.getBarcode(), param.getCombMats())) {
             throw new CoolException(BaseRes.PARAM);
         }
@@ -89,6 +111,7 @@
                 eq("zpallet", param.getBarcode()).eq("io_status", "N")) > 0) {
             throw new CoolException(param.getBarcode() + "鏁版嵁缁勬墭妗d腑宸插瓨鍦�");
         }
+
 
         int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet", param.getBarcode()));
         int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet", param.getBarcode()));
@@ -107,8 +130,9 @@
         //杩涜鎵瑰彿绛涢�夛紝鎵瑰彿鍙兘鍞竴
         Set<String> batchs = new HashSet<>();
         List<String> strings = new ArrayList<>();
-
-
+        long time = new Date().getTime();
+        //鐢熶骇鍏ュ簱瀵逛竴鍧ㄧ墿鏂欒繘琛岀粦瀹氥�傚敮涓�鍊�
+        String fbillno = param.getBarcode()+"--"+time;
         for (CombParam.CombMat mat : param.getCombMats()) {
             if (Cools.isEmpty(mat.getBatch())) {
                 continue;
@@ -132,7 +156,16 @@
             // 鐢熸垚鍏ュ簱閫氱煡妗�
             List<DetlDto> detlDtos = new ArrayList<>();
             param.getCombMats().forEach(elem -> {
+                // 鍒ゆ柇鏄惁鏈夌浉鍚屾潯鐮佺殑鏁版嵁
+                if (!Cools.isEmpty(elem.getBc())){
+                    if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>().
+                            eq("three_code", elem.getBc())) > 0) {
+                        throw new CoolException( elem.getBc() + "鏁版嵁缁勬墭妗d腑宸插瓨鍦�");
+                    }
+                }
+
                 DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme());
+                detlDto.setBc(elem.getBc());
                 if (DetlDto.has(detlDtos, detlDto)) {
                     DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch());
                     assert one != null;
@@ -153,7 +186,8 @@
                 }
                 WaitPakin waitPakin = new WaitPakin();
                 waitPakin.sync(mat);
-                waitPakin.setBatch(detlDto.getBatch());
+                waitPakin.setBatch(detlDto.getBc());
+                waitPakin.setThreeCode(detlDto.getBc());
                 waitPakin.setZpallet(param.getBarcode());   // 鎵樼洏鐮�
                 waitPakin.setIoStatus("N");     // 鍏ュ嚭鐘舵��
                 waitPakin.setAnfme(detlDto.getAnfme());  // 鏁伴噺
@@ -161,8 +195,17 @@
                 waitPakin.setAppeUser(userId);
                 waitPakin.setAppeTime(now);
                 waitPakin.setModiUser(userId);
+                waitPakin.setColor(userId+"");
                 waitPakin.setModiTime(now);
-                waitPakin.setBrand(param.getCk());//浠撳簱
+                //鐢熶骇鍏ュ簱瀵逛竴鍧ㄧ墿鏂欒繘琛岀粦瀹氥�傚敮涓�鍊�
+                waitPakin.setOrigin(fbillno);
+                ExdvYanbu barcode1 = exdMaterialMapper.getBacode(detlDto.getBc());
+                String pid="03.98";
+                if(!Cools.isEmpty(barcode1)&&!Cools.isEmpty(barcode1.getProdinkind())){
+                    pid=barcode1.getProdinkind();
+                }
+                ExdStock id = exdStockService.selectOne(new EntityWrapper<ExdStock>().eq("Fnumber", pid));
+                waitPakin.setBrand(id.getFname());//浠撳簱
                 waitPakin.setInspect(param.isType() ? 1 : 0);
                 if (i == 1) {
 //                0锛氫笉闇�瑕佽ˉ绌烘墭鐩�
@@ -178,7 +221,7 @@
                      * 3锛欰GV浠诲姟瀹屾垚
                      * 4锛氱粰杈撻�佺嚎涓嬪彂鍏ュ簱鎸囦护
                      */
-                    waitPakin.setBeBatch(param.getBeBatch());
+                    waitPakin.setBeBatch(Cools.isEmpty(param.getRsta())?0:1);
                     waitPakin.setSuppCode(param.getBarcode());
                 }
                 i++;
@@ -202,7 +245,11 @@
                     throw new CoolException(orderDetl.getMatnr() + "鍏ュ簱鏁伴噺涓嶅悎娉�");
                 }
                 // 淇敼璁㈠崟浣滀笟鏁伴噺
-                if (!orderDetlService.increaseWorkQty2(order.getId(), elem.getMatnr(), elem.getBatch(), elem.getAnfme(), fxId)) {
+                if (!orderDetlService.increaseWorkQty2(order.getId(), elem.getMatnr(), elem.getBatch(), elem.getAnfme(), userId)) {
+                    throw new CoolException("淇敼鍗曟嵁浣滀笟鏁伴噺澶辫触");
+                }
+                // 淇敼瀛愬崟璁㈠崟浣滀笟鏁伴噺
+                if (!orderDetl1Service.increaseWorkQty2(order.getId(), elem.getMatnr(), elem.getBatch(), elem.getAnfme(), userId)) {
                     throw new CoolException("淇敼鍗曟嵁浣滀笟鏁伴噺澶辫触");
                 }
 
@@ -223,7 +270,7 @@
                 WaitPakin waitPakin = new WaitPakin();
                 waitPakin.sync(mat);
                 waitPakin.setOrderNo(order.getOrderNo());   // 鍗曟嵁缂栧彿
-                waitPakin.setBatch(detlDto.getBatch());     // 搴忓垪鐮�
+                waitPakin.setBatch(detlDto.getBatch());     // 鎵瑰彿
                 waitPakin.setZpallet(param.getBarcode());   // 鎵樼洏鐮�
                 waitPakin.setIoStatus("N");     // 鍏ュ嚭鐘舵��
                 waitPakin.setAnfme(detlDto.getAnfme());  // 鏁伴噺
@@ -232,7 +279,12 @@
                 waitPakin.setAppeTime(now);
                 waitPakin.setModiUser(userId);
                 waitPakin.setModiTime(now);
-                waitPakin.setBrand(param.getCk());//浠撳簱
+                waitPakin.setColor(userId+"");
+
+                OrderDetl orderDetl = orderDetlService.selectOne(new EntityWrapper<OrderDetl>()
+                        .eq("matnr", detlDto.getMatnr()).eq("order_no", order.getOrderNo())
+                        .eq("batch", detlDto.getBatch()));
+                waitPakin.setBrand(orderDetl.getBrand());//浠撳簱
                 waitPakin.setInspect(param.isType() ? 1 : 0);
                 if (i == 1) {
 //                0锛氫笉闇�瑕佽ˉ绌烘墭鐩�
@@ -257,6 +309,13 @@
                 }
             }
             orderService.updateSettle(order.getId(), 2L, userId);
+            List<ExdInstockSource> fBillNo = exdInstockSourceService.selectList(new EntityWrapper<ExdInstockSource>().eq("FBillNo", order.getOrderNo()));
+            if(fBillNo != null){
+                for(ExdInstockSource exdInstockSource : fBillNo){
+                    exdInstockSource.setStatus(10);
+                    exdInstockSourceService.updateById(exdInstockSource);
+                }
+            }
         }
 
     }

--
Gitblit v1.9.1