|
|
@@ -243,7 +243,11 @@ public class itemgroup extends Controller {
|
|
|
row.put("cover", coverRows.get(0).getString("url"));
|
|
|
}
|
|
|
|
|
|
- row.put("attinfos", attRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
|
|
|
+ if ((attRowsMap.getOrDefault(row.getString("itemid"), new Rows())).isEmpty()) {
|
|
|
+ row.put("attinfos", defaultImageRows);
|
|
|
+ } else {
|
|
|
+ row.put("attinfos", attRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
|
|
|
+ }
|
|
|
row.put("itemclass", itemclassRowsMap.get(row.getString("itemid")));
|
|
|
}
|
|
|
|
|
|
@@ -885,6 +889,8 @@ public class itemgroup extends Controller {
|
|
|
|
|
|
ArrayList<Long> ids = itemrows.toArrayList("itemid", new ArrayList<>());
|
|
|
|
|
|
+ //默认商品图片
|
|
|
+ Rows defaultImageRows = getAttachmentUrl("system", (long) 1, "defaultImage");
|
|
|
// 封面cover
|
|
|
RowsMap coverRowsMap = getAttachmentUrl("plm_item", ids, "cover");
|
|
|
// 附件
|
|
|
@@ -912,7 +918,11 @@ public class itemgroup extends Controller {
|
|
|
row.put("cover", coverRows.get(0).getString("url"));
|
|
|
}
|
|
|
|
|
|
- row.put("attinfos", attRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
|
|
|
+ if ((attRowsMap.getOrDefault(row.getString("itemid"), new Rows())).isEmpty()) {
|
|
|
+ row.put("attinfos", defaultImageRows);
|
|
|
+ } else {
|
|
|
+ row.put("attinfos", attRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
|
|
|
+ }
|
|
|
row.put("itemclass", itemclassRowsMap.get(row.getString("itemid")));
|
|
|
row.put("tradefield", tradefieldRowsMap.get(row.getString("itemid")));
|
|
|
row.put("brand", brandRowsMap.get(row.getString("itemid")));
|