From 96b3548131415a2a036d1514a9a0d046f3facdb5 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 22 四月 2021 13:13:30 +0800
Subject: [PATCH] #

---
 src/main/java/zy/cloud/wms/common/service/asrs/AsrsService.java |   27 +++++++++++++++++++--------
 1 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/src/main/java/zy/cloud/wms/common/service/asrs/AsrsService.java b/src/main/java/zy/cloud/wms/common/service/asrs/AsrsService.java
index 9fb018a..c6590d1 100644
--- a/src/main/java/zy/cloud/wms/common/service/asrs/AsrsService.java
+++ b/src/main/java/zy/cloud/wms/common/service/asrs/AsrsService.java
@@ -4,6 +4,7 @@
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import zy.cloud.wms.common.service.asrs.entity.Result;
+import zy.cloud.wms.common.service.asrs.entity.Result1;
 import zy.cloud.wms.manager.entity.param.StockTransferParam;
 import zy.cloud.wms.manager.utils.HttpHandler;
 
@@ -19,7 +20,22 @@
     @Value("${asrs.baseUrl}")
     private String asrsBaseUrl;
 
-    public Boolean stockTransfer(List<StockTransferParam> params) {
+    public Result stockTransferPrew(List<StockTransferParam> params) {
+        try {
+            String response = new HttpHandler.Builder()
+                    .setUri(asrsBaseUrl)
+                    .setPath("/open/api/stockOut/prew")
+                    .setJson(JSON.toJSONString(params))
+                    .build()
+                    .doPost();
+            return JSON.parseObject(response, Result.class);
+        } catch (IOException e) {
+            e.printStackTrace();
+            return new Result(500, "鏈嶅姟鍣ㄥ紓甯�", null);
+        }
+    }
+
+    public Result1 stockTransfer(List<StockTransferParam> params) {
         try {
             String response = new HttpHandler.Builder()
                     .setUri(asrsBaseUrl)
@@ -27,15 +43,10 @@
                     .setJson(JSON.toJSONString(params))
                     .build()
                     .doPost();
-            Result result = JSON.parseObject(response, Result.class);
-            if (result.getCode() == 200) {
-                return true;
-            } else {
-                return false;
-            }
+            return JSON.parseObject(response, Result1.class);
         } catch (IOException e) {
             e.printStackTrace();
-            return false;
+            return new Result1(500, "鏈嶅姟鍣ㄥ紓甯�", null);
         }
     }
 

--
Gitblit v1.9.1