|
@@ -1,6 +1,7 @@
|
|
|
package com.kxs.stat.biz.service.impl;
|
|
package com.kxs.stat.biz.service.impl;
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DatePattern;
|
|
import cn.hutool.core.date.DatePattern;
|
|
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
|
|
import cn.hutool.core.map.MapUtil;
|
|
import cn.hutool.core.map.MapUtil;
|
|
|
import cn.hutool.core.util.NumberUtil;
|
|
import cn.hutool.core.util.NumberUtil;
|
|
@@ -508,26 +509,35 @@ public class KxsUserTradeServiceImpl extends ServiceImpl<KxsUserTradeMapper, Kxs
|
|
|
@Override
|
|
@Override
|
|
|
public R getTradeDetail(StatUserGetTradeDetailDTO param) {
|
|
public R getTradeDetail(StatUserGetTradeDetailDTO param) {
|
|
|
Integer totalType = param.getTotalType();//0:个人 1:计奖
|
|
Integer totalType = param.getTotalType();//0:个人 1:计奖
|
|
|
- Integer month = param.getDate();//该参数有效获取月份格式yyyyMM 日格式yyyyMMdd
|
|
|
|
|
|
|
+ Integer date = param.getDate();//该参数有效获取月份格式yyyyMM 日格式yyyyMMdd
|
|
|
Integer getType = param.getGetType();// 1获取日详情 2获取月详情
|
|
Integer getType = param.getGetType();// 1获取日详情 2获取月详情
|
|
|
Integer tradeType = param.getTradeType();//1获取增量 2获取存量 3获取全部
|
|
Integer tradeType = param.getTradeType();//1获取增量 2获取存量 3获取全部
|
|
|
|
|
+
|
|
|
Long userId = param.getUserId();//用户id
|
|
Long userId = param.getUserId();//用户id
|
|
|
if (userId == null || userId == 0) {
|
|
if (userId == null || userId == 0) {
|
|
|
userId = SecurityUtils.getUser().getId();
|
|
userId = SecurityUtils.getUser().getId();
|
|
|
}
|
|
}
|
|
|
|
|
+ if(getType == 1 && String.valueOf(date).length() != 8){
|
|
|
|
|
+ return R.failed("日期格式错误");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(getType == 2 && String.valueOf(date).length() != 6){
|
|
|
|
|
+ return R.failed("日期格式错误");
|
|
|
|
|
+ }
|
|
|
Integer brandId = param.getBrandId();//品牌id
|
|
Integer brandId = param.getBrandId();//品牌id
|
|
|
|
|
|
|
|
String tableName;
|
|
String tableName;
|
|
|
|
|
+ String tableMonth = String.valueOf(date).substring(0, 6);
|
|
|
|
|
+
|
|
|
switch (tradeType) {
|
|
switch (tradeType) {
|
|
|
- case 1 -> tableName = CommonConstants.USER_TABLE_AFTER_PREFIX + month;
|
|
|
|
|
- case 2 -> tableName = CommonConstants.USER_TABLE_BEFORE_PREFIX + month;
|
|
|
|
|
- case 3 -> tableName = CommonConstants.USER_TABLE_PREFIX + month;
|
|
|
|
|
|
|
+ case 1 -> tableName = CommonConstants.USER_TABLE_AFTER_PREFIX + tableMonth;
|
|
|
|
|
+ case 2 -> tableName = CommonConstants.USER_TABLE_BEFORE_PREFIX + tableMonth;
|
|
|
|
|
+ case 3 -> tableName = CommonConstants.USER_TABLE_PREFIX + tableMonth;
|
|
|
default -> throw new GlobalCustomerException("参数错误");
|
|
default -> throw new GlobalCustomerException("参数错误");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
StatUserGetTradeDetailVO statUserGetTradeDetailVO = new StatUserGetTradeDetailVO();
|
|
StatUserGetTradeDetailVO statUserGetTradeDetailVO = new StatUserGetTradeDetailVO();
|
|
|
- statUserGetTradeDetailVO.setDate(month);//交易时间
|
|
|
|
|
|
|
+ statUserGetTradeDetailVO.setDate(date);//交易时间
|
|
|
statUserGetTradeDetailVO.setBrandId(brandId);//品牌
|
|
statUserGetTradeDetailVO.setBrandId(brandId);//品牌
|
|
|
|
|
|
|
|
//扶持期
|
|
//扶持期
|
|
@@ -540,7 +550,7 @@ public class KxsUserTradeServiceImpl extends ServiceImpl<KxsUserTradeMapper, Kxs
|
|
|
StatUserTradeVo proBstatUserTradeVo = new StatUserTradeVo();
|
|
StatUserTradeVo proBstatUserTradeVo = new StatUserTradeVo();
|
|
|
|
|
|
|
|
//pos交易
|
|
//pos交易
|
|
|
- KxsUserTrade kxsUserTradePos = baseMapper.getAllUserTradeSum(userId, month, getType, 0, brandId, totalType, tableName);
|
|
|
|
|
|
|
+ KxsUserTrade kxsUserTradePos = baseMapper.getAllUserTradeSum(userId, date, getType, 0, brandId, totalType, tableName);
|
|
|
if (kxsUserTradePos != null) {
|
|
if (kxsUserTradePos != null) {
|
|
|
statUserTradeVo.setDirectTradeAmt(kxsUserTradePos.getHelpDirectTradeAmt());//扶持期贷记卡
|
|
statUserTradeVo.setDirectTradeAmt(kxsUserTradePos.getHelpDirectTradeAmt());//扶持期贷记卡
|
|
|
statUserTradeVo.setDebitTradeAmt(kxsUserTradePos.getHelpDebitTradeAmt());//扶持期借记卡
|
|
statUserTradeVo.setDebitTradeAmt(kxsUserTradePos.getHelpDebitTradeAmt());//扶持期借记卡
|
|
@@ -575,7 +585,7 @@ public class KxsUserTradeServiceImpl extends ServiceImpl<KxsUserTradeMapper, Kxs
|
|
|
proBstatUserTradeVo.setPosTrade(kxsUserTradePos.getProBDirectTradeAmt().add(kxsUserTradePos.getProBDebitTradeAmt()));//交易总和
|
|
proBstatUserTradeVo.setPosTrade(kxsUserTradePos.getProBDirectTradeAmt().add(kxsUserTradePos.getProBDebitTradeAmt()));//交易总和
|
|
|
}
|
|
}
|
|
|
//云闪付
|
|
//云闪付
|
|
|
- KxsUserTrade kxsUserTradeCloud = baseMapper.getAllUserTradeSum(userId, month, getType, 1, brandId, totalType, tableName);
|
|
|
|
|
|
|
+ KxsUserTrade kxsUserTradeCloud = baseMapper.getAllUserTradeSum(userId, date, getType, 1, brandId, totalType, tableName);
|
|
|
if (kxsUserTradeCloud != null) {
|
|
if (kxsUserTradeCloud != null) {
|
|
|
BigDecimal helpTrade = kxsUserTradeCloud.getHelpDebitCapTradeAmt().add(kxsUserTradeCloud.getHelpDirectTradeAmt());//计算扶持期云闪付交易额
|
|
BigDecimal helpTrade = kxsUserTradeCloud.getHelpDebitCapTradeAmt().add(kxsUserTradeCloud.getHelpDirectTradeAmt());//计算扶持期云闪付交易额
|
|
|
statUserTradeVo.setCloudTrade(helpTrade);//扶持期云闪付交易额
|
|
statUserTradeVo.setCloudTrade(helpTrade);//扶持期云闪付交易额
|