feat:不活跃用户统计list

This commit is contained in:
dzc committed 2025-04-25 12:23:46 +08:00
1 parent 0228b99844
commit eda4868b58
5 files changed
+44 -7

No files matched your search

@@ -201,13 +201,20 @@ public class WalletManageController {
return R.ok(walletManageService.scopeQbPage(page, dto, dataScope));
}
@Operation(summary = "不活跃用户钱包", description = "不活跃用户钱包")
@Operation(summary = "不活跃用户统计", description = "不活跃用户统计")
@PostMapping("/page-join-active")
public R<Page<WalletManageVo>> pageJoinActive(@ParameterObject Page page, @RequestBody WalletTopupActionDto dto) {
DataScope dataScope = new DataScope();
return R.ok(walletManageService.pageJoinActive(page, dto, dataScope));
}
@Operation(summary = "不活跃用户统计list", description = "不活跃用户统计list")
@PostMapping("/list-list-active")
public R<List<WalletManageVo>> listActive(@RequestBody WalletTopupActionDto dto) {
DataScope dataScope = new DataScope();
return R.ok(walletManageService.pageListActive(dto, dataScope));
}
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('wallet_walletManage_view')")
@@ -162,4 +162,6 @@ public interface WalletManageMapper extends PjcloudBaseMapper<WalletManageEntity
List<WalletManageBalanceVo> selectBalance(@Param("dto") WalletManageBalanceDto walletDto);
Page<WalletManageVo> activeBalancePage(Page page, @Param("dto") WalletTopupActionDto dto, @Param("unactiveDayNumberStr") String unactiveDayNumberStr);
List<WalletManageVo> activeBalanceList(@Param("dto") WalletTopupActionDto dto, @Param("unactiveDayNumberStr") String unactiveDayNumberStr);
}
@@ -68,6 +68,11 @@ public interface WalletManageService extends IService<WalletManageEntity> {
*/
Page<WalletManageVo> pageJoinActive(Page page, WalletTopupActionDto dto, DataScope dataScope);
/**
* 不活跃用户钱包
*/
List<WalletManageVo> pageListActive(WalletTopupActionDto dto, DataScope dataScope);
List<WalletManageVo> scopeQbList(WalletManageBalanceDto dto, DataScope dataScope);
WalletManageVo join(Long walletId);
@@ -298,6 +298,20 @@ public class WalletManageServiceImpl extends ServiceImpl<WalletManageMapper, Wal
return pageList;
}
/**
* 不活跃用户钱包
*/
@Override
public List<WalletManageVo> pageListActive(WalletTopupActionDto dto, DataScope dataScope) {
if (ObjectUtil.isNotEmpty(dto.getUnactiveMonthsNumber())) {
dto.setUnactiveMonthsNumber(3L);
}
String unactiveDayNumberStr = LocalDateTimeUtil.format(LocalDateTimeUtil.now().minusMonths(dto.getUnactiveMonthsNumber()), DatePattern.NORM_DATE_PATTERN);
List<WalletManageVo> list = baseMapper.activeBalanceList(dto, unactiveDayNumberStr);
disposeList(list);
return list;
}
@Override
public List<WalletManageVo> scopeQbList(WalletManageBalanceDto dto, DataScope dataScope) {
WalletManageDto walletDto = BeanUtils.toBean(dto, WalletManageDto.class);
@@ -34,7 +34,7 @@
a.freeze_price,
a.is_freeze,
a.active_bind_time,
a.active_bind_status,
a.status,
a.create_by,
a.create_time,
a.update_by,
@@ -44,7 +44,6 @@
</sql>
<sql id="whereA">
</sql>
<select id="selectBalance" resultType="com.bsd.pjcloud.wallet.api.vo.WalletManageBalanceVo">
@@ -119,15 +118,17 @@
</sql>
<select id="scopeUserPage" resultType="java.lang.Long">
<include refid="scopeUser" />
<include refid="scopeUser"/>
</select>
<delete id="scopeUserList">
<include refid="scopeUser" />
<include refid="scopeUser"/>
</delete>
<select id="activeBalancePage" resultType="com.bsd.pjcloud.wallet.api.vo.WalletManageVo">
<sql id="activeBalance">
<include refid="selectA"/>
1
from wallet_manage a
where a.del_flag = 0
and a.id not in (SELECT DISTINCT (sub.wallet_id)
FROM wallet_transaction sub
@@ -152,7 +153,7 @@
#{v}
</foreach>
</if>
AND DATE_FORMAT(sub.create_time, '%Y-%m-%d') &lt;= #{unactiveDayNumberStr})
AND DATE_FORMAT(sub.create_time, '%Y-%m-%d') &gt;= #{unactiveDayNumberStr})
<if test="dto.userId != null">
AND a.user_id = #{dto.userId}
</if>
@@ -172,5 +173,13 @@
#{v}
</foreach>
</if>
</sql>
<select id="activeBalancePage" resultType="com.bsd.pjcloud.wallet.api.vo.WalletManageVo">
<include refid="activeBalance"/>
</select>
<select id="activeBalanceList" resultType="com.bsd.pjcloud.wallet.api.vo.WalletManageVo">
<include refid="activeBalance"/>
</select>
</mapper>