From 12d9f4e03c0331efc9a656356e78b9f314639707 Mon Sep 17 00:00:00 2001
From: 1 <1@123>
Date: 星期三, 18 三月 2026 17:07:57 +0800
Subject: [PATCH] lsh#

---
 rsf-open-api/src/main/java/com/vincent/rsf/openApi/controller/phyz/ERPController.java |  120 +++++++++++++++++++++++++++++++++++------------------------
 1 files changed, 71 insertions(+), 49 deletions(-)

diff --git a/rsf-open-api/src/main/java/com/vincent/rsf/openApi/controller/phyz/ERPController.java b/rsf-open-api/src/main/java/com/vincent/rsf/openApi/controller/phyz/ERPController.java
index d2f59c7..1c01de7 100644
--- a/rsf-open-api/src/main/java/com/vincent/rsf/openApi/controller/phyz/ERPController.java
+++ b/rsf-open-api/src/main/java/com/vincent/rsf/openApi/controller/phyz/ERPController.java
@@ -18,8 +18,8 @@
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletRequest;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -56,7 +56,11 @@
         JSONArray params = paramsFormat(objParams);
         List<Warehouse> warehouseList = JSON.parseArray(params.toJSONString(), Warehouse.class);
         // 鏁版嵁澶勭悊锛岃浆鍙憇erver
-        return CommonResponse.ok();
+        String resultMsg = erpReportService.syncWareHouse(warehouseList);
+        if ("200".equals(resultMsg)){
+            return  CommonResponse.ok(resultMsg);
+        }
+        return CommonResponse.error(resultMsg);
     }
 
     @ApiOperation("鐗╂枡淇℃伅鍚屾")
@@ -73,7 +77,11 @@
         JSONArray params = paramsFormat(objParams);
         List<Material> materialList = JSON.parseArray(params.toJSONString(), Material.class);
         // 鏁版嵁澶勭悊锛岃浆鍙憇erver
-        return CommonResponse.ok();
+        String resultMsg = erpReportService.syncMaterial(materialList);
+        if ("200".equals(resultMsg)){
+            return  CommonResponse.ok(resultMsg);
+        }
+        return CommonResponse.error(resultMsg);
     }
 
     @ApiOperation("瀹㈡埛淇℃伅鍚屾")
@@ -90,7 +98,11 @@
         JSONArray params = paramsFormat(objParams);
         List<Customer> customerList = JSON.parseArray(params.toJSONString(), Customer.class);
         // 鏁版嵁澶勭悊锛岃浆鍙憇erver
-        return CommonResponse.ok();
+        String resultMsg = erpReportService.syncCustomer(customerList);
+        if ("200".equals(resultMsg)){
+            return  CommonResponse.ok(resultMsg);
+        }
+        return CommonResponse.error(resultMsg);
     }
 
     @ApiOperation("渚涘簲鍟嗕俊鎭悓姝�")
@@ -107,6 +119,10 @@
         JSONArray params = paramsFormat(objParams);
         List<Supplier> supplierList = JSON.parseArray(params.toJSONString(), Supplier.class);
         // 鏁版嵁澶勭悊锛岃浆鍙憇erver
+        String resultMsg = erpReportService.syncSupplier(supplierList);
+        if ("200".equals(resultMsg)){
+            return  CommonResponse.ok(resultMsg);
+        }
         return CommonResponse.ok();
     }
 
@@ -129,8 +145,14 @@
             String i = erpReportService.addOrderToServer(order);
             if (i.equals("200")){
                 errorMsg.append(order.getOrderNo()+"涓嬪彂鎴愬姛;");
+                if (orderList.size()==1){
+                    return CommonResponse.ok(errorMsg.toString());
+                }
             } else {
                 errorMsg.append(order.getOrderNo()+"涓嬪彂澶辫触,鍘熷洜锛�"+i+";");
+                if (orderList.size()==1){
+                    return CommonResponse.error(errorMsg.toString());
+                }
             }
         }
         return CommonResponse.ok(errorMsg.toString());
@@ -170,50 +192,50 @@
             condition = new InventoryQueryCondition();
         }
         
