Commit f18a4741a9e85c7052160fc901236790ace39f20
1 parent
f462ac7f
营销活动:完善 review 提到的问题
Showing
7 changed files
with
8 additions
and
13 deletions
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/article/AppArticleController.java
| @@ -56,13 +56,11 @@ public class AppArticleController { | @@ -56,13 +56,11 @@ public class AppArticleController { | ||
| 56 | return success(ArticleConvert.INSTANCE.convert01(articleService.getArticle(id))); | 56 | return success(ArticleConvert.INSTANCE.convert01(articleService.getArticle(id))); |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | - // TODO @puhui999:add-browse-count 噢;前端 uniapp 也要接下;就是打开文章的时候,调用下这个接口; | ||
| 60 | - @PutMapping("/add-browseCount") | 59 | + @PutMapping("/add-browse-count") |
| 61 | @Operation(summary = "增加文章浏览量") | 60 | @Operation(summary = "增加文章浏览量") |
| 62 | @Parameter(name = "id", description = "文章编号", example = "1024") | 61 | @Parameter(name = "id", description = "文章编号", example = "1024") |
| 63 | public CommonResult<Boolean> addBrowseCount(@RequestParam("id") Long id) { | 62 | public CommonResult<Boolean> addBrowseCount(@RequestParam("id") Long id) { |
| 64 | - // TODO @puhui999:addArticleBrowseCount | ||
| 65 | - articleService.addBrowseCount(id); | 63 | + articleService.addArticleBrowseCount(id); |
| 66 | return success(true); | 64 | return success(true); |
| 67 | } | 65 | } |
| 68 | 66 |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/bargain/BargainActivityMapper.java
| @@ -86,7 +86,6 @@ public interface BargainActivityMapper extends BaseMapperX<BargainActivityDO> { | @@ -86,7 +86,6 @@ public interface BargainActivityMapper extends BaseMapperX<BargainActivityDO> { | ||
| 86 | .last("LIMIT " + count)); | 86 | .last("LIMIT " + count)); |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | - // TODO @puhui999:是不是返回 BargainActivityDO 更干净哈?分组后返回 DO 的话需要联表查询 | ||
| 90 | /** | 89 | /** |
| 91 | * 查询出指定 spuId 的 spu 参加的活动最接近现在的一条记录。多个的话,一个 spuId 对应一个最近的活动编号 | 90 | * 查询出指定 spuId 的 spu 参加的活动最接近现在的一条记录。多个的话,一个 spuId 对应一个最近的活动编号 |
| 92 | * | 91 | * |
| @@ -102,7 +101,6 @@ public interface BargainActivityMapper extends BaseMapperX<BargainActivityDO> { | @@ -102,7 +101,6 @@ public interface BargainActivityMapper extends BaseMapperX<BargainActivityDO> { | ||
| 102 | .groupBy("spu_id")); | 101 | .groupBy("spu_id")); |
| 103 | } | 102 | } |
| 104 | 103 | ||
| 105 | - // TODO @puhui999:是不是只要 endTime 小于就可以啦; | ||
| 106 | /** | 104 | /** |
| 107 | * 获取指定活动编号的活动列表且 | 105 | * 获取指定活动编号的活动列表且 |
| 108 | * 开始时间和结束时间小于给定时间 dateTime 的活动列表 | 106 | * 开始时间和结束时间小于给定时间 dateTime 的活动列表 |
| @@ -115,7 +113,7 @@ public interface BargainActivityMapper extends BaseMapperX<BargainActivityDO> { | @@ -115,7 +113,7 @@ public interface BargainActivityMapper extends BaseMapperX<BargainActivityDO> { | ||
| 115 | return selectList(new LambdaQueryWrapperX<BargainActivityDO>() | 113 | return selectList(new LambdaQueryWrapperX<BargainActivityDO>() |
| 116 | .in(BargainActivityDO::getId, ids) | 114 | .in(BargainActivityDO::getId, ids) |
| 117 | .lt(BargainActivityDO::getStartTime, dateTime) | 115 | .lt(BargainActivityDO::getStartTime, dateTime) |
| 118 | - .lt(BargainActivityDO::getEndTime, dateTime) | 116 | + .gt(BargainActivityDO::getEndTime, dateTime)// 开始时间 < 指定时间 < 结束时间,也就是说获取指定时间段的活动 |
| 119 | .orderByDesc(BargainActivityDO::getCreateTime)); | 117 | .orderByDesc(BargainActivityDO::getCreateTime)); |
| 120 | } | 118 | } |
| 121 | 119 |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/combination/CombinationActivityMapper.java
| @@ -71,7 +71,7 @@ public interface CombinationActivityMapper extends BaseMapperX<CombinationActivi | @@ -71,7 +71,7 @@ public interface CombinationActivityMapper extends BaseMapperX<CombinationActivi | ||
| 71 | return selectList(new LambdaQueryWrapperX<CombinationActivityDO>() | 71 | return selectList(new LambdaQueryWrapperX<CombinationActivityDO>() |
| 72 | .in(CombinationActivityDO::getId, ids) | 72 | .in(CombinationActivityDO::getId, ids) |
| 73 | .lt(CombinationActivityDO::getStartTime, dateTime) | 73 | .lt(CombinationActivityDO::getStartTime, dateTime) |
| 74 | - .lt(CombinationActivityDO::getEndTime, dateTime) | 74 | + .gt(CombinationActivityDO::getEndTime, dateTime)// 开始时间 < 指定时间 < 结束时间,也就是说获取指定时间段的活动 |
| 75 | .orderByDesc(CombinationActivityDO::getCreateTime)); | 75 | .orderByDesc(CombinationActivityDO::getCreateTime)); |
| 76 | } | 76 | } |
| 77 | 77 |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/seckill/seckillactivity/SeckillActivityMapper.java
| @@ -103,7 +103,7 @@ public interface SeckillActivityMapper extends BaseMapperX<SeckillActivityDO> { | @@ -103,7 +103,7 @@ public interface SeckillActivityMapper extends BaseMapperX<SeckillActivityDO> { | ||
| 103 | return selectList(new LambdaQueryWrapperX<SeckillActivityDO>() | 103 | return selectList(new LambdaQueryWrapperX<SeckillActivityDO>() |
| 104 | .in(SeckillActivityDO::getId, ids) | 104 | .in(SeckillActivityDO::getId, ids) |
| 105 | .lt(SeckillActivityDO::getStartTime, dateTime) | 105 | .lt(SeckillActivityDO::getStartTime, dateTime) |
| 106 | - .lt(SeckillActivityDO::getEndTime, dateTime) | 106 | + .gt(SeckillActivityDO::getEndTime, dateTime)// 开始时间 < 指定时间 < 结束时间,也就是说获取指定时间段的活动 |
| 107 | .orderByDesc(SeckillActivityDO::getCreateTime)); | 107 | .orderByDesc(SeckillActivityDO::getCreateTime)); |
| 108 | } | 108 | } |
| 109 | 109 |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/article/ArticleService.java
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/article/ArticleServiceImpl.java
| @@ -111,7 +111,7 @@ public class ArticleServiceImpl implements ArticleService { | @@ -111,7 +111,7 @@ public class ArticleServiceImpl implements ArticleService { | ||
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | @Override | 113 | @Override |
| 114 | - public void addBrowseCount(Long id) { | 114 | + public void addArticleBrowseCount(Long id) { |
| 115 | // 校验文章是否存在 | 115 | // 校验文章是否存在 |
| 116 | validateArticleExists(id); | 116 | validateArticleExists(id); |
| 117 | // 增加浏览次数 | 117 | // 增加浏览次数 |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationRecordServiceImpl.java
| @@ -369,8 +369,7 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { | @@ -369,8 +369,7 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { | ||
| 369 | keyValue.setValue(keyValue.getValue() + 1); | 369 | keyValue.setValue(keyValue.getValue() + 1); |
| 370 | } | 370 | } |
| 371 | } catch (Exception ignored) { // 处理异常继续循环 | 371 | } catch (Exception ignored) { // 处理异常继续循环 |
| 372 | - // TODO @puhui999:拼团过期 or 虚拟成团 可以改成 expireCombinationRecord;因为找方法更容易一些; | ||
| 373 | - log.error("[拼团过期 or 虚拟成团][record({}) 处理异常,请进行处理!record 数据是:{}]", | 372 | + log.error("[expireCombinationRecord][record({}) 处理异常,请进行处理!record 数据是:{}]", |
| 374 | record.getId(), JsonUtils.toJsonString(record)); | 373 | record.getId(), JsonUtils.toJsonString(record)); |
| 375 | } | 374 | } |
| 376 | } | 375 | } |