首充功能开放-限时首充档位范围判断

This commit is contained in:
2023-02-27 10:42:50 +08:00
parent aaf855b529
commit a78e500ce3
4 changed files with 22 additions and 7 deletions

View File

@@ -390,9 +390,11 @@ public class ChargeService extends BaseService {
return 200;
}
Boolean ret = userPurseService.addDiamond(chargeRecord.getUid(), realGoldNum.doubleValue(), chargeProd.getFirstGiftGoldNum().doubleValue(),
Constant.BusinessType.CHARGE_GOLD);
if (ret) {
if (userPurseService.addDiamond(chargeRecord.getUid(),
realGoldNum.doubleValue(),
chargeProd.getFirstGiftGoldNum().doubleValue(),
Constant.BusinessType.CHARGE_GOLD)) {
userPurseService.sendSysMsgByModifyGold(userPurseService.queryUserPurse(chargeRecord.getUid()));
log.info("charge success, uid:{}, charge record={}", chargeRecord.getUid(), chargeRecord);
}

View File

@@ -13,7 +13,8 @@ import org.springframework.stereotype.Service;
public class FirstChargeLevelService extends ServiceImpl<FirstChargeLevelMapper, FirstChargeLevel> {
public FirstChargeLevel getOneLimitByAmount(Long amount) {
return this.getOne(new LambdaQueryWrapper<FirstChargeLevel>()
.eq(FirstChargeLevel::getLowerLimit, amount)
.ge(FirstChargeLevel::getLowerLimit, amount)
.le(FirstChargeLevel::getUpperLimit, amount)
.eq(FirstChargeLevel::getFirstChargeType, 2)
.eq(FirstChargeLevel::getFirstChargeStatus, Constant.status.valid));
}

View File

@@ -39,6 +39,7 @@ import com.accompany.core.util.StringUtils;
import com.accompany.core.vo.UserVo;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.reflect.TypeToken;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.redisson.api.RedissonClient;
@@ -619,6 +620,9 @@ public class HallManageService extends BaseService {
}
} catch (Exception e) {
logger.error("dealInviteRecord failed,recordId={},e={}", recordId, e);
if (e instanceof ServiceException){
throw e;
}
} finally {
this.jedisLockService.unlock(RedisKey.lock_hall_invite.getKey(recordId.toString()), lockVal);
}
@@ -658,7 +662,7 @@ public class HallManageService extends BaseService {
if (record.getStatus().equals(Constant.HallOperateStatus.EXPIRE)) {
throw new ServiceException(BusiStatus.HALL_OPERATE_RECORD_EXPIRE);
} else {
throw new ServiceException(BusiStatus.HALL_OPERATE_RECORD_EXPIRE);
throw new ServiceException(BusiStatus.HALL_OPERATE_RECORD_DEAL);
}
}
@@ -745,6 +749,9 @@ public class HallManageService extends BaseService {
} catch (Exception e) {
logger.error("dealApplyRecord failed,recordId={},e={}", recordId, e);
if (e instanceof ServiceException){
throw e;
}
} finally {
this.jedisLockService.unlock(RedisKey.lock_hall_apply.getKey(recordId.toString()), lockVal);
}
@@ -759,6 +766,7 @@ public class HallManageService extends BaseService {
* @param recordId
* @return
*/
@SneakyThrows
@Transactional(rollbackFor = Exception.class)
public void dealQuitRecord(Long uid, Long recordId) {
String lockVal = null;
@@ -842,7 +850,10 @@ public class HallManageService extends BaseService {
sendSysMsgService.sentBatchMsgByLoop(params);
} catch (Exception e) {
logger.error("dealApplyRecord failed,recordId={},e={}", recordId, e);
logger.error("dealQuitRecord failed,recordId={},e={}", recordId, e);
if (e instanceof ServiceException){
throw e;
}
} finally {
this.jedisLockService.unlock(RedisKey.lock_hall_quit.getKey(recordId.toString()), lockVal);
}

View File

@@ -240,13 +240,14 @@ public class UsersController extends BaseController {
try {
// 查询用户是否满足首充激励条件
Boolean isFirstCharge = firstChargeRewardService.isFirstCharge(uid);
userVo.setIsFirstCharge(isFirstCharge);
// 用户限时首充
Boolean showLimitCharge = firstChargeRewardService.checkLimitCharge(uid);
if (showLimitCharge) {
userVo.setLimitChargeEndTime(firstChargeRewardService.getLimitChargeEndTime(userVo.getCreateTime()));
}
userVo.setShowLimitCharge(showLimitCharge);
userVo.setIsFirstCharge(isFirstCharge && showLimitCharge);
// 用户贵族信息
UserVipInfoVO userVipInfo = VipUtil.getUserVipInfo(uid);