|
|
@@ -31,10 +31,8 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Optional;
|
|
|
-import java.util.Set;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* @author chan
|
|
|
@@ -92,6 +90,7 @@ public class GoodsDonController {
|
|
|
* 推广未登录,虚拟商品列表
|
|
|
*/
|
|
|
@GetMapping("/get/popularize")
|
|
|
+ @Deprecated
|
|
|
public Result<SearchResult<GoodsDonPopularizeView>> getPopularizeVipGoods() {
|
|
|
SearchResult<GoodsDonPopularizeView> search = beanSearcher.search(GoodsDonPopularizeView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
|
.field(GoodsDonPopularizeView::getStatus, true)
|
|
|
@@ -175,11 +174,20 @@ public class GoodsDonController {
|
|
|
if (CollUtil.isNotEmpty(list)) {
|
|
|
if (fUid != null) {
|
|
|
list.forEach(data -> {
|
|
|
- String specificGoodsIdsStr = data.getSpecificGoodsIds();
|
|
|
- if (isPaySpecificGoodsIds(specificGoodsIdsStr, fUid)) {
|
|
|
- data.setSpecificGoodsIds(null);
|
|
|
- data.setSpecificPrice(null);
|
|
|
- }
|
|
|
+ data.getSkuList().forEach(sku -> {
|
|
|
+ String specificGoodsIdsStr = sku.getSpecificGoodsIds();
|
|
|
+ if (isPaySpecificGoodsIds(specificGoodsIdsStr, fUid)) {
|
|
|
+ BigDecimal specificPrice = data.getSpecificPrice();
|
|
|
+ BigDecimal skuSpecificPrice = sku.getSpecificPrice();
|
|
|
+ if (specificPrice == null) {
|
|
|
+ data.setSpecificPrice(skuSpecificPrice);
|
|
|
+ data.setMonths(sku.getMonths());
|
|
|
+ } else if (specificPrice.compareTo(skuSpecificPrice) > 0) {
|
|
|
+ data.setSpecificPrice(skuSpecificPrice);
|
|
|
+ data.setMonths(sku.getMonths());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(list);
|
|
|
@@ -201,6 +209,20 @@ public class GoodsDonController {
|
|
|
List<GoodsDiscountPlusPurchaseRelationFrontView> dpSkuViews = beanSearcher.searchAll(GoodsDiscountPlusPurchaseRelationFrontView.class, MapUtils.builder().field(GoodsDiscountPlusPurchaseRelationFrontView::getSkuId, sku.getId()).build());
|
|
|
sku.setDpSkuViews(dpSkuViews);
|
|
|
}
|
|
|
+ if (fUid != null) {
|
|
|
+ String specificGoodsIdsStr = sku.getSpecificGoodsIds();
|
|
|
+ if (isPaySpecificGoodsIds(specificGoodsIdsStr, fUid)) {
|
|
|
+ BigDecimal specificPrice = data.getSpecificPrice();
|
|
|
+ BigDecimal skuSpecificPrice = sku.getSpecificPrice();
|
|
|
+ if (specificPrice == null) {
|
|
|
+ data.setSpecificPrice(skuSpecificPrice);
|
|
|
+ data.setMonths(sku.getMonths());
|
|
|
+ } else if (specificPrice.compareTo(skuSpecificPrice) > 0) {
|
|
|
+ data.setSpecificPrice(skuSpecificPrice);
|
|
|
+ data.setMonths(sku.getMonths());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
Integer sold = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
|
|
|
.eq(OrderDon::getGoodsId, data.getId()).notIn(OrderDon::getStatus, Constant.noOrderStatus));
|
|
|
@@ -211,14 +233,7 @@ public class GoodsDonController {
|
|
|
.orderBy(OrderCommentFrontView::getId).desc()
|
|
|
.build());
|
|
|
data.setComments(comments);
|
|
|
- data.setNotifyMsg(getPayMsgTime(data.getId(), now, 1));
|
|
|
- if (fUid != null) {
|
|
|
- String specificGoodsIdsStr = data.getSpecificGoodsIds();
|
|
|
- if (isPaySpecificGoodsIds(specificGoodsIdsStr, fUid)) {
|
|
|
- data.setSpecificGoodsIds(null);
|
|
|
- data.setSpecificPrice(null);
|
|
|
- }
|
|
|
- }
|
|
|
+ data.setNotifyMsg(getPayMsgTime(data.getId(), now, 1));
|
|
|
});
|
|
|
redisService.setNx(pcCacheKey, list, RedisService.key.YH_HOME_PAGHE_CACHE.getTimeout());
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(list);
|