From aacf537c160d210beea3c37a18f43f3183414ac0 Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期二, 18 十一月 2025 13:14:29 +0800
Subject: [PATCH] *

---
 src/main/java/com/zy/asrs/controller/LocDetlController.java |   49 ++++++++++++++++++++++++++++---------------------
 1 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/LocDetlController.java b/src/main/java/com/zy/asrs/controller/LocDetlController.java
index ca83d92..6e6ced4 100644
--- a/src/main/java/com/zy/asrs/controller/LocDetlController.java
+++ b/src/main/java/com/zy/asrs/controller/LocDetlController.java
@@ -16,10 +16,8 @@
 import com.zy.asrs.entity.param.QualityGroupListParam;
 import com.zy.asrs.entity.result.OrderPakoutDetailVo;
 import com.zy.asrs.mapper.LocDetlMapper;
-import com.zy.asrs.service.ApiLogService;
-import com.zy.asrs.service.LocDetlService;
-import com.zy.asrs.service.ManLocDetlService;
-import com.zy.asrs.service.MatService;
+import com.zy.asrs.service.*;
+import com.zy.asrs.service.impl.LocMastServiceImpl;
 import com.zy.common.utils.HttpHandler;
 import com.zy.common.web.BaseController;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -36,7 +34,6 @@
 
     @Autowired
     private LocDetlService locDetlService;
-
     @Autowired
     private LocDetlMapper locDetlMapper;
     @Autowired
@@ -51,10 +48,12 @@
     @Value("${srXghyMes.qualityFinishedCheckout}")
     private String qualityFinishedCheckout;
 
-    @Value("${srXghyMes.productInventoryUrl}")
-    private String productInventoryUrl;
-    @Value("${srXghyMes.productInventory}")
-    private String productInventory;
+    @Value("${srXghyMes.productInventoryUrlSaveListDto}")
+    private String productInventoryUrlSaveListDto;
+    @Value("${srXghyMes.productInventorySaveListDto}")
+    private String productInventorySaveListDto;
+    @Autowired
+    private LocMastServiceImpl locMastService;
 
     @RequestMapping(value = "/locDetl/update")
     public R update1() {
@@ -392,23 +391,31 @@
     @ManagerAuth(memo = "鍚屾搴撳瓨鑷矼ES")
     public R synchronizeLocDetlMes() {
         try{
-            List<LocDetl> locDetlList = locDetlService.selectList(new EntityWrapper<LocDetl>());
-            if (locDetlList.isEmpty()) {
-                return R.error("搴撳瓨涓虹┖锛侊紒锛�");
+            List<LocMast> locMastList = locMastService.selectList(new EntityWrapper<LocMast>().eq("loc_sts", "F"));
+
+            List<OrderMesXGHYParam> orderMesXGHYParams = new ArrayList<>();
+            for (LocMast locMast : locMastList) {
+                List<LocDetl> locDetlList = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no",locMast.getLocNo()));
+                if (locDetlList.isEmpty()) {
+                    continue;
+                }
+                OrderMesXGHYParam orderMesXGHYParam = new OrderMesXGHYParam(locDetlList,"in","鎴愬搧鍏ュ簱");
+                orderMesXGHYParam.setBarcode(String.valueOf(snowflakeIdWorker.nextId()));
+                orderMesXGHYParam.setPalletizingNo(1);
+                orderMesXGHYParams.add(orderMesXGHYParam);
             }
 
-            OrderMesXGHYParam orderMesXGHYParam = new OrderMesXGHYParam(locDetlList,"in","鎴愬搧鍏ュ簱");
-            orderMesXGHYParam.setBarcode(String.valueOf(snowflakeIdWorker.nextId()));
-            orderMesXGHYParam.setPalletizingNo(1);
-
+            if (orderMesXGHYParams.isEmpty()) {
+                return R.error("搴撳瓨涓虹┖锛侊紒锛�");
+            }
 
             String response = "";
             boolean success = false;
             try {
                 response = new HttpHandler.Builder()
-                        .setUri(productInventoryUrl)
-                        .setPath(productInventory)
-                        .setJson(JSON.toJSONString(orderMesXGHYParam))
+                        .setUri(productInventoryUrlSaveListDto)
+                        .setPath(productInventorySaveListDto)
+                        .setJson(JSON.toJSONString(orderMesXGHYParams))
                         .build()
                         .doPost();
                 JSONObject jsonObject = JSON.parseObject(response);
@@ -424,10 +431,10 @@
                     // 淇濆瓨鎺ュ彛鏃ュ織
                     apiLogService.save(
                             "鍚屾搴撳瓨鑷矼ES",
-                            productInventoryUrl+"/"+productInventory,
+                            productInventoryUrlSaveListDto+"/"+productInventorySaveListDto,
                             null,
                             "127.0.0.1",
-                            JSON.toJSONString(orderMesXGHYParam),
+                            JSON.toJSONString(orderMesXGHYParams),
                             response,
                             success
                     );

--
Gitblit v1.9.1