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 |   55 +++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 49 insertions(+), 6 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 07edb2b..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,6 +87,14 @@
     private ManLocDetlService manLocDetlService;
     @Autowired
     private ManLocDetlMapper manLocDetlMapper;
+    @Autowired
+    private ExdMaterialMapper exdMaterialMapper;
+    @Autowired
+    private ExdStockMapper exdStockMapper;
+    @Autowired
+    private ExdStockService exdStockService;
+    @Autowired
+    private ExdInstockSourceService  exdInstockSourceService;
 
 
     @Override
@@ -111,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;
@@ -177,7 +197,15 @@
                 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锛氫笉闇�瑕佽ˉ绌烘墭鐩�
@@ -193,7 +221,7 @@
                      * 3锛欰GV浠诲姟瀹屾垚
                      * 4锛氱粰杈撻�佺嚎涓嬪彂鍏ュ簱鎸囦护
                      */
-                    waitPakin.setBeBatch(param.getBeBatch());
+                    waitPakin.setBeBatch(Cools.isEmpty(param.getRsta())?0:1);
                     waitPakin.setSuppCode(param.getBarcode());
                 }
                 i++;
@@ -217,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("淇敼鍗曟嵁浣滀笟鏁伴噺澶辫触");
                 }
 
@@ -248,7 +280,11 @@
                 waitPakin.setModiUser(userId);
                 waitPakin.setModiTime(now);
                 waitPakin.setColor(userId+"");
-                waitPakin.setBrand(param.getCk());//浠撳簱
+
+                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锛氫笉闇�瑕佽ˉ绌烘墭鐩�
@@ -273,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