## 看板充值数据;

This commit is contained in:
cabbage 2025-05-13 18:06:45 +08:00
parent 623a78b391
commit 35723dbd96
9 changed files with 184 additions and 5 deletions

View File

@ -5,10 +5,7 @@ import com.hzs.common.core.utils.BigDecimalUtil;
import com.hzs.common.core.web.controller.BaseController;
import com.hzs.common.core.web.domain.AjaxResult;
import com.hzs.system.board.service.IBoardService;
import com.hzs.system.board.vo.BoardAchieveVO;
import com.hzs.system.board.vo.BoardDayAchieveVO;
import com.hzs.system.board.vo.BoardMemberLevelVO;
import com.hzs.system.board.vo.BoardMemberVO;
import com.hzs.system.board.vo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@ -107,4 +104,34 @@ public class BoardController extends BaseController {
return AjaxResult.success(boardAchieveVO);
}
/**
* 充值汇总数据
*
* @return
*/
@GetMapping("/recharge-summary")
public AjaxResult rechargeSummary() {
BoardRechargeVO boardRechargeVO = new BoardRechargeVO();
boardRechargeVO.setRechargeTodayList(new ArrayList<>(6));
boardRechargeVO.setRechargeYesterdayLevelList(new ArrayList<>(6));
boardRechargeVO.setRechargeMonthLevelList(new ArrayList<>(6));
// 会员汇总数据
List<BoardRechargeAccountVO> rechargeList = iBoardService.listAccountRechargeBoard();
for (BoardRechargeAccountVO boardMemberVO : rechargeList) {
if (boardMemberVO.getSort() == 0) {
// 今日
boardRechargeVO.getRechargeTodayList().add(boardMemberVO);
} else if (boardMemberVO.getSort() == 1) {
// 昨日
boardRechargeVO.getRechargeYesterdayLevelList().add(boardMemberVO);
} else {
// 本月
boardRechargeVO.getRechargeMonthLevelList().add(boardMemberVO);
}
}
return AjaxResult.success(boardRechargeVO);
}
}

View File

@ -3,6 +3,7 @@ package com.hzs.system.board.mapper;
import com.hzs.system.board.vo.BoardAchieveVO;
import com.hzs.system.board.vo.BoardMemberLevelVO;
import com.hzs.system.board.vo.BoardMemberVO;
import com.hzs.system.board.vo.BoardRechargeAccountVO;
import java.util.List;
@ -39,4 +40,11 @@ public interface BoardMapper {
*/
BoardAchieveVO getMonthAchieve();
/**
* 各币种充值数据
*
* @return
*/
List<BoardRechargeAccountVO> listAccountRechargeBoard();
}

View File

@ -3,6 +3,7 @@ package com.hzs.system.board.service;
import com.hzs.system.board.vo.BoardAchieveVO;
import com.hzs.system.board.vo.BoardMemberLevelVO;
import com.hzs.system.board.vo.BoardMemberVO;
import com.hzs.system.board.vo.BoardRechargeAccountVO;
import java.util.List;
@ -39,4 +40,11 @@ public interface IBoardService {
*/
BoardAchieveVO getMonthAchieve();
/**
* 各币种充值数据
*
* @return
*/
List<BoardRechargeAccountVO> listAccountRechargeBoard();
}

View File

@ -5,6 +5,7 @@ import com.hzs.system.board.service.IBoardService;
import com.hzs.system.board.vo.BoardAchieveVO;
import com.hzs.system.board.vo.BoardMemberLevelVO;
import com.hzs.system.board.vo.BoardMemberVO;
import com.hzs.system.board.vo.BoardRechargeAccountVO;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -39,4 +40,9 @@ public class BoardServiceImpl implements IBoardService {
return boardMapper.getMonthAchieve();
}
@Override
public List<BoardRechargeAccountVO> listAccountRechargeBoard() {
return boardMapper.listAccountRechargeBoard();
}
}

View File