-        if (SIMULATED_DATA_ENABLE.equals("1")) {
-            String x = "[\n" +
-                    "  {\n" +
-                    "    \"locId\": \"LOC-A-01-01\",\n" +
-                    "    \"wareHouseId\": \"WH001\",\n" +
-                    "    \"wareHouseName\": \"鍘熸枡浠撳簱\",\n" +
-                    "    \"palletId\": \"PALLET001\",\n" +
-                    "    \"matNr\": \"MAT10001\",\n" +
-                    "    \"makTx\": \"閽㈡潗Q235\",\n" +
-                    "    \"spec\": \"鍥芥爣GB/T700-2006\",\n" +
-                    "    \"anfme\": 10.5,\n" +
-                    "    \"unit\": \"鍚╘",\n" +
-                    "    \"status\": \"鍙敤\",\n" +
-                    "    \"orderType\": 1,\n" +
-                    "    \"orderNo\": \"Order202698921\",\n" +
-                    "    \"prepareType\": 1,\n" +
-                    "    \"planNo\": \"PLAN202601060001\",\n" +
-                    "    \"batch\": \"BATCH20260106001\",\n" +
-                    "    \"stockOrgId\": \"ORG001\"\n" +
-                    "  },\n" +
-                    "  {\n" +
-                    "    \"locId\": \"LOC-B-02-03\",\n" +
-                    "    \"wareHouseId\": \"WH002\",\n" +
-                    "    \"wareHouseName\": \"鎴愬搧浠撳簱\",\n" +
-                    "    \"palletId\": \"PALLET002\",\n" +
-                    "    \"matNr\": \"MAT20001\",\n" +
-                    "    \"makTx\": \"鐢垫満缁勪欢\",\n" +
-                    "    \"spec\": \"380V 50Hz\",\n" +
-                    "    \"anfme\": 50,\n" +
-                    "    \"unit\": \"鍙癨",\n" +
-                    "    \"status\": \"鍙敤\",\n" +
-                    "    \"orderType\": \"1\",\n" +
-                    "    \"orderNo\": \"SO202601060001\",\n" +
-                    "    \"prepareType\": 1,\n" +
-                    "    \"planNo\": \"PLAN202601060002\",\n" +
-                    "    \"batch\": \"BATCH20260106002\",\n" +
-                    "    \"stockOrgId\": \"ORG001\"\n" +
-                    "  }\n" +
-                    "]";
-            if (map == null || map.isEmpty()) {
-                map = JSON.parseArray(x);
-            }
-            return CommonResponse.ok(JSONArray.parseArray(map.toJSONString(), InventoryDetails.class));
-        }
+//        if (SIMULATED_DATA_ENABLE.equals("1")) {
+//            String x = "[\n" +
+//                    "  {\n" +
+//                    "    \"locId\": \"LOC-A-01-01\",\n" +
+//                    "    \"wareHouseId\": \"WH001\",\n" +
+//                    "    \"wareHouseName\": \"鍘熸枡浠撳簱\",\n" +
+//                    "    \"palletId\": \"PALLET001\",\n" +
+//                    "    \"matNr\": \"MAT10001\",\n" +
+//                    "    \"makTx\": \"閽㈡潗Q235\",\n" +
+//                    "    \"spec\": \"鍥芥爣GB/T700-2006\",\n" +
+//                    "    \"anfme\": 10.5,\n" +
+//                    "    \"unit\": \"鍚╘",\n" +
+//                    "    \"status\": \"鍙敤\",\n" +
+//                    "    \"orderType\": 1,\n" +
+//                    "    \"orderNo\": \"Order202698921\",\n" +
+//                    "    \"prepareType\": 1,\n" +
+//                    "    \"planNo\": \"PLAN202601060001\",\n" +
+//                    "    \"batch\": \"BATCH20260106001\",\n" +
+//                    "    \"stockOrgId\": \"ORG001\"\n" +
+//                    "  },\n" +
+//                    "  {\n" +
+//                    "    \"locId\": \"LOC-B-02-03\",\n" +
+//                    "    \"wareHouseId\": \"WH002\",\n" +
+//                    "    \"wareHouseName\": \"鎴愬搧浠撳簱\",\n" +
+//                    "    \"palletId\": \"PALLET002\",\n" +
+//                    "    \"matNr\": \"MAT20001\",\n" +
+//                    "    \"makTx\": \"鐢垫満缁勪欢\",\n" +
+//                    "    \"spec\": \"380V 50Hz\",\n" +
+//                    "    \"anfme\": 50,\n" +
+//                    "    \"unit\": \"鍙癨",\n" +
+//                    "    \"status\": \"鍙敤\",\n" +
+//                    "    \"orderType\": \"1\",\n" +
+//                    "    \"orderNo\": \"SO202601060001\",\n" +
+//                    "    \"prepareType\": 1,\n" +
+//                    "    \"planNo\": \"PLAN202601060002\",\n" +
+//                    "    \"batch\": \"BATCH20260106002\",\n" +
+//                    "    \"stockOrgId\": \"ORG001\"\n" +
+//                    "  }\n" +
+//                    "]";
+//            if (map == null || map.isEmpty()) {
+//                map = JSON.parseArray(x);
+//            }
+//            return CommonResponse.ok(JSONArray.parseArray(map.toJSONString(), InventoryDetails.class));
+//        }
 
         try {
             if (wmsServerFeignClient == null) {

--
Gitblit v1.9.1