Просмотр исходного кода

查询商品详情查询库存去除及添加查询商品库存接口

hu 2 лет назад
Родитель
Сommit
55bc8835d9
2 измененных файлов с 38 добавлено и 2 удалено
  1. 4 0
      src/custom/restcontroller/R.java
  2. 34 2
      src/custom/restcontroller/webmanage/sale/item/Item.java

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

@@ -5245,6 +5245,10 @@ public class R {
         public static class v1 {
         public static class v1 {
         }
         }
     }
     }
+    public static class ID20230913154803 {
+        public static class v1 {
+        }
+    }
 
 
 
 
 }
 }

+ 34 - 2
src/custom/restcontroller/webmanage/sale/item/Item.java

@@ -328,8 +328,9 @@ public class Item extends Controller {
         object.put("content", content);
         object.put("content", content);
 
 
          WebRequest request = new WebRequest();
          WebRequest request = new WebRequest();
-        String result = request.doPost(object.toString(),
-                "http://60.190.151.198:8089/BYESB/jaxrs/webclientrest");
+         String result ="";
+//        String result = request.doPost(object.toString(),
+//                "http://60.190.151.198:8089/BYESB/jaxrs/webclientrest");
         for (Row row : rows) {
         for (Row row : rows) {
             JSONArray jsonArrayResult = new JSONArray();
             JSONArray jsonArrayResult = new JSONArray();
             if(isJSONArray(result)){
             if(isJSONArray(result)){
@@ -353,6 +354,37 @@ public class Item extends Controller {
         return getSucReturnObject().setData(rows.isNotEmpty() ? rows.get(0) : new Row()).toString();
         return getSucReturnObject().setData(rows.isNotEmpty() ? rows.get(0) : new Row()).toString();
     }
     }
 
 
+    @API(title = "货品档案库存查询", apiversion = R.ID20230913154803.v1.class)
+    public String queryInvbalQty() throws YosException {
+
+        Long itemid = content.getLong("itemid");
+        Rows rows = dbConnect.runSqlQuery("select itemno from plm_item where siteid='"+siteid+"' and itemid="+itemid);
+
+        JSONObject object = new JSONObject();
+        object.put("classname", "getIcinvbal");
+        object.put("method", "getMsg");
+
+        JSONObject content = new JSONObject();
+        content.put("fitemnos",  rows.toJsonArray("itemno"));
+        object.put("content", content);
+
+        WebRequest request = new WebRequest();
+        String result = request.doPost(object.toString(),
+                "http://60.190.151.198:8089/BYESB/jaxrs/webclientrest");
+        for (Row row : rows) {
+            JSONArray jsonArrayResult = new JSONArray();
+            if(isJSONArray(result)){
+                jsonArrayResult = JSONArray.parseArray(result);
+            }
+            if(!jsonArrayResult.isEmpty()){
+                row.put("invbal_qty",((JSONObject)jsonArrayResult.get(0)).getBigDecimal("FQty"));
+            }else{
+                row.put("invbal_qty",0);
+            }
+        }
+        return getSucReturnObject().setData(rows.isNotEmpty() ? rows.get(0) : new Row()).toString();
+    }
+
     @API(title = "货品档案列表", apiversion = R.ID20220923140602.v1.class)
     @API(title = "货品档案列表", apiversion = R.ID20220923140602.v1.class)
     @CACHEING
     @CACHEING
     public String queryList() throws YosException, IOException {
     public String queryList() throws YosException, IOException {