hu 4 месяцев назад
Родитель
Сommit
e15dabf43b

+ 13 - 0
src/custom/restcontroller/webmanage/sale/warrantycard/warrantycard.java

@@ -81,6 +81,13 @@ public class warrantycard extends Controller {
         Rows ywyRows = dbConnect.runSqlQuery(sqlFactory);
         RowsMap ywyRowsMap = ywyRows.toRowsMap("sa_saleareaid");
 
+        // 默认商品图片
+        Rows defaultImageRows = beans.Item.Item.getItemdefaultImage(this);
+        // 附件
+        ArrayList<Long> ids = rows.toArrayList("itemid", new ArrayList<>());
+        RowsMap attRowsMap = getAttachmentUrl("plm_item", ids);
+
+
         for (Row row : rows) {
             long sys_enterpriseid = row.getLong("sys_enterpriseid");
             if (tradefieldRowsMap.containsKey(String.valueOf(sys_enterpriseid))) {
@@ -89,6 +96,12 @@ public class warrantycard extends Controller {
                     row.put("qyjl", ywyRowsMap.get(String.valueOf(sa_saleareaid)));
                 }
             }
+            if (attRowsMap.getOrDefault(row.getString("itemid"), new Rows()).isNotEmpty()) {
+                row.put("attinfos", attRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
+            } else {
+                row.put("attinfos", defaultImageRows);
+            }
+
         }
         return getSucReturnObject().setData(rows).toString();
     }