Compare commits

..

No commits in common. "527e0210deba9525ab0c0069e403c991be68b390" and "7dcb1ef9a9c95920c77783603a3c18bfb074a4a8" have entirely different histories.

3 changed files with 1 additions and 55 deletions

View File

@ -201,23 +201,4 @@ public class AppProductSpuController {
return pageResult;
}
// TODO 芋艿商品的浏览记录
@GetMapping("/getActivityGoods")
public CommonResult<List<AppProductSpuRespVO>> getActivityGoods(String activityType) {
List<ProductSpuDO> list = productSpuService.getActivityGoods(activityType);
if (CollUtil.isEmpty(list)) {
return success(Collections.emptyList());
}
// 拼接返回
list.forEach(spu -> spu.setSalesCount(spu.getSalesCount() + spu.getVirtualSalesCount()));
List<AppProductSpuRespVO> voList = BeanUtils.toBean(list, AppProductSpuRespVO.class);
// 处理 vip 价格
MemberLevelRespDTO memberLevel = getMemberLevel();
voList.forEach(vo -> vo.setVipPrice(calculateVipPrice(vo.getPrice(), memberLevel)));
return success(voList);
}
}
}

View File

@ -6,7 +6,6 @@ import cn.iocoder.yudao.module.product.controller.admin.spu.vo.ProductSpuSaveReq
import cn.iocoder.yudao.module.product.controller.admin.spu.vo.ProductSpuUpdateStatusReqVO;
import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuPageReqVO;
import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuRecommendPageReqVo;
import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuRespVO;
import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO;
import org.springframework.scheduling.annotation.Async;
@ -139,7 +138,4 @@ public interface ProductSpuService {
* @return
*/
List<ProductSpuDO> getRecommendProductIdList(AppProductSpuRecommendPageReqVo pageVo);
List<ProductSpuDO> getActivityGoods(String activityType);
}

View File

@ -15,7 +15,6 @@ import cn.iocoder.yudao.module.product.controller.admin.spu.vo.ProductSpuSaveReq
import cn.iocoder.yudao.module.product.controller.admin.spu.vo.ProductSpuUpdateStatusReqVO;
import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuPageReqVO;
import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuRecommendPageReqVo;
import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuRespVO;
import cn.iocoder.yudao.module.product.dal.dataobject.category.ProductCategoryDO;
import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO;
import cn.iocoder.yudao.module.product.dal.mysql.spu.ProductSpuMapper;
@ -23,7 +22,6 @@ import cn.iocoder.yudao.module.product.enums.spu.ProductSpuStatusEnum;
import cn.iocoder.yudao.module.product.service.brand.ProductBrandService;
import cn.iocoder.yudao.module.product.service.category.ProductCategoryService;
import cn.iocoder.yudao.module.product.service.sku.ProductSkuService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Maps;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
@ -196,8 +194,6 @@ public class ProductSpuServiceImpl implements ProductSpuService {
return productSpuMapper.selectList(wrapperX);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteSpu(Long id) {
@ -312,31 +308,4 @@ public class ProductSpuServiceImpl implements ProductSpuService {
return productSpuMapper.selectCount(ProductSpuDO::getCategoryId, categoryId);
}
@Override
public List<ProductSpuDO> getActivityGoods(String activityType) {
String activity = "";
if (activityType.equals("recommendHot")){
activity = "recommend_hot";
}
if (activityType.equals("recommendBenefit")){
activity = "recommend_benefit";
}
if (activityType.equals("recommendBest")){
activity = "recommend_best";
}
if (activityType.equals("recommendNew")){
activity = "recommend_new";
}
if (activityType.equals("recommendGood")){
activity = "recommend_good";
}
QueryWrapper<ProductSpuDO> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(activity,1).eq("status",1);
return productSpuMapper.selectList(queryWrapper);
}
}