feat: 智聪记账管理,新增储蓄卡开卡统计功能代码提交。

This commit is contained in:
tianyongbao
2025-03-05 09:36:28 +08:00
parent ba23989d59
commit 67b9ea5023
8 changed files with 315 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ import com.intc.invest.domain.dto.AccountsDto;
import com.intc.invest.domain.dto.AnalysisDto;
import com.intc.invest.domain.vo.AccountCalendarVo;
import com.intc.invest.domain.vo.AccountsVo;
import com.intc.invest.domain.vo.OpenCardVo;
import com.intc.invest.service.IStatisticAnalysisService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -185,7 +186,15 @@ public class StatisticAnalysisController extends BaseController {
return getDataTable(list);
}
/**
* 查询储蓄卡开卡统计数据
*/
@ApiOperation(value="查询储蓄卡开卡统计数据",response = OpenCardVo.class)
@GetMapping("/openCardList")
public Map<String,Object> selectOpenCardList(AnalysisDto analysisDto)
{
Map<String, Object> resultMap = iStatisticAnalysisService.selectOpenCardList(analysisDto);
return AjaxResult.success(resultMap);
}
}

View File

@@ -50,4 +50,15 @@ public class BankCardLendDto extends BaseEntity implements Serializable
@ApiModelProperty(value="还款账户flag")
private String repayFlag;
private String staticFlag;
/** 结束月份 */
@ApiModelProperty(value="结束月份")
private String endMonth;
/** 开始月份 */
@ApiModelProperty(value="开始月份")
private String startMonth;
}

View File

@@ -0,0 +1,22 @@
package com.intc.invest.domain.vo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
/**
*
* @author tianyongbao
* @date 2025-03-04
*/
@ApiModel("开卡数据Vo对象")
@Data
public class OpenCardVo
{
private String type;
private String name;
private Integer count;
}

View File

@@ -105,4 +105,12 @@ public interface StatisticAnalysisMapper {
public List<AccountsVo> selectAccountsList(AccountsDto accountsDto);
/**
* 查询储蓄卡开卡统计数据
*
* @return 储蓄卡信息集合
*/
@DataScope(businessAlias = "t")
public List<OpenCardVo> selectOpenCardList(AccountsDto accountsDto);
}

View File

@@ -63,5 +63,12 @@ public interface IStatisticAnalysisService {
*/
public List<AccountsVo> selectAccountsList(AccountsDto accountsDto);
/**
* 查询储蓄卡开卡统计数据
*
* @return 记账账户集合
*/
public Map<String, Object> selectOpenCardList(AnalysisDto analysisDto);
}

View File

@@ -3284,4 +3284,150 @@ public class StatisticAnalysisImpl implements IStatisticAnalysisService {
}
return accountsList;
}
@Override
public Map<String, Object> selectOpenCardList(AnalysisDto analysisDto) {
//返回数据
HashMap<String, Object> map = new HashMap<>();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
//月查询
if(analysisDto.getType().equals("2")){
if(StringUtils.isEmpty(analysisDto.getStartTime())&&StringUtils.isEmpty(analysisDto.getEndTime())){
String endTime=dateFormat.format(DateUtils.addMonths(DateUtils.getNowDate(),-1));
String startTime=dateFormat.format(DateUtils.addMonths(DateUtils.getNowDate(),-2400));
analysisDto.setStartTime(startTime);
analysisDto.setEndTime(endTime);
}else {
analysisDto.setStartTime(analysisDto.getStartTime()+"-01");
analysisDto.setEndTime(analysisDto.getEndTime()+"-31");
}
//年查询
}else if(analysisDto.getType().equals("3")){
if(StringUtils.isEmpty(analysisDto.getStartTime())&&StringUtils.isEmpty(analysisDto.getEndTime())){
String endTime=dateFormat.format(DateUtils.getNowDate());
String startTime=dateFormat.format(DateUtils.addYears(DateUtils.getNowDate(),-500));
analysisDto.setStartTime(startTime);
analysisDto.setEndTime(endTime);
}else {
analysisDto.setStartTime(analysisDto.getStartTime()+"-01-01");
analysisDto.setEndTime(analysisDto.getEndTime()+"-12-31");
}
}
DecimalFormat decimalFormat = new DecimalFormat("#.##");
//获取数据
List<BankCardLendVo> bankCardLendVoList=new ArrayList<>();
BankCardLendDto bankCardLendDto=new BankCardLendDto();
bankCardLendDto.setStartMonth(analysisDto.getStartTime().substring(0,7));
bankCardLendDto.setEndMonth(analysisDto.getEndTime().substring(0,7));
//只统计一类卡和二类卡
bankCardLendDto.setStaticFlag("1");
bankCardLendVoList=bankCardLendMapper.selectBankCardLendList(bankCardLendDto);
//修改名称加卡号
for (BankCardLendVo vo : bankCardLendVoList) {
if(vo.getCode()!=null){
vo.setNameCode(vo.getName()+""+ vo.getCode()+"");
}else {
vo.setNameCode(vo.getName());
}
}
List<BankCardLendVo> debietList=new ArrayList<>();
if("2".equals(analysisDto.getType())){
//月列表
List <String> staticsTimeList=new ArrayList<>();
for (BankCardLendVo vo:bankCardLendVoList
) {
String monthString=dateFormat.format(vo.getActivationDate()).substring(0,7);
if(!staticsTimeList.contains(monthString)){
staticsTimeList.add(monthString);
}
}
for (String staticsTime :staticsTimeList
) {
String details="";
int actualCreditBillMonth=0;
for (BankCardLendVo vo:bankCardLendVoList
) {
String monthString=dateFormat.format(vo.getActivationDate()).substring(0,7);
if(staticsTime.equals(monthString)){
actualCreditBillMonth++;
details+=vo.getNameCode()+""+dateFormat.format(vo.getActivationDate())+""+vo.getOpeningBank()+" 开户;<br/>";
}
}
BankCardLendVo analysisVo=new BankCardLendVo();
analysisVo.setName(actualCreditBillMonth+"");
analysisVo.setCode(staticsTime);
analysisVo.setRemark(details);
debietList.add(analysisVo);
}
//年查询
}else if("3".equals(analysisDto.getType())){
//月列表
List <String> staticsTimeList=new ArrayList<>();
for (BankCardLendVo vo:bankCardLendVoList
) {
String monthString=dateFormat.format(vo.getActivationDate()).substring(0,4);
if(!staticsTimeList.contains(monthString)){
staticsTimeList.add(monthString);
}
}
for (String staticsTime :staticsTimeList
) {
String details="";
int actualCreditBillMonth=0;
for (BankCardLendVo vo:bankCardLendVoList
) {
String monthString=dateFormat.format(vo.getActivationDate()).substring(0,4);
if(staticsTime.equals(monthString)){
actualCreditBillMonth++;
details+=vo.getNameCode()+""+dateFormat.format(vo.getActivationDate())+""+vo.getOpeningBank()+" 开户;<br/>";
}
}
BankCardLendVo analysisVo=new BankCardLendVo();
analysisVo.setName(actualCreditBillMonth+"");
analysisVo.setCode(staticsTime);
analysisVo.setRemark(details);
debietList.add(analysisVo);
}
}
ArrayList<Map<String, Object>> debitList = new ArrayList<>();
ArrayList<Map<String, Object>> tableDebitList = new ArrayList<>();
for (BankCardLendVo bankCardLendVo:debietList
) {
Map<String, Object> datamap = new HashMap<>();
datamap.put("time", bankCardLendVo.getCode());
datamap.put("detail", bankCardLendVo.getRemark());
datamap.put("value", bankCardLendVo.getName());
tableDebitList.add(datamap);
}
Collections.reverse(debietList);
for (BankCardLendVo bankCardLendVo:debietList
) {
Map<String, Object> datamap = new HashMap<>();
datamap.put("time", bankCardLendVo.getCode());
datamap.put("value", bankCardLendVo.getName());
debitList.add(datamap);
}
List<OpenCardVo> accountsList=statisticAnalysisMapper.selectOpenCardList(new AccountsDto());
//列表
map.put("accountsList",accountsList);
map.put("debitList",debitList);
map.put("tableDebitList",tableDebitList);
return map;
}
}