소스 검색

发货单添加查询erp库存接口

hu 2 년 전
부모
커밋
c222876c56

+ 5 - 0
src/custom/restcontroller/R.java

@@ -4678,6 +4678,11 @@ public class R {
         public static class v1 {
         }
     }
+    public static class ID20230427101303 {
+        public static class v1 {
+        }
+    }
+
 
 }
 

+ 1 - 1
src/custom/restcontroller/webmanage/sale/dispatch/SQL/发货单明细列表查询.sql

@@ -6,7 +6,7 @@ SELECT t1.sa_dispatch_itemsid,
        t1.itemid,
        ifnull(t1.qty, 0) qty,
        ifnull(t1.outwarehouseqty, 0) outwarehouseqty,
-       t1.batchcontrol,
+       t2.batchcontrol,
        t1.batchno,
        t1.remarks,
        t2.itemno,

+ 1 - 0
src/custom/restcontroller/webmanage/sale/dispatch/SQL/发货商品列表查询.sql

@@ -5,6 +5,7 @@ SELECT t1.sa_orderitemsid,
        t1.itemname,
        t1.model,
        t2.spec,
+       t2.batchcontrol,
        t1.unit,
        t1.undeliqty,
        t1.remarks,

+ 10 - 0
src/custom/restcontroller/webmanage/sale/dispatch/dispatchItems.java

@@ -96,6 +96,16 @@ public class dispatchItems extends Controller {
         return getSucReturnObject().setData(rows).toString();
     }
 
+    @API(title = "erp批次库存查询", apiversion = R.ID20230427101303.v1.class)
+    @CACHEING
+    public String queryErpIcinvbalBatchList() throws YosException {
+
+        JSONArray jsonArray= content.getJSONArray("itemnos");
+        ERPDocking erpDocking =new ERPDocking();
+        JSONArray rows = erpDocking.getErpIcinvbalBatchRows(1000, 1,jsonArray );
+        return getSucReturnObject().setData(rows).toString();
+    }
+
     @API(title = "新建或修改发货单商品明细", apiversion = R.ID20221115104603.v1.class)
     @CACHEING_CLEAN(apiClass = {dispatchItems.class,dispatch.class})
     public String insertormodify_dispatchItems() throws YosException {

+ 39 - 0
src/custom/utility/ERPDocking.java

@@ -128,6 +128,45 @@ public class ERPDocking {
 
         }
     }
+    /**
+     *查询Erp批次库存
+     * @param pagerows
+     * @param pagenum
+     * @param fitemnos
+     * @return
+     * @throws YosException
+     */
+    public JSONArray getErpIcinvbalBatchRows( int pagerows, int pagenum,JSONArray fitemnos) throws YosException {
+        {
+
+            JSONObject object= new JSONObject();
+            JSONObject objectdetail= new JSONObject();
+            objectdetail.put("fstockno", "");
+            objectdetail.put("fstockname", "");
+            objectdetail.put("fmodel", "");
+            objectdetail.put("fitemname", "");
+            objectdetail.put("fbatchno", "");
+            objectdetail.put("fitemclsnum", "");
+            objectdetail.put("fitemnos", fitemnos);
+            objectdetail.put("pagerows", pagerows);
+            objectdetail.put("pagenum", pagenum);
+            object.put("access_token","basicDrp");
+            object.put("classname","Icinvbal");
+            object.put("method","queryPageOfBatch");
+            object.put("content",objectdetail);
+
+            HashMap<String, String> map = new HashMap<>();
+            map.put("content-Type", "application/json");
+            String result = new WebRequest().doPost(object.toString(), "http://124.71.196.182:8001/rest/ws_v2/basicDrp", map);
+            JSONObject resultobject = JSONObject.parseObject(result);
+            if(resultobject.getString("errcode").equals("0")){
+                return resultobject.getJSONObject("results").getJSONArray("list");
+            }else {
+                return new JSONArray();
+            }
+
+        }
+    }
 
     /**
      * 创建Erp发货单