فهرست منبع

商品库存查询接口更新

hu 1 سال پیش
والد
کامیت
a5f2bff36a
1فایلهای تغییر یافته به همراه18 افزوده شده و 0 حذف شده
  1. 18 0
      src/custom/restcontroller/webmanage/sale/item/Item.java

+ 18 - 0
src/custom/restcontroller/webmanage/sale/item/Item.java

@@ -386,6 +386,24 @@ public class Item extends Controller {
 //                row.put("invbal_qty",0);
 //            }
 //        }
+        ERPDocking erpDocking = new ERPDocking();
+        JSONArray jsonArray = new JSONArray();
+        if (Parameter.get("system.ccerp_dockswitch").equalsIgnoreCase("true") && siteid.equalsIgnoreCase("ccyosg")) {
+            if (!rows.toJsonArray("itemno").isEmpty()) {
+                jsonArray = erpDocking.getErpIcinvbalRows(200000, 1, rows.toJsonArray("itemno"));
+            }
+        }
+        if (!jsonArray.isEmpty()) {
+            for (Object object : jsonArray) {
+                JSONObject jsonObject = (JSONObject) object;
+                if (!rows.isEmpty()) {
+                    if (rows.get(0).getString("itemno").equals(jsonObject.getString("fitemno"))) {
+                        rows.get(0).put("invbal_qty", jsonObject.getBigDecimalValue("fqty"));
+                    }
+                }
+
+            }
+        }
         return getSucReturnObject().setData(rows.isNotEmpty() ? rows.get(0) : new Row()).toString();
     }