首充获奖添加系统自定义消息
首充获奖添加系统自定义消息
This commit is contained in:
@@ -273,6 +273,7 @@ public class Constant {
|
||||
// --------------- 首充激励自定义消息类型 ---------------------
|
||||
public static int FIRST_CHARGE_REWARD = 76;
|
||||
public static int FIRST_CHARGE_REWARD_MSG = 761;
|
||||
public static int FIRST_CHARGE_REWARD_MSG_NEW = 763;
|
||||
|
||||
// --------------- 首充激励自定义消息类型 ---------------------
|
||||
|
||||
|
@@ -243,7 +243,7 @@ public enum BillObjTypeEnum {
|
||||
USER_EVENT_PAY_BANNER(162, "用户付费创建用户活动", BillTypeEnum.IN, CurrencyEnum.DIAMOND, BillDomainTypeEnum.USER_EVENT),
|
||||
USER_EVENT_REFUND_BANNER(163, "用户活动审核失败退款", BillTypeEnum.OUT, CurrencyEnum.DIAMOND, BillDomainTypeEnum.USER_EVENT),
|
||||
|
||||
FIRST_CHARGE_REWARD(164, "首充奖励", BillTypeEnum.IN, CurrencyEnum.DIAMOND, BillDomainTypeEnum.FIRST_CHARGE),
|
||||
FIRST_CHARGE_REWARD_BILL(164, "首充奖励", BillTypeEnum.IN, CurrencyEnum.DIAMOND, BillDomainTypeEnum.FIRST_CHARGE),
|
||||
;
|
||||
|
||||
BillObjTypeEnum(int value, String desc, BillTypeEnum type, CurrencyEnum currency, BillDomainTypeEnum domain) {
|
||||
|
@@ -305,7 +305,7 @@ public enum I18nAlertEnum {
|
||||
GOLD_NAME("GOLD"),
|
||||
MEDAL_EXPIRE_MSG("您的[{0}]已过期,已自动摘下"),
|
||||
LUCKY_NUMBER_HAS_JACKPOT_SYS("恭喜 {0} 猜中本期Moli百万幸运数字:{1},一举斩获 {2} 金币大奖! \uD83C\uDFC6"),
|
||||
FIRST_CHARGE_REWARD("你已经通过首充活动充值了{0}USD,获得了{1}金币,及其额外的奖励物料。快去查看吧~!"),
|
||||
FIRST_CHARGE_REWARD_SYS("你已经通过首充活动充值了{0}USD,获得了{1}金币,及其额外的奖励物料。快去查看吧~!"),
|
||||
ACCOUNT_CANCEL_TOAST("ACCOUNT CANCEL SUCCESS"),
|
||||
;
|
||||
|
||||
|
@@ -39,24 +39,29 @@ public class CommonRecharge4ActListener implements ApplicationListener<CommonRe
|
||||
@Async
|
||||
public void onApplicationEvent(CommonRecharge4ActEvent event) {
|
||||
CommonRecharge4ActVo commonRecharge4ActVo = (CommonRecharge4ActVo) event.getSource();
|
||||
|
||||
if (!commonRecharge4ActVo.getChargeStatus().equals(Constant.ChargeRecordStatus.finish)
|
||||
|| 0L > commonRecharge4ActVo.getTotalGoldNum()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
log.info("ActivityOfChargeService.addTotalNum, uid:{}", commonRecharge4ActVo.getUid());
|
||||
activityOfChargeService.addTotalNum(commonRecharge4ActVo.getUid(), commonRecharge4ActVo.getTotalGoldNum(), commonRecharge4ActVo.getCreateTime());
|
||||
} catch (Exception e) {
|
||||
log.error("chargeSuccessMessage addTotalNum error is {}", JSONObject.toJSONString(commonRecharge4ActVo), e);
|
||||
}
|
||||
Long uid = commonRecharge4ActVo.getUid();
|
||||
Long totalGoldNum = commonRecharge4ActVo.getTotalGoldNum();
|
||||
Date createTime = commonRecharge4ActVo.getCreateTime();
|
||||
//月充值活动
|
||||
activityOfChargeService.addTotalNum(uid, totalGoldNum, createTime);
|
||||
|
||||
//邀请处理
|
||||
this.inviteFissionCharge(commonRecharge4ActVo);
|
||||
firstChargeService.firstChargeCheckAndReward(commonRecharge4ActVo.getUid(), commonRecharge4ActVo.getIp(), commonRecharge4ActVo.getDeviceId(), commonRecharge4ActVo.getTotalGoldNum());
|
||||
DailyProgressContext dailyProgressContext = DailyProgressContext.builder()
|
||||
.chargeGoldNum(commonRecharge4ActVo.getTotalGoldNum())
|
||||
.uid(commonRecharge4ActVo.getUid())
|
||||
.createTime(commonRecharge4ActVo.getCreateTime())
|
||||
.build();
|
||||
dailyTaskService.executeProgress(DailyTaskTypeEnum.CHARGE_GOLD_NUM, dailyProgressContext);
|
||||
|
||||
//首充处理
|
||||
firstChargeService.firstChargeCheckAndReward(uid, commonRecharge4ActVo.getIp(), commonRecharge4ActVo.getDeviceId(), totalGoldNum);
|
||||
|
||||
//日常任务处理
|
||||
dailyTaskService.executeProgress(DailyTaskTypeEnum.CHARGE_GOLD_NUM, DailyProgressContext.builder()
|
||||
.chargeGoldNum(totalGoldNum)
|
||||
.uid(uid)
|
||||
.createTime(createTime)
|
||||
.build());
|
||||
}
|
||||
|
||||
private void inviteFissionCharge(CommonRecharge4ActVo commonRecharge4ActVo) {
|
||||
|
@@ -13,6 +13,7 @@ import com.accompany.business.vo.firstcharge.FirstChargeBannerConfigVo;
|
||||
import com.accompany.business.vo.firstcharge.FirstChargeExpVo;
|
||||
import com.accompany.business.vo.firstcharge.FirstChargeRewardVo;
|
||||
import com.accompany.business.vo.firstcharge.FirstChargeVo;
|
||||
import com.accompany.common.config.SystemConfig;
|
||||
import com.accompany.common.utils.StringUtils;
|
||||
import com.accompany.core.enumeration.BillObjTypeEnum;
|
||||
import com.accompany.core.model.Users;
|
||||
@@ -36,9 +37,11 @@ import java.util.stream.Collectors;
|
||||
|
||||
import static com.accompany.business.constant.activity.ActivityType.FIRST_CHARGE;
|
||||
import static com.accompany.business.service.activity.h5.ActivityOfChargeService.GOLD_TO_USB_DIVISOR;
|
||||
import static com.accompany.common.constant.Constant.DefMsgType.FIRST_CHARGE_REWARD;
|
||||
import static com.accompany.common.constant.Constant.DefMsgType.FIRST_CHARGE_REWARD_MSG_NEW;
|
||||
import static com.accompany.common.constant.Constant.SysConfId.FIRST_CHARGE_BANNER_CONFIG;
|
||||
import static com.accompany.common.redis.RedisKey.*;
|
||||
import static com.accompany.core.enumeration.I18nAlertEnum.FIRST_CHARGE_REWARD;
|
||||
import static com.accompany.core.enumeration.I18nAlertEnum.FIRST_CHARGE_REWARD_SYS;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@@ -161,10 +164,10 @@ public class FirstChargeService {
|
||||
}
|
||||
|
||||
public void firstChargeCheckAndReward(Long uid, String ip, String deviceId, Long totalGoldNum) {
|
||||
log.info("firstChargeCheckAndReward-begin,uid:{}, ip:{}, deviceId:{}, totalGoldNum:{}" , uid, ip, deviceId, totalGoldNum);
|
||||
if (checkStatus(uid, ip, deviceId)) {
|
||||
return;
|
||||
}
|
||||
log.info("firstChargeCheckAndReward-begin,uid:{}, ip:{}, deviceId:{}, totalGoldNum:{}" , uid, ip, deviceId, totalGoldNum);
|
||||
firstChargeRecordService.saveRecord(uid, ip, deviceId);
|
||||
this.deleteCache(uid, ip, deviceId);
|
||||
Users users = usersService.getUsersByUid(uid);
|
||||
@@ -184,8 +187,12 @@ public class FirstChargeService {
|
||||
}
|
||||
BigDecimal usd = BigDecimal.valueOf(totalGoldNum).divide(GOLD_TO_USB_DIVISOR, 2, RoundingMode.DOWN);
|
||||
activityRankRuleService.sendLevelRankAwardOnlyLevelWithBill(FIRST_CHARGE, uid, diffExpVo.getLevel(),
|
||||
"" , partitionId, BillObjTypeEnum.FIRST_CHARGE_REWARD);
|
||||
baseSendService.sendSystemMsg(uid.toString(), I18NMessageSourceUtil.getMessage(FIRST_CHARGE_REWARD, new Object[]{usd.doubleValue(), rewardGold}, uid));
|
||||
"" , partitionId, BillObjTypeEnum.FIRST_CHARGE_REWARD_BILL);
|
||||
String message = I18NMessageSourceUtil.getMessage(FIRST_CHARGE_REWARD_SYS, new Object[]{usd.doubleValue(), rewardGold}, uid);
|
||||
baseSendService.sendSystemMsg(uid.toString(), message);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("msg", message);
|
||||
baseSendService.sendMsg(SystemConfig.systemMessageUid, uid, FIRST_CHARGE_REWARD, FIRST_CHARGE_REWARD_MSG_NEW, jsonObject);
|
||||
}
|
||||
|
||||
public void deleteCache(Long uid, String ip, String deviceId) {
|
||||
|
@@ -82,6 +82,8 @@ public class ActivityOfChargeService {
|
||||
|
||||
//添加榜单数据
|
||||
public void addTotalNum(Long uid, Long goldNum, Date date) {
|
||||
try {
|
||||
log.info("ActivityOfChargeService.addTotalNum, uid:{}", uid);
|
||||
ActivitySwitchVo activitySwitchVo = activityRankRuleService.getActivitySwitchVo();
|
||||
if (!activitySwitchVo.getMonthCharge()) {
|
||||
return;
|
||||
@@ -115,6 +117,9 @@ public class ActivityOfChargeService {
|
||||
ActivityDiffExpVo diffExpVo = getDiffExpVo(aDouble, partitionId);
|
||||
addActivityUsers(diffExpVo.getLevel(), uid, partitionId, currentDate);
|
||||
sendLevelUpQYWXKey(currentDate, users, uid, diffExpVo.getLevel(), (long)Math.floor(aDouble));
|
||||
} catch (Exception e) {
|
||||
log.error("ActivityOfChargeService.addTotalNum:uid:{},totalNum:{},e:{}", uid, goldNum.toString(), e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
public ActivityH5ChargeRankVo rank(Long uid, Integer type) {
|
||||
|
Reference in New Issue
Block a user