Преглед изворни кода

经销商序列号新增客户信息

hu пре 4 месеци
родитељ
комит
487c3e7a1d
1 измењених фајлова са 22 додато и 0 уклоњено
  1. 22 0
      src/custom/restcontroller/webmanage/sale/serviceorder/serviceorder.java

+ 22 - 0
src/custom/restcontroller/webmanage/sale/serviceorder/serviceorder.java

@@ -250,12 +250,34 @@ public class serviceorder extends Controller {
         ArrayList<Long> ids = rows.toArrayList("itemid", new ArrayList<>());
         RowsMap attRowsMap = getAttachmentUrl("plm_item", ids);
 
+        RowsMap warrantycardRowsMap = SQLFactory.createQuerySQL(this, "sa_warrantycard", "sku","name", "phonenumber","address","sa_customersid","province","city","county").setWhere("sku", rows.toArrayList("sku")).query().toRowsMap("sku");
+
         for (Row row : rows) {
             if (attRowsMap.getOrDefault(row.getString("itemid"), new Rows()).isNotEmpty()) {
                 row.put("attinfos", attRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
             } else {
                 row.put("attinfos", defaultImageRows);
             }
+            String sku = row.getString("sku");
+            if (warrantycardRowsMap.containsKey(sku) && warrantycardRowsMap.get(sku).isNotEmpty()) {
+                Row warrantycardRow = warrantycardRowsMap.get(sku).get(0);
+                row.put("name", warrantycardRow.getString("name"));
+                row.put("phonenumber", warrantycardRow.getString("phonenumber"));
+                row.put("address", warrantycardRow.getString("address"));
+                row.put("sa_customersid", warrantycardRow.getLong("sa_customersid"));
+                row.put("province", warrantycardRow.getString("province"));
+                row.put("city", warrantycardRow.getString("city"));
+                row.put("county", warrantycardRow.getString("county"));
+            }else{
+                row.put("name", "");
+                row.put("phonenumber", "");
+                row.put("address","");
+                row.put("sa_customersid", "");
+                row.put("province", "");
+                row.put("city", "");
+                row.put("county", "");
+            }
+
         }
 
         return getSucReturnObject().setData(rows).toString();