|
@@ -604,7 +604,7 @@ public class AppUserCountTask {
|
|
int i = 1;
|
|
int i = 1;
|
|
List<FinTranRecord> dealTranList = new ArrayList<>();
|
|
List<FinTranRecord> dealTranList = new ArrayList<>();
|
|
for (FinTranRecord tranRecord : userChargeList) {
|
|
for (FinTranRecord tranRecord : userChargeList) {
|
|
- dealTranList.add(tranRecord);
|
|
|
|
|
|
+// dealTranList.add(tranRecord);
|
|
if (null == beginDate){
|
|
if (null == beginDate){
|
|
beginDate = tranRecord.getCreateTime();
|
|
beginDate = tranRecord.getCreateTime();
|
|
}
|
|
}
|
|
@@ -613,13 +613,13 @@ public class AppUserCountTask {
|
|
}else{
|
|
}else{
|
|
endDate = new Date();
|
|
endDate = new Date();
|
|
}
|
|
}
|
|
- money += tranRecord.getDiamondCoinChange();
|
|
|
|
|
|
+ double curMoney = tranRecord.getDiamondCoinChange();
|
|
//查询赠送金额
|
|
//查询赠送金额
|
|
AppUsersCharge appUsersCharge = appUsersChargeService.selectByOrderNo(String.valueOf(tranRecord.getTranGroupId()));
|
|
AppUsersCharge appUsersCharge = appUsersChargeService.selectByOrderNo(String.valueOf(tranRecord.getTranGroupId()));
|
|
if(null != appUsersCharge && null != appUsersCharge.getCoinGive()){
|
|
if(null != appUsersCharge && null != appUsersCharge.getCoinGive()){
|
|
- money += appUsersCharge.getCoinGive().doubleValue();
|
|
|
|
|
|
+ curMoney += appUsersCharge.getCoinGive().doubleValue();
|
|
}
|
|
}
|
|
- dealTran(dealTranList,beginDate,endDate,uid,money);
|
|
|
|
|
|
+ dealTran(dealTranList,beginDate,endDate,uid,money,curMoney,tranRecord);
|
|
i++;
|
|
i++;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -628,10 +628,37 @@ public class AppUserCountTask {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private void dealTran(List<FinTranRecord> userChargeList,Date beginDate,Date endDate,Long userId,Double money){
|
|
|
|
|
|
+ private void dealTran(List<FinTranRecord> userChargeList,Date beginDate,Date endDate,Long userId,Double money,Double curMoney,FinTranRecord tranRecord){
|
|
//查询用户这段时间流水记录
|
|
//查询用户这段时间流水记录
|
|
String type3s = FinTranType3.CONSUM_GAME_ANCHOR_ZHUANPAN.getType() + "," + FinTranType3.CONSUM_GAME_ANCHOR_WITHDRAW.getType();
|
|
String type3s = FinTranType3.CONSUM_GAME_ANCHOR_ZHUANPAN.getType() + "," + FinTranType3.CONSUM_GAME_ANCHOR_WITHDRAW.getType();
|
|
List<FinTranRecord> curTranList = finTranRecordService.selectUserTran(null,type3s,userId,beginDate,endDate,0);
|
|
List<FinTranRecord> curTranList = finTranRecordService.selectUserTran(null,type3s,userId,beginDate,endDate,0);
|
|
|
|
+ //获取用户资产
|
|
|
|
+ AppUser appUser = appUserService.getUserAsset(userId);
|
|
|
|
+ //资产为0 则充值两倍流水条件设为已作废
|
|
|
|
+ if(null != appUser && appUser.getDiamondCoin().doubleValue() < 1){
|
|
|
|
+ //更新为已满足提现
|
|
|
|
+// userChargeList.forEach(e->{
|
|
|
|
+ FinTranRecord updateTran = new FinTranRecord();
|
|
|
|
+ updateTran.setId(tranRecord.getId());
|
|
|
|
+ updateTran.setWithdrawFlag(2);
|
|
|
|
+ finTranRecordService.updateFinTranRecord(updateTran);
|
|
|
|
+ log.info("用户{},流水单号:{} 因金额已使用完,该笔订单流水条件已作废",userId,tranRecord.getId());
|
|
|
|
+// });
|
|
|
|
+ }else{
|
|
|
|
+ //查询本次充值到下次充值期间资产除去返佣后是否已归零
|
|
|
|
+ double amount = finTranRecordService.sumUserRechareTran(userId,beginDate,endDate);
|
|
|
|
+ if(amount < 1){
|
|
|
|
+ FinTranRecord updateTran = new FinTranRecord();
|
|
|
|
+ updateTran.setId(tranRecord.getId());
|
|
|
|
+ updateTran.setWithdrawFlag(2);
|
|
|
|
+ finTranRecordService.updateFinTranRecord(updateTran);
|
|
|
|
+ log.info("用户{},流水单号:{} 因充值金额已使用完,该笔订单流水条件已作废",userId,tranRecord.getId());
|
|
|
|
+ }else{
|
|
|
|
+ //未归零,则叠加
|
|
|
|
+ userChargeList.add(tranRecord);
|
|
|
|
+ money += curMoney;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
if(null != curTranList && curTranList.size() > 0){
|
|
if(null != curTranList && curTranList.size() > 0){
|
|
//筛选投注流水
|
|
//筛选投注流水
|
|
double bettingAmount = curTranList.stream().filter(e->
|
|
double bettingAmount = curTranList.stream().filter(e->
|