|
@@ -19,6 +19,7 @@ import com.game.business.task.AppUserCountTask;
|
|
import com.game.business.util.Md5Utils;
|
|
import com.game.business.util.Md5Utils;
|
|
import com.game.business.util.im.HttpClientUtils;
|
|
import com.game.business.util.im.HttpClientUtils;
|
|
import com.game.business.util.im.TencentCloudImUtil;
|
|
import com.game.business.util.im.TencentCloudImUtil;
|
|
|
|
+import com.game.business.vo.AppRechargeConfigVo;
|
|
import com.game.common.annotation.RepeatSubmit;
|
|
import com.game.common.annotation.RepeatSubmit;
|
|
import com.game.common.constant.AppSceneType;
|
|
import com.game.common.constant.AppSceneType;
|
|
import com.game.common.constant.finance.*;
|
|
import com.game.common.constant.finance.*;
|
|
@@ -291,16 +292,22 @@ public class AppUserController extends BaseController
|
|
appUserService.updateUserAmount(rateTran);*/
|
|
appUserService.updateUserAmount(rateTran);*/
|
|
}
|
|
}
|
|
double give = 0;
|
|
double give = 0;
|
|
- if(userChargeDto.getType() == 1 && userChargeDto.getAmount() > 0 && null != userChargeDto.getRate() && userChargeDto.getRate() > 0) { //金币充值不赠送
|
|
|
|
|
|
+ //查询赠送配置
|
|
|
|
+ AppRechargeConfigVo configVo = appUsersChargeService.getRechargeConfig();
|
|
|
|
+ if(userChargeDto.getType() == 1
|
|
|
|
+ && userChargeDto.getAmount() > 0
|
|
|
|
+ && null != userChargeDto.getRate()
|
|
|
|
+ && userChargeDto.getRate() > 0
|
|
|
|
+ ) { //金币充值不赠送
|
|
// if(null != userChargeDto.getGiveAmount() && userChargeDto.getGiveAmount() > 0){
|
|
// if(null != userChargeDto.getGiveAmount() && userChargeDto.getGiveAmount() > 0){
|
|
//今日已赠送金额
|
|
//今日已赠送金额
|
|
double todayGiveMoney = appUsersChargeService.isChargeToday(userChargeDto.getUserId(),userChargeDto.getType());
|
|
double todayGiveMoney = appUsersChargeService.isChargeToday(userChargeDto.getUserId(),userChargeDto.getType());
|
|
- double giveRate = todayGiveMoney>0?0.02:0.1; //当然首充10% 否则2%
|
|
|
|
- if(todayGiveMoney < 2000) { //当日2000封顶
|
|
|
|
|
|
+ double giveRate = todayGiveMoney>0?configVo.getSend()/100:configVo.getFirstSend()/100; //当然首充10% 否则2%
|
|
|
|
+ if(todayGiveMoney < configVo.getMaxSend() && giveRate > 0) { //当日2000封顶
|
|
give = BigDecimal.valueOf(userChargeDto.getAmount().doubleValue()
|
|
give = BigDecimal.valueOf(userChargeDto.getAmount().doubleValue()
|
|
* giveRate).setScale(4, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
* giveRate).setScale(4, BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
- if((give + todayGiveMoney) > 2000){
|
|
|
|
- give = give - (give + todayGiveMoney - 2000); //赠送金额超过2000则扣减多出的余额
|
|
|
|
|
|
+ if((give + todayGiveMoney) > configVo.getMaxSend()){
|
|
|
|
+ give = give - (give + todayGiveMoney - configVo.getMaxSend()); //赠送金额超过2000则扣减多出的余额
|
|
}
|
|
}
|
|
//赠送
|
|
//赠送
|
|
FinTranRecord giveTran = new FinTranRecord();
|
|
FinTranRecord giveTran = new FinTranRecord();
|