@ -4,6 +4,9 @@ import lombok.Data;
import java.io.Serializable;
/**
* 看板会员等级数据
*/
@Data
public class BoardMemberLevelVO implements Serializable {

View File

@ -29,7 +29,7 @@ public class BoardMemberVO implements Serializable {
*/
private Integer memberYesterday;
/**
* 日会员等级
* 日会员等级
*/
private List<BoardMemberLevelVO> memberYesterdayLevelList;

View File

@ -0,0 +1,28 @@
package com.hzs.system.board.vo;
import lombok.Data;
import java.io.Serializable;
/**
* 看板各币种充值数据
*/
@Data
public class BoardRechargeAccountVO implements Serializable {
/**
* 账户名称
*/
private String accountName;
/**
* 充值金额
*/
private Integer rechargeAmount;
/**
* 0=今日1=昨日2=当月
*/
private Integer sort;
}

View File

@ -0,0 +1,30 @@
package com.hzs.system.board.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 看板充值数据
*/
@Data
public class BoardRechargeVO implements Serializable {
/**
* 今日充值
*/
private List<BoardRechargeAccountVO> rechargeTodayList;
/**
* 昨日充值
*/
private List<BoardRechargeAccountVO> rechargeYesterdayLevelList;
/**
* 本月充值
*/
private List<BoardRechargeAccountVO> rechargeMonthLevelList;
}

View File

@ -161,4 +161,73 @@
) b on 1 = 1
</select>
<!-- 各币种充值数据 -->
<select id="listAccountRechargeBoard" resultType="com.hzs.system.board.vo.BoardRechargeAccountVO">
select ba.account_name, nvl(a.recharge_amount, 0) recharge_amount, 0 sort
from (select t.pk_account, sum(t.recharge_amount) recharge_amount
from CU_MEMBER_RECHARGE t
where t.del_flag = 0
and t.recharge_amount != 0
and t.pk_account in
(select t.pk_id
from bd_account t
where t.del_flag = 0
and t.enable_state = 0
and t.pk_country = 1
and t.field_value in (1, 2, 3, 4))
and ((t.recharge_source = 1 and t.approve_state = 2) or
(t.recharge_source = 0 and t.approve_state = 2))
and to_char(t.modified_time, 'yyyy-mm-dd') =
to_char(sysdate, 'yyyy-mm-dd')
group by t.pk_account) a
right join bd_account ba
on ba.pk_id = a.pk_account
and ba.del_flag = 0
where ba.field_value in (1, 2, 3, 4)
union all
select ba.account_name, nvl(a.recharge_amount, 0) recharge_amount, 1 sort
from (select t.pk_account, sum(t.recharge_amount) recharge_amount
from CU_MEMBER_RECHARGE t
where t.del_flag = 0
and t.recharge_amount != 0
and t.pk_account in
(select t.pk_id
from bd_account t
where t.del_flag = 0
and t.enable_state = 0
and t.pk_country = 1
and t.field_value in (1, 2, 3, 4))
and ((t.recharge_source = 1 and t.approve_state = 2) or
(t.recharge_source = 0 and t.approve_state = 2))
and to_char(t.modified_time, 'yyyy-mm-dd') =
to_char(sysdate - 1, 'yyyy-mm-dd')
group by t.pk_account) a
right join bd_account ba
on ba.pk_id = a.pk_account
and ba.del_flag = 0
where ba.field_value in (1, 2, 3, 4)
union all
select ba.account_name, nvl(a.recharge_amount, 0) recharge_amount, 2 sort
from (select t.pk_account, sum(t.recharge_amount) recharge_amount
from CU_MEMBER_RECHARGE t
where t.del_flag = 0
and t.recharge_amount != 0
and t.pk_account in
(select t.pk_id
from bd_account t
where t.del_flag = 0
and t.enable_state = 0
and t.pk_country = 1
and t.field_value in (1, 2, 3, 4))
and ((t.recharge_source = 1 and t.approve_state = 2) or
(t.recharge_source = 0 and t.approve_state = 2))
and to_char(t.modified_time, 'yyyy-mm') =
to_char(sysdate - 1, 'yyyy-mm')
group by t.pk_account) a
right join bd_account ba
on ba.pk_id = a.pk_account
and ba.del_flag = 0
where ba.field_value in (1, 2, 3, 4)
</select>
</mapper>