|
@@ -243,7 +243,7 @@ public class GoodsDonController {
|
|
|
* h5 银河首页平台展示
|
|
* h5 银河首页平台展示
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/get/homePage")
|
|
@GetMapping("/get/homePage")
|
|
|
- public Result<List<GoodsHomePageView>> getGoodsHomePage(Boolean isLogin) {
|
|
|
|
|
|
|
+ public Result<List<GoodsFrontListView>> getGoodsHomePage(Boolean isLogin) {
|
|
|
List<Long> filter_goodsIds = getFilterGoodsIds();
|
|
List<Long> filter_goodsIds = getFilterGoodsIds();
|
|
|
String h5CacheKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "H5";
|
|
String h5CacheKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "H5";
|
|
|
if (CollUtil.isNotEmpty(filter_goodsIds)) {
|
|
if (CollUtil.isNotEmpty(filter_goodsIds)) {
|
|
@@ -257,10 +257,40 @@ public class GoodsDonController {
|
|
|
Object value = redisService.get(h5CacheKey);
|
|
Object value = redisService.get(h5CacheKey);
|
|
|
if (value != null) {
|
|
if (value != null) {
|
|
|
try {
|
|
try {
|
|
|
- List<GoodsHomePageView> list = Jsons.parseObject(value, List.class);
|
|
|
|
|
|
|
+ List<GoodsFrontListView> list = Jsons.parseObject(value, List.class);
|
|
|
if (CollUtil.isNotEmpty(list)) {
|
|
if (CollUtil.isNotEmpty(list)) {
|
|
|
if (fUid != null) {
|
|
if (fUid != null) {
|
|
|
list.forEach(data -> {
|
|
list.forEach(data -> {
|
|
|
|
|
+ if (data.getIsSp()) {
|
|
|
|
|
+ //查找所有特定规格最小价格 满足条件
|
|
|
|
|
+ String specificGoodsKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "specific:" + data.getId();
|
|
|
|
|
+ Object speciObj = redisService.get(specificGoodsKey);
|
|
|
|
|
+ List<GoodsDonSku> specificSkus = null;
|
|
|
|
|
+ if (speciObj != null) {
|
|
|
|
|
+ specificSkus = Jsons.parseList(speciObj, GoodsDonSku.class);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ specificSkus = goodsDonSkuMapper.selectList(
|
|
|
|
|
+ Wrappers.lambdaQuery(GoodsDonSku.class)
|
|
|
|
|
+ .eq(GoodsDonSku::getGoodsId, data.getId())
|
|
|
|
|
+ .eq(GoodsDonSku::getStatus, true)
|
|
|
|
|
+ .gt(GoodsDonSku::getSpecificPrice, 0));
|
|
|
|
|
+ redisService.setNx(specificGoodsKey, specificSkus, RedisService.key.YH_HOME_PAGHE_CACHE.getTimeout());
|
|
|
|
|
+ }
|
|
|
|
|
+ specificSkus.forEach(specificSku -> {
|
|
|
|
|
+ String specificGoodsIdsStr = specificSku.getSpecificGoodsIds();
|
|
|
|
|
+ if (isPaySpecificGoodsIds(specificGoodsIdsStr, fUid)) {
|
|
|
|
|
+ BigDecimal specificPrice = data.getSpecificPrice();
|
|
|
|
|
+ BigDecimal skuSpecificPrice = specificSku.getSpecificPrice();
|
|
|
|
|
+ if (specificPrice == null) {
|
|
|
|
|
+ data.setSpecificPrice(skuSpecificPrice);
|
|
|
|
|
+ data.setMonths(specificSku.getMonths());
|
|
|
|
|
+ } else if (specificPrice.compareTo(skuSpecificPrice) > 0) {
|
|
|
|
|
+ data.setSpecificPrice(skuSpecificPrice);
|
|
|
|
|
+ data.setMonths(specificSku.getMonths());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
String specificGoodsIdsStr = data.getSpecificGoodsIds();
|
|
String specificGoodsIdsStr = data.getSpecificGoodsIds();
|
|
|
if (isPaySpecificGoodsIds(specificGoodsIdsStr, fUid)) {
|
|
if (isPaySpecificGoodsIds(specificGoodsIdsStr, fUid)) {
|
|
|
data.setSpecificGoodsIds(null);
|
|
data.setSpecificGoodsIds(null);
|
|
@@ -277,7 +307,7 @@ public class GoodsDonController {
|
|
|
if (CollUtil.isNotEmpty(filter_goodsIds)) {
|
|
if (CollUtil.isNotEmpty(filter_goodsIds)) {
|
|
|
builder.field(GoodsFrontListView::getId, filter_goodsIds).op(Operator.NotIn);
|
|
builder.field(GoodsFrontListView::getId, filter_goodsIds).op(Operator.NotIn);
|
|
|
}
|
|
}
|
|
|
- List<GoodsHomePageView> dataList = beanSearcher.searchAll(GoodsHomePageView.class, builder.build());
|
|
|
|
|
|
|
+ List<GoodsFrontListView> dataList = beanSearcher.searchAll(GoodsFrontListView.class, builder.build());
|
|
|
DateTime now = DateTime.now();
|
|
DateTime now = DateTime.now();
|
|
|
dataList.forEach(data -> {
|
|
dataList.forEach(data -> {
|
|
|
Integer sold = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
|
|
Integer sold = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
|