Browse Source

Merge remote-tracking branch 'origin/develop' into develop

沈静伟 1 year ago
parent
commit
e943ef2a47

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

@@ -5438,6 +5438,10 @@ public class R {
         public static class v1 {
         }
     }
+    public static class ID2024020201095102 {
+        public static class v1 {
+        }
+    }
 }
 
 

+ 29 - 6
src/custom/restcontroller/webmanage/sale/order/OrderItems.java

@@ -202,6 +202,32 @@ public class OrderItems extends Controller {
         return getSucReturnObject().toString();
     }
 
+    @API(title = "查询订单重复商品", apiversion = R.ID2024020201095102.v1.class)
+    public String get() throws YosException {
+        Long sa_orderid = content.getLongValue("sa_orderid");
+        JSONArray items = content.getJSONArray("items");
+
+        OrderItemsHelper orderItemsHelper = new OrderItemsHelper(this);
+        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 + "'");
+            rows.addAll(temprows);
+        }
+        Rows orderRows = beans.order.Order.getOrderRows(this, sa_orderid);
+        String type = orderRows.get(0).getString("type");
+        Row resRow = new Row();
+        resRow.put("items", rows);
+
+        resRow.put("isrepeat", beans.order.Order.getDefaultIsRepeatValue(siteid, type));
+
+
+        return getSucReturnObject().setData(resRow).toString();
+
+    }
+
 
     /**
      * 更新订单扣款信息
@@ -608,7 +634,7 @@ public class OrderItems extends Controller {
         RowsMap itempriceRowsMap = itempriceRows.toRowsMap("itemno");
 
         JSONArray jsonArray = new JSONArray();
-        if(siteid.equalsIgnoreCase("lsa")){
+        if (siteid.equalsIgnoreCase("lsa")) {
             JSONObject object = new JSONObject();
             object.put("classname", "getIcinvbal");
             object.put("method", "getMsg");
@@ -631,7 +657,7 @@ public class OrderItems extends Controller {
                     }
                 }
             }
-        }else{
+        } else {
             ERPDocking erpDocking = new ERPDocking(siteid);
             if (rows.toJsonArray("itemno").size() != 0) {
                 if (Parameter.get("system.ccerp_dockswitch").equalsIgnoreCase("true")) {
@@ -654,9 +680,6 @@ public class OrderItems extends Controller {
         }
 
 
-
-
-
         //查询附件
         RowsMap attinfoRowsMap = getAttachmentUrl("plm_item", ids);
         for (Row row : rows) {
@@ -1118,7 +1141,7 @@ public class OrderItems extends Controller {
                 sqlFactory.addParameter_SQL("where2", where2);
                 break;
         }
-        if(iswuliao){
+        if (iswuliao) {
             where.append(" and t1.iswuliao ='1' ");
         }
         sqlFactory.addParameter("siteid", siteid);

+ 7 - 5
src/custom/restcontroller/webmanage/sale/order/OrderItemsHelper.java

@@ -479,11 +479,13 @@ public class OrderItemsHelper extends BaseClass {
             }
 
         }
-        String size = "尺寸:" + length + "×" + width;
-        if (str.isEmpty()) {
-            str = size;
-        } else {
-            str = str + ";" + size;
+        if (!length.equals("0") && !width.equals("0")) {
+            String size = "尺寸:" + length + "×" + width;
+            if (str.isEmpty()) {
+                str = size;
+            } else {
+                str = str + ";" + size;
+            }
         }
         return str;
     }