记得上下班打卡 | git大法好,push需谨慎

Commit 6d7b14a2 authored by wangyifan's avatar wangyifan

Merge branch 'dev-wyf-v1.8.0-goblin' into test

parents ab04f0a8 7c22d7af
...@@ -66,8 +66,11 @@ public class GoblinStoreMgtArtistTopicDetailVo implements Serializable { ...@@ -66,8 +66,11 @@ public class GoblinStoreMgtArtistTopicDetailVo implements Serializable {
@ApiModelProperty("封面") @ApiModelProperty("封面")
private String coverPic; private String coverPic;
@ApiModelProperty("售价") @ApiModelProperty("价格区间MIN")
private BigDecimal sellPrice; private BigDecimal priceGe;
@ApiModelProperty("价格区间MAX")
private BigDecimal priceLe;
@ApiModelProperty("排序") @ApiModelProperty("排序")
private Integer sort; private Integer sort;
......
...@@ -39,6 +39,7 @@ public class GoblinArtistTopicVo implements Serializable { ...@@ -39,6 +39,7 @@ public class GoblinArtistTopicVo implements Serializable {
private Integer sort; private Integer sort;
private String name; private String name;
private String coverPic; private String coverPic;
private BigDecimal sellPrice; private BigDecimal priceGe;
private BigDecimal priceLe;
} }
} }
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
<li>专题状态:<select name="status"> <li>专题状态:<select name="status">
<option value="">全部</option> <option value="">全部</option>
<option value="0">待上架</option> <option value="0">待上架</option>
<option value="1">上架中</option> <option value="1">已上架</option>
<option value="2">已下架</option> <option value="2">已下架</option>
</select></li> </select></li>
<li>所属商家:<input type="text" name="storeName" placeholder="请输入商家名称"/></li> <li>所属商家:<input type="text" name="storeName" placeholder="请输入商家名称"/></li>
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
function statusHtml(v) { function statusHtml(v) {
if (v == 1) { if (v == 1) {
return '<span class="badge-status badge-status-success">上架中</span>'; return '<span class="badge-status badge-status-success">已上架</span>';
} else if (v == 0) { } else if (v == 0) {
return '<span class="badge-status badge-status-warning">待上架</span>'; return '<span class="badge-status badge-status-warning">待上架</span>';
} else { } else {
......
...@@ -386,13 +386,27 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer ...@@ -386,13 +386,27 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
} }
if (!CollectionUtils.isEmpty(topic.getGoods())) { if (!CollectionUtils.isEmpty(topic.getGoods())) {
Set<String> spuIds = topic.getGoods().stream()
.map(GoblinArtistTopicVo.GoodsItem::getSpuId)
.filter(StringUtils::isNotBlank)
.collect(Collectors.toSet());
Map<String, GoblinGoods> goodsMap = loadGoodsMapBySpuIds(spuIds);
for (GoblinArtistTopicVo.GoodsItem goods : topic.getGoods()) { for (GoblinArtistTopicVo.GoodsItem goods : topic.getGoods()) {
GoblinStoreMgtArtistTopicDetailVo.GoodsItem item = new GoblinStoreMgtArtistTopicDetailVo.GoodsItem(); GoblinStoreMgtArtistTopicDetailVo.GoodsItem item = new GoblinStoreMgtArtistTopicDetailVo.GoodsItem();
item.setSpuId(goods.getSpuId()); item.setSpuId(goods.getSpuId());
item.setSort(goods.getSort()); item.setSort(goods.getSort());
item.setName(goods.getName()); item.setName(goods.getName());
item.setCoverPic(goods.getCoverPic()); item.setCoverPic(goods.getCoverPic());
item.setSellPrice(goods.getSellPrice()); GoblinGoods dbGoods = goodsMap.get(goods.getSpuId());
if (dbGoods != null) {
item.setName(dbGoods.getName());
item.setCoverPic(dbGoods.getCoverPic());
item.setPriceGe(dbGoods.getPriceGe());
item.setPriceLe(dbGoods.getPriceLe());
} else {
item.setPriceGe(goods.getPriceGe());
item.setPriceLe(goods.getPriceLe());
}
vo.getGoods().add(item); vo.getGoods().add(item);
} }
} }
...@@ -710,7 +724,13 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer ...@@ -710,7 +724,13 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
} }
Set<String> spuIds = goods.stream().map(GoblinStoreMgtArtistTopicGoodsItemParams::getSpuId) Set<String> spuIds = goods.stream().map(GoblinStoreMgtArtistTopicGoodsItemParams::getSpuId)
.filter(StringUtils::isNotBlank).collect(Collectors.toSet()); .filter(StringUtils::isNotBlank).collect(Collectors.toSet());
if (spuIds.isEmpty()) return Collections.emptyMap(); return loadGoodsMapBySpuIds(spuIds);
}
private Map<String, GoblinGoods> loadGoodsMapBySpuIds(Set<String> spuIds) {
if (CollectionUtils.isEmpty(spuIds)) {
return Collections.emptyMap();
}
List<GoblinGoods> list = goodsMapper.selectList(new LambdaQueryWrapper<GoblinGoods>() List<GoblinGoods> list = goodsMapper.selectList(new LambdaQueryWrapper<GoblinGoods>()
.in(GoblinGoods::getSpuId, spuIds)); .in(GoblinGoods::getSpuId, spuIds));
Map<String, GoblinGoods> map = new HashMap<>(); Map<String, GoblinGoods> map = new HashMap<>();
...@@ -737,7 +757,8 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer ...@@ -737,7 +757,8 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
if (goods != null) { if (goods != null) {
item.setName(goods.getName()); item.setName(goods.getName());
item.setCoverPic(goods.getCoverPic()); item.setCoverPic(goods.getCoverPic());
item.setSellPrice(goods.getSellPrice()); item.setPriceGe(goods.getPriceGe());
item.setPriceLe(goods.getPriceLe());
} }
items.add(item); items.add(item);
index++; index++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment