App订单、商品实体类--修改

pull/2/head
小小张 2023-05-15 10:15:43 +08:00
parent 4e350e2767
commit 481473c310
6 changed files with 55 additions and 54 deletions

View File

@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.shop.controller.app.product;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductResponse; import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductRespVO;
import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailResponse; import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailRespVO;
import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProduct; import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProduct;
import cn.iocoder.yudao.module.shop.request.product.ProductListRequest; import cn.iocoder.yudao.module.shop.request.product.ProductListRequest;
import cn.iocoder.yudao.module.shop.request.product.ProductRequest; import cn.iocoder.yudao.module.shop.request.product.ProductRequest;
@ -49,7 +49,7 @@ public class ProductController {
*/ */
@Operation(summary = "热门商品推荐") @Operation(summary = "热门商品推荐")
@RequestMapping(value = "/product/hot", method = RequestMethod.GET) @RequestMapping(value = "/product/hot", method = RequestMethod.GET)
public CommonResult<PageInfo<IndexProductResponse>> getHotProductList(@Validated PageParam pageParamRequest) { public CommonResult<PageInfo<IndexProductRespVO>> getHotProductList(@Validated PageParam pageParamRequest) {
return CommonResult.success(productService.getHotProductList(pageParamRequest)); return CommonResult.success(productService.getHotProductList(pageParamRequest));
} }
@ -58,7 +58,7 @@ public class ProductController {
*/ */
@Operation(summary = "优选商品推荐") @Operation(summary = "优选商品推荐")
@RequestMapping(value = "/product/good", method = RequestMethod.GET) @RequestMapping(value = "/product/good", method = RequestMethod.GET)
public CommonResult<PageInfo<IndexProductResponse>> getGoodProductList() { public CommonResult<PageInfo<IndexProductRespVO>> getGoodProductList() {
return CommonResult.success(productService.getGoodProductList()); return CommonResult.success(productService.getGoodProductList());
} }
@ -76,7 +76,7 @@ public class ProductController {
*/ */
@Operation(summary = "商品列表") @Operation(summary = "商品列表")
@RequestMapping(value = "/products", method = RequestMethod.GET) @RequestMapping(value = "/products", method = RequestMethod.GET)
public CommonResult<PageInfo<IndexProductResponse>> getList(@Validated ProductRequest request, @Validated PageParam pageParamRequest) { public CommonResult<PageInfo<IndexProductRespVO>> getList(@Validated ProductRequest request, @Validated PageParam pageParamRequest) {
return CommonResult.success(productService.getList(request, pageParamRequest)); return CommonResult.success(productService.getList(request, pageParamRequest));
} }
@ -86,7 +86,7 @@ public class ProductController {
@Operation(summary = "商品详情") @Operation(summary = "商品详情")
@RequestMapping(value = "/product/detail/{id}", method = RequestMethod.GET) @RequestMapping(value = "/product/detail/{id}", method = RequestMethod.GET)
@Parameter(name = "type", description = "normal-正常video-视频") @Parameter(name = "type", description = "normal-正常video-视频")
public CommonResult<ProductDetailResponse> getDetail(@PathVariable Integer id, @RequestParam(value = "type", defaultValue = "normal") String type) { public CommonResult<ProductDetailRespVO> getDetail(@PathVariable Integer id, @RequestParam(value = "type", defaultValue = "normal") String type) {
return CommonResult.success(productService.getDetail(id, type)); return CommonResult.success(productService.getDetail(id, type));
} }
@ -124,7 +124,7 @@ public class ProductController {
*/ */
@Operation(summary = "商品列表(个别分类模型使用)") @Operation(summary = "商品列表(个别分类模型使用)")
@RequestMapping(value = "/product/list", method = RequestMethod.GET) @RequestMapping(value = "/product/list", method = RequestMethod.GET)
public CommonResult<PageInfo<IndexProductResponse>> getProductList(@Validated ProductListRequest request, @Validated PageParam pageParamRequest) { public CommonResult<PageInfo<IndexProductRespVO>> getProductList(@Validated ProductListRequest request, @Validated PageParam pageParamRequest) {
return CommonResult.success(productService.getCategoryProductList(request, pageParamRequest)); return CommonResult.success(productService.getCategoryProductList(request, pageParamRequest));
} }
@ -133,7 +133,7 @@ public class ProductController {
*/ */
@Operation(summary = "商品规格详情") @Operation(summary = "商品规格详情")
@RequestMapping(value = "/product/sku/detail/{id}", method = RequestMethod.GET) @RequestMapping(value = "/product/sku/detail/{id}", method = RequestMethod.GET)
public CommonResult<ProductDetailResponse> getSkuDetail(@PathVariable Integer id) { public CommonResult<ProductDetailRespVO> getSkuDetail(@PathVariable Integer id) {
return CommonResult.success(productService.getSkuDetail(id)); return CommonResult.success(productService.getSkuDetail(id));
} }

View File

@ -6,6 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
/** /**
@ -24,7 +25,7 @@ import java.math.BigDecimal;
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@Accessors(chain = true) @Accessors(chain = true)
@Schema(description="首页商品对象") @Schema(description="首页商品对象")
public class IndexProductResponse { public class IndexProductRespVO implements Serializable {
@Schema(description = "商品id") @Schema(description = "商品id")

View File

@ -28,7 +28,7 @@ import java.util.List;
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@Accessors(chain = true) @Accessors(chain = true)
@Schema(description="商品详情H5") @Schema(description="商品详情H5")
public class ProductDetailResponse implements Serializable { public class ProductDetailRespVO implements Serializable {
private static final long serialVersionUID=1L; private static final long serialVersionUID=1L;

View File

@ -1,6 +1,6 @@
package cn.iocoder.yudao.module.shop.convert.product; package cn.iocoder.yudao.module.shop.convert.product;
import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductResponse; import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductRespVO;
import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProduct; import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProduct;
import cn.iocoder.yudao.module.shop.vo.product.StoreProductVO; import cn.iocoder.yudao.module.shop.vo.product.StoreProductVO;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
@ -14,5 +14,5 @@ public interface StoreProductConvert {
StoreProductVO convert(StoreProduct bean); StoreProductVO convert(StoreProduct bean);
List<IndexProductResponse> convert1(List<StoreProduct> bean); List<IndexProductRespVO> convert1(List<StoreProduct> bean);
} }

View File

@ -2,8 +2,8 @@ package cn.iocoder.yudao.module.shop.service.product;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductResponse; import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductRespVO;
import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailResponse; import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailRespVO;
import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProduct; import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProduct;
import cn.iocoder.yudao.module.shop.request.product.ProductListRequest; import cn.iocoder.yudao.module.shop.request.product.ProductListRequest;
import cn.iocoder.yudao.module.shop.request.product.ProductRequest; import cn.iocoder.yudao.module.shop.request.product.ProductRequest;
@ -41,7 +41,7 @@ public interface ProductService {
* @param pageParamRequest * @param pageParamRequest
* @return CommonPage * @return CommonPage
*/ */
PageInfo<IndexProductResponse> getList(ProductRequest request, PageParam pageParamRequest); PageInfo<IndexProductRespVO> getList(ProductRequest request, PageParam pageParamRequest);
/** /**
* *
@ -49,14 +49,14 @@ public interface ProductService {
* @param type normal-void- * @param type normal-void-
* @return * @return
*/ */
ProductDetailResponse getDetail(Integer id, String type); ProductDetailRespVO getDetail(Integer id, String type);
/** /**
* SKU * SKU
* @param id * @param id
* @return * @return
*/ */
ProductDetailResponse getSkuDetail(Integer id); ProductDetailRespVO getSkuDetail(Integer id);
/** /**
* *
@ -79,7 +79,7 @@ public interface ProductService {
* @param pageRequest * @param pageRequest
* @return CommonPage<IndexProductResponse> * @return CommonPage<IndexProductResponse>
*/ */
PageInfo<IndexProductResponse> getHotProductList(PageParam pageRequest); PageInfo<IndexProductRespVO> getHotProductList(PageParam pageRequest);
/** /**
* *
@ -92,7 +92,7 @@ public interface ProductService {
* *
* @return CommonPage<IndexProductResponse> * @return CommonPage<IndexProductResponse>
*/ */
PageInfo<IndexProductResponse> getGoodProductList(); PageInfo<IndexProductRespVO> getGoodProductList();
/** /**
* (使) * (使)
@ -100,7 +100,7 @@ public interface ProductService {
* @param pageParamRequest * @param pageParamRequest
* @return CommonPage * @return CommonPage
*/ */
PageInfo<IndexProductResponse> getCategoryProductList(ProductListRequest request, PageParam pageParamRequest); PageInfo<IndexProductRespVO> getCategoryProductList(ProductListRequest request, PageParam pageParamRequest);
/** /**
* *

View File

@ -9,8 +9,8 @@ import cn.iocoder.yudao.module.infra.api.config.ApiConfigApi;
import cn.iocoder.yudao.module.member.api.user.MemberUserApi; import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
import cn.iocoder.yudao.module.shop.constants.SysConfigConstants; import cn.iocoder.yudao.module.shop.constants.SysConfigConstants;
import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductResponse; import cn.iocoder.yudao.module.shop.controller.app.product.vo.IndexProductRespVO;
import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailResponse; import cn.iocoder.yudao.module.shop.controller.app.product.vo.ProductDetailRespVO;
import cn.iocoder.yudao.module.shop.convert.product.StoreProductConvert; import cn.iocoder.yudao.module.shop.convert.product.StoreProductConvert;
import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProduct; import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProduct;
import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProductAttr; import cn.iocoder.yudao.module.shop.dal.dataobject.product.StoreProductAttr;
@ -107,18 +107,18 @@ public class ProductServiceImpl implements ProductService {
* @return CommonPage<IndexProductResponse> * @return CommonPage<IndexProductResponse>
*/ */
@Override @Override
public PageInfo<IndexProductResponse> getList(ProductRequest request, PageParam pageRequest) { public PageInfo<IndexProductRespVO> getList(ProductRequest request, PageParam pageRequest) {
List<StoreProduct> storeProductList = storeProductService.findH5List(request, pageRequest); List<StoreProduct> storeProductList = storeProductService.findH5List(request, pageRequest);
if (CollUtil.isEmpty(storeProductList)) { if (CollUtil.isEmpty(storeProductList)) {
return new PageInfo<>(new ArrayList<>()); return new PageInfo<>(new ArrayList<>());
} }
Page<IndexProductResponse> productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize()); Page<IndexProductRespVO> productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize());
PageInfo<StoreProduct> storeProductCommonPage = CommonPage.copyPageInfo(productPage,storeProductList); PageInfo<StoreProduct> storeProductCommonPage = CommonPage.copyPageInfo(productPage,storeProductList);
List<IndexProductResponse> productResponseArrayList = new ArrayList<>(); List<IndexProductRespVO> productResponseArrayList = new ArrayList<>();
for (StoreProduct storeProduct : storeProductList) { for (StoreProduct storeProduct : storeProductList) {
IndexProductResponse productResponse = new IndexProductResponse(); IndexProductRespVO productResponse = new IndexProductRespVO();
List<Integer> activityList = CrmebUtil.stringToArrayInt(storeProduct.getActivity()); List<Integer> activityList = CrmebUtil.stringToArrayInt(storeProduct.getActivity());
// 活动类型默认:直接跳过 // 活动类型默认:直接跳过
if (activityList.get(0).equals(Constants.PRODUCT_TYPE_NORMAL)) { if (activityList.get(0).equals(Constants.PRODUCT_TYPE_NORMAL)) {
@ -161,7 +161,7 @@ public class ProductServiceImpl implements ProductService {
productResponseArrayList.add(productResponse); productResponseArrayList.add(productResponse);
} }
PageInfo<IndexProductResponse> productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList); PageInfo<IndexProductRespVO> productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList);
BeanUtils.copyProperties(storeProductCommonPage, productResponseCommonPage, "list"); BeanUtils.copyProperties(storeProductCommonPage, productResponseCommonPage, "list");
return productResponseCommonPage; return productResponseCommonPage;
@ -174,22 +174,22 @@ public class ProductServiceImpl implements ProductService {
* @return * @return
*/ */
@Override @Override
public ProductDetailResponse getDetail(Integer id, String type) { public ProductDetailRespVO getDetail(Integer id, String type) {
// 获取用户 // 获取用户
MemberUserRespDTO user = userService.getUser(SecurityFrameworkUtils.getLoginUserId()); MemberUserRespDTO user = userService.getUser(SecurityFrameworkUtils.getLoginUserId());
ProductDetailResponse productDetailResponse = new ProductDetailResponse(); ProductDetailRespVO productDetailRespVO = new ProductDetailRespVO();
// 查询商品 // 查询商品
StoreProduct storeProduct = storeProductService.getH5Detail(id); StoreProduct storeProduct = storeProductService.getH5Detail(id);
// 设置会员价 // 设置会员价
storeProduct.setVipPrice(storeProduct.getPrice()); storeProduct.setVipPrice(storeProduct.getPrice());
productDetailResponse.setProductInfo(storeProduct); productDetailRespVO.setProductInfo(storeProduct);
// 获取商品规格 // 获取商品规格
List<StoreProductAttr> attrList = attrService.getListByProductIdAndType(storeProduct.getId(), Constants.PRODUCT_TYPE_NORMAL); List<StoreProductAttr> attrList = attrService.getListByProductIdAndType(storeProduct.getId(), Constants.PRODUCT_TYPE_NORMAL);
// 根据制式设置attr属性 // 根据制式设置attr属性
productDetailResponse.setProductAttr(attrList); productDetailRespVO.setProductAttr(attrList);
// 根据制式设置sku属性 // 根据制式设置sku属性
HashMap<String, Object> skuMap = new HashMap<>(); HashMap<String, Object> skuMap = new HashMap<>();
@ -202,11 +202,11 @@ public class ProductServiceImpl implements ProductService {
skuMap.put(atr.getSuk(), atr); skuMap.put(atr.getSuk(), atr);
} }
productDetailResponse.setProductValue(skuMap); productDetailRespVO.setProductValue(skuMap);
// 商品活动 // 商品活动
List<ProductActivityItemResponse> activityAllH5 = productUtils.getProductAllActivity(storeProduct); List<ProductActivityItemResponse> activityAllH5 = productUtils.getProductAllActivity(storeProduct);
productDetailResponse.setActivityAllH5(activityAllH5); productDetailRespVO.setActivityAllH5(activityAllH5);
// 商品浏览量+1 // 商品浏览量+1
StoreProduct updateProduct = new StoreProduct(); StoreProduct updateProduct = new StoreProduct();
@ -216,7 +216,7 @@ public class ProductServiceImpl implements ProductService {
// TODO 保存用户访问记录 // TODO 保存用户访问记录
return productDetailResponse; return productDetailRespVO;
} }
/** /**
@ -225,18 +225,18 @@ public class ProductServiceImpl implements ProductService {
* @return * @return
*/ */
@Override @Override
public ProductDetailResponse getSkuDetail(Integer id) { public ProductDetailRespVO getSkuDetail(Integer id) {
// 获取用户 // 获取用户
MemberUserRespDTO user = userService.getUser(SecurityFrameworkUtils.getLoginUserId()); MemberUserRespDTO user = userService.getUser(SecurityFrameworkUtils.getLoginUserId());
ProductDetailResponse productDetailResponse = new ProductDetailResponse(); ProductDetailRespVO productDetailRespVO = new ProductDetailRespVO();
// 查询商品 // 查询商品
StoreProduct storeProduct = storeProductService.getH5Detail(id); StoreProduct storeProduct = storeProductService.getH5Detail(id);
// 获取商品规格 // 获取商品规格
List<StoreProductAttr> attrList = attrService.getListByProductIdAndType(storeProduct.getId(), Constants.PRODUCT_TYPE_NORMAL); List<StoreProductAttr> attrList = attrService.getListByProductIdAndType(storeProduct.getId(), Constants.PRODUCT_TYPE_NORMAL);
// 根据制式设置attr属性 // 根据制式设置attr属性
productDetailResponse.setProductAttr(attrList); productDetailRespVO.setProductAttr(attrList);
// 根据制式设置sku属性 // 根据制式设置sku属性
HashMap<String, Object> skuMap = new HashMap<>(); HashMap<String, Object> skuMap = new HashMap<>();
@ -248,9 +248,9 @@ public class ProductServiceImpl implements ProductService {
skuMap.put(atr.getSuk(), atr); skuMap.put(atr.getSuk(), atr);
} }
productDetailResponse.setProductValue(skuMap); productDetailRespVO.setProductValue(skuMap);
return productDetailResponse; return productDetailRespVO;
} }
/** /**
@ -326,18 +326,18 @@ public class ProductServiceImpl implements ProductService {
* @return CommonPage<IndexProductResponse> * @return CommonPage<IndexProductResponse>
*/ */
@Override @Override
public PageInfo<IndexProductResponse> getHotProductList(PageParam pageRequest) { public PageInfo<IndexProductRespVO> getHotProductList(PageParam pageRequest) {
List<StoreProduct> storeProductList = storeProductService.getIndexProduct(Constants.INDEX_HOT_BANNER, pageRequest); List<StoreProduct> storeProductList = storeProductService.getIndexProduct(Constants.INDEX_HOT_BANNER, pageRequest);
if (CollUtil.isEmpty(storeProductList)) { if (CollUtil.isEmpty(storeProductList)) {
return new PageInfo<>(new ArrayList<>()); return new PageInfo<>(new ArrayList<>());
} }
Page<IndexProductResponse> productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize()); Page<IndexProductRespVO> productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize());
PageInfo<StoreProduct> storeProductCommonPage = CommonPage.copyPageInfo(productPage,storeProductList); PageInfo<StoreProduct> storeProductCommonPage = CommonPage.copyPageInfo(productPage,storeProductList);
List<IndexProductResponse> productResponseArrayList = new ArrayList<>(); List<IndexProductRespVO> productResponseArrayList = new ArrayList<>();
for (StoreProduct storeProduct : storeProductList) { for (StoreProduct storeProduct : storeProductList) {
IndexProductResponse productResponse = new IndexProductResponse(); IndexProductRespVO productResponse = new IndexProductRespVO();
List<Integer> activityList = CrmebUtil.stringToArrayInt(storeProduct.getActivity()); List<Integer> activityList = CrmebUtil.stringToArrayInt(storeProduct.getActivity());
// 活动类型默认:直接跳过 // 活动类型默认:直接跳过
if (activityList.get(0).equals(Constants.PRODUCT_TYPE_NORMAL)) { if (activityList.get(0).equals(Constants.PRODUCT_TYPE_NORMAL)) {
@ -380,7 +380,7 @@ public class ProductServiceImpl implements ProductService {
productResponseArrayList.add(productResponse); productResponseArrayList.add(productResponse);
} }
PageInfo<IndexProductResponse> productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList); PageInfo<IndexProductRespVO> productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList);
BeanUtils.copyProperties(storeProductCommonPage, productResponseCommonPage, "list"); BeanUtils.copyProperties(storeProductCommonPage, productResponseCommonPage, "list");
return new PageInfo<>(StoreProductConvert.INSTANCE.convert1(storeProductList)); return new PageInfo<>(StoreProductConvert.INSTANCE.convert1(storeProductList));
@ -404,7 +404,7 @@ public class ProductServiceImpl implements ProductService {
* @return CommonPage<IndexProductResponse> * @return CommonPage<IndexProductResponse>
*/ */
@Override @Override
public PageInfo<IndexProductResponse> getGoodProductList() { public PageInfo<IndexProductRespVO> getGoodProductList() {
PageParam pageRequest = new PageParam(); PageParam pageRequest = new PageParam();
pageRequest.setPageSize(9); pageRequest.setPageSize(9);
List<StoreProduct> storeProductList = storeProductService.getIndexProduct(Constants.INDEX_RECOMMEND_BANNER, pageRequest); List<StoreProduct> storeProductList = storeProductService.getIndexProduct(Constants.INDEX_RECOMMEND_BANNER, pageRequest);
@ -412,12 +412,12 @@ public class ProductServiceImpl implements ProductService {
return new PageInfo<>(new ArrayList<>()); return new PageInfo<>(new ArrayList<>());
} }
Page<IndexProductResponse> productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize()); Page<IndexProductRespVO> productPage = PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize());
PageInfo<StoreProduct> storeProductCommonPage = CommonPage.copyPageInfo(productPage,storeProductList); PageInfo<StoreProduct> storeProductCommonPage = CommonPage.copyPageInfo(productPage,storeProductList);
List<IndexProductResponse> productResponseArrayList = new ArrayList<>(); List<IndexProductRespVO> productResponseArrayList = new ArrayList<>();
for (StoreProduct storeProduct : storeProductList) { for (StoreProduct storeProduct : storeProductList) {
IndexProductResponse productResponse = new IndexProductResponse(); IndexProductRespVO productResponse = new IndexProductRespVO();
List<Integer> activityList = CrmebUtil.stringToArrayInt(storeProduct.getActivity()); List<Integer> activityList = CrmebUtil.stringToArrayInt(storeProduct.getActivity());
// 活动类型默认:直接跳过 // 活动类型默认:直接跳过
if (activityList.get(0).equals(Constants.PRODUCT_TYPE_NORMAL)) { if (activityList.get(0).equals(Constants.PRODUCT_TYPE_NORMAL)) {
@ -460,7 +460,7 @@ public class ProductServiceImpl implements ProductService {
productResponseArrayList.add(productResponse); productResponseArrayList.add(productResponse);
} }
PageInfo<IndexProductResponse> productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList); PageInfo<IndexProductRespVO> productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList);
BeanUtils.copyProperties(storeProductCommonPage, productResponseCommonPage, "list"); BeanUtils.copyProperties(storeProductCommonPage, productResponseCommonPage, "list");
return new PageInfo<>(StoreProductConvert.INSTANCE.convert1(storeProductList)); return new PageInfo<>(StoreProductConvert.INSTANCE.convert1(storeProductList));
@ -473,7 +473,7 @@ public class ProductServiceImpl implements ProductService {
* @return CommonPage * @return CommonPage
*/ */
@Override @Override
public PageInfo<IndexProductResponse> getCategoryProductList(ProductListRequest request, PageParam pageParamRequest) { public PageInfo<IndexProductRespVO> getCategoryProductList(ProductListRequest request, PageParam pageParamRequest) {
ProductRequest searchRequest = new ProductRequest(); ProductRequest searchRequest = new ProductRequest();
BeanUtils.copyProperties(searchRequest, request); BeanUtils.copyProperties(searchRequest, request);
List<StoreProduct> storeProductList = storeProductService.findH5List(searchRequest, pageParamRequest); List<StoreProduct> storeProductList = storeProductService.findH5List(searchRequest, pageParamRequest);
@ -481,13 +481,13 @@ public class ProductServiceImpl implements ProductService {
return new PageInfo<>(new ArrayList<>()); return new PageInfo<>(new ArrayList<>());
} }
Page<IndexProductResponse> productPage = PageHelper.startPage(pageParamRequest.getPageNo(), pageParamRequest.getPageSize()); Page<IndexProductRespVO> productPage = PageHelper.startPage(pageParamRequest.getPageNo(), pageParamRequest.getPageSize());
PageInfo<StoreProduct> storeProductCommonPage = CommonPage.copyPageInfo(productPage,storeProductList); PageInfo<StoreProduct> storeProductCommonPage = CommonPage.copyPageInfo(productPage,storeProductList);
MemberUserRespDTO user = userService.getUser(SecurityFrameworkUtils.getLoginUserId()); MemberUserRespDTO user = userService.getUser(SecurityFrameworkUtils.getLoginUserId());
List<IndexProductResponse> productResponseArrayList = new ArrayList<>(); List<IndexProductRespVO> productResponseArrayList = new ArrayList<>();
for (StoreProduct storeProduct : storeProductList) { for (StoreProduct storeProduct : storeProductList) {
IndexProductResponse productResponse = new IndexProductResponse(); IndexProductRespVO productResponse = new IndexProductRespVO();
// 获取商品购物车数量 // 获取商品购物车数量
if (ObjectUtil.isNotNull(user)) { if (ObjectUtil.isNotNull(user)) {
productResponse.setCartNum(cartService.getProductNumByUidAndProductId(user.getId(), storeProduct.getId())); productResponse.setCartNum(cartService.getProductNumByUidAndProductId(user.getId(), storeProduct.getId()));
@ -496,7 +496,7 @@ public class ProductServiceImpl implements ProductService {
productResponseArrayList.add(productResponse); productResponseArrayList.add(productResponse);
} }
PageInfo<IndexProductResponse> productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList); PageInfo<IndexProductRespVO> productResponseCommonPage = CommonPage.copyPageInfo(productPage,productResponseArrayList);
BeanUtils.copyProperties(storeProductCommonPage, productResponseCommonPage, "list"); BeanUtils.copyProperties(storeProductCommonPage, productResponseCommonPage, "list");
return new PageInfo<>(StoreProductConvert.INSTANCE.convert1(storeProductList)); return new PageInfo<>(StoreProductConvert.INSTANCE.convert1(storeProductList));