-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: 拼团记录,虚拟成团数有误 #720
base: master
Are you sure you want to change the base?
fix: 拼团记录,虚拟成团数有误 #720
Conversation
@@ -240,4 +240,10 @@ public CombinationActivityDO getMatchCombinationActivityBySpuId(Long spuId) { | |||
return combinationActivityMapper.selectBySpuIdAndStatusAndNow(spuId, CommonStatusEnum.ENABLE.getStatus()); | |||
} | |||
|
|||
@Override | |||
public List<CombinationActivityDO> getByVirtualGroup() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
具体查询,建议放到 mapper 里。
service 不要有 dao 操作
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好
} | ||
|
||
// virtualGroup 为 true 的时候,查询虚拟成团的数量 | ||
List<CombinationActivityDO> activities = combinationActivityService.getByVirtualGroup(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个,是不是只查询数量?不要返回 list 去求 count
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的主要目的是查activityIds
} | ||
|
||
List<Long> activityIds = convertList(activities, CombinationActivityDO::getId); | ||
return combinationRecordMapper.selectCountByHeadAndStatusAndActivityIds(activityIds, status, headId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是不是不用 activityIds 过滤???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要activityIds过滤。从数据上看,虚拟成团(virtual_group)在 promotion_combination_record ,真实用户记 true。虚拟用户记 false。导致只能依靠activityIds筛选出虚拟成团的数据。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是不是不拿 activityIds 过滤,直接通过 “真实用户记 true。虚拟用户记 false”,也可以呀?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有个疑问:在拼团活动支持虚拟成团的情况下,一个队伍(全是真实用户),一个队伍(存在虚拟用户),那么在统计页面【拼团记录——虚拟成团(个)】预期是2 还是1?
我想了一下,是不是应该在 @GetMapping("/get-summary")
@Operation(summary = "获得拼团记录的概要信息", description = "用于拼团记录页面展示")
@PreAuthorize("@ss.hasPermission('promotion:combination-record:query')")
public CommonResult<CombinationRecordSummaryVO> getCombinationRecordSummary() {
CombinationRecordSummaryVO summaryVO = new CombinationRecordSummaryVO();
summaryVO.setUserCount(combinationRecordService.getCombinationUserCount()); // 获取拼团用户参与数量
summaryVO.setSuccessCount(combinationRecordService.getCombinationRecordCount( // 获取成团记录
CombinationRecordStatusEnum.SUCCESS.getStatus(), null, CombinationRecordDO.HEAD_ID_GROUP));
summaryVO.setVirtualGroupCount(combinationRecordService.getCombinationRecordCount(// 获取虚拟成团记录
null, Boolean.TRUE, CombinationRecordDO.HEAD_ID_GROUP));
return success(summaryVO);
} 把 summaryVO.setVirtualGroupCount(combinationRecordService.getCombinationRecordCount(// 获取虚拟成团记录
null, Boolean.TRUE, CombinationRecordDO.HEAD_ID_GROUP)); 改成 summaryVO.setVirtualGroupCount(combinationRecordService.getCombinationRecordCount(// 获取虚拟成团记录
null, Boolean.TRUE, null)); 更合理噢?就是不限制 headId |
知识星球提的关于“拼团记录,虚拟成团(个)查询有误”的PR