From e7bc4f312ad836305802d0e509be60c999806d8a Mon Sep 17 00:00:00 2001
From: sj <1304317391@qq.com>
Date: Thu, 13 Oct 2022 09:41:37 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=95=86=E5=93=81=E7=83=AD?=
=?UTF-8?q?=E6=A6=9C=E8=AE=BE=E7=BD=AE=EF=BC=8C=E5=B9=B6=E8=B4=AD=E7=89=A9?=
=?UTF-8?q?=E8=BD=A6=E6=8C=89=E5=93=81=E7=89=8C=E5=8C=BA=E5=88=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../rest/AppStoreHotListController.java | 45 ++++++
.../product/rest/AppStoreBrandController.java | 11 ++
.../modules/shop/rest/BxgIndexController.java | 2 +
.../activity/domain/YxStoreCoupon.java | 6 +-
.../activity/rest/StoreCouponController.java | 1 +
.../impl/YxStoreCouponUserServiceImpl.java | 1 -
.../service/impl/YxStoreCartServiceImpl.java | 64 +++++++--
.../evaluation/domain/YxEvaluation.java | 1 -
.../service/impl/YxEvaluationServiceImpl.java | 2 +-
.../hotList/domain/YxStoreHotList.java | 71 ++++++++++
.../rest/YxStoreHotListController.java | 89 ++++++++++++
.../service/YxStoreHotListService.java | 53 +++++++
.../service/dto/YxStoreHotListDto.java | 50 +++++++
.../dto/YxStoreHotListQueryCriteria.java | 19 +++
.../impl/YxStoreHotListServiceImpl.java | 130 ++++++++++++++++++
.../service/mapper/YxStoreHotListMapper.java | 22 +++
.../hotList/service/vo/YxStoreHotListVo.java | 37 +++++
.../impl/YxStoreProductServiceImpl.java | 26 +++-
.../yixiang/modules/product/vo/ProductVo.java | 5 +
.../impl/YxSystemGroupDataServiceImpl.java | 2 +-
.../modules/store/domain/YxStoreBrand.java | 4 +-
.../store/service/YxStoreBrandService.java | 5 +-
.../store/service/dto/YxStoreBrandDto.java | 3 +
.../service/impl/YxStoreBrandServiceImpl.java | 17 ++-
.../modules/store/vo/YxStoreBrandVo.java | 47 +++++++
.../main/java/co/yixiang/utils/BrandDTO.java | 7 +
.../java/co/yixiang/utils/HotListDTO.java | 30 ++++
27 files changed, 725 insertions(+), 25 deletions(-)
create mode 100644 zsw-bxg/src/main/java/co/yixiang/app/modules/hotList/rest/AppStoreHotListController.java
create mode 100644 zsw-bxg/src/main/java/co/yixiang/modules/hotList/domain/YxStoreHotList.java
create mode 100644 zsw-bxg/src/main/java/co/yixiang/modules/hotList/rest/YxStoreHotListController.java
create mode 100644 zsw-bxg/src/main/java/co/yixiang/modules/hotList/service/YxStoreHotListService.java
create mode 100644 zsw-bxg/src/main/java/co/yixiang/modules/hotList/service/dto/YxStoreHotListDto.java
create mode 100644 zsw-bxg/src/main/java/co/yixiang/modules/hotList/service/dto/YxStoreHotListQueryCriteria.java
create mode 100644 zsw-bxg/src/main/java/co/yixiang/modules/hotList/service/impl/YxStoreHotListServiceImpl.java
create mode 100644 zsw-bxg/src/main/java/co/yixiang/modules/hotList/service/mapper/YxStoreHotListMapper.java
create mode 100644 zsw-bxg/src/main/java/co/yixiang/modules/hotList/service/vo/YxStoreHotListVo.java
create mode 100644 zsw-bxg/src/main/java/co/yixiang/modules/store/vo/YxStoreBrandVo.java
create mode 100644 zsw-bxg/src/main/java/co/yixiang/utils/HotListDTO.java
diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/hotList/rest/AppStoreHotListController.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/hotList/rest/AppStoreHotListController.java
new file mode 100644
index 00000000..d9e318f3
--- /dev/null
+++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/hotList/rest/AppStoreHotListController.java
@@ -0,0 +1,45 @@
+package co.yixiang.app.modules.hotList.rest;
+
+import cn.iocoder.yudao.framework.common.pojo.ApiResult;
+import co.yixiang.annotation.AnonymousAccess;
+import co.yixiang.modules.evaluation.service.YxEvaluationService;
+import co.yixiang.modules.hotList.service.YxStoreHotListService;
+import co.yixiang.modules.hotList.service.dto.YxStoreHotListDto;
+import co.yixiang.utils.EvaluationDTO;
+import co.yixiang.utils.HotListDTO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ *
+ * 商品热榜控制器
+ *
+ *
+ * @author ssj
+ * @since 2022-10-8
+ */
+@Slf4j
+@RestController
+@Api(value = "商品热门榜单", tags = "商城:热门榜单")
+@RequiredArgsConstructor(onConstructor = @__(@Autowired))
+public class AppStoreHotListController {
+ private final YxStoreHotListService yxStoreHotListService;
+
+
+ /**
+ * 热门榜单列表
+ */
+ @AnonymousAccess
+ @GetMapping("/hotList")
+ @ApiOperation(value = "热门榜单列表",notes = "热门榜单")
+ public ApiResult> getYxStoreHotList(){
+ return ApiResult.ok(yxStoreHotListService.getList());
+ }
+}
diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/product/rest/AppStoreBrandController.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/product/rest/AppStoreBrandController.java
index 7e161226..e4e8c986 100644
--- a/zsw-bxg/src/main/java/co/yixiang/app/modules/product/rest/AppStoreBrandController.java
+++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/product/rest/AppStoreBrandController.java
@@ -10,6 +10,7 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@@ -39,4 +40,14 @@ public class AppStoreBrandController {
public ApiResult> getYxStoreBrandPageList(){
return ApiResult.ok(yxStoreBrandService.getList());
}
+
+ /**
+ * 商品品牌列表
+ */
+ @AnonymousAccess
+ @GetMapping("/brand/{id}")
+ @ApiOperation(value = "商品品牌详情",notes = "商品品牌详情")
+ public ApiResult getYxStoreBrandById(@PathVariable String id){
+ return ApiResult.ok(yxStoreBrandService.getYxStoreBrandById(id));
+ }
}
diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/shop/rest/BxgIndexController.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/shop/rest/BxgIndexController.java
index 82d5083c..7cb8d6ef 100644
--- a/zsw-bxg/src/main/java/co/yixiang/app/modules/shop/rest/BxgIndexController.java
+++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/shop/rest/BxgIndexController.java
@@ -93,6 +93,7 @@ public class BxgIndexController {
@ApiOperation(value = "首页数据",notes = "首页数据")
public ApiResult index(){
IndexVo indexVo = IndexVo.builder()
+ //首页图
.banner(systemGroupDataService.getDatas(ShopConstants.ZSW_HOME_BANNER))
.bastList(storeProductService.getList(1,6, ProductEnum.TYPE_1.getValue()))
.evaluationList(evaluationService.getList(1,5))
@@ -101,6 +102,7 @@ public class BxgIndexController {
.firstList(storeProductService.getList(1,6,ProductEnum.TYPE_3.getValue()))
.likeInfo(storeProductService.getList(1,80,ProductEnum.TYPE_2.getValue()))
.mapKey(systemConfigService.getData(ShopKeyUtils.getTengXunMapKey()))
+ //菜单
.menus(systemGroupDataService.getDatas(ShopConstants.ZSW_HOME_MENUS))
.roll(systemGroupDataService.getDatas(ShopConstants.ZSW_HOME_ROLL_NEWS))
.seckillList(storeSeckillService.getList(1, 4))
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/activity/domain/YxStoreCoupon.java b/zsw-bxg/src/main/java/co/yixiang/modules/activity/domain/YxStoreCoupon.java
index ff1e0937..5c925f04 100644
--- a/zsw-bxg/src/main/java/co/yixiang/modules/activity/domain/YxStoreCoupon.java
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/activity/domain/YxStoreCoupon.java
@@ -67,7 +67,7 @@ public class YxStoreCoupon extends BaseDomain {
// @ApiModelProperty(value = "优惠券有效期限(单位:天)")
// private Integer couponTime;
-// /** 优惠券有效期限(单位:天) */
+// /** 优惠券有效期限(单位:天) */
// @NotNull(message = "请输入有效期限")
// @ApiModelProperty(value = "优惠券有效期限(单位:天;几号到几号)")
// private Object useTime;
@@ -75,12 +75,12 @@ public class YxStoreCoupon extends BaseDomain {
/** 优惠券开始使用期限(单位:天) */
@NotNull(message = "请输入开始期限")
@ApiModelProperty(value = "优惠券使用期限(单位:天)")
- private Object useStartTime;
+ private String useStartTime;
/** 优惠券结束使用期限(单位:天) */
@NotNull(message = "请输入有效结束期限")
@ApiModelProperty(value = "优惠券失效期限(单位:天)")
- private Object useEndTime;
+ private String useEndTime;
/** 排序 */
@ApiModelProperty(value = "排序")
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreCouponController.java b/zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreCouponController.java
index 844d2930..6af063b0 100644
--- a/zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreCouponController.java
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/activity/rest/StoreCouponController.java
@@ -67,6 +67,7 @@ public class StoreCouponController {
return new ResponseEntity<>(yxStoreCouponService.save(resources),HttpStatus.CREATED);
}
+
@Log("修改")
@ApiOperation(value = "修改")
@PutMapping(value = "/yxStoreCoupon")
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponUserServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponUserServiceImpl.java
index 6e39a6cf..501370b5 100644
--- a/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponUserServiceImpl.java
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponUserServiceImpl.java
@@ -218,7 +218,6 @@ public class YxStoreCouponUserServiceImpl extends BaseServiceImpl implements YxStoreCartService {
+ @Autowired
+ private StoreProductMapper storeProductMapper;
+
+ @Autowired
+ private YxStoreBrandMapper yxStoreBrandMapper;
@Autowired
private IGenerator generator;
@@ -146,7 +149,7 @@ public class YxStoreCartServiceImpl extends BaseServiceImpl map = new LinkedHashMap<>();
- map.put("valid", valid);
- map.put("invalid", invalid);
+ //最终返回的有效商品的数组
+ ArrayList cartList=new ArrayList<>();
+ //获取不重复的品牌id数组
+ LinkedHashSet BrandIdList = new LinkedHashSet<>();
+ //有效商品
+ valid.forEach(item->{
+ YxStoreProduct storeProduct = storeProductMapper.selectById(item.getProductId());
+ BrandIdList.add(storeProduct.getBrandId());
+ });
+ //无效商品
+ invalid.forEach(item->{
+ YxStoreProduct storeProduct = storeProductMapper.selectById(item.getProductId());
+ BrandIdList.add(storeProduct.getBrandId());
+ });
+ BrandIdList.forEach(item->{
+ Map map1 = new LinkedHashMap<>();
+ YxStoreBrand yxStoreBrand=yxStoreBrandMapper.selectById(item);
+ Map list = new LinkedHashMap<>();
+ list.put("brandName",yxStoreBrand.getBrandName());
+ list.put("pic",yxStoreBrand.getPic());
+ map1.put("brand",list);
+ //对valid/invalid进行筛选,只要当前品牌下的商品
+ List validProductList = new ArrayList<>();
+ List invalidProductList = new ArrayList<>();
+ valid.forEach(item1->{
+ YxStoreProduct yxStoreProduct= storeProductMapper.selectById(item1.getProductId());;
+// //商品品牌id相等
+ if (item.equals(yxStoreProduct.getBrandId())){
+ validProductList.add(item1);
+ }
+ });
+ invalid.forEach(item1->{
+ YxStoreProduct yxStoreProduct= storeProductMapper.selectById(item1.getProductId());;
+ //商品品牌id相等
+ if (item.equals(yxStoreProduct.getBrandId())){
+ invalidProductList.add(item1);
+ }
+ });
+ map1.put("validProductList",validProductList);
+ map1.put("invalidProductList",invalidProductList);
+ cartList.add(map1);
+ });
+// map.put("valid", valid);
+// map.put("invalid", invalid);
+ map.put("cartList",cartList);
return map;
}
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/domain/YxEvaluation.java b/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/domain/YxEvaluation.java
index 0d7d97f9..27892138 100644
--- a/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/domain/YxEvaluation.java
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/domain/YxEvaluation.java
@@ -45,7 +45,6 @@ public class YxEvaluation implements Serializable {
private String videoInput;
-
/** 关联商品信息 */
@NotNull
private String product;
diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/impl/YxEvaluationServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/impl/YxEvaluationServiceImpl.java
index d6e95f2b..e087d8d8 100644
--- a/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/impl/YxEvaluationServiceImpl.java
+++ b/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/service/impl/YxEvaluationServiceImpl.java
@@ -121,7 +121,7 @@ public class YxEvaluationServiceImpl extends BaseServiceImpl> getYxStoreHotLists(YxStoreHotListQueryCriteria criteria, Pageable pageable){
+ return new ResponseEntity<>(yxStoreHotListService.queryAll(criteria,pageable),HttpStatus.OK);
+ }
+
+ @PostMapping
+ @Log("新增hotList")
+ @ApiOperation("新增hotList")
+// @PreAuthorize("@el.check('admin','yxStoreHotList:add')")
+ public ResponseEntity