eganwu 2 лет назад
Родитель
Сommit
1d8165f878
1 измененных файлов с 8 добавлено и 2 удалено
  1. 8 2
      src/custom/restcontroller/webmanage/sale/order/OrderItems.java

+ 8 - 2
src/custom/restcontroller/webmanage/sale/order/OrderItems.java

@@ -208,12 +208,18 @@ public class OrderItems extends Controller {
         JSONArray items = content.getJSONArray("items");
 
         OrderItemsHelper orderItemsHelper = new OrderItemsHelper(this);
+        //批量查询商品信息
+        RowsMap itemRowsMap = orderItemsHelper.getItemRowsMap(items);
         Rows rows = new Rows();
         for (Object obj : items) {
             JSONObject item = (JSONObject) obj;
             Long itemid = item.getLongValue("itemid");
-            String customproperties = orderItemsHelper.getcustomproperties(item);
-            Rows temprows = dbConnect.runSqlQuery("SELECT itemname from  sa_orderitems WHERE sa_orderid=" + sa_orderid + " and siteid='" + siteid + "' and itemid=" + itemid + " and ifnull(customproperties,'')='" + customproperties + "'");
+            JSONArray customproperties = new JSONArray();
+            customproperties = orderItemsHelper.getCustomProperties(itemRowsMap, item);
+
+            String custompropertie=customproperties.toJSONString().replace("[", "").replace("]", "").replace("\"", "");
+
+            Rows temprows = dbConnect.runSqlQuery("SELECT itemname from  sa_orderitems WHERE sa_orderid=" + sa_orderid + " and siteid='" + siteid + "' and itemid=" + itemid + " and ifnull(customproperties,'')='" + custompropertie + "'");
             rows.addAll(temprows);
         }
         Rows orderRows = beans.order.Order.getOrderRows(this, sa_orderid);