Commit 6099786c1b7a7e8d9f93bb9edcc9fb5db364b3bd
1 parent
8b480c52
拼团记录:完善拼团记录后台管理接口
Showing
6 changed files
with
40 additions
and
63 deletions
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/combination/CombinationRecordController.java
| @@ -51,7 +51,7 @@ public class CombinationRecordController { | @@ -51,7 +51,7 @@ public class CombinationRecordController { | ||
| 51 | @PreAuthorize("@ss.hasPermission('promotion:combination-record:query')") | 51 | @PreAuthorize("@ss.hasPermission('promotion:combination-record:query')") |
| 52 | public CommonResult<PageResult<CombinationRecordRespVO>> getBargainRecordPage(@Valid CombinationRecordReqPageVO pageVO) { | 52 | public CommonResult<PageResult<CombinationRecordRespVO>> getBargainRecordPage(@Valid CombinationRecordReqPageVO pageVO) { |
| 53 | return success(CombinationActivityConvert.INSTANCE.convert( | 53 | return success(CombinationActivityConvert.INSTANCE.convert( |
| 54 | - combinationRecordService.getBargainRecordPage(pageVO))); | 54 | + combinationRecordService.getCombinationRecordPage(pageVO))); |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | @GetMapping("/get-summary") | 57 | @GetMapping("/get-summary") |
| @@ -64,22 +64,22 @@ public class CombinationRecordController { | @@ -64,22 +64,22 @@ public class CombinationRecordController { | ||
| 64 | @GetMapping("/get-count") | 64 | @GetMapping("/get-count") |
| 65 | @Operation(summary = "获得拼团记录分页 tab count") | 65 | @Operation(summary = "获得拼团记录分页 tab count") |
| 66 | @PreAuthorize("@ss.hasPermission('promotion:combination-record:query')") | 66 | @PreAuthorize("@ss.hasPermission('promotion:combination-record:query')") |
| 67 | - public CommonResult<Map<String, Long>> getSpuCount() { | 67 | + public CommonResult<Map<String, Long>> getCombinationRecordCount() { |
| 68 | Map<String, Long> hashMap = MapUtil.newHashMap(7); | 68 | Map<String, Long> hashMap = MapUtil.newHashMap(7); |
| 69 | - hashMap.put("all", combinationRecordService.getRecordsCountByDateType(CombinationRecordReqPageVO.ALL));// 全部 | ||
| 70 | - hashMap.put("toDay", combinationRecordService.getRecordsCountByDateType(CombinationRecordReqPageVO.TO_DAY));// 今天 | ||
| 71 | - hashMap.put("yesterday", combinationRecordService.getRecordsCountByDateType(CombinationRecordReqPageVO.YESTERDAY));// 昨天 | ||
| 72 | - hashMap.put("lastSevenDays", combinationRecordService.getRecordsCountByDateType(CombinationRecordReqPageVO.LAST_SEVEN_DAYS));// 最近七天 | ||
| 73 | - hashMap.put("last30Days", combinationRecordService.getRecordsCountByDateType(CombinationRecordReqPageVO.LAST_30_DAYS));// 最近 30 天 | ||
| 74 | - hashMap.put("thisMonth", combinationRecordService.getRecordsCountByDateType(CombinationRecordReqPageVO.THIS_MONTH));// 本月 | ||
| 75 | - hashMap.put("thisYear", combinationRecordService.getRecordsCountByDateType(CombinationRecordReqPageVO.THIS_YEAR));// 本年 | 69 | + hashMap.put("all", combinationRecordService.getCombinationRecordsCountByDateType(CombinationRecordReqPageVO.ALL));// 全部 |
| 70 | + hashMap.put("toDay", combinationRecordService.getCombinationRecordsCountByDateType(CombinationRecordReqPageVO.TO_DAY));// 今天 | ||
| 71 | + hashMap.put("yesterday", combinationRecordService.getCombinationRecordsCountByDateType(CombinationRecordReqPageVO.YESTERDAY));// 昨天 | ||
| 72 | + hashMap.put("lastSevenDays", combinationRecordService.getCombinationRecordsCountByDateType(CombinationRecordReqPageVO.LAST_SEVEN_DAYS));// 最近七天 | ||
| 73 | + hashMap.put("last30Days", combinationRecordService.getCombinationRecordsCountByDateType(CombinationRecordReqPageVO.LAST_30_DAYS));// 最近 30 天 | ||
| 74 | + hashMap.put("thisMonth", combinationRecordService.getCombinationRecordsCountByDateType(CombinationRecordReqPageVO.THIS_MONTH));// 本月 | ||
| 75 | + hashMap.put("thisYear", combinationRecordService.getCombinationRecordsCountByDateType(CombinationRecordReqPageVO.THIS_YEAR));// 本年 | ||
| 76 | return success(hashMap); | 76 | return success(hashMap); |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | private Map<String, Long> getCombinationRecordSummary0() { | 79 | private Map<String, Long> getCombinationRecordSummary0() { |
| 80 | Map<String, Long> hashMap = MapUtil.newHashMap(3); | 80 | Map<String, Long> hashMap = MapUtil.newHashMap(3); |
| 81 | - hashMap.put("userCount", combinationRecordService.getRecordsCount());// 获取所有拼团记录 | ||
| 82 | - hashMap.put("successCount", combinationRecordService.getRecordsSuccessCount());// 获取成团记录 | 81 | + hashMap.put("userCount", combinationRecordService.getCombinationRecordsCount());// 获取所有拼团记录 |
| 82 | + hashMap.put("successCount", combinationRecordService.getCombinationRecordsSuccessCount());// 获取成团记录 | ||
| 83 | hashMap.put("virtualGroupCount", combinationRecordService.getRecordsVirtualGroupCount());// 获取虚拟成团记录 | 83 | hashMap.put("virtualGroupCount", combinationRecordService.getRecordsVirtualGroupCount());// 获取虚拟成团记录 |
| 84 | return hashMap; | 84 | return hashMap; |
| 85 | } | 85 | } |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationRecordController.java
| @@ -42,7 +42,7 @@ public class AppCombinationRecordController { | @@ -42,7 +42,7 @@ public class AppCombinationRecordController { | ||
| 42 | // TODO 芋艿:增加 @Cache 缓存,1 分钟过期 | 42 | // TODO 芋艿:增加 @Cache 缓存,1 分钟过期 |
| 43 | public CommonResult<AppCombinationRecordSummaryRespVO> getCombinationRecordSummary() { | 43 | public CommonResult<AppCombinationRecordSummaryRespVO> getCombinationRecordSummary() { |
| 44 | // 获取所有拼团记录 | 44 | // 获取所有拼团记录 |
| 45 | - Long count = combinationRecordService.getRecordsCount(); | 45 | + Long count = combinationRecordService.getCombinationRecordsCount(); |
| 46 | AppCombinationRecordSummaryRespVO summary = new AppCombinationRecordSummaryRespVO(); | 46 | AppCombinationRecordSummaryRespVO summary = new AppCombinationRecordSummaryRespVO(); |
| 47 | if (count == null || count == 0L) { | 47 | if (count == null || count == 0L) { |
| 48 | summary.setAvatars(Collections.emptyList()); | 48 | summary.setAvatars(Collections.emptyList()); |
| @@ -53,7 +53,7 @@ public class AppCombinationRecordController { | @@ -53,7 +53,7 @@ public class AppCombinationRecordController { | ||
| 53 | summary.setUserCount(count); | 53 | summary.setUserCount(count); |
| 54 | // TODO 只返回最近的 7 个 | 54 | // TODO 只返回最近的 7 个 |
| 55 | int num = 7; | 55 | int num = 7; |
| 56 | - summary.setAvatars(convertList(combinationRecordService.getLatestRecordList(num), CombinationRecordDO::getAvatar)); | 56 | + summary.setAvatars(convertList(combinationRecordService.getLatestCombinationRecordList(num), CombinationRecordDO::getAvatar)); |
| 57 | return success(summary); | 57 | return success(summary); |
| 58 | } | 58 | } |
| 59 | 59 | ||
| @@ -69,7 +69,7 @@ public class AppCombinationRecordController { | @@ -69,7 +69,7 @@ public class AppCombinationRecordController { | ||
| 69 | @RequestParam("status") Integer status, | 69 | @RequestParam("status") Integer status, |
| 70 | @RequestParam(value = "count", defaultValue = "20") @Max(20) Integer count) { | 70 | @RequestParam(value = "count", defaultValue = "20") @Max(20) Integer count) { |
| 71 | return success(CombinationActivityConvert.INSTANCE.convertList3( | 71 | return success(CombinationActivityConvert.INSTANCE.convertList3( |
| 72 | - combinationRecordService.getRecordListWithHead(activityId, status, count))); | 72 | + combinationRecordService.getCombinationRecordListWithHead(activityId, status, count))); |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | @GetMapping("/get-detail") | 75 | @GetMapping("/get-detail") |
| @@ -77,7 +77,7 @@ public class AppCombinationRecordController { | @@ -77,7 +77,7 @@ public class AppCombinationRecordController { | ||
| 77 | @Parameter(name = "id", description = "拼团记录编号", required = true, example = "1024") | 77 | @Parameter(name = "id", description = "拼团记录编号", required = true, example = "1024") |
| 78 | public CommonResult<AppCombinationRecordDetailRespVO> getCombinationRecordDetail(@RequestParam("id") Long id) { | 78 | public CommonResult<AppCombinationRecordDetailRespVO> getCombinationRecordDetail(@RequestParam("id") Long id) { |
| 79 | // 1、查询这条记录 | 79 | // 1、查询这条记录 |
| 80 | - CombinationRecordDO record = combinationRecordService.getRecordById(id); | 80 | + CombinationRecordDO record = combinationRecordService.getCombinationRecordById(id); |
| 81 | if (record == null) { | 81 | if (record == null) { |
| 82 | return success(null); | 82 | return success(null); |
| 83 | } | 83 | } |
| @@ -88,17 +88,17 @@ public class AppCombinationRecordController { | @@ -88,17 +88,17 @@ public class AppCombinationRecordController { | ||
| 88 | if (record.getHeadId() == null) { | 88 | if (record.getHeadId() == null) { |
| 89 | detail.setHeadRecord(CombinationActivityConvert.INSTANCE.convert(record)); | 89 | detail.setHeadRecord(CombinationActivityConvert.INSTANCE.convert(record)); |
| 90 | // 2.1、查找团员拼团记录 | 90 | // 2.1、查找团员拼团记录 |
| 91 | - records = combinationRecordService.getRecordListByHeadId(record.getId()); | 91 | + records = combinationRecordService.getCombinationRecordListByHeadId(record.getId()); |
| 92 | } else { | 92 | } else { |
| 93 | // 2.2、查找团长拼团记录 | 93 | // 2.2、查找团长拼团记录 |
| 94 | - CombinationRecordDO headRecord = combinationRecordService.getRecordById(record.getHeadId()); | 94 | + CombinationRecordDO headRecord = combinationRecordService.getCombinationRecordById(record.getHeadId()); |
| 95 | if (headRecord == null) { | 95 | if (headRecord == null) { |
| 96 | return success(null); | 96 | return success(null); |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | detail.setHeadRecord(CombinationActivityConvert.INSTANCE.convert(headRecord)); | 99 | detail.setHeadRecord(CombinationActivityConvert.INSTANCE.convert(headRecord)); |
| 100 | // 2.3、查找团员拼团记录 | 100 | // 2.3、查找团员拼团记录 |
| 101 | - records = combinationRecordService.getRecordListByHeadId(headRecord.getId()); | 101 | + records = combinationRecordService.getCombinationRecordListByHeadId(headRecord.getId()); |
| 102 | 102 | ||
| 103 | } | 103 | } |
| 104 | detail.setMemberRecords(CombinationActivityConvert.INSTANCE.convertList3(records)); | 104 | detail.setMemberRecords(CombinationActivityConvert.INSTANCE.convertList3(records)); |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/combination/CombinationRecordMapper.java
| @@ -2,9 +2,9 @@ package cn.iocoder.yudao.module.promotion.dal.mysql.combination; | @@ -2,9 +2,9 @@ package cn.iocoder.yudao.module.promotion.dal.mysql.combination; | ||
| 2 | 2 | ||
| 3 | import cn.hutool.core.collection.CollUtil; | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | import cn.hutool.core.map.MapUtil; | 4 | import cn.hutool.core.map.MapUtil; |
| 5 | -import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | ||
| 6 | import cn.hutool.core.util.ObjectUtil; | 5 | import cn.hutool.core.util.ObjectUtil; |
| 7 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 6 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 7 | +import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | ||
| 8 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | 8 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 9 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | 9 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 10 | import cn.iocoder.yudao.module.promotion.controller.admin.combination.vo.recrod.CombinationRecordReqPageVO; | 10 | import cn.iocoder.yudao.module.promotion.controller.admin.combination.vo.recrod.CombinationRecordReqPageVO; |
| @@ -32,10 +32,6 @@ public interface CombinationRecordMapper extends BaseMapperX<CombinationRecordDO | @@ -32,10 +32,6 @@ public interface CombinationRecordMapper extends BaseMapperX<CombinationRecordDO | ||
| 32 | CombinationRecordDO::getOrderId, orderId); | 32 | CombinationRecordDO::getOrderId, orderId); |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | - default List<CombinationRecordDO> selectListByUserId(Long userId) { | ||
| 36 | - return selectList(CombinationRecordDO::getUserId, userId); | ||
| 37 | - } | ||
| 38 | - | ||
| 39 | default List<CombinationRecordDO> selectListByUserIdAndStatus(Long userId, Integer status) { | 35 | default List<CombinationRecordDO> selectListByUserIdAndStatus(Long userId, Integer status) { |
| 40 | return selectList(new LambdaQueryWrapperX<CombinationRecordDO>() | 36 | return selectList(new LambdaQueryWrapperX<CombinationRecordDO>() |
| 41 | .eq(CombinationRecordDO::getUserId, userId) | 37 | .eq(CombinationRecordDO::getUserId, userId) |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationRecordService.java
| @@ -15,7 +15,6 @@ import java.util.Collection; | @@ -15,7 +15,6 @@ import java.util.Collection; | ||
| 15 | import java.util.List; | 15 | import java.util.List; |
| 16 | import java.util.Map; | 16 | import java.util.Map; |
| 17 | 17 | ||
| 18 | -// todo @PUHUI:方法名,还是带下 Combination 哈 | ||
| 19 | /** | 18 | /** |
| 20 | * 拼团记录 Service 接口 | 19 | * 拼团记录 Service 接口 |
| 21 | * | 20 | * |
| @@ -62,11 +61,11 @@ public interface CombinationRecordService { | @@ -62,11 +61,11 @@ public interface CombinationRecordService { | ||
| 62 | void updateRecordStatusAndStartTimeByUserIdAndOrderId(Integer status, Long userId, Long orderId, LocalDateTime startTime); | 61 | void updateRecordStatusAndStartTimeByUserIdAndOrderId(Integer status, Long userId, Long orderId, LocalDateTime startTime); |
| 63 | 62 | ||
| 64 | /** | 63 | /** |
| 65 | - * 获得拼团状态 | 64 | + * 获得拼团记录 |
| 66 | * | 65 | * |
| 67 | * @param userId 用户编号 | 66 | * @param userId 用户编号 |
| 68 | * @param orderId 订单编号 | 67 | * @param orderId 订单编号 |
| 69 | - * @return 拼团状态 | 68 | + * @return 拼团记录 |
| 70 | */ | 69 | */ |
| 71 | CombinationRecordDO getCombinationRecord(Long userId, Long orderId); | 70 | CombinationRecordDO getCombinationRecord(Long userId, Long orderId); |
| 72 | 71 | ||
| @@ -77,7 +76,7 @@ public interface CombinationRecordService { | @@ -77,7 +76,7 @@ public interface CombinationRecordService { | ||
| 77 | * @param activityId 活动 id | 76 | * @param activityId 活动 id |
| 78 | * @return 拼团记录列表 | 77 | * @return 拼团记录列表 |
| 79 | */ | 78 | */ |
| 80 | - List<CombinationRecordDO> getRecordListByUserIdAndActivityId(Long userId, Long activityId); | 79 | + List<CombinationRecordDO> getCombinationRecordListByUserIdAndActivityId(Long userId, Long activityId); |
| 81 | 80 | ||
| 82 | /** | 81 | /** |
| 83 | * 【下单前】校验是否满足拼团活动条件 | 82 | * 【下单前】校验是否满足拼团活动条件 |
| @@ -97,14 +96,14 @@ public interface CombinationRecordService { | @@ -97,14 +96,14 @@ public interface CombinationRecordService { | ||
| 97 | * | 96 | * |
| 98 | * @return 记录数 | 97 | * @return 记录数 |
| 99 | */ | 98 | */ |
| 100 | - Long getRecordsCount(); | 99 | + Long getCombinationRecordsCount(); |
| 101 | 100 | ||
| 102 | /** | 101 | /** |
| 103 | * 获取成功记录数 | 102 | * 获取成功记录数 |
| 104 | * | 103 | * |
| 105 | * @return 记录数 | 104 | * @return 记录数 |
| 106 | */ | 105 | */ |
| 107 | - Long getRecordsSuccessCount(); | 106 | + Long getCombinationRecordsSuccessCount(); |
| 108 | 107 | ||
| 109 | /** | 108 | /** |
| 110 | * 获取虚拟成团记录数 | 109 | * 获取虚拟成团记录数 |
| @@ -119,7 +118,7 @@ public interface CombinationRecordService { | @@ -119,7 +118,7 @@ public interface CombinationRecordService { | ||
| 119 | * @param dateType 日期类型 | 118 | * @param dateType 日期类型 |
| 120 | * @return 记录数 | 119 | * @return 记录数 |
| 121 | */ | 120 | */ |
| 122 | - Long getRecordsCountByDateType(Integer dateType); | 121 | + Long getCombinationRecordsCountByDateType(Integer dateType); |
| 123 | 122 | ||
| 124 | /** | 123 | /** |
| 125 | * 获取最近的 count 条拼团记录 | 124 | * 获取最近的 count 条拼团记录 |
| @@ -127,7 +126,7 @@ public interface CombinationRecordService { | @@ -127,7 +126,7 @@ public interface CombinationRecordService { | ||
| 127 | * @param count 限制数量 | 126 | * @param count 限制数量 |
| 128 | * @return 拼团记录列表 | 127 | * @return 拼团记录列表 |
| 129 | */ | 128 | */ |
| 130 | - List<CombinationRecordDO> getLatestRecordList(int count); | 129 | + List<CombinationRecordDO> getLatestCombinationRecordList(int count); |
| 131 | 130 | ||
| 132 | /** | 131 | /** |
| 133 | * 获得最近 n 条拼团记录(团长发起的) | 132 | * 获得最近 n 条拼团记录(团长发起的) |
| @@ -137,7 +136,7 @@ public interface CombinationRecordService { | @@ -137,7 +136,7 @@ public interface CombinationRecordService { | ||
| 137 | * @param count 数量 | 136 | * @param count 数量 |
| 138 | * @return 拼团记录列表 | 137 | * @return 拼团记录列表 |
| 139 | */ | 138 | */ |
| 140 | - List<CombinationRecordDO> getRecordListWithHead(Long activityId, Integer status, Integer count); | 139 | + List<CombinationRecordDO> getCombinationRecordListWithHead(Long activityId, Integer status, Integer count); |
| 141 | 140 | ||
| 142 | /** | 141 | /** |
| 143 | * 获取指定编号的拼团记录 | 142 | * 获取指定编号的拼团记录 |
| @@ -145,7 +144,7 @@ public interface CombinationRecordService { | @@ -145,7 +144,7 @@ public interface CombinationRecordService { | ||
| 145 | * @param id 拼团记录编号 | 144 | * @param id 拼团记录编号 |
| 146 | * @return 拼团记录 | 145 | * @return 拼团记录 |
| 147 | */ | 146 | */ |
| 148 | - CombinationRecordDO getRecordById(Long id); | 147 | + CombinationRecordDO getCombinationRecordById(Long id); |
| 149 | 148 | ||
| 150 | /** | 149 | /** |
| 151 | * 获取指定团长编号的拼团记录 | 150 | * 获取指定团长编号的拼团记录 |
| @@ -153,7 +152,7 @@ public interface CombinationRecordService { | @@ -153,7 +152,7 @@ public interface CombinationRecordService { | ||
| 153 | * @param headId 团长编号 | 152 | * @param headId 团长编号 |
| 154 | * @return 拼团记录列表 | 153 | * @return 拼团记录列表 |
| 155 | */ | 154 | */ |
| 156 | - List<CombinationRecordDO> getRecordListByHeadId(Long headId); | 155 | + List<CombinationRecordDO> getCombinationRecordListByHeadId(Long headId); |
| 157 | 156 | ||
| 158 | /** | 157 | /** |
| 159 | * 获取拼团记录分页数据 | 158 | * 获取拼团记录分页数据 |
| @@ -161,7 +160,7 @@ public interface CombinationRecordService { | @@ -161,7 +160,7 @@ public interface CombinationRecordService { | ||
| 161 | * @param pageVO 分页请求 | 160 | * @param pageVO 分页请求 |
| 162 | * @return 拼团记录分页数据 | 161 | * @return 拼团记录分页数据 |
| 163 | */ | 162 | */ |
| 164 | - PageResult<CombinationRecordDO> getBargainRecordPage(CombinationRecordReqPageVO pageVO); | 163 | + PageResult<CombinationRecordDO> getCombinationRecordPage(CombinationRecordReqPageVO pageVO); |
| 165 | 164 | ||
| 166 | /** | 165 | /** |
| 167 | * 【拼团活动】获得拼团记录数量 Map | 166 | * 【拼团活动】获得拼团记录数量 Map |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationRecordServiceImpl.java
| @@ -139,7 +139,7 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { | @@ -139,7 +139,7 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { | ||
| 139 | throw exception(COMBINATION_ACTIVITY_UPDATE_STOCK_FAIL); | 139 | throw exception(COMBINATION_ACTIVITY_UPDATE_STOCK_FAIL); |
| 140 | } | 140 | } |
| 141 | // 3、校验是否有拼团记录 | 141 | // 3、校验是否有拼团记录 |
| 142 | - List<CombinationRecordDO> recordList = getRecordListByUserIdAndActivityId(userId, activityId); | 142 | + List<CombinationRecordDO> recordList = getCombinationRecordListByUserIdAndActivityId(userId, activityId); |
| 143 | if (CollUtil.isEmpty(recordList)) { | 143 | if (CollUtil.isEmpty(recordList)) { |
| 144 | return new KeyValue<>(activity, product); | 144 | return new KeyValue<>(activity, product); |
| 145 | } | 145 | } |
| @@ -213,7 +213,7 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { | @@ -213,7 +213,7 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { | ||
| 213 | } | 213 | } |
| 214 | 214 | ||
| 215 | @Override | 215 | @Override |
| 216 | - public List<CombinationRecordDO> getRecordListByUserIdAndActivityId(Long userId, Long activityId) { | 216 | + public List<CombinationRecordDO> getCombinationRecordListByUserIdAndActivityId(Long userId, Long activityId) { |
| 217 | return recordMapper.selectListByUserIdAndActivityId(userId, activityId); | 217 | return recordMapper.selectListByUserIdAndActivityId(userId, activityId); |
| 218 | } | 218 | } |
| 219 | 219 | ||
| @@ -227,12 +227,12 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { | @@ -227,12 +227,12 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { | ||
| 227 | } | 227 | } |
| 228 | 228 | ||
| 229 | @Override | 229 | @Override |
| 230 | - public Long getRecordsCount() { | 230 | + public Long getCombinationRecordsCount() { |
| 231 | return recordMapper.selectCount(); | 231 | return recordMapper.selectCount(); |
| 232 | } | 232 | } |
| 233 | 233 | ||
| 234 | @Override | 234 | @Override |
| 235 | - public Long getRecordsSuccessCount() { | 235 | + public Long getCombinationRecordsSuccessCount() { |
| 236 | return recordMapper.selectCount(CombinationRecordDO::getStatus, CombinationRecordStatusEnum.SUCCESS.getStatus()); | 236 | return recordMapper.selectCount(CombinationRecordDO::getStatus, CombinationRecordStatusEnum.SUCCESS.getStatus()); |
| 237 | } | 237 | } |
| 238 | 238 | ||
| @@ -242,32 +242,32 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { | @@ -242,32 +242,32 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { | ||
| 242 | } | 242 | } |
| 243 | 243 | ||
| 244 | @Override | 244 | @Override |
| 245 | - public Long getRecordsCountByDateType(Integer dateType) { | 245 | + public Long getCombinationRecordsCountByDateType(Integer dateType) { |
| 246 | return recordMapper.selectCount(dateType); | 246 | return recordMapper.selectCount(dateType); |
| 247 | } | 247 | } |
| 248 | 248 | ||
| 249 | @Override | 249 | @Override |
| 250 | - public List<CombinationRecordDO> getLatestRecordList(int count) { | 250 | + public List<CombinationRecordDO> getLatestCombinationRecordList(int count) { |
| 251 | return recordMapper.selectLatestList(count); | 251 | return recordMapper.selectLatestList(count); |
| 252 | } | 252 | } |
| 253 | 253 | ||
| 254 | @Override | 254 | @Override |
| 255 | - public List<CombinationRecordDO> getRecordListWithHead(Long activityId, Integer status, Integer count) { | 255 | + public List<CombinationRecordDO> getCombinationRecordListWithHead(Long activityId, Integer status, Integer count) { |
| 256 | return recordMapper.selectList(activityId, status, count); | 256 | return recordMapper.selectList(activityId, status, count); |
| 257 | } | 257 | } |
| 258 | 258 | ||
| 259 | @Override | 259 | @Override |
| 260 | - public CombinationRecordDO getRecordById(Long id) { | 260 | + public CombinationRecordDO getCombinationRecordById(Long id) { |
| 261 | return recordMapper.selectById(id); | 261 | return recordMapper.selectById(id); |
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | @Override | 264 | @Override |
| 265 | - public List<CombinationRecordDO> getRecordListByHeadId(Long headId) { | 265 | + public List<CombinationRecordDO> getCombinationRecordListByHeadId(Long headId) { |
| 266 | return recordMapper.selectList(CombinationRecordDO::getHeadId, headId); | 266 | return recordMapper.selectList(CombinationRecordDO::getHeadId, headId); |
| 267 | } | 267 | } |
| 268 | 268 | ||
| 269 | @Override | 269 | @Override |
| 270 | - public PageResult<CombinationRecordDO> getBargainRecordPage(CombinationRecordReqPageVO pageVO) { | 270 | + public PageResult<CombinationRecordDO> getCombinationRecordPage(CombinationRecordReqPageVO pageVO) { |
| 271 | return recordMapper.selectPage(pageVO); | 271 | return recordMapper.selectPage(pageVO); |
| 272 | } | 272 | } |
| 273 | 273 |
yudao-module-mall/yudao-module-promotion-biz/src/test/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationActivityServiceImplTest.java
| @@ -111,9 +111,6 @@ public class CombinationActivityServiceImplTest extends BaseDbUnitTest { | @@ -111,9 +111,6 @@ public class CombinationActivityServiceImplTest extends BaseDbUnitTest { | ||
| 111 | o.setStartTime(null); | 111 | o.setStartTime(null); |
| 112 | o.setEndTime(null); | 112 | o.setEndTime(null); |
| 113 | o.setUserSize(null); | 113 | o.setUserSize(null); |
| 114 | - o.setTotalCount(null); | ||
| 115 | - o.setSuccessCount(null); | ||
| 116 | - o.setOrderUserCount(null); | ||
| 117 | o.setVirtualGroup(null); | 114 | o.setVirtualGroup(null); |
| 118 | o.setStatus(null); | 115 | o.setStatus(null); |
| 119 | o.setLimitDuration(null); | 116 | o.setLimitDuration(null); |
| @@ -134,12 +131,6 @@ public class CombinationActivityServiceImplTest extends BaseDbUnitTest { | @@ -134,12 +131,6 @@ public class CombinationActivityServiceImplTest extends BaseDbUnitTest { | ||
| 134 | combinationActivityMapper.insert(cloneIgnoreId(dbCombinationActivity, o -> o.setEndTime(null))); | 131 | combinationActivityMapper.insert(cloneIgnoreId(dbCombinationActivity, o -> o.setEndTime(null))); |
| 135 | // 测试 userSize 不匹配 | 132 | // 测试 userSize 不匹配 |
| 136 | combinationActivityMapper.insert(cloneIgnoreId(dbCombinationActivity, o -> o.setUserSize(null))); | 133 | combinationActivityMapper.insert(cloneIgnoreId(dbCombinationActivity, o -> o.setUserSize(null))); |
| 137 | - // 测试 totalNum 不匹配 | ||
| 138 | - combinationActivityMapper.insert(cloneIgnoreId(dbCombinationActivity, o -> o.setTotalCount(null))); | ||
| 139 | - // 测试 successNum 不匹配 | ||
| 140 | - combinationActivityMapper.insert(cloneIgnoreId(dbCombinationActivity, o -> o.setSuccessCount(null))); | ||
| 141 | - // 测试 orderUserCount 不匹配 | ||
| 142 | - combinationActivityMapper.insert(cloneIgnoreId(dbCombinationActivity, o -> o.setOrderUserCount(null))); | ||
| 143 | // 测试 virtualGroup 不匹配 | 134 | // 测试 virtualGroup 不匹配 |
| 144 | combinationActivityMapper.insert(cloneIgnoreId(dbCombinationActivity, o -> o.setVirtualGroup(null))); | 135 | combinationActivityMapper.insert(cloneIgnoreId(dbCombinationActivity, o -> o.setVirtualGroup(null))); |
| 145 | // 测试 status 不匹配 | 136 | // 测试 status 不匹配 |
| @@ -173,9 +164,6 @@ public class CombinationActivityServiceImplTest extends BaseDbUnitTest { | @@ -173,9 +164,6 @@ public class CombinationActivityServiceImplTest extends BaseDbUnitTest { | ||
| 173 | o.setStartTime(null); | 164 | o.setStartTime(null); |
| 174 | o.setEndTime(null); | 165 | o.setEndTime(null); |
| 175 | o.setUserSize(null); | 166 | o.setUserSize(null); |
| 176 | - o.setTotalCount(null); | ||
| 177 | - o.setSuccessCount(null); | ||
| 178 | - o.setOrderUserCount(null); | ||
| 179 | o.setVirtualGroup(null); | 167 | o.setVirtualGroup(null); |
| 180 | o.setStatus(null); | 168 | o.setStatus(null); |
| 181 | o.setLimitDuration(null); | 169 | o.setLimitDuration(null); |
| @@ -196,12 +184,6 @@ public class CombinationActivityServiceImplTest extends BaseDbUnitTest { | @@ -196,12 +184,6 @@ public class CombinationActivityServiceImplTest extends BaseDbUnitTest { | ||
| 196 | combinationActivityMapper.insert(cloneIgnoreId(dbCombinationActivity, o -> o.setEndTime(null))); | 184 | combinationActivityMapper.insert(cloneIgnoreId(dbCombinationActivity, o -> o.setEndTime(null))); |
| 197 | // 测试 userSize 不匹配 | 185 | // 测试 userSize 不匹配 |
| 198 | combinationActivityMapper.insert(cloneIgnoreId(dbCombinationActivity, o -> o.setUserSize(null))); | 186 | combinationActivityMapper.insert(cloneIgnoreId(dbCombinationActivity, o -> o.setUserSize(null))); |
| 199 | - // 测试 totalNum 不匹配 | ||
| 200 | - combinationActivityMapper.insert(cloneIgnoreId(dbCombinationActivity, o -> o.setTotalCount(null))); | ||
| 201 | - // 测试 successNum 不匹配 | ||
| 202 | - combinationActivityMapper.insert(cloneIgnoreId(dbCombinationActivity, o -> o.setSuccessCount(null))); | ||
| 203 | - // 测试 orderUserCount 不匹配 | ||
| 204 | - combinationActivityMapper.insert(cloneIgnoreId(dbCombinationActivity, o -> o.setOrderUserCount(null))); | ||
| 205 | // 测试 virtualGroup 不匹配 | 187 | // 测试 virtualGroup 不匹配 |
| 206 | combinationActivityMapper.insert(cloneIgnoreId(dbCombinationActivity, o -> o.setVirtualGroup(null))); | 188 | combinationActivityMapper.insert(cloneIgnoreId(dbCombinationActivity, o -> o.setVirtualGroup(null))); |
| 207 | // 测试 status 不匹配 | 189 | // 测试 status 不匹配 |