|
|
@@ -76,7 +76,7 @@ public class GoodsDonController {
|
|
|
* 推广未登录,虚拟商品列表
|
|
|
*/
|
|
|
@GetMapping("/get/popularize")
|
|
|
- public Result<SearchResult<GoodsDonPopularizeView>> getPopularizeVipGoods() {
|
|
|
+ public Result<SearchResult<GoodsDonPopularizeView>> getPopularizeVipGoods(Boolean isHide) {
|
|
|
SearchResult<GoodsDonPopularizeView> search = beanSearcher.search(GoodsDonPopularizeView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
|
.field(GoodsDonPopularizeView::getStatus, true)
|
|
|
.field(GoodsDonPopularizeView::getDeleted, true)
|
|
|
@@ -88,7 +88,12 @@ public class GoodsDonController {
|
|
|
LinkedList<GoodsDonPopularizeView> collect = new LinkedList<>();
|
|
|
search.getDataList().forEach(data -> {
|
|
|
data.setSpecs(beanSearcher.searchFirst(GoodsDonSpec.class, MapUtils.builder().field(GoodsDonSpec::getGoodsId, data.getId()).build()));
|
|
|
- data.setSkuList(beanSearcher.searchAll(GoodsDonSku.class, MapUtils.builder().field(GoodsDonSku::getGoodsId, data.getId()).field(GoodsDonSku::getStatus, true).orderBy(GoodsDonSku::getPrice).asc().build()));
|
|
|
+ data.setSkuList(beanSearcher.searchAll(GoodsDonSku.class, MapUtils.builder()
|
|
|
+ .field(GoodsDonSku::getGoodsId, data.getId())
|
|
|
+ .field(GoodsDonSku::getStatus, true)
|
|
|
+ .field(GoodsDonFrontSkuView::getIsHide, isHide)
|
|
|
+ .orderBy(GoodsDonSku::getPrice).asc()
|
|
|
+ .build()));
|
|
|
Integer sold = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
.eq(OrderDon::getGoodsId, data.getId()).notIn(OrderDon::getStatus, Constant.noOrderStatus));
|
|
|
data.setSold(sold + data.getVirtualSold());
|
|
|
@@ -98,8 +103,8 @@ public class GoodsDonController {
|
|
|
.build());
|
|
|
|
|
|
Optional.ofNullable(data.getSkuList()).ifPresent(skuList -> {
|
|
|
- GoodsDonSku goodsDonSku = skuList.get(0);
|
|
|
- if (goodsDonSku != null) {
|
|
|
+ if (skuList.size() > 0) {
|
|
|
+ GoodsDonSku goodsDonSku = skuList.get(0);
|
|
|
data.setPrice(goodsDonSku.getPrice());
|
|
|
data.setMonths(goodsDonSku.getMonths());
|
|
|
}
|
|
|
@@ -155,7 +160,7 @@ public class GoodsDonController {
|
|
|
* 官网首页 平台列表
|
|
|
*/
|
|
|
@GetMapping("/get/list")
|
|
|
- public Result<SearchResult<GoodsFrontListView>> getGoodsList() {
|
|
|
+ public Result<SearchResult<GoodsFrontListView>> getGoodsList(Boolean isHide) {
|
|
|
SearchResult<GoodsFrontListView> search = beanSearcher.search(GoodsFrontListView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
|
.field(GoodsFrontListView::getStatus, true)
|
|
|
.field(GoodsFrontListView::getDeleted, true)
|
|
|
@@ -167,14 +172,20 @@ public class GoodsDonController {
|
|
|
LinkedList<GoodsFrontListView> collect = new LinkedList<>();
|
|
|
search.getDataList().forEach(data -> {
|
|
|
data.setSpecs(beanSearcher.searchFirst(GoodsDonSpec.class, MapUtils.builder().field(GoodsDonSpec::getGoodsId, data.getId()).build()));
|
|
|
- data.setSkuList(beanSearcher.searchAll(GoodsDonFrontSkuView.class, MapUtils.builder().field(GoodsDonFrontSkuView::getGoodsId, data.getId()).field(GoodsDonFrontSkuView::getStatus, true).orderBy(GoodsDonFrontSkuView::getPrice).asc().build()));
|
|
|
+ data.setSkuList(beanSearcher.searchAll(GoodsDonFrontSkuView.class, MapUtils.builder()
|
|
|
+ .field(GoodsDonFrontSkuView::getGoodsId, data.getId())
|
|
|
+ .field(GoodsDonFrontSkuView::getStatus, true)
|
|
|
+ .field(GoodsDonFrontSkuView::getIsHide, isHide)
|
|
|
+ .orderBy(GoodsDonFrontSkuView::getPrice)
|
|
|
+ .asc()
|
|
|
+ .build()));
|
|
|
Integer sold = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
.eq(OrderDon::getGoodsId, data.getId()).notIn(OrderDon::getStatus, Constant.noOrderStatus));
|
|
|
data.setSold(sold + data.getVirtualSold());
|
|
|
|
|
|
Optional.ofNullable(data.getSkuList()).ifPresent(skuList -> {
|
|
|
- GoodsDonFrontSkuView donFrontSkuView = skuList.get(0);
|
|
|
- if (donFrontSkuView != null) {
|
|
|
+ if (skuList.size() > 0) {
|
|
|
+ GoodsDonFrontSkuView donFrontSkuView = skuList.get(0);
|
|
|
data.setPrice(donFrontSkuView.getPrice());
|
|
|
data.setMonths(donFrontSkuView.getMonths());
|
|
|
}
|