|
|
@@ -60,19 +60,16 @@ public class GoodsDonController {
|
|
|
.orderBy(GoodsDon::getId).asc()
|
|
|
.build()
|
|
|
);
|
|
|
- Integer virtual = 2000;
|
|
|
- search.getDataList().forEach(goods->{
|
|
|
+ search.getDataList().forEach(goods -> {
|
|
|
GoodsDonSku goodsDonSku = goodsDonSkuMapper.selectOne(Wrappers.lambdaQuery(GoodsDonSku.class).eq(GoodsDonSku::getGoodsId, goods.getId())
|
|
|
.eq(GoodsDonSku::getStatus, true)
|
|
|
.orderByAsc(GoodsDonSku::getPrice)
|
|
|
.last("limit 1")
|
|
|
.select(GoodsDonSku::getPrice));
|
|
|
goods.setPrice(goodsDonSku.getPrice());
|
|
|
- if (goods.getType() != 3 & goods.getId() != 17 && goods.getId() != 23 && goods.getId() != 24) {
|
|
|
- goods.setSoldNum(virtual + orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
- .eq(OrderDon::getGoodsId, goods.getId())
|
|
|
- .notIn(OrderDon::getStatus, Constant.noOrderStatus)));
|
|
|
- }
|
|
|
+ goods.setSoldNum(goods.getVirtualSold() + orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
+ .eq(OrderDon::getGoodsId, goods.getId())
|
|
|
+ .notIn(OrderDon::getStatus, Constant.noOrderStatus)));
|
|
|
});
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
}
|
|
|
@@ -90,7 +87,6 @@ public class GoodsDonController {
|
|
|
.orderBy(GoodsDonPopularizeView::getId).asc()
|
|
|
.build());
|
|
|
DateTime now = DateTime.now();
|
|
|
- Integer randomNum = 2000;
|
|
|
search.getDataList().forEach(data -> {
|
|
|
GoodsDonSku goodsDonSku = goodsDonSkuMapper.selectOne(Wrappers.lambdaQuery(GoodsDonSku.class)
|
|
|
.eq(GoodsDonSku::getGoodsId, data.getId())
|
|
|
@@ -103,9 +99,7 @@ public class GoodsDonController {
|
|
|
});
|
|
|
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).build()));
|
|
|
- if (data.getId() != 17 && data.getId() != 23 && data.getId() != 24) {
|
|
|
- data.setSold(data.getSold() + randomNum);
|
|
|
- }
|
|
|
+ data.setSold(data.getSold() + data.getVirtualSold());
|
|
|
SearchResult<OrderComment> orderComments = beanSearcher.search(OrderComment.class,
|
|
|
MapUtils.builder().field(OrderComment::getGoodsId, data.getId())
|
|
|
.orderBy(OrderComment::getId).desc()
|
|
|
@@ -121,7 +115,7 @@ public class GoodsDonController {
|
|
|
.last("limit 1"));
|
|
|
StringBuilder notifyMsg = new StringBuilder();
|
|
|
if (orderDon == null) {
|
|
|
- notifyMsg.append("2分钟");
|
|
|
+ notifyMsg.append("点击购买立即上车");
|
|
|
} else {
|
|
|
Date payTime = orderDon.getPayTime();
|
|
|
Date startTime = payTime != null ? payTime : orderDon.getCreatedTime();
|