diff --git a/intc-modules/intc-gen/src/main/resources/vm/vue/v3/index.vue.vm b/intc-modules/intc-gen/src/main/resources/vm/vue/v3/index.vue.vm
deleted file mode 100644
index 9bc3b46..0000000
--- a/intc-modules/intc-gen/src/main/resources/vm/vue/v3/index.vue.vm
+++ /dev/null
@@ -1,604 +0,0 @@
-
-
-
-
查询条件
-
- #foreach($column in $columns)
- #if($column.query)
- #set($dictType=$column.dictType)
- #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
- #set($parentheseIndex=$column.columnComment.indexOf("("))
- #if($parentheseIndex != -1)
- #set($comment=$column.columnComment.substring(0, $parentheseIndex))
- #else
- #set($comment=$column.columnComment)
- #end
- #if($column.htmlType == "input")
-
-
-
- #elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType)
-
-
-
-
-
- #elseif(($column.htmlType == "select" || $column.htmlType == "radio") && $dictType)
-
-
-
-
-
- #elseif($column.htmlType == "datetime" && $column.queryType != "BETWEEN")
-
-
-
-
- #elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
-
-
-
- #end
- #end
- #end
-
-
- 搜索
- 重置
-
-
-
-
-
基本信息
-
- 新增
- 删除
- 导出
-
-
-
-
-
- #foreach($column in $columns)
- #set($javaField=$column.javaField)
- #set($parentheseIndex=$column.columnComment.indexOf("("))
- #if($parentheseIndex != -1)
- #set($comment=$column.columnComment.substring(0, $parentheseIndex))
- #else
- #set($comment=$column.columnComment)
- #end
- #if($column.pk)
-
- #elseif($column.list && $column.htmlType == "datetime")
-
-
- {{ parseTime(scope.row.${javaField}, '{y}-{m}-{d}') }}
-
-
- #elseif($column.list && $column.htmlType == "imageUpload")
-
-
-
-
-
- #elseif($column.list && "" != $column.dictType)
-
-
- #if($column.htmlType == "checkbox")
-
- #else
-
- #end
-
-
- #elseif($column.list && "" != $javaField)
-
- #end
- #end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #foreach($column in $columns)
- #set($field=$column.javaField)
- #if($column.insert && !$column.pk)
- #if(($column.usableColumn) || (!$column.superColumn))
- #set($parentheseIndex=$column.columnComment.indexOf("("))
- #if($parentheseIndex != -1)
- #set($comment=$column.columnComment.substring(0, $parentheseIndex))
- #else
- #set($comment=$column.columnComment)
- #end
- #set($dictType=$column.dictType)
- #if($column.htmlType == "input")
-
-
-
- #elseif($column.htmlType == "imageUpload")
-
-
-
- #elseif($column.htmlType == "fileUpload")
-
-
-
- #elseif($column.htmlType == "editor")
-
-
-
- #elseif($column.htmlType == "select" && "" != $dictType)
-
-
-
-
-
- #elseif($column.htmlType == "select" && $dictType)
-
-
-
-
-
- #elseif($column.htmlType == "checkbox" && "" != $dictType)
-
-
-
- {{dict.label}}
-
-
-
- #elseif($column.htmlType == "checkbox" && $dictType)
-
-
- 请选择字典生成
-
-
- #elseif($column.htmlType == "radio" && "" != $dictType)
-
-
- {{dict.label}}
-
-
- #elseif($column.htmlType == "radio" && $dictType)
-
-
- 请选择字典生成
-
-
- #elseif($column.htmlType == "datetime")
-
-
-
-
- #elseif($column.htmlType == "textarea")
-
-
-
- #end
- #end
- #end
- #end
- #if($table.sub)
- ${subTable.functionName}信息
-
-
- 添加
-
-
- 删除
-
-
-
-
-
- #foreach($column in $subTable.columns)
- #set($javaField=$column.javaField)
- #set($parentheseIndex=$column.columnComment.indexOf("("))
- #if($parentheseIndex != -1)
- #set($comment=$column.columnComment.substring(0, $parentheseIndex))
- #else
- #set($comment=$column.columnComment)
- #end
- #if($column.pk || $javaField == ${subTableFkclassName})
- #elseif($column.list && $column.htmlType == "input")
-
-
-
-
-
- #elseif($column.list && $column.htmlType == "datetime")
-
-
-
-
-
-
- #elseif($column.list && ($column.htmlType == "select" || $column.htmlType == "radio") && "" != $column.dictType)
-
-
-
-
-
-
-
- #elseif($column.list && ($column.htmlType == "select" || $column.htmlType == "radio") && "" == $column.dictType)
-
-
-
-
-
-
-
- #end
- #end
-
- #end
-
-
-
-
-
-
-
-
-
diff --git a/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/vo/InstallmentHistoryDetailVo.java b/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/vo/InstallmentHistoryDetailVo.java
deleted file mode 100644
index b7594e7..0000000
--- a/intc-modules/intc-invest/src/main/java/com/intc/invest/domain/vo/InstallmentHistoryDetailVo.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.intc.invest.domain.vo;
-
-import com.intc.invest.domain.InstallmentHistoryDetail;
-import io.swagger.annotations.ApiModel;
-import lombok.Data;
-/**
- * 分期历史明细Vo对象 installment_history_detail
- *
- * @author tianyongbao
- * @date 2024-03-23
- */
-@ApiModel("分期历史明细Vo对象")
-@Data
-public class InstallmentHistoryDetailVo extends InstallmentHistoryDetail
-{
- private String bankCardLendName;
-
- private String repaymentAccountName;
-
-}
diff --git a/intc-modules/intc-invest/src/main/java/com/intc/invest/service/impl/StatisticAnalysisImpl.java b/intc-modules/intc-invest/src/main/java/com/intc/invest/service/impl/StatisticAnalysisImpl.java
deleted file mode 100644
index c08d005..0000000
--- a/intc-modules/intc-invest/src/main/java/com/intc/invest/service/impl/StatisticAnalysisImpl.java
+++ /dev/null
@@ -1,3430 +0,0 @@
-package com.intc.invest.service.impl;
-
-import com.alibaba.fastjson2.JSON;
-import com.intc.common.core.utils.DateUtils;
-import com.intc.common.core.utils.StringUtils;
-import com.intc.common.security.utils.DictUtils;
-import com.intc.invest.domain.dto.*;
-import com.intc.invest.domain.vo.*;
-import com.intc.invest.mapper.*;
-import com.intc.invest.service.IStatisticAnalysisService;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.math.BigDecimal;
-import java.text.DecimalFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.stream.Collectors;
-
-@Service
-public class StatisticAnalysisImpl implements IStatisticAnalysisService {
-
- @Resource
- private BankCardLendMapper bankCardLendMapper;
-
- @Resource
- private CreditCardBillMapper creditCardBillMapper;
-
- @Resource
- private FutureStocksBillMapper futureStocksBillMapper;
-
- @Resource
- private FutureStocksMapper futureStocksMapper;
-
- @Resource
- private PosMachineMapper posMachineMapper;
-
- @Resource
- private InstallmentHistoryMapper installmentHistoryMapper;
-
- @Resource
- private InstallmentHistoryDetailMapper installmentHistoryDetailMapper;
-
- @Resource
- private StatisticAnalysisMapper statisticAnalysisMapper;
-
- @Resource
- private CreditReportQueryRecordMapper creditReportQueryRecordMapper;
-
- @Resource
- private AccountsMapper accountsMapper;
-
- @Resource
- private AccountsTransferRecordMapper accountsTransferRecordMapper;
-
- @Resource
- private AccountsDealRecordMapper accountsDealRecordMapper;
-
- @Override
- public Map getPosAccountsInfo() {
- //返回数据
- HashMap map = new HashMap<>();
- //Pos机
- PosMachineDto posMachineDto=new PosMachineDto();
- //状态为正常使用
- posMachineDto.setStatus("1");
- map.put("posCount",posMachineMapper.selectPosMachineList(posMachineDto).size());
-
- DecimalFormat decimalFormat = new DecimalFormat("#.##");
-
- AccountsTransferRecordDto dto=new AccountsTransferRecordDto();
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
- //当前日期
- Date queryDate=DateUtils.getNowDate();
-
- Calendar calendarStart = Calendar.getInstance();
- calendarStart.add(Calendar.MONTH, 0);
- calendarStart.set(Calendar.DAY_OF_MONTH, 1);//1:本月第一天
- //获取数据
- dto.setEndTime(dateFormat.format(queryDate));
- dto.setStartTime(dateFormat.format(calendarStart.getTime()));
- dto.setType("1");
- List transferList=accountsTransferRecordMapper.selectAccountsTransferRecordList(dto);
-
- double currentMonthAmount =0;
- double currentMonthCommission =0;
- int currentMonthCount =0;
- double actualAmount =0;
- if(transferList.size()>0){
- currentMonthCommission=transferList.stream().mapToDouble(AccountsTransferRecordVo::getCommission).sum();
- currentMonthAmount=transferList.stream().mapToDouble(AccountsTransferRecordVo::getAmount).sum();
- }
- currentMonthCount=transferList.size();
- map.put("currentMonthAmount",decimalFormat.format(currentMonthAmount));
- map.put("currentMonthCommission",decimalFormat.format(currentMonthCommission));
- map.put("currentMonthCount",currentMonthCount);
-
- calendarStart= Calendar.getInstance();
- calendarStart.set(Calendar.DAY_OF_YEAR, 1);//本年的第一天
- dto.setStartTime(dateFormat.format(calendarStart.getTime()));
- transferList=accountsTransferRecordMapper.selectAccountsTransferRecordList(dto);
-
- double currentYearAmount =0;
- double currentYearCommission =0;
- int currentYearCount =0;
- if(transferList.size()>0){
- currentYearCommission=transferList.stream().mapToDouble(AccountsTransferRecordVo::getCommission).sum();
- currentYearAmount=transferList.stream().mapToDouble(AccountsTransferRecordVo::getAmount).sum();
- }
-
- currentYearCount=transferList.size();
- map.put("currentYearAmount",decimalFormat.format(currentYearAmount));
- map.put("currentYearCommission",decimalFormat.format(currentYearCommission));
- map.put("currentYearCount",currentYearCount);
- dto.setStartTime("");
- transferList=accountsTransferRecordMapper.selectAccountsTransferRecordList(dto);
-
- double accumulateAmount =0;
- double accumulateCommission =0;
- int accumulateCount =0;
- if(transferList.size()>0){
- accumulateCommission=transferList.stream().mapToDouble(AccountsTransferRecordVo::getCommission).sum();
- accumulateAmount=transferList.stream().mapToDouble(AccountsTransferRecordVo::getAmount).sum();
- }
- accumulateCount=transferList.size();
- map.put("accumulateAmount",decimalFormat.format(accumulateAmount));
- map.put("accumulateCommission",decimalFormat.format(accumulateCommission));
- map.put("accumulateCount",accumulateCount);
-
- return map;
- }
-
- @Override
- public Map getCreditAccountsInfo() {
- //返回数据
- HashMap map = new HashMap<>();
- DecimalFormat decimalFormat = new DecimalFormat("#.##");
- SimpleDateFormat formatterMonth = new SimpleDateFormat("yyyy-MM");
-
-
- //当月信用卡账单
- SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy年MM月账单");
- CreditCardBillDto creditCardBillDto=new CreditCardBillDto();
- creditCardBillDto.setName(simpleDateFormat.format(DateUtils.getNowDate()));
- List creditCardBillList=creditCardBillMapper.selectCreditCardBillList(creditCardBillDto);
- double currentCreditBill = creditCardBillList.stream().mapToDouble(CreditCardBillVo::getBillAmount).sum();
- map.put("currentCreditBill",decimalFormat.format(currentCreditBill));
-
- //信用卡分期当月应还款
- InstallmentHistoryDetailDto detailDto=new InstallmentHistoryDetailDto();
- detailDto.setRepaymentMonth(formatterMonth.format(new Date()));
- detailDto.setType("2");
- List detailList=installmentHistoryDetailMapper.selectInstallmentHistoryDetailList(detailDto);
- double creditInstallment = detailList.stream().mapToDouble(InstallmentHistoryDetailVo::getCurrentAmount).sum();
- map.put("creditInstallment",decimalFormat.format(creditInstallment));
-
- detailDto.setState("0");
- detailDto.setRepaymentMonth("");
- detailList=installmentHistoryDetailMapper.selectInstallmentHistoryDetailList(detailDto);
- double unclearedCreditInstallment = 0;
- double unclearedCreditInstallmentPrinciple = 0;
- double unclearedCreditInstallmentInterest = 0;
- if(detailList.size()>0){
-
- unclearedCreditInstallmentPrinciple=detailList.stream().mapToDouble(InstallmentHistoryDetailVo::getPrincipal).sum();
- unclearedCreditInstallmentInterest=detailList.stream().mapToDouble(InstallmentHistoryDetailVo::getInterest).sum();
- unclearedCreditInstallment=unclearedCreditInstallmentPrinciple+unclearedCreditInstallmentInterest;
- }
- map.put("unclearedCreditInstallment",decimalFormat.format(unclearedCreditInstallment));
- map.put("unclearedCreditInstallmentPrinciple",decimalFormat.format(unclearedCreditInstallmentPrinciple));
- map.put("unclearedCreditInstallmentInterest",decimalFormat.format(unclearedCreditInstallmentInterest));
-
- //已结清信用卡分期数据
- InstallmentHistoryDto installmentHistoryDto=new InstallmentHistoryDto();
- installmentHistoryDto.setState("1");
- installmentHistoryDto.setType("2");
- List installmentHistoryList=installmentHistoryMapper.selectInstallmentHistoryList(installmentHistoryDto);
- double clearedCreditInstallmentDebt =0;
- double clearedCreditInstallmentPrinciple =0;
- double clearedCreditInstallmentInterest =0;
- if(installmentHistoryList.size()>0){
- clearedCreditInstallmentPrinciple = installmentHistoryList.stream().mapToDouble(InstallmentHistoryVo::getInstallmentAmount).sum();
- clearedCreditInstallmentInterest = installmentHistoryList.stream().mapToDouble(InstallmentHistoryVo::getTotalInterest).sum();
- clearedCreditInstallmentDebt=clearedCreditInstallmentPrinciple+clearedCreditInstallmentInterest;
- }
- map.put("clearedCreditInstallmentDebt",decimalFormat.format(clearedCreditInstallmentDebt));
- map.put("clearedCreditInstallmentPrinciple",decimalFormat.format(clearedCreditInstallmentPrinciple));
- map.put("clearedCreditInstallmentInterest",decimalFormat.format(clearedCreditInstallmentInterest));
-
- int clearedCreditInstallmentCount = installmentHistoryList.size();
- map.put("clearedCreditInstallmentCount",clearedCreditInstallmentCount);
-
- installmentHistoryDto.setState("0");
- installmentHistoryDto.setType("2");
- installmentHistoryList=installmentHistoryMapper.selectInstallmentHistoryList(installmentHistoryDto);
- int unclearedCreditInstallmentCount = installmentHistoryList.size();
- map.put("unclearedCreditInstallmentCount",unclearedCreditInstallmentCount);
-
-
- //信用卡额度
- BankCardLendDto bankCardLendDto=new BankCardLendDto();
-
- //状态为正常使用
- bankCardLendDto.setStatus("1");
- bankCardLendDto.setType("2");
-
- List bankCardLendVoList=bankCardLendMapper.selectBankCardLendList(bankCardLendDto);
- //信用卡
- map.put("creditCount",bankCardLendVoList.size());
- int creditLimit = bankCardLendVoList.stream().mapToInt(BankCardLendVo::getCreditLimit).sum();
- map.put("creditLimit",creditLimit);
- AccountsDto dto=new AccountsDto();
- //正常使用
- dto.setStatus("1");
- //信用卡
- dto.setType("2");
- List accountsList=accountsMapper.selectAccountsList(dto);
- double creditAvailableLimit =0;
- double creditBalance =0;
- if(accountsList.size()>0){
- creditAvailableLimit=accountsList.stream().mapToDouble(AccountsVo::getAvailableLimit).sum();
- creditBalance=accountsList.stream().mapToDouble(AccountsVo::getBalance).sum()*(-1);
- }
- map.put("creditAvailableLimit",decimalFormat.format(creditAvailableLimit));
- map.put("creditBalance",decimalFormat.format(creditBalance));
- //使用率
- double creditBillRate;
- if (creditLimit != 0) {
- creditBillRate= ((creditBalance) * 100) /creditLimit;
- }else {
- creditBillRate= 0;
- }
- map.put("creditBillRate", decimalFormat.format(creditBillRate));
-
- //上月信用卡账单
- Calendar calendar = Calendar.getInstance();
- calendar.setTime(DateUtils.getNowDate());
- calendar.add(Calendar.MONTH, -1);
- creditCardBillDto.setName(simpleDateFormat.format(calendar.getTime()));
- creditCardBillList=creditCardBillMapper.selectCreditCardBillList(creditCardBillDto);
- double lastMonthUsedLimit = creditCardBillList.stream().mapToDouble(CreditCardBillVo::getBillAmount).sum();
- map.put("lastMonthUsedLimit",decimalFormat.format(lastMonthUsedLimit));
-
-
- //使用率
- double lastMonthUsedRate;
- if (creditLimit != 0) {
- lastMonthUsedRate= ((lastMonthUsedLimit) * 100) /creditLimit;
- }else {
- lastMonthUsedRate= 0;
- }
- map.put("lastMonthUsedRate", decimalFormat.format(lastMonthUsedRate));
-
-
-
- //近6个月月信用卡账单
- creditCardBillDto.setName("");
- Calendar startMonth = Calendar.getInstance();
- startMonth.setTime(DateUtils.getNowDate());
- startMonth.add(Calendar.MONTH, -6);
- creditCardBillDto.setStartMonth(formatterMonth.format(startMonth.getTime()));
- Calendar endMonth = Calendar.getInstance();
- endMonth.setTime(DateUtils.getNowDate());
- endMonth.add(Calendar.MONTH, -1);
- creditCardBillDto.setEndMonth(formatterMonth.format(endMonth.getTime()));
- creditCardBillList=creditCardBillMapper.selectCreditCardBillList(creditCardBillDto);
- double lastSixMonthUsedLimit = creditCardBillList.stream().mapToDouble(CreditCardBillVo::getBillAmount).sum();
- map.put("lastSixMonthUsedLimit",decimalFormat.format(lastSixMonthUsedLimit/6));
- //近6个月月信用卡使用率
- double lastSixMonthUsedRate;
- if (creditLimit != 0) {
- lastSixMonthUsedRate= lastSixMonthUsedLimit*100/(6*creditLimit);
- }else {
- lastSixMonthUsedRate= 0;
- }
- map.put("lastSixMonthUsedRate", decimalFormat.format(lastSixMonthUsedRate));
-
-
- return map;
- }
-
-
- @Override
- public Map getDebitAccountsInfo() {
- //返回数据
- HashMap map = new HashMap<>();
- DecimalFormat decimalFormat = new DecimalFormat("#.##");
-
- AccountsDto dto=new AccountsDto();
- //状态正常,不隐藏
- dto.setStatus("1");
- //储蓄卡
- dto.setType("1");
-
- //I类储蓄卡
- dto.setDebitType("1");
- List accountsList=accountsMapper.selectAccountsList(dto);
- double debitIBalance =0;
- Integer debitICount =0;
- if(accountsList.size()>0){
- debitIBalance=accountsList.stream().mapToDouble(AccountsVo::getAvailableLimit).sum();
- }
- //I类储蓄卡数量
- debitICount=accountsList.size();
- map.put("debitICount",debitICount);
- //I类储蓄卡余额
- map.put("debitIBalance",decimalFormat.format(debitIBalance));
- //II类储蓄卡
- dto.setDebitType("2");
- accountsList=accountsMapper.selectAccountsList(dto);
- double debitIIBalance =0;
- Integer debitIICount =0;
- if(accountsList.size()>0){
- debitIIBalance=accountsList.stream().mapToDouble(AccountsVo::getAvailableLimit).sum();
- }
- //II类储蓄卡余额
- map.put("debitIIBalance",decimalFormat.format(debitIIBalance));
- //II类储蓄卡数量
- debitIICount=accountsList.size();
- map.put("debitICount",debitICount);
- map.put("debitIICount",debitIICount);
- //储蓄卡数量
- map.put("debitCount",debitICount+debitIICount);
- //储蓄卡余额=I类储蓄卡余额+II类储蓄卡余额
- map.put("debitBalance",decimalFormat.format(debitIBalance+debitIIBalance));
- //网络账户余额
- dto.setDebitType("3");
- accountsList=accountsMapper.selectAccountsList(dto);
- double debitOnlineBalance =0;
- if(accountsList.size()>0){
- debitOnlineBalance=accountsList.stream().mapToDouble(AccountsVo::getAvailableLimit).sum();
- }
- map.put("debitOnlineBalance",decimalFormat.format(debitOnlineBalance));
- map.put("debitOnlineCount",accountsList.size());
- //储值卡余额
- dto.setDebitType("4");
- accountsList=accountsMapper.selectAccountsList(dto);
- double storedValueCardBalance =0;
- if(accountsList.size()>0){
- storedValueCardBalance=accountsList.stream().mapToDouble(AccountsVo::getAvailableLimit).sum();
- }
- //储值卡总数
- map.put("storedValueCardCount",accountsList.size());
- //储值卡余额
- map.put("storedValueCardBalance",decimalFormat.format(storedValueCardBalance));
- //住房公积金余额
- dto.setDebitType("5");
- accountsList=accountsMapper.selectAccountsList(dto);
- double housingFundBalance =0;
- if(accountsList.size()>0){
- housingFundBalance=accountsList.stream().mapToDouble(AccountsVo::getAvailableLimit).sum();
- }
- map.put("housingFundBalance",decimalFormat.format(housingFundBalance));
-
- //职工医保余额
- dto.setDebitType("6");
- accountsList=accountsMapper.selectAccountsList(dto);
- double medicalBalance =0;
- if(accountsList.size()>0){
- medicalBalance=accountsList.stream().mapToDouble(AccountsVo::getAvailableLimit).sum();
- }
- map.put("medicalBalance",decimalFormat.format(medicalBalance));
-
- //个人养老金余额
- dto.setDebitType("7");
- accountsList=accountsMapper.selectAccountsList(dto);
- double personalPensionBalance =0;
- if(accountsList.size()>0){
- personalPensionBalance=accountsList.stream().mapToDouble(AccountsVo::getAvailableLimit).sum();
- }
- map.put("personalPensionBalance",decimalFormat.format(personalPensionBalance));
-
- //其他余额
- dto.setDebitType("8");
- accountsList=accountsMapper.selectAccountsList(dto);
- double otherDebitBalance =0;
- if(accountsList.size()>0){
- otherDebitBalance=accountsList.stream().mapToDouble(AccountsVo::getAvailableLimit).sum();
- }
- map.put("otherDebitBalance",decimalFormat.format(otherDebitBalance));
- map.put("otherDebitCount",accountsList.size());
- //储蓄账户总余额
- map.put("debitTotalBalance",decimalFormat.format(debitIBalance+debitIIBalance+debitOnlineBalance+housingFundBalance+storedValueCardBalance+medicalBalance+personalPensionBalance+otherDebitBalance));
-
-
- return map;
- }
-
- @Override
- public Map getInvestAccountsInfo() {
- //返回数据
- HashMap map = new HashMap<>();
- DecimalFormat decimalFormat = new DecimalFormat("#.##");
- //期货收益
- FutureStocksBillDto futureStocksBillDto=new FutureStocksBillDto();
- futureStocksBillDto.setType("1");
- List futureStocksBillList=futureStocksBillMapper.selectFutureStocksBillList(futureStocksBillDto);
- double futuresIncome = futureStocksBillList.stream().mapToDouble(FutureStocksBillVo::getBillAmount).sum();
- map.put("futuresIncome",decimalFormat.format(futuresIncome));
- //股票收益
- futureStocksBillDto.setType("2");
- futureStocksBillList=futureStocksBillMapper.selectFutureStocksBillList(futureStocksBillDto);
- double stocksIncome = futureStocksBillList.stream().mapToDouble(FutureStocksBillVo::getBillAmount).sum();
- map.put("stocksIncome",decimalFormat.format(stocksIncome));
- AccountsDto dto=new AccountsDto();
- dto.setState("1");
- //投资账户余额
- dto.setType("5");
- List accountsList=accountsMapper.selectAccountsList(dto);
- double investBalance =0;
- if(accountsList.size()>0){
- investBalance=accountsList.stream().mapToDouble(AccountsVo::getAvailableLimit).sum();
- }
- map.put("investBalance",decimalFormat.format(investBalance));
- //总收益
- map.put("totalIncome",decimalFormat.format(futuresIncome+stocksIncome));
-
- FutureStocksDto futureStocksDto=new FutureStocksDto();
- //状态为正常使用
- futureStocksDto.setStatus("1");
- futureStocksDto.setType("1");
- //期货
- map.put("futuresCount",futureStocksMapper.selectFutureStocksList(futureStocksDto).size());
- //股票
- futureStocksDto.setType("2");
- map.put("stocksCount",futureStocksMapper.selectFutureStocksList(futureStocksDto).size());
- AccountsDealRecordDto dealDto=new AccountsDealRecordDto();
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
- //当前日期
- Date queryDate=DateUtils.getNowDate();
-
- Calendar calendarStart = Calendar.getInstance();
- calendarStart.add(Calendar.MONTH, 0);
- calendarStart.set(Calendar.DAY_OF_MONTH, 1);//1:本月第一天
- //获取数据
- dealDto.setEndTime(dateFormat.format(queryDate));
- dealDto.setStartTime(dateFormat.format(calendarStart.getTime()));
- dealDto.setType("5");
- dealDto.setDealCategory("2");
- List accountsDealRecordVoList=accountsDealRecordMapper.selectAccountsDealRecordList(dealDto);
- double income =0;
- double expenses =0;
- for (AccountsDealRecordVo vo:accountsDealRecordVoList
- ) {
-
- if(vo.getDealType().equals("1")){
- income+=vo.getAmount();
- }
- //支出
- if(vo.getDealType().equals("2")){
- expenses+=vo.getAmount();
- }
- }
- //交易金额
- map.put("currentMonthInvest",decimalFormat.format(income-expenses));
- //收入
- map.put("currentMonthIncome",decimalFormat.format(income));
-
- //支出
- map.put("currentMonthExpenses",decimalFormat.format(expenses));
-
- return map;
- }
-
- @Override
- public Map getLendAccountsInfo() {
- //返回数据
- HashMap map = new HashMap<>();
- DecimalFormat decimalFormat = new DecimalFormat("#.##");
- BankCardLendDto bankCardLendDto=new BankCardLendDto();
- //状态为正常使用
- bankCardLendDto.setStatus("1");
- bankCardLendDto.setType("3");
- bankCardLendDto.setLendType("1");
- //网贷
- map.put("onlineLendCount",bankCardLendMapper.selectBankCardLendList(bankCardLendDto).size());
- //人情
- bankCardLendDto.setLendType("2");
- map.put("peopleLendCount",bankCardLendMapper.selectBankCardLendList(bankCardLendDto).size());
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
- SimpleDateFormat formatterMonth = new SimpleDateFormat("yyyy-MM");
- //未结清网贷数据
- InstallmentHistoryDto installmentHistoryDto=new InstallmentHistoryDto();
- InstallmentHistoryDetailDto detailDto=new InstallmentHistoryDetailDto();
- detailDto.setType("3");
- detailDto.setState("0");
- List detailList=installmentHistoryDetailMapper.selectInstallmentHistoryDetailList(detailDto);
- double unClearedOnlineDebt = 0;
- double unClearedOnlineDebtPrinciple = 0;
- double unClearedOnlineDebtInterest = 0;
- if(detailList.size()>0){
- unClearedOnlineDebtPrinciple=detailList.stream().mapToDouble(InstallmentHistoryDetailVo::getPrincipal).sum();
- unClearedOnlineDebtInterest=detailList.stream().mapToDouble(InstallmentHistoryDetailVo::getInterest).sum();
- unClearedOnlineDebt=unClearedOnlineDebtPrinciple+unClearedOnlineDebtInterest;
- }
- map.put("unClearedOnlineDebt",decimalFormat.format(unClearedOnlineDebt));
- map.put("unClearedOnlineDebtPrinciple",decimalFormat.format(unClearedOnlineDebtPrinciple));
- map.put("unClearedOnlineDebtInterest",decimalFormat.format(unClearedOnlineDebtInterest));
-
- //信用卡分期账单
- detailDto.setType("2");
- detailDto.setState("0");
- detailList=installmentHistoryDetailMapper.selectInstallmentHistoryDetailList(detailDto);
- double creditInstallmentHistory =0;
- if(detailList.size()>0){
- creditInstallmentHistory = detailList.stream().mapToDouble(InstallmentHistoryDetailVo::getCurrentAmount).sum();
- }
- map.put("creditInstallmentHistory",decimalFormat.format(creditInstallmentHistory));
-
-
- AccountsDto dto=new AccountsDto();
- //状态正常,不隐藏
- dto.setStatus("1");
- //借贷
- dto.setType("3");
- dto.setLendType("2");
- List accountsList=accountsMapper.selectAccountsList(dto);
- double peopleLendHistory =0;
- if(accountsList.size()>0){
- peopleLendHistory=accountsList.stream().mapToDouble(AccountsVo::getBalance).sum()*(-1);
- }
- map.put("peopleLendHistory",decimalFormat.format(peopleLendHistory));
-// //人情
-// installmentHistoryDto.setType("4");
-// installmentHistoryDto.setState("0");
-// List installmentHistoryList=installmentHistoryMapper.selectInstallmentHistoryList(installmentHistoryDto);
-
- //未结清账户数
- installmentHistoryDto.setState("0");
- installmentHistoryDto.setType("3");
- List installmentHistoryList=installmentHistoryMapper.selectInstallmentHistoryList(installmentHistoryDto);
- int unclearedOnlineDebtCount = installmentHistoryList.size();
- map.put("unclearedOnlineDebtCount",unclearedOnlineDebtCount);
-
- //已结清账户数
- installmentHistoryDto.setState("1");
- installmentHistoryDto.setType("3");
- installmentHistoryList=installmentHistoryMapper.selectInstallmentHistoryList(installmentHistoryDto);
- int clearedOnlineDebtCount = installmentHistoryList.size();
- map.put("clearedOnlineDebtCount",clearedOnlineDebtCount);
-
- //已结清网贷数据
- installmentHistoryDto.setState("1");
- installmentHistoryDto.setType("3");
- installmentHistoryList=installmentHistoryMapper.selectInstallmentHistoryList(installmentHistoryDto);
- double clearedOnlineDebt =0;
- double clearedOnlineDebtPrinciple =0;
- double clearedOnlineDebtInterest =0;
- if(installmentHistoryList.size()>0){
- clearedOnlineDebtPrinciple = installmentHistoryList.stream().mapToDouble(InstallmentHistoryVo::getInstallmentAmount).sum();
- clearedOnlineDebtInterest = installmentHistoryList.stream().mapToDouble(InstallmentHistoryVo::getTotalInterest).sum();
- clearedOnlineDebt=clearedOnlineDebtPrinciple+clearedOnlineDebtInterest;
- }
- map.put("clearedOnlineDebt",decimalFormat.format(clearedOnlineDebt));
- map.put("clearedOnlineDebtPrinciple",decimalFormat.format(clearedOnlineDebtPrinciple));
- map.put("clearedOnlineDebtInterest",decimalFormat.format(clearedOnlineDebtInterest));
- //网贷当月应还款
-
- detailDto.setRepaymentMonth(formatterMonth.format(new Date()));
- detailDto.setState("");
- detailDto.setType("3");
- detailList=installmentHistoryDetailMapper.selectInstallmentHistoryDetailList(detailDto);
- double dueOnlineDebt =0;
- if(detailList.size()>0){
- dueOnlineDebt = detailList.stream().mapToDouble(InstallmentHistoryDetailVo::getCurrentAmount).sum();
- }
- map.put("dueOnlineDebt",decimalFormat.format(dueOnlineDebt));
-
- //网贷当月已还款
- detailDto.setState("1");
- detailDto.setRepaymentMonth(formatterMonth.format(new Date()));
- detailDto.setType("3");
- detailList=installmentHistoryDetailMapper.selectInstallmentHistoryDetailList(detailDto);
- double repaidOnlineDebt =0;
- if(detailList.size()>0){
- repaidOnlineDebt = detailList.stream().mapToDouble(InstallmentHistoryDetailVo::getCurrentAmount).sum();
- }
- map.put("repaidOnlineDebt",decimalFormat.format(repaidOnlineDebt));
-
- //网贷剩余还款
- map.put("leftOnlineDebt",decimalFormat.format(dueOnlineDebt-repaidOnlineDebt));
-
- return map;
- }
-
- @Override
- public CreditReportAnalysisVO getCreditReportInfo() {
-
- CreditReportQueryRecordDto dto =new CreditReportQueryRecordDto();
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
- Date queryDate=DateUtils.getNowDate();
- if(dto.getQueryDateStart()!=null){
- try {
- queryDate=formatter.parse(dto.getQueryDateStart());
- dto.setQueryDateEnd(dto.getQueryDateStart());
- } catch (ParseException e) {
- throw new RuntimeException(e);
- }
- }
- CreditReportAnalysisVO analysisVO=new CreditReportAnalysisVO();
- dto.setQueryType("1");
-
- Calendar calendarStart = Calendar.getInstance();
- calendarStart.setTime(queryDate);
- calendarStart.add(Calendar.MONTH, -1);
- dto.setQueryDateStart(formatter.format(calendarStart.getTime()));
- analysisVO.setLastOneMonths(creditReportQueryRecordMapper.selectCreditReportQueryRecordList(dto).size()+"");
-
- calendarStart.setTime(queryDate);
- calendarStart.add(Calendar.MONTH, -2);
- dto.setQueryDateStart(formatter.format(calendarStart.getTime()));
- analysisVO.setLastTwoMonths(creditReportQueryRecordMapper.selectCreditReportQueryRecordList(dto).size()+"");
-
- calendarStart.setTime(queryDate);
- calendarStart.add(Calendar.MONTH, -3);
- dto.setQueryDateStart(formatter.format(calendarStart.getTime()));
- analysisVO.setLastThreeMonths(creditReportQueryRecordMapper.selectCreditReportQueryRecordList(dto).size()+"");
-
- calendarStart.setTime(queryDate);
- calendarStart.add(Calendar.MONTH, -6);
- dto.setQueryDateStart(formatter.format(calendarStart.getTime()));
- analysisVO.setLastSixMonths(creditReportQueryRecordMapper.selectCreditReportQueryRecordList(dto).size()+"");
-
-
- calendarStart.setTime(queryDate);
- calendarStart.add(Calendar.MONTH, -12);
- dto.setQueryDateStart(formatter.format(calendarStart.getTime()));
- analysisVO.setLastOneYears(creditReportQueryRecordMapper.selectCreditReportQueryRecordList(dto).size()+"");
-
-
- calendarStart.setTime(queryDate);
- calendarStart.add(Calendar.MONTH, -24);
- dto.setQueryDateStart(formatter.format(calendarStart.getTime()));
- analysisVO.setLastTwoYears(creditReportQueryRecordMapper.selectCreditReportQueryRecordList(dto).size()+"");
-
-
- dto.setQueryDateStart("");
- analysisVO.setLastAllYears(creditReportQueryRecordMapper.selectCreditReportQueryRecordList(dto).size()+"");
-
-
- calendarStart.setTime(queryDate);
- calendarStart.add(Calendar.MONTH, -6);
- dto.setQueryDateStart(formatter.format(calendarStart.getTime()));
- dto.setType("5");
- dto.setQueryType("2");
- analysisVO.setLastSixMonthQueryCount(creditReportQueryRecordMapper.selectCreditReportQueryRecordList(dto).size()+"");
-
- calendarStart.setTime(queryDate);
- calendarStart.add(Calendar.MONTH, -6);
- dto.setQueryDateStart(formatter.format(calendarStart.getTime()));
- dto.setType("4");
- analysisVO.setLastSixMonthsAfterLoan(creditReportQueryRecordMapper.selectCreditReportQueryRecordList(dto).size()+"");
-
- calendarStart.setTime(queryDate);
- calendarStart.add(Calendar.MONTH, -24);
- dto.setQueryDateStart(formatter.format(calendarStart.getTime()));
- dto.setType("4");
- analysisVO.setLastTwoYearsAfterLoan(creditReportQueryRecordMapper.selectCreditReportQueryRecordList(dto).size()+"");
-
- dto.setQueryDateStart("");
- dto.setType("4");
- analysisVO.setTotalAfterLoan(creditReportQueryRecordMapper.selectCreditReportQueryRecordList(dto).size()+"");
- return analysisVO;
- }
-
- @Override
- public Map getCreditAnalysis(AnalysisDto analysisDto) {
-//返回数据
- HashMap map = new HashMap<>();
-
- List creditCardBillVoList=new ArrayList<>();
- 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(),-6));
- 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(),-5));
- analysisDto.setStartTime(startTime);
- analysisDto.setEndTime(endTime);
- }else {
- analysisDto.setStartTime(analysisDto.getStartTime()+"-01-01");
- analysisDto.setEndTime(analysisDto.getEndTime()+"-12-31");
- }
- }
- DecimalFormat decimalFormat = new DecimalFormat("#.##");
-
- //根据日期,获取按日获取的数据,按月按年分组列表,单独处理
- CreditCardBillDto creditCardBillDto=new CreditCardBillDto();
- creditCardBillDto.setStartMonth(analysisDto.getStartTime().substring(0,7));
- creditCardBillDto.setEndMonth(analysisDto.getEndTime().substring(0,7));
- creditCardBillDto.setCreditCardId(analysisDto.getId());
- creditCardBillVoList=creditCardBillMapper.selectCreditCardBillList(creditCardBillDto);
- //修改名称加卡号
- for (CreditCardBillVo creditCardBill : creditCardBillVoList) {
- if(creditCardBill.getBankName()!=null){
- creditCardBill.setBankNameCode(creditCardBill.getBankName()+"("+ StringUtils.getLastNumberChars(4,creditCardBill.getBankCode()+")"));
- }
- }
- //信用卡额度
- BankCardLendDto bankCardLendDto=new BankCardLendDto();
- bankCardLendDto.setType("2");
- bankCardLendDto.setStatus("1");
- bankCardLendDto.setCreditCardId(analysisDto.getId());
- List bankCardLendVoList=statisticAnalysisMapper.selectBankCardLendList(bankCardLendDto);
- int creditLimit = bankCardLendVoList.stream().mapToInt(BankCardLendVo::getCreditLimit).sum();
- map.put("creditLimit",creditLimit);
- //信用卡
- map.put("creditCardCount",bankCardLendMapper.selectBankCardLendList(bankCardLendDto).size());
-
- AccountsDto dto=new AccountsDto();
- //正常使用
- dto.setStatus("1");
- //信用卡
- dto.setType("2");
- dto.setAccountId(analysisDto.getId());
- List accountsList=accountsMapper.selectAccountsList(dto);
- double creditAvailableLimit =0;
- double creditBalance =0;
- if(accountsList.size()>0){
- creditAvailableLimit=accountsList.stream().mapToDouble(AccountsVo::getAvailableLimit).sum();
- creditBalance=accountsList.stream().mapToDouble(AccountsVo::getBalance).sum()*(-1);
- }
- map.put("creditAvailableLimit",decimalFormat.format(creditAvailableLimit));
- map.put("creditBalance",decimalFormat.format(creditBalance));
-
-
- //实际账单
- double actualCreditBill = creditCardBillVoList.stream().mapToDouble(CreditCardBillVo::getBillAmount).sum();
- map.put("actualCreditBill", decimalFormat.format(actualCreditBill));
-
-
- List creditAnalysisList=new ArrayList<>();
-
- if("2".equals(analysisDto.getType())){
- //月列表
- List staticsTimeList=new ArrayList<>();
- for (CreditCardBillVo creditCardBillVo:creditCardBillVoList
- ) {
- String monthString=dateFormat.format(creditCardBillVo.getBillDate()).substring(0,7);
-
- if(!staticsTimeList.contains(monthString)){
- staticsTimeList.add(monthString);
- }
- }
-
- for (String staticsTime :staticsTimeList
- ) {
- String details="";
- double actualCreditBillMonth=0;
- for (CreditCardBillVo creditCardBillVo:creditCardBillVoList
- ) {
- String monthString=dateFormat.format(creditCardBillVo.getBillDate()).substring(0,7);
-
- if(staticsTime.equals(monthString)){
- actualCreditBillMonth+=creditCardBillVo.getBillAmount();
- details+=creditCardBillVo.getBankNameCode()+"账单"+creditCardBillVo.getBillAmount()+";
";
- }
- }
- CreditCardBillVo analysisVo=new CreditCardBillVo();
- analysisVo.setBillAmount(Double.parseDouble(decimalFormat.format(actualCreditBillMonth)));
- analysisVo.setName(staticsTime);
- analysisVo.setRemark(details);
- creditAnalysisList.add(analysisVo);
- }
-
- //年查询
- }else if("3".equals(analysisDto.getType())){
- List staticsTimeList=new ArrayList<>();
- for (CreditCardBillVo creditCardBillVo:creditCardBillVoList
- ) {
- String yearString=dateFormat.format(creditCardBillVo.getBillDate()).substring(0,4);
-
- if(!staticsTimeList.contains(yearString)){
- staticsTimeList.add(yearString);
- }
- }
-
- for (String staticsTime :staticsTimeList
- ) {
- double actualCreditBillYear=0;
- for (CreditCardBillVo creditCardBillVo:creditCardBillVoList
- ) {
- String yearString=dateFormat.format(creditCardBillVo.getBillDate()).substring(0,4);
- if(staticsTime.equals(yearString)){
- actualCreditBillYear+=creditCardBillVo.getBillAmount();
- }
- }
- CreditCardBillVo analysisVo=new CreditCardBillVo();
- analysisVo.setBillAmount(Double.parseDouble(decimalFormat.format(actualCreditBillYear)));
- analysisVo.setName(staticsTime);
- creditAnalysisList.add(analysisVo);
-
- }
-
- }
- //平均账单
- int timesCount=creditAnalysisList.size();
- double averageCreditBill=0;
- if(timesCount!=0){
- averageCreditBill= actualCreditBill /timesCount;
- }
- //使用率
- double creditBillRate;
- if (creditLimit != 0) {
- creditBillRate= ((creditBalance) * 100) /creditLimit;
- }else {
- creditBillRate= 0;
- }
- map.put("creditBillRate", decimalFormat.format(creditBillRate));
- map.put("averageCreditBill", decimalFormat.format(averageCreditBill));
- ArrayList