幸运25-giftSendService策略入口

This commit is contained in:
khalil
2025-05-04 13:53:38 +08:00
parent 90c88ac0f2
commit 8a1721706a
35 changed files with 1719 additions and 36 deletions

View File

@@ -597,6 +597,7 @@ public class Constant {
* Bravo礼物
*/
public static final byte BRAVO_GIFT = GiftTypeEnum.BRAVO.getType();
public static final byte LUCKY_25 = GiftTypeEnum.LUCKY_25.getType();
}
public static class PayloadSkiptype {
@@ -1431,6 +1432,10 @@ public class Constant {
public static final String BRAVO_GIFT_CONFIG = "bravo_gift_config";
public static final String GUILD_USD_WITHDRAW_RATE = "guild_usd_withdraw_rate";
public static final String LUCKY_NUMBER_ACT_CONFIG = "lucky_number_act_config";
public static final String LUCKY_25_GIFT_CONFIG = "lucky_25_gift_config";
}
public static class WithDrawStatus {

View File

@@ -23,10 +23,12 @@ public enum GiftTypeEnum {
LUCKY_BAG_LINEAR((byte) 15, "线性福袋"),
SUPER_LUCKY((byte) 16, "幸运礼物"),
COUNTRY((byte) 17, "国家"),
LUCKY_24((byte) 18, "幸运礼物"),
LUCKY_24((byte) 18, "幸运24礼物"),
CP((byte) 19, "cp"),
CUSTOM((byte) 20, "大R定制"),
BRAVO((byte) 21, "Bravo");
BRAVO((byte) 21, "Bravo"),
LUCKY_25((byte) 22, "幸运25礼物"),
;
private byte type;
private String desc;

View File

@@ -1441,6 +1441,17 @@ public enum RedisKey {
gusd_withdraw_limit,//公会长提现次数限制
bravo_banner_queue, // bravo轮播队列
//幸运25
lucky_25_stock,
lucky_25_user_meta,
lucky_25_user_pool,
lucky_25_user_history,
lucky_25_user_lock,
lucky_25_robot_push_msg,
lucky_25_status, // 礼物消息的状态
lock_lucky_25_message, // 消费送礼物消息锁
lucky_25_user_10w_stat, // 消费送礼物消息锁
;
public String getKey() {

View File

@@ -233,8 +233,9 @@ public enum BillObjTypeEnum {
LUCKY_NUM_JACKPOT_INPUT_GOLD(155, "幸运数字奖池金币投入", BillTypeEnum.OUT, CurrencyEnum.DIAMOND, BillDomainTypeEnum.ACTIVITY),
LUCKY_NUM_JACKPOT_OUTPUT_GOLD(156, "幸运数字奖池金币瓜分", BillTypeEnum.IN, CurrencyEnum.DIAMOND, BillDomainTypeEnum.ACTIVITY),
LUCKY_24_GIFT_PAY( 157, "幸运礼物支出", BillTypeEnum.OUT, CurrencyEnum.DIAMOND, BillDomainTypeEnum.SEND_GIFT),
LUCKY_24_GIFT_PAY( 157, "幸运24礼物支出", BillTypeEnum.OUT, CurrencyEnum.DIAMOND, BillDomainTypeEnum.SEND_GIFT),
BRAVO_GIFT_PAY( 158, "Bravo礼物支出", BillTypeEnum.OUT, CurrencyEnum.DIAMOND, BillDomainTypeEnum.SEND_GIFT),
LUCKY_25_GIFT_PAY( 159, "幸运25礼物支出", BillTypeEnum.OUT, CurrencyEnum.DIAMOND, BillDomainTypeEnum.SEND_GIFT),
;
BillObjTypeEnum(int value, String desc, BillTypeEnum type, CurrencyEnum currency, BillDomainTypeEnum domain) {

View File

@@ -0,0 +1,8 @@
package com.accompany.sharding.model;
import com.baomidou.mybatisplus.annotation.TableName;
@TableName(value = "lucky_25_record")
public class Lucky25Record extends Lucky24Record {
}

View File

@@ -0,0 +1,11 @@
package com.accompany.sharding.vo;
import io.swagger.annotations.ApiModel;
@ApiModel
public class Lucky25PersonalStat extends Lucky24PersonalStat {
public Lucky25PersonalStat(String date, Integer partitionId, Long uid, Long erbanNo) {
super(date, partitionId, uid, erbanNo);
}
}

View File

@@ -0,0 +1,11 @@
package com.accompany.sharding.vo;
import io.swagger.annotations.ApiModel;
@ApiModel
public class Lucky25PlatformStat extends Lucky24PlatformStat {
public Lucky25PlatformStat(String date, Integer partitionId) {
super(date, partitionId);
}
}

View File

@@ -0,0 +1,22 @@
package com.accompany.sharding.mapper;
import com.accompany.sharding.model.Lucky25Record;
import com.accompany.sharding.vo.Lucky25PersonalStat;
import com.accompany.sharding.vo.Lucky25PlatformStat;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface Lucky25RecordMapper extends BaseMapper<Lucky25Record> {
List<Lucky25PlatformStat> listPlatform(@Param("partitionId") Integer partitionId, @Param("startTime") Date startTime, @Param("endTime") Date endTime,
@Param("zoneIdHour") long zoneIdHour);
List<Lucky25PersonalStat> listPersonal(@Param("partitionId") Integer partitionId,
@Param("uid") Long uid,
@Param("startTime") Date startTime, @Param("endTime") Date endTime,
@Param("zoneIdHour") long zoneIdHour);
}

View File

@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.accompany.sharding.mapper.Lucky25RecordMapper">
<select id="listPlatform" resultType="com.accompany.sharding.vo.Lucky25PlatformStat">
select `date`, partition_id,
sum(`totalInput`) `totalInput`, sum(`totalOutput`) `totalOutput`,
sum(`totalOutput`) / sum(`totalInput`) `productionRatio`,
count(*) `count`, count((IF(`maxOutput` > 0, 1, null))) `winCount`,
sum(`num`) `num`, sum(`winNum`) `winNum`, sum(`winNum`) / sum(`num`) `winRate`
from (
select date(date_add(r.create_time, INTERVAL #{zoneIdHour} HOUR)) `date`,
partition_id,
sum(gift_num * gift_gold_price) `totalInput`,
sum(win_gold_num) `totalOutput`,
count(*) `num`,
count((case when win_gold_num > 0 then 1 end)) `winNum`,
max(win_gold_num) `maxOutput`
from lucky_24_record r
where r.create_time >= #{startTime} and r.create_time &lt;= #{endTime}
and r.partition_id = #{partitionId}
group by `date`, uid) l
group by `date`
</select>
<select id="listPersonal" resultType="com.accompany.sharding.vo.Lucky25PersonalStat">
select date(date_add(r.create_time, INTERVAL #{zoneIdHour} HOUR)) `date`, partition_id,
r.uid,
sum(gift_num * gift_gold_price) `totalInput`,
sum(win_gold_num) `totalOutput`,
sum(gift_num * gift_gold_price) - sum(win_gold_num) `production`,
sum(win_gold_num) / sum(gift_num * gift_gold_price) `productionRatio`,
sum(gift_num * gift_gold_price) / count(*) `avgInput`,
count(*) `num`,
count((case when win_gold_num > 0 then r.uid else null end)) `winNum`,
ifnull(count((case when win_gold_num > 0 then r.uid else null end)) / count(*),0) `winRate`
from lucky_24_record r
where r.create_time >= #{startTime} and r.create_time &lt;= #{endTime}
<if test="null != uid">
and r.uid = #{uid}
</if>
and r.partition_id = #{partitionId}
group by `date`, r.uid
</select>
</mapper>