|
@@ -592,28 +592,46 @@ public class OrderItems extends Controller {
|
|
|
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
|
|
|
- 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");
|
|
|
- if (isJSONArray(result)) {
|
|
|
- jsonArray = JSONArray.parseArray(result);
|
|
|
+// 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");
|
|
|
+// if (isJSONArray(result)) {
|
|
|
+// jsonArray = JSONArray.parseArray(result);
|
|
|
+// }
|
|
|
+// for (Object obj : jsonArray) {
|
|
|
+// JSONObject jsonObject = (JSONObject) obj;
|
|
|
+// if (rowsMap.containsKey(jsonObject.getString("fitemno"))) {
|
|
|
+// if (rowsMap.get(jsonObject.getString("fitemno")).isNotEmpty()) {
|
|
|
+// rowsMap.get(jsonObject.getString("fitemno")).get(0).put("invbalqty", jsonObject.getBigDecimalValue("FQty"));
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+ ERPDocking erpDocking = new ERPDocking();
|
|
|
+ if (rows.toJsonArray("itemno").size() != 0) {
|
|
|
+ if (Parameter.get("system.ccerp_dockswitch").equalsIgnoreCase("true") && siteid.equalsIgnoreCase("ccyosg")) {
|
|
|
+ jsonArray = erpDocking.getErpIcinvbalRows(1000, 1, rows.toJsonArray("itemno"));
|
|
|
+ }
|
|
|
}
|
|
|
- for (Object obj : jsonArray) {
|
|
|
- JSONObject jsonObject = (JSONObject) obj;
|
|
|
- if (rowsMap.containsKey(jsonObject.getString("fitemno"))) {
|
|
|
- if (rowsMap.get(jsonObject.getString("fitemno")).isNotEmpty()) {
|
|
|
- rowsMap.get(jsonObject.getString("fitemno")).get(0).put("invbalqty", jsonObject.getBigDecimalValue("FQty"));
|
|
|
+ if (!jsonArray.isEmpty()) {
|
|
|
+ for (Object object : jsonArray) {
|
|
|
+ JSONObject jsonObject = (JSONObject) object;
|
|
|
+ if (rowsMap.containsKey(jsonObject.getString("fitemno"))) {
|
|
|
+ if (rowsMap.get(jsonObject.getString("fitemno")).isNotEmpty()) {
|
|
|
+ rowsMap.get(jsonObject.getString("fitemno")).get(0).put("invbalqty", jsonObject.getBigDecimalValue("fqty"));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
//查询附件
|
|
|
RowsMap attinfoRowsMap = getAttachmentUrl("plm_item", ids);
|
|
|
for (Row row : rows) {
|