diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/dto/TarotChargeRecordDTO.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/dto/TarotChargeRecordDTO.java deleted file mode 100644 index e744c7d0a..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/dto/TarotChargeRecordDTO.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.accompany.admin.dto; - -import com.accompany.payment.vo.TarotRecordTotalVo; -import com.github.pagehelper.PageInfo; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @Author: yangming - * @Date: 2019/11/14 17:19 - * @Description: 塔罗充值统计数据对象 - **/ -@Data -@NoArgsConstructor -@AllArgsConstructor -public class TarotChargeRecordDTO { - - /** 分页对象 */ - private PageInfo pageInfo; - - /** 总的记录相加 */ - private TarotRecordTotalVo tarotRecordTotalVo; -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/dto/treasure/SeizeTreasureRecordDto.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/dto/treasure/SeizeTreasureRecordDto.java deleted file mode 100644 index b9cac46fb..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/dto/treasure/SeizeTreasureRecordDto.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.accompany.admin.dto.treasure; - -import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; - -/** - * @author: liaozetao - * @date: 2023/10/25 16:57 - * @description: - */ -@Data -public class SeizeTreasureRecordDto { - - /** - * ID - */ - @ExcelProperty("ID") - private Long id; - - /** - * 平台号 - */ - @ExcelProperty("平台号") - private Long erbanNo; - - /** - * 昵称 - */ - @ExcelProperty("昵称") - private String userNick; - - /** - * 奖励ID - */ - @ExcelProperty("奖励ID") - private Long rewardId; - - /** - * 奖励关联ID - */ - @ExcelProperty("奖励关联ID") - private Long rewardRefId; - - /** - * 奖励类型 - */ - @ExcelProperty("奖励类型") - private String rewardType; - - /** - * 奖励名称 - */ - @ExcelProperty("奖励名称") - private String rewardName; - - /** - * 奖励数量 - */ - @ExcelProperty("奖励数量") - private Integer rewardNum; - - /** - * 奖励等级 - */ - @ExcelProperty("奖励等级") - private Integer rewardLevel; - - /** - * 奖励价值 - */ - @ExcelProperty("奖励价值") - private Integer rewardShowValue; - - /** - * 抽奖时间 - */ - @ExcelProperty("抽奖时间") - private String createTimeStr; -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/dto/treasure/SeizeTreasureUserPropRecordAdminDto.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/dto/treasure/SeizeTreasureUserPropRecordAdminDto.java deleted file mode 100644 index 6cfc746bb..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/dto/treasure/SeizeTreasureUserPropRecordAdminDto.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.accompany.admin.dto.treasure; - -import com.alibaba.excel.annotation.ExcelProperty; -import lombok.Data; - -/** - * @author: liaozetao - * @date: 2023/9/7 16:55 - * @description: - */ -@Data -public class SeizeTreasureUserPropRecordAdminDto { - - /** - * 用户ID - */ - @ExcelProperty("用户ID") - private Long erbanNo; - - /** - * 昵称 - */ - @ExcelProperty("昵称") - private String nick; - - /** - * 试炼素材 - */ - @ExcelProperty("试炼素材") - private String expendStr; - - /** - * 试炼产出 - */ - @ExcelProperty("试炼产出") - private String propName; - - /** - * 试炼时间 - */ - @ExcelProperty("试炼时间") - private String createTimeStr; -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/params/linearlypool/PlatformDataReqParams.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/params/linearlypool/PlatformDataReqParams.java index 25b7fa3f1..6159c24cc 100644 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/params/linearlypool/PlatformDataReqParams.java +++ b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/params/linearlypool/PlatformDataReqParams.java @@ -1,27 +1,24 @@ package com.accompany.admin.params.linearlypool; -import lombok.AllArgsConstructor; -import lombok.Builder; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; -import lombok.NoArgsConstructor; import java.util.Date; /** + * 平台数据请求参数 */ -@AllArgsConstructor -@NoArgsConstructor @Data -@Builder +@ApiModel("平台数据请求参数") public class PlatformDataReqParams { - private Integer pageNum; - - private Integer pageSize; - + @ApiModelProperty("开始日期") private Date startDate; + @ApiModelProperty("结束日期") private Date endDate; + @ApiModelProperty("用户靓号") private Long erbanNo; -} +} \ No newline at end of file diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/params/linearlypool/PoolItemDraftSaveReqParams.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/params/linearlypool/PoolItemDraftSaveReqParams.java deleted file mode 100644 index ac8826aa4..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/params/linearlypool/PoolItemDraftSaveReqParams.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.accompany.admin.params.linearlypool; - -import com.accompany.business.model.linearlypool.LinearlyPrizePoolItemDraft; -import lombok.Data; - -import java.util.List; - -@Data -public class PoolItemDraftSaveReqParams { - - private List poolItems; - - private Byte prizePoolType; -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/params/linearlypool/PoolItemShowRatioReqParams.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/params/linearlypool/PoolItemShowRatioReqParams.java deleted file mode 100644 index c903fd9cd..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/params/linearlypool/PoolItemShowRatioReqParams.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.accompany.admin.params.linearlypool; - -import com.accompany.business.model.linearlypool.LinearlyPrizePoolItem; -import lombok.Data; - -import java.util.List; - -@Data -public class PoolItemShowRatioReqParams { - - private List poolItems; - -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/GiftCompoundRewardAdminVo.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/GiftCompoundRewardAdminVo.java deleted file mode 100644 index 994b26ced..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/GiftCompoundRewardAdminVo.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.accompany.admin.vo; - -import com.accompany.core.annotation.I18n; -import lombok.Data; - -@Data -public class GiftCompoundRewardAdminVo { - - private Integer id; - - private Integer giftId; - - private Integer rate; - - private Integer orderNo; - - private Integer serviceNotice; - - @I18n(className = "Gift") - private String giftName; - - private Long goldPrice; - - private Integer giftRate; - - private String expendValue; - - private Double expectValue; -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/audiocard/UserAudioCardAdminVo.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/audiocard/UserAudioCardAdminVo.java deleted file mode 100644 index 54177babb..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/audiocard/UserAudioCardAdminVo.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.accompany.admin.vo.audiocard; - -import lombok.Data; - -import java.util.Date; - -@Data -public class UserAudioCardAdminVo { - - private Long id; - private Long uid; - private Long erbanNo; - private String nick; - private String audioUrl; - private Integer second; - private Date createTime; - private Byte status; - private String auditor; - private Date auditTime; - private Boolean isDel; -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/chat/PublicChatTopRecordAdminVo.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/chat/PublicChatTopRecordAdminVo.java deleted file mode 100644 index 29502150e..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/chat/PublicChatTopRecordAdminVo.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.accompany.admin.vo.chat; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -/** - * @author: liaozetao - * @date: 2024/5/8 10:46 - * @description: - */ -@Data -public class PublicChatTopRecordAdminVo { - - /** - * 用户ID - */ - @ApiModelProperty("用户ID") - private Long erbanNo; - - /** - * 用户昵称 - */ - @ApiModelProperty("用户昵称") - private String nick; - - /** - * 所属地区 - */ - @ApiModelProperty("所属地区") - private String partitionDesc; - - /** - * 付费金额(金币) - */ - @ApiModelProperty("付费金额(金币)") - private Integer payMoneyNum; - - /** - * 付费日期 - */ - @ApiModelProperty("付费日期") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date createTime; - - /** - * 头条内容 - */ - @ApiModelProperty("头条内容") - private String content; -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/findlove/PoolItemVo.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/findlove/PoolItemVo.java index 32148a163..34527b544 100644 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/findlove/PoolItemVo.java +++ b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/findlove/PoolItemVo.java @@ -1,10 +1,9 @@ package com.accompany.admin.vo.findlove; -import com.accompany.business.model.linearlypool.LinearlyPrizePoolItem; import lombok.Data; @Data -public class PoolItemVo extends LinearlyPrizePoolItem { +public class PoolItemVo { /** * 奖品类型 see {@link com.accompany.business.constant.PrizeTypeEnum} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/gift/GiftCompoundRewordVo.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/gift/GiftCompoundRewordVo.java deleted file mode 100644 index 04ecabcce..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/gift/GiftCompoundRewordVo.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.accompany.admin.vo.gift; - -import com.accompany.business.model.GiftCompoundReward; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -public class GiftCompoundRewordVo { - @ApiModelProperty("合成奖励id") - private Integer id; - @ApiModelProperty("展示礼物id") - private Integer giftId; - @ApiModelProperty("展示礼物价值") - private Integer giftGoldPrice; - @ApiModelProperty("序号") - private Integer orderNo; - @ApiModelProperty("合成奖励消耗值") - private Integer expendValue; - @ApiModelProperty("合成奖励类型-1:普通合成奖励;2:限时合成奖励") - private Integer rewardType; - @ApiModelProperty("合成概率") - private Integer rate; - @ApiModelProperty("期望") - private Integer expectValue; - @ApiModelProperty("是否全服通知") - private Boolean serviceNotice = false; - - public GiftCompoundReward toEntity() { - GiftCompoundReward entity = new GiftCompoundReward(); - entity.setId(this.id); - entity.setGiftId(this.giftId); - entity.setOrderNo(this.orderNo); - entity.setExpendValue(this.expendValue); - entity.setRewardType(this.rewardType); - return entity; - } -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/home/HomeNewFriendAdminVo.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/home/HomeNewFriendAdminVo.java deleted file mode 100644 index 1bbaa61b3..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/home/HomeNewFriendAdminVo.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.accompany.admin.vo.home; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -/** - * @author: liaozetao - * @date: 2023/9/4 14:19 - * @description: - */ -@Data -public class HomeNewFriendAdminVo { - - /** - * 用户UID - */ - @ApiModelProperty("用户UID") - private Long uid; - - /** - * 平台号 - */ - @ApiModelProperty("平台号") - private Long erbanNo; - - /** - * 昵称 - */ - @ApiModelProperty("昵称") - private String nick; - - /** - * 头像 - */ - @ApiModelProperty("头像") - private String avatar; - - /** - * 性别 - */ - @ApiModelProperty("性别") - private Byte gender; - - /** - * 创建时间 - */ - @ApiModelProperty("创建时间") - private Date createTime; - - /** - * 失效时间 - */ - @ApiModelProperty("失效时间") - private Date expireTime; - -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/linearlypool/LinearlyPoolDeployResultVO.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/linearlypool/LinearlyPoolDeployResultVO.java deleted file mode 100644 index 743b62c34..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/linearlypool/LinearlyPoolDeployResultVO.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.accompany.admin.vo.linearlypool; - -import lombok.Data; - -@Data -public class LinearlyPoolDeployResultVO { - /** - * 当前奖品线id - */ - private Long currentPoolLineId; - /** - * 发布后生效的奖品线id - */ - private Long willActiveLineId; -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/linearlypool/LinearlyPoolDrawRecordStatisVo.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/linearlypool/LinearlyPoolDrawRecordStatisVo.java deleted file mode 100644 index a45bcd915..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/linearlypool/LinearlyPoolDrawRecordStatisVo.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.accompany.admin.vo.linearlypool; - -import lombok.Data; - -import java.util.Date; - -@Data -public class LinearlyPoolDrawRecordStatisVo { - private Date createTime; - private Integer countNum; - private Long userTotalPay; - private Long totalPlatformValue; - private Long totalActualValue; - private Long totalGiftActualValue; - private Long totalNotGiftActualValue; - private Long totalRealGiftActualValue; -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/linearlypool/LinearlyPoolDrawRecordVO.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/linearlypool/LinearlyPoolDrawRecordVO.java deleted file mode 100644 index 4e9b902f4..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/linearlypool/LinearlyPoolDrawRecordVO.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 文 件 名: LinearlyPoolDrawRecordVO - * 版 权: - * 描 述: <描述> - * 创建时间: 2021/9/17 - * 修改人: - * 修改内容: - * 修改时间: - */ -package com.accompany.admin.vo.linearlypool; - -import com.accompany.business.model.linearlypool.LinearlyPrizePoolDrawLineItem; -import lombok.Data; - -/** - *
类描述: 抽奖记录vo - *
功能详细描述: - * - * @date [2021/9/17] - */ -@Data -public class LinearlyPoolDrawRecordVO extends LinearlyPrizePoolDrawLineItem { - - private Long erbanNo; - - private String nick; -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/linearlypool/LinearlyPoolItemAdminPageVO.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/linearlypool/LinearlyPoolItemAdminPageVO.java deleted file mode 100644 index daf1067ae..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/linearlypool/LinearlyPoolItemAdminPageVO.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.accompany.admin.vo.linearlypool; - -import lombok.Data; - -import java.util.List; - -@Data -public class LinearlyPoolItemAdminPageVO { - - /** - * 普通礼物组 - */ - private PrizeGroupVO normalPrizeGroup; - - /** - * 高级礼物组 - */ - private PrizeGroupVO seniorPrizeGroup; - - /** - * 已发布的普通礼物组列表 - */ - private List deployedNormalPrizes; - /** - * 已发布的高级礼物组列表 - */ - private List deployedSeniorPrizes; - - /** - * 当前奖品线id - */ - private Long currentPoolLineId; - /** - * 已生成的最大奖品线id - */ - private Long maxLineId; -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/linearlypool/PrizeGroupVO.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/linearlypool/PrizeGroupVO.java deleted file mode 100644 index f6ba69aad..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/linearlypool/PrizeGroupVO.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.accompany.admin.vo.linearlypool; - -import lombok.Data; - -import java.util.List; - -@Data -public class PrizeGroupVO { - - /** - * 奖品列表 - */ - private List prizeItems; - - /** - * 是否未发布 - */ - private Boolean isUndeploy; -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/linearlypool/PrizeItemVO.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/linearlypool/PrizeItemVO.java deleted file mode 100644 index c0b81cac4..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/linearlypool/PrizeItemVO.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.accompany.admin.vo.linearlypool; - -import com.accompany.business.model.linearlypool.LinearlyPrizePoolItem; -import lombok.Data; - -@Data -public class PrizeItemVO extends LinearlyPrizePoolItem { - - /** - * 奖品类型 see {@link com.accompany.business.constant.PrizeTypeEnum} - */ - private Byte prizeType; - - /** - * 奖品名称 - */ - private String prizeName; - - /** - * 平台价值 - */ - private Integer platformValue; - -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/linearlypool/UserDrawStatisAdminVo.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/linearlypool/UserDrawStatisAdminVo.java deleted file mode 100644 index 83a415adf..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/linearlypool/UserDrawStatisAdminVo.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.accompany.admin.vo.linearlypool; - -import lombok.Data; - -@Data -public class UserDrawStatisAdminVo { - - private Long uid; - private String nick; - private Long erbanNo; - private Long totalPurchaseMoney; - private Long totalDrawMoney; - private Long totalPlatformValue; - private Long totalActualValue; - private Long deviation; - -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasureConvertItemAdminVo.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasureConvertItemAdminVo.java deleted file mode 100644 index e1f929bdd..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasureConvertItemAdminVo.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.accompany.admin.vo.treasure; - -import cn.hutool.core.util.StrUtil; -import com.accompany.business.model.treasure.SeizeTreasureConvertItem; -import com.alibaba.fastjson.JSONArray; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Collections; -import java.util.List; - -/** - * @author: liaozetao - * @date: 2023/9/6 14:52 - * @description: - */ -@Data -@ApiModel -public class SeizeTreasureConvertItemAdminVo extends SeizeTreasureConvertItem { - - /** - * 奖品类型 - */ - @ApiModelProperty("奖品类型") - private String rewardType; - - /** - * 奖品名称 - */ - @ApiModelProperty("奖品名称") - private String rewardName; - - /** - * 奖品价值 - */ - @ApiModelProperty("奖品价值") - private Integer rewardValue; - - /** - * 关联ID - */ - @ApiModelProperty("关联ID") - private Long rewardRefId; - - /** - * 精灵ID - */ - @ApiModelProperty("精灵ID") - private String propIdsJson; - - /** - * 精灵数量 - */ - @ApiModelProperty("精灵数量") - private String propNumsJson; - - - @Override - public List getPropIds() { - if (StrUtil.isEmpty(propIdsJson)) { - return Collections.emptyList(); - } - return JSONArray.parseArray(propIdsJson, Long.class); - } - - @Override - public List getPropNums() { - if (StrUtil.isEmpty(propNumsJson)) { - return Collections.emptyList(); - } - return JSONArray.parseArray(propNumsJson, Integer.class); - } -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasureConvertRecordAdminVo.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasureConvertRecordAdminVo.java deleted file mode 100644 index 39b78357b..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasureConvertRecordAdminVo.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.accompany.admin.vo.treasure; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -/** - * @author: liaozetao - * @date: 2023/9/7 11:10 - * @description: - */ -@Data -@ApiModel -public class SeizeTreasureConvertRecordAdminVo { - - /** - * 用户ID - */ - @ApiModelProperty("用户ID") - private Long erbanNo; - - /** - * 用户昵称 - */ - @ApiModelProperty("用户昵称") - private String nick; - - /** - * 召唤类型 - */ - @ApiModelProperty("召唤类型") - private Integer convertType; - - /** - * 获得物品名称 - */ - @ApiModelProperty("获得物品名称") - private String rewardName; - - /** - * 获得物品价值 - */ - @ApiModelProperty("获得物品价值(钻)") - private Integer rewardShowValue; - - /** - * 召唤时间 - */ - @ApiModelProperty("召唤时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date createTime; -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasureDailyRecordVo.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasureDailyRecordVo.java deleted file mode 100644 index 8a6c857b6..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasureDailyRecordVo.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.accompany.admin.vo.treasure; - -import com.accompany.business.vo.treasure.record.SeizeTreasureStaticVo; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -public class SeizeTreasureDailyRecordVo extends SeizeTreasureStaticVo { - private String dateStr; -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasurePoolDrawRecordAdminVo.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasurePoolDrawRecordAdminVo.java deleted file mode 100644 index 43f5953c9..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasurePoolDrawRecordAdminVo.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.accompany.admin.vo.treasure; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.math.BigDecimal; - -/** - * @author: liaozetao - * @date: 2023/9/7 14:19 - * @description: - */ -@Data -@ApiModel -public class SeizeTreasurePoolDrawRecordAdminVo { - - /** - * 用户UID - */ - @ApiModelProperty("用户UID") - private Long uid; - - /** - * 平台号 - */ - @ApiModelProperty("平台号") - private Long erbanNo; - - /** - * 昵称 - */ - @ApiModelProperty("昵称") - private String nick; - - /** - * 历史抽奖总金额 - */ - @ApiModelProperty("历史抽奖总金额") - private BigDecimal drawAmount = BigDecimal.ZERO; - - /** - * 历史获奖平台价值 - */ - @ApiModelProperty("历史获奖平台价值") - private BigDecimal rewardAmount = BigDecimal.ZERO; - - - public BigDecimal getDiffAmount() { - return this.drawAmount.subtract(this.rewardAmount); - } -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasurePoolItemAdminVo.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasurePoolItemAdminVo.java deleted file mode 100644 index d5d965559..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasurePoolItemAdminVo.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.accompany.admin.vo.treasure; - -import com.accompany.business.model.treasure.SeizeTreasurePoolItem; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @author: liaozetao - * @date: 2023/10/10 14:11 - * @description: - */ -@Data -@ApiModel -public class SeizeTreasurePoolItemAdminVo extends SeizeTreasurePoolItem { - - /** - * 奖品名称 - */ - @ApiModelProperty("奖品名称") - private String rewardName; - - /** - * 奖品价值 - */ - @ApiModelProperty("奖品价值") - private Integer rewardValue; - - /** - * 奖品展示价值 - */ - @ApiModelProperty("奖品展示价值") - private Integer rewardShowValue; - - /** - * 关联ID - */ - @ApiModelProperty("关联ID") - private Long rewardRefId; -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasurePoolItemCountAdminVo.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasurePoolItemCountAdminVo.java deleted file mode 100644 index 0f0806bef..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasurePoolItemCountAdminVo.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.accompany.admin.vo.treasure; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @author: liaozetao - * @date: 2023/10/13 16:59 - * @description: - */ -@Data -@ApiModel -public class SeizeTreasurePoolItemCountAdminVo { - - /** - * 礼物个数 - */ - @ApiModelProperty("礼物个数") - private Double giftCount = 0D; - - /** - * 礼物价值 - */ - @ApiModelProperty("礼物价值") - private Double giftValue = 0D; - - /** - * 奖池线包含组数 - */ - @ApiModelProperty("奖池线包含组数") - private Double rewardLineCount = 0D; - - /** - * 奖池线礼物数 - */ - @ApiModelProperty("奖池线礼物数") - private Double rewardLineNum = 0D; - - /** - * 总礼物价值 - */ - @ApiModelProperty("总礼物价值") - private Double totalGiftValue = 0D; - - /** - * 单线比 - */ - @ApiModelProperty("单线比") - private Double singleLineRatio = 0D; -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasurePoolItemDeployedAdminVo.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasurePoolItemDeployedAdminVo.java deleted file mode 100644 index b3dd9ef36..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasurePoolItemDeployedAdminVo.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.accompany.admin.vo.treasure; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.List; - -/** - * @author: liaozetao - * @date: 2023/10/13 15:54 - * @description: - */ -@Data -@ApiModel -public class SeizeTreasurePoolItemDeployedAdminVo { - - /** - * 普通 - */ - @ApiModelProperty("普通") - private List normalPoolItems; - - /** - * 高级 - */ - @ApiModelProperty("高级") - private List seniorPoolItems; -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasureRecordVo.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasureRecordVo.java deleted file mode 100644 index f9e7d37ae..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasureRecordVo.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.accompany.admin.vo.treasure; - -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -@Data -@NoArgsConstructor -public class SeizeTreasureRecordVo { - private Long id; - private Long erbanNo; - private String userNick; - private String poolType; - private String poolGroup; - private String poolLevel; - private Long rewardId; - private Long rewardRefId; - private String rewardType; - private String rewardName; - private Integer rewardNum; - private Integer rewardLevel; - private Integer rewardShowValue; - private Date createTime; -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasureUserPropRecordAdminVo.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasureUserPropRecordAdminVo.java deleted file mode 100644 index 07cea96a5..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/treasure/SeizeTreasureUserPropRecordAdminVo.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.accompany.admin.vo.treasure; - -import com.accompany.business.model.treasure.SeizeTreasureUserPropRecord; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; -import java.util.List; - -/** - * @author: liaozetao - * @date: 2023/9/7 16:24 - * @description: - */ -@Data -@ApiModel -public class SeizeTreasureUserPropRecordAdminVo { - - /** - * 用户ID - */ - @ApiModelProperty("用户ID") - private Long erbanNo; - - /** - * 昵称 - */ - @ApiModelProperty("昵称") - private String nick; - - /** - * 试炼素材 - */ - @ApiModelProperty("试炼素材") - private List expends; - - /** - * 试炼产出 - */ - @ApiModelProperty("试炼产出") - private String propName; - - /** - * 试炼时间 - */ - @ApiModelProperty("试炼时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date createTime; -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/GiftCompoundAdminMapper.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/GiftCompoundAdminMapper.java deleted file mode 100644 index f6357191d..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/GiftCompoundAdminMapper.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.accompany.admin.mapper; - -import com.accompany.admin.vo.GiftCompoundRewardAdminVo; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -public interface GiftCompoundAdminMapper { - - List getGiftCompoundList(); - - GiftCompoundRewardAdminVo getGiftCompoundById(Integer id); - - List getGiftCompoundLimitList(@Param("rewardId") Integer rewardId); - - GiftCompoundRewardAdminVo getGiftCompoundLimitById(@Param("id") Integer id); - - List getPoolItem(@Param("id") Integer id); - -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/chat/PublicChatTopRecordAdminMapper.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/chat/PublicChatTopRecordAdminMapper.java deleted file mode 100644 index f2847e8d3..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/chat/PublicChatTopRecordAdminMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.accompany.admin.mapper.chat; - -import com.accompany.admin.vo.chat.PublicChatTopRecordAdminVo; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import org.apache.ibatis.annotations.Param; - -/** - * @author: liaozetao - * @date: 2024/5/8 10:45 - * @description: - */ -public interface PublicChatTopRecordAdminMapper { - - /** - * 分页 - * @param page - * @param erbanNo - * @param startTime - * @param endTime - * @param partitionId - * @return - */ - Page selectPage(Page page, @Param("erbanNo") Long erbanNo, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("partitionId") Integer partitionId); -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/linearlypool/LinearlyPoolAdminMapper.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/linearlypool/LinearlyPoolAdminMapper.java deleted file mode 100644 index 3fe8cf279..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/linearlypool/LinearlyPoolAdminMapper.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.accompany.admin.mapper.linearlypool; - -import com.accompany.admin.vo.linearlypool.LinearlyPoolDrawRecordStatisVo; -import com.accompany.admin.vo.linearlypool.UserDrawStatisAdminVo; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -public interface LinearlyPoolAdminMapper { - LinearlyPoolDrawRecordStatisVo getDrawStaticList(@Param("startTime") Date startTime, @Param("endTime") Date endTime, - @Param("uid") Long uid, @Param("tableType") String tableType); - - List getUserStatisList(@Param("uid") Long uid, @Param("minDis") Integer minDis, @Param("maxDis") Integer maxDis, @Param("startTime") String startTime, @Param("endTime") String endTime); -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/treasure/SeizeTreasureAdminMapper.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/treasure/SeizeTreasureAdminMapper.java deleted file mode 100644 index 36f1590ca..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/treasure/SeizeTreasureAdminMapper.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.accompany.admin.mapper.treasure; - -import com.accompany.admin.vo.treasure.SeizeTreasureDailyRecordVo; -import com.accompany.admin.vo.treasure.SeizeTreasureRecordVo; -import com.accompany.business.vo.treasure.record.SeizeTreasureStaticVo; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -@Mapper -public interface SeizeTreasureAdminMapper { - - SeizeTreasureStaticVo getRecordTotal(@Param("poolTypeList") List poolTypeList, @Param("poolGroupList") List poolGroupList, @Param("poolLevelList") List poolLevelList, @Param("uid") Long uid, @Param("startTime") Date startTime, @Param("endTime") Date endTime); - - List getRecordDaily(@Param("poolTypeList") List poolTypeList, @Param("poolGroupList") List poolGroupList, @Param("poolLevelList") List poolLevelList, @Param("uid") Long uid, @Param("startTime") Date startTime, @Param("endTime") Date endTime); - - List getRecord(@Param("poolTypeList") List poolTypeList, @Param("poolGroupList") List poolGroupList, @Param("poolLevelList") List poolLevelList, @Param("uid") Long uid, @Param("startTime") Date startTime, @Param("endTime") Date endTime); - -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/treasure/SeizeTreasurePoolDrawRecordAdminMapper.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/treasure/SeizeTreasurePoolDrawRecordAdminMapper.java deleted file mode 100644 index 03c77e575..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/treasure/SeizeTreasurePoolDrawRecordAdminMapper.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.accompany.admin.mapper.treasure; - -import com.accompany.admin.vo.treasure.SeizeTreasurePoolDrawRecordAdminVo; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * @author: liaozetao - * @date: 2023/9/7 14:33 - * @description: - */ -public interface SeizeTreasurePoolDrawRecordAdminMapper { - - /** - * 用户数据查询-全奖池 - * - * @param page - * @param startTime - * @param endTime - * @param uidList - * @return - */ - Page totalPage(Page page, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("uidList") List uidList); -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/treasure/SeizeTreasurePoolItemAdminMapper.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/treasure/SeizeTreasurePoolItemAdminMapper.java deleted file mode 100644 index d2ae54a5e..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/treasure/SeizeTreasurePoolItemAdminMapper.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.accompany.admin.mapper.treasure; - -import com.accompany.admin.vo.treasure.SeizeTreasurePoolItemAdminVo; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import org.apache.ibatis.annotations.Param; - -/** - * @author: liaozetao - * @date: 2023/10/10 14:14 - * @description: - */ -public interface SeizeTreasurePoolItemAdminMapper { - - /** - * 分页 - * - * @param page - * @param rewardName - * @param poolType - * @param poolGroup - * @param poolLevel - * @return - */ - Page page(Page page, @Param("rewardName") String rewardName, @Param("poolType") Integer poolType, @Param("poolGroup") Integer poolGroup, @Param("poolLevel") Integer poolLevel); -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/WriteAcheService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/WriteAcheService.java deleted file mode 100644 index d908ff136..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/WriteAcheService.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.accompany.admin.service; - -import com.accompany.admin.service.base.BaseService; -import com.accompany.common.redis.RedisKey; -import com.accompany.core.model.Account; -import com.accompany.core.service.account.AccountService; -import com.accompany.core.service.common.JedisService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import java.util.List; - -/** - * Created by Administrator on 2018/1/13. - */ -@Service -public class WriteAcheService extends BaseService { - @Autowired - private AccountService accountService; - @Autowired - private JedisService jedisService; - - public int startWriteAche(){ - List userses = accountService.list(); - if(!CollectionUtils.isEmpty(userses)){ - for ( Account user: userses) { - jedisService.hset(RedisKey.erban_no.getKey(), String.valueOf(user.getErbanNo()),String.valueOf(user.getUid())); - } - }else{ - return 0; - } - return 200; - } - - -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/analysis/AnalysisAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/analysis/AnalysisAdminService.java deleted file mode 100644 index e56df7ecb..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/analysis/AnalysisAdminService.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.accompany.admin.service.analysis; - -/** - * @author: liaozetao - * @date: 2023/9/16 15:08 - * @description: - */ -public interface AnalysisAdminService { - - /** - * 初始化数据 - */ - void initData(); - -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/analysis/impl/AnalysisAdminServiceImpl.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/analysis/impl/AnalysisAdminServiceImpl.java deleted file mode 100644 index 52200a7bf..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/analysis/impl/AnalysisAdminServiceImpl.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.accompany.admin.service.analysis.impl; - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.StrUtil; -import com.accompany.admin.service.analysis.AnalysisAdminService; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.stereotype.Service; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * @author: liaozetao - * @date: 2023/9/16 15:08 - * @description: - */ -@Slf4j -@Service -public class AnalysisAdminServiceImpl implements AnalysisAdminService { - - @Autowired - private JdbcTemplate jdbcTemplate; - - @Override - public void initData() { - firstChatRecord(); - } - - private void firstChatRecord() { - log.info("==== firstChatRecord initData start... ===="); - //jdbcTemplate.execute("drop table if exists t_first_chat_record;"); - //jdbcTemplate.execute("create table t_first_chat_record(uid bigint, erban_no bigint, nick varchar(256) charset utf8mb4, is_initiative tinyint(4), first_charge_time varchar(256), first_charge_amount decimal(11, 4), msg_type varchar(256) charset utf8mb4);"); - List uidList = jdbcTemplate.query("select uid from users where def_user = 1 and create_time >= DATE_SUB(CURDATE(), INTERVAL 30 DAY) and uid not in (select uid from t_first_chat_record) limit 20", (rs, i) -> rs.getLong("uid")); - while (CollectionUtil.isNotEmpty(uidList)) { - for (Long uid : uidList) { - try { - Map userMap = jdbcTemplate.queryForObject("select uid, erban_no, nick from users where uid = " + uid, (rs, i) -> { - Map map = new HashMap<>(); - map.put("uid", rs.getLong("uid")); - map.put("erbanNo", rs.getLong("erban_no")); - map.put("nick", rs.getString("nick")); - return map; - }); - if (CollectionUtil.isEmpty(userMap)) { - continue; - } - List fromUids = jdbcTemplate.query("select hrcr.from_uid as fromUid from hall_room_chat_record as hrcr where (hrcr.to_uid = " + uid + " or hrcr.from_uid = " + uid + ") and hrcr.conv_type = 'PERSON' order by hrcr.id limit 1", (rs, i) -> rs.getLong("fromUid")); - List createTimes = jdbcTemplate.query("select DATE_FORMAT(cr.create_time, '%Y-%m-%d %H:%i:%s') as createTime from charge_record as cr where cr.uid = " + uid + " and cr.charge_status in (2,6) order by cr.create_time limit 1", (rs, i) -> rs.getString("createTime")); - List amounts = jdbcTemplate.query("select (cr.amount / 100) as amount from charge_record as cr where cr.uid = " + uid + " and cr.charge_status in (2,6) order by cr.create_time limit 1", (rs, i) -> rs.getDouble("amount")); - List msgTypes = jdbcTemplate.query("select (case hrcr.msg_type when 'TEXT' then '文字' when 'PICTURE' then '图片' else '无' end) as msgType from hall_room_chat_record as hrcr where (hrcr.to_uid = " + uid + " or hrcr.from_uid = " + uid + ") and hrcr.conv_type = 'PERSON' order by hrcr.id limit 1", (rs, i) -> rs.getString("msgType")); - int isInitiative = 0; - if (CollectionUtil.isNotEmpty(fromUids)) { - Long fromUid = fromUids.get(0); - if (Objects.equals(fromUid, uid)) { - isInitiative = 1; - } - } - String createTime = StrUtil.EMPTY; - double amount = 0.0; - String msgType = "无"; - if (CollectionUtil.isNotEmpty(createTimes)) { - createTime = createTimes.get(0); - } - if (CollectionUtil.isNotEmpty(amounts)) { - amount = amounts.get(0); - } - if (CollectionUtil.isNotEmpty(msgTypes)) { - msgType = msgTypes.get(0); - } - String sql = "insert into t_first_chat_record(uid, erban_no, nick, is_initiative, first_charge_time, first_charge_amount, msg_type) values(" + - "'" + uid + "'," + - "'" + userMap.get("erbanNo") + "'," + - "\"" + userMap.get("nick") + "\"," + - "'" + isInitiative + "'," + - "'" + createTime + "'," + - "'" + amount + "'," + - "'" + msgType + "'" + - ")"; - log.info("sql : {}", sql); - jdbcTemplate.execute(sql); - } catch (Exception e) { - log.error(e.getMessage(), e); - } - } - uidList = jdbcTemplate.query("select uid from users where def_user = 1 and create_time >= DATE_SUB(CURDATE(), INTERVAL 30 DAY) and uid not in (select uid from t_first_chat_record) limit 20", (rs, i) -> rs.getLong("uid")); - } - log.info("==== firstChatRecord initData end... ===="); - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/anchor/AnchorAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/anchor/AnchorAdminService.java deleted file mode 100644 index 38ac55d31..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/anchor/AnchorAdminService.java +++ /dev/null @@ -1,165 +0,0 @@ -package com.accompany.admin.service.anchor; - -import com.accompany.admin.model.AdminUser; -import com.accompany.admin.service.base.BaseService; -import com.accompany.admin.service.system.AdminUserService; -import com.accompany.business.model.AnchorWhitelist; -import com.accompany.business.model.AnchorWhitelistExample; -import com.accompany.business.mybatismapper.AnchorWhitelistMapper; -import com.accompany.common.redis.RedisKey; -import com.accompany.core.exception.AdminServiceException; -import com.accompany.core.model.Users; -import com.accompany.core.service.common.JedisService; -import com.accompany.core.service.user.UsersBaseService; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Date; -import java.util.List; - -/** - * 主播白名单service - */ -@Service -public class AnchorAdminService extends BaseService { - - - @Autowired - private AnchorWhitelistMapper anchorWhitelistMapper; - - @Autowired - private UsersBaseService usersBaseService; - - @Autowired - private AdminUserService adminUserService; - - @Autowired - private JedisService jedisService; - - - /** - * 查询主播白名单列表 - * @param erbanNo - * @param pageNumber - * @param pageSize - * @return - */ - public PageInfo queryUsersForPages(Long erbanNo, Integer pageNumber, Integer pageSize) { - PageHelper.startPage(pageNumber, pageSize); - return new PageInfo<>(queryWhiteLists(erbanNo)); - } - - public List queryWhiteLists(Long erbanNo) { - - AnchorWhitelistExample anchorWhitelistExample = new AnchorWhitelistExample(); - anchorWhitelistExample.setOrderByClause("operate_time desc"); - AnchorWhitelistExample.Criteria criteria = anchorWhitelistExample.createCriteria(); - criteria.andStatusEqualTo(1); - if(null != erbanNo) { - criteria.andErbanNoEqualTo(erbanNo); - } - List anchorWhitelists = anchorWhitelistMapper.selectByExample(anchorWhitelistExample); - return anchorWhitelists; - } - - - /** - * 增加白名单用户 - * @param erbanNo - * @return - */ - public int addAnchor(int adminId, String erbanNo, String reason){ - logger.info("addAnchor adminId:{},erbanNo:{},reason:{}",adminId,erbanNo,reason); - - if(StringUtils.isNotBlank(erbanNo)){ - String[] erbanNoList = erbanNo.split(","); - for(String erbanNoStr : erbanNoList){ - //用户信息 - Users users = usersBaseService.getUsersByErBanNo(Long.valueOf(erbanNoStr)); - if(null == users) { - throw new AdminServiceException("平台号为"+ erbanNo + "的用户不存在!"); - } - AnchorWhitelistExample anchorWhitelistExample = new AnchorWhitelistExample(); - AnchorWhitelistExample.Criteria criteria = anchorWhitelistExample.createCriteria(); - criteria.andUidEqualTo(users.getUid()); - List anchorWhitelists = anchorWhitelistMapper.selectByExample(anchorWhitelistExample); - - int row = 0; - if(!CollectionUtils.isEmpty(anchorWhitelists)){ - AnchorWhitelist anchor = anchorWhitelists.get(0); - if(anchor.getStatus() == 1){ - throw new AdminServiceException("平台号为"+ erbanNo + "已存在列表中!"); - }else { - anchor.setStatus(1); - anchor.setOperateReason(reason); - row = anchorWhitelistMapper.updateByPrimaryKey(anchor); - } - }else { - AdminUser adminUser = adminUserService.getAdminUserById(adminId); - //TODO 批量保存 - Date date = new Date(); - AnchorWhitelist anchorWhitelist = new AnchorWhitelist(); - anchorWhitelist.setUid(users.getUid()); - anchorWhitelist.setErbanNo(users.getErbanNo()); - anchorWhitelist.setNick(users.getNick()); - anchorWhitelist.setOperateTime(date); - anchorWhitelist.setOperateReason(reason); - anchorWhitelist.setStatus(1); - anchorWhitelist.setAdminId(adminId); - anchorWhitelist.setAdminName(adminUser.getUsername()); - row = anchorWhitelistMapper.insertSelective(anchorWhitelist); - } - if(row > 0){ - jedisService.hset(RedisKey.anchor_white_list.getKey(),users.getUid().toString(),"ok"); - } - } - } - - return 1; - } - - /** - * 设置主播白名单状态 1 正式 2 非白名单 - * @param erbanNo - * @return - */ - public int updateAnchor(int adminId, Long erbanNo, String reason, int status){ - logger.info("updateAnchor adminId:{},erbanNo:{},reason:{},status:{}",adminId,erbanNo,reason,status); - //用户信息 - Users users = usersBaseService.getUsersByErBanNo(erbanNo); - if(null == users) { - throw new AdminServiceException("平台号为"+ erbanNo + "的用户不存在!"); - } - AnchorWhitelistExample anchorWhitelistExample = new AnchorWhitelistExample(); - anchorWhitelistExample.createCriteria().andErbanNoEqualTo(erbanNo); - - List anchorWhitelists = anchorWhitelistMapper.selectByExample(anchorWhitelistExample); - if(CollectionUtils.isEmpty(anchorWhitelists)){ - throw new AdminServiceException("平台号为"+ erbanNo + "的主播不存在!"); - } - AdminUser adminUser = adminUserService.getAdminUserById(adminId); - - AnchorWhitelist anchorWhitelist = anchorWhitelists.get(0); - logger.info("updateAnchor before anchorWhitelist:{}",anchorWhitelist); - anchorWhitelist.setOperateReason(reason); - anchorWhitelist.setAdminId(adminId); - anchorWhitelist.setAdminName(adminUser.getUsername()); - anchorWhitelist.setStatus(status); - int row = anchorWhitelistMapper.updateByPrimaryKey(anchorWhitelist); - if(row > 0){ - if(status == 1){//添加白名单 - jedisService.hset(RedisKey.anchor_white_list.getKey(),users.getUid().toString(),"ok"); - }else {//取消 - jedisService.hdel(RedisKey.anchor_white_list.getKey(),users.getUid().toString()); - } - } - return 1; - } - - - -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/anchor/AnchorCheckAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/anchor/AnchorCheckAdminService.java deleted file mode 100644 index f30587fca..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/anchor/AnchorCheckAdminService.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.accompany.admin.service.anchor; - -import com.accompany.admin.model.AdminUser; -import com.accompany.admin.service.base.BaseService; -import com.accompany.admin.service.system.AdminUserService; -import com.accompany.business.model.AnchorBillCheck; -import com.accompany.business.model.AnchorBillCheckExample; -import com.accompany.business.mybatismapper.AnchorBillCheckMapper; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.Date; -import java.util.List; - -/** - * 主播流水附件上传 - */ -@Service -@Slf4j -public class AnchorCheckAdminService extends BaseService { - - @Autowired - private AdminUserService adminUserService; - - @Autowired - private AnchorBillCheckMapper anchorBillCheckMapper; - - /** - * @param pageNumber - * @param pageSize - * @return - */ - public PageInfo queryBillCheckForPages(Integer pageNumber, Integer pageSize) { - PageHelper.startPage(pageNumber, pageSize); - return new PageInfo<>(queryAnchorBillCheckLists()); - } - - public List queryAnchorBillCheckLists() { - - AnchorBillCheckExample anchorBillCheckExample = new AnchorBillCheckExample(); - anchorBillCheckExample.setOrderByClause("update_time desc"); - List anchorBillCheckList = anchorBillCheckMapper.selectByExample(anchorBillCheckExample); - return anchorBillCheckList; - } - - - public int saveBillCheck(int adminId, Date date, String fileName, String filePath,String fileMd5){ - logger.info("saveBillCheck adminId:{},date:{},fileName:{},filePath:{},fileMd5:{}",adminId,date,fileName,filePath,fileMd5); - - AnchorBillCheck anchorBillCheck = new AnchorBillCheck(); - AdminUser admin = adminUserService.getAdminUserById(adminId); - anchorBillCheck.setAdminId(adminId); - anchorBillCheck.setAdminName(admin.getUsername()); - anchorBillCheck.setRealName(fileName); - anchorBillCheck.setFileFullPath(filePath+fileName); - try { - fileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8.toString()); - anchorBillCheck.setFileName(fileName); - } catch (UnsupportedEncodingException e) { - logger.error(e.getMessage()); - } - anchorBillCheck.setFilePath(filePath); - - anchorBillCheck.setFileMd5(fileMd5); - anchorBillCheck.setUploadTime(date); - - int row = anchorBillCheckMapper.insertSelective(anchorBillCheck); - return row; - } - - - public AnchorBillCheck queryById(Long id){ - AnchorBillCheck anchorBillCheck = anchorBillCheckMapper.selectByPrimaryKey(id); - return anchorBillCheck; - } - -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/anchor/AnchorFansPrivilegeAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/anchor/AnchorFansPrivilegeAdminService.java deleted file mode 100644 index d8c817892..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/anchor/AnchorFansPrivilegeAdminService.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.accompany.admin.service.anchor; - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.StrUtil; -import com.accompany.admin.service.base.BaseService; -import com.accompany.business.model.anchor.AnchorFansPrivilegeConfig; -import com.accompany.business.model.anchor.AnchorFansTeam; -import com.accompany.business.model.anchor.AnchorFansTeamMpPic; -import com.accompany.business.mybatismapper.UserBackpackMapper; -import com.accompany.business.service.anchor.AnchorFansPrivilegeConfigService; -import com.accompany.business.service.anchor.AnchorFansTeamMemberService; -import com.accompany.business.service.anchor.AnchorFansTeamMpPicService; -import com.accompany.business.service.anchor.AnchorFansTeamService; -import com.accompany.common.constant.Constant; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.utils.DateTimeUtil; -import com.accompany.core.exception.AdminServiceException; -import com.accompany.core.service.common.JedisService; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.google.gson.Gson; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -/** - * 粉丝团特权配置 - */ -@Service -public class AnchorFansPrivilegeAdminService extends BaseService { - - @Autowired - private AnchorFansTeamService anchorFansTeamService; - @Autowired - private AnchorFansPrivilegeConfigService anchorFansPrivilegeConfigService; - @Autowired - private JedisService jedisService; - - private Gson gson = new Gson(); - - @Autowired - private AnchorFansTeamMpPicService anchorFansTeamMpPicService; - @Autowired - private AnchorFansTeamMemberService anchorFansTeamMemberService; - @Autowired - private UserBackpackMapper userBackpackMapper; - - public static final Logger logger = LoggerFactory.getLogger(AnchorFansPrivilegeAdminService.class); - - public IPage privilegeList(Integer pageNum, Integer pageSize) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().in(AnchorFansPrivilegeConfig::getStatus, Constant.GlobalStatus.valid,Constant.GlobalStatus.in_valid).orderByDesc(AnchorFansPrivilegeConfig::getStatus); - - Page page = new Page<>(pageNum, pageSize); - return anchorFansPrivilegeConfigService.page(page, queryWrapper); - } - - public void savePrivilege(AnchorFansPrivilegeConfig fansPrivilegeConfig) { - AnchorFansPrivilegeConfig preConfig = anchorFansPrivilegeConfigService.getById(fansPrivilegeConfig.getId()); - - - if (fansPrivilegeConfig.getId() == null) { - anchorFansPrivilegeConfigService.save(fansPrivilegeConfig); - } else { - if (fansPrivilegeConfig.getType().equals(Constant.AnchorFansTeamPrivilegeType.nameplate) && Constant.GlobalStatus.in_valid.equals(fansPrivilegeConfig.getStatus())) { - List teams = anchorFansTeamService.getAllAnchorFansTeam(); - for (AnchorFansTeam team : teams) { - // 获取等级为1的铭牌即可 - AnchorFansTeamMpPic mpPic = anchorFansTeamMpPicService.getLevelMpPicsByGuardsTeamIdAndLevelSeq(team.getId(), 1); - if (mpPic != null && fansPrivilegeConfig.getId().equals(mpPic.getPrivilegeId())) { - throw new AdminServiceException("该铭牌有粉丝团队正在使用中,无法设置为无效状态!"); - } - } - } - - // 修改 - anchorFansPrivilegeConfigService.updateById(fansPrivilegeConfig); - - // 铭牌 更新粉丝团铭牌底图 用户底图 用户穿戴的缓存数据 - if (fansPrivilegeConfig.getType().equals(Constant.AnchorFansTeamPrivilegeType.nameplate)) { - try { - if (!fansPrivilegeConfig.getNormalId().equals(preConfig.getNormalId())) { - anchorFansTeamService.generateAllAnchorFansTeamMpPicAndMemberPic(Constant.AnchorFansMemberMpStatus.narmal,fansPrivilegeConfig.getId(),preConfig.getNormalId()); - } - - if (!fansPrivilegeConfig.getNegativeId().equals(preConfig.getNegativeId())) { - anchorFansTeamService.generateAllAnchorFansTeamMpPicAndMemberPic(Constant.AnchorFansMemberMpStatus.negative,fansPrivilegeConfig.getId(),null); - } - - if (!fansPrivilegeConfig.getActiveId().equals(preConfig.getActiveId())) { - anchorFansTeamService.generateAllAnchorFansTeamMpPicAndMemberPic(Constant.AnchorFansMemberMpStatus.active,fansPrivilegeConfig.getId(),null); - } - } catch (Exception e) { - logger.error("更新粉丝团铭牌出现异常: ",e); - } - } - } - - - // 入团礼物 直接更改缓存 - // 保存缓存 - String key = RedisKey.anchor_fans_privilege_config.getKey(); - if (Constant.GlobalStatus.valid.equals(fansPrivilegeConfig.getStatus())) { - jedisService.hset(key,fansPrivilegeConfig.getId().toString(),gson.toJson(fansPrivilegeConfig)); - } else { - jedisService.hdel(key,fansPrivilegeConfig.getId().toString(),gson.toJson(fansPrivilegeConfig)); - } - } - - public void delPrivilege(Integer id) { - - AnchorFansPrivilegeConfig config = anchorFansPrivilegeConfigService.getById(id); - if (config == null) { - throw new AdminServiceException("该特权不存在!"); - } - - if (config.getType().equals(Constant.AnchorFansTeamPrivilegeType.nameplate)) { - List teams = anchorFansTeamService.getAllAnchorFansTeam(); - for (AnchorFansTeam team : teams) { - // 获取等级为1的铭牌即可 - AnchorFansTeamMpPic mpPic = anchorFansTeamMpPicService.getLevelMpPicsByGuardsTeamIdAndLevelSeq(team.getId(), 1); - if (mpPic != null && config.getId().equals(mpPic.getPrivilegeId())) { - throw new AdminServiceException("该铭牌有粉丝团队正在使用中,无法删除!"); - } - } - } - - AnchorFansPrivilegeConfig anchorFansPrivilegeConfig = new AnchorFansPrivilegeConfig(); - anchorFansPrivilegeConfig.setId(id); - anchorFansPrivilegeConfig.setStatus(Constant.GlobalStatus.in_valid); - anchorFansPrivilegeConfigService.updateById(anchorFansPrivilegeConfig); - - // 专属礼物 回收 - if (config.getType().equals(Constant.AnchorFansTeamPrivilegeType.exclusive_gift)) { - String key = RedisKey.anchor_fans_team_daily_sys_send_design_gift.getKey(DateTimeUtil.getTodayStr() + StrUtil.UNDERLINE + config.getNormalId()); - Set smembers = jedisService.smembers(key); - List uids = smembers.stream().map(Long::parseLong).collect(Collectors.toList()); - if (CollectionUtil.isNotEmpty(uids)) { - userBackpackMapper.cleanUsersBackGift(config.getNormalId(),uids); - for (Long uid : uids) { - // 更新用户背包缓存 - this.jedisService.hdel(RedisKey.user_backpacket.getKey(uid.toString()), config.getNormalId().toString()); - } - } - } - // 删除对应缓存 - String key = RedisKey.anchor_fans_privilege_config.getKey(); - jedisService.hdel(key,id.toString()); - } - - public AnchorFansPrivilegeConfig getPrivilegeInfo(Long id) { - return anchorFansPrivilegeConfigService.getById(id); - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/anchor/AnchorFansTeamStatisticAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/anchor/AnchorFansTeamStatisticAdminService.java deleted file mode 100644 index 9b6cb5b3d..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/anchor/AnchorFansTeamStatisticAdminService.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.accompany.admin.service.anchor; - -import com.accompany.business.model.anchor.AnchorFansTeam; -import com.accompany.business.mybatismapper.anchor.AnchorFansTeamMapper; -import com.accompany.business.service.anchor.AnchorFansTeamService; -import com.accompany.business.service.user.UsersService; -import com.accompany.business.vo.anchor.AnchorFansTeamStatsDetailVo; -import com.accompany.business.vo.anchor.AnchorFansTeamStatsVo; -import com.accompany.common.constant.Constant; -import com.accompany.core.exception.AdminServiceException; -import com.accompany.core.model.Users; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.google.common.collect.Maps; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Map; - -@Service -public class AnchorFansTeamStatisticAdminService { - - @Autowired - private UsersService usersService; - @Autowired - private AnchorFansTeamMapper anchorFansTeamMapper; - @Autowired - private AnchorFansTeamService anchorFansTeamService; - - public Map statisticsMap(Integer page, Integer pageSize,Long erbanNo) { - Long uid = null; - if(erbanNo != null){ - Users user = usersService.getUserByErbanNo(erbanNo); - if(user == null){ - throw new AdminServiceException("查询66号不存在"); - } - uid = user.getUid(); - } - - Map statisticsMap = Maps.newHashMap(); - page = page != null ? page : Constant.DEFAULT_PAGE; - pageSize = pageSize != null ? pageSize : Constant.DEFAULT_PAGE_SIZE; - PageHelper.startPage(page, pageSize); - List fansTeamStatsVoList = anchorFansTeamMapper.getAnchorWithFansteam(uid); - PageInfo pageInfo = new PageInfo<>(fansTeamStatsVoList); - statisticsMap.put("rows", pageInfo.getList()); - statisticsMap.put("total", pageInfo.getTotal()); - return statisticsMap; - } - - - public Map fansTeamDetailList(Integer page, Integer pageSize, Long uid) { - Map statisticsMap = Maps.newHashMap(); - if(uid == null) { - throw new AdminServiceException("参数非法!"); - } - AnchorFansTeam team = anchorFansTeamService.getAnchorFansTeamByUid(uid); - if (team == null) { - throw new AdminServiceException("该粉丝团不存在或已删除!"); - } - page = page != null ? page : Constant.DEFAULT_PAGE; - pageSize = pageSize != null ? pageSize : Constant.DEFAULT_PAGE_SIZE; - PageHelper.startPage(page, pageSize); - List list = anchorFansTeamMapper.getAnchorFansTeamDetailList(team.getId()); - PageInfo pageInfo = new PageInfo<>(list); - statisticsMap.put("rows", pageInfo.getList()); - statisticsMap.put("total", pageInfo.getTotal()); - return statisticsMap; - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/anchor/AnchorReleaseAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/anchor/AnchorReleaseAdminService.java deleted file mode 100644 index 4f94e6637..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/anchor/AnchorReleaseAdminService.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.accompany.admin.service.anchor; - -import com.accompany.admin.service.base.BaseService; -import com.accompany.admin.service.system.AdminUserService; -import com.accompany.business.model.AnchorBillRecord; -import com.accompany.business.model.AnchorBillRecordExample; -import com.accompany.business.mybatismapper.AnchorBillRecordMapper; -import com.accompany.business.service.user.UsersService; -import com.accompany.core.service.common.JedisService; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 主播白名单service - */ -@Service -public class AnchorReleaseAdminService extends BaseService { - - - - @Autowired - private UsersService usersService; - - @Autowired - private AdminUserService adminUserService; - - @Autowired - private JedisService jedisService; - - @Autowired - private AnchorBillRecordMapper anchorBillRecordMapper; - - - - /** - * 查询主播导入明细 - * @param erbanNo - * @param pageNumber - * @param pageSize - * @return - */ - public PageInfo queryUsersForPages(Long erbanNo, String remark, Integer pageNumber, Integer pageSize) { - PageHelper.startPage(pageNumber, pageSize); - return new PageInfo<>(queryAnchorBillLists(erbanNo, remark)); - } - - public List queryAnchorBillLists(Long erbanNo,String remark) { - - AnchorBillRecordExample anchorBillRecordExample = new AnchorBillRecordExample(); - anchorBillRecordExample.setOrderByClause("create_time desc"); - AnchorBillRecordExample.Criteria criteria = anchorBillRecordExample.createCriteria(); - if(null != erbanNo) { - criteria.andQingxunNoEqualTo(erbanNo); - } - if(StringUtils.isNotBlank(remark)) { - criteria.andRemarkLike("%"+remark+"%"); - } - - List anchorBillRecordList = anchorBillRecordMapper.selectByExample(anchorBillRecordExample); - return anchorBillRecordList; - } - - - - - -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/audiocard/AudioCardAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/audiocard/AudioCardAdminService.java deleted file mode 100644 index 465f54d27..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/audiocard/AudioCardAdminService.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.accompany.admin.service.audiocard; - -import com.accompany.admin.vo.audiocard.UserAudioCardAdminVo; -import com.accompany.business.model.audiocard.UserAudioCard; -import com.accompany.business.mybatismapper.audiocard.AudioCardMapper; -import com.accompany.business.param.neteasepush.NeteaseSendMsgParam; -import com.accompany.business.service.SendSysMsgService; -import com.accompany.business.service.user.UsersService; -import com.accompany.common.config.SystemConfig; -import com.accompany.common.constant.Constant; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.status.BusiStatus; -import com.accompany.core.exception.AdminServiceException; -import com.accompany.core.model.Users; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.redisson.api.RedissonClient; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; -import org.springframework.util.StringUtils; - -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -@Service -public class AudioCardAdminService extends ServiceImpl { - - @Autowired - private RedissonClient redissonClient; - @Autowired - private UsersService usersService; - @Autowired - private SendSysMsgService sendSysMsgService; - - public void page(Page page, Long erbanNo, String startTime, String endTime, Byte status) { - Page pageInfo = new Page<>(page.getCurrent(), page.getSize()); - Long uid = null; - if (null != erbanNo){ - Users u = usersService.getUserByErbanNo(erbanNo); - if (null != u){ - uid = u.getUid(); - } - } - lambdaQuery() - .ge(StringUtils.hasText(startTime), UserAudioCard::getCreateTime, startTime) - .le(StringUtils.hasText(endTime), UserAudioCard::getCreateTime, endTime) - .eq(null != uid, UserAudioCard::getUid, uid) - .eq(null != status, UserAudioCard::getStatus, status) - .orderByDesc(UserAudioCard::getCreateTime).page(pageInfo); - if (!CollectionUtils.isEmpty(pageInfo.getRecords())){ - List records = pageInfo.getRecords(); - List uids = records.stream().map(UserAudioCard::getUid).distinct().collect(Collectors.toList()); - Map userMap = usersService.getUsersListByUids(uids).stream().collect(Collectors.toMap(Users::getUid, user->user)); - List voList = records.stream().map(r->{ - UserAudioCardAdminVo vo = new UserAudioCardAdminVo(); - Users user = userMap.get(r.getUid()); - if (null != user){ - vo.setErbanNo(user.getErbanNo()); - vo.setNick(user.getNick()); - } - BeanUtils.copyProperties(r,vo); - return vo; - }).collect(Collectors.toList()); - - page.setCurrent(pageInfo.getCurrent()); - page.setSize(pageInfo.getSize()); - page.setTotal(pageInfo.getTotal()); - page.setRecords(voList); - } - } - - public void operate(Long id, Byte status, String adminName) { - UserAudioCard db = getById(id); - if (null == db || Constant.UserAudioCard.no_pass.equals(db.getStatus()) - || Constant.UserAudioCard.down.equals(db.getStatus())){ - throw new AdminServiceException(BusiStatus.USER_AUDIO_CARD_STATUS); - } - - Date now = new Date(); - UserAudioCard entry = new UserAudioCard(); - entry.setStatus(status); - entry.setAuditor(adminName); - entry.setAuditTime(now); - entry.setUpdateTime(now); - boolean result = lambdaUpdate().eq(UserAudioCard::getId, db.getId()) - .eq(UserAudioCard::getStatus, db.getStatus()) - .update(entry); - if (!result){ - throw new AdminServiceException(BusiStatus.USER_AUDIO_CARD_CONCURRENT); - } - - Long uid = db.getUid(); - redissonClient.getMap(RedisKey.user_audio_card.getKey()).fastRemove(uid); - - if (Constant.UserAudioCard.pass.equals(status)){ - sendSysTextMessage(uid, "聲音簽名審核通過,快叫小夥伴來聽聽吧~"); - } else if (Constant.UserAudioCard.no_pass.equals(status)) { - sendSysTextMessage(uid, - "很抱歉,你錄製的聲音簽名暫時未能通過審核,可能是由於存在敏感詞彙而導致哦,請再次錄製吧,我們期待聽到你的聲音~"); - } else if (Constant.UserAudioCard.down.equals(status)) { - sendSysTextMessage(uid, - "很抱歉,你錄製的聲音簽名已被刪除,可能是由於存在敏感詞彙等方面,具體請諮詢客服或重新錄製,我們期待再次聽到你的聲音~"); - } - } - - private void sendSysTextMessage(Long uid, String message) { - NeteaseSendMsgParam neteaseSendMsgParam = new NeteaseSendMsgParam(); - neteaseSendMsgParam.setType(0); - neteaseSendMsgParam.setFrom(SystemConfig.secretaryUid); - neteaseSendMsgParam.setOpe(0); - neteaseSendMsgParam.setTo(uid.toString()); - neteaseSendMsgParam.setBody(message); - sendSysMsgService.sendMsg(neteaseSendMsgParam); - } - -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/charge/RedeemCodeService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/charge/RedeemCodeService.java deleted file mode 100644 index eeca6e643..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/charge/RedeemCodeService.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.accompany.admin.service.charge; - -import com.accompany.admin.service.base.BaseService; -import com.accompany.business.model.RedeemCode; -import com.accompany.business.model.RedeemCodeExample; -import com.accompany.business.mybatismapper.RedeemCodeMapper; -import com.accompany.common.utils.BlankUtil; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Random; - -@Service("redeemCodeService2") -public class RedeemCodeService extends BaseService { - - @Autowired - private RedeemCodeMapper redeemCodeMapper; - - /** - * 查询兑换码,分页返回 - * - * @param code - * @param uid - * @param status - * @return - */ - public PageInfo getRedeemCodeList(String code, Long uid, Integer status, Integer pageNum, Integer pageSize) { - RedeemCodeExample example = new RedeemCodeExample(); - example.setOrderByClause("create_time desc"); - RedeemCodeExample.Criteria criteria = example.createCriteria(); - if (!BlankUtil.isBlank(code)) { - criteria.andCodeEqualTo(code); - } - if (uid != null) { - criteria.andUseUidEqualTo(uid); - } - if (status != null) { - criteria.andUseStatusEqualTo(status); - } - PageHelper.startPage(pageNum, pageSize); - List list = redeemCodeMapper.selectByExample(example); - return new PageInfo<>(list); - } - - public int insertRedeemCode(RedeemCode redeemCode) { - return redeemCodeMapper.insertSelective(redeemCode); - } - - // 数字字符加多一倍,平衡数字跟字母出现的概率 - private static final String[] CODE_STR = {"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J" - ,"K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9"}; - - /** - * 构建随机生成的字符串 - * - * @param len 指定生成的字符串长度 - * @return - */ - public static String buildRandomCode(int len) { - StringBuilder builder = new StringBuilder(); - Random random = new Random(); - for (int i = 0; i < len; i++) { - builder.append(CODE_STR[random.nextInt(CODE_STR.length)]); - } - return builder.toString(); - } - - public static void main(String[] args) { - for (int i = 0; i < 10; i++) { - System.out.println(buildRandomCode(16)); - } - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/charge/TarotChargeAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/charge/TarotChargeAdminService.java deleted file mode 100644 index 6bafcdbf1..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/charge/TarotChargeAdminService.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.accompany.admin.service.charge; - -import com.accompany.admin.dto.TarotChargeRecordDTO; -import com.accompany.admin.service.base.BaseService; -import com.accompany.common.constant.Constant; -import com.accompany.common.utils.DateTimeUtil; -import com.accompany.common.utils.StringUtils; -import com.accompany.payment.mapper.LuckyTarotRecordMapperExpand; -import com.accompany.payment.vo.LuckyTarotRecordVo; -import com.accompany.payment.vo.TarotRecordStatisVo; -import com.accompany.payment.vo.TarotRecordTotalVo; -import com.github.pagehelper.PageInfo; -import com.google.common.collect.Maps; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.math.BigDecimal; -import java.text.DecimalFormat; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * @Author: yangming - * @Date: 2019/11/12 11:43 - * @Description: 塔罗充值管理业务处理 - **/ -@Service -public class TarotChargeAdminService extends BaseService { - - @Autowired - private LuckyTarotRecordMapperExpand luckyTarotRecordMapperExpand; - - public PageInfo getRecordList(String erbanNo, String beginDate, String endDate, Integer pageNum, - Integer pageSize){ - pageNum = pageNum != null ? pageNum : Constant.DEFAULT_PAGE; - pageSize = pageSize != null ? pageSize : Constant.DEFAULT_PAGE_SIZE; - Integer start = (pageNum - 1) * pageSize; - Map record = Maps.newHashMap(); - if (StringUtils.isNotEmpty(erbanNo)) { - record.put("erbanNo", erbanNo); - } - if (StringUtils.isNotBlank(beginDate)) { - record.put("beginDate", beginDate); - } else { - record.put("beginDate", DateTimeUtil.getTodayStr()); - } - if (StringUtils.isNotBlank(endDate)) { - record.put("endDate", endDate); - }else { - record.put("endDate", DateTimeUtil.getCurrentTime(DateTimeUtil.DEFAULT_DATETIME_PATTERN)); - } - List recordVos = luckyTarotRecordMapperExpand.getRecordListByPage(record,start,pageSize); - Integer count = luckyTarotRecordMapperExpand.getRecordCount(record); - PageInfo pageInfo = new PageInfo<>(recordVos); - pageInfo.setTotal(count); - return pageInfo; - } - - public PageInfo getRecordStatis(String erbanNo, String beginDate, String endDate, - Integer pageNum, Integer pageSize){ - pageNum = pageNum != null ? pageNum : Constant.DEFAULT_PAGE; - pageSize = pageSize != null ? pageSize : Constant.DEFAULT_PAGE_SIZE; - Integer start = (pageNum - 1) * pageSize; - Map record = Maps.newHashMap(); - if (StringUtils.isNotEmpty(erbanNo)) { - record.put("erbanNo", erbanNo); - } - if (StringUtils.isNotBlank(beginDate)) { - record.put("beginDate", beginDate); - } else { - record.put("beginDate", DateTimeUtil.getTodayStr()); - } - if (StringUtils.isNotBlank(endDate)) { - record.put("endDate", endDate); - }else { - record.put("endDate", DateTimeUtil.getCurrentTime(DateTimeUtil.DEFAULT_DATETIME_PATTERN)); - } - List recordVos = luckyTarotRecordMapperExpand.getRecordStatisByPage(record,start,pageSize); - recordVos = recordVos.stream().map(x -> { - TarotRecordStatisVo statisVo = new TarotRecordStatisVo(); - BeanUtils.copyProperties(x, statisVo); - statisVo.setDeviateGold(x.getDrawMoney()*10 - x.getWinGold()); - double avgWinSelectNo = x.getWinCount() == 0 ? 0.00 : - new BigDecimal(x.getWinSelectNum() / x.getWinCount()). - setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue(); - statisVo.setAvgWinSelectNo(avgWinSelectNo); - return statisVo; - }).collect(Collectors.toList()); - Integer count = luckyTarotRecordMapperExpand.getStatisCount(record); - PageInfo pageInfo = new PageInfo<>(recordVos); - pageInfo.setTotal(count); - return pageInfo; - } - - public TarotChargeRecordDTO getRecordTotal(String beginDate, String endDate, - Integer pageNum, Integer pageSize){ - pageNum = pageNum != null ? pageNum : Constant.DEFAULT_PAGE; - pageSize = pageSize != null ? pageSize : Constant.DEFAULT_PAGE_SIZE; - Integer start = (pageNum - 1) * pageSize; - Map record = Maps.newHashMap(); - if (StringUtils.isNotBlank(beginDate)) { - record.put("beginDate", beginDate); - } else { - record.put("beginDate", DateTimeUtil.getTodayStr()); - } - if (StringUtils.isNotBlank(endDate)) { - record.put("endDate", endDate); - }else { - record.put("endDate", DateTimeUtil.getCurrentTime(DateTimeUtil.DEFAULT_DATETIME_PATTERN)); - } - List recordVos = luckyTarotRecordMapperExpand.getRecordTotalByPage(record,start,pageSize); - recordVos = recordVos.stream().map(x-> { - TarotRecordTotalVo totalVo = new TarotRecordTotalVo(); - BeanUtils.copyProperties(x,totalVo); - totalVo.setProfitRation(new DecimalFormat("#.00").format( - (x.getDrawMoney() * 10.0 / x.getWinGold()) * 100) + "%"); - double avgWinSelectNo = x.getWinNum() == 0 ? 0.00 : - new BigDecimal(x.getWinSelectNum() / x.getWinNum()). - setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue(); - totalVo.setAvgWinSelectNo(avgWinSelectNo); - return totalVo; - }).collect(Collectors.toList()); - Integer count = luckyTarotRecordMapperExpand.getTotalCount(record); - PageInfo pageInfo = new PageInfo<>(recordVos); - pageInfo.setTotal(count); - TarotRecordTotalVo totalVo = luckyTarotRecordMapperExpand.getRecordTotal(record); - totalVo.setProfitRation(new DecimalFormat("#.00").format( - (totalVo.getDrawMoney() * 10.0 / totalVo.getWinGold()) * 100) + "%"); - double avgWinSelectNo = totalVo.getWinNum() == 0 ? 0.00 : - new BigDecimal(totalVo.getWinSelectNum() / totalVo.getWinNum()). - setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue(); - totalVo.setAvgWinSelectNo(avgWinSelectNo); - TarotChargeRecordDTO recordDTO = new TarotChargeRecordDTO(); - recordDTO.setPageInfo(pageInfo); - recordDTO.setTarotRecordTotalVo(totalVo); - return recordDTO; - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/chat/PublicChatTopRecordAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/chat/PublicChatTopRecordAdminService.java deleted file mode 100644 index 6cd137395..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/chat/PublicChatTopRecordAdminService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.accompany.admin.service.chat; - -import com.accompany.admin.vo.chat.PublicChatTopRecordAdminVo; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; - -/** - * @author: liaozetao - * @date: 2024/5/8 10:43 - * @description: - */ -public interface PublicChatTopRecordAdminService { - - /** - * 分页 - * @param erbanNo - * @param startTime - * @param endTime - * @param partitionId - * @param pageNum - * @param pageSize - * @return - */ - Page page(Long erbanNo, String startTime, String endTime, Integer partitionId, Integer pageNum, Integer pageSize); -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/chat/impl/PublicChatTopRecordAdminServiceImpl.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/chat/impl/PublicChatTopRecordAdminServiceImpl.java deleted file mode 100644 index 7589cc85c..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/chat/impl/PublicChatTopRecordAdminServiceImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.accompany.admin.service.chat.impl; - -import com.accompany.admin.mapper.chat.PublicChatTopRecordAdminMapper; -import com.accompany.admin.service.chat.PublicChatTopRecordAdminService; -import com.accompany.admin.vo.chat.PublicChatTopRecordAdminVo; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * @author: liaozetao - * @date: 2024/5/8 10:43 - * @description: - */ -@Slf4j -@Service -public class PublicChatTopRecordAdminServiceImpl implements PublicChatTopRecordAdminService { - - @Autowired - private PublicChatTopRecordAdminMapper publicChatTopRecordAdminMapper; - - @Override - public Page page(Long erbanNo, String startTime, String endTime, Integer partitionId, Integer pageNum, Integer pageSize) { - return publicChatTopRecordAdminMapper.selectPage(new Page<>(pageNum, pageSize), erbanNo, startTime, endTime, partitionId); - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/cleanup/CleanUpAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/cleanup/CleanUpAdminService.java deleted file mode 100644 index ea5016175..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/cleanup/CleanUpAdminService.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.accompany.admin.service.cleanup; - -import com.accompany.admin.service.base.BaseService; -import com.accompany.business.mybatismapper.DrawLotteryRecordMapperWebExpand; -import com.accompany.business.mybatismapper.UserPrizeKeyExpand; -import com.accompany.common.utils.DateTimeUtil; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.Date; - -@Service -public class CleanUpAdminService extends BaseService { - - @Autowired - private UserPrizeKeyExpand userPrizeKeyExpand; - - @Autowired - private DrawLotteryRecordMapperWebExpand drawLotteryRecordMapperWebExpand; - - @Transactional(rollbackFor = Exception.class) - public void cleanUserPrizeKey() { - String cycleDateSecond = DateTimeUtil.convertDate(new Date(), DateTimeUtil.DEFAULT_DATE_PATTERN__); - - backUpAndCleanUserPrizeKey(cycleDateSecond); - backUpAndCleanDrawLotteryRecord(cycleDateSecond); - } - - private void backUpAndCleanDrawLotteryRecord(String cycleDate) { - logger.info("create new table draw_lottery_record."); - drawLotteryRecordMapperWebExpand.createTable(cycleDate); - logger.info("backup table draw_lottery_record."); - drawLotteryRecordMapperWebExpand.renameOldTable(cycleDate); - logger.info("clean table draw_lottery_record."); - drawLotteryRecordMapperWebExpand.renameNewTable(cycleDate); - } - - private void backUpAndCleanUserPrizeKey(String cycleDate) { - logger.info("create new table user_prize_key."); - userPrizeKeyExpand.createTable(cycleDate); - logger.info("backup table user_prize_key."); - userPrizeKeyExpand.renameOldTable(cycleDate); - logger.info("clean table user_prize_key."); - userPrizeKeyExpand.renameNewTable(cycleDate); - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/gift/GiftCompoundAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/gift/GiftCompoundAdminService.java deleted file mode 100644 index ba17771ce..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/gift/GiftCompoundAdminService.java +++ /dev/null @@ -1,170 +0,0 @@ -package com.accompany.admin.service.gift; - -import com.accompany.admin.mapper.GiftCompoundAdminMapper; -import com.accompany.admin.vo.GiftCompoundRewardAdminVo; -import com.accompany.admin.vo.gift.GiftCompoundRewordVo; -import com.accompany.business.model.Gift; -import com.accompany.business.model.GiftCompoundReward; -import com.accompany.business.model.GiftCompoundRewardPool; -import com.accompany.business.service.gift.GiftCompoundRewardPoolService; -import com.accompany.business.service.gift.GiftCompoundRewardService; -import com.accompany.business.service.gift.GiftService; -import com.accompany.common.constant.Constant; -import com.accompany.common.status.BusiStatus; -import com.accompany.core.exception.AdminServiceException; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.github.pagehelper.PageHelper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -@Service -public class GiftCompoundAdminService { - @Autowired - private GiftCompoundRewardService giftCompoundRewardService; - - @Autowired - private GiftCompoundRewardPoolService giftcompoundRewardPoolService; - - @Autowired - private GiftCompoundAdminMapper giftCompoundAdminMapper; - - @Autowired - private GiftService giftService; - - public List getList(Integer pageNum, Integer pageSize) { - PageHelper.startPage(pageNum,pageSize); - List giftCompoundList = giftCompoundAdminMapper.getGiftCompoundList(); - return giftCompoundList; - } - - public List limtList(Integer pageNum, Integer pageSize, Integer rewardId) { - PageHelper.startPage(pageNum,pageSize); - List giftCompoundList = giftCompoundAdminMapper.getGiftCompoundLimitList(rewardId); - return giftCompoundList; - } - - public long getCount(Integer giftRewardType) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.lambda().eq(GiftCompoundReward::getRewardType, giftRewardType); - return giftCompoundRewardService.count(); - } - - public GiftCompoundRewardAdminVo getGiftCompoundById(Integer id) { - GiftCompoundRewardAdminVo vo = giftCompoundAdminMapper.getGiftCompoundById(id); - return vo; - } - - public GiftCompoundRewardAdminVo getGiftCompoundLimitById(Integer id) { - GiftCompoundRewardAdminVo vo = giftCompoundAdminMapper.getGiftCompoundLimitById(id); - return vo; - } - - public void saveReward(GiftCompoundRewordVo rewardVo) { - Gift gift = getGift(rewardVo.getGiftId()); - GiftCompoundReward giftCompoundReward = rewardVo.toEntity(); - // 普通礼物直接将礼物价值设定为合成消耗值 - if (Constant.GiftCompound.GiftRewardType.NORMAL.equals(giftCompoundReward.getRewardType())) { - giftCompoundReward.setExpendValue(gift.getGoldPrice().intValue()); - } - giftCompoundRewardService.saveOrUpdate(giftCompoundReward); - // 新增奖励时,同时新增奖励池配置 - if (rewardVo.getId() == null) { - // 将配置礼物新增至奖池,概率100 - giftcompoundRewardPoolService.save( - new GiftCompoundRewardPool().setRewardId(giftCompoundReward.getId()).setGiftId(giftCompoundReward.getGiftId()) - .setServiceNotice(rewardVo.getServiceNotice()).setRate(100)); - // 限时奖励同时新增空礼物至奖池,概率0 - if (Constant.GiftCompound.GiftRewardType.LIMIT.equals(giftCompoundReward.getRewardType())) { - giftcompoundRewardPoolService.save( - new GiftCompoundRewardPool().setRewardId(giftCompoundReward.getId()).setGiftId(null) - .setServiceNotice(false).setRate(0)); - } - } else { - // 修改奖池信息 - if (Constant.GiftCompound.GiftRewardType.NORMAL.equals(giftCompoundReward.getRewardType())) { - GiftCompoundRewardPool rewardPool = giftcompoundRewardPoolService.getOne(new LambdaQueryWrapper().eq(GiftCompoundRewardPool::getRewardId, giftCompoundReward.getId())); - rewardPool.setGiftId(giftCompoundReward.getGiftId()).setServiceNotice(rewardVo.getServiceNotice()); - giftcompoundRewardPoolService.updateById(rewardPool); - } - } - } - - public void delReward(Integer rewardId) { - giftcompoundRewardPoolService.remove(new LambdaQueryWrapper().eq(GiftCompoundRewardPool::getRewardId, rewardId)); - giftCompoundRewardService.removeById(rewardId); - } - - public void saveRewardPool(GiftCompoundRewardPool giftCompoundRewardPool) { - Gift gift = getGift(giftCompoundRewardPool.getGiftId()); - if(gift.getGiftStatus().equals(Constant.status.invalid)){ - throw new AdminServiceException(BusiStatus.GIFTDOWNORNOTEXISTS,"不可添加无效礼物"); - } - GiftCompoundRewardPool defaultRewardPool = giftcompoundRewardPoolService.getOne( - new LambdaQueryWrapper() - .eq(GiftCompoundRewardPool::getRewardId, giftCompoundRewardPool.getRewardId()) - .isNull(GiftCompoundRewardPool::getGiftId)); - Integer offsetRate; - Integer maxRate; - maxRate = defaultRewardPool.getRate(); - if (giftCompoundRewardPool.getId() != null) { - GiftCompoundRewardPool currentPool = giftcompoundRewardPoolService.getById(giftCompoundRewardPool.getId()); - offsetRate = giftCompoundRewardPool.getRate() - currentPool.getRate(); - maxRate += currentPool.getRate(); - } else { - offsetRate = giftCompoundRewardPool.getRate(); - } - - if (offsetRate > defaultRewardPool.getRate()) { - throw new AdminServiceException(BusiStatus.PARAMETERILLEGAL, "概率超出可设定范围,当前最大可设定为" + maxRate); - } - defaultRewardPool.setRate(defaultRewardPool.getRate() - offsetRate); - giftcompoundRewardPoolService.saveOrUpdate(defaultRewardPool); - giftcompoundRewardPoolService.saveOrUpdate(giftCompoundRewardPool); - } - - public void delRewardPool(Integer rewardPoolId) { - GiftCompoundRewardPool byId = giftcompoundRewardPoolService.getById(rewardPoolId); - if (byId.getGiftId() == null) { - throw new AdminServiceException(BusiStatus.PARAMETERILLEGAL, "默认礼物不可删除"); - } - GiftCompoundReward reward = giftCompoundRewardService.getById(byId.getRewardId()); - if (byId.getGiftId().equals(reward.getGiftId())) { - throw new AdminServiceException(BusiStatus.PARAMETERILLEGAL, "当前礼物不可删除"); - } - GiftCompoundRewardPool defaultRewardPool = getDefaultRewardPool(byId.getRewardId()); - giftcompoundRewardPoolService.removeById(rewardPoolId); - Integer rete = defaultRewardPool.getRate() + byId.getRate(); - defaultRewardPool.setRate(rete); - giftcompoundRewardPoolService.saveOrUpdate(defaultRewardPool); - } - - - public List getPoolItem() { - List poolItem = giftCompoundAdminMapper.getPoolItem(null); - return poolItem; - } - - public GiftCompoundRewardAdminVo getLimitGtifById(Integer id) { - GiftCompoundRewardAdminVo vo = giftCompoundAdminMapper.getPoolItem(id).get(0); - return vo; - } - - private GiftCompoundRewardPool getDefaultRewardPool(Integer rewardId){ - GiftCompoundRewardPool defaultRewardPool = giftcompoundRewardPoolService.getOne( - new LambdaQueryWrapper() - .eq(GiftCompoundRewardPool::getRewardId, rewardId) - .isNull(GiftCompoundRewardPool::getGiftId)); - return defaultRewardPool; - } - - private Gift getGift(Integer giftId){ - Gift gift = giftService.getGiftById(giftId); - if (gift == null) { - throw new AdminServiceException(BusiStatus.GIFT_IS_NOT_EXIST); - } - return gift; - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/home/HomeNewFriendAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/home/HomeNewFriendAdminService.java deleted file mode 100644 index 139ae8788..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/home/HomeNewFriendAdminService.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.accompany.admin.service.home; - -import com.accompany.admin.vo.home.HomeNewFriendAdminVo; -import com.accompany.common.model.PageReq; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; - -/** - * @author: liaozetao - * @date: 2023/9/4 14:16 - * @description: - */ -public interface HomeNewFriendAdminService { - - /** - * 分页 - * - * @param req - * @return - */ - Page page(PageReq req); - - /** - * 保存 - * - * @param erBanNoStr - * @param expireTimeStr - */ - void save(String erBanNoStr, String expireTimeStr); - - /** - * 删除 - * - * @param uid - */ - void del(Long uid); -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/home/impl/HomeNewFriendAdminServiceImpl.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/home/impl/HomeNewFriendAdminServiceImpl.java deleted file mode 100644 index 1fda78b33..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/home/impl/HomeNewFriendAdminServiceImpl.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.accompany.admin.service.home.impl; - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.date.DatePattern; -import cn.hutool.core.util.StrUtil; -import com.accompany.admin.service.home.HomeNewFriendAdminService; -import com.accompany.admin.util.DateTimeUtil; -import com.accompany.admin.vo.home.HomeNewFriendAdminVo; -import com.accompany.common.constant.Constant; -import com.accompany.common.enums.RedisZSetEnum; -import com.accompany.common.model.PageReq; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.status.BusiStatus; -import com.accompany.core.exception.AdminServiceException; -import com.accompany.core.model.Users; -import com.accompany.core.service.common.JedisService; -import com.accompany.core.service.user.UsersBaseService; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.*; - -/** - * @author: liaozetao - * @date: 2023/9/4 14:16 - * @description: - */ -@Slf4j -@Service -public class HomeNewFriendAdminServiceImpl implements HomeNewFriendAdminService { - - @Autowired - private UsersBaseService usersBaseService; - - @Autowired - private JedisService jedisService; - - @Override - public Page page(PageReq req) { - String redisKey = RedisKey.home_new_friend_uid.getKey(); - Set> set = jedisService.zrange(redisKey, req.getStartNum(), req.getEndNum()); - List admins = new ArrayList<>(); - for (Map map : set) { - String uidStr = map.get(RedisZSetEnum.member.name()).toString(); - double score = Double.parseDouble(map.get(RedisZSetEnum.score.name()).toString()); - Users users = usersBaseService.getUsersByUid(Long.valueOf(uidStr)); - if (users == null) { - continue; - } - String expireTimeStr = jedisService.get(RedisKey.home_new_friend_uid.getKey(uidStr)); - HomeNewFriendAdminVo admin = new HomeNewFriendAdminVo(); - BeanUtils.copyProperties(users, admin); - admin.setCreateTime(new Date((long) score)); - if (StrUtil.isNotEmpty(expireTimeStr)) { - admin.setExpireTime(DateTimeUtil.convertStrToDate(expireTimeStr, DatePattern.NORM_DATETIME_PATTERN)); - } - admins.add(admin); - } - Page iPage = new Page<>(req.getPage(), req.getPageSize()); - iPage.setTotal(jedisService.zcard(redisKey)); - iPage.setRecords(admins); - return iPage; - } - - @Override - public void save(String erBanNoStr, String expireTimeStr) { - String[] erBanNoArray = null; - if (StrUtil.isNotEmpty(erBanNoStr)) { - if (erBanNoStr.contains(StrUtil.COMMA)) { - erBanNoArray = erBanNoStr.split(StrUtil.COMMA); - } - if (erBanNoStr.contains("\n")) { - erBanNoArray = erBanNoStr.split("\n"); - } - } - if (erBanNoArray == null) { - erBanNoArray = new String[]{erBanNoStr}; - } - List uidList = usersBaseService.getUidByErbanNo(Arrays.asList(erBanNoArray)); - if (CollectionUtil.isEmpty(uidList)) { - throw new AdminServiceException("用户ID不存在"); - } - Date now = new Date(); - Date expireTime = now; - if (StrUtil.isNotEmpty(expireTimeStr)) { - expireTime = DateTimeUtil.convertStrToDate(expireTimeStr, DatePattern.NORM_DATETIME_PATTERN); - } - assert expireTime != null; - for (String uidStr : uidList) { - Users users = usersBaseService.getUsersByUid(Long.valueOf(uidStr)); - if (users == null) { - continue; - } - Byte gender = users.getGender(); - int expireSeconds = (int) ((expireTime.getTime() - now.getTime()) / 1000); - jedisService.set(RedisKey.home_new_friend_uid.getKey(uidStr), expireTimeStr); - jedisService.expire(RedisKey.home_new_friend_uid.getKey(uidStr), expireSeconds); - jedisService.zadd(RedisKey.home_new_friend_uid.getKey(), (double) now.getTime(), uidStr); - jedisService.sadd(RedisKey.home_new_friend_uid.getKey(gender.toString()), uidStr); - } - } - - @Override - public void del(Long uid) { - if (uid == null) { - throw new AdminServiceException(BusiStatus.PARAMERROR); - } - String uidStr = uid.toString(); - jedisService.del(RedisKey.home_new_friend_uid.getKey(uidStr)); - jedisService.zrem(RedisKey.home_new_friend_uid.getKey(), uidStr); - jedisService.srem(RedisKey.home_new_friend_uid.getKey(Constant.UserGender.MALE.toString()), uidStr); - jedisService.srem(RedisKey.home_new_friend_uid.getKey(Constant.UserGender.FEMALE.toString()), uidStr); - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/linearly/LinearlyPoolDataAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/linearly/LinearlyPoolDataAdminService.java deleted file mode 100644 index 55510988d..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/linearly/LinearlyPoolDataAdminService.java +++ /dev/null @@ -1,256 +0,0 @@ -package com.accompany.admin.service.linearly; - -import cn.hutool.core.collection.CollectionUtil; -import com.accompany.admin.base.Pagination; -import com.accompany.admin.mapper.linearlypool.LinearlyPoolAdminMapper; -import com.accompany.admin.params.linearlypool.PlatformDataReqParams; -import com.accompany.admin.service.base.BaseService; -import com.accompany.admin.vo.linearlypool.LinearlyPoolDrawRecordStatisVo; -import com.accompany.admin.vo.linearlypool.LinearlyPoolDrawRecordVO; -import com.accompany.admin.vo.linearlypool.UserDrawStatisAdminVo; -import com.accompany.business.constant.LinearlyPrizePoolTypeEnum; -import com.accompany.business.model.linearlypool.LinearlyPrizePoolDrawLineItem; -import com.accompany.business.service.linearlypool.LinearlyPrizePoolDrawLineItemService; -import com.accompany.business.service.user.UsersService; -import com.accompany.common.constant.Constant; -import com.accompany.common.utils.BeanUtil; -import com.accompany.common.utils.DateTimeUtil; -import com.accompany.core.model.Users; -import com.accompany.core.service.user.UsersBaseService; -import com.accompany.core.util.StringUtils; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.google.common.collect.Lists; -import org.apache.commons.lang3.time.FastDateFormat; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import javax.validation.constraints.NotNull; -import java.util.*; - -@Service -public class LinearlyPoolDataAdminService extends BaseService { - - @Autowired - private UsersService usersService; - @Autowired - private LinearlyPrizePoolDrawLineItemService drawLineItemService; - @Autowired - private UsersBaseService usersBaseService; - @Autowired - private LinearlyPoolAdminMapper linearlyPoolAdminMapper; - - public PageInfo getRecordList(Long uid, String prizeName, Integer pageNumber, Integer pageSize, Date startDate, Date endDate) { - IPage queryPage = new Page<>(pageNumber, pageSize); - QueryWrapper queryWrapper = genRecordQuery(uid, prizeName, startDate, endDate); - IPage page = drawLineItemService.page(queryPage, queryWrapper); - List recordList = convertToDrawRecordVoList(page.getRecords()); - PageInfo resPage = new PageInfo(recordList); - resPage.setTotal(page.getTotal()); - return resPage; - } - - @NotNull - private QueryWrapper genRecordQuery(Long uid, String prizeName, Date startDate, Date endDate) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().eq(uid != null, LinearlyPrizePoolDrawLineItem::getUid, uid) - .like(StringUtils.isNotBlank(prizeName), LinearlyPrizePoolDrawLineItem::getPrizeName, "%" + prizeName + "%") - .ge(startDate != null, LinearlyPrizePoolDrawLineItem::getDrawTime, startDate) - .le(endDate != null, LinearlyPrizePoolDrawLineItem::getDrawTime, endDate) - .eq(LinearlyPrizePoolDrawLineItem::getDrawStatus, Constant.LinearlyPoolDrawStatus.HAS_DRAW) - .orderByDesc(LinearlyPrizePoolDrawLineItem::getDrawTime); - return queryWrapper; - } - - public PageInfo getUserStatisList(Long uid, Integer minDis, Integer maxDis, Integer pageNumber, - Integer pageSize, Byte source, String startTime, String endTime) { - PageHelper.startPage(pageNumber, pageSize); - List list; - if(Constant.Source.msNo.equals(source)){ - list = this.getHistoryList(uid,null, null, startTime, endTime); - }else{ - list = this.getHistoryList(uid,minDis, maxDis, startTime, endTime); - } - if (CollectionUtils.isEmpty(list)) { - return new PageInfo<>(Collections.EMPTY_LIST); - } - list = convertToVo(list); - return new PageInfo(list); - } - - /** - * 获取用户抽奖历史总额信息与白名单信息 - * @param uid - * @param minDis - * @param maxDis - * @return - */ - private List getHistoryList(Long uid, Integer minDis, Integer maxDis, - String startTime, String endTime){ - List drawBoxHistoryMsgByTimeRange = - linearlyPoolAdminMapper.getUserStatisList(uid, minDis, maxDis, startTime, endTime); - return drawBoxHistoryMsgByTimeRange; - } - - private List convertToVo(List list){ - if(CollectionUtils.isEmpty(list)){ - return Lists.newArrayList(); - } - List uids = Lists.newArrayList(); - for(UserDrawStatisAdminVo userBoxPrizeRecordAdminVo:list){ - String uidStr = userBoxPrizeRecordAdminVo.getUid().toString(); - uids.add(uidStr); - } - String[] uidArray = new String[uids.size()]; - uids.toArray(uidArray); - - Map map = this.usersService.getUsersMapBatch(uidArray); - for(UserDrawStatisAdminVo userBoxPrizeRecordAdminVo:list){ - Long uid = userBoxPrizeRecordAdminVo.getUid(); - Users users = map.get(uid); - if(users != null){ - userBoxPrizeRecordAdminVo.setErbanNo(users.getErbanNo()); - userBoxPrizeRecordAdminVo.setNick(users.getNick()); - } - } - return list; - } - - public List convertToDrawRecordVoList(List list){ - if (CollectionUtil.isEmpty(list)) { - return Collections.EMPTY_LIST; - } - List voList = Lists.newArrayList(); - Map userMap = new HashMap<>(); - for(LinearlyPrizePoolDrawLineItem drawLotteryRecord:list){ - LinearlyPoolDrawRecordVO vo = BeanUtil.map(drawLotteryRecord, LinearlyPoolDrawRecordVO.class); - Users users = userMap.get(drawLotteryRecord.getUid()); - if (users == null) { - users = usersService.getUsersByUid(drawLotteryRecord.getUid()); - if (users != null) { - userMap.put(users.getUid(), users); - } - } - if(users != null){ - vo.setErbanNo(users.getErbanNo()); - vo.setNick(users.getNick()); - } - voList.add(vo); - } - return voList; - } - - /** - * 根据礼物记录构建excel数据 - * @param records - * @return - */ - public List buildExcelData(List records) { - FastDateFormat format = FastDateFormat.getInstance("yyyy-MM-dd HH:mm:ss"); - List excelRows = new ArrayList(records.size()); - records.forEach((record) -> { - List excelData = new ArrayList<>(); - excelData.add(record.getLineId()); - excelData.add(record.getUid()); - excelData.add(record.getErbanNo()); - excelData.add(record.getNick()); - excelData.add(record.getPrizeName()); - excelData.add(format.format(record.getDrawTime())); - excelData.add(record.getPlatformValue()); - excelData.add(getPoolNameForType(record.getPrizePoolType())); - excelRows.add(excelData); - }); - return excelRows; - } - - /** - * 根据奖池类型获取奖池名称 - * @param poolType - * @return - */ - private String getPoolNameForType(Byte poolType) { - return LinearlyPrizePoolTypeEnum.from(poolType).getPoolName(); - } - - public Pagination queryPlatformData(PlatformDataReqParams params, boolean oldQuery) { - Date startDate = params.getStartDate(); - Date endDate = params.getEndDate(); - if (null == startDate || null == endDate) { - Pagination res = new Pagination(new PageInfo()); - return res; - } - - List list = Lists.newArrayList(); - List dateList = DateTimeUtil.getBetweenDates(startDate,endDate,false); - // 通过截取的日期区间进行分页功能 - int startIndex = (params.getPageNum() - 1) * params.getPageSize(); - int endIndex = (startIndex + params.getPageSize() > dateList.size())? (dateList.size()):(startIndex + params.getPageSize()); - for(int i = startIndex; i < endIndex;i++){ - Date date = dateList.get(i); - Date startTime = DateTimeUtil.getBeginTimeOfDay(date); - Date endTime = DateTimeUtil.getEndTimeOfDay(date); - params.setStartDate(startTime); - params.setEndDate(endTime); - LinearlyPoolDrawRecordStatisVo drawLotteryRecordStatisVo = this.querySingleDrawLotteryRecordStatisVo(params, oldQuery); - list.add(drawLotteryRecordStatisVo); - } - - return new Pagination(dateList.size(), list); - } - - public LinearlyPoolDrawRecordStatisVo querySingleDrawLotteryRecordStatisVo(PlatformDataReqParams params, Boolean oldQuery){ - - // 根据用户靓号获取uid - Users user = usersBaseService.getUsersByErBanNo(params.getErbanNo()); - Long uid = user != null ? user.getUid() : null; - - LinearlyPoolDrawRecordStatisVo drawLotteryRecordStatisVo = new LinearlyPoolDrawRecordStatisVo(); - if (params.getStartDate() != null && params.getEndDate() != null) { - drawLotteryRecordStatisVo = linearlyPoolAdminMapper - .getDrawStaticList(params.getStartDate(), params.getEndDate(), uid, oldQuery ? "normal" : "days"); - } - return initialDrawLotteryRecordVo(drawLotteryRecordStatisVo,params.getStartDate()); - } - - private LinearlyPoolDrawRecordStatisVo initialDrawLotteryRecordVo(LinearlyPoolDrawRecordStatisVo drawLotteryRecordStatisVo,Date date){ - if (null == drawLotteryRecordStatisVo) { - drawLotteryRecordStatisVo = new LinearlyPoolDrawRecordStatisVo(); - } - if(drawLotteryRecordStatisVo.getCountNum() == null){ - drawLotteryRecordStatisVo.setCountNum(0); - } - if(drawLotteryRecordStatisVo.getCreateTime() == null){ - drawLotteryRecordStatisVo.setCreateTime(date); - } - if(drawLotteryRecordStatisVo.getTotalActualValue() == null){ - drawLotteryRecordStatisVo.setTotalActualValue(0L); - } - if(drawLotteryRecordStatisVo.getTotalGiftActualValue() == null){ - drawLotteryRecordStatisVo.setTotalGiftActualValue(0L); - } - if(drawLotteryRecordStatisVo.getTotalNotGiftActualValue() == null){ - drawLotteryRecordStatisVo.setTotalNotGiftActualValue(0L); - } - if(drawLotteryRecordStatisVo.getTotalRealGiftActualValue() == null){ - drawLotteryRecordStatisVo.setTotalRealGiftActualValue(0L); - } - if(drawLotteryRecordStatisVo.getTotalPlatformValue() == null){ - drawLotteryRecordStatisVo.setTotalPlatformValue(0L); - } - if(drawLotteryRecordStatisVo.getUserTotalPay() == null){ - drawLotteryRecordStatisVo.setUserTotalPay(0L); - } - return drawLotteryRecordStatisVo; - } - - public List listExportRecordRows(Long uid, String prizeName, Date startDate, Date endDate) { - QueryWrapper queryWrapper = genRecordQuery(uid, prizeName, startDate, endDate); - List resultList = drawLineItemService.list(queryWrapper); - List recordList = convertToDrawRecordVoList(resultList); - return buildExcelData(recordList); - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/linearly/LinearlyPoolItemAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/linearly/LinearlyPoolItemAdminService.java deleted file mode 100644 index 186235ba6..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/linearly/LinearlyPoolItemAdminService.java +++ /dev/null @@ -1,278 +0,0 @@ -package com.accompany.admin.service.linearly; - -import cn.hutool.core.collection.CollectionUtil; -import com.accompany.admin.params.linearlypool.PoolItemDraftSaveReqParams; -import com.accompany.admin.params.linearlypool.PoolItemShowRatioReqParams; -import com.accompany.admin.vo.linearlypool.LinearlyPoolDeployResultVO; -import com.accompany.admin.vo.linearlypool.LinearlyPoolItemAdminPageVO; -import com.accompany.admin.vo.linearlypool.PrizeGroupVO; -import com.accompany.admin.vo.linearlypool.PrizeItemVO; -import com.accompany.business.constant.LinearlyPrizePoolTypeEnum; -import com.accompany.business.model.Prize; -import com.accompany.business.model.PrizeExample; -import com.accompany.business.model.linearlypool.LinearlyPrizePoolItem; -import com.accompany.business.model.linearlypool.LinearlyPrizePoolItemDraft; -import com.accompany.business.mybatismapper.PrizeMapper; -import com.accompany.business.service.linearlypool.LinearlyPrizePoolItemDraftService; -import com.accompany.business.service.linearlypool.LinearlyPrizePoolItemService; -import com.accompany.business.service.linearlypool.LinearlyPrizePoolService; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.BeanUtil; -import com.accompany.common.utils.StringUtils; -import com.accompany.core.exception.AdminServiceException; -import com.accompany.core.service.common.JedisService; -import com.alibaba.fastjson.JSONObject; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.validation.constraints.NotNull; -import java.util.*; -import java.util.stream.Collectors; - -@Service -@Slf4j -public class LinearlyPoolItemAdminService { - - @Autowired - private LinearlyPrizePoolItemService linearlyPrizePoolItemService; - @Autowired - private LinearlyPrizePoolItemDraftService linearlyPrizePoolItemDraftService; - @Autowired - private PrizeMapper prizeMapper; - @Autowired - private LinearlyPrizePoolService linearlyPrizePoolService; - @Autowired - private JedisService jedisService; - - public LinearlyPoolItemAdminPageVO getPrizeGroupsInfo() { - PrizeGroupVO normalPrizeGroup = getPrizeGroupVO(LinearlyPrizePoolTypeEnum.normal_prize_pool); - - PrizeGroupVO seniorPrizeGroup = getPrizeGroupVO(LinearlyPrizePoolTypeEnum.senior_prize_pool); - - List deployedNormalPrizes = getDeployedPrizes(LinearlyPrizePoolTypeEnum.normal_prize_pool); - List deployedSeniorPrizes = getDeployedPrizes(LinearlyPrizePoolTypeEnum.senior_prize_pool); - - LinearlyPoolItemAdminPageVO result = new LinearlyPoolItemAdminPageVO(); - result.setNormalPrizeGroup(normalPrizeGroup); - result.setSeniorPrizeGroup(seniorPrizeGroup); - result.setDeployedNormalPrizes(deployedNormalPrizes); - result.setDeployedSeniorPrizes(deployedSeniorPrizes); - result.setCurrentPoolLineId(Optional.ofNullable(linearlyPrizePoolService.getCurrentLineId()).orElse(0L)); - result.setMaxLineId(Optional.ofNullable(linearlyPrizePoolService.getMaxLineId()).orElse(0L)); - - return result; - } - - private List getDeployedPrizes(LinearlyPrizePoolTypeEnum poolType) { - List poolItems = linearlyPrizePoolItemService.listByPoolType(poolType.getValue()); - return convertToPrizeItemVOList(poolItems); - } - - @NotNull - private PrizeGroupVO getPrizeGroupVO(LinearlyPrizePoolTypeEnum poolType) { - boolean isUndeploy = false; - // 先查询未发布的 - - List poolItems = Collections.emptyList(); - List draftItems = linearlyPrizePoolItemDraftService.listByPoolType(poolType.getValue()); - if (CollectionUtil.isEmpty(draftItems)) { - // 没有未发布的,就查询已发布的 - poolItems = linearlyPrizePoolItemService.listByPoolType(poolType.getValue()); - } else { - poolItems = draftItems.stream().map(item -> BeanUtil.map(item, LinearlyPrizePoolItem.class)).collect(Collectors.toList()); - isUndeploy = true; - } - PrizeGroupVO normalPrizeGroup = new PrizeGroupVO(); - normalPrizeGroup.setPrizeItems(convertToPrizeItemVOList(poolItems)); - normalPrizeGroup.setIsUndeploy(isUndeploy); - return normalPrizeGroup; - } - - private List convertToPrizeItemVOList(List poolItems) { - if (CollectionUtil.isEmpty(poolItems)) { - return Collections.emptyList(); - } - - List prizeIds = poolItems.stream().map(LinearlyPrizePoolItem::getPrizeId).collect(Collectors.toList()); - PrizeExample prizeExample = new PrizeExample(); - prizeExample.createCriteria().andIdIn(prizeIds); - List prizes = prizeMapper.selectByExample(prizeExample); - Map prizeMap = prizes.stream().collect(Collectors.toMap(Prize::getId, it -> it, (k1, k2) -> k1)); - - return poolItems.stream().map(item -> { - PrizeItemVO prizeItem = BeanUtil.map(item, PrizeItemVO.class); - Prize prize = prizeMap.get(prizeItem.getPrizeId()); - if (prize != null) { - prizeItem.setPrizeType(prize.getPrizeType()); - prizeItem.setPlatformValue(prize.getPlatformValue()); - prizeItem.setPrizeName(prize.getPrizeName()); - } - - return prizeItem; - }) - // 按平台价值排序 - .sorted((i1, i2) -> { - if (i1.getPlatformValue() == null) { - return 1; - } else if (i2.getPlatformValue() == null) { - return -1; - } - return i1.getPlatformValue().compareTo(i2.getPlatformValue()); - }).collect(Collectors.toList()); - } - - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - public void saveDraft(PoolItemDraftSaveReqParams params, String creator) { - List oldItems = linearlyPrizePoolItemDraftService.listByPoolType(params.getPrizePoolType()); - List oldIds; - if (CollectionUtil.isNotEmpty(oldItems)) { - oldIds = oldItems.stream().map(LinearlyPrizePoolItemDraft::getId).collect(Collectors.toList()); - } else { - oldIds = Collections.emptyList(); - } - List newItems = new ArrayList<>(); - List updateItems = new ArrayList<>(); - params.getPoolItems().forEach(item -> { - if (item.getId() == null || !oldIds.contains(item.getId())) { - item.setPrizePoolType(params.getPrizePoolType()); - item.setCreator(creator); - item.setShowRatio(0); - - newItems.add(item); - } else { - LinearlyPrizePoolItemDraft itemForUpdate = new LinearlyPrizePoolItemDraft(); - itemForUpdate.setId(item.getId()); - // 当前还有数量可以调整 - itemForUpdate.setPrizeNum(item.getPrizeNum()); - - updateItems.add(itemForUpdate); - // 从原id列表中移除 - oldIds.remove(item.getId()); - } - }); - - if (CollectionUtil.isNotEmpty(newItems)) { - log.info("新增奖品列表: {}", JSONObject.toJSONString(newItems)); - linearlyPrizePoolItemDraftService.saveBatch(newItems); - } - if (CollectionUtil.isNotEmpty(updateItems)) { - log.info("更新奖品列表: {}", JSONObject.toJSONString(updateItems)); - linearlyPrizePoolItemDraftService.updateBatchById(updateItems); - } - if (CollectionUtil.isNotEmpty(oldIds)) { - log.info("移除的奖品列表: {}", JSONObject.toJSONString(oldIds)); - linearlyPrizePoolItemDraftService.removeByIds(oldIds); - } - } - - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - public LinearlyPoolDeployResultVO deploy() { - String lockKey = RedisKey.linearly_pool_create_pool_line_lock.getKey(); - String lock = jedisService.lock(lockKey, 3000, 60); - if (StringUtils.isBlank(lock)) { - log.error("[linearly deploy]获取锁超时"); - throw new AdminServiceException(BusiStatus.SERVERBUSY, "系统正在生成奖池线,请稍后再试"); - } - try { - return doDeploy(); - } catch (Exception e) { - log.error("[linearly deploy]发布奖池组出错",e); - throw e; - } finally { - jedisService.unlock(lockKey, lock); - } - } - - private LinearlyPoolDeployResultVO doDeploy() { - long draftItemCount = linearlyPrizePoolItemDraftService.count(); - if (draftItemCount <= 0L) { - throw new AdminServiceException(BusiStatus.BUSIERROR, "奖池里面没有奖品,发布失败"); - } - - deployPrizeGroup(LinearlyPrizePoolTypeEnum.normal_prize_pool); - deployPrizeGroup(LinearlyPrizePoolTypeEnum.senior_prize_pool); - - - LinearlyPoolDeployResultVO result = new LinearlyPoolDeployResultVO(); - result.setCurrentPoolLineId(Optional.ofNullable(linearlyPrizePoolService.getCurrentLineId()).orElse(0L)); - result.setWillActiveLineId(Optional.ofNullable(linearlyPrizePoolService.getMaxLineId()).orElse(0L) + 1); - - return result; - } - - private void deployPrizeGroup(LinearlyPrizePoolTypeEnum poolType) { - List draftPoolItems = linearlyPrizePoolItemDraftService.listByPoolType(poolType.getValue()); - if (CollectionUtil.isEmpty(draftPoolItems)) { - return ; - } - List draftIds = draftPoolItems.stream().map(LinearlyPrizePoolItemDraft::getId).collect(Collectors.toList()); - List oldPoolItems = linearlyPrizePoolItemService.listByPoolType(poolType.getValue()); - // 以prizeId作为key的map - Map oldPoolItemMap = oldPoolItems.stream().collect(Collectors.toMap(LinearlyPrizePoolItem::getPrizeId, it -> it, (k1, k2) -> k1)); - - List newItems = new ArrayList<>(); - List updateItems = new ArrayList<>(); - draftPoolItems.forEach(item -> { - if (!oldPoolItemMap.containsKey(item.getPrizeId())) { - // 新增的 - LinearlyPrizePoolItem newItem = BeanUtil.map(item, LinearlyPrizePoolItem.class); - newItem.setId(null); - newItems.add(newItem); - } else { - LinearlyPrizePoolItem itemForUpdate = new LinearlyPrizePoolItem(); - LinearlyPrizePoolItem oldItem = oldPoolItemMap.get(item.getPrizeId()); - itemForUpdate.setId(oldItem.getId()); - itemForUpdate.setPrizeNum(item.getPrizeNum()); -// itemForUpdate.setShowRatio(item.getShowRatio()); - - updateItems.add(itemForUpdate); - // 从原id列表中移除 - oldPoolItemMap.remove(item.getPrizeId()); - } - }); - - List needRemoveIds = oldPoolItemMap.values().stream().map(LinearlyPrizePoolItem::getId).collect(Collectors.toList()); - - if (CollectionUtil.isNotEmpty(newItems)) { - log.info("新增奖品列表: {}", JSONObject.toJSONString(newItems)); - linearlyPrizePoolItemService.saveBatch(newItems); - } - if (CollectionUtil.isNotEmpty(updateItems)) { - log.info("更新奖品列表: {}", JSONObject.toJSONString(updateItems)); - linearlyPrizePoolItemService.updateBatchById(updateItems); - } - if (CollectionUtil.isNotEmpty(needRemoveIds)) { - log.info("移除的奖品列表: {}", JSONObject.toJSONString(needRemoveIds)); - linearlyPrizePoolItemService.removeByIds(needRemoveIds); - } - - // 发布后清理草稿数据 - linearlyPrizePoolItemDraftService.removeByIds(draftIds); - - } - - public List listDeployedPoolItems() { - List list = linearlyPrizePoolItemService.list(); - return convertToPrizeItemVOList(list); - } - - public void updateShowRatio(PoolItemShowRatioReqParams params) { - if (params == null || CollectionUtil.isEmpty(params.getPoolItems())) { - throw new AdminServiceException(BusiStatus.PARAMERROR, "必须传入奖品列表"); - } - - List updateItems = new ArrayList<>(params.getPoolItems().size()); - params.getPoolItems().forEach(item -> { - LinearlyPrizePoolItem updateItem = new LinearlyPrizePoolItem(); - updateItem.setId(item.getId()); - updateItem.setShowRatio(item.getShowRatio()); - - updateItems.add(updateItem); - }); - - linearlyPrizePoolItemService.updateBatchById(updateItems); - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/nameplate/NameplateAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/nameplate/NameplateAdminService.java index 02e2edce3..726d415a2 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/nameplate/NameplateAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/nameplate/NameplateAdminService.java @@ -13,14 +13,11 @@ import com.accompany.business.constant.nameplate.StatusEnum; import com.accompany.business.model.Nameplate; import com.accompany.business.model.NameplateRecord; import com.accompany.business.model.UserNameplate; -import com.accompany.business.model.anchor.AnchorFansPrivilegeConfig; import com.accompany.business.mybatismapper.NameplateMapper; import com.accompany.business.mybatismapper.NameplateRecordMapper; import com.accompany.business.mybatismapper.UserNameplateMapper; import com.accompany.business.param.neteasepush.NeteaseSendMsgParam; import com.accompany.business.service.SendSysMsgService; -import com.accompany.business.service.anchor.AnchorFansPrivilegeConfigService; -import com.accompany.business.service.anchor.AnchorFansTeamService; import com.accompany.business.service.nameplate.UserNameplateService; import com.accompany.business.service.user.UsersService; import com.accompany.common.config.SystemConfig; @@ -101,11 +98,6 @@ public class NameplateAdminService extends BaseService { @Autowired private TencentCosUploadService uploadService; - @Autowired - private AnchorFansPrivilegeConfigService anchorFansPrivilegeConfigService; - - @Autowired - private AnchorFansTeamService anchorFansTeamService; @Autowired private SysConfService sysConfService; @@ -371,25 +363,20 @@ public class NameplateAdminService extends BaseService { return; } try { - // 粉丝团铭牌更新 - if (NameplateStyleTypeEnum.ANCHOR_FANS_MP_SEND.getValue().equals(nameplate.getType())) { - generateAndUpdateUserNameplateWithLevelAndWord(nameplate); - } else { - // 更新基础铭牌数据 - generateAndUpdateUserNameplatePicByNameplateId(nameplate); - Map result = jedisService.hgetAll(RedisKey.user_using_nameplate.getKey()); - // key为uid - for (String key : result.keySet()) { - UserNameplateVo vo = gson.fromJson(result.get(key), UserNameplateVo.class); - if (!vo.getNameplateId().equals(id)) { - continue; - } - UserNameplateVo userNameplateVo = userNameplateMapper.userNameplateById(vo.getId()); - userNameplateVo = userNameplateService.checkNameplateVo(userNameplateVo); - jedisService.hset(RedisKey.user_using_nameplate.getKey(), key, this.gson.toJson(userNameplateVo)); - jedisService.hdel(RedisKey.user.getKey(), key); - jedisService.hdel(RedisKey.user_summary.getKey(), key); + // 更新基础铭牌数据 + generateAndUpdateUserNameplatePicByNameplateId(nameplate); + Map result = jedisService.hgetAll(RedisKey.user_using_nameplate.getKey()); + // key为uid + for (String key : result.keySet()) { + UserNameplateVo vo = gson.fromJson(result.get(key), UserNameplateVo.class); + if (!vo.getNameplateId().equals(id)) { + continue; } + UserNameplateVo userNameplateVo = userNameplateMapper.userNameplateById(vo.getId()); + userNameplateVo = userNameplateService.checkNameplateVo(userNameplateVo); + jedisService.hset(RedisKey.user_using_nameplate.getKey(), key, this.gson.toJson(userNameplateVo)); + jedisService.hdel(RedisKey.user.getKey(), key); + jedisService.hdel(RedisKey.user_summary.getKey(), key); } } catch (Exception e) { @@ -404,21 +391,21 @@ public class NameplateAdminService extends BaseService { * * @param nameplate */ - public void generateAndUpdateUserNameplateWithLevelAndWord(Nameplate nameplate) throws IOException { - Long nameplateId = nameplate.getId(); - List configs = anchorFansPrivilegeConfigService.getPrivilegeConfigListByType(Constant.AnchorFansTeamPrivilegeType.nameplate); - for (AnchorFansPrivilegeConfig config : configs) { - // 批量更新使用该铭牌特权的粉丝团铭牌图片 => 目前粉丝铭牌只有一种固定类型 - // 批量更新使用该铭牌特权的粉丝团成员铭牌图片 - if (nameplateId.equals(config.getNormalId())) { - anchorFansTeamService.generateAllAnchorFansTeamMpPicAndMemberPic(Constant.AnchorFansMemberMpStatus.narmal, config.getId(), nameplateId); - } else if (nameplateId.equals(config.getActiveId())) { - anchorFansTeamService.generateAllAnchorFansTeamMpPicAndMemberPic(Constant.AnchorFansMemberMpStatus.active, config.getId(), null); - } else if (nameplateId.equals(config.getNegativeId())) { - anchorFansTeamService.generateAllAnchorFansTeamMpPicAndMemberPic(Constant.AnchorFansMemberMpStatus.negative, config.getId(), null); - } - } - } + // public void generateAndUpdateUserNameplateWithLevelAndWord(Nameplate nameplate) throws IOException { + // Long nameplateId = nameplate.getId(); + // List configs = anchorFansPrivilegeConfigService.getPrivilegeConfigListByType(Constant.AnchorFansTeamPrivilegeType.nameplate); + // for (AnchorFansPrivilegeConfig config : configs) { + // // 批量更新使用该铭牌特权的粉丝团铭牌图片 => 目前粉丝铭牌只有一种固定类型 + // // 批量更新使用该铭牌特权的粉丝团成员铭牌图片 + // if (nameplateId.equals(config.getNormalId())) { + // anchorFansTeamService.generateAllAnchorFansTeamMpPicAndMemberPic(Constant.AnchorFansMemberMpStatus.narmal, config.getId(), nameplateId); + // } else if (nameplateId.equals(config.getActiveId())) { + // anchorFansTeamService.generateAllAnchorFansTeamMpPicAndMemberPic(Constant.AnchorFansMemberMpStatus.active, config.getId(), null); + // } else if (nameplateId.equals(config.getNegativeId())) { + // anchorFansTeamService.generateAllAnchorFansTeamMpPicAndMemberPic(Constant.AnchorFansMemberMpStatus.negative, config.getId(), null); + // } + // } + // } /** * 生成铭牌图片 diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/record/UserService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/record/UserService.java deleted file mode 100644 index 446f929f4..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/record/UserService.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.accompany.admin.service.record; - -import com.accompany.admin.mapper.UserMapperExpand; -import com.accompany.admin.vo.UsersVo; -import com.accompany.common.utils.BlankUtil; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Map; - -@Service("userService2") -public class UserService { - - private static final Logger logger = LoggerFactory.getLogger(UserService.class); - - @Autowired - private UserMapperExpand userMapperExpand; - /** - * - * @param erNos - * @return - */ - public List getUserList(String erNos, Integer page, Integer pageSize) { - if (BlankUtil.isBlank(erNos)) { - return Lists.newArrayList(); - } - String[] arr = erNos.split("\n"); - List erNoList = Lists.newArrayList(); - for (String erNo : arr) { - erNoList.add(Long.valueOf(erNo.trim())); - } - Map data = Maps.newHashMap(); - data.put("ids",erNoList); - data.put("start",(page-1)*pageSize); - data.put("pageSize",pageSize); - List usersVoList = userMapperExpand.selectUserWithGold(data); - return usersVoList; - } - - public int getUserCount(String erNos){ - if (BlankUtil.isBlank(erNos)) { - return 0; - } - String[] arr = erNos.split("\n"); - List erNoList = Lists.newArrayList(); - for (String erNo : arr) { - erNoList.add(Long.valueOf(erNo.trim())); - } - return userMapperExpand.getUserWithGoldCount(erNoList); - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/system/AppVersionAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/system/AppVersionAdminService.java deleted file mode 100644 index 3efca6252..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/system/AppVersionAdminService.java +++ /dev/null @@ -1,339 +0,0 @@ -package com.accompany.admin.service.system; - -import com.accompany.admin.base.AbstractCoreService; -import com.accompany.business.model.AppVersion; -import com.accompany.business.model.AppVersionExample; -import com.accompany.business.mybatismapper.AppVersionMapper; -import com.accompany.business.service.AppVersionService; -import com.accompany.business.service.SendSysMsgService; -import com.accompany.business.vo.AppVersionVo; -import com.accompany.common.config.SystemConfig; -import com.accompany.common.constant.Attach; -import com.accompany.common.constant.Constant; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.utils.GsonUtil; -import com.accompany.core.base.BaseMapper; -import com.accompany.core.exception.AdminServiceException; -import com.accompany.core.model.SysConf; -import com.accompany.core.service.SysConfService; -import com.accompany.core.service.common.JedisService; -import com.accompany.core.util.StringUtils; -import com.alibaba.nacos.api.exception.NacosException; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; - -import java.util.*; -import java.util.stream.Collectors; - -/** - * Created by PaperCut on 2018/1/20. - */ - -/** - * Created by PaperCut on 2018/1/20. - */ -@Service -public class AppVersionAdminService extends AbstractCoreService{ - @Autowired - private AppVersionMapper appVersionMapper; - @Autowired - private SysConfService sysConfService; - @Autowired - private JedisService jedisService; - @Autowired - private AppVersionService appVersionService; - @Autowired - private SysConfAdminService sysConfNacosAdminService; - @Autowired - private SendSysMsgService sendSysMsgService; - - public PageInfo getVersionByPage(int page, int size, String os, String platform, String version) { - PageHelper.startPage(page, size); - AppVersionExample example = new AppVersionExample(); - example.setOrderByClause("create_time desc"); - AppVersionExample.Criteria criteria = example.createCriteria(); - if(StringUtils.isNotBlank(os)){ - criteria.andOsEqualTo(os); - } - if(StringUtils.isNotBlank(platform)){ - criteria.andPlatformEqualTo(platform); - } - if(StringUtils.isNotBlank(version)){ - criteria.andVersionEqualTo(version); - } - List appVersionList = appVersionMapper.selectByExample(example); - return new PageInfo<>(appVersionList); - } - - /** - * 批量更新状态 - * @param ids - * @param status - * @return - */ - private int updateStatusByIds(List ids, byte status) { - AppVersionExample example = new AppVersionExample(); - example.createCriteria().andVersionIdIn(ids); - AppVersion appVersion = new AppVersion(); - appVersion.setStatus(status); - appVersion.setUpdateTime(new Date()); - return appVersionMapper.updateByExampleSelective(appVersion, example); - } - - /** - * 通过状态统计版本记录 - * @param status - * @return - */ - public int countByStatus(byte status, String platform) { - AppVersionExample example = new AppVersionExample(); - example.createCriteria().andStatusEqualTo(status).andPlatformEqualTo(platform); - return appVersionMapper.countByExample(example); - } - - /** - * 更新指定版本为审核中状态 - * @param id - * @return - */ - public int resetAudit(Integer id, String operator) { - AppVersion appVersion = appVersionMapper.selectByPrimaryKey(id); - if(appVersion == null) { - throw new AdminServiceException("未找到该版本"); - } - if(checkHasAudit(id, appVersion.getPlatform())) { - throw new AdminServiceException("已存在审核状态中的版本记录.请修改后再试"); - } - - // 更新指定id的版本状态为审核中 - List ids = Collections.singletonList(id); - int result = updateStatusByIds(ids, Constant.AppVersion.audit); - if (result > 0) { - // 更改系统配置的审核版本 - //sysConfService.setConfValueById(appVersionService.getAuditingVersionKey(appVersion.getPlatform()), appVersion.getVersion(), operator); - // 更新版本中的缓存 - String key = appVersionService.getAppVersionKey(appVersion.getVersion(), appVersion.getOs(), appVersion.getPlatform()); - jedisService.hdel(RedisKey.app_version.getKey(), key); - return result; - } - return 0; - } - - /** - * 根据状态获取版本 - * @param status - * @return - */ - public AppVersion getVersionByStatus(byte status, String platform) { - AppVersionExample example = new AppVersionExample(); - example.createCriteria().andStatusEqualTo(status).andPlatformEqualTo(platform); - List list = appVersionMapper.selectByExampleWithBLOBs(example); - return list.size()>0?list.get(0):null; - } - - - /** - * 统计是否有审核状态中的记录 - * @return - */ - private boolean checkHasAudit(Integer id,String platform) { - if(id == null) { - int count = countByStatus(Constant.AppVersion.audit, platform); - if (count > 0) { - return true; - } - } else { - AppVersion auditingVersion = getVersionByStatus(Constant.AppVersion.audit, platform); - // 判断审核版本的记录是否跟当前id一致 - if(auditingVersion != null && !id.equals(auditingVersion.getVersionId())) { - return true; - } - } - return false; - } - - /** - * 批量重置状态(只支持强制更新和建议更新) - * @param status - * @param ids - * @return - */ - public int resetStatus(Byte status, List ids) { - AppVersionExample example = new AppVersionExample(); - example.createCriteria().andVersionIdIn(ids); - List dbList = appVersionMapper.selectByExample(example); - //更新状态在同一个os和channel分组下只能由一个 - if (isNeedUpdateStatus(status)){ - Optional> optional = dbList.stream().collect(Collectors.groupingBy(v->String.format("%s_%s",v.getOs(),v.getPlatform()))) - .values().stream().filter(l->l.size() >1).findFirst(); - if (optional.isPresent()){ - String versonIds = optional.get().stream().map(AppVersion::getVersionId).map(Object::toString).collect(Collectors.joining("和")); - throw new AdminServiceException(String.format("%s的状态冲突了", versonIds)); - } - } - int result = 0; - for (AppVersion data: dbList){ - data.setStatus(status); - result += save(data); - } - return result; - } - - @Override - public void afterInsert(AppVersion entity) { - jedisService.hset(RedisKey.app_version.getKey(), - appVersionService.getAppVersionKey(entity.getVersion(), entity.getOs(), entity.getPlatform()), GsonUtil.getGson().toJson(entity)); - updateOtherStatus(entity); - } - - @Override - public void afterUpdate(AppVersion entity) { - jedisService.hset(RedisKey.app_version.getKey(), - appVersionService.getAppVersionKey(entity.getVersion(), entity.getOs(), entity.getPlatform()), GsonUtil.getGson().toJson(entity)); - updateOtherStatus(entity); - } - - private void updateOtherStatus(AppVersion entity){ - String newestKey = appVersionService.getNewestVersionKey(entity.getOs(), entity.getPlatform()); - SysConf oldSysConf = sysConfNacosAdminService.getSysConfById(newestKey); - if (null == oldSysConf || !oldSysConf.getConfigValue().equalsIgnoreCase(entity.getVersion())){ - if (isNeedUpdateStatus(entity.getStatus())){ - try { - SysConf sysConf = new SysConf(); - sysConf.setConfigId(newestKey); - sysConf.setConfigName(newestKey); - sysConf.setConfigValue(entity.getVersion()); - sysConf.setNameSpace(Constant.SysConfId.newest_version); - sysConf.setConfigStatus(Constant.StatusV2.valid); - sysConfNacosAdminService.saveOrUpdate(sysConf); - } catch (NacosException e) { - throw new RuntimeException(e); - } - - sendVersionMsg(entity); - - AppVersion updateEntity = new AppVersion(); - updateEntity.setStatus(Constant.AppVersion.online); - - AppVersionExample example = new AppVersionExample(); - example.createCriteria().andOsEqualTo(entity.getOs()).andPlatformEqualTo(entity.getPlatform()) - .andVersionNotEqualTo(entity.getVersion()) - .andStatusIn(Arrays.asList(Constant.AppVersion.forceupdate, Constant.AppVersion.recommupdate)); - List otherList = appVersionMapper.selectByExample(example); - if (!CollectionUtils.isEmpty(otherList)){ - appVersionMapper.updateByExampleSelective(updateEntity, example); - for (AppVersion o: otherList){ - jedisService.hdel(RedisKey.app_version.getKey(), - appVersionService.getAppVersionKey(o.getVersion(), o.getOs(), o.getPlatform())); - } - } - } - } else if (!isNeedUpdateStatus(entity.getStatus())){//当前最新版本是它 - try { - List sysConfIdList = Arrays.asList(newestKey); - sysConfNacosAdminService.delByIds(sysConfIdList); - } catch (NacosException e) { - throw new RuntimeException(e); - } - } - } - - public List getPlatform(String os){ - List platformLits = new ArrayList<>(); - - List sysConfIds = new ArrayList<>(); - sysConfIds.add(Constant.SysConfId.ios_platform); - sysConfIds.add(Constant.SysConfId.android_platform); - if(Constant.OsType.IOS.equalsIgnoreCase(os)){ - sysConfIds.remove(Constant.SysConfId.android_platform); - }else if(Constant.OsType.ANDROID.equalsIgnoreCase(os)){ - sysConfIds.remove(Constant.SysConfId.ios_platform); - } - - for (String sysConfId: sysConfIds){ - SysConf sysConf = sysConfService.getSysConfById(sysConfId); - String conVal = cleanEnter(sysConf.getConfigValue()); - if (StringUtils.isNotBlank(conVal)){ - platformLits.addAll(Arrays.asList(conVal.split(","))); - } - } - return platformLits; - } - - @Transactional(rollbackFor = Exception.class) - public int deleteIds(Object[] ids) throws NacosException { - int count = 0; - List sysConfIdList = new ArrayList<>(); - for(Object id : ids){ - AppVersion appVersion = get(id); - if(appVersion != null) { - int result = super.delete(id); - count += result; - if(result > 0){ - if(isNeedUpdateStatus(appVersion.getStatus())) { - sysConfIdList.add(appVersionService.getNewestVersionKey(appVersion.getOs(), appVersion.getPlatform())); - } - // 清除缓存 - String key = appVersionService.getAppVersionKey(appVersion.getVersion(), appVersion.getOs(), appVersion.getPlatform()); - jedisService.hset(RedisKey.app_version.getKey(), key, ""); - } - - } - } - if (!CollectionUtils.isEmpty(sysConfIdList)){ - sysConfNacosAdminService.delByIds(sysConfIdList); - } - return count; - } - - public void sendVersionMsg(AppVersion newVersion){ - Attach attach = new Attach(); - attach.setFirst(Constant.DefMsgType.Version); - attach.setSecond(Constant.DefMsgType.ForceUpdateVersion); - AppVersionVo vo = appVersionService.toVo(newVersion); - attach.setData(vo); - sendSysMsgService.broadCastMsg(SystemConfig.secretaryUid, GsonUtil.getGson().toJson(attach)); - } - - @Override - public boolean beforeInsert(AppVersion entity) { - Date now = new Date(); - entity.setCreateTime(now); - entity.setUpdateTime(now); - return super.beforeInsert(entity); - } - - @Override - public boolean beforeUpdate(AppVersion entity) { - entity.setUpdateTime(new Date()); - return super.beforeUpdate(entity); - } - - @Override - public Object getId(AppVersion entity) { - return entity.getVersionId(); - } - - @Override - protected BaseMapper getMapper() { - return appVersionMapper; - } - - private String cleanEnter(String str){ - if(str == null){ - return str; - } - str = str.replaceAll("\n",""); - str = str.replaceAll("\r",""); - return str; - } - - private boolean isNeedUpdateStatus(Byte status){ - return Constant.AppVersion.forceupdate.equals(status) || Constant.AppVersion.recommupdate.equals(status); - } -} - diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasureAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasureAdminService.java deleted file mode 100644 index 61b9a14e8..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasureAdminService.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.accompany.admin.service.treasure; - -import cn.hutool.core.collection.CollectionUtil; -import com.accompany.admin.base.Pagination; -import com.accompany.admin.dto.treasure.SeizeTreasureRecordDto; -import com.accompany.admin.mapper.treasure.SeizeTreasureAdminMapper; -import com.accompany.admin.params.treasure.TreasureRecordReq; -import com.accompany.admin.vo.treasure.SeizeTreasureDailyRecordVo; -import com.accompany.admin.vo.treasure.SeizeTreasureRecordVo; -import com.accompany.business.service.user.UsersService; -import com.accompany.business.vo.treasure.record.SeizeTreasureStaticVo; -import com.accompany.common.model.PageReq; -import com.accompany.common.utils.DateTimeUtil; -import com.accompany.core.model.Users; -import com.alibaba.excel.EasyExcel; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.web.context.request.ServletWebRequest; - -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.List; - -@Slf4j -@Service -public class SeizeTreasureAdminService { - @Autowired - private UsersService usersService; - @Autowired - private SeizeTreasureAdminMapper seizeTreasureAdminMapper; - - public SeizeTreasureStaticVo getRecordTotal(TreasureRecordReq recordReq) { - Users userByErbanNo = null; - if (recordReq.getErbanNo() != null) { - userByErbanNo = usersService.getUserByErbanNo(recordReq.getErbanNo()); - if (userByErbanNo == null) { - return new SeizeTreasureStaticVo(); - } - } - return seizeTreasureAdminMapper.getRecordTotal( - recordReq.getPoolTypeList(), recordReq.getPoolGroupList(), recordReq.getPoolLevelList(), userByErbanNo == null ? null : userByErbanNo.getUid(), - recordReq.getStartTime(), recordReq.getEndTime()); - } - - public Pagination getRecordDaily(TreasureRecordReq recordReq, PageReq pageReq) { - Users userByErbanNo = null; - if (recordReq.getErbanNo() != null) { - userByErbanNo = usersService.getUserByErbanNo(recordReq.getErbanNo()); - if (userByErbanNo == null) { - return new Pagination(); - } - } - PageHelper.startPage(pageReq.getPage(), pageReq.getPageSize()); - List recordDaily = seizeTreasureAdminMapper.getRecordDaily( - recordReq.getPoolTypeList(), recordReq.getPoolGroupList(), recordReq.getPoolLevelList(), userByErbanNo == null ? null : userByErbanNo.getUid(), - recordReq.getStartTime(), recordReq.getEndTime()); - PageInfo pageInfo = new PageInfo<>(recordDaily); - return new Pagination(pageInfo); - } - - public Pagination getRecord(TreasureRecordReq recordReq, PageReq pageReq) { - Users userByErbanNo = null; - if (recordReq.getErbanNo() != null) { - userByErbanNo = usersService.getUserByErbanNo(recordReq.getErbanNo()); - if (userByErbanNo == null) { - return new Pagination(); - } - } - PageHelper.startPage(pageReq.getPage(), pageReq.getPageSize()); - List recordDaily = seizeTreasureAdminMapper.getRecord( - recordReq.getPoolTypeList(), recordReq.getPoolGroupList(), recordReq.getPoolLevelList(), userByErbanNo == null ? null : userByErbanNo.getUid(), - recordReq.getStartTime(), recordReq.getEndTime()); - PageInfo pageInfo = new PageInfo<>(recordDaily); - return new Pagination(pageInfo); - } - - public void export(TreasureRecordReq params, ServletWebRequest servletWebRequest) { - PageReq pageReq = new PageReq(); - pageReq.setPage(1); - pageReq.setPageSize(10000000); - Pagination pagination = getRecord(params, pageReq); - List datas = new ArrayList<>(); - List records = pagination.getRows(); - if (CollectionUtil.isNotEmpty(records)) { - for (SeizeTreasureRecordVo record : records) { - SeizeTreasureRecordDto admin = new SeizeTreasureRecordDto(); - BeanUtils.copyProperties(record, admin); - if (record.getCreateTime() != null) { - admin.setCreateTimeStr(DateTimeUtil.convertDate(record.getCreateTime())); - } - datas.add(admin); - } - } - if (servletWebRequest.getResponse() != null) { - try { - //这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman - servletWebRequest.getResponse().setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - servletWebRequest.getResponse().setCharacterEncoding("utf-8"); - //这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系 - String fileName = URLEncoder.encode("抽奖明细", "UTF-8").replaceAll("\\+", "%20"); - servletWebRequest.getResponse().setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); - EasyExcel.write(servletWebRequest.getResponse().getOutputStream(), SeizeTreasureRecordDto.class).sheet("抽奖明细").doWrite(datas); - } catch (Exception e) { - log.error(e.getMessage(), e); - } - } - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasureConvertRecordAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasureConvertRecordAdminService.java deleted file mode 100644 index 393a5db4e..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasureConvertRecordAdminService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.accompany.admin.service.treasure; - -import com.accompany.admin.vo.treasure.SeizeTreasureConvertRecordAdminVo; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; - -/** - * @author: liaozetao - * @date: 2023/9/7 11:02 - * @description: - */ -public interface SeizeTreasureConvertRecordAdminService { - - /** - * 分页 - * - * @param convertType - * @param currentPage - * @param pageSize - * @return - */ - Page page(Integer convertType, Integer currentPage, Integer pageSize); -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasureCovertItemAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasureCovertItemAdminService.java deleted file mode 100644 index fa549fe6e..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasureCovertItemAdminService.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.accompany.admin.service.treasure; - -import com.accompany.admin.vo.treasure.SeizeTreasureConvertItemAdminVo; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; - -/** - * @author: liaozetao - * @date: 2023/9/5 18:23 - * @description: - */ -public interface SeizeTreasureCovertItemAdminService { - - /** - * 分页 - * - * @param page - * @param pageSize - * @return - */ - Page page(Integer page, Integer pageSize); - - /** - * 保存 - * - * @param admin - */ - void save(SeizeTreasureConvertItemAdminVo admin); - - /** - * 删除 - * - * @param id - */ - void del(Long id); -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasurePoolDrawRecordAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasurePoolDrawRecordAdminService.java deleted file mode 100644 index b387abfa7..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasurePoolDrawRecordAdminService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.accompany.admin.service.treasure; - -import com.accompany.admin.vo.treasure.SeizeTreasurePoolDrawRecordAdminVo; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; - -/** - * @author: liaozetao - * @date: 2023/9/7 14:18 - * @description: - */ -public interface SeizeTreasurePoolDrawRecordAdminService { - - /** - * 用户数据查询-全奖池 - * - * @param startTime - * @param endTime - * @param erBanNo - * @param currentPage - * @param pageSize - * @return - */ - Page totalPage(String startTime, String endTime, Long erBanNo, Integer currentPage, Integer pageSize); -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasurePoolItemAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasurePoolItemAdminService.java deleted file mode 100644 index cad847d4a..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasurePoolItemAdminService.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.accompany.admin.service.treasure; - -import com.accompany.admin.vo.treasure.SeizeTreasurePoolItemAdminVo; -import com.accompany.admin.vo.treasure.SeizeTreasurePoolItemCountAdminVo; -import com.accompany.admin.vo.treasure.SeizeTreasurePoolItemDeployedAdminVo; -import com.accompany.business.model.treasure.SeizeTreasurePoolItem; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; - -/** - * @author: liaozetao - * @date: 2023/10/10 14:06 - * @description: - */ -public interface SeizeTreasurePoolItemAdminService { - - /** - * 分页 - * - * @param rewardName - * @param poolType - * @param poolGroup - * @param poolLevel - * @param page - * @param pageSize - * @return - */ - Page page(String rewardName, Integer poolType, Integer poolGroup, Integer poolLevel, Integer page, Integer pageSize); - - /** - * 保存 - * - * @param poolItem - */ - void save(SeizeTreasurePoolItem poolItem); - - /** - * 发布 - * - * @param poolType - */ - void deploy(Integer poolType); - - /** - * 已发布奖池 - * - * @param poolType - * @return - */ - SeizeTreasurePoolItemDeployedAdminVo deployed(Integer poolType); - - /** - * 统计 - * - * @param poolType - * @param poolGroup - * @return - */ - SeizeTreasurePoolItemCountAdminVo count(Integer poolType, Integer poolGroup); - - /** - * 删除 - * - * @param id - */ - void del(Long id); -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasurePropAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasurePropAdminService.java deleted file mode 100644 index c91b5d8e6..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasurePropAdminService.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.accompany.admin.service.treasure; - -import com.accompany.business.model.treasure.SeizeTreasureProp; - -import java.util.List; - -/** - * @author: liaozetao - * @date: 2023/9/6 11:53 - * @description: - */ -public interface SeizeTreasurePropAdminService { - - /** - * 列表 - * - * @param type - * @param level - * @return - */ - List list(Integer type, Integer level); - -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasureRewardAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasureRewardAdminService.java deleted file mode 100644 index 3e8406b55..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasureRewardAdminService.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.accompany.admin.service.treasure; - -import com.accompany.business.model.treasure.SeizeTreasureReward; -import com.accompany.common.model.PageReq; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; - -import java.util.List; - -/** - * @author: liaozetao - * @date: 2023/9/5 18:38 - * @description: - */ -public interface SeizeTreasureRewardAdminService { - - /** - * 分页 - * - * @param req - * @return - */ - Page page(PageReq req); - - /** - * 保存 - * - * @param reward - */ - void save(SeizeTreasureReward reward); - - /** - * 列表 - * - * @param rewardType - * @return - */ - List list(String rewardType); - - /** - * 删除 - * - * @param id - */ - void del(Long id); -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasureUserPropRecordAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasureUserPropRecordAdminService.java deleted file mode 100644 index f679ee0b0..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/SeizeTreasureUserPropRecordAdminService.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.accompany.admin.service.treasure; - -import com.accompany.admin.vo.treasure.SeizeTreasureUserPropRecordAdminVo; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import org.springframework.web.context.request.ServletWebRequest; - -/** - * @author: liaozetao - * @date: 2023/9/7 16:20 - * @description: - */ -public interface SeizeTreasureUserPropRecordAdminService { - - /** - * 分页 - * - * @param erBanNo - * @param startTime - * @param endTime - * @param currentPage - * @param pageSize - * @return - */ - Page page(Long erBanNo, String startTime, String endTime, Integer currentPage, Integer pageSize); - - /** - * 导出 - * - * @param erBanNo - * @param startTime - * @param endTime - * @param servletWebRequest - */ - void export(Long erBanNo, String startTime, String endTime, ServletWebRequest servletWebRequest); - -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/impl/SeizeTreasureConvertRecordAdminServiceImpl.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/impl/SeizeTreasureConvertRecordAdminServiceImpl.java deleted file mode 100644 index 8856af601..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/impl/SeizeTreasureConvertRecordAdminServiceImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.accompany.admin.service.treasure.impl; - -import cn.hutool.core.collection.CollectionUtil; -import com.accompany.admin.service.treasure.SeizeTreasureConvertRecordAdminService; -import com.accompany.admin.vo.treasure.SeizeTreasureConvertRecordAdminVo; -import com.accompany.business.model.treasure.SeizeTreasureConvertRecord; -import com.accompany.business.service.treasure.SeizeTreasureConvertRecordService; -import com.accompany.core.model.Users; -import com.accompany.core.service.user.UsersBaseService; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - -/** - * @author: liaozetao - * @date: 2023/9/7 11:02 - * @description: - */ -@Slf4j -@Service -public class SeizeTreasureConvertRecordAdminServiceImpl implements SeizeTreasureConvertRecordAdminService { - - @Autowired - private UsersBaseService usersBaseService; - - @Autowired - private SeizeTreasureConvertRecordService seizeTreasureConvertRecordService; - - @Override - public Page page(Integer convertType, Integer currentPage, Integer pageSize) { - IPage page = seizeTreasureConvertRecordService.page(new Page<>(currentPage, pageSize), Wrappers.lambdaQuery() - .eq(convertType != null, SeizeTreasureConvertRecord::getConvertType, convertType) - .orderByDesc(SeizeTreasureConvertRecord::getCreateTime)); - List records = page.getRecords(); - List admins = new ArrayList<>(); - if (CollectionUtil.isNotEmpty(records)) { - List uidList = records.stream().map(SeizeTreasureConvertRecord::getUid).distinct().collect(Collectors.toList()); - List userList = usersBaseService.getUsersListByUids(uidList); - for (SeizeTreasureConvertRecord record : records) { - SeizeTreasureConvertRecordAdminVo admin = new SeizeTreasureConvertRecordAdminVo(); - BeanUtils.copyProperties(record, admin); - if (CollectionUtil.isNotEmpty(userList)) { - Optional any = userList.stream().filter(v -> record.getUid().equals(v.getUid())).findAny(); - if (any.isPresent()) { - Users users = any.get(); - admin.setErbanNo(users.getErbanNo()); - admin.setNick(users.getNick()); - } - } - admins.add(admin); - } - } - Page iPage = new Page<>(currentPage, pageSize); - iPage.setTotal(page.getTotal()); - iPage.setRecords(admins); - return iPage; - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/impl/SeizeTreasureCovertItemAdminServiceImpl.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/impl/SeizeTreasureCovertItemAdminServiceImpl.java deleted file mode 100644 index 68a786f9c..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/impl/SeizeTreasureCovertItemAdminServiceImpl.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.accompany.admin.service.treasure.impl; - -import cn.hutool.core.collection.CollectionUtil; -import com.accompany.admin.service.treasure.SeizeTreasureCovertItemAdminService; -import com.accompany.admin.vo.treasure.SeizeTreasureConvertItemAdminVo; -import com.accompany.business.model.treasure.SeizeTreasureConvertItem; -import com.accompany.business.model.treasure.SeizeTreasureReward; -import com.accompany.business.service.treasure.SeizeTreasureConvertItemService; -import com.accompany.business.service.treasure.SeizeTreasureRewardService; -import com.accompany.common.constant.Constant; -import com.accompany.core.exception.AdminServiceException; -import com.accompany.core.util.DateUtil; -import com.alibaba.fastjson.JSONArray; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - -/** - * @author: liaozetao - * @date: 2023/9/5 18:23 - * @description: - */ -@Slf4j -@Service -public class SeizeTreasureCovertItemAdminServiceImpl implements SeizeTreasureCovertItemAdminService { - - @Autowired - private SeizeTreasureRewardService seizeTreasureRewardService; - - @Autowired - private SeizeTreasureConvertItemService seizeTreasureConvertItemService; - - @Override - public Page page(Integer currentPage, Integer pageSize) { - IPage iPage = seizeTreasureConvertItemService.page(new Page<>(currentPage, pageSize), Wrappers.lambdaQuery() - .orderByDesc(SeizeTreasureConvertItem::getType) - .orderByAsc(SeizeTreasureConvertItem::getSeq)); - List records = iPage.getRecords(); - List admins = new ArrayList<>(); - if (CollectionUtil.isNotEmpty(records)) { - List rewardIds = records.stream().map(SeizeTreasureConvertItem::getRewardId).distinct().collect(Collectors.toList()); - List seizeTreasureRewards = seizeTreasureRewardService.list(Wrappers.lambdaQuery() - .in(SeizeTreasureReward::getId, rewardIds)); - for (SeizeTreasureConvertItem record : records) { - Long rewardId = record.getRewardId(); - List propIds = record.getPropIds(); - List propNums = record.getPropNums(); - SeizeTreasureConvertItemAdminVo admin = new SeizeTreasureConvertItemAdminVo(); - BeanUtils.copyProperties(record, admin); - if (CollectionUtil.isNotEmpty(propIds)) { - admin.setPropIdsJson(JSONArray.toJSONString(propIds)); - } - if (CollectionUtil.isNotEmpty(propNums)) { - admin.setPropNumsJson(JSONArray.toJSONString(propNums)); - } - if (CollectionUtil.isNotEmpty(seizeTreasureRewards)) { - Optional any = seizeTreasureRewards.stream().filter(v -> v.getId().equals(rewardId)).findAny(); - if (any.isPresent()) { - SeizeTreasureReward seizeTreasureReward = any.get(); - admin.setRewardName(seizeTreasureReward.getRewardName()); - admin.setRewardType(seizeTreasureReward.getRewardType()); - admin.setRewardValue(seizeTreasureReward.getRewardValue()); - } - } - admins.add(admin); - } - } - Page page = new Page<>(currentPage, pageSize); - page.setTotal(iPage.getTotal()); - page.setRecords(admins); - return page; - } - - @Override - public void save(SeizeTreasureConvertItemAdminVo admin) { - Long id = admin.getId(); - Long rewardId = admin.getRewardId(); - List propIds = admin.getPropIds(); - List propNums = admin.getPropNums(); - SeizeTreasureReward reward = seizeTreasureRewardService.getById(rewardId); - if (reward == null) { - throw new AdminServiceException("奖品不存在"); - } - SeizeTreasureConvertItem item = new SeizeTreasureConvertItem(); - BeanUtils.copyProperties(admin, item); - item.setLevel(reward.getRewardLevel()); - Date now = new Date(); - Date expireTime = null; - Integer effectDay = item.getEffectDay(); - if (effectDay != null && effectDay != 0) { - expireTime = DateUtil.addDays(now, effectDay); - } - item.setStatus(Constant.StatusV2.valid.intValue()); - item.setExpireTime(expireTime); - if (id == null) { - item.setCreateTime(now); - } - if (CollectionUtil.isNotEmpty(propNums)) { - int sum = propNums.stream().mapToInt(v -> v).sum(); - if (sum > 0) { - item.setExpendNum(sum / propNums.size()); - } - } - item.setPropIds(propIds); - item.setPropNums(propNums); - item.setUpdateTime(now); - seizeTreasureConvertItemService.saveOrUpdate(item); - } - - @Override - public void del(Long id) { - seizeTreasureConvertItemService.removeById(id); - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/impl/SeizeTreasurePoolDrawRecordAdminServiceImpl.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/impl/SeizeTreasurePoolDrawRecordAdminServiceImpl.java deleted file mode 100644 index b0bbcf02e..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/impl/SeizeTreasurePoolDrawRecordAdminServiceImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.accompany.admin.service.treasure.impl; - -import cn.hutool.core.collection.CollectionUtil; -import com.accompany.admin.mapper.treasure.SeizeTreasurePoolDrawRecordAdminMapper; -import com.accompany.admin.service.treasure.SeizeTreasurePoolDrawRecordAdminService; -import com.accompany.admin.vo.treasure.SeizeTreasurePoolDrawRecordAdminVo; -import com.accompany.business.service.user.UsersService; -import com.accompany.core.model.Users; -import com.accompany.core.mybatismapper.UsersMapper; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * @author: liaozetao - * @date: 2023/9/7 14:19 - * @description: - */ -@Slf4j -@Service -public class SeizeTreasurePoolDrawRecordAdminServiceImpl implements SeizeTreasurePoolDrawRecordAdminService { - - @Autowired - private UsersMapper usersMapper; - - @Autowired - private SeizeTreasurePoolDrawRecordAdminMapper seizeTreasurePoolDrawRecordAdminMapper; - - @Autowired - private UsersService usersService; - - @Override - public Page totalPage(String startTime, String endTime, Long erBanNo, Integer currentPage, Integer pageSize) { - List uidList = null; - if (erBanNo != null) { - uidList = usersMapper.getUidByErBanNo(String.valueOf(erBanNo)); - } - Page page = seizeTreasurePoolDrawRecordAdminMapper.totalPage(new Page<>(currentPage, pageSize), startTime, endTime, uidList); - List records = page.getRecords(); - if (CollectionUtil.isNotEmpty(records)) { - Map usersMap = usersService.getUsersMapByUids(records.stream().map(SeizeTreasurePoolDrawRecordAdminVo::getUid).distinct().collect(Collectors.toList())); - for (SeizeTreasurePoolDrawRecordAdminVo record : records) { - Long uid = record.getUid(); - if (!usersMap.containsKey(uid)) { - continue; - } - Users users = usersMap.get(uid); - record.setErbanNo(users.getErbanNo()); - record.setNick(users.getNick()); - } - } - return page; - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/impl/SeizeTreasurePoolItemAdminServiceImpl.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/impl/SeizeTreasurePoolItemAdminServiceImpl.java deleted file mode 100644 index 9ee4712a7..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/impl/SeizeTreasurePoolItemAdminServiceImpl.java +++ /dev/null @@ -1,207 +0,0 @@ -package com.accompany.admin.service.treasure.impl; - -import cn.hutool.core.collection.CollectionUtil; -import com.accompany.admin.mapper.treasure.SeizeTreasurePoolItemAdminMapper; -import com.accompany.admin.service.treasure.SeizeTreasurePoolItemAdminService; -import com.accompany.admin.vo.treasure.SeizeTreasurePoolItemAdminVo; -import com.accompany.admin.vo.treasure.SeizeTreasurePoolItemCountAdminVo; -import com.accompany.admin.vo.treasure.SeizeTreasurePoolItemDeployedAdminVo; -import com.accompany.business.model.treasure.SeizeTreasurePoolItem; -import com.accompany.business.model.treasure.SeizeTreasureReward; -import com.accompany.business.mybatismapper.treasure.SeizeTreasureRewardMapper; -import com.accompany.business.service.treasure.SeizeTreasurePoolItemService; -import com.accompany.common.constant.SeizeTreasureConstant; -import com.accompany.common.redis.RedisKey; -import com.accompany.core.service.common.JedisService; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; - -/** - * @author: liaozetao - * @date: 2023/10/10 14:07 - * @description: - */ -@Slf4j -@Service -public class SeizeTreasurePoolItemAdminServiceImpl implements SeizeTreasurePoolItemAdminService { - - @Autowired - private SeizeTreasureRewardMapper seizeTreasureRewardMapper; - - @Autowired - private SeizeTreasurePoolItemAdminMapper seizeTreasurePoolItemAdminMapper; - - @Autowired - private SeizeTreasurePoolItemService seizeTreasurePoolItemService; - - @Autowired - private JedisService jedisService; - - @Override - public Page page(String rewardName, Integer poolType, Integer poolGroup, Integer poolLevel, Integer currentPage, Integer pageSize) { - return seizeTreasurePoolItemAdminMapper.page(new Page<>(currentPage, pageSize), rewardName, poolType, poolGroup, poolLevel); - } - - @Override - public void save(SeizeTreasurePoolItem poolItem) { - Date now = new Date(); - Long id = poolItem.getId(); - if (id != null) { - poolItem.setCreateTime(now); - } - poolItem.setUpdateTime(now); - seizeTreasurePoolItemService.saveOrUpdate(poolItem); - Integer poolType = poolItem.getPoolType(); - List poolItems = seizeTreasurePoolItemService.list(Wrappers.lambdaQuery() - .eq(SeizeTreasurePoolItem::getPoolType, poolType)); - if (CollectionUtil.isNotEmpty(poolItems)) { - Map> poolGroupMap = poolItems.stream().collect(Collectors.groupingBy(SeizeTreasurePoolItem::getPoolGroup)); - List highPoolItems = poolGroupMap.get(SeizeTreasureConstant.TreasurePoolGroup.HIGH); - int poolItemSum = 0; - for (int i = 0, len = highPoolItems.stream().mapToInt(SeizeTreasurePoolItem::getPoolNum).sum(); i < len; i++) { - poolItemSum += poolGroupMap.get(SeizeTreasureConstant.TreasurePoolGroup.BASE).stream().mapToInt(SeizeTreasurePoolItem::getPoolNum).sum(); - poolItemSum += 1; - } - for (SeizeTreasurePoolItem item : poolItems) { - Integer poolNum = item.getPoolNum(); - if (SeizeTreasureConstant.TreasurePoolGroup.BASE.equals(item.getPoolGroup())) { - poolNum = item.getPoolNum() * highPoolItems.size(); - } - double ratio = BigDecimal.valueOf(((double) poolNum) / poolItemSum * 1000000).setScale(0, RoundingMode.HALF_UP).doubleValue(); - item.setRatio((int) ratio); - log.info("SeizeTreasure poolNum : {}, poolItemSum : {}, ratio : {}", poolNum, poolItemSum, ratio); - seizeTreasurePoolItemService.updateById(item); - } - } - } - - @Override - public void deploy(Integer poolType) { - jedisService.del(RedisKey.seize_treasure_pool_item.getKey(String.valueOf(poolType))); - } - - @Override - public SeizeTreasurePoolItemDeployedAdminVo deployed(Integer poolType) { - SeizeTreasurePoolItemDeployedAdminVo deployedItem = new SeizeTreasurePoolItemDeployedAdminVo(); - List poolItems = seizeTreasurePoolItemService.getPoolItem(poolType, null, null); - if (CollectionUtil.isEmpty(poolItems)) { - return deployedItem; - } - List admins = new ArrayList<>(); - for (SeizeTreasurePoolItem poolItem : poolItems) { - SeizeTreasurePoolItemAdminVo admin = new SeizeTreasurePoolItemAdminVo(); - BeanUtils.copyProperties(poolItem, admin); - SeizeTreasureReward seizeTreasureReward = seizeTreasureRewardMapper.selectById(poolItem.getRewardId()); - if (seizeTreasureReward != null) { - admin.setRewardName(seizeTreasureReward.getRewardName()); - admin.setRewardValue(seizeTreasureReward.getRewardValue()); - admin.setRewardShowValue(seizeTreasureReward.getRewardShowValue()); - admin.setRewardRefId(seizeTreasureReward.getRewardRefId()); - } - admins.add(admin); - } - List normalItems = admins.stream().filter(v -> SeizeTreasureConstant.TreasurePoolGroup.BASE.equals(v.getPoolGroup())).collect(Collectors.toList()); - List highItems = admins.stream().filter(v -> SeizeTreasureConstant.TreasurePoolGroup.HIGH.equals(v.getPoolGroup())).collect(Collectors.toList()); - deployedItem.setNormalPoolItems(normalItems); - deployedItem.setSeniorPoolItems(highItems); - return deployedItem; - } - - @Override - public SeizeTreasurePoolItemCountAdminVo count(Integer poolType, Integer poolGroup) { - SeizeTreasurePoolItemCountAdminVo admin = new SeizeTreasurePoolItemCountAdminVo(); - List poolItems = seizeTreasurePoolItemService.list(Wrappers.lambdaQuery() - .eq(SeizeTreasurePoolItem::getPoolType, poolType)); - if (CollectionUtil.isEmpty(poolItems)) { - return admin; - } - List seizeTreasureRewards = seizeTreasureRewardMapper.selectBatchIds(poolItems.stream().map(SeizeTreasurePoolItem::getRewardId).distinct().collect(Collectors.toList())); - if (CollectionUtil.isEmpty(seizeTreasureRewards)) { - return admin; - } - Map rewardMap = seizeTreasureRewards.stream().collect(Collectors.toMap(SeizeTreasureReward::getId, Function.identity(), (v1, v2) -> v1)); - Map> poolGroupMap = poolItems.stream().collect(Collectors.groupingBy(SeizeTreasurePoolItem::getPoolGroup)); - admin.setGiftCount((double) poolGroupMap.get(poolGroup).stream().mapToInt(SeizeTreasurePoolItem::getPoolNum).sum()); - //普通 - double normalGiftValue = 0; - if (poolGroupMap.containsKey(SeizeTreasureConstant.TreasurePoolGroup.BASE)) { - normalGiftValue = poolGroupMap.get(SeizeTreasureConstant.TreasurePoolGroup.BASE).stream().mapToInt(v -> { - Long rewardId = v.getRewardId(); - if (rewardMap.containsKey(rewardId)) { - SeizeTreasureReward reward = rewardMap.get(rewardId); - return reward.getRewardValue() * v.getPoolNum(); - } - return 0; - }).sum(); - } - //高级 - double highGiftValue = 0; - if (poolGroupMap.containsKey(SeizeTreasureConstant.TreasurePoolGroup.HIGH)) { - SeizeTreasurePoolItem poolItem = poolGroupMap.get(SeizeTreasureConstant.TreasurePoolGroup.HIGH).get(0); - Long rewardId = poolItem.getRewardId(); - if (rewardMap.containsKey(rewardId)) { - SeizeTreasureReward reward = rewardMap.get(rewardId); - highGiftValue = reward.getRewardValue() * poolItem.getPoolNum(); - } - } - admin.setGiftValue(normalGiftValue + highGiftValue); - //奖池线包含组数 = 高级礼物组礼物总个数 - int highItemSize = poolGroupMap.get(SeizeTreasureConstant.TreasurePoolGroup.HIGH).stream().mapToInt(SeizeTreasurePoolItem::getPoolNum).sum(); - admin.setRewardLineCount((double) highItemSize); - //奖池线礼物数 = 一条线的总长度 = 普通礼物组总礼物个数 * 高级礼物组礼物个数 + 高级礼物组礼物个数 - int poolItemSum = 0; - double totalGiftValue = 0; - for (int i = 0; i < highItemSize; i++) { - List normalPoolItems = poolGroupMap.get(SeizeTreasureConstant.TreasurePoolGroup.BASE); - poolItemSum += normalPoolItems.stream().mapToInt(SeizeTreasurePoolItem::getPoolNum).sum(); - for (SeizeTreasurePoolItem basePoolItem : normalPoolItems) { - Long rewardId = basePoolItem.getRewardId(); - Integer poolNum = basePoolItem.getPoolNum(); - Integer rewardValue = 0; - if (rewardMap.containsKey(rewardId)) { - SeizeTreasureReward reward = rewardMap.get(rewardId); - rewardValue = reward.getRewardValue(); - } - totalGiftValue += rewardValue * poolNum; - } - } - if (poolGroupMap.containsKey(SeizeTreasureConstant.TreasurePoolGroup.HIGH)) { - totalGiftValue += poolGroupMap.get(SeizeTreasureConstant.TreasurePoolGroup.HIGH).stream().mapToInt(v -> { - Long rewardId = v.getRewardId(); - if (rewardMap.containsKey(rewardId)) { - SeizeTreasureReward reward = rewardMap.get(rewardId); - return reward.getRewardValue() * v.getPoolNum(); - } - return 0; - }).sum(); - poolItemSum += poolGroupMap.get(SeizeTreasureConstant.TreasurePoolGroup.HIGH).stream().mapToInt(SeizeTreasurePoolItem::getPoolNum).sum(); - } - admin.setRewardLineNum((double) poolItemSum); - admin.setTotalGiftValue(totalGiftValue); - //单线比 = 总礼物价值 / (奖池线礼物数 * 每次参与的单价100钻) - double singleLineRatio = 0; - if (poolItemSum != 0) { - singleLineRatio = totalGiftValue / (poolItemSum * 100); - } - admin.setSingleLineRatio(singleLineRatio); - return admin; - } - - @Override - public void del(Long id) { - seizeTreasurePoolItemService.removeById(id); - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/impl/SeizeTreasurePropAdminServiceImpl.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/impl/SeizeTreasurePropAdminServiceImpl.java deleted file mode 100644 index 8e2c13714..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/impl/SeizeTreasurePropAdminServiceImpl.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.accompany.admin.service.treasure.impl; - -import com.accompany.admin.service.treasure.SeizeTreasurePropAdminService; -import com.accompany.business.model.treasure.SeizeTreasureProp; -import com.accompany.business.service.treasure.SeizeTreasurePropService; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * @author: liaozetao - * @date: 2023/9/6 11:54 - * @description: - */ -@Slf4j -@Service -public class SeizeTreasurePropAdminServiceImpl implements SeizeTreasurePropAdminService { - - @Autowired - private SeizeTreasurePropService seizeTreasurePropService; - - @Override - public List list(Integer type, Integer level) { - return seizeTreasurePropService.list(Wrappers.lambdaQuery() - .eq(type != null, SeizeTreasureProp::getType, type) - .eq(level != null, SeizeTreasureProp::getLevel, level)); - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/impl/SeizeTreasureRewardAdminServiceImpl.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/impl/SeizeTreasureRewardAdminServiceImpl.java deleted file mode 100644 index 2e0301352..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/impl/SeizeTreasureRewardAdminServiceImpl.java +++ /dev/null @@ -1,188 +0,0 @@ -package com.accompany.admin.service.treasure.impl; - -import cn.hutool.core.util.StrUtil; -import com.accompany.admin.service.treasure.SeizeTreasureRewardAdminService; -import com.accompany.business.model.CarGoods; -import com.accompany.business.model.Gift; -import com.accompany.business.model.Headwear; -import com.accompany.business.model.Nameplate; -import com.accompany.business.model.dress.ChatBubble; -import com.accompany.business.model.dress.InfoCard; -import com.accompany.business.model.treasure.SeizeTreasureProp; -import com.accompany.business.model.treasure.SeizeTreasureReward; -import com.accompany.business.mybatismapper.CarGoodsMapper; -import com.accompany.business.mybatismapper.GiftMapper; -import com.accompany.business.mybatismapper.HeadwearMapper; -import com.accompany.business.mybatismapper.NameplateMapper; -import com.accompany.business.mybatismapper.dress.ChatBubbleMapper; -import com.accompany.business.mybatismapper.dress.InfoCardMapper; -import com.accompany.business.mybatismapper.treasure.SeizeTreasurePropMapper; -import com.accompany.business.service.treasure.SeizeTreasureRewardService; -import com.accompany.common.constant.Constant; -import com.accompany.common.model.PageReq; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Date; -import java.util.List; - -/** - * @author: liaozetao - * @date: 2023/9/5 18:39 - * @description: - */ -@Slf4j -@Service -public class SeizeTreasureRewardAdminServiceImpl implements SeizeTreasureRewardAdminService { - - @Autowired - private SeizeTreasurePropMapper seizeTreasurePropMapper; - - @Autowired - private GiftMapper giftMapper; - - @Autowired - private NameplateMapper nameplateMapper; - - @Autowired - private CarGoodsMapper carGoodsMapper; - - @Autowired - private HeadwearMapper headwearMapper; - - @Autowired - private ChatBubbleMapper chatBubbleMapper; - - @Autowired - private InfoCardMapper infoCardMapper; - - @Autowired - private SeizeTreasureRewardService seizeTreasureRewardService; - - @Override - public Page page(PageReq req) { - return (Page) seizeTreasureRewardService.page(new Page<>(req.getPage(), req.getPageSize()), Wrappers.lambdaQuery() - .orderByDesc(SeizeTreasureReward::getCreateTime)); - } - - @Override - public void save(SeizeTreasureReward reward) { - buildReward(reward); - Long id = reward.getId(); - if (id == null) { - reward.setCreateTime(new Date()); - } - reward.setUpdateTime(new Date()); - seizeTreasureRewardService.saveOrUpdate(reward); - } - - @Override - public List list(String rewardType) { - return seizeTreasureRewardService.list(Wrappers.lambdaQuery() - .eq(StrUtil.isNotEmpty(rewardType), SeizeTreasureReward::getRewardType, rewardType)); - } - - /** - * 获取图片链接 - * - * @param reward - */ - private void buildReward(SeizeTreasureReward reward) { - Long rewardRefId = reward.getRewardRefId(); - String rewardType = reward.getRewardType(); - String newRewardPicUrl = reward.getRewardPicUrl(); - Integer newRewardValue = reward.getRewardValue(); - Integer newRewardShowValue = reward.getRewardShowValue(); - String rewardPicUrl = null; - Integer rewardValue = null; - Integer rewardShowValue = null; - String rewardName = null; - if (rewardRefId != null) { - switch (rewardType) { - case Constant.ActivityRewardType.ACTIVITY_PROPS: { - SeizeTreasureProp seizeTreasureProp = seizeTreasurePropMapper.selectById(rewardRefId); - if (seizeTreasureProp != null) { - rewardName = seizeTreasureProp.getName(); - rewardPicUrl = seizeTreasureProp.getPicUrl(); - } - break; - } - case Constant.ActivityRewardType.GIFT: { - Gift gift = giftMapper.selectByPrimaryKey(rewardRefId.intValue()); - if (gift != null) { - rewardName = gift.getGiftName(); - rewardPicUrl = gift.getPicUrl(); - rewardValue = gift.getGoldPrice().intValue(); - rewardShowValue = gift.getGoldPrice().intValue(); - } - break; - } - case Constant.ActivityRewardType.NAME_PLATE: { - Nameplate nameplate = nameplateMapper.selectById(rewardRefId); - if (nameplate != null) { - rewardName = nameplate.getName(); - rewardPicUrl = nameplate.getIconPic(); - } - break; - } - case Constant.ActivityRewardType.CAR: { - CarGoods carGoods = carGoodsMapper.selectByPrimaryKey(rewardRefId.intValue()); - if (carGoods != null) { - rewardName = carGoods.getName(); - rewardPicUrl = carGoods.getPic(); - rewardValue = carGoods.getPrice().intValue(); - rewardShowValue = carGoods.getPrice().intValue(); - } - break; - } - case Constant.ActivityRewardType.HEADWEAR: { - Headwear headwear = headwearMapper.selectByPrimaryKey(rewardRefId.intValue()); - if (headwear != null) { - rewardName = headwear.getName(); - rewardPicUrl = headwear.getPic(); - rewardValue = headwear.getPrice().intValue(); - rewardShowValue = headwear.getPrice().intValue(); - } - break; - } - case Constant.ActivityRewardType.CHAT_BUBBLE: { - ChatBubble chatBubble = chatBubbleMapper.selectById(rewardRefId); - if (chatBubble != null) { - rewardName = chatBubble.getName(); - rewardPicUrl = chatBubble.getIosUrl(); - } - break; - } - case Constant.ActivityRewardType.INFO_CARD: { - InfoCard infoCard = infoCardMapper.selectById(rewardRefId); - if (infoCard != null) { - rewardName = infoCard.getName(); - rewardPicUrl = infoCard.getPic(); - } - break; - } - } - } - if (StrUtil.isNotEmpty(rewardName)) { - reward.setRewardName(rewardName); - } - if (StrUtil.isEmpty(newRewardPicUrl)) { - reward.setRewardPicUrl(rewardPicUrl); - } - if (newRewardValue == null) { - reward.setRewardValue(rewardValue); - } - if (newRewardShowValue == null) { - reward.setRewardShowValue(rewardShowValue); - } - } - - @Override - public void del(Long id) { - seizeTreasureRewardService.removeById(id); - } - -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/impl/SeizeTreasureUserPropRecordAdminServiceImpl.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/impl/SeizeTreasureUserPropRecordAdminServiceImpl.java deleted file mode 100644 index 0dc06b604..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/treasure/impl/SeizeTreasureUserPropRecordAdminServiceImpl.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.accompany.admin.service.treasure.impl; - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.date.DatePattern; -import cn.hutool.core.util.StrUtil; -import com.accompany.admin.dto.treasure.SeizeTreasureUserPropRecordAdminDto; -import com.accompany.admin.service.treasure.SeizeTreasureUserPropRecordAdminService; -import com.accompany.admin.vo.treasure.SeizeTreasureUserPropRecordAdminVo; -import com.accompany.business.model.treasure.SeizeTreasureUserPropRecord; -import com.accompany.business.mybatismapper.treasure.SeizeTreasureUserPropRecordMapper; -import com.accompany.business.service.user.UsersService; -import com.accompany.common.constant.SeizeTreasureConstant; -import com.accompany.core.model.Users; -import com.accompany.core.mybatismapper.UsersMapper; -import com.alibaba.excel.EasyExcel; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.web.context.request.ServletWebRequest; - -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * @author: liaozetao - * @date: 2023/9/7 16:20 - * @description: - */ -@Slf4j -@Service -public class SeizeTreasureUserPropRecordAdminServiceImpl implements SeizeTreasureUserPropRecordAdminService { - - @Autowired - private UsersMapper usersMapper; - - @Autowired - private SeizeTreasureUserPropRecordMapper seizeTreasureUserPropRecordMapper; - - @Autowired - private UsersService usersService; - - @Override - public Page page(Long erBanNo, String startTime, String endTime, Integer currentPage, Integer pageSize) { - List uidList = null; - if (erBanNo != null) { - uidList = usersMapper.getUidByErBanNo(String.valueOf(erBanNo)); - } - IPage page = seizeTreasureUserPropRecordMapper.selectPage(new Page<>(currentPage, pageSize), Wrappers.lambdaQuery() - .in(CollectionUtil.isNotEmpty(uidList), SeizeTreasureUserPropRecord::getUid, uidList) - .eq(SeizeTreasureUserPropRecord::getType, SeizeTreasureConstant.PropRecordType.COMPOUND_GAIN) - .le(StrUtil.isNotEmpty(endTime), SeizeTreasureUserPropRecord::getCreateTime, endTime) - .ge(StrUtil.isNotEmpty(startTime), SeizeTreasureUserPropRecord::getCreateTime, startTime) - .orderByDesc(SeizeTreasureUserPropRecord::getCreateTime)); - List records = page.getRecords(); - List admins = new ArrayList<>(); - if (CollectionUtil.isNotEmpty(records)) { - Map usersMap = usersService.getUsersMapByUids(records.stream().map(SeizeTreasureUserPropRecord::getUid).distinct().collect(Collectors.toList())); - for (SeizeTreasureUserPropRecord record : records) { - Long uid = record.getUid(); - Long recordId = record.getId(); - SeizeTreasureUserPropRecordAdminVo admin = new SeizeTreasureUserPropRecordAdminVo(); - admin.setPropName(record.getPropName()); - admin.setCreateTime(record.getCreateTime()); - if (usersMap.containsKey(uid)) { - Users users = usersMap.get(uid); - admin.setErbanNo(users.getErbanNo()); - admin.setNick(users.getNick()); - } - admin.setExpends(seizeTreasureUserPropRecordMapper.selectList(Wrappers.lambdaQuery() - .eq(SeizeTreasureUserPropRecord::getType, SeizeTreasureConstant.PropRecordType.COMPOUND_EXPEND) - .eq(SeizeTreasureUserPropRecord::getBizId, recordId))); - admins.add(admin); - } - } - Page iPage = new Page<>(currentPage, pageSize); - iPage.setTotal(page.getTotal()); - iPage.setRecords(admins); - return iPage; - } - - @Override - public void export(Long erBanNo, String startTime, String endTime, ServletWebRequest servletWebRequest) { - List datas = new ArrayList<>(); - Page page = page(erBanNo, startTime, endTime, 1, 1000000); - List records = page.getRecords(); - if (CollectionUtil.isNotEmpty(records)) { - for (SeizeTreasureUserPropRecordAdminVo record : records) { - Date createTime = record.getCreateTime(); - List expends = record.getExpends(); - SeizeTreasureUserPropRecordAdminDto admin = new SeizeTreasureUserPropRecordAdminDto(); - BeanUtils.copyProperties(record, admin); - if (createTime != null) { - admin.setCreateTimeStr(DateFormatUtils.format(createTime, DatePattern.NORM_DATETIME_PATTERN)); - } - StringBuilder expendStr = new StringBuilder(StrUtil.EMPTY); - if (CollectionUtil.isNotEmpty(expends)) { - for (SeizeTreasureUserPropRecord expend : expends) { - expendStr.append(expend.getPropName()).append("*").append(expend.getPropNum()).append("\r\n"); - } - } - admin.setExpendStr(expendStr.toString()); - datas.add(admin); - } - } - if (servletWebRequest.getResponse() != null) { - try { - //这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman - servletWebRequest.getResponse().setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - servletWebRequest.getResponse().setCharacterEncoding("utf-8"); - //这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系 - String fileName = URLEncoder.encode("用户传说试炼明细", "UTF-8").replaceAll("\\+", "%20"); - servletWebRequest.getResponse().setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); - EasyExcel.write(servletWebRequest.getResponse().getOutputStream(), SeizeTreasureUserPropRecordAdminDto.class).sheet("用户传说试炼明细").doWrite(datas); - } catch (Exception e) { - log.error(e.getMessage(), e); - } - } - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/resources/mapper/GiftCompoundAdminMapper.xml b/accompany-admin/accompany-admin-service/src/main/resources/mapper/GiftCompoundAdminMapper.xml deleted file mode 100644 index b4a4191ad..000000000 --- a/accompany-admin/accompany-admin-service/src/main/resources/mapper/GiftCompoundAdminMapper.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/accompany-admin/accompany-admin-service/src/main/resources/mapper/LinearlyPoolAdminMapper.xml b/accompany-admin/accompany-admin-service/src/main/resources/mapper/LinearlyPoolAdminMapper.xml deleted file mode 100644 index 169e54cc3..000000000 --- a/accompany-admin/accompany-admin-service/src/main/resources/mapper/LinearlyPoolAdminMapper.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/accompany-admin/accompany-admin-service/src/main/resources/mapper/PublicChatTopRecordAdminMapper.xml b/accompany-admin/accompany-admin-service/src/main/resources/mapper/PublicChatTopRecordAdminMapper.xml deleted file mode 100644 index a6eedc44f..000000000 --- a/accompany-admin/accompany-admin-service/src/main/resources/mapper/PublicChatTopRecordAdminMapper.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - \ No newline at end of file diff --git a/accompany-admin/accompany-admin-service/src/main/resources/mapper/SeizeTreasureAdminMapper.xml b/accompany-admin/accompany-admin-service/src/main/resources/mapper/SeizeTreasureAdminMapper.xml deleted file mode 100644 index d7fbf2ba7..000000000 --- a/accompany-admin/accompany-admin-service/src/main/resources/mapper/SeizeTreasureAdminMapper.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/accompany-admin/accompany-admin-service/src/main/resources/mapper/SeizeTreasurePoolDrawRecordAdminMapper.xml b/accompany-admin/accompany-admin-service/src/main/resources/mapper/SeizeTreasurePoolDrawRecordAdminMapper.xml deleted file mode 100644 index b80c31fac..000000000 --- a/accompany-admin/accompany-admin-service/src/main/resources/mapper/SeizeTreasurePoolDrawRecordAdminMapper.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - \ No newline at end of file diff --git a/accompany-admin/accompany-admin-service/src/main/resources/mapper/SeizeTreasurePoolItemAdminMapper.xml b/accompany-admin/accompany-admin-service/src/main/resources/mapper/SeizeTreasurePoolItemAdminMapper.xml deleted file mode 100644 index ecd0e7288..000000000 --- a/accompany-admin/accompany-admin-service/src/main/resources/mapper/SeizeTreasurePoolItemAdminMapper.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - \ No newline at end of file diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/analysis/AnalysisAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/analysis/AnalysisAdminController.java deleted file mode 100644 index dc3c798a4..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/analysis/AnalysisAdminController.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.accompany.admin.controller.analysis; - -import com.accompany.admin.service.analysis.AnalysisAdminService; -import com.accompany.common.result.BusiResult; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @author: liaozetao - * @date: 2023/9/16 15:09 - * @description: - */ -@Api(tags = "分析管理") -@RestController -@RequestMapping("/admin/analysis") -public class AnalysisAdminController { - - @Autowired - private AnalysisAdminService analysisAdminService; - - /** - * 初始化数据 - * - * @return - */ - @ApiOperation("初始化数据") - @GetMapping("/initData") - public BusiResult initData() { - analysisAdminService.initData(); - return BusiResult.success(); - } -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/anchor/AnchorAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/anchor/AnchorAdminController.java deleted file mode 100644 index 2494cc5e2..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/anchor/AnchorAdminController.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.accompany.admin.controller.anchor; - -import com.accompany.admin.controller.BaseController; -import com.accompany.admin.service.anchor.AnchorAdminService; -import com.accompany.business.model.AnchorWhitelist; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import com.accompany.core.exception.ServiceException; -import com.alibaba.fastjson.JSONObject; -import com.github.pagehelper.PageInfo; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * 主播白名单管理 - */ -@RestController -@RequestMapping("/admin/anchor") -public class AnchorAdminController extends BaseController { - - @Autowired - private AnchorAdminService anchorAdminService; - - - /** - * 主播白名单列表 - */ - @RequestMapping(value = "/whitelist") - public void anchorWhiteList(Long erbanNo){ - PageInfo pageInfo = anchorAdminService.queryUsersForPages(erbanNo, getPageNumber(), getPageSize()); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("total", pageInfo.getTotal()); - jsonObject.put("rows", pageInfo.getList()); - writeJson(jsonObject.toJSONString()); - } - - @RequestMapping(value = "/whitelist/save", method = RequestMethod.POST) - public BusiResult save(@RequestParam String erbanNo, String reason){ - try { - int result = anchorAdminService.addAnchor(getAdminId(), erbanNo, reason); - if(result > 0) { - return new BusiResult(BusiStatus.SUCCESS); - } else { - return new BusiResult(BusiStatus.UNKNOWN, "添加失败!",null); - } - } catch (Exception e) { - logger.error(e.getMessage(), e); - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); - } - } - - @RequestMapping(value = "/whitelist/update", method = RequestMethod.POST) - public BusiResult delete(@RequestParam Long erbanNo, String reason, int status){ - try { - int result = anchorAdminService.updateAnchor(getAdminId(), erbanNo, reason,status); - if(result > 0) { - return new BusiResult(BusiStatus.SUCCESS); - } else { - return new BusiResult(BusiStatus.UNKNOWN, "操作失败!",null); - } - } catch (Exception e){ - logger.error(e.getMessage(), e); - return new BusiResult(BusiStatus.SERVERERROR); - } - } - - -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/anchor/AnchorFansPrivilegeAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/anchor/AnchorFansPrivilegeAdminController.java deleted file mode 100644 index b42f708e8..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/anchor/AnchorFansPrivilegeAdminController.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.accompany.admin.controller.anchor; - -import com.accompany.admin.controller.BaseController; -import com.accompany.admin.service.anchor.AnchorFansPrivilegeAdminService; -import com.accompany.business.model.anchor.AnchorFansPrivilegeConfig; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.metadata.IPage; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.RestController; - -/** - * 粉丝团特权配置 - */ -@RestController -@RequestMapping("/admin/anchorFansPrivilege") -public class AnchorFansPrivilegeAdminController extends BaseController { - - @Autowired - private AnchorFansPrivilegeAdminService anchorFansPrivilegeAdminService; - - - @ApiOperation("特权列表") - @RequestMapping("/privilegeList") - @ResponseBody - public BusiResult privilegeList(Integer pageNum, Integer pageSize) { - JSONObject jsonObject = new JSONObject(); - IPage pageInfo = anchorFansPrivilegeAdminService.privilegeList(pageNum, pageSize); - jsonObject.put("total",pageInfo.getTotal()); - jsonObject.put("rows", pageInfo.getRecords()); - return new BusiResult(jsonObject); - } - - @ApiOperation("新增/编辑") - @RequestMapping(value = "/savePrivilege", method = RequestMethod.POST) - @ResponseBody - public BusiResult savePrivilege(AnchorFansPrivilegeConfig fansPrivilegeConfig) { - anchorFansPrivilegeAdminService.savePrivilege(fansPrivilegeConfig); - return new BusiResult(BusiStatus.SUCCESS); - } - - @ApiOperation("删除") - @RequestMapping("/delPrivilege") - @ResponseBody - public BusiResult delPrivilege(Integer id) { - anchorFansPrivilegeAdminService.delPrivilege(id); - return new BusiResult(BusiStatus.SUCCESS); - } - - - @ApiOperation("查询特权信息") - @RequestMapping("/getPrivilegeInfo") - @ResponseBody - public BusiResult getPrivilegeInfo(Long id) { - return new BusiResult(anchorFansPrivilegeAdminService.getPrivilegeInfo(id)); - } - - - -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/anchor/AnchorFansTeamAudioAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/anchor/AnchorFansTeamAudioAdminController.java deleted file mode 100644 index 11fe3939a..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/anchor/AnchorFansTeamAudioAdminController.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.accompany.admin.controller.anchor; - -import com.accompany.admin.controller.BaseController; -import com.accompany.business.service.anchor.AnchorFansTeamAudioRecordService; -import com.accompany.business.vo.anchor.AnchorFansTeamAudioRecordVo; -import com.alibaba.fastjson.JSONObject; -import com.github.pagehelper.PageInfo; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping("/admin/anchorFansTeamAudio") -public class AnchorFansTeamAudioAdminController extends BaseController { - - @Autowired - private AnchorFansTeamAudioRecordService anchorFansTeamAudioRecordService; - - /** - * 粉丝团审核记录 - */ - @RequestMapping("recordList") - public void recordList(Integer pageNumber, Integer pageSize, Long searchText){ - PageInfo userAuditRecordList = anchorFansTeamAudioRecordService.getRecordList(pageNumber, pageSize, searchText); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("total", userAuditRecordList.getTotal()); - jsonObject.put("rows", userAuditRecordList.getList()); - writeJson(jsonObject.toJSONString()); - } - - - @RequestMapping("pass") - public void nameplateAuditPass(Byte status, Long pid,String message){ - anchorFansTeamAudioRecordService.nameplateAuditPass(status,pid,message,getAdminId()); - writeJson(true, "操作成功"); - } - - /** - * 粉丝团铭牌更换 - * @param uid - * @param mpTx - */ - @RequestMapping("uploadFasnTeamMp") - public void uploadFansTeamMp(Long uid,String mpTx){ - anchorFansTeamAudioRecordService.uploadFansTeamMp(uid,mpTx); - writeJson(true, "操作成功"); - } - - - -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/anchor/AnchorFansTeamStatisticAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/anchor/AnchorFansTeamStatisticAdminController.java deleted file mode 100644 index 0e0835765..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/anchor/AnchorFansTeamStatisticAdminController.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.accompany.admin.controller.anchor; - -import com.accompany.admin.controller.BaseController; -import com.accompany.admin.service.anchor.AnchorFansTeamStatisticAdminService; -import com.accompany.business.service.anchor.AnchorFansTeamService; -import com.alibaba.fastjson.JSONObject; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.RestController; - -import java.util.Map; - -@RestController -@RequestMapping("/admin/anchorFansTeam/statis") -public class AnchorFansTeamStatisticAdminController extends BaseController { - - @Autowired - private AnchorFansTeamStatisticAdminService anchorFansTeamStatisticAdminService; - @Autowired - private AnchorFansTeamService anchorFansTeamService; - - @ApiOperation("粉丝团数据统计") - @RequestMapping("/statisList") - @ResponseBody - public void statisList(Integer page, Integer pageSize,Long erbanNo) { - Map map = anchorFansTeamStatisticAdminService.statisticsMap(page,pageSize,erbanNo); - writeJson(JSONObject.toJSONString(map)); - } - - @ApiOperation("粉丝流水统计") - @RequestMapping("/team/DetailList") - @ResponseBody - public void miniGameRoomDetailList(Integer page,Integer pageSize,Long uid) { - Map map = anchorFansTeamStatisticAdminService.fansTeamDetailList(page, pageSize,uid); - writeJson(JSONObject.toJSONString(map)); - } - - - @ApiOperation("粉丝定时任务测试") - @RequestMapping("/team/sendDaliyGiftAndChangeNameplateStatus") - @ResponseBody - public void sendDaliyGiftAndChangeNameplateStatus() { - anchorFansTeamService.sendDesignGiftAndNameplateStatus(); - writeJson(true, "success"); - } - - @ApiOperation("粉丝定时任务测试") - @RequestMapping("/team/fixMemberRedisJoinKeySignAndMpStatus") - @ResponseBody - public void fixMemberRedisJoinKeySign() { - anchorFansTeamService.fixMemberRedisJoinKeySignAndMpStatus(); - writeJson(true, "success"); - } -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/anchor/AnchorReleaseAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/anchor/AnchorReleaseAdminController.java deleted file mode 100644 index d90581e16..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/anchor/AnchorReleaseAdminController.java +++ /dev/null @@ -1,163 +0,0 @@ -package com.accompany.admin.controller.anchor; - -import com.accompany.admin.controller.BaseController; -import com.accompany.admin.service.anchor.AnchorCheckAdminService; -import com.accompany.admin.service.anchor.AnchorReleaseAdminService; -import com.accompany.business.model.AnchorBillCheck; -import com.accompany.business.model.AnchorBillRecord; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.DateTimeUtil; -import com.alibaba.fastjson.JSONObject; -import com.github.pagehelper.PageInfo; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletResponse; -import java.io.*; -import java.util.Date; - -/** - * 主播流水管理 - */ -@RestController -@RequestMapping("/admin/anchor") -public class AnchorReleaseAdminController extends BaseController { - - private static final String ROOT_PATH = "/data/excel"; - - @Autowired - private AnchorReleaseAdminService anchorReleaseAdminService; - - @Autowired - private AnchorCheckAdminService anchorCheckAdminService; - - - /** - * 上传Excel并插入到数据库 - * @param uploadFile - * @return - * @throws Exception - */ - @RequestMapping(value = "/uploadExcel",method = RequestMethod.POST) - public BusiResult uploadFile(MultipartFile uploadFile) throws Exception{ - - Integer adminId = getAdminId(); - String fileName = uploadFile.getOriginalFilename(); - - if(!fileName.contains(".xls")&&fileName.contains(".xlsx")){ - return new BusiResult(BusiStatus.FILE_FORMAT_ERROR); - } - - String filePath = ROOT_PATH + "/"; - File dir = new File(filePath); - if (!dir.isDirectory()){ - dir.mkdir(); - } - Date date = new Date(); - String yyyyMMddHHmmss = DateTimeUtil.convertDate(date, "yyyyMMddHHmmss"); - - String fileOriginalName = uploadFile.getOriginalFilename(); - int index = fileOriginalName.lastIndexOf("."); - String newFileName = fileOriginalName.substring(0,index)+yyyyMMddHHmmss+fileOriginalName.substring(index); - File writeFile = new File(filePath + newFileName); - //文件写入磁盘 - uploadFile.transferTo(writeFile); - int row = anchorCheckAdminService.saveBillCheck(adminId, date, newFileName, filePath, ""); - - if(row > 0) { - return new BusiResult(BusiStatus.SUCCESS); - } else { - return new BusiResult(BusiStatus.UNKNOWN, "操作失败!",null); - } - } - - - - /** - * 账单流水列表 - */ - @RequestMapping(value = "/billList") - public void anchorBillList(Long erbanNo, String remark){ - - PageInfo pageInfo = anchorReleaseAdminService.queryUsersForPages(erbanNo, remark, getPageNumber(), getPageSize()); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("total", pageInfo.getTotal()); - jsonObject.put("rows", pageInfo.getList()); - writeJson(jsonObject.toJSONString()); - } - - - /** - * 上传附件列表 - */ - @RequestMapping(value = "/uploadList") - public void uploadList(){ - - PageInfo pageInfo = anchorCheckAdminService.queryBillCheckForPages(getPageNumber(),getPageSize()); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("total", pageInfo.getTotal()); - jsonObject.put("rows", pageInfo.getList()); - writeJson(jsonObject.toJSONString()); - } - - - /** - * - */ - @RequestMapping(value = "/downloadExcel") - public String downloadExcel(@RequestParam Long id, HttpServletResponse response){ - int adminId = getAdminId(); - logger.info("downloadExcel adminId:{},id:{},id",adminId,id); - AnchorBillCheck anchorBillCheck = anchorCheckAdminService.queryById(id); - if(anchorBillCheck == null){ - return "id not exist"; - } - String fileName = anchorBillCheck.getFileName();// 文件名 - if (fileName != null) { - //设置文件路径 - File file = new File(anchorBillCheck.getFileFullPath()); - if (file.exists()) { - response.setContentType("application/force-download");// 设置强制下载不打开 - response.addHeader("Content-Disposition", "attachment;fileName=" + fileName);// 设置文件名 - byte[] buffer = new byte[1024]; - FileInputStream fis = null; - BufferedInputStream bis = null; - try { - fis = new FileInputStream(file); - bis = new BufferedInputStream(fis); - OutputStream os = response.getOutputStream(); - int i = bis.read(buffer); - while (i != -1) { - os.write(buffer, 0, i); - i = bis.read(buffer); - } - return "下载成功"; - } catch (Exception e) { - e.printStackTrace(); - } finally { - if (bis != null) { - try { - bis.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - if (fis != null) { - try { - fis.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - } - } - return null; - } - -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/audiocard/AudioCardAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/audiocard/AudioCardAdminController.java deleted file mode 100644 index f0123be21..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/audiocard/AudioCardAdminController.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.accompany.admin.controller.audiocard; - -import com.accompany.admin.controller.BaseController; -import com.accompany.admin.service.audiocard.AudioCardAdminService; -import com.accompany.admin.service.system.AdminUserService; -import com.accompany.admin.vo.audiocard.UserAudioCardAdminVo; -import com.accompany.common.result.BusiResult; -import com.accompany.common.result.PageResult; -import com.accompany.common.status.BusiStatus; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping("/admin/audioCard") -public class AudioCardAdminController extends BaseController { - - @Autowired - private AudioCardAdminService audioCardAdminService; - @Autowired - private AdminUserService adminUserService; - - @GetMapping("/page") - public PageResult page(Page page, - Long erbanNo, String startTime, String endTime, Byte status){ - audioCardAdminService.page(page, erbanNo, startTime, endTime, status); - return new PageResult<>(page); - } - - @PostMapping("/verify") - public BusiResult verify(Long id, Byte status){ - int adminId = getAdminId(); - String adminName = adminUserService.getAdminName(adminId); - audioCardAdminService.operate(id, status, adminName); - return new BusiResult<>(BusiStatus.SUCCESS); - } - -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/charge/RedeemCodeController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/charge/RedeemCodeController.java deleted file mode 100644 index 42316a080..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/charge/RedeemCodeController.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.accompany.admin.controller.charge; - -import com.accompany.admin.controller.BaseController; -import com.accompany.admin.service.charge.RedeemCodeService; -import com.accompany.admin.service.system.AdminLogService; -import com.accompany.business.model.RedeemCode; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import com.alibaba.fastjson.JSONObject; -import com.github.pagehelper.PageInfo; -import com.google.common.collect.Lists; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; - -import java.util.Date; -import java.util.List; - -@Controller -@RequestMapping("/admin/redeemcode") -public class RedeemCodeController extends BaseController { - - @Autowired - private RedeemCodeService redeemCodeService2; - @Autowired - private AdminLogService adminLogService; - - /** - * 查询兑换码,分页返回 - * - * @param code - * @param uid - * @param status - */ - @RequestMapping("/getlist") - @ResponseBody - public void getRedeemCodeList(String code, Long uid, Integer status) { - PageInfo pageInfo = redeemCodeService2.getRedeemCodeList(code, uid, status, getPageNumber(), getPageSize()); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("total", pageInfo.getTotal()); - jsonObject.put("rows", pageInfo.getList()); - writeJson(jsonObject.toJSONString()); - } - - - /** - * 生成兑换码 - * - * @param num 指定生成的数量 - * @return - */ - @RequestMapping(value = "/gener") - @ResponseBody - public BusiResult generRedeemCode(Integer num, long amount, Integer len) { - BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS); - if (num == null || num < 1) { - num = 10; - } - if (len == null || len < 8) { - len = 16; - } - // 异步线程执行生成兑换码 - new GenerThread(num, amount, len).start(); - return busiResult; - } - - - class GenerThread extends Thread{ - - private Integer num; - private Long amount; - private Integer len; - - public GenerThread(Integer num, Long amount, Integer len) { - this.num = num; - this.amount = amount; - this.len = len; - } - - @Override - public void run() { - long start = System.currentTimeMillis(); - logger.info("generRedeemCode start, uid: {}, num: {}, amount: {}, len: {}", getAdminId(), num, amount, len); - // 用于存储生成的兑换码 - List codes = Lists.newArrayList(); - int tmp = 0; - while (tmp < num) { - RedeemCode redeemCode = new RedeemCode(); - redeemCode.setCode(redeemCodeService2.buildRandomCode(len)); - redeemCode.setAmount(amount); - redeemCode.setCreateTime(new Date()); - redeemCode.setUseStatus(1); - int result = redeemCodeService2.insertRedeemCode(redeemCode); - if (result == 1) { - tmp++; - codes.add(redeemCode.getCode()); - } - } - long end = System.currentTimeMillis(); - logger.info("generRedeemCode end, gener num: {}, cast time: {}", codes.size(), (end-start)/1000); - adminLogService.insertLog(getAdminId(), RedeemCodeController.class.getCanonicalName(), "generRedeemCode" - , "param===>>num:"+num+", amount:"+amount+",len:"+len+", cast time:"+ (end-start)/1000); - } - } -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/charge/TarotChargeAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/charge/TarotChargeAdminController.java deleted file mode 100644 index edba5c8ce..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/charge/TarotChargeAdminController.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.accompany.admin.controller.charge; - -import com.accompany.admin.controller.BaseController; -import com.accompany.admin.dto.TarotChargeRecordDTO; -import com.accompany.admin.service.charge.TarotChargeAdminService; -import com.accompany.payment.vo.LuckyTarotRecordVo; -import com.accompany.payment.vo.TarotRecordStatisVo; -import com.alibaba.fastjson.JSONObject; -import com.github.pagehelper.PageInfo; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @Author: yangming - * @Date: 2019/11/12 10:57 - * @Description: 塔罗充值管理 - **/ -@RestController -@RequestMapping("/tarot/charge/admin") -public class TarotChargeAdminController extends BaseController { - - @Autowired - private TarotChargeAdminService tarotChargeAdminService; - - /** - * 获取用户抽奖记录 - * @param erbanNo - * @param startDate - * @param endDate - * @param pageNum - * @param pageSize - */ - @GetMapping(value = "/record/list") - public void getRecordList(String erbanNo, String startDate, String endDate, Integer pageNum, Integer pageSize){ - JSONObject jsonObject = new JSONObject(); - PageInfo list = tarotChargeAdminService.getRecordList(erbanNo,startDate,endDate, - pageNum,pageSize); - jsonObject.put("total",list.getTotal()); - jsonObject.put("rows",list.getList()); - writeJson(jsonObject.toJSONString()); - } - - @GetMapping(value = "/record/statis") - public void getRecordStatis(String erbanNo, String startDate, String endDate, Integer pageNum, Integer pageSize){ - JSONObject jsonObject = new JSONObject(); - PageInfo list = tarotChargeAdminService.getRecordStatis(erbanNo,startDate,endDate, - pageNum,pageSize); - jsonObject.put("total",list.getTotal()); - jsonObject.put("rows",list.getList()); - writeJson(jsonObject.toJSONString()); - } - - @GetMapping(value = "/record/total") - public void getRecordTotal(String startDate, String endDate, Integer pageNum, Integer pageSize){ - JSONObject jsonObject = new JSONObject(); - TarotChargeRecordDTO recordDTO = tarotChargeAdminService.getRecordTotal(startDate,endDate, pageNum,pageSize); - jsonObject.put("total",recordDTO.getPageInfo().getTotal()); - jsonObject.put("rows",recordDTO.getPageInfo().getList()); - jsonObject.put("totalVo",recordDTO.getTarotRecordTotalVo()); - writeJson(jsonObject.toJSONString()); - } -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/chat/PublicChatTopRecordAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/chat/PublicChatTopRecordAdminController.java deleted file mode 100644 index a0512a365..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/chat/PublicChatTopRecordAdminController.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.accompany.admin.controller.chat; - -import com.accompany.admin.service.chat.PublicChatTopRecordAdminService; -import com.accompany.admin.vo.chat.PublicChatTopRecordAdminVo; -import com.accompany.common.result.BusiResult; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import groovy.util.logging.Slf4j; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @author: liaozetao - * @date: 2024/5/8 10:42 - * @description: - */ -@Slf4j -@RestController -@RequestMapping("/admin/publicChatTopRecord") -public class PublicChatTopRecordAdminController { - - @Autowired - private PublicChatTopRecordAdminService publicChatTopRecordAdminService; - - /** - * 分页列表 - * @param erbanNo - * @param startTime - * @param endTime - * @param partitionId - * @param pageNum - * @param pageSize - * @return - */ - @ApiOperation("分页列表") - @GetMapping("page") - public BusiResult> page(Long erbanNo, String startTime, String endTime, Integer partitionId, Integer pageNum, Integer pageSize) { - return BusiResult.success(publicChatTopRecordAdminService.page(erbanNo, startTime, endTime, partitionId, pageNum, pageSize)); - } -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/cleanup/CleanUpAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/cleanup/CleanUpAdminController.java deleted file mode 100644 index aebe8c222..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/cleanup/CleanUpAdminController.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.accompany.admin.controller.cleanup; - -import com.accompany.admin.controller.BaseController; -import com.accompany.admin.service.cleanup.CleanUpAdminService; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping("/cleanup") -public class CleanUpAdminController extends BaseController { - - @Autowired - private CleanUpAdminService cleanUpAdminService; - - @RequestMapping(value = "/cleanUserPrizeKey", method = RequestMethod.POST) - public BusiResult cleanUserPrizeKey() { - try { - cleanUpAdminService.cleanUserPrizeKey(); - } catch (Exception e) { - logger.error("cleanUserPrizeKey error: ", e); - return new BusiResult(BusiStatus.SERVERERROR); - } - return new BusiResult(BusiStatus.SUCCESS); - } -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/gift/GiftCompoundAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/gift/GiftCompoundAdminController.java deleted file mode 100644 index 6804a3bed..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/gift/GiftCompoundAdminController.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.accompany.admin.controller.gift; - -import com.accompany.admin.controller.BaseController; -import com.accompany.admin.service.gift.GiftCompoundAdminService; -import com.accompany.admin.vo.GiftCompoundRewardAdminVo; -import com.accompany.admin.vo.gift.GiftCompoundRewordVo; -import com.accompany.business.model.GiftCompoundRewardPool; -import com.accompany.common.constant.Constant; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import com.alibaba.fastjson.JSONObject; -import org.apache.commons.collections.CollectionUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -@RestController -@RequestMapping("/admin/gift/compound") -public class GiftCompoundAdminController extends BaseController { - @Autowired - private GiftCompoundAdminService giftCompoundAdminService; - - @GetMapping(value = "list") - public BusiResult getList(Integer pageNum, Integer pageSize){ - JSONObject jsonObject = new JSONObject(); - List list = giftCompoundAdminService.getList(pageNum, pageSize); - jsonObject.put("total", giftCompoundAdminService.getCount(Constant.GiftCompound.GiftRewardType.NORMAL)); - jsonObject.put("rows", list); - return new BusiResult(jsonObject); - } - - @ResponseBody - @GetMapping(value = "getById") - public BusiResult getById(Integer id){ - return new BusiResult(giftCompoundAdminService.getGiftCompoundById(id)); - } - - @ResponseBody - @GetMapping(value = "getByLimitId") - public BusiResult getByLimitId(Integer id){ - return new BusiResult(giftCompoundAdminService.getGiftCompoundLimitById(id)); - } - - @GetMapping(value = "limtList") - public BusiResult limtList(Integer pageNum, Integer pageSize, Integer rewardId){ - JSONObject jsonObject = new JSONObject(); - List list = giftCompoundAdminService.limtList(pageNum, pageSize, rewardId); - double sumExpectValue = 0; - if(CollectionUtils.isNotEmpty(list) && list.size() > 0 ){ - sumExpectValue = list.stream().filter(a -> a.getExpectValue() != null).map(a -> a.getExpectValue()).mapToDouble(a -> a).sum(); - } - jsonObject.put("total", giftCompoundAdminService.getCount(Constant.GiftCompound.GiftRewardType.LIMIT)); - jsonObject.put("rows", list); - jsonObject.put("sumExpectValue", sumExpectValue); - return new BusiResult(jsonObject); - } - - @ResponseBody - @RequestMapping(value = "getLimitGiftList", method = RequestMethod.GET) - public BusiResult getLimitGiftList() { - JSONObject jsonObject = new JSONObject(); - List list = giftCompoundAdminService.getPoolItem(); - jsonObject.put("total", list.size()); - jsonObject.put("rows", list); - return new BusiResult(jsonObject); - } - - @ResponseBody - @GetMapping(value = "getLimitGtifById") - public BusiResult getLimitGtifById(Integer id){ - return new BusiResult(giftCompoundAdminService.getLimitGtifById(id)); - } - - - @ResponseBody - @RequestMapping(value = "getPoolItem", method = RequestMethod.GET) - public void getPoolItem() { - JSONObject jsonObject = new JSONObject(); - List list = giftCompoundAdminService.getPoolItem(); - jsonObject.put("total", giftCompoundAdminService.getCount(Constant.GiftCompound.GiftRewardType.LIMIT)); - jsonObject.put("rows", list); - writeJson(jsonObject.toJSONString()); - } - - - @ResponseBody - @PostMapping(value = "saveReward") - public BusiResult saveReward(GiftCompoundRewordVo rewardVo){ - giftCompoundAdminService.saveReward(rewardVo); - return new BusiResult(BusiStatus.SUCCESS); - } - - - - @PostMapping(value = "saveRewardPool") - public BusiResult saveRewardPool(GiftCompoundRewardPool rewardPool){ - giftCompoundAdminService.saveRewardPool(rewardPool); - return new BusiResult(BusiStatus.SUCCESS); - } - - @GetMapping(value = "deleteReward") - @ResponseBody - public BusiResult deleteReward(Integer id){ - giftCompoundAdminService.delReward(id); - return new BusiResult(BusiStatus.SUCCESS); - } - - @ResponseBody - @GetMapping(value = "deleteRewardPool") - public BusiResult deleteRewardPool(Integer rewardPoolId){ - giftCompoundAdminService.delRewardPool(rewardPoolId); - return new BusiResult(BusiStatus.SUCCESS); - } - - -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/home/HomeNewFriendController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/home/HomeNewFriendController.java deleted file mode 100644 index a4c04dec7..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/home/HomeNewFriendController.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.accompany.admin.controller.home; - -import com.accompany.admin.service.home.HomeNewFriendAdminService; -import com.accompany.admin.vo.home.HomeNewFriendAdminVo; -import com.accompany.common.model.PageReq; -import com.accompany.common.result.BusiResult; -import com.accompany.common.result.PageResult; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -/** - * @author: liaozetao - * @date: 2023/9/4 14:14 - * @description: - */ -@Api(tags = "扩列交友管理") -@RestController -@RequestMapping("/admin/new/friend") -public class HomeNewFriendController { - - @Autowired - private HomeNewFriendAdminService homeNewFriendAdminService; - - /** - * 分页 - * - * @param req - * @return - */ - @ApiOperation("分页") - @GetMapping("page") - public PageResult page(PageReq req) { - return new PageResult<>(homeNewFriendAdminService.page(req)); - } - - /** - * 保存 - * - * @param erBanNoStr - * @param expireTimeStr - * @return - */ - @ApiOperation("保存") - @PostMapping("save") - public BusiResult save(String erBanNoStr, String expireTimeStr) { - homeNewFriendAdminService.save(erBanNoStr, expireTimeStr); - return BusiResult.success(); - } - - /** - * 删除 - * - * @param uid - * @return - */ - @ApiOperation("删除") - @DeleteMapping("del") - public BusiResult del(Long uid) { - homeNewFriendAdminService.del(uid); - return BusiResult.success(); - } - -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/linearlypool/LinearlyPoolAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/linearlypool/LinearlyPoolAdminController.java deleted file mode 100644 index 17ac6da57..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/linearlypool/LinearlyPoolAdminController.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.accompany.admin.controller.linearlypool; - -import com.accompany.admin.controller.BaseController; -import com.accompany.admin.params.linearlypool.PoolItemDraftSaveReqParams; -import com.accompany.admin.params.linearlypool.PoolItemShowRatioReqParams; -import com.accompany.admin.service.linearly.LinearlyPoolItemAdminService; -import com.accompany.admin.service.system.AdminLogService; -import com.accompany.admin.service.system.AdminUserService; -import com.accompany.admin.vo.linearlypool.LinearlyPoolDeployResultVO; -import com.accompany.admin.vo.linearlypool.LinearlyPoolItemAdminPageVO; -import com.accompany.admin.vo.linearlypool.PrizeItemVO; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import com.accompany.core.vo.BaseResponseVO; -import com.alibaba.fastjson.JSONObject; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -@RestController -@RequestMapping("/admin/linearlyPool") -public class LinearlyPoolAdminController extends BaseController { - - @Autowired - private LinearlyPoolItemAdminService linearlyPoolItemAdminService; - @Autowired - private AdminLogService adminLogService; - @Autowired - private AdminUserService adminUserService; - - @GetMapping("/getPrizeGroupsInfo") - public BusiResult getPrizeGroupsInfo() { - LinearlyPoolItemAdminPageVO result = linearlyPoolItemAdminService.getPrizeGroupsInfo(); - - return new BusiResult<>(BusiStatus.SUCCESS, result); - } - - @GetMapping("/listDeployedPoolItems") - public BusiResult> listDeployedPoolItems() { - List poolItems = linearlyPoolItemAdminService.listDeployedPoolItems(); - - return new BusiResult<>(BusiStatus.SUCCESS, poolItems); - } - - @PostMapping("/saveDraft") - public BaseResponseVO saveDraft(@RequestBody PoolItemDraftSaveReqParams params) { - int adminId = getAdminId(); - String adminName = adminUserService.getAdminName(adminId); - linearlyPoolItemAdminService.saveDraft(params, adminName); - adminLogService.insertLog(getAdminId(), getClass().getCanonicalName(), "saveDraft", "params===>>PoolItemDraftSaveReqParams:" + JSONObject.toJSONString(params)); - return new BaseResponseVO<>(BusiStatus.SUCCESS); - } - - @PostMapping("/deploy") - public BaseResponseVO deploy() { - LinearlyPoolDeployResultVO res = linearlyPoolItemAdminService.deploy(); - adminLogService.insertLog(getAdminId(), getClass().getCanonicalName(), "deploy", ""); - return new BaseResponseVO<>(BusiStatus.SUCCESS, res); - } - - @PostMapping("/updateShowRatio") - public BaseResponseVO updateShowRatio(@RequestBody PoolItemShowRatioReqParams params) { - linearlyPoolItemAdminService.updateShowRatio(params); - adminLogService.insertLog(getAdminId(), getClass().getCanonicalName(), "updateShowRatio", "params===>>PoolItemShowRatioReqParams:" + JSONObject.toJSONString(params)); - return new BaseResponseVO<>(BusiStatus.SUCCESS); - } -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/linearlypool/LinearlyPoolDataAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/linearlypool/LinearlyPoolDataAdminController.java deleted file mode 100644 index 7f2eca2ea..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/linearlypool/LinearlyPoolDataAdminController.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.accompany.admin.controller.linearlypool; - -import com.accompany.admin.base.Pagination; -import com.accompany.admin.controller.BaseController; -import com.accompany.admin.params.linearlypool.PlatformDataReqParams; -import com.accompany.admin.service.linearly.LinearlyPoolDataAdminService; -import com.accompany.admin.util.ExcelUtils; -import com.accompany.common.result.BusiResult; -import com.accompany.core.model.Users; -import com.accompany.core.service.user.UsersBaseService; -import com.alibaba.fastjson.JSONObject; -import com.github.pagehelper.PageInfo; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -@RestController -@RequestMapping("/admin/linearlyPool/data") -public class LinearlyPoolDataAdminController extends BaseController { - - @Autowired - private LinearlyPoolDataAdminService linearlyPoolDataAdminService; - @Autowired - private UsersBaseService usersBaseService; - - @RequestMapping("/user/statis/list") - public void getList(Long msNo, Integer minDis, Integer maxDis, Byte source, String startTime, String endTime){ - Users users = usersBaseService.getUsersByErBanNo(msNo); - JSONObject jsonObject = new JSONObject(); - Long uid = null; - if (users != null) { - uid = users.getUid(); - } - try{ - PageInfo pageInfo = linearlyPoolDataAdminService.getUserStatisList(uid, minDis, maxDis, getPageNumber(), getPageSize(), source, startTime, endTime); - jsonObject.put("total",pageInfo.getTotal()); - jsonObject.put("rows",pageInfo.getList()); - writeJson(jsonObject.toJSONString()); - }catch (Exception e){ - logger.error("get draw box statis list failed",e); - jsonObject.put("message",e); - writeJson(jsonObject.toJSONString()); - } - } - - @GetMapping("/listDrawRecord") - public void getRecordList(Long msNo,String prizeName, Date startDate,Date endDate){ - Users users = usersBaseService.getUsersByErBanNo(msNo); - JSONObject jsonObject = new JSONObject(); - Long uid = null; - if(users != null){ - uid = users.getUid(); - } - try{ - PageInfo pageInfo = linearlyPoolDataAdminService.getRecordList(uid,prizeName,getPageNumber(),getPageSize(),startDate,endDate); - jsonObject.put("total",pageInfo.getTotal()); - jsonObject.put("rows",pageInfo.getList()); - writeJson(jsonObject.toJSONString()); - }catch (Exception e){ - logger.error("get draw box record list failed",e); - jsonObject.put("message",e); - writeJson(jsonObject.toJSONString()); - } - } - - /** - * 用户抽奖记录导出Excel - * @param msNo - * @param prizeName - * @param startDate - * @param endDate - * @param request - * @param response - */ - @RequestMapping(value = "export", method = RequestMethod.POST) - public void export(Long msNo, String prizeName, Date startDate, Date endDate, HttpServletRequest request, HttpServletResponse response) { - try { - Long uid = null; - if(msNo != null) { - Users users = usersBaseService.getUsersByErBanNo(msNo); - if (users != null) { - uid = users.getUid(); - } - } - - List headerList = new ArrayList<>(); - headerList.add("奖池线id"); - headerList.add("uid"); - headerList.add("66号"); - headerList.add("用户昵称"); - headerList.add("奖品名称"); - headerList.add("抽奖时间"); - headerList.add("平台价值"); - headerList.add("礼物组类型"); - String fileName = "用户抽奖记录.xls"; - List excelRows = linearlyPoolDataAdminService.listExportRecordRows(uid, prizeName, startDate, endDate); - Workbook workbook = ExcelUtils.createExcelSheet(headerList, excelRows); - ExcelUtils.setExcelResponseHeader(request, response, fileName); - java.io.OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - } catch(Exception e) { - logger.error("Failed to export box prize record list. ", e); - writeJson(false, "导出失败"); - } - } - - @GetMapping("/platform/list") - public Pagination queryPlatformStaticList(PlatformDataReqParams params){ - params.setPageNum(getPageNumber()); - params.setPageSize(getPageSize()); - Pagination page = this.linearlyPoolDataAdminService.queryPlatformData(params, true); - return page; - } - - @PostMapping("/platform/total") - public BusiResult queryPlatformStaticTotal(PlatformDataReqParams params){ - return new BusiResult(linearlyPoolDataAdminService.querySingleDrawLotteryRecordStatisVo(params, true)); - } - - @GetMapping("/platform/listDays") - public Pagination queryPlatformStaticListDays(PlatformDataReqParams params){ - params.setPageNum(getPageNumber()); - params.setPageSize(getPageSize()); - Pagination page = this.linearlyPoolDataAdminService.queryPlatformData(params, false); - return page; - } - - @PostMapping("/platform/totalDays") - public BusiResult queryPlatformStaticTotalDays(PlatformDataReqParams params){ - return new BusiResult(linearlyPoolDataAdminService.querySingleDrawLotteryRecordStatisVo(params, false)); - } -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/record/GiveKeyAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/record/GiveKeyAdminController.java index 3d2f2ee12..0476123ff 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/record/GiveKeyAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/record/GiveKeyAdminController.java @@ -2,7 +2,6 @@ package com.accompany.admin.controller.record; import com.accompany.admin.controller.BaseController; import com.accompany.admin.service.record.OfficialGiveKeyService; -import com.accompany.admin.service.record.UserService; import com.accompany.admin.service.system.AdminLogService; import com.accompany.admin.vo.UserKeyVo; import com.accompany.admin.vo.UsersVo; @@ -32,8 +31,6 @@ public class GiveKeyAdminController extends BaseController { private OfficialGiveKeyService officialGiveKeyService; @Autowired private AdminLogService adminLogService; - @Autowired - private UserService userService; /** * 赠送金币、萝卜 @@ -74,15 +71,15 @@ public class GiveKeyAdminController extends BaseController { @ResponseBody public void getUserInfoByErNos(String ernos, @RequestParam(defaultValue = "1")Integer page, @RequestParam(defaultValue = "20") Integer pageSize) { try { - List userList = userService.getUserList(ernos, page, pageSize); - List uids = userList.stream().map(item -> item.getUid()).collect(Collectors.toList()); + // List userList = userService.getUserList(ernos, page, pageSize); + // List uids = userList.stream().map(item -> item.getUid()).collect(Collectors.toList()); - List list = officialGiveKeyService.getUserPrizeKeyBatch(uids); - int count = userService.getUserCount(ernos); - Map data = Maps.newHashMap(); - data.put("total", count); - data.put("rows", list); - writeJson(JSONObject.toJSONString(data)); + // List list = officialGiveKeyService.getUserPrizeKeyBatch(uids); + // int count = userService.getUserCount(ernos); + // Map data = Maps.newHashMap(); + // data.put("total", count); + // data.put("rows", list); + // writeJson(JSONObject.toJSONString(data)); }catch (Exception e){ logger.error("getUserInfoByErNos error:{}",e); writeJson(false, "查询失败"); diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/record/GoldCoinController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/record/GoldCoinController.java index 77f7cc471..d3f6279ad 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/record/GoldCoinController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/record/GoldCoinController.java @@ -2,7 +2,6 @@ package com.accompany.admin.controller.record; import com.accompany.admin.controller.BaseController; import com.accompany.admin.service.record.OfficialGoldRecordService; -import com.accompany.admin.service.record.UserService; import com.accompany.admin.service.system.AdminLogService; import com.accompany.admin.vo.OfficialGoldAllRecordVo; import com.accompany.admin.vo.OfficialGoldRecordVo; @@ -43,8 +42,6 @@ import java.util.Map; @RequestMapping("/admin/goldcoin") public class GoldCoinController extends BaseController { - @Autowired - private UserService userService; @Autowired private OfficialGoldRecordService officialGoldRecordService; @Autowired @@ -88,12 +85,7 @@ public class GoldCoinController extends BaseController { @RequestMapping("/userinfo") @ResponseBody public void getUserInfoByErNos(String ernos, @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "20") Integer pageSize) { - List list = userService.getUserList(ernos, page, pageSize); - int count = userService.getUserCount(ernos); - Map data = Maps.newHashMap(); - data.put("total", count); - data.put("rows", list); - writeJson(JSONObject.toJSONString(data)); + } @RequestMapping("/record") diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/sms/SmsRecordAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/sms/SmsRecordAdminController.java index 86904bc22..bab9a73c2 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/sms/SmsRecordAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/sms/SmsRecordAdminController.java @@ -5,5 +5,24 @@ import com.accompany.admin.service.sms.SmsRecordAdminService; import com.accompany.common.model.PageReq; import com.accompany.common.result.BusiResult; import com.accompany.common.result.PageResult; -import com.accompany.common.status.BusiStatus; -import com.accompany.sms.model.SmsRecord; \ No newline at end of file +import com.accompany.sms.model.SmsRecord; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/admin/smsRecord") +public class SmsRecordAdminController extends BaseController { + + @Autowired + private SmsRecordAdminService smsRecordAdminService; + + @GetMapping("/page") + public BusiResult> page(PageReq pageReq, String phone) { + Page pageInfo = smsRecordAdminService.page(pageReq, phone); + return BusiResult.success(new PageResult<>(pageInfo)); + } + +} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/system/AppVersionAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/system/AppVersionAdminController.java deleted file mode 100644 index 5706f76ae..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/system/AppVersionAdminController.java +++ /dev/null @@ -1,298 +0,0 @@ -package com.accompany.admin.controller.system; - -import com.accompany.admin.controller.BaseController; -import com.accompany.admin.model.AdminUser; -import com.accompany.admin.service.system.AdminLogService; -import com.accompany.admin.service.system.AdminUserService; -import com.accompany.admin.service.system.AppVersionAdminService; -import com.accompany.admin.util.AdminUtil; -import com.accompany.business.model.AppVersion; -import com.accompany.business.vo.EditVersionVo; -import com.accompany.business.vo.UploadFileInfoVo; -import com.accompany.common.tencent.cos.TencentCosUploadService; -import com.accompany.common.utils.BlankUtil; -import com.accompany.common.utils.GsonUtil; -import com.accompany.core.exception.AdminServiceException; -import com.accompany.core.util.StringUtils; -import com.alibaba.fastjson.JSONObject; -import com.github.pagehelper.PageInfo; -import com.google.common.collect.Maps; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.codec.digest.DigestUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.*; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.ThreadPoolExecutor; - -/** - * Created by PaperCut on 2018/1/20. - */ -@Slf4j -@Controller -@RequestMapping("/admin/version") -public class AppVersionAdminController extends BaseController { - @Autowired - private AppVersionAdminService appVersionAdminService; - @Autowired - private TencentCosUploadService uploadService; - @Resource(name = "biz-executor") - private ThreadPoolExecutor bizExecutor; - @Autowired - private AdminUserService adminUserService; - @Autowired - private AdminLogService adminLogService; - - @RequestMapping(value = "getList", method = RequestMethod.GET) - @ResponseBody - public void getList(String os, String platform, String version) { - JSONObject jsonObject = new JSONObject(); - PageInfo pageInfo = appVersionAdminService.getVersionByPage(getPageNumber(), getPageSize(), os, platform, version); - jsonObject.put("total", pageInfo.getTotal()); - jsonObject.put("rows", pageInfo.getList()); - writeJson(jsonObject.toJSONString()); - } - - @RequestMapping(value = "save", method = RequestMethod.POST) - @ResponseBody - public void save(EditVersionVo versionVo) { - try { - // 保存版本记录 - if (StringUtils.isBlank(versionVo.getPlatform())) { - throw new AdminServiceException("未选择平台"); - } - int adminId = getAdminId(); - //AdminUser adminUser = adminUserService.getAdminUserById(adminId); - //int result = appVersionService.batchSave(versionVo, adminUser.getUsername()); - int result = appVersionAdminService.save(versionVo); - adminLogService.insertLog(adminId, getClass().getCanonicalName(), "save", "params===>>" + JSONObject.toJSONString(versionVo)); - if (result > 0) { - writeJson(true, "保存成功"); - return; - } - } catch (AdminServiceException e) { - writeJson(false, e.getMessage()); - return; - } catch (Exception e) { - logger.error("Failed to save appVersion. Cause by {}", e.getMessage()); - } - writeJson(false, "保存失败"); - } - - - @RequestMapping(value = "del") - @ResponseBody - public void del(HttpServletRequest request) { - List ids = getRequestArray(request, "ids", Integer.class); - if (CollectionUtils.isEmpty(ids)) { - writeJson(false, "参数有误"); - return; - } - try { - int adminId = getAdminId(); - int result = appVersionAdminService.deleteIds(ids.toArray(new Integer[]{})); - adminLogService.insertLog(adminId, getClass().getCanonicalName(), "del", "params===>>ids:" + ids.toString()); - if (result > 0) { - writeJson(true, "删除成功"); - return; - } - } catch (Exception e) { - logger.error("Failed to delete appVersion, Cause by {}", e.getCause().getMessage()); - } - - } - - @RequestMapping(value = "get", method = RequestMethod.GET) - @ResponseBody - public void get(@RequestParam("id") Integer id) { - if (null == id){ - writeJson(false, "参数有误"); - return; - } - JSONObject jsonObject = new JSONObject(); - AppVersion appVersion = appVersionAdminService.get(id); - if (appVersion != null) { - jsonObject.put("entity", appVersion); - } - writeJson(jsonObject.toJSONString()); - } - - /** - * 置为强制更新或建议更新 - * - * @param type - * @param request - */ - @RequestMapping(value = "resetStatus", method = RequestMethod.POST) - @ResponseBody - public void resetStatus(@RequestParam("type") Byte type, HttpServletRequest request) { - List ids = getRequestArray(request, "ids", Integer.class); - if (CollectionUtils.isEmpty(ids)) { - writeJson(false, "参数有误"); - return; - } - int result = appVersionAdminService.resetStatus(type, ids); - if (result > 0) { - writeJson(true, "设置成功"); - return; - } - writeJson(false, "设置失败"); - } - - @RequestMapping(value = "resetAudit", method = RequestMethod.POST) - @ResponseBody - public void resetAudit(@RequestParam("id") Integer id) { - try { - int adminId = getAdminId(); - AdminUser adminUser = adminUserService.getAdminUserById(adminId); - // 设置该版本记录为审核状态中 - int result = appVersionAdminService.resetAudit(id, adminUser.getUsername()); - adminLogService.insertLog(adminId, getClass().getCanonicalName(), "resetAudit", "params===>>id:" + id); - if (result > 0) { - writeJson(true, "设置成功"); - return; - } - } catch (AdminServiceException e) { - writeJson(false, e.getMessage()); - return; - } catch (Exception e) { - logger.error("Failed to resetAudit, Cause by {}", e.getCause().getMessage()); - } - writeJson(false, "设置失败"); - } - - /** - * 根据系统获取渠道信息 - * - * @param os - * @return - */ - @RequestMapping(value = "getPlatform", method = RequestMethod.GET) - @ResponseBody - public void getPlatform(String os) { - List platform = appVersionAdminService.getPlatform(os); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("data", platform); - writeJson(jsonObject.toJSONString()); - } - - /** - * 上传文件,文件路径不加瘦身参数,并获取md5码 - * - * @param uploadFiles - */ - @RequestMapping(value = "/upload/file", method = RequestMethod.POST) - @ResponseBody - public void uploadFile(@RequestParam("uploadFile") MultipartFile[] uploadFiles, HttpServletRequest request) throws Exception { - - List returnList = Collections.synchronizedList(new ArrayList<>()); - final CountDownLatch latch = new CountDownLatch(uploadFiles.length); - if (uploadFiles.length != 0) { - for (int i = 0; i < uploadFiles.length; i++) { - final int j = i; - bizExecutor.execute(() -> { - UploadFileInfoVo infoVo = new UploadFileInfoVo(); - MultipartFile uploadFile = uploadFiles[j]; - // 文件名 - String fileName = uploadFile.getOriginalFilename(); - // 保存到本地临时文件 - Map fileMap = writeFileToLocal(uploadFile, request, fileName); - // 本地临时文件 - File file = (File) fileMap.get("file"); - // 文件MD5 - String md5 = (String) fileMap.get("md5"); - // 本地临时文件流 - InputStream in = null; - try { - if (file != null && StringUtils.isNotBlank(md5)) { - in = new FileInputStream(file); - String filePath = uploadService.uploadByStream(in, Calendar.getInstance().getTimeInMillis() - + "/" + fileName); - - if (!BlankUtil.isBlank(filePath)) { - infoVo.setPath(filePath); - infoVo.setMd5(md5); - infoVo.setSuccess(true); - returnList.add(infoVo); - } - } - } catch (Exception e) { - logger.error("uploadFile fail, fileName = {},{}", fileName, e.getMessage(), e); - infoVo.setSuccess(false); - infoVo.setMsg(fileName + "上传失败,I/O流异常"); - returnList.add(infoVo); - } finally { - if (in != null) { - try { - in.close(); - } catch (IOException e) { - logger.error("InputStream close fail,e:{}", e.getMessage()); - } - } - if (file != null) { - file.delete(); - } - latch.countDown(); - } - }); - } - } - latch.await(); - writeJson(GsonUtil.getGson().toJson(returnList)); - } - - private Map writeFileToLocal(MultipartFile uploadFile, HttpServletRequest request, String fileName) { - String localPath = AdminUtil.getAbsolutePath(request, "upload/apk/" + Calendar.getInstance().getTimeInMillis()); - File src = new File(localPath); - if (!src.exists()) { - src.mkdirs(); - } - Map retMap = Maps.newHashMap(); - try { - File file = new File(src, fileName); - file.setExecutable(true); - file.setReadable(true); - file.setWritable(true); - uploadFile.transferTo(file); - if (file != null && file.exists()) { - InputStream in = new FileInputStream(file); - // 获取md5 - String md5 = DigestUtils.md5Hex(in); - in.close(); - logger.info("文件 = " + (localPath + "\\" + fileName) + " 文件md5 = " + md5); - - retMap.put("file", file); - retMap.put("md5", md5); - } - } catch (IOException e) { - logger.error("获取文件md5失败", e); - } - return retMap; - } - - /** - * 推送强制更新全服广播 - */ - /*@RequestMapping(value = "/sendVersionMsg", method = RequestMethod.POST) - @ResponseBody - public void sendVersionMsg() { - Attach attach = new Attach(); - attach.setFirst(Constant.DefMsgType.Version); - attach.setSecond(Constant.DefMsgType.ForceUpdateVersion); - sendSysMsgService.broadCastMsg(SystemConfig.secretaryUid, GsonUtil.getGson().toJson(attach)); - writeJson(true, "推送成功"); - }*/ -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasureAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasureAdminController.java deleted file mode 100644 index 90c604fc6..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasureAdminController.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.accompany.admin.controller.treasure; - -import com.accompany.admin.base.Pagination; -import com.accompany.admin.controller.BaseController; -import com.accompany.admin.params.treasure.TreasureRecordReq; -import com.accompany.admin.service.treasure.SeizeTreasureAdminService; -import com.accompany.business.vo.treasure.record.SeizeTreasureStaticVo; -import com.accompany.common.constant.SeizeTreasureConstant; -import com.accompany.common.model.PageReq; -import com.accompany.common.result.BusiResult; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.context.request.ServletWebRequest; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.Arrays; -import java.util.List; - -@RestController -@RequestMapping("/admin/seize-treasure") -public class SeizeTreasureAdminController extends BaseController { - @Autowired - private SeizeTreasureAdminService seizeTreasureAdminService; - - private static final List DEFAULT_POOL_TYPE_LIST = Arrays.asList( - SeizeTreasureConstant.PoolType.TREASURE, SeizeTreasureConstant.PoolType.TREASURE_DRAW_NUM, SeizeTreasureConstant.PoolType.FOREST); - - @GetMapping("/treasure/record/total") - public BusiResult getTreasureRecordTotal(TreasureRecordReq params) { - if (CollectionUtils.isEmpty(params.getPoolTypeList())) { - params.setPoolTypeList(DEFAULT_POOL_TYPE_LIST); - } - return new BusiResult<>(seizeTreasureAdminService.getRecordTotal(params)); - } - - @GetMapping("/treasure/record/day") - public Pagination getTreasureRecordDaily(TreasureRecordReq params, PageReq pageReq) { - if (CollectionUtils.isEmpty(params.getPoolTypeList())) { - params.setPoolTypeList(DEFAULT_POOL_TYPE_LIST); - } - return seizeTreasureAdminService.getRecordDaily(params, pageReq); - } - - @GetMapping("/treasure/record") - public Pagination getTreasureRecord(TreasureRecordReq params, PageReq pageReq) { - if (CollectionUtils.isEmpty(params.getPoolTypeList())) { - params.setPoolTypeList(DEFAULT_POOL_TYPE_LIST); - } - return seizeTreasureAdminService.getRecord(params, pageReq); - } - - /** - * 导出 - * - * @param params - * @param request - * @param response - */ - @ApiOperation("导出") - @GetMapping("/treasure/record/export") - public void export(TreasureRecordReq params, HttpServletRequest request, HttpServletResponse response) { - seizeTreasureAdminService.export(params, new ServletWebRequest(request, response)); - } -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasureConvertRecordAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasureConvertRecordAdminController.java deleted file mode 100644 index 204145a4b..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasureConvertRecordAdminController.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.accompany.admin.controller.treasure; - -import com.accompany.admin.service.treasure.SeizeTreasureConvertRecordAdminService; -import com.accompany.admin.vo.treasure.SeizeTreasureConvertRecordAdminVo; -import com.accompany.common.model.PageReq; -import com.accompany.common.result.PageResult; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @author: liaozetao - * @date: 2023/9/7 11:02 - * @description: - */ -@Api(tags = "兑换商店数据管理") -@RestController -@RequestMapping("/admin/seize-treasure/convert/record") -public class SeizeTreasureConvertRecordAdminController { - - @Autowired - private SeizeTreasureConvertRecordAdminService seizeTreasureConvertRecordAdminService; - - /** - * 分页 - * - * @param convertType - * @param req - * @return - */ - @ApiOperation("分页") - @GetMapping("page") - public PageResult page(Integer convertType, PageReq req) { - return new PageResult<>(seizeTreasureConvertRecordAdminService.page(convertType, req.getPage(), req.getPageSize())); - } -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasureCovertItemAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasureCovertItemAdminController.java deleted file mode 100644 index 3d2c2adea..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasureCovertItemAdminController.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.accompany.admin.controller.treasure; - -import com.accompany.admin.service.treasure.SeizeTreasureCovertItemAdminService; -import com.accompany.admin.vo.treasure.SeizeTreasureConvertItemAdminVo; -import com.accompany.common.model.PageReq; -import com.accompany.common.result.BusiResult; -import com.accompany.common.result.PageResult; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @author: liaozetao - * @date: 2023/9/5 18:21 - * @description: - */ -@Api(tags = "兑换商店管理") -@RestController -@RequestMapping("/admin/seize-treasure/convert/item") -public class SeizeTreasureCovertItemAdminController { - - @Autowired - private SeizeTreasureCovertItemAdminService seizeTreasureCovertItemAdminService; - - /** - * 分页 - * - * @param req - * @return - */ - @ApiOperation("分页") - @GetMapping("page") - public PageResult page(PageReq req) { - return new PageResult<>(seizeTreasureCovertItemAdminService.page(req.getPage(), req.getPageSize())); - } - - /** - * 保存 - * - * @param admin - * @return - */ - @ApiOperation("保存") - @PostMapping("save") - public BusiResult save(SeizeTreasureConvertItemAdminVo admin) { - seizeTreasureCovertItemAdminService.save(admin); - return BusiResult.success(); - } - - /** - * 删除 - * - * @param id - * @return - */ - @ApiOperation("删除") - @GetMapping("del") - public BusiResult del(Long id) { - seizeTreasureCovertItemAdminService.del(id); - return BusiResult.success(); - } - -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasurePoolDrawRecordAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasurePoolDrawRecordAdminController.java deleted file mode 100644 index d3f69e9d8..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasurePoolDrawRecordAdminController.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.accompany.admin.controller.treasure; - -import com.accompany.admin.service.treasure.SeizeTreasurePoolDrawRecordAdminService; -import com.accompany.admin.vo.treasure.SeizeTreasurePoolDrawRecordAdminVo; -import com.accompany.common.model.PageReq; -import com.accompany.common.result.PageResult; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @author: liaozetao - * @date: 2023/9/7 14:17 - * @description: - */ -@Api(tags = "兑换商店管理") -@RestController -@RequestMapping("/admin/seize-treasure/pool/draw/record") -public class SeizeTreasurePoolDrawRecordAdminController { - - @Autowired - private SeizeTreasurePoolDrawRecordAdminService seizeTreasurePoolDrawRecordAdminService; - - /** - * 用户数据查询-全奖池 - * - * @param startTime - * @param endTime - * @param erbanNo - * @param req - * @return - */ - @ApiOperation("用户数据查询-全奖池") - @GetMapping("totalPage") - public PageResult totalPage(String startTime, String endTime, Long erbanNo, PageReq req) { - return new PageResult<>(seizeTreasurePoolDrawRecordAdminService.totalPage(startTime, endTime, erbanNo, req.getPage(), req.getPageSize())); - } - -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasurePoolItemAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasurePoolItemAdminController.java deleted file mode 100644 index 87798c1b9..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasurePoolItemAdminController.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.accompany.admin.controller.treasure; - -import com.accompany.admin.controller.BaseController; -import com.accompany.admin.service.system.AdminUserService; -import com.accompany.admin.service.treasure.SeizeTreasurePoolItemAdminService; -import com.accompany.admin.vo.treasure.SeizeTreasurePoolItemAdminVo; -import com.accompany.admin.vo.treasure.SeizeTreasurePoolItemCountAdminVo; -import com.accompany.admin.vo.treasure.SeizeTreasurePoolItemDeployedAdminVo; -import com.accompany.business.model.treasure.SeizeTreasurePoolItem; -import com.accompany.common.model.PageReq; -import com.accompany.common.result.BusiResult; -import com.accompany.common.result.PageResult; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -/** - * @author: liaozetao - * @date: 2023/10/10 14:05 - * @description: - */ -@Api(tags = "奖池设置管理") -@RestController -@RequestMapping("/admin/seize-treasure/pool/item") -public class SeizeTreasurePoolItemAdminController extends BaseController { - - @Autowired - private SeizeTreasurePoolItemAdminService seizeTreasurePoolItemAdminService; - @Autowired - private AdminUserService adminUserService; - - /** - * 分页 - * - * @param req - * @return - */ - @ApiOperation("分页") - @GetMapping("page") - public PageResult page(String rewardName, Integer poolType, Integer poolGroup, Integer poolLevel, PageReq req) { - return new PageResult<>(seizeTreasurePoolItemAdminService.page(rewardName, poolType, poolGroup, poolLevel, req.getPage(), req.getPageSize())); - } - - /** - * 保存 - * - * @param poolItem - * @return - */ - @ApiOperation("保存") - @PostMapping("save") - public BusiResult save(SeizeTreasurePoolItem poolItem) { - int adminId = getAdminId(); - String adminName = adminUserService.getAdminName(adminId); - poolItem.setCreator(adminName); - seizeTreasurePoolItemAdminService.save(poolItem); - return BusiResult.success(); - } - - /** - * 发布 - * - * @param poolType - * @return - */ - @ApiOperation("发布") - @GetMapping("deploy") - public BusiResult deploy(@RequestParam("poolType") Integer poolType) { - seizeTreasurePoolItemAdminService.deploy(poolType); - return BusiResult.success(); - } - - /** - * 已发布奖池 - * - * @param poolType - * @return - */ - @ApiOperation("已发布奖池") - @GetMapping("deployed") - public BusiResult deployed(@RequestParam("poolType") Integer poolType) { - return BusiResult.success(seizeTreasurePoolItemAdminService.deployed(poolType)); - } - - /** - * 统计 - * - * @param poolType - * @param poolGroup - * @return - */ - @ApiOperation("统计") - @GetMapping("count") - public BusiResult count(@RequestParam("poolType") Integer poolType, @RequestParam("poolGroup") Integer poolGroup) { - return BusiResult.success(seizeTreasurePoolItemAdminService.count(poolType, poolGroup)); - } - - /** - * 删除 - * - * @param id - * @return - */ - @ApiOperation("删除") - @GetMapping("del") - public BusiResult del(Long id) { - seizeTreasurePoolItemAdminService.del(id); - return BusiResult.success(); - } -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasurePropAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasurePropAdminController.java deleted file mode 100644 index 4b17f326e..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasurePropAdminController.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.accompany.admin.controller.treasure; - -import com.accompany.admin.service.treasure.SeizeTreasurePropAdminService; -import com.accompany.business.model.treasure.SeizeTreasureProp; -import com.accompany.common.result.BusiResult; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -/** - * @author: liaozetao - * @date: 2023/9/6 11:53 - * @description: - */ -@Api(tags = "活动道具管理") -@RestController -@RequestMapping("/admin/seize-treasure/prop") -public class SeizeTreasurePropAdminController { - - @Autowired - private SeizeTreasurePropAdminService seizeTreasurePropAdminService; - - /** - * 列表 - * - * @param type - * @param level - * @return - */ - @ApiOperation("列表") - @GetMapping("list") - public BusiResult> list(Integer type, Integer level) { - return BusiResult.success(seizeTreasurePropAdminService.list(type, level)); - } -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasureRewardAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasureRewardAdminController.java deleted file mode 100644 index 550a60d55..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasureRewardAdminController.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.accompany.admin.controller.treasure; - -import com.accompany.admin.service.treasure.SeizeTreasureRewardAdminService; -import com.accompany.business.model.treasure.SeizeTreasureReward; -import com.accompany.common.model.PageReq; -import com.accompany.common.result.BusiResult; -import com.accompany.common.result.PageResult; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -/** - * @author: liaozetao - * @date: 2023/9/5 18:29 - * @description: - */ -@Api(tags = "奖品设置管理") -@RestController -@RequestMapping("/admin/seize-treasure/reward") -public class SeizeTreasureRewardAdminController { - - @Autowired - private SeizeTreasureRewardAdminService seizeTreasureRewardAdminService; - - /** - * 分页 - * - * @param req - * @return - */ - @ApiOperation("分页") - @GetMapping("page") - public PageResult page(PageReq req) { - return new PageResult<>(seizeTreasureRewardAdminService.page(req)); - } - - /** - * 保存 - * - * @param reward - * @return - */ - @ApiOperation("保存") - @PostMapping("save") - public BusiResult save(SeizeTreasureReward reward) { - seizeTreasureRewardAdminService.save(reward); - return BusiResult.success(); - } - - /** - * 列表 - * - * @return - */ - @ApiOperation("列表") - @GetMapping("list") - public BusiResult> list(String rewardType) { - return BusiResult.success(seizeTreasureRewardAdminService.list(rewardType)); - } - - /** - * 删除 - * - * @param id - * @return - */ - @ApiOperation("删除") - @GetMapping("del") - public BusiResult del(Long id) { - seizeTreasureRewardAdminService.del(id); - return BusiResult.success(); - } - -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasureUserPropRecordAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasureUserPropRecordAdminController.java deleted file mode 100644 index 43fed2dba..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/treasure/SeizeTreasureUserPropRecordAdminController.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.accompany.admin.controller.treasure; - -import com.accompany.admin.service.treasure.SeizeTreasureUserPropRecordAdminService; -import com.accompany.admin.vo.treasure.SeizeTreasureUserPropRecordAdminVo; -import com.accompany.common.model.PageReq; -import com.accompany.common.result.PageResult; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.context.request.ServletWebRequest; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * @author: liaozetao - * @date: 2023/9/7 16:18 - * @description: - */ -@Api(tags = "夺宝精灵-用户道具记录管理") -@RestController -@RequestMapping("/admin/seize-treasure/user/prop/record") -public class SeizeTreasureUserPropRecordAdminController { - - @Autowired - private SeizeTreasureUserPropRecordAdminService seizeTreasureUserPropRecordAdminService; - - /** - * 分页 - * - * @param erbanNo - * @param startTime - * @param endTime - * @param req - * @return - */ - @ApiOperation("分页") - @GetMapping("page") - public PageResult page(Long erbanNo, String startTime, String endTime, PageReq req) { - return new PageResult<>(seizeTreasureUserPropRecordAdminService.page(erbanNo, startTime, endTime, req.getPage(), req.getPageSize())); - } - - /** - * 导出 - * - * @param erbanNo - * @param startTime - * @param endTime - * @param request - * @param response - */ - @ApiOperation("导出") - @PostMapping("export") - public void export(Long erbanNo, String startTime, String endTime, HttpServletRequest request, HttpServletResponse response) { - seizeTreasureUserPropRecordAdminService.export(erbanNo, startTime, endTime, new ServletWebRequest(request, response)); - } -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/WriteAcheController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/WriteAcheController.java deleted file mode 100644 index 75f2dc942..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/WriteAcheController.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.accompany.admin.controller.user; - -import com.accompany.admin.service.WriteAcheService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; - -/** - * Created by Administrator on 2018/1/13. - */ -@Controller -@RequestMapping("/admin/write/*") -@ResponseBody -public class WriteAcheController { - @Autowired - private WriteAcheService writeAcheService; - - @RequestMapping("/startWriteAche") - @ResponseBody - public int WriteAche(){ - return writeAcheService.startWriteAche(); - } -} diff --git a/accompany-base/accompany-basic/accompany-basic-sdk/src/main/java/com/accompany/core/vo/UserVo.java b/accompany-base/accompany-basic/accompany-basic-sdk/src/main/java/com/accompany/core/vo/UserVo.java index c27fe7d29..22295bd82 100644 --- a/accompany-base/accompany-basic/accompany-basic-sdk/src/main/java/com/accompany/core/vo/UserVo.java +++ b/accompany-base/accompany-basic/accompany-basic-sdk/src/main/java/com/accompany/core/vo/UserVo.java @@ -2,8 +2,6 @@ package com.accompany.core.vo; import com.accompany.common.annotation.ReplaceAppDomain; import com.accompany.core.annotation.I18n; -import com.accompany.core.model.RegionInfo; -import com.accompany.core.vo.audiocard.UserAudioCardVo; import com.accompany.core.vo.car.CarportVo; import com.accompany.core.vo.headwear.UserHeadwearVo; import com.accompany.core.vo.live.LiveUserInfoSkillVo; @@ -150,8 +148,6 @@ public class UserVo { */ private String micNickColor; - private UserAudioCardVo audioCard; - @ApiModelProperty(value = "标签") private List labels; @@ -170,18 +166,12 @@ public class UserVo { @ApiModelProperty(value = "是否为主播:是-true,否-false") private Boolean isAnchor; - @ApiModelProperty(value = "是否开通粉丝团:是-true,否-false") - private Boolean hasAnchorFansTeam; @ApiModelProperty(value = "是否为当前房间的主播:是-true,否-false") private Boolean isCurrentRoomAnchor; @ApiModelProperty(value = "当前房间是否开通粉丝团:是-true,否-false") private Boolean hasFansTeamCurrentRoom; @ApiModelProperty(value = "粉丝团成员总数") private Integer anchorFansNum; - @ApiModelProperty(value = "用户是否为当前房间的粉丝团成员:是-true,否-false") - private Boolean isAnchorFans; - @ApiModelProperty(value = "粉丝团成员等级") - private Integer fansLevelSeq; @ApiModelProperty(value = "是否来自需要打招呼的渠道") private boolean fromSayHelloChannel; diff --git a/accompany-base/accompany-basic/accompany-basic-sdk/src/main/java/com/accompany/core/vo/audiocard/UserAudioCardVo.java b/accompany-base/accompany-basic/accompany-basic-sdk/src/main/java/com/accompany/core/vo/audiocard/UserAudioCardVo.java deleted file mode 100644 index 2ae242263..000000000 --- a/accompany-base/accompany-basic/accompany-basic-sdk/src/main/java/com/accompany/core/vo/audiocard/UserAudioCardVo.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.accompany.core.vo.audiocard; - -import lombok.Data; - -@Data -public class UserAudioCardVo { - - private Long uid; - private String audioUrl; - private Integer second; - private Byte status; - -} diff --git a/accompany-base/accompany-basic/accompany-basic-service/src/main/java/com/accompany/core/service/account/AccountService.java b/accompany-base/accompany-basic/accompany-basic-service/src/main/java/com/accompany/core/service/account/AccountService.java index ef034b3e4..a187981e3 100644 --- a/accompany-base/accompany-basic/accompany-basic-service/src/main/java/com/accompany/core/service/account/AccountService.java +++ b/accompany-base/accompany-basic/accompany-basic-service/src/main/java/com/accompany/core/service/account/AccountService.java @@ -4,7 +4,6 @@ import cn.hutool.core.util.StrUtil; import com.accompany.common.constant.ApplicationConstant; import com.accompany.common.netease.neteaseacc.result.TokenRet; import com.accompany.common.redis.RedisKey; -import com.accompany.common.utils.AppVersionUtil; import com.accompany.common.utils.BlankUtil; import com.accompany.common.utils.CommonUtil; import com.accompany.common.utils.GetTimeUtils; @@ -247,14 +246,6 @@ public class AccountService extends ServiceImpl { return resultList; } - public boolean checkAppVersion(Long uid, String appVersion) { - Account account = getById(uid); - if (account == null) { - return false; - } - return AppVersionUtil.compareVersion(account.getAppVersion(), appVersion) > 0; - } - } diff --git a/accompany-base/accompany-common/src/main/java/com/accompany/common/status/BusiStatus.java b/accompany-base/accompany-common/src/main/java/com/accompany/common/status/BusiStatus.java index e757064b1..d2b117309 100644 --- a/accompany-base/accompany-common/src/main/java/com/accompany/common/status/BusiStatus.java +++ b/accompany-base/accompany-common/src/main/java/com/accompany/common/status/BusiStatus.java @@ -729,13 +729,13 @@ public enum BusiStatus { THE_MODE_IN_WHICH_THE_INVITED_ROOM_IS_LOCATED_CANNOT_PARTICIPATE_IN_CROSS_ROOM_PK(500, "被邀请房间所处模式不能参与跨房PK"), NO_CORRESPONDING_RESOURCE_DATA_OBTAINED(500, "未獲取到對應資源數據"), SUGGESTION_VALUE_STATUS_UNKNOWN_SUGGESTION(500, "suggestion值狀態未知%s"), - THE_CURRENT_ROOM_MODE_CANNOT_ENABLE_BLIND_DATES(500, "当前房间所处模式不能开启相亲"), + THE_CURRENT_ROOM_MODE_CANNOT_ENABLE_BLIND_DATES(500, "当前房间所處模式不能开启相亲"), UNABLE_TO_OBTAIN_THE_PK_FOR_THIS_MATCH(500, "获取不到该场PK!"), THE_PHONE_NUMBER_HAS_BEEN_REGISTERED(500, "手機號碼已經註冊"), ABNORMAL_ACTIVITY_LOTTERY_STATUS(500, "活動開獎狀態異常"), TOPIC_ID_CANNOT_BE_EMPTY(500, "话题id不能为空!"), THE_CURRENT_NOBLE_LEVEL_IS_INSUFFICIENT_SO_WE_CANNOT_APPLY_FOR_A_NAMEPLATE_FOR_THIS_LEVEL(500, "當前貴族等級不足,無法申請該等級銘牌哦~"), - THE_OPPONENT_IS_IN_A_PK_PLEASE_INITIATE_THE_CHALLENGE_LATER(500, "对方PK中,请稍后再发起挑战"), + THE_OPPONENT_IS_IN_A_PK_PLEASE_INITIATE_THE_CHALLENGE_LATER(500, "對方PK中,请稍后再发起挑战"), THE_STATUS_OF_THE_PK_PARTICIPANTS_IN_THIS_GAME_IS_ABNORMAL(500, "该场pk参与方状态异常!"), THE_TOTAL_AMOUNT_OF_ROOM_RED_ENVELOPES_CANNOT_EXCEED_CONFIG_GETREDENVELOPEMAXAMOUNT(500, "房间红包总金额不能超过%s"), THE_ROOM_IS_ALREADY_IN_THE_GAME(500, "房间已经在游戏中啦~"), @@ -815,7 +815,7 @@ public enum BusiStatus { THE_TOTAL_AMOUNT_OF_RED_ENVELOPES_IN_THE_LIVING_ROOM_CANNOT_EXCEED_CONFIG_GETREDENVELOPEMAXAMOUNT(500, "房間紅包總金額不能超過%s"), AT_LEAST_ONE_ITEM_NEEDS_TO_BE_SELECTED(500, "至少需要選中一項"), THE_TOTAL_AMOUNT_OF_ROOM_RED_ENVELOPES_CANNOT_BE_LESS_THAN_CONFIG_GETREDENVELOPEMINAMOUNT(500, "房间红包总金额不能低于%s"), - YOUR_ROOM_IS_IN_A_MODE_WHERE_CROSS_ROOM_PK_CANNOT_BE_INITIATED(500, "您的房间所处模式不能发起跨房PK"), + YOUR_ROOM_IS_IN_A_MODE_WHERE_CROSS_ROOM_PK_CANNOT_BE_INITIATED(500, "您的房间所處模式不能发起跨房PK"), ILLEGAL_ACCOUNT(500, "非法賬戶"), CURRENTLY_UNABLE_TO_PERFORM_PICK_UP_OPERATION(500, "當前無法進行提領操作"), THE_LENGTH_OF_THE_RED_ENVELOPE_TITLE_CANNOT_EXCEED_10(500, "紅包標題長度不能超過10"), @@ -841,9 +841,7 @@ public enum BusiStatus { INVITE_TIME_OUT(500, "邀请过期啦!"), - AT_LEAST_ONE_CARD(5210, " Please select at least one tarot card "), CHARGE_PROD_NOT_ALLOWED(5211, " The product has been taken down and cannot be recharged "), - TAROT_CHARGE_LIMIT(5212, " Today, Lucky Tarot recharge consumption has reached its limit "), PARTITION_ERROR(500, "暂不可用"), PARTITION_ERROR_INTO_ROOM(500, "因區域不同,你無法進入該房間"), diff --git a/accompany-base/accompany-core/src/main/java/com/accompany/common/config/SystemConfig.java b/accompany-base/accompany-core/src/main/java/com/accompany/common/config/SystemConfig.java index d0cde0010..a487833cf 100644 --- a/accompany-base/accompany-core/src/main/java/com/accompany/common/config/SystemConfig.java +++ b/accompany-base/accompany-core/src/main/java/com/accompany/common/config/SystemConfig.java @@ -37,9 +37,6 @@ public class SystemConfig { */ public static String flowTeamGenInviteCodeUid; - // 线性奖池中,可用的奖品线最小数 - public static Long minAvailableLinearlyPoolLineCount = 2L; - public static Map phoneRegex; public void setPhoneRegex(Map phoneRegex) { @@ -74,9 +71,9 @@ public class SystemConfig { SystemConfig.userInfoCompleteInterceptWhiteList = userInfoCompleteInterceptWhiteList; } - public void setMinAvailableLinearlyPoolLineCount(Long minAvailableLinearlyPoolLineCount) { - SystemConfig.minAvailableLinearlyPoolLineCount = minAvailableLinearlyPoolLineCount; - } + // public void setMinAvailableLinearlyPoolLineCount(Long minAvailableLinearlyPoolLineCount) { + // SystemConfig.minAvailableLinearlyPoolLineCount = minAvailableLinearlyPoolLineCount; + // } @Component @Lazy(value = false) diff --git a/accompany-base/accompany-core/src/main/java/com/accompany/common/constant/AnchorFansLevelExperienceArr.java b/accompany-base/accompany-core/src/main/java/com/accompany/common/constant/AnchorFansLevelExperienceArr.java deleted file mode 100644 index e3df2fc3f..000000000 --- a/accompany-base/accompany-core/src/main/java/com/accompany/common/constant/AnchorFansLevelExperienceArr.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.accompany.common.constant; - -/** - * 主播粉丝团等级经验配置 - */ -public class AnchorFansLevelExperienceArr { - public static Long[] exper; -} diff --git a/accompany-base/accompany-core/src/main/java/com/accompany/common/constant/Constant.java b/accompany-base/accompany-core/src/main/java/com/accompany/common/constant/Constant.java index 3991efb13..ee12ef4eb 100644 --- a/accompany-base/accompany-core/src/main/java/com/accompany/common/constant/Constant.java +++ b/accompany-base/accompany-core/src/main/java/com/accompany/common/constant/Constant.java @@ -3617,11 +3617,6 @@ public class Constant { public static final Byte VIP = 2; } - /** - * 敏感信息des加密的客户端版本号 - */ - public final static String ENCRYPT_SENSITIVE_INFO_APP_VERSION = "1.0.0"; - /** * PK类型 diff --git a/accompany-base/accompany-core/src/main/java/com/accompany/common/constant/SeizeTreasureConstant.java b/accompany-base/accompany-core/src/main/java/com/accompany/common/constant/SeizeTreasureConstant.java deleted file mode 100644 index 54554c3cd..000000000 --- a/accompany-base/accompany-core/src/main/java/com/accompany/common/constant/SeizeTreasureConstant.java +++ /dev/null @@ -1,314 +0,0 @@ -package com.accompany.common.constant; - -import org.springframework.util.StringUtils; - -import javax.annotation.Nullable; -import java.util.Arrays; -import java.util.List; - -public interface SeizeTreasureConstant { - - interface ActInfo { - String ACT_NAME = "seize_treasure"; - String ACT_DESC = "夺宝精灵"; - } - - interface PoolType { - /** - * 密藏奖池 - */ - Integer TREASURE = 1; - /** - * 幸运值奖池 - */ - Integer TREASURE_DRAW_NUM = 2; - /** - * 森林奖池 - */ - Integer FOREST = 3; - /** - * 合成奖池 - */ - Integer COMPOUND = 4; - } - - interface TreasurePoolGroup { - /** - * 基础奖池 - */ - Integer BASE = 1; - /** - * 高级奖池 - */ - Integer HIGH = 2; - } - - interface ForestPoolLevel { - /** - * 基础奖池 - */ - Integer BASE = 1; - /** - * 中级奖池 - */ - Integer MIDDLE = 2; - /** - * 高级奖池 - */ - Integer HIGH = 3; - } - - interface DrawUserInfoField { - // 当前抽奖次数 - String CURRENT_DRAW_NUM_FIELD = "currentDrawNum"; - // 需要的抽奖次数 - String NEED_DRAW_NUM_FIELD = "needDrawNum"; - // 上轮差值 - String LESS_DRAW_NUM_FIELD = "lessDrawNum"; - } - - interface ActPropsId { - /** - * 精灵碎片 - */ - Long CHIP = 1001001L; - - /** - * 初级精灵球 - */ - Long LOW_LEVEL_BALL = 1002001L; - /** - * 中级精灵球 - */ - Long MIDDLE_LEVEL_BALL = 1002002L; - /** - * 高级精灵球 - */ - Long HIGH_LEVEL_BALL = 1002003L; - - /** - * 初级-龙 - */ - Long LOW_LEVEL_DRAGON = 1003001L; - /** - * 初级-猪 - */ - Long LOW_LEVEL_PIG = 1003002L; - /** - * 初级-兔 - */ - Long LOW_LEVEL_RABBIT = 1003003L; - /** - * 初级-龟 - */ - Long LOW_LEVEL_TURTLE = 1003004L; - /** - * 初级-虎 - */ - Long LOW_LEVEL_TIGER = 1003005L; - List lowElfIdList = Arrays.asList(LOW_LEVEL_DRAGON, LOW_LEVEL_PIG, LOW_LEVEL_RABBIT); - /** - * 中级-龙 - */ - Long MIDDLE_LEVEL_DRAGON = 1004001L; - /** - * 中级-猪 - */ - Long MIDDLE_LEVEL_PIG = 1004002L; - /** - * 中级-兔 - */ - Long MIDDLE_LEVEL_RABBIT = 1004003L; - /** - * 中级-龟 - */ - Long MIDDLE_LEVEL_TURTLE = 1004004L; - /** - * 中级-虎 - */ - Long MIDDLE_LEVEL_TIGER = 1004005L; - List middleElfIdList = Arrays.asList(MIDDLE_LEVEL_DRAGON, MIDDLE_LEVEL_PIG, MIDDLE_LEVEL_RABBIT, MIDDLE_LEVEL_TURTLE, MIDDLE_LEVEL_TIGER); - - /** - * 高级-龙 - */ - Long HIGH_LEVEL_DRAGON = 1005001L; - /** - * 高级-猪 - */ - Long HIGH_LEVEL_PIG = 1005002L; - /** - * 高级-兔 - */ - Long HIGH_LEVEL_RABBIT = 1005003L; - /** - * 高级-龟 - */ - Long HIGH_LEVEL_TURTLE = 1005004L; - /** - * 高级-虎 - */ - Long HIGH_LEVEL_TIGER = 1005005L; - List highElfIdList = Arrays.asList(HIGH_LEVEL_DRAGON, HIGH_LEVEL_PIG, HIGH_LEVEL_RABBIT); - - } - - interface PropType { - /** - * 碎片 - */ - Integer CHIP = 1; - /** - * 精灵球 - */ - Integer BALL = 2; - /** - * 精灵 - */ - Integer ELF = 3; - } - - interface PropLevel { - /** - * 1级 - */ - Integer L1 = 1; - /** - * 2级 - */ - Integer L2 = 2; - /** - * 3级 - */ - Integer L3 = 3; - } - - interface PropRecordType { - - /** - * 索要 - */ - Integer ASK_FOR = 1; - - /** - * 赠予 - */ - Integer SEND = 2; - - /** - * 获赠 - */ - Integer RECEIVE = 3; - - /** - * 合成获得 - */ - Integer COMPOUND_GAIN = 4; - - /** - * 合成消耗 - */ - Integer COMPOUND_EXPEND = 5; - - /** - * 兑换消耗 - */ - Integer CONVERT_EXPEND = 6; - - /** - * 分解消耗 - */ - Integer SALVAGE_EXPEND = 7; - } - - interface ConvertType { - /** - * 精灵兑换 - */ - Integer ELF = 1; - /** - * 碎片兑换 - */ - Integer CHIP = 2; - } - - interface OrderType { - /** - * 奖池order升序 - */ - Integer POOL = 1; - /** - * 礼物价值降序 - */ - Integer REWARD = 2; - } - - interface RedisKey { - /** - * 用户活动缓存 - */ - String USER_INFO_KEY = "user_info"; - /** - * 用户活动道具初始化锁 - */ - String USER_PROP_INIT_LOCK_KEY = "user_prop:init_lock"; - /** - * 用户活动道具初始化锁 - */ - String POOL_INFO_KEY = "pool_info"; - /** - * 夺宝奖池 - */ - String POOL_KEY = "pool"; - /** - * 奖池初始化锁 - */ - String POOL_INIT_LOCK_KEY = "pool:init_lock"; - /** - * 幸运值奖池 - */ - String DRAW_NUM_POOL_KEY = "pool:draw_num"; - /** - * 幸运奖池初始化锁 - */ - String DRAW_NUM_POOL_INIT_LOCK_KEY = "pool:draw_num:init_lock"; - /** - * 森林奖池 - */ - String FOREST_POOL_KEY = "pool:forest"; - /** - * 森林奖池初始化锁 - */ - String FOREST_POOL_INIT_LOCK_KEY = "pool:forest:init_lock"; - /** - * 精灵合成奖池 - */ - String ELF_COMPOUND_POOL_KEY = "pool:elf_compound"; - /** - * 精灵合成奖池初始化锁 - */ - String ELF_COMPOUND_POOL_INIT_LOCK_KEY = "pool:elf_compound:init_lock"; - /** - * 产出榜单 - */ - String VALUE_RANK = "rank:value"; - - /** - * @param str - * @return - */ - static String getActRedisKey(@Nullable String... str) { - StringBuilder sb = new StringBuilder("peko:seize_treasure"); - - if (null != str && str.length > 0) { - for (String suf : str) { - // 仅拼接有内容的字符串 - if (StringUtils.hasText(suf)) { - sb.append(":").append(suf); - } - } - } - return sb.toString(); - } - } -} diff --git a/accompany-base/accompany-core/src/main/java/com/accompany/common/redis/RedisKey.java b/accompany-base/accompany-core/src/main/java/com/accompany/common/redis/RedisKey.java index 4188e9703..1b2183acf 100644 --- a/accompany-base/accompany-core/src/main/java/com/accompany/common/redis/RedisKey.java +++ b/accompany-base/accompany-core/src/main/java/com/accompany/common/redis/RedisKey.java @@ -745,7 +745,7 @@ public enum RedisKey { /** * 塔罗每日充值金额 **/ - daily_tarot_cost, + // daily_tarot_cost, /** * 相亲开启新一轮下麦锁 diff --git a/accompany-base/accompany-core/src/main/java/com/accompany/common/utils/PicAddTextAnchorFansMpMarkUtils.java b/accompany-base/accompany-core/src/main/java/com/accompany/common/utils/PicAddTextAnchorFansMpMarkUtils.java deleted file mode 100644 index 5833333f8..000000000 --- a/accompany-base/accompany-core/src/main/java/com/accompany/common/utils/PicAddTextAnchorFansMpMarkUtils.java +++ /dev/null @@ -1,187 +0,0 @@ -package com.accompany.common.utils; - -import com.accompany.common.constant.Constant; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.tuple.ImmutablePair; -import org.springframework.core.io.ClassPathResource; - -import javax.imageio.ImageIO; -import javax.imageio.stream.ImageOutputStream; -import java.awt.*; -import java.awt.image.BufferedImage; -import java.io.*; - -/** - * 粉丝团铭牌生成 - */ -@Slf4j -public class PicAddTextAnchorFansMpMarkUtils { - - public static final Color color = new Color(255, 255, 255, 255); - - //铭牌以四个汉字为基准的文字长度 - public static final int LEN_CHARACTERS_4 = 86; - - //铭牌以汉字为基准对应的x坐标 - public static final int MP_T_CHARACTER_LOCATION_X = 45; - //铭牌以汉字为基准对应的y坐标 - public static final int MP_T_CHARACTER_LOCATION_Y = 28; - - //4字等级坐标 - public static final int LEVEL_LOCATION_X_4 = 15; - public static final int LEVEL_LOCATION_Y_ACTIVE = 30; - public static final int LEVEL_LOCATION_Y_NORMAL_NEGATIVE = 29; - //等级基准长度9 - public static final int LEN_LEVEL = 14; - - - public static BufferedImage addTextToPic(Byte mpStatus, InputStream inputStream, String text, Integer level, Font wordFontS, Font levelFontS) throws IOException { - BufferedImage bufImg = null; - try { - Image srcImg = ImageIO.read(inputStream); - int srcImgWidth = srcImg.getWidth(null);//获取图片的宽 - int srcImgHeight = srcImg.getHeight(null);//获取图片的高 - // 加水印 - bufImg = new BufferedImage(srcImgWidth, srcImgHeight, BufferedImage.TYPE_INT_ARGB_PRE); - Graphics2D g = bufImg.createGraphics(); - g.drawImage(srcImg, 0, 0, srcImgWidth, srcImgHeight, null); - g.setColor(color); //根据图片的背景设置水印颜色 - g.setFont(wordFontS); //设置字体 - //消除文字锯齿 - g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); - //消除画图锯齿字符串 - g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - //计算文字对应的坐标 - ImmutablePair location = calculateLocation(text, wordFontS); - //计算等级对应的坐标 - ImmutablePair levelLocation = calculateLevelLocation(level, levelFontS, mpStatus); - g.drawString(text, location.getLeft(), location.getRight()); - g.setFont(levelFontS); - g.drawString(String.valueOf(level), levelLocation.getLeft(), levelLocation.getRight()); - g.dispose(); - } finally { - if (inputStream != null) inputStream.close(); - } - return bufImg; - } - - - /** - * 计算徽章或铭牌文字坐标 - * - * @param text - * @param fontS - * @return - */ - public static ImmutablePair calculateLocation(String text, Font fontS) { - //铭牌坐标计算 - int x = (LEN_CHARACTERS_4 - getTextWidth(fontS, text)) / 2; - return ImmutablePair.of(MP_T_CHARACTER_LOCATION_X + x, MP_T_CHARACTER_LOCATION_Y); - } - - /** - * 计算等级坐标 - * - * @param levelSeq - * @param mpStatus - * @return - */ - public static ImmutablePair calculateLevelLocation(Integer levelSeq, Font fonts, Byte mpStatus) { - int len = getTextWidth(fonts, String.valueOf(levelSeq)); - int x = LEVEL_LOCATION_X_4; - if (len < LEN_LEVEL) { - x = x + (LEN_LEVEL - len) / 2; - } - if (Constant.AnchorFansMemberMpStatus.active.equals(mpStatus)) { - return ImmutablePair.of(x, LEVEL_LOCATION_Y_ACTIVE); - } else { - return ImmutablePair.of(x, LEVEL_LOCATION_Y_NORMAL_NEGATIVE); - } - } - - public static int getTextWidth(Font fontS, String content) { - return PicAddTextMarkUtils.getTextWidth(fontS, content); - } - - private static Font loadIconFont(String fontStyle) throws IOException { - Font font = null; - ClassPathResource resource = new ClassPathResource(fontStyle); - InputStream inputStream = resource.getInputStream(); - try { - font = Font.createFont(Font.TRUETYPE_FONT, inputStream); - } catch (Exception e) { - log.error(e.getMessage(), e); - } - try { - inputStream.close(); - } catch (Exception ignored) { - } - assert font != null; - return font.deriveFont(18f); - } - - private static Font loadLevelFont(String fontStyle) throws IOException { - Font font = null; - ClassPathResource resource = new ClassPathResource(fontStyle); - InputStream inputStream = resource.getInputStream(); - try { - font = Font.createFont(Font.TRUETYPE_FONT, inputStream); - } catch (Exception e) { - log.error(e.getMessage(), e); - } - try { - inputStream.close(); - } catch (Exception ignored) { - } - assert font != null; - return font.deriveFont(24f); - } - - public static Font loadWordFont(String fontStyle, float fontSize) throws IOException { - Font font = null; - ClassPathResource resource = new ClassPathResource(fontStyle); - InputStream inputStream = resource.getInputStream(); - try { - font = Font.createFont(Font.TRUETYPE_FONT, inputStream); - } catch (Exception e) { - log.error(e.getMessage(), e); - } - try { - inputStream.close(); - } catch (Exception e) { - log.error(e.getMessage(), e); - } - assert font != null; - return font.deriveFont(fontSize); - } - - public static void main(String[] args) throws Exception { - testAddTextToPic(); - } - - public static void testAddTextToPic() throws Exception { - try (InputStream input = FileUtils.downloadFileInputStream("http://img.uat.lecheng163.com/FsffrTt6ittnFttLVPVxsQnF4VCB?imageslim")) { - InputStream uploadStream = null; - FileOutputStream downloadFile = null; - try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); ImageOutputStream imOut = ImageIO.createImageOutputStream(baos);) { - Font levelFont = loadLevelFont(PicAddTextMarkUtils.ZH_EN_WORD_FONT_STYLE); - Font loadIconFont = loadIconFont(PicAddTextMarkUtils.ZH_EN_WORD_FONT_STYLE); - BufferedImage bufImg = PicAddTextAnchorFansMpMarkUtils.addTextToPic((byte) 2, input, "粉丝高级", 8, loadIconFont, levelFont); - if (bufImg == null) return; - ImageIO.write(bufImg, "png", imOut); - uploadStream = new ByteArrayInputStream(baos.toByteArray()); - int index; - byte[] bytes = new byte[1024]; - downloadFile = new FileOutputStream("C:\\Users\\demo\\Desktop\\2022-03\\mp\\mppptest.png"); - while ((index = uploadStream.read(bytes)) != -1) { - downloadFile.write(bytes, 0, index); - downloadFile.flush(); - } - } finally { - if (downloadFile != null) downloadFile.close(); - if (uploadStream != null) uploadStream.close(); - } - } - System.out.println("结束运行....."); - } -} diff --git a/accompany-base/accompany-payment/accompany-payment-sdk/src/main/java/com/accompany/payment/model/LuckyTarotRecord.java b/accompany-base/accompany-payment/accompany-payment-sdk/src/main/java/com/accompany/payment/model/LuckyTarotRecord.java deleted file mode 100644 index b3ad1a3d3..000000000 --- a/accompany-base/accompany-payment/accompany-payment-sdk/src/main/java/com/accompany/payment/model/LuckyTarotRecord.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.accompany.payment.model; - -import java.util.Date; - -public class LuckyTarotRecord { - private String recordId; - - private Long uid; - - private Long roomUid; - - private String selectdNo; - - private Integer selectdNoNum; - - private String chargeProdId; - - private Long chargeMoney; - - private Long goldNum; - - private String chargeRecordId; - - private Integer drawNum; - - private Byte drawStatus; - - private Date createTime; - - private Date updateTime; - - public String getRecordId() { - return recordId; - } - - public void setRecordId(String recordId) { - this.recordId = recordId == null ? null : recordId.trim(); - } - - public Long getUid() { - return uid; - } - - public void setUid(Long uid) { - this.uid = uid; - } - - public Long getRoomUid() { - return roomUid; - } - - public void setRoomUid(Long roomUid) { - this.roomUid = roomUid; - } - - public String getSelectdNo() { - return selectdNo; - } - - public void setSelectdNo(String selectdNo) { - this.selectdNo = selectdNo == null ? null : selectdNo.trim(); - } - - public Integer getSelectdNoNum() { - return selectdNoNum; - } - - public void setSelectdNoNum(Integer selectdNoNum) { - this.selectdNoNum = selectdNoNum; - } - - public String getChargeProdId() { - return chargeProdId; - } - - public void setChargeProdId(String chargeProdId) { - this.chargeProdId = chargeProdId == null ? null : chargeProdId.trim(); - } - - public Long getChargeMoney() { - return chargeMoney; - } - - public void setChargeMoney(Long chargeMoney) { - this.chargeMoney = chargeMoney; - } - - public Long getGoldNum() { - return goldNum; - } - - public void setGoldNum(Long goldNum) { - this.goldNum = goldNum; - } - - public String getChargeRecordId() { - return chargeRecordId; - } - - public void setChargeRecordId(String chargeRecordId) { - this.chargeRecordId = chargeRecordId == null ? null : chargeRecordId.trim(); - } - - public Integer getDrawNum() { - return drawNum; - } - - public void setDrawNum(Integer drawNum) { - this.drawNum = drawNum; - } - - public Byte getDrawStatus() { - return drawStatus; - } - - public void setDrawStatus(Byte drawStatus) { - this.drawStatus = drawStatus; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } -} \ No newline at end of file diff --git a/accompany-base/accompany-payment/accompany-payment-sdk/src/main/java/com/accompany/payment/model/LuckyTarotRecordExample.java b/accompany-base/accompany-payment/accompany-payment-sdk/src/main/java/com/accompany/payment/model/LuckyTarotRecordExample.java deleted file mode 100644 index 9b8a14505..000000000 --- a/accompany-base/accompany-payment/accompany-payment-sdk/src/main/java/com/accompany/payment/model/LuckyTarotRecordExample.java +++ /dev/null @@ -1,1041 +0,0 @@ -package com.accompany.payment.model; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class LuckyTarotRecordExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - private Integer limit; - - private Integer offset; - - public LuckyTarotRecordExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - public void setLimit(Integer limit) { - this.limit = limit; - } - - public Integer getLimit() { - return limit; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } - - public Integer getOffset() { - return offset; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andRecordIdIsNull() { - addCriterion("record_id is null"); - return (Criteria) this; - } - - public Criteria andRecordIdIsNotNull() { - addCriterion("record_id is not null"); - return (Criteria) this; - } - - public Criteria andRecordIdEqualTo(String value) { - addCriterion("record_id =", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdNotEqualTo(String value) { - addCriterion("record_id <>", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdGreaterThan(String value) { - addCriterion("record_id >", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdGreaterThanOrEqualTo(String value) { - addCriterion("record_id >=", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdLessThan(String value) { - addCriterion("record_id <", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdLessThanOrEqualTo(String value) { - addCriterion("record_id <=", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdLike(String value) { - addCriterion("record_id like", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdNotLike(String value) { - addCriterion("record_id not like", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdIn(List values) { - addCriterion("record_id in", values, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdNotIn(List values) { - addCriterion("record_id not in", values, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdBetween(String value1, String value2) { - addCriterion("record_id between", value1, value2, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdNotBetween(String value1, String value2) { - addCriterion("record_id not between", value1, value2, "recordId"); - return (Criteria) this; - } - - public Criteria andUidIsNull() { - addCriterion("uid is null"); - return (Criteria) this; - } - - public Criteria andUidIsNotNull() { - addCriterion("uid is not null"); - return (Criteria) this; - } - - public Criteria andUidEqualTo(Long value) { - addCriterion("uid =", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotEqualTo(Long value) { - addCriterion("uid <>", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidGreaterThan(Long value) { - addCriterion("uid >", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidGreaterThanOrEqualTo(Long value) { - addCriterion("uid >=", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidLessThan(Long value) { - addCriterion("uid <", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidLessThanOrEqualTo(Long value) { - addCriterion("uid <=", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidIn(List values) { - addCriterion("uid in", values, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotIn(List values) { - addCriterion("uid not in", values, "uid"); - return (Criteria) this; - } - - public Criteria andUidBetween(Long value1, Long value2) { - addCriterion("uid between", value1, value2, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotBetween(Long value1, Long value2) { - addCriterion("uid not between", value1, value2, "uid"); - return (Criteria) this; - } - - public Criteria andRoomUidIsNull() { - addCriterion("room_uid is null"); - return (Criteria) this; - } - - public Criteria andRoomUidIsNotNull() { - addCriterion("room_uid is not null"); - return (Criteria) this; - } - - public Criteria andRoomUidEqualTo(Long value) { - addCriterion("room_uid =", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidNotEqualTo(Long value) { - addCriterion("room_uid <>", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidGreaterThan(Long value) { - addCriterion("room_uid >", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidGreaterThanOrEqualTo(Long value) { - addCriterion("room_uid >=", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidLessThan(Long value) { - addCriterion("room_uid <", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidLessThanOrEqualTo(Long value) { - addCriterion("room_uid <=", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidIn(List values) { - addCriterion("room_uid in", values, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidNotIn(List values) { - addCriterion("room_uid not in", values, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidBetween(Long value1, Long value2) { - addCriterion("room_uid between", value1, value2, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidNotBetween(Long value1, Long value2) { - addCriterion("room_uid not between", value1, value2, "roomUid"); - return (Criteria) this; - } - - public Criteria andSelectdNoIsNull() { - addCriterion("selectd_no is null"); - return (Criteria) this; - } - - public Criteria andSelectdNoIsNotNull() { - addCriterion("selectd_no is not null"); - return (Criteria) this; - } - - public Criteria andSelectdNoEqualTo(String value) { - addCriterion("selectd_no =", value, "selectdNo"); - return (Criteria) this; - } - - public Criteria andSelectdNoNotEqualTo(String value) { - addCriterion("selectd_no <>", value, "selectdNo"); - return (Criteria) this; - } - - public Criteria andSelectdNoGreaterThan(String value) { - addCriterion("selectd_no >", value, "selectdNo"); - return (Criteria) this; - } - - public Criteria andSelectdNoGreaterThanOrEqualTo(String value) { - addCriterion("selectd_no >=", value, "selectdNo"); - return (Criteria) this; - } - - public Criteria andSelectdNoLessThan(String value) { - addCriterion("selectd_no <", value, "selectdNo"); - return (Criteria) this; - } - - public Criteria andSelectdNoLessThanOrEqualTo(String value) { - addCriterion("selectd_no <=", value, "selectdNo"); - return (Criteria) this; - } - - public Criteria andSelectdNoLike(String value) { - addCriterion("selectd_no like", value, "selectdNo"); - return (Criteria) this; - } - - public Criteria andSelectdNoNotLike(String value) { - addCriterion("selectd_no not like", value, "selectdNo"); - return (Criteria) this; - } - - public Criteria andSelectdNoIn(List values) { - addCriterion("selectd_no in", values, "selectdNo"); - return (Criteria) this; - } - - public Criteria andSelectdNoNotIn(List values) { - addCriterion("selectd_no not in", values, "selectdNo"); - return (Criteria) this; - } - - public Criteria andSelectdNoBetween(String value1, String value2) { - addCriterion("selectd_no between", value1, value2, "selectdNo"); - return (Criteria) this; - } - - public Criteria andSelectdNoNotBetween(String value1, String value2) { - addCriterion("selectd_no not between", value1, value2, "selectdNo"); - return (Criteria) this; - } - - public Criteria andSelectdNoNumIsNull() { - addCriterion("selectd_no_num is null"); - return (Criteria) this; - } - - public Criteria andSelectdNoNumIsNotNull() { - addCriterion("selectd_no_num is not null"); - return (Criteria) this; - } - - public Criteria andSelectdNoNumEqualTo(Integer value) { - addCriterion("selectd_no_num =", value, "selectdNoNum"); - return (Criteria) this; - } - - public Criteria andSelectdNoNumNotEqualTo(Integer value) { - addCriterion("selectd_no_num <>", value, "selectdNoNum"); - return (Criteria) this; - } - - public Criteria andSelectdNoNumGreaterThan(Integer value) { - addCriterion("selectd_no_num >", value, "selectdNoNum"); - return (Criteria) this; - } - - public Criteria andSelectdNoNumGreaterThanOrEqualTo(Integer value) { - addCriterion("selectd_no_num >=", value, "selectdNoNum"); - return (Criteria) this; - } - - public Criteria andSelectdNoNumLessThan(Integer value) { - addCriterion("selectd_no_num <", value, "selectdNoNum"); - return (Criteria) this; - } - - public Criteria andSelectdNoNumLessThanOrEqualTo(Integer value) { - addCriterion("selectd_no_num <=", value, "selectdNoNum"); - return (Criteria) this; - } - - public Criteria andSelectdNoNumIn(List values) { - addCriterion("selectd_no_num in", values, "selectdNoNum"); - return (Criteria) this; - } - - public Criteria andSelectdNoNumNotIn(List values) { - addCriterion("selectd_no_num not in", values, "selectdNoNum"); - return (Criteria) this; - } - - public Criteria andSelectdNoNumBetween(Integer value1, Integer value2) { - addCriterion("selectd_no_num between", value1, value2, "selectdNoNum"); - return (Criteria) this; - } - - public Criteria andSelectdNoNumNotBetween(Integer value1, Integer value2) { - addCriterion("selectd_no_num not between", value1, value2, "selectdNoNum"); - return (Criteria) this; - } - - public Criteria andChargeProdIdIsNull() { - addCriterion("charge_prod_id is null"); - return (Criteria) this; - } - - public Criteria andChargeProdIdIsNotNull() { - addCriterion("charge_prod_id is not null"); - return (Criteria) this; - } - - public Criteria andChargeProdIdEqualTo(String value) { - addCriterion("charge_prod_id =", value, "chargeProdId"); - return (Criteria) this; - } - - public Criteria andChargeProdIdNotEqualTo(String value) { - addCriterion("charge_prod_id <>", value, "chargeProdId"); - return (Criteria) this; - } - - public Criteria andChargeProdIdGreaterThan(String value) { - addCriterion("charge_prod_id >", value, "chargeProdId"); - return (Criteria) this; - } - - public Criteria andChargeProdIdGreaterThanOrEqualTo(String value) { - addCriterion("charge_prod_id >=", value, "chargeProdId"); - return (Criteria) this; - } - - public Criteria andChargeProdIdLessThan(String value) { - addCriterion("charge_prod_id <", value, "chargeProdId"); - return (Criteria) this; - } - - public Criteria andChargeProdIdLessThanOrEqualTo(String value) { - addCriterion("charge_prod_id <=", value, "chargeProdId"); - return (Criteria) this; - } - - public Criteria andChargeProdIdLike(String value) { - addCriterion("charge_prod_id like", value, "chargeProdId"); - return (Criteria) this; - } - - public Criteria andChargeProdIdNotLike(String value) { - addCriterion("charge_prod_id not like", value, "chargeProdId"); - return (Criteria) this; - } - - public Criteria andChargeProdIdIn(List values) { - addCriterion("charge_prod_id in", values, "chargeProdId"); - return (Criteria) this; - } - - public Criteria andChargeProdIdNotIn(List values) { - addCriterion("charge_prod_id not in", values, "chargeProdId"); - return (Criteria) this; - } - - public Criteria andChargeProdIdBetween(String value1, String value2) { - addCriterion("charge_prod_id between", value1, value2, "chargeProdId"); - return (Criteria) this; - } - - public Criteria andChargeProdIdNotBetween(String value1, String value2) { - addCriterion("charge_prod_id not between", value1, value2, "chargeProdId"); - return (Criteria) this; - } - - public Criteria andChargeMoneyIsNull() { - addCriterion("charge_money is null"); - return (Criteria) this; - } - - public Criteria andChargeMoneyIsNotNull() { - addCriterion("charge_money is not null"); - return (Criteria) this; - } - - public Criteria andChargeMoneyEqualTo(Long value) { - addCriterion("charge_money =", value, "chargeMoney"); - return (Criteria) this; - } - - public Criteria andChargeMoneyNotEqualTo(Long value) { - addCriterion("charge_money <>", value, "chargeMoney"); - return (Criteria) this; - } - - public Criteria andChargeMoneyGreaterThan(Long value) { - addCriterion("charge_money >", value, "chargeMoney"); - return (Criteria) this; - } - - public Criteria andChargeMoneyGreaterThanOrEqualTo(Long value) { - addCriterion("charge_money >=", value, "chargeMoney"); - return (Criteria) this; - } - - public Criteria andChargeMoneyLessThan(Long value) { - addCriterion("charge_money <", value, "chargeMoney"); - return (Criteria) this; - } - - public Criteria andChargeMoneyLessThanOrEqualTo(Long value) { - addCriterion("charge_money <=", value, "chargeMoney"); - return (Criteria) this; - } - - public Criteria andChargeMoneyIn(List values) { - addCriterion("charge_money in", values, "chargeMoney"); - return (Criteria) this; - } - - public Criteria andChargeMoneyNotIn(List values) { - addCriterion("charge_money not in", values, "chargeMoney"); - return (Criteria) this; - } - - public Criteria andChargeMoneyBetween(Long value1, Long value2) { - addCriterion("charge_money between", value1, value2, "chargeMoney"); - return (Criteria) this; - } - - public Criteria andChargeMoneyNotBetween(Long value1, Long value2) { - addCriterion("charge_money not between", value1, value2, "chargeMoney"); - return (Criteria) this; - } - - public Criteria andGoldNumIsNull() { - addCriterion("gold_num is null"); - return (Criteria) this; - } - - public Criteria andGoldNumIsNotNull() { - addCriterion("gold_num is not null"); - return (Criteria) this; - } - - public Criteria andGoldNumEqualTo(Long value) { - addCriterion("gold_num =", value, "goldNum"); - return (Criteria) this; - } - - public Criteria andGoldNumNotEqualTo(Long value) { - addCriterion("gold_num <>", value, "goldNum"); - return (Criteria) this; - } - - public Criteria andGoldNumGreaterThan(Long value) { - addCriterion("gold_num >", value, "goldNum"); - return (Criteria) this; - } - - public Criteria andGoldNumGreaterThanOrEqualTo(Long value) { - addCriterion("gold_num >=", value, "goldNum"); - return (Criteria) this; - } - - public Criteria andGoldNumLessThan(Long value) { - addCriterion("gold_num <", value, "goldNum"); - return (Criteria) this; - } - - public Criteria andGoldNumLessThanOrEqualTo(Long value) { - addCriterion("gold_num <=", value, "goldNum"); - return (Criteria) this; - } - - public Criteria andGoldNumIn(List values) { - addCriterion("gold_num in", values, "goldNum"); - return (Criteria) this; - } - - public Criteria andGoldNumNotIn(List values) { - addCriterion("gold_num not in", values, "goldNum"); - return (Criteria) this; - } - - public Criteria andGoldNumBetween(Long value1, Long value2) { - addCriterion("gold_num between", value1, value2, "goldNum"); - return (Criteria) this; - } - - public Criteria andGoldNumNotBetween(Long value1, Long value2) { - addCriterion("gold_num not between", value1, value2, "goldNum"); - return (Criteria) this; - } - - public Criteria andChargeRecordIdIsNull() { - addCriterion("charge_record_id is null"); - return (Criteria) this; - } - - public Criteria andChargeRecordIdIsNotNull() { - addCriterion("charge_record_id is not null"); - return (Criteria) this; - } - - public Criteria andChargeRecordIdEqualTo(String value) { - addCriterion("charge_record_id =", value, "chargeRecordId"); - return (Criteria) this; - } - - public Criteria andChargeRecordIdNotEqualTo(String value) { - addCriterion("charge_record_id <>", value, "chargeRecordId"); - return (Criteria) this; - } - - public Criteria andChargeRecordIdGreaterThan(String value) { - addCriterion("charge_record_id >", value, "chargeRecordId"); - return (Criteria) this; - } - - public Criteria andChargeRecordIdGreaterThanOrEqualTo(String value) { - addCriterion("charge_record_id >=", value, "chargeRecordId"); - return (Criteria) this; - } - - public Criteria andChargeRecordIdLessThan(String value) { - addCriterion("charge_record_id <", value, "chargeRecordId"); - return (Criteria) this; - } - - public Criteria andChargeRecordIdLessThanOrEqualTo(String value) { - addCriterion("charge_record_id <=", value, "chargeRecordId"); - return (Criteria) this; - } - - public Criteria andChargeRecordIdLike(String value) { - addCriterion("charge_record_id like", value, "chargeRecordId"); - return (Criteria) this; - } - - public Criteria andChargeRecordIdNotLike(String value) { - addCriterion("charge_record_id not like", value, "chargeRecordId"); - return (Criteria) this; - } - - public Criteria andChargeRecordIdIn(List values) { - addCriterion("charge_record_id in", values, "chargeRecordId"); - return (Criteria) this; - } - - public Criteria andChargeRecordIdNotIn(List values) { - addCriterion("charge_record_id not in", values, "chargeRecordId"); - return (Criteria) this; - } - - public Criteria andChargeRecordIdBetween(String value1, String value2) { - addCriterion("charge_record_id between", value1, value2, "chargeRecordId"); - return (Criteria) this; - } - - public Criteria andChargeRecordIdNotBetween(String value1, String value2) { - addCriterion("charge_record_id not between", value1, value2, "chargeRecordId"); - return (Criteria) this; - } - - public Criteria andDrawNumIsNull() { - addCriterion("draw_num is null"); - return (Criteria) this; - } - - public Criteria andDrawNumIsNotNull() { - addCriterion("draw_num is not null"); - return (Criteria) this; - } - - public Criteria andDrawNumEqualTo(Integer value) { - addCriterion("draw_num =", value, "drawNum"); - return (Criteria) this; - } - - public Criteria andDrawNumNotEqualTo(Integer value) { - addCriterion("draw_num <>", value, "drawNum"); - return (Criteria) this; - } - - public Criteria andDrawNumGreaterThan(Integer value) { - addCriterion("draw_num >", value, "drawNum"); - return (Criteria) this; - } - - public Criteria andDrawNumGreaterThanOrEqualTo(Integer value) { - addCriterion("draw_num >=", value, "drawNum"); - return (Criteria) this; - } - - public Criteria andDrawNumLessThan(Integer value) { - addCriterion("draw_num <", value, "drawNum"); - return (Criteria) this; - } - - public Criteria andDrawNumLessThanOrEqualTo(Integer value) { - addCriterion("draw_num <=", value, "drawNum"); - return (Criteria) this; - } - - public Criteria andDrawNumIn(List values) { - addCriterion("draw_num in", values, "drawNum"); - return (Criteria) this; - } - - public Criteria andDrawNumNotIn(List values) { - addCriterion("draw_num not in", values, "drawNum"); - return (Criteria) this; - } - - public Criteria andDrawNumBetween(Integer value1, Integer value2) { - addCriterion("draw_num between", value1, value2, "drawNum"); - return (Criteria) this; - } - - public Criteria andDrawNumNotBetween(Integer value1, Integer value2) { - addCriterion("draw_num not between", value1, value2, "drawNum"); - return (Criteria) this; - } - - public Criteria andDrawStatusIsNull() { - addCriterion("draw_status is null"); - return (Criteria) this; - } - - public Criteria andDrawStatusIsNotNull() { - addCriterion("draw_status is not null"); - return (Criteria) this; - } - - public Criteria andDrawStatusEqualTo(Byte value) { - addCriterion("draw_status =", value, "drawStatus"); - return (Criteria) this; - } - - public Criteria andDrawStatusNotEqualTo(Byte value) { - addCriterion("draw_status <>", value, "drawStatus"); - return (Criteria) this; - } - - public Criteria andDrawStatusGreaterThan(Byte value) { - addCriterion("draw_status >", value, "drawStatus"); - return (Criteria) this; - } - - public Criteria andDrawStatusGreaterThanOrEqualTo(Byte value) { - addCriterion("draw_status >=", value, "drawStatus"); - return (Criteria) this; - } - - public Criteria andDrawStatusLessThan(Byte value) { - addCriterion("draw_status <", value, "drawStatus"); - return (Criteria) this; - } - - public Criteria andDrawStatusLessThanOrEqualTo(Byte value) { - addCriterion("draw_status <=", value, "drawStatus"); - return (Criteria) this; - } - - public Criteria andDrawStatusIn(List values) { - addCriterion("draw_status in", values, "drawStatus"); - return (Criteria) this; - } - - public Criteria andDrawStatusNotIn(List values) { - addCriterion("draw_status not in", values, "drawStatus"); - return (Criteria) this; - } - - public Criteria andDrawStatusBetween(Byte value1, Byte value2) { - addCriterion("draw_status between", value1, value2, "drawStatus"); - return (Criteria) this; - } - - public Criteria andDrawStatusNotBetween(Byte value1, Byte value2) { - addCriterion("draw_status not between", value1, value2, "drawStatus"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNull() { - addCriterion("create_time is null"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNotNull() { - addCriterion("create_time is not null"); - return (Criteria) this; - } - - public Criteria andCreateTimeEqualTo(Date value) { - addCriterion("create_time =", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotEqualTo(Date value) { - addCriterion("create_time <>", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThan(Date value) { - addCriterion("create_time >", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("create_time >=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThan(Date value) { - addCriterion("create_time <", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThanOrEqualTo(Date value) { - addCriterion("create_time <=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeIn(List values) { - addCriterion("create_time in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotIn(List values) { - addCriterion("create_time not in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeBetween(Date value1, Date value2) { - addCriterion("create_time between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotBetween(Date value1, Date value2) { - addCriterion("create_time not between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNull() { - addCriterion("update_time is null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNotNull() { - addCriterion("update_time is not null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeEqualTo(Date value) { - addCriterion("update_time =", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotEqualTo(Date value) { - addCriterion("update_time <>", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThan(Date value) { - addCriterion("update_time >", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("update_time >=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThan(Date value) { - addCriterion("update_time <", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { - addCriterion("update_time <=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIn(List values) { - addCriterion("update_time in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotIn(List values) { - addCriterion("update_time not in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeBetween(Date value1, Date value2) { - addCriterion("update_time between", value1, value2, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { - addCriterion("update_time not between", value1, value2, "updateTime"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/accompany-base/accompany-payment/accompany-payment-sdk/src/main/java/com/accompany/payment/vo/ChargeRecordStatisVo.java b/accompany-base/accompany-payment/accompany-payment-sdk/src/main/java/com/accompany/payment/vo/ChargeRecordStatisVo.java index b83c9cce1..9163ec805 100644 --- a/accompany-base/accompany-payment/accompany-payment-sdk/src/main/java/com/accompany/payment/vo/ChargeRecordStatisVo.java +++ b/accompany-base/accompany-payment/accompany-payment-sdk/src/main/java/com/accompany/payment/vo/ChargeRecordStatisVo.java @@ -39,8 +39,6 @@ public class ChargeRecordStatisVo extends BaseVo { public BigDecimal alipayWapAmount; @FieldComment("小程序支付") public BigDecimal wxMiniAppAmount; - @FieldComment("") - public BigDecimal luckyTarotAmount; @FieldComment("兑换") public BigDecimal exchangeAmount; @FieldComment("google") @@ -73,8 +71,6 @@ public class ChargeRecordStatisVo extends BaseVo { public Integer alipayWapCount; @FieldComment("微信小程序笔数") public Integer miniPayCount; - @FieldComment("") - public Integer tarotPayCount; @FieldComment("兑换笔数") public Integer exchangeCount; @FieldComment("google笔数") diff --git a/accompany-base/accompany-payment/accompany-payment-sdk/src/main/java/com/accompany/payment/vo/LuckyTarotRecordVo.java b/accompany-base/accompany-payment/accompany-payment-sdk/src/main/java/com/accompany/payment/vo/LuckyTarotRecordVo.java deleted file mode 100644 index 8bc8f30a6..000000000 --- a/accompany-base/accompany-payment/accompany-payment-sdk/src/main/java/com/accompany/payment/vo/LuckyTarotRecordVo.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.accompany.payment.vo; - -import lombok.Data; - -import java.util.Date; - -/** - * @Author: yangming - * @Date: 2019/11/6 10:34 - * @Description: 幸运塔罗充值记录 - **/ -@Data -public class LuckyTarotRecordVo { - - private String recordId; - - private Long uid; - - private Long erbanNo; - - private String nick; - - private Long roomUid; - - private String chargeProdId; - - private String chargeProdName; - - private String selectdNo; - - private Integer selectdNoNum; - - private Long chargeMoney; - - private Long goldNum; - - private String chargeRecordId; - - private Integer drawNum; - - private Byte drawStatus; - - private Date createTime; - - private Date updateTime; -} diff --git a/accompany-base/accompany-payment/accompany-payment-sdk/src/main/java/com/accompany/payment/vo/TarotChargeRetVo.java b/accompany-base/accompany-payment/accompany-payment-sdk/src/main/java/com/accompany/payment/vo/TarotChargeRetVo.java deleted file mode 100644 index 786557241..000000000 --- a/accompany-base/accompany-payment/accompany-payment-sdk/src/main/java/com/accompany/payment/vo/TarotChargeRetVo.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.accompany.payment.vo; - -import lombok.Data; - -/** - * @Author: yangming - * @Date: 2019/11/8 15:07 - * @Description: 塔罗充值下单返回结果(必须包含订单号) - **/ -@Data -public class TarotChargeRetVo { - - private String chargeRecordId; - - @Deprecated - private Object alipayRet; - - private Object payRet; -} diff --git a/accompany-base/accompany-payment/accompany-payment-sdk/src/main/java/com/accompany/payment/vo/TarotRecordStatisVo.java b/accompany-base/accompany-payment/accompany-payment-sdk/src/main/java/com/accompany/payment/vo/TarotRecordStatisVo.java deleted file mode 100644 index f0526b752..000000000 --- a/accompany-base/accompany-payment/accompany-payment-sdk/src/main/java/com/accompany/payment/vo/TarotRecordStatisVo.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.accompany.payment.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @Author: yangming - * @Date: 2019/11/12 15:10 - * @Description: 幸运塔罗抽牌统计 - **/ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class TarotRecordStatisVo { - - /** 用户uid **/ - private Long uid; - /** 用户平台号 **/ - private Long erbanNo; - /** 用户昵称 **/ - private String nick; - /** 抽牌次数 **/ - private Integer drawCount; - /** 中奖次数 **/ - private Integer winCount; - /** 抽奖总额 **/ - private Long drawMoney; - /** 中奖总额 **/ - private Long winGold; - /** 偏差值 **/ - private Long deviateGold; - /** 平均选择号码个数 **/ - private Double avgSelectNo; - /** 中奖选择号码的总次数 **/ - private Long winSelectNum; - /** 中奖平均选择号码个数 **/ - private Double avgWinSelectNo; -} diff --git a/accompany-base/accompany-payment/accompany-payment-sdk/src/main/java/com/accompany/payment/vo/TarotRecordTotalVo.java b/accompany-base/accompany-payment/accompany-payment-sdk/src/main/java/com/accompany/payment/vo/TarotRecordTotalVo.java deleted file mode 100644 index 5fc909f19..000000000 --- a/accompany-base/accompany-payment/accompany-payment-sdk/src/main/java/com/accompany/payment/vo/TarotRecordTotalVo.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.accompany.payment.vo; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -/** - * @Author: yangming - * @Date: 2019/11/12 16:36 - * @Description: 幸运塔罗充值平台数据管理 - **/ -@Data -@NoArgsConstructor -@AllArgsConstructor -public class TarotRecordTotalVo { - - private Date createTime; - /** 抽牌次数 **/ - private Integer drawNum; - /** 中奖次数 **/ - private Long winNum; - /** 抽牌金额 **/ - private Long drawMoney; - /** 中奖金币 **/ - private Long winGold; - /** 盈亏比 **/ - private String profitRation; - /** 平均每次选择号码个数 **/ - private Double avgSelectNo; - /** 中奖选择号码的总次数 **/ - private Long winSelectNum; - /** 中奖平均每次选择号码个数 **/ - private Double avgWinSelectNo; -} diff --git a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/mapper/LuckyTarotRecordMapper.java b/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/mapper/LuckyTarotRecordMapper.java deleted file mode 100644 index 038ac485a..000000000 --- a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/mapper/LuckyTarotRecordMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.accompany.payment.mapper; - -import com.accompany.payment.model.LuckyTarotRecord; -import com.accompany.payment.model.LuckyTarotRecordExample; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -public interface LuckyTarotRecordMapper { - int countByExample(LuckyTarotRecordExample example); - - int deleteByPrimaryKey(String recordId); - - int insert(LuckyTarotRecord record); - - int insertSelective(LuckyTarotRecord record); - - List selectByExample(LuckyTarotRecordExample example); - - LuckyTarotRecord selectByPrimaryKey(String recordId); - - int updateByExampleSelective(@Param("record") LuckyTarotRecord record, @Param("example") LuckyTarotRecordExample example); - - int updateByExample(@Param("record") LuckyTarotRecord record, @Param("example") LuckyTarotRecordExample example); - - int updateByPrimaryKeySelective(LuckyTarotRecord record); - - int updateByPrimaryKey(LuckyTarotRecord record); -} \ No newline at end of file diff --git a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/mapper/LuckyTarotRecordMapperExpand.java b/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/mapper/LuckyTarotRecordMapperExpand.java deleted file mode 100644 index c11fe0cb6..000000000 --- a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/mapper/LuckyTarotRecordMapperExpand.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.accompany.payment.mapper; - -import com.accompany.payment.vo.LuckyTarotRecordVo; -import com.accompany.payment.vo.TarotRecordStatisVo; -import com.accompany.payment.vo.TarotRecordTotalVo; -import org.apache.ibatis.annotations.Param; - -import java.util.List; -import java.util.Map; - -/** - * @author yangming - * @date 2019-11-06 - */ - -public interface LuckyTarotRecordMapperExpand { - - List getDrawList(Integer count); - - List getUserDrawRecord(@Param("uid") Long uid, @Param("start") Integer start, - @Param("limit") Integer limit); - - List getRecordListByPage(@Param("record") Map record, @Param("start") Integer start, - @Param("pageSize") Integer pageSize); - - int getRecordCount(@Param("record") Map record); - - List getRecordStatisByPage(@Param("record") Map record, @Param("start") Integer start, - @Param("pageSize") Integer pageSize); - int getStatisCount(@Param("record") Map record); - - List getRecordTotalByPage(@Param("record") Map record, @Param("start") Integer start, - @Param("pageSize") Integer pageSize); - - int getTotalCount(@Param("record") Map record); - - TarotRecordTotalVo getRecordTotal(@Param("record") Map record); -} \ No newline at end of file diff --git a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/LuckyTarotRecordService.java b/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/LuckyTarotRecordService.java deleted file mode 100644 index 359f407d0..000000000 --- a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/LuckyTarotRecordService.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.accompany.payment.service; - -import com.accompany.core.exception.ServiceException; -import com.accompany.core.service.base.BaseService; -import com.accompany.payment.mapper.LuckyTarotRecordMapper; -import com.accompany.payment.mapper.LuckyTarotRecordMapperExpand; -import com.accompany.payment.model.LuckyTarotRecord; -import com.accompany.payment.model.LuckyTarotRecordExample; -import com.accompany.payment.vo.LuckyTarotRecordVo; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import java.util.List; - -/** - * @Author: yangming - * @Date: 2019/11/4 19:00 - * @Description: 幸运塔罗业务处理 - **/ -@Slf4j -@Service -public class LuckyTarotRecordService extends BaseService { - - @Autowired - private LuckyTarotRecordMapper luckyTarotRecordMapper; - @Autowired - private LuckyTarotRecordMapperExpand luckyTarotRecordMapperExpand; - - /** - * 插入塔罗充值记录 - * @param luckyTarotRecord - */ - public void insertLuckyTarotRecord(LuckyTarotRecord luckyTarotRecord){ - luckyTarotRecordMapper.insert(luckyTarotRecord); - } - - /** - * 根据商户订单号查询塔罗充值记录 - * @param outTradeNo - * @return - */ - public LuckyTarotRecord getLuckyTarotRecordByOutTradeNo(Long uid , String outTradeNo){ - LuckyTarotRecordExample example = new LuckyTarotRecordExample(); - LuckyTarotRecordExample.Criteria criteria = example.createCriteria(); - criteria.andUidEqualTo(uid).andChargeRecordIdEqualTo(outTradeNo); - List records = luckyTarotRecordMapper.selectByExample(example); - if (CollectionUtils.isEmpty(records)){ - throw new ServiceException("没有塔罗占卜充值记录"); - } - return records.get(0); - } - - public int updateLuckyTarotRecord(LuckyTarotRecord luckyTarotRecord){ - LuckyTarotRecordExample example = new LuckyTarotRecordExample(); - LuckyTarotRecordExample.Criteria criteria = example.createCriteria(); - criteria.andRecordIdEqualTo(luckyTarotRecord.getRecordId()); - return luckyTarotRecordMapper.updateByExampleSelective(luckyTarotRecord,example); - } - - public List getDrawList(Integer count){ - return luckyTarotRecordMapperExpand.getDrawList(count); - } - - public List getUserDrawRecord(Long uid, Integer page, Integer pageSize){ - Integer offset = (page - 1) * pageSize; - return luckyTarotRecordMapperExpand.getUserDrawRecord(uid,offset,pageSize); - } -} diff --git a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/PayCenterService.java b/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/PayCenterService.java index aac5d4844..c5e7a8c54 100644 --- a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/PayCenterService.java +++ b/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/PayCenterService.java @@ -4,21 +4,16 @@ import com.accompany.common.constant.Constant; import com.accompany.common.device.DeviceInfo; import com.accompany.common.redis.RedisKey; import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.EnvComponent; import com.accompany.common.utils.UUIDUtil; import com.accompany.core.exception.ServiceException; -import com.accompany.core.service.SysConfService; -import com.accompany.core.vo.BaseResponseVO; import com.accompany.payment.constant.CurrencyTypeEnum; import com.accompany.payment.event.ChargeEvent; import com.accompany.payment.model.ChargeProd; import com.accompany.payment.model.ChargeRecord; -import com.accompany.payment.model.LuckyTarotRecord; import com.accompany.payment.model.UserVipRecord; import com.accompany.payment.strategy.PayContext; import com.accompany.payment.strategy.PayStrategy; import com.accompany.payment.strategy.factory.PayStrategyFactory; -import com.accompany.payment.vo.TarotChargeRetVo; import com.alibaba.fastjson.JSON; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -47,12 +42,6 @@ public class PayCenterService { @Autowired private PayStrategyFactory payStrategyFactory; @Autowired - private LuckyTarotRecordService luckyChargeRecordService; - @Autowired - private EnvComponent envComponent; - @Autowired - private SysConfService sysConfService; - @Autowired private ApplicationContext applicationContext; @Autowired private UserVipRecordService userVipRecordService; @@ -77,9 +66,6 @@ public class PayCenterService { String recordChannel = getChannelUseInRecord(channel); ChargeRecord chargeRecord = buildChargeRecord(Constant.PayBussType.charge, uid, chargeProd, recordChannel, clientIp, deviceInfo, openId, paymentType, countryCode); - if (isTarotLowChargeAmountOpen()) { - chargeRecord.setAmount(chargeRecord.getAmount() / 100); - } PayContext payContext = buildPayContext(erbanNo, nick, successUrl, failureUrl, chargeProd, chargeRecord, realName, idCardNum, deviceInfo); PayStrategy strategy = payStrategyFactory.getStrategy(channel); if (strategy == null) { @@ -178,54 +164,6 @@ public class PayCenterService { return payContext; } - /** - * 幸运塔罗充值的接口 - * - * @param uid - * @param luckyTarotRecord - * @param channel - * @param clientIp - * @param chargeProd - * @param successUrl - * @param deviceInfo - * @return - * @throws Exception - */ - public BaseResponseVO createTarotOrder(Long uid, LuckyTarotRecord luckyTarotRecord, String channel, String clientIp, - ChargeProd chargeProd, String realName, String idCardNum, String successUrl, DeviceInfo deviceInfo) throws Exception { - BaseResponseVO BaseResponseVO = new BaseResponseVO<>(BusiStatus.SUCCESS); - ChargeRecord chargeRecord = - buildChargeRecord(uid, luckyTarotRecord, channel, clientIp, chargeProd, deviceInfo); - if (isTarotLowChargeAmountOpen()) { - chargeRecord.setAmount(chargeRecord.getAmount() / 100); - } - StringBuilder successUrlSb = new StringBuilder(successUrl).append("?chargeRecordId=").append(chargeRecord.getChargeRecordId()); - PayContext payContext = buildPayContext(null, null, successUrlSb.toString(), chargeProd, chargeRecord, realName, idCardNum, deviceInfo); - PayStrategy strategy = payStrategyFactory.getStrategy(channel); - if (strategy == null) { - throw new ServiceException(BusiStatus.PAYMENT_FAIL); - } - TarotChargeRetVo retVo = new TarotChargeRetVo(); - Object ret = strategy.pay(payContext); - log.info("Completed charge uid:{} channelProdId:{} channel:{}, ret:{}", uid, chargeProd.getChargeProdId(), - channel, JSON.toJSONString(ret)); - retVo.setPayRet(ret); - chargeRecordService.insertChargeRecord(chargeRecord); - luckyTarotRecord.setChargeRecordId(chargeRecord.getChargeRecordId()); - luckyTarotRecord.setDrawStatus(Constant.LuckyTarotStatus.charge); - luckyChargeRecordService.insertLuckyTarotRecord(luckyTarotRecord); - try { - saveOrderToCache(chargeRecord); - } catch (Exception e) { - log.error("缓存增加订单数出现异常", e); - throw e; - } - retVo.setChargeRecordId(chargeRecord.getChargeRecordId()); - BaseResponseVO.setData(retVo); - return BaseResponseVO; - } - - /** * 创建开通贵族订单 * @@ -245,9 +183,6 @@ public class PayCenterService { public Object createOpenVipOrder(Long uid, ChargeProd chargeProd, String channel, String clientIp, String successUrl, String facReturnUrl, UserVipRecord userVipRecord, String realName, String idCardNum, DeviceInfo deviceInfo, String openId, String paymentType, String countryCode) { ChargeRecord chargeRecord = buildChargeRecord(Constant.PayBussType.OPEN_VIP, uid, chargeProd, channel, clientIp, deviceInfo, openId, paymentType, countryCode); - if (isTarotLowChargeAmountOpen()) { - chargeRecord.setAmount(chargeRecord.getAmount() / 100); - } PayContext payContext = buildPayContext(null, null, successUrl, facReturnUrl, chargeProd, chargeRecord, realName, idCardNum, deviceInfo); PayStrategy strategy = payStrategyFactory.getStrategy(channel); if (strategy == null) { @@ -268,53 +203,4 @@ public class PayCenterService { return ret; } - - /** - * 判断是否开启了低价充值开关 - * - * @return - */ - public boolean isTarotLowChargeAmountOpen() { - if (envComponent.getOnlineEnv()) { - // 正式环境都是不启动 - return false; - } - return Boolean.valueOf(sysConfService.getDefaultSysConfValueById(Constant.SysConfId.TAROT_LOW_CHARGE_AMOUNT_SWITCH, "false")); - } - - /** - * 幸运塔罗充值记录 - * - * @param uid - * @param luckyTarotRecord - * @param channel - * @param clientIp - * @param deviceInfo - * @return - */ - public ChargeRecord buildChargeRecord(Long uid, LuckyTarotRecord luckyTarotRecord, String channel, String clientIp, - ChargeProd chargeProd, DeviceInfo deviceInfo) { - String chargeRecordId = UUIDUtil.get(); - ChargeRecord chargeRecord = new ChargeRecord(); - chargeRecord.setChargeRecordId(chargeRecordId); - chargeRecord.setChargeProdId(luckyTarotRecord.getChargeProdId()); - chargeRecord.setUid(uid); - chargeRecord.setChannel(channel); - chargeRecord.setBussType(Constant.PayBussType.lucky_tarot); - chargeRecord.setChargeStatus(Constant.ChargeRecordStatus.create); - Long money = luckyTarotRecord.getChargeMoney(); - // 充值金额,以分为单位 - Long amount = money * 100; - chargeRecord.setAmount(amount); - String body = chargeProd.getProdName() + "充值"; - String subject = chargeProd.getProdName() + "充值"; - chargeRecord.setSubject(subject); - chargeRecord.setBody(body); - chargeRecord.setClientIp(clientIp); - chargeRecord.setCreateTime(Calendar.getInstance().getTime()); - if (deviceInfo != null) { - chargeRecord.setChargeApp(deviceInfo.getApp()); - } - return chargeRecord; - } } diff --git a/accompany-base/accompany-payment/accompany-payment-service/src/main/resources/mapper/ChargeRecordMapperMgr.xml b/accompany-base/accompany-payment/accompany-payment-service/src/main/resources/mapper/ChargeRecordMapperMgr.xml index 36d8b171f..7b5ee41d4 100644 --- a/accompany-base/accompany-payment/accompany-payment-service/src/main/resources/mapper/ChargeRecordMapperMgr.xml +++ b/accompany-base/accompany-payment/accompany-payment-service/src/main/resources/mapper/ChargeRecordMapperMgr.xml @@ -48,7 +48,6 @@ - @@ -64,7 +63,6 @@ - diff --git a/accompany-base/accompany-payment/accompany-payment-service/src/main/resources/mapper/LuckyTarotRecordMapper.xml b/accompany-base/accompany-payment/accompany-payment-service/src/main/resources/mapper/LuckyTarotRecordMapper.xml deleted file mode 100644 index c22b857d8..000000000 --- a/accompany-base/accompany-payment/accompany-payment-service/src/main/resources/mapper/LuckyTarotRecordMapper.xml +++ /dev/null @@ -1,341 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - record_id, uid, room_uid, selectd_no, selectd_no_num, charge_prod_id, charge_money, - gold_num, charge_record_id, draw_num, draw_status, create_time, update_time - - - - - delete from lucky_tarot_record - where record_id = #{recordId,jdbcType=VARCHAR} - - - insert into lucky_tarot_record (record_id, uid, room_uid, - selectd_no, selectd_no_num, charge_prod_id, - charge_money, gold_num, charge_record_id, - draw_num, draw_status, create_time, - update_time) - values (#{recordId,jdbcType=VARCHAR}, #{uid,jdbcType=BIGINT}, #{roomUid,jdbcType=BIGINT}, - #{selectdNo,jdbcType=VARCHAR}, #{selectdNoNum,jdbcType=INTEGER}, #{chargeProdId,jdbcType=VARCHAR}, - #{chargeMoney,jdbcType=BIGINT}, #{goldNum,jdbcType=BIGINT}, #{chargeRecordId,jdbcType=VARCHAR}, - #{drawNum,jdbcType=INTEGER}, #{drawStatus,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP}, - #{updateTime,jdbcType=TIMESTAMP}) - - - insert into lucky_tarot_record - - - record_id, - - - uid, - - - room_uid, - - - selectd_no, - - - selectd_no_num, - - - charge_prod_id, - - - charge_money, - - - gold_num, - - - charge_record_id, - - - draw_num, - - - draw_status, - - - create_time, - - - update_time, - - - - - #{recordId,jdbcType=VARCHAR}, - - - #{uid,jdbcType=BIGINT}, - - - #{roomUid,jdbcType=BIGINT}, - - - #{selectdNo,jdbcType=VARCHAR}, - - - #{selectdNoNum,jdbcType=INTEGER}, - - - #{chargeProdId,jdbcType=VARCHAR}, - - - #{chargeMoney,jdbcType=BIGINT}, - - - #{goldNum,jdbcType=BIGINT}, - - - #{chargeRecordId,jdbcType=VARCHAR}, - - - #{drawNum,jdbcType=INTEGER}, - - - #{drawStatus,jdbcType=TINYINT}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - - - - update lucky_tarot_record - - - record_id = #{record.recordId,jdbcType=VARCHAR}, - - - uid = #{record.uid,jdbcType=BIGINT}, - - - room_uid = #{record.roomUid,jdbcType=BIGINT}, - - - selectd_no = #{record.selectdNo,jdbcType=VARCHAR}, - - - selectd_no_num = #{record.selectdNoNum,jdbcType=INTEGER}, - - - charge_prod_id = #{record.chargeProdId,jdbcType=VARCHAR}, - - - charge_money = #{record.chargeMoney,jdbcType=BIGINT}, - - - gold_num = #{record.goldNum,jdbcType=BIGINT}, - - - charge_record_id = #{record.chargeRecordId,jdbcType=VARCHAR}, - - - draw_num = #{record.drawNum,jdbcType=INTEGER}, - - - draw_status = #{record.drawStatus,jdbcType=TINYINT}, - - - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - - - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - - - - - - - - update lucky_tarot_record - set record_id = #{record.recordId,jdbcType=VARCHAR}, - uid = #{record.uid,jdbcType=BIGINT}, - room_uid = #{record.roomUid,jdbcType=BIGINT}, - selectd_no = #{record.selectdNo,jdbcType=VARCHAR}, - selectd_no_num = #{record.selectdNoNum,jdbcType=INTEGER}, - charge_prod_id = #{record.chargeProdId,jdbcType=VARCHAR}, - charge_money = #{record.chargeMoney,jdbcType=BIGINT}, - gold_num = #{record.goldNum,jdbcType=BIGINT}, - charge_record_id = #{record.chargeRecordId,jdbcType=VARCHAR}, - draw_num = #{record.drawNum,jdbcType=INTEGER}, - draw_status = #{record.drawStatus,jdbcType=TINYINT}, - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - update_time = #{record.updateTime,jdbcType=TIMESTAMP} - - - - - - update lucky_tarot_record - - - uid = #{uid,jdbcType=BIGINT}, - - - room_uid = #{roomUid,jdbcType=BIGINT}, - - - selectd_no = #{selectdNo,jdbcType=VARCHAR}, - - - selectd_no_num = #{selectdNoNum,jdbcType=INTEGER}, - - - charge_prod_id = #{chargeProdId,jdbcType=VARCHAR}, - - - charge_money = #{chargeMoney,jdbcType=BIGINT}, - - - gold_num = #{goldNum,jdbcType=BIGINT}, - - - charge_record_id = #{chargeRecordId,jdbcType=VARCHAR}, - - - draw_num = #{drawNum,jdbcType=INTEGER}, - - - draw_status = #{drawStatus,jdbcType=TINYINT}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - where record_id = #{recordId,jdbcType=VARCHAR} - - - update lucky_tarot_record - set uid = #{uid,jdbcType=BIGINT}, - room_uid = #{roomUid,jdbcType=BIGINT}, - selectd_no = #{selectdNo,jdbcType=VARCHAR}, - selectd_no_num = #{selectdNoNum,jdbcType=INTEGER}, - charge_prod_id = #{chargeProdId,jdbcType=VARCHAR}, - charge_money = #{chargeMoney,jdbcType=BIGINT}, - gold_num = #{goldNum,jdbcType=BIGINT}, - charge_record_id = #{chargeRecordId,jdbcType=VARCHAR}, - draw_num = #{drawNum,jdbcType=INTEGER}, - draw_status = #{drawStatus,jdbcType=TINYINT}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP} - where record_id = #{recordId,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/accompany-base/accompany-payment/accompany-payment-service/src/main/resources/mapper/LuckyTarotRecordMapperExpand.xml b/accompany-base/accompany-payment/accompany-payment-service/src/main/resources/mapper/LuckyTarotRecordMapperExpand.xml deleted file mode 100644 index adb450d55..000000000 --- a/accompany-base/accompany-payment/accompany-payment-service/src/main/resources/mapper/LuckyTarotRecordMapperExpand.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/constant/LinearlyPrizePoolTypeEnum.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/constant/LinearlyPrizePoolTypeEnum.java deleted file mode 100644 index 81ca4797e..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/constant/LinearlyPrizePoolTypeEnum.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.accompany.business.constant; - -import java.util.Arrays; -import java.util.Optional; - -/** - * 功能描述:线性奖池类型枚举类 - * - */ -public enum LinearlyPrizePoolTypeEnum { - - /** - * 普通奖品池 - */ - normal_prize_pool((byte) 1, "普通礼物组"), - /** - * 高级奖品池 - */ - senior_prize_pool((byte) 2, "高级礼物组"), - - unknown((byte) 999, "未知"), - ; - - LinearlyPrizePoolTypeEnum(byte value, String poolName) { - this.value = value; - this.poolName = poolName; - } - - /** - * value - */ - private byte value; - - private String poolName; - - public byte getValue() { - return value; - } - - public static LinearlyPrizePoolTypeEnum from(byte type) { - Optional result = Arrays.stream(LinearlyPrizePoolTypeEnum.values()).filter(poolTypeEnum -> - poolTypeEnum.value == type).findAny(); - if (result.isPresent()) { - return result.get(); - } - return unknown; - } - - public String getPoolName() { - return poolName; - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/constant/anchor/AnchorFansTeamPrivilegeTypeEnum.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/constant/anchor/AnchorFansTeamPrivilegeTypeEnum.java deleted file mode 100644 index 766a27f54..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/constant/anchor/AnchorFansTeamPrivilegeTypeEnum.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.accompany.business.constant.anchor; - -import com.accompany.business.constant.ConsumeTypeEnum; - -public enum AnchorFansTeamPrivilegeTypeEnum { - NAMEPLATE((byte)1, "铭牌"), - GIFT((byte)2, "礼物"), - PRIVILEGE_GIFT((byte)3, "入团礼物(唯一)"), - ; - - private byte type; - - private String name; - - AnchorFansTeamPrivilegeTypeEnum(byte type, String name) { - this.type = type; - this.name = name; - } - - public byte getType() { - return type; - } - - public String getName() { - return name; - } - - public static String getNameByType(byte type) { - for (ConsumeTypeEnum value : ConsumeTypeEnum.values()) { - if(value.getType() == type) { - return value.getName(); - } - } - return "-"; - } - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/constant/linearlypool/LinearlyPoolConstants.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/constant/linearlypool/LinearlyPoolConstants.java deleted file mode 100644 index 7d0cf622a..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/constant/linearlypool/LinearlyPoolConstants.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.accompany.business.constant.linearlypool; - -import java.math.BigDecimal; - -public class LinearlyPoolConstants { - - /** - * 出现概率从数据库保存到展示或从展示到数据库保存的转化比 - * 十万分比 - */ - public final static BigDecimal RATE_SCALE = new BigDecimal(1000); - - /** - * 查询前多少条中奖记录 - */ - public static final int DRAW_RECORD_LIMIT_NUM = 300; - - public final static String DEFAULT_GAME_NAME = "航海冒險"; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/constant/nameplate/NameplateStyleTypeEnum.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/constant/nameplate/NameplateStyleTypeEnum.java index 54c313f01..e0cf89fcd 100644 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/constant/nameplate/NameplateStyleTypeEnum.java +++ b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/constant/nameplate/NameplateStyleTypeEnum.java @@ -12,7 +12,7 @@ public enum NameplateStyleTypeEnum { CP_AUDIO_SEND(5,"CP铭牌审核送出"), - ANCHOR_FANS_MP_SEND(6,"粉丝团铭牌送出"), + //ANCHOR_FANS_MP_SEND(6,"粉丝团铭牌送出"), VIP_MP_SEND(7,"贵族等级铭牌送出"), ; diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/LuckyTarotConfig.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/LuckyTarotConfig.java deleted file mode 100644 index a77a50c9e..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/LuckyTarotConfig.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.accompany.business.dto; - -import com.accompany.business.vo.tarot.TarotHeadwearVo; -import lombok.Data; - -import java.util.List; - -@Data -public class LuckyTarotConfig { - - /** - * 活动总开关 - */ - private Boolean isOpen; - - /** - * 头饰信息配置 - */ - private List tarotHeadwears; - - /** - * 等级限制 - */ - private Integer limitLevelSeq; - - /** - * 充值额限制开关 - */ - private Boolean isChargeLimit; - - /** - * 充值限制额 - */ - private Long chargeLimitAmount; - - /** - * 幸运塔罗低额充值开关(价格降100倍,只有在开发、测试环境有用) - */ - private Boolean isLowChargeAmount; - - private Integer actId; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/activity/GiftCompoundConfig.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/activity/GiftCompoundConfig.java deleted file mode 100644 index 361f8b8ae..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/activity/GiftCompoundConfig.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.accompany.business.dto.activity; - -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.ArrayList; -import java.util.List; - -@Data -@NoArgsConstructor -public class GiftCompoundConfig { - private Boolean open = false; - private Integer beginHour = 12; - private Integer endHour = 24; - private List whiteUidList = new ArrayList<>(); -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/ad/AdPlatformConfigDTO.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/ad/AdPlatformConfigDTO.java deleted file mode 100644 index 769aacb97..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/ad/AdPlatformConfigDTO.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 文 件 名: AdPlatformConfigDTO - * 版 权: - * 描 述: <描述> - * 创建人: H1 - * 创建时间: 2021/8/9 - * 修改人: - * 修改内容: - * 修改时间: - */ -package com.accompany.business.dto.ad; - -import lombok.Data; - -import java.util.List; -import java.util.Map; - -/** - *
类描述: - *
功能详细描述: - * - * @author H1 - * @date [2021/8/9] - */ -@Data -public class AdPlatformConfigDTO { - - private Map configMap; - - @Data - public static class ConfigItem { - private List channels; - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/certification/FacialPictureFront.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/certification/FacialPictureFront.java deleted file mode 100644 index 4558b8d46..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/certification/FacialPictureFront.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.accompany.business.dto.certification; - -import lombok.Data; - -@Data -public class FacialPictureFront { - - /** - * @Desc 人脸攻击分 - */ - private String faceAttackScore; - - /** - * @Desc 活体人脸质量分数 - */ - private String qualityScore; - - /** - * @Desc 人脸比对分数 - */ - private String verifyScore; - - /** - * @Desc 照片https地址,有效期15分钟,从查询时开始计时 - */ - private String pictureUrl; - - /** - * @Desc 照片存放客户上海区域的OSS里,此为照片的bucket名 - */ - private String ossBucketName; - - /** - * @Desc 照片存放客户上海区域的OSS里,此为照片的文件名 - */ - private String ossObjectName; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/linearlypool/LinearlyPoolConfigDTO.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/linearlypool/LinearlyPoolConfigDTO.java deleted file mode 100644 index c6e4522eb..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/linearlypool/LinearlyPoolConfigDTO.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.accompany.business.dto.linearlypool; - -import lombok.Data; - -import java.util.List; - -@Data -public class LinearlyPoolConfigDTO { - /** - * 是否开启 - */ - private Boolean isOpen; - - /** - * 用户可以玩的等级限制 - */ - private Integer openLevel; - - /** - * 发送横幅的礼物等级 - */ - private Byte prizeMsgLevel; - - private Boolean prizeMsgSwitch; - - /** - * 可以看到房间公屏消息的用户等级 - */ - private Integer prizeRoomMsgUserLevel; - - /** - * 消耗的道具的价格 - */ - private Integer keyPrice; - - /** - * 需要发送企业微信通知的id列表 - */ - private List wxNotifyPrizeIds; - - /** - * 企业微信通知开关 - */ - private Boolean wxNotifySwitch; - - /** - * 活动名称 - */ - private String gameName; - - /** - * 定点播报开关 - */ - private Boolean hourReportSwitch; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/linearlypool/LinearlyPoolTotalStatisticsDTO.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/linearlypool/LinearlyPoolTotalStatisticsDTO.java deleted file mode 100644 index a57e2258a..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/linearlypool/LinearlyPoolTotalStatisticsDTO.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.accompany.business.dto.linearlypool; - -import lombok.Data; - -@Data -public class LinearlyPoolTotalStatisticsDTO { - /** - * 抽奖次数 - */ - private Long drawCounts; - /** - * 抽奖用户数 - */ - private Long drawUserCount; - /** - * 抽奖总支出 - */ - private Long totalPrice; - /** - * 抽奖总产出 - */ - private Long totalPlatformValue; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/enums/AdPlatformEnum.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/enums/AdPlatformEnum.java deleted file mode 100644 index 5934d4c27..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/enums/AdPlatformEnum.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.accompany.business.enums; - -/** - * 广告平台 - * - * @data 2021/08/06 - */ -public enum AdPlatformEnum { - - DOUYIN("DOUYIN", "抖音"), - KUAISHOU("KUAISHOU", "快手"), - MOCK("MOCK", "mock"), - ; - - /** - * 事件类型 - */ - private String type; - - private String desc; - - - AdPlatformEnum(String type, String desc) { - this.type = type; - this.desc = desc; - } - - public String getType() { - return type; - } - - public String getDesc() { - return desc; - } - - public static AdPlatformEnum getByType(String type) { - for(AdPlatformEnum adPlatformEnum : AdPlatformEnum.values()) { - if(adPlatformEnum.getType().equals(type)) { - return adPlatformEnum; - } - } - return null; - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/enums/JuLiangEventTypeEnum.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/enums/JuLiangEventTypeEnum.java deleted file mode 100644 index d80832e0a..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/enums/JuLiangEventTypeEnum.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.accompany.business.enums; - -import com.accompany.common.utils.StringUtils; - -import java.util.ArrayList; -import java.util.List; - -/** - * 巨量引擎事件类型 - * - * @data 2021/08/06 - */ -public enum JuLiangEventTypeEnum { - - CLICK("CLICK", (byte)-1, "点击", "", 0), - ACTIVE("ACTIVE",(byte)0, "激活", "CLICK", 10), - REGISTER("REGISTER", (byte)1, "注册", "ACTIVE", 20), - CHARGE("CHARGE", (byte)2, "付费", "",30), - NEXT_DAY_STAY("NEXT_DAY_STAY", (byte)6, "次留", "",30), - ; - - /** - * 事件类型 - */ - private String type; - - /** - * 事件的平台值 - */ - private Byte value; - - /** - * 描述 - */ - private String desc; - - /** - * 前置事件类型 - */ - private String preEventType; - - - /** - * 事件的排序级别,越小代表改事件越早发生 - */ - private Integer seq; - - JuLiangEventTypeEnum(String type, byte value, String name, String preEventType, Integer seq) { - this.type = type; - this.value = value; - this.desc = name; - this.preEventType = preEventType; - this.seq = seq; - } - - public String getType() { - return type; - } - - public Byte getValue() { - return value; - } - - public String getDesc() { - return desc; - } - - public String getPreEventType() { - return preEventType; - } - - public Integer getSeq() { - return seq; - } - - - public static JuLiangEventTypeEnum getByType(String type) { - for(JuLiangEventTypeEnum juLiangEventTypeEnum : JuLiangEventTypeEnum.values()) { - if(juLiangEventTypeEnum.getType().equals(type)) { - return juLiangEventTypeEnum; - } - } - return null; - } - - public static JuLiangEventTypeEnum getByValue(byte value) { - for(JuLiangEventTypeEnum juLiangEventTypeEnum : JuLiangEventTypeEnum.values()) { - if(value == juLiangEventTypeEnum.getValue()) { - return juLiangEventTypeEnum; - } - } - return null; - } - - public static List listTypeBeforeEventIncludeSelf(JuLiangEventTypeEnum eventType) { - List events = new ArrayList<>(); - for (JuLiangEventTypeEnum juLiangEventTypeEnum : JuLiangEventTypeEnum.values()) { - if (StringUtils.isNotBlank(eventType.getPreEventType())) { - // 有前置事件时,优先以前置事件为准 - events.add(getByType(eventType.getPreEventType()).getType()); - break; - } else if (eventType.getSeq() >= juLiangEventTypeEnum.getSeq()) { - events.add(juLiangEventTypeEnum.getType()); - } - } - return events; - } - - public static List listTypeAfterEventIncludeSelf(JuLiangEventTypeEnum eventType) { - List events = new ArrayList<>(); - for (JuLiangEventTypeEnum juLiangEventTypeEnum : JuLiangEventTypeEnum.values()) { - if (eventType.getSeq() < juLiangEventTypeEnum.getSeq() || eventType.equals(juLiangEventTypeEnum)) { - events.add(juLiangEventTypeEnum.getType()); - } - } - return events; - } - - public static List listTypeAfterEventNotIncludeSelf(JuLiangEventTypeEnum eventType) { - List events = new ArrayList<>(); - for (JuLiangEventTypeEnum juLiangEventTypeEnum : JuLiangEventTypeEnum.values()) { - if (eventType.getSeq() < juLiangEventTypeEnum.getSeq()) { - events.add(juLiangEventTypeEnum.getType()); - } - } - return events; - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/enums/gamepartner/OrderStatusEnum.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/enums/gamepartner/OrderStatusEnum.java deleted file mode 100644 index e80e7db28..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/enums/gamepartner/OrderStatusEnum.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.accompany.business.enums.gamepartner; - -/** - * @author: liaozetao - * @date: 2023/8/22 14:28 - * @description: - */ -public enum OrderStatusEnum { - - INVITE, - - FINISH; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/event/AnchorFansSendGiftEvent.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/event/AnchorFansSendGiftEvent.java deleted file mode 100644 index 6bf74dc01..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/event/AnchorFansSendGiftEvent.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.accompany.business.event; - -import org.springframework.context.ApplicationEvent; - -/** - * 粉丝送礼记录事件 - */ -public class AnchorFansSendGiftEvent extends ApplicationEvent { - - public AnchorFansSendGiftEvent(Object source) { - super(source); - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/event/AnchorOnWheatEvent.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/event/AnchorOnWheatEvent.java deleted file mode 100644 index 29181c40f..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/event/AnchorOnWheatEvent.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.accompany.business.event; - -import org.springframework.context.ApplicationEvent; - -/** - * Created by chenli on 2021/6/11. - * 主播上下麦事件处理 - */ -public class AnchorOnWheatEvent extends ApplicationEvent { - /** - * 上下麦事件处理 - * @param source - */ - public AnchorOnWheatEvent(Object source) { - super(source); - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/event/linearlypool/LinearlyPoolPrizeEvent.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/event/linearlypool/LinearlyPoolPrizeEvent.java deleted file mode 100644 index 016c5ac7d..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/event/linearlypool/LinearlyPoolPrizeEvent.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.accompany.business.event.linearlypool; - -import org.springframework.context.ApplicationEvent; - -/** - * 线性奖池中奖事件 - */ -public class LinearlyPoolPrizeEvent extends ApplicationEvent { - public LinearlyPoolPrizeEvent(Object source) { - super(source); - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/message/linearlypool/LinearlyPoolPrizeMessage.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/message/linearlypool/LinearlyPoolPrizeMessage.java deleted file mode 100644 index 1be9889ef..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/message/linearlypool/LinearlyPoolPrizeMessage.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.accompany.business.message.linearlypool; - -import com.accompany.business.message.PrizeEntity; -import com.accompany.mq.model.BaseMqMessage; -import lombok.Data; - -import java.util.List; - -/** - * Created by PaperCut on 2018/7/16. - * 砸金蛋中奖消息 - */ -@Data -public class LinearlyPoolPrizeMessage extends BaseMqMessage { - - private static final long serialVersionUID = 1L; - - // 消息id - private String messId; - // 消息创建时间 - private Long messTime; - // 房主uid - private Long roomUid; - // 中奖用户 - private Long uid; - // 中奖列表 - private List prizeList; - // 是否发送公屏消息 - private Boolean sendMessage; - -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AnchorBillCheck.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AnchorBillCheck.java deleted file mode 100644 index 3103478ca..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AnchorBillCheck.java +++ /dev/null @@ -1,165 +0,0 @@ -package com.accompany.business.model; - -import java.util.Date; - -public class AnchorBillCheck { - private Long id; - - private Integer adminId; - - private String adminName; - - private Date uploadTime; - - private String remark; - - private Integer status; - - private Integer checkAdminId; - - private String checkAdminName; - - private Date checkTime; - - private Date updateTime; - - private String checkRemark; - - private String fileMd5; - - private String fileName; - - private String realName; - - private String filePath; - - private String fileFullPath; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Integer getAdminId() { - return adminId; - } - - public void setAdminId(Integer adminId) { - this.adminId = adminId; - } - - public String getAdminName() { - return adminName; - } - - public void setAdminName(String adminName) { - this.adminName = adminName == null ? null : adminName.trim(); - } - - public Date getUploadTime() { - return uploadTime; - } - - public void setUploadTime(Date uploadTime) { - this.uploadTime = uploadTime; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark == null ? null : remark.trim(); - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - public Integer getCheckAdminId() { - return checkAdminId; - } - - public void setCheckAdminId(Integer checkAdminId) { - this.checkAdminId = checkAdminId; - } - - public String getCheckAdminName() { - return checkAdminName; - } - - public void setCheckAdminName(String checkAdminName) { - this.checkAdminName = checkAdminName == null ? null : checkAdminName.trim(); - } - - public Date getCheckTime() { - return checkTime; - } - - public void setCheckTime(Date checkTime) { - this.checkTime = checkTime; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - - public String getCheckRemark() { - return checkRemark; - } - - public void setCheckRemark(String checkRemark) { - this.checkRemark = checkRemark == null ? null : checkRemark.trim(); - } - - public String getFileMd5() { - return fileMd5; - } - - public void setFileMd5(String fileMd5) { - this.fileMd5 = fileMd5 == null ? null : fileMd5.trim(); - } - - public String getFileName() { - return fileName; - } - - public void setFileName(String fileName) { - this.fileName = fileName == null ? null : fileName.trim(); - } - - public String getRealName() { - return realName; - } - - public void setRealName(String realName) { - this.realName = realName == null ? null : realName.trim(); - } - - public String getFilePath() { - return filePath; - } - - public void setFilePath(String filePath) { - this.filePath = filePath == null ? null : filePath.trim(); - } - - public String getFileFullPath() { - return fileFullPath; - } - - public void setFileFullPath(String fileFullPath) { - this.fileFullPath = fileFullPath == null ? null : fileFullPath.trim(); - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AnchorBillCheckExample.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AnchorBillCheckExample.java deleted file mode 100644 index eb9c70ec4..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AnchorBillCheckExample.java +++ /dev/null @@ -1,1271 +0,0 @@ -package com.accompany.business.model; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class AnchorBillCheckExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - private Integer limit; - - private Integer offset; - - public AnchorBillCheckExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - public void setLimit(Integer limit) { - this.limit = limit; - } - - public Integer getLimit() { - return limit; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } - - public Integer getOffset() { - return offset; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andAdminIdIsNull() { - addCriterion("admin_id is null"); - return (Criteria) this; - } - - public Criteria andAdminIdIsNotNull() { - addCriterion("admin_id is not null"); - return (Criteria) this; - } - - public Criteria andAdminIdEqualTo(Integer value) { - addCriterion("admin_id =", value, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdNotEqualTo(Integer value) { - addCriterion("admin_id <>", value, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdGreaterThan(Integer value) { - addCriterion("admin_id >", value, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdGreaterThanOrEqualTo(Integer value) { - addCriterion("admin_id >=", value, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdLessThan(Integer value) { - addCriterion("admin_id <", value, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdLessThanOrEqualTo(Integer value) { - addCriterion("admin_id <=", value, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdIn(List values) { - addCriterion("admin_id in", values, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdNotIn(List values) { - addCriterion("admin_id not in", values, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdBetween(Integer value1, Integer value2) { - addCriterion("admin_id between", value1, value2, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdNotBetween(Integer value1, Integer value2) { - addCriterion("admin_id not between", value1, value2, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminNameIsNull() { - addCriterion("admin_name is null"); - return (Criteria) this; - } - - public Criteria andAdminNameIsNotNull() { - addCriterion("admin_name is not null"); - return (Criteria) this; - } - - public Criteria andAdminNameEqualTo(String value) { - addCriterion("admin_name =", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameNotEqualTo(String value) { - addCriterion("admin_name <>", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameGreaterThan(String value) { - addCriterion("admin_name >", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameGreaterThanOrEqualTo(String value) { - addCriterion("admin_name >=", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameLessThan(String value) { - addCriterion("admin_name <", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameLessThanOrEqualTo(String value) { - addCriterion("admin_name <=", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameLike(String value) { - addCriterion("admin_name like", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameNotLike(String value) { - addCriterion("admin_name not like", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameIn(List values) { - addCriterion("admin_name in", values, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameNotIn(List values) { - addCriterion("admin_name not in", values, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameBetween(String value1, String value2) { - addCriterion("admin_name between", value1, value2, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameNotBetween(String value1, String value2) { - addCriterion("admin_name not between", value1, value2, "adminName"); - return (Criteria) this; - } - - public Criteria andUploadTimeIsNull() { - addCriterion("upload_time is null"); - return (Criteria) this; - } - - public Criteria andUploadTimeIsNotNull() { - addCriterion("upload_time is not null"); - return (Criteria) this; - } - - public Criteria andUploadTimeEqualTo(Date value) { - addCriterion("upload_time =", value, "uploadTime"); - return (Criteria) this; - } - - public Criteria andUploadTimeNotEqualTo(Date value) { - addCriterion("upload_time <>", value, "uploadTime"); - return (Criteria) this; - } - - public Criteria andUploadTimeGreaterThan(Date value) { - addCriterion("upload_time >", value, "uploadTime"); - return (Criteria) this; - } - - public Criteria andUploadTimeGreaterThanOrEqualTo(Date value) { - addCriterion("upload_time >=", value, "uploadTime"); - return (Criteria) this; - } - - public Criteria andUploadTimeLessThan(Date value) { - addCriterion("upload_time <", value, "uploadTime"); - return (Criteria) this; - } - - public Criteria andUploadTimeLessThanOrEqualTo(Date value) { - addCriterion("upload_time <=", value, "uploadTime"); - return (Criteria) this; - } - - public Criteria andUploadTimeIn(List values) { - addCriterion("upload_time in", values, "uploadTime"); - return (Criteria) this; - } - - public Criteria andUploadTimeNotIn(List values) { - addCriterion("upload_time not in", values, "uploadTime"); - return (Criteria) this; - } - - public Criteria andUploadTimeBetween(Date value1, Date value2) { - addCriterion("upload_time between", value1, value2, "uploadTime"); - return (Criteria) this; - } - - public Criteria andUploadTimeNotBetween(Date value1, Date value2) { - addCriterion("upload_time not between", value1, value2, "uploadTime"); - return (Criteria) this; - } - - public Criteria andRemarkIsNull() { - addCriterion("remark is null"); - return (Criteria) this; - } - - public Criteria andRemarkIsNotNull() { - addCriterion("remark is not null"); - return (Criteria) this; - } - - public Criteria andRemarkEqualTo(String value) { - addCriterion("remark =", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkNotEqualTo(String value) { - addCriterion("remark <>", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkGreaterThan(String value) { - addCriterion("remark >", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkGreaterThanOrEqualTo(String value) { - addCriterion("remark >=", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkLessThan(String value) { - addCriterion("remark <", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkLessThanOrEqualTo(String value) { - addCriterion("remark <=", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkLike(String value) { - addCriterion("remark like", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkNotLike(String value) { - addCriterion("remark not like", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkIn(List values) { - addCriterion("remark in", values, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkNotIn(List values) { - addCriterion("remark not in", values, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkBetween(String value1, String value2) { - addCriterion("remark between", value1, value2, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkNotBetween(String value1, String value2) { - addCriterion("remark not between", value1, value2, "remark"); - return (Criteria) this; - } - - public Criteria andStatusIsNull() { - addCriterion("`status` is null"); - return (Criteria) this; - } - - public Criteria andStatusIsNotNull() { - addCriterion("`status` is not null"); - return (Criteria) this; - } - - public Criteria andStatusEqualTo(Integer value) { - addCriterion("`status` =", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotEqualTo(Integer value) { - addCriterion("`status` <>", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThan(Integer value) { - addCriterion("`status` >", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThanOrEqualTo(Integer value) { - addCriterion("`status` >=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThan(Integer value) { - addCriterion("`status` <", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThanOrEqualTo(Integer value) { - addCriterion("`status` <=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusIn(List values) { - addCriterion("`status` in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotIn(List values) { - addCriterion("`status` not in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusBetween(Integer value1, Integer value2) { - addCriterion("`status` between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotBetween(Integer value1, Integer value2) { - addCriterion("`status` not between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andCheckAdminIdIsNull() { - addCriterion("check_admin_id is null"); - return (Criteria) this; - } - - public Criteria andCheckAdminIdIsNotNull() { - addCriterion("check_admin_id is not null"); - return (Criteria) this; - } - - public Criteria andCheckAdminIdEqualTo(Integer value) { - addCriterion("check_admin_id =", value, "checkAdminId"); - return (Criteria) this; - } - - public Criteria andCheckAdminIdNotEqualTo(Integer value) { - addCriterion("check_admin_id <>", value, "checkAdminId"); - return (Criteria) this; - } - - public Criteria andCheckAdminIdGreaterThan(Integer value) { - addCriterion("check_admin_id >", value, "checkAdminId"); - return (Criteria) this; - } - - public Criteria andCheckAdminIdGreaterThanOrEqualTo(Integer value) { - addCriterion("check_admin_id >=", value, "checkAdminId"); - return (Criteria) this; - } - - public Criteria andCheckAdminIdLessThan(Integer value) { - addCriterion("check_admin_id <", value, "checkAdminId"); - return (Criteria) this; - } - - public Criteria andCheckAdminIdLessThanOrEqualTo(Integer value) { - addCriterion("check_admin_id <=", value, "checkAdminId"); - return (Criteria) this; - } - - public Criteria andCheckAdminIdIn(List values) { - addCriterion("check_admin_id in", values, "checkAdminId"); - return (Criteria) this; - } - - public Criteria andCheckAdminIdNotIn(List values) { - addCriterion("check_admin_id not in", values, "checkAdminId"); - return (Criteria) this; - } - - public Criteria andCheckAdminIdBetween(Integer value1, Integer value2) { - addCriterion("check_admin_id between", value1, value2, "checkAdminId"); - return (Criteria) this; - } - - public Criteria andCheckAdminIdNotBetween(Integer value1, Integer value2) { - addCriterion("check_admin_id not between", value1, value2, "checkAdminId"); - return (Criteria) this; - } - - public Criteria andCheckAdminNameIsNull() { - addCriterion("check_admin_name is null"); - return (Criteria) this; - } - - public Criteria andCheckAdminNameIsNotNull() { - addCriterion("check_admin_name is not null"); - return (Criteria) this; - } - - public Criteria andCheckAdminNameEqualTo(String value) { - addCriterion("check_admin_name =", value, "checkAdminName"); - return (Criteria) this; - } - - public Criteria andCheckAdminNameNotEqualTo(String value) { - addCriterion("check_admin_name <>", value, "checkAdminName"); - return (Criteria) this; - } - - public Criteria andCheckAdminNameGreaterThan(String value) { - addCriterion("check_admin_name >", value, "checkAdminName"); - return (Criteria) this; - } - - public Criteria andCheckAdminNameGreaterThanOrEqualTo(String value) { - addCriterion("check_admin_name >=", value, "checkAdminName"); - return (Criteria) this; - } - - public Criteria andCheckAdminNameLessThan(String value) { - addCriterion("check_admin_name <", value, "checkAdminName"); - return (Criteria) this; - } - - public Criteria andCheckAdminNameLessThanOrEqualTo(String value) { - addCriterion("check_admin_name <=", value, "checkAdminName"); - return (Criteria) this; - } - - public Criteria andCheckAdminNameLike(String value) { - addCriterion("check_admin_name like", value, "checkAdminName"); - return (Criteria) this; - } - - public Criteria andCheckAdminNameNotLike(String value) { - addCriterion("check_admin_name not like", value, "checkAdminName"); - return (Criteria) this; - } - - public Criteria andCheckAdminNameIn(List values) { - addCriterion("check_admin_name in", values, "checkAdminName"); - return (Criteria) this; - } - - public Criteria andCheckAdminNameNotIn(List values) { - addCriterion("check_admin_name not in", values, "checkAdminName"); - return (Criteria) this; - } - - public Criteria andCheckAdminNameBetween(String value1, String value2) { - addCriterion("check_admin_name between", value1, value2, "checkAdminName"); - return (Criteria) this; - } - - public Criteria andCheckAdminNameNotBetween(String value1, String value2) { - addCriterion("check_admin_name not between", value1, value2, "checkAdminName"); - return (Criteria) this; - } - - public Criteria andCheckTimeIsNull() { - addCriterion("check_time is null"); - return (Criteria) this; - } - - public Criteria andCheckTimeIsNotNull() { - addCriterion("check_time is not null"); - return (Criteria) this; - } - - public Criteria andCheckTimeEqualTo(Date value) { - addCriterion("check_time =", value, "checkTime"); - return (Criteria) this; - } - - public Criteria andCheckTimeNotEqualTo(Date value) { - addCriterion("check_time <>", value, "checkTime"); - return (Criteria) this; - } - - public Criteria andCheckTimeGreaterThan(Date value) { - addCriterion("check_time >", value, "checkTime"); - return (Criteria) this; - } - - public Criteria andCheckTimeGreaterThanOrEqualTo(Date value) { - addCriterion("check_time >=", value, "checkTime"); - return (Criteria) this; - } - - public Criteria andCheckTimeLessThan(Date value) { - addCriterion("check_time <", value, "checkTime"); - return (Criteria) this; - } - - public Criteria andCheckTimeLessThanOrEqualTo(Date value) { - addCriterion("check_time <=", value, "checkTime"); - return (Criteria) this; - } - - public Criteria andCheckTimeIn(List values) { - addCriterion("check_time in", values, "checkTime"); - return (Criteria) this; - } - - public Criteria andCheckTimeNotIn(List values) { - addCriterion("check_time not in", values, "checkTime"); - return (Criteria) this; - } - - public Criteria andCheckTimeBetween(Date value1, Date value2) { - addCriterion("check_time between", value1, value2, "checkTime"); - return (Criteria) this; - } - - public Criteria andCheckTimeNotBetween(Date value1, Date value2) { - addCriterion("check_time not between", value1, value2, "checkTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNull() { - addCriterion("update_time is null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNotNull() { - addCriterion("update_time is not null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeEqualTo(Date value) { - addCriterion("update_time =", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotEqualTo(Date value) { - addCriterion("update_time <>", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThan(Date value) { - addCriterion("update_time >", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("update_time >=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThan(Date value) { - addCriterion("update_time <", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { - addCriterion("update_time <=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIn(List values) { - addCriterion("update_time in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotIn(List values) { - addCriterion("update_time not in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeBetween(Date value1, Date value2) { - addCriterion("update_time between", value1, value2, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { - addCriterion("update_time not between", value1, value2, "updateTime"); - return (Criteria) this; - } - - public Criteria andCheckRemarkIsNull() { - addCriterion("check_remark is null"); - return (Criteria) this; - } - - public Criteria andCheckRemarkIsNotNull() { - addCriterion("check_remark is not null"); - return (Criteria) this; - } - - public Criteria andCheckRemarkEqualTo(String value) { - addCriterion("check_remark =", value, "checkRemark"); - return (Criteria) this; - } - - public Criteria andCheckRemarkNotEqualTo(String value) { - addCriterion("check_remark <>", value, "checkRemark"); - return (Criteria) this; - } - - public Criteria andCheckRemarkGreaterThan(String value) { - addCriterion("check_remark >", value, "checkRemark"); - return (Criteria) this; - } - - public Criteria andCheckRemarkGreaterThanOrEqualTo(String value) { - addCriterion("check_remark >=", value, "checkRemark"); - return (Criteria) this; - } - - public Criteria andCheckRemarkLessThan(String value) { - addCriterion("check_remark <", value, "checkRemark"); - return (Criteria) this; - } - - public Criteria andCheckRemarkLessThanOrEqualTo(String value) { - addCriterion("check_remark <=", value, "checkRemark"); - return (Criteria) this; - } - - public Criteria andCheckRemarkLike(String value) { - addCriterion("check_remark like", value, "checkRemark"); - return (Criteria) this; - } - - public Criteria andCheckRemarkNotLike(String value) { - addCriterion("check_remark not like", value, "checkRemark"); - return (Criteria) this; - } - - public Criteria andCheckRemarkIn(List values) { - addCriterion("check_remark in", values, "checkRemark"); - return (Criteria) this; - } - - public Criteria andCheckRemarkNotIn(List values) { - addCriterion("check_remark not in", values, "checkRemark"); - return (Criteria) this; - } - - public Criteria andCheckRemarkBetween(String value1, String value2) { - addCriterion("check_remark between", value1, value2, "checkRemark"); - return (Criteria) this; - } - - public Criteria andCheckRemarkNotBetween(String value1, String value2) { - addCriterion("check_remark not between", value1, value2, "checkRemark"); - return (Criteria) this; - } - - public Criteria andFileMd5IsNull() { - addCriterion("file_md5 is null"); - return (Criteria) this; - } - - public Criteria andFileMd5IsNotNull() { - addCriterion("file_md5 is not null"); - return (Criteria) this; - } - - public Criteria andFileMd5EqualTo(String value) { - addCriterion("file_md5 =", value, "fileMd5"); - return (Criteria) this; - } - - public Criteria andFileMd5NotEqualTo(String value) { - addCriterion("file_md5 <>", value, "fileMd5"); - return (Criteria) this; - } - - public Criteria andFileMd5GreaterThan(String value) { - addCriterion("file_md5 >", value, "fileMd5"); - return (Criteria) this; - } - - public Criteria andFileMd5GreaterThanOrEqualTo(String value) { - addCriterion("file_md5 >=", value, "fileMd5"); - return (Criteria) this; - } - - public Criteria andFileMd5LessThan(String value) { - addCriterion("file_md5 <", value, "fileMd5"); - return (Criteria) this; - } - - public Criteria andFileMd5LessThanOrEqualTo(String value) { - addCriterion("file_md5 <=", value, "fileMd5"); - return (Criteria) this; - } - - public Criteria andFileMd5Like(String value) { - addCriterion("file_md5 like", value, "fileMd5"); - return (Criteria) this; - } - - public Criteria andFileMd5NotLike(String value) { - addCriterion("file_md5 not like", value, "fileMd5"); - return (Criteria) this; - } - - public Criteria andFileMd5In(List values) { - addCriterion("file_md5 in", values, "fileMd5"); - return (Criteria) this; - } - - public Criteria andFileMd5NotIn(List values) { - addCriterion("file_md5 not in", values, "fileMd5"); - return (Criteria) this; - } - - public Criteria andFileMd5Between(String value1, String value2) { - addCriterion("file_md5 between", value1, value2, "fileMd5"); - return (Criteria) this; - } - - public Criteria andFileMd5NotBetween(String value1, String value2) { - addCriterion("file_md5 not between", value1, value2, "fileMd5"); - return (Criteria) this; - } - - public Criteria andFileNameIsNull() { - addCriterion("file_name is null"); - return (Criteria) this; - } - - public Criteria andFileNameIsNotNull() { - addCriterion("file_name is not null"); - return (Criteria) this; - } - - public Criteria andFileNameEqualTo(String value) { - addCriterion("file_name =", value, "fileName"); - return (Criteria) this; - } - - public Criteria andFileNameNotEqualTo(String value) { - addCriterion("file_name <>", value, "fileName"); - return (Criteria) this; - } - - public Criteria andFileNameGreaterThan(String value) { - addCriterion("file_name >", value, "fileName"); - return (Criteria) this; - } - - public Criteria andFileNameGreaterThanOrEqualTo(String value) { - addCriterion("file_name >=", value, "fileName"); - return (Criteria) this; - } - - public Criteria andFileNameLessThan(String value) { - addCriterion("file_name <", value, "fileName"); - return (Criteria) this; - } - - public Criteria andFileNameLessThanOrEqualTo(String value) { - addCriterion("file_name <=", value, "fileName"); - return (Criteria) this; - } - - public Criteria andFileNameLike(String value) { - addCriterion("file_name like", value, "fileName"); - return (Criteria) this; - } - - public Criteria andFileNameNotLike(String value) { - addCriterion("file_name not like", value, "fileName"); - return (Criteria) this; - } - - public Criteria andFileNameIn(List values) { - addCriterion("file_name in", values, "fileName"); - return (Criteria) this; - } - - public Criteria andFileNameNotIn(List values) { - addCriterion("file_name not in", values, "fileName"); - return (Criteria) this; - } - - public Criteria andFileNameBetween(String value1, String value2) { - addCriterion("file_name between", value1, value2, "fileName"); - return (Criteria) this; - } - - public Criteria andFileNameNotBetween(String value1, String value2) { - addCriterion("file_name not between", value1, value2, "fileName"); - return (Criteria) this; - } - - public Criteria andRealNameIsNull() { - addCriterion("real_name is null"); - return (Criteria) this; - } - - public Criteria andRealNameIsNotNull() { - addCriterion("real_name is not null"); - return (Criteria) this; - } - - public Criteria andRealNameEqualTo(String value) { - addCriterion("real_name =", value, "realName"); - return (Criteria) this; - } - - public Criteria andRealNameNotEqualTo(String value) { - addCriterion("real_name <>", value, "realName"); - return (Criteria) this; - } - - public Criteria andRealNameGreaterThan(String value) { - addCriterion("real_name >", value, "realName"); - return (Criteria) this; - } - - public Criteria andRealNameGreaterThanOrEqualTo(String value) { - addCriterion("real_name >=", value, "realName"); - return (Criteria) this; - } - - public Criteria andRealNameLessThan(String value) { - addCriterion("real_name <", value, "realName"); - return (Criteria) this; - } - - public Criteria andRealNameLessThanOrEqualTo(String value) { - addCriterion("real_name <=", value, "realName"); - return (Criteria) this; - } - - public Criteria andRealNameLike(String value) { - addCriterion("real_name like", value, "realName"); - return (Criteria) this; - } - - public Criteria andRealNameNotLike(String value) { - addCriterion("real_name not like", value, "realName"); - return (Criteria) this; - } - - public Criteria andRealNameIn(List values) { - addCriterion("real_name in", values, "realName"); - return (Criteria) this; - } - - public Criteria andRealNameNotIn(List values) { - addCriterion("real_name not in", values, "realName"); - return (Criteria) this; - } - - public Criteria andRealNameBetween(String value1, String value2) { - addCriterion("real_name between", value1, value2, "realName"); - return (Criteria) this; - } - - public Criteria andRealNameNotBetween(String value1, String value2) { - addCriterion("real_name not between", value1, value2, "realName"); - return (Criteria) this; - } - - public Criteria andFilePathIsNull() { - addCriterion("file_path is null"); - return (Criteria) this; - } - - public Criteria andFilePathIsNotNull() { - addCriterion("file_path is not null"); - return (Criteria) this; - } - - public Criteria andFilePathEqualTo(String value) { - addCriterion("file_path =", value, "filePath"); - return (Criteria) this; - } - - public Criteria andFilePathNotEqualTo(String value) { - addCriterion("file_path <>", value, "filePath"); - return (Criteria) this; - } - - public Criteria andFilePathGreaterThan(String value) { - addCriterion("file_path >", value, "filePath"); - return (Criteria) this; - } - - public Criteria andFilePathGreaterThanOrEqualTo(String value) { - addCriterion("file_path >=", value, "filePath"); - return (Criteria) this; - } - - public Criteria andFilePathLessThan(String value) { - addCriterion("file_path <", value, "filePath"); - return (Criteria) this; - } - - public Criteria andFilePathLessThanOrEqualTo(String value) { - addCriterion("file_path <=", value, "filePath"); - return (Criteria) this; - } - - public Criteria andFilePathLike(String value) { - addCriterion("file_path like", value, "filePath"); - return (Criteria) this; - } - - public Criteria andFilePathNotLike(String value) { - addCriterion("file_path not like", value, "filePath"); - return (Criteria) this; - } - - public Criteria andFilePathIn(List values) { - addCriterion("file_path in", values, "filePath"); - return (Criteria) this; - } - - public Criteria andFilePathNotIn(List values) { - addCriterion("file_path not in", values, "filePath"); - return (Criteria) this; - } - - public Criteria andFilePathBetween(String value1, String value2) { - addCriterion("file_path between", value1, value2, "filePath"); - return (Criteria) this; - } - - public Criteria andFilePathNotBetween(String value1, String value2) { - addCriterion("file_path not between", value1, value2, "filePath"); - return (Criteria) this; - } - - public Criteria andFileFullPathIsNull() { - addCriterion("file_full_path is null"); - return (Criteria) this; - } - - public Criteria andFileFullPathIsNotNull() { - addCriterion("file_full_path is not null"); - return (Criteria) this; - } - - public Criteria andFileFullPathEqualTo(String value) { - addCriterion("file_full_path =", value, "fileFullPath"); - return (Criteria) this; - } - - public Criteria andFileFullPathNotEqualTo(String value) { - addCriterion("file_full_path <>", value, "fileFullPath"); - return (Criteria) this; - } - - public Criteria andFileFullPathGreaterThan(String value) { - addCriterion("file_full_path >", value, "fileFullPath"); - return (Criteria) this; - } - - public Criteria andFileFullPathGreaterThanOrEqualTo(String value) { - addCriterion("file_full_path >=", value, "fileFullPath"); - return (Criteria) this; - } - - public Criteria andFileFullPathLessThan(String value) { - addCriterion("file_full_path <", value, "fileFullPath"); - return (Criteria) this; - } - - public Criteria andFileFullPathLessThanOrEqualTo(String value) { - addCriterion("file_full_path <=", value, "fileFullPath"); - return (Criteria) this; - } - - public Criteria andFileFullPathLike(String value) { - addCriterion("file_full_path like", value, "fileFullPath"); - return (Criteria) this; - } - - public Criteria andFileFullPathNotLike(String value) { - addCriterion("file_full_path not like", value, "fileFullPath"); - return (Criteria) this; - } - - public Criteria andFileFullPathIn(List values) { - addCriterion("file_full_path in", values, "fileFullPath"); - return (Criteria) this; - } - - public Criteria andFileFullPathNotIn(List values) { - addCriterion("file_full_path not in", values, "fileFullPath"); - return (Criteria) this; - } - - public Criteria andFileFullPathBetween(String value1, String value2) { - addCriterion("file_full_path between", value1, value2, "fileFullPath"); - return (Criteria) this; - } - - public Criteria andFileFullPathNotBetween(String value1, String value2) { - addCriterion("file_full_path not between", value1, value2, "fileFullPath"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AnchorBillRecord.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AnchorBillRecord.java deleted file mode 100644 index be92a0f8d..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AnchorBillRecord.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.accompany.business.model; - -import java.util.Date; - -public class AnchorBillRecord { - private Long id; - - private Long uid; - - private Long qingxunNo; - - private String nick; - - private String avatar; - - private Long goldNum; - - private Double diamondNum; - - private Integer adminId; - - private String adminName; - - private Date createTime; - - private Date updateTime; - - private String remark; - - private Integer status; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Long getUid() { - return uid; - } - - public void setUid(Long uid) { - this.uid = uid; - } - - public Long getQingxunNo() { - return qingxunNo; - } - - public void setQingxunNo(Long qingxunNo) { - this.qingxunNo = qingxunNo; - } - - public String getNick() { - return nick; - } - - public void setNick(String nick) { - this.nick = nick == null ? null : nick.trim(); - } - - public String getAvatar() { - return avatar; - } - - public void setAvatar(String avatar) { - this.avatar = avatar == null ? null : avatar.trim(); - } - - public Long getGoldNum() { - return goldNum; - } - - public void setGoldNum(Long goldNum) { - this.goldNum = goldNum; - } - - public Double getDiamondNum() { - return diamondNum; - } - - public void setDiamondNum(Double diamondNum) { - this.diamondNum = diamondNum; - } - - public Integer getAdminId() { - return adminId; - } - - public void setAdminId(Integer adminId) { - this.adminId = adminId; - } - - public String getAdminName() { - return adminName; - } - - public void setAdminName(String adminName) { - this.adminName = adminName == null ? null : adminName.trim(); - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark == null ? null : remark.trim(); - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AnchorBillRecordExample.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AnchorBillRecordExample.java deleted file mode 100644 index ed4946fb7..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AnchorBillRecordExample.java +++ /dev/null @@ -1,1041 +0,0 @@ -package com.accompany.business.model; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class AnchorBillRecordExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - private Integer limit; - - private Integer offset; - - public AnchorBillRecordExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - public void setLimit(Integer limit) { - this.limit = limit; - } - - public Integer getLimit() { - return limit; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } - - public Integer getOffset() { - return offset; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andUidIsNull() { - addCriterion("`uid` is null"); - return (Criteria) this; - } - - public Criteria andUidIsNotNull() { - addCriterion("`uid` is not null"); - return (Criteria) this; - } - - public Criteria andUidEqualTo(Long value) { - addCriterion("`uid` =", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotEqualTo(Long value) { - addCriterion("`uid` <>", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidGreaterThan(Long value) { - addCriterion("`uid` >", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidGreaterThanOrEqualTo(Long value) { - addCriterion("`uid` >=", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidLessThan(Long value) { - addCriterion("`uid` <", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidLessThanOrEqualTo(Long value) { - addCriterion("`uid` <=", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidIn(List values) { - addCriterion("`uid` in", values, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotIn(List values) { - addCriterion("`uid` not in", values, "uid"); - return (Criteria) this; - } - - public Criteria andUidBetween(Long value1, Long value2) { - addCriterion("`uid` between", value1, value2, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotBetween(Long value1, Long value2) { - addCriterion("`uid` not between", value1, value2, "uid"); - return (Criteria) this; - } - - public Criteria andQingxunNoIsNull() { - addCriterion("qingxun_no is null"); - return (Criteria) this; - } - - public Criteria andQingxunNoIsNotNull() { - addCriterion("qingxun_no is not null"); - return (Criteria) this; - } - - public Criteria andQingxunNoEqualTo(Long value) { - addCriterion("qingxun_no =", value, "qingxunNo"); - return (Criteria) this; - } - - public Criteria andQingxunNoNotEqualTo(Long value) { - addCriterion("qingxun_no <>", value, "qingxunNo"); - return (Criteria) this; - } - - public Criteria andQingxunNoGreaterThan(Long value) { - addCriterion("qingxun_no >", value, "qingxunNo"); - return (Criteria) this; - } - - public Criteria andQingxunNoGreaterThanOrEqualTo(Long value) { - addCriterion("qingxun_no >=", value, "qingxunNo"); - return (Criteria) this; - } - - public Criteria andQingxunNoLessThan(Long value) { - addCriterion("qingxun_no <", value, "qingxunNo"); - return (Criteria) this; - } - - public Criteria andQingxunNoLessThanOrEqualTo(Long value) { - addCriterion("qingxun_no <=", value, "qingxunNo"); - return (Criteria) this; - } - - public Criteria andQingxunNoIn(List values) { - addCriterion("qingxun_no in", values, "qingxunNo"); - return (Criteria) this; - } - - public Criteria andQingxunNoNotIn(List values) { - addCriterion("qingxun_no not in", values, "qingxunNo"); - return (Criteria) this; - } - - public Criteria andQingxunNoBetween(Long value1, Long value2) { - addCriterion("qingxun_no between", value1, value2, "qingxunNo"); - return (Criteria) this; - } - - public Criteria andQingxunNoNotBetween(Long value1, Long value2) { - addCriterion("qingxun_no not between", value1, value2, "qingxunNo"); - return (Criteria) this; - } - - public Criteria andNickIsNull() { - addCriterion("nick is null"); - return (Criteria) this; - } - - public Criteria andNickIsNotNull() { - addCriterion("nick is not null"); - return (Criteria) this; - } - - public Criteria andNickEqualTo(String value) { - addCriterion("nick =", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickNotEqualTo(String value) { - addCriterion("nick <>", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickGreaterThan(String value) { - addCriterion("nick >", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickGreaterThanOrEqualTo(String value) { - addCriterion("nick >=", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickLessThan(String value) { - addCriterion("nick <", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickLessThanOrEqualTo(String value) { - addCriterion("nick <=", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickLike(String value) { - addCriterion("nick like", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickNotLike(String value) { - addCriterion("nick not like", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickIn(List values) { - addCriterion("nick in", values, "nick"); - return (Criteria) this; - } - - public Criteria andNickNotIn(List values) { - addCriterion("nick not in", values, "nick"); - return (Criteria) this; - } - - public Criteria andNickBetween(String value1, String value2) { - addCriterion("nick between", value1, value2, "nick"); - return (Criteria) this; - } - - public Criteria andNickNotBetween(String value1, String value2) { - addCriterion("nick not between", value1, value2, "nick"); - return (Criteria) this; - } - - public Criteria andAvatarIsNull() { - addCriterion("avatar is null"); - return (Criteria) this; - } - - public Criteria andAvatarIsNotNull() { - addCriterion("avatar is not null"); - return (Criteria) this; - } - - public Criteria andAvatarEqualTo(String value) { - addCriterion("avatar =", value, "avatar"); - return (Criteria) this; - } - - public Criteria andAvatarNotEqualTo(String value) { - addCriterion("avatar <>", value, "avatar"); - return (Criteria) this; - } - - public Criteria andAvatarGreaterThan(String value) { - addCriterion("avatar >", value, "avatar"); - return (Criteria) this; - } - - public Criteria andAvatarGreaterThanOrEqualTo(String value) { - addCriterion("avatar >=", value, "avatar"); - return (Criteria) this; - } - - public Criteria andAvatarLessThan(String value) { - addCriterion("avatar <", value, "avatar"); - return (Criteria) this; - } - - public Criteria andAvatarLessThanOrEqualTo(String value) { - addCriterion("avatar <=", value, "avatar"); - return (Criteria) this; - } - - public Criteria andAvatarLike(String value) { - addCriterion("avatar like", value, "avatar"); - return (Criteria) this; - } - - public Criteria andAvatarNotLike(String value) { - addCriterion("avatar not like", value, "avatar"); - return (Criteria) this; - } - - public Criteria andAvatarIn(List values) { - addCriterion("avatar in", values, "avatar"); - return (Criteria) this; - } - - public Criteria andAvatarNotIn(List values) { - addCriterion("avatar not in", values, "avatar"); - return (Criteria) this; - } - - public Criteria andAvatarBetween(String value1, String value2) { - addCriterion("avatar between", value1, value2, "avatar"); - return (Criteria) this; - } - - public Criteria andAvatarNotBetween(String value1, String value2) { - addCriterion("avatar not between", value1, value2, "avatar"); - return (Criteria) this; - } - - public Criteria andGoldNumIsNull() { - addCriterion("gold_num is null"); - return (Criteria) this; - } - - public Criteria andGoldNumIsNotNull() { - addCriterion("gold_num is not null"); - return (Criteria) this; - } - - public Criteria andGoldNumEqualTo(Long value) { - addCriterion("gold_num =", value, "goldNum"); - return (Criteria) this; - } - - public Criteria andGoldNumNotEqualTo(Long value) { - addCriterion("gold_num <>", value, "goldNum"); - return (Criteria) this; - } - - public Criteria andGoldNumGreaterThan(Long value) { - addCriterion("gold_num >", value, "goldNum"); - return (Criteria) this; - } - - public Criteria andGoldNumGreaterThanOrEqualTo(Long value) { - addCriterion("gold_num >=", value, "goldNum"); - return (Criteria) this; - } - - public Criteria andGoldNumLessThan(Long value) { - addCriterion("gold_num <", value, "goldNum"); - return (Criteria) this; - } - - public Criteria andGoldNumLessThanOrEqualTo(Long value) { - addCriterion("gold_num <=", value, "goldNum"); - return (Criteria) this; - } - - public Criteria andGoldNumIn(List values) { - addCriterion("gold_num in", values, "goldNum"); - return (Criteria) this; - } - - public Criteria andGoldNumNotIn(List values) { - addCriterion("gold_num not in", values, "goldNum"); - return (Criteria) this; - } - - public Criteria andGoldNumBetween(Long value1, Long value2) { - addCriterion("gold_num between", value1, value2, "goldNum"); - return (Criteria) this; - } - - public Criteria andGoldNumNotBetween(Long value1, Long value2) { - addCriterion("gold_num not between", value1, value2, "goldNum"); - return (Criteria) this; - } - - public Criteria andDiamondNumIsNull() { - addCriterion("diamond_num is null"); - return (Criteria) this; - } - - public Criteria andDiamondNumIsNotNull() { - addCriterion("diamond_num is not null"); - return (Criteria) this; - } - - public Criteria andDiamondNumEqualTo(Double value) { - addCriterion("diamond_num =", value, "diamondNum"); - return (Criteria) this; - } - - public Criteria andDiamondNumNotEqualTo(Double value) { - addCriterion("diamond_num <>", value, "diamondNum"); - return (Criteria) this; - } - - public Criteria andDiamondNumGreaterThan(Double value) { - addCriterion("diamond_num >", value, "diamondNum"); - return (Criteria) this; - } - - public Criteria andDiamondNumGreaterThanOrEqualTo(Double value) { - addCriterion("diamond_num >=", value, "diamondNum"); - return (Criteria) this; - } - - public Criteria andDiamondNumLessThan(Double value) { - addCriterion("diamond_num <", value, "diamondNum"); - return (Criteria) this; - } - - public Criteria andDiamondNumLessThanOrEqualTo(Double value) { - addCriterion("diamond_num <=", value, "diamondNum"); - return (Criteria) this; - } - - public Criteria andDiamondNumIn(List values) { - addCriterion("diamond_num in", values, "diamondNum"); - return (Criteria) this; - } - - public Criteria andDiamondNumNotIn(List values) { - addCriterion("diamond_num not in", values, "diamondNum"); - return (Criteria) this; - } - - public Criteria andDiamondNumBetween(Double value1, Double value2) { - addCriterion("diamond_num between", value1, value2, "diamondNum"); - return (Criteria) this; - } - - public Criteria andDiamondNumNotBetween(Double value1, Double value2) { - addCriterion("diamond_num not between", value1, value2, "diamondNum"); - return (Criteria) this; - } - - public Criteria andAdminIdIsNull() { - addCriterion("admin_id is null"); - return (Criteria) this; - } - - public Criteria andAdminIdIsNotNull() { - addCriterion("admin_id is not null"); - return (Criteria) this; - } - - public Criteria andAdminIdEqualTo(Integer value) { - addCriterion("admin_id =", value, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdNotEqualTo(Integer value) { - addCriterion("admin_id <>", value, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdGreaterThan(Integer value) { - addCriterion("admin_id >", value, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdGreaterThanOrEqualTo(Integer value) { - addCriterion("admin_id >=", value, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdLessThan(Integer value) { - addCriterion("admin_id <", value, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdLessThanOrEqualTo(Integer value) { - addCriterion("admin_id <=", value, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdIn(List values) { - addCriterion("admin_id in", values, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdNotIn(List values) { - addCriterion("admin_id not in", values, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdBetween(Integer value1, Integer value2) { - addCriterion("admin_id between", value1, value2, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdNotBetween(Integer value1, Integer value2) { - addCriterion("admin_id not between", value1, value2, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminNameIsNull() { - addCriterion("admin_name is null"); - return (Criteria) this; - } - - public Criteria andAdminNameIsNotNull() { - addCriterion("admin_name is not null"); - return (Criteria) this; - } - - public Criteria andAdminNameEqualTo(String value) { - addCriterion("admin_name =", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameNotEqualTo(String value) { - addCriterion("admin_name <>", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameGreaterThan(String value) { - addCriterion("admin_name >", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameGreaterThanOrEqualTo(String value) { - addCriterion("admin_name >=", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameLessThan(String value) { - addCriterion("admin_name <", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameLessThanOrEqualTo(String value) { - addCriterion("admin_name <=", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameLike(String value) { - addCriterion("admin_name like", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameNotLike(String value) { - addCriterion("admin_name not like", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameIn(List values) { - addCriterion("admin_name in", values, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameNotIn(List values) { - addCriterion("admin_name not in", values, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameBetween(String value1, String value2) { - addCriterion("admin_name between", value1, value2, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameNotBetween(String value1, String value2) { - addCriterion("admin_name not between", value1, value2, "adminName"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNull() { - addCriterion("create_time is null"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNotNull() { - addCriterion("create_time is not null"); - return (Criteria) this; - } - - public Criteria andCreateTimeEqualTo(Date value) { - addCriterion("create_time =", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotEqualTo(Date value) { - addCriterion("create_time <>", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThan(Date value) { - addCriterion("create_time >", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("create_time >=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThan(Date value) { - addCriterion("create_time <", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThanOrEqualTo(Date value) { - addCriterion("create_time <=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeIn(List values) { - addCriterion("create_time in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotIn(List values) { - addCriterion("create_time not in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeBetween(Date value1, Date value2) { - addCriterion("create_time between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotBetween(Date value1, Date value2) { - addCriterion("create_time not between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNull() { - addCriterion("update_time is null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNotNull() { - addCriterion("update_time is not null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeEqualTo(Date value) { - addCriterion("update_time =", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotEqualTo(Date value) { - addCriterion("update_time <>", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThan(Date value) { - addCriterion("update_time >", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("update_time >=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThan(Date value) { - addCriterion("update_time <", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { - addCriterion("update_time <=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIn(List values) { - addCriterion("update_time in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotIn(List values) { - addCriterion("update_time not in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeBetween(Date value1, Date value2) { - addCriterion("update_time between", value1, value2, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { - addCriterion("update_time not between", value1, value2, "updateTime"); - return (Criteria) this; - } - - public Criteria andRemarkIsNull() { - addCriterion("remark is null"); - return (Criteria) this; - } - - public Criteria andRemarkIsNotNull() { - addCriterion("remark is not null"); - return (Criteria) this; - } - - public Criteria andRemarkEqualTo(String value) { - addCriterion("remark =", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkNotEqualTo(String value) { - addCriterion("remark <>", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkGreaterThan(String value) { - addCriterion("remark >", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkGreaterThanOrEqualTo(String value) { - addCriterion("remark >=", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkLessThan(String value) { - addCriterion("remark <", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkLessThanOrEqualTo(String value) { - addCriterion("remark <=", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkLike(String value) { - addCriterion("remark like", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkNotLike(String value) { - addCriterion("remark not like", value, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkIn(List values) { - addCriterion("remark in", values, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkNotIn(List values) { - addCriterion("remark not in", values, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkBetween(String value1, String value2) { - addCriterion("remark between", value1, value2, "remark"); - return (Criteria) this; - } - - public Criteria andRemarkNotBetween(String value1, String value2) { - addCriterion("remark not between", value1, value2, "remark"); - return (Criteria) this; - } - - public Criteria andStatusIsNull() { - addCriterion("`status` is null"); - return (Criteria) this; - } - - public Criteria andStatusIsNotNull() { - addCriterion("`status` is not null"); - return (Criteria) this; - } - - public Criteria andStatusEqualTo(Integer value) { - addCriterion("`status` =", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotEqualTo(Integer value) { - addCriterion("`status` <>", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThan(Integer value) { - addCriterion("`status` >", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThanOrEqualTo(Integer value) { - addCriterion("`status` >=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThan(Integer value) { - addCriterion("`status` <", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThanOrEqualTo(Integer value) { - addCriterion("`status` <=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusIn(List values) { - addCriterion("`status` in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotIn(List values) { - addCriterion("`status` not in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusBetween(Integer value1, Integer value2) { - addCriterion("`status` between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotBetween(Integer value1, Integer value2) { - addCriterion("`status` not between", value1, value2, "status"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AnchorWhitelist.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AnchorWhitelist.java deleted file mode 100644 index 97fb50f40..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AnchorWhitelist.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.accompany.business.model; - -import java.util.Date; - -public class AnchorWhitelist { - private Long uid; - - private Long erbanNo; - - private String nick; - - private Date operateTime; - - private String operateReason; - - private Integer status; - - private Integer adminId; - - private String adminName; - - public Long getUid() { - return uid; - } - - public void setUid(Long uid) { - this.uid = uid; - } - - public Long getErbanNo() { - return erbanNo; - } - - public void setErbanNo(Long erbanNo) { - this.erbanNo = erbanNo; - } - - public String getNick() { - return nick; - } - - public void setNick(String nick) { - this.nick = nick == null ? null : nick.trim(); - } - - public Date getOperateTime() { - return operateTime; - } - - public void setOperateTime(Date operateTime) { - this.operateTime = operateTime; - } - - public String getOperateReason() { - return operateReason; - } - - public void setOperateReason(String operateReason) { - this.operateReason = operateReason == null ? null : operateReason.trim(); - } - - public Integer getStatus() { - return status; - } - - public void setStatus(Integer status) { - this.status = status; - } - - public Integer getAdminId() { - return adminId; - } - - public void setAdminId(Integer adminId) { - this.adminId = adminId; - } - - public String getAdminName() { - return adminName; - } - - public void setAdminName(String adminName) { - this.adminName = adminName == null ? null : adminName.trim(); - } - - @Override - public String toString() { - return "AnchorWhitelist{" + - "uid=" + uid + - ", erbanNo=" + erbanNo + - ", nick='" + nick + '\'' + - ", operateTime=" + operateTime + - ", operateReason='" + operateReason + '\'' + - ", status=" + status + - ", adminId=" + adminId + - ", adminName='" + adminName + '\'' + - '}'; - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AnchorWhitelistExample.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AnchorWhitelistExample.java deleted file mode 100644 index 67c59fb91..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AnchorWhitelistExample.java +++ /dev/null @@ -1,731 +0,0 @@ -package com.accompany.business.model; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class AnchorWhitelistExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - private Integer limit; - - private Integer offset; - - public AnchorWhitelistExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - public void setLimit(Integer limit) { - this.limit = limit; - } - - public Integer getLimit() { - return limit; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } - - public Integer getOffset() { - return offset; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andUidIsNull() { - addCriterion("`uid` is null"); - return (Criteria) this; - } - - public Criteria andUidIsNotNull() { - addCriterion("`uid` is not null"); - return (Criteria) this; - } - - public Criteria andUidEqualTo(Long value) { - addCriterion("`uid` =", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotEqualTo(Long value) { - addCriterion("`uid` <>", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidGreaterThan(Long value) { - addCriterion("`uid` >", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidGreaterThanOrEqualTo(Long value) { - addCriterion("`uid` >=", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidLessThan(Long value) { - addCriterion("`uid` <", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidLessThanOrEqualTo(Long value) { - addCriterion("`uid` <=", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidIn(List values) { - addCriterion("`uid` in", values, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotIn(List values) { - addCriterion("`uid` not in", values, "uid"); - return (Criteria) this; - } - - public Criteria andUidBetween(Long value1, Long value2) { - addCriterion("`uid` between", value1, value2, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotBetween(Long value1, Long value2) { - addCriterion("`uid` not between", value1, value2, "uid"); - return (Criteria) this; - } - - public Criteria andErbanNoIsNull() { - addCriterion("erban_no is null"); - return (Criteria) this; - } - - public Criteria andErbanNoIsNotNull() { - addCriterion("erban_no is not null"); - return (Criteria) this; - } - - public Criteria andErbanNoEqualTo(Long value) { - addCriterion("erban_no =", value, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoNotEqualTo(Long value) { - addCriterion("erban_no <>", value, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoGreaterThan(Long value) { - addCriterion("erban_no >", value, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoGreaterThanOrEqualTo(Long value) { - addCriterion("erban_no >=", value, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoLessThan(Long value) { - addCriterion("erban_no <", value, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoLessThanOrEqualTo(Long value) { - addCriterion("erban_no <=", value, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoIn(List values) { - addCriterion("erban_no in", values, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoNotIn(List values) { - addCriterion("erban_no not in", values, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoBetween(Long value1, Long value2) { - addCriterion("erban_no between", value1, value2, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoNotBetween(Long value1, Long value2) { - addCriterion("erban_no not between", value1, value2, "erbanNo"); - return (Criteria) this; - } - - public Criteria andNickIsNull() { - addCriterion("nick is null"); - return (Criteria) this; - } - - public Criteria andNickIsNotNull() { - addCriterion("nick is not null"); - return (Criteria) this; - } - - public Criteria andNickEqualTo(String value) { - addCriterion("nick =", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickNotEqualTo(String value) { - addCriterion("nick <>", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickGreaterThan(String value) { - addCriterion("nick >", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickGreaterThanOrEqualTo(String value) { - addCriterion("nick >=", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickLessThan(String value) { - addCriterion("nick <", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickLessThanOrEqualTo(String value) { - addCriterion("nick <=", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickLike(String value) { - addCriterion("nick like", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickNotLike(String value) { - addCriterion("nick not like", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickIn(List values) { - addCriterion("nick in", values, "nick"); - return (Criteria) this; - } - - public Criteria andNickNotIn(List values) { - addCriterion("nick not in", values, "nick"); - return (Criteria) this; - } - - public Criteria andNickBetween(String value1, String value2) { - addCriterion("nick between", value1, value2, "nick"); - return (Criteria) this; - } - - public Criteria andNickNotBetween(String value1, String value2) { - addCriterion("nick not between", value1, value2, "nick"); - return (Criteria) this; - } - - public Criteria andOperateTimeIsNull() { - addCriterion("operate_time is null"); - return (Criteria) this; - } - - public Criteria andOperateTimeIsNotNull() { - addCriterion("operate_time is not null"); - return (Criteria) this; - } - - public Criteria andOperateTimeEqualTo(Date value) { - addCriterion("operate_time =", value, "operateTime"); - return (Criteria) this; - } - - public Criteria andOperateTimeNotEqualTo(Date value) { - addCriterion("operate_time <>", value, "operateTime"); - return (Criteria) this; - } - - public Criteria andOperateTimeGreaterThan(Date value) { - addCriterion("operate_time >", value, "operateTime"); - return (Criteria) this; - } - - public Criteria andOperateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("operate_time >=", value, "operateTime"); - return (Criteria) this; - } - - public Criteria andOperateTimeLessThan(Date value) { - addCriterion("operate_time <", value, "operateTime"); - return (Criteria) this; - } - - public Criteria andOperateTimeLessThanOrEqualTo(Date value) { - addCriterion("operate_time <=", value, "operateTime"); - return (Criteria) this; - } - - public Criteria andOperateTimeIn(List values) { - addCriterion("operate_time in", values, "operateTime"); - return (Criteria) this; - } - - public Criteria andOperateTimeNotIn(List values) { - addCriterion("operate_time not in", values, "operateTime"); - return (Criteria) this; - } - - public Criteria andOperateTimeBetween(Date value1, Date value2) { - addCriterion("operate_time between", value1, value2, "operateTime"); - return (Criteria) this; - } - - public Criteria andOperateTimeNotBetween(Date value1, Date value2) { - addCriterion("operate_time not between", value1, value2, "operateTime"); - return (Criteria) this; - } - - public Criteria andOperateReasonIsNull() { - addCriterion("operate_reason is null"); - return (Criteria) this; - } - - public Criteria andOperateReasonIsNotNull() { - addCriterion("operate_reason is not null"); - return (Criteria) this; - } - - public Criteria andOperateReasonEqualTo(String value) { - addCriterion("operate_reason =", value, "operateReason"); - return (Criteria) this; - } - - public Criteria andOperateReasonNotEqualTo(String value) { - addCriterion("operate_reason <>", value, "operateReason"); - return (Criteria) this; - } - - public Criteria andOperateReasonGreaterThan(String value) { - addCriterion("operate_reason >", value, "operateReason"); - return (Criteria) this; - } - - public Criteria andOperateReasonGreaterThanOrEqualTo(String value) { - addCriterion("operate_reason >=", value, "operateReason"); - return (Criteria) this; - } - - public Criteria andOperateReasonLessThan(String value) { - addCriterion("operate_reason <", value, "operateReason"); - return (Criteria) this; - } - - public Criteria andOperateReasonLessThanOrEqualTo(String value) { - addCriterion("operate_reason <=", value, "operateReason"); - return (Criteria) this; - } - - public Criteria andOperateReasonLike(String value) { - addCriterion("operate_reason like", value, "operateReason"); - return (Criteria) this; - } - - public Criteria andOperateReasonNotLike(String value) { - addCriterion("operate_reason not like", value, "operateReason"); - return (Criteria) this; - } - - public Criteria andOperateReasonIn(List values) { - addCriterion("operate_reason in", values, "operateReason"); - return (Criteria) this; - } - - public Criteria andOperateReasonNotIn(List values) { - addCriterion("operate_reason not in", values, "operateReason"); - return (Criteria) this; - } - - public Criteria andOperateReasonBetween(String value1, String value2) { - addCriterion("operate_reason between", value1, value2, "operateReason"); - return (Criteria) this; - } - - public Criteria andOperateReasonNotBetween(String value1, String value2) { - addCriterion("operate_reason not between", value1, value2, "operateReason"); - return (Criteria) this; - } - - public Criteria andStatusIsNull() { - addCriterion("`status` is null"); - return (Criteria) this; - } - - public Criteria andStatusIsNotNull() { - addCriterion("`status` is not null"); - return (Criteria) this; - } - - public Criteria andStatusEqualTo(Integer value) { - addCriterion("`status` =", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotEqualTo(Integer value) { - addCriterion("`status` <>", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThan(Integer value) { - addCriterion("`status` >", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThanOrEqualTo(Integer value) { - addCriterion("`status` >=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThan(Integer value) { - addCriterion("`status` <", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThanOrEqualTo(Integer value) { - addCriterion("`status` <=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusIn(List values) { - addCriterion("`status` in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotIn(List values) { - addCriterion("`status` not in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusBetween(Integer value1, Integer value2) { - addCriterion("`status` between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotBetween(Integer value1, Integer value2) { - addCriterion("`status` not between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andAdminIdIsNull() { - addCriterion("admin_id is null"); - return (Criteria) this; - } - - public Criteria andAdminIdIsNotNull() { - addCriterion("admin_id is not null"); - return (Criteria) this; - } - - public Criteria andAdminIdEqualTo(Integer value) { - addCriterion("admin_id =", value, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdNotEqualTo(Integer value) { - addCriterion("admin_id <>", value, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdGreaterThan(Integer value) { - addCriterion("admin_id >", value, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdGreaterThanOrEqualTo(Integer value) { - addCriterion("admin_id >=", value, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdLessThan(Integer value) { - addCriterion("admin_id <", value, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdLessThanOrEqualTo(Integer value) { - addCriterion("admin_id <=", value, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdIn(List values) { - addCriterion("admin_id in", values, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdNotIn(List values) { - addCriterion("admin_id not in", values, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdBetween(Integer value1, Integer value2) { - addCriterion("admin_id between", value1, value2, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminIdNotBetween(Integer value1, Integer value2) { - addCriterion("admin_id not between", value1, value2, "adminId"); - return (Criteria) this; - } - - public Criteria andAdminNameIsNull() { - addCriterion("admin_name is null"); - return (Criteria) this; - } - - public Criteria andAdminNameIsNotNull() { - addCriterion("admin_name is not null"); - return (Criteria) this; - } - - public Criteria andAdminNameEqualTo(String value) { - addCriterion("admin_name =", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameNotEqualTo(String value) { - addCriterion("admin_name <>", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameGreaterThan(String value) { - addCriterion("admin_name >", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameGreaterThanOrEqualTo(String value) { - addCriterion("admin_name >=", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameLessThan(String value) { - addCriterion("admin_name <", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameLessThanOrEqualTo(String value) { - addCriterion("admin_name <=", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameLike(String value) { - addCriterion("admin_name like", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameNotLike(String value) { - addCriterion("admin_name not like", value, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameIn(List values) { - addCriterion("admin_name in", values, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameNotIn(List values) { - addCriterion("admin_name not in", values, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameBetween(String value1, String value2) { - addCriterion("admin_name between", value1, value2, "adminName"); - return (Criteria) this; - } - - public Criteria andAdminNameNotBetween(String value1, String value2) { - addCriterion("admin_name not between", value1, value2, "adminName"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AppVersion.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AppVersion.java deleted file mode 100644 index 45cc2807d..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AppVersion.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.accompany.business.model; - - -import java.util.Date; - -public class AppVersion { - private Integer versionId; - - private String os; - - private String version; - - private String platform; - - private Byte status; - - private String downloadLink; - - private String fileMd5; - - private String versionDesc; - - private Date publishTime; - - private Date createTime; - - private Date updateTime; - - public Integer getVersionId() { - return versionId; - } - - public void setVersionId(Integer versionId) { - this.versionId = versionId; - } - - public String getOs() { - return os; - } - - public void setOs(String os) { - this.os = os == null ? null : os.trim(); - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version == null ? null : version.trim(); - } - - public String getPlatform() { - return platform; - } - - public void setPlatform(String platform) { - this.platform = platform == null ? null : platform.trim(); - } - - public Byte getStatus() { - return status; - } - - public void setStatus(Byte status) { - this.status = status; - } - - public String getDownloadLink() { - return downloadLink; - } - - public void setDownloadLink(String downloadLink) { - this.downloadLink = downloadLink == null ? null : downloadLink.trim(); - } - - public String getFileMd5() { - return fileMd5; - } - - public void setFileMd5(String fileMd5) { - this.fileMd5 = fileMd5 == null ? null : fileMd5.trim(); - } - - public Date getPublishTime() { - return publishTime; - } - - public void setPublishTime(Date publishTime) { - this.publishTime = publishTime; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public String getVersionDesc() { - return versionDesc; - } - - public void setVersionDesc(String versionDesc) { - this.versionDesc = versionDesc == null ? null : versionDesc.trim(); - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AppVersionExample.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AppVersionExample.java deleted file mode 100644 index 2090dbdeb..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AppVersionExample.java +++ /dev/null @@ -1,811 +0,0 @@ -package com.accompany.business.model; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class AppVersionExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - private Integer limit; - - private Integer offset; - - public AppVersionExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - public void setLimit(Integer limit) { - this.limit = limit; - } - - public Integer getLimit() { - return limit; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } - - public Integer getOffset() { - return offset; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andVersionIdIsNull() { - addCriterion("version_id is null"); - return (Criteria) this; - } - - public Criteria andVersionIdIsNotNull() { - addCriterion("version_id is not null"); - return (Criteria) this; - } - - public Criteria andVersionIdEqualTo(Integer value) { - addCriterion("version_id =", value, "versionId"); - return (Criteria) this; - } - - public Criteria andVersionIdNotEqualTo(Integer value) { - addCriterion("version_id <>", value, "versionId"); - return (Criteria) this; - } - - public Criteria andVersionIdGreaterThan(Integer value) { - addCriterion("version_id >", value, "versionId"); - return (Criteria) this; - } - - public Criteria andVersionIdGreaterThanOrEqualTo(Integer value) { - addCriterion("version_id >=", value, "versionId"); - return (Criteria) this; - } - - public Criteria andVersionIdLessThan(Integer value) { - addCriterion("version_id <", value, "versionId"); - return (Criteria) this; - } - - public Criteria andVersionIdLessThanOrEqualTo(Integer value) { - addCriterion("version_id <=", value, "versionId"); - return (Criteria) this; - } - - public Criteria andVersionIdIn(List values) { - addCriterion("version_id in", values, "versionId"); - return (Criteria) this; - } - - public Criteria andVersionIdNotIn(List values) { - addCriterion("version_id not in", values, "versionId"); - return (Criteria) this; - } - - public Criteria andVersionIdBetween(Integer value1, Integer value2) { - addCriterion("version_id between", value1, value2, "versionId"); - return (Criteria) this; - } - - public Criteria andVersionIdNotBetween(Integer value1, Integer value2) { - addCriterion("version_id not between", value1, value2, "versionId"); - return (Criteria) this; - } - - public Criteria andOsIsNull() { - addCriterion("os is null"); - return (Criteria) this; - } - - public Criteria andOsIsNotNull() { - addCriterion("os is not null"); - return (Criteria) this; - } - - public Criteria andOsEqualTo(String value) { - addCriterion("os =", value, "os"); - return (Criteria) this; - } - - public Criteria andOsNotEqualTo(String value) { - addCriterion("os <>", value, "os"); - return (Criteria) this; - } - - public Criteria andOsGreaterThan(String value) { - addCriterion("os >", value, "os"); - return (Criteria) this; - } - - public Criteria andOsGreaterThanOrEqualTo(String value) { - addCriterion("os >=", value, "os"); - return (Criteria) this; - } - - public Criteria andOsLessThan(String value) { - addCriterion("os <", value, "os"); - return (Criteria) this; - } - - public Criteria andOsLessThanOrEqualTo(String value) { - addCriterion("os <=", value, "os"); - return (Criteria) this; - } - - public Criteria andOsLike(String value) { - addCriterion("os like", value, "os"); - return (Criteria) this; - } - - public Criteria andOsNotLike(String value) { - addCriterion("os not like", value, "os"); - return (Criteria) this; - } - - public Criteria andOsIn(List values) { - addCriterion("os in", values, "os"); - return (Criteria) this; - } - - public Criteria andOsNotIn(List values) { - addCriterion("os not in", values, "os"); - return (Criteria) this; - } - - public Criteria andOsBetween(String value1, String value2) { - addCriterion("os between", value1, value2, "os"); - return (Criteria) this; - } - - public Criteria andOsNotBetween(String value1, String value2) { - addCriterion("os not between", value1, value2, "os"); - return (Criteria) this; - } - - public Criteria andVersionIsNull() { - addCriterion("version is null"); - return (Criteria) this; - } - - public Criteria andVersionIsNotNull() { - addCriterion("version is not null"); - return (Criteria) this; - } - - public Criteria andVersionEqualTo(String value) { - addCriterion("version =", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionNotEqualTo(String value) { - addCriterion("version <>", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionGreaterThan(String value) { - addCriterion("version >", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionGreaterThanOrEqualTo(String value) { - addCriterion("version >=", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionLessThan(String value) { - addCriterion("version <", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionLessThanOrEqualTo(String value) { - addCriterion("version <=", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionLike(String value) { - addCriterion("version like", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionNotLike(String value) { - addCriterion("version not like", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionIn(List values) { - addCriterion("version in", values, "version"); - return (Criteria) this; - } - - public Criteria andVersionNotIn(List values) { - addCriterion("version not in", values, "version"); - return (Criteria) this; - } - - public Criteria andVersionBetween(String value1, String value2) { - addCriterion("version between", value1, value2, "version"); - return (Criteria) this; - } - - public Criteria andVersionNotBetween(String value1, String value2) { - addCriterion("version not between", value1, value2, "version"); - return (Criteria) this; - } - - public Criteria andPlatformIsNull() { - addCriterion("platform is null"); - return (Criteria) this; - } - - public Criteria andPlatformIsNotNull() { - addCriterion("platform is not null"); - return (Criteria) this; - } - - public Criteria andPlatformEqualTo(String value) { - addCriterion("platform =", value, "platform"); - return (Criteria) this; - } - - public Criteria andPlatformNotEqualTo(String value) { - addCriterion("platform <>", value, "platform"); - return (Criteria) this; - } - - public Criteria andPlatformGreaterThan(String value) { - addCriterion("platform >", value, "platform"); - return (Criteria) this; - } - - public Criteria andPlatformGreaterThanOrEqualTo(String value) { - addCriterion("platform >=", value, "platform"); - return (Criteria) this; - } - - public Criteria andPlatformLessThan(String value) { - addCriterion("platform <", value, "platform"); - return (Criteria) this; - } - - public Criteria andPlatformLessThanOrEqualTo(String value) { - addCriterion("platform <=", value, "platform"); - return (Criteria) this; - } - - public Criteria andPlatformLike(String value) { - addCriterion("platform like", value, "platform"); - return (Criteria) this; - } - - public Criteria andPlatformNotLike(String value) { - addCriterion("platform not like", value, "platform"); - return (Criteria) this; - } - - public Criteria andPlatformIn(List values) { - addCriterion("platform in", values, "platform"); - return (Criteria) this; - } - - public Criteria andPlatformNotIn(List values) { - addCriterion("platform not in", values, "platform"); - return (Criteria) this; - } - - public Criteria andPlatformBetween(String value1, String value2) { - addCriterion("platform between", value1, value2, "platform"); - return (Criteria) this; - } - - public Criteria andPlatformNotBetween(String value1, String value2) { - addCriterion("platform not between", value1, value2, "platform"); - return (Criteria) this; - } - - public Criteria andStatusIsNull() { - addCriterion("status is null"); - return (Criteria) this; - } - - public Criteria andStatusIsNotNull() { - addCriterion("status is not null"); - return (Criteria) this; - } - - public Criteria andStatusEqualTo(Byte value) { - addCriterion("status =", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotEqualTo(Byte value) { - addCriterion("status <>", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThan(Byte value) { - addCriterion("status >", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThanOrEqualTo(Byte value) { - addCriterion("status >=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThan(Byte value) { - addCriterion("status <", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThanOrEqualTo(Byte value) { - addCriterion("status <=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusIn(List values) { - addCriterion("status in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotIn(List values) { - addCriterion("status not in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusBetween(Byte value1, Byte value2) { - addCriterion("status between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotBetween(Byte value1, Byte value2) { - addCriterion("status not between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andDownloadLinkIsNull() { - addCriterion("download_link is null"); - return (Criteria) this; - } - - public Criteria andDownloadLinkIsNotNull() { - addCriterion("download_link is not null"); - return (Criteria) this; - } - - public Criteria andDownloadLinkEqualTo(String value) { - addCriterion("download_link =", value, "downloadLink"); - return (Criteria) this; - } - - public Criteria andDownloadLinkNotEqualTo(String value) { - addCriterion("download_link <>", value, "downloadLink"); - return (Criteria) this; - } - - public Criteria andDownloadLinkGreaterThan(String value) { - addCriterion("download_link >", value, "downloadLink"); - return (Criteria) this; - } - - public Criteria andDownloadLinkGreaterThanOrEqualTo(String value) { - addCriterion("download_link >=", value, "downloadLink"); - return (Criteria) this; - } - - public Criteria andDownloadLinkLessThan(String value) { - addCriterion("download_link <", value, "downloadLink"); - return (Criteria) this; - } - - public Criteria andDownloadLinkLessThanOrEqualTo(String value) { - addCriterion("download_link <=", value, "downloadLink"); - return (Criteria) this; - } - - public Criteria andDownloadLinkLike(String value) { - addCriterion("download_link like", value, "downloadLink"); - return (Criteria) this; - } - - public Criteria andDownloadLinkNotLike(String value) { - addCriterion("download_link not like", value, "downloadLink"); - return (Criteria) this; - } - - public Criteria andDownloadLinkIn(List values) { - addCriterion("download_link in", values, "downloadLink"); - return (Criteria) this; - } - - public Criteria andDownloadLinkNotIn(List values) { - addCriterion("download_link not in", values, "downloadLink"); - return (Criteria) this; - } - - public Criteria andDownloadLinkBetween(String value1, String value2) { - addCriterion("download_link between", value1, value2, "downloadLink"); - return (Criteria) this; - } - - public Criteria andDownloadLinkNotBetween(String value1, String value2) { - addCriterion("download_link not between", value1, value2, "downloadLink"); - return (Criteria) this; - } - - public Criteria andFileMd5IsNull() { - addCriterion("file_md5 is null"); - return (Criteria) this; - } - - public Criteria andFileMd5IsNotNull() { - addCriterion("file_md5 is not null"); - return (Criteria) this; - } - - public Criteria andFileMd5EqualTo(String value) { - addCriterion("file_md5 =", value, "fileMd5"); - return (Criteria) this; - } - - public Criteria andFileMd5NotEqualTo(String value) { - addCriterion("file_md5 <>", value, "fileMd5"); - return (Criteria) this; - } - - public Criteria andFileMd5GreaterThan(String value) { - addCriterion("file_md5 >", value, "fileMd5"); - return (Criteria) this; - } - - public Criteria andFileMd5GreaterThanOrEqualTo(String value) { - addCriterion("file_md5 >=", value, "fileMd5"); - return (Criteria) this; - } - - public Criteria andFileMd5LessThan(String value) { - addCriterion("file_md5 <", value, "fileMd5"); - return (Criteria) this; - } - - public Criteria andFileMd5LessThanOrEqualTo(String value) { - addCriterion("file_md5 <=", value, "fileMd5"); - return (Criteria) this; - } - - public Criteria andFileMd5Like(String value) { - addCriterion("file_md5 like", value, "fileMd5"); - return (Criteria) this; - } - - public Criteria andFileMd5NotLike(String value) { - addCriterion("file_md5 not like", value, "fileMd5"); - return (Criteria) this; - } - - public Criteria andFileMd5In(List values) { - addCriterion("file_md5 in", values, "fileMd5"); - return (Criteria) this; - } - - public Criteria andFileMd5NotIn(List values) { - addCriterion("file_md5 not in", values, "fileMd5"); - return (Criteria) this; - } - - public Criteria andFileMd5Between(String value1, String value2) { - addCriterion("file_md5 between", value1, value2, "fileMd5"); - return (Criteria) this; - } - - public Criteria andFileMd5NotBetween(String value1, String value2) { - addCriterion("file_md5 not between", value1, value2, "fileMd5"); - return (Criteria) this; - } - - public Criteria andPublishTimeIsNull() { - addCriterion("publish_time is null"); - return (Criteria) this; - } - - public Criteria andPublishTimeIsNotNull() { - addCriterion("publish_time is not null"); - return (Criteria) this; - } - - public Criteria andPublishTimeEqualTo(Date value) { - addCriterion("publish_time =", value, "publishTime"); - return (Criteria) this; - } - - public Criteria andPublishTimeNotEqualTo(Date value) { - addCriterion("publish_time <>", value, "publishTime"); - return (Criteria) this; - } - - public Criteria andPublishTimeGreaterThan(Date value) { - addCriterion("publish_time >", value, "publishTime"); - return (Criteria) this; - } - - public Criteria andPublishTimeGreaterThanOrEqualTo(Date value) { - addCriterion("publish_time >=", value, "publishTime"); - return (Criteria) this; - } - - public Criteria andPublishTimeLessThan(Date value) { - addCriterion("publish_time <", value, "publishTime"); - return (Criteria) this; - } - - public Criteria andPublishTimeLessThanOrEqualTo(Date value) { - addCriterion("publish_time <=", value, "publishTime"); - return (Criteria) this; - } - - public Criteria andPublishTimeIn(List values) { - addCriterion("publish_time in", values, "publishTime"); - return (Criteria) this; - } - - public Criteria andPublishTimeNotIn(List values) { - addCriterion("publish_time not in", values, "publishTime"); - return (Criteria) this; - } - - public Criteria andPublishTimeBetween(Date value1, Date value2) { - addCriterion("publish_time between", value1, value2, "publishTime"); - return (Criteria) this; - } - - public Criteria andPublishTimeNotBetween(Date value1, Date value2) { - addCriterion("publish_time not between", value1, value2, "publishTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNull() { - addCriterion("create_time is null"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNotNull() { - addCriterion("create_time is not null"); - return (Criteria) this; - } - - public Criteria andCreateTimeEqualTo(Date value) { - addCriterion("create_time =", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotEqualTo(Date value) { - addCriterion("create_time <>", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThan(Date value) { - addCriterion("create_time >", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("create_time >=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThan(Date value) { - addCriterion("create_time <", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThanOrEqualTo(Date value) { - addCriterion("create_time <=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeIn(List values) { - addCriterion("create_time in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotIn(List values) { - addCriterion("create_time not in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeBetween(Date value1, Date value2) { - addCriterion("create_time between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotBetween(Date value1, Date value2) { - addCriterion("create_time not between", value1, value2, "createTime"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/GiftCompoundRecord.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/GiftCompoundRecord.java deleted file mode 100644 index 37f6258e0..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/GiftCompoundRecord.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.accompany.business.model; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -/** - * @author guojicong - * @Description - * @create 2022-06-20 - */ -@Data -@NoArgsConstructor -public class GiftCompoundRecord { - @TableId(value = "id", type = IdType.AUTO) - @ApiModelProperty("合成记录id") - private Integer id; - @ApiModelProperty("uid") - private Long uid; - @ApiModelProperty("用户昵称") - private String userNick; - @ApiModelProperty("合成礼物id") - private Integer giftId; - @ApiModelProperty("合成礼物id") - private String giftName; - @ApiModelProperty("合成礼物价值") - private Long giftPrice; - @ApiModelProperty("合成礼物时间") - private Date createTime; - private Date updateTime; - - @ApiModelProperty("合成礼物时间") - private Integer rewardId; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/GiftCompoundRecordDetail.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/GiftCompoundRecordDetail.java deleted file mode 100644 index 7bc177552..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/GiftCompoundRecordDetail.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.accompany.business.model; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -/** - * @author guojicong - * @Description - * @create 2022-06-20 - */ -@Data -@NoArgsConstructor -public class GiftCompoundRecordDetail { - @TableId(value = "id", type = IdType.AUTO) - @ApiModelProperty("合成记录详情id") - private Integer id; - @ApiModelProperty("合成记录id") - private Integer recordId; - - @ApiModelProperty("消耗礼物id") - private Integer giftId; - - @ApiModelProperty("消耗礼物数量") - private Integer giftNum; - private Date createTime; - private Date updateTime; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/GiftCompoundReward.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/GiftCompoundReward.java deleted file mode 100644 index 499fa90ff..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/GiftCompoundReward.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.accompany.business.model; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -import java.util.Date; - -@Data -@Accessors(chain=true) -@NoArgsConstructor -public class GiftCompoundReward { - @TableId(value = "id", type = IdType.AUTO) - @ApiModelProperty("合成奖励id") - private Integer id; - @ApiModelProperty("展示礼物id") - private Integer giftId; - @ApiModelProperty("序号") - private Integer orderNo; - @ApiModelProperty("合成奖励消耗值") - private Integer expendValue; - @ApiModelProperty("合成奖励类型-1:普通合成奖励;2:限时合成奖励") - private Integer rewardType; - @ApiModelProperty("创建时间") - private Date createTime; - @ApiModelProperty("更新时间") - private Date updateTime; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/GiftCompoundRewardPool.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/GiftCompoundRewardPool.java deleted file mode 100644 index 289969077..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/GiftCompoundRewardPool.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.accompany.business.model; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -import java.util.Date; - -@Data -@Accessors(chain=true) -@NoArgsConstructor -public class GiftCompoundRewardPool { - @TableId(value = "id", type = IdType.AUTO) - @ApiModelProperty("合成奖励池id") - private Integer id; - @ApiModelProperty("合成奖励id") - private Integer rewardId; - @ApiModelProperty("合成奖励礼物id") - private Integer giftId; - @ApiModelProperty("合成概率") - private Integer rate; - @ApiModelProperty("是否全服通知") - private Boolean serviceNotice; - @ApiModelProperty("创建时间") - private Date createTime; - @ApiModelProperty("更新时间") - private Date updateTime; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RedeemCode.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RedeemCode.java deleted file mode 100644 index 66a212789..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RedeemCode.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.accompany.business.model; - -import java.util.Date; - -public class RedeemCode { - private String code; - - private Long amount; - - private Long useUid; - - private String useIp; - - private String useImei; - - private Integer useStatus; - - private Date useTime; - - private Date createTime; - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code == null ? null : code.trim(); - } - - public Long getAmount() { - return amount; - } - - public void setAmount(Long amount) { - this.amount = amount; - } - - public Long getUseUid() { - return useUid; - } - - public void setUseUid(Long useUid) { - this.useUid = useUid; - } - - public String getUseIp() { - return useIp; - } - - public void setUseIp(String useIp) { - this.useIp = useIp == null ? null : useIp.trim(); - } - - public String getUseImei() { - return useImei; - } - - public void setUseImei(String useImei) { - this.useImei = useImei == null ? null : useImei.trim(); - } - - public Integer getUseStatus() { - return useStatus; - } - - public void setUseStatus(Integer useStatus) { - this.useStatus = useStatus; - } - - public Date getUseTime() { - return useTime; - } - - public void setUseTime(Date useTime) { - this.useTime = useTime; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RedeemCodeExample.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RedeemCodeExample.java deleted file mode 100644 index c6a497eb8..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RedeemCodeExample.java +++ /dev/null @@ -1,711 +0,0 @@ -package com.accompany.business.model; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class RedeemCodeExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - public RedeemCodeExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andCodeIsNull() { - addCriterion("code is null"); - return (Criteria) this; - } - - public Criteria andCodeIsNotNull() { - addCriterion("code is not null"); - return (Criteria) this; - } - - public Criteria andCodeEqualTo(String value) { - addCriterion("code =", value, "code"); - return (Criteria) this; - } - - public Criteria andCodeNotEqualTo(String value) { - addCriterion("code <>", value, "code"); - return (Criteria) this; - } - - public Criteria andCodeGreaterThan(String value) { - addCriterion("code >", value, "code"); - return (Criteria) this; - } - - public Criteria andCodeGreaterThanOrEqualTo(String value) { - addCriterion("code >=", value, "code"); - return (Criteria) this; - } - - public Criteria andCodeLessThan(String value) { - addCriterion("code <", value, "code"); - return (Criteria) this; - } - - public Criteria andCodeLessThanOrEqualTo(String value) { - addCriterion("code <=", value, "code"); - return (Criteria) this; - } - - public Criteria andCodeLike(String value) { - addCriterion("code like", value, "code"); - return (Criteria) this; - } - - public Criteria andCodeNotLike(String value) { - addCriterion("code not like", value, "code"); - return (Criteria) this; - } - - public Criteria andCodeIn(List values) { - addCriterion("code in", values, "code"); - return (Criteria) this; - } - - public Criteria andCodeNotIn(List values) { - addCriterion("code not in", values, "code"); - return (Criteria) this; - } - - public Criteria andCodeBetween(String value1, String value2) { - addCriterion("code between", value1, value2, "code"); - return (Criteria) this; - } - - public Criteria andCodeNotBetween(String value1, String value2) { - addCriterion("code not between", value1, value2, "code"); - return (Criteria) this; - } - - public Criteria andAmountIsNull() { - addCriterion("amount is null"); - return (Criteria) this; - } - - public Criteria andAmountIsNotNull() { - addCriterion("amount is not null"); - return (Criteria) this; - } - - public Criteria andAmountEqualTo(Long value) { - addCriterion("amount =", value, "amount"); - return (Criteria) this; - } - - public Criteria andAmountNotEqualTo(Long value) { - addCriterion("amount <>", value, "amount"); - return (Criteria) this; - } - - public Criteria andAmountGreaterThan(Long value) { - addCriterion("amount >", value, "amount"); - return (Criteria) this; - } - - public Criteria andAmountGreaterThanOrEqualTo(Long value) { - addCriterion("amount >=", value, "amount"); - return (Criteria) this; - } - - public Criteria andAmountLessThan(Long value) { - addCriterion("amount <", value, "amount"); - return (Criteria) this; - } - - public Criteria andAmountLessThanOrEqualTo(Long value) { - addCriterion("amount <=", value, "amount"); - return (Criteria) this; - } - - public Criteria andAmountIn(List values) { - addCriterion("amount in", values, "amount"); - return (Criteria) this; - } - - public Criteria andAmountNotIn(List values) { - addCriterion("amount not in", values, "amount"); - return (Criteria) this; - } - - public Criteria andAmountBetween(Long value1, Long value2) { - addCriterion("amount between", value1, value2, "amount"); - return (Criteria) this; - } - - public Criteria andAmountNotBetween(Long value1, Long value2) { - addCriterion("amount not between", value1, value2, "amount"); - return (Criteria) this; - } - - public Criteria andUseUidIsNull() { - addCriterion("use_uid is null"); - return (Criteria) this; - } - - public Criteria andUseUidIsNotNull() { - addCriterion("use_uid is not null"); - return (Criteria) this; - } - - public Criteria andUseUidEqualTo(Long value) { - addCriterion("use_uid =", value, "useUid"); - return (Criteria) this; - } - - public Criteria andUseUidNotEqualTo(Long value) { - addCriterion("use_uid <>", value, "useUid"); - return (Criteria) this; - } - - public Criteria andUseUidGreaterThan(Long value) { - addCriterion("use_uid >", value, "useUid"); - return (Criteria) this; - } - - public Criteria andUseUidGreaterThanOrEqualTo(Long value) { - addCriterion("use_uid >=", value, "useUid"); - return (Criteria) this; - } - - public Criteria andUseUidLessThan(Long value) { - addCriterion("use_uid <", value, "useUid"); - return (Criteria) this; - } - - public Criteria andUseUidLessThanOrEqualTo(Long value) { - addCriterion("use_uid <=", value, "useUid"); - return (Criteria) this; - } - - public Criteria andUseUidIn(List values) { - addCriterion("use_uid in", values, "useUid"); - return (Criteria) this; - } - - public Criteria andUseUidNotIn(List values) { - addCriterion("use_uid not in", values, "useUid"); - return (Criteria) this; - } - - public Criteria andUseUidBetween(Long value1, Long value2) { - addCriterion("use_uid between", value1, value2, "useUid"); - return (Criteria) this; - } - - public Criteria andUseUidNotBetween(Long value1, Long value2) { - addCriterion("use_uid not between", value1, value2, "useUid"); - return (Criteria) this; - } - - public Criteria andUseIpIsNull() { - addCriterion("use_ip is null"); - return (Criteria) this; - } - - public Criteria andUseIpIsNotNull() { - addCriterion("use_ip is not null"); - return (Criteria) this; - } - - public Criteria andUseIpEqualTo(String value) { - addCriterion("use_ip =", value, "useIp"); - return (Criteria) this; - } - - public Criteria andUseIpNotEqualTo(String value) { - addCriterion("use_ip <>", value, "useIp"); - return (Criteria) this; - } - - public Criteria andUseIpGreaterThan(String value) { - addCriterion("use_ip >", value, "useIp"); - return (Criteria) this; - } - - public Criteria andUseIpGreaterThanOrEqualTo(String value) { - addCriterion("use_ip >=", value, "useIp"); - return (Criteria) this; - } - - public Criteria andUseIpLessThan(String value) { - addCriterion("use_ip <", value, "useIp"); - return (Criteria) this; - } - - public Criteria andUseIpLessThanOrEqualTo(String value) { - addCriterion("use_ip <=", value, "useIp"); - return (Criteria) this; - } - - public Criteria andUseIpLike(String value) { - addCriterion("use_ip like", value, "useIp"); - return (Criteria) this; - } - - public Criteria andUseIpNotLike(String value) { - addCriterion("use_ip not like", value, "useIp"); - return (Criteria) this; - } - - public Criteria andUseIpIn(List values) { - addCriterion("use_ip in", values, "useIp"); - return (Criteria) this; - } - - public Criteria andUseIpNotIn(List values) { - addCriterion("use_ip not in", values, "useIp"); - return (Criteria) this; - } - - public Criteria andUseIpBetween(String value1, String value2) { - addCriterion("use_ip between", value1, value2, "useIp"); - return (Criteria) this; - } - - public Criteria andUseIpNotBetween(String value1, String value2) { - addCriterion("use_ip not between", value1, value2, "useIp"); - return (Criteria) this; - } - - public Criteria andUseImeiIsNull() { - addCriterion("use_imei is null"); - return (Criteria) this; - } - - public Criteria andUseImeiIsNotNull() { - addCriterion("use_imei is not null"); - return (Criteria) this; - } - - public Criteria andUseImeiEqualTo(String value) { - addCriterion("use_imei =", value, "useImei"); - return (Criteria) this; - } - - public Criteria andUseImeiNotEqualTo(String value) { - addCriterion("use_imei <>", value, "useImei"); - return (Criteria) this; - } - - public Criteria andUseImeiGreaterThan(String value) { - addCriterion("use_imei >", value, "useImei"); - return (Criteria) this; - } - - public Criteria andUseImeiGreaterThanOrEqualTo(String value) { - addCriterion("use_imei >=", value, "useImei"); - return (Criteria) this; - } - - public Criteria andUseImeiLessThan(String value) { - addCriterion("use_imei <", value, "useImei"); - return (Criteria) this; - } - - public Criteria andUseImeiLessThanOrEqualTo(String value) { - addCriterion("use_imei <=", value, "useImei"); - return (Criteria) this; - } - - public Criteria andUseImeiLike(String value) { - addCriterion("use_imei like", value, "useImei"); - return (Criteria) this; - } - - public Criteria andUseImeiNotLike(String value) { - addCriterion("use_imei not like", value, "useImei"); - return (Criteria) this; - } - - public Criteria andUseImeiIn(List values) { - addCriterion("use_imei in", values, "useImei"); - return (Criteria) this; - } - - public Criteria andUseImeiNotIn(List values) { - addCriterion("use_imei not in", values, "useImei"); - return (Criteria) this; - } - - public Criteria andUseImeiBetween(String value1, String value2) { - addCriterion("use_imei between", value1, value2, "useImei"); - return (Criteria) this; - } - - public Criteria andUseImeiNotBetween(String value1, String value2) { - addCriterion("use_imei not between", value1, value2, "useImei"); - return (Criteria) this; - } - - public Criteria andUseStatusIsNull() { - addCriterion("use_status is null"); - return (Criteria) this; - } - - public Criteria andUseStatusIsNotNull() { - addCriterion("use_status is not null"); - return (Criteria) this; - } - - public Criteria andUseStatusEqualTo(Integer value) { - addCriterion("use_status =", value, "useStatus"); - return (Criteria) this; - } - - public Criteria andUseStatusNotEqualTo(Integer value) { - addCriterion("use_status <>", value, "useStatus"); - return (Criteria) this; - } - - public Criteria andUseStatusGreaterThan(Integer value) { - addCriterion("use_status >", value, "useStatus"); - return (Criteria) this; - } - - public Criteria andUseStatusGreaterThanOrEqualTo(Integer value) { - addCriterion("use_status >=", value, "useStatus"); - return (Criteria) this; - } - - public Criteria andUseStatusLessThan(Integer value) { - addCriterion("use_status <", value, "useStatus"); - return (Criteria) this; - } - - public Criteria andUseStatusLessThanOrEqualTo(Integer value) { - addCriterion("use_status <=", value, "useStatus"); - return (Criteria) this; - } - - public Criteria andUseStatusIn(List values) { - addCriterion("use_status in", values, "useStatus"); - return (Criteria) this; - } - - public Criteria andUseStatusNotIn(List values) { - addCriterion("use_status not in", values, "useStatus"); - return (Criteria) this; - } - - public Criteria andUseStatusBetween(Integer value1, Integer value2) { - addCriterion("use_status between", value1, value2, "useStatus"); - return (Criteria) this; - } - - public Criteria andUseStatusNotBetween(Integer value1, Integer value2) { - addCriterion("use_status not between", value1, value2, "useStatus"); - return (Criteria) this; - } - - public Criteria andUseTimeIsNull() { - addCriterion("use_time is null"); - return (Criteria) this; - } - - public Criteria andUseTimeIsNotNull() { - addCriterion("use_time is not null"); - return (Criteria) this; - } - - public Criteria andUseTimeEqualTo(Date value) { - addCriterion("use_time =", value, "useTime"); - return (Criteria) this; - } - - public Criteria andUseTimeNotEqualTo(Date value) { - addCriterion("use_time <>", value, "useTime"); - return (Criteria) this; - } - - public Criteria andUseTimeGreaterThan(Date value) { - addCriterion("use_time >", value, "useTime"); - return (Criteria) this; - } - - public Criteria andUseTimeGreaterThanOrEqualTo(Date value) { - addCriterion("use_time >=", value, "useTime"); - return (Criteria) this; - } - - public Criteria andUseTimeLessThan(Date value) { - addCriterion("use_time <", value, "useTime"); - return (Criteria) this; - } - - public Criteria andUseTimeLessThanOrEqualTo(Date value) { - addCriterion("use_time <=", value, "useTime"); - return (Criteria) this; - } - - public Criteria andUseTimeIn(List values) { - addCriterion("use_time in", values, "useTime"); - return (Criteria) this; - } - - public Criteria andUseTimeNotIn(List values) { - addCriterion("use_time not in", values, "useTime"); - return (Criteria) this; - } - - public Criteria andUseTimeBetween(Date value1, Date value2) { - addCriterion("use_time between", value1, value2, "useTime"); - return (Criteria) this; - } - - public Criteria andUseTimeNotBetween(Date value1, Date value2) { - addCriterion("use_time not between", value1, value2, "useTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNull() { - addCriterion("create_time is null"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNotNull() { - addCriterion("create_time is not null"); - return (Criteria) this; - } - - public Criteria andCreateTimeEqualTo(Date value) { - addCriterion("create_time =", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotEqualTo(Date value) { - addCriterion("create_time <>", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThan(Date value) { - addCriterion("create_time >", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("create_time >=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThan(Date value) { - addCriterion("create_time <", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThanOrEqualTo(Date value) { - addCriterion("create_time <=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeIn(List values) { - addCriterion("create_time in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotIn(List values) { - addCriterion("create_time not in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeBetween(Date value1, Date value2) { - addCriterion("create_time between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotBetween(Date value1, Date value2) { - addCriterion("create_time not between", value1, value2, "createTime"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RedeemCodeRecord.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RedeemCodeRecord.java deleted file mode 100644 index 7637dda2f..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RedeemCodeRecord.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.accompany.business.model; - -import java.util.Date; - -public class RedeemCodeRecord { - private String recordId; - - private String code; - - private Long uid; - - private String ip; - - private String imei; - - private Long amount; - - private Date createTime; - - public String getRecordId() { - return recordId; - } - - public void setRecordId(String recordId) { - this.recordId = recordId == null ? null : recordId.trim(); - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code == null ? null : code.trim(); - } - - public Long getUid() { - return uid; - } - - public void setUid(Long uid) { - this.uid = uid; - } - - public String getIp() { - return ip; - } - - public void setIp(String ip) { - this.ip = ip == null ? null : ip.trim(); - } - - public String getImei() { - return imei; - } - - public void setImei(String imei) { - this.imei = imei == null ? null : imei.trim(); - } - - public Long getAmount() { - return amount; - } - - public void setAmount(Long amount) { - this.amount = amount; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RedeemCodeRecordExample.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RedeemCodeRecordExample.java deleted file mode 100644 index 5b6109352..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RedeemCodeRecordExample.java +++ /dev/null @@ -1,661 +0,0 @@ -package com.accompany.business.model; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class RedeemCodeRecordExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - public RedeemCodeRecordExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andRecordIdIsNull() { - addCriterion("record_id is null"); - return (Criteria) this; - } - - public Criteria andRecordIdIsNotNull() { - addCriterion("record_id is not null"); - return (Criteria) this; - } - - public Criteria andRecordIdEqualTo(String value) { - addCriterion("record_id =", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdNotEqualTo(String value) { - addCriterion("record_id <>", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdGreaterThan(String value) { - addCriterion("record_id >", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdGreaterThanOrEqualTo(String value) { - addCriterion("record_id >=", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdLessThan(String value) { - addCriterion("record_id <", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdLessThanOrEqualTo(String value) { - addCriterion("record_id <=", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdLike(String value) { - addCriterion("record_id like", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdNotLike(String value) { - addCriterion("record_id not like", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdIn(List values) { - addCriterion("record_id in", values, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdNotIn(List values) { - addCriterion("record_id not in", values, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdBetween(String value1, String value2) { - addCriterion("record_id between", value1, value2, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdNotBetween(String value1, String value2) { - addCriterion("record_id not between", value1, value2, "recordId"); - return (Criteria) this; - } - - public Criteria andCodeIsNull() { - addCriterion("code is null"); - return (Criteria) this; - } - - public Criteria andCodeIsNotNull() { - addCriterion("code is not null"); - return (Criteria) this; - } - - public Criteria andCodeEqualTo(String value) { - addCriterion("code =", value, "code"); - return (Criteria) this; - } - - public Criteria andCodeNotEqualTo(String value) { - addCriterion("code <>", value, "code"); - return (Criteria) this; - } - - public Criteria andCodeGreaterThan(String value) { - addCriterion("code >", value, "code"); - return (Criteria) this; - } - - public Criteria andCodeGreaterThanOrEqualTo(String value) { - addCriterion("code >=", value, "code"); - return (Criteria) this; - } - - public Criteria andCodeLessThan(String value) { - addCriterion("code <", value, "code"); - return (Criteria) this; - } - - public Criteria andCodeLessThanOrEqualTo(String value) { - addCriterion("code <=", value, "code"); - return (Criteria) this; - } - - public Criteria andCodeLike(String value) { - addCriterion("code like", value, "code"); - return (Criteria) this; - } - - public Criteria andCodeNotLike(String value) { - addCriterion("code not like", value, "code"); - return (Criteria) this; - } - - public Criteria andCodeIn(List values) { - addCriterion("code in", values, "code"); - return (Criteria) this; - } - - public Criteria andCodeNotIn(List values) { - addCriterion("code not in", values, "code"); - return (Criteria) this; - } - - public Criteria andCodeBetween(String value1, String value2) { - addCriterion("code between", value1, value2, "code"); - return (Criteria) this; - } - - public Criteria andCodeNotBetween(String value1, String value2) { - addCriterion("code not between", value1, value2, "code"); - return (Criteria) this; - } - - public Criteria andUidIsNull() { - addCriterion("uid is null"); - return (Criteria) this; - } - - public Criteria andUidIsNotNull() { - addCriterion("uid is not null"); - return (Criteria) this; - } - - public Criteria andUidEqualTo(Long value) { - addCriterion("uid =", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotEqualTo(Long value) { - addCriterion("uid <>", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidGreaterThan(Long value) { - addCriterion("uid >", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidGreaterThanOrEqualTo(Long value) { - addCriterion("uid >=", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidLessThan(Long value) { - addCriterion("uid <", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidLessThanOrEqualTo(Long value) { - addCriterion("uid <=", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidIn(List values) { - addCriterion("uid in", values, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotIn(List values) { - addCriterion("uid not in", values, "uid"); - return (Criteria) this; - } - - public Criteria andUidBetween(Long value1, Long value2) { - addCriterion("uid between", value1, value2, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotBetween(Long value1, Long value2) { - addCriterion("uid not between", value1, value2, "uid"); - return (Criteria) this; - } - - public Criteria andIpIsNull() { - addCriterion("ip is null"); - return (Criteria) this; - } - - public Criteria andIpIsNotNull() { - addCriterion("ip is not null"); - return (Criteria) this; - } - - public Criteria andIpEqualTo(String value) { - addCriterion("ip =", value, "ip"); - return (Criteria) this; - } - - public Criteria andIpNotEqualTo(String value) { - addCriterion("ip <>", value, "ip"); - return (Criteria) this; - } - - public Criteria andIpGreaterThan(String value) { - addCriterion("ip >", value, "ip"); - return (Criteria) this; - } - - public Criteria andIpGreaterThanOrEqualTo(String value) { - addCriterion("ip >=", value, "ip"); - return (Criteria) this; - } - - public Criteria andIpLessThan(String value) { - addCriterion("ip <", value, "ip"); - return (Criteria) this; - } - - public Criteria andIpLessThanOrEqualTo(String value) { - addCriterion("ip <=", value, "ip"); - return (Criteria) this; - } - - public Criteria andIpLike(String value) { - addCriterion("ip like", value, "ip"); - return (Criteria) this; - } - - public Criteria andIpNotLike(String value) { - addCriterion("ip not like", value, "ip"); - return (Criteria) this; - } - - public Criteria andIpIn(List values) { - addCriterion("ip in", values, "ip"); - return (Criteria) this; - } - - public Criteria andIpNotIn(List values) { - addCriterion("ip not in", values, "ip"); - return (Criteria) this; - } - - public Criteria andIpBetween(String value1, String value2) { - addCriterion("ip between", value1, value2, "ip"); - return (Criteria) this; - } - - public Criteria andIpNotBetween(String value1, String value2) { - addCriterion("ip not between", value1, value2, "ip"); - return (Criteria) this; - } - - public Criteria andImeiIsNull() { - addCriterion("imei is null"); - return (Criteria) this; - } - - public Criteria andImeiIsNotNull() { - addCriterion("imei is not null"); - return (Criteria) this; - } - - public Criteria andImeiEqualTo(String value) { - addCriterion("imei =", value, "imei"); - return (Criteria) this; - } - - public Criteria andImeiNotEqualTo(String value) { - addCriterion("imei <>", value, "imei"); - return (Criteria) this; - } - - public Criteria andImeiGreaterThan(String value) { - addCriterion("imei >", value, "imei"); - return (Criteria) this; - } - - public Criteria andImeiGreaterThanOrEqualTo(String value) { - addCriterion("imei >=", value, "imei"); - return (Criteria) this; - } - - public Criteria andImeiLessThan(String value) { - addCriterion("imei <", value, "imei"); - return (Criteria) this; - } - - public Criteria andImeiLessThanOrEqualTo(String value) { - addCriterion("imei <=", value, "imei"); - return (Criteria) this; - } - - public Criteria andImeiLike(String value) { - addCriterion("imei like", value, "imei"); - return (Criteria) this; - } - - public Criteria andImeiNotLike(String value) { - addCriterion("imei not like", value, "imei"); - return (Criteria) this; - } - - public Criteria andImeiIn(List values) { - addCriterion("imei in", values, "imei"); - return (Criteria) this; - } - - public Criteria andImeiNotIn(List values) { - addCriterion("imei not in", values, "imei"); - return (Criteria) this; - } - - public Criteria andImeiBetween(String value1, String value2) { - addCriterion("imei between", value1, value2, "imei"); - return (Criteria) this; - } - - public Criteria andImeiNotBetween(String value1, String value2) { - addCriterion("imei not between", value1, value2, "imei"); - return (Criteria) this; - } - - public Criteria andAmountIsNull() { - addCriterion("amount is null"); - return (Criteria) this; - } - - public Criteria andAmountIsNotNull() { - addCriterion("amount is not null"); - return (Criteria) this; - } - - public Criteria andAmountEqualTo(Long value) { - addCriterion("amount =", value, "amount"); - return (Criteria) this; - } - - public Criteria andAmountNotEqualTo(Long value) { - addCriterion("amount <>", value, "amount"); - return (Criteria) this; - } - - public Criteria andAmountGreaterThan(Long value) { - addCriterion("amount >", value, "amount"); - return (Criteria) this; - } - - public Criteria andAmountGreaterThanOrEqualTo(Long value) { - addCriterion("amount >=", value, "amount"); - return (Criteria) this; - } - - public Criteria andAmountLessThan(Long value) { - addCriterion("amount <", value, "amount"); - return (Criteria) this; - } - - public Criteria andAmountLessThanOrEqualTo(Long value) { - addCriterion("amount <=", value, "amount"); - return (Criteria) this; - } - - public Criteria andAmountIn(List values) { - addCriterion("amount in", values, "amount"); - return (Criteria) this; - } - - public Criteria andAmountNotIn(List values) { - addCriterion("amount not in", values, "amount"); - return (Criteria) this; - } - - public Criteria andAmountBetween(Long value1, Long value2) { - addCriterion("amount between", value1, value2, "amount"); - return (Criteria) this; - } - - public Criteria andAmountNotBetween(Long value1, Long value2) { - addCriterion("amount not between", value1, value2, "amount"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNull() { - addCriterion("create_time is null"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNotNull() { - addCriterion("create_time is not null"); - return (Criteria) this; - } - - public Criteria andCreateTimeEqualTo(Date value) { - addCriterion("create_time =", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotEqualTo(Date value) { - addCriterion("create_time <>", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThan(Date value) { - addCriterion("create_time >", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("create_time >=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThan(Date value) { - addCriterion("create_time <", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThanOrEqualTo(Date value) { - addCriterion("create_time <=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeIn(List values) { - addCriterion("create_time in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotIn(List values) { - addCriterion("create_time not in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeBetween(Date value1, Date value2) { - addCriterion("create_time between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotBetween(Date value1, Date value2) { - addCriterion("create_time not between", value1, value2, "createTime"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansExperRecord.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansExperRecord.java deleted file mode 100644 index 008b0d169..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansExperRecord.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.accompany.business.model.anchor; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; - -import java.util.Date; - -/** - * 粉丝团成员亲密度账单 - */ -@Data -@TableName("anchor_fans_exper_record") -public class AnchorFansExperRecord { - - @TableId(value = "id", type = IdType.AUTO) - private Long id; - private Long uid; - private Long targetUid; - private Byte billType; - private String objId; - private Long experAmount; - private Date createTime; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansLevelExperience.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansLevelExperience.java deleted file mode 100644 index 7491709d8..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansLevelExperience.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.accompany.business.model.anchor; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; - -/** - * lzm - * 2022-3-30 14:55:01 - */ -@Data -@TableName("anchor_fans_level_experience") -public class AnchorFansLevelExperience { - - /** - * 主键 - */ - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - private Integer levelSeq; - private String levelName; - private Long amount; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansPrivilegeConfig.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansPrivilegeConfig.java deleted file mode 100644 index 338c6c623..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansPrivilegeConfig.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.accompany.business.model.anchor; - -import com.accompany.common.annotation.ReplaceAppDomain; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; - -import java.util.Date; - -/** - * lzm - * 2022-3-30 14:55:01 - */ -@Data -@TableName("anchor_fans_privilege_config") -public class AnchorFansPrivilegeConfig { - - /** - * 主键 - */ - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - private String name; // 特权名称 - private Long normalId; // 特权id - private Long negativeId; // 特权id(消极) - private Long activeId; // 特权id(积极) - private String description; // 特权描述 - private Byte type; // 特权类型 - @ReplaceAppDomain - private String icon; // 图标 - private Byte status; // 状态 - private Date createTime; - private Byte seq; //排序 - private Byte isShow; // 是否展示 -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansTask.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansTask.java deleted file mode 100644 index a0ae02e16..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansTask.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.accompany.business.model.anchor; - -import com.accompany.common.annotation.ReplaceAppDomain; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; - -/** - * lzm - * 2022-3-30 14:55:01 - */ -@Data -@TableName("anchor_fans_task") -public class AnchorFansTask { - - /** - * 主键 - */ - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - private String taskCode; // 任务编码 - private String taskName; // 任务名称 - private String taskDesc; // 任务详情 - private Integer awardVal; // 奖励经验值,如果是赠送礼物,表示多少钻石换1经验 - private Integer totalNum; // 每日奖励总额 - private Integer onceVal; // 单次值 - private Integer limitNum; // 限制次数 - @ReplaceAppDomain - private String icon; // 图标 -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansTeam.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansTeam.java deleted file mode 100644 index a6280e2d8..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansTeam.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.accompany.business.model.anchor; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; - -import java.util.Date; - -/** - * lzm - * 2022-3-30 14:55:01 - */ -@Data -@TableName("anchor_fans_team") -public class AnchorFansTeam { - - /** - * 主键 - */ - @TableId(value = "id", type = IdType.AUTO) - private Long id; - private Long uid; - private String teamName; // 粉丝团设定的铭牌名称 - private Byte status; // 状态 0无效 1有效 2待审核 3审核不通过 - private Date createTime; - private Date updateTime; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansTeamAudioRecord.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansTeamAudioRecord.java deleted file mode 100644 index 059fbd312..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansTeamAudioRecord.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.accompany.business.model.anchor; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; - -import java.util.Date; - -/** - * lzm - * 2022-3-30 14:55:01 - */ -@Data -@TableName("anchor_fans_team_audio_record") -public class AnchorFansTeamAudioRecord { - - /** - * 主键 - */ - @TableId(value = "id", type = IdType.AUTO) - private Long id; - private Long teamId; // 粉丝团id - private Long uid; - private Integer privilegeId; - private String mpTx; // 粉丝团铭牌文案 - private Byte auditType; // 0待审核 1审核通过 2审核不通过 - private String remark; - private Date createTime; - private Date updateTime; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansTeamMember.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansTeamMember.java deleted file mode 100644 index 13979af1e..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansTeamMember.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.accompany.business.model.anchor; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; - -import java.util.Date; - -/** - * lzm - * 2022-3-30 14:55:01 - */ -@Data -@TableName("anchor_fans_team_member") -public class AnchorFansTeamMember { - - /** - * 主键 - */ - @TableId(value = "id", type = IdType.AUTO) - private Long id; - private Long memberUid; - private Long teamId; // 粉丝团id - private Integer levelSeq; // 等级序号 - private Long exper; // 亲密值 - private Byte status; // 状态 0无效 1有效 - private Date createTime; - private Date updateTime; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansTeamMpPic.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansTeamMpPic.java deleted file mode 100644 index 8f8aaa6b0..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/anchor/AnchorFansTeamMpPic.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.accompany.business.model.anchor; - -import com.accompany.common.annotation.ReplaceAppDomain; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; - -import java.util.Date; - -/** - * lzm - * 2022-3-30 14:55:01 - */ -@Data -@TableName("anchor_fans_team_mp_pic") -public class AnchorFansTeamMpPic { - - /** - * 主键 - */ - @TableId(value = "id", type = IdType.AUTO) - private Long id; - private Long teamId; - private Integer privilegeId; - private Integer levelSeq; - @ReplaceAppDomain - private String fansMpPic; // 基础粉丝团铭牌图片 - @ReplaceAppDomain - private String negativeMpPic; // 粉丝团铭牌图片(消极) - @ReplaceAppDomain - private String activeMpPic; // 粉丝团铭牌图片(炫酷) - private Date createTime; - private Date updateTime; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/audiocard/UserAudioCard.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/audiocard/UserAudioCard.java deleted file mode 100644 index 609945e9c..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/audiocard/UserAudioCard.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.accompany.business.model.audiocard; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import lombok.Data; - -import java.util.Date; - -@Data -public class UserAudioCard { - - @TableId(type= IdType.AUTO) - private Long id; - private Long uid; - private String audioUrl; - private Integer second; - private Date createTime; - private Date updateTime; - private Byte status; - private String auditor; - private Date auditTime; - private Boolean isDel; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/beanmap/HomeRoomFlowPeriod.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/beanmap/HomeRoomFlowPeriod.java deleted file mode 100644 index 8f8cd8a8d..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/beanmap/HomeRoomFlowPeriod.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.accompany.business.model.beanmap; - -/** - * Created by liuguofu on 2017/10/7. - */ -public class HomeRoomFlowPeriod implements Comparable { - private Long flowSumTotal; - private Long uid; - private double personFlowSumSeqNoValue; - private int onlineNum; - - public Long getFlowSumTotal() { - return flowSumTotal; - } - - public void setFlowSumTotal(Long flowSumTotal) { - this.flowSumTotal = flowSumTotal; - } - - public Long getUid() { - return uid; - } - - public void setUid(Long uid) { - this.uid = uid; - } - - public double getPersonFlowSumSeqNoValue() { - return personFlowSumSeqNoValue; - } - - public void setPersonFlowSumSeqNoValue(double personFlowSumSeqNoValue) { - this.personFlowSumSeqNoValue = personFlowSumSeqNoValue; - } - - public int getOnlineNum() { - return onlineNum; - } - - public void setOnlineNum(int onlineNum) { - this.onlineNum = onlineNum; - } - - @Override - public int compareTo(HomeRoomFlowPeriod homeRoomFlow) { - double roomPersonFlowSumSeqNoValueFrm = homeRoomFlow.getPersonFlowSumSeqNoValue(); - double roomPersonFlowSumSeqNoValueThis = this.getPersonFlowSumSeqNoValue(); - if (roomPersonFlowSumSeqNoValueThis > roomPersonFlowSumSeqNoValueFrm) { - return -1; - } else if (roomPersonFlowSumSeqNoValueThis < roomPersonFlowSumSeqNoValueThis) { - return 1; - } else { - return 0; - } - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/linearlypool/LinearlyPrizePoolDrawLineItem.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/linearlypool/LinearlyPrizePoolDrawLineItem.java deleted file mode 100644 index 8a0e5f8c8..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/linearlypool/LinearlyPrizePoolDrawLineItem.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.accompany.business.model.linearlypool; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -@Data -@TableName("linearly_prize_pool_draw_line_item") -public class LinearlyPrizePoolDrawLineItem { - - @TableId(value = "id", type = IdType.AUTO) - @ApiModelProperty("id") - private Long id; - @TableField(value = "line_id") - @ApiModelProperty("奖池线id") - private Long lineId; - @TableField(value = "prize_id") - @ApiModelProperty("奖品id") - private Integer prizeId; - @TableField(value = "prize_type") - @ApiModelProperty("奖品类型:1-萌币,2-礼物,3-座驾,4-头饰,5-背景,6-实物,7-靓号") - private Byte prizeType; - @TableField(value = "prize_name") - @ApiModelProperty("奖品名称") - private String prizeName; - @TableField(value = "prize_img_url") - @ApiModelProperty("奖品图片地址") - private String prizeImgUrl; - @TableField(value = "reference_id") - @ApiModelProperty("关联id,如座驾id等,没有则为0") - private Integer referenceId; - @TableField(value = "platform_value") - @ApiModelProperty("平台价值") - private Integer platformValue; - @TableField(value = "actual_value") - @ApiModelProperty("实际价值") - private Integer actualValue; - @TableField(value = "prize_level") - @ApiModelProperty("奖品等级:1-一级,2-二级,以此类推,共4级") - private Byte prizeLevel; - @TableField(value = "prize_pool_type") - @ApiModelProperty("奖品池类型:1-普通组奖池,2-高级组奖池") - private Byte prizePoolType; - @TableField(value = "prize_pool_group") - @ApiModelProperty("奖池组") - private Integer prizePoolGroup; - @TableField(value = "draw_status") - @ApiModelProperty("抽奖状态,0未被抽中,1已抽中") - private Byte drawStatus; - @TableField(value = "uid") - @ApiModelProperty("用户uid") - private Long uid; - @TableField(value = "device_id") - @ApiModelProperty("抽奖手机设备id") - private String deviceId; - @TableField(value = "draw_time") - @ApiModelProperty("抽奖时间") - private Date drawTime; - @TableField(value = "key_price") - @ApiModelProperty("抽奖时道具价格") - private Integer keyPrice; - @TableField(value = "create_time") - private Date createTime; - @TableField(value = "update_time") - private Date updateTime; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/linearlypool/LinearlyPrizePoolDrawLineItemDay.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/linearlypool/LinearlyPrizePoolDrawLineItemDay.java deleted file mode 100644 index bd1bb632a..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/linearlypool/LinearlyPrizePoolDrawLineItemDay.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.accompany.business.model.linearlypool; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -@Data -@TableName("linearly_prize_pool_draw_line_item_day") -public class LinearlyPrizePoolDrawLineItemDay { - - @TableId(value = "id", type = IdType.NONE) - @ApiModelProperty("id") - private Long id; - @TableField(value = "line_id") - @ApiModelProperty("奖池线id") - private Long lineId; - @TableField(value = "prize_id") - @ApiModelProperty("奖品id") - private Integer prizeId; - @TableField(value = "prize_type") - @ApiModelProperty("奖品类型:1-萌币,2-礼物,3-座驾,4-头饰,5-背景,6-实物,7-靓号") - private Byte prizeType; - @TableField(value = "prize_name") - @ApiModelProperty("奖品名称") - private String prizeName; - @TableField(value = "prize_img_url") - @ApiModelProperty("奖品图片地址") - private String prizeImgUrl; - @TableField(value = "reference_id") - @ApiModelProperty("关联id,如座驾id等,没有则为0") - private Integer referenceId; - @TableField(value = "platform_value") - @ApiModelProperty("平台价值") - private Integer platformValue; - @TableField(value = "actual_value") - @ApiModelProperty("实际价值") - private Integer actualValue; - @TableField(value = "prize_level") - @ApiModelProperty("奖品等级:1-一级,2-二级,以此类推,共4级") - private Byte prizeLevel; - @TableField(value = "prize_pool_type") - @ApiModelProperty("奖品池类型:1-普通组奖池,2-高级组奖池") - private Byte prizePoolType; - @TableField(value = "prize_pool_group") - @ApiModelProperty("奖池组") - private Integer prizePoolGroup; - @TableField(value = "draw_status") - @ApiModelProperty("抽奖状态,0未被抽中,1已抽中") - private Byte drawStatus; - @TableField(value = "uid") - @ApiModelProperty("用户uid") - private Long uid; - @TableField(value = "device_id") - @ApiModelProperty("抽奖手机设备id") - private String deviceId; - @TableField(value = "draw_time") - @ApiModelProperty("抽奖时间") - private Date drawTime; - @TableField(value = "key_price") - @ApiModelProperty("抽奖时道具价格") - private Integer keyPrice; - @TableField(value = "create_time") - private Date createTime; - @TableField(value = "update_time") - private Date updateTime; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/linearlypool/LinearlyPrizePoolItem.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/linearlypool/LinearlyPrizePoolItem.java deleted file mode 100644 index b7f7d1340..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/linearlypool/LinearlyPrizePoolItem.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.accompany.business.model.linearlypool; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -@Data -@TableName("linearly_prize_pool_item") -public class LinearlyPrizePoolItem { - @TableId(value = "id", type = IdType.AUTO) - @ApiModelProperty("id") - private Long id; - @TableField(value = "prize_id") - @ApiModelProperty("奖品id") - private Integer prizeId; - @TableField(value = "prize_pool_type") - @ApiModelProperty("奖品池类型:1-普通组奖池,2-高级组奖池") - private Byte prizePoolType; - @TableField(value = "prize_num") - @ApiModelProperty("奖品数量") - private Integer prizeNum; - @TableField(value = "pool_version") - @ApiModelProperty("奖池版本号") - private Integer poolVersion; - @TableField(value = "show_ratio") - @ApiModelProperty("展示的奖品概率占比十万分比(一个奖品池的总占比不能超十万") - private Integer showRatio; - @TableField(value = "creator") - @ApiModelProperty("创建人名称") - private String creator; - @TableField(value = "create_time") - private Date createTime; - @TableField(value = "update_time") - private Date updateTime; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/linearlypool/LinearlyPrizePoolItemDraft.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/linearlypool/LinearlyPrizePoolItemDraft.java deleted file mode 100644 index cb3793df2..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/linearlypool/LinearlyPrizePoolItemDraft.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.accompany.business.model.linearlypool; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -@Data -@TableName("linearly_prize_pool_item_draft") -public class LinearlyPrizePoolItemDraft { - @TableId(value = "id", type = IdType.AUTO) - @ApiModelProperty("id") - private Long id; - @TableField(value = "prize_id") - @ApiModelProperty("奖品id") - private Integer prizeId; - @TableField(value = "prize_pool_type") - @ApiModelProperty("奖品池类型:1-普通组奖池,2-高级组奖池") - private Byte prizePoolType; - @TableField(value = "prize_num") - @ApiModelProperty("奖品数量") - private Integer prizeNum; - @TableField(value = "pool_version") - @ApiModelProperty("奖池版本号") - private Integer poolVersion; - @TableField(value = "show_ratio") - @ApiModelProperty("展示的奖品概率占比十万分比(一个奖品池的总占比不能超十万") - private Integer showRatio; - @TableField(value = "creator") - @ApiModelProperty("创建人名称") - private String creator; - @TableField(value = "create_time") - private Date createTime; - @TableField(value = "update_time") - private Date updateTime; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasureConvertItem.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasureConvertItem.java deleted file mode 100644 index 2f15a5bf8..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasureConvertItem.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.accompany.business.model.treasure; - -import com.accompany.core.mybatis.typehandler.IntegerListTypeHandler; -import com.accompany.core.mybatis.typehandler.LongListTypeHandler; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; -import java.util.List; - -@Data -@NoArgsConstructor -@TableName(value = "seize_treasure_convert_item", autoResultMap = true) -public class SeizeTreasureConvertItem { - - @TableId(type = IdType.AUTO) - private Long id; - - private Long rewardId; - - private Integer type; - - private Integer level; - - private Integer expendType; - - private Integer expendNum; - - private Integer status; - - private Date createTime; - - private Date updateTime; - - private Integer effectDay; - - private Date expireTime; - - private Integer seq; - - @TableField(value = "prop_ids", typeHandler = LongListTypeHandler.class) - private List propIds; - - @TableField(value = "prop_nums", typeHandler = IntegerListTypeHandler.class) - private List propNums; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasureConvertRecord.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasureConvertRecord.java deleted file mode 100644 index 8caef16ac..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasureConvertRecord.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.accompany.business.model.treasure; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -@Data -@NoArgsConstructor -public class SeizeTreasureConvertRecord { - @TableId(type = IdType.AUTO) - private Long id; - private Long uid; - private Long itemId; - private Integer convertType; - private Integer convertLevel; - private Long rewardId; - private String rewardType; - private String rewardName; - private Integer rewardNum; - private String rewardUnit; - private String rewardPicUrl; - private Integer rewardShowValue; - private Date createTime; - private Date updateTime; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasurePoolDrawRecord.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasurePoolDrawRecord.java deleted file mode 100644 index ca3bb3d2f..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasurePoolDrawRecord.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.accompany.business.model.treasure; - -import com.accompany.business.vo.treasure.reward.SeizeTreasurePoolRewardCache; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -import java.util.Date; - -@Data -@Accessors(chain = true) -@NoArgsConstructor -@AllArgsConstructor -public class SeizeTreasurePoolDrawRecord { - - @TableId(type = IdType.AUTO) - private Long id; - - private Integer poolType; - - private Integer poolGroup; - - private Integer poolLevel; - - private Long poolId; - - private Long rewardId; - - private Long uid; - - private Date createTime; - - private Date updateTime; - - private String rewardName; - - private Integer rewardValue; - - private Integer rewardNum; - - private String rewardType; - - private Long rewardRefId; - - public SeizeTreasurePoolDrawRecord(Long uid, SeizeTreasurePoolRewardCache rewardCache) { - this.poolType = rewardCache.getPoolType(); - this.poolGroup = rewardCache.getPoolGroup(); - this.poolLevel = rewardCache.getPoolLevel(); - this.poolId = rewardCache.getPoolId(); - this.uid = uid; - SeizeTreasureReward reward = rewardCache.getReward(); - if (reward != null) { - this.rewardId = reward.getId(); - this.rewardName = reward.getRewardName(); - this.rewardValue = reward.getRewardValue(); - this.rewardNum = reward.getRewardNum(); - this.rewardType = reward.getRewardType(); - this.rewardRefId = reward.getRewardRefId(); - } - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasurePoolItem.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasurePoolItem.java deleted file mode 100644 index 330e30345..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasurePoolItem.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.accompany.business.model.treasure; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -@Data -@NoArgsConstructor -public class SeizeTreasurePoolItem { - @TableId(type = IdType.AUTO) - private Long id; - private Integer poolType; - private Integer poolGroup; - private Integer poolLevel; - private Long rewardId; - private Integer poolNum; - private Integer ratio; - private Integer showRatio; - private Integer itemIndex; - private Integer itemOrder; - private String creator; - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date createTime; - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date updateTime; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasureProp.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasureProp.java deleted file mode 100644 index cd5b8ee38..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasureProp.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.accompany.business.model.treasure; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -@Data -@NoArgsConstructor -public class SeizeTreasureProp { - @TableId(type = IdType.AUTO) - private Long id; - private Integer type; - private Integer level; - private String name; - private String picUrl; - private Date createTime; - private Date updateTime; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasureReward.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasureReward.java deleted file mode 100644 index 086529aff..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasureReward.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.accompany.business.model.treasure; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -@Data -@NoArgsConstructor -@TableName("seize_treasure_reward") -public class SeizeTreasureReward { - - @TableId(type = IdType.AUTO) - private Long id; - - /** - * 奖励类型 - */ - private String rewardType; - - /** - * 关联id - */ - private Long rewardRefId; - - private String rewardName; - - private String rewardPicUrl; - - private Integer rewardNum; - - private String rewardUnit; - - private Integer rewardValue; - - private Integer rewardShowValue; - - private Integer rewardLevel; - - private Integer rewardOrder; - - private String creator; - - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date createTime; - - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date updateTime; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasureUserProp.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasureUserProp.java deleted file mode 100644 index 75f343b0a..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasureUserProp.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.accompany.business.model.treasure; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -import java.util.Date; - -@Data -@Accessors(chain = true) -@NoArgsConstructor -public class SeizeTreasureUserProp { - @TableId(type = IdType.AUTO) - private Long id; - private Long uid; - private Long propId; - private Integer propNum; - private Date createTime; - private Date updateTime; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasureUserPropRecord.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasureUserPropRecord.java deleted file mode 100644 index a2561d024..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/treasure/SeizeTreasureUserPropRecord.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.accompany.business.model.treasure; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -@Data -@NoArgsConstructor -public class SeizeTreasureUserPropRecord { - @TableId(type = IdType.AUTO) - private Long id; - private Long uid; - private Long propId; - private Integer propNum; - private Integer type; - private Long targetUid; - private Long bizId; - private Integer bizLevel; - private Date createTime; - private Date updateTime; - - private String propName; - private String picUrl; - - public SeizeTreasureUserPropRecord(Long uid, Long propId, Integer type, String propName, String picUrl) { - this(uid, type, propId, 1, null, null, null, propName, picUrl); - } - - public SeizeTreasureUserPropRecord(Long uid, Long propId, Integer type, Long targetUid, String propName, String picUrl) { - this(uid, type, propId, 1, targetUid, null, null, propName, picUrl); - } - - public SeizeTreasureUserPropRecord(Long uid, Integer type, Long propId, Integer propNum, Long bizId, String propName, String picUrl) { - this(uid, type, propId, propNum, null, bizId, null, propName, picUrl); - } - - public SeizeTreasureUserPropRecord(Long uid, Integer type, Long propId, Integer propNum, Long targetUid, Long bizId, Integer bizLevel, String propName, String picUrl) { - this.uid = uid; - this.propId = propId; - this.propNum = propNum; - this.type = type; - this.targetUid = targetUid; - this.bizId = bizId; - this.bizLevel = bizLevel; - this.propName = propName; - this.picUrl = picUrl; - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/userevent/vo/UserEventSubVO.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/userevent/vo/UserEventSubVO.java index 7d74e7350..dd9792ce9 100644 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/userevent/vo/UserEventSubVO.java +++ b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/userevent/vo/UserEventSubVO.java @@ -2,23 +2,13 @@ package com.accompany.business.model.userevent.vo; import com.accompany.business.model.userevent.UserEventSub; import com.accompany.common.annotation.ReplaceAppDomain; -import com.accompany.core.annotation.I18n; -import com.accompany.core.vo.PrivatePhotoVo; import com.accompany.core.vo.UserLevelVo; -import com.accompany.core.vo.audiocard.UserAudioCardVo; -import com.accompany.core.vo.car.CarportVo; -import com.accompany.core.vo.headwear.UserHeadwearVo; -import com.accompany.core.vo.live.LiveUserInfoSkillVo; -import com.accompany.core.vo.user.InfoCardVo; -import com.accompany.core.vo.user.UserExpandVo; import com.accompany.core.vo.vip.UserVipInfoVO; import com.fasterxml.jackson.annotation.JsonInclude; -import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import java.util.Date; -import java.util.List; /** * 用户活动订阅表视图实体类 diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/param/GiftCompoundParam.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/param/GiftCompoundParam.java deleted file mode 100644 index 1d2442380..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/param/GiftCompoundParam.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.accompany.business.param; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * @author guojicong - * @Description - * @create 2022-06-20 - */ -@Data -@NoArgsConstructor -public class GiftCompoundParam { - @ApiModelProperty("房间uid") - private Long roomUid; - @ApiModelProperty("合成奖励id") - private Integer compoundRewardId; - @ApiModelProperty("消耗礼物信息") - private List compoundList; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/AppVersionVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/AppVersionVo.java deleted file mode 100644 index 9519cbdc2..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/AppVersionVo.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.accompany.business.vo; - -import com.accompany.common.annotation.ReplaceAppDomain; -import lombok.Data; - -/** - * Created by liuguofu on 2017/11/9. - */ -@Data -public class AppVersionVo { - - private String os; - - private String version; - - private Byte status; - - private String versionDesc; - - private String updateVersion; - - private String updateVersionDesc; - - @ReplaceAppDomain - private String updateDownloadLink; - - private String updateFileMd5; - - private Byte updateStatus; - - private String updateOs; - - private String updateChannel; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/EditVersionVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/EditVersionVo.java deleted file mode 100644 index 5b132dd1f..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/EditVersionVo.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.accompany.business.vo; - -import com.accompany.business.model.AppVersion; -import com.google.common.collect.Lists; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.BeanUtils; - -import java.util.List; - -/** - * @Author: chucheng - * @Date: 2019/3/27 14:52 - * @Description: - */ - -public class EditVersionVo extends AppVersion { - - private String fileInfo; - - private final static Gson gson = new Gson(); - - public String getFileInfo() { - return fileInfo; - } - - public void setFileInfo(String fileInfo) { - this.fileInfo = fileInfo; - } - - public EditVersionVo(){ - - } - - public EditVersionVo(AppVersion appVersion){ - BeanUtils.copyProperties(appVersion,this); - initFileInfo(); - } - - public AppVersion getAppVersion(){ - AppVersion appVersion = new AppVersion(); - BeanUtils.copyProperties(this,appVersion); - return appVersion; - } - - public List getFileInfoList(){ - List list = Lists.newArrayList(); - if(StringUtils.isNotBlank(this.getFileInfo())){ - list = gson.fromJson(this.getFileInfo(), new TypeToken>() {}.getType()); - } - return list; - } - - private void initFileInfo(){ - List list = Lists.newArrayList(); - if(StringUtils.isNotBlank(this.getFileMd5())){ - UploadFileInfoVo infoVo = new UploadFileInfoVo(); - infoVo.setPath(this.getDownloadLink()); - infoVo.setMd5(this.getFileMd5()); - infoVo.setSuccess( true); - list.add(infoVo); - } - this.setFileInfo(gson.toJson(list)); - } - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/ExpendRecordVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/ExpendRecordVo.java deleted file mode 100644 index 521565ca2..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/ExpendRecordVo.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.accompany.business.vo; - -import com.accompany.common.annotation.ReplaceAppDomain; - -import java.util.Date; - -public class ExpendRecordVo implements Comparable { - @ReplaceAppDomain - private String userAvatar; - - private String userNick; - - private Long money; - - @ReplaceAppDomain - private String targetAvatar; - - private String giftName; - - private String targetNick; - - @ReplaceAppDomain - private String giftPic; - - private Integer giftNum; - - private Date recordTime; - - private Long goldNum; - - private Byte expendType; - - private Double diamoundNum; - - public void setDiamoundNum(Double diamoundNum) { this.diamoundNum = diamoundNum; } - - public Double getDiamoundNum() { return diamoundNum; } - - public void setMoney(Long money) { - this.money = money; - } - - public Long getMoney() { return money; } - - public void setGiftPic(String giftPic) { - this.giftPic = giftPic; - } - - public void setGiftNum(Integer giftNum) { - this.giftNum = giftNum; - } - - public void setGiftName(String giftName) { - this.giftName = giftName; - } - - public String getGiftName() { - return giftName; - } - - public String getGiftPic() { return giftPic; } - - public Integer getGiftNum() { - return giftNum; - } - - public void setUserAvatar(String userAvatar) { - this.userAvatar = userAvatar; - } - - public void setUserNick(String userNick) { - this.userNick = userNick; - } - - public void setTargetAvatar(String targetAvatar) { - this.targetAvatar = targetAvatar; - } - - public void setTargetNick(String targetNick) { - this.targetNick = targetNick; - } - - public void setRecordTime(Date recordTime) { - this.recordTime = recordTime; - } - - public void setGoldNum(Long goldNum) { - this.goldNum = goldNum; - } - - public void setExpendType(Byte expendType) { - this.expendType = expendType; - } - - public Byte getExpendType() { return expendType; } - - public String getUserAvatar() { return userAvatar; } - - public String getUserNick() { - return userNick; - } - - public String getTargetAvatar() { - return targetAvatar; - } - - public String getTargetNick() { - return targetNick; - } - - public Date getRecordTime() { - return recordTime; - } - - public Long getGoldNum() { - return goldNum; - } - - @Override - public int compareTo(ExpendRecordVo expendRecordVo) { - Date recordTimeVo = expendRecordVo.recordTime; - Date recordTimeThis = this.recordTime; - if (recordTimeThis.getTime() > recordTimeVo.getTime()) { - return -1; - } else if (recordTimeThis.getTime() < recordTimeVo.getTime()) { - return 1; - } else { - return 0; - } - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/FollowVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/FollowVo.java deleted file mode 100644 index 400a21d4d..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/FollowVo.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.accompany.business.vo; - -import com.google.common.collect.Lists; - -import java.util.Collections; -import java.util.List; - -/** - * Created by liuguofu on 2017/7/10. - */ -public class FollowVo implements Comparable { - private Long uid; - private boolean valid; - - private String avatar; - private String nick; - private Integer fansNum; - - public void setAvatar(String avatar) { - this.avatar = avatar; - } - - public void setNick(String nick) { - this.nick = nick; - } - - public void setFansNum(Integer fansNum) { - this.fansNum = fansNum; - } - - public String getAvatar() { - - return avatar; - } - - public String getNick() { - return nick; - } - - public Integer getFansNum() { - return fansNum; - } - - public Long getUid() { - return uid; - } - - public void setUid(Long uid) { - this.uid = uid; - } - - public boolean isValid() { - return valid; - } - - public void setValid(boolean valid) { - this.valid = valid; - } - - @Override - public int compareTo(FollowVo followVo) { - boolean validVo = followVo.isValid(); - boolean validThis = this.valid; - int validVoInt = 0; - int validThisInt = 0; - if (validVo) { - validVoInt = 1; - } - if (validThis) { - validThisInt = 1; - } - if (validVoInt > validThisInt) - return 1; - else if (validVoInt < validThisInt) - return -1; - else - return 0; - } - - public static void business(String args[]) { - FollowVo followVo = new FollowVo(); - followVo.setUid(1L); - followVo.setValid(false); - - - FollowVo followVo1 = new FollowVo(); - followVo1.setUid(2L); - followVo1.setValid(true); - - - FollowVo followVo2 = new FollowVo(); - followVo2.setUid(3L); - followVo2.setValid(false); - - - FollowVo followVo3 = new FollowVo(); - followVo3.setUid(4L); - followVo3.setValid(true); - - FollowVo followVo4 = new FollowVo(); - followVo4.setUid(5L); - followVo4.setValid(false); - List list = Lists.newArrayList(); - - list.add(followVo); - list.add(followVo1); - list.add(followVo2); - list.add(followVo3); - list.add(followVo4); - - for (int i = 0; i < list.size(); i++) { - System.out.print(list.get(i).getUid()); - } - Collections.sort(list); - System.out.println("----------------"); - for (int i = 0; i < list.size(); i++) { - System.out.print(list.get(i).getUid()); - } - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/GainRecordVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/GainRecordVo.java deleted file mode 100644 index 86dc596df..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/GainRecordVo.java +++ /dev/null @@ -1,149 +0,0 @@ -package com.accompany.business.vo; - -import com.accompany.common.annotation.ReplaceAppDomain; - -import java.util.Date; - -public class GainRecordVo implements Comparable { - @ReplaceAppDomain - private String userAvatar; - - private String userNick; - - @ReplaceAppDomain - private String targetAvatar; - - private Long money; - - public void setMoney(Long money) { - this.money = money; - } - - public Long getMoney() { - - return money; - } - - private String giftName; - - private Long goldNum; - - public void setGoldNum(Long goldNum) { - this.goldNum = goldNum; - } - - public Long getGoldNum() { - - return goldNum; - } - - private String targetNick; - - private Double diamondNum; - - @ReplaceAppDomain - private String giftPic; - - private Integer giftNum; - - public void setGiftName(String giftName) { - this.giftName = giftName; - } - - public String getGiftName() { - - return giftName; - } - - public void setGiftPic(String giftPic) { - this.giftPic = giftPic; - } - - public void setGiftNum(Integer giftNum) { - this.giftNum = giftNum; - } - - public String getGiftPic() { - - return giftPic; - } - - public Integer getGiftNum() { - return giftNum; - } - - private Date recordTime; - - private Byte gainType; - - public void setGainType(Byte gainType) { - this.gainType = gainType; - } - - public Byte getGainType() { - - return gainType; - } - - public void setUserAvatar(String userAvatar) { - this.userAvatar = userAvatar; - } - - public void setUserNick(String userNick) { - this.userNick = userNick; - } - - public void setTargetAvatar(String targetAvatar) { - this.targetAvatar = targetAvatar; - } - - public void setTargetNick(String targetNick) { - this.targetNick = targetNick; - } - - public void setDiamondNum(Double diamondNum) { - this.diamondNum = diamondNum; - } - - public void setRecordTime(Date recordTime) { - this.recordTime = recordTime; - } - - public String getUserAvatar() { - - return userAvatar; - } - - public String getUserNick() { - return userNick; - } - - public String getTargetAvatar() { - return targetAvatar; - } - - public String getTargetNick() { - return targetNick; - } - - public Double getDiamondNum() { - return diamondNum; - } - - public Date getRecordTime() { - return recordTime; - } - - @Override - public int compareTo(GainRecordVo gainRecordVo) { - Date recordTimeVo = gainRecordVo.recordTime; - Date recordTimeThis = this.recordTime; - if (recordTimeThis.getTime() > recordTimeVo.getTime()) { - return -1; - } else if (recordTimeThis.getTime() < recordTimeVo.getTime()) { - return 1; - } else { - return 0; - } - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/GiftNotifyConfigVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/GiftNotifyConfigVo.java deleted file mode 100644 index e21f2f520..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/GiftNotifyConfigVo.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.accompany.business.vo; - -import com.accompany.business.model.GiftNotifyLevel; - -import java.util.Date; - -/** - * Created by PaperCut on 2018/5/9. - */ -public class GiftNotifyConfigVo { - private Integer notifyConfigId; - - private Integer notifyLevelId; - - private Integer notifyTriggerType; - - private Long minGold; - - private Long maxGold; - - private Long giftId; - - private Date createTime; - - private GiftNotifyLevel notifyLevel; - - public Integer getNotifyConfigId() { - return notifyConfigId; - } - - public void setNotifyConfigId(Integer notifyConfigId) { - this.notifyConfigId = notifyConfigId; - } - - public Integer getNotifyLevelId() { - return notifyLevelId; - } - - public void setNotifyLevelId(Integer notifyLevelId) { - this.notifyLevelId = notifyLevelId; - } - - public Integer getNotifyTriggerType() { - return notifyTriggerType; - } - - public void setNotifyTriggerType(Integer notifyTriggerType) { - this.notifyTriggerType = notifyTriggerType; - } - - public Long getMinGold() { - return minGold; - } - - public void setMinGold(Long minGold) { - this.minGold = minGold; - } - - public Long getMaxGold() { - return maxGold; - } - - public void setMaxGold(Long maxGold) { - this.maxGold = maxGold; - } - - public Long getGiftId() { - return giftId; - } - - public void setGiftId(Long giftId) { - this.giftId = giftId; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public GiftNotifyLevel getNotifyLevel() { - return notifyLevel; - } - - public void setNotifyLevel(GiftNotifyLevel notifyLevel) { - this.notifyLevel = notifyLevel; - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/ReceiptVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/ReceiptVo.java deleted file mode 100644 index bbbe3ec84..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/ReceiptVo.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.accompany.business.vo; - -/** - * Created by 北岭山下 on 2017/7/20. - */ -public class ReceiptVo { - private String transcationId; - private String recipt; - private String orderId; - - public String getTranscationId() { - return transcationId; - } - - public void setTranscationId(String transcationId) { - this.transcationId = transcationId; - } - - public String getRecipt() { - return recipt; - } - - public void setRecipt(String recipt) { - this.recipt = recipt; - } - - public String getOrderId() { - return orderId; - } - - public void setOrderId(String orderId) { - this.orderId = orderId; - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/RoomRecommendVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/RoomRecommendVo.java deleted file mode 100644 index d161e39be..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/RoomRecommendVo.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.accompany.business.vo; - -/** - * 2 * @Author: zhuct - * 3 * @Date: 2019/6/5 16:56 - * 4 - */ -public class RoomRecommendVo { - private Long id; - - private Long roomUid; - - private Byte labelType; - - private Byte status; - - private Integer seqNo; - - private String startTime; - - private String endTime; - - private String roomTitle; - - private Long erbanNo; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Long getRoomUid() { - return roomUid; - } - - public void setRoomUid(Long roomUid) { - this.roomUid = roomUid; - } - - public Byte getLabelType() { - return labelType; - } - - public void setLabelType(Byte labelType) { - this.labelType = labelType; - } - - public Byte getStatus() { - return status; - } - - public void setStatus(Byte status) { - this.status = status; - } - - public Integer getSeqNo() { - return seqNo; - } - - public void setSeqNo(Integer seqNo) { - this.seqNo = seqNo; - } - - public String getStartTime() { - return startTime; - } - - public void setStartTime(String startTime) { - this.startTime = startTime; - } - - public String getEndTime() { - return endTime; - } - - public void setEndTime(String endTime) { - this.endTime = endTime; - } - - public String getRoomTitle() { - return roomTitle; - } - - public void setRoomTitle(String roomTitle) { - this.roomTitle = roomTitle; - } - - public Long getErbanNo() { - return erbanNo; - } - - public void setErbanNo(Long erbanNo) { - this.erbanNo = erbanNo; - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/RoomVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/RoomVo.java index 20e70190c..0eb7a3076 100644 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/RoomVo.java +++ b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/RoomVo.java @@ -2,7 +2,6 @@ package com.accompany.business.vo; import com.accompany.business.vo.box.BoxSwitchVo; import com.accompany.business.vo.findlove.FindLoveDrawSwitchVo; -import com.accompany.business.vo.treasure.SeizeTreasureSwitchConfig; import com.accompany.common.annotation.ReplaceAppDomain; import com.accompany.core.annotation.I18n; import com.alibaba.fastjson.JSON; @@ -438,12 +437,6 @@ public class RoomVo implements Comparable { @ApiModelProperty("是否相册权限") private Boolean hasRoomAlbum; - /** - * 夺宝配置 - */ - @ApiModelProperty("夺宝配置") - private SeizeTreasureSwitchConfig seizeTreasureSwitchVo; - /** * 红包开通类型 1 厅内红包(0b1) 2 全服红包(0b10) 3 厅内红包+全服红包(0b11) */ diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/SimpleNewUserVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/SimpleNewUserVo.java deleted file mode 100644 index 64898c06b..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/SimpleNewUserVo.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.accompany.business.vo; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * Created by chucheng on 2019/1/18. - */ -@ApiModel -@Data -public class SimpleNewUserVo extends SimpleUserVo { - - @ApiModelProperty("注册时间") - private String createTime; - @ApiModelProperty("是否首充") - private Boolean firstCharge; - @ApiModelProperty("地区") - private String region; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/WithDrawCashProdVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/WithDrawCashProdVo.java deleted file mode 100644 index 402f398e2..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/WithDrawCashProdVo.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.accompany.business.vo; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.math.BigDecimal; - -/** - * {这里添加描述} - * - * @author fangchengyan - * @date 2019-12-25 11:25 上午 - */ -@Data -@Builder -@AllArgsConstructor -@NoArgsConstructor -public class WithDrawCashProdVo { - - private String cashProdId; - - private String cashProdName; - - private Long diamondNum; - - private Long cashNum; - - private Integer seqNo; - - /** 实际到账金额 */ - private BigDecimal actualArrival; - - /** 提现手续费 */ - private BigDecimal withdrawalFee; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/WithDrawVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/WithDrawVo.java deleted file mode 100644 index 9e6c9d9b3..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/WithDrawVo.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.accompany.business.vo; - -import lombok.Data; - -/** - * @author yangming - * @date 2020-04-18 - * 提现 - */ -@Data -public class WithDrawVo { - - private Long uid; - - private Double diamondNum; - - private Boolean isNotBoundPhone; - - private Boolean isBindPaymentPwd; - - private Boolean isBindAlipay; - - private String alipayAccount; - - private String alipayAccountName; - - private Double goldNum; - - /** 是否绑定银行卡*/ - private Boolean isBindBankCard; - - /** 银行卡号 */ - private String bankCardNum; - - /** 持卡人姓名 */ - private String bankCardName; - - /** - * 银行卡最低提现金额 - */ - private Integer bankCardMinAmount; - - /** - * 默认的提现账号类型 - */ - private Integer defaultWithdrawAccountType; - - /** - * 提现方式切换按钮是否展示 - */ - private Boolean switchButtonShow; - - /** 提现费率 */ - private Double withdrawRate; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/WorldGroupChatMemberInfoVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/WorldGroupChatMemberInfoVo.java deleted file mode 100644 index 37fc47974..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/WorldGroupChatMemberInfoVo.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.accompany.business.vo; - -import com.accompany.common.annotation.ReplaceAppDomain; -import com.accompany.core.vo.UserLevelVo; -import lombok.Data; - -/** - * @Author: - * @Date: 2019/7/5 16:56 - * @Description: - */ -@Data -public class WorldGroupChatMemberInfoVo { - - private String nick; - - private Byte gender; - - @ReplaceAppDomain - private String avatar; - - /** - * 用户uid - */ - private Long uid; - - /** - * 状态 - */ - private Integer status; - - /** - * 是否创始人 - */ - private boolean ownerFlag; - - /** - * 是否在线 - */ - private boolean onlineFlag; - - /** - * 当前所在派对 - */ - private Long currentRoomUid; - - /** - * 用户等级信息 - */ - private UserLevelVo userLevelVo; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansMemberRankVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansMemberRankVo.java deleted file mode 100644 index 572ffd9a0..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansMemberRankVo.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.accompany.business.vo.anchor; - - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.ArrayList; -import java.util.List; - -@ApiModel("粉丝榜vo") -@Data -public class AnchorFansMemberRankVo { - - @ApiModelProperty(value = "主播uid") - private Long teamUid; - @ApiModelProperty(value = "活跃人数") - private Long activeNum; - @ApiModelProperty(value = "成员") - private List memberVos = new ArrayList<>(); - @ApiModelProperty(value = "当前用户是否加入") - private Boolean isJoin = false; - @ApiModelProperty(value = "当前用户加入后的成员信息") - private AnchorFansMemberVo currentUserMemberVo; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansMemberVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansMemberVo.java deleted file mode 100644 index ba3d8b486..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansMemberVo.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.accompany.business.vo.anchor; - -import com.accompany.common.annotation.ReplaceAppDomain; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -@ApiModel("成员vo") -@Data -public class AnchorFansMemberVo { - - @ApiModelProperty("对应粉丝团主播uid") - private Long teamUid; - @ApiModelProperty(value = "成员id") - private Long memberUid; - @ApiModelProperty(value = "成员头像") - @ReplaceAppDomain - private String avatar; - @ApiModelProperty(value = "成员昵称") - private String nick; - @ApiModelProperty(value = "粉丝团铭牌图片") - @ReplaceAppDomain - private String nameplateImage; - @ApiModelProperty(value = "亲密值") - private Long exper; - @ApiModelProperty(value = "亲密等级") - private Integer levelSeq; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansPrivilegeConfigVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansPrivilegeConfigVo.java deleted file mode 100644 index 855564e03..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansPrivilegeConfigVo.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.accompany.business.vo.anchor; - -import com.accompany.business.vo.GiftVo; -import com.accompany.common.annotation.ReplaceAppDomain; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -@Data -@ApiModel("粉丝特权") -public class AnchorFansPrivilegeConfigVo { - - @ApiModelProperty(value = "粉丝团id") - private Integer privilegeId; - @ApiModelProperty(value = "特权名称") - private String name; - @ApiModelProperty(value = "特权对应的铭牌/礼物id") - private Long normalId; - @ApiModelProperty(value = "特权描述") - private String description; - @ApiModelProperty(value = "特权类型 1铭牌 2专属礼物 3入团礼物") - private Byte type; - @ReplaceAppDomain - @ApiModelProperty(value = "图标") - private String icon; // 图标 - @ApiModelProperty(value = "状态 0无效 1有效") - private Byte status; // 状态 - @ApiModelProperty(value = "创建时间") - private Date createTime; - @ApiModelProperty(value = "展示排序") - private Integer seq; - @ApiModelProperty(value = "是否展示") - private Byte isShow; - - @ApiModelProperty(value = "对应礼物id") - private GiftVo giftVo; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansTaskInfoVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansTaskInfoVo.java deleted file mode 100644 index 91255d603..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansTaskInfoVo.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.accompany.business.vo.anchor; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.ArrayList; -import java.util.List; - -@ApiModel("粉丝团任务Vo") -@Data -public class AnchorFansTaskInfoVo { - - @ApiModelProperty(value = "粉丝团id") - private Long teamId; - @ApiModelProperty(value = "主播uid") - private Long teamUid; - @ApiModelProperty(value = "主播头像") - private String anchorAvatar; - @ApiModelProperty(value = "主播昵称") - private String anchorNick; - @ApiModelProperty(value = "粉丝团总人数") - private Long teamNum; - @ApiModelProperty(value = "当前用户uid") - private Long memberUid; - @ApiModelProperty(value = "当前用户头像") - private String memberAvatar; - @ApiModelProperty(value = "榜单前三用户头像") - private List avatarList = new ArrayList<>(); - - @ApiModelProperty(value = "粉丝任务") - private List taskVos = new ArrayList<>(); - - - @ApiModelProperty(value = "亲密值等级") - private Integer levelSeq; - @ApiModelProperty(value = "亲密值") - private Long levelExper; - @ApiModelProperty(value = "下一等级亲密值") - private Long nextLevelExper; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansTaskVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansTaskVo.java deleted file mode 100644 index 240a548e8..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansTaskVo.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.accompany.business.vo.anchor; - -import com.accompany.common.annotation.ReplaceAppDomain; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -@Data -@ApiModel("粉丝团任务") -public class AnchorFansTaskVo { - - @ApiModelProperty(value = "任务id") - private Integer taskId; - @ApiModelProperty(value = "任务编码") - private String taskCode; // 任务编码 - @ApiModelProperty(value = "任务名称") - private String taskName; // 任务名称 - @ApiModelProperty(value = "图标") - @ReplaceAppDomain - private String icon; // 图标 - @ApiModelProperty(value = "任务详情") - private String taskDesc; // 任务详情 - @ApiModelProperty(value = "目前增加的经验值") - private Integer awardVal; // 目前增加的经验值 - @ApiModelProperty(value = "每日奖励总额") - private Integer totalNum; // 每日奖励总额 - @ApiModelProperty(value = "是否完成") - private Boolean isFinished; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansTeamAudioRecordVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansTeamAudioRecordVo.java deleted file mode 100644 index 72d129be7..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansTeamAudioRecordVo.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.accompany.business.vo.anchor; - -import com.accompany.common.annotation.ReplaceAppDomain; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -@Data -@ApiModel -public class AnchorFansTeamAudioRecordVo { - - - @ApiModelProperty(value = "任务id") - private Long id; - @ApiModelProperty(value = "粉丝团id") - private Long teamId; - @ApiModelProperty(value = "用户uid") - private String uid; - @ApiModelProperty(value = "特权id") - private Byte privilegeId; - @ApiModelProperty(value = "用户昵称") - private String nick; - @ApiModelProperty(value = "用户耳伴号") - private Long erbanNo; - @ReplaceAppDomain - @ApiModelProperty(value = "铭牌底图icon") - private String icon; - @ApiModelProperty(value = "铭牌申请文案") - private String mpTx; - @ApiModelProperty(value = "审核状态 0待审核 1审核不通过 2审核通过 ") - private Byte auditType; - @ApiModelProperty(value = "审核不通过原因") - private String remark; - private Date createTime; - private Date updateTime; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansTeamJoinVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansTeamJoinVo.java deleted file mode 100644 index 188a625bb..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansTeamJoinVo.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.accompany.business.vo.anchor; - -import com.accompany.common.annotation.ReplaceAppDomain; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * 加入的粉丝团Vo - */ -@ApiModel("用户加入的粉丝团Vo") -@Data -public class AnchorFansTeamJoinVo { - - @ApiModelProperty(value = "粉丝团id") - private Long teamId; - @ApiModelProperty(value = "主播uid") - private Long teamUid; - @ApiModelProperty(value = "主播头像") - private String anchorAvatar; - @ApiModelProperty(value = "主播名称") - private String anchorNick; - @ApiModelProperty(value = "当前用户的对应等级铭牌图片") - @ReplaceAppDomain - private String icon; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansTeamMessageVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansTeamMessageVo.java deleted file mode 100644 index 08be5a479..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansTeamMessageVo.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.accompany.business.vo.anchor; - -import com.accompany.business.vo.GiftVo; -import lombok.Data; - -@Data -public class AnchorFansTeamMessageVo { - - private Long uid; - private String nickname; - private GiftVo giftVo; // 入团礼物实体 - private Long count; // 当前粉丝团数量 -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansTeamStatsDetailVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansTeamStatsDetailVo.java deleted file mode 100644 index 9fe4af352..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansTeamStatsDetailVo.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.accompany.business.vo.anchor; - -import lombok.Data; - -import java.util.Date; - -@Data -public class AnchorFansTeamStatsDetailVo { - - private Long uid; - private Long erbanNo; - private String nick; - private Integer levelSeq; - private Integer sendGiftTotal; - private Date createTime; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansTeamStatsVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansTeamStatsVo.java deleted file mode 100644 index 3ddd90432..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansTeamStatsVo.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.accompany.business.vo.anchor; - -import lombok.Data; - -@Data -public class AnchorFansTeamStatsVo { - - private Long uid; - private Long erbanNo; - private String nick; - private Boolean isOpen; - private Integer fansNum; - private Integer sendGiftTotal; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansWatchVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansWatchVo.java deleted file mode 100644 index edfd2fb33..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/AnchorFansWatchVo.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.accompany.business.vo.anchor; - -import lombok.Data; - -/** - * 粉丝观看主播直播 - */ -@Data -public class AnchorFansWatchVo { - - /** - * 起始时间点 - */ - private Long startTime; - /** - * 结束时间点 - */ - private Long endTime; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/ApplyFansTeamPopInfoVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/ApplyFansTeamPopInfoVo.java deleted file mode 100644 index edf05617b..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/ApplyFansTeamPopInfoVo.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.accompany.business.vo.anchor; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.ArrayList; -import java.util.List; - -@ApiModel("粉丝团弹窗Vo") -@Data -public class ApplyFansTeamPopInfoVo { - - @ApiModelProperty(value = "粉丝团id") - private Long teamId; - @ApiModelProperty(value = "主播uid") - private Long teamUid; - @ApiModelProperty(value = "主播头像") - private String anchorAvatar; - @ApiModelProperty(value = "主播名称") - private String anchorNick; - @ApiModelProperty(value = "粉丝团总人数") - private Long teamNum; - @ApiModelProperty(value = "榜单前三用户头像") - private List avatarList = new ArrayList<>(); - - @ApiModelProperty(value = "是否在退出粉丝团重新加入的24小时限制") - private Boolean isJoinLimit; - - @ApiModelProperty(value = "粉丝特权") - private List privilegeConfigVos = new ArrayList<>(); - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/InRoomFansTeamInitVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/InRoomFansTeamInitVo.java deleted file mode 100644 index c001393d1..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/InRoomFansTeamInitVo.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.accompany.business.vo.anchor; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -@Data -public class InRoomFansTeamInitVo { - - @ApiModelProperty(value = "是否为当前房间的主播:是-true,否-false") - private Boolean isCurrentRoomAnchor; - @ApiModelProperty(value = "当前房间是否开通粉丝团:是-true,否-false") - private Boolean hasFansTeamCurrentRoom; - @ApiModelProperty(value = "粉丝团入口是否红点提示:是-true,否-false") - private Boolean isRedPop; - @ApiModelProperty(value = "粉丝团成员总数") - private Long anchorFansNum; - @ApiModelProperty(value = "用户是否为当前房间的粉丝团成员:是-true,否-false") - private Boolean isAnchorFans; - @ApiModelProperty(value = "粉丝团成员等级") - private Integer fansLevelSeq; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/PrivilegeFansMpVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/PrivilegeFansMpVo.java deleted file mode 100644 index a6e8402ca..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/anchor/PrivilegeFansMpVo.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.accompany.business.vo.anchor; - -import com.accompany.common.annotation.ReplaceAppDomain; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -@ApiModel("粉丝团特权铭牌") -@Data -public class PrivilegeFansMpVo { - - @ApiModelProperty(value = "特权id") - private Integer privilegeId; - @ApiModelProperty(value = "铭牌图片") - @ReplaceAppDomain - private String icon; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/config/LimitFirstChargeConfig.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/config/LimitFirstChargeConfig.java deleted file mode 100644 index 1ae2c5253..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/config/LimitFirstChargeConfig.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.accompany.business.vo.config; - -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.ArrayList; -import java.util.List; - -@Data -@NoArgsConstructor -public class LimitFirstChargeConfig { - /** - * 限时首充活动开关 - */ - private Boolean open; - - /** - * 首充礼包说明 - */ - private String chargeProdDesc; - - /** - * 限时天数 - */ - private Integer limitTimeDays = 7; - - /** - * 奖励标题描述 - */ - private String chargeProdTitelStr = "充 $%s -得 %s 鑽石!-解鎖限定裝扮-"; - - private String successTitelMsg = "充值成功,您已獲得以下獎勵"; - - private List writeUidList = new ArrayList<>(); -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/config/NewUserConfig.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/config/NewUserConfig.java deleted file mode 100644 index 5766efa51..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/config/NewUserConfig.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.accompany.business.vo.config; - -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; - -/** - * @author guojicong - * @description - * @date 2022-07-26 - */ -@Data -@NoArgsConstructor -public class NewUserConfig { - private Date startTime; - - { - try { - startTime = new SimpleDateFormat("yyyy-MM-dd").parse("2022-07-26"); - } catch (ParseException e) { - throw new RuntimeException(e); - } - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/dealer/DealerAccount.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/dealer/DealerAccount.java deleted file mode 100644 index 8fe726be9..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/dealer/DealerAccount.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.accompany.business.vo.dealer; - -import lombok.Data; - -@Data -public class DealerAccount { - private Long coinBalance; - private Long saleAmount; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/dealer/DealerBusiStatus.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/dealer/DealerBusiStatus.java deleted file mode 100644 index dacb29205..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/dealer/DealerBusiStatus.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.accompany.business.vo.dealer; - -public enum DealerBusiStatus { - SUCCESS(200, "Success"), - IP_LIMIT(131, "IP addresses cannot be requested"), - SECRETKEY_ERROR(132, "account error"), - ACCOUNT_ERROR(133, "account error"), - DEALER_LIMIT(134, "Not a coin dealer"), - SELL_LIMIT(135, "Can't sell it to yourself"), - SELL_ERROR(136, "can not sell"), - SIGN_ERROR(137, "agent config error"), - USER_NOT_EXIST(138, "not this taala user"), - USER_NOT_REGION(139, "Not in the same district"), - AGENT_USER_NOT_EXIST(140, "agent user not exist"), - SEND_SELF_FAIL(141, "SEND_SELF_FAIL"), - PARAM_ERROR(400, "param error"), - - ; - private int code; - private String message; - - DealerBusiStatus(int code, String message) { - this.code = code; - this.message = message; - } - - public int getCode() { - return code; - } - - public String getMessage() { - return message; - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/dealer/DealerConfigVO.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/dealer/DealerConfigVO.java deleted file mode 100644 index 933dd4995..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/dealer/DealerConfigVO.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.accompany.business.vo.dealer; - -import lombok.Data; - -import java.util.List; - -@Data -public class DealerConfigVO { - private String secretKey; - private List ipWhitelist; - private Long agentUid; - private Integer daySendLimit = 100; - private Integer daySendGoldLimit = 700000; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/dealer/DealerResponse.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/dealer/DealerResponse.java deleted file mode 100644 index 7f0039bb2..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/dealer/DealerResponse.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.accompany.business.vo.dealer; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -@Data -public class DealerResponse { - @ApiModelProperty("响应状态码,成功200") - private Integer code; - - @ApiModelProperty("响应消息") - private String message; - - @ApiModelProperty("响应数据") - private T data; - - public DealerResponse(DealerBusiStatus dealerBusiStatus) { - this.code = dealerBusiStatus.getCode(); - this.message = dealerBusiStatus.getMessage(); - } - - public DealerResponse(Integer code, String message, T data) { - this.code = code; - this.message = message; - this.data = data; - } - - public DealerResponse(Integer code, String message) { - this.code = code; - this.message = message; - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/dealer/DealerResponsePage.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/dealer/DealerResponsePage.java deleted file mode 100644 index 377345aa7..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/dealer/DealerResponsePage.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.accompany.business.vo.dealer; - -import lombok.Data; - -import java.util.List; - -@Data -public class DealerResponsePage { - private Long total; - private Integer currentPage; - private Integer pageSize; - private Integer lastPage; - private List rows; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/dealer/DealerSaleRequestVO.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/dealer/DealerSaleRequestVO.java deleted file mode 100644 index d5c7d3191..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/dealer/DealerSaleRequestVO.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.accompany.business.vo.dealer; - -import lombok.Data; - -@Data -public class DealerSaleRequestVO { - private String secretKey; - private Long toUserId; - private Long coins; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/dealer/DealerUserInfo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/dealer/DealerUserInfo.java deleted file mode 100644 index 34dde4b2b..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/dealer/DealerUserInfo.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.accompany.business.vo.dealer; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@AllArgsConstructor -@NoArgsConstructor -@Builder -@Data -public class DealerUserInfo { - private Long uid; - private String nickName; - private Long userId; - private String gender; - private String avatar; - - private Long toUserId; - private String toNickName; - private Double coins; - private Long createAt; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/gift/CompoundGiftVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/gift/CompoundGiftVo.java deleted file mode 100644 index 47dbb8777..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/gift/CompoundGiftVo.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.accompany.business.vo.gift; - -import com.accompany.core.annotation.I18n; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author guojicong - * @Description - * @create 2022-06-22 - */ -@Data -@NoArgsConstructor -public class CompoundGiftVo { - @ApiModelProperty("合成奖励id") - private Integer compoundRewardId; - @ApiModelProperty("礼物id") - private Integer giftId; - @ApiModelProperty("礼物名称") - @I18n(className = "Gift") - private String giftName; - @ApiModelProperty("礼物排序序号") - private Integer orderNo; - @ApiModelProperty("礼物价值") - private Long goldPrice; - @ApiModelProperty("合成礼物消耗") - private Integer expendValue; - @ApiModelProperty("礼物图片url") - private String giftUrl; - - @ApiModelProperty("礼物合成概率") - private Integer compoundRate; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/giftCompound/GiftCompoundRecordVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/giftCompound/GiftCompoundRecordVo.java deleted file mode 100644 index 7bc59b8a7..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/giftCompound/GiftCompoundRecordVo.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.accompany.business.vo.giftCompound; - -import com.accompany.business.model.GiftCompoundRecord; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author guojicong - * @Description - * @create 2022-06-23 - */ -@Data -@NoArgsConstructor -public class GiftCompoundRecordVo extends GiftCompoundRecord { - @ApiModelProperty("礼物图片") - private String giftUrl; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/linearlypool/DrawPageResultVO.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/linearlypool/DrawPageResultVO.java deleted file mode 100644 index 280563c57..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/linearlypool/DrawPageResultVO.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.accompany.business.vo.linearlypool; - -import com.accompany.business.vo.openbox.DrawPrizeItemVo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Builder; -import lombok.Data; - -import java.util.List; - -@ApiModel -@Data -@Builder -public class DrawPageResultVO { - - /** - * 奖品列表 - */ - @ApiModelProperty("奖品列表") - private List prizeItemList; - - /** - * 剩余道具数 - */ - @ApiModelProperty("剩余道具数") - private Long remainKeyNum; - /** - * 剩余货币数 - */ - @ApiModelProperty("剩余货币数") - private Double goldNum; - - /** - * 是否抽中特殊货币礼物 - */ - @ApiModelProperty("是否抽中特殊货币礼物") - private Boolean specialStatus; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/linearlypool/DrawResultVO.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/linearlypool/DrawResultVO.java deleted file mode 100644 index d63fc6a00..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/linearlypool/DrawResultVO.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.accompany.business.vo.linearlypool; - -import com.accompany.business.vo.openbox.DrawPrizeItemVo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Builder; -import lombok.Data; - -import java.util.Date; -import java.util.List; - -@ApiModel -@Data -@Builder -public class DrawResultVO { - - /** - * 奖品列表 - */ - @ApiModelProperty("奖品列表") - private List prizeItemVoList; - - /** - * 剩余道具数 - */ - @ApiModelProperty("剩余道具数") - private Long remainKeyNum; - /** - * 抽奖时间 - */ - @ApiModelProperty("抽奖时间") - private Date drawTime; - - /** - * 是否抽中特殊货币礼物 - */ - @ApiModelProperty("是否抽中特殊货币礼物") - private Boolean specialStatus; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/linearlypool/LinearlyPoolRankParentVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/linearlypool/LinearlyPoolRankParentVo.java deleted file mode 100644 index 740440bec..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/linearlypool/LinearlyPoolRankParentVo.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.accompany.business.vo.linearlypool; - -import lombok.Data; - -import java.util.List; - -/** - * Created by PaperCut on 2018/12/3. - * 开箱子排行榜vo - */ -@Data -public class LinearlyPoolRankParentVo { - - private List rankVos; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/linearlypool/LinearlyPoolRankVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/linearlypool/LinearlyPoolRankVo.java deleted file mode 100644 index 4d0bab23b..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/linearlypool/LinearlyPoolRankVo.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.accompany.business.vo.linearlypool; - -import com.accompany.common.annotation.ReplaceAppDomain; -import lombok.Data; - -/** - * Created by PaperCut on 2018/12/3. - * 开箱子排行榜vo - */ -@Data -public class LinearlyPoolRankVo { - private Long uid; - private Long erbanNo; - private String nick; - @ReplaceAppDomain - private String avatar; - private Byte gender; - private Integer experSeq; - private String experUrl; - private Integer charmSeq; - private String charmUrl; - - private Long amount; - private Long ranking; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/linearlypool/PrizePushMsg.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/linearlypool/PrizePushMsg.java deleted file mode 100644 index 213f7819a..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/linearlypool/PrizePushMsg.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.accompany.business.vo.linearlypool; - -import lombok.Data; - -/** - * 中奖推送给客户端的消息 - */ -@Data -public class PrizePushMsg { - // 中奖用户uid - private Long uid; - // 中奖用户名称 - private String nick; - // 房主uid - private Long roomUid; - // 奖品id - private Integer prizeId; - // 奖品名称 - private String prizeName; - // 奖品数量 - private Integer prizeNum; - //类型描述 - private String boxTypeStr; - // 可以看到消息的用户等级 - private Integer userLevelLimit; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/linearlypool/UserKeyPageVO.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/linearlypool/UserKeyPageVO.java deleted file mode 100644 index 4842ff8c8..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/linearlypool/UserKeyPageVO.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.accompany.business.vo.linearlypool; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Builder; -import lombok.Data; - -@ApiModel -@Data -@Builder -public class UserKeyPageVO { - - /** - * 剩余道具数 - */ - @ApiModelProperty("剩余道具数") - private Long keyNum; - /** - * 剩余货币数 - */ - @ApiModelProperty("剩余货币数") - private Double goldNum; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/tarot/TarotChargeMessage.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/tarot/TarotChargeMessage.java deleted file mode 100644 index ece7a10ea..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/tarot/TarotChargeMessage.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.accompany.business.vo.tarot; - -import lombok.Data; - -/** - * @Author: yangming - * @Date: 2019/11/7 10:56 - * @Description: 塔罗充值中奖消息 - **/ -@Data -public class TarotChargeMessage { - /** 中奖用户uid **/ - private Long uid; - /** 中奖用户昵称 **/ - private String nick; - /** 中奖的房间uid **/ - private Long roomUid; - /** 中奖的产品ID **/ - private String chargeProdId; - /** 中奖的产品名称 **/ - private String chargeProdName; - /** 中奖的种子数量 **/ - private Long drawGoldNum; - /** 中奖的房间消息文本 **/ - private String drawMsgText; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/tarot/TarotHeadwearShowVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/tarot/TarotHeadwearShowVo.java deleted file mode 100644 index fc1069899..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/tarot/TarotHeadwearShowVo.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.accompany.business.vo.tarot; - -import com.accompany.business.model.Headwear; -import lombok.Data; - -/** - * @Author: yangming - * @Date: 2019/11/13 17:43 - * @Description: 返回给H5的实体(包含头饰图片) - **/ -@Data -public class TarotHeadwearShowVo extends TarotHeadwearVo { - - /** 头饰实体类 **/ - private Headwear headwear; - - /** 构造函数 **/ - public TarotHeadwearShowVo(TarotHeadwearVo tarotHeadwearVo){ - setChargeProdId(tarotHeadwearVo.getChargeProdId()); - setHeadwearId(tarotHeadwearVo.getHeadwearId()); - } - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/tarot/TarotHeadwearVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/tarot/TarotHeadwearVo.java deleted file mode 100644 index d511398ab..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/tarot/TarotHeadwearVo.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.accompany.business.vo.tarot; - -import com.alibaba.fastjson.annotation.JSONField; -import lombok.Data; - -/** - * @Author: yangming - * @Date: 2019/11/5 15:48 - * @Description: 幸运塔罗充值赠送头饰配置实体 - **/ -@Data -public class TarotHeadwearVo { - - @JSONField(name = "chargeProdId") - private String chargeProdId; - - @JSONField(name = "headwearId") - private Integer headwearId; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/SeizeTreasureConfig.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/SeizeTreasureConfig.java deleted file mode 100644 index 1b2e7a536..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/SeizeTreasureConfig.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.accompany.business.vo.treasure; - -import com.accompany.common.status.BusiStatus; -import com.accompany.core.exception.ServiceException; -import com.google.common.collect.Lists; -import com.google.gson.GsonBuilder; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class SeizeTreasureConfig { - @ApiModelProperty("开始时间") - private Date startTime; - @ApiModelProperty("结束时间") - private Date endTime; - @ApiModelProperty("白名单uid列表") - private List whiteUidList = new ArrayList<>(); - @ApiModelProperty("推送消息奖励列表") - private List msgRewardIdList = new ArrayList<>(); - @ApiModelProperty("辛运值奖池基数,需大于200") - private Integer treasureDrawBaseNum = 500; - @ApiModelProperty("夺宝奖池最小维持个数") - private Integer minTreasurePoolSize = 30000; - @ApiModelProperty("森林奖池最小维持个数") - private Integer minForestPoolSize = 300; - @ApiModelProperty("森林奖池最小维持个数") - private Integer minElfCompoundPoolSize = 300; - @ApiModelProperty("财富等级限制") - private Integer userLevelLimit = 3; - @ApiModelProperty("小时统计消息") - private Boolean hourCountMsg = true; - @ApiModelProperty("小时频率") - private Integer hourLimit = 1; - @ApiModelProperty("定时初始化奖池") - private Boolean autoInitPool = true; - /** - * 活动是否开启 - * - * @param uid - * @return - */ - public Boolean isOpen(Long uid) { - Date now = new Date(); - if (now.before(startTime) || now.after(endTime)) { - return whiteUidList.contains(uid); - } - return true; - } - - public void checkOpen(Long uid) { - Boolean isOpen = this.isOpen(uid); - if (!isOpen) { - throw new ServiceException(BusiStatus.SEIZE_TREASURE_NOT_OPEN); - } - } - - public static void main(String[] args) { - SeizeTreasureConfig config = new SeizeTreasureConfig(); - config.setStartTime(new Date(1675180800000L)); - config.setEndTime(new Date(1676699200000L)); - config.setWhiteUidList(Lists.newArrayList(1006041L)); - System.out.println(new GsonBuilder() - .setDateFormat("yyyy-MM-dd HH:mm:ss") - .create().toJson(config)); - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/SeizeTreasurePoolItemVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/SeizeTreasurePoolItemVo.java deleted file mode 100644 index 481245a19..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/SeizeTreasurePoolItemVo.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.accompany.business.vo.treasure; - -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class SeizeTreasurePoolItemVo { - @ApiModelProperty("奖励下标") - private Integer itemIndex; - @ApiModelProperty("奖池序号") - private Integer itemOrder; - @ApiModelProperty("奖励id") - private Long rewardId; - @ApiModelProperty("奖励类型 activityProps:活动道具;gift:礼物;namePlate:铭牌;car:座驾;headwear:头饰;chatBubble:气泡;infoCard:资料卡;") - private String rewardType; - @ApiModelProperty("奖励名称") - private String rewardName; - @ApiModelProperty("奖励图片") - private String rewardPicUrl; - @ApiModelProperty("奖励数量") - private Integer rewardNum; - @ApiModelProperty("奖励单位") - private String rewardUnit; - @ApiModelProperty("展示价值") - private Integer rewardShowValue; - @ApiModelProperty("展示概率") - private Integer showRatio; - @ApiModelProperty("奖励序号") - private Integer rewardOrder; - @ApiModelProperty("有效期") - private Integer effectDay; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/SeizeTreasureSalvageConfig.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/SeizeTreasureSalvageConfig.java deleted file mode 100644 index 5148e2ae4..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/SeizeTreasureSalvageConfig.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.accompany.business.vo.treasure; - -import lombok.Data; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author: liaozetao - * @date: 2023/9/5 17:02 - * @description: - */ -@Data -public class SeizeTreasureSalvageConfig { - - /** - * 分解率 - */ - private List salvageRates = new ArrayList<>(); - - @Data - public static class ElfConfig { - - /** - * 精灵等级 - */ - private Integer level; - - /** - * 最小值 - */ - private Integer min; - - /** - * 最大值 - */ - private Integer max; - } - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/SeizeTreasureStatus.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/SeizeTreasureStatus.java deleted file mode 100644 index 432768218..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/SeizeTreasureStatus.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.accompany.business.vo.treasure; - -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class SeizeTreasureStatus { - - /** - * 活动是否开启 - */ - @ApiModelProperty("活动是否开启") - private Boolean open = false; - - /** - * 最低限制等级 - */ - @ApiModelProperty("最低限制等级") - private Integer levelLimit = 3; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/SeizeTreasureSwitchConfig.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/SeizeTreasureSwitchConfig.java deleted file mode 100644 index 179abcbac..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/SeizeTreasureSwitchConfig.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.accompany.business.vo.treasure; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @author: liaozetao - * @date: 2023/9/7 18:10 - * @description: - */ -@Data -public class SeizeTreasureSwitchConfig { - - /** - * 是否开启 - */ - @ApiModelProperty("是否开启") - private Boolean open; - - /** - * 价格 - */ - @ApiModelProperty("价格") - private Double price; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/compound/SeizeTreasureElfCompoundRecordVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/compound/SeizeTreasureElfCompoundRecordVo.java deleted file mode 100644 index 4219bc089..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/compound/SeizeTreasureElfCompoundRecordVo.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.accompany.business.vo.treasure.compound; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -import java.util.Date; -import java.util.List; - -@Data -@Accessors(chain = true) -@NoArgsConstructor -@AllArgsConstructor -public class SeizeTreasureElfCompoundRecordVo { - - private Long recordId; - - private Integer compoundLevel; - - private String elfLevel; - - private String elfName; - - private List expendList; - - private Date createTime; - - private Integer type; - - @Data - @Accessors(chain = true) - @NoArgsConstructor - @AllArgsConstructor - public static class ElfCompoundExpendVo { - private Long bizId; - private Long elfId; - private Integer elfLevel; - private String elfName; - private Integer elfNum; - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/compound/SeizeTreasureElfCompoundReq.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/compound/SeizeTreasureElfCompoundReq.java deleted file mode 100644 index babd6a686..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/compound/SeizeTreasureElfCompoundReq.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.accompany.business.vo.treasure.compound; - -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -import java.util.ArrayList; -import java.util.List; - -@Data -@Accessors(chain = true) -@NoArgsConstructor -@AllArgsConstructor -public class SeizeTreasureElfCompoundReq { - - /** - * 试炼类型 1:史诗;2:传说; - */ - @ApiModelProperty("试炼类型 1:史诗;2:传说;") - private Integer level; - - /** - * 试炼消耗 - */ - @ApiModelProperty("试炼消耗") - private List expendList = new ArrayList<>(); - - @Data - @Accessors(chain = true) - @NoArgsConstructor - @AllArgsConstructor - public static class ElfCompoundExpend { - - /** - * 消耗精灵id - */ - @ApiModelProperty("消耗精灵id") - private Long elfId; - - /** - * 消耗精灵数量 - */ - @ApiModelProperty("消耗精灵数量") - private Integer elfNum; - - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/convert/SeizeTreasureConvertRecordVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/convert/SeizeTreasureConvertRecordVo.java deleted file mode 100644 index efde4d313..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/convert/SeizeTreasureConvertRecordVo.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.accompany.business.vo.treasure.convert; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -import java.util.Date; - -@Data -@Accessors(chain = true) -@NoArgsConstructor -@AllArgsConstructor -public class SeizeTreasureConvertRecordVo { - private Long recordId; - private Integer convertType; - private Integer convertLevel; - private String rewardType; - private String rewardName; - private String rewardNum; - private String rewardUnit; - private String rewardPicUrl; - private String rewardShowValue; - private Date createTime; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/convert/SeizeTreasureCovertItemVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/convert/SeizeTreasureCovertItemVo.java deleted file mode 100644 index b592caa98..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/convert/SeizeTreasureCovertItemVo.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.accompany.business.vo.treasure.convert; - -import cn.hutool.core.util.StrUtil; -import com.alibaba.fastjson.JSONArray; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -import java.util.Collections; -import java.util.List; - -@Data -@Accessors(chain = true) -@NoArgsConstructor -@AllArgsConstructor -public class SeizeTreasureCovertItemVo { - - @ApiModelProperty("兑换项id") - private Long itemId; - - @ApiModelProperty("兑换类型") - private Integer type; - - @ApiModelProperty("兑换等级") - private Integer level; - - @ApiModelProperty("消耗数量") - private Integer expendNum; - - @ApiModelProperty("奖励id") - private Long rewardId; - - @ApiModelProperty("奖励类型 activityProps:活动道具;gift:礼物;namePlate:铭牌;car:座驾;headwear:头饰;chatBubble:气泡;infoCard:资料卡;") - private String rewardType; - - @ApiModelProperty("奖励名称") - private String rewardName; - - @ApiModelProperty("奖励图片url") - private String rewardPicUrl; - - @ApiModelProperty("奖励数量") - private Integer rewardNum; - - @ApiModelProperty("奖励单位") - private String rewardUnit; - - @ApiModelProperty("奖励价值") - private String rewardShowValue; - - /** - * 精灵ID - */ - @ApiModelProperty("精灵ID") - private String propIds; - - /** - * 精灵数量 - */ - @ApiModelProperty("精灵数量") - private String propNums; - - /** - * 有效期 - */ - @ApiModelProperty("有效期") - private Integer effectDay; - - /** - * 兑换物品 - */ - @ApiModelProperty("兑换物品") - private List propItems; - - public List getPropIds() { - if (StrUtil.isEmpty(propIds)) { - return Collections.emptyList(); - } - return JSONArray.parseArray(propIds, Long.class); - } - - public List getPropNums() { - if (StrUtil.isEmpty(propNums)) { - return Collections.emptyList(); - } - return JSONArray.parseArray(propNums, Integer.class); - } - - @Data - public static class PropItem { - - /** - * 兑换ID - */ - @ApiModelProperty("兑换ID") - private Long propId; - - /** - * 兑换名称 - */ - @ApiModelProperty("兑换名称") - private String propName; - - /** - * 兑换数量 - */ - @ApiModelProperty("兑换数量") - private Integer propNum; - - /** - * 图片 - */ - @ApiModelProperty("图片") - private String picUrl; - - - } - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/elf/SeizeTreasureElfMsgVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/elf/SeizeTreasureElfMsgVo.java deleted file mode 100644 index aa63f3e64..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/elf/SeizeTreasureElfMsgVo.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.accompany.business.vo.treasure.elf; - -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class SeizeTreasureElfMsgVo { - @ApiModelProperty("uid") - private Long uid; - @ApiModelProperty("用户昵称") - private String nick; - @ApiModelProperty("目标uid") - private Long targetUid; - @ApiModelProperty("目标用户昵称") - private String targetNick; - @ApiModelProperty("精灵id") - private Long elfId; - @ApiModelProperty("精灵名称") - private String elfName; - @ApiModelProperty("精灵图片链接") - private String elfPicUrl; - @ApiModelProperty("消息内容") - private String msgContent; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/elf/SeizeTreasureElfRecordVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/elf/SeizeTreasureElfRecordVo.java deleted file mode 100644 index 42b847cff..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/elf/SeizeTreasureElfRecordVo.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.accompany.business.vo.treasure.elf; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -@Data -@NoArgsConstructor -public class SeizeTreasureElfRecordVo { - @ApiModelProperty("记录id") - private Long recordId; - @ApiModelProperty("记录类型 2:赠予 3:获赠") - private Integer type; - @ApiModelProperty("精灵id") - private Long elfId; - @ApiModelProperty("精灵名称") - private String elfName; - @ApiModelProperty("精灵图片链接") - private String elfPicUrl; - @ApiModelProperty("目标用户uid") - private Long targetUid; - @ApiModelProperty("目标用户昵称") - private String targetNick; - @ApiModelProperty("目标用户头像图片链接") - private String targetAvatar; - private Date createTime; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/elf/SeizeTreasureElfVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/elf/SeizeTreasureElfVo.java deleted file mode 100644 index 7a5cd39ea..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/elf/SeizeTreasureElfVo.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.accompany.business.vo.treasure.elf; - -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -@Data -@Accessors(chain = true) -@NoArgsConstructor -@AllArgsConstructor -public class SeizeTreasureElfVo { - @ApiModelProperty("精灵id") - private Long elfId; - @ApiModelProperty("精灵等级") - private Integer elfLevel; - @ApiModelProperty("精灵名称") - private String elfName; - @ApiModelProperty("精灵图片") - private String elfPicUrl; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/elf/SeizeTreasureUserElfVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/elf/SeizeTreasureUserElfVo.java deleted file mode 100644 index e45e97edf..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/elf/SeizeTreasureUserElfVo.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.accompany.business.vo.treasure.elf; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -@Data -@Accessors(chain = true) -@NoArgsConstructor -public class SeizeTreasureUserElfVo extends SeizeTreasureElfVo { - @ApiModelProperty("精灵数量") - private Integer elfNum = 0; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/msg/SeizeTreasureMsg.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/msg/SeizeTreasureMsg.java deleted file mode 100644 index 3c35ebe9c..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/msg/SeizeTreasureMsg.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.accompany.business.vo.treasure.msg; - -import com.accompany.business.vo.treasure.reward.SeizeTreasureRewardBaseVo; -import com.accompany.core.model.Users; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -public class SeizeTreasureMsg { - @ApiModelProperty("uid") - private Long uid; - @ApiModelProperty("昵称") - private String nick; - @ApiModelProperty("所在房间uid") - private Long roomUid; - @ApiModelProperty("奖励类型") - private String rewardType; - @ApiModelProperty("奖励名称") - private String rewardName; - @ApiModelProperty("奖励等级") - private Integer rewardLevel; - @ApiModelProperty("奖励数量") - private Integer rewardNum; - @ApiModelProperty("奖励单位") - private String rewardUnit; - @ApiModelProperty("展示价值") - private Integer rewardShowValue; - @ApiModelProperty("限制等级") - private Integer userLevelLimit; - - - public SeizeTreasureMsg(Users users, Long roomUid, SeizeTreasureRewardBaseVo rewardVo, Integer userLevelLimit) { - this.uid = users.getUid(); - this.nick = users.getNick(); - this.roomUid = roomUid; - this.rewardType = rewardVo.getRewardType(); - this.rewardName = rewardVo.getRewardName(); - this.rewardLevel = rewardVo.getRewardLevel(); - this.rewardNum = rewardVo.getRewardNum(); - this.rewardUnit = rewardVo.getRewardUnit(); - this.rewardShowValue = rewardVo.getRewardShowValue(); - this.userLevelLimit = userLevelLimit; - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/rank/SeizeTreasureRankVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/rank/SeizeTreasureRankVo.java deleted file mode 100644 index 77ed1fbda..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/rank/SeizeTreasureRankVo.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.accompany.business.vo.treasure.rank; - -import com.accompany.common.annotation.ReplaceAppDomain; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.ArrayList; -import java.util.List; - -@Data -@NoArgsConstructor -public class SeizeTreasureRankVo { - private SeizeTreasureRankEntityVo currentRank; - - private List rankList = new ArrayList<>(); - - @Data - @NoArgsConstructor - @AllArgsConstructor - public static class SeizeTreasureRankEntityVo { - @ApiModelProperty("排名") - private Integer order; - @ApiModelProperty("erbanNo") - private Long erbanNo; - @ApiModelProperty("uid") - private Long uid; - @ApiModelProperty("用户昵称") - private String nick; - @ReplaceAppDomain - @ApiModelProperty("用户头像") - private String avatar; - @ApiModelProperty("用户分值") - private Double score; - - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/record/SeizeTreasurePoolDrawRecordVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/record/SeizeTreasurePoolDrawRecordVo.java deleted file mode 100644 index df03d0b05..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/record/SeizeTreasurePoolDrawRecordVo.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.accompany.business.vo.treasure.record; - -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.Date; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class SeizeTreasurePoolDrawRecordVo { - @ApiModelProperty("奖池等级 1:初级 2:中级 3:高级") - private Integer poolLevel; - @ApiModelProperty("奖励id") - private Long rewardId; - @ApiModelProperty("奖励类型 activityProps:活动道具;gift:礼物;namePlate:铭牌;car:座驾;headwear:头饰;chatBubble:气泡;infoCard:资料卡;") - private String rewardType; - @ApiModelProperty("奖励名称") - private String rewardName; - @ApiModelProperty("奖励图片") - private String rewardPicUrl; - @ApiModelProperty("奖励数量") - private Integer rewardNum; - @ApiModelProperty("奖励单位") - private String rewardUnit; - @ApiModelProperty("展示价值") - private Integer rewardShowValue; - @ApiModelProperty("展示概率") - private Integer showRatio; - @ApiModelProperty("奖励序号") - private Integer rewardOrder; - @ApiModelProperty("奖励序号") - private Date drawTime; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/record/SeizeTreasureStaticVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/record/SeizeTreasureStaticVo.java deleted file mode 100644 index 12238402d..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/record/SeizeTreasureStaticVo.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.accompany.business.vo.treasure.record; - -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class SeizeTreasureStaticVo { - @ApiModelProperty("参与用户数量") - private Integer drawPeopleNum = 0; - @ApiModelProperty("抽奖次数") - private Integer drawCountNum = 0; - @ApiModelProperty("投入总价值") - private Long drawInputValue = 0L; - @ApiModelProperty("产出总价值") - private Long drawOutputValue = 0L; - @ApiModelProperty("产出展示总价值") - private Long drawOutputShowValue = 0L; - @ApiModelProperty("产出礼物总价值") - private Long drawOutputGiftValue = 0L; - @ApiModelProperty("产出活动道具总价值") - private Long drawOutputPropValue = 0L; - @ApiModelProperty("产出精灵球总价值") - private Long drawOutputBallValue = 0L; - @ApiModelProperty("试炼/兑换产出总价值") - private Long convertOutputValue = 0L; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/reward/SeizeTreasurePoolRewardCache.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/reward/SeizeTreasurePoolRewardCache.java deleted file mode 100644 index 2ae000251..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/reward/SeizeTreasurePoolRewardCache.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.accompany.business.vo.treasure.reward; - -import com.accompany.business.model.treasure.SeizeTreasurePoolItem; -import com.accompany.business.model.treasure.SeizeTreasureReward; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -@Data -@Accessors(chain = true) -@NoArgsConstructor -public class SeizeTreasurePoolRewardCache { - @ApiModelProperty("奖池id") - private Long poolId; - @ApiModelProperty("奖励下班") - private Integer itemIndex; - @ApiModelProperty("奖池类型") - private Integer poolType; - @ApiModelProperty("奖池组") - private Integer poolGroup; - @ApiModelProperty("奖池等级") - private Integer poolLevel; - @ApiModelProperty("奖励") - private SeizeTreasureReward reward; - - public SeizeTreasurePoolRewardCache(Long poolId, SeizeTreasurePoolItem poolItem, SeizeTreasureReward reward) { - this.poolId = poolId; - this.itemIndex = poolItem.getItemIndex(); - this.poolType = poolItem.getPoolType(); - this.poolGroup = poolItem.getPoolGroup(); - this.poolLevel = poolItem.getPoolLevel(); - this.reward = reward; - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/reward/SeizeTreasurePoolRewardVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/reward/SeizeTreasurePoolRewardVo.java deleted file mode 100644 index 5220db9bb..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/reward/SeizeTreasurePoolRewardVo.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.accompany.business.vo.treasure.reward; - -import com.accompany.business.model.treasure.SeizeTreasureReward; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -@Data -@Accessors(chain = true) -@NoArgsConstructor -public class SeizeTreasurePoolRewardVo extends SeizeTreasureRewardBaseVo { - @ApiModelProperty("奖励下标") - private Integer itemIndex; - - public SeizeTreasurePoolRewardVo(Integer itemIndex, SeizeTreasureReward reward) { - super(reward); - // 如果数量 > 1,将展示价格修改为奖励单价 - if (getRewardNum() > 1) { - setRewardShowValue(getRewardShowValue() / getRewardNum()); - } - this.itemIndex = itemIndex; - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/reward/SeizeTreasureRewardBaseVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/reward/SeizeTreasureRewardBaseVo.java deleted file mode 100644 index 0e94cd965..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/reward/SeizeTreasureRewardBaseVo.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.accompany.business.vo.treasure.reward; - -import com.accompany.business.model.treasure.SeizeTreasureReward; -import com.accompany.common.constant.SeizeTreasureConstant; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -@Data -@Accessors(chain = true) -@NoArgsConstructor -public class SeizeTreasureRewardBaseVo { - @ApiModelProperty("奖励id") - private Long rewardId; - @ApiModelProperty("奖励关联id") - private Long rewardRefId; - @ApiModelProperty("奖励类型 activityProps:活动道具;gift:礼物;namePlate:铭牌;car:座驾;headwear:头饰;chatBubble:气泡;infoCard:资料卡;") - private String rewardType; - @ApiModelProperty("活动道具类型 1:碎片") - private Integer propType; - @ApiModelProperty("奖励名称") - private String rewardName; - @ApiModelProperty("奖励等级") - private Integer rewardLevel = 0; - @ApiModelProperty("奖励展示价值") - private Integer rewardShowValue = 0; - @ApiModelProperty("奖励数量") - private Integer rewardNum = 1; - @ApiModelProperty("奖励单位") - private String rewardUnit = "个"; - @ApiModelProperty("奖励图片uil") - private String rewardPicUrl; - @ApiModelProperty("奖励序号") - private Integer rewardOrder; - @ApiModelProperty("有效天数") - private Integer effectDay; - - public SeizeTreasureRewardBaseVo(SeizeTreasureReward reward) { - this.rewardId = reward.getId(); - this.rewardRefId = reward.getRewardRefId(); - // 判断是否碎片 - if (SeizeTreasureConstant.ActPropsId.CHIP.equals(rewardRefId)) { - this.propType = 1; - } - this.rewardType = reward.getRewardType(); - this.rewardName = reward.getRewardName(); - this.rewardLevel = reward.getRewardLevel(); - this.rewardShowValue = reward.getRewardShowValue(); - this.rewardNum = reward.getRewardNum(); - this.rewardUnit = reward.getRewardUnit(); - this.rewardPicUrl = reward.getRewardPicUrl(); - this.rewardOrder = reward.getRewardOrder(); - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/salvage/SeizeTreasureElfSalvageRecordVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/salvage/SeizeTreasureElfSalvageRecordVo.java deleted file mode 100644 index fdc9f237c..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/salvage/SeizeTreasureElfSalvageRecordVo.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.accompany.business.vo.treasure.salvage; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @author: liaozetao - * @date: 2023/9/5 16:25 - * @description: - */ -@Data -@ApiModel -public class SeizeTreasureElfSalvageRecordVo { - - /** - * 精灵等级 - */ - @ApiModelProperty("精灵等级") - private Integer elfLevel; - - /** - * 精灵碎片 - */ - @ApiModelProperty("精灵碎片") - private Integer pieceNum; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/salvage/SeizeTreasureElfSalvageReq.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/salvage/SeizeTreasureElfSalvageReq.java deleted file mode 100644 index 62747fd16..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/salvage/SeizeTreasureElfSalvageReq.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.accompany.business.vo.treasure.salvage; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author: liaozetao - * @date: 2023/9/5 16:14 - * @description: - */ -@Data -@ApiModel -public class SeizeTreasureElfSalvageReq { - - /** - * 分解消耗 - */ - @ApiModelProperty("分解消耗") - private List expendList = new ArrayList<>(); - - @Data - @ApiModel - public static class ElfSalvageExpend { - - /** - * 消耗精灵id - */ - @ApiModelProperty("消耗精灵id") - private Long elfId; - - /** - * 消耗精灵数量 - */ - @ApiModelProperty("消耗精灵数量") - private Integer elfNum; - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/userinfo/SeizeTreasureUserBaseInfo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/userinfo/SeizeTreasureUserBaseInfo.java deleted file mode 100644 index 946ac9b18..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/userinfo/SeizeTreasureUserBaseInfo.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.accompany.business.vo.treasure.userinfo; - -import com.accompany.core.model.Users; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class SeizeTreasureUserBaseInfo { - @ApiModelProperty("erbanNo") - private Long erbanNo; - @ApiModelProperty("uid") - private Long uid; - @ApiModelProperty("头像") - private String avatar; - @ApiModelProperty("昵称") - private String nick; - - public void completeBaseInfo(Users user) { - this.erbanNo = user.getErbanNo(); - this.uid = user.getUid(); - this.avatar = user.getAvatar(); - this.nick = user.getNick(); - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/userinfo/SeizeTreasureUserDrawInfo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/userinfo/SeizeTreasureUserDrawInfo.java deleted file mode 100644 index 9265ee38f..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/userinfo/SeizeTreasureUserDrawInfo.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.accompany.business.vo.treasure.userinfo; - -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class SeizeTreasureUserDrawInfo extends SeizeTreasureUserBaseInfo { - - /** - * 夺宝券 - */ - @ApiModelProperty("夺宝券") - private Long drawTicketNum = 0L; - - /** - * 当前幸运值 - */ - @ApiModelProperty("当前幸运值") - private Integer luckyNum = 0; - - /** - * 获得精灵球距离 - */ - @ApiModelProperty("获得精灵球距离") - private Integer nextBallNum = 0; - - /** - * 需要幸运值 - */ - @ApiModelProperty("需要幸运值") - private Integer needLuckyNum = 0; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/userinfo/SeizeTreasureUserElfInfo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/userinfo/SeizeTreasureUserElfInfo.java deleted file mode 100644 index 922f1bf09..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/userinfo/SeizeTreasureUserElfInfo.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.accompany.business.vo.treasure.userinfo; - -import com.accompany.business.vo.treasure.elf.SeizeTreasureUserElfVo; -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.ArrayList; -import java.util.List; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class SeizeTreasureUserElfInfo extends SeizeTreasureUserBaseInfo { - @ApiModelProperty("精灵碎片") - private Integer chipNum = 0; - @ApiModelProperty("初级精灵") - private List lowElves = new ArrayList<>(); - @ApiModelProperty("中级精") - private List middleElves = new ArrayList<>(); - @ApiModelProperty("高级精灵") - private List highElves = new ArrayList<>(); - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/userinfo/SeizeTreasureUserForestInfo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/userinfo/SeizeTreasureUserForestInfo.java deleted file mode 100644 index a71ea0167..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/userinfo/SeizeTreasureUserForestInfo.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.accompany.business.vo.treasure.userinfo; - -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class SeizeTreasureUserForestInfo extends SeizeTreasureUserBaseInfo { - @ApiModelProperty("初级精灵球数量") - private Integer lowBallNum = 0; - @ApiModelProperty("中级精灵球数量") - private Integer middleBallNum = 0; - @ApiModelProperty("高级精灵球数量") - private Integer highBallNum = 0; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/userinfo/SeizeTreasureUserInfo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/userinfo/SeizeTreasureUserInfo.java deleted file mode 100644 index ba9b48bd9..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/treasure/userinfo/SeizeTreasureUserInfo.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.accompany.business.vo.treasure.userinfo; - -import io.swagger.annotations.ApiModelProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class SeizeTreasureUserInfo extends SeizeTreasureUserBaseInfo { - @ApiModelProperty("钻石余额") - private Double diamonds = 0d; - @ApiModelProperty("夺宝券") - private Long drawTicketNum = 0L; -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/AnchorFansSendGiftListener.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/AnchorFansSendGiftListener.java deleted file mode 100644 index 48980e585..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/AnchorFansSendGiftListener.java +++ /dev/null @@ -1,330 +0,0 @@ -package com.accompany.business.event.listener; - -import cn.hutool.core.util.StrUtil; -import com.accompany.business.constant.nameplate.NameplateStyleTypeEnum; -import com.accompany.business.event.AnchorFansSendGiftEvent; -import com.accompany.business.model.anchor.*; -import com.accompany.business.service.anchor.*; -import com.accompany.business.service.nameplate.UserNameplateService; -import com.accompany.common.constant.Constant; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.DateTimeUtil; -import com.accompany.common.utils.StringUtils; -import com.accompany.common.utils.WeekUtil; -import com.accompany.core.enumeration.FansBillObjTypeEnum; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.service.common.JedisService; -import com.accompany.core.vo.user.UserNameplateVo; -import com.accompany.sharding.model.GiftSendRecord; -import com.google.gson.Gson; -import lombok.SneakyThrows; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationListener; -import org.springframework.context.annotation.Lazy; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Component; -import org.springframework.util.StopWatch; - -import java.util.Date; -import java.util.List; -import java.util.Objects; - -/** - * 加入粉丝团的粉丝 给主播送礼增加亲密度 监听 - */ -@Component -public class AnchorFansSendGiftListener implements ApplicationListener { - - private static final Logger logger = LoggerFactory.getLogger(AnchorFansSendGiftListener.class); - - @Autowired - private AnchorFansTeamService anchorFansTeamService; - @Autowired - private AnchorFansPrivilegeConfigService anchorFansPrivilegeConfigService; - @Autowired - private JedisService jedisService; - @Autowired - private AnchorFansTeamMemberService anchorFansTeamMemberService; - @Autowired - private AnchorFansTaskService anchorFansTaskService; - @Autowired - private AnchorFansLevelExperienceService anchorFansLevelExperienceService; - @Autowired - private AnchorFansExperRecordService anchorFansExperRecordService; - - private Gson gson = new Gson(); - - @Autowired - @Lazy - private UserNameplateService userNameplateService; - - @SneakyThrows - @Override - @Async - public void onApplicationEvent(AnchorFansSendGiftEvent event) { - GiftSendRecord giftSendRecord = (GiftSendRecord) event.getSource(); - Date date = giftSendRecord.getCreateTime(); - Integer giftId = giftSendRecord.getGiftId(); - Long recvUid = giftSendRecord.getReciveUid(); - Long sendUid = giftSendRecord.getUid(); - Integer giftNum = giftSendRecord.getGiftNum(); - Long goldNum = giftSendRecord.getTotalGoldNum(); - Long roomUid = giftSendRecord.getRoomUid(); - - AnchorFansTeam team = anchorFansTeamService.getAnchorFansTeamByUid(recvUid); - if (team == null) { - logger.debug("当前收礼用户不存在粉丝团....sendUid {}, recvUid {}",sendUid,recvUid); - return ; - } - - StopWatch stopWatch = new StopWatch(); - stopWatch.start(); - - logger.debug("进入到粉丝团送礼监听器了....sendUid:{} recvUid: {}",sendUid,recvUid); - Long teamId = team.getId(); - - // 入团礼物校验 - List privilegeConfigList = anchorFansPrivilegeConfigService.getPrivilegeConfigListByType(Constant.AnchorFansTeamPrivilegeType.join_gift); - for (AnchorFansPrivilegeConfig config : privilegeConfigList) { - logger.debug("用户赠送入团礼物,粉丝团入团礼物配置....config {}" ,gson.toJson(config)); - if ( giftId == config.getNormalId().intValue() && !recvUid.equals(sendUid) ) { - logger.info("用户赠送入团礼物, 开始进行入团操作.... sendUid {} recvUid {}" ,sendUid, recvUid); - // 插入粉丝团成员数据 赠送入团礼物 - anchorFansTeamService.joinFansTeamByMemberUid(teamId,sendUid,giftId,date); - - logger.info("用户赠送入团礼物, 入团操作结束.... sendUid {} recvUid {}" ,sendUid, recvUid); - // 入团礼物不增加亲密值 - return; - } - } - - - - // 是否为当前粉丝团成员 - AnchorFansTeamMember member = anchorFansTeamMemberService.getTeamFansByMemberUid(recvUid, sendUid); - if (member == null) { - return; - } - // 本次送礼增加的亲密值 - Long exper = 0L; - // 是否是专属礼物 - Boolean isDesignGift = false; - // 对应的任务 - AnchorFansTask task = new AnchorFansTask(); - // 账单枚举 - FansBillObjTypeEnum fansBillObjTypeEnum = null; - String key = RedisKey.anchor_fans_team_exper_lock.getKey(team.getUid() + StrUtil.UNDERLINE + sendUid); - String lockVal = jedisService.lock(key,10 * 1000); - if (StringUtils.isBlank(lockVal)) { - //拿不到锁暂不考虑 - logger.info("获取成员锁失败...,粉丝团teamId:{}, 主播uid: {}, 粉丝uid: {}", teamId, recvUid, sendUid); - return; - } - try{ - - // 赠送专属礼物增加亲密值 - List exclusiveGiftConfig = anchorFansPrivilegeConfigService.getPrivilegeConfigListByType(Constant.AnchorFansTeamPrivilegeType.exclusive_gift); - for (AnchorFansPrivilegeConfig config : exclusiveGiftConfig) { - if (config.getNormalId().intValue() == giftId) { - isDesignGift = true; - task = anchorFansTaskService.getAnchorFansTaskByCode(Constant.AnchorFansTaskCode.sendDesignatedGift); - if (task == null) { - return; - } - // 计算本次增加的亲密度值 - exper = cacluDesignExperCurrentDay(giftNum, sendUid, recvUid, task,date); - fansBillObjTypeEnum = FansBillObjTypeEnum.SEND_DESIGN_GIFT; - } - } - - if (!isDesignGift) { - - // 是否粉丝和主播都在房间 不在则不计入流水统计 - if (!recvUid.equals(roomUid)) { - logger.info("粉丝送礼的主播不在对应房间,不增加亲密值... sendUid:{}, teamUid:{}",sendUid,recvUid); - return; - } - - task = anchorFansTaskService.getAnchorFansTaskByCode(Constant.AnchorFansTaskCode.sendGift); - if (task == null) { - return; - } - exper = cacluRemainCurrentDay(goldNum, sendUid, recvUid, task,date); - fansBillObjTypeEnum = FansBillObjTypeEnum.SEND_NORMAL_GIFT; - } - - if (exper <= 0) { - logger.info("当前任务已完成,亲密值增加为0, 任务code:{},粉丝uid:{}, 主播uid:{}",task.getTaskCode(),sendUid,recvUid); - return; - } - - // 更新粉丝经验值 - Long currentExper = member.getExper(); - Long nowExper = currentExper + exper; - Integer levelOld = member.getLevelSeq(); - Integer levelNew = anchorFansLevelExperienceService.cacluAnchorFansLevelExperienceByExper(nowExper); - - member.setExper(nowExper); - member.setUpdateTime(date); - if (!Objects.equals(levelOld, levelNew)) { - member.setLevelSeq(levelNew); - // 更新用户铭牌 - anchorFansTeamService.detectionMp(recvUid, sendUid, levelNew); - } - anchorFansTeamMemberService.updateById(member); - // 更新缓存数据 - String memberInfoKey = RedisKey.anchor_fans_team_member_info.getKey(recvUid.toString()); - jedisService.hset(memberInfoKey,sendUid.toString(),gson.toJson(member)); - - // 增加亲密值账单记录 - AnchorFansExperRecord record = new AnchorFansExperRecord(); - record.setCreateTime(date); - record.setExperAmount(exper); - record.setObjId(giftSendRecord.getSendRecordId().toString()); - record.setUid(sendUid); - record.setTargetUid(recvUid); - record.setBillType(fansBillObjTypeEnum.getValue()); - anchorFansExperRecordService.save(record); - - // 亲密度榜单数据增加 - String rankKey = RedisKey.anchor_fans_team_rank.getKey(recvUid.toString()); - jedisService.zincrby(rankKey, exper.doubleValue(), member.getMemberUid().toString()); - - - // 一周内活跃用户缓存标识key增加 - Date monday = WeekUtil.getFirstDayOfWeek(date); - String weekStr = DateTimeUtil.convertDate(monday, DateTimeUtil.DEFAULT_DATE_PATTERN); - String activeKey = RedisKey.anchor_fans_team_play_once_week.getKey(recvUid + StrUtil.UNDERLINE + weekStr); - if (!jedisService.exits(activeKey)) { - // 一周过期 - jedisService.sadd(activeKey,member.getMemberUid().toString()); - jedisService.expire(activeKey,14 * 24 * 60 * 60); - } else { - if (jedisService.sismember(activeKey,member.getMemberUid().toString())) { - return; - } - // 增加缓存标识 - jedisService.sadd(activeKey,member.getMemberUid().toString()); - - UserNameplateVo nameplateVo = userNameplateService.getUserUsingNameplateVo(sendUid); - if (nameplateVo == null) { - return; - } - // 如果用户穿戴粉丝铭牌, 活跃后更新铭牌活跃状态 - if( nameplateVo.getType() != null && nameplateVo.getType().equals(NameplateStyleTypeEnum.ANCHOR_FANS_MP_SEND.getValue()) - && nameplateVo.getFixedWord().equals(team.getTeamName()) ) { - String mpPic = anchorFansTeamService.getAnchorFansMpPicWithMemberStatus(team.getUid(), sendUid); - if (org.apache.commons.lang3.StringUtils.isNotBlank(mpPic)) { - nameplateVo.setNameplateImage(mpPic); - jedisService.hset(RedisKey.user_using_nameplate.getKey(),sendUid.toString(),gson.toJson(nameplateVo)); - jedisService.hdel(RedisKey.user_summary.getKey(), sendUid.toString()); - } - } - } - - - logger.info("粉丝送礼监听完成..."); - logger.info("耗时:{}", stopWatch.prettyPrint()); - } catch (Exception e) { - logger.error("粉丝送礼监听器出现异常...e.message {}", e.getMessage(),e); - throw new ServiceException(BusiStatus.BUSIERROR); - } finally { - jedisService.unlock(key,lockVal); - } - - } - - - /** - * 限制用户在粉丝团中送专属礼物涨的经验数 - * @param sendUid - * @param recvUid - * @param task - * @param date 礼物送出时间 - * @return - */ - private Long cacluDesignExperCurrentDay(Integer giftNum, Long sendUid, Long recvUid, AnchorFansTask task, Date date) { - Long currentCount = giftNum.longValue(); - logger.info("粉丝团成员送专属礼物后获得的亲密值:{}", giftNum * task.getOnceVal()); - //维护每日送专属礼物增长亲密不能超过配置次数 - String todayStr = StrUtil.UNDERLINE + DateTimeUtil.convertDate(date,DateTimeUtil.DEFAULT_DATE_PATTERN); - String dayExperKey = RedisKey.anchor_fans_send_design_gift_day_exper.getKey(sendUid + StrUtil.UNDERLINE + recvUid + todayStr); - - Long limitNum = task.getLimitNum().longValue(); - Boolean isFinished = false; - if (jedisService.exits(dayExperKey)) { - Long useCount = Long.parseLong(jedisService.get(dayExperKey)); - - Long remainCount = limitNum - useCount; - - if (currentCount >= remainCount) { - currentCount = remainCount; - isFinished = true; - } - jedisService.incrBy(dayExperKey, currentCount); - }else { - if (currentCount >= limitNum) { - currentCount = limitNum; - isFinished = true; - } - jedisService.incrBy(dayExperKey, currentCount); - jedisService.expire(dayExperKey, 24 * 60 *60); - } - - if (isFinished) { - // 完成任务数 +1 - anchorFansTeamService.finishedTask(recvUid,sendUid,task,todayStr); - } - return currentCount * task.getOnceVal(); - } - - /** - * 限制用户在粉丝团中送礼张的经验数 - * @param goldNum - * @param sendUid - * @param recvUid - * @param task - * @param date - * @return - */ - private Long cacluRemainCurrentDay(Long goldNum, Long sendUid, Long recvUid, AnchorFansTask task, Date date) { - Long exper = goldNum / task.getAwardVal(); - logger.info("粉丝团成员送专属礼物后获得的亲密值:{}", exper); - //维护每日送礼长经验不能超过配置值 - String todayStr = StrUtil.UNDERLINE + DateTimeUtil.convertDate(date,DateTimeUtil.DEFAULT_DATE_PATTERN); - String dayExperKey = RedisKey.anchor_fans_send_gift_day_exper.getKey(sendUid + StrUtil.UNDERLINE + recvUid + todayStr); - - Long limitNum = task.getLimitNum().longValue(); - Boolean isFinished = false; - if (jedisService.exits(dayExperKey)) { - Long useExper = Long.parseLong(jedisService.get(dayExperKey)); - - Long remainExper = limitNum - useExper; - - if (exper > remainExper) { - exper = remainExper; - isFinished = true; - } - jedisService.incrBy(dayExperKey, exper); - }else { - if (exper > limitNum) { - exper = limitNum; - isFinished = true; - } - jedisService.incrBy(dayExperKey, exper); - jedisService.expire(dayExperKey, 24 * 60 *60); - } - - if (isFinished) { - // 完成任务数 +1 - anchorFansTeamService.finishedTask(recvUid,sendUid,task,todayStr); - } - - return exper; - } - - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/AnchorOnWheatListener.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/AnchorOnWheatListener.java deleted file mode 100644 index c4f840297..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/AnchorOnWheatListener.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.accompany.business.event.listener; - -import cn.hutool.core.util.ObjectUtil; -import com.accompany.business.event.AnchorOnWheatEvent; -import com.accompany.business.param.MicQueueParam; -import com.accompany.business.service.room.RoomService; -import com.accompany.business.service.room.SingleBroadcastPopularityService; -import com.accompany.common.constant.Constant; -import com.accompany.common.redis.RedisKey; -import com.accompany.core.model.Room; -import com.accompany.core.service.common.JedisService; -import com.google.gson.Gson; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationListener; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Component; - -/** - * Created By chenli on 2021/06/11. - * 上麦下麦事件监听 - */ -@Component -public class AnchorOnWheatListener implements ApplicationListener { - private static final Logger logger = LoggerFactory.getLogger(AnchorOnWheatListener.class); - - @Autowired - private ApplicationContext applicationContext; - - @Autowired - private SingleBroadcastPopularityService singleBroadcastPopularityService; - - @Autowired - private JedisService jedisService; - - @Autowired - private RoomService roomService; - - private Gson gson = new Gson(); - - - @Override - @Async - public void onApplicationEvent(AnchorOnWheatEvent anchorOnWheatEvent) { - MicQueueParam micQueueParam = (MicQueueParam) anchorOnWheatEvent.getSource(); - int qEvent = micQueueParam.getQEvent(); - Long roomId = micQueueParam.getRoomid(); - try { - if (Constant.AnchorOnWheatQueOperate.ADD_QUEUE.equals(qEvent)) { - //上麦:添加到队列 - Long uid = micQueueParam.getOperator(); - logger.info("用户上麦uid:{}, roomId:{}", uid, roomId); - singleBroadcastPopularityService.singleBroadcastSendMsgJudge(uid, roomId); - } - if (Constant.AnchorOnWheatQueOperate.DEL_QUEUE.equals(qEvent) || Constant.AnchorOnWheatQueOperate.POP_QUEUE.equals(qEvent)) { - //下麦:从队列删除 - Long uid = micQueueParam.getOperator(); - //清除10min钟计时发消息key,房间开启离开模式也会触发下麦 - jedisService.del(RedisKey.single_broadcast_up.getKey(String.valueOf(uid))); - } - if (Constant.AnchorOnWheatQueOperate.DROP_QUEUE.equals(qEvent)) { - //删除整个队列 - Room room = roomService.getRoomByRoomId(roomId); - if (ObjectUtil.isNull(room)) return; - Long roomUid = room.getUid(); - //清除10min钟计时发消息key,房间开启离开模式也会触发下麦 - jedisService.del(RedisKey.single_broadcast_up.getKey(String.valueOf(roomUid))); - } - - }catch (Exception e) { - e.printStackTrace(); - } - - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/ChargeTreasureActTaskChargeListener.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/ChargeTreasureActTaskChargeListener.java index 73006ecd9..42c41f705 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/ChargeTreasureActTaskChargeListener.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/ChargeTreasureActTaskChargeListener.java @@ -26,9 +26,9 @@ public class ChargeTreasureActTaskChargeListener implements ApplicationListener< @Override public void onApplicationEvent(ChargeSuccessEvent event) { ChargeRecord chargeRecord = (ChargeRecord) event.getSource(); - if(chargeRecord.getBussType().equals(Constant.PayBussType.lucky_tarot)){ - return ; - } + // if(chargeRecord.getBussType().equals(Constant.PayBussType.lucky_tarot)){ + // return ; + // } Long uid = chargeRecord.getUid(); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/HighRechargeUserChargeListener.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/HighRechargeUserChargeListener.java index 6fa5c3dd8..93e126811 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/HighRechargeUserChargeListener.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/HighRechargeUserChargeListener.java @@ -29,9 +29,9 @@ public class HighRechargeUserChargeListener implements ApplicationListener { - @Autowired - private LinearlyPrizePoolService linearlyPrizePoolService; - @Autowired - private UsersService usersService; - @Autowired - private MessageRobotPushService messageRobotPushService; - @Autowired - private WebSecurityConfig webSecurityConfig; - - @Override - @Async - @SneakyThrows - public void onApplicationEvent(LinearlyPoolPrizeEvent boxPrizeEvent) { - LinearlyPoolPrizeMessage boxPrizeMessage = (LinearlyPoolPrizeMessage) boxPrizeEvent.getSource(); - Long uid = boxPrizeMessage.getUid(); - List entityList = boxPrizeMessage.getPrizeList(); - LinearlyPoolConfigDTO config = linearlyPrizePoolService.getConfig(); - List prizeNames = new ArrayList<>(); - for (PrizeEntity entity : entityList) { - if (config.getWxNotifyPrizeIds().contains(entity.getPrizeId())) { - prizeNames.add(entity); - } - } - if (CollectionUtil.isNotEmpty(prizeNames) && config.getWxNotifySwitch()) { - log.info("[LinearlyPoolPrizeWxNotifyListener] {} 抽中特殊礼物,发送企业微信消息. 特殊礼物: {}", uid, JSONObject.toJSONString(prizeNames)); - Users user = usersService.getUsersByUid(uid); - sendEnterpriseWechatMsg(user, prizeNames, config, boxPrizeMessage.getMessTime()); - } - } - - private void sendEnterpriseWechatMsg(Users user, List prizeNames, LinearlyPoolConfigDTO config, Long drawTime) { - MarkdownMessage msg = new MarkdownMessage(); - String gameName = StringUtils.isNotBlank(config.getGameName()) ? config.getGameName() : LinearlyPoolConstants.DEFAULT_GAME_NAME; - msg.addTitle(MarkdownMessage.getHeaderText(3, new StringBuilder("[").append(gameName).append("]礼物通知").toString())); - msg.add(MarkdownMessage.getReferenceText(new StringBuilder("App应用: ").append(AppEnum.molistar.getDesc()).toString())); - String prizes = prizeNames.stream().map(item -> new StringBuilder(item.getPrizeName()).append("x").append(item.getPrizeNum())).collect(Collectors.joining(",")); - msg.add(MarkdownMessage.getReferenceText(new StringBuilder("奖品: ").append(prizes).toString())); - msg.add(MarkdownMessage.getReferenceText(new StringBuilder("获得者: ").append(user.getNick()).append("(").append(user.getErbanNo()).append(")").toString())); - msg.add(MarkdownMessage.getReferenceText(new StringBuilder("抽奖时间: ").append(DateTimeUtil.convertDate(new Date(drawTime))).toString())); - String key = webSecurityConfig.getActivityDingPushKey(); - messageRobotPushService.pushMessageByKey(key, msg, true); - } - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/linearlypool/LinearlyPoolRankListener.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/linearlypool/LinearlyPoolRankListener.java deleted file mode 100644 index b7fe41578..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/linearlypool/LinearlyPoolRankListener.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.accompany.business.event.listener.linearlypool; - -import com.accompany.business.event.linearlypool.LinearlyPoolPrizeEvent; -import com.accompany.business.message.PrizeEntity; -import com.accompany.business.message.linearlypool.LinearlyPoolPrizeMessage; -import com.accompany.business.service.linearlypool.LinearlyPrizePoolRankService; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.utils.DateTimeUtil; -import lombok.SneakyThrows; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationListener; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * @author PaperCut on 2018/12/3. - * 开箱子排行榜处理 - */ -@Component -public class LinearlyPoolRankListener implements ApplicationListener { - @Autowired - private LinearlyPrizePoolRankService rankService; - - @Override - @Async - @SneakyThrows - public void onApplicationEvent(LinearlyPoolPrizeEvent boxPrizeEvent) { - LinearlyPoolPrizeMessage boxPrizeMessage = (LinearlyPoolPrizeMessage) boxPrizeEvent.getSource(); - Long uid = boxPrizeMessage.getUid(); - List entityList = boxPrizeMessage.getPrizeList(); - Double openBoxScore = 0d; - for (PrizeEntity entity : entityList) { - // 现在改成按照用户获得钻石 - openBoxScore += entity.getPrizeNum() * Integer.parseInt(String.valueOf(entity.getPlatformValue())); - } - //消息发送时间 - Long time = boxPrizeMessage.getMessTime(); - String timeStr = DateTimeUtil.getFormateTimeByMillis(time, DateTimeUtil.DEFAULT_DATE_PATTERN_); - // 增加氪金榜的排行 - String key = RedisKey.linearly_pool_krypton_rank.getKey(timeStr); - rankService.incrOpenBox(key, uid, openBoxScore); - } - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/room/AnchorFansTeamIntoRoomListener.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/room/AnchorFansTeamIntoRoomListener.java deleted file mode 100644 index a2aea298a..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/room/AnchorFansTeamIntoRoomListener.java +++ /dev/null @@ -1,207 +0,0 @@ -package com.accompany.business.event.listener.room; - -import cn.hutool.core.util.StrUtil; -import com.accompany.business.event.room.UserInRoomEvent; -import com.accompany.business.message.room.UserInRoomMessage; -import com.accompany.business.model.anchor.AnchorFansTask; -import com.accompany.business.model.anchor.AnchorFansTeam; -import com.accompany.business.model.anchor.AnchorFansTeamMember; -import com.accompany.business.service.anchor.AnchorFansTaskService; -import com.accompany.business.service.anchor.AnchorFansTeamMemberService; -import com.accompany.business.service.anchor.AnchorFansTeamService; -import com.accompany.business.service.room.RoomService; -import com.accompany.business.vo.RoomVo; -import com.accompany.business.vo.anchor.AnchorFansWatchVo; -import com.accompany.common.constant.Constant; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.DateTimeUtil; -import com.accompany.common.utils.StringUtils; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.service.common.JedisService; -import com.google.gson.Gson; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.collections.CollectionUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationListener; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Component; - -import java.text.ParseException; -import java.util.Date; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -/** - * @Author: lzm - * @Date: 2022-4-1 22:11:39 - * @Description: 用户进房粉丝团相关处理: - **/ -@Slf4j -@Component -public class AnchorFansTeamIntoRoomListener implements ApplicationListener { - - @Autowired - private RoomService roomService; - @Autowired - private AnchorFansTeamService anchorFansTeamService; - @Autowired - private JedisService jedisService; - @Autowired - private AnchorFansTeamMemberService anchorFansTeamMemberService; - @Autowired - private AnchorFansTaskService anchorFansTaskService; - - private Gson gson = new Gson(); - - /** - * 1、用户进房:判断用户是否为粉丝团长,判断用户是否为粉丝团成员、分别维护各自的缓存 - * 2、如果用户是团长、检查当前房间是否有对应团员,完成所有团员的进房任务 - * 3、如果用户是守护团成员、检查所属团和当前房间团长缓存是否有交集 - * 4、有交集进行处理每日进房任务、刷新进房时刻任务(用于经验扣减判定) - * @param userInRoomEvent - */ - @SneakyThrows - @Async - @Override - public void onApplicationEvent(UserInRoomEvent userInRoomEvent) { - UserInRoomMessage userInRoomMessage = (UserInRoomMessage) userInRoomEvent.getSource(); - if (userInRoomMessage == null) return; - - Date date = userInRoomMessage.getEnterTime(); - - - RoomVo roomVo = userInRoomMessage.getRoomVo(); - Long uid = userInRoomMessage.getUid(); - // 房间uid - Long roomUid = roomVo.getUid(); - // 是否主播房 - if (!roomService.judgeIsSingleBroadByUid(roomUid)) { - return; - } - // 是否拥有粉丝团 - AnchorFansTeam team = anchorFansTeamService.getAnchorFansTeamByUid(roomUid); - if (team == null) { - return; - } - - // 重复处理拦截 - if (!needHandleUserInRoomStatusCallback(date,uid,roomUid)) { - log.info("{} 已有更新的消息被处理,忽略", uid); - return ; - } - - // 当前进房用户uid 是否为主播 - String fansInRoomKey = RedisKey.anchor_fans_in_room.getKey(roomUid.toString()); - if (roomUid.equals(uid)) { - // 主播进房 => 查看当前是否有粉丝在房,如果有,开启计时, 如果上一轮粉丝的计时未结束, 则结束计时且重新开始 - // 房主进房缓存标识 - jedisService.sadd(RedisKey.anchor_in_room.getKey(), roomUid.toString()); - - Set fansUidSet = jedisService.smembers(fansInRoomKey); - List uids = fansUidSet.stream().map(Long::valueOf).collect(Collectors.toList()); - if (CollectionUtils.isEmpty(uids)) { - return; - } - anchorFansTeamService.dealWheat(uid, roomUid, "IN"); - - } else { - AnchorFansTeamMember member = anchorFansTeamMemberService.getTeamFansByMemberUid(roomUid, uid); - if (member == null) { - return; - } - - // 写入进房记录 - jedisService.sadd(fansInRoomKey,uid.toString()); - // 检查是否为粉丝团成员,是则进行相关处理 - this.dealIntoRoomTask(uid, roomUid,date); - } - - } - - private void dealIntoRoomTask(Long uid, Long roomUid,Date today) throws ParseException { - String todayStr = StrUtil.UNDERLINE + DateTimeUtil.convertDate(today,DateTimeUtil.DEFAULT_DATE_PATTERN); - AnchorFansTask task = anchorFansTaskService.getAnchorFansTaskByCode(Constant.AnchorFansTaskCode.watchLive); - if (task == null) { - return; - } - String durationDayKey = RedisKey.anchor_fans_day_watch_live.getKey(roomUid + StrUtil.UNDERLINE + uid + todayStr) ; - //默认观看直播20分钟完成任务 - Integer defaultMaxWatchMin = task.getOnceVal() * task.getLimitNum(); - long currentTime = today.getTime(); - - //默认观看直播15分钟完成任务 - Long defaultMs = defaultMaxWatchMin * 60 * 1000l; - - if (!jedisService.exits(durationDayKey)) { - jedisService.set(durationDayKey, String.valueOf(0)); - jedisService.expire(durationDayKey, 48 * 60 * 60); - } - - - Boolean flag = true; - String watchTimerKey = RedisKey.anchor_fans_member_watch_clock.getKey(roomUid.toString() + StrUtil.UNDERLINE + uid.toString() + todayStr); - if (!jedisService.exits(watchTimerKey)) { - //防止前一日有未处理的,进行处理 - String prevDayStr = StrUtil.UNDERLINE + DateTimeUtil.convertDate(DateTimeUtil.addDays(today, -1), DateTimeUtil.DEFAULT_DATE_PATTERN); - watchTimerKey = RedisKey.anchor_fans_member_watch_clock.getKey(roomUid + StrUtil.UNDERLINE + uid + prevDayStr); - if (!jedisService.exits(watchTimerKey)) flag = false; - } - String str = jedisService.get(watchTimerKey); - if (flag && (StringUtils.isEmpty(str) || "null".equalsIgnoreCase(str))) flag = false; - - if (flag) { - //对前一次未结束的进行处理 - AnchorFansWatchVo fansWatchVo = gson.fromJson(str, AnchorFansWatchVo.class); - fansWatchVo.setEndTime(currentTime); - anchorFansTeamService.watchliveDuration(roomUid, uid, fansWatchVo, 4, today, task); - jedisService.del(watchTimerKey); - } - - //主播在房间,有开启计时 - Boolean isExit = jedisService.sismember(RedisKey.anchor_in_room.getKey(),roomUid.toString()); - if (!isExit) { - return; - } - - log.info("用户uid:{}准备开启在teamUid:{}粉丝团团的计时", uid, roomUid); - anchorFansTeamService.startWatchLiveTimer(uid, todayStr, task, defaultMs, currentTime, roomUid); - - } - - private boolean needHandleUserInRoomStatusCallback(Date date, Long uid, Long roomUid) { - String key = RedisKey.anchor_fans_user_last_in_room_msg_time.getKey(); - String lastTimeStr = jedisService.hget(key, uid.toString()); - Long lastTime = null; - if (StringUtils.isNotBlank(lastTimeStr)) { - lastTime = Long.valueOf(lastTimeStr); - } - // 没有处理过或者缓存里面的时间小于当前消息的时间,则进行处理 - if (lastTime == null || lastTime.compareTo(date.getTime()) < 0) { - String lockKey = RedisKey.anchor_fans_user_last_in_room_msg_time_lock.getKey(uid.toString()); - String lock = jedisService.lock(lockKey, 10 * 1000, 10); - if (StringUtils.isBlank(lock)) { - throw new ServiceException(BusiStatus.SERVERBUSY, "获取锁失败"); - } - try { - // 加锁后再次判断 - lastTimeStr = jedisService.hget(key, uid.toString()); - if (StringUtils.isNotBlank(lastTimeStr)) { - lastTime = Long.valueOf(lastTimeStr); - } - if (lastTime == null || lastTime.compareTo(date.getTime()) < 0) { - // 将当前处理的消息时间戳设置到缓存 - jedisService.hset(key, uid.toString(), date.getTime() + ""); - return true; - } - } finally { - if (StringUtils.isNotBlank(lock)) { - jedisService.unlock(lockKey, lock); - } - } - } - return false; - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/room/AnchorFansTeamOutRoomListener.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/room/AnchorFansTeamOutRoomListener.java deleted file mode 100644 index 508c0045c..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/room/AnchorFansTeamOutRoomListener.java +++ /dev/null @@ -1,169 +0,0 @@ -package com.accompany.business.event.listener.room; - -import cn.hutool.core.util.StrUtil; -import com.accompany.business.event.room.UserOutRoomEvent; -import com.accompany.business.message.room.UserOutRoomMessage; -import com.accompany.business.model.anchor.AnchorFansTask; -import com.accompany.business.model.anchor.AnchorFansTeam; -import com.accompany.business.model.anchor.AnchorFansTeamMember; -import com.accompany.business.service.anchor.AnchorFansTaskService; -import com.accompany.business.service.anchor.AnchorFansTeamMemberService; -import com.accompany.business.service.anchor.AnchorFansTeamService; -import com.accompany.business.service.room.RoomService; -import com.accompany.business.vo.anchor.AnchorFansWatchVo; -import com.accompany.common.constant.Constant; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.DateTimeUtil; -import com.accompany.common.utils.StringUtils; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.service.common.JedisService; -import com.google.gson.Gson; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationListener; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Component; - -import java.util.Date; - - -/** - * @Author: lzm - * @Date: 2022-4-1 22:11:39 - * @Description: 用户退房粉丝团相关处理: - **/ -@Slf4j -@Component -public class AnchorFansTeamOutRoomListener implements ApplicationListener { - - @Autowired - private RoomService roomService; - @Autowired - private AnchorFansTeamService anchorFansTeamService; - @Autowired - private JedisService jedisService; - @Autowired - private AnchorFansTeamMemberService anchorFansTeamMemberService; - @Autowired - private AnchorFansTaskService anchorFansTaskService; - - private Gson gson = new Gson(); - - @Async - @Override - @SneakyThrows - public void onApplicationEvent(UserOutRoomEvent event) { - UserOutRoomMessage userOutRoomMessage = (UserOutRoomMessage) event.getSource(); - if (userOutRoomMessage == null) return; - Date date = new Date(); - - //当前退房用户uid - Long memberUid = userOutRoomMessage.getUid(); - Long roomUid = userOutRoomMessage.getRoomUid(); - - // 是否主播房 - if (!roomService.judgeIsSingleBroadByUid(roomUid)) { - return; - } - // 是否拥有粉丝团 - AnchorFansTeam team = anchorFansTeamService.getAnchorFansTeamByUid(roomUid); - if (team == null) { - return; - } - - // 重复处理拦截 - if (!needHandleUserInRoomStatusCallback(date,memberUid,roomUid)) { - log.info("{} 已有更新的消息被处理,忽略", memberUid); - return ; - } - - //1、离开房间检查用户否拥有守护团 - if (memberUid.equals(roomUid)) { - // 用户是主播 - anchorFansTeamService.dealWheat(memberUid, roomUid, "OUT"); - // 移除粉丝团主播当前所在房间标记 - jedisService.srem(RedisKey.anchor_in_room.getKey(),String.valueOf(memberUid)); - - }else { - // 普通用户 是否为粉丝 - AnchorFansTeamMember member = anchorFansTeamMemberService.getTeamFansByMemberUid(roomUid, memberUid); - if (member == null) { - log.info("不是当前粉丝团的成员, 用户uid:{},粉丝团主播uid:{},粉丝团id:{}",memberUid, roomUid, team.getId()); - return; - } - - String fansInRoomKey = RedisKey.anchor_fans_in_room.getKey(roomUid.toString()); - boolean isExit = jedisService.sismember(fansInRoomKey, String.valueOf(memberUid)); - if (!isExit){ - log.info("当前粉丝进房缓存不存在该用户数据, 用户uid:{},粉丝团主播uid:{},粉丝团id:{}",memberUid, roomUid, team.getId()); - return; - } - - AnchorFansTask task = anchorFansTaskService.getAnchorFansTaskByCode(Constant.AnchorFansTaskCode.watchLive); - if (task == null) return; - Date today = new Date(); - String todayStr = StrUtil.UNDERLINE + DateTimeUtil.convertDate(today, DateTimeUtil.DEFAULT_DATE_PATTERN); - long currentTime = today.getTime(); - - //结束成员对应计时 - Boolean flag = true; - String watchTimerKey = RedisKey.anchor_fans_member_watch_clock.getKey(roomUid + StrUtil.UNDERLINE + memberUid + todayStr); - if (!jedisService.exits(watchTimerKey)) { - //防止前一日有未处理的,进行处理 - todayStr = StrUtil.UNDERLINE + DateTimeUtil.convertDate(DateTimeUtil.addDays(today, -1), DateTimeUtil.DEFAULT_DATE_PATTERN); - watchTimerKey = RedisKey.anchor_fans_member_watch_clock.getKey(roomUid + StrUtil.UNDERLINE + memberUid + todayStr); - if (!jedisService.exits(watchTimerKey)) return; - } - String str = jedisService.get(watchTimerKey); - if (flag && (StringUtils.isEmpty(str) || "null".equalsIgnoreCase(str))) return; - - AnchorFansWatchVo vo = gson.fromJson(str, AnchorFansWatchVo.class); - vo.setEndTime(currentTime); - anchorFansTeamService.watchliveDuration(roomUid, memberUid, vo, 3, today, task); - jedisService.del(watchTimerKey); - - //清除用户所在房间标记 - jedisService.srem(RedisKey.anchor_fans_in_room.getKey(roomUid.toString()),String.valueOf(memberUid)); - - - } - - - } - - private boolean needHandleUserInRoomStatusCallback(Date date, Long uid, Long roomUid) { - String key = RedisKey.anchor_fans_user_last_out_room_time.getKey(); - String lastTimeStr = jedisService.hget(key, uid.toString()); - Long lastTime = null; - if (StringUtils.isNotBlank(lastTimeStr)) { - lastTime = Long.valueOf(lastTimeStr); - } - // 没有处理过或者缓存里面的时间小于当前消息的时间,则进行处理 - if (lastTime == null || lastTime.compareTo(date.getTime()) < 0) { - String lockKey = RedisKey.anchor_fans_user_last_out_room_msg_time_lock.getKey(uid.toString()); - String lock = jedisService.lock(lockKey, 10 * 1000, 10); - if (StringUtils.isBlank(lock)) { - throw new ServiceException(BusiStatus.SERVERBUSY, "获取锁失败"); - } - try { - // 加锁后再次判断 - lastTimeStr = jedisService.hget(key, uid.toString()); - if (StringUtils.isNotBlank(lastTimeStr)) { - lastTime = Long.valueOf(lastTimeStr); - } - if (lastTime == null || lastTime.compareTo(date.getTime()) < 0) { - // 将当前处理的消息时间戳设置到缓存 - jedisService.hset(key, uid.toString(), date.getTime() + ""); - return true; - } - } finally { - if (StringUtils.isNotBlank(lock)) { - jedisService.unlock(lockKey, lock); - } - } - } - return false; - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/AnchorBillCheckMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/AnchorBillCheckMapper.java deleted file mode 100644 index 38118868a..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/AnchorBillCheckMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.accompany.business.mybatismapper; - -import com.accompany.business.model.AnchorBillCheck; -import com.accompany.business.model.AnchorBillCheckExample; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -public interface AnchorBillCheckMapper { - int countByExample(AnchorBillCheckExample example); - - int deleteByExample(AnchorBillCheckExample example); - - int deleteByPrimaryKey(Long id); - - int insert(AnchorBillCheck record); - - int insertSelective(AnchorBillCheck record); - - List selectByExample(AnchorBillCheckExample example); - - AnchorBillCheck selectByPrimaryKey(Long id); - - int updateByExampleSelective(@Param("record") AnchorBillCheck record, @Param("example") AnchorBillCheckExample example); - - int updateByExample(@Param("record") AnchorBillCheck record, @Param("example") AnchorBillCheckExample example); - - int updateByPrimaryKeySelective(AnchorBillCheck record); - - int updateByPrimaryKey(AnchorBillCheck record); -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/AnchorBillRecordMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/AnchorBillRecordMapper.java deleted file mode 100644 index 734c9cc0d..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/AnchorBillRecordMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.accompany.business.mybatismapper; - -import com.accompany.business.model.AnchorBillRecord; -import com.accompany.business.model.AnchorBillRecordExample; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -public interface AnchorBillRecordMapper { - int countByExample(AnchorBillRecordExample example); - - int deleteByExample(AnchorBillRecordExample example); - - int deleteByPrimaryKey(Long id); - - int insert(AnchorBillRecord record); - - int insertSelective(AnchorBillRecord record); - - List selectByExample(AnchorBillRecordExample example); - - AnchorBillRecord selectByPrimaryKey(Long id); - - int updateByExampleSelective(@Param("record") AnchorBillRecord record, @Param("example") AnchorBillRecordExample example); - - int updateByExample(@Param("record") AnchorBillRecord record, @Param("example") AnchorBillRecordExample example); - - int updateByPrimaryKeySelective(AnchorBillRecord record); - - int updateByPrimaryKey(AnchorBillRecord record); -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/AnchorBillRecordMapperExpand.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/AnchorBillRecordMapperExpand.java deleted file mode 100644 index 5e1ddb930..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/AnchorBillRecordMapperExpand.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.accompany.business.mybatismapper; - -import com.accompany.business.model.AnchorBillRecord; - -import java.util.List; - -public interface AnchorBillRecordMapperExpand { - - /** - * 批量保存 - * @param record - */ - int insertBatch(List record); -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/AnchorWhitelistMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/AnchorWhitelistMapper.java deleted file mode 100644 index e77d9dcd2..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/AnchorWhitelistMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.accompany.business.mybatismapper; - -import com.accompany.business.model.AnchorWhitelist; -import com.accompany.business.model.AnchorWhitelistExample; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -public interface AnchorWhitelistMapper { - int countByExample(AnchorWhitelistExample example); - - int deleteByExample(AnchorWhitelistExample example); - - int deleteByPrimaryKey(Long uid); - - int insert(AnchorWhitelist record); - - int insertSelective(AnchorWhitelist record); - - List selectByExample(AnchorWhitelistExample example); - - AnchorWhitelist selectByPrimaryKey(Long uid); - - int updateByExampleSelective(@Param("record") AnchorWhitelist record, @Param("example") AnchorWhitelistExample example); - - int updateByExample(@Param("record") AnchorWhitelist record, @Param("example") AnchorWhitelistExample example); - - int updateByPrimaryKeySelective(AnchorWhitelist record); - - int updateByPrimaryKey(AnchorWhitelist record); -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/AppVersionMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/AppVersionMapper.java deleted file mode 100644 index c90ee74b7..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/AppVersionMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.accompany.business.mybatismapper; - -import com.accompany.business.model.AppVersion; -import com.accompany.business.model.AppVersionExample; -import com.accompany.core.base.BaseMapper; - -import java.util.List; - -public interface AppVersionMapper extends BaseMapper{ - - List selectByExampleWithBLOBs(AppVersionExample example); - - int updateByPrimaryKeyWithBLOBs(AppVersion record); - /* - int countByExample(AppVersionExample example); - - int deleteByExample(AppVersionExample example); - - int deleteByPrimaryKey(Integer versionId); - - int insert(AppVersion record); - - int insertSelective(AppVersion record); - - List selectByExample(AppVersionExample example); - - AppVersion selectByPrimaryKey(Integer versionId); - - int updateByExampleSelective(@Param("record") AppVersion record, @Param("example") AppVersionExample example); - - int updateByExample(@Param("record") AppVersion record, @Param("example") AppVersionExample example); - - int updateByPrimaryKeySelective(AppVersion record); - - int updateByPrimaryKey(AppVersion record); - */ -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/GiftCompoundRecordDetailMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/GiftCompoundRecordDetailMapper.java deleted file mode 100644 index f0fa14de2..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/GiftCompoundRecordDetailMapper.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.accompany.business.mybatismapper; - -import com.accompany.business.model.GiftCompoundRecordDetail; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; - -@Mapper -public interface GiftCompoundRecordDetailMapper extends BaseMapper { -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/GiftCompoundRecordMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/GiftCompoundRecordMapper.java deleted file mode 100644 index 5ade6a793..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/GiftCompoundRecordMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.accompany.business.mybatismapper; - -import com.accompany.business.model.GiftCompoundRecord; -import com.accompany.business.vo.giftCompound.GiftCompoundRecordVo; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -@Mapper -public interface GiftCompoundRecordMapper extends BaseMapper { - List getByUid(@Param("uid") Long uid, @Param("start") Integer start, @Param("pageSize") Integer pageSize); -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/GiftCompoundRewardMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/GiftCompoundRewardMapper.java deleted file mode 100644 index 791b978cc..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/GiftCompoundRewardMapper.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.accompany.business.mybatismapper; - -import com.accompany.business.model.GiftCompoundReward; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -public interface GiftCompoundRewardMapper extends BaseMapper { -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/GiftCompoundRewardPoolMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/GiftCompoundRewardPoolMapper.java deleted file mode 100644 index 1f412261e..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/GiftCompoundRewardPoolMapper.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.accompany.business.mybatismapper; - -import com.accompany.business.model.GiftCompoundRewardPool; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -public interface GiftCompoundRewardPoolMapper extends BaseMapper { -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RedeemCodeMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RedeemCodeMapper.java deleted file mode 100644 index bc0fafcf4..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RedeemCodeMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.accompany.business.mybatismapper; - -import com.accompany.business.model.RedeemCode; -import com.accompany.business.model.RedeemCodeExample; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -public interface RedeemCodeMapper { - int countByExample(RedeemCodeExample example); - - int deleteByExample(RedeemCodeExample example); - - int deleteByPrimaryKey(String code); - - int insert(RedeemCode record); - - int insertSelective(RedeemCode record); - - List selectByExample(RedeemCodeExample example); - - RedeemCode selectByPrimaryKey(String code); - - int updateByExampleSelective(@Param("record") RedeemCode record, @Param("example") RedeemCodeExample example); - - int updateByExample(@Param("record") RedeemCode record, @Param("example") RedeemCodeExample example); - - int updateByPrimaryKeySelective(RedeemCode record); - - int updateByPrimaryKey(RedeemCode record); -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RedeemCodeRecordMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RedeemCodeRecordMapper.java deleted file mode 100644 index afc6f102c..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RedeemCodeRecordMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.accompany.business.mybatismapper; - -import com.accompany.business.model.RedeemCodeRecord; -import com.accompany.business.model.RedeemCodeRecordExample; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -public interface RedeemCodeRecordMapper { - int countByExample(RedeemCodeRecordExample example); - - int deleteByExample(RedeemCodeRecordExample example); - - int deleteByPrimaryKey(String recordId); - - int insert(RedeemCodeRecord record); - - int insertSelective(RedeemCodeRecord record); - - List selectByExample(RedeemCodeRecordExample example); - - RedeemCodeRecord selectByPrimaryKey(String recordId); - - int updateByExampleSelective(@Param("record") RedeemCodeRecord record, @Param("example") RedeemCodeRecordExample example); - - int updateByExample(@Param("record") RedeemCodeRecord record, @Param("example") RedeemCodeRecordExample example); - - int updateByPrimaryKeySelective(RedeemCodeRecord record); - - int updateByPrimaryKey(RedeemCodeRecord record); -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansExperRecordMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansExperRecordMapper.java deleted file mode 100644 index 993f866c3..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansExperRecordMapper.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.accompany.business.mybatismapper.anchor; - -import com.accompany.business.model.anchor.AnchorFansExperRecord; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; - -@Mapper -public interface AnchorFansExperRecordMapper extends BaseMapper { -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansLevelExperienceMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansLevelExperienceMapper.java deleted file mode 100644 index 0560117d4..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansLevelExperienceMapper.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.accompany.business.mybatismapper.anchor; - -import com.accompany.business.model.anchor.AnchorFansLevelExperience; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; - -@Mapper -public interface AnchorFansLevelExperienceMapper extends BaseMapper { -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansPrivilegeConfigMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansPrivilegeConfigMapper.java deleted file mode 100644 index 27291191d..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansPrivilegeConfigMapper.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.accompany.business.mybatismapper.anchor; - -import com.accompany.business.model.anchor.AnchorFansPrivilegeConfig; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; - -@Mapper -public interface AnchorFansPrivilegeConfigMapper extends BaseMapper { -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansTaskMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansTaskMapper.java deleted file mode 100644 index 6e3a44d70..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansTaskMapper.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.accompany.business.mybatismapper.anchor; - -import com.accompany.business.model.anchor.AnchorFansTask; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; - -@Mapper -public interface AnchorFansTaskMapper extends BaseMapper { -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansTeamAudioRecordMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansTeamAudioRecordMapper.java deleted file mode 100644 index f1eff7778..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansTeamAudioRecordMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.accompany.business.mybatismapper.anchor; - -import com.accompany.business.model.anchor.AnchorFansTeamAudioRecord; -import com.accompany.business.vo.anchor.AnchorFansTeamAudioRecordVo; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -@Mapper -public interface AnchorFansTeamAudioRecordMapper extends BaseMapper { - List getUserAuditRecord(@Param("uid") Long uid); - - AnchorFansTeamAudioRecordVo getUserAuditRecordById(@Param("id") Long id); -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansTeamMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansTeamMapper.java deleted file mode 100644 index dca730cd5..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansTeamMapper.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.accompany.business.mybatismapper.anchor; - -import com.accompany.business.model.anchor.AnchorFansTeam; -import com.accompany.business.vo.anchor.AnchorFansTeamJoinVo; -import com.accompany.business.vo.anchor.AnchorFansTeamStatsDetailVo; -import com.accompany.business.vo.anchor.AnchorFansTeamStatsVo; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -@Mapper -public interface AnchorFansTeamMapper extends BaseMapper { - - List searchJoinFansTeamByTeamIds(@Param("teamIds") List teamIds); - - List getUseMpPrivilegeConfigByPrivilegeId(@Param("privilegeId") Integer privilegeId); - - List getAnchorWithFansteam(@Param("uid") Long uid); - - List getAnchorFansTeamDetailList(@Param("teamId") Long teamId); -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansTeamMemberMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansTeamMemberMapper.java deleted file mode 100644 index e98908230..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansTeamMemberMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.accompany.business.mybatismapper.anchor; - -import com.accompany.business.model.anchor.AnchorFansTeamMember; -import com.accompany.business.vo.anchor.AnchorFansMemberVo; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -@Mapper -public interface AnchorFansTeamMemberMapper extends BaseMapper { - List getFansMemberVoByTeamId(@Param("teamId") Long teamId, @Param("beginIndex") Integer beginIndex, @Param("pageSize") Integer pageSize); -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansTeamMpPicMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansTeamMpPicMapper.java deleted file mode 100644 index f0d3d97af..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/anchor/AnchorFansTeamMpPicMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.accompany.business.mybatismapper.anchor; - -import com.accompany.business.model.anchor.AnchorFansTeamMpPic; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -@Mapper -public interface AnchorFansTeamMpPicMapper extends BaseMapper { - - void saveBatchAnchorFansTeamMpPicList(@Param("levelPics") List levelPics); - - void updateBatchAnchorFansTeamMpPicList(@Param("levelPics") List levelPics); -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/audiocard/AudioCardMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/audiocard/AudioCardMapper.java deleted file mode 100644 index fd00d9898..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/audiocard/AudioCardMapper.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.accompany.business.mybatismapper.audiocard; - -import com.accompany.business.model.audiocard.UserAudioCard; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -public interface AudioCardMapper extends BaseMapper { - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/linearlypool/LinearlyPrizePoolDrawLineItemDayMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/linearlypool/LinearlyPrizePoolDrawLineItemDayMapper.java deleted file mode 100644 index e8bfccad7..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/linearlypool/LinearlyPrizePoolDrawLineItemDayMapper.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.accompany.business.mybatismapper.linearlypool; - -import com.accompany.business.model.linearlypool.LinearlyPrizePoolDrawLineItemDay; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -public interface LinearlyPrizePoolDrawLineItemDayMapper extends BaseMapper { -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/linearlypool/LinearlyPrizePoolDrawLineItemMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/linearlypool/LinearlyPrizePoolDrawLineItemMapper.java deleted file mode 100644 index 94a640f1c..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/linearlypool/LinearlyPrizePoolDrawLineItemMapper.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.accompany.business.mybatismapper.linearlypool; - -import com.accompany.business.model.linearlypool.LinearlyPrizePoolDrawLineItem; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -public interface LinearlyPrizePoolDrawLineItemMapper extends BaseMapper { -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/linearlypool/LinearlyPrizePoolItemDraftMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/linearlypool/LinearlyPrizePoolItemDraftMapper.java deleted file mode 100644 index 30f5c72e2..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/linearlypool/LinearlyPrizePoolItemDraftMapper.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.accompany.business.mybatismapper.linearlypool; - -import com.accompany.business.model.linearlypool.LinearlyPrizePoolItemDraft; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -public interface LinearlyPrizePoolItemDraftMapper extends BaseMapper { -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/linearlypool/LinearlyPrizePoolItemMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/linearlypool/LinearlyPrizePoolItemMapper.java deleted file mode 100644 index cddd6a547..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/linearlypool/LinearlyPrizePoolItemMapper.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.accompany.business.mybatismapper.linearlypool; - -import com.accompany.business.model.linearlypool.LinearlyPrizePoolItem; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -public interface LinearlyPrizePoolItemMapper extends BaseMapper { -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasureConvertItemMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasureConvertItemMapper.java deleted file mode 100644 index e33e493a5..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasureConvertItemMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.accompany.business.mybatismapper.treasure; - -import com.accompany.business.model.treasure.SeizeTreasureConvertItem; -import com.accompany.business.vo.treasure.convert.SeizeTreasureCovertItemVo; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -@Mapper -public interface SeizeTreasureConvertItemMapper extends BaseMapper { - List getConvertItem(@Param("convertType") Integer convertType); - - SeizeTreasureCovertItemVo getItemById(@Param("itemId") Long itemId); -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasureConvertRecordMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasureConvertRecordMapper.java deleted file mode 100644 index 1d1686f21..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasureConvertRecordMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.accompany.business.mybatismapper.treasure; - -import com.accompany.business.model.treasure.SeizeTreasureConvertRecord; -import com.accompany.business.vo.treasure.convert.SeizeTreasureConvertRecordVo; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -@Mapper -public interface SeizeTreasureConvertRecordMapper extends BaseMapper { - List getConvertRecord(@Param("uid") Long uid, @Param("convertType") Integer convertType); -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasurePoolDrawRecordMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasurePoolDrawRecordMapper.java deleted file mode 100644 index 56d20060d..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasurePoolDrawRecordMapper.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.accompany.business.mybatismapper.treasure; - -import com.accompany.business.model.treasure.SeizeTreasurePoolDrawRecord; -import com.accompany.business.vo.treasure.record.SeizeTreasurePoolDrawRecordVo; -import com.accompany.business.vo.treasure.record.SeizeTreasureStaticVo; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -@Mapper -public interface SeizeTreasurePoolDrawRecordMapper extends BaseMapper { - - List getDrawRecordList(@Param("uid") Long uid, @Param("poolTypeList") List poolTypeList); - - SeizeTreasureStaticVo staticPoolRecord(@Param("poolTypeList") List poolType, @Param("poolGroup") Integer poolGroup, @Param("poolLevel") Integer poolLevel, @Param("startDate") Date startDate, @Param("endDate") Date endDate); -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasurePoolItemMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasurePoolItemMapper.java deleted file mode 100644 index a857881dd..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasurePoolItemMapper.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.accompany.business.mybatismapper.treasure; - -import com.accompany.business.model.treasure.SeizeTreasurePoolItem; -import com.accompany.business.vo.treasure.SeizeTreasurePoolItemVo; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -@Mapper -public interface SeizeTreasurePoolItemMapper extends BaseMapper { - List getPoolItemList( - @Param("poolType") Integer poolType, @Param("poolGroup") Integer poolGroup,@Param("poolLevel") Integer poolLeveler); - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasurePropMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasurePropMapper.java deleted file mode 100644 index b929ff3e1..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasurePropMapper.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.accompany.business.mybatismapper.treasure; - -import com.accompany.business.model.treasure.SeizeTreasureProp; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; - -@Mapper -public interface SeizeTreasurePropMapper extends BaseMapper { - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasureRewardMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasureRewardMapper.java deleted file mode 100644 index 0f8414084..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasureRewardMapper.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.accompany.business.mybatismapper.treasure; - -import com.accompany.business.model.treasure.SeizeTreasureReward; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; - -@Mapper -public interface SeizeTreasureRewardMapper extends BaseMapper { - -} - diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasureUserPropMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasureUserPropMapper.java deleted file mode 100644 index 65368b6fa..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasureUserPropMapper.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.accompany.business.mybatismapper.treasure; - -import com.accompany.business.model.treasure.SeizeTreasureUserProp; -import com.accompany.business.vo.treasure.elf.SeizeTreasureUserElfVo; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; -import java.util.Set; - -@Mapper -public interface SeizeTreasureUserPropMapper extends BaseMapper { - void addUserProp(@Param("uid") Long uid, @Param("propId") Long propId, @Param("addNum") Integer addNum); - - /** - * - * @param uid - * @param propId - * @param reduceNum - * @param minNum - * @return 受影响的行数 - */ - Integer reduceUserProp(@Param("uid") Long uid, @Param("propId") Long propId, @Param("reduceNum") Integer reduceNum,@Param("minNum") Integer minNum); - - /** - * - * @param uid - * @param propIdSet - * @param reduceNum - * @param minNum - * @return 受影响的行数 - */ - Integer batchReduceUserProp(@Param("uid") Long uid, @Param("propIdSet") Set propIdSet, @Param("reduceNum") Integer reduceNum, @Param("minNum") Integer minNum); - - - List getUserElvesVo(@Param("uid") Long uid); -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasureUserPropRecordMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasureUserPropRecordMapper.java deleted file mode 100644 index 46c738bc1..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/treasure/SeizeTreasureUserPropRecordMapper.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.accompany.business.mybatismapper.treasure; - -import com.accompany.business.model.treasure.SeizeTreasureUserPropRecord; -import com.accompany.business.vo.treasure.compound.SeizeTreasureElfCompoundRecordVo; -import com.accompany.business.vo.treasure.elf.SeizeTreasureElfRecordVo; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -@Mapper -public interface SeizeTreasureUserPropRecordMapper extends BaseMapper { - - List getUserElfRecord(@Param("uid") Long uid, @Param("typeList") List typeList); - - List getCompoundGainRecord(@Param("uid") Long uid); - - List getCompoundExpendList(@Param("recordIdList")List recordIdList); -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/AppVersionService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/AppVersionService.java deleted file mode 100644 index 942cd72fb..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/AppVersionService.java +++ /dev/null @@ -1,356 +0,0 @@ -package com.accompany.business.service; - -import com.accompany.business.model.AppVersion; -import com.accompany.business.model.AppVersionExample; -import com.accompany.business.mybatismapper.AppVersionMapper; -import com.accompany.business.vo.AppVersionVo; -import com.accompany.business.vo.ComponentContrlVo; -import com.accompany.common.constant.Constant; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.AppVersionUtil; -import com.accompany.common.utils.BlankUtil; -import com.accompany.common.utils.GsonUtil; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.service.SysConfService; -import com.accompany.core.service.base.BaseService; -import com.accompany.core.util.StringUtils; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import java.util.List; -import java.util.Objects; -import java.util.function.Predicate; - -/** - * Created by liuguofu on 2017/7/10. - */ -@Slf4j -@Service -public class AppVersionService extends BaseService { - - @Autowired - private AppVersionMapper appVersionMapper; - @Autowired - private SysConfService sysConfService; - - /** - * 判断是否为审核中版本 - * @param version - * @return - */ - public boolean checkIsAuditingVersion(String version, String channel) { - String auditingVersion = sysConfService.getSysConfValueById(getAuditingVersionKey(channel)); - if(!StringUtils.isEmpty(auditingVersion) && (auditingVersion.equals(version.trim()))) { - logger.info("auditing_version : " + auditingVersion + ", version: " + version); - return true; - } - return false; - } - - /** - * 获取指定channel的审核版本key - * @param channel - * @return - */ - public String getAuditingVersionKey(String channel) { - return channel + "_" + Constant.SysConfId.auditing_version; - } - - /** - * 获取指定channel的最新版本key - * @param channel - * @return - */ - public String getNewestVersionKey(String os, String channel) { - return os + "_" + channel + "_" + Constant.SysConfId.newest_version; - } - - - /** - * 获取普通的版本key - * @param version - * @param os - * @param channel - * @return - */ - public String getAppVersionKey(String version, String os, String channel) { - return version + "_" + os + "_" + channel; - } - - public boolean checkIsAuditingUid(Long uid) { - if (uid == null) { - return false; - } - String json = jedisService.get(RedisKey.auti_user.getKey()); - if (BlankUtil.isBlank(json)) { - return false; - } - if (json.contains(uid.toString())) { - return true; - } - return false; - } - - /** - * 获取版本信息(附带版本更新信息) - * - * @param version - * @param os - * @return - */ - public BusiResult getAppVersionInfo(String version, String os, String channel) { - AppVersion appVersion = getAppVersion(version, os, channel); - if (appVersion == null) { - return new BusiResult<>(BusiStatus.SUCCESS); - } - - AppVersionVo appVersionVo = checkVersion((appVer) -> { - // 该版本状态是否处于建议更新或强制更新状态 - return Constant.AppVersion.forceupdate.equals(appVer.getStatus()) - || Constant.AppVersion.recommupdate.equals(appVer.getStatus()); - }, appVersion); - - BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS); - busiResult.setData(appVersionVo); - return busiResult; - } - - public ComponentContrlVo getNotAuditingVersionTips(String version, String channel, String os){ - ComponentContrlVo contrlVo = new ComponentContrlVo(); - if (!this.checkIsAuditingVersion(version, channel)){ - contrlVo.setTips(this.sysConfService.getSysConfValueById("login_tips")); - }else{ - contrlVo.setTips(""); - } - //eg: qingxun_ios_show_wx qingxun_android_show_qq - contrlVo.setShowWechat(Objects.equals(this.sysConfService.getSysConfValueById(os+"_show_wx").toLowerCase(),"true")); - contrlVo.setShowQq(Objects.equals(this.sysConfService.getSysConfValueById(os+"_show_qq").toLowerCase(),"true")); - contrlVo.setShowOneClick(Objects.equals(this.sysConfService.getSysConfValueById(os+"_show_oneClick").toLowerCase(),"true")); - return contrlVo; - } - - /** - * 根据版本号及os获取版本详情 - * - * @param version - * @param os - * @return - */ - private AppVersion getAppVersion(String version, String os, String channel) { - AppVersion appVersion = getAppVersionCache(version, os, channel); - if (appVersion == null) { - appVersion = queryAppVersionBy(version, os, channel); - if (appVersion != null) { - saveAppVersionCache(appVersion); - } - } - return appVersion; - } - - private AppVersionVo checkVersion(Predicate needUpdate, AppVersion appVersion) { - AppVersionVo appVersionVo = covertAppVersionToVo(appVersion); - // 判断该版本是否需要更新 - if (needUpdate.test(appVersion)) { - // 获取当前os最新的可用版本 - AppVersion newestVersion = getNewestAppVersion(appVersion.getOs(),appVersion.getPlatform()); - if (newestVersion == null) { - logger.error("Not found newestVersion. The version: " + appVersion.getVersion() + ", os: " + appVersion.getOs()); - throw new ServiceException("Not found newestVersion."); - } - - // 将最新的版本及描述加入Vo - appVersionVo.setUpdateVersion(newestVersion.getVersion()); - appVersionVo.setUpdateVersionDesc(newestVersion.getVersionDesc()); - } - return appVersionVo; - } - - /** - * 获取当前os最新的版本 - * - * @param os - * @return - */ - private AppVersion getNewestAppVersion(String os,String channel) { - //外层已经判过空 - os = os.toLowerCase(); - // 从配置表中获取当前最新的版本号 - String newestVersionValue = sysConfService.getSysConfValueById(getNewestVersionKey(os, channel)); - // 根据版本号获取版本信息 - return getAppVersion(newestVersionValue, os,channel); - } - - /** - * 管理后台获取所有版本 - * - * @return - */ - public BusiResult> getAllAppVersionList() { - BusiResult> busiResult = new BusiResult>(BusiStatus.SUCCESS); - List appVersionList = getAllAppVersionListByDb(); - busiResult.setData(appVersionList); - return busiResult; - } - - public List getAllAppVersionListByDb() { - AppVersionExample appVersionExample = new AppVersionExample(); - List appVersionList = appVersionMapper.selectByExampleWithBLOBs(appVersionExample); - return appVersionList; - } - - - private AppVersionVo covertAppVersionToVo(AppVersion appVersion) { - if (appVersion == null) { - return new AppVersionVo(); - } - AppVersionVo appVersionVo = new AppVersionVo(); - appVersionVo.setOs(appVersion.getOs()); - appVersionVo.setStatus(appVersion.getStatus()); - appVersionVo.setVersion(appVersion.getVersion()); - appVersionVo.setVersionDesc(appVersion.getVersionDesc()); - return appVersionVo; - } - - private AppVersion queryAppVersionBy(String version, String os, String channel) { - AppVersionExample appVersionExample = new AppVersionExample(); - AppVersionExample.Criteria criteria = appVersionExample.createCriteria().andVersionEqualTo(version).andOsEqualTo(os); - if(StringUtils.isNotBlank(channel)){ - criteria.andPlatformEqualTo(channel); - } - List appVersionList = appVersionMapper.selectByExampleWithBLOBs(appVersionExample); - if (CollectionUtils.isEmpty(appVersionList)) { - return null; - } else { - return appVersionList.get(0); - } - - } - - private AppVersion getAppVersionCache(String version, String os, String channel) { - String key = getAppVersionKey(version, os, channel); - String appVersionStr = jedisService.hget(RedisKey.app_version.getKey(), key); - - if (StringUtils.isEmpty(appVersionStr)) { - return null; - } else { - return GsonUtil.getGson().fromJson(appVersionStr, AppVersion.class); - } - } - - private void saveAppVersionCache(AppVersion appVersion) { - if (appVersion == null) { - return; - } - String version = appVersion.getVersion(); - String os = appVersion.getOs(); - String channel = appVersion.getPlatform(); - String key = getAppVersionKey(version, os, channel); - jedisService.hwrite(RedisKey.app_version.getKey(), key, GsonUtil.getGson().toJson(appVersion)); - } - - private void batchSaveAppVersion(List appVersionList) { - if (CollectionUtils.isEmpty(appVersionList)) { - return; - } - for (AppVersion appVersion : appVersionList) { - saveAppVersionCache(appVersion); - } - } - - private void refreshAppVersion() { - List appVersionList = getAllAppVersionListByDb(); - batchSaveAppVersion(appVersionList); - } - - public void cleanCache() { - jedisService.hdeleteKey(RedisKey.app_version.getKey()); - refreshAppVersion(); - } - - public BusiResult updateVersion(String version, Byte status) { - AppVersion appVersion = new AppVersion(); - appVersion.setStatus(status); - appVersion.setVersion(version); - AppVersionExample appVersionExample = new AppVersionExample(); - appVersionExample.createCriteria().andVersionEqualTo(version); - appVersionMapper.updateByExampleSelective(appVersion, appVersionExample); -// deleteAppVersionCache(version,"iOS"); - refreshAppVersion(); - return new BusiResult(BusiStatus.SUCCESS); - } - -// public BusiResult checkVersion(String version) { -// if (BlankUtil.isBlank(version)) { -// return new BusiResult(BusiStatus.VERSIONISNULL); -// } -// String replace = version.replace(".", ""); -// int versionInt = Integer.parseInt(replace); -// if (versionInt < 230) { -// return new BusiResult(BusiStatus.VERSIONTOLOW); -// } -// return new BusiResult(BusiStatus.SUCCESS); -// } - - /** - * 比较版本号的大小,前者大则返回一个正数,后者大返回一个负数,相等则返回0 - * - * @param version1 - * @param version2 - */ - public int compareVersion(String version1, String version2) { - //注意此处为正则匹配,不能用.; - String[] versionArray1 = version1.split("\\."); - String[] versionArray2 = version2.split("\\."); - int idx = 0; - //取最小长度值 - int minLength = Math.min(versionArray1.length, versionArray2.length); - int diff = 0; - //先比较长度, 再比较字符 - while (idx < minLength - && (diff = versionArray1[idx].length() - versionArray2[idx].length()) == 0 - && (diff = versionArray1[idx].compareTo(versionArray2[idx])) == 0) { - ++idx; - } - //如果已经分出大小,则直接返回,如果未分出大小,则再比较位数,有子版本的为大; - diff = (diff != 0) ? diff : versionArray1.length - versionArray2.length; - return diff; - } - - public AppVersionVo toVo(AppVersion data){ - AppVersionVo appVersionVo = new AppVersionVo(); - appVersionVo.setUpdateVersion(data.getVersion()); - appVersionVo.setUpdateVersionDesc(data.getVersionDesc()); - appVersionVo.setUpdateOs(data.getOs()); - appVersionVo.setUpdateChannel(data.getPlatform()); - appVersionVo.setUpdateStatus(data.getStatus()); - appVersionVo.setUpdateFileMd5(data.getFileMd5()); - appVersionVo.setUpdateDownloadLink(data.getDownloadLink()); - return appVersionVo; - } - - /** - * 查询最新版本 - * - * @param version - * @param os - * @return - */ - public AppVersionVo getNewestVersion(String version, String os, String channel) { - AppVersion newestVersion = getNewestAppVersion(os, channel); - if (newestVersion == null) { - logger.info("Not found newestVersion. The version: " + version + ", os: " + os + ", channel: " + channel); - return null; - } - if (AppVersionUtil.compareVersion(newestVersion.getVersion(), version) <= 0) { - logger.info("The current version is the newest version: " + version + ", os: " + os + ", channel: "+ channel); - return null; - } - // 将最新的版本及描述加入Vo - return toVo(newestVersion); - } - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/ChargeService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/ChargeService.java index a7bd4b543..368abe9d6 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/ChargeService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/ChargeService.java @@ -5,7 +5,6 @@ import cn.hutool.core.util.StrUtil; import com.accompany.business.annotation.CancelUidTag; import com.accompany.business.message.PayFinishMessage; import com.accompany.business.model.UserPurse; -import com.accompany.business.service.charge.LuckyTarotChargeService; import com.accompany.business.service.charge.VipChargeService; import com.accompany.business.service.mq.RocketMQService; import com.accompany.business.service.purse.UserPurseService; @@ -71,10 +70,6 @@ public class ChargeService extends BaseService { @Autowired private RocketMQService rocketMQService; @Autowired - private LuckyTarotRecordService luckyTarotRecordService; - @Autowired - private LuckyTarotChargeService luckyTarotChargeService; - @Autowired private UserVipRecordService userVipRecordService; @Autowired private VipAuthItemBizService vipAuthItemBizService; @@ -180,8 +175,6 @@ public class ChargeService extends BaseService { case Constant.PayBussType.charge: // 充值金幣 return handleAppPayGoldBuss(chargeRecord); - case Constant.PayBussType.lucky_tarot: - return doTarotChargeBusiness(chargeRecord); case Constant.PayBussType.OPEN_VIP: // 開通貴族 return doOpenVipBuss(chargeRecord); @@ -248,9 +241,6 @@ public class ChargeService extends BaseService { ChargeProd chargeProd = chargeProdService.getChargeProdById(chargeRecordProdId); Long money = chargeProd.getMoney(); long realAmount = money; - if (payCenterService.isTarotLowChargeAmountOpen()) { - realAmount = realAmount * 100; - } int vipLevel = 1; String prodDesc = chargeProd.getProdDesc(); if (StrUtil.isNotEmpty(prodDesc)) { @@ -325,9 +315,6 @@ public class ChargeService extends BaseService { money = chargeProd.getMoney(); Long checkMoney = money; chargeGoldNum = chargeProd.getChargeGoldNum(); - if (payCenterService.isTarotLowChargeAmountOpen()) { - checkMoney = money * 100; - } // 充值金額與實際價格不一致 if (!amountLong.equals(checkMoney)) { log.info("updateChargeData orderNo=" + chargeRecord.getChargeRecordId() + "&amountLong=" + amountLong + "&checkMoney=" + checkMoney + "數據異常"); @@ -397,131 +384,4 @@ public class ChargeService extends BaseService { rocketMQService.sendPayFinishMessage(message); } - /** - * 幸運塔羅充值業務處理 - * - * @param chargeRecord - * @return - */ - public int doTarotChargeBusiness(ChargeRecord chargeRecord) { - - String chargeRecordId = chargeRecord.getChargeRecordId(); - String tradeNo = chargeRecord.getPingxxChargeId(); - if (chargeRecordId == null || tradeNo == null) { - throw new ServiceException(BusiStatus.ABNORMAL_PAYMENT_ORDER_NUMBER_OR_MERCHANT_ORDER_NUMBER); - } - Long chargeUid = chargeRecord.getUid(); - int outTradeNum = getLastNumFromOrder(chargeRecordId); - int tradeNum = getLastNumFromOrder(tradeNo); - // 兩個訂單號最後一位数字相加的結果除以10取余既是中獎號碼 - int luckyNum = (outTradeNum + tradeNum) % 10; - LuckyTarotRecord luckyTarotRecord = - luckyTarotRecordService.getLuckyTarotRecordByOutTradeNo(chargeUid, chargeRecordId); - String cardNo = luckyTarotRecord.getSelectdNo(); - List cardList = gson.fromJson(cardNo, new TypeToken>() { - }.getType()); - // 選的牌有一張是中獎数字就算中獎 - boolean isDraw = cardList.contains(String.valueOf(luckyNum)); - // 更新錢包和充值記錄 - this.updateUserPurseAndRecord(chargeRecord, luckyTarotRecord, luckyNum, isDraw, chargeUid); - // 統計今日塔羅充值金額 - luckyTarotChargeService.countUserTarotChargeAmount( - chargeUid, luckyTarotRecord.getChargeMoney(), chargeRecord.getCreateTime()); - // 發布充值成功事件 - this.applicationContext.publishEvent(new ChargeSuccessEvent(chargeRecord)); - this.applicationContext.publishEvent(new CommonRecharge4ActEvent( - CommonRecharge4ActVo.builder() - .uid(chargeRecord.getUid()) - .ip(chargeRecord.getClientIp()) - .deviceId(chargeRecord.getClientDeviceId()) - .channel(chargeRecord.getChannel()) - .chargeStatus(chargeRecord.getChargeStatus()) - .totalGoldNum(chargeRecord.getTotalGold()) - .createTime(chargeRecord.getUpdateTime()).build())); - return 200; - } - - /** - * 從支付訂單號或商戶訂單號中獲取最後一位数字 - * - * @param orderId - * @return - */ - private int getLastNumFromOrder(String orderId) { - String regEx = "[^0-9]"; - Pattern p = Pattern.compile(regEx); - Matcher m = p.matcher(orderId); - String numbers = m.replaceAll("").trim(); - if (!StringUtils.isBlank(numbers)) { - String lastChar = numbers.substring(numbers.length() - 1); - return Integer.parseInt(lastChar); - } else { - Random random = new Random(); - return random.nextInt(10); - } - } - - /** - * 根據是否中獎處理業務 - * - * @param chargeRecord - * @param luckyTarotRecord - * @param isDraw - */ - @Transactional(rollbackFor = Exception.class) - public void updateUserPurseAndRecord( - ChargeRecord chargeRecord, - LuckyTarotRecord luckyTarotRecord, - int drawNum, - boolean isDraw, - Long chargeUid) { - log.info( - "幸运塔罗充值业务处理,chargeRecordId={},luckyNum={},isDraw={}", - chargeRecord.getChargeRecordId(), - drawNum, - isDraw); - String chargeRecordProdId = chargeRecord.getChargeProdId(); - ChargeProd chargeProd = chargeProdService.getChargeProdById(chargeRecordProdId); - Long money = luckyTarotRecord.getChargeMoney(); - long realAmount = money; - if (payCenterService.isTarotLowChargeAmountOpen()) { - realAmount = realAmount * 100; - } - Long amount = chargeRecord.getAmount(); - String orderNo = chargeRecord.getChargeRecordId(); - if (realAmount != amount) { - // 充值金額與實際價格不一致 (amount以分為單位) - log.error("非法塔罗充值. orderNo=[{}], amountLong=[{}], money=[{}]", orderNo, amount, money); - throw new IllegalArgumentException(String.format("非法塔羅充值. orderNo=[%s]", orderNo)); - } - Long chargeGoldNum = 0L; - Byte drawStatus = Constant.LuckyTarotStatus.fail; - if (isDraw) { - // 如果中獎,金幣數乘以10倍 - chargeGoldNum = chargeProd.getChargeGoldNum() * 10; - drawStatus = Constant.LuckyTarotStatus.success; - } - chargeRecord.setChargeStatus(Constant.ChargeRecordStatus.finish); - chargeRecord.setTotalGold(chargeGoldNum); - int result = completedOrder(chargeRecord); - if (result <= 0) { - log.info("重复请求:chargeRecordId: " + chargeRecord.getChargeRecordId()); - throw new ServiceException(BusiStatus.DUPLICATE_TRANSFER_REQUEST); - } - // 更新塔羅充值記錄 - luckyTarotRecord.setDrawStatus(drawStatus); - luckyTarotRecord.setGoldNum(chargeGoldNum); - luckyTarotRecord.setDrawNum(drawNum); - luckyTarotRecord.setUpdateTime(Calendar.getInstance().getTime()); - luckyTarotRecordService.updateLuckyTarotRecord(luckyTarotRecord); - // 更新錢包 - if (chargeGoldNum > 0L) { - double chargeGoldNumD = Double.valueOf(chargeGoldNum); - userPurseService.addDiamond(chargeUid, Double.valueOf(chargeGoldNum), BillObjTypeEnum.TARO_CHARGE, - (userPurse -> billRecordService.insertGeneralBillRecord(chargeUid, chargeRecord.getChargeRecordId(), BillObjTypeEnum.TARO_CHARGE, chargeGoldNumD, userPurse))); - } - // 發送小秘書通知和頭飾 - luckyTarotChargeService.sendDrawResultToUsers(luckyTarotRecord); - } - } \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansExperRecordService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansExperRecordService.java deleted file mode 100644 index fd21ec1ce..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansExperRecordService.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.accompany.business.service.anchor; - -import com.accompany.business.model.anchor.AnchorFansExperRecord; -import com.baomidou.mybatisplus.extension.service.IService; - -public interface AnchorFansExperRecordService extends IService { -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansLevelExperienceService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansLevelExperienceService.java deleted file mode 100644 index b1e430b0e..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansLevelExperienceService.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.accompany.business.service.anchor; - -import com.accompany.business.model.anchor.AnchorFansLevelExperience; -import com.baomidou.mybatisplus.extension.service.IService; - -import java.util.List; - -public interface AnchorFansLevelExperienceService extends IService { - - /** - * 保存粉丝等级配置 - * @param anchorFansLevelExperience - * @return - */ - AnchorFansLevelExperience saveAnchorFansLevelExperience(AnchorFansLevelExperience anchorFansLevelExperience); - - /** - * 更新粉丝等级配置 - * @param anchorFansLevelExperience - * @return - */ - AnchorFansLevelExperience updateAnchorFansLevelExperience(AnchorFansLevelExperience anchorFansLevelExperience); - - /** - * 计算当前粉丝经验等级 - * @param exper - * @return - */ - Integer cacluAnchorFansLevelExperienceByExper(Long exper); - - /** - * 根据等级序号获取对应的等级配置信息 - * @param leveSeq - * @return - */ - AnchorFansLevelExperience getAnchorFansLevelExperienceBySeq(Integer leveSeq); - - /** - * 初始化等级信息 - */ - void initAnchorFansLevelExperienceCache(); - - - /** - * 获取所有等级信息 - * @return - */ - List getAllFansLevel(); - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansPrivilegeConfigService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansPrivilegeConfigService.java deleted file mode 100644 index f3304ce46..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansPrivilegeConfigService.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.accompany.business.service.anchor; - -import com.accompany.business.model.anchor.AnchorFansPrivilegeConfig; -import com.accompany.business.vo.anchor.AnchorFansPrivilegeConfigVo; -import com.accompany.business.vo.anchor.PrivilegeFansMpVo; -import com.baomidou.mybatisplus.extension.service.IService; - -import java.util.List; - -public interface AnchorFansPrivilegeConfigService extends IService { - - - /** - * 获取可申请的特权粉丝团铭牌 - * @return - */ - List getApplyPrivilegeFansMpVoList(); - - /** - * 获取粉丝团特权缓存 目前每种类型只有一个 - * @return - */ - List getPrivilegeConfigListByType(Byte type); - - - /** - * 获取粉丝团所有特权 - */ - List allPrivilegeList(); - - /** - * 获取展示的所有特权 - * @return - */ - List allShowPrivilegeVoList(); - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansTaskService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansTaskService.java deleted file mode 100644 index 50e69c439..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansTaskService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.accompany.business.service.anchor; - -import com.accompany.business.model.anchor.AnchorFansTask; -import com.accompany.business.vo.anchor.AnchorFansTaskVo; -import com.baomidou.mybatisplus.extension.service.IService; - -import java.io.IOException; -import java.util.List; - -public interface AnchorFansTaskService extends IService { - - AnchorFansTask saveAnchorFansTask(AnchorFansTask AnchorFansTask); - - AnchorFansTask updateAnchorFansTask(AnchorFansTask AnchorFansTask); - - /** - * 粉丝今日任务情况 - * @param uid - * @param guardsUid - * @return - * @throws IOException - */ - List getAnchorFansTaskDescList(Long uid, Long guardsUid) ; - - /** - * 初始化任务信息 - */ - void initAnchorFansTaskCache(); - - /** - * 根据任务编码获取对应任务 - * @param taskCode - * @return - */ - AnchorFansTask getAnchorFansTaskByCode(String taskCode); - - /** - * 获取配置的所有任务 - * @return - */ - List getAllFansTaskList(); -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansTeamAudioRecordService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansTeamAudioRecordService.java deleted file mode 100644 index 8efd0c2e1..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansTeamAudioRecordService.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.accompany.business.service.anchor; - -import com.accompany.business.model.anchor.AnchorFansTeamAudioRecord; -import com.accompany.business.vo.anchor.AnchorFansTeamAudioRecordVo; -import com.baomidou.mybatisplus.extension.service.IService; -import com.github.pagehelper.PageInfo; - -public interface AnchorFansTeamAudioRecordService extends IService { - /** - * 获取审核的粉丝团铭牌数据 - * @param pageNumber - * @param pageSize - * @param erbanNo - * @return - */ - PageInfo getRecordList(Integer pageNumber, Integer pageSize, Long erbanNo); - - /** - * 审核粉丝团 - * @param status - * @param pid - * @param message - * @param adminId - */ - void nameplateAuditPass(Byte status, Long pid, String message, int adminId); - - /** - * 更新粉丝团铭牌 => 这里主要用来更改后台通过了 字体库没有的字, 导致铭牌有一部分空白的情况 - * @param uid - * @param mpTx - */ - void uploadFansTeamMp(Long uid, String mpTx); -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansTeamMemberService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansTeamMemberService.java deleted file mode 100644 index 501055ad0..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansTeamMemberService.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.accompany.business.service.anchor; - -import com.accompany.business.model.anchor.AnchorFansTeamMember; -import com.accompany.business.vo.anchor.AnchorFansMemberVo; -import com.baomidou.mybatisplus.extension.service.IService; - -import java.util.List; - -public interface AnchorFansTeamMemberService extends IService { - /** - * 根据粉丝团id 获取对应的粉丝总人数 - * - * @param teamId - * @return - */ - long getTeamMemberCountByTeamId(Long teamId); - - /** - * 根据成员uid 判断对应粉丝团是否存在对应的粉丝 - * @param teamUid - * @param memberUid - * @return - */ - Boolean hasTeamFansByMemberUid(Long teamUid, Long memberUid); - - /** - * 根据粉丝团主播uid, 成员uid 获取对应的成员信息 - * @param teamUid - * @param memberUid - * @return - */ - AnchorFansTeamMember getTeamFansByMemberUid(Long teamUid, Long memberUid); - - /** - * 获取对应的粉丝Vo - * @param teamId - * @param pageNum - * @param pageSize - * @return - */ - List getFansMemberVoByTeamId(Long teamId, Integer pageNum, Integer pageSize); - - List getTeamMemberListByTeamId(Long teamId); - - /** - * 根据主播uid 粉丝uid 从缓存获取对象 - * @param teamUid - * @param memberUid - * @return - */ - AnchorFansTeamMember getTeamFansByMemberUidCash(Long teamUid, Long memberUid); - - List getTeamMemberListByTeamIdFromDB(Long teamId); -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansTeamMpPicService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansTeamMpPicService.java deleted file mode 100644 index 8dfe62f40..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansTeamMpPicService.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.accompany.business.service.anchor; - -import com.accompany.business.model.anchor.AnchorFansTeamMpPic; -import com.baomidou.mybatisplus.extension.service.IService; - -import java.util.List; - -public interface AnchorFansTeamMpPicService extends IService { - /** - * 获取当前粉丝团的所有铭牌信息 - * @param teamId - * @return - */ - List getLevelMpPicsByGuardsTeamId(Long teamId); - - /** - * 批量保存铭牌 - * @param mpPicList - */ - void saveBatchAnchorFansTeamMpPicList(List mpPicList); - - /** - * 批量更新粉丝团铭牌 - * @param mpPicList - */ - void updateBatchAnchorFansTeamMpPicList(List mpPicList); - - /** - * 获取对应的粉丝团等级铭牌 - * @param teamId - * @param levelSeq - */ - AnchorFansTeamMpPic getLevelMpPicsByGuardsTeamIdAndLevelSeq(Long teamId, Integer levelSeq); -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansTeamService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansTeamService.java deleted file mode 100644 index 31c23b67c..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/AnchorFansTeamService.java +++ /dev/null @@ -1,263 +0,0 @@ -package com.accompany.business.service.anchor; - -import com.accompany.business.model.anchor.AnchorFansTask; -import com.accompany.business.model.anchor.AnchorFansTeam; -import com.accompany.business.vo.anchor.*; -import com.baomidou.mybatisplus.extension.service.IService; - -import java.io.IOException; -import java.text.ParseException; -import java.util.Date; -import java.util.List; - -public interface AnchorFansTeamService extends IService { - - /** - * 获取可申请的特权粉丝团铭牌 - * @return - */ - List getApplyPrivilegeFansMpVoList(); - - /** - * 申请粉丝团铭牌 - * @param uid - * @param privilegeId - * @param mpTx - */ - void applyFansTeamMp(Long uid, Integer privilegeId, String mpTx); - - /** - * 获取用户申请的粉丝团铭牌记录 - * @return - * @param uid - */ - List getApplyRecordList(Long uid); - - /** - * 生成粉丝团所有等级铭牌 - * @param teamId - * @param mpTx - * @param privilegeId - * @param teamUid - */ - void generateAnchorFansTeamMpPic(Long teamId, String mpTx, Integer privilegeId, Long teamUid) throws IOException; - - /** - * 加入的粉丝团列表 - * @param memberUid - * @return - */ - List getJoinFansTeamList(Long memberUid); - - /** - * 粉丝团 底部弹窗 - * @param teamUid - * @param memberUid - * @return - */ - ApplyFansTeamPopInfoVo applyFansTeamPopInfoVo(Long teamUid, Long memberUid); - - /** - * 获取根据id 获取对应粉丝团 - * @param teamId - * @return - */ - AnchorFansTeam getAnchorFansTeamByTeamId(Long teamId); - - /** - * 根据主播uid 获取对应粉丝团前三名头像信息 - * @return - */ - List getPreThirdFansAvatar(Long teamUid); - - AnchorFansTeam getAnchorFansTeamByUid(Long uid); - - Boolean hasAnchorFansTeamByUid(Long uid); - - /** - * 获取该用户的粉丝团成员数量 - * - * @param teamId - * @return - */ - long getAnchorFansTeamMemberCountByTeamId(Long teamId); - - /** - * 是否为对应用户的粉丝团成员 - * @param teamUid - * @param memberUid - * @return - */ - Boolean isCurrentRoomAnchorFans(Long teamUid, Long memberUid); - - /** - * 获取粉丝在粉丝团的对应等级 - * @param teamId - * @param memberUid - * @return - */ - Integer getFansLevelSeqByMemberUid(Long teamId, Long memberUid); - - /** - * 用户进主播房时初始化粉丝团信息 - * - * @param teamUid - * @param memberUid - * @return - */ - InRoomFansTeamInitVo initInRoomFansTeam(Long teamUid, Long memberUid); - - /** - * 加入粉丝团 - * @param teamId - * @param memberUid - * @param giftId - * @param joinTime - */ - void joinFansTeamByMemberUid(Long teamId, Long memberUid, Integer giftId, Date joinTime) throws Exception; - - /** - * 根据申请的铭牌名称(粉丝团名称) 判断是否存在对应的粉丝团 - * @param teamName - * @return - */ - boolean hasAnchorFansTeamByName(String teamName); - - /** - * 退出粉丝团 - * @param teamUid - * @param memberUid - */ - void outAnchorFansTeam(Long teamUid, Long memberUid); - - AnchorFansTaskInfoVo getFansTaskInfo(Long teamUid, Long memberUid); - - /** - * 检查更新用户铭牌 - * @param teamUid - * @param memberUid - * @param levelSeq - */ - void detectionMp(Long teamUid, Long memberUid, Integer levelSeq); - - /** - * 完成任务相关逻辑 - * @param teamUid - * @param memberUid - * @param task - * @param todayStr - */ - void finishedTask(Long teamUid, Long memberUid, AnchorFansTask task, String todayStr); - - /** - * 主播视角,我的粉丝 - * @param teamUid - * @param pageNum - * @param pageSize - * @return - */ - List getFansMemberVoList(Long teamUid, Integer pageNum, Integer pageSize); - - AnchorFansMemberRankVo getFansMemberRankVo(Long teamUid, Long memberUid, Integer pageNum, Integer pageSize); - - /** - * 观看主播直播任务处理 - * @param teamUid - * @param memberUid - * @param fansWatchVo - * @param type - * @param today - * @param task - */ - void watchliveDuration(Long teamUid, Long memberUid, AnchorFansWatchVo fansWatchVo, int type, Date today, AnchorFansTask task); - - /** - * 开启每日观看主播任务计时 - * @param memberUid - * @param todayStr - * @param task - * @param defaultMs - * @param currentTime - * @param teamUid - */ - void startWatchLiveTimer(Long memberUid, String todayStr, AnchorFansTask task, Long defaultMs, long currentTime, Long teamUid) throws ParseException; - - void dealWheat(Long memberUid, Long roomUid, String qEvent); - - /** - * 获取粉丝当前等级 当前活跃状态的 铭牌图片 - * @param teamUid - * @param memberUid - * @return - */ - String getAnchorFansMpPicWithMemberStatus(Long teamUid, Long memberUid); - - /** - * 定时赠送专属礼物给粉丝团用户 - */ - void sendDesignGiftAndNameplateStatus(); - - List getAllAnchorFansTeam(); - - /** - * 根据成员id, 铭牌文案(粉丝团名称) 获取对应的成员等级+状态的 铭牌图片 - * @param teamName - * @return - */ - String getAnchorFansMpPicWithWordAndStatus(Long memberUid, String teamName); - - /** - * 获取所有所有团队成员的 uid集合 - * @return - * @param teamIds - */ - List getAllAnchorFansTeamMemberUidsByTeamIds(List teamIds); - - /** - * 获取正在使用这些铭牌特权id 的所有团队uid - * @param privilegeId - * @return - */ - List getUseMpPrivilegeConfigByPrivilegeId(Integer privilegeId); - - /** - * 根据传入的铭牌状态 批量更新对应的粉丝团铭牌图片, 以及粉丝团成员的铭牌信息 - * @param mpStatus - * @param privilegeConfigId - */ - void generateAllAnchorFansTeamMpPicAndMemberPic(Byte mpStatus, Integer privilegeConfigId, Long oldNameplateId) throws IOException; - - /** - * 送入团礼物 加入粉丝团 - * @param sendUid - * @param receiveUids - * @param roomUid - * @param giftId - * @param giftNum - * @param msg - * @param giftSource - * @param sendType - * @return - */ - Object sendJoinTeamGift(Long sendUid, Long[] receiveUids, Long roomUid, int giftId, int giftNum, String msg, byte giftSource, byte sendType) throws Exception; - - /** - * 设置首周加入的成员key 恢复一些没加入粉丝团成员信息key的缓存数据 并更新其铭牌状态 - * => - * 修复 线上的key一开始设置过期时间不对 太短 - * && 加入粉丝团没有设置成员信息缓存key 导致在用户没触发增加对应缓存时 导致定时任务扫描不到对应的用户 不进行专属礼物派发操作 - * - * 注意: 这里只是针对团队信息缓存 及 首周加入标识进行处理(本方法执行后默认所有用户都会设置本周加入该粉丝团的标识) - */ - void fixMemberRedisJoinKeySignAndMpStatus(); - - - /** - * 更新指定粉丝团铭牌文案 并生成对应铭牌 更新到粉丝用户中 - * @param mpStatus - * @param privilegeId - * @param oldNameplateId - * @throws IOException - */ - void generateAnchorFansTeamMpPicAndMemberPic(Byte mpStatus, Integer privilegeId, Long oldNameplateId, Long teamId, String oldMpTx) throws IOException; -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansExperRecordServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansExperRecordServiceImpl.java deleted file mode 100644 index 8978c97ad..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansExperRecordServiceImpl.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.accompany.business.service.anchor.impl; - -import com.accompany.business.model.anchor.AnchorFansExperRecord; -import com.accompany.business.mybatismapper.anchor.AnchorFansExperRecordMapper; -import com.accompany.business.service.anchor.AnchorFansExperRecordService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; - -/** - * 粉丝成员亲密值账单 - */ -@Slf4j -@Service -public class AnchorFansExperRecordServiceImpl extends ServiceImpl implements AnchorFansExperRecordService { -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansLevelExperienceServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansLevelExperienceServiceImpl.java deleted file mode 100644 index 2ef537801..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansLevelExperienceServiceImpl.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.accompany.business.service.anchor.impl; - -import cn.hutool.core.collection.CollectionUtil; -import com.accompany.business.model.anchor.AnchorFansLevelExperience; -import com.accompany.business.mybatismapper.anchor.AnchorFansLevelExperienceMapper; -import com.accompany.business.service.anchor.AnchorFansLevelExperienceService; -import com.accompany.common.constant.AnchorFansLevelExperienceArr; -import com.accompany.common.redis.RedisKey; -import com.accompany.core.service.common.JedisService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.google.gson.Gson; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.StringUtils; - -import javax.annotation.PostConstruct; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -@Slf4j -@Service -public class AnchorFansLevelExperienceServiceImpl extends ServiceImpl implements AnchorFansLevelExperienceService { - - @Autowired - private JedisService jedisService; - - private Gson gson = new Gson(); - - @Override - @Transactional - public AnchorFansLevelExperience saveAnchorFansLevelExperience(AnchorFansLevelExperience anchorFansLevelExperience) { - this.save(anchorFansLevelExperience); - return anchorFansLevelExperience; - } - - @Override - @Transactional - public AnchorFansLevelExperience updateAnchorFansLevelExperience(AnchorFansLevelExperience anchorFansLevelExperience) { - this.updateById(anchorFansLevelExperience); - return anchorFansLevelExperience; - } - - @Override - public Integer cacluAnchorFansLevelExperienceByExper(Long exper) { - Integer levelSeq = 1; - - if (exper == null || exper == 0) return levelSeq; - - if (!jedisService.exits(RedisKey.anchor_fans_level_experience_config.getKey())) { - this.initAnchorFansLevelExperience(); - } - for (int i = 0; i < AnchorFansLevelExperienceArr.exper.length; i++) { - if (exper >= AnchorFansLevelExperienceArr.exper[i]) levelSeq = i + 1; - else break; - } - - return levelSeq; - } - - @Override - public AnchorFansLevelExperience getAnchorFansLevelExperienceBySeq(Integer leveSeq) { - if (leveSeq == null) return null; - if (!jedisService.exits(RedisKey.anchor_fans_level_experience_config.getKey())) { - this.initAnchorFansLevelExperience(); - } - - String levelStr = jedisService.hget(RedisKey.anchor_fans_level_experience_config.getKey(), String.valueOf(leveSeq)); - if (StringUtils.isEmpty(levelStr)) return null; - - return gson.fromJson(levelStr, AnchorFansLevelExperience.class); - - } - - @Override - @PostConstruct - public void initAnchorFansLevelExperienceCache() { - initAnchorFansLevelExperience(); - } - - @Override - public List getAllFansLevel() { - if (!jedisService.exits(RedisKey.anchor_fans_level_experience_config.getKey())) { - this.initAnchorFansLevelExperience(); - } - - Map map = jedisService.hgetAll(RedisKey.anchor_fans_level_experience_config.getKey()); - List levels = new ArrayList<>(); - for (String value : map.values()) { - AnchorFansLevelExperience levelExperience = gson.fromJson(value, AnchorFansLevelExperience.class); - levels.add(levelExperience); - } - levels = levels.stream().sorted(Comparator.comparing(AnchorFansLevelExperience::getLevelSeq)).collect(Collectors.toList()); - return levels; - } - - private void initAnchorFansLevelExperience() { - List levelExperiences = this.list(); - //数据库暂未设置粉丝团任务,作个判断 - if (CollectionUtil.isEmpty(levelExperiences)) { - log.info("anchorFansLevelExperienceConfig init,configList is Null!!!"); - return; - } - - levelExperiences = levelExperiences.stream().sorted(Comparator.comparing(AnchorFansLevelExperience::getLevelSeq)).collect(Collectors.toList()); - - //初始化之前清除原有的数据,防止数据混乱 - jedisService.del(RedisKey.anchor_fans_level_experience_config.getKey()); - - AnchorFansLevelExperienceArr.exper = new Long[levelExperiences.size()]; - for (int i = 0; i < AnchorFansLevelExperienceArr.exper.length; i++) { - AnchorFansLevelExperience anchorFansLevelExperience = levelExperiences.get(i); - jedisService.hset(RedisKey.anchor_fans_level_experience_config.getKey(), String.valueOf(anchorFansLevelExperience.getLevelSeq()), gson.toJson(anchorFansLevelExperience)); - AnchorFansLevelExperienceArr.exper[i] = anchorFansLevelExperience.getAmount(); - } - - - log.info("anchorFansLevelExperienceConfig has init!!!"); - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansPrivilegeConfigServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansPrivilegeConfigServiceImpl.java deleted file mode 100644 index eb579bd3b..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansPrivilegeConfigServiceImpl.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.accompany.business.service.anchor.impl; - -import cn.hutool.core.collection.CollectionUtil; -import com.accompany.business.model.Nameplate; -import com.accompany.business.model.anchor.AnchorFansPrivilegeConfig; -import com.accompany.business.mybatismapper.NameplateMapper; -import com.accompany.business.mybatismapper.anchor.AnchorFansPrivilegeConfigMapper; -import com.accompany.business.service.anchor.AnchorFansPrivilegeConfigService; -import com.accompany.business.service.gift.GiftService; -import com.accompany.business.vo.GiftVo; -import com.accompany.business.vo.anchor.AnchorFansPrivilegeConfigVo; -import com.accompany.business.vo.anchor.PrivilegeFansMpVo; -import com.accompany.common.constant.Constant; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.status.BusiStatus; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.service.common.JedisService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.google.gson.Gson; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -@Slf4j -@Service -public class AnchorFansPrivilegeConfigServiceImpl extends ServiceImpl implements AnchorFansPrivilegeConfigService { - - @Autowired - private JedisService jedisService; - - private Gson gson = new Gson(); - - @Autowired - private NameplateMapper nameplateMapper; - @Autowired - private GiftService giftService; - - @Override - public List getApplyPrivilegeFansMpVoList() { - List list = this.getPrivilegeConfigListByType(Constant.AnchorFansTeamPrivilegeType.nameplate); - List vos = new ArrayList<>(); - for (AnchorFansPrivilegeConfig privilegeConfig : list) { - PrivilegeFansMpVo vo = new PrivilegeFansMpVo(); - Long nameplateId = privilegeConfig.getNormalId(); - Nameplate nameplate = nameplateMapper.selectById(nameplateId); - if (nameplate == null){ - throw new ServiceException(BusiStatus.CONFIGURATION_EXCEPTION_PLEASE_CONTACT_THE_ADMINISTRATOR_FOR_HANDLING); - } - vo.setPrivilegeId(privilegeConfig.getId()); - vo.setIcon(nameplate.getIconPic()); - vos.add(vo); - } - return vos; - } - - @Override - public List getPrivilegeConfigListByType(@NonNull Byte type) { - List privilegeConfigs = this.allPrivilegeList(); - return privilegeConfigs.stream().filter(it -> type.equals(it.getType())).collect(Collectors.toList()); - } - - @Override - public List allPrivilegeList() { - if (!jedisService.exits(RedisKey.anchor_fans_privilege_config.getKey())) { - this.initPrivilegeConfigList(); - } - - Map map = jedisService.hgetAll(RedisKey.anchor_fans_privilege_config.getKey()); - - List privilegeList = new ArrayList<>(); - map.forEach((k, v) -> { - privilegeList.add(gson.fromJson(v, AnchorFansPrivilegeConfig.class)); - }); - - return privilegeList; - } - - @Override - public List allShowPrivilegeVoList() { - List privilegeConfigs = allPrivilegeList(); - List configs = privilegeConfigs.stream() - .filter(it -> Constant.AnchorFansPrivilegeShowStatus.show.equals(it.getIsShow())) - .sorted(Comparator.comparing(AnchorFansPrivilegeConfig::getSeq)) - .collect(Collectors.toList()); - List vos = new ArrayList<>(); - for (AnchorFansPrivilegeConfig config : configs) { - AnchorFansPrivilegeConfigVo configVo = new AnchorFansPrivilegeConfigVo(); - BeanUtils.copyProperties(config,configVo); - configVo.setPrivilegeId(config.getId()); - if (Constant.AnchorFansTeamPrivilegeType.exclusive_gift.equals(config.getType()) || Constant.AnchorFansTeamPrivilegeType.join_gift.equals(config.getType())) { - GiftVo vo = giftService.getGiftVoById(config.getNormalId().intValue()); - if (vo != null) { - configVo.setGiftVo(vo); - } - } - vos.add(configVo); - } - return vos; - } - - private void initPrivilegeConfigList () { - List privilegeList = this.list(); - //数据库暂未设置守护团任务,作个判断 - if (CollectionUtil.isEmpty(privilegeList)) { - log.info("guardsRuleConfig init,configList is Null!!!"); - return; - } - - //初始化之前清除原有的数据,防止数据混乱 - jedisService.del(RedisKey.anchor_fans_privilege_config.getKey()); - - for (AnchorFansPrivilegeConfig config : privilegeList) { - if (config.getStatus().equals(Constant.GlobalStatus.valid)) { - jedisService.hset(RedisKey.anchor_fans_privilege_config.getKey(), config.getId().toString(), gson.toJson(config)); - } - } - - log.info("guardsTaskConfig has init!!!"); - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansTaskServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansTaskServiceImpl.java deleted file mode 100644 index 6c839afb5..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansTaskServiceImpl.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.accompany.business.service.anchor.impl; - -import cn.hutool.core.collection.CollectionUtil; -import com.accompany.business.model.anchor.AnchorFansTask; -import com.accompany.business.mybatismapper.anchor.AnchorFansTaskMapper; -import com.accompany.business.service.anchor.AnchorFansTaskService; -import com.accompany.business.vo.anchor.AnchorFansTaskVo; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.utils.StringUtils; -import com.accompany.core.service.common.JedisService; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.google.gson.Gson; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -@Slf4j -@Service -public class AnchorFansTaskServiceImpl extends ServiceImpl implements AnchorFansTaskService { - - @Autowired - private JedisService jedisService; - private Gson gson = new Gson(); - - @Override - public AnchorFansTask saveAnchorFansTask(AnchorFansTask AnchorFansTask) { - return null; - } - - @Override - public AnchorFansTask updateAnchorFansTask(AnchorFansTask AnchorFansTask) { - return null; - } - - /** - * 粉丝任务完成情况 - * @param uid - * @param guardsUid - * @return - */ - @Override - public List getAnchorFansTaskDescList(Long uid, Long guardsUid) { - return null; - } - - @Override - public void initAnchorFansTaskCache() { - List taskList = this.list(); - //数据库暂未设置守护团任务,作个判断 - if (CollectionUtil.isEmpty(taskList)) { - log.info("anchorFansTaskConfig init,configList is Null!!!"); - return; - } - - //初始化之前清除原有的数据,防止数据混乱 - jedisService.del(RedisKey.anchor_fans_privilege_config.getKey()); - - taskList.forEach(task -> jedisService.hset(RedisKey.anchor_fans_day_task_config.getKey(), - task.getTaskCode(), gson.toJson(task))); - - log.info("anchorFansTaskConfig has init!!!"); - } - - @Override - public AnchorFansTask getAnchorFansTaskByCode(String taskCode) { - if (StringUtils.isEmpty(taskCode)) return null; - - if (!jedisService.exits(RedisKey.anchor_fans_day_task_config.getKey())) { - initAnchorFansTaskCache(); - } - - String taskStr = jedisService.hget(RedisKey.anchor_fans_day_task_config.getKey(), taskCode); - if (!StringUtils.isEmpty(taskStr)) { - return gson.fromJson(taskStr, AnchorFansTask.class); - } - - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().eq(AnchorFansTask::getTaskCode, taskCode); - AnchorFansTask guardsTask = this.baseMapper.selectOne(queryWrapper); - if (guardsTask != null) { - jedisService.hset(RedisKey.anchor_fans_day_task_config.getKey(), taskCode, gson.toJson(guardsTask)); - } - return guardsTask; - } - - @Override - public List getAllFansTaskList() { - if (!jedisService.exits(RedisKey.anchor_fans_day_task_config.getKey())) { - initAnchorFansTaskCache(); - } - Map stringStringMap = jedisService.hgetAll(RedisKey.anchor_fans_day_task_config.getKey()); - List taskList = new ArrayList<>(); - List taskStrList = stringStringMap.values().stream().collect(Collectors.toList()); - for (String taskStr : taskStrList) { - taskList.add(gson.fromJson(taskStr, AnchorFansTask.class)); - } - return taskList; - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansTeamAudioRecordServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansTeamAudioRecordServiceImpl.java deleted file mode 100644 index 79d8c45f4..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansTeamAudioRecordServiceImpl.java +++ /dev/null @@ -1,295 +0,0 @@ -package com.accompany.business.service.anchor.impl; - -import com.accompany.business.constant.nameplate.NameplateStyleTypeEnum; -import com.accompany.business.model.anchor.*; -import com.accompany.business.mybatismapper.anchor.AnchorFansTeamAudioRecordMapper; -import com.accompany.business.param.neteasepush.NeteaseSendMsgParam; -import com.accompany.business.service.SendSysMsgService; -import com.accompany.business.service.anchor.*; -import com.accompany.business.service.netease.YidunCheckUtil; -import com.accompany.business.service.room.RoomService; -import com.accompany.business.service.user.UsersService; -import com.accompany.business.vo.anchor.AnchorFansTeamAudioRecordVo; -import com.accompany.business.vo.anchor.AnchorFansTeamMessageVo; -import com.accompany.common.config.SystemConfig; -import com.accompany.common.constant.Attach; -import com.accompany.common.constant.Constant; -import com.accompany.common.netease.ErBanNetEaseService; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.UUIDUtil; -import com.accompany.core.enumeration.I18nAlertEnum; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.model.Room; -import com.accompany.core.model.Users; -import com.accompany.core.service.common.JedisService; -import com.accompany.core.util.I18NMessageSourceUtil; -import com.accompany.core.vo.user.UserNameplateVo; -import com.alibaba.fastjson.JSON; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.google.gson.Gson; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Lazy; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.Date; -import java.util.List; -import java.util.Map; - -@Slf4j -@Service -public class AnchorFansTeamAudioRecordServiceImpl extends ServiceImpl implements AnchorFansTeamAudioRecordService { - - @Autowired - private SendSysMsgService sendSysMsgService; - @Autowired - private UsersService usersService; - @Autowired - private AnchorFansTeamAudioRecordMapper anchorFansTeamAudioRecordMapper; - @Autowired - @Lazy - private AnchorFansTeamService anchorFansTeamService; - @Autowired - private JedisService jedisService; - @Autowired - private RoomService roomService; - @Autowired - private ErBanNetEaseService erBanNetEaseService; - @Autowired - private AnchorFansPrivilegeConfigService anchorFansPrivilegeConfigService; - @Autowired - private AnchorFansTeamMpPicService anchorFansTeamMpPicService; - @Autowired - private AnchorFansTeamMemberService anchorFansTeamMemberService; - - private Gson gson = new Gson(); - - @Override - public PageInfo getRecordList(Integer pageNumber, Integer pageSize, Long erbanNo) { - Long uid = null; - if(erbanNo != null){ - Users users = usersService.getUserByErbanNo(erbanNo); - if(users == null){ - throw new ServiceException("账号不存在"); - } - uid = users.getUid(); - } - PageHelper.startPage(pageNumber, pageSize); - List recordVoList = anchorFansTeamAudioRecordMapper.getUserAuditRecord(uid); - PageInfo info = new PageInfo<>(recordVoList); - return info; - } - - @Override - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - public void nameplateAuditPass(Byte status, Long pid, String message, int adminId) { - AnchorFansTeamAudioRecord record = this.getById(pid); - Long uid = record.getUid(); - String mpTx = record.getMpTx(); - Long teamId = record.getTeamId(); - AnchorFansTeam team = anchorFansTeamService.getById(teamId); - - String lockKey = RedisKey.anchor_fans_team_mp_apply_lock.getKey(teamId.toString()); - String lockVal = jedisService.lock(lockKey,10 * 1000); - if (StringUtils.isEmpty(lockVal)) { - throw new ServiceException(BusiStatus.SERVERBUSY); - } - try{ - if(status == 1){ - sendUserNameplateMsg(uid, I18NMessageSourceUtil.getMessage(I18nAlertEnum.ANCHOR_FANS_TEAM_USER_NAMEPLATE_NOT_PASS, new Object[]{message}, uid)); - - // 更新粉丝团状态 - team.setStatus(Constant.AnchorFansTeamStatus.no_pass); - team.setUpdateTime(new Date()); - anchorFansTeamService.updateById(team); - // 设置红点提示 - String key = RedisKey.anchor_red_point_pop.getKey(); - jedisService.hdel(key, uid.toString()); - }else{ - - // 审核通过, 生成粉丝团铭牌 - // 确认铭牌文案是否唯一 - boolean isRepeat = anchorFansTeamService.hasAnchorFansTeamByName(mpTx); - if (isRepeat) { - throw new ServiceException(BusiStatus.THE_CURRENT_NAMEPLATE_COPY_HAS_BEEN_USED_BY_ANOTHER_ANCHOR); - } - // 更新粉丝团状态 - team.setStatus(Constant.AnchorFansTeamStatus.vaild); - team.setUpdateTime(new Date()); - anchorFansTeamService.updateById(team); - - // 生成更新粉丝团铭牌图片 - anchorFansTeamService.generateAnchorFansTeamMpPic(teamId,mpTx,record.getPrivilegeId(),uid); - sendUserNameplateMsg(uid,"你申請的粉絲團已通過審核並開通,快去邀請粉絲進團吧!"); - } - - record.setAuditType(status); - record.setRemark(message); - record.setUpdateTime(new Date()); - this.updateById(record); - - AnchorFansTeamMessageVo vo = new AnchorFansTeamMessageVo(); - vo.setUid(uid); - Users users = usersService.getUsersByUid(uid); - if (users != null) { - vo.setNickname(users.getNick()); - } - sendOpenFansTeamMessage(record.getUid(),vo,status); - } catch (ServiceException e1) { - log.error("审核通过粉丝团铭牌生成失败,teamUid:{},mpTx:{},",team.getUid(),mpTx,e1); - throw new ServiceException(BusiStatus.SERVERBUSY,e1.getMessage()); - } catch (Exception e){ - log.error("审核通过粉丝团铭牌生成失败,teamUid:{},mpTx:{},",team.getUid(),mpTx,e); - throw new ServiceException(BusiStatus.SERVERBUSY,e.getMessage()); - }finally { - jedisService.unlock(lockKey, lockVal); - } - - } - - @Override - @Transactional - public void uploadFansTeamMp(Long uid, String mpTx) { - if (uid == null) { - throw new ServiceException(BusiStatus.PARAMETERILLEGAL); - } - if (StringUtils.isBlank(mpTx)) { - throw new ServiceException(BusiStatus.THE_COPY_CANNOT_BE_EMPTY); - } - if(mpTx.length() != 4) { - throw new ServiceException(BusiStatus.PLEASE_ENTER_FOUR_TEXT_LENGTH_COPY_ATTRIBUTES); - } - if (YidunCheckUtil.checkHasSensitiveWord(mpTx)) { - throw new ServiceException(BusiStatus.THE_CURRENT_COPY_CONTAINS_SENSITIVE_VOCABULARY_PLEASE_CONFIRM_AND_RE_ENTER); - } - - Users users = usersService.getUsersByUid(uid); - if (users == null) { - throw new ServiceException(BusiStatus.USERNOTEXISTS); - } - - AnchorFansTeam team = anchorFansTeamService.getAnchorFansTeamByUid(uid); - String oldMpTx = team.getTeamName(); - if (team == null) { - throw new ServiceException(BusiStatus.THE_USER_HAS_NOT_OPENED_A_FAN_GROUP); - } - - // 审核通过, 生成粉丝团铭牌 - // 确认铭牌文案是否唯一 - boolean isRepeat = anchorFansTeamService.hasAnchorFansTeamByName(mpTx); - if (isRepeat) { - throw new ServiceException("当前铭牌文案已被其他主播使用~"); - } - - AnchorFansTeamMpPic mpPic = anchorFansTeamMpPicService.getLevelMpPicsByGuardsTeamIdAndLevelSeq(team.getId(), 1); - Integer privilegeId = mpPic.getPrivilegeId(); - AnchorFansPrivilegeConfig config = anchorFansPrivilegeConfigService.getById(privilegeId); - if (config == null || !Constant.AnchorFansTeamPrivilegeType.nameplate.equals(config.getType())) { - throw new ServiceException(BusiStatus.THE_CURRENT_NAMEPLATE_PRIVILEGE_DOES_NOT_EXIST); - } - - String lockKey = RedisKey.anchor_fans_team_mp_apply_lock.getKey(team.getId().toString()); - String lockVal = jedisService.lock(lockKey,10 * 1000); - if (StringUtils.isEmpty(lockVal)) { - throw new ServiceException(BusiStatus.SERVERBUSY); - } - try{ - // 更新粉丝团名称+缓存 - team.setTeamName(mpTx); - team.setUpdateTime(new Date()); - anchorFansTeamService.saveOrUpdate(team); - jedisService.hset(RedisKey.anchor_fans_team_info.getKey(),uid.toString(),gson.toJson(team)); - - // 生成并更新粉丝团铭牌信息 - anchorFansTeamService.generateAnchorFansTeamMpPicAndMemberPic(Constant.AnchorFansMemberMpStatus.negative,config.getId(),null,team.getId(),oldMpTx); - anchorFansTeamService.generateAnchorFansTeamMpPicAndMemberPic(Constant.AnchorFansMemberMpStatus.active,config.getId(),null,team.getId(),oldMpTx); - anchorFansTeamService.generateAnchorFansTeamMpPicAndMemberPic(Constant.AnchorFansMemberMpStatus.narmal,config.getId(),config.getNormalId(), team.getId(),oldMpTx); - - // 更新用户铭牌缓存 - Map result = jedisService.hgetAll(RedisKey.user_using_nameplate.getKey()); - // key为uid - for (String key : result.keySet()) { - UserNameplateVo vo = gson.fromJson(result.get(key), UserNameplateVo.class); - if (vo != null && vo.getType() != null && vo.getType().equals(NameplateStyleTypeEnum.ANCHOR_FANS_MP_SEND.getValue()) - && vo.getFixedWord().equals(oldMpTx)) { // 这里缓存使用的是旧的铭牌文案(即旧的粉丝团名称 team.getTeamName()) - AnchorFansTeamMember member = anchorFansTeamMemberService.getTeamFansByMemberUidCash(team.getUid(), vo.getUid()); - if (member != null) { - // 获取对应状态对应等级铭牌图片 - String pic = anchorFansTeamService.getAnchorFansMpPicWithMemberStatus(team.getUid(),member.getMemberUid()); - if (StringUtils.isEmpty(pic)) { - continue; - } - vo.setNameplateId(config.getNormalId()); - vo.setNameplateImage(pic); - vo.setFixedWord(mpTx); - vo.setNameplateName(mpTx); - // 更新穿戴铭牌状态 - jedisService.hset(RedisKey.user_using_nameplate.getKey(), key, this.gson.toJson(vo)); - jedisService.hdel(RedisKey.user.getKey(), key); - jedisService.hdel(RedisKey.user_summary.getKey(), key); - } - } - } - } catch (ServiceException e1) { - log.error("审核通过粉丝团铭牌生成失败,teamUid:{},mpTx:{},",team.getUid(),mpTx,e1); - throw new ServiceException(BusiStatus.SERVERBUSY,e1.getMessage()); - } catch (Exception e){ - log.error("审核通过粉丝团铭牌生成失败,teamUid:{},mpTx:{},",team.getUid(),mpTx,e); - throw new ServiceException(BusiStatus.SERVERBUSY,e.getMessage()); - }finally { - jedisService.unlock(lockKey, lockVal); - } - - } - - - /** - * 开通粉丝团消息 - */ - private void sendOpenFansTeamMessage (Long roomUid, AnchorFansTeamMessageVo vo, Byte aduioType) { - Attach attach = new Attach(); - attach.setFirst(Constant.DefineProtocol.ANHCOTR_FANS_TEAM); - if (aduioType == 1) { - attach.setSecond(Constant.DefineProtocol.ANHCOTR_FANS_VERIFY_NO_PASS); - } else { - attach.setSecond(Constant.DefineProtocol.ANHCOTR_FANS_TEAM_VERIFY_PASS); - } - attach.setData(vo); - try { - log.info("发送开通粉丝团房间消息, roomUid {} uid {}", roomUid, roomUid); - Room room = roomService.getRoomByUid(roomUid); - if (null != room) { - sendSingleRoomMsg(room.getRoomId(), roomUid, JSON.toJSONString(attach)); - } } catch (Exception e) { - log.error("发送开通粉丝团消息房间消息失败, roomUid :" + roomUid + ", uid :" + roomUid, e); - } - } - - /** - * 单个房间公屏消息 - * @param roomId 房间id - * @param roomUid 房间uid - * @param msg - * @throws Exception - */ - private void sendSingleRoomMsg(Long roomId, Long roomUid, final String msg) throws Exception { - erBanNetEaseService.sendChatRoomMsg(roomId, UUIDUtil.get(), roomUid.toString(), Constant.DefineProtocol.CUSTOM_MESS_DEFINE, msg); - } - - @Async - public void sendUserNameplateMsg(Long uid,String message) { - NeteaseSendMsgParam msg = new NeteaseSendMsgParam(); - msg.setOpe(0); - msg.setType(0); - msg.setFrom(SystemConfig.secretaryUid); - msg.setTo(String.valueOf(uid)); - msg.setBody(message); - sendSysMsgService.sendMsg(msg); - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansTeamMemberServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansTeamMemberServiceImpl.java deleted file mode 100644 index a8cbeb6f6..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansTeamMemberServiceImpl.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.accompany.business.service.anchor.impl; - -import com.accompany.business.model.anchor.AnchorFansTeam; -import com.accompany.business.model.anchor.AnchorFansTeamMember; -import com.accompany.business.model.anchor.AnchorFansTeamMpPic; -import com.accompany.business.mybatismapper.anchor.AnchorFansTeamMemberMapper; -import com.accompany.business.service.anchor.AnchorFansTeamMemberService; -import com.accompany.business.service.anchor.AnchorFansTeamMpPicService; -import com.accompany.business.service.anchor.AnchorFansTeamService; -import com.accompany.business.vo.anchor.AnchorFansMemberVo; -import com.accompany.common.constant.Constant; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.utils.StringUtils; -import com.accompany.core.service.common.JedisService; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.google.gson.Gson; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Lazy; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -@Slf4j -@Service -public class AnchorFansTeamMemberServiceImpl extends ServiceImpl implements AnchorFansTeamMemberService { - - @Autowired - @Lazy - private JedisService jedisService; - - private Gson gson = new Gson(); - - @Autowired - @Lazy - private AnchorFansTeamService anchorFansTeamService; - @Autowired - private AnchorFansTeamMemberMapper anchorFansTeamMemberMapper; - @Autowired - private AnchorFansTeamMpPicService anchorFansTeamMpPicService; - - @Override - public long getTeamMemberCountByTeamId(Long teamId) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.lambda().eq(AnchorFansTeamMember::getTeamId,teamId).eq(AnchorFansTeamMember::getStatus, Constant.GlobalStatus.valid); - return baseMapper.selectCount(wrapper); - } - - @Override - public Boolean hasTeamFansByMemberUid(Long teamUid, Long memberUid) { - return getTeamFansByMemberUid(teamUid,memberUid) != null; - } - - @Override - public AnchorFansTeamMember getTeamFansByMemberUidCash(Long teamUid, Long memberUid) { - String key = RedisKey.anchor_fans_team_member_info.getKey(teamUid.toString()); - String memberStr = jedisService.hget(key, memberUid.toString()); - if (StringUtils.isNotBlank(memberStr)) { - return gson.fromJson(memberStr,AnchorFansTeamMember.class); - } - return null; - } - - @Override - public List getTeamMemberListByTeamIdFromDB(Long teamId) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.lambda().eq(AnchorFansTeamMember::getTeamId,teamId) - .eq(AnchorFansTeamMember::getStatus, Constant.GlobalStatus.valid); - return baseMapper.selectList(wrapper); - } - - @Override - public AnchorFansTeamMember getTeamFansByMemberUid(Long teamUid, Long memberUid) { - String key = RedisKey.anchor_fans_team_member_info.getKey(teamUid.toString()); - String memberStr = jedisService.hget(key, memberUid.toString()); - if (StringUtils.isNotBlank(memberStr)) { - return gson.fromJson(memberStr,AnchorFansTeamMember.class); - } - - AnchorFansTeam team = anchorFansTeamService.getAnchorFansTeamByUid(teamUid); - if (team == null ){ - return null; - } - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.lambda().eq(AnchorFansTeamMember::getTeamId,team.getId()). - eq(AnchorFansTeamMember::getMemberUid,memberUid) - .eq(AnchorFansTeamMember::getStatus, Constant.GlobalStatus.valid); - AnchorFansTeamMember member = baseMapper.selectOne(wrapper); - if (member != null) { - jedisService.hset(key,memberUid.toString(),gson.toJson(member)); - } - return member; - } - - @Override - public List getFansMemberVoByTeamId(Long teamId, Integer pageNum, Integer pageSize) { - int beginIndex = (pageNum - 1) * pageSize; - AnchorFansTeam team = anchorFansTeamService.getById(teamId); - List memberVos = anchorFansTeamMemberMapper.getFansMemberVoByTeamId(teamId,beginIndex,pageSize); - for (AnchorFansMemberVo memberVo : memberVos) { - memberVo.setTeamUid(team.getUid()); - AnchorFansTeamMpPic mpPic = anchorFansTeamMpPicService.getLevelMpPicsByGuardsTeamIdAndLevelSeq(team.getId(), memberVo.getLevelSeq()); - if (mpPic != null) { - memberVo.setNameplateImage(mpPic.getFansMpPic()); - } - } - return memberVos; - } - - @Override - public List getTeamMemberListByTeamId(Long teamId) { - AnchorFansTeam team = anchorFansTeamService.getAnchorFansTeamByTeamId(teamId); - if (team == null) { - return new ArrayList<>(); - } - String key = RedisKey.anchor_fans_team_member_info.getKey(team.getUid().toString()); - Map memberMap = jedisService.hgetAll(key); - if (memberMap != null && memberMap.size() > 0) { - return memberMap.values().stream().map(it -> gson.fromJson(it,AnchorFansTeamMember.class)).collect(Collectors.toList()); - } - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.lambda().eq(AnchorFansTeamMember::getTeamId,teamId).eq(AnchorFansTeamMember::getStatus,Constant.GlobalStatus.valid); - return baseMapper.selectList(wrapper); - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansTeamMpPicServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansTeamMpPicServiceImpl.java deleted file mode 100644 index 2e1b0a9e1..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansTeamMpPicServiceImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.accompany.business.service.anchor.impl; - -import com.accompany.business.model.anchor.AnchorFansTeamMpPic; -import com.accompany.business.mybatismapper.anchor.AnchorFansTeamMpPicMapper; -import com.accompany.business.service.anchor.AnchorFansTeamMpPicService; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Lazy; -import org.springframework.stereotype.Service; - -import java.util.List; - -@Slf4j -@Service -public class AnchorFansTeamMpPicServiceImpl extends ServiceImpl implements AnchorFansTeamMpPicService { - - @Autowired - @Lazy - private AnchorFansTeamMpPicMapper anchorFansTeamMpPicMapper; - - @Override - public List getLevelMpPicsByGuardsTeamId(Long teamId) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.lambda().eq(AnchorFansTeamMpPic::getTeamId,teamId); - return baseMapper.selectList(wrapper); - } - - @Override - public void saveBatchAnchorFansTeamMpPicList(List mpPicList) { - anchorFansTeamMpPicMapper.saveBatchAnchorFansTeamMpPicList(mpPicList); - } - - @Override - public void updateBatchAnchorFansTeamMpPicList(List mpPicList) { - anchorFansTeamMpPicMapper.updateBatchAnchorFansTeamMpPicList(mpPicList); - } - - @Override - public AnchorFansTeamMpPic getLevelMpPicsByGuardsTeamIdAndLevelSeq(Long teamId, Integer levelSeq) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.lambda().eq(AnchorFansTeamMpPic::getTeamId,teamId).eq(AnchorFansTeamMpPic::getLevelSeq,levelSeq); - return baseMapper.selectOne(wrapper); - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansTeamServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansTeamServiceImpl.java deleted file mode 100644 index 4ab58619d..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansTeamServiceImpl.java +++ /dev/null @@ -1,2471 +0,0 @@ -package com.accompany.business.service.anchor.impl; - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.StrUtil; -import com.accompany.business.constant.nameplate.NameplateStyleTypeEnum; -import com.accompany.business.model.Gift; -import com.accompany.business.model.Nameplate; -import com.accompany.business.model.UserNameplate; -import com.accompany.business.model.anchor.*; -import com.accompany.business.mybatismapper.NameplateMapper; -import com.accompany.business.mybatismapper.UserNameplateMapper; -import com.accompany.business.mybatismapper.anchor.AnchorFansTeamMapper; -import com.accompany.business.param.UserBackpackParam; -import com.accompany.business.param.neteasepush.NeteaseSendMsgParam; -import com.accompany.business.service.SendSysMsgService; -import com.accompany.business.service.anchor.*; -import com.accompany.business.service.api.QinniuService; -import com.accompany.business.service.follow.FansService; -import com.accompany.business.service.gift.GiftSendService; -import com.accompany.business.service.gift.GiftService; -import com.accompany.business.service.nameplate.UserNameplateService; -import com.accompany.business.service.netease.YidunCheckUtil; -import com.accompany.business.service.room.RoomService; -import com.accompany.business.service.user.UserBackpackService; -import com.accompany.business.service.user.UserInRoomService; -import com.accompany.business.service.user.UsersService; -import com.accompany.business.vo.GiftVo; -import com.accompany.business.vo.RoomVo; -import com.accompany.business.vo.anchor.*; -import com.accompany.common.config.QiNiuConfig; -import com.accompany.common.config.SystemConfig; -import com.accompany.common.constant.AnchorFansLevelExperienceArr; -import com.accompany.common.constant.Attach; -import com.accompany.common.constant.Constant; -import com.accompany.common.netease.ErBanNetEaseService; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.*; -import com.accompany.core.enumeration.FansBillObjTypeEnum; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.model.Room; -import com.accompany.core.model.Users; -import com.accompany.core.service.common.JedisService; -import com.accompany.core.vo.user.UserNameplateVo; -import com.alibaba.fastjson.JSON; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.google.gson.Gson; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.StopWatch; - -import javax.annotation.Resource; -import javax.imageio.ImageIO; -import javax.imageio.stream.ImageOutputStream; -import java.awt.*; -import java.awt.image.BufferedImage; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.text.ParseException; -import java.util.List; -import java.util.*; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.stream.Collectors; - - -@Slf4j -@Service -public class AnchorFansTeamServiceImpl extends ServiceImpl implements AnchorFansTeamService { - - private static final String DATE_PATTERN = "MMdd"; - - @Autowired - private JedisService jedisService; - @Autowired - private AnchorFansTeamMpPicService anchorFansTeamMpPicService; - @Autowired - private AnchorFansPrivilegeConfigService anchorFansPrivilegeConfigService; - @Autowired - private AnchorFansTeamAudioRecordService anchorFansTeamAudioRecordService; - @Autowired - private RoomService roomService; - @Autowired - private AnchorFansLevelExperienceService anchorFansLevelExperienceService; - @Autowired - private NameplateMapper nameplateMapper; - @Autowired - private QinniuService qinniuService; - @Autowired - private UserInRoomService userInRoomService; - - private Gson gson = new Gson(); - - @Autowired - private UserNameplateMapper userNameplateMapper; - @Autowired - private AnchorFansTeamMapper anchorFansTeamMapper; - @Autowired - private AnchorFansTeamMemberService anchorFansTeamMemberService; - @Autowired - private UsersService usersService; - @Autowired - private UserNameplateService userNameplateService; - @Autowired - private UserBackpackService userBackpackService; - @Autowired - private GiftService giftService; - @Autowired - private SendSysMsgService sendSysMsgService; - @Autowired - private AnchorFansTaskService anchorFansTaskService; - @Autowired - private ErBanNetEaseService erBanNetEaseService; - @Autowired - private AnchorFansExperRecordService anchorFansExperRecordService; - @Autowired - private FansService fansService; - @Autowired - private GiftSendService giftSendService; - @Resource(name = "async-executor") - private ThreadPoolExecutor asyncExecutor; - - - @Override - public List getApplyPrivilegeFansMpVoList() { - return anchorFansPrivilegeConfigService.getApplyPrivilegeFansMpVoList(); - } - - @Override - public void applyFansTeamMp(Long uid, Integer privilegeId, String mpTx) { - boolean flag = roomService.judgeIsSingleBroadByUid(uid); - if (!flag) { - throw new ServiceException(BusiStatus.ONLY_ANCHORS_CAN_OPEN_FAN_GROUPS); - } - - if (YidunCheckUtil.checkHasSensitiveWord(mpTx)) { - throw new ServiceException(BusiStatus.THE_CURRENT_COPY_CONTAINS_SENSITIVE_VOCABULARY_PLEASE_CONFIRM_AND_RE_ENTER); - } - - if (StringUtils.isBlank(mpTx)) { - throw new ServiceException(BusiStatus.THE_COPY_CANNOT_BE_EMPTY); - } - - if (mpTx.length() != 4) { - throw new ServiceException(BusiStatus.PLEASE_ENTER_FOUR_TEXT_LENGTH_COPY_ATTRIBUTES); - } - - AnchorFansPrivilegeConfig privilegeConfig = anchorFansPrivilegeConfigService.getById(privilegeId); - if (privilegeConfig == null || !Constant.AnchorFansTeamPrivilegeType.nameplate.equals(privilegeConfig.getType())) { - throw new ServiceException(BusiStatus.PARAMETERILLEGAL); - } - if (YidunCheckUtil.checkHasSensitiveWord(mpTx)) { - throw new ServiceException(BusiStatus.THE_CURRENT_COPY_CONTAINS_SENSITIVE_VOCABULARY_PLEASE_RE_ENTER); - } - - boolean isRepeat = hasAnchorFansTeamByName(mpTx); - if (isRepeat) { - throw new ServiceException(BusiStatus.THE_NAMEPLATE_COPY_HAS_BEEN_APPLIED_FOR_BY_ANOTHER_ANCHOR_PLEASE_CONFIRM_AND_RE_ENTER_IT); - } - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.lambda().eq(AnchorFansTeamAudioRecord::getAuditType, Constant.AnchorFansTeamMpAuditType.wait).eq(AnchorFansTeamAudioRecord::getUid, uid); - AnchorFansTeamAudioRecord record = anchorFansTeamAudioRecordService.getOne(wrapper); - if (record != null) { - throw new ServiceException(BusiStatus.THERE_ARE_CURRENTLY_FAN_GROUPS_UNDER_REVIEW_PLEASE_WAIT_FOR_REVIEW); - } - - AnchorFansTeam fansTeam = getAnchorFansTeamByUid(uid); - if (fansTeam != null) { - throw new ServiceException(BusiStatus.EACH_ANCHOR_CAN_ONLY_HAVE_ONE_FAN_GROUP); - } - - String key = RedisKey.anchor_fans_team_mp_apply_lock.getKey(uid.toString()); - String lockVal = jedisService.lock(key, 10 * 1000); - if (StringUtils.isEmpty(lockVal)) { - throw new ServiceException(BusiStatus.SERVERBUSY); - } - try { - // 主播粉丝团创建 - AnchorFansTeam team = new AnchorFansTeam(); - team.setCreateTime(new Date()); - team.setUid(uid); - team.setStatus(Constant.AnchorFansTeamStatus.verify); - team.setTeamName(mpTx); - this.save(team); - - // 保存审核记录 - AnchorFansTeamAudioRecord audioRecord = new AnchorFansTeamAudioRecord(); - audioRecord.setAuditType(Constant.AnchorFansTeamMpAuditType.wait); - audioRecord.setCreateTime(new Date()); - audioRecord.setMpTx(mpTx); - audioRecord.setUid(uid); - audioRecord.setPrivilegeId(privilegeId); - audioRecord.setTeamId(team.getId()); - anchorFansTeamAudioRecordService.save(audioRecord); - - } finally { - this.jedisService.unlock(key, lockVal); - } - } - - - @Override - public List getApplyRecordList(Long uid) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.lambda().eq(AnchorFansTeamAudioRecord::getUid, uid); - List list = anchorFansTeamAudioRecordService.list(wrapper); - List vos = new ArrayList<>(); - for (AnchorFansTeamAudioRecord record : list) { - AnchorFansTeamAudioRecordVo vo = new AnchorFansTeamAudioRecordVo(); - BeanUtils.copyProperties(record, vo); - Integer privilegeId = record.getPrivilegeId(); - AnchorFansPrivilegeConfig config = anchorFansPrivilegeConfigService.getById(privilegeId); - Nameplate nameplate = nameplateMapper.selectById(config.getNormalId()); - vo.setIcon(nameplate.getIconPic()); - vos.add(vo); - } - return vos; - } - - public Boolean hasFinishedCurrentDailyTask(Long memberUid, Long teamUid) { - - return true; - } - - - @Override - public void generateAnchorFansTeamMpPic(Long teamId, String mpTx, Integer privilegeId, Long teamUid) throws IOException { - StopWatch stopWatch = new StopWatch(); - stopWatch.start(); - - - log.info("粉丝团id:{}, 铭牌名称:{}", teamId, mpTx); - AnchorFansPrivilegeConfig privilegeConfig = anchorFansPrivilegeConfigService.getById(privilegeId); - if (!Constant.AnchorFansTeamPrivilegeType.nameplate.equals(privilegeConfig.getType())) { - log.info("对应的特权不是铭牌, 无法生成图片, 粉丝团id:{}, 铭牌名称:{} ", teamId, mpTx); - return; - } - - - Long normalId = privilegeConfig.getNormalId(); - Long activeId = privilegeConfig.getActiveId(); - Long negativeId = privilegeConfig.getNegativeId(); - if (normalId == null || activeId == null || negativeId == null) { - log.info("配置的粉丝铭牌为 null, 铭牌生成失败, 粉丝团id:{}, 铭牌名称:{} ", teamId, mpTx); - return; - } - Nameplate normalNameplate = nameplateMapper.selectById(normalId); - Nameplate activeNameplate = nameplateMapper.selectById(activeId); - Nameplate negativeNameplate = nameplateMapper.selectById(privilegeConfig.getNegativeId()); - if (normalNameplate == null || activeNameplate == null || negativeNameplate == null) { - log.info("配置的粉丝铭牌为 null, 铭牌生成失败, 粉丝团id:{}, 铭牌名称:{} ", teamId, mpTx); - return; - } - - - List levelList = anchorFansLevelExperienceService.list(); - if (CollectionUtil.isEmpty(levelList)) return; - - String curTime = DateTimeUtil.convertDate(new Date(), DATE_PATTERN); - int randomNum = (int) (Math.random() * 900) + 100; - // 获取月日 + 随机数拼接成 - randomNum = Integer.parseInt(curTime + randomNum); - Font wordFont = PicAddTextMarkUtils.loadWordFont(PicAddTextMarkUtils.ZH_EN_WORD_FONT_STYLE, 18F); - Font levelFont = PicAddTextMarkUtils.loadWordFont(PicAddTextMarkUtils.ZH_EN_ICON_FONT_STYLE, 24F); - Date date = new Date(); - // key: levelId - Map teamLevelPicMap = new LinkedHashMap<>(); - // key: levelSeq - Map nowTeamLevelMpPicMap = new LinkedHashMap<>(); - List mpPicList = anchorFansTeamMpPicService.getLevelMpPicsByGuardsTeamId(teamId); - if (CollectionUtil.isNotEmpty(mpPicList)) { - teamLevelPicMap = mpPicList.stream().collect(Collectors.toMap(AnchorFansTeamMpPic::getLevelSeq, a -> a)); - mpPicList = new ArrayList<>(); - } - if (mpPicList == null) { - mpPicList = new ArrayList<>(); - } - for (AnchorFansLevelExperience level : levelList) { - InputStream uploadStream = null; - // 更新对应的等级铭牌信息 - AnchorFansTeamMpPic mpPic = teamLevelPicMap.get(level.getLevelSeq()); - - // 常规铭牌 - try (InputStream inputStream = FileUtils.downloadFileInputStream(normalNameplate.getIconPic()); - ByteArrayOutputStream baos = new ByteArrayOutputStream(); ImageOutputStream imOut = ImageIO.createImageOutputStream(baos)) { - BufferedImage bufImg = PicAddTextAnchorFansMpMarkUtils.addTextToPic(Constant.AnchorFansMemberMpStatus.narmal, inputStream, mpTx, level.getLevelSeq(), wordFont, levelFont); - if (bufImg == null) continue; - ImageIO.write(bufImg, "png", imOut); - uploadStream = new ByteArrayInputStream(baos.toByteArray()); - String key = String.format(Constant.AnchorFansMpFileNamePrefix.prefix_mp_nomal_name, randomNum + StrUtil.UNDERLINE + teamUid + StrUtil.UNDERLINE + level.getLevelSeq() + ".png"); - qinniuService.uploadByStreamReplace(uploadStream, key, key); - - // 更新对应的等级铭牌信息 - if (mpPic != null) { - mpPic.setFansMpPic(QiNiuConfig.accessUrl + key); - mpPic.setUpdateTime(date); - } else { - mpPic = new AnchorFansTeamMpPic(); - mpPic.setFansMpPic(QiNiuConfig.accessUrl + key); - mpPic.setPrivilegeId(privilegeId); - mpPic.setLevelSeq(level.getId()); - mpPic.setTeamId(teamId); - mpPic.setCreateTime(date); - mpPic.setUpdateTime(date); - } - } catch (Exception e) { - log.error("粉丝团生成图片异常:{}", e.getMessage()); - e.printStackTrace(); - } finally { - if (uploadStream != null) uploadStream.close(); - } - - // 活跃铭牌 - try (InputStream inputStream = FileUtils.downloadFileInputStream(activeNameplate.getIconPic()); - ByteArrayOutputStream baos = new ByteArrayOutputStream(); ImageOutputStream imOut = ImageIO.createImageOutputStream(baos)) { - BufferedImage bufImg = PicAddTextAnchorFansMpMarkUtils.addTextToPic(Constant.AnchorFansMemberMpStatus.active, inputStream, mpTx, level.getLevelSeq(), wordFont, levelFont); - if (bufImg == null) continue; - ImageIO.write(bufImg, "png", imOut); - uploadStream = new ByteArrayInputStream(baos.toByteArray()); - String key = String.format(Constant.AnchorFansMpFileNamePrefix.prefix_mp_active_name, randomNum + StrUtil.UNDERLINE + teamUid + StrUtil.UNDERLINE + level.getLevelSeq() + ".png"); - qinniuService.uploadByStreamReplace(uploadStream, key, key); - - // 更新对应的等级铭牌信息 - if (mpPic != null) { - mpPic.setActiveMpPic(QiNiuConfig.accessUrl + key); - mpPic.setUpdateTime(date); - } else { - mpPic = new AnchorFansTeamMpPic(); - mpPic.setPrivilegeId(privilegeId); - mpPic.setActiveMpPic(QiNiuConfig.accessUrl + key); - mpPic.setLevelSeq(level.getId()); - mpPic.setTeamId(teamId); - mpPic.setCreateTime(date); - mpPic.setUpdateTime(date); - } - } catch (Exception e) { - log.error("粉丝团生成图片异常:{}", e.getMessage()); - e.printStackTrace(); - } finally { - if (uploadStream != null) uploadStream.close(); - } - - // 消极铭牌 - try (InputStream inputStream = FileUtils.downloadFileInputStream(negativeNameplate.getIconPic()); - ByteArrayOutputStream baos = new ByteArrayOutputStream(); ImageOutputStream imOut = ImageIO.createImageOutputStream(baos)) { - BufferedImage bufImg = PicAddTextAnchorFansMpMarkUtils.addTextToPic(Constant.AnchorFansMemberMpStatus.negative, inputStream, mpTx, level.getLevelSeq(), wordFont, levelFont); - if (bufImg == null) continue; - ImageIO.write(bufImg, "png", imOut); - uploadStream = new ByteArrayInputStream(baos.toByteArray()); - String key = String.format(Constant.AnchorFansMpFileNamePrefix.prefix_mp_negative_name, randomNum + StrUtil.UNDERLINE + teamUid + StrUtil.UNDERLINE + level.getLevelSeq() + ".png"); - qinniuService.uploadByStreamReplace(uploadStream, key, key); - - - if (mpPic != null) { - mpPic.setNegativeMpPic(QiNiuConfig.accessUrl + key); - mpPic.setUpdateTime(date); - } else { - mpPic = new AnchorFansTeamMpPic(); - mpPic.setTeamId(teamId); - mpPic.setPrivilegeId(privilegeId); - mpPic.setLevelSeq(level.getId()); - mpPic.setNegativeMpPic(QiNiuConfig.accessUrl + key); - mpPic.setCreateTime(date); - mpPic.setUpdateTime(date); - } - } catch (Exception e) { - log.error("粉丝团生成图片异常:{}", e.getMessage()); - e.printStackTrace(); - } finally { - if (uploadStream != null) uploadStream.close(); - } - - mpPicList.add(mpPic); - nowTeamLevelMpPicMap.put(level.getLevelSeq(), mpPic); - } - - // 更新/插入 - List saveGuardsMpList = mpPicList.stream().filter(it -> it != null && it.getId() == null).collect(Collectors.toList()); - if (CollectionUtil.isNotEmpty(saveGuardsMpList)) { - anchorFansTeamMpPicService.saveBatchAnchorFansTeamMpPicList(mpPicList); - } - } - - @Override - public List getJoinFansTeamList(Long memberUid) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.lambda().eq(AnchorFansTeamMember::getMemberUid, memberUid) - .eq(AnchorFansTeamMember::getStatus, Constant.GlobalStatus.valid); - List list = anchorFansTeamMemberService.list(wrapper); - - if (CollectionUtils.isEmpty(list)) { - return new ArrayList<>(); - } - - List teamIds = list.stream().map(AnchorFansTeamMember::getTeamId).collect(Collectors.toList()); - List anchorFansTeamJoinVos = anchorFansTeamMapper.searchJoinFansTeamByTeamIds(teamIds); - - for (AnchorFansTeamJoinVo vo : anchorFansTeamJoinVos) { - String nameplatePic = getAnchorFansMpPicWithMemberStatus(vo.getTeamUid(), memberUid); - vo.setIcon(nameplatePic); - } - - return anchorFansTeamJoinVos; - } - - @Override - public String getAnchorFansMpPicWithMemberStatus(Long teamUid, Long memberUid) { - AnchorFansTeamMember member = anchorFansTeamMemberService.getTeamFansByMemberUid(teamUid, memberUid); - if (member == null) { - return null; - } - - Integer levelSeq = member.getLevelSeq(); - Date monday = WeekUtil.getFirstDayOfWeek(new Date()); - Date preMonday = WeekUtil.getFirstDayOfLastWeek(new Date()); - String weekStr = DateTimeUtil.convertDate(monday, DateTimeUtil.DEFAULT_DATE_PATTERN); - String preWeekStr = DateTimeUtil.convertDate(preMonday, DateTimeUtil.DEFAULT_DATE_PATTERN); - String todayStr = DateTimeUtil.getTodayStr(); - // 当天完成所有任务key - String finsheKey = RedisKey.anchor_fans_team_complete_finished.getKey(teamUid + StrUtil.UNDERLINE + todayStr); - // 本周&&上一周 活跃key - String activeKey = RedisKey.anchor_fans_team_play_once_week.getKey(teamUid + StrUtil.UNDERLINE + weekStr); - String preActiveKey = RedisKey.anchor_fans_team_play_once_week.getKey(teamUid + StrUtil.UNDERLINE + preWeekStr); - // 本周加入粉丝团标识key - String joinSignKey = RedisKey.anchor_fans_join_sign_current_week.getKey(teamUid + StrUtil.UNDERLINE + weekStr); - - String finsheFlag = jedisService.hget(finsheKey, memberUid.toString()); - Boolean activeFlag = jedisService.sismember(activeKey, memberUid.toString()); - Boolean preActiveFlag = jedisService.sismember(preActiveKey, memberUid.toString()); - Boolean joinSignFlag = jedisService.sismember(joinSignKey, memberUid.toString()); - // 今日是否完成所有任务 是则返回炫酷铭牌 - if (StringUtils.isNotBlank(finsheFlag)) { - return getAnchorFansMpPicByType(teamUid, levelSeq, Constant.AnchorFansTaskActiveType.once_finished); - } - // 是否在 上一周/本周/本周新加入 活跃的用户中 - if (activeFlag || preActiveFlag || joinSignFlag) { - return getAnchorFansMpPicByType(teamUid, levelSeq, Constant.AnchorFansTaskActiveType.active); - } - // 消极 - return getAnchorFansMpPicByType(teamUid, levelSeq, Constant.AnchorFansTaskActiveType.negative); - } - - @Override - public void sendDesignGiftAndNameplateStatus() { - String lockKey = RedisKey.anchor_fans_send_daliy_design_gift_lock.getKey(); - String lockVal = jedisService.lock(lockKey, 10 * 1000); - if (StringUtils.isEmpty(lockVal)) { - log.info("sendDesignGiftAndNameplateStatus 每日赠送粉丝团专属礼物获取不到锁, 暂不考虑...."); - return; - } - try { - // 赠送专属礼物 更新炫酷铭牌状态 - List exclusiveGiftConfigList = anchorFansPrivilegeConfigService.getPrivilegeConfigListByType(Constant.AnchorFansTeamPrivilegeType.exclusive_gift); - - if (CollectionUtils.isEmpty(exclusiveGiftConfigList)) { - log.info("每日赠送特权礼物失败...找不到对应特权礼物赠送配置... "); - return; - } - List teams = getAllAnchorFansTeam(); - List teamIds = teams.stream().map(AnchorFansTeam::getId).collect(Collectors.toList()); - List memberUidList = getAllAnchorFansTeamMemberUidsByTeamIds(teamIds); - - // 赠送入团礼物 - for (AnchorFansPrivilegeConfig exclusiveGiftConfig : exclusiveGiftConfigList) { - Integer giftId = exclusiveGiftConfig.getNormalId().intValue(); - Gift gift = giftService.getGiftByIdFromDb(giftId); - String key = RedisKey.anchor_fans_team_daily_sys_send_design_gift.getKey(DateTimeUtil.getTodayStr() + StrUtil.UNDERLINE + giftId); - - for (Long memberUid : memberUidList) { - asyncExecutor.execute(() -> { - UserBackpackParam param = new UserBackpackParam(); - param.setGiftId(giftId); - param.setGiftType(gift.getGiftType()); - param.setUid(memberUid); - param.setCount(Constant.AnchorFansTeamDefaultVal.join_fans_team_gift_num); - param.setGiftSeq(gift.getSeqNo()); - - // 赠送入团礼物 - // 系统每日赠送入团礼物标识 - if (!jedisService.exits(key)) { - userBackpackService.saveOrUpdateUserBackpackByFansDesignGift(param); - jedisService.sadd(key, memberUid.toString()); - jedisService.expire(key, 24 * 60 * 60); - - // 发送小秘书消息 - sendUserNameplateMsg(memberUid, Constant.AnchorFansTeamDefaultVal.send_daily_design_gift); - } else { - boolean exist = jedisService.sismember(key, memberUid.toString()); - if (!exist) { - userBackpackService.saveOrUpdateUserBackpackByFansDesignGift(param); - jedisService.sadd(key, memberUid.toString()); - - // 发送小秘书消息 - sendUserNameplateMsg(memberUid, Constant.AnchorFansTeamDefaultVal.send_daily_design_gift); - } - } - }); - } - - String usingNameplateKey = RedisKey.user_using_nameplate.getKey(); - // 铭牌图片设置: 穿戴的炫酷铭牌恢复常态 / 当前周没有活跃 设置为消极状态 - for (AnchorFansTeam team : teams) { - asyncExecutor.execute(() -> { - List members = anchorFansTeamMemberService.getTeamMemberListByTeamId(team.getId()); - for (AnchorFansTeamMember member : members) { - UserNameplateVo nameplateVo = userNameplateService.getUserUsingNameplateVo(member.getMemberUid()); - if (nameplateVo == null) { - continue; - } - // 穿戴的是否为当前粉丝团铭牌 - if (nameplateVo.getType() != null && nameplateVo.getType().equals(NameplateStyleTypeEnum.ANCHOR_FANS_MP_SEND.getValue()) - && nameplateVo.getFixedWord().equals(team.getTeamName())) { - String mpPic = getAnchorFansMpPicWithMemberStatus(team.getUid(), member.getMemberUid()); - if (StringUtils.isNotBlank(mpPic)) { - nameplateVo.setNameplateImage(mpPic); - jedisService.hset(usingNameplateKey, member.getMemberUid().toString(), gson.toJson(nameplateVo)); - jedisService.hdel(RedisKey.user_summary.getKey(), member.getMemberUid().toString()); - } - } - } - }); - } - } - } catch (Exception e) { - log.error("粉丝团每日赠送专属礼物失败..... date {}", DateTimeUtil.getTodayStr(), e); - } finally { - jedisService.unlock(lockKey, lockVal); - } - - } - - @Override - public List getAllAnchorFansTeamMemberUidsByTeamIds(List teamIds) { - List teams = getAllAnchorFansTeam(); - List memberUidList = new ArrayList<>(); - List uids = new ArrayList<>(); - for (AnchorFansTeam team : teams) { - List memberList = anchorFansTeamMemberService.getTeamMemberListByTeamId(team.getId()); - uids = memberList.stream().map(AnchorFansTeamMember::getMemberUid).collect(Collectors.toList()); - if (CollectionUtil.isNotEmpty(uids)) { - memberUidList.addAll(uids); - } - } - return memberUidList.stream().distinct().collect(Collectors.toList()); - } - - @Override - public List getUseMpPrivilegeConfigByPrivilegeId(Integer privilegeId) { - return anchorFansTeamMapper.getUseMpPrivilegeConfigByPrivilegeId(privilegeId); - } - - @Override - @Async - public void generateAllAnchorFansTeamMpPicAndMemberPic(Byte mpStatus, Integer privilegeId, Long oldNameplateId) throws IOException { - // 获取所有使用本特权的团队, 批量更新对应的等级图片, 查询当前的所有成员 更新对应的铭牌图片 如果穿戴了该铭牌 再更新其铭牌 - List teamIds = getUseMpPrivilegeConfigByPrivilegeId(privilegeId); - if (CollectionUtils.isEmpty(teamIds)) { - log.info("当前铭牌特权无正在使用的粉丝团, 无需进行更新操作...,privilegeId:{}", privilegeId); - } - // 更新团队图片 - StopWatch stopWatch = new StopWatch(); - stopWatch.start(); - - for (Long teamId : teamIds) { - AnchorFansTeam team = getAnchorFansTeamByTeamId(teamId); - if (team == null) { - log.info("该粉丝团不存在或已删除, 粉丝团id:{}", teamId); - return; - } - - String mpTx = team.getTeamName(); - log.info("粉丝团id:{}, 铭牌名称:{}", teamId, mpTx); - - AnchorFansPrivilegeConfig privilegeConfig = anchorFansPrivilegeConfigService.getById(privilegeId); - if (!Constant.AnchorFansTeamPrivilegeType.nameplate.equals(privilegeConfig.getType())) { - log.info("对应的特权不是铭牌, 无法生成图片, 粉丝团id:{}, 铭牌名称:{} ", teamId, mpTx); - return; - } - - - Long normalId = privilegeConfig.getNormalId(); - Long activeId = privilegeConfig.getActiveId(); - Long negativeId = privilegeConfig.getNegativeId(); - List nameplateIds = Arrays.asList(normalId, activeId, negativeId); - if (normalId == null || activeId == null || negativeId == null) { - log.info("粉丝铭牌特权配置的粉丝铭牌为 null, 铭牌生成失败, 粉丝团id:{}, 铭牌名称:{} ", teamId, mpTx); - return; - } - - Nameplate normalNameplate = nameplateMapper.selectById(normalId); - Nameplate activeNameplate = nameplateMapper.selectById(activeId); - Nameplate negativeNameplate = nameplateMapper.selectById(privilegeConfig.getNegativeId()); - if (normalNameplate == null || activeNameplate == null || negativeNameplate == null) { - log.info("配置的粉丝铭牌为 null, 铭牌生成失败, 粉丝团id:{}, 铭牌名称:{} ", teamId, mpTx); - return; - } - - String icon = null; - String preName = null; - if (Constant.AnchorFansMemberMpStatus.negative.equals(mpStatus)) { - icon = negativeNameplate.getIconPic(); - preName = Constant.AnchorFansMpFileNamePrefix.prefix_mp_negative_name; - } else if (Constant.AnchorFansMemberMpStatus.active.equals(mpStatus)) { - icon = activeNameplate.getIconPic(); - preName = Constant.AnchorFansMpFileNamePrefix.prefix_mp_active_name; - } else if (Constant.AnchorFansMemberMpStatus.narmal.equals(mpStatus)) { - icon = normalNameplate.getIconPic(); - preName = Constant.AnchorFansMpFileNamePrefix.prefix_mp_nomal_name; - } - - List levelList = anchorFansLevelExperienceService.list(); - if (CollectionUtil.isEmpty(levelList)) return; - - String curTime = DateTimeUtil.convertDate(new Date(), DATE_PATTERN); - int randomNum = (int) (Math.random() * 900) + 100; - // 获取月日 + 随机数拼接成 - randomNum = Integer.parseInt(curTime + randomNum); - Font wordFont = PicAddTextMarkUtils.loadWordFont(PicAddTextMarkUtils.ZH_EN_WORD_FONT_STYLE, 18F); - Font levelFont = PicAddTextMarkUtils.loadWordFont(PicAddTextMarkUtils.ZH_EN_ICON_FONT_STYLE, 24F); - Date date = new Date(); - // key: levelId - Map teamLevelPicMap = new LinkedHashMap<>(); - // key: levelSeq - Map nowTeamLevelMpPicMap = new LinkedHashMap<>(); - List mpPicList = anchorFansTeamMpPicService.getLevelMpPicsByGuardsTeamId(teamId); - if (CollectionUtil.isNotEmpty(mpPicList)) { - teamLevelPicMap = mpPicList.stream().collect(Collectors.toMap(AnchorFansTeamMpPic::getLevelSeq, a -> a)); - mpPicList = new ArrayList<>(); - } - for (AnchorFansLevelExperience level : levelList) { - InputStream uploadStream = null; - // 更新对应的等级铭牌信息 - AnchorFansTeamMpPic mpPic = teamLevelPicMap.get(level.getLevelSeq()); - - try (InputStream inputStream = FileUtils.downloadFileInputStream(icon); - ByteArrayOutputStream baos = new ByteArrayOutputStream(); ImageOutputStream imOut = ImageIO.createImageOutputStream(baos)) { - BufferedImage bufImg = PicAddTextAnchorFansMpMarkUtils.addTextToPic(mpStatus, inputStream, mpTx, level.getLevelSeq(), wordFont, levelFont); - if (bufImg == null) continue; - ImageIO.write(bufImg, "png", imOut); - uploadStream = new ByteArrayInputStream(baos.toByteArray()); - String key = String.format(preName, randomNum + StrUtil.UNDERLINE + team.getUid() + StrUtil.UNDERLINE + level.getLevelSeq() + ".png"); - qinniuService.uploadByStreamReplace(uploadStream, key, key); - - // 更新对应的等级铭牌信息 - if (mpPic != null) { - if (Constant.AnchorFansMemberMpStatus.negative.equals(mpStatus)) { - mpPic.setNegativeMpPic(QiNiuConfig.accessUrl + key); - } else if (Constant.AnchorFansMemberMpStatus.active.equals(mpStatus)) { - mpPic.setActiveMpPic(QiNiuConfig.accessUrl + key); - } else if (Constant.AnchorFansMemberMpStatus.narmal.equals(mpStatus)) { - mpPic.setFansMpPic(QiNiuConfig.accessUrl + key); - } - - mpPic.setUpdateTime(date); - } else { - mpPic = new AnchorFansTeamMpPic(); - if (Constant.AnchorFansMemberMpStatus.negative.equals(mpStatus)) { - mpPic.setNegativeMpPic(QiNiuConfig.accessUrl + key); - } else if (Constant.AnchorFansMemberMpStatus.active.equals(mpStatus)) { - mpPic.setActiveMpPic(QiNiuConfig.accessUrl + key); - } else if (Constant.AnchorFansMemberMpStatus.narmal.equals(mpStatus)) { - mpPic.setFansMpPic(QiNiuConfig.accessUrl + key); - } - mpPic.setPrivilegeId(privilegeId); - mpPic.setLevelSeq(level.getId()); - mpPic.setTeamId(teamId); - mpPic.setCreateTime(date); - mpPic.setUpdateTime(date); - } - } catch (Exception e) { - log.error("粉丝团生成图片异常:{}", e.getMessage()); - e.printStackTrace(); - } finally { - if (uploadStream != null) uploadStream.close(); - } - - mpPicList.add(mpPic); - nowTeamLevelMpPicMap.put(level.getLevelSeq(), mpPic); - } - - - // 更新/插入 - List saveGuardsMpList = mpPicList.stream().filter(it -> it.getId() == null).collect(Collectors.toList()); - List updateGuardsMpList = mpPicList.stream().filter(it -> it.getId() != null).collect(Collectors.toList()); - if (CollectionUtil.isNotEmpty(saveGuardsMpList)) { - anchorFansTeamMpPicService.saveBatchAnchorFansTeamMpPicList(saveGuardsMpList); - } - if (CollectionUtil.isNotEmpty(updateGuardsMpList)) { - anchorFansTeamMpPicService.updateBatchAnchorFansTeamMpPicList(updateGuardsMpList); - - if (mpStatus.equals(Constant.AnchorFansMemberMpStatus.narmal) && oldNameplateId != null) { - // 更新成员铭牌数据 - List members = anchorFansTeamMemberService.getTeamMemberListByTeamId(teamId); - // 获取napelateId 和 word 一致的铭牌 - List userNameplates = userNameplateMapper.getUserFansNampelateByUids(oldNameplateId, team.getTeamName()); - Map nameplateMap = userNameplates.stream().collect(Collectors.toMap(UserNameplate::getUid, a -> a)); - List saveOrUpdateNameplates = new ArrayList<>(); - for (AnchorFansTeamMember member : members) { - UserNameplate userNameplate = nameplateMap.get(member.getMemberUid()); - UserNameplate nameplate = new UserNameplate(); - AnchorFansTeamMpPic mpPic = anchorFansTeamMpPicService.getLevelMpPicsByGuardsTeamIdAndLevelSeq(teamId, member.getLevelSeq()); - if (mpPic == null) { - log.info("获取不到对应的成员等级铭牌:memberUid:{},teamUid:{}", member.getMemberUid(), team.getUid()); - continue; - } - if (userNameplate != null) { - // 更新数据数据 - nameplate.setId(userNameplate.getId()); - nameplate.setUpdateTime(date); - } else { - // 保险起见 是其成员,却无对应铭牌 则生成一个 - nameplate.setType(Constant.namePlateType.ANCHOR_FANS_TEAM_SEND); - nameplate.setUpdateTime(date); - nameplate.setCreateTime(date); - nameplate.setWord(team.getTeamName()); - nameplate.setExpireTime(DateTimeUtil.addDays(new Date(), Constant.AnchorFansTeamDefaultVal.expireDays)); - nameplate.setUid(member.getMemberUid()); - } - nameplate.setNameplateId(normalId); - nameplate.setNameplateImage(mpPic.getFansMpPic()); - saveOrUpdateNameplates.add(nameplate); - } - - // 更新/插入 - List saveUserMpList = saveOrUpdateNameplates.stream().filter(it -> it.getId() == null).collect(Collectors.toList()); - List updateUserMpList = saveOrUpdateNameplates.stream().filter(it -> it.getId() != null).collect(Collectors.toList()); - if (CollectionUtil.isNotEmpty(saveUserMpList)) { - userNameplateMapper.batchSaveUserNameplateList(saveUserMpList); - } - if (CollectionUtil.isNotEmpty(updateUserMpList)) { - userNameplateMapper.batchUpdateUserNameplateList(updateUserMpList); - } - } - } - - // 更新用户铭牌缓存 - Map result = jedisService.hgetAll(RedisKey.user_using_nameplate.getKey()); - // key为uid - for (String key : result.keySet()) { - UserNameplateVo vo = gson.fromJson(result.get(key), UserNameplateVo.class); - if (vo != null && vo.getType() != null && vo.getType().equals(NameplateStyleTypeEnum.ANCHOR_FANS_MP_SEND.getValue()) - && vo.getFixedWord().equals(team.getTeamName())) { - AnchorFansTeamMember member = anchorFansTeamMemberService.getTeamFansByMemberUidCash(team.getUid(), vo.getUid()); - if (member != null) { - // 获取对应状态对应等级铭牌图片 - String pic = getAnchorFansMpPicWithMemberStatus(team.getUid(), member.getMemberUid()); - if (StringUtils.isEmpty(pic)) { - continue; - } - vo.setNameplateId(normalId); - vo.setNameplateImage(pic); - // 更新穿戴铭牌状态 - jedisService.hset(RedisKey.user_using_nameplate.getKey(), key, this.gson.toJson(vo)); - jedisService.hdel(RedisKey.user.getKey(), key); - jedisService.hdel(RedisKey.user_summary.getKey(), key); - } - } - } - } - stopWatch.stop(); - - log.info("用户铭牌数据更新完成..."); - log.info("{}", stopWatch.prettyPrint()); - } - - @Override - public Object sendJoinTeamGift(Long sendUid, Long[] receiveUids, Long roomUid, int giftId, int giftNum, String msg, byte giftSource, byte sendType) throws Exception { - Long receiveUid = receiveUids[0]; - AnchorFansTeam team = getAnchorFansTeamByUid(receiveUid); - if (team == null) { - throw new ServiceException(BusiStatus.THE_CURRENT_FAN_GROUP_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED); - } - - if (team.getUid().equals(sendUid)) { - throw new ServiceException(BusiStatus.CANNOT_JOIN_YOUR_OWN_FAN_GROUP); - } - - Boolean flag = anchorFansTeamMemberService.hasTeamFansByMemberUid(team.getUid(), sendUid); - if (flag) { - throw new ServiceException(BusiStatus.CURRENT_FANS_TEAM_IS_JOINED); - } - - // 是否在用户退出该粉丝团重新加入的限制期 - String limitJoinKey = RedisKey.anchor_fans_team_join_limit.getKey(team.getUid() + StrUtil.UNDERLINE + sendUid); - if (jedisService.exits(limitJoinKey)) { - log.info("当前用户正在加入该粉丝团的限制期内,无法加入....粉丝团主播uid:{},用户uid:{}", team.getUid(), sendUid); - throw new ServiceException(BusiStatus.JOIN_FANS_TEAM_LIMIT); - } - - // 设置加入粉丝团的缓存锁 避免监听器还未处理结束对应的入团操作 - String sendJoinGiftSignKey = RedisKey.anchor_fans_send_join_gift_sign.getKey(team.getUid() + StrUtil.UNDERLINE + sendUid); - String sendJoinGiftSignVal = jedisService.get(sendJoinGiftSignKey); - if (StringUtils.isNotBlank(sendJoinGiftSignVal)) { - throw new ServiceException(BusiStatus.SERVERBUSY); - } - - String key = RedisKey.anchor_fans_send_join_gift_lock.getKey(sendUid + StrUtil.UNDERLINE + receiveUid); - String lockVal = jedisService.lock(key, 10 * 1000); - if (StringUtils.isEmpty(lockVal)) { - throw new ServiceException(BusiStatus.SERVERBUSY); - } - try { - // 再次校验, 避免送入团礼时亲密值增加先处理,导致此时数据库先生成了对应的成员记录 - AnchorFansTeamMember member = anchorFansTeamMemberService.getTeamFansByMemberUid(team.getUid(), sendUid); - if (member != null) { - throw new ServiceException(BusiStatus.CURRENT_FANS_TEAM_IS_JOINED); - } - - // 是否在用户退出该粉丝团重新加入的限制期 - if (jedisService.exits(limitJoinKey)) { - log.info("当前用户正在加入该粉丝团的限制期内,无法加入....粉丝团主播uid:{},用户uid:{}", team.getUid(), sendUid); - throw new ServiceException(BusiStatus.JOIN_FANS_TEAM_LIMIT); - } - - String sendJoinGiftSignValDoubleVal = jedisService.get(sendJoinGiftSignKey); - // 设置加入粉丝团的缓存锁 避免监听器还未处理结束对应的入团操作 - if (StringUtils.isNotBlank(sendJoinGiftSignValDoubleVal)) { - throw new ServiceException(BusiStatus.SERVERBUSY); - } - - Object object = giftSendService.sendGiftAllowNotPutOn(sendUid, receiveUids, roomUid, giftId, giftNum, msg, giftSource, sendType); - return object; - } finally { - jedisService.unlock(key, lockVal); - } - - } - - @Override - @Async - public void fixMemberRedisJoinKeySignAndMpStatus() { - List teamList = getAllAnchorFansTeam(); - Date monday = WeekUtil.getFirstDayOfWeek(new Date()); - String weekStr = DateTimeUtil.convertDate(monday, DateTimeUtil.DEFAULT_DATE_PATTERN); - for (AnchorFansTeam team : teamList) { - String key = RedisKey.anchor_fans_join_sign_current_week.getKey(team.getUid() + StrUtil.UNDERLINE + weekStr); - List members = anchorFansTeamMemberService.getTeamMemberListByTeamIdFromDB(team.getId()); - if (CollectionUtils.isEmpty(members)) { - continue; - } - for (AnchorFansTeamMember member : members) { - // 经验值锁 - String experLockKey = RedisKey.anchor_fans_team_exper_lock.getKey(team.getUid() + StrUtil.UNDERLINE + member.getMemberUid()); - String lockVal = jedisService.lock(experLockKey, 10 * 1000); - try { - if (StringUtils.isBlank(lockVal)) { - //拿不到锁暂不考虑 - log.error("fixMemberRedisJoinKeySing 获取成员锁失败...,粉丝团teamId:{}, 主播uid: {}, 粉丝uid: {}", team.getId(), team.getUid(), member.getMemberUid()); - continue; - } - // 设置缓存 - anchorFansTeamMemberService.getTeamFansByMemberUid(team.getUid(), member.getMemberUid()); - // 设置首周加入的key标识 - jedisService.sadd(key, member.getMemberUid().toString()); - jedisService.expire(key, DateTimeUtil.getSecondsOfDays(7)); - } finally { - jedisService.unlock(experLockKey, lockVal); - } - - } - } - - String usingNameplateKey = RedisKey.user_using_nameplate.getKey(); - // 铭牌图片设置: 穿戴的炫酷铭牌恢复常态 / 当前周没有活跃 设置为消极状态 - for (AnchorFansTeam team : teamList) { - asyncExecutor.execute(() -> { - List members = anchorFansTeamMemberService.getTeamMemberListByTeamId(team.getId()); - for (AnchorFansTeamMember member : members) { - UserNameplateVo nameplateVo = userNameplateService.getUserUsingNameplateVo(member.getMemberUid()); - if (nameplateVo == null) { - continue; - } - // 穿戴的是否为当前粉丝团铭牌 - if (nameplateVo.getType() != null && nameplateVo.getType().equals(NameplateStyleTypeEnum.ANCHOR_FANS_MP_SEND.getValue()) - && nameplateVo.getFixedWord().equals(team.getTeamName())) { - String mpPic = getAnchorFansMpPicWithMemberStatus(team.getUid(), member.getMemberUid()); - if (StringUtils.isNotBlank(mpPic)) { - nameplateVo.setNameplateImage(mpPic); - jedisService.hset(usingNameplateKey, member.getMemberUid().toString(), gson.toJson(nameplateVo)); - jedisService.hdel(RedisKey.user_summary.getKey(), member.getMemberUid().toString()); - } - } - } - }); - } - } - - @Override - public List getAllAnchorFansTeam() { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.lambda().eq(AnchorFansTeam::getStatus, Constant.AnchorFansTeamStatus.vaild); - return baseMapper.selectList(wrapper); - } - - @Override - public String getAnchorFansMpPicWithWordAndStatus(Long memberUid, String teamName) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.lambda().eq(AnchorFansTeam::getTeamName, teamName).eq(AnchorFansTeam::getStatus, Constant.AnchorFansTeamStatus.vaild); - AnchorFansTeam team = baseMapper.selectOne(wrapper); - if (team == null) { - return null; - } - return getAnchorFansMpPicWithMemberStatus(team.getUid(), memberUid); - } - - - private String getAnchorFansMpPicByType(Long teamUid, Integer levelSeq, Byte status) { - AnchorFansTeam team = getAnchorFansTeamByUid(teamUid); - if (team == null) { - return null; - } - AnchorFansTeamMpPic mpPic = anchorFansTeamMpPicService.getLevelMpPicsByGuardsTeamIdAndLevelSeq(team.getId(), levelSeq); - if (mpPic == null) { - return null; - } - if (Constant.AnchorFansTaskActiveType.once_finished.equals(status)) { - return mpPic.getActiveMpPic(); - } else if (Constant.AnchorFansTaskActiveType.active.equals(status)) { - return mpPic.getFansMpPic(); - } else { - return mpPic.getNegativeMpPic(); - } - } - - @Override - public ApplyFansTeamPopInfoVo applyFansTeamPopInfoVo(Long teamUid, Long memberUid) { - ApplyFansTeamPopInfoVo popInfoVo = new ApplyFansTeamPopInfoVo(); - AnchorFansTeam team = getAnchorFansTeamByUid(teamUid); - if (team == null) { - throw new ServiceException(BusiStatus.THE_FAN_GROUP_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED); - } - Users anchor = usersService.getUsersByUid(team.getUid()); - if (anchor == null) { - throw new ServiceException(BusiStatus.THERE_IS_NO_USER_INFORMATION_FOR_THIS_ANCHOR); - } - long count = anchorFansTeamMemberService.getTeamMemberCountByTeamId(team.getId()); - popInfoVo.setTeamNum(count); - popInfoVo.setAnchorNick(anchor.getNick()); - popInfoVo.setAnchorAvatar(anchor.getAvatar()); - popInfoVo.setTeamUid(anchor.getUid()); - popInfoVo.setIsJoinLimit(false); - // 特权配置 - List privilegeConfigVos = anchorFansPrivilegeConfigService.allShowPrivilegeVoList(); - popInfoVo.setPrivilegeConfigVos(privilegeConfigVos); - - // 获取亲密值榜单前三 - List avatars = getPreThirdFansAvatar(anchor.getUid()); - if (CollectionUtils.isNotEmpty(avatars)) { - popInfoVo.setAvatarList(avatars); - } - - // 是否在用户退出该粉丝团重新加入的限制期 - String key = RedisKey.anchor_fans_team_join_limit.getKey(team.getUid() + StrUtil.UNDERLINE + memberUid); - if (jedisService.exits(key)) { - popInfoVo.setIsJoinLimit(true); - } - - return popInfoVo; - } - - @Override - public List getPreThirdFansAvatar(Long teamUid) { - List avatars = new ArrayList<>(); - String key = RedisKey.anchor_fans_team_rank.getKey(teamUid.toString()); - Set> totalRank = jedisService.zrevrange(key, 0L, Constant.AnchorFansTeamDefaultVal.DEFAULT_SHOW_TOP_NUM); - if (CollectionUtil.isEmpty(totalRank)) { - return new ArrayList<>(); - } - - for (Map rank : totalRank) { - long memberUid = Long.parseLong(rank.get("member").toString()); - //送礼物的用户 - Users users = Optional.ofNullable(usersService.getUsersByUid(memberUid)).orElse(new Users()); - avatars.add(users.getAvatar()); - } - return avatars; - } - - @Override - public AnchorFansTeam getAnchorFansTeamByUid(Long uid) { - String key = RedisKey.anchor_fans_team_info.getKey(); - String teamStr = jedisService.hget(key, uid.toString()); - if (StringUtils.isNotBlank(teamStr)) { - return gson.fromJson(teamStr, AnchorFansTeam.class); - } - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.lambda().eq(AnchorFansTeam::getUid, uid).eq(AnchorFansTeam::getStatus, Constant.AnchorFansTeamStatus.vaild); - AnchorFansTeam team = baseMapper.selectOne(wrapper); - if (team != null) { - jedisService.hset(key, uid.toString(), gson.toJson(team)); - return team; - } - return null; - } - - @Override - public Boolean hasAnchorFansTeamByUid(Long uid) { - AnchorFansTeam team = getAnchorFansTeamByUid(uid); - return team != null; - } - - @Override - public long getAnchorFansTeamMemberCountByTeamId(Long teamId) { - return anchorFansTeamMemberService.getTeamMemberCountByTeamId(teamId); - } - - @Override - public Boolean isCurrentRoomAnchorFans(Long teamUid, Long memberUid) { - AnchorFansTeam fansTeam = getAnchorFansTeamByUid(teamUid); - if (fansTeam == null) { - return false; - } - return anchorFansTeamMemberService.hasTeamFansByMemberUid(fansTeam.getUid(), memberUid); - } - - @Override - public Integer getFansLevelSeqByMemberUid(Long teamId, Long memberUid) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.lambda().eq(AnchorFansTeamMember::getTeamId, teamId).eq(AnchorFansTeamMember::getMemberUid, memberUid).eq(AnchorFansTeamMember::getStatus, Constant.GlobalStatus.valid); - AnchorFansTeamMember fansTeamMember = anchorFansTeamMemberService.getBaseMapper().selectOne(wrapper); - if (fansTeamMember != null) { - return fansTeamMember.getLevelSeq(); - } - return null; - } - - @Override - public InRoomFansTeamInitVo initInRoomFansTeam(Long teamUid, Long uid) { - InRoomFansTeamInitVo initVo = new InRoomFansTeamInitVo(); - initVo.setIsCurrentRoomAnchor(false); - initVo.setHasFansTeamCurrentRoom(false); - initVo.setIsAnchorFans(false); - initVo.setIsRedPop(false); - - // 当前房间是否为主播房 - if (!roomService.judgeIsSingleBroadByUid(teamUid)) { - return null; - } - if (teamUid.equals(uid)) { - // 是否为当前个播房房主 - initVo.setIsCurrentRoomAnchor(true); - } - AnchorFansTeam team = getAnchorFansTeamByUid(teamUid); - if (team != null) { - initVo.setHasFansTeamCurrentRoom(true); - if (teamUid.equals(uid)) { - // 粉丝团总人数 - long count = getAnchorFansTeamMemberCountByTeamId(team.getId()); - initVo.setAnchorFansNum(count); - - // 设置红点提示 - String key = RedisKey.anchor_red_point_pop.getKey(); - String popStr = jedisService.hget(key, uid.toString()); - if (StringUtils.isBlank(popStr)) { - initVo.setIsRedPop(true); - - jedisService.hset(key, uid.toString(), uid.toString()); - } - } else { - // 是否为当前房间的粉丝团成员 - Boolean flag = isCurrentRoomAnchorFans(teamUid, uid); - if (flag) { - initVo.setIsAnchorFans(true); - initVo.setFansLevelSeq(getFansLevelSeqByMemberUid(team.getId(), uid)); - } - } - } - return initVo; - } - - @Override - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - public void joinFansTeamByMemberUid(Long teamId, Long memberUid, Integer giftId, Date joinTime) throws Exception { - - StopWatch stopWatch = new StopWatch(); - stopWatch.start(); - - log.info("joinFansTeamByMemberUid is begin... memberUid {} teamId {}", memberUid, teamId); - AnchorFansTeam team = getAnchorFansTeamByTeamId(teamId); - if (team == null) { - log.info("当前加入的粉丝团为空!!! sendUid {} operateTime {} ,teamId {}", memberUid, joinTime, teamId); - return; - } - Boolean flag = anchorFansTeamMemberService.hasTeamFansByMemberUid(team.getUid(), memberUid); - if (flag) { - log.info("当前用户已为该粉丝团粉丝...无需进行入团操作!!! sendUid {} operateTime {} ,teamUid {}", memberUid, joinTime, team.getUid()); - return; - } - - // 是否在用户退出该粉丝团重新加入的限制期 - String limitJoinKey = RedisKey.anchor_fans_team_join_limit.getKey(team.getUid() + StrUtil.UNDERLINE + memberUid); - if (jedisService.exits(limitJoinKey)) { - log.info("当前用户正在加入该粉丝团的限制期内,无法加入....粉丝团主播uid:{},用户uid:{}", team.getUid(), memberUid); - } - - // 粉丝团成员加入/更新经验值锁 - String key = RedisKey.anchor_fans_team_exper_lock.getKey(team.getUid() + StrUtil.UNDERLINE + memberUid); - String lockVal = jedisService.lock(key, 10 * 1000); - if (StringUtils.isEmpty(lockVal)) { - log.error("加入粉丝团获取不到对应的锁....sendUid {} teamUid {}", memberUid, team.getUid()); - throw new ServiceException(BusiStatus.SERVERBUSY); - } - String sendJoinGiftSignKey = RedisKey.anchor_fans_send_join_gift_sign.getKey(team.getUid() + StrUtil.UNDERLINE + memberUid); - try { - // 再次校验, 避免送入团礼时亲密值增加先处理,导致此时数据库先生成了对应的成员记录 - AnchorFansTeamMember member = anchorFansTeamMemberService.getTeamFansByMemberUid(team.getUid(), memberUid); - if (member != null) { - log.info("当前用户已为该粉丝团粉丝...无需进行入团操作!!! sendUid {} operateTime {} ,teamUid {} ", memberUid, joinTime, team.getUid()); - return; - } - - // 是否在用户退出该粉丝团重新加入的限制期 - if (jedisService.exits(limitJoinKey)) { - log.info("当前用户正在加入该粉丝团的限制期内,无法加入....粉丝团主播uid:{},用户uid:{}", team.getUid(), memberUid); - return; - } - - // 是否存在需要处理的key - if (!jedisService.setnx(sendJoinGiftSignKey, memberUid.toString(), 30)) { - log.info("当前用户的入团请求已处理,无需继续进行...{}, {}", team.getUid(), memberUid); - return; - } - - log.info("当前用户进入入团操作, 准备往AnchorFansTeamMember 表中插入数据... teamUid : {}, memberUid : {}, operateTime : {}", team.getUid(), memberUid, joinTime); - member = new AnchorFansTeamMember(); - // 粉丝团成员创建 - member.setMemberUid(memberUid); - member.setTeamId(teamId); - member.setLevelSeq(1); - member.setExper(0L); - member.setCreateTime(joinTime); - member.setUpdateTime(joinTime); - member.setStatus(Constant.GlobalStatus.valid); - anchorFansTeamMemberService.save(member); - log.info("AnchorFansTeamMember 表中插入数据结束...入团成功, teamUid : {}, memberUid : {}", team.getUid(), memberUid); - - // 设置缓存 - String memberInfoKey = RedisKey.anchor_fans_team_member_info.getKey(team.getUid().toString()); - jedisService.hset(memberInfoKey, memberUid.toString(), gson.toJson(member)); - // 关注主播 - fansService.likeSomeBody(memberUid, team.getUid(), (byte) 1); - // 赠送入团礼物 铭牌+专属礼物 - sendJoinFansTeamMpAndGift(teamId, member.getMemberUid()); - // 设置本周加入粉丝团的缓存标识 - Date monday = WeekUtil.getFirstDayOfWeek(joinTime); - String weekStr = DateTimeUtil.convertDate(monday, DateTimeUtil.DEFAULT_DATE_PATTERN); - String joinSignKey = RedisKey.anchor_fans_join_sign_current_week.getKey(team.getUid() + StrUtil.UNDERLINE + weekStr); - if (!jedisService.exits(joinSignKey)) { - jedisService.sadd(joinSignKey, memberUid.toString()); - jedisService.expire(joinSignKey, 7 * 24 * 60 * 60); - } else { - jedisService.sadd(joinSignKey, memberUid.toString()); - } - - // 公屏消息 - AnchorFansTeamMessageVo vo = new AnchorFansTeamMessageVo(); - vo.setUid(memberUid); - GiftVo giftVo = giftService.getGiftVoById(giftId); - if (giftVo != null) { - vo.setGiftVo(giftVo); - } - Users users = usersService.getUsersByUid(memberUid); - if (users != null) { - vo.setNickname(users.getNick()); - } - // 设置进房标识, 如果主播在房间则开启计时 - RoomVo roomVo = userInRoomService.getUserInRoomInfoCache(memberUid); - if (roomVo != null && roomVo.getUid().equals(team.getUid())) { - String inRoomKey = RedisKey.anchor_fans_in_room.getKey(team.getUid().toString()); - jedisService.sadd(inRoomKey, memberUid.toString()); - - // 查看当前房主是否在房间, 是的话 开启计时 - String anchorInRoomKey = RedisKey.anchor_in_room.getKey(); - boolean isInRoom = jedisService.sismember(anchorInRoomKey, team.getUid().toString()); - if (isInRoom) { - String todayStr = StrUtil.UNDERLINE + DateTimeUtil.getTodayStr(); - AnchorFansTask task = anchorFansTaskService.getAnchorFansTaskByCode(Constant.AnchorFansTaskCode.watchLive); - if (task == null) { - return; - } - int defaultMaxWatchMin = task.getOnceVal() * task.getLimitNum(); - //默认观看直播30分钟完成任务 - Long defaultMs = defaultMaxWatchMin * 60 * 1000L; - this.startWatchLiveTimer(memberUid, todayStr, task, defaultMs, joinTime.getTime(), team.getUid()); - } - } - - vo.setCount(getAnchorFansTeamMemberCountByTeamId(teamId)); - sendJoinFansTeamMessage(memberUid, team.getUid(), vo, "IN"); - - - } catch (Exception e) { - log.error("加入粉丝团出现异常。。。memberUid {} teamUid {}", memberUid, team.getUid(), e); - throw new ServiceException(BusiStatus.SERVERBUSY); - } finally { - this.jedisService.del(sendJoinGiftSignKey); - this.jedisService.unlock(key, lockVal); - } - - stopWatch.stop(); - - log.info("加入粉丝完成..."); - log.info("{}", stopWatch.prettyPrint()); - } - - /** - * 加入粉丝团房间消息 - */ - private void sendJoinFansTeamMessage(Long uid, Long roomUid, AnchorFansTeamMessageVo vo, String status) { - Attach attach = new Attach(); - attach.setFirst(Constant.DefineProtocol.ANHCOTR_FANS_TEAM); - if (status.equals("IN")) { - attach.setSecond(Constant.DefineProtocol.ANCHOR_FANS_JOIN_TEAM); - } else { - attach.setSecond(Constant.DefineProtocol.ANCHOR_FANS_OUT_TEAM); - } - attach.setData(vo); - try { - log.info("发送加入粉丝团房间消息, roomUid {} uid {}", roomUid, uid); - Room room = roomService.getRoomByUid(roomUid); - if (null != room) { - sendSingleRoomMsg(room.getRoomId(), roomUid, JSON.toJSONString(attach)); - } - } catch (Exception e) { - log.error("发送加入粉丝团房间消息失败, roomUid :" + roomUid + ", uid :" + uid, e); - } - } - - /** - * 单个房间公屏消息 - * - * @param roomId 房间id - * @param roomUid 房间uid - * @param msg - * @throws Exception - */ - private void sendSingleRoomMsg(Long roomId, Long roomUid, final String msg) throws Exception { - erBanNetEaseService.sendChatRoomMsg(roomId, UUIDUtil.get(), roomUid.toString(), Constant.DefineProtocol.CUSTOM_MESS_DEFINE, msg); - } - - @Override - public boolean hasAnchorFansTeamByName(String teamName) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.lambda().eq(AnchorFansTeam::getTeamName, teamName).eq(AnchorFansTeam::getStatus, Constant.GlobalStatus.valid); - return baseMapper.selectOne(wrapper) != null; - } - - /** - * 退出粉丝团 - * - * @param teamUid - * @param memberUid - */ - @Override - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - public void outAnchorFansTeam(Long teamUid, Long memberUid) { - AnchorFansTeam fansTeam = getAnchorFansTeamByUid(teamUid); - if (fansTeam == null) { - throw new ServiceException(BusiStatus.THE_CURRENT_FAN_GROUP_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED); - } - AnchorFansTeamMember member = anchorFansTeamMemberService.getTeamFansByMemberUid(fansTeam.getUid(), memberUid); - if (member == null) { - return; - } - - String key = RedisKey.anchor_fans_team_exper_lock.getKey(teamUid + StrUtil.UNDERLINE + memberUid); - String lockVal = jedisService.lock(key, 10 * 1000); - if (com.accompany.common.utils.StringUtils.isBlank(lockVal)) { - //拿不到锁暂不考虑 - log.info("退出粉丝团, 获取成员锁失败..., 主播uid: {}, 粉丝uid: {}", teamUid, memberUid); - return; - } - - try { - // 更新状态标识 - member.setStatus(Constant.GlobalStatus.in_valid); - anchorFansTeamMemberService.updateById(member); - - // 退出粉丝团重新加入限制标识 缓存key设置 - String joinLimitKey = RedisKey.anchor_fans_team_join_limit.getKey(fansTeam.getUid() + StrUtil.UNDERLINE + memberUid); - jedisService.set(joinLimitKey, memberUid.toString(), 24 * 60 * 60); - // 减少对应过期铭牌时间 - Integer levelSeq = member.getLevelSeq(); - AnchorFansTeamMpPic mpPic = anchorFansTeamMpPicService.getLevelMpPicsByGuardsTeamIdAndLevelSeq(fansTeam.getId(), levelSeq); - Integer privilegeId = mpPic.getPrivilegeId(); - AnchorFansPrivilegeConfig config = anchorFansPrivilegeConfigService.getById(privilegeId); - UserNameplate userNameplate = userNameplateMapper.getUserNameplateListByNameplateIdAndWord(memberUid, config.getNormalId(), fansTeam.getTeamName()); - if (userNameplate != null) { - userNameplate.setExpireTime(DateTimeUtil.addDays(userNameplate.getExpireTime(), -Constant.AnchorFansTeamDefaultVal.expireDays)); - userNameplateMapper.updateById(userNameplate); - } - - UserNameplateVo nameplateVo = userNameplateService.getUserUsingNameplateVo(memberUid); - if (nameplateVo != null && nameplateVo.getType() != null && nameplateVo.getType().equals(NameplateStyleTypeEnum.ANCHOR_FANS_MP_SEND.getValue()) - && nameplateVo.getFixedWord().equals(fansTeam.getTeamName())) { - String usingNameplateKey = RedisKey.user_using_nameplate.getKey(); - jedisService.hdel(usingNameplateKey, memberUid.toString()); - jedisService.hdel(RedisKey.user_summary.getKey(), memberUid.toString()); - } - - - // 删除粉丝团的指定成员缓存数据 - delAnchorFansTeamMemberCash(fansTeam.getUid(), memberUid); - // 删除每周活跃缓存 - Date monday = WeekUtil.getFirstDayOfWeek(new Date()); - String weekStr = DateTimeUtil.convertDate(monday, DateTimeUtil.DEFAULT_DATE_PATTERN); - Date preMonday = WeekUtil.getFirstDayOfLastWeek(new Date()); - String preWeekStr = DateTimeUtil.convertDate(preMonday, DateTimeUtil.DEFAULT_DATE_PATTERN); - // 删除加入粉丝团成员标识 - String joinKey = RedisKey.anchor_fans_join_sign_current_week.getKey(teamUid + StrUtil.UNDERLINE + weekStr); - jedisService.srem(joinKey, memberUid.toString()); - // 一周内活跃用户缓存标识key - String activeKey = RedisKey.anchor_fans_team_play_once_week.getKey(teamUid + StrUtil.UNDERLINE + weekStr); - String preActiveKey = RedisKey.anchor_fans_team_play_once_week.getKey(teamUid + StrUtil.UNDERLINE + preWeekStr); - jedisService.srem(activeKey, memberUid.toString()); - jedisService.srem(preActiveKey, memberUid.toString()); - // 删除榜单数据 - String rankKey = RedisKey.anchor_fans_team_rank.getKey(teamUid.toString()); - jedisService.zrem(rankKey, memberUid.toString()); - // 删除成员进房记录 - String fansInRoomKey = RedisKey.anchor_fans_in_room.getKey(teamUid.toString()); - jedisService.hdel(fansInRoomKey, memberUid.toString()); - // 删除一周中某一天是否完成所有任务 - String todayStr = DateTimeUtil.getTodayStr(); - String finsheKey = RedisKey.anchor_fans_team_complete_finished.getKey(teamUid + StrUtil.UNDERLINE + todayStr); - jedisService.hdel(finsheKey, memberUid.toString()); - - // 公屏消息 - AnchorFansTeamMessageVo vo = new AnchorFansTeamMessageVo(); - vo.setUid(memberUid); - vo.setCount(getAnchorFansTeamMemberCountByTeamId(fansTeam.getId())); - Users users = usersService.getUsersByUid(memberUid); - if (users != null) { - vo.setNickname(users.getNick()); - } - sendJoinFansTeamMessage(memberUid, fansTeam.getUid(), vo, "OUT"); - } finally { - jedisService.unlock(key, lockVal); - } - - } - - @Override - public AnchorFansTaskInfoVo getFansTaskInfo(Long teamUid, Long memberUid) { - AnchorFansTaskInfoVo vo = new AnchorFansTaskInfoVo(); - AnchorFansTeam team = getAnchorFansTeamByUid(teamUid); - if (team == null) { - throw new ServiceException(BusiStatus.THE_FAN_GROUP_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED); - } - Users users = usersService.getUsersByUid(teamUid); - Users memberUsers = usersService.getUsersByUid(memberUid); - if (users == null || memberUsers == null) { - throw new ServiceException(BusiStatus.THE_CURRENT_USER_OR_ANCHOR_USER_INFORMATION_DOES_NOT_EXIST); - } - AnchorFansTeamMember member = anchorFansTeamMemberService.getTeamFansByMemberUid(teamUid, memberUid); - if (member == null) { - throw new ServiceException(BusiStatus.YOU_ARE_CURRENTLY_NOT_A_MEMBER_OF_THIS_FAN_GROUP); - } - - // 等级设置 - Integer levelSeq = member.getLevelSeq(); - AnchorFansLevelExperience currentLevel = anchorFansLevelExperienceService.getAnchorFansLevelExperienceBySeq(levelSeq); - if (currentLevel == null) { - throw new ServiceException(BusiStatus.SERVERBUSY); - } - Long amount = currentLevel.getAmount(); - if (amount == null) { - amount = 0L; - } - if (AnchorFansLevelExperienceArr.exper == null) { - throw new ServiceException(BusiStatus.LACK_OF_LEVEL_EXPERIENCE_CONFIGURATION); - } - if (amount >= AnchorFansLevelExperienceArr.exper[AnchorFansLevelExperienceArr.exper.length - 1]) { - //说明已经满级,没有下一级 - vo.setNextLevelExper(currentLevel.getAmount()); - } else { - AnchorFansLevelExperience nextLevel = anchorFansLevelExperienceService.getAnchorFansLevelExperienceBySeq(levelSeq + 1); - if (nextLevel == null) throw new ServiceException(BusiStatus.SERVERBUSY); - vo.setNextLevelExper(nextLevel.getAmount()); - } - Long teamId = team.getId(); - vo.setTeamId(vo.getTeamId()); - vo.setTeamNum(getAnchorFansTeamMemberCountByTeamId(teamId)); - vo.setTeamUid(teamUid); - vo.setAnchorAvatar(users.getAvatar()); - vo.setLevelSeq(levelSeq); - vo.setAnchorNick(users.getNick()); - vo.setLevelExper(member.getExper()); - vo.setMemberAvatar(memberUsers.getAvatar()); - vo.setMemberUid(memberUid); - // 亲密度前三数据 - vo.setAvatarList(getPreThirdFansAvatar(teamUid)); - // 任务集 - List taskVos = new ArrayList<>(); - try { - taskVos = getFansTaskVos(teamUid, memberUid); - } catch (Exception e) { - log.error("handle getFansTaskInfo -> getFansTaskVos error", e); - } - vo.setTaskVos(taskVos); - return vo; - } - - private List getFansTaskVos(Long teamUid, Long memberUid) throws ParseException { - List taskList = anchorFansTaskService.getAllFansTaskList(); - List vos = new ArrayList<>(); - Date date = new Date(); - String todayStr = StrUtil.UNDERLINE + DateTimeUtil.convertDate(date, DateTimeUtil.DEFAULT_DATE_PATTERN); - // 处理观看任务计时 - dealIntoRoomTask(memberUid, teamUid, date); - - for (AnchorFansTask task : taskList) { - AnchorFansTaskVo vo = new AnchorFansTaskVo(); - BeanUtils.copyProperties(task, vo); - vo.setTaskId(task.getId()); - - vo.setAwardVal(0); - if (task.getTaskCode().equals(Constant.AnchorFansTaskCode.sendDesignatedGift)) { - // 专属礼物 - String dayExperKey = RedisKey.anchor_fans_send_design_gift_day_exper.getKey(memberUid + StrUtil.UNDERLINE + teamUid + todayStr); - String sendCount = jedisService.get(dayExperKey); - int totalNum = task.getLimitNum() * task.getAwardVal(); - vo.setTotalNum(totalNum); - if (StringUtils.isNotBlank(sendCount)) { - Integer exper = Integer.parseInt(sendCount) * task.getOnceVal(); - vo.setAwardVal(exper); - if (exper >= totalNum) { - vo.setIsFinished(true); - } - } - } - - if (task.getTaskCode().equals(Constant.AnchorFansTaskCode.sendGift)) { - // 普通赠礼 - String dayExperKey = RedisKey.anchor_fans_send_gift_day_exper.getKey(memberUid + StrUtil.UNDERLINE + teamUid + todayStr); - String experStr = jedisService.get(dayExperKey); - int totalNum = task.getLimitNum(); - vo.setTotalNum(totalNum); - if (StringUtils.isNotBlank(experStr)) { - int exper = Integer.parseInt(experStr); - vo.setAwardVal(exper); - if (exper >= totalNum) { - vo.setIsFinished(true); - } - } - } - - if (task.getTaskCode().equals(Constant.AnchorFansTaskCode.watchLive)) { - String dayExperKey = RedisKey.anchor_fans_watch_day_exper.getKey(memberUid + StrUtil.UNDERLINE + teamUid + todayStr); - String experStr = jedisService.get(dayExperKey); - int totalNum = task.getLimitNum() * task.getAwardVal(); - vo.setTotalNum(totalNum); - if (StringUtils.isNotBlank(experStr)) { - int exper = Integer.parseInt(experStr); - vo.setAwardVal(exper); - if (exper >= totalNum) { - vo.setIsFinished(true); - } - } - } - vos.add(vo); - } - return vos; - } - - /** - * 用户在房间获取任务时, 进行任务结束计时, 并开启新一轮的计算 - * - * @param uid - * @param roomUid - * @param today - * @throws ParseException - */ - public void dealIntoRoomTask(Long uid, Long roomUid, Date today) throws ParseException { - String todayStr = StrUtil.UNDERLINE + DateTimeUtil.convertDate(today, DateTimeUtil.DEFAULT_DATE_PATTERN); - AnchorFansTask task = anchorFansTaskService.getAnchorFansTaskByCode(Constant.AnchorFansTaskCode.watchLive); - if (task == null) { - return; - } - String durationDayKey = RedisKey.anchor_fans_day_watch_live.getKey(roomUid + StrUtil.UNDERLINE + uid + todayStr); - //默认观看直播20分钟完成任务 - Integer defaultMaxWatchMin = task.getOnceVal() * task.getLimitNum(); - long currentTime = today.getTime(); - - //默认观看直播15分钟完成任务 - Long defaultMs = defaultMaxWatchMin * 60 * 1000l; - - if (!jedisService.exits(durationDayKey)) { - jedisService.set(durationDayKey, String.valueOf(0)); - jedisService.expire(durationDayKey, 48 * 60 * 60); - } - - - Boolean flag = true; - String watchTimerKey = RedisKey.anchor_fans_member_watch_clock.getKey(roomUid.toString() + StrUtil.UNDERLINE + uid.toString() + todayStr); - if (!jedisService.exits(watchTimerKey)) { - //防止前一日有未处理的,进行处理 - String prevDayStr = StrUtil.UNDERLINE + DateTimeUtil.convertDate(DateTimeUtil.addDays(today, -1), DateTimeUtil.DEFAULT_DATE_PATTERN); - watchTimerKey = RedisKey.anchor_fans_member_watch_clock.getKey(roomUid + StrUtil.UNDERLINE + uid + prevDayStr); - if (!jedisService.exits(watchTimerKey)) flag = false; - } - String str = jedisService.get(watchTimerKey); - if (flag && (com.accompany.common.utils.StringUtils.isEmpty(str) || "null".equalsIgnoreCase(str))) flag = false; - - if (flag) { - //对前一次未结束的进行处理 - AnchorFansWatchVo fansWatchVo = gson.fromJson(str, AnchorFansWatchVo.class); - fansWatchVo.setEndTime(currentTime); - watchliveDuration(roomUid, uid, fansWatchVo, 4, today, task); - jedisService.del(watchTimerKey); - } - - // 主播 && 粉丝 在房间,有开启计时 - Boolean isExit = jedisService.sismember(RedisKey.anchor_in_room.getKey(), roomUid.toString()); - boolean sismember = jedisService.sismember(RedisKey.anchor_fans_in_room.getKey(), uid.toString()); - if (!isExit && !sismember) { - return; - } - - log.info("用户uid:{}准备开启在teamUid:{}粉丝团团的计时", uid, roomUid); - startWatchLiveTimer(uid, todayStr, task, defaultMs, currentTime, roomUid); - - } - - @Override - public void detectionMp(Long teamUid, Long memberUid, Integer levelSeq) { - AnchorFansTeam team = getAnchorFansTeamByUid(teamUid); - Date date = new Date(); - if (team == null) { - return; - } - AnchorFansTeamMember member = anchorFansTeamMemberService.getTeamFansByMemberUid(teamUid, memberUid); - if (member == null) { - return; - } - // 获取粉丝团生成的对应等级铭牌数据 - AnchorFansTeamMpPic mpPic = anchorFansTeamMpPicService.getLevelMpPicsByGuardsTeamIdAndLevelSeq(team.getId(), levelSeq); - AnchorFansPrivilegeConfig nameplateConfig = anchorFansPrivilegeConfigService.getById(mpPic.getPrivilegeId()); - Long nameplateId = nameplateConfig.getNormalId(); - UserNameplateVo nameplateVo = userNameplateService.getUserUsingNameplateVo(memberUid); - if (nameplateVo != null && nameplateVo.getType() != null && nameplateVo.getType().equals(NameplateStyleTypeEnum.ANCHOR_FANS_MP_SEND.getValue()) - && nameplateVo.getNameplateId().equals(nameplateId) && nameplateVo.getFixedWord().equals(team.getTeamName())) { - String pic = getAnchorFansMpPicWithMemberStatus(teamUid, memberUid); - if (StringUtils.isNotBlank(pic)) { - nameplateVo.setNameplateImage(pic); - - String key = RedisKey.user_using_nameplate.getKey(); - jedisService.hset(key, memberUid.toString(), gson.toJson(nameplateVo)); - jedisService.hdel(RedisKey.user_summary.getKey(), memberUid.toString()); - } - } - // 更新铭牌数据 - UserNameplate userNameplate = userNameplateMapper.getUserNameplateListByNameplateIdAndWord(memberUid, nameplateId, team.getTeamName()); - if (userNameplate != null) { - userNameplate.setUpdateTime(date); - userNameplate.setNameplateImage(mpPic.getFansMpPic()); - userNameplateMapper.updateById(userNameplate); - } else { - userNameplate = new UserNameplate(); - userNameplate.setWord(team.getTeamName()); - userNameplate.setNameplateId(nameplateId); - userNameplate.setUid(memberUid); - userNameplate.setType(Constant.namePlateType.ANCHOR_FANS_TEAM_SEND); - userNameplate.setCreateTime(date); - userNameplate.setUpdateTime(date); - userNameplate.setExpireTime(DateUtil.addDays(date, Constant.AnchorFansTeamDefaultVal.expireDays)); - userNameplate.setNameplateImage(mpPic.getFansMpPic()); - userNameplateMapper.insert(userNameplate); - } - - } - - /** - * 完成对应任务 增加累计任务次数 - * - * @param teamUid - * @param memberUid - * @param task - * @param todayStr - */ - @Override - public void finishedTask(Long teamUid, Long memberUid, AnchorFansTask task, String todayStr) { - AnchorFansTeam team = getAnchorFansTeamByUid(teamUid); - if (team == null) { - return; - } - // 完成任务数 - List taskList = anchorFansTaskService.getAllFansTaskList(); - if (CollectionUtils.isEmpty(taskList)) { - return; - } - String key = RedisKey.anchor_fans_day_task_finished_task.getKey(teamUid + StrUtil.UNDERLINE + memberUid + todayStr); - if (!jedisService.exits(key)) { - jedisService.hset(key, task.getTaskCode(), memberUid.toString()); - jedisService.expire(key, 24 * 60 * 60); - } else { - jedisService.hset(key, task.getTaskCode(), memberUid.toString()); - Map map = jedisService.hgetAll(key); - // 设置某天完成所有任务的用户数据 - if (map != null && (map.size() == taskList.size())) { - String finsheKey = RedisKey.anchor_fans_team_complete_finished.getKey(teamUid + StrUtil.UNDERLINE + DateTimeUtil.getTodayStr()); - if (!jedisService.exits(finsheKey)) { - jedisService.hset(finsheKey, memberUid.toString(), memberUid.toString()); - jedisService.expire(finsheKey, 48 * 60 * 60); - } else { - jedisService.hset(finsheKey, memberUid.toString(), memberUid.toString()); - } - - // 用户穿戴铭牌数据更新 - UserNameplateVo nameplateVo = userNameplateService.getUserUsingNameplateVo(memberUid); - if (nameplateVo != null && nameplateVo.getType() != null && nameplateVo.getType().equals(NameplateStyleTypeEnum.ANCHOR_FANS_MP_SEND.getValue()) - && nameplateVo.getFixedWord().equals(team.getTeamName())) { - nameplateVo = userNameplateService.checkNameplateVo(nameplateVo); - - // 删除用户缓存,更新用户铭牌 - jedisService.hset(RedisKey.user_using_nameplate.getKey(), memberUid.toString(), this.gson.toJson(nameplateVo)); - this.jedisService.hdel(RedisKey.user_summary.getKey(), memberUid.toString()); - } - } - } - } - - @Override - public List getFansMemberVoList(Long teamUid, Integer pageNum, Integer pageSize) { - if (teamUid == null || pageNum == null || pageSize == null) { - throw new ServiceException(BusiStatus.PARAMETERILLEGAL); - } - AnchorFansTeam team = getAnchorFansTeamByUid(teamUid); - if (team == null) { - throw new ServiceException(BusiStatus.THE_FAN_GROUP_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED); - } - - return anchorFansTeamMemberService.getFansMemberVoByTeamId(team.getId(), pageNum, pageSize); - } - - @Override - public AnchorFansMemberRankVo getFansMemberRankVo(Long teamUid, Long memberUid, Integer pageNum, Integer pageSize) { - if (teamUid == null || pageNum == null || pageSize == null) { - throw new ServiceException(BusiStatus.PARAMETERILLEGAL); - } - Integer startIndex = (pageNum - 1) * pageSize; - Integer endIndex = (pageNum) * pageSize; - AnchorFansTeam team = getAnchorFansTeamByUid(teamUid); - if (team == null) { - throw new ServiceException(BusiStatus.THE_FAN_GROUP_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED); - } - - AnchorFansMemberRankVo rankVo = new AnchorFansMemberRankVo(); - List uids = getActiveMemberUidList(teamUid); - Long activeNum = 0L; - if (CollectionUtils.isNotEmpty(uids)) { - activeNum = (long) uids.size(); - } - - Boolean isJoin = anchorFansTeamMemberService.hasTeamFansByMemberUid(teamUid, memberUid); - rankVo.setActiveNum(activeNum); - rankVo.setIsJoin(isJoin); - rankVo.setTeamUid(teamUid); - List memberVos = new ArrayList<>(); - for (Long uid : uids) { - AnchorFansMemberVo memberVo = new AnchorFansMemberVo(); - Users users = usersService.getUsersByUid(uid); - if (users == null) { - continue; - } - AnchorFansTeamMember member = anchorFansTeamMemberService.getTeamFansByMemberUid(teamUid, uid); - if (member == null) { - continue; - } - memberVo.setNick(users.getNick()); - memberVo.setMemberUid(uid); - memberVo.setAvatar(users.getAvatar()); - memberVo.setExper(member.getExper()); - memberVo.setLevelSeq(member.getLevelSeq()); - AnchorFansTeamMpPic mpPic = anchorFansTeamMpPicService.getLevelMpPicsByGuardsTeamIdAndLevelSeq(team.getId(), memberVo.getLevelSeq()); - if (mpPic != null) { - memberVo.setNameplateImage(mpPic.getFansMpPic()); - } - - memberVos.add(memberVo); - } - memberVos = memberVos.stream().sorted(Comparator.comparingLong(AnchorFansMemberVo::getExper).reversed()).collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(memberVos) && memberVos.size() >= endIndex) { - memberVos = memberVos.subList(startIndex, endIndex); - } else { - if (startIndex >= memberVos.size()) { - memberVos = new ArrayList<>(); - } else { - memberVos = memberVos.subList(startIndex, memberVos.size()); - } - } - rankVo.setMemberVos(memberVos); - - Users currentUser = usersService.getUsersByUid(memberUid); - AnchorFansMemberVo memberVo = new AnchorFansMemberVo(); - AnchorFansTeamMember currentMember = anchorFansTeamMemberService.getTeamFansByMemberUid(teamUid, memberUid); - if (isJoin) { - memberVo.setExper(currentMember.getExper()); - } - memberVo.setNick(currentUser.getNick()); - memberVo.setAvatar(currentUser.getAvatar()); - memberVo.setMemberUid(memberUid); - rankVo.setCurrentUserMemberVo(memberVo); - - return rankVo; - } - - /** - * 根据主播uid 获取状态为活跃的粉丝成员uid集合 - * 活跃判断: 上周是否有亲密值增加行为 || 是否为本周新加入的成员 || 本周有活跃粉丝 - * - * @param teamUid - * @return - */ - private List getActiveMemberUidList(Long teamUid) { - Date monday = WeekUtil.getFirstDayOfWeek(new Date()); - Date preMonday = WeekUtil.getFirstDayOfLastWeek(new Date()); - String weekStr = DateTimeUtil.convertDate(monday, DateTimeUtil.DEFAULT_DATE_PATTERN); - String preWeekStr = DateTimeUtil.convertDate(preMonday, DateTimeUtil.DEFAULT_DATE_PATTERN); - - // 本周&&上周 活跃标识 - String activeKey = RedisKey.anchor_fans_team_play_once_week.getKey(teamUid + StrUtil.UNDERLINE + weekStr); - String preActiveKey = RedisKey.anchor_fans_team_play_once_week.getKey(teamUid + StrUtil.UNDERLINE + preWeekStr); - Set currentWeekActiveUidSet = jedisService.smembers(activeKey); - Set lastWeekActiveUidSet = jedisService.smembers(preActiveKey); - // 本周入团标识 - String joinSignKey = RedisKey.anchor_fans_join_sign_current_week.getKey(teamUid + StrUtil.UNDERLINE + weekStr); - Set joinMembersSigns = jedisService.smembers(joinSignKey); - - Set uidSet = new HashSet<>(); - if (CollectionUtils.isNotEmpty(currentWeekActiveUidSet)) { - uidSet.addAll(currentWeekActiveUidSet); - } - if (CollectionUtils.isNotEmpty(lastWeekActiveUidSet)) { - uidSet.addAll(lastWeekActiveUidSet); - } - if (CollectionUtils.isNotEmpty(joinMembersSigns)) { - uidSet.addAll(joinMembersSigns); - } - - return uidSet.stream().map(Long::parseLong).collect(Collectors.toList()); - } - - /** - * 结束用户观看直播计时:1-粉丝团主播下麦结束计时,2-主播上麦检测到前一次未下麦,3-粉丝离开房间结束计时, 4-粉丝进入房间检测到前一次未结束计时 - * - * @param teamUid - * @param memberUid - * @param fansWatchVo - * @param type - * @throws ParseException - */ - @Override - public void watchliveDuration(Long teamUid, Long memberUid, AnchorFansWatchVo fansWatchVo, int type, Date today, AnchorFansTask task) { - String lockKey = RedisKey.anchor_fans_team_exper_lock.getKey(teamUid + StrUtil.UNDERLINE + memberUid); - String lockVal = jedisService.lock(lockKey, 10 * 1000); - - if (org.springframework.util.StringUtils.isEmpty(lockVal)) { - //拿不到锁暂不考虑 - log.info("团长下麦处理未获取到锁:teamUid:{},todayStr:{}", teamUid, DateTimeUtil.convertDate(today, DateTimeUtil.DEFAULT_DATE_PATTERN)); - return; - } - - try { - Long startTime = fansWatchVo.getStartTime(); - Long endTime = fansWatchVo.getEndTime(); - - String todayStr = StrUtil.UNDERLINE + DateTimeUtil.convertDate(today, DateTimeUtil.DEFAULT_DATE_PATTERN); - - String durationDayKey = RedisKey.anchor_fans_day_watch_live.getKey(teamUid + StrUtil.UNDERLINE + memberUid + todayStr); - - if (1 == type || 3 == type) { - //正常下麦 - - if (DateTimeUtil.diffDayByDate(DateTimeUtil.msTimeToDate(startTime), DateTimeUtil.msTimeToDate(endTime)) == 0) { - //上下麦同一天 - Long incrDuration = endTime - startTime; - - if (incrDuration <= 0) return; - dealOnOrDownWheat(teamUid, memberUid, task, durationDayKey, incrDuration, todayStr); - } else { - //上下麦不是同一天 - Date zeroTime = DateTimeUtil.getZeroTimeByDate(DateTimeUtil.msTimeToDate(endTime)); - Long prevIncrDuration = zeroTime.getTime() - startTime; - Long currentIncrDuration = endTime - prevIncrDuration; - //判断累加前一天的时长后是否加经验 - String prevDatestr = StrUtil.UNDERLINE + DateTimeUtil.convertDate(DateTimeUtil.addDays(DateTimeUtil.msTimeToDate(endTime), -1), DateTimeUtil.DEFAULT_DATE_PATTERN); - String prevDurationDayKey = RedisKey.anchor_fans_day_watch_live.getKey(teamUid + StrUtil.UNDERLINE + memberUid + prevDatestr); - //判断处理前一天 - dealOnOrDownWheat(teamUid, memberUid, task, prevDurationDayKey, prevIncrDuration, prevDatestr); - //判断处理当天 - dealOnOrDownWheat(teamUid, memberUid, task, durationDayKey, currentIncrDuration, todayStr); - } - } - if (2 == type || 4 == type) { - //上麦发现前一次还未下麦 - if (DateTimeUtil.diffDayByDate(DateTimeUtil.msTimeToDate(endTime), today) != 0) { - //前一天未下麦 - todayStr = StrUtil.UNDERLINE + DateTimeUtil.convertDate(DateTimeUtil.addDays(today, -1), DateTimeUtil.DEFAULT_DATE_PATTERN); - durationDayKey = RedisKey.anchor_fans_day_watch_live.getKey(teamUid + StrUtil.UNDERLINE + memberUid + todayStr); - } - - //上麦处理:下麦或定时任务更新团长对应团员的观看直播时间点时,发现跨天一定会做出处理,因此上麦处理不考虑跨天 - Long incrDuration = endTime - startTime; - - if (incrDuration <= 0) { - return; - } - - this.dealOnOrDownWheat(teamUid, memberUid, task, durationDayKey, incrDuration, todayStr); - } - } catch (Exception e) { - log.error("团长下麦处理异常:teamUid:{},memberUid:{},todayStr:{}", teamUid, memberUid, DateTimeUtil.convertDate(today, DateTimeUtil.DEFAULT_DATE_PATTERN)); - log.error(e.getMessage()); - e.printStackTrace(); - } finally { - jedisService.unlock(lockKey, lockVal); - } - } - - @Override - public void startWatchLiveTimer(Long memberUid, String todayStr, AnchorFansTask task, Long defaultMs, long currentTime, Long teamUid) throws ParseException { - String lockKey = RedisKey.anchor_fans_day_watch_start_lock.getKey(teamUid + StrUtil.UNDERLINE + memberUid); - String lockVal = jedisService.lock(lockKey, 10 * 1000); - if (org.springframework.util.StringUtils.isEmpty(lockVal)) { - //拿不到锁暂不考虑 - log.info("开启直播观看计时未获取到锁:guardsUid:{},uid:{},todayStr:{}", teamUid, memberUid, DateTimeUtil.convertDate(DateTimeUtil.msTimeToDate(currentTime), DateTimeUtil.DEFAULT_DATE_PATTERN)); - return; - } - - try { - if (task == null) return; - String durationDayKey = RedisKey.anchor_fans_day_watch_live.getKey(teamUid + StrUtil.UNDERLINE + memberUid + todayStr); - if (!jedisService.exits(durationDayKey)) { - jedisService.set(durationDayKey, String.valueOf(0l)); - jedisService.expire(durationDayKey, 48 * 60 * 60); - } - String durationStr = jedisService.get(durationDayKey); - Long duration = org.springframework.util.StringUtils.isEmpty(durationStr) ? 0l : Long.valueOf(durationStr); - if (duration >= defaultMs) return; - - - log.info("用户uid:{}准备开启在guardsUid:{}新计时", memberUid, teamUid); - String watchTimerKey = RedisKey.anchor_fans_member_watch_clock.getKey(teamUid + StrUtil.UNDERLINE + memberUid + todayStr); - - //开启新计时 - AnchorFansWatchVo watchVo = new AnchorFansWatchVo(); - watchVo.setStartTime(currentTime); - watchVo.setEndTime(currentTime); - if (!jedisService.exits(watchTimerKey)) { - jedisService.set(watchTimerKey, gson.toJson(watchVo)); - jedisService.expire(watchTimerKey, 24 * 60 * 60); - } else { - jedisService.set(watchTimerKey, gson.toJson(watchVo)); - } - } catch (Exception e) { - log.error("开启直播观看计时处理异常:guardsUid:{},memberUid:{}todayStr:{}", teamUid, memberUid, DateTimeUtil.convertDate(DateTimeUtil.msTimeToDate(currentTime), DateTimeUtil.DEFAULT_DATE_PATTERN)); - log.error(e.getMessage()); - e.printStackTrace(); - } finally { - jedisService.unlock(lockKey, lockVal); - } - } - - /** - * 主播直播监听 2直播, 4下拨 - * - * @param memberUid - * @param roomUid - * @param qEvent - */ - @Override - public void dealWheat(Long memberUid, Long roomUid, String qEvent) { - //加锁处理,避免几乎同时收到同一用户的上下麦导致数据问题 - String lockKey = RedisKey.anchor_fans_team_exper_lock.getKey(roomUid + StrUtil.UNDERLINE + memberUid); - String lockVal = jedisService.lock(lockKey, 10 * 1000); - if (org.springframework.util.StringUtils.isEmpty(lockVal)) { - //拿不到锁暂不考虑 - log.info("团长上麦or下麦处理未获取到锁:uid:{},roomId:{},todayStr:{}", memberUid, DateTimeUtil.convertDate(new Date(), DateTimeUtil.DEFAULT_DATE_PATTERN)); - return; - } - - try { - if ("IN".equals(qEvent)) { - jedisService.sadd(RedisKey.anchor_in_room.getKey(), String.valueOf(roomUid)); - //上麦:添加到队列 - dealGuardOnWheat(memberUid, roomUid); - } - if ("OUT".equals(qEvent)) { - //下麦 - dealGuardDownWheat(memberUid, roomUid); - } - } catch (Exception e) { - log.error("主播进房处理异常:anchorUid:{},todayStr:{}", memberUid, DateTimeUtil.convertDate(new Date(), DateTimeUtil.DEFAULT_DATE_PATTERN)); - log.error(e.getMessage()); - e.printStackTrace(); - } finally { - jedisService.unlock(lockKey, lockVal); - } - } - - private void dealGuardDownWheat(Long memberUid, Long roomUid) { - log.info("准备处理房间:{},下麦用户:{}", roomUid, memberUid); - - //不是团长不处理 - List uidList = judgeOnWheatUser(memberUid, roomUid); - - //清楚房内的团长上麦缓存 - jedisService.srem(RedisKey.anchor_in_room.getKey(), String.valueOf(memberUid)); - - if (CollectionUtil.isEmpty(uidList)) return; - //结束所有开启了计时的团成员 - this.endWatchTimer(memberUid, new Date(), 1); - } - - /** - * @param teamUid:进房主播用户uid - * @param memberUid - */ - private void dealGuardOnWheat(Long memberUid, Long teamUid) throws ParseException { - log.info("准备处理房间:{},上麦用户:{}", teamUid, memberUid); - - //不是主播不处理 - List uidList = judgeOnWheatUser(teamUid, memberUid); - if (CollectionUtil.isEmpty(uidList)) return; - log.info("团长上麦处理开始uid:{}", teamUid); - - //开始所有团员的计时,开启计时需要检查,用户当日观看直播时长已满的不需要开启计时 - AnchorFansTask task = anchorFansTaskService.getAnchorFansTaskByCode(Constant.AnchorFansTaskCode.watchLive); - if (task == null) return; - Integer defaultMaxWatchMin = task.getOnceVal() * task.getLimitNum(); - //默认观看直播15分钟完成任务 - Long defaultMs = defaultMaxWatchMin * 60 * 1000l; - - Date currentDate = new Date(); - long currentTime = currentDate.getTime(); - String todayStr = StrUtil.UNDERLINE + DateTimeUtil.getTodayStr(); - - //防止前一天有意外导致没有走下麦处理 - this.endWatchTimer(teamUid, currentDate, 2); - //添加主播在房间缓存 - jedisService.sadd(RedisKey.anchor_in_room.getKey(), teamUid.toString()); - //检查并结束前一天计时 - for (Long membeUid : uidList) { - //给所有用户开启房间内的计时: - this.startWatchLiveTimer(membeUid, todayStr, task, defaultMs, currentTime, teamUid); - } - } - - private void endWatchTimer(Long teamUid, Date today, int downMicType) { - String todayStr = StrUtil.UNDERLINE + DateTimeUtil.convertDate(today, DateTimeUtil.DEFAULT_DATE_PATTERN); - - Long currentTime = new Date().getTime(); - try { - AnchorFansTask guardsTask = anchorFansTaskService.getAnchorFansTaskByCode(Constant.AnchorFansTaskCode.watchLive); - - String key = RedisKey.anchor_fans_in_room.getKey(teamUid.toString()); - Set smembers = jedisService.smembers(key); - List memberUids = smembers.stream().map(Long::parseLong).collect(Collectors.toList()); - if (CollectionUtils.isEmpty(memberUids)) { - return; - } - - for (Long memberUid : memberUids) { - String watchTimerKey = RedisKey.anchor_fans_member_watch_clock.getKey(teamUid + StrUtil.UNDERLINE + memberUid + todayStr); - if (guardsTask == null) { - jedisService.del(watchTimerKey); - return; - - } - - if (!jedisService.exits(watchTimerKey)) { - //防止前一日有未处理的,进行处理 - todayStr = StrUtil.UNDERLINE + DateTimeUtil.convertDate(DateTimeUtil.addDays(today, -1), DateTimeUtil.DEFAULT_DATE_PATTERN); - watchTimerKey = RedisKey.anchor_fans_member_watch_clock.getKey(teamUid + StrUtil.UNDERLINE + memberUid + todayStr); - if (!jedisService.exits(watchTimerKey)) continue; - } - - AnchorFansWatchVo vo = gson.fromJson(jedisService.get(watchTimerKey), AnchorFansWatchVo.class); - vo.setEndTime(currentTime); - watchliveDuration(teamUid, memberUid, vo, downMicType, today, guardsTask); - jedisService.del(watchTimerKey); - } - } catch (Exception e) { - log.error("粉丝团主播下麦处理异常:teamUid:{},todayStr:{}", teamUid, todayStr); - log.error(e.getMessage()); - e.printStackTrace(); - } - } - - private List judgeOnWheatUser(Long teamUid, Long memberUid) { - AnchorFansTeam team = getAnchorFansTeamByUid(teamUid); - if (team == null) { - return new ArrayList<>(); - } - - String key = RedisKey.anchor_fans_in_room.getKey(teamUid.toString()); - Set smembers = jedisService.smembers(key); - return smembers.stream().map(it -> Long.parseLong(it)).collect(Collectors.toList()); - } - - private void dealOnOrDownWheat(Long teamUid, Long memberUid, AnchorFansTask task, String durationDayKey, Long incrDuration, String todayStr) { - Integer defaultMaxWatchMin = task.getOnceVal() * task.getLimitNum(); - //默认观看直播30分钟完成任务 - Long defaultMs = defaultMaxWatchMin * 60 * 1000l; - - if (!jedisService.exits(durationDayKey)) { - jedisService.set(durationDayKey, String.valueOf(0)); - jedisService.expire(durationDayKey, 48 * 60 * 60); - } - String originDurationStr = jedisService.get(durationDayKey); - if (org.springframework.util.StringUtils.isEmpty(originDurationStr)) { - originDurationStr = "0"; - } - Long originDuration = Long.valueOf(originDurationStr); - //保险起见,新增经验前也做检查,避免超出限定值还加经验 - if (originDuration >= defaultMs) return; - - jedisService.incrBy(durationDayKey, incrDuration); - // 是否完成本日观看任务 - long currentDuration = originDuration + incrDuration; - if (currentDuration > defaultMs) { - // 完成任务数 +1 - this.finishedTask(teamUid, memberUid, task, todayStr); - } - - // 计算获得的经验值 - Long exper = cacluExper(originDuration, incrDuration, task, todayStr); - - //维护每日送礼长经验不能超过配置值 - if (exper <= 0) { - return; - } - - String dayExperKey = RedisKey.anchor_fans_watch_day_exper.getKey(memberUid + StrUtil.UNDERLINE + teamUid + todayStr); - if (!jedisService.exits(dayExperKey)) { - jedisService.incrBy(dayExperKey, exper); - jedisService.expire(dayExperKey, 24 * 60 * 60); - } else { - jedisService.incrBy(dayExperKey, exper); - } - - AnchorFansTeam team = this.getAnchorFansTeamByUid(teamUid); - if (team == null) return; - - // 更新等级经验信息 - updateFansMemberLevelInfo(memberUid, teamUid, exper, team.getId()); - } - - private void updateFansMemberLevelInfo(Long memberUid, Long teamUid, Long exper, Long teamId) { - AnchorFansTeam team = getAnchorFansTeamByUid(teamUid); - if (team == null) { - return; - } - AnchorFansTeamMember member = anchorFansTeamMemberService.getTeamFansByMemberUid(teamUid, memberUid); - if (member == null) { - log.error("用户进房处理失败,获取不到memberUid:{}在{}粉丝团的等级信息...", memberUid, teamId); - return; - } - - Date date = new Date(); - // 更新粉丝经验值 - Long currentExper = member.getExper(); - Long nowExper = currentExper + exper; - Integer levelOld = member.getLevelSeq(); - Integer levelNew = anchorFansLevelExperienceService.cacluAnchorFansLevelExperienceByExper(nowExper); - - member.setExper(nowExper); - member.setUpdateTime(date); - if (!Objects.equals(levelOld, levelNew)) { - member.setLevelSeq(levelNew); - // 升级 更新用户铭牌 - this.detectionMp(teamUid, memberUid, levelNew); - } - anchorFansTeamMemberService.updateById(member); - // 更新缓存数据 - String memberInfoKey = RedisKey.anchor_fans_team_member_info.getKey(teamUid.toString()); - jedisService.hset(memberInfoKey, memberUid.toString(), gson.toJson(member)); - - // 增加亲密值账单记录 - AnchorFansExperRecord record = new AnchorFansExperRecord(); - record.setCreateTime(date); - record.setExperAmount(exper); - record.setUid(memberUid); - record.setTargetUid(teamUid); - record.setBillType(FansBillObjTypeEnum.DAY_WATCH_ANCHOR_SINGLE.getValue()); - anchorFansExperRecordService.save(record); - - // 亲密度榜单数据增加 - String rankKey = RedisKey.anchor_fans_team_rank.getKey(teamUid.toString()); - jedisService.zincrby(rankKey, exper.doubleValue(), member.getMemberUid().toString()); - // 一周内活跃用户缓存标识key增加 - Date monday = WeekUtil.getFirstDayOfWeek(date); - String weekStr = DateTimeUtil.convertDate(monday, DateTimeUtil.DEFAULT_DATE_PATTERN); - String activeKey = RedisKey.anchor_fans_team_play_once_week.getKey(teamUid + StrUtil.UNDERLINE + weekStr); - if (!jedisService.exits(activeKey)) { - // 一周过期 - jedisService.sadd(activeKey, member.getMemberUid().toString()); - jedisService.expire(activeKey, 14 * 24 * 60 * 60); - } else { - // 不活跃转换为活跃状态 铭牌回显正常设置 - if (jedisService.sismember(activeKey, member.getMemberUid().toString())) { - return; - } - // 设置活跃标识 - jedisService.sadd(activeKey, member.getMemberUid().toString()); - // 更新图片 - UserNameplateVo nameplateVo = userNameplateService.getUserUsingNameplateVo(memberUid); - if (nameplateVo == null) { - return; - } - // 如果用户穿戴粉丝铭牌, 活跃后更新铭牌活跃状态 - if (nameplateVo.getType() != null && nameplateVo.getType().equals(NameplateStyleTypeEnum.ANCHOR_FANS_MP_SEND.getValue()) - && nameplateVo.getFixedWord().equals(team.getTeamName())) { - String mpPic = this.getAnchorFansMpPicWithMemberStatus(team.getUid(), memberUid); - if (org.apache.commons.lang3.StringUtils.isNotBlank(mpPic)) { - nameplateVo.setNameplateImage(mpPic); - jedisService.hset(RedisKey.user_using_nameplate.getKey(), member.getMemberUid().toString(), gson.toJson(nameplateVo)); - jedisService.hdel(RedisKey.user_summary.getKey(), member.getMemberUid().toString()); - } - } - } - - - } - - private Long cacluExper(Long originDuration, Long incrDuration, AnchorFansTask task, String todayStr) { - Long exper = 0L; - Long duration = originDuration + incrDuration; - - for (int i = 1; i <= task.getLimitNum(); i++) { - long unitMs = i * task.getOnceVal() * 60 * 1000l; - if (originDuration < unitMs && duration >= unitMs) { - exper += task.getAwardVal().longValue(); - } - } - return exper; - } - - /** - * 删除粉丝团的指定成员缓存数据 - * - * @param teamUid - * @param memberUid - */ - private void delAnchorFansTeamMemberCash(Long teamUid, Long memberUid) { - String key = RedisKey.anchor_fans_team_member_info.getKey(teamUid.toString()); - jedisService.hdel(key, memberUid.toString()); - } - - /** - * 赠送入团礼物 - * - * @param teamId - * @param memberUid - */ - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - public void sendJoinFansTeamMpAndGift(Long teamId, Long memberUid) { - log.info("赠送入团礼物开始...."); - Date date = new Date(); - AnchorFansTeam team = getAnchorFansTeamByTeamId(teamId); - Users anchor = usersService.getUsersByUid(team.getUid()); - // 赠送专属铭牌 - List nameplateConfigList = anchorFansPrivilegeConfigService.getPrivilegeConfigListByType(Constant.AnchorFansTeamPrivilegeType.nameplate); - Map privilegeConfigMap = nameplateConfigList.stream().collect(Collectors.toMap(AnchorFansPrivilegeConfig::getId, a -> a)); - - // 获取粉丝团生成的铭牌数据 - log.info("获取所有的粉丝团铭牌信息....teamUid:{},memberUid:{}", team.getUid(), memberUid); - List mpPics = anchorFansTeamMpPicService.getLevelMpPicsByGuardsTeamId(teamId); - Map mpPicMap = mpPics.stream().collect(Collectors.toMap(AnchorFansTeamMpPic::getLevelSeq, a -> a)); - Integer levelSeq = getFansLevelSeqByMemberUid(teamId, memberUid); - AnchorFansTeamMpPic mpPic = mpPicMap.get(levelSeq); - if (mpPic == null) { - log.info("找不到该粉丝团对应等级的铭牌数据...粉丝团id:{}, 粉丝团成员id:{}, 等级levelSeq:{}", teamId, memberUid, levelSeq); - return; - } - Integer privilegeId = mpPic.getPrivilegeId(); - AnchorFansPrivilegeConfig nameplateConfig = privilegeConfigMap.get(privilegeId); - if (nameplateConfig == null) { - log.info("找不到该粉丝团申请的铭牌配置...粉丝团id:{}, 粉丝团成员id:{}", teamId, memberUid); - return; - } - // 获取配置的铭牌id - Long nameplateId = nameplateConfig.getNormalId(); - log.info("开始赠送粉丝铭牌 粉丝团id:{}, 粉丝团成员id:{}, 铭牌id:{}", teamId, memberUid, nameplateId); - UserNameplate userNameplate = userNameplateMapper.getUserNameplateListByNameplateIdAndWord(memberUid, nameplateId, team.getTeamName()); - if (userNameplate == null) { - userNameplate = new UserNameplate(); - userNameplate.setWord(team.getTeamName()); - userNameplate.setNameplateId(nameplateId); - userNameplate.setUid(memberUid); - userNameplate.setType(Constant.namePlateType.ANCHOR_FANS_TEAM_SEND); - userNameplate.setCreateTime(date); - userNameplate.setUpdateTime(date); - userNameplate.setExpireTime(DateUtil.addDays(date, Constant.AnchorFansTeamDefaultVal.expireDays)); - userNameplate.setNameplateImage(mpPic.getFansMpPic()); - userNameplateMapper.insert(userNameplate); - } else { - userNameplate.setExpireTime(DateTimeUtil.addDays(userNameplate.getExpireTime(), Constant.AnchorFansTeamDefaultVal.expireDays)); - userNameplateMapper.updateById(userNameplate); - } - log.info("赠送粉丝铭牌成功 粉丝团id:{}, 粉丝团成员id:{}, 铭牌id:{}", teamId, memberUid, nameplateId); - - - log.info("赠送粉丝专属礼物开始 粉丝团id:{}, 粉丝团成员id:{}", teamId, memberUid); - // 赠送专属礼物 - List exclusiveGiftConfigList = anchorFansPrivilegeConfigService.getPrivilegeConfigListByType(Constant.AnchorFansTeamPrivilegeType.exclusive_gift); - if (CollectionUtils.isEmpty(exclusiveGiftConfigList)) { - log.info("找不到对应特权礼物赠送配置...粉丝团id:{}, 粉丝团成员id:{}", teamId, memberUid); - return; - } - - // 发送小秘书消息 - sendUserNameplateMsg(memberUid, String.format(Constant.AnchorFansTeamDefaultVal.join_fans_team_word, anchor.getNick())); - for (AnchorFansPrivilegeConfig exclusiveGiftConfig : exclusiveGiftConfigList) { - Integer giftId = exclusiveGiftConfig.getNormalId().intValue(); - UserBackpackParam param = new UserBackpackParam(); - Gift gift = giftService.getGiftByIdFromDb(giftId); - if (gift == null) { - log.info("赠送失败,找不到对应特权礼物...粉丝团id:{}, 粉丝团成员id:{}, 礼物id: {}", teamId, memberUid, giftId); - return; - } - - - // 赠送入团礼物 - // 系统每日赠送入团礼物标识 - String key = RedisKey.anchor_fans_team_daily_sys_send_design_gift.getKey(DateTimeUtil.getTodayStr() + StrUtil.UNDERLINE + giftId); - if (!jedisService.exits(key)) { - jedisService.sadd(key, memberUid.toString()); - jedisService.expire(key, 24 * 60 * 60); - } else { - boolean sismember = jedisService.sismember(key, memberUid.toString()); - if (sismember) { - // 今日已派发...不再派送专属礼物 - log.info("今日该成员已派发过专属礼物...不再派送 memberUid:{}", memberUid); - return; - } - jedisService.sadd(key, memberUid.toString()); - } - - param.setGiftId(giftId); - param.setGiftType(gift.getGiftType()); - param.setUid(memberUid); - param.setCount(Constant.AnchorFansTeamDefaultVal.join_fans_team_gift_num); - param.setGiftSeq(gift.getSeqNo()); - - userBackpackService.saveOrUpdateUserBackpackByFansDesignGift(param); - } - - - log.info("赠送入团礼物结束...."); - } - - - @Override - public AnchorFansTeam getAnchorFansTeamByTeamId(Long teamId) { - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.lambda().eq(AnchorFansTeam::getStatus, Constant.AnchorFansTeamStatus.vaild).eq(AnchorFansTeam::getId, teamId); - return baseMapper.selectOne(wrapper); - } - - @Async - public void sendUserNameplateMsg(Long uid, String message) { - NeteaseSendMsgParam msg = new NeteaseSendMsgParam(); - msg.setOpe(0); - msg.setType(0); - msg.setFrom(SystemConfig.secretaryUid); - msg.setTo(String.valueOf(uid)); - msg.setBody(message); - // 设置易盾文本不检测 - msg.setUseYidun(0); - sendSysMsgService.sendMsg(msg); - } - - - @Override - public void generateAnchorFansTeamMpPicAndMemberPic(Byte mpStatus, Integer privilegeId, Long oldNameplateId, Long teamId, String oldMpTx) throws IOException { - // 批量更新对应的等级图片, 查询当前的所有成员 更新对应的铭牌图片 如果穿戴了该铭牌 再更新其铭牌 - // 更新团队图片 - StopWatch stopWatch = new StopWatch(); - stopWatch.start(); - - AnchorFansTeam team = getAnchorFansTeamByTeamId(teamId); - if (team == null) { - log.info("该粉丝团不存在或已删除, 粉丝团id:{}", teamId); - return; - } - - String mpTx = team.getTeamName(); - log.info("粉丝团id:{}, 旧铭牌名称:{}, 新铭牌名称:{}", teamId, oldMpTx, mpTx); - - AnchorFansPrivilegeConfig privilegeConfig = anchorFansPrivilegeConfigService.getById(privilegeId); - if (!Constant.AnchorFansTeamPrivilegeType.nameplate.equals(privilegeConfig.getType())) { - log.info("对应的特权不是铭牌, 无法生成图片, 粉丝团id:{},旧铭牌名称:{}, 新铭牌名称:{} ", teamId, oldMpTx, mpTx); - return; - } - - - Long normalId = privilegeConfig.getNormalId(); - Long activeId = privilegeConfig.getActiveId(); - Long negativeId = privilegeConfig.getNegativeId(); - if (normalId == null || activeId == null || negativeId == null) { - log.info("粉丝铭牌特权配置的粉丝铭牌为 null, 铭牌生成失败, 旧铭牌名称:{}, 新铭牌名称:{} ", teamId, oldMpTx, mpTx); - return; - } - - Nameplate normalNameplate = nameplateMapper.selectById(normalId); - Nameplate activeNameplate = nameplateMapper.selectById(activeId); - Nameplate negativeNameplate = nameplateMapper.selectById(privilegeConfig.getNegativeId()); - if (normalNameplate == null || activeNameplate == null || negativeNameplate == null) { - log.info("配置的粉丝铭牌为 null, 铭牌生成失败, 粉丝团id:{}, 旧铭牌名称:{}, 新铭牌名称:{} ", teamId, oldMpTx, mpTx); - return; - } - - String icon = null; - String preName = null; - if (Constant.AnchorFansMemberMpStatus.negative.equals(mpStatus)) { - icon = negativeNameplate.getIconPic(); - preName = Constant.AnchorFansMpFileNamePrefix.prefix_mp_negative_name; - } else if (Constant.AnchorFansMemberMpStatus.active.equals(mpStatus)) { - icon = activeNameplate.getIconPic(); - preName = Constant.AnchorFansMpFileNamePrefix.prefix_mp_active_name; - } else if (Constant.AnchorFansMemberMpStatus.narmal.equals(mpStatus)) { - icon = normalNameplate.getIconPic(); - preName = Constant.AnchorFansMpFileNamePrefix.prefix_mp_nomal_name; - } - - List levelList = anchorFansLevelExperienceService.list(); - if (CollectionUtil.isEmpty(levelList)) return; - - String curTime = DateTimeUtil.convertDate(new Date(), DATE_PATTERN); - int randomNum = (int) (Math.random() * 900) + 100; - // 获取月日 + 随机数拼接成 - randomNum = Integer.parseInt(curTime + randomNum); - Font wordFont = PicAddTextMarkUtils.loadWordFont(PicAddTextMarkUtils.ZH_EN_WORD_FONT_STYLE, 18F); - Font levelFont = PicAddTextMarkUtils.loadWordFont(PicAddTextMarkUtils.ZH_EN_ICON_FONT_STYLE, 24F); - Date date = new Date(); - // key: levelId - Map teamLevelPicMap = new LinkedHashMap<>(); - // key: levelSeq - Map nowTeamLevelMpPicMap = new LinkedHashMap<>(); - List mpPicList = anchorFansTeamMpPicService.getLevelMpPicsByGuardsTeamId(teamId); - if (CollectionUtil.isNotEmpty(mpPicList)) { - teamLevelPicMap = mpPicList.stream().collect(Collectors.toMap(AnchorFansTeamMpPic::getLevelSeq, a -> a)); - mpPicList = new ArrayList<>(); - } - for (AnchorFansLevelExperience level : levelList) { - InputStream uploadStream = null; - // 更新对应的等级铭牌信息 - AnchorFansTeamMpPic mpPic = teamLevelPicMap.get(level.getLevelSeq()); - - try (InputStream inputStream = FileUtils.downloadFileInputStream(icon); - ByteArrayOutputStream baos = new ByteArrayOutputStream(); ImageOutputStream imOut = ImageIO.createImageOutputStream(baos)) { - BufferedImage bufImg = PicAddTextAnchorFansMpMarkUtils.addTextToPic(mpStatus, inputStream, mpTx, level.getLevelSeq(), wordFont, levelFont); - if (bufImg == null) continue; - ImageIO.write(bufImg, "png", imOut); - uploadStream = new ByteArrayInputStream(baos.toByteArray()); - String key = String.format(preName, randomNum + StrUtil.UNDERLINE + team.getUid() + StrUtil.UNDERLINE + level.getLevelSeq() + ".png"); - qinniuService.uploadByStreamReplace(uploadStream, key, key); - - // 更新对应的等级铭牌信息 - if (mpPic != null) { - if (Constant.AnchorFansMemberMpStatus.negative.equals(mpStatus)) { - mpPic.setNegativeMpPic(QiNiuConfig.accessUrl + key); - } else if (Constant.AnchorFansMemberMpStatus.active.equals(mpStatus)) { - mpPic.setActiveMpPic(QiNiuConfig.accessUrl + key); - } else if (Constant.AnchorFansMemberMpStatus.narmal.equals(mpStatus)) { - mpPic.setFansMpPic(QiNiuConfig.accessUrl + key); - } - mpPic.setUpdateTime(date); - } else { - mpPic = new AnchorFansTeamMpPic(); - if (Constant.AnchorFansMemberMpStatus.negative.equals(mpStatus)) { - mpPic.setNegativeMpPic(QiNiuConfig.accessUrl + key); - } else if (Constant.AnchorFansMemberMpStatus.active.equals(mpStatus)) { - mpPic.setActiveMpPic(QiNiuConfig.accessUrl + key); - } else if (Constant.AnchorFansMemberMpStatus.narmal.equals(mpStatus)) { - mpPic.setFansMpPic(QiNiuConfig.accessUrl + key); - } - mpPic.setPrivilegeId(privilegeId); - mpPic.setLevelSeq(level.getId()); - mpPic.setTeamId(teamId); - mpPic.setCreateTime(date); - mpPic.setUpdateTime(date); - } - } catch (Exception e) { - log.error("粉丝团生成图片异常:{}", e.getMessage()); - e.printStackTrace(); - } finally { - if (uploadStream != null) uploadStream.close(); - } - - mpPicList.add(mpPic); - nowTeamLevelMpPicMap.put(level.getLevelSeq(), mpPic); - } - - - // 更新/插入 - List saveGuardsMpList = mpPicList.stream().filter(it -> it.getId() == null).collect(Collectors.toList()); - List updateGuardsMpList = mpPicList.stream().filter(it -> it.getId() != null).collect(Collectors.toList()); - if (CollectionUtil.isNotEmpty(saveGuardsMpList)) { - anchorFansTeamMpPicService.saveBatchAnchorFansTeamMpPicList(saveGuardsMpList); - } - if (CollectionUtil.isNotEmpty(updateGuardsMpList)) { - anchorFansTeamMpPicService.updateBatchAnchorFansTeamMpPicList(updateGuardsMpList); - - if (mpStatus.equals(Constant.AnchorFansMemberMpStatus.narmal) && oldNameplateId != null) { - // 更新成员铭牌数据 - List members = anchorFansTeamMemberService.getTeamMemberListByTeamId(teamId); - // 获取napelateId 和 word 一致的铭牌 - List userNameplates = userNameplateMapper.getUserFansNampelateByUids(oldNameplateId, oldMpTx); - Map nameplateMap = userNameplates.stream().collect(Collectors.toMap(UserNameplate::getUid, a -> a)); - List saveOrUpdateNameplates = new ArrayList<>(); - for (AnchorFansTeamMember member : members) { - UserNameplate userNameplate = nameplateMap.get(member.getMemberUid()); - UserNameplate nameplate = new UserNameplate(); - AnchorFansTeamMpPic mpPic = anchorFansTeamMpPicService.getLevelMpPicsByGuardsTeamIdAndLevelSeq(teamId, member.getLevelSeq()); - if (mpPic == null) { - log.info("获取不到对应的成员等级铭牌:memberUid:{},teamUid:{}", member.getMemberUid(), team.getUid()); - continue; - } - if (userNameplate != null) { - // 更新数据数据 - nameplate.setId(userNameplate.getId()); - nameplate.setUpdateTime(date); - } else { - // 保险起见 是其成员,却无对应铭牌 则生成一个 - nameplate.setType(Constant.namePlateType.ANCHOR_FANS_TEAM_SEND); - nameplate.setUpdateTime(date); - nameplate.setCreateTime(date); - nameplate.setExpireTime(DateTimeUtil.addDays(new Date(), Constant.AnchorFansTeamDefaultVal.expireDays)); - nameplate.setUid(member.getMemberUid()); - } - nameplate.setNameplateId(normalId); - nameplate.setNameplateImage(mpPic.getFansMpPic()); - String teamName = team.getTeamName(); - log.info("normalId : {}, teamName : {}", normalId, teamName); - nameplate.setRemark(teamName); - nameplate.setWord(StrUtil.SPACE); - saveOrUpdateNameplates.add(nameplate); - } - - // 更新/插入 - List saveUserMpList = saveOrUpdateNameplates.stream().filter(it -> it.getId() == null).collect(Collectors.toList()); - List updateUserMpList = saveOrUpdateNameplates.stream().filter(it -> it.getId() != null).collect(Collectors.toList()); - if (CollectionUtil.isNotEmpty(saveUserMpList)) { - userNameplateMapper.batchSaveUserNameplateList(saveUserMpList); - } - if (CollectionUtil.isNotEmpty(updateUserMpList)) { - userNameplateMapper.batchUpdateUserNameplateList(updateUserMpList); - } - } - } - - - stopWatch.stop(); - - log.info("用户铭牌数据更新完成..."); - log.info("{}", stopWatch.prettyPrint()); - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/audiocard/AudioCardService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/audiocard/AudioCardService.java deleted file mode 100644 index 092d30b15..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/audiocard/AudioCardService.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.accompany.business.service.audiocard; - -import com.accompany.business.model.audiocard.UserAudioCard; -import com.accompany.business.mybatismapper.audiocard.AudioCardMapper; -import com.accompany.common.constant.Constant; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.status.BusiStatus; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.vo.audiocard.UserAudioCardVo; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.redisson.api.RMap; -import org.redisson.api.RedissonClient; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.InitializingBean; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.Date; - -@Service -public class AudioCardService extends ServiceImpl implements InitializingBean { - - @Autowired - private RedissonClient redissonClient; - - private RMap cacheMap; - - public UserAudioCard get(Long uid){ - UserAudioCard cacheDb = cacheMap.get(uid); - if (null != cacheDb){ - return cacheDb; - } - cacheDb = lambdaQuery().eq(UserAudioCard::getUid, uid) - .orderByDesc(UserAudioCard::getCreateTime) - .last("limit 1") - .one(); - if (null != cacheDb){ - cacheMap.fastPut(uid, cacheDb); - } - return cacheDb; - } - - public UserAudioCardVo getVo(Long me, Long uid) { - UserAudioCardVo vo = new UserAudioCardVo(); - UserAudioCard db = get(uid); - if (null == db || (!me.equals(uid) && !Constant.UserAudioCard.pass.equals(db.getStatus()))){ - vo.setUid(uid); - vo.setStatus(Constant.UserAudioCard.no); - return vo; - } - BeanUtils.copyProperties(db, vo); - return vo; - } - - @Transactional(rollbackFor = Exception.class) - public void save(Long me, UserAudioCardVo vo) { - Date now = new Date(); - - UserAudioCard old = get(me); - if (null != old && (Constant.UserAudioCard.pass.equals(old.getStatus()) || Constant.UserAudioCard.no_pass.equals(old.getStatus()))) { - UserAudioCard entry = new UserAudioCard(); - entry.setId(old.getId()); - entry.setUpdateTime(now); - entry.setIsDel(true); - updateById(entry); - } - - UserAudioCard db = null == old || !Constant.UserAudioCard.upload.equals(old.getStatus())? - new UserAudioCard(): old; - db.setUid(me); - db.setAudioUrl(vo.getAudioUrl()); - db.setSecond(vo.getSecond()); - db.setCreateTime(now); - db.setUpdateTime(now); - db.setStatus(Constant.UserAudioCard.upload); - db.setAuditor(null); - db.setAuditTime(null); - db.setIsDel(false); - if (saveOrUpdate(db)){ - cacheMap.fastPut(me, db); - } - } - - public void del(Long me) { - UserAudioCard db = get(me); - if (null == db){ - throw new ServiceException(BusiStatus.PARAMERROR); - } - - boolean result = false; - if (Constant.UserAudioCard.upload.equals(db.getStatus())){ - result = removeById(db.getId()); - } else { - UserAudioCard entry = new UserAudioCard(); - entry.setId(db.getId()); - entry.setStatus(Constant.UserAudioCard.delete); - entry.setUpdateTime(new Date()); - entry.setIsDel(true); - result = updateById(entry); - } - - if (result){ - cacheMap.fastRemove(me); - } - } - - @Override - public void afterPropertiesSet() throws Exception { - cacheMap = redissonClient.getMap(RedisKey.user_audio_card.getKey()); - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/charge/LuckyTarotChargeService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/charge/LuckyTarotChargeService.java deleted file mode 100644 index 53ea28bee..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/charge/LuckyTarotChargeService.java +++ /dev/null @@ -1,457 +0,0 @@ -package com.accompany.business.service.charge; - -import com.accompany.business.dto.LuckyTarotConfig; -import com.accompany.business.model.Headwear; -import com.accompany.business.model.UserHeadwear; -import com.accompany.business.model.UserLevelExperience; -import com.accompany.business.param.neteasepush.NeteaseSendMsgParam; -import com.accompany.business.service.SendSysMsgService; -import com.accompany.business.service.firstpage.FirstPageBannerService; -import com.accompany.business.service.headwear.HeadwearService; -import com.accompany.business.service.level.LevelService; -import com.accompany.business.service.room.RoomService; -import com.accompany.business.service.user.UsersService; -import com.accompany.business.vo.firstpage.FirstPageBannerVo; -import com.accompany.business.vo.tarot.TarotChargeMessage; -import com.accompany.business.vo.tarot.TarotHeadwearShowVo; -import com.accompany.business.vo.tarot.TarotHeadwearVo; -import com.accompany.common.config.SystemConfig; -import com.accompany.common.constant.Attach; -import com.accompany.common.constant.Constant; -import com.accompany.common.device.DeviceInfo; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.*; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.model.Room; -import com.accompany.core.model.Users; -import com.accompany.core.service.SysConfService; -import com.accompany.core.service.base.BaseService; -import com.accompany.core.service.user.UsersBaseService; -import com.accompany.core.vo.BaseResponseVO; -import com.accompany.payment.model.ChargeProd; -import com.accompany.payment.model.LuckyTarotRecord; -import com.accompany.payment.service.ChargeProdService; -import com.accompany.payment.service.ChargeRecordService; -import com.accompany.payment.service.LuckyTarotRecordService; -import com.accompany.payment.service.PayCenterService; -import com.accompany.payment.vo.LuckyTarotRecordVo; -import com.google.gson.reflect.TypeToken; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import java.util.*; - -/** - * @Author: yangming - * @Date: 2019/11/4 17:23 - * @Description: 幸运塔罗充值 - **/ -@Slf4j -@Service -public class LuckyTarotChargeService extends BaseService { - - @Autowired - private UsersService usersService; - @Autowired - private RoomService roomService; - @Autowired - private ChargeProdService chargeProdService; - @Autowired - private PayCenterService payCenterService; - @Autowired - private SysConfService sysConfService; - @Autowired - private HeadwearService headwearService; - @Autowired - private SendSysMsgService sendSysMsgService; - @Autowired - private LuckyTarotRecordService luckyTarotRecordService; - @Autowired - private LevelService levelService; - @Autowired - private FirstPageBannerService firstPageBannerService; - @Autowired - private EnvComponent envComponent; - @Autowired - private UsersBaseService usersBaseService; - @Autowired - private ChargeRecordService chargeRecordService; - - - /** - * 幸运塔罗充值 - * @param uid - * @param roomUid - * @param cardList - * @param chargeProdId - * @param channel - * @param clientIp - * @param successUrl - * @param deviceInfo - * @return - * @throws Exception - */ - public BaseResponseVO tarotCharge(Long uid, Long roomUid, String cardList, String chargeProdId, String channel, - String clientIp, String successUrl, DeviceInfo deviceInfo) throws Exception{ - //用户信息 - Users users = usersService.getUsersByUid(uid); - if(users == null){ - return new BaseResponseVO(BusiStatus.USERNOTEXISTS); - } - - // 用户等级 - LuckyTarotConfig luckyTarotConfig = getLuckyTarotConfig(); - if (null != luckyTarotConfig) { - UserLevelExperience userExper = levelService.getUserExper(uid); - if (null == userExper - || userExper.getLevelExperience() == null || userExper.getLevelExperience().getLevelSeq().compareTo(luckyTarotConfig.getLimitLevelSeq()) < 0) { - throw new ServiceException(BusiStatus.NOT_ENOUGH_LEVEL); - } - } - - //房间信息 - if(roomUid != null){ - Room room = roomService.getRoomByUid(roomUid); - if(room == null){ - return new BaseResponseVO(BusiStatus.ROOMNOTEXIST); - } - } - //塔罗牌信息 - List cardNo = gson.fromJson(cardList,new TypeToken>() {}.getType()); - if(CollectionUtils.isEmpty(cardNo)){ - return new BaseResponseVO(BusiStatus.AT_LEAST_ONE_CARD); - } - //充值产品信息(初级,中级,高级) - ChargeProd chargeProd = chargeProdService.getChargeProdById(chargeProdId); - if(chargeProd == null || !chargeProd.getProdStatus().equals(Constant.ChargeProdStatus.using)){ - return new BaseResponseVO(BusiStatus.CHARGE_PROD_NOT_ALLOWED); - } - - //产品单价(单位:元) - Long money = chargeProd.getMoney(); - Long chargeAmount = money * cardNo.size(); - - //今日塔罗充值金额 - Long usedAmount = this.getUserTarotChargeAmount(uid,Calendar.getInstance().getTime()); - Boolean goldLimit = Optional.ofNullable(Boolean.parseBoolean( - sysConfService.getSysConfValueById(Constant.SysConfId.TAROT_CHARGE_LIMIT_SWITCH))) - .orElse(Boolean.FALSE); - if (goldLimit) { - //默认十万元 - String amount = sysConfService.getDefaultSysConfValueById(Constant.SysConfId.TAROT_CHARGE_LIMIT_AMOUNT, - "100000"); - if(usedAmount + chargeAmount > Long.parseLong(amount)){ - return new BaseResponseVO(BusiStatus.TAROT_CHARGE_LIMIT); - } - } - - LuckyTarotRecord luckyTarotRecord = this.buildLuckyTarotRecord(uid, roomUid, cardNo, chargeAmount, chargeProdId); - - return payCenterService.createTarotOrder(uid, luckyTarotRecord, channel, - clientIp, chargeProd, users.getRealName(), users.getIdCardNum(), successUrl, deviceInfo); - } - - /** - * 创建幸运塔罗记录 - * @param uid - * @param roomUid - * @param cardNo - * @param chargeProdId - * @return - */ - private LuckyTarotRecord buildLuckyTarotRecord(Long uid, Long roomUid, List cardNo, Long chargeAmount, - String chargeProdId){ - LuckyTarotRecord luckyTarotRecord = new LuckyTarotRecord(); - luckyTarotRecord.setRecordId(UUIDUtil.get()); - luckyTarotRecord.setUid(uid); - luckyTarotRecord.setRoomUid(roomUid); - luckyTarotRecord.setSelectdNo(gson.toJson(cardNo)); - luckyTarotRecord.setSelectdNoNum(cardNo.size()); - luckyTarotRecord.setChargeProdId(chargeProdId); - luckyTarotRecord.setChargeMoney(chargeAmount); - luckyTarotRecord.setCreateTime(new Date()); - return luckyTarotRecord; - } - - - /** - * 发送中奖结果给用户(包括头饰和小秘书以及房间消息) - * @param luckyTarotRecord - */ - @Async - public void sendDrawResultToUsers(LuckyTarotRecord luckyTarotRecord){ - try { - Long uid = luckyTarotRecord.getUid(); - String sendHeadwear = sysConfService.getSysConfValueById(Constant.SysConfId.TAROT_SEND_HEADWEAR); - if (StringUtils.isBlank(sendHeadwear)) { - log.error("塔罗赠送头饰配置为空"); - return; - } - String chargeProdId = luckyTarotRecord.getChargeProdId(); - Integer headwearId = null; - List tarotHeadwearVo = gson.fromJson(sendHeadwear, - new TypeToken>(){}.getType()); - for(TarotHeadwearVo tarotHeadwear : tarotHeadwearVo){ - if(tarotHeadwear.getChargeProdId().equalsIgnoreCase(chargeProdId)){ - headwearId = tarotHeadwear.getHeadwearId(); - break; - } - } - if(headwearId == null){ - log.warn("没有配置该产品应该赠送的头饰!chargeProdId={}",chargeProdId); - return; - } - List cardNo = gson.fromJson(luckyTarotRecord.getSelectdNo(), - new TypeToken>(){}.getType()); - int cardNum = luckyTarotRecord.getSelectdNoNum().intValue(); - //是否中奖 - boolean isDraw = luckyTarotRecord.getDrawStatus().equals(Constant.LuckyTarotStatus.success); - - //送头饰(抽几张牌送几天头饰) - Headwear headwear = sendHeadwear(uid,headwearId,cardNum); - //发送小秘书 - sendDrawMsg(uid,headwear.getName(),cardNo,luckyTarotRecord.getDrawNum(), isDraw,cardNum); - //发房间消息 - Long roomUid = luckyTarotRecord.getRoomUid(); - if(roomUid != null && isDraw){ - TarotChargeMessage message = buildTarotChargeMessage(uid,roomUid,luckyTarotRecord.getChargeProdId(), - luckyTarotRecord.getGoldNum()); - sendRoomMsg(roomUid,gson.toJson(message)); - } - - }catch (Exception e){ - log.error("sendDrawResultToUsers error,errorMsg:",e); - } - } - - /** - * 送头饰 - * @param uid - * @param headwearId - * @param headwearNum - * @return - */ - private Headwear sendHeadwear(Long uid, Integer headwearId, int headwearNum){ - - Headwear headwear = headwearService.getHeadwearFromDb(headwearId); - - if (headwear == null) { - throw new ServiceException(BusiStatus.HEADWEAR_NOT_EXISTS); - } - - UserHeadwear userHeadwear = headwearService.getUserHeardwear(uid, headwearId); - this.headwearService.officialSendHeadWearSingle(headwearId, uid, headwearNum); - return headwear; - } - - /** - * 构建中奖的房间消息 - * @param uid - * @param roomUid - * @param chargeProdId - * @param drawNum - * @return - */ - private TarotChargeMessage buildTarotChargeMessage(Long uid, Long roomUid, String chargeProdId, Long drawNum){ - - TarotChargeMessage message = new TarotChargeMessage(); - Users users = usersService.getUsersByUid(uid); - message.setUid(uid); - message.setNick(users == null ? "神秘人" : users.getNick()); - message.setRoomUid(roomUid); - message.setChargeProdId(chargeProdId); - message.setDrawGoldNum(drawNum); - String drawMsgText = sysConfService.getDefaultSysConfValueById(Constant.SysConfId.TAROT_DRAW_ROOM_MSG_TEXT, "在塔罗占卜中运气爆发,收获"); - message.setDrawMsgText(drawMsgText.trim()); - return message; - } - /** - * 将中奖消息发送到房间 - * @param roomUid - * @param msg - */ - private void sendRoomMsg(Long roomUid, String msg){ - Room room = roomService.getRoomByUid(roomUid); - if (room == null) { - logger.error("Failed to send tarot msg to room. Cause by can't find this room. roomUid=[{}]", roomUid); - return; - } - - Attach attach = new Attach(); - attach.setFirst(Constant.DefineProtocol.CUSTOM_MESS_TAROT); - attach.setSecond(Constant.DefineProtocol.CUSTOM_MESS_TAROT_SUCCESS); - attach.setMessage(msg); - - sendSysMsgService.sendSingleRoomMessage(room, attach); - } - - /** - * 发送小秘书消息 - * @param uid - * @param headwearName - * @param cardNo - * @param drawNum - * @param isDraw - * @param headwearNum - */ - private void sendDrawMsg(Long uid, String headwearName, List cardNo, int drawNum, - boolean isDraw, int headwearNum){ - try { - String result = "未中獎"; - String wish = ""; - if(isDraw){ - result = "中獎"; - wish = "繼續"; - } - String msg = "您在塔羅占卜里%s。您選擇了%s,開獎幸運数字是%s,祝您下次%s好運!同時%s頭飾*%s已發放到您的裝扮"; - String content = String.format(msg,result,String.join(",",cardNo),drawNum,wish,headwearName,headwearNum); - NeteaseSendMsgParam neteaseSendMsgParam = new NeteaseSendMsgParam(); - neteaseSendMsgParam.setFrom(SystemConfig.secretaryUid); - neteaseSendMsgParam.setTo(uid.toString()); - //点对点个人消息 - neteaseSendMsgParam.setOpe(0); - //文本消息 - neteaseSendMsgParam.setType(0); - - neteaseSendMsgParam.setBody(content); - sendSysMsgService.sendMsg(neteaseSendMsgParam); - }catch (Exception e){ - log.error("sendDrawMsg error,error:",e); - } - } - - /** - * 获取最近二十条中奖信息 - * @param count - * @return - */ - public BaseResponseVO getDrawList(Integer count){ - List recordVos = luckyTarotRecordService.getDrawList(count); - return new BaseResponseVO(BusiStatus.SUCCESS,recordVos); - } - - /** - * 根据外部订单号查询中奖结果 - * @param uid - * @param chargeRecordId - * @return - */ - public BaseResponseVO getDrawResult(Long uid, String chargeRecordId){ - LuckyTarotRecord luckyTarotRecord = luckyTarotRecordService.getLuckyTarotRecordByOutTradeNo(uid,chargeRecordId); - return new BaseResponseVO(BusiStatus.SUCCESS,luckyTarotRecord); - } - - public BaseResponseVO getUserDrawRecord(Long uid, Integer page, Integer pageSize){ - List recordVos = luckyTarotRecordService.getUserDrawRecord(uid,page,pageSize); - return new BaseResponseVO(BusiStatus.SUCCESS,recordVos); - } - - /** - * 获取用户每日买锤子消耗的金币数 - * @param uid - * @param time - * @return - */ - public Long getUserTarotChargeAmount(Long uid, Date time){ - String dateStr = DateTimeUtil.convertDate(time,DateTimeUtil.DEFAULT_DATE_PATTERN_); - String key = RedisKey.daily_tarot_cost.getKey(dateStr); - String amount = jedisService.hget(key,uid.toString()); - return amount == null ? 0L : Long.parseLong(amount); - } - - /** - * 统计今日塔罗充值金额 - * @param uid - * @param chargeMoney - * @param time - */ - public void countUserTarotChargeAmount(Long uid, Long chargeMoney, Date time){ - String dateStr = DateTimeUtil.convertDate(time,DateTimeUtil.DEFAULT_DATE_PATTERN_); - String key = RedisKey.daily_tarot_cost.getKey(dateStr); - jedisService.hincrBy(key,uid.toString(),chargeMoney); - long expireTime = GetTimeUtils.getTimesnight(24).getTime() - 1; - //24小时之后过期 - jedisService.expireAt(key,expireTime); - } - - public BaseResponseVO getTarotHeadwear(){ - String headwear = sysConfService.getSysConfValueById(Constant.SysConfId.TAROT_SEND_HEADWEAR); - if (StringUtils.isBlank(headwear)) { - log.error("塔罗赠送头饰配置为空"); - return new BaseResponseVO(BusiStatus.NOTEXISTS); - } - List showVoList = new ArrayList<>(); - List tarotHeadwearVo = gson.fromJson(headwear, - new TypeToken>(){}.getType()); - for(TarotHeadwearVo vo : tarotHeadwearVo){ - TarotHeadwearShowVo showVo = new TarotHeadwearShowVo(vo); - Headwear tarotHeadwear = headwearService.getHeadwearFromDb(vo.getHeadwearId()); - if(tarotHeadwear != null){ - showVo.setHeadwear(tarotHeadwear); - } - showVoList.add(showVo); - } - return new BaseResponseVO(BusiStatus.SUCCESS,showVoList); - } - - /** - * 幸运塔罗活动是否开启 - * @return - */ - public void checkLuckyTarotIsOpen() { - LuckyTarotConfig config = getLuckyTarotConfig(); - logger.debug("LuckyTarotConfig: {}", config); - boolean isOpen = config.getIsOpen() && config.getActId() != null; - if (!isOpen) { - throw new ServiceException(BusiStatus.ACTIVITYNOTSTART); - } - } - - /** - * 获取幸运塔罗活动配置 - * @return - */ - public LuckyTarotConfig getLuckyTarotConfig() { - LuckyTarotConfig config = new LuckyTarotConfig(); - boolean isOpen = Boolean.valueOf(sysConfService.getDefaultSysConfValueById(Constant.SysConfId.LUCKY_TAROT_SWITCH, "false")); - config.setIsOpen(isOpen); - String sendHeadwear = sysConfService.getSysConfValueById(Constant.SysConfId.TAROT_SEND_HEADWEAR); - if (StringUtils.isNotBlank(sendHeadwear)) { - List tarotHeadwearVo = gson.fromJson(sendHeadwear, - new TypeToken>(){}.getType()); - config.setTarotHeadwears(tarotHeadwearVo); - } else { - config.setTarotHeadwears(Collections.emptyList()); - } - Boolean goldLimit = Optional.ofNullable(Boolean.parseBoolean( - sysConfService.getSysConfValueById(Constant.SysConfId.TAROT_CHARGE_LIMIT_SWITCH))) - .orElse(Boolean.FALSE); - config.setIsChargeLimit(goldLimit); - String amount = sysConfService.getDefaultSysConfValueById(Constant.SysConfId.TAROT_CHARGE_LIMIT_AMOUNT, - "100000"); - config.setChargeLimitAmount(Long.valueOf(amount)); - if (envComponent.getDevOrNativeEnv()) { - Boolean switchOpen = Boolean.valueOf(sysConfService.getDefaultSysConfValueById(Constant.SysConfId.TAROT_LOW_CHARGE_AMOUNT_SWITCH, "false")); - config.setIsLowChargeAmount(switchOpen); - } else { - config.setIsLowChargeAmount(false); - } - - String actIdStr = sysConfService.getSysConfValueById(Constant.SysConfId.TAROT_ACT_ID); - if (StringUtils.isNotBlank(actIdStr)) { - Integer actId = Integer.valueOf(actIdStr); - config.setActId(actId); - FirstPageBannerVo bannerVO = firstPageBannerService.getBannerVOById(actId, Constant.BannerType.BANNER_ROOM); - if (bannerVO != null) { - config.setLimitLevelSeq(bannerVO.getActLimitLevelSeq()); - } - } - - - return config; - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/charge/RedeemCodeService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/charge/RedeemCodeService.java deleted file mode 100644 index 100c480ed..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/charge/RedeemCodeService.java +++ /dev/null @@ -1,198 +0,0 @@ -package com.accompany.business.service.charge; - - -import com.accompany.business.model.RedeemCode; -import com.accompany.business.model.RedeemCodeRecord; -import com.accompany.business.model.UserPurse; -import com.accompany.business.mybatismapper.RedeemCodeMapper; -import com.accompany.business.mybatismapper.RedeemCodeRecordMapper; -import com.accompany.business.mybatismapper.UserPurseMapper; -import com.accompany.business.service.purse.UserPurseService; -import com.accompany.business.service.record.BillRecordService; -import com.accompany.business.service.user.UsersService; -import com.accompany.business.vo.UserPurseRedeemVo; -import com.accompany.common.device.DeviceInfo; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.StringUtils; -import com.accompany.common.utils.UUIDUtil; -import com.accompany.core.enumeration.BillObjTypeEnum; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.model.Users; -import com.accompany.core.service.base.BaseService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Date; -import java.util.Random; - -@Service -public class RedeemCodeService extends BaseService { - - @Autowired - private RedeemCodeMapper redeemCodeMapper; - @Autowired - private UsersService usersService; - @Autowired - private RedeemCodeRecordMapper redeemCodeRecordMapper; - @Autowired - private UserPurseService userPurseService; - @Autowired - private UserPurseMapper userPurseMapper; - @Autowired - private BillRecordService billRecordService; - - - /** - * 使用兑换码 - * - * @param code - * @param uid - * @param clientIp - * @param deviceInfo - * @return - */ - public BusiResult useRedeemCode(String code, Long uid, String clientIp, DeviceInfo deviceInfo, String inputKey) { - BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS); - RedeemCode redeemCode = null; - String lockVal = jedisService.lock(RedisKey.redeem_code_lock.getKey(), 15000, 30000); - try { - // 加分布式锁,防止 - if(StringUtils.isEmpty(lockVal)){ - throw new ServiceException(BusiStatus.SERVERBUSY); - } - redeemCode = redeemCodeMapper.selectByPrimaryKey(code); - - - if (redeemCode == null) { - busiResult.setCode(0); - busiResult.setMessage("您输入的兑换码有误,请核对后重新输入"); - long errorCount = jedisService.incr(inputKey); - if (errorCount >= 3) { - busiResult.setMessage(String.format("您今天已累计%d次输入有误,累计5次输入错误后,系统将停止您的兑换码充值功能", errorCount)); - } - return busiResult; - } - - // 多台机器情况下,判断使用状态可能存在并发问题,加分布式锁 - if (redeemCode.getUseStatus() != 1) { - busiResult.setCode(1); - busiResult.setMessage("该兑换码已被兑换,请核对后输入"); - return busiResult; - } - - Date date = new Date(); - // 更新DB兑换状态 - redeemCode.setUseUid(uid); - redeemCode.setUseIp(clientIp); - if (deviceInfo != null) { - redeemCode.setUseImei(deviceInfo.getDeviceId()); - } - redeemCode.setUseStatus(2); - redeemCode.setUseTime(date); - redeemCodeMapper.updateByPrimaryKeySelective(redeemCode); - - // 插入兑换记录表 - saveRedeemCodeRecord(redeemCode); - // 更新用户的金币余额 -// UserPurse userPurse = updateUserPurseGold(redeemCode); - UserPurse userPurse = userPurseService.addDiamond(redeemCode.getUseUid(), redeemCode.getAmount().doubleValue(), BillObjTypeEnum.ACTIVITY_DIAMOND); - userPurseService.sendSysMsgByModifyGold(userPurse); - - busiResult.setData(transToUserPurseVo(userPurse,redeemCode.getAmount())); - } catch (Exception e) { - busiResult.setCode(BusiStatus.SERVEXCEPTION.value()); - busiResult.setMessage("系统错误,请稍候再试"); - logger.error("useRedeemCode error", e); - return busiResult; - } finally { - jedisService.unlock(RedisKey.redeem_code_lock.getKey(),lockVal); - } - return busiResult; - } - - public int insertRedeemCode(RedeemCode redeemCode) { - return redeemCodeMapper.insertSelective(redeemCode); - } - - /** - * 保存兑换记录 - * - * @param redeemCode - */ - public String saveRedeemCodeRecord(RedeemCode redeemCode) { - String recordId = UUIDUtil.get(); - RedeemCodeRecord redeemCodeRecord = new RedeemCodeRecord(); - redeemCodeRecord.setRecordId(recordId); - redeemCodeRecord.setAmount(redeemCode.getAmount()); - redeemCodeRecord.setUid(redeemCode.getUseUid()); - redeemCodeRecord.setCode(redeemCode.getCode()); - redeemCodeRecord.setCreateTime(new Date()); - redeemCodeRecord.setIp(redeemCode.getUseIp()); - redeemCodeRecord.setImei(redeemCode.getUseImei()); - redeemCodeRecordMapper.insertSelective(redeemCodeRecord); - return recordId; - } - - /** - * 判断用户是否存在 - * - * @param uid - * @return - */ - public boolean isExistUser(Long uid) { - String uidKey = RedisKey.redeem_code_uid.getKey(uid.toString()); - if (jedisService.read(uidKey) != null) { - return false; - } - Users users = usersService.getUsersByUid(uid); - if (users == null) { - // 防止缓存穿透,短期缓存 - jedisService.set(uidKey, uid.toString(), 60); // 失效时间为60s - return false; - } - return true; - } - - /** - * - * - * @param userPurse - * @return - */ - public UserPurseRedeemVo transToUserPurseVo(UserPurse userPurse, Long amount) { - UserPurseRedeemVo userPurseRedeemVo = new UserPurseRedeemVo(); - userPurseRedeemVo.setAmount(amount); - userPurseRedeemVo.setDiamonds(userPurse.getDiamonds()); - userPurseRedeemVo.setCrystals(userPurse.getCrystals()); - userPurseRedeemVo.setFirstCharge(userPurse.getFirstCharge()); - userPurseRedeemVo.setUid(userPurse.getUid()); - userPurseRedeemVo.setUpdateTime(userPurse.getUpdateTime()); - return userPurseRedeemVo; - } - - private static final String[] CODE_STR = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" - , "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}; - - /** - * 构建随机生成的字符串 - * - * @param len 指定生成的字符串长度 - * @return - */ - public static String buildRandomCode(int len) { - StringBuilder builder = new StringBuilder(); - Random random = new Random(); - for (int i = 0; i < len; i++) { - builder.append(CODE_STR[random.nextInt(CODE_STR.length)]); - } - return builder.toString(); - } - - public static void business(String[] args) { - for (int i = 0; i < 10; i++) { - System.out.println(buildRandomCode(16)); - } - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/dealer/DealerService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/dealer/DealerService.java deleted file mode 100644 index 128ac5d09..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/dealer/DealerService.java +++ /dev/null @@ -1,228 +0,0 @@ -package com.accompany.business.service.dealer; - -import cn.hutool.core.date.DateUtil; -import com.accompany.business.model.UserPurse; -import com.accompany.business.service.purse.DiamondGiveHistoryService; -import com.accompany.business.service.purse.UserPurseService; -import com.accompany.business.service.user.UsersService; -import com.accompany.business.vo.DiamondGiveHistoryVo; -import com.accompany.business.vo.dealer.*; -import com.accompany.common.constant.Constant; -import com.accompany.common.push.MarkdownMessage; -import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.EnvComponent; -import com.accompany.core.enumeration.PartitionEnum; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.model.Users; -import com.accompany.core.service.SysConfService; -import com.accompany.core.service.message.MessageRobotPushService; -import com.accompany.payment.service.RechargeUserService; -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.metadata.IPage; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.lang.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.*; - -import static com.accompany.common.constant.Constant.SysConfId.WEB_API_AGENT_CHARGE; - -@Slf4j -@Service -public class DealerService { - - @Autowired - private UsersService usersService; - - @Autowired - private UserPurseService userPurseService; - - @Autowired - private RechargeUserService rechargeUserService; - - @Autowired - private DiamondGiveHistoryService diamondGiveHistoryService; - - @Autowired - private EnvComponent envComponent; - @Autowired - private MessageRobotPushService messageRobotPushService; - @Autowired - private SysConfService sysConfService; - - - public DealerResponse checkParam(String secretKey, String ipStr, Long userId, DealerConfigVO dealerConfigVO) { - if (StringUtils.isEmpty(secretKey) || StringUtils.isEmpty(ipStr)) { - return new DealerResponse(DealerBusiStatus.PARAM_ERROR); - } - if (dealerConfigVO == null || dealerConfigVO.getAgentUid() == null - || StringUtils.isEmpty(dealerConfigVO.getSecretKey())) { - return new DealerResponse(DealerBusiStatus.ACCOUNT_ERROR); - } - if (CollectionUtils.isNotEmpty(dealerConfigVO.getIpWhitelist()) && !dealerConfigVO.getIpWhitelist().contains(ipStr)) { - return new DealerResponse(DealerBusiStatus.IP_LIMIT); - } - if (!dealerConfigVO.getSecretKey().equals(secretKey)) { - return new DealerResponse(DealerBusiStatus.SECRETKEY_ERROR); - } - Boolean rechargeUser = rechargeUserService.isRechargeUser(dealerConfigVO.getAgentUid()); - if (!rechargeUser) { - return new DealerResponse(DealerBusiStatus.SIGN_ERROR); - } - Users user = usersService.getUsersByUid(dealerConfigVO.getAgentUid()); - if (user == null) { - return new DealerResponse(DealerBusiStatus.AGENT_USER_NOT_EXIST); - } - if (userId != null) { - Users usersByErBanNo = usersService.getUserByErbanNo(userId); - if (usersByErBanNo == null) { - return new DealerResponse(DealerBusiStatus.USER_NOT_EXIST); - } - if (user.getUid().equals(usersByErBanNo.getUid())) { - return new DealerResponse(DealerBusiStatus.SEND_SELF_FAIL); - } - if (!user.getPartitionId().equals(usersByErBanNo.getPartitionId())) { - return new DealerResponse(DealerBusiStatus.USER_NOT_REGION); - } - } - return new DealerResponse(DealerBusiStatus.SUCCESS); - } - - - public void accountInfo(DealerResponse dealerResponse, DealerConfigVO dealerConfigVO) { - DealerAccount dealerAccount = new DealerAccount(); - dealerResponse.setData(dealerAccount); - Long totalGoldNum = 0L; - UserPurse userPurse = userPurseService.queryUserPurse(dealerConfigVO.getAgentUid()); - if (userPurse != null) { - totalGoldNum += userPurse.getDiamonds().longValue(); - } - dealerAccount.setCoinBalance(totalGoldNum); - } - - public DealerResponse userInfo(Long erbanNo) { - DealerUserInfo userInfo = new DealerUserInfo(); - Users users = usersService.getUserByErbanNo(erbanNo); - userInfo.setUserId(users.getErbanNo()); - userInfo.setAvatar(users.getAvatar()); - userInfo.setGender(users.getGender() == 1 ? "MALE" : "FEMALE"); - userInfo.setNickName(users.getNick()); - userInfo.setUid(users.getUid()); - DealerResponse dealerResponse = new DealerResponse(DealerBusiStatus.SUCCESS); - dealerResponse.setData(userInfo); - return dealerResponse; - } - - public DealerResponse sale(Long toErbanNo, Long coins, DealerConfigVO dealerConfigVO) { - if (coins == null || coins <= 0) { - return new DealerResponse(DealerBusiStatus.PARAM_ERROR); - } - Users toUser = usersService.getUserByErbanNo(toErbanNo); - Long toUid = toUser.getUid(); - boolean toAgentUser = rechargeUserService.isRechargeUser(toUid); - if (toAgentUser) { - log.info("DealerService.sale:toErbanNo:{} are agent", toErbanNo); - return new DealerResponse(DealerBusiStatus.SIGN_ERROR); - } - Long agentUid = dealerConfigVO.getAgentUid(); - Users usersByUid = usersService.getUsersByUid(agentUid); - try { - diamondGiveHistoryService.webGiveDiamond(agentUid, toUid, coins); - sendRobotMsg(usersByUid.getPartitionId(), usersByUid.getErbanNo(), toUser.getErbanNo(), coins); - } catch (ServiceException e) { - BusiStatus busiStatus = e.getBusiStatus(); - log.error("DealerService.sale,error:{}", JSONObject.toJSONString(busiStatus), e); - return new DealerResponse(busiStatus.getCode(), busiStatus.getName()); - } - - return new DealerResponse(DealerBusiStatus.SUCCESS); - } - - private void sendRobotMsg(Integer partitionId, Long agentErbanNo, Long erbanNo, Long coins) { - String key; - if (envComponent.getDevOrNativeEnv()) { - key = "474c92e5-385d-4b6a-b606-b33769f59457"; - } else { - key = "37355bec-05c4-4168-8287-51c8fcfd1475"; - } - PartitionEnum partitionEnum = PartitionEnum.getByPartitionId(partitionId); - String title = " WEB-API代理充值(" + partitionEnum.getDesc() + "区)"; - MarkdownMessage msg = new MarkdownMessage(); - msg.add(MarkdownMessage.getHeaderText(3, title)); - msg.add(MarkdownMessage.getReferenceText("充值用户ID: " + erbanNo)); - msg.add(MarkdownMessage.getReferenceText("充值使用的代理ID: " + agentErbanNo)); - msg.add(MarkdownMessage.getReferenceText("充值coins: " + coins)); - msg.add(MarkdownMessage.getReferenceText("充值时间(GMT+8): " + DateUtil.formatDateTime(new Date()))); - messageRobotPushService.pushMessageByKey(key, msg, false); - } - - public DealerResponse> list(Integer page, DealerConfigVO dealerConfigVO) { - DealerResponsePage dealerResponsePage = new DealerResponsePage(); - DealerResponse dealerResponse = new DealerResponse<>(DealerBusiStatus.SUCCESS); - List result = new ArrayList<>(); - dealerResponse.setData(dealerResponsePage); - dealerResponsePage.setRows(result); - Long agentUid = dealerConfigVO.getAgentUid(); - dealerResponsePage.setPageSize(10); - dealerResponsePage.setCurrentPage(page); - IPage giveHistoryVoIPage = diamondGiveHistoryService.listRecordVoByType(Constant.UserGiveType.webDiamond, agentUid, - dealerResponsePage.getCurrentPage(), dealerResponsePage.getPageSize()); - dealerResponsePage.setTotal(giveHistoryVoIPage.getTotal()); - int lastPage = dealerResponsePage.getTotal().intValue() / 10 + 1; - dealerResponsePage.setLastPage(lastPage); - if (dealerResponsePage.getTotal() <= 0 || page > lastPage) { - return dealerResponse; - } - List records = giveHistoryVoIPage.getRecords(); - if (CollectionUtils.isNotEmpty(records)) { - for (DiamondGiveHistoryVo giveHistoryDTO : records) { - Users usersByUid = usersService.getUsersByUid(giveHistoryDTO.getTargetUid()); - DealerUserInfo build = DealerUserInfo.builder() - .toUserId(usersByUid.getErbanNo()) - .createAt(giveHistoryDTO.getCreateTime().getTime()) - .coins(giveHistoryDTO.getRealDiamondNum()) - .toNickName(usersByUid.getNick()).build(); - result.add(build); - } - } - return dealerResponse; - } - - /** - * 获取配置 - * - * @param secretKey - * @return - */ - public DealerConfigVO getConfigVo(String secretKey) { - return this.getConfigMap().get(secretKey); - } - - private Map getConfigMap() { - Map resultMap = new HashMap<>(); - String sysConfValueById = sysConfService.getSysConfValueById(WEB_API_AGENT_CHARGE); - log.info("DealerService.getConfigMap:{}", sysConfValueById); - if (StringUtils.isEmpty(sysConfValueById)) { - return resultMap; - } - List configVOS = JSONObject.parseArray(sysConfValueById, DealerConfigVO.class); - if (CollectionUtils.isNotEmpty(configVOS)) { - configVOS.forEach(configVO -> { - resultMap.put(configVO.getSecretKey(), configVO); - }); - } - return resultMap; - } - - public static void main(String[] args) { - DealerConfigVO configVO = new DealerConfigVO(); - configVO.setSecretKey("e364f8c9a6c8402ca375594deadcbf52"); - configVO.setAgentUid(1222L); - configVO.setIpWhitelist(new ArrayList<>()); - List configVOS = new ArrayList<>(); - configVOS.add(configVO); - System.out.println(JSONObject.toJSONString(configVOS)); - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/GiftCompoundRecordDetailService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/GiftCompoundRecordDetailService.java deleted file mode 100644 index c5a563684..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/GiftCompoundRecordDetailService.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.accompany.business.service.gift; - -import com.accompany.business.model.GiftCompoundRecordDetail; -import com.accompany.business.mybatismapper.GiftCompoundRecordDetailMapper; -import com.accompany.business.param.BatchGiftParam; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author guojicong - * @Description - * @create 2022-06-20 - */ -@Service -public class GiftCompoundRecordDetailService extends ServiceImpl { - - public void batchSave(Integer recordId, List giftParamList) { - if (CollectionUtils.isEmpty(giftParamList)) { - return; - } - List entityList = new ArrayList<>(); - for (BatchGiftParam param : giftParamList) { - GiftCompoundRecordDetail entity = new GiftCompoundRecordDetail(); - entity.setRecordId(recordId); - entity.setGiftId(param.getGiftId()); - entity.setGiftNum(param.getNum()); - entityList.add(entity); - } - this.saveBatch(entityList); - } - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/GiftCompoundRecordService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/GiftCompoundRecordService.java deleted file mode 100644 index 6e20cf5ae..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/GiftCompoundRecordService.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.accompany.business.service.gift; - -import com.accompany.business.model.Gift; -import com.accompany.business.model.GiftCompoundRecord; -import com.accompany.business.mybatismapper.GiftCompoundRecordMapper; -import com.accompany.business.vo.giftCompound.GiftCompoundRecordVo; -import com.accompany.common.redis.RedisKey; -import com.accompany.core.model.Users; -import com.accompany.core.service.common.JedisService; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.google.gson.Gson; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author guojicong - * @Description - * @create 2022-06-20 - */ -@Slf4j -@Service -public class GiftCompoundRecordService extends ServiceImpl { - - @Autowired - private JedisService jedisService; - - @Autowired - private GiftCompoundRecordMapper giftCompoundRecordMapper; - - private Gson gson = new Gson(); - - private static final Long SHOW_PRICE = 5200L; - - public GiftCompoundRecord add(Users usersByUid, Gift actualGift, Integer rewardId) { - GiftCompoundRecord entity = new GiftCompoundRecord(); - entity.setUid(usersByUid.getUid()); - entity.setUserNick(usersByUid.getNick()); - entity.setRewardId(rewardId); - if (actualGift != null) { - entity.setGiftId(actualGift.getGiftId()); - entity.setGiftName(actualGift.getGiftName()); - entity.setGiftPrice(actualGift.getGoldPrice()); - } - // 保存 db - this.save(entity); - return entity; - } - - public List getRecordByUid(Long uid, Integer pageNum, Integer pageSize) { - return giftCompoundRecordMapper.getByUid(uid, (pageNum - 1) * pageSize, pageSize); - } - - public List getTopRecord() { - List recordStrList = jedisService.lrange(RedisKey.gift_compound_record.getKey(), 0, 29); - // 无缓存 - if (CollectionUtils.isEmpty(recordStrList)) { - List topRecordList = this.list(new LambdaQueryWrapper() - .ge(GiftCompoundRecord::getGiftPrice, SHOW_PRICE) - .orderByDesc(GiftCompoundRecord::getCreateTime) - .last(" limit 30")); - topRecordList.forEach(record -> recordStrList.add(gson.toJson(record))); - jedisService.lpushList(RedisKey.gift_compound_record.getKey(), recordStrList); - // 设置3天过期 - jedisService.expire(RedisKey.gift_compound_record.getKey(), 60 * 60 * 24 * 3); - return topRecordList; - } - List topRecordList = new ArrayList<>(); - recordStrList.forEach(recordStr -> topRecordList.add(gson.fromJson(recordStr, GiftCompoundRecord.class))); - return topRecordList; - } - - public void addTopCache(GiftCompoundRecord entity) { - if (entity.getGiftPrice()==null||entity.getGiftPrice() < SHOW_PRICE) - return; - String key = RedisKey.gift_compound_record.getKey(); - // 添加至头部 - jedisService.lpush(key, gson.toJson(entity)); - if (jedisService.llen(key) > 30) { - // 删除一个尾部元素 - jedisService.rpop(key); - } - - } - -} - diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/GiftCompoundRewardPoolService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/GiftCompoundRewardPoolService.java deleted file mode 100644 index a07382f3e..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/GiftCompoundRewardPoolService.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.accompany.business.service.gift; - -import com.accompany.business.model.GiftCompoundRewardPool; -import com.accompany.business.mybatismapper.GiftCompoundRewardPoolMapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -@Service -public class GiftCompoundRewardPoolService extends ServiceImpl { -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/GiftCompoundRewardService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/GiftCompoundRewardService.java deleted file mode 100644 index 1339df350..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/GiftCompoundRewardService.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.accompany.business.service.gift; - -import com.accompany.business.model.GiftCompoundReward; -import com.accompany.business.model.GiftCompoundRewardPool; -import com.accompany.business.mybatismapper.GiftCompoundRewardMapper; -import com.accompany.common.status.BusiStatus; -import com.accompany.core.exception.ServiceException; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -@Service -public class GiftCompoundRewardService extends ServiceImpl { - - @Autowired - private GiftCompoundRewardPoolService giftCompoundRewardPoolService; - - public GiftCompoundRewardPool getActualGiftPool(GiftCompoundReward compoundReward) { - List poolList = giftCompoundRewardPoolService.list(new LambdaQueryWrapper().eq(GiftCompoundRewardPool::getRewardId, compoundReward.getId())); - // 获取 0 - 100 随机数 - Double randomValue = Math.random() * 100; - // 概率和 - Integer rateSum = 0; - for (GiftCompoundRewardPool pool : poolList) { - rateSum += pool.getRate(); - // 当概率和 >= 随机数时,命中 - if (rateSum >= randomValue) - return pool; - } - - // 概率配置正常时,不应执行至此处 - throw new ServiceException(BusiStatus.GIFT_SYNTHESIS_ABNORMALITY); - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/GiftCompoundService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/GiftCompoundService.java deleted file mode 100644 index 7366ea5d2..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/GiftCompoundService.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.accompany.business.service.gift; - -import com.accompany.business.dto.activity.GiftCompoundConfig; -import com.accompany.business.model.Gift; -import com.accompany.business.model.GiftCompoundRecord; -import com.accompany.business.model.GiftCompoundReward; -import com.accompany.business.model.GiftCompoundRewardPool; -import com.accompany.business.param.BatchGiftParam; -import com.accompany.business.param.GiftCompoundParam; -import com.accompany.business.service.SendSysMsgService; -import com.accompany.business.service.room.RoomService; -import com.accompany.business.service.room.UserInOutRoomRecordService; -import com.accompany.business.service.user.UserBackpackService; -import com.accompany.business.service.user.UsersService; -import com.accompany.business.vo.UserBackpackVo; -import com.accompany.business.vo.gift.CompoundGiftVo; -import com.accompany.common.constant.Attach; -import com.accompany.common.constant.Constant; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.status.BusiStatus; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.model.Room; -import com.accompany.core.model.Users; -import com.accompany.core.service.SysConfService; -import com.accompany.core.service.common.JedisService; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; -import org.springframework.util.Assert; -import org.springframework.util.StringUtils; - -import java.time.LocalTime; -import java.util.*; -import java.util.stream.Collectors; - -/** - * @author guojicong - * @Description - * @create 2022-06-22 - */ -@Slf4j -@Service -public class GiftCompoundService { - - @Autowired - private UserBackpackService userBackpackService; - @Autowired - private GiftService giftService; - @Autowired - private GiftCompoundRewardService giftCompoundRewardService; - @Autowired - private GiftCompoundRecordService giftCompoundRecordService; - @Autowired - private GiftCompoundRecordDetailService giftCompoundRecordDetailService; - @Autowired - private JedisService jedisService; - @Autowired - private UsersService usersService; - private Gson gson = new Gson(); - @Autowired - private RoomService roomService; - @Autowired - private UserInOutRoomRecordService userInOutRoomRecordService; - - @Autowired - private SysConfService sysConfService; - - @Autowired - private ApplicationContext applicationContext; - - @Autowired - private GiftCompoundRewardPoolService giftCompoundRewardPoolService; - @Autowired - private SendSysMsgService sendSysMsgService; - - public Gift compound(Long uid, GiftCompoundParam compoundParam) { - log.info("uid {} ,compoundParam{}", uid, compoundParam); - Users usersByUid = usersService.getUsersByUid(uid); - Assert.notNull(usersByUid, "uid error"); - - List userBackpackList = userBackpackService.getUserBackpackListWithCache(uid, - Constant.GiftConsumeType.GOLD_GIFT); - Assert.notEmpty(userBackpackList, "user backpack is null"); - - GiftCompoundReward compoundReward = giftCompoundRewardService.getOne(new LambdaQueryWrapper().eq(GiftCompoundReward::getId, compoundParam.getCompoundRewardId())); - Assert.notNull(compoundReward, "compound reward id error"); - // 限时合成开关及时间检验 - if (Constant.GiftCompound.GiftRewardType.LIMIT.equals(compoundReward.getRewardType())) { - this.checkLimitGiftCompoundTime(uid); - } - - List validParamList = compoundParam.getCompoundList().stream().filter(giftVo -> giftVo.getNum() != 0).collect(Collectors.toList()); - compoundParam.setCompoundList(validParamList); - // 目标礼物 - Gift targetGiftById = giftService.getGiftById(compoundReward.getGiftId()); - Assert.notNull(targetGiftById, "compound id error"); - - - // 校验 - this.checkCompound(compoundParam, compoundReward, userBackpackList); - - // 获取奖池实际礼物 - GiftCompoundRewardPool actualRewardPool = giftCompoundRewardService.getActualGiftPool(compoundReward); - log.info("actual reward pool {}", actualRewardPool); - // 实际合成获得礼物 - BatchGiftParam compoundGift; - if (actualRewardPool.getGiftId() == null) { - compoundGift = null; - } else { - compoundGift = new BatchGiftParam(); - compoundGift.setGiftId(actualRewardPool.getGiftId()); - compoundGift.setNum(1); - } - // 合成失败会返回空礼物 - Gift actualGiftById = compoundGift == null ? null : giftService.getGiftById(actualRewardPool.getGiftId()); - log.info("actual reward gift {}", actualGiftById); - // 背包礼物处理 - userBackpackService.backpackGiftCompound(uid, compoundParam.getCompoundList(), compoundGift); - // 添加合成记录 - GiftCompoundRecord record = giftCompoundRecordService.add(usersByUid, actualGiftById, compoundParam.getCompoundRewardId()); - giftCompoundRecordDetailService.batchSave(record.getId(), compoundParam.getCompoundList()); - // 添加 top 缓存 - giftCompoundRecordService.addTopCache(record); - // 发送全服公告 - if (actualRewardPool != null && actualRewardPool.getServiceNotice()) { - applicationContext.getBean(GiftCompoundService.class).sendServiceMsg(usersByUid, actualGiftById); - } - return actualGiftById; - } - - private void checkCompound(GiftCompoundParam compoundParam, GiftCompoundReward compoundReward, List userBackpackList) { - - Map userBackpackMap = - userBackpackList.stream().collect(Collectors.toMap( - UserBackpackVo::getGiftId, userBackpackVo -> userBackpackVo)); - Long countPrice = 0L; - for (BatchGiftParam param : compoundParam.getCompoundList()) { - UserBackpackVo userBackpackVo = userBackpackMap.get(param.getGiftId()); - // 背包礼物数量不足 - if (userBackpackVo == null || userBackpackVo.getCount() < param.getNum()) { - log.info("user backpack {} BatchGiftParam{} count not enough ", userBackpackVo, param); - throw new ServiceException(BusiStatus.GIFTISEMPTY); - } - countPrice += (param.getNum() * userBackpackVo.getGoldPrice()); - } - // 礼物总价值不足 - if (countPrice < compoundReward.getExpendValue()) { - log.info("user compoundParam{} countPrice{} not enough reward {}", compoundParam, countPrice, compoundReward.getExpendValue()); - throw new ServiceException(BusiStatus.GIFT_AMOUNT_NOT_ENOUGH); - } - } - - - public List getCompoundGiftList(Long uid, Integer rewardType) { - // 限时合成开关及时间检验 - if (Constant.GiftCompound.GiftRewardType.LIMIT.equals(rewardType)) { - this.checkLimitGiftCompoundTime(uid); - } - - String cacheStr = jedisService.hget(RedisKey.gift_compound_reward.getKey(), rewardType.toString()); - if (StringUtils.hasText(cacheStr)) { - return gson.fromJson(cacheStr, new TypeToken>() { - }.getType()); - } - - List rewardList = giftCompoundRewardService.list( - new LambdaQueryWrapper().eq(GiftCompoundReward::getRewardType, rewardType)); - - List voList = new ArrayList<>(); - - rewardList.forEach(reward -> { - Gift gift = giftService.getGiftById(reward.getGiftId()); - GiftCompoundRewardPool pool = giftCompoundRewardPoolService.getOne( - new LambdaQueryWrapper() - .eq(GiftCompoundRewardPool::getRewardId, reward.getId()) - .eq(GiftCompoundRewardPool::getGiftId, reward.getGiftId())); - // 有效状态礼物 - if (gift.getGiftStatus() == Constant.status.valid) { - CompoundGiftVo vo = new CompoundGiftVo(); - vo.setGiftId(gift.getGiftId()); - vo.setGiftName(gift.getGiftName()); - vo.setGoldPrice(gift.getGoldPrice()); - vo.setExpendValue(reward.getExpendValue()); - vo.setGiftUrl(gift.getPicUrl()); - vo.setCompoundRewardId(reward.getId()); - vo.setOrderNo(reward.getOrderNo()); - vo.setCompoundRate(pool.getRate()); - voList.add(vo); - } - }); - - voList.sort(Comparator.comparing(CompoundGiftVo::getOrderNo)); - jedisService.hset(RedisKey.gift_compound_reward.getKey(), rewardType.toString(), gson.toJson(voList)); - jedisService.expire(RedisKey.gift_compound_reward.getKey(), 10); - return voList; - } - - public void checkLimitGiftCompoundTime(Long uid) { - String configStr = sysConfService.getSysConfValueById(Constant.SysConfId.GIFT_COMPOUND_LIMIT_CONFIG); - GiftCompoundConfig giftCompoundConfig = new GiftCompoundConfig(); - if (!StringUtils.isEmpty(configStr)) { - giftCompoundConfig = gson.fromJson(configStr, GiftCompoundConfig.class); - } - // 白名单不校验 - if (!giftCompoundConfig.getWhiteUidList().contains(uid)) { - if (!giftCompoundConfig.getOpen()) - throw new ServiceException(BusiStatus.GIFT_COMPOUND_LIMIT_NOT_OPEN); - int hour = LocalTime.now().getHour(); - if (hour < giftCompoundConfig.getBeginHour() || hour >= giftCompoundConfig.getEndHour()) - throw new ServiceException(BusiStatus.GIFT_COMPOUND_LIMIT_IN_COOLING); - } - } - - @Async - public void sendServiceMsg(Users user, Gift gift) { - Long roomUid = userInOutRoomRecordService.getUserCurrentRoomUid(user.getUid()); - if (null == roomUid){ - return; - } - - Room roomByUid = roomService.getRoomByUid(roomUid); - - Map map = new HashMap<>(); - map.put("uid", user.getUid()); - map.put("nick", user.getNick()); - map.put("msg", "在魔法小屋合成了"); - map.put("giftId", gift.getGiftId()); - map.put("giftName", gift.getGiftName()); - - Attach attach = new Attach(Constant.DefineProtocol.CUSTOM_MSG_GIFT_COMPOUND, Constant.DefineProtocol.CUSTOM_MSG_GIFT_COMPOUND_NOTIFY, map); - sendSysMsgService.sendMessageToPartition(roomByUid, attach); - } - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/home/impl/HomeIndexServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/home/impl/HomeIndexServiceImpl.java index 6600693f4..28a5f61b4 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/home/impl/HomeIndexServiceImpl.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/home/impl/HomeIndexServiceImpl.java @@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DatePattern; import cn.hutool.core.util.StrUtil; import com.accompany.business.mybatismapper.RoomTabHomeMapper; -import com.accompany.business.service.audiocard.AudioCardService; import com.accompany.business.service.follow.FansService; import com.accompany.business.service.home.HomeIndexService; import com.accompany.business.service.label.LabelService; @@ -25,7 +24,6 @@ import com.accompany.core.base.UidContextHolder; import com.accompany.core.model.Users; import com.accompany.core.service.SysConfService; import com.accompany.core.service.common.JedisService; -import com.accompany.core.vo.audiocard.UserAudioCardVo; import com.alibaba.fastjson.TypeReference; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; @@ -44,9 +42,6 @@ import java.util.stream.Collectors; @Service public class HomeIndexServiceImpl implements HomeIndexService { - @Autowired - private RoomTabHomeMapper roomTabHomeMapper; - @Autowired private JedisService jedisService; @@ -59,9 +54,6 @@ public class HomeIndexServiceImpl implements HomeIndexService { @Autowired private LevelService levelService; - @Autowired - private AudioCardService audioCardService; - @Autowired private SysConfService sysConfService; @@ -125,12 +117,6 @@ public class HomeIndexServiceImpl implements HomeIndexService { newFriend.setBirth(users.getBirth()); newFriend.setUserVipInfoVO(VipUtil.getUserVipInfo(newFriendUid)); result.add(newFriend); - //语音 - UserAudioCardVo auditCard = audioCardService.getVo(newFriendUid, newFriendUid); - if (auditCard != null) { - newFriend.setUserVoice(auditCard.getAudioUrl()); - newFriend.setVoiceDura(auditCard.getSecond()); - } //设置标签 newFriend.setLabels(labelService.listByUid(newFriendUid)); //是否在线 diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/linearlypool/LinearlyPoolPrizeMessageService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/linearlypool/LinearlyPoolPrizeMessageService.java deleted file mode 100644 index ac30f5fda..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/linearlypool/LinearlyPoolPrizeMessageService.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.accompany.business.service.linearlypool; - -import com.accompany.business.constant.PrizeLevelEnum; -import com.accompany.business.dto.linearlypool.LinearlyPoolConfigDTO; -import com.accompany.business.event.linearlypool.LinearlyPoolPrizeEvent; -import com.accompany.business.message.PrizeEntity; -import com.accompany.business.message.linearlypool.LinearlyPoolPrizeMessage; -import com.accompany.business.service.SendSysMsgService; -import com.accompany.business.service.prize.PrizeContext; -import com.accompany.business.service.prize.PrizeStrategyFactory; -import com.accompany.business.service.room.RoomService; -import com.accompany.business.service.user.UsersService; -import com.accompany.business.vo.linearlypool.PrizePushMsg; -import com.accompany.common.constant.Attach; -import com.accompany.common.constant.Constant; -import com.accompany.core.model.Room; -import com.accompany.core.model.Users; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * Created by PaperCut on 2018/7/16. - * 砸金蛋中奖处理业务 - */ -@Slf4j -@Service -public class LinearlyPoolPrizeMessageService { - @Autowired - PrizeStrategyFactory factory; - @Autowired - RoomService roomService; - @Autowired - UsersService usersService; - @Autowired - private ApplicationContext applicationContext; - @Autowired - private LinearlyPrizePoolService linearlyPrizePoolService; - @Autowired - private SendSysMsgService sendSysMsgService; - - /** - * 处理中奖消息逻辑 - * - * @param msg - */ - public void onMessage(final LinearlyPoolPrizeMessage msg) { - List list = msg.getPrizeList(); - LinearlyPoolConfigDTO config = linearlyPrizePoolService.getConfig(); - for (PrizeEntity entity : list) { - final PrizeContext context = new PrizeContext.Builder().setUid(msg.getUid()).setRoomUid(msg.getRoomUid()).setEntity(entity).build(); - try { - // 处理中奖逻辑 - factory.getStrategy(entity.getPrizeType()).execute(context); - log.info("Successful to linearly pool prize to user,messId={}, prize: {}, uid:{}, roomUid: {}", - msg.getMessId()+"",JSON.toJSONString(entity), msg.getUid(), msg.getRoomUid()); - - // 发送中奖通知 - if (msg.getSendMessage() && entity.getPrizeLevel().compareTo(config.getPrizeMsgLevel()) >= 0) { - sendPrizeMsg(msg.getRoomUid(), msg.getUid(), entity, config.getPrizeMsgSwitch(), msg.getMessTime(), config.getPrizeRoomMsgUserLevel()); - } - } catch (Exception e) { - // 出问题暂不做处理.只做日志输出 - log.error("Failed to handling linearly pool prize prize business,", e); - log.error("Failed to handling linearly pool prize prize business1, mess={},boxPrizeEntity={}", JSON.toJSONString(msg), - JSONObject.toJSONString(entity)); - } - } - applicationContext.publishEvent(new LinearlyPoolPrizeEvent(msg)); - } - - /** - * 发送中奖消息 - * @param roomUid - * @param uid - * @param entity - * @param prizeRoomMsgUserLevel - */ - public void sendPrizeMsg(final Long roomUid, final Long uid, final PrizeEntity entity, final Boolean msgSwitch, final Long messTime, Integer prizeRoomMsgUserLevel){ - try { - PrizePushMsg msg = buildPrizePushMsg(roomUid, uid, entity,prizeRoomMsgUserLevel); - Room room = roomService.getRoomByUid(roomUid); - if (entity.getPrizeLevel() == PrizeLevelEnum.LEVEL_1.getValue()) { -// sendSingleRoomMsg(Constant.DefineProtocol.CUSTOM_MSG_LINEARLY_POOL_PRIZE, Constant.DefineProtocol.CUSTOM_MSG_LINEARLY_POOL_PRIZE_LV1, -// room, msg); - } else if (entity.getPrizeLevel() == PrizeLevelEnum.LEVEL_2.getValue()) { -// sendSingleRoomMsg(Constant.DefineProtocol.CUSTOM_MSG_LINEARLY_POOL_PRIZE, Constant.DefineProtocol.CUSTOM_MSG_LINEARLY_POOL_PRIZE_LV2, -// room, msg); - } else if (entity.getPrizeLevel() == PrizeLevelEnum.LEVEL_3.getValue()) { - Attach attach = new Attach(Constant.DefineProtocol.CUSTOM_MSG_LINEARLY_POOL_PRIZE, Constant.DefineProtocol.CUSTOM_MSG_LINEARLY_POOL_PRIZE_LV3, msg); - sendSysMsgService.sendMessageToPartition(room, attach); - } else if (entity.getPrizeLevel() == PrizeLevelEnum.LEVEL_4.getValue()) { - Attach attach = new Attach(Constant.DefineProtocol.CUSTOM_MSG_LINEARLY_POOL_PRIZE, Constant.DefineProtocol.CUSTOM_MSG_LINEARLY_POOL_PRIZE_LV4, msg); - sendSysMsgService.sendMessageToPartition(room, attach); - } else if (entity.getPrizeLevel() == PrizeLevelEnum.LEVEL_5.getValue()) { - Attach attach = new Attach(Constant.DefineProtocol.CUSTOM_MSG_LINEARLY_POOL_PRIZE, Constant.DefineProtocol.CUSTOM_MSG_LINEARLY_POOL_PRIZE_LV5, msg); - sendSysMsgService.sendMessageToPartition(room, attach); - } else { - throw new IllegalArgumentException("Not support send the prize level msg."); - } - } catch (Exception e) { - log.error("failed to send prize msg, roomUid="+ roomUid +", uid="+uid+", entity="+ JSONObject.toJSONString(entity), e); - } - } - - /** - * 构建奖品推送消息 - * - * @param roomUid - * @param uid - * @param entity - * @return - */ - public PrizePushMsg buildPrizePushMsg(final Long roomUid, final Long uid, final PrizeEntity entity, final Integer prizeRoomMsgUserLevel) { - PrizePushMsg msg = new PrizePushMsg(); - msg.setUid(uid); - msg.setRoomUid(roomUid); - Users user = usersService.getUsersByUid(uid); - msg.setNick(user.getNick()); - msg.setPrizeId(entity.getPrizeId()); - msg.setPrizeName(entity.getPrizeName()); - msg.setPrizeNum(entity.getPrizeNum()); - msg.setBoxTypeStr("航海冒险"); - msg.setUserLevelLimit(prizeRoomMsgUserLevel); - return msg; - } - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/linearlypool/LinearlyPrizePoolDrawLineItemDayService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/linearlypool/LinearlyPrizePoolDrawLineItemDayService.java deleted file mode 100644 index 48f715d4c..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/linearlypool/LinearlyPrizePoolDrawLineItemDayService.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.accompany.business.service.linearlypool; - -import cn.hutool.core.collection.CollectionUtil; -import com.accompany.business.dto.linearlypool.LinearlyPoolTotalStatisticsDTO; -import com.accompany.business.model.linearlypool.LinearlyPrizePoolDrawLineItemDay; -import com.accompany.business.mybatismapper.linearlypool.LinearlyPrizePoolDrawLineItemDayMapper; -import com.accompany.common.constant.Constant; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -import java.util.Date; -import java.util.List; -import java.util.Map; - -@Service -public class LinearlyPrizePoolDrawLineItemDayService extends ServiceImpl { - - /** - * 按时间统计抽奖汇总数据 - * @param startTime - * @param endTime - * @return - */ - public LinearlyPoolTotalStatisticsDTO statisticsTotalByTime(Date startTime, Date endTime) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().eq(LinearlyPrizePoolDrawLineItemDay::getDrawStatus, Constant.LinearlyPoolDrawStatus.HAS_DRAW) - .ge(LinearlyPrizePoolDrawLineItemDay::getDrawTime, startTime) - .lt(LinearlyPrizePoolDrawLineItemDay::getDrawTime, endTime); - // 统计抽奖次数,抽奖用户数,抽奖总支出,抽奖总收入 - queryWrapper.select("count(1) as drawCounts", "count(distinct uid) as drawUserCount", - "ifnull(sum(key_price),0) as totalPrice", "ifnull(sum(platform_value), 0) as totalPlatformValue"); - - List> resultMap = baseMapper.selectMaps(queryWrapper); - - LinearlyPoolTotalStatisticsDTO res = new LinearlyPoolTotalStatisticsDTO(); - res.setDrawCounts(0L); - res.setDrawUserCount(0L); - res.setTotalPrice(0L); - res.setTotalPlatformValue(0L); - if (CollectionUtil.isNotEmpty(resultMap)) { - Map result = resultMap.get(0); - if (result.get("drawCounts") != null) { - res.setDrawCounts(Long.valueOf(result.get("drawCounts").toString())); - } - if (result.get("drawUserCount") != null) { - res.setDrawUserCount(Long.valueOf(result.get("drawUserCount").toString())); - } - if (result.get("totalPrice") != null) { - res.setTotalPrice(Long.valueOf(result.get("totalPrice").toString())); - } - if (result.get("totalPlatformValue") != null) { - res.setTotalPlatformValue(Long.valueOf(result.get("totalPlatformValue").toString())); - } - } - - return res; - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/linearlypool/LinearlyPrizePoolDrawLineItemService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/linearlypool/LinearlyPrizePoolDrawLineItemService.java deleted file mode 100644 index a1d264855..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/linearlypool/LinearlyPrizePoolDrawLineItemService.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.accompany.business.service.linearlypool; - -import cn.hutool.core.collection.CollectionUtil; -import com.accompany.business.model.linearlypool.LinearlyPrizePoolDrawLineItem; -import com.accompany.business.model.linearlypool.LinearlyPrizePoolDrawLineItemDay; -import com.accompany.business.mybatismapper.linearlypool.LinearlyPrizePoolDrawLineItemMapper; -import com.accompany.business.vo.openbox.DrawPrizeItemVo; -import com.accompany.common.constant.Constant; -import com.accompany.common.utils.BeanUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; - -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -@Service -public class LinearlyPrizePoolDrawLineItemService extends ServiceImpl { - - @Autowired - private LinearlyPrizePoolDrawLineItemDayService linearlyPrizePoolDrawLineItemDayService; - - public List listByLineId(Long lineId) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().eq(LinearlyPrizePoolDrawLineItem::getLineId, lineId); - - return baseMapper.selectList(queryWrapper); - } - - @Async - public void updateStatusAfterDrawAsync(List drawLineItems, Long uid, String deviceId, Date drawTime, Integer keyPrice, List prizeItems) { - Map prizeItemMap = prizeItems.stream().collect(Collectors.toMap(DrawPrizeItemVo::getPrizeId, it -> it, (k1, k2) -> k1)); - if (CollectionUtil.isNotEmpty(drawLineItems)) { - List updateItems = drawLineItems.stream().map(item -> { - LinearlyPrizePoolDrawLineItem itemForUpdate = new LinearlyPrizePoolDrawLineItem(); - itemForUpdate.setId(item.getId()); - itemForUpdate.setUid(uid); - itemForUpdate.setDeviceId(deviceId); - itemForUpdate.setDrawStatus(Constant.LinearlyPoolDrawStatus.HAS_DRAW); - itemForUpdate.setUpdateTime(drawTime); - itemForUpdate.setDrawTime(drawTime); - itemForUpdate.setKeyPrice(keyPrice); - - DrawPrizeItemVo drawPrizeItemVo = prizeItemMap.get(item.getPrizeId()); - if (drawPrizeItemVo != null) { - itemForUpdate.setPrizeType(drawPrizeItemVo.getPrizeType()); - itemForUpdate.setPrizeName(drawPrizeItemVo.getPrizeName()); - itemForUpdate.setPrizeImgUrl(drawPrizeItemVo.getPrizeImgUrl()); - itemForUpdate.setReferenceId(drawPrizeItemVo.getReferenceId()); - itemForUpdate.setPlatformValue(drawPrizeItemVo.getPlatformValue()); - itemForUpdate.setActualValue(drawPrizeItemVo.getPlatformValue()); - itemForUpdate.setPrizeLevel(drawPrizeItemVo.getPrizeLevel()); - } - - return itemForUpdate; - }).collect(Collectors.toList()); - updateBatchById(updateItems, 10000); - - // 记录到近几天的表,优化平台数据统计查询效率 - List drawLineItemIds = drawLineItems.stream().map(LinearlyPrizePoolDrawLineItem::getId).collect(Collectors.toList()); - List linearlyPrizePoolDrawLineItems = baseMapper.selectBatchIds(drawLineItemIds); - List dayItems = linearlyPrizePoolDrawLineItems.stream().map(item -> BeanUtil.map(item, LinearlyPrizePoolDrawLineItemDay.class)).collect(Collectors.toList()); - linearlyPrizePoolDrawLineItemDayService.saveBatch(dayItems, 10000); - } - - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/linearlypool/LinearlyPrizePoolItemDraftService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/linearlypool/LinearlyPrizePoolItemDraftService.java deleted file mode 100644 index 47ab2badc..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/linearlypool/LinearlyPrizePoolItemDraftService.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.accompany.business.service.linearlypool; - -import com.accompany.business.model.linearlypool.LinearlyPrizePoolItemDraft; -import com.accompany.business.mybatismapper.linearlypool.LinearlyPrizePoolItemDraftMapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -import java.util.List; - -@Service -public class LinearlyPrizePoolItemDraftService extends ServiceImpl { - public List listByPoolType(byte poolType) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().eq(LinearlyPrizePoolItemDraft::getPrizePoolType, poolType); - return baseMapper.selectList(queryWrapper); - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/linearlypool/LinearlyPrizePoolItemService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/linearlypool/LinearlyPrizePoolItemService.java deleted file mode 100644 index 1a257b3c1..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/linearlypool/LinearlyPrizePoolItemService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.accompany.business.service.linearlypool; - -import com.accompany.business.model.linearlypool.LinearlyPrizePoolItem; -import com.accompany.business.mybatismapper.linearlypool.LinearlyPrizePoolItemMapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -import java.util.List; - -@Service -public class LinearlyPrizePoolItemService extends ServiceImpl { - - public List listValidByPoolType(byte poolType) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().eq(LinearlyPrizePoolItem::getPrizePoolType, poolType) - .gt(LinearlyPrizePoolItem::getPrizeNum, 0); - return baseMapper.selectList(queryWrapper); - } - - public List listByPoolType(byte poolType) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().eq(LinearlyPrizePoolItem::getPrizePoolType, poolType); - return baseMapper.selectList(queryWrapper); - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/linearlypool/LinearlyPrizePoolRankService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/linearlypool/LinearlyPrizePoolRankService.java deleted file mode 100644 index 83b70595f..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/linearlypool/LinearlyPrizePoolRankService.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.accompany.business.service.linearlypool; - -import com.accompany.business.service.level.LevelService; -import com.accompany.business.service.user.UsersService; -import com.accompany.business.vo.linearlypool.LinearlyPoolRankParentVo; -import com.accompany.business.vo.linearlypool.LinearlyPoolRankVo; -import com.accompany.common.utils.DateTimeUtil; -import com.accompany.core.model.Users; -import com.accompany.core.service.common.JedisService; -import com.accompany.core.vo.UserLevelVo; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.*; -import java.util.stream.Collectors; - -@Service -@Slf4j -public class LinearlyPrizePoolRankService { - - @Autowired - private JedisService jedisService; - @Autowired - private UsersService usersService; - @Autowired - private LevelService levelService; - - /** - * 自增开箱子排行 - * @param key - * @param uid - * @param score - */ - public void incrOpenBox(String key, Long uid, Double score) { - boolean isExists = jedisService.exits(key); - jedisService.zincrby(key, score, uid.toString()); - if (!isExists) { - //榜单保留三天 - jedisService.expireAt(key, (DateTimeUtil.getLastDay(new Date(),3).getTime())); - } - } - - /** - * 获取榜单列表 - * - * @param key - * @param page - * @param pageSize - * @return - */ - public LinearlyPoolRankParentVo ranking(String key, Integer page, Integer pageSize) { - LinearlyPoolRankParentVo boxParentRankVo = new LinearlyPoolRankParentVo(); - // 最多返回100条 - if (page * pageSize > 100) { - boxParentRankVo.setRankVos(new ArrayList<>()); - return boxParentRankVo; - } - - Set> rankings = jedisService.zrevrangeWithScore(key, - (long) (page - 1) * pageSize, (long) ((page * pageSize) - 1)); - List uids = rankings.stream().map(ranking -> (String)ranking.get("member")).collect(Collectors.toList()); - String[] uidArr = uids.toArray(new String[uids.size()]); - Map usersMap = usersService.getUsersMapBatch(uidArr); - Map userLevelVoMap = levelService.getUserLevelVoMap(uidArr); - List rankingVos = new ArrayList<>(uids.size()); - rankings.stream().forEach(ranking -> { - Long userId = Long.parseLong(ranking.get("member").toString()); - Long score = Math.round((Double) ranking.get("score")); - Long rankingNum = getRankIndex(key, userId.toString()) + 1; - LinearlyPoolRankVo boxRankVo = new LinearlyPoolRankVo(); - boxRankVo.setAmount(score); - boxRankVo.setRanking(rankingNum); - Users user = usersMap.get(userId); - if (user != null) { - boxRankVo = buildRankUser(boxRankVo, user); - } - UserLevelVo level = userLevelVoMap.get(userId); - if (level != null) { - boxRankVo = buildRankLevel(boxRankVo, level); - } - rankingVos.add(boxRankVo); - }); - boxParentRankVo.setRankVos(rankingVos); - return boxParentRankVo; - } - - public LinearlyPoolRankVo buildRankUser(LinearlyPoolRankVo boxRankVo, Users user) { - boxRankVo.setUid(user.getUid()); - boxRankVo.setErbanNo(user.getErbanNo()); - boxRankVo.setNick(user.getNick()); - boxRankVo.setAvatar(user.getAvatar()); - boxRankVo.setGender(user.getGender()); - return boxRankVo; - } - - public LinearlyPoolRankVo buildRankLevel(LinearlyPoolRankVo boxRankVo, UserLevelVo level) { - boxRankVo.setExperSeq(level.getExperLevelSeq()); - boxRankVo.setExperUrl(level.getExperUrl()); - boxRankVo.setCharmSeq(level.getCharmLevelSeq()); - boxRankVo.setCharmUrl(level.getCharmUrl()); - return boxRankVo; - } - - /** - * 获取指定member当前排名 - * - * @param key - * @param member - * @return - */ - private Long getRankIndex(String key, String member) { - return Optional.ofNullable(jedisService.zrevrank(key, member)).orElse(-1L); - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/linearlypool/LinearlyPrizePoolService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/linearlypool/LinearlyPrizePoolService.java deleted file mode 100644 index 463f781a5..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/linearlypool/LinearlyPrizePoolService.java +++ /dev/null @@ -1,933 +0,0 @@ -package com.accompany.business.service.linearlypool; - -import cn.hutool.core.collection.CollectionUtil; -import com.accompany.business.constant.LinearlyPrizePoolTypeEnum; -import com.accompany.business.constant.PrizeLevelEnum; -import com.accompany.business.constant.PrizeTypeEnum; -import com.accompany.business.constant.activities.ActivitesPackTypeEnum; -import com.accompany.business.constant.linearlypool.LinearlyPoolConstants; -import com.accompany.business.dto.linearlypool.LinearlyPoolConfigDTO; -import com.accompany.business.dto.linearlypool.LinearlyPoolTotalStatisticsDTO; -import com.accompany.business.message.PrizeEntity; -import com.accompany.business.message.linearlypool.LinearlyPoolPrizeMessage; -import com.accompany.business.model.Prize; -import com.accompany.business.model.PrizeExample; -import com.accompany.business.model.linearlypool.LinearlyPrizePoolDrawLineItem; -import com.accompany.business.model.linearlypool.LinearlyPrizePoolDrawLineItemDay; -import com.accompany.business.model.linearlypool.LinearlyPrizePoolItem; -import com.accompany.business.model.user.UserActPropertyInfoV2; -import com.accompany.business.mybatismapper.PrizeMapper; -import com.accompany.business.service.box.PrizeService; -import com.accompany.business.service.level.LevelService; -import com.accompany.business.service.mq.RocketMQService; -import com.accompany.business.service.user.UserActPropertyInfoV2Service; -import com.accompany.business.vo.PrizeWithRateVo; -import com.accompany.business.vo.linearlypool.DrawResultVO; -import com.accompany.business.vo.openbox.DrawPrizeItemVo; -import com.accompany.common.annotation.Frozen; -import com.accompany.common.config.SystemConfig; -import com.accompany.common.config.WebSecurityConfig; -import com.accompany.common.constant.Constant; -import com.accompany.common.push.MarkdownMessage; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.BlankUtil; -import com.accompany.common.utils.DateTimeUtil; -import com.accompany.common.utils.StringUtils; -import com.accompany.common.utils.UUIDUtil; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.service.SysConfService; -import com.accompany.core.service.common.JedisService; -import com.accompany.core.service.message.MessageRobotPushService; -import com.accompany.core.util.DateUtil; -import com.accompany.core.vo.UserLevelVo; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson2.JSON; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.Lists; -import lombok.Data; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.Assert; -import org.springframework.util.CollectionUtils; -import org.springframework.util.StopWatch; - -import java.io.IOException; -import java.math.BigDecimal; -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.stream.Collectors; - -@Service -@Slf4j -public class LinearlyPrizePoolService { - - @Autowired - private LinearlyPrizePoolItemService linearlyPrizePoolItemService; - @Autowired - private LinearlyPrizePoolDrawLineItemService linearlyPrizePoolDrawLineItemService; - @Autowired - private JedisService jedisService; - @Autowired - private PrizeService prizeService; - @Autowired - private UserActPropertyInfoV2Service userActPropertyInfoV2Service; - @Autowired - private RocketMQService rocketMQService; - @Autowired - private SysConfService sysConfService; - @Autowired - private PrizeMapper prizeMapper; - @Autowired - private LevelService levelService; - @Autowired - private LinearlyPrizePoolDrawLineItemDayService linearlyPrizePoolDrawLineItemDayService; - @Autowired - private MessageRobotPushService messageRobotPushService; - @Autowired - private WebSecurityConfig webSecurityConfig; - - private ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() * 4 - 1); - - private final static String CACHE_FIELD_MAX_LINE_ID = "max_line_id"; - private final static String CACHE_FIELD_CUR_LINE_ID = "cur_line_id"; - private final static String CACHE_FIELD_CURR_LINE_ITEM_IDX = "curr_line_item_idx"; - - private final static Long INIT_MAX_LINE_ID = 1L; - - private final static byte DEFAULT_PRIZE_MSG_LEVEL = 3; - - private final static int DEFAULT_KEY_PRICE = 10; - - /** - * 目前,用户查看抽奖记录可以按时间-time 和 价值-worth 排序 - */ - private static final String SORT_TYPE_TIME = "time"; - - private static final String NOT_ENOUGH_PRIZE_TIME = "网络不畅,请稍后再试"; - - public LinearlyPoolConfigDTO getConfig() { - LinearlyPoolConfigDTO config = JSONObject.parseObject(sysConfService.getDefaultSysConfValueById(Constant.SysConfId.LINEARLY_POOL_CONFIG, "{}"), LinearlyPoolConfigDTO.class); - if (config.getIsOpen() == null) { - config.setIsOpen(false); - } - if (config.getPrizeMsgLevel() == null) { - config.setPrizeMsgLevel(DEFAULT_PRIZE_MSG_LEVEL); - } - if (config.getPrizeMsgSwitch() == null) { - config.setPrizeMsgSwitch(false); - } - if (config.getPrizeRoomMsgUserLevel() == null) { - config.setPrizeRoomMsgUserLevel(0); - } - if (config.getKeyPrice() == null) { - config.setKeyPrice(DEFAULT_KEY_PRICE); - } - if (config.getOpenLevel() == null) { - config.setOpenLevel(0); - } - if (CollectionUtil.isEmpty(config.getWxNotifyPrizeIds())) { - config.setWxNotifyPrizeIds(Collections.emptyList()); - } - if (config.getWxNotifySwitch() == null) { - config.setWxNotifySwitch(true); - } - if (config.getHourReportSwitch() == null) { - config.setHourReportSwitch(true); - } - - return config; - } - - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - public void createPoolLine() { - String lockKey = RedisKey.linearly_pool_create_pool_line_lock.getKey(); - String lock = jedisService.lock(lockKey, 30000, 600); - if (StringUtils.isBlank(lock)) { - log.warn("[linearly createPoolLine]获取锁超时"); - return; - } - try { - doCreatePoolLine(); - } catch (Exception e) { - log.error("[linearly createPoolLine]生成奖品线出错",e); - } finally { - jedisService.unlock(lockKey, lock); - } - } - - private boolean doCreatePoolLine() throws IOException { - final StopWatch totalStopWatch = new StopWatch(); - try { - totalStopWatch.start("createLinealyPoolLine"); - List normalItems = linearlyPrizePoolItemService.listValidByPoolType(LinearlyPrizePoolTypeEnum.normal_prize_pool.getValue()); - List seniorItems = linearlyPrizePoolItemService.listValidByPoolType(LinearlyPrizePoolTypeEnum.senior_prize_pool.getValue()); - - if (CollectionUtil.isEmpty(normalItems) || CollectionUtil.isEmpty(seniorItems)) { - log.error("[linearly createPoolLine]普通奖池和高级奖池都必须添加奖品"); - return true; - } - - Long lineId = getNextLineId(); - List poolLine = new ArrayList<>(); - final StopWatch createDrawLineItemTaskStopWatch = new StopWatch(); - int poolGroupIdx = 1; - // 按数量,展开高级奖品组 - List seniorItemsForCreateLine = new ArrayList<>(); - for (LinearlyPrizePoolItem seniorItem : seniorItems) { - for (int i = 0; i < seniorItem.getPrizeNum(); i++) { - seniorItemsForCreateLine.add(seniorItem); - } - } - // 打乱高级奖品组里礼物的顺序 - Collections.shuffle(seniorItemsForCreateLine); - - for (LinearlyPrizePoolItem seniorItem : seniorItemsForCreateLine) { - // 每一个高级组的奖品,生成一个奖品组 - createDrawLineItemTaskStopWatch.start("createPoolLineGroup_" + poolGroupIdx); - LinearlyPrizePoolDrawLineItem seniorDrawLineItem = genSeniorDrawLineItem(seniorItem, lineId, poolGroupIdx); - List normalDrawLineItems = genNormalDrawLineItems(normalItems, lineId, poolGroupIdx); - - List lineGroup = new ArrayList<>(); - lineGroup.add(seniorDrawLineItem); - lineGroup.addAll(normalDrawLineItems); - Collections.shuffle(lineGroup); - - poolLine.addAll(lineGroup); - poolGroupIdx++; - createDrawLineItemTaskStopWatch.stop(); - } - - log.info("[linearly createPoolLine]create pool line item instances use itme :{}ms", createDrawLineItemTaskStopWatch.getTotalTimeMillis()); - log.info("[linearly createPoolLine]total line item count: {}", poolLine.size()); - - final StopWatch saveDataStopWatch = new StopWatch(); - saveDataStopWatch.start("saveDataToDb_"+lineId); - linearlyPrizePoolDrawLineItemService.saveBatch(poolLine, 30000); - poolLine = linearlyPrizePoolDrawLineItemService.listByLineId(lineId); - saveDataStopWatch.stop(); - log.info("[linearly createPoolLine]save pool line to db use itme :{}ms", saveDataStopWatch.getTotalTimeMillis()); - - - saveCache(poolLine); - return true; - } finally { - totalStopWatch.stop(); - log.info("[linearly createPoolLine]use total itme :{}ms", totalStopWatch.getTotalTimeMillis()); - } - } - - private void saveCache(List poolLine) throws IOException { - if (CollectionUtil.isEmpty(poolLine)) { - return ; - } - Long lineId = poolLine.get(0).getLineId(); - final StopWatch saveDataStopWatch = new StopWatch(); - saveDataStopWatch.start("saveDataToRedis_"+lineId); - initCurrentLineIdIfNecessary(lineId); - // 按奖品线id分组保存到缓存中 - String cachKey = RedisKey.linearly_pool_draw_line.getKey(lineId.toString()); - jedisService.rpushList(cachKey, poolLine.stream().map(JSON::toJSONString).toList()); - jedisService.hset(RedisKey.linearly_pool_stat.getKey(), CACHE_FIELD_MAX_LINE_ID, lineId.toString()); - jedisService.zadd(RedisKey.linearly_pool_line_id_list.getKey(), lineId.doubleValue(), lineId.toString()); - saveDataStopWatch.stop(); - log.info("[linearly createPoolLine]save pool line to redis use itme :{}ms", saveDataStopWatch.getTotalTimeMillis()); - } - - private void initCurrentLineIdIfNecessary(Long lineId) { - Long curLineId = getCurrentLineId(); - if (curLineId == null) { - String lockKey = RedisKey.linearly_pool_cur_line_id_lock.getKey(); - String lock = jedisService.lock(lockKey, 5000, 10); - if (StringUtils.isBlank(lockKey)) { - log.warn("get current line id lock fail"); - return ; - } - try { - curLineId = getCurrentLineId(); - if (curLineId != null) { - return ; - } - jedisService.hset(RedisKey.linearly_pool_stat.getKey(), CACHE_FIELD_CUR_LINE_ID, lineId.toString()); - } finally { - jedisService.unlock(lockKey, lock); - } - } - } - - public Long getCurrentLineId() { - String lineIdStr = jedisService.hget(RedisKey.linearly_pool_stat.getKey(), CACHE_FIELD_CUR_LINE_ID); - if (StringUtils.isBlank(lineIdStr)) { - return null; - } else { - return Long.valueOf(lineIdStr); - } - } - - private LinearlyPrizePoolDrawLineItem genSeniorDrawLineItem(LinearlyPrizePoolItem seniorItem, Long lineId, int poolGroupIdx) { - LinearlyPrizePoolDrawLineItem drawLineItem = createDrawLineItem(seniorItem, lineId, poolGroupIdx); - - return drawLineItem; - } - - private Long getNextLineId() { - String maxLineId = jedisService.hget(RedisKey.linearly_pool_stat.getKey(), CACHE_FIELD_MAX_LINE_ID); - if (StringUtils.isBlank(maxLineId)) { - return INIT_MAX_LINE_ID; - } - return Long.valueOf(maxLineId) + 1; - } - - private List genNormalDrawLineItems(List normalItems, Long lineId, int poolGroupIdx) { - // 按奖品的数量,生成相应个数的实例 - List>> createNormalDrawLineItemTaskFutures = new ArrayList<>(); - for (LinearlyPrizePoolItem normalItem : normalItems) { - CompletableFuture> taskFuture = CompletableFuture.supplyAsync(() -> { - List items = genDrawLineItemsUsePrizePoolItem(normalItem, lineId, poolGroupIdx); - return items; - }, executorService); - createNormalDrawLineItemTaskFutures.add(taskFuture); - } - List normalDrawLineItems = new ArrayList<>(); - for (CompletableFuture> createNormalDrawLineItemTaskFuture : createNormalDrawLineItemTaskFutures) { - normalDrawLineItems.addAll(createNormalDrawLineItemTaskFuture.join()); - } -// log.debug("[genNormalDrawLineItems]normalDrawLineItems: {}", JSONObject.toJSONString(normalDrawLineItems)); - return normalDrawLineItems; - } - - private List genDrawLineItemsUsePrizePoolItem(LinearlyPrizePoolItem prizePoolItem, Long lineId, int poolGroupIdx) { - LinearlyPrizePoolDrawLineItem lineItem = createDrawLineItem(prizePoolItem, lineId, poolGroupIdx); - List resList = new ArrayList<>(prizePoolItem.getPrizeNum()); - for (int i = 0; i < prizePoolItem.getPrizeNum(); i++) { - resList.add(lineItem); - } - - return resList; - } - - private LinearlyPrizePoolDrawLineItem createDrawLineItem(LinearlyPrizePoolItem prizePoolItem, Long lineId, int poolGroupIdx) { - Prize prize = prizeService.getPrizeById(prizePoolItem.getPrizeId()); - LinearlyPrizePoolDrawLineItem lineItem = new LinearlyPrizePoolDrawLineItem(); - lineItem.setLineId(lineId); - lineItem.setPrizeId(prize.getId()); - lineItem.setPrizeType(prize.getPrizeType()); - lineItem.setPrizeName(prize.getPrizeName()); - lineItem.setPrizeImgUrl(prize.getPrizeImgUrl()); - lineItem.setReferenceId(prize.getReferenceId()); - lineItem.setPlatformValue(prize.getPlatformValue()); - lineItem.setActualValue(prize.getActualValue()); - lineItem.setPrizeLevel(prize.getPrizeLevel()); - lineItem.setPrizePoolType(prizePoolItem.getPrizePoolType()); - lineItem.setPrizePoolGroup(poolGroupIdx); - return lineItem; - } - - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - public void createPoolLineIfNecessary() { - long maxLineId = Optional.ofNullable(getMaxLineId()).orElse(0L); - long currLineId = Optional.ofNullable(getCurrentLineId()).orElse(0L); - - if (maxLineId - currLineId < SystemConfig.minAvailableLinearlyPoolLineCount) { - // 如果当前剩余可用的奖品线小于配置的数量,则生成新的 - String lockKey = RedisKey.linearly_pool_create_pool_line_lock.getKey(); - String lock = jedisService.lock(lockKey, 30000, 600); - if (StringUtils.isBlank(lock)) { - log.warn("[linearly createPoolLineIfNecessary]获取锁超时"); - return; - } - try { - maxLineId = Optional.ofNullable(getMaxLineId()).orElse(0L); - currLineId = Optional.ofNullable(getCurrentLineId()).orElse(0L); - if (maxLineId - currLineId < SystemConfig.minAvailableLinearlyPoolLineCount) { - doCreatePoolLine(); - } else { - log.info("[linearly createPoolLineIfNecessary]有足够的奖品线,不进行生成"); - } - } catch (Exception e) { - log.error("[linearly createPoolLineIfNecessary]生成奖品线出错",e); - } finally { - jedisService.unlock(lockKey, lock); - } - } else { - log.info("[linearly createPoolLineIfNecessary]有足够的奖品线,不进行生成"); - } - } - - public Long getMaxLineId() { - String lineIdStr = jedisService.hget(RedisKey.linearly_pool_stat.getKey(), CACHE_FIELD_MAX_LINE_ID); - if (StringUtils.isBlank(lineIdStr)) { - return null; - } else { - return Long.valueOf(lineIdStr); - } - } - - public void clearDrawOutPoolLine() { - String lockKey = RedisKey.linearly_pool_clear_pool_line_lock.getKey(); - String lock = jedisService.lock(lockKey, 30000, 600); - if (StringUtils.isBlank(lock)) { - log.warn("[linearly clearDrawOutPoolLine]获取锁超时"); - return; - } - try { - Long currLineId = Optional.ofNullable(getCurrentLineId()).orElse(0L); - if (currLineId <= 0) { - return ; - } - Long endLineId = currLineId - 1; - // 小于当前id的都为已抽取完的奖池线id - Set drawOutIds = jedisService.zrangeByScore(RedisKey.linearly_pool_line_id_list.getKey(), 0, endLineId); - if (CollectionUtil.isNotEmpty(drawOutIds)) { - drawOutIds.forEach(id -> { - String cachKey = RedisKey.linearly_pool_draw_line.getKey(id); - jedisService.del(cachKey); - }); - - jedisService.zremrangeByScore(RedisKey.linearly_pool_line_id_list.getKey(), 0 ,endLineId); - } - } catch (Exception e) { - log.error("[linearly clearDrawOutPoolLine]清理已抽取完的奖品线出错",e); - } finally { - jedisService.unlock(lockKey, lock); - } - } - - public List listPrizeWithRate() { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().gt(LinearlyPrizePoolItem::getPrizeNum, 0); - List poolItems = linearlyPrizePoolItemService.list(queryWrapper); - List prizes = getPrizesInPrizePools(poolItems); - - Map prizePoolItemMaps = poolItems.stream().collect(Collectors.toMap( - LinearlyPrizePoolItem::getPrizeId, prizePoolItem -> prizePoolItem, (a, b) -> a)); - - List list = com.google.common.collect.Lists.newArrayList(); - if (!CollectionUtils.isEmpty(prizes)) { - for (Prize prize : prizes) { - PrizeWithRateVo prizeWithRateVo = new PrizeWithRateVo(); - prizeWithRateVo.setPrizeId(prize.getId()); - prizeWithRateVo.setPrizeName(prize.getPrizeName()); - prizeWithRateVo.setPrizeType(prize.getPrizeType()); - prizeWithRateVo.setPrizeImgUrl(prize.getPrizeImgUrl()); - prizeWithRateVo.setPlatformValue(prize.getPlatformValue()); - LinearlyPrizePoolItem prizePoolItem = prizePoolItemMaps.get(prize.getId()); - BigDecimal showRate = new BigDecimal(prizePoolItem.getShowRatio()).divide(LinearlyPoolConstants.RATE_SCALE); - showRate = showRate.setScale(2, BigDecimal.ROUND_HALF_UP); - prizeWithRateVo.setShowRate(showRate + "%"); - list.add(prizeWithRateVo); - } - } - return list; - } - - private List getPrizesInPrizePools(List prizePoolItems) { - List prizeIdList = prizePoolItems.stream().map(LinearlyPrizePoolItem::getPrizeId).collect(Collectors.toList()); - Assert.notEmpty(prizeIdList, "奖品池不能为空"); - - //查询奖品详情,按平台价值排序 - PrizeExample prizeExample = new PrizeExample(); - prizeExample.createCriteria().andIdIn(prizeIdList); - prizeExample.setOrderByClause("platform_value desc"); - List prizes = prizeMapper.selectByExample(prizeExample); - return prizes; - } - - /** - * 获取抽奖记录,以及【奖品数量计算+分页处理】 - * 说明:数据库存放的促销活动记录,是没有数量字段,有多少个奖品,就有多少条记录。 - * - * @param uid 用户id - * @param sortType 排序方式:按时间:time,按价值:worth - * @param page 页码 - * @param pageSize 页大小 - */ - public List listUserDrawRecordByPage(Long uid, String sortType, Integer page, Integer pageSize) { - List drawRecords = listRecordByPage(uid, 1, LinearlyPoolConstants.DRAW_RECORD_LIMIT_NUM); - if (CollectionUtil.isEmpty(drawRecords)) { - return Collections.emptyList(); - } - - List drawPrizeItemVoList = new ArrayList<>(drawRecords.size()); - for (LinearlyPrizePoolDrawLineItem drawLotteryRecord : drawRecords) { - DrawPrizeItemVo drawPrizeItemVo = new DrawPrizeItemVo(); - drawPrizeItemVo.setCreateTime(drawLotteryRecord.getDrawTime().getTime()); - drawPrizeItemVo.setPlatformValue(drawLotteryRecord.getPlatformValue()); - drawPrizeItemVo.setPrizeId(drawLotteryRecord.getPrizeId()); - drawPrizeItemVo.setPrizeImgUrl(drawLotteryRecord.getPrizeImgUrl()); - drawPrizeItemVo.setPrizeLevel(drawLotteryRecord.getPrizeLevel()); - drawPrizeItemVo.setPrizeType(drawLotteryRecord.getPrizeType()); - drawPrizeItemVo.setPrizeName(drawLotteryRecord.getPrizeName()); - //设置数量 - drawPrizeItemVo.setPrizeNum(1); - drawPrizeItemVoList.add(drawPrizeItemVo); - } - - //分组,key 为奖品id+时间戳,value 为 List - ArrayListMultimap myMultimap = ArrayListMultimap.create(); - for (DrawPrizeItemVo drawPrizeItemVo : drawPrizeItemVoList) { - myMultimap.put(drawPrizeItemVo.getPrizeId().toString() + drawPrizeItemVo.getCreateTime().toString(), drawPrizeItemVo); - } - - log.debug("drawPrizeItemVoList size:{},myMultimap.keys():{}", drawRecords.size(), myMultimap.keySet().size()); - //设置数量 - List result = Lists.newArrayList(); - for (String value : myMultimap.keySet()) { - List drawPrizeItemVos = myMultimap.get(value); - int prizeNum = drawPrizeItemVos.size(); - DrawPrizeItemVo drawPrizeItemVo = drawPrizeItemVos.get(0); - drawPrizeItemVo.setPrizeNum(prizeNum); - result.add(drawPrizeItemVo); - } - - //排序 - List itemVoList = sortType.equals(SORT_TYPE_TIME) ? - result.stream().sorted(Comparator.comparing(DrawPrizeItemVo::getCreateTime).reversed()).collect(Collectors.toList()) : - result.stream().sorted(Comparator.comparing(DrawPrizeItemVo::getPlatformValue).reversed()).collect(Collectors.toList()); - - return pageList(itemVoList, page, pageSize); - } - - private List listRecordByPage(Long uid, int page, int pageSize) { - IPage queryPage = new Page<>(page, pageSize); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().eq(LinearlyPrizePoolDrawLineItem::getUid, uid) - .eq(LinearlyPrizePoolDrawLineItem::getDrawStatus, Constant.LinearlyPoolDrawStatus.HAS_DRAW) - .orderByDesc(LinearlyPrizePoolDrawLineItem::getId); - IPage pageInfo = linearlyPrizePoolDrawLineItemService.page(queryPage, queryWrapper); - if (pageInfo != null) { - return pageInfo.getRecords(); - } else { - return Collections.emptyList(); - } - } - - /** - * 对列表进行分页 - * - * @param drawPrizeItemVoList 待分页对象 - * @param page 页数,从1开始 - * @param pageSize 页大小 - * @return List - */ - public List pageList(List drawPrizeItemVoList, int page, int pageSize) { - Assert.isTrue(page > 0, "page 必须大于0"); - Assert.isTrue(pageSize > 0, "pageSize 必须大于0"); - - int totalCount = drawPrizeItemVoList.size(); - - //是否整除 - int m = totalCount % pageSize; - //总页数 - int pageCount = totalCount / pageSize; - - log.info("m:{},page:{},pageCount:{},pageSize:{}", m, page, pageCount, pageSize); - //能整除的情况 - if (m == 0) { - return page > pageCount ? Collections.emptyList() : - drawPrizeItemVoList.subList((page - 1) * pageSize, pageSize * page); - } - if (page > pageCount + 1) { - return Collections.emptyList(); - } - - return page > pageCount ? - drawPrizeItemVoList.subList((page - 1) * pageSize, totalCount) : - drawPrizeItemVoList.subList((page - 1) * pageSize, pageSize * page); - } - - public void clearExpiredDrawLineDatas() { - Date expireTime = DateUtil.beginOfDate(DateUtil.addDays(new Date(), -2)); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.lambda().lt(LinearlyPrizePoolDrawLineItemDay::getDrawTime, expireTime); - linearlyPrizePoolDrawLineItemDayService.remove(wrapper); - } - - public void reportTotalStatisticsByTime(Date startTime, Date endTime) { - LinearlyPoolConfigDTO config = getConfig(); - if (config.getHourReportSwitch()) { - LinearlyPoolTotalStatisticsDTO statisticsRes = linearlyPrizePoolDrawLineItemDayService.statisticsTotalByTime(startTime, endTime); - sendTotalStatisticsReportUseEnterpriseWechatMsg(statisticsRes, startTime, endTime, config); - } else { - log.info("定点播报开关关闭"); - } - } - - private void sendTotalStatisticsReportUseEnterpriseWechatMsg(LinearlyPoolTotalStatisticsDTO statisticsRes, Date startTime, Date endTime, LinearlyPoolConfigDTO config) { - MarkdownMessage msg = new MarkdownMessage(); - String gameName = StringUtils.isNotBlank(config.getGameName()) ? config.getGameName() : LinearlyPoolConstants.DEFAULT_GAME_NAME; - String header = new StringBuilder("[").append(gameName).append("]在 ").append(DateTimeUtil.convertDate(startTime)).append("-") - .append(DateTimeUtil.convertDate(endTime)).append("期间内情况如下:").toString(); - msg.addTitle(MarkdownMessage.getHeaderText(3, header)); - msg.add(MarkdownMessage.getReferenceText(new StringBuilder("参与用户数: ").append(statisticsRes.getDrawUserCount()).toString())); - msg.add(MarkdownMessage.getReferenceText(new StringBuilder("用户参与总数: ").append(statisticsRes.getTotalPrice()).toString())); - msg.add(MarkdownMessage.getReferenceText(new StringBuilder("用户产出总价值: ").append(statisticsRes.getTotalPlatformValue()).toString())); - msg.add(MarkdownMessage.getReferenceText(new StringBuilder("游戏进行次数 ").append(statisticsRes.getDrawCounts()).toString())); - String key = webSecurityConfig.getActivityDingPushKey(); - messageRobotPushService.pushMessageByKey(key, msg, true); - } - - @Data - public class DrawIndexInfo { - private Long lineId; - - private Long startIdx; - - private Long endIdx; - } - - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - @Frozen - public DrawResultVO draw(Long uid, Long roomUid, Boolean sendMessage, Integer keyNum, String deviceId) { - if (com.accompany.core.util.StringUtils.isEmpty(deviceId)){ - throw new ServiceException(BusiStatus.DEVICE_ID_NOT_EXISTS); - } - LinearlyPoolConfigDTO config = getConfig(); - if (!config.getIsOpen()) { - throw new ServiceException(BusiStatus.BUSIERROR, "活动未开放"); - } - UserLevelVo userLevel = levelService.getUserLevelVo(uid); - if (userLevel == null || config.getOpenLevel().compareTo(userLevel.getExperLevelSeq()) > 0) { - throw new ServiceException(BusiStatus.NOT_ENOUGH_LEVEL); - } - String lockKey = RedisKey.linearly_pool_draw_lock.getKey(uid.toString()); - String lockVal = jedisService.lock(lockKey, 10 * 1000); - if (BlankUtil.isBlank(lockVal)) { - log.error("[linearly pool draw]获取分布式锁失败,uid:{},keyNum:{}", uid, keyNum); - throw new ServiceException(BusiStatus.LINEARLY_POOL_USER_TO_MORE); - } - try { - StopWatch drawStopWatch = new StopWatch(); - drawStopWatch.start("linearlyPoolDraw_" + uid); - - // 扣减道具 - StopWatch reducePieceStopWatch = new StopWatch(); - reducePieceStopWatch.start("linearlyPoolReducePiece_" + uid); - UserActPropertyInfoV2 userActPropertyInfo; - try { - userActPropertyInfo = userActPropertyInfoV2Service.reduceUserPiece(uid, keyNum.longValue(), ActivitesPackTypeEnum.SHIP_ANTICS.getValue()); - } catch (ServiceException e) { - if (e.getBusiStatus() == BusiStatus.PIECE_NOT_ENOUGH) { - throw new ServiceException(BusiStatus.INSUFFICIENT_FUEL_QUANTITY); - } else { - throw e; - } - } - reducePieceStopWatch.stop(); - log.info("[linearly pool draw]reduce piece use time: {}ms", reducePieceStopWatch.getTotalTimeMillis()); - - List drawIndexInfos = calcuDrawLineIndexInfos(uid, keyNum); - - DrawResultVO resultVO = cropDrawResult(uid, deviceId, userActPropertyInfo, drawIndexInfos, config.getKeyPrice()); - sendPrizeMsg(uid, roomUid, sendMessage, resultVO.getPrizeItemVoList(), resultVO.getDrawTime()); - - drawStopWatch.stop(); - log.info("[linearly pool draw]draw total use time: {}ms", drawStopWatch.getTotalTimeMillis()); - return resultVO; - } finally { - jedisService.unlock(lockKey, lockVal); - } - } - - /** - * 发送奖品消息 - * @param uid - * @param roomUid - * @param sendMessage - * @param prizeItemVoList - * @param drawTime - */ - private void sendPrizeMsg(Long uid, Long roomUid, Boolean sendMessage, List prizeItemVoList, Date drawTime) { - LinearlyPoolPrizeMessage[] prizeMessages = buildPrizeMessages(uid, roomUid, prizeItemVoList, sendMessage, drawTime); - for (int level = prizeMessages.length - 1; level >= 0; level--) { - LinearlyPoolPrizeMessage msg = prizeMessages[level]; - if (msg == null) { - continue; - } - - if (!CollectionUtils.isEmpty(msg.getPrizeList())) { - // 缓存消息的消费状态,便于队列消息做幂等处理 - jedisService.hwrite(RedisKey.mq_linearly_pool_prize_status.getKey(), msg.getMessId(), JSONObject.toJSONString(msg)); - rocketMQService.sendLinearlyPoolDrawMessage(msg); - } - - } - } - - protected String generLinearlyPoolMsgQueueName(int level) { - if (level > 0) { - return "linearly-pool-draw-queue-lv" + level; - } - - return "linearly-pool-draw-queue"; - } - - private LinearlyPoolPrizeMessage[] buildPrizeMessages(Long uid, Long roomUid, List prizeItemVoList, Boolean sendMessage, Date drawTime) { - // 多预留一个位置放未知等级的 - LinearlyPoolPrizeMessage[] messages = new LinearlyPoolPrizeMessage[PrizeLevelEnum.values().length + 1]; - for (DrawPrizeItemVo item : prizeItemVoList) { - int idx = item.getPrizeLevel(); - // 由于要与消息队列名相关,所以必须是已知的等级,如果是未知的等级,就放入默认队列中 - if (idx > PrizeLevelEnum.LEVEL_5.getValue()) { - idx = 0; - } - LinearlyPoolPrizeMessage msg = messages[idx]; - if (msg == null) { - msg = new LinearlyPoolPrizeMessage(); - msg.setMessId(UUIDUtil.get()); - msg.setMessTime(drawTime.getTime()); - msg.setUid(uid); - msg.setRoomUid(roomUid); - msg.setSendMessage(sendMessage); - List entities = com.google.common.collect.Lists.newArrayListWithCapacity(prizeItemVoList.size()); - msg.setPrizeList(entities); - - // 将消息放入相应等级下标下 - messages[idx] = msg; - } - PrizeEntity entity = new PrizeEntity(); - entity.setPrizeId(item.getPrizeId()); - entity.setPrizeType(item.getPrizeType()); - entity.setPrizeValue(getPrizeValue(item)); - entity.setPrizeName(item.getPrizeName()); - entity.setPrizeLevel(item.getPrizeLevel()); - entity.setPrizeNum(item.getPrizeNum()); - entity.setPlatformValue(item.getPlatformValue()); - //TODO 对于头饰/背景/座驾,萌声已支持配置赠送天数。但还未迁移.默认使用7天 - entity.setPrizeRefValue(7); - msg.getPrizeList().add(entity); - } - return messages; - } - - /** - * 根据类型获取中奖值 - * - * @param item - * @return - */ - private Integer getPrizeValue(DrawPrizeItemVo item) { - // 如果是金额则取平台价值 - if (item.getPrizeType() == PrizeTypeEnum.coins.getValue()) { - return item.getPlatformValue(); - } else { - return item.getReferenceId(); - } - } - - /** - * 生成抽奖结果 - * @param uid - * @param deviceId - * @param userActPropertyInfo - * @param drawIndexInfos - * @param keyPrice - * @return - */ - private DrawResultVO cropDrawResult(Long uid, String deviceId, UserActPropertyInfoV2 userActPropertyInfo, List drawIndexInfos, Integer keyPrice) { - StopWatch stopWatch = new StopWatch(); - stopWatch.start("starCropDrawResult_" + uid); - Date drawTime = new Date(); - List drawOutItems = new ArrayList<>(); - for (DrawIndexInfo drawIndexInfo : drawIndexInfos) { - List drawLineItems = getDrawLineItemInfoFromCache(drawIndexInfo.getLineId(), drawIndexInfo.getStartIdx(), drawIndexInfo.getEndIdx()); - drawOutItems.addAll(drawLineItems); - } - List drawLineItemIds = drawOutItems.stream().map(LinearlyPrizePoolDrawLineItem::getId).collect(Collectors.toList()); - log.info("[linearly pool draw]user {} draw out line items: {}", uid, JSONObject.toJSONString(drawLineItemIds)); - -// Collection linearlyPrizePoolItems = linearlyPrizePoolDrawLineItemService.listByIds(drawLineItemIds); - // 转化成奖品列表vo - List prizeItems = genPrizeItemVOs(drawOutItems); - - // 判断是否抽中特殊礼物 - Boolean specialStatus = false; - byte virtualCurrencyType = (byte) PrizeTypeEnum.virtual_currency.getValue(); - List virtualCurrencyList = prizeItems.stream().filter(a -> a.getPrizeType().equals(virtualCurrencyType)).collect(Collectors.toList()); - if(virtualCurrencyList.size() > 0){ - specialStatus = true; - } - - DrawResultVO resultVO = DrawResultVO.builder().prizeItemVoList(prizeItems).remainKeyNum(userActPropertyInfo.getPieceNum()).drawTime(drawTime).specialStatus(specialStatus).build(); - - linearlyPrizePoolDrawLineItemService.updateStatusAfterDrawAsync(drawOutItems, uid, deviceId, drawTime, keyPrice, prizeItems); - - stopWatch.stop(); - log.info("[linearly pool draw]crop draw result use time: {}ms", stopWatch.getTotalTimeMillis()); - - return resultVO; - } - - private List genPrizeItemVOs(Collection linearlyPrizePoolItems) { - Map drawPrizeMap = new HashMap<>(linearlyPrizePoolItems.size()); - List prizeIds = linearlyPrizePoolItems.stream().map(LinearlyPrizePoolDrawLineItem::getPrizeId).distinct().collect(Collectors.toList()); - List prizes = prizeService.listPrizeByIds(prizeIds); - Map prizeMap = prizes.stream().collect(Collectors.toMap(Prize::getId, it -> it, (k1, k2) -> k1)); - for (LinearlyPrizePoolDrawLineItem linearlyPrizePoolItem : linearlyPrizePoolItems) { - DrawPrizeItemVo prizeItem = drawPrizeMap.get(linearlyPrizePoolItem.getPrizeId()); - if (prizeItem == null) { - prizeItem = new DrawPrizeItemVo(); - Prize prize = prizeMap.get(linearlyPrizePoolItem.getPrizeId()); - if (prize == null) { - prize = prizeService.getPrizeById(linearlyPrizePoolItem.getPrizeId()); - if (prize != null) { - prizeMap.put(prize.getId(), prize); - } - } - if (prize != null) { - // 用最新的奖品信息返回 - prizeItem.setPrizeId(prize.getId()); - prizeItem.setPrizeType(prize.getPrizeType()); - prizeItem.setPrizeName(prize.getPrizeName()); - prizeItem.setPrizeImgUrl(prize.getPrizeImgUrl()); - prizeItem.setPlatformValue(prize.getPlatformValue()); - prizeItem.setPrizeLevel(prize.getPrizeLevel()); - prizeItem.setReferenceId(prize.getReferenceId()); - } else { - prizeItem.setPrizeId(linearlyPrizePoolItem.getPrizeId()); - prizeItem.setPrizeType(linearlyPrizePoolItem.getPrizeType()); - prizeItem.setPrizeName(linearlyPrizePoolItem.getPrizeName()); - prizeItem.setPrizeImgUrl(linearlyPrizePoolItem.getPrizeImgUrl()); - prizeItem.setPlatformValue(linearlyPrizePoolItem.getPlatformValue()); - prizeItem.setPrizeLevel(linearlyPrizePoolItem.getPrizeLevel()); - prizeItem.setReferenceId(linearlyPrizePoolItem.getReferenceId()); - } - prizeItem.setPrizeNum(1); - - drawPrizeMap.put(prizeItem.getPrizeId(), prizeItem); - } else { - prizeItem.setPrizeNum(prizeItem.getPrizeNum() + 1); - } - } - - return drawPrizeMap.values().stream().collect(Collectors.toList()); - } - - private List getDrawLineItemInfoFromCache(Long lineId, Long startIdx, Long endIdx) { - String cachKey = RedisKey.linearly_pool_draw_line.getKey(lineId.toString()); - List itemStrs = jedisService.lrange(cachKey, startIdx, endIdx); - return itemStrs.stream().map(itemStr -> JSONObject.parseObject(itemStr, LinearlyPrizePoolDrawLineItem.class)).collect(Collectors.toList()); - } - - /** - * 计算需要抽取的奖品线和对应的奖品位置信息 - * @param uid - * @param keyNum - * @return - */ - protected List calcuDrawLineIndexInfos(Long uid, Integer keyNum) { - /* - 抽奖的主要逻辑: 根据记录缓存中,从cur_line_id列表中的curr_line_item_idx指向的位置,读取keyNum个奖品. - 如果cur_line_id剩余的奖品数不足,则从cur_line_id+1的列表中继续读取剩余个数的. - */ - String lockKey = RedisKey.linearly_pool_stat_lock.getKey(); - String lockVal = jedisService.lock(lockKey, 10 * 1000); - if (BlankUtil.isBlank(lockVal)) { - log.error("[linearly pool draw]获取状态更新分布式锁失败,uid:{},keyNum:{}", uid, keyNum); - throw new ServiceException(BusiStatus.LINEARLY_POOL_USER_TO_MORE); - } - try { - StopWatch stopWatch = new StopWatch(); - stopWatch.start("starCalculateDrawIndex_" + uid); - final Long currLineId = getCurrentLineId(); - final Long maxLineId = getMaxLineId(); - if (currLineId == null || maxLineId == null) { - log.warn("[linearly pool draw]奖品线不存在,不能进行抽奖。uid: {}", uid); - throw new ServiceException(BusiStatus.BUSIERROR, NOT_ENOUGH_PRIZE_TIME); - } - final long currLineItemIdx = getCurrentLineItemIdx(); - if (currLineId.equals(maxLineId)) { - // 当当前奖品线id等于已生成的最大奖品线id时,检查是否够奖品供抽取 - long drawingLineItemCount = getPoolLineItemCount(currLineId); - if (currLineItemIdx + keyNum > drawingLineItemCount) { - log.warn("[linearly pool draw]奖品数不够抽取,不能进行抽奖。uid: {}, keyNum: {}, currLineItemIdx: {}, drawingLineItemCount: {}", - uid, keyNum, currLineItemIdx, drawingLineItemCount); - throw new ServiceException(BusiStatus.BUSIERROR, NOT_ENOUGH_PRIZE_TIME); - } - } - - List idxInfos = new ArrayList<>(); - int remainKeyNum = keyNum; - long startIdx = currLineItemIdx; - long drawingLineId = currLineId; - - long newLineId = drawingLineId; - long newLineItemIdx = 0; - long endIdx = 0; - do { - long drawingLineItemCount = getPoolLineItemCount(drawingLineId); - - if (startIdx + remainKeyNum <= drawingLineItemCount) { - // 在当前奖品线中可以完成抽奖 - endIdx = startIdx + remainKeyNum - 1; - - remainKeyNum = 0; - // 刚好取完时,则需要更新缓存的奖品线信息,已供其他用户使用 - if (endIdx + 1 == drawingLineItemCount) { - newLineId = drawingLineId + 1; - newLineItemIdx = 0; - } else { - newLineItemIdx = endIdx + 1; - } - } else { - // 抽取的奖品数多于当前drawingLineId指定的奖品线时,则取到最后一个,剩下的从下一个奖品线抽取 - endIdx = drawingLineItemCount - 1; - int userKey = (int)(endIdx - startIdx + 1); - remainKeyNum = remainKeyNum - userKey; - } - log.info("[linearly pool draw] user {} draw in line {} from {} to {}", uid, drawingLineId, startIdx, endIdx); - DrawIndexInfo idxInfo = new DrawIndexInfo(); - idxInfo.setLineId(drawingLineId); - idxInfo.setStartIdx(startIdx); - idxInfo.setEndIdx(endIdx); - idxInfos.add(idxInfo); - - if (remainKeyNum > 0) { - drawingLineId++; - startIdx = 0; - // 奖品线变了,所以新的奖品线需要使用新的 - newLineId = drawingLineId; - } - } while (remainKeyNum > 0); - - // 更新缓存中的状态信息 - updatePoolLineStat(newLineId != currLineId ? newLineId : null, newLineItemIdx); - stopWatch.stop(); - - log.info("[linearly pool draw]calculate draw index use time: {}ms", stopWatch.getTotalTimeMillis()); - return idxInfos; - } finally { - jedisService.unlock(lockKey, lockVal); - } - - } - - private void updatePoolLineStat(Long newLineId, Long newLineItemIdx) { - if (newLineId != null) { - jedisService.hset(RedisKey.linearly_pool_stat.getKey(), CACHE_FIELD_CUR_LINE_ID, newLineId.toString()); - } - jedisService.hset(RedisKey.linearly_pool_stat.getKey(), CACHE_FIELD_CURR_LINE_ITEM_IDX, newLineItemIdx.toString()); - } - - private long getCurrentLineItemIdx() { - String idxStr = jedisService.hget(RedisKey.linearly_pool_stat.getKey(), CACHE_FIELD_CURR_LINE_ITEM_IDX); - if (StringUtils.isBlank(idxStr)) { - return 0; - } else { - return Long.valueOf(idxStr); - } - } - - private long getPoolLineItemCount(Long lineId) { - String cachKey = RedisKey.linearly_pool_draw_line.getKey(lineId.toString()); - return jedisService.llen(cachKey); - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/mq/RocketMQService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/mq/RocketMQService.java index 0a91641bf..6e90ec304 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/mq/RocketMQService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/mq/RocketMQService.java @@ -1,7 +1,6 @@ package com.accompany.business.service.mq; import com.accompany.business.message.*; -import com.accompany.business.message.linearlypool.LinearlyPoolPrizeMessage; import com.accompany.mq.constant.MqConstant; import com.accompany.mq.producer.MQMessageProducer; import com.alibaba.fastjson.JSON; @@ -94,12 +93,6 @@ public class RocketMQService { }); } - public void sendLinearlyPoolDrawMessage(LinearlyPoolPrizeMessage message) { - mqMessageProducer.sendOrderly(MqConstant.LINEARLY_POOL_TOPIC, message, message.getUid().toString(), sendResult -> log.info("sendLinearlyPoolDrawMessage success message: {} queue {}", JSON.toJSONString(message), sendResult.getMessageQueue().getQueueId()), throwable -> { - log.error("sendLinearlyPoolDrawMessage fail message: {}", JSON.toJSONString(message), throwable); - }); - } - /** * 活动礼包消息,发送到MQ * diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/nameplate/UserNameplateService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/nameplate/UserNameplateService.java index 8af421b04..612d176b8 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/nameplate/UserNameplateService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/nameplate/UserNameplateService.java @@ -13,7 +13,6 @@ import com.accompany.business.mybatismapper.NameplateRecordMapper; import com.accompany.business.mybatismapper.UserNameplateMapper; import com.accompany.business.param.neteasepush.NeteaseSendMsgParam; import com.accompany.business.service.SendSysMsgService; -import com.accompany.business.service.anchor.AnchorFansTeamService; import com.accompany.business.service.dress.DressShopService; import com.accompany.business.service.netease.YidunCheckUtil; import com.accompany.business.service.purse.UserPurseService; @@ -77,10 +76,6 @@ public class UserNameplateService extends BaseService { * 每获得一个礼物可申请对应的铭牌7天 **/ private final static Integer NAME_PLATE_APPLY_DAY = 7; - /** - * 申请铭牌正则校验(中文、数字、字母) - */ - public static final String APPLY_NAME_PLATE_CHECK = "^[\\u4E00-\\u9FA5A-Za-z0-9]+$"; @Autowired UserNameplateMapper userNameplateMapper; @@ -99,9 +94,6 @@ public class UserNameplateService extends BaseService { @Autowired private TencentCosUploadService uploadService; @Autowired - @Lazy - private AnchorFansTeamService anchorFansTeamService; - @Autowired private UserVipInfoService userVipInfoService; @Autowired private VipCustomNameplateService vipCustomNameplateService; @@ -665,14 +657,6 @@ public class UserNameplateService extends BaseService { nameplateVo.setNameplateImage(nameplateVo.getIconPic()); return nameplateVo; } - // 粉丝团铭牌校验 - if (nameplateVo.getType() != null && nameplateVo.getType().equals(NameplateStyleTypeEnum.ANCHOR_FANS_MP_SEND.getValue())) { - String word = nameplateVo.getFixedWord(); - String mpPic = anchorFansTeamService.getAnchorFansMpPicWithWordAndStatus(nameplateVo.getUid(), word); - if (StringUtils.isNotBlank(mpPic)) { - nameplateVo.setNameplateImage(mpPic); - } - } // 此时图片为服务端生成文字的图片, word返回" " nameplateVo.setWord(" "); return nameplateVo; diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/netease/ReceiveNeteaseService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/netease/ReceiveNeteaseService.java index 4c1849abe..272491dfe 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/netease/ReceiveNeteaseService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/netease/ReceiveNeteaseService.java @@ -158,7 +158,6 @@ public class ReceiveNeteaseService extends BaseService { playRoomVo.setMicUserCount(0); jedisService.hset(RedisKey.room_mic_up.getKey(), room.getUid().toString(), gson.toJson(playRoomVo)); } - applicationContext.publishEvent(new AnchorOnWheatEvent(micQueueParam)); } /** diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomForPartyService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomForPartyService.java index 801ba23b5..d3f2d2df7 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomForPartyService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomForPartyService.java @@ -3,7 +3,6 @@ package com.accompany.business.service.room; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; import com.accompany.business.constant.RoomTypeEnum; -import com.accompany.business.service.AppVersionService; import com.accompany.common.constant.ApplicationConstant; import com.accompany.common.constant.Constant; import com.accompany.common.netease.neteaseacc.result.RoomMemberRet; @@ -13,7 +12,6 @@ import com.accompany.core.model.Account; import com.accompany.core.model.Room; import com.accompany.core.util.I18NMessageSourceUtil; import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @@ -27,9 +25,6 @@ import java.util.List; @Service public class RoomForPartyService extends AbstractRoomService { - @Autowired - private AppVersionService appVersionService; - @Override public RoomTypeEnum roomType() { return RoomTypeEnum.PARTY; @@ -94,20 +89,4 @@ public class RoomForPartyService extends AbstractRoomService { } } - @Override - public void checkAppVersion(Room room) { - //新旧版本处理,迭代几个版本后,可移除 - /*DeviceInfo deviceInfo = DeviceInfoContextHolder.get(); - String os = deviceInfo.getOs(); - String appVersion = StrUtil.EMPTY; - if (ApplicationConstant.PublicParameters.OS_IOS.equalsIgnoreCase(os)) { - appVersion = "20.20.26"; - } else if (ApplicationConstant.PublicParameters.OS_ANDROID.equalsIgnoreCase(os)) { - appVersion = "1.0.9"; - } - if (AppVersionUtil.compareVersion(deviceInfo.getAppVersion(), appVersion) < 0) { - throw new ServiceException(BusiStatus.VERSION_TOO_LOW); - }*/ - } - } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomForTwentyMicService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomForTwentyMicService.java index 224458eb3..f1f5c5d7d 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomForTwentyMicService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomForTwentyMicService.java @@ -8,7 +8,6 @@ import com.accompany.common.constant.Constant; import com.accompany.common.device.DeviceInfo; import com.accompany.common.netease.neteaseacc.result.RoomMemberRet; import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.AppVersionUtil; import com.accompany.core.base.DeviceInfoContextHolder; import com.accompany.core.exception.ServiceException; import com.accompany.core.model.Account; @@ -91,20 +90,4 @@ public class RoomForTwentyMicService extends AbstractRoomService { } } - @Override - public void checkAppVersion(Room room) { - //新旧版本处理,迭代几个版本后,可移除 - DeviceInfo deviceInfo = DeviceInfoContextHolder.get(); - String os = deviceInfo.getOs(); - String appVersion = StrUtil.EMPTY; - if (ApplicationConstant.PublicParameters.OS_IOS.equalsIgnoreCase(os)) { - appVersion = "20.20.49"; - } else if (ApplicationConstant.PublicParameters.OS_ANDROID.equalsIgnoreCase(os)) { - appVersion = "1.0.22"; - } - if (AppVersionUtil.compareVersion(deviceInfo.getAppVersion(), appVersion) < 0) { - throw new ServiceException(BusiStatus.VERSION_TOO_LOW); - } - } - } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/skillcard/impl/SkillCardUserRecordServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/skillcard/impl/SkillCardUserRecordServiceImpl.java index 4e44a958b..6fc028a8a 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/skillcard/impl/SkillCardUserRecordServiceImpl.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/skillcard/impl/SkillCardUserRecordServiceImpl.java @@ -3,7 +3,6 @@ package com.accompany.business.service.skillcard.impl; import cn.hutool.core.util.ObjectUtil; import com.accompany.business.model.skillcard.*; import com.accompany.business.mybatismapper.skillcard.SkillCardUserRecordMapper; -import com.accompany.business.service.AppVersionService; import com.accompany.business.service.netease.YidunCheckUtil; import com.accompany.business.service.skillcard.*; import com.accompany.business.vo.skillcard.*; @@ -44,8 +43,6 @@ public class SkillCardUserRecordServiceImpl extends ServiceImpl { - @Autowired - private SeizeTreasureConvertItemMapper seizeTreasureConvertItemMapper; - - @Autowired - private SeizeTreasurePropMapper seizeTreasurePropMapper; - - List getConvertItem(Integer convertType) { - List convertItems = seizeTreasureConvertItemMapper.getConvertItem(convertType); - if (CollectionUtil.isNotEmpty(convertItems)) { - Map propMap = null; - List propIdList = convertItems.stream().filter(v -> CollectionUtil.isNotEmpty(v.getPropIds())).flatMap(v -> v.getPropIds().stream()).distinct().collect(Collectors.toList()); - if (CollectionUtil.isNotEmpty(propIdList)) { - List seizeTreasureProps = seizeTreasurePropMapper.selectBatchIds(propIdList); - if (CollectionUtil.isNotEmpty(seizeTreasureProps)) { - propMap = seizeTreasureProps.stream().collect(Collectors.toMap(SeizeTreasureProp::getId, Function.identity(), (v1, v2) -> v1)); - } - } - for (SeizeTreasureCovertItemVo convertItem : convertItems) { - List propIds = convertItem.getPropIds(); - List propNums = convertItem.getPropNums(); - List propItems = new ArrayList<>(); - if (CollectionUtil.isNotEmpty(propMap)) { - for (int i = 0, len = propIds.size(); i < len; i++) { - Long propId = propIds.get(i); - Integer propNum = propNums.get(i); - if (!propMap.containsKey(propId)) { - continue; - } - if (propNum == null || propNum == 0) { - continue; - } - SeizeTreasureProp seizeTreasureProp = propMap.get(propId); - String name = seizeTreasureProp.getName(); - String picUrl = seizeTreasureProp.getPicUrl(); - SeizeTreasureCovertItemVo.PropItem propItem = new SeizeTreasureCovertItemVo.PropItem(); - propItem.setPropId(propId); - propItem.setPropNum(propNum); - propItem.setPropName(name); - propItem.setPicUrl(picUrl); - propItems.add(propItem); - } - } - convertItem.setPropItems(propItems); - } - } - return convertItems; - } - - SeizeTreasureCovertItemVo getItemById(Long itemId) { - SeizeTreasureCovertItemVo convertItem = seizeTreasureConvertItemMapper.getItemById(itemId); - if (convertItem != null) { - Map propMap = null; - List propIdList = convertItem.getPropIds(); - if (CollectionUtil.isNotEmpty(propIdList)) { - List seizeTreasureProps = seizeTreasurePropMapper.selectBatchIds(propIdList); - if (CollectionUtil.isNotEmpty(seizeTreasureProps)) { - propMap = seizeTreasureProps.stream().collect(Collectors.toMap(SeizeTreasureProp::getId, Function.identity(), (v1, v2) -> v1)); - } - } - List propIds = convertItem.getPropIds(); - List propNums = convertItem.getPropNums(); - List propItems = new ArrayList<>(); - if (CollectionUtil.isNotEmpty(propMap)) { - for (int i = 0, len = propIds.size(); i < len; i++) { - Long propId = propIds.get(i); - Integer propNum = propNums.get(i); - if (!propMap.containsKey(propId)) { - continue; - } - SeizeTreasureProp seizeTreasureProp = propMap.get(propId); - String name = seizeTreasureProp.getName(); - String picUrl = seizeTreasureProp.getPicUrl(); - SeizeTreasureCovertItemVo.PropItem propItem = new SeizeTreasureCovertItemVo.PropItem(); - propItem.setPropId(propId); - propItem.setPropNum(propNum); - propItem.setPropName(name); - propItem.setPicUrl(picUrl); - propItems.add(propItem); - } - } - convertItem.setPropItems(propItems); - } - return convertItem; - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureConvertRecordService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureConvertRecordService.java deleted file mode 100644 index 20e317586..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureConvertRecordService.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.accompany.business.service.treasure; - -import com.accompany.business.model.treasure.SeizeTreasureConvertRecord; -import com.accompany.business.mybatismapper.treasure.SeizeTreasureConvertRecordMapper; -import com.accompany.business.vo.treasure.convert.SeizeTreasureConvertRecordVo; -import com.accompany.business.vo.treasure.convert.SeizeTreasureCovertItemVo; -import com.accompany.business.vo.treasure.reward.SeizeTreasureRewardBaseVo; -import com.accompany.common.model.PageReq; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.github.pagehelper.PageHelper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -@Service -public class SeizeTreasureConvertRecordService extends ServiceImpl { - @Autowired - private SeizeTreasureConvertRecordMapper seizeTreasureConvertRecordMapper; - - public SeizeTreasureConvertRecord addRecord(Long uid, SeizeTreasureCovertItemVo covertItem, SeizeTreasureRewardBaseVo convertReward) { - SeizeTreasureConvertRecord record = new SeizeTreasureConvertRecord(); - - record.setUid(uid); - record.setItemId(covertItem.getItemId()); - record.setConvertType(covertItem.getType()); - record.setConvertLevel(covertItem.getLevel()); - record.setRewardId(covertItem.getRewardId()); - record.setRewardType(convertReward.getRewardType()); - record.setRewardName(covertItem.getRewardName()); - record.setRewardNum(covertItem.getRewardNum()); - record.setRewardUnit(convertReward.getRewardUnit()); - record.setRewardPicUrl(covertItem.getRewardPicUrl()); - record.setRewardShowValue(convertReward.getRewardShowValue()); - this.save(record); - return record; - } - - public List getConvertRecord(Long uid, Integer convertType, PageReq pageReq) { - PageHelper.startPage(pageReq.getPage(), pageReq.getPageSize()); - return seizeTreasureConvertRecordMapper.getConvertRecord(uid, convertType); - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasurePoolDrawRecordService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasurePoolDrawRecordService.java deleted file mode 100644 index 1987b33de..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasurePoolDrawRecordService.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.accompany.business.service.treasure; - -import com.accompany.business.model.treasure.SeizeTreasurePoolDrawRecord; -import com.accompany.business.mybatismapper.treasure.SeizeTreasurePoolDrawRecordMapper; -import com.accompany.business.vo.treasure.record.SeizeTreasurePoolDrawRecordVo; -import com.accompany.business.vo.treasure.record.SeizeTreasureStaticVo; -import com.accompany.common.model.PageReq; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.github.pagehelper.PageHelper; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.annotation.Nullable; -import java.util.Date; -import java.util.List; - -/** - * 夺宝精灵奖池类 - */ -@Slf4j -@Service -public class SeizeTreasurePoolDrawRecordService extends ServiceImpl { - - @Autowired - private SeizeTreasurePoolDrawRecordMapper seizeTreasurePoolDrawRecordMapper; - - public List getDrawRecordList(Long uid, List poolTypeList, PageReq pageReq) { - PageHelper.startPage(pageReq.getPage(), pageReq.getPageSize()); - List drawRecordList = seizeTreasurePoolDrawRecordMapper.getDrawRecordList(uid, poolTypeList); - return drawRecordList; - } - - public SeizeTreasureStaticVo staticPoolRecord(List poolTypeList, @Nullable Integer poolGroup, @Nullable Integer poolLevel, Date startDate, Date endDate) { - return seizeTreasurePoolDrawRecordMapper.staticPoolRecord(poolTypeList, poolGroup, poolLevel, startDate, endDate); - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasurePoolItemService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasurePoolItemService.java deleted file mode 100644 index 6549c05b6..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasurePoolItemService.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.accompany.business.service.treasure; - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.StrUtil; -import com.accompany.business.model.treasure.SeizeTreasurePoolItem; -import com.accompany.business.mybatismapper.treasure.SeizeTreasurePoolItemMapper; -import com.accompany.business.vo.treasure.SeizeTreasurePoolItemVo; -import com.accompany.common.redis.RedisKey; -import com.accompany.core.service.common.JedisService; -import com.alibaba.fastjson.JSONArray; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - -/** - * 夺宝精灵奖池类 - */ -@Slf4j -@Service -public class SeizeTreasurePoolItemService extends ServiceImpl { - - @Autowired - private SeizeTreasurePoolItemMapper seizeTreasurePoolItemMapper; - - @Autowired - private JedisService jedisService; - - public List getPoolItem(@Nullable Integer poolType, @Nullable Integer poolGroup, @Nullable Integer poolLevel) { - List seizeTreasurePoolItems = new ArrayList<>(); - if (poolType != null) { - String poolItemJson = jedisService.get(RedisKey.seize_treasure_pool_item.getKey(String.valueOf(poolType))); - if (StrUtil.isNotEmpty(poolItemJson)) { - seizeTreasurePoolItems = JSONArray.parseArray(poolItemJson, SeizeTreasurePoolItem.class); - } - } - if (CollectionUtil.isEmpty(seizeTreasurePoolItems)) { - seizeTreasurePoolItems = this.lambdaQuery() - .eq(poolType != null, SeizeTreasurePoolItem::getPoolType, poolType) - .eq(poolGroup != null, SeizeTreasurePoolItem::getPoolGroup, poolGroup) - .eq(poolLevel != null, SeizeTreasurePoolItem::getPoolLevel, poolLevel) - .list(); - if (CollectionUtil.isNotEmpty(seizeTreasurePoolItems) && poolType != null) { - jedisService.set(RedisKey.seize_treasure_pool_item.getKey(String.valueOf(poolType)), JSONArray.toJSONString(seizeTreasurePoolItems)); - } - } - return seizeTreasurePoolItems.stream().filter(v -> poolGroup == null || poolGroup.equals(v.getPoolGroup())).filter(v -> poolLevel == null || poolLevel.equals(v.getPoolLevel())).collect(Collectors.toList()); - } - - public List getPoolItemVo(@Nullable Integer poolType, @Nullable Integer poolGroup, @Nullable Integer poolLevel) { - return seizeTreasurePoolItemMapper.getPoolItemList(poolType, poolGroup, poolLevel); - } - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasurePropService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasurePropService.java deleted file mode 100644 index 068e47b8e..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasurePropService.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.accompany.business.service.treasure; - -import com.accompany.business.model.treasure.SeizeTreasureProp; -import com.accompany.business.mybatismapper.treasure.SeizeTreasurePropMapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -@Service -public class SeizeTreasurePropService extends ServiceImpl { -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureRewardService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureRewardService.java deleted file mode 100644 index f095f835a..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureRewardService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.accompany.business.service.treasure; - -import cn.hutool.core.collection.CollectionUtil; -import com.accompany.business.model.treasure.SeizeTreasureReward; -import com.accompany.business.mybatismapper.treasure.SeizeTreasureRewardMapper; -import com.accompany.common.status.BusiStatus; -import com.accompany.core.exception.ServiceException; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; - -import java.util.List; - -@Slf4j -@Service -public class SeizeTreasureRewardService extends ServiceImpl { - - List getByRewardIds(List rewardIdList) { - if (CollectionUtil.isEmpty(rewardIdList)) { - throw new ServiceException(BusiStatus.THE_PRIZE_POOL_IS_EMPTY); - } - return lambdaQuery().in(SeizeTreasureReward::getId, rewardIdList).list(); - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureService.java deleted file mode 100644 index 0d9ca4a76..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureService.java +++ /dev/null @@ -1,1435 +0,0 @@ -package com.accompany.business.service.treasure; - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.date.DatePattern; -import cn.hutool.core.util.StrUtil; -import com.accompany.business.constant.activities.ActivitesPackTypeEnum; -import com.accompany.business.enums.UserActPropertyObjType; -import com.accompany.business.enums.resource.ResourceCodeEnum; -import com.accompany.business.model.resource.Resource; -import com.accompany.business.model.treasure.*; -import com.accompany.business.model.user.UserActPropertyInfoRecord; -import com.accompany.business.model.user.UserActPropertyInfoV2; -import com.accompany.business.param.neteasepush.NeteaseSendMsgParam; -import com.accompany.business.param.neteasepush.Payload; -import com.accompany.business.service.SendSysMsgService; -import com.accompany.business.service.car.CarPayService; -import com.accompany.business.service.dress.UserChatBubbleService; -import com.accompany.business.service.dress.UserInfoCardService; -import com.accompany.business.service.headwear.HeadwearService; -import com.accompany.business.service.level.LevelService; -import com.accompany.business.service.nameplate.UserNameplateService; -import com.accompany.business.service.purse.UserPurseService; -import com.accompany.business.service.resource.ResourceService; -import com.accompany.business.service.room.RoomService; -import com.accompany.business.service.user.UserActPropertyInfoRecordService; -import com.accompany.business.service.user.UserActPropertyInfoV2Service; -import com.accompany.business.service.user.UserBackpackService; -import com.accompany.business.service.user.UsersService; -import com.accompany.business.vo.treasure.SeizeTreasureConfig; -import com.accompany.business.vo.treasure.SeizeTreasurePoolItemVo; -import com.accompany.business.vo.treasure.SeizeTreasureSalvageConfig; -import com.accompany.business.vo.treasure.compound.SeizeTreasureElfCompoundRecordVo; -import com.accompany.business.vo.treasure.compound.SeizeTreasureElfCompoundReq; -import com.accompany.business.vo.treasure.convert.SeizeTreasureConvertRecordVo; -import com.accompany.business.vo.treasure.convert.SeizeTreasureCovertItemVo; -import com.accompany.business.vo.treasure.elf.SeizeTreasureElfMsgVo; -import com.accompany.business.vo.treasure.elf.SeizeTreasureElfRecordVo; -import com.accompany.business.vo.treasure.elf.SeizeTreasureElfVo; -import com.accompany.business.vo.treasure.elf.SeizeTreasureUserElfVo; -import com.accompany.business.vo.treasure.msg.SeizeTreasureMsg; -import com.accompany.business.vo.treasure.rank.SeizeTreasureRankVo; -import com.accompany.business.vo.treasure.record.SeizeTreasurePoolDrawRecordVo; -import com.accompany.business.vo.treasure.record.SeizeTreasureStaticVo; -import com.accompany.business.vo.treasure.reward.SeizeTreasurePoolRewardCache; -import com.accompany.business.vo.treasure.reward.SeizeTreasurePoolRewardVo; -import com.accompany.business.vo.treasure.reward.SeizeTreasureRewardBaseVo; -import com.accompany.business.vo.treasure.salvage.SeizeTreasureElfSalvageRecordVo; -import com.accompany.business.vo.treasure.salvage.SeizeTreasureElfSalvageReq; -import com.accompany.business.vo.treasure.userinfo.SeizeTreasureUserDrawInfo; -import com.accompany.business.vo.treasure.userinfo.SeizeTreasureUserElfInfo; -import com.accompany.business.vo.treasure.userinfo.SeizeTreasureUserForestInfo; -import com.accompany.business.vo.treasure.userinfo.SeizeTreasureUserInfo; -import com.accompany.common.config.SystemConfig; -import com.accompany.common.config.WebSecurityConfig; -import com.accompany.common.constant.AppEnum; -import com.accompany.common.constant.Attach; -import com.accompany.common.constant.Constant; -import com.accompany.common.constant.SeizeTreasureConstant.*; -import com.accompany.common.model.PageReq; -import com.accompany.common.push.MarkdownMessage; -import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.DateTimeUtil; -import com.accompany.core.base.SpringContextHolder; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.model.Room; -import com.accompany.core.model.Users; -import com.accompany.core.service.SysConfService; -import com.accompany.core.service.common.JedisService; -import com.accompany.core.service.message.MessageRobotPushService; -import com.accompany.core.vo.UserLevelVo; -import com.alibaba.fastjson.JSON; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; -import org.springframework.util.StringUtils; -import redis.clients.jedis.Response; - -import java.io.IOException; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.ZoneId; -import java.util.*; -import java.util.concurrent.ThreadLocalRandom; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.IntStream; - -/** - * 夺宝精灵活动 - */ -@Slf4j -@Service -public class SeizeTreasureService { - @Autowired - private SysConfService sysConfService; - @Autowired - private JedisService jedisService; - @Autowired - private UserActPropertyInfoV2Service userActPropertyInfoV2Service; - @Autowired - private UserActPropertyInfoRecordService userActPropertyInfoRecordService; - @Autowired - private UsersService usersService; - @Autowired - private RoomService roomService; - @Autowired - private UserPurseService userPurseService; - @Autowired - private UserBackpackService userBackpackService; - @Autowired - private UserNameplateService userNameplateService; - @Autowired - private CarPayService carPayService; - @Autowired - private HeadwearService headwearService; - @Autowired - private UserChatBubbleService userChatBubbleService; - @Autowired - private UserInfoCardService userInfoCardService; - @Autowired - private SeizeTreasureRewardService seizeTreasureRewardService; - @Autowired - private SeizeTreasurePoolItemService seizeTreasurePoolItemService; - @Autowired - private SeizeTreasureUserPropService seizeTreasureUserPropService; - @Autowired - private SeizeTreasurePropService seizeTreasurePropService; - @Autowired - private SeizeTreasurePoolDrawRecordService seizeTreasurePoolDrawRecordService; - @Autowired - private SeizeTreasureUserPropRecordService seizeTreasureUserPropRecordService; - @Autowired - private SeizeTreasureConvertItemService seizeTreasureConvertItemService; - @Autowired - private SeizeTreasureConvertRecordService seizeTreasureConvertRecordService; - @Autowired - private SendSysMsgService sendSysMsgService; - @Autowired - private LevelService levelService; - @Autowired - private MessageRobotPushService messageRobotPushService; - @Autowired - private WebSecurityConfig webSecurityConfig; - - @Autowired - private ResourceService resourceService; - private Gson gson = new GsonBuilder() - .setDateFormat("yyyy-MM-dd HH:mm:ss") - .create(); - - public SeizeTreasureUserInfo getUserInfo(Long uid) { - Users users = usersService.getUsersByUid(uid); - SeizeTreasureUserInfo userInfo = new SeizeTreasureUserInfo(); - UserActPropertyInfoV2 userActPropertyInfo = userActPropertyInfoV2Service.getUserActPropertyInfo(uid, ActivitesPackTypeEnum.SEIZE_TREASURE_TICKET.getValue()); - if (userActPropertyInfo != null) { - userInfo.setDrawTicketNum(userActPropertyInfo.getPieceNum()); - } - userInfo.setDiamonds(userPurseService.queryUserPurse(uid).getDiamonds()); - userInfo.setUid(users.getUid()); - userInfo.setErbanNo(users.getErbanNo()); - userInfo.setNick(users.getNick()); - userInfo.setAvatar(users.getAvatar()); - return userInfo; - } - - public SeizeTreasureUserDrawInfo getUserDrawInfo(Long uid) { - SeizeTreasureUserDrawInfo userInfo = new SeizeTreasureUserDrawInfo(); - userInfo.completeBaseInfo(usersService.getUsersByUid(uid)); - UserActPropertyInfoV2 userActPropertyInfo = userActPropertyInfoV2Service.getUserActPropertyInfo(uid, ActivitesPackTypeEnum.SEIZE_TREASURE_TICKET.getValue()); - if (userActPropertyInfo != null) { - userInfo.setDrawTicketNum(userActPropertyInfo.getPieceNum()); - } - String userInfoKey = RedisKey.getActRedisKey(RedisKey.USER_INFO_KEY); - Map userInfoStrMap = jedisService.hgetAll(userInfoKey); - // 添加幸运值数据 - String currentDrawNumStr = userInfoStrMap.get(DrawUserInfoField.LESS_DRAW_NUM_FIELD); - if (StringUtils.hasText(currentDrawNumStr)) { - userInfo.setLuckyNum(Integer.valueOf(currentDrawNumStr)); - } - String luckyNumStr = jedisService.hget(RedisKey.getActRedisKey(RedisKey.USER_INFO_KEY), DrawUserInfoField.NEED_DRAW_NUM_FIELD); - if (StrUtil.isNotEmpty(luckyNumStr)) { - userInfo.setNeedLuckyNum(Integer.valueOf(luckyNumStr)); - } - return userInfo; - } - - public SeizeTreasureUserForestInfo getUserForestInfo(Long uid) { - SeizeTreasureUserForestInfo userInfo = new SeizeTreasureUserForestInfo(); - userInfo.completeBaseInfo(usersService.getUsersByUid(uid)); - // 获取精灵球信息 - List userPropList = seizeTreasureUserPropService.lambdaQuery().eq(SeizeTreasureUserProp::getUid, uid) - .in(SeizeTreasureUserProp::getPropId, ActPropsId.LOW_LEVEL_BALL, ActPropsId.MIDDLE_LEVEL_BALL, ActPropsId.HIGH_LEVEL_BALL).list(); - - for (SeizeTreasureUserProp userProp : userPropList) { - if (ActPropsId.LOW_LEVEL_BALL.equals(userProp.getPropId())) { - userInfo.setLowBallNum(userProp.getPropNum()); - } else if (ActPropsId.MIDDLE_LEVEL_BALL.equals(userProp.getPropId())) { - userInfo.setMiddleBallNum(userProp.getPropNum()); - } else if (ActPropsId.HIGH_LEVEL_BALL.equals(userProp.getPropId())) { - userInfo.setHighBallNum(userProp.getPropNum()); - } - } - return userInfo; - } - - /** - * 抽奖 - * - * @param uid - * @param roomUid - * @param drawNum - * @return - */ - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - public List treasureDraw(Long uid, Long roomUid, Integer drawNum) throws IOException { - SeizeTreasureConfig actConfig = this.getActConfig(); - actConfig.checkOpen(uid); - UserLevelVo userLevel = levelService.getUserLevelVo(uid); - if (userLevel == null || actConfig.getUserLevelLimit().compareTo(userLevel.getExperLevelSeq()) > 0) { - throw new ServiceException(BusiStatus.NOT_ENOUGH_LEVEL); - } - log.info("SeizeTreasureService treasureDraw uid:{} roomUid:{} drawNum:{}", uid, roomUid, drawNum); - // 扣除道具 - userActPropertyInfoV2Service.reduceUserPieceNum(uid, ActivitesPackTypeEnum.SEIZE_TREASURE_TICKET.getValue(), drawNum); - log.info("SeizeTreasureService treasureDraw uid:{} reduceUserPiece:{} num:{} success", uid, ActivitesPackTypeEnum.SEIZE_TREASURE_TICKET.getValue(), drawNum); - // 获取奖励信息 - List rewardCacheList = this.getTreasureDrawReward(uid, drawNum); - // 添加记录 - SpringContextHolder.getBean(SeizeTreasureService.class).addDrawRecord(uid, rewardCacheList); - // 构建同奖励合并后的奖励数据 - List rewardVoList = this.buildRewardVoList(rewardCacheList); - // 发放奖励 - SpringContextHolder.getBean(SeizeTreasureService.class).sendReward(uid, rewardVoList); - // 更新榜单、发送通知 - SpringContextHolder.getBean(SeizeTreasureService.class).afterDraw(uid, roomUid, rewardVoList); - return rewardVoList; - } - - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - public List forestDraw(Long uid, Integer poolLevel, Integer drawNum) throws IOException { - if (!checkAuthority()) { - throw new ServiceException(BusiStatus.NOT_ENOUGH_LEVEL); - } - log.info("SeizeTreasureService forestDraw uid:{} poolLevel:{} drawNum:{}", uid, poolLevel, drawNum); - Long propId = this.getReducePropId(poolLevel); - // 扣除道具 - Boolean reduceSuccess = seizeTreasureUserPropService.reduceUserProp(uid, propId, drawNum); - if (!reduceSuccess) { - throw new ServiceException(BusiStatus.SEIZE_TREASURE_USER_PROP_NOT_ENOUGH, "當前精靈球不足,參與奪寶獲得吧~"); - } - log.info("SeizeTreasureService forestDraw uid:{} reduceUserProp:{} num:{} success", uid, propId, drawNum); - // 获取奖励信息 - List rewardCacheList = this.getForestPoolReward(poolLevel, drawNum); - // 添加记录 - SpringContextHolder.getBean(SeizeTreasureService.class).addDrawRecord(uid, rewardCacheList); - // 构建同奖励合并后的奖励数据 - List rewardVoList = this.buildRewardVoList(rewardCacheList); - // 发放奖励 - SpringContextHolder.getBean(SeizeTreasureService.class).sendReward(uid, rewardVoList); - SpringContextHolder.getBean(SeizeTreasureService.class).afterForestDraw(uid, rewardVoList); - return rewardVoList; - } - - @Async - public void afterForestDraw(Long uid, List rewardList) { - Integer sumValue = rewardList.stream().mapToInt(reward -> reward.getRewardShowValue() * reward.getRewardNum()).sum(); - updateValueRank(uid, sumValue); - } - - public List getForestPoolReward(Integer poolLevel, Integer drawNum) throws IOException { - String poolKey = RedisKey.getActRedisKey(RedisKey.FOREST_POOL_KEY, poolLevel.toString()); - Long poolSize = jedisService.llen(poolKey); - log.info("SeizeTreasureService getForestPoolReward poolKey:{} poolLevel:{} drawNum:{}", poolKey, poolSize, drawNum); - - // 奖池数量小于抽取的数量 - if (poolSize < drawNum) { - log.info("SeizeTreasureService getForestPoolReward poolSize:{} < drawNum:{}", poolSize, drawNum); - // 奖池数量不足时,调用初始化奖池 - SpringContextHolder.getBean(SeizeTreasureService.class).initForestPool(poolLevel); - throw new ServiceException(BusiStatus.SEIZE_TREASURE_DRAW_TOO_BUSY); - } - List rewardCacheList = IntStream.range(0, drawNum) - .mapToObj(n->jedisService.lpop(poolKey)) - .filter(StringUtils::hasText) - .map(rewardCacheStr -> gson.fromJson(rewardCacheStr, SeizeTreasurePoolRewardCache.class)) - .toList(); - // 取出奖励数量小于抽奖次数 - if (rewardCacheList.size() < drawNum) { - log.info("SeizeTreasureService getForestPoolReward rewardCacheList.size:{} < drawNum:{}", rewardCacheList.size(), drawNum); - // 将已取出奖励返还奖池 - jedisService.lpushList(poolKey, rewardCacheList.stream().map(rewardCache -> gson.toJson(rewardCache)).collect(Collectors.toList())); - // 调用初始化奖池 - SpringContextHolder.getBean(SeizeTreasureService.class).initForestPool(poolLevel); - throw new ServiceException(BusiStatus.SEIZE_TREASURE_DRAW_TOO_BUSY); - } - return rewardCacheList; - } - - @Async - public void initForestPool(Integer poolLevel) { - log.info("SeizeTreasureService initForestPool poolLevel:{} begin", poolLevel); - SeizeTreasureConfig actConfig = this.getActConfig(); - - String poolKey = RedisKey.getActRedisKey(RedisKey.FOREST_POOL_KEY, poolLevel.toString()); - Long poolSize = jedisService.llen(poolKey); - // 存在时不做初始化 - if (poolSize != null && poolSize > actConfig.getMinForestPoolSize()) { - log.info("SeizeTreasureService initForestPool exits size:{}", poolSize); - return; - } - - // 加锁 - String poolInitLockKey = RedisKey.getActRedisKey(RedisKey.FOREST_POOL_INIT_LOCK_KEY, poolLevel.toString()); - String poolInitLockValue = jedisService.lock(poolInitLockKey, 10 * 1000); - if (StringUtils.isEmpty(poolInitLockValue)) { - log.error("SeizeTreasureService initForestPool get redis lock failed"); - return; - } - try { - // 加锁后再次判断奖池是否存在,存在时不做初始化 - poolSize = jedisService.llen(poolKey); - if (poolSize != null && poolSize > actConfig.getMinForestPoolSize()) { - log.info("SeizeTreasureService initForestPool exits size:{}", poolSize); - return; - } - // 生成奖池 - // 获取森林奖池配置 - List poolItemList = seizeTreasurePoolItemService.getPoolItem(PoolType.FOREST, null, poolLevel); - log.info("SeizeTreasureService initForestPool poolItemList:{}", poolItemList); - - List rewardIdList = poolItemList.stream().map(SeizeTreasurePoolItem::getRewardId).collect(Collectors.toList()); - List itemRewardList = seizeTreasureRewardService.getByRewardIds(rewardIdList); - Map itemRewardIdMap = itemRewardList.stream().collect(Collectors.toMap(SeizeTreasureReward::getId, reward -> reward)); - log.info("SeizeTreasureService initForestPool itemRewardList:{}", itemRewardList); - - // 获取奖池id - Long poolId = jedisService.hincrBy(RedisKey.getActRedisKey(RedisKey.POOL_INFO_KEY), CURRENT_FOREST_POOL_ID_FIELD + poolLevel, 1L); - log.info("SeizeTreasureService initForestPool poolId:{}", poolId); - - List poolRewardCacheList = new ArrayList<>(); - // 遍历基础奖池配置,将所有奖励添加至基础奖池中 - for (SeizeTreasurePoolItem poolItem : poolItemList) { - SeizeTreasurePoolRewardCache basePoolRewardCache = new SeizeTreasurePoolRewardCache(poolId, poolItem, itemRewardIdMap.get(poolItem.getRewardId())); - for (int i = 0; i < poolItem.getPoolNum(); i++) { - poolRewardCacheList.add(basePoolRewardCache); - } - } - // 打乱顺序 - Collections.shuffle(poolRewardCacheList); - // 存入缓存 - jedisService.lpushList(poolKey, poolRewardCacheList.stream().map(rewardCache -> gson.toJson(rewardCache)).collect(Collectors.toList())); - - } catch (Exception e) { - log.error("SeizeTreasureService initForestPool failed"); - throw e; - } finally { - jedisService.unlock(poolInitLockKey, poolInitLockValue); - } - } - - private Long getReducePropId(Integer poolLevel) { - if (ForestPoolLevel.BASE.equals(poolLevel)) { - return ActPropsId.LOW_LEVEL_BALL; - } else if (ForestPoolLevel.MIDDLE.equals(poolLevel)) { - return ActPropsId.MIDDLE_LEVEL_BALL; - } else { - return ActPropsId.HIGH_LEVEL_BALL; - } - } - - public void updateLuckyNum(List poolRewardList, Integer drawNum) { - log.info("SeizeTreasureService getTreasureDrawNumReward drawNum : {}", drawNum); - String userInfoKey = RedisKey.getActRedisKey(RedisKey.USER_INFO_KEY); - //累计抽奖次数 - Long currentDrawNum = jedisService.hincrBy(userInfoKey, DrawUserInfoField.CURRENT_DRAW_NUM_FIELD, drawNum.longValue()); - if (CollectionUtil.isNotEmpty(poolRewardList)) { - for (SeizeTreasurePoolRewardCache rewardCache : poolRewardList){ - if (ActPropsId.highElfIdList.contains(rewardCache.getReward().getRewardRefId())) { - //更新差值数 - jedisService.hdel(RedisKey.getActRedisKey(RedisKey.USER_INFO_KEY), DrawUserInfoField.LESS_DRAW_NUM_FIELD); - } - jedisService.hincrBy(userInfoKey, DrawUserInfoField.LESS_DRAW_NUM_FIELD, 1L); - } - } - updateLuckyNum(); - log.info("SeizeTreasureService getTreasureDrawNumReward drawNum : {}, currentDrawNum : {}", drawNum, currentDrawNum); - } - - public Long updateLuckyNum() { - long index = 0, pageSize = 1000, stepIndex; - Gson gson = new GsonBuilder() - .setDateFormat(DatePattern.NORM_DATETIME_PATTERN) - .create(); - boolean isDestination = true; - label: - for (List rewardCacheStrs = jedisService.lrange(RedisKey.getActRedisKey(RedisKey.POOL_KEY), 0, (stepIndex = pageSize) - 1); - CollectionUtil.isNotEmpty(rewardCacheStrs); - rewardCacheStrs = jedisService.lrange(RedisKey.getActRedisKey(RedisKey.POOL_KEY), stepIndex, (stepIndex += pageSize) - 1)) { - for (String rewardCacheStr : rewardCacheStrs) { - index++; - SeizeTreasurePoolRewardCache rewardCache = gson.fromJson(rewardCacheStr, SeizeTreasurePoolRewardCache.class); - if (ActPropsId.highElfIdList.contains(rewardCache.getReward().getRewardRefId())) { - log.info("updateLuckyNum rewardRefId : {}", rewardCache.getReward().getRewardRefId()); - isDestination = false; - break label; - } - } - } - SeizeTreasureConfig actConfig = this.getActConfig(); - Long poolSize = jedisService.llen(RedisKey.getActRedisKey(RedisKey.POOL_KEY)); - if (isDestination && (poolSize != null && poolSize <= actConfig.getMinTreasurePoolSize())) { - if (!jedisService.exits(RedisKey.getActRedisKey(RedisKey.POOL_INIT_LOCK_KEY))) { - log.info("更新夺宝奖池..."); - initTreasurePool(); - index = updateLuckyNum(); - } - } - jedisService.hset(RedisKey.getActRedisKey(RedisKey.USER_INFO_KEY), DrawUserInfoField.NEED_DRAW_NUM_FIELD, String.valueOf(index)); - return index; - } - - @Deprecated - public Long updateLuckyNumOld(Long uid) { - SeizeTreasureConfig actConfig = this.getActConfig(); - Integer treasureDrawBaseNum = actConfig.getTreasureDrawBaseNum(); - if (treasureDrawBaseNum <= 100) { - treasureDrawBaseNum = 200; - } - log.info("SeizeTreasureService updateLuckyNum uid : {}", uid); - String userInfoKey = RedisKey.getActRedisKey(RedisKey.USER_INFO_KEY, uid.toString()); - // 随机本轮需要的抽奖次数 - Long randomDrawNum = randomDrawNum(treasureDrawBaseNum); - // 获取上轮需要的抽奖次数 - Long lastNeedDrawNum = jedisService.hincrBy(userInfoKey, DrawUserInfoField.NEED_DRAW_NUM_FIELD, 0L); - // 获取上轮差值 - Long lastLessDrawNum = jedisService.hincrBy(userInfoKey, DrawUserInfoField.LESS_DRAW_NUM_FIELD, 0L); - // 更新当前抽奖次数 = 已有抽奖次数 - 上轮需要的抽奖次数 - Long currentDrawNum = jedisService.hincrBy(userInfoKey, DrawUserInfoField.CURRENT_DRAW_NUM_FIELD, -lastNeedDrawNum); - jedisService.hset(userInfoKey, DrawUserInfoField.NEED_DRAW_NUM_FIELD, String.valueOf(randomDrawNum + lastLessDrawNum)); - // 更新差值 = 基数 - 本轮需要的抽奖次数 - jedisService.hset(userInfoKey, DrawUserInfoField.LESS_DRAW_NUM_FIELD, String.valueOf(treasureDrawBaseNum - randomDrawNum)); - log.info("SeizeTreasureService updateLuckyNum uid:{} randomDrawNum:{} lastNeedDrawNum:{} lastLessDrawNum:{} currentDrawNum:{} needDrawNum:{}", - uid, randomDrawNum, lastNeedDrawNum, lastLessDrawNum, currentDrawNum, randomDrawNum + lastLessDrawNum); - return randomDrawNum; - } - - /** - * 获取随机幸运值,必定大于抽奖次数最大值100 - * - * @return - */ - public Long randomDrawNum(Integer drawNumBase) { - double randomNum = Math.random() * drawNumBase; - Long resultNum = (long) (randomNum > 100 ? randomNum : randomNum + 100); - log.info("SeizeTreasureService randomDrawNum randomNum:{} resultNum:{}", randomNum, resultNum); - return resultNum; - } - - @Async - public void sendReward(Long uid, Collection resultVoList) { - resultVoList.forEach(result -> this.doSendReward(uid, result)); - } - - private void doSendReward(Long uid, SeizeTreasureRewardBaseVo reward) { - log.info("SeizeTreasureService doSendReward uid:{} send reward:{}", uid, reward); - if (reward == null) { - return; - } - String rewardType = reward.getRewardType(); - Integer effectDay = reward.getEffectDay(); - if (effectDay == null || effectDay == 0) { - effectDay = 1; - } - // 活动道具由活动service自行处理 - if (Constant.ActivityRewardType.ACTIVITY_PROPS.equals(rewardType)) { - this.addUserSeizeTreasureProps(uid, reward.getRewardRefId(), reward.getRewardNum()); - } else if (Constant.ActivityRewardType.GIFT.equals(rewardType)) { - userBackpackService.sendGiftToUser(uid, reward.getRewardRefId().intValue(), reward.getRewardNum(), Constant.GiftType.ACTIVITY); - } else if (Constant.ActivityRewardType.NAME_PLATE.equals(rewardType)) { - userNameplateService.officialSendNameplateSingle(reward.getRewardRefId(), uid, reward.getRewardNum() * effectDay, ActInfo.ACT_DESC, SystemConfig.secretaryUid, null, null); - } else if (Constant.ActivityRewardType.CAR.equals(rewardType)) { - carPayService.experCarByOfficial(uid, reward.getRewardRefId().intValue(), reward.getRewardNum() * effectDay, ActInfo.ACT_DESC, false); - } else if (Constant.ActivityRewardType.HEADWEAR.equals(rewardType)) { - headwearService.officialSendHeadWearSingle(reward.getRewardRefId().intValue(), uid, reward.getRewardNum() * effectDay, false); - } else if (Constant.ActivityRewardType.CHAT_BUBBLE.equals(rewardType)) { - userChatBubbleService.sendChatBubbleToUser(uid, reward.getRewardRefId(), Constant.UserInfoCardComeFrom.ADMIN_SEND, reward.getRewardNum() * effectDay, ActInfo.ACT_DESC, false); - } else if (Constant.ActivityRewardType.INFO_CARD.equals(rewardType)) { - userInfoCardService.sendInfoCardToUser(uid, reward.getRewardRefId(), Constant.UserInfoCardComeFrom.ADMIN_SEND, reward.getRewardNum() * effectDay, ActInfo.ACT_DESC, false); - } - log.info("SeizeTreasureService doSendReward uid:{} reward name:{} num:{} effectDay : {} success", uid, reward.getRewardName(), reward.getRewardNum(), reward.getEffectDay()); - } - - public void addUserSeizeTreasureProps(Long uid, Long propId, Integer propNum) { - seizeTreasureUserPropService.addUserProp(uid, propId, propNum); - } - - @Async - public void afterDraw(Long uid, Long roomUid, List rewardList) { - Users users = usersService.getUsersByUid(uid); - SeizeTreasureConfig actConfig = this.getActConfig(); - Integer totalValue = 0; - // 发送通知 - for (SeizeTreasurePoolRewardVo rewardVo : rewardList) { - totalValue += rewardVo.getRewardShowValue() * rewardVo.getRewardNum(); - sendDrawMsg(users, roomUid, rewardVo, actConfig.getUserLevelLimit()); - // 礼物产出播报 - if (actConfig.getMsgRewardIdList().contains(rewardVo.getRewardId())) { - this.giftOutputMsg(uid, rewardVo); - } - } - // 更新产出榜单 - updateValueRank(uid, totalValue); - } - - private void sendDrawMsg(Users users, Long roomUid, SeizeTreasurePoolRewardVo rewardVo, Integer limitLevel) { - try { - SeizeTreasureMsg msg = new SeizeTreasureMsg(users, roomUid, rewardVo, limitLevel); - int first = Constant.DefMsgType.SEIZE_TREASURE; - Room room = roomService.getRoomByUid(roomUid); - int second = 0; - boolean sendAllRoom = false; - boolean sendAllServer = false; - switch (rewardVo.getRewardLevel()) { - case 1: - second = Constant.DefMsgType.SEIZE_TREASURE_DRAW_GIFT_L1; - break; - case 2: - second = Constant.DefMsgType.SEIZE_TREASURE_DRAW_GIFT_L2; - break; - case 3: - second = Constant.DefMsgType.SEIZE_TREASURE_DRAW_GIFT_L3; - sendAllRoom = true; - break; - case 4: - second = Constant.DefMsgType.SEIZE_TREASURE_DRAW_GIFT_L4; - sendAllRoom = true; - break; - case 5: - second = Constant.DefMsgType.SEIZE_TREASURE_DRAW_GIFT_L5; - sendAllServer = true; - break; - } - // 未定义类型不发送消息 - if (second == 0) { - return; - } - Attach attach = new Attach(); - attach.setFirst(first); - attach.setSecond(second); - attach.setData(msg); - // 全服通知 - if (sendAllServer) { - sendSysMsgService.broadCastMsg(SystemConfig.systemMessageUid, JSON.toJSONString(attach)); - } else if (sendAllRoom) { - sendSysMsgService.sendMessageToPartition(room, attach); - } else { // 单房通知 - sendSysMsgService.sendSingleRoomMessage(room, attach); - } - } catch (Exception e) { - log.error("SeizeTreasureService sendMsg error", e); - } - - } - - /** - * 更新产出榜单 - * - * @param uid - * @param totalValue - */ - private void updateValueRank(Long uid, Integer totalValue) { - LocalDate now = LocalDate.now(); - log.info("SeizeTreasureService updateValueRank uid:{} LocalDate:{} totalValue:{}", uid, now, totalValue); - jedisService.zincrby(RedisKey.getActRedisKey(RedisKey.VALUE_RANK, now.toString()), totalValue.doubleValue(), uid.toString()); - } - - public SeizeTreasureRankVo getValueRank(Long uid, String dateStr, Integer rankNum, Integer showOrderNum) { - SeizeTreasureRankVo rankVo = new SeizeTreasureRankVo(); - String rankRedisKey = RedisKey.getActRedisKey(RedisKey.VALUE_RANK, dateStr); - // 获取排行榜单 - Set> rankMapSet = jedisService.zrevrange(rankRedisKey, 0L, rankNum - 1L); - // 当前用户信息 - Users currentUser = usersService.getUsersByUid(uid); - Iterator> rankSetIterator = rankMapSet.iterator(); - - for (int i = 1; rankSetIterator.hasNext(); i++) { - Map rankMap = rankSetIterator.next(); - Long rankUid = Long.parseLong((String) rankMap.get("member")); - Double score = (Double) rankMap.get("score"); - Users rankUser = usersService.getUsersByUid(rankUid); - SeizeTreasureRankVo.SeizeTreasureRankEntityVo rankEntityVo = - new SeizeTreasureRankVo.SeizeTreasureRankEntityVo(i, rankUser.getErbanNo(), rankUid, rankUser.getNick(), rankUser.getAvatar(), score); - rankVo.getRankList().add(rankEntityVo); - - } - // 当前用户分值 - Double currentScore = jedisService.zscore(rankRedisKey, uid.toString()); - currentScore = currentScore == null ? 0 : currentScore; - Long currentOrder = jedisService.zrevrank(rankRedisKey, uid.toString()); - currentOrder = currentOrder == null ? 0 : currentOrder + 1; - currentOrder = currentOrder > showOrderNum ? 0 : currentOrder; - rankVo.setCurrentRank( - new SeizeTreasureRankVo.SeizeTreasureRankEntityVo( - currentOrder.intValue(), currentUser.getErbanNo(), uid, currentUser.getNick(), currentUser.getAvatar(), currentScore)); - return rankVo; - } - - public List getPoolItemList(Integer poolType, Integer poolGroup, Integer poolLevel) { - return seizeTreasurePoolItemService.getPoolItemVo(poolType, poolGroup, poolLevel); - } - - public List getDrawRecordList(Long uid, List poolTypeList, PageReq pageReq) { - return seizeTreasurePoolDrawRecordService.getDrawRecordList(uid, poolTypeList, pageReq); - } - - public List getTreasureDrawReward(Long uid, Integer drawNum) throws IOException { - // 奖池奖励 - List poolRewardList = this.getTreasurePoolReward(drawNum); - log.info("SeizeTreasureService getTreasureDrawReward uid:{} drawNum:{} poolRewardList.Size:{}", uid, drawNum, poolRewardList.size()); - //修改幸运值逻辑 - this.updateLuckyNum(poolRewardList, drawNum); - return poolRewardList; - } - - @Async - public void addDrawRecord(Long uid, List cacheList) { - List recordList = new ArrayList<>(cacheList.size()); - cacheList.forEach(cache -> { - SeizeTreasurePoolDrawRecord record = new SeizeTreasurePoolDrawRecord() - .setPoolType(cache.getPoolType()) - .setPoolGroup(cache.getPoolGroup()) - .setPoolLevel(cache.getPoolLevel()) - .setPoolId(cache.getPoolId()) - .setRewardId(cache.getReward().getId()) - .setRewardName(cache.getReward().getRewardName()) - .setRewardValue(cache.getReward().getRewardValue()) - .setRewardNum(cache.getReward().getRewardNum()) - .setRewardType(cache.getReward().getRewardType()) - .setRewardRefId(cache.getReward().getRewardRefId()) - .setUid(uid); - recordList.add(record); - }); - seizeTreasurePoolDrawRecordService.saveBatch(recordList, 100); - } - - public List buildRewardVoList(List cacheList) { - Map rewardIdMap = new HashMap<>(); - // 根据rewardId分组奖励 - for (SeizeTreasurePoolRewardCache rewardCache : cacheList) { - Integer itemIndex = rewardCache.getItemIndex(); - SeizeTreasureReward reward = rewardCache.getReward(); - SeizeTreasurePoolRewardVo mapEntity = rewardIdMap.get(itemIndex); - if (mapEntity == null) { - mapEntity = new SeizeTreasurePoolRewardVo(itemIndex, reward); - rewardIdMap.put(itemIndex, mapEntity); - } else { // 已存在则数量增加 - mapEntity.setRewardNum(mapEntity.getRewardNum() + reward.getRewardNum()); - } - } - ArrayList seizeTreasurePoolRewardVos = new ArrayList<>(rewardIdMap.values()); - return seizeTreasurePoolRewardVos.stream().sorted(Comparator.comparingInt(SeizeTreasurePoolRewardVo::getRewardOrder).reversed()).collect(Collectors.toList()); - } - - public List getTreasurePoolReward(Integer drawNum) { - String poolRedisKey = RedisKey.getActRedisKey(RedisKey.POOL_KEY); - Long poolSize = jedisService.llen(poolRedisKey); - log.info("SeizeTreasureService getTreasurePoolReward poolRedisKey:{} drawNum:{} poolSize:{}", poolRedisKey, drawNum, poolSize); - // 奖池数量小于抽取的数量 - if (poolSize < drawNum) { - log.info("SeizeTreasureService getTreasurePoolReward drawNum:{} < poolSize:{}", drawNum, poolSize); - // 奖池数量不足时,调用初始化奖池 - SpringContextHolder.getBean(SeizeTreasureService.class).initTreasurePool(); - throw new ServiceException(BusiStatus.SEIZE_TREASURE_DRAW_TOO_BUSY); - } - List rewardCacheList = IntStream.range(0, drawNum) - .mapToObj(n->jedisService.lpop(poolRedisKey)) - .filter(StringUtils::hasText) - .map(rewardCacheStr -> gson.fromJson(rewardCacheStr, SeizeTreasurePoolRewardCache.class)) - .toList(); - - // 取出奖励数量小于抽奖次数 - if (rewardCacheList.size() < drawNum) { - log.info("SeizeTreasureService getTreasurePoolReward rewardCacheList.size():{} < drawNum:{}", rewardCacheList.size(), drawNum); - // 将已取出奖励返还奖池 - jedisService.lpushList(poolRedisKey, rewardCacheList.stream().map(rewardCache -> gson.toJson(rewardCache)).collect(Collectors.toList())); - // 调用初始化奖池 - SpringContextHolder.getBean(SeizeTreasureService.class).initTreasurePool(); - throw new ServiceException(BusiStatus.SEIZE_TREASURE_DRAW_TOO_BUSY); - } - log.info("SeizeTreasureService getTreasurePoolReward drawNum:{} rewardCacheList.size:{}", drawNum, rewardCacheList.size()); - return rewardCacheList; - } - - @Deprecated - public Optional getTreasureDrawNumReward(Long uid, Integer drawNum) { - log.info("SeizeTreasureService getTreasureDrawNumReward uid:{} drawNum:{}", uid, drawNum); - String userInfoKey = RedisKey.getActRedisKey(RedisKey.USER_INFO_KEY, uid.toString()); - Long currentDrawNum = jedisService.hincrBy(userInfoKey, DrawUserInfoField.CURRENT_DRAW_NUM_FIELD, drawNum.longValue()); - String needDrawNumStr = jedisService.hget(userInfoKey, DrawUserInfoField.NEED_DRAW_NUM_FIELD); - log.info("SeizeTreasureService getTreasureDrawNumReward uid:{} drawNum:{} currentDrawNum:{} needDrawNumStr:{}", uid, drawNum, currentDrawNum, needDrawNumStr); - Long needDrawNum; - if (!StringUtils.hasText(needDrawNumStr)) { - needDrawNum = this.updateLuckyNumOld(uid); - } else { - needDrawNum = Long.valueOf(needDrawNumStr); - } - // 当前抽奖数量 > 所需达到数量 && 上次数量 < 所需达到数量 - if (currentDrawNum >= needDrawNum && (currentDrawNum - drawNum) < needDrawNum) { - log.info("SeizeTreasureService getTreasureDrawNumReward uid:{} currentDrawNum:{} needDrawNumStr:{} send drawNum reward", uid, currentDrawNum, needDrawNumStr); - // 重置幸运值 - this.updateLuckyNumOld(uid); - return Optional.of(this.getTreasureDrawNumPoolReward()); - } - return Optional.empty(); - } - - public void initPool() { - SeizeTreasureConfig actConfig = this.getActConfig(); - if (!actConfig.getAutoInitPool()) { - log.info("SeizeTreasureService initPool auto init off"); - return; - } - try { - initTreasurePool(); - } catch (Exception e) { - log.error("SeizeTreasureService initPool initTreasurePool error", e); - } - try { - initForestPool(1); - } catch (Exception e) { - log.error("SeizeTreasureService initPool initForestPool:1 error", e); - } - try { - initForestPool(2); - } catch (Exception e) { - log.error("SeizeTreasureService initPool initForestPool:2 error", e); - } - try { - initForestPool(3); - } catch (Exception e) { - log.error("SeizeTreasureService initPool initForestPool:3 error", e); - } - } - - @Async - public void initTreasurePool() { - log.info("SeizeTreasureService initTreasurePool begin"); - SeizeTreasureConfig actConfig = this.getActConfig(); - String seizeTreasurePoolRedisKey = RedisKey.getActRedisKey(RedisKey.POOL_KEY); - Long poolSize = jedisService.llen(seizeTreasurePoolRedisKey); - // 存在时不做初始化 - if (poolSize != null && poolSize > actConfig.getMinTreasurePoolSize()) { - log.info("SeizeTreasureService initTreasurePool exits size:{}", poolSize); - return; - } - // 加锁 - String poolInitLockKey = RedisKey.getActRedisKey(RedisKey.POOL_INIT_LOCK_KEY); - String poolInitLockValue = jedisService.lock(poolInitLockKey, 10 * 1000); - if (StringUtils.isEmpty(poolInitLockValue)) { - log.error("SeizeTreasureService initTreasurePool get redis lock failed"); - return; - } - try { - // 加锁后再次判断奖池是否存在,存在时不做初始化 - poolSize = jedisService.llen(seizeTreasurePoolRedisKey); - if (poolSize != null && poolSize > actConfig.getMinTreasurePoolSize()) { - log.info("SeizeTreasureService initTreasurePool exits size:{}", poolSize); - return; - } - // 生成奖池 - this.doInitTreasurePool(); - } catch (Exception e) { - log.error("SeizeTreasureService initTreasurePool failed"); - throw e; - } finally { - jedisService.unlock(poolInitLockKey, poolInitLockValue); - } - } - - /** - * 奖池生成 - * 根据基础奖池配置+高级奖池配置,生成 (基础奖池数量+1)*高级奖池数量 个奖项 - */ - public void doInitTreasurePool() { - log.info("SeizeTreasureService doInitTreasurePool begin"); - // 获取夺宝奖池配置 - List poolItemList = seizeTreasurePoolItemService.getPoolItem(PoolType.TREASURE, null, null); - log.info("SeizeTreasureService doInitTreasurePool poolItemList:{}", poolItemList); - // 获取奖池配置的奖励相关信息 - List rewardIdList = poolItemList.stream().map(SeizeTreasurePoolItem::getRewardId).collect(Collectors.toList()); - List itemRewardList = seizeTreasureRewardService.getByRewardIds(rewardIdList); - Map itemRewardIdMap = itemRewardList.stream().collect(Collectors.toMap(SeizeTreasureReward::getId, reward -> reward)); - log.info("SeizeTreasureService doInitTreasurePool itemRewardList:{}", itemRewardList); - // 奖池配置根据奖池等级分组 - Map> poolTypeItemMap = poolItemList.stream().collect(Collectors.groupingBy(SeizeTreasurePoolItem::getPoolGroup)); - // 基础等级奖池 - List basePoolItemList = poolTypeItemMap.get(TreasurePoolGroup.BASE); - // 高级奖池 - List highPoolItemList = poolTypeItemMap.get(TreasurePoolGroup.HIGH); - // 检查 基础 以及 高级 奖池组奖励是否配置 - if (CollectionUtils.isEmpty(basePoolItemList) || CollectionUtils.isEmpty(highPoolItemList)) { - throw new ServiceException(BusiStatus.SEIZE_TREASURE_POOL_CONFIG_ERROR); - } - // 获取奖池id - Long poolId = jedisService.hincrBy(RedisKey.getActRedisKey(RedisKey.POOL_INFO_KEY), CURRENT_TREASURE_POOL_ID_FIELD, 1L); - // 基础奖池奖励总个数 - int basePoolRewardSize = basePoolItemList.stream().mapToInt(SeizeTreasurePoolItem::getPoolNum).sum(); - // 高级奖池奖励总个数 - int highPoolRewardSize = highPoolItemList.stream().mapToInt(SeizeTreasurePoolItem::getPoolNum).sum(); - // 总奖池大小 = 基础奖池个数 * 高级奖池个数 + 高级奖池个数 - int poolSize = (basePoolRewardSize + 1) * (highPoolRewardSize == 0 ? 1 : highPoolRewardSize); - log.info("SeizeTreasureService doInitTreasurePool poolId:{} basePoolRewardSize:{} HighPoolRewardSize:{} poolSize:{}", poolId, basePoolRewardSize, highPoolRewardSize, poolSize); - List basePoolRewardCacheList = new ArrayList<>(basePoolRewardSize); - List highPoolRewardCacheList = new ArrayList<>(highPoolRewardSize); - List poolRewardCacheList = new ArrayList<>(poolSize); - // 遍历基础奖池配置,将所有奖励添加至基础奖池中 - for (SeizeTreasurePoolItem basePoolItem : basePoolItemList) { - SeizeTreasurePoolRewardCache basePoolRewardCache = new SeizeTreasurePoolRewardCache(poolId, basePoolItem, itemRewardIdMap.get(basePoolItem.getRewardId())); - for (int i = 0; i < basePoolItem.getPoolNum(); i++) { - basePoolRewardCacheList.add(basePoolRewardCache); - } - } - // 遍历高级奖池配置,生成所有高级奖励 - for (SeizeTreasurePoolItem highPoolItem : highPoolItemList) { - SeizeTreasurePoolRewardCache highPoolRewardCache = new SeizeTreasurePoolRewardCache(poolId, highPoolItem, itemRewardIdMap.get(highPoolItem.getRewardId())); - for (int i = 0; i < highPoolItem.getPoolNum(); i++) { - highPoolRewardCacheList.add(highPoolRewardCache); - } - } - log.info("SeizeTreasureService doInitTreasurePool highPoolRewardCacheList size:{}", highPoolRewardCacheList.size()); - // 打乱高级奖池 - Collections.shuffle(highPoolRewardCacheList); - // 遍历所有高级奖励,将每一个高级奖励 匹配 一组基础奖池,生成一个奖池组,加入奖池 - for (SeizeTreasurePoolRewardCache highRewardCache : highPoolRewardCacheList) { - List groupRewardCacheList = new ArrayList<>(basePoolRewardSize + 1); - groupRewardCacheList.add(highRewardCache); - groupRewardCacheList.addAll(basePoolRewardCacheList); - // 打乱本组奖池 - Collections.shuffle(groupRewardCacheList); - // 将本组奖池加入当前总奖池 - poolRewardCacheList.addAll(groupRewardCacheList); - } - log.info("SeizeTreasureService doInitTreasurePool poolItemList size:{}", poolItemList.size()); - // 加入缓存 - List poolRewardCacheStrList = poolRewardCacheList.stream().map(cache -> gson.toJson(cache)).collect(Collectors.toList()); - jedisService.rpushList(RedisKey.getActRedisKey(RedisKey.POOL_KEY), poolRewardCacheStrList); - //初始化清除用户累计抽奖次数池 - //jedisService.del(RedisKey.getActRedisKey(RedisKey.USER_INFO_KEY)); - log.info("SeizeTreasureService doInitTreasurePool save cache success"); - } - - public void initTreasureDrawNumPool() { - log.info("SeizeTreasureService initTreasureDrawNumPool begin"); - - String poolKey = RedisKey.getActRedisKey(RedisKey.DRAW_NUM_POOL_KEY); - Boolean poolExist = jedisService.exits(poolKey); - if (poolExist) { - return; - } - - // 加锁 - String poolInitLockKey = RedisKey.getActRedisKey(RedisKey.DRAW_NUM_POOL_INIT_LOCK_KEY); - String poolInitLockValue = jedisService.lock(poolInitLockKey, 10 * 1000); - if (StringUtils.isEmpty(poolInitLockValue)) { - log.error("SeizeTreasureService initTreasureLuckyNumPool get redis lock failed"); - return; - } - try { - if (jedisService.exits(poolKey)) { - return; - } - - // 获取夺宝奖池配置 - List poolItemList = seizeTreasurePoolItemService.getPoolItem(PoolType.TREASURE_DRAW_NUM, null, null); - log.info("SeizeTreasureService initTreasureDrawNumPool poolItemList:{}", poolItemList); - - List rewardIdList = poolItemList.stream().map(SeizeTreasurePoolItem::getRewardId).collect(Collectors.toList()); - List itemRewardList = seizeTreasureRewardService.getByRewardIds(rewardIdList); - Map itemRewardIdMap = itemRewardList.stream().collect(Collectors.toMap(SeizeTreasureReward::getId, reward -> reward)); - log.info("SeizeTreasureService initTreasureDrawNumPool itemRewardList:{}", itemRewardList); - - // 获取奖池id - Long poolId = jedisService.hincrBy(RedisKey.getActRedisKey(RedisKey.POOL_INFO_KEY), CURRENT_TREASURE_DRAW_POOL_ID_FIELD, 1L); - log.info("SeizeTreasureService initTreasureDrawNumPool poolId:{}", poolId); - - List poolRewardCacheList = new ArrayList<>(); - // 遍历基础奖池配置,将所有奖励添加至基础奖池中 - for (SeizeTreasurePoolItem poolItem : poolItemList) { - SeizeTreasurePoolRewardCache basePoolRewardCache = new SeizeTreasurePoolRewardCache(poolId, poolItem, itemRewardIdMap.get(poolItem.getRewardId())); - for (int i = 0; i < poolItem.getPoolNum(); i++) { - poolRewardCacheList.add(basePoolRewardCache); - } - } - // 打乱顺序 - Collections.shuffle(poolRewardCacheList); - // 存入缓存 - jedisService.lpushList(poolKey, poolRewardCacheList.stream().map(rewardCache -> gson.toJson(rewardCache)).collect(Collectors.toList())); - } finally { - jedisService.unlock(poolInitLockKey, poolInitLockValue); - } - log.info("SeizeTreasureService initTreasureDrawNumPool success"); - } - - public SeizeTreasurePoolRewardCache getTreasureDrawNumPoolReward() { - log.info("SeizeTreasureService getTreasureDrawNumPoolReward"); - String poolKey = RedisKey.getActRedisKey(RedisKey.DRAW_NUM_POOL_KEY); - String rewardCacheStr = jedisService.lpop(poolKey); - if (!StringUtils.hasText(rewardCacheStr)) { - this.initTreasureDrawNumPool(); - return getTreasureDrawNumPoolReward(); - } - log.info("SeizeTreasureService getTreasureDrawNumPoolReward success, reward:{}", rewardCacheStr); - return gson.fromJson(rewardCacheStr, SeizeTreasurePoolRewardCache.class); - } - - public SeizeTreasureUserElfInfo getUserElvesInfo(Long uid) { - SeizeTreasureUserElfInfo userInfo = new SeizeTreasureUserElfInfo(); - List userElves = seizeTreasureUserPropService.getUserElvesVo(uid); - userElves.forEach(userElf -> { - if (PropLevel.L1.equals(userElf.getElfLevel())) { - userInfo.getLowElves().add(userElf); - } else if (PropLevel.L3.equals(userElf.getElfLevel())) { - userInfo.getHighElves().add(userElf); - } - }); - UserActPropertyInfoV2 userActPropertyInfo = userActPropertyInfoV2Service.getUserActPropertyInfo(uid, ActivitesPackTypeEnum.SEIZE_TREASURE_TICKET.getValue()); - if (userActPropertyInfo != null) { - userInfo.setChipNum(userActPropertyInfo.getPieceNum().intValue()); - } - return userInfo; - } - - public void sendElf(Long uid, Long elfId, Long targetUid) { - if (!checkAuthority()) { - throw new ServiceException(BusiStatus.NOT_ENOUGH_LEVEL); - } - log.info("SeizeTreasureService sendElf uid:{} elfId:{} targetUid:{}", uid, elfId, targetUid); - - SeizeTreasureProp actProp = seizeTreasurePropService.getById(elfId); - if (actProp == null || !PropType.ELF.equals(actProp.getType())) { - throw new ServiceException(BusiStatus.PARAMERROR); - } - Boolean reduceSuccess = seizeTreasureUserPropService.reduceUserProp(uid, elfId, 1); - log.info("SeizeTreasureService sendElf uid:{} elfId:{} reduceUserProp success", uid, elfId); - - if (!reduceSuccess) { - throw new ServiceException(BusiStatus.SEIZE_TREASURE_USER_PROP_NOT_ENOUGH, "精靈數量不足"); - } - Users targetUser = usersService.getUsersByUid(targetUid); - if (targetUser == null) { - throw new ServiceException(BusiStatus.PARAMERROR); - } - Users user = usersService.getUsersByUid(uid); - seizeTreasureUserPropService.addUserProp(targetUid, elfId, 1); - log.info("SeizeTreasureService addUserProp uid:{} elfId:{} addUserProp success", targetUid, elfId); - seizeTreasureUserPropRecordService.save(new SeizeTreasureUserPropRecord(uid, elfId, PropRecordType.SEND, targetUid, actProp.getName(), actProp.getPicUrl())); - seizeTreasureUserPropRecordService.save(new SeizeTreasureUserPropRecord(targetUid, elfId, PropRecordType.RECEIVE, uid, actProp.getName(), actProp.getPicUrl())); - // 发送消息 - String msg = String.format(SEND_ELF_COMMON_MSG, actProp.getName()); - SeizeTreasureElfMsgVo seizeTreasureElfMsgVo = new SeizeTreasureElfMsgVo(uid, user.getNick(), targetUid, targetUser.getNick(), actProp.getId(), actProp.getName(), actProp.getPicUrl(), msg); - this.sendElfMsg(uid, targetUid, Constant.DefMsgType.SEIZE_TREASURE_SEND_ELF, msg, seizeTreasureElfMsgVo); - } - - public void askForElf(Long elfId, Long uid, Long targetUid) { - if (!checkAuthority()) { - throw new ServiceException(BusiStatus.NOT_ENOUGH_LEVEL); - } - log.info("SeizeTreasureService askForElf uid:{} elfId:{} targetUid:{}", uid, elfId, targetUid); - - SeizeTreasureProp actProp = seizeTreasurePropService.getById(elfId); - if (actProp == null || !PropType.ELF.equals(actProp.getType())) { - throw new ServiceException(BusiStatus.PARAMERROR); - } - Users targetUser = usersService.getUsersByUid(targetUid); - if (targetUser == null) { - throw new ServiceException(BusiStatus.PARAMERROR); - } - Users user = usersService.getUsersByUid(uid); - seizeTreasureUserPropRecordService.save(new SeizeTreasureUserPropRecord(uid, elfId, PropRecordType.ASK_FOR, targetUid, actProp.getName(), actProp.getPicUrl())); - String msg = String.format(ASK_FOR_ELF_COMMON_MSG, actProp.getName()); - SeizeTreasureElfMsgVo seizeTreasureElfMsgVo = new SeizeTreasureElfMsgVo(uid, user.getNick(), targetUid, targetUser.getNick(), actProp.getId(), actProp.getName(), actProp.getPicUrl(), msg); - this.sendElfMsg(uid, targetUid, Constant.DefMsgType.SEIZE_TREASURE_ASK_FOR_ELF, msg, seizeTreasureElfMsgVo); - } - - public List getUserElfRecord(Long uid, PageReq pageReq) { - return seizeTreasureUserPropRecordService.getUserElfRecord(uid, Arrays.asList(PropRecordType.SEND, PropRecordType.RECEIVE), pageReq); - } - - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - public SeizeTreasureElfVo compoundElf(Long uid, SeizeTreasureElfCompoundReq compoundReqs) { - if (!checkAuthority()) { - throw new ServiceException(BusiStatus.NOT_ENOUGH_LEVEL); - } - log.info("SeizeTreasureService compoundElf uid:{} compoundReqs:{}", uid, compoundReqs); - Integer compoundLevel = compoundReqs.getLevel(); - List compoundExpendList = compoundReqs.getExpendList(); - Map elfIdMap = compoundExpendList.stream() - .filter(expend -> expend.getElfNum() > 0) - .collect(Collectors.toMap( - SeizeTreasureElfCompoundReq.ElfCompoundExpend::getElfId, reward -> reward, (o, n) -> n.setElfNum(o.getElfNum() + n.getElfNum()))); - // 消耗道具信息 - List propList = seizeTreasurePropService.lambdaQuery() - .eq(SeizeTreasureProp::getType, PropType.ELF) - .in(SeizeTreasureProp::getId, elfIdMap.keySet()).list(); - // 扣除道具 - propList.forEach(prop -> { - Long propId = prop.getId(); - Boolean reduceSuccess = seizeTreasureUserPropService.reduceUserProp(uid, propId, elfIdMap.get(propId).getElfNum()); - if (!reduceSuccess) { - throw new ServiceException(BusiStatus.SEIZE_TREASURE_USER_PROP_NOT_ENOUGH, prop.getName() + "數量不足"); - } - }); - log.info("SeizeTreasureService compoundElf reduceUserProp uid:{} propList:{} success", uid, propList); - SeizeTreasurePoolRewardCache compoundReward = this.getElfCompoundPoolReward(compoundLevel); - SeizeTreasureReward elfReward = compoundReward.getReward(); - // 增加道具 - seizeTreasureUserPropService.addUserProp(uid, compoundReward.getReward().getRewardRefId(), elfReward.getRewardNum()); - log.info("SeizeTreasureService compoundElf addUserProp uid:{} propId:{} propNum:{} success", uid, compoundReward.getReward().getRewardRefId(), elfReward.getRewardNum()); - // 保存合成获取记录 - SeizeTreasureProp rewardProp = seizeTreasurePropService.getById(elfReward.getRewardRefId()); - SeizeTreasureUserPropRecord elfRecord = null; - if (rewardProp != null) { - elfRecord = new SeizeTreasureUserPropRecord(uid, PropRecordType.COMPOUND_GAIN, elfReward.getRewardRefId(), 1, null, null, compoundLevel, rewardProp.getName(), rewardProp.getPicUrl()); - seizeTreasureUserPropRecordService.save(elfRecord); - } - if (elfRecord != null) { - Long elfRecordId = elfRecord.getId(); - List recordList = elfIdMap.values().stream() - .map(req -> { - Long elfId = req.getElfId(); - Optional any = propList.stream().filter(v -> elfId.equals(v.getId())).findAny(); - if (any.isPresent()) { - SeizeTreasureProp prop = any.get(); - return new SeizeTreasureUserPropRecord(uid, PropRecordType.COMPOUND_EXPEND, req.getElfId(), req.getElfNum(), null, elfRecordId, compoundLevel, prop.getName(), prop.getPicUrl()); - } else { - throw new ServiceException(BusiStatus.ELVES_DO_NOT_EXIST); - } - }) - .collect(Collectors.toList()); - seizeTreasureUserPropRecordService.saveBatch(recordList); - } - return new SeizeTreasureElfVo(elfReward.getId(), elfReward.getRewardLevel(), elfReward.getRewardName(), elfReward.getRewardPicUrl()); - } - - public SeizeTreasurePoolRewardCache getElfCompoundPoolReward(Integer compoundLevel) { - String poolKey = RedisKey.getActRedisKey(RedisKey.ELF_COMPOUND_POOL_KEY, compoundLevel.toString()); - String rewardCacheStr = jedisService.lpop(poolKey); - log.info("SeizeTreasureService getElfCompoundPoolReward poolKey:{} compoundLevel:{} rewardCacheStr:{}", poolKey, compoundLevel, rewardCacheStr); - if (!StringUtils.hasText(rewardCacheStr)) { - this.initElfCompoundPool(compoundLevel); - return getElfCompoundPoolReward(compoundLevel); - } - return gson.fromJson(rewardCacheStr, SeizeTreasurePoolRewardCache.class); - } - - public void initElfCompoundPool(Integer poolLevel) { - log.info("SeizeTreasureService initElfCompoundPool poolLevel:{} begin", poolLevel); - SeizeTreasureConfig actConfig = this.getActConfig(); - String poolKey = RedisKey.getActRedisKey(RedisKey.ELF_COMPOUND_POOL_KEY, poolLevel.toString()); - Long poolSize = jedisService.llen(poolKey); - // 存在时不做初始化 - if (poolSize != null && poolSize > actConfig.getMinElfCompoundPoolSize()) { - log.info("SeizeTreasureService initElfCompoundPool exits size:{}", poolSize); - return; - } - // 加锁 - String poolInitLockKey = RedisKey.getActRedisKey(RedisKey.ELF_COMPOUND_POOL_INIT_LOCK_KEY, poolLevel.toString()); - String poolInitLockValue = jedisService.lock(poolInitLockKey, 10 * 1000); - if (StringUtils.isEmpty(poolInitLockValue)) { - log.error("SeizeTreasureService initElfCompoundPool get redis lock failed"); - return; - } - try { - // 加锁后再次判断奖池是否存在,存在时不做初始化 - poolSize = jedisService.llen(poolKey); - if (poolSize != null && poolSize > actConfig.getMinElfCompoundPoolSize()) { - log.info("SeizeTreasureService initElfCompoundPool exits size:{}", poolSize); - return; - } - // 生成奖池 - // 获取合成奖池配置 - List poolItemList = seizeTreasurePoolItemService.getPoolItem(PoolType.COMPOUND, null, poolLevel); - log.info("SeizeTreasureService initElfCompoundPool poolItemList:{}", poolItemList); - List rewardIdList = poolItemList.stream().map(SeizeTreasurePoolItem::getRewardId).collect(Collectors.toList()); - List itemRewardList = seizeTreasureRewardService.getByRewardIds(rewardIdList); - Map itemRewardIdMap = itemRewardList.stream().collect(Collectors.toMap(SeizeTreasureReward::getId, reward -> reward)); - log.info("SeizeTreasureService initElfCompoundPool itemRewardList:{}", itemRewardList); - // 获取奖池id - Long poolId = jedisService.hincrBy(RedisKey.getActRedisKey(RedisKey.POOL_INFO_KEY), CURRENT_ELF_COMPOUND_POOL_ID_FIELD + poolLevel, 1L); - log.info("SeizeTreasureService initElfCompoundPool poolId:{}", poolId); - List poolRewardCacheList = new ArrayList<>(); - // 遍历基础奖池配置,将所有奖励添加至基础奖池中 - for (SeizeTreasurePoolItem poolItem : poolItemList) { - SeizeTreasurePoolRewardCache basePoolRewardCache = new SeizeTreasurePoolRewardCache(poolId, poolItem, itemRewardIdMap.get(poolItem.getRewardId())); - for (int i = 0; i < poolItem.getPoolNum(); i++) { - poolRewardCacheList.add(basePoolRewardCache); - } - } - // 打乱顺序 - Collections.shuffle(poolRewardCacheList); - // 存入缓存 - jedisService.lpushList(poolKey, poolRewardCacheList.stream().map(rewardCache -> gson.toJson(rewardCache)).collect(Collectors.toList())); - } catch (Exception e) { - log.error("SeizeTreasureService initElfCompoundPool failed"); - throw e; - } finally { - jedisService.unlock(poolInitLockKey, poolInitLockValue); - } - } - - public List getElfCompoundRecord(Long uid, PageReq pageReq) { - List recordVoList = seizeTreasureUserPropRecordService.getCompoundGainRecord(uid, pageReq); - // 无记录时直接返回 - if (CollectionUtils.isEmpty(recordVoList)) { - return recordVoList; - } - List recordIdList = recordVoList.stream().map(SeizeTreasureElfCompoundRecordVo::getRecordId).collect(Collectors.toList()); - List expendList = seizeTreasureUserPropRecordService.getCompoundExpendList(recordIdList); - Map> objIdMap = expendList.stream().collect(Collectors.groupingBy(SeizeTreasureElfCompoundRecordVo.ElfCompoundExpendVo::getBizId)); - for (SeizeTreasureElfCompoundRecordVo record : recordVoList) { - Long recordId = record.getRecordId(); - String elfNameStr = record.getElfName(); - if (StrUtil.isEmpty(elfNameStr)) { - elfNameStr = StrUtil.EMPTY; - } - StringBuilder elfName = new StringBuilder(elfNameStr); - Integer type = record.getType(); - if (PropRecordType.SALVAGE_EXPEND.equals(type)) { - SeizeTreasureUserPropRecord propRecord = seizeTreasureUserPropRecordService.getById(recordId); - if (propRecord != null) { - SeizeTreasureElfCompoundRecordVo.ElfCompoundExpendVo expend = new SeizeTreasureElfCompoundRecordVo.ElfCompoundExpendVo(); - expend.setElfName(elfName.toString()); - expend.setBizId(propRecord.getBizId()); - expend.setElfId(propRecord.getPropId()); - expend.setElfNum(propRecord.getPropNum()); - SeizeTreasureProp prop = seizeTreasurePropService.getById(propRecord.getPropId()); - if (prop != null) { - expend.setElfLevel(prop.getLevel()); - } - record.setExpendList(Collections.singletonList(expend)); - Long bizId = propRecord.getBizId(); - elfName = new StringBuilder(ActivitesPackTypeEnum.SEIZE_TREASURE_TICKET.getDesc()); - UserActPropertyInfoRecord infoRecord = userActPropertyInfoRecordService.getById(bizId); - if (infoRecord != null) { - elfName.append("x").append(infoRecord.getNum()); - } - record.setElfName(elfName.toString()); - } - } else { - record.setExpendList(objIdMap.get(recordId)); - } - } - return recordVoList; - } - - public List getElfConvertList() { - return seizeTreasureConvertItemService.getConvertItem(ConvertType.ELF); - } - - public List getChipConvertList() { - return seizeTreasureConvertItemService.getConvertItem(ConvertType.CHIP); - } - - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - public SeizeTreasureRewardBaseVo convert(Long uid, Long roomUid, Long itemId) { - if (!checkAuthority()) { - throw new ServiceException(BusiStatus.NOT_ENOUGH_LEVEL); - } - log.info("SeizeTreasureService convert uid:{} roomUid:{} itemId:{}", uid, roomUid, itemId); - SeizeTreasureCovertItemVo convertItem = seizeTreasureConvertItemService.getItemById(itemId); - if (convertItem == null) { - throw new ServiceException(BusiStatus.PARAMERROR); - } - SeizeTreasureReward reward = seizeTreasureRewardService.getById(convertItem.getRewardId()); - if (reward == null) { - throw new ServiceException(BusiStatus.PARAMERROR); - } - log.info("SeizeTreasureService convert convertItem:{} reward:{}", convertItem, reward); - SeizeTreasureRewardBaseVo convertReward = new SeizeTreasureRewardBaseVo(reward); - convertReward.setEffectDay(convertItem.getEffectDay()); - boolean reduceSuccess = false; - List reduceElfIdList = new ArrayList<>(); - if (ConvertType.ELF.equals(convertItem.getType())) { - List propIds = convertItem.getPropIds(); - List propNums = convertItem.getPropNums(); - if (CollectionUtil.isNotEmpty(propIds) && CollectionUtil.isNotEmpty(propNums)) { - propIds = propIds.stream().filter(v -> v != 0).collect(Collectors.toList()); - propNums = propNums.stream().filter(v -> v != 0).collect(Collectors.toList()); - Boolean[] successArray = new Boolean[propIds.size()]; - for (int i = 0, len = propIds.size(); i < len; i++) { - Long propId = 0L; - if (propIds.size() > i) { - propId = propIds.get(i); - } - Integer propNum = 0; - if (propNums.size() > i) { - propNum = propNums.get(i); - } - successArray[i] = seizeTreasureUserPropService.reduceUserProp(uid, propId, propNum); - log.info("SeizeTreasureService convert reduceUserProp propId : {}, propNum : {}, reduceSuccess : {}", propId, propNum, successArray[i]); - } - reduceSuccess = Arrays.stream(successArray).allMatch(v -> v); - reduceElfIdList.addAll(propIds); - } - } else if (ConvertType.CHIP.equals(convertItem.getType())) { - List reduceChipList = Collections.singletonList(ActPropsId.CHIP); - try { - userActPropertyInfoV2Service.reduceUserPiece(uid, Long.valueOf(convertItem.getExpendNum()), ActivitesPackTypeEnum.SEIZE_TREASURE_TICKET.getValue()); - reduceSuccess = true; - } catch (Exception e) { - log.error(e.getMessage(), e); - reduceSuccess = false; - } - log.info("SeizeTreasureService convert reduceUserProp reduceChipList : {}", reduceChipList); - reduceElfIdList.addAll(reduceChipList); - } - log.info("SeizeTreasureService convert reduceSuccess : {}", reduceSuccess); - if (!reduceSuccess) { - String msg = String.format(PROP_NOT_ENOUGH_MSG, ConvertType.ELF.equals(convertItem.getType()) ? "精靈" : "道具"); - throw new ServiceException(BusiStatus.SEIZE_TREASURE_USER_PROP_NOT_ENOUGH, msg); - } - // 发放奖励 - SpringContextHolder.getBean(SeizeTreasureService.class).sendReward(uid, Collections.singletonList(convertReward)); - // 添加兑换记录 - SeizeTreasureConvertRecord record = seizeTreasureConvertRecordService.addRecord(uid, convertItem, convertReward); - // 添加扣除记录 - seizeTreasureUserPropRecordService.addRecord(uid, PropRecordType.CONVERT_EXPEND, record.getId(), convertItem.getLevel(), reduceElfIdList, convertItem.getExpendNum()); - if (ConvertType.ELF.equals(convertItem.getType())) { - Users users = usersService.getUsersByUid(uid); - Room room = roomService.getRoomByUid(roomUid); - SpringContextHolder.getBean(SeizeTreasureService.class).afterElfConvert(users, room, convertItem.getLevel(), convertReward, getActConfig().getUserLevelLimit()); - } - return convertReward; - } - - @Async - public void afterElfConvert(Users users, Room room, Integer convertLevel, SeizeTreasureRewardBaseVo rewardBaseVo, Integer limitLevel) { - Integer first = Constant.DefMsgType.SEIZE_TREASURE; - Integer second = 0; - switch (convertLevel) { - case 1: - second = Constant.DefMsgType.SEIZE_TREASURE_CONVERT_L1; - break; - case 2: - second = Constant.DefMsgType.SEIZE_TREASURE_CONVERT_L2; - break; - case 3: - second = Constant.DefMsgType.SEIZE_TREASURE_CONVERT_L3; - break; - } - - // 未定义类型不发送消息 - if (second == 0) { - return; - } - - SeizeTreasureMsg msg = new SeizeTreasureMsg(users, room.getUid(), rewardBaseVo, limitLevel); - - Attach attach = new Attach(); - attach.setFirst(first); - attach.setSecond(second); - attach.setData(msg); - - // 全服通知 - sendSysMsgService.sendMessageToPartition(room, attach); - } - - public List getConvertRecord(Long uid, Integer convertType, PageReq pageReq) { - return seizeTreasureConvertRecordService.getConvertRecord(uid, convertType, pageReq); - } - - public SeizeTreasureConfig getActConfig() { - String configStr = sysConfService.getDefaultSysConfValueById(Constant.SysConfId.ACT_SEIZE_TREASURE_CONFIG, "{}"); - SeizeTreasureConfig config = gson.fromJson(configStr, SeizeTreasureConfig.class); - return config; - } - - private void sendElfMsg(Long fromUid, Long toUid, Integer second, String msg, SeizeTreasureElfMsgVo seizeTreasureElfMsgVo) { - NeteaseSendMsgParam neteaseSendMsgParam = new NeteaseSendMsgParam(); - neteaseSendMsgParam.setFrom(fromUid.toString()); - neteaseSendMsgParam.setTo(toUid.toString()); - neteaseSendMsgParam.setType(100); - neteaseSendMsgParam.setPushcontent(msg); - Attach attach = new Attach(); - attach.setFirst(Constant.DefMsgType.SEIZE_TREASURE); - attach.setSecond(second); - attach.setData(seizeTreasureElfMsgVo); - neteaseSendMsgParam.setAttach(attach); - Payload payload = new Payload(); - neteaseSendMsgParam.setPayload(payload); - sendSysMsgService.sendMsg(neteaseSendMsgParam); - } - - public static final String CURRENT_TREASURE_POOL_ID_FIELD = "currentTreasurePoolId"; - public static final String CURRENT_TREASURE_DRAW_POOL_ID_FIELD = "currentTreasureDrawNumPoolId"; - public static final String CURRENT_FOREST_POOL_ID_FIELD = "currentForestPoolId_"; - public static final String CURRENT_ELF_COMPOUND_POOL_ID_FIELD = "currentElfCompoundPoolId_"; - public static final String SEND_ELF_COMMON_MSG = "我贈送了你1張\"%s\"精靈卡"; - public static final String ASK_FOR_ELF_COMMON_MSG = "我向你索要了1張\"%s\"精靈卡"; - public static final String PROP_NOT_ENOUGH_MSG = "當前%s不足,參與活動獲取吧~"; - - public void hourCountMsg() { - SeizeTreasureConfig actConfig = this.getActConfig(); - if (!actConfig.getHourCountMsg()) { - log.info("SeizeTreasureService hourCountMsg off"); - return; - } - LocalDateTime endTime = LocalDateTime.now().minusSeconds(0).minusNanos(0); - if ((endTime.getHour() % actConfig.getHourLimit()) != 0) { - log.info("SeizeTreasureService currentHour:{} hourLimit:{} off", endTime.getHour(), actConfig.getHourLimit()); - } - String gameName = ActInfo.ACT_DESC + "_小时播报"; - LocalDateTime startTime = endTime.plusHours(-actConfig.getHourLimit()); - Date startDate = Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()); - Date endDate = Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()); - log.info("SeizeTreasureService hourCountMsg startTime:{} endTime:{} startDate:{} endDate:{}", startTime, endTime, startDate, endDate); - - SeizeTreasureStaticVo seizeTreasureStaticVo = seizeTreasurePoolDrawRecordService.staticPoolRecord(Arrays.asList(PoolType.TREASURE, PoolType.TREASURE_DRAW_NUM), null, null, startDate, endDate); - - MarkdownMessage msg = new MarkdownMessage(); - msg.addTitle(MarkdownMessage.getHeaderText(3, "[" + AppEnum.molistar.getDesc() + "]" + - "[" + gameName + "]\n " + - DateTimeUtil.convertDate(startDate) + "--" + - DateTimeUtil.convertDate(endDate) + "期间内情况如下:")); - msg.add(MarkdownMessage.getReferenceText("参与用户数: " + seizeTreasureStaticVo.getDrawPeopleNum())); - msg.add(MarkdownMessage.getReferenceText("总抽奖次数: " + seizeTreasureStaticVo.getDrawCountNum())); - msg.add(MarkdownMessage.getReferenceText("用户投入总价值: " + seizeTreasureStaticVo.getDrawInputValue())); - msg.add(MarkdownMessage.getReferenceText("用户产出总价值: " + seizeTreasureStaticVo.getDrawOutputValue())); - messageRobotPushService.pushMessageByKey(webSecurityConfig.getSeizeTreasureDingPushKey(), msg, true); - } - - public void giftOutputMsg(Long uid, SeizeTreasurePoolRewardVo rewardVo) { - Users users = usersService.getUsersByUid(uid); - - String gameName = ActInfo.ACT_DESC + "_产出播报"; - MarkdownMessage msg = new MarkdownMessage(); - msg.addTitle(MarkdownMessage.getHeaderText(3, "[" + AppEnum.molistar.getDesc() + "][" + gameName + "]\n产出奖品")); - msg.add(MarkdownMessage.getReferenceText("奖品id: " + rewardVo.getRewardRefId())); - msg.add(MarkdownMessage.getReferenceText("奖品名称: " + rewardVo.getRewardName())); - msg.add(MarkdownMessage.getReferenceText("奖品价值: " + rewardVo.getRewardShowValue())); - msg.add(MarkdownMessage.getReferenceText("产出数量: " + rewardVo.getRewardNum())); - msg.add(MarkdownMessage.getReferenceText("获得者: " + users.getNick() + "(" + users.getErbanNo() + ")")); - messageRobotPushService.pushMessageByKey(webSecurityConfig.getSeizeTreasureDingPushKey(), msg, true); - } - - /** - * 精灵分解 - * - * @param uid - * @param salvageReq - * @return - */ - @Transactional(rollbackFor = Exception.class) - public List elfSalvage(Long uid, SeizeTreasureElfSalvageReq salvageReq) { - if (!checkAuthority()) { - throw new ServiceException(BusiStatus.NOT_ENOUGH_LEVEL); - } - log.info("SeizeTreasureService elfSalvage uid : {}, salvageReq : {}", uid, salvageReq); - List expendList = salvageReq.getExpendList(); - Map elfIdMap = expendList.stream() - .filter(expend -> expend.getElfNum() > 0) - .collect(Collectors.toMap( - SeizeTreasureElfSalvageReq.ElfSalvageExpend::getElfId, Function.identity(), (v1, v2) -> { - v2.setElfNum(v1.getElfNum() + v2.getElfNum()); - return v2; - })); - //消耗道具信息 - List propList = seizeTreasurePropService.lambdaQuery() - .eq(SeizeTreasureProp::getType, PropType.ELF) - .in(SeizeTreasureProp::getId, elfIdMap.keySet()).list(); - //参数中的道具信息有不存在的相关道具信息 - if (propList.size() != elfIdMap.keySet().size()) { - throw new ServiceException(BusiStatus.PARAMERROR); - } - //扣除道具 - propList.forEach(prop -> { - Long propId = prop.getId(); - Boolean reduceSuccess = seizeTreasureUserPropService.reduceUserProp(uid, propId, elfIdMap.get(propId).getElfNum()); - if (!reduceSuccess) { - throw new ServiceException(BusiStatus.SEIZE_TREASURE_USER_PROP_NOT_ENOUGH); - } - }); - log.info("SeizeTreasureService elfSalvage reduceUserProp uid : {}, propList : {} success", uid, propList); - //获取分解率 - Map> rateMap = new HashMap<>(); - String configValue = sysConfService.getSysConfValueById(Constant.SysConfId.SEIZE_TREASURE_SALVAGE_CONFIG); - if (StrUtil.isNotEmpty(configValue)) { - SeizeTreasureSalvageConfig config = new Gson().fromJson(configValue, SeizeTreasureSalvageConfig.class); - rateMap = config.getSalvageRates().stream().collect(Collectors.toMap(SeizeTreasureSalvageConfig.ElfConfig::getLevel, v -> Arrays.asList(v.getMin(), v.getMax()))); - } else { - rateMap.put(PropLevel.L1, Arrays.asList(80, 100)); - rateMap.put(PropLevel.L3, Arrays.asList(400, 500)); - } - if (CollectionUtil.isEmpty(rateMap)) { - throw new ServiceException(BusiStatus.LACK_OF_DECOMPOSITION_RATE); - } - List records = new ArrayList<>(); - //分解 - for (SeizeTreasureProp prop : propList) { - Long propId = prop.getId(); - String name = prop.getName(); - String picUrl = prop.getPicUrl(); - Integer level = prop.getLevel(); - Integer elfNum = elfIdMap.get(propId).getElfNum(); - Integer min = rateMap.get(level).get(0); - Integer max = rateMap.get(level).get(1); - int pieceNum = 0; - for (int i = 0; i < elfNum; i++) { - int randNumber = ThreadLocalRandom.current().nextInt(max - min + 1) + min; - log.info("propId : {}, level : {}, elfNum : {}, randNumber : {}", propId, level, elfNum, randNumber); - pieceNum += randNumber; - } - log.info("level : {}, pieceNum : {}", level, pieceNum); - //增加道具 - Long recordId = userActPropertyInfoV2Service.updateUserPiece(uid, (long) pieceNum, ActivitesPackTypeEnum.SEIZE_TREASURE_TICKET.getValue(), UserActPropertyObjType.SEIZE_TREASURE_TICKET); - seizeTreasureUserPropRecordService.save(new SeizeTreasureUserPropRecord(uid, PropRecordType.SALVAGE_EXPEND, propId, elfNum, recordId, name, picUrl)); - SeizeTreasureElfSalvageRecordVo record = new SeizeTreasureElfSalvageRecordVo(); - record.setElfLevel(level); - record.setPieceNum(pieceNum); - records.add(record); - } - return records; - } - - public boolean checkAuthority() { - Resource resource = resourceService.getResource(ResourceCodeEnum.SEIZE_TREASURE.name()); - return resource != null; - } - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureShardService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureShardService.java deleted file mode 100644 index abaf98afa..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureShardService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.accompany.business.service.treasure; - -import com.accompany.business.vo.treasure.SeizeTreasureSwitchConfig; - -/** - * @author: liaozetao - * @date: 2023/9/4 16:25 - * @description: - */ -public interface SeizeTreasureShardService { - - /** - * 购买 - * - * @param uid - * @param num - */ - void buy(Long uid, Integer num); - - /** - * 获取配置 - * - * @return - */ - SeizeTreasureSwitchConfig getConfig(); -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureUserPropRecordService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureUserPropRecordService.java deleted file mode 100644 index 184f82cff..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureUserPropRecordService.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.accompany.business.service.treasure; - -import cn.hutool.core.collection.CollectionUtil; -import com.accompany.business.model.treasure.SeizeTreasureProp; -import com.accompany.business.model.treasure.SeizeTreasureUserPropRecord; -import com.accompany.business.mybatismapper.treasure.SeizeTreasurePropMapper; -import com.accompany.business.mybatismapper.treasure.SeizeTreasureUserPropRecordMapper; -import com.accompany.business.vo.treasure.compound.SeizeTreasureElfCompoundRecordVo; -import com.accompany.business.vo.treasure.elf.SeizeTreasureElfRecordVo; -import com.accompany.common.model.PageReq; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.github.pagehelper.PageHelper; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.List; - -/** - * 夺宝精灵奖池类 - */ -@Slf4j -@Service -public class SeizeTreasureUserPropRecordService extends ServiceImpl { - - @Autowired - private SeizeTreasurePropMapper seizeTreasurePropMapper; - - @Autowired - private SeizeTreasureUserPropRecordMapper seizeTreasureUserPropRecordMapper; - - public List getUserElfRecord(Long uid, List recordType, PageReq pageReq) { - PageHelper.startPage(pageReq.getPage(), pageReq.getPageSize()); - return seizeTreasureUserPropRecordMapper.getUserElfRecord(uid, recordType); - } - - public List getCompoundGainRecord(Long uid, PageReq pageReq) { - PageHelper.startPage(pageReq.getPage(), pageReq.getPageSize()); - return seizeTreasureUserPropRecordMapper.getCompoundGainRecord(uid); - } - - public List getCompoundExpendList(List recordIdList) { - return seizeTreasureUserPropRecordMapper.getCompoundExpendList(recordIdList); - } - - public void addRecord(Long uid, Integer type, Long bizId, Integer bizLevel, List propIdList, Integer propNum) { - List recordList = new ArrayList<>(); - List seizeTreasureProps = seizeTreasurePropMapper.selectBatchIds(propIdList); - if (CollectionUtil.isNotEmpty(seizeTreasureProps)) { - for (SeizeTreasureProp prop : seizeTreasureProps) { - Long propId = prop.getId(); - String propName = prop.getName(); - String picUrl = prop.getPicUrl(); - recordList.add(new SeizeTreasureUserPropRecord(uid, type, propId, propNum, null, bizId, bizLevel, propName, picUrl)); - } - } - this.saveBatch(recordList); - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureUserPropService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureUserPropService.java deleted file mode 100644 index 7ecd75d66..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureUserPropService.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.accompany.business.service.treasure; - -import com.accompany.business.model.treasure.SeizeTreasureUserProp; -import com.accompany.business.mybatismapper.treasure.SeizeTreasureUserPropMapper; -import com.accompany.business.vo.treasure.elf.SeizeTreasureUserElfVo; -import com.accompany.common.constant.SeizeTreasureConstant; -import com.accompany.core.service.common.JedisService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; -import org.springframework.util.StringUtils; - -import java.util.List; -import java.util.Set; - -@Slf4j -@Service -public class SeizeTreasureUserPropService extends ServiceImpl { - @Autowired - private SeizeTreasureUserPropMapper seizeTreasureUserPropMapper; - @Autowired - private JedisService jedisService; - - public void addUserProp(Long uid, Long propId, Integer addNum) { - log.info("SeizeTreasureUserPropService updateUserProp uid:{} propId:{} addNum:{}", uid, propId, addNum); - SeizeTreasureUserProp userProp = lambdaQuery().eq(SeizeTreasureUserProp::getUid, uid).eq(SeizeTreasureUserProp::getPropId, propId).one(); - if (userProp == null) { - // 初始化加锁 - String propInitLockKey = SeizeTreasureConstant.RedisKey.getActRedisKey(SeizeTreasureConstant.RedisKey.USER_PROP_INIT_LOCK_KEY, - uid.toString(), propId.toString()); - String propInitLockValue = jedisService.lock(propInitLockKey, 10 * 1000); - if (StringUtils.isEmpty(propInitLockValue)) { - log.error("SeizeTreasureUserPropService updateUserProp init user prop get redis lock failed"); - return; - } - try { - // 加锁后再次判断 - userProp = lambdaQuery().eq(SeizeTreasureUserProp::getUid, uid).eq(SeizeTreasureUserProp::getPropId, propId).one(); - if (userProp == null) { - this.save(new SeizeTreasureUserProp().setUid(uid).setPropId(propId).setPropNum(addNum)); - return; - } - } finally { - jedisService.unlock(propInitLockKey, propInitLockValue); - } - } - seizeTreasureUserPropMapper.addUserProp(uid, propId, addNum); - } - - /** - * 扣除用户指定道具数量 - * - * @param uid - * @param propId - * @param reduceNum - */ - public Boolean reduceUserProp(Long uid, Long propId, Integer reduceNum) { - return this.reduceUserProp(uid, propId, reduceNum, reduceNum); - } - - /** - * 同时扣除用户多个指定道具数量 - * - * @param uid - * @param propIdSet - * @param reduceNum - */ - public Boolean batchReduceUserProp(Long uid, Set propIdSet, Integer reduceNum) { - return this.batchReduceUserProp(uid, propIdSet, reduceNum, reduceNum); - } - - /** - * 扣除用户指定道具数量 - * - * @param uid - * @param propId - * @param reduceNum - * @param minNum 最小要求数量 - */ - public Boolean reduceUserProp(Long uid, Long propId, Integer reduceNum, Integer minNum) { - Integer affectedNum = seizeTreasureUserPropMapper.reduceUserProp(uid, propId, reduceNum, minNum); - // 受影响行数为0时,代表指定用户指定道具数量不足扣减值 - return affectedNum == 1; - } - - /** - * 扣除用户指定道具数量 - * - * @param uid - * @param propIdSet - * @param reduceNum - * @param minNum 最小要求数量 - */ - public Boolean batchReduceUserProp(Long uid, Set propIdSet, Integer reduceNum, Integer minNum) { - if (CollectionUtils.isEmpty(propIdSet)) { - return true; - } - Integer affectedNum = seizeTreasureUserPropMapper.batchReduceUserProp(uid, propIdSet, reduceNum, minNum); - // 受影响行数为0时,代表指定用户指定道具数量不足扣减值 - return affectedNum == propIdSet.size(); - } - - public List getUserElvesVo(Long uid) { - return seizeTreasureUserPropMapper.getUserElvesVo(uid); - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/impl/SeizeTreasureShardServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/impl/SeizeTreasureShardServiceImpl.java deleted file mode 100644 index 877c596dc..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/impl/SeizeTreasureShardServiceImpl.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.accompany.business.service.treasure.impl; - -import cn.hutool.core.util.StrUtil; -import com.accompany.business.constant.activities.ActivitesPackTypeEnum; -import com.accompany.business.enums.UserActPropertyObjType; -import com.accompany.business.enums.resource.ResourceCodeEnum; -import com.accompany.business.model.UserPurse; -import com.accompany.business.service.purse.UserPurseService; -import com.accompany.business.service.record.BillRecordService; -import com.accompany.business.service.resource.ResourceService; -import com.accompany.business.service.treasure.SeizeTreasureShardService; -import com.accompany.business.service.user.UserActPropertyInfoV2Service; -import com.accompany.business.vo.treasure.SeizeTreasureSwitchConfig; -import com.accompany.common.constant.Constant; -import com.accompany.common.status.BusiStatus; -import com.accompany.core.enumeration.BillObjTypeEnum; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.service.SysConfService; -import com.google.gson.Gson; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -/** - * @author: liaozetao - * @date: 2023/9/4 16:25 - * @description: - */ -@Slf4j -@Service -public class SeizeTreasureShardServiceImpl implements SeizeTreasureShardService { - - @Autowired - private UserPurseService userPurseService; - - @Autowired - private BillRecordService billRecordService; - - @Autowired - private UserActPropertyInfoV2Service userActPropertyInfoV2Service; - - @Autowired - private SysConfService sysConfService; - - @Autowired - private ResourceService resourceService; - - @Transactional(rollbackFor = Exception.class) - @Override - public void buy(Long uid, Integer num) { - //精灵碎片置换比率 - int diamondRate = sysConfService.getIntValueById(Constant.SysConfId.SEIZE_TREASURES_SHARD_TO_DIAMOND); - //默认100 - if (diamondRate <= 0) { - diamondRate = 100; - } - int diamondNum = num * diamondRate; - //余额校验 - UserPurse userPurse = userPurseService.queryUserPurse(uid); - double currentDiamonds = userPurse.getDiamonds(); - if (Double.compare(currentDiamonds, diamondNum) < 0) { - throw new ServiceException(BusiStatus.NOT_ENOUGH_DIAMOND); - } - //扣减钱包 - userPurseService.subDiamond(uid, (double) diamondNum, BillObjTypeEnum.ACTIVITY_SEIZE_TREASURE_PACK); - //增加道具 - userActPropertyInfoV2Service.updateUserPiece(uid, (long) num, ActivitesPackTypeEnum.SEIZE_TREASURE_TICKET.getValue(), UserActPropertyObjType.SEIZE_TREASURE_TICKET); - } - - @Override - public SeizeTreasureSwitchConfig getConfig() { - String configValue = sysConfService.getSysConfValueById(Constant.SysConfId.SEIZE_TREASURE_SWITCH_CONFIG); - SeizeTreasureSwitchConfig config = null; - if (StrUtil.isEmpty(configValue)) { - config = new SeizeTreasureSwitchConfig(); - config.setOpen(true); - config.setPrice(100.0); - } else { - config = new Gson().fromJson(configValue, SeizeTreasureSwitchConfig.class); - } - config.setOpen(resourceService.isOpen(ResourceCodeEnum.SEIZE_TREASURE.name())); - return config; - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserBackpackService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserBackpackService.java index 309f0d40e..fd230ba03 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserBackpackService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserBackpackService.java @@ -383,127 +383,6 @@ public class UserBackpackService extends BaseService { } } - @Frozen - public void backpackGiftCompound(Long uid, List expendGiftList, BatchGiftParam compoundGift) { - logger.info("compound gift uid{}, expendGiftList{},compoundGift{}", uid, expendGiftList, compoundGift); - - Assert.isTrue(uid > 0, "uid <= 0"); - Assert.isTrue(!CollectionUtils.isEmpty(expendGiftList), "giftList is empty"); - - // 用户背包 加锁 - String lockKey = getBackpackLock(uid); - String lockVal = jedisService.lock(lockKey, 10 * 1000); - - Map userBackpackMap = this.getUserBackpackMap(uid); - - try { - // 校验 消耗礼物 - for (BatchGiftParam giftParam : expendGiftList) { - String giftIdStr = giftParam.getGiftId().toString(); - // 背包礼物对象 - String userBackpackStr = userBackpackMap.get(giftIdStr); - if (StringUtils.isBlank(userBackpackStr)) { - throw new ServiceException(BusiStatus.GIFTISEMPTY); - } - UserBackpack userBackpack = this.gson.fromJson(userBackpackStr, UserBackpack.class); - - int giftCount = userBackpack.getCount() - giftParam.getNum(); - // 数量校验 - if (giftCount < 0) { - logger.info("check failed uid:{} ,giftId{} count:{} less than needNum{}" - , uid, userBackpack.getGiftId(), userBackpack.getCount(), giftParam.getNum()); - throw new ServiceException(BusiStatus.GIFTISEMPTY); - } - } - - // 扣除兑换消耗礼物 + 新增兑换礼物 - applicationContext.getBean(UserBackpackService.class).compoundAndAdd(uid, expendGiftList, compoundGift); - } finally { // 解锁 - jedisService.unlock(lockKey, lockVal); - } - } - - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - public void compoundAndAdd(Long uid, List expendGiftList, BatchGiftParam compoundGift) { - // 扣除礼物 - for (BatchGiftParam giftParam : expendGiftList) { - this.reduceBackpackGift(uid, giftParam.getGiftId(), giftParam.getNum()); - } - // 需要新增礼物 - if (compoundGift != null) { - UserBackpackParam userBackpackParam = buildUserBackpackParam(uid, compoundGift); - this.saveOrUpdateUserBackpack(userBackpackParam); - } - } - - private UserBackpackParam buildUserBackpackParam(Long uid, BatchGiftParam compoundGift) { - UserBackpackParam userBackpackParam = new UserBackpackParam(); - Gift giftById = giftService.getGiftById(compoundGift.getGiftId()); - userBackpackParam.setUid(uid); - userBackpackParam.setGiftId(compoundGift.getGiftId()); - userBackpackParam.setCount(compoundGift.getNum()); - userBackpackParam.setGiftType(giftById.getGiftType()); - userBackpackParam.setGiftSeq(giftById.getSeqNo()); - return userBackpackParam; - } - - /** - * 这里用来每日存储 粉丝团特权礼物 每日发10个, 且背包最多只有10个 - * 新增或更新用户背包(存在并发问题,加了分布式锁) - * 根据uid+giftId判断,如果记录存在则作更新;如果记录不存在则作新增 - * - * @param userBackpackParam 用户礼物背包参数实体 - * @return - */ - @Frozen - public void saveOrUpdateUserBackpackByFansDesignGift(UserBackpackParam userBackpackParam) { - Assert.notNull(userBackpackParam, "userBackpackParam is null"); - - Long uid = userBackpackParam.getUid(); - Integer giftId = userBackpackParam.getGiftId(); - Integer giftNum = userBackpackParam.getCount(); - - logger.info("saveOrUpdateUserBackpack param==>>>uid:{},giftId:{},giftNum:{}", uid, giftId, giftNum); - Assert.isTrue(uid != null && uid > 0, "uid is null or uid <= 0"); - Assert.isTrue(giftId != null && giftId > 0, "giftId is null or giftId <= 0"); - Assert.isTrue(giftNum != null && giftNum > 0, "giftNum is null or giftNum <= 0"); - - String lockKey = getBackpackItemLock(uid, giftId); - String lockVal = jedisService.lock(lockKey, 10 * 1000); - try { - if (BlankUtil.isBlank(lockVal)) { - logger.error("put into backpack too frequent, uid:{},giftId:{},giftNum:{}", uid, giftId, giftNum); - throw new ServiceException(BusiStatus.SERVERBUSY); - } - - UserBackpackExample userBackpackExample = new UserBackpackExample(); - userBackpackExample.createCriteria().andUidEqualTo(uid).andGiftIdEqualTo(giftId); - List userBackpacks = userBackpackMapper.selectByExample(userBackpackExample); - Date currentDate = new Date(); - UserBackpack userBackpack; - if (CollectionUtils.isEmpty(userBackpacks)) { - // BeanUtils.copyProperties(userBackpackParam, userBackpack); - // 使用Orika性能更快 - userBackpack = BeanMapper.map(userBackpackParam, UserBackpack.class); - userBackpack.setCreateTime(currentDate); - userBackpack.setUpdateTime(currentDate); - userBackpackMapper.insert(userBackpack); - } else { - userBackpack = userBackpacks.get(0); - userBackpack.setGiftType(userBackpackParam.getGiftType()); - userBackpack.setGiftSeq(userBackpackParam.getGiftSeq()); - userBackpack.setCount(giftNum); - userBackpack.setUpdateTime(currentDate); - userBackpackMapper.updateByPrimaryKey(userBackpack); - } - - // 更新用户背包缓存 - this.jedisService.hset(RedisKey.user_backpacket.getKey(uid.toString()), giftId.toString(), this.gson.toJson(userBackpack)); - } finally { - jedisService.unlock(lockKey, lockVal); - } - } - public void clearRoomFreeGift() { String key = RedisKey.room_free_gift_user_uid_gift.getKey(); Set uidGiftIdSet = jedisService.smembers(key); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/util/ChargeNotifyUtil.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/util/ChargeNotifyUtil.java index 0689b7abe..d6fc20785 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/util/ChargeNotifyUtil.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/util/ChargeNotifyUtil.java @@ -54,10 +54,6 @@ public final class ChargeNotifyUtil { channelName = "IOS支付"; break; } - case Constant.ChargeChannel.lucky_tarot: { - channelName = "幸运塔罗充值"; - break; - } case Constant.ChargeChannel.wx: { channelName = "微信支付"; break; diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorBillCheckMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorBillCheckMapper.xml deleted file mode 100644 index 979d79f4f..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorBillCheckMapper.xml +++ /dev/null @@ -1,389 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - id, admin_id, admin_name, upload_time, remark, `status`, check_admin_id, check_admin_name, - check_time, update_time, check_remark, file_md5, file_name, real_name, file_path, - file_full_path - - - - - delete from anchor_bill_check - where id = #{id,jdbcType=BIGINT} - - - delete from anchor_bill_check - - - - - - insert into anchor_bill_check (admin_id, admin_name, upload_time, - remark, `status`, check_admin_id, - check_admin_name, check_time, update_time, - check_remark, file_md5, file_name, - real_name, file_path, file_full_path - ) - values (#{adminId,jdbcType=INTEGER}, #{adminName,jdbcType=VARCHAR}, #{uploadTime,jdbcType=TIMESTAMP}, - #{remark,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{checkAdminId,jdbcType=INTEGER}, - #{checkAdminName,jdbcType=VARCHAR}, #{checkTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, - #{checkRemark,jdbcType=VARCHAR}, #{fileMd5,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR}, - #{realName,jdbcType=VARCHAR}, #{filePath,jdbcType=VARCHAR}, #{fileFullPath,jdbcType=VARCHAR} - ) - - - insert into anchor_bill_check - - - admin_id, - - - admin_name, - - - upload_time, - - - remark, - - - `status`, - - - check_admin_id, - - - check_admin_name, - - - check_time, - - - update_time, - - - check_remark, - - - file_md5, - - - file_name, - - - real_name, - - - file_path, - - - file_full_path, - - - - - #{adminId,jdbcType=INTEGER}, - - - #{adminName,jdbcType=VARCHAR}, - - - #{uploadTime,jdbcType=TIMESTAMP}, - - - #{remark,jdbcType=VARCHAR}, - - - #{status,jdbcType=INTEGER}, - - - #{checkAdminId,jdbcType=INTEGER}, - - - #{checkAdminName,jdbcType=VARCHAR}, - - - #{checkTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - #{checkRemark,jdbcType=VARCHAR}, - - - #{fileMd5,jdbcType=VARCHAR}, - - - #{fileName,jdbcType=VARCHAR}, - - - #{realName,jdbcType=VARCHAR}, - - - #{filePath,jdbcType=VARCHAR}, - - - #{fileFullPath,jdbcType=VARCHAR}, - - - - - - update anchor_bill_check - - - id = #{record.id,jdbcType=BIGINT}, - - - admin_id = #{record.adminId,jdbcType=INTEGER}, - - - admin_name = #{record.adminName,jdbcType=VARCHAR}, - - - upload_time = #{record.uploadTime,jdbcType=TIMESTAMP}, - - - remark = #{record.remark,jdbcType=VARCHAR}, - - - `status` = #{record.status,jdbcType=INTEGER}, - - - check_admin_id = #{record.checkAdminId,jdbcType=INTEGER}, - - - check_admin_name = #{record.checkAdminName,jdbcType=VARCHAR}, - - - check_time = #{record.checkTime,jdbcType=TIMESTAMP}, - - - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - - - check_remark = #{record.checkRemark,jdbcType=VARCHAR}, - - - file_md5 = #{record.fileMd5,jdbcType=VARCHAR}, - - - file_name = #{record.fileName,jdbcType=VARCHAR}, - - - real_name = #{record.realName,jdbcType=VARCHAR}, - - - file_path = #{record.filePath,jdbcType=VARCHAR}, - - - file_full_path = #{record.fileFullPath,jdbcType=VARCHAR}, - - - - - - - - update anchor_bill_check - set id = #{record.id,jdbcType=BIGINT}, - admin_id = #{record.adminId,jdbcType=INTEGER}, - admin_name = #{record.adminName,jdbcType=VARCHAR}, - upload_time = #{record.uploadTime,jdbcType=TIMESTAMP}, - remark = #{record.remark,jdbcType=VARCHAR}, - `status` = #{record.status,jdbcType=INTEGER}, - check_admin_id = #{record.checkAdminId,jdbcType=INTEGER}, - check_admin_name = #{record.checkAdminName,jdbcType=VARCHAR}, - check_time = #{record.checkTime,jdbcType=TIMESTAMP}, - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - check_remark = #{record.checkRemark,jdbcType=VARCHAR}, - file_md5 = #{record.fileMd5,jdbcType=VARCHAR}, - file_name = #{record.fileName,jdbcType=VARCHAR}, - real_name = #{record.realName,jdbcType=VARCHAR}, - file_path = #{record.filePath,jdbcType=VARCHAR}, - file_full_path = #{record.fileFullPath,jdbcType=VARCHAR} - - - - - - update anchor_bill_check - - - admin_id = #{adminId,jdbcType=INTEGER}, - - - admin_name = #{adminName,jdbcType=VARCHAR}, - - - upload_time = #{uploadTime,jdbcType=TIMESTAMP}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - `status` = #{status,jdbcType=INTEGER}, - - - check_admin_id = #{checkAdminId,jdbcType=INTEGER}, - - - check_admin_name = #{checkAdminName,jdbcType=VARCHAR}, - - - check_time = #{checkTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - check_remark = #{checkRemark,jdbcType=VARCHAR}, - - - file_md5 = #{fileMd5,jdbcType=VARCHAR}, - - - file_name = #{fileName,jdbcType=VARCHAR}, - - - real_name = #{realName,jdbcType=VARCHAR}, - - - file_path = #{filePath,jdbcType=VARCHAR}, - - - file_full_path = #{fileFullPath,jdbcType=VARCHAR}, - - - where id = #{id,jdbcType=BIGINT} - - - update anchor_bill_check - set admin_id = #{adminId,jdbcType=INTEGER}, - admin_name = #{adminName,jdbcType=VARCHAR}, - upload_time = #{uploadTime,jdbcType=TIMESTAMP}, - remark = #{remark,jdbcType=VARCHAR}, - `status` = #{status,jdbcType=INTEGER}, - check_admin_id = #{checkAdminId,jdbcType=INTEGER}, - check_admin_name = #{checkAdminName,jdbcType=VARCHAR}, - check_time = #{checkTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, - check_remark = #{checkRemark,jdbcType=VARCHAR}, - file_md5 = #{fileMd5,jdbcType=VARCHAR}, - file_name = #{fileName,jdbcType=VARCHAR}, - real_name = #{realName,jdbcType=VARCHAR}, - file_path = #{filePath,jdbcType=VARCHAR}, - file_full_path = #{fileFullPath,jdbcType=VARCHAR} - where id = #{id,jdbcType=BIGINT} - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorBillRecordMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorBillRecordMapper.xml deleted file mode 100644 index 0bdef0939..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorBillRecordMapper.xml +++ /dev/null @@ -1,341 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - id, `uid`, qingxun_no, nick, avatar, gold_num, diamond_num, admin_id, admin_name, - create_time, update_time, remark, `status` - - - - - delete from anchor_bill_record - where id = #{id,jdbcType=BIGINT} - - - delete from anchor_bill_record - - - - - - insert into anchor_bill_record (`uid`, qingxun_no, nick, - avatar, gold_num, diamond_num, - admin_id, admin_name, create_time, - update_time, remark, `status` - ) - values (#{uid,jdbcType=BIGINT}, #{qingxunNo,jdbcType=BIGINT}, #{nick,jdbcType=VARCHAR}, - #{avatar,jdbcType=VARCHAR}, #{goldNum,jdbcType=BIGINT}, #{diamondNum,jdbcType=DOUBLE}, - #{adminId,jdbcType=INTEGER}, #{adminName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, - #{updateTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER} - ) - - - insert into anchor_bill_record - - - `uid`, - - - qingxun_no, - - - nick, - - - avatar, - - - gold_num, - - - diamond_num, - - - admin_id, - - - admin_name, - - - create_time, - - - update_time, - - - remark, - - - `status`, - - - - - #{uid,jdbcType=BIGINT}, - - - #{qingxunNo,jdbcType=BIGINT}, - - - #{nick,jdbcType=VARCHAR}, - - - #{avatar,jdbcType=VARCHAR}, - - - #{goldNum,jdbcType=BIGINT}, - - - #{diamondNum,jdbcType=DOUBLE}, - - - #{adminId,jdbcType=INTEGER}, - - - #{adminName,jdbcType=VARCHAR}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - #{remark,jdbcType=VARCHAR}, - - - #{status,jdbcType=INTEGER}, - - - - - - update anchor_bill_record - - - id = #{record.id,jdbcType=BIGINT}, - - - `uid` = #{record.uid,jdbcType=BIGINT}, - - - qingxun_no = #{record.qingxunNo,jdbcType=BIGINT}, - - - nick = #{record.nick,jdbcType=VARCHAR}, - - - avatar = #{record.avatar,jdbcType=VARCHAR}, - - - gold_num = #{record.goldNum,jdbcType=BIGINT}, - - - diamond_num = #{record.diamondNum,jdbcType=DOUBLE}, - - - admin_id = #{record.adminId,jdbcType=INTEGER}, - - - admin_name = #{record.adminName,jdbcType=VARCHAR}, - - - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - - - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - - - remark = #{record.remark,jdbcType=VARCHAR}, - - - `status` = #{record.status,jdbcType=INTEGER}, - - - - - - - - update anchor_bill_record - set id = #{record.id,jdbcType=BIGINT}, - `uid` = #{record.uid,jdbcType=BIGINT}, - qingxun_no = #{record.qingxunNo,jdbcType=BIGINT}, - nick = #{record.nick,jdbcType=VARCHAR}, - avatar = #{record.avatar,jdbcType=VARCHAR}, - gold_num = #{record.goldNum,jdbcType=BIGINT}, - diamond_num = #{record.diamondNum,jdbcType=DOUBLE}, - admin_id = #{record.adminId,jdbcType=INTEGER}, - admin_name = #{record.adminName,jdbcType=VARCHAR}, - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - remark = #{record.remark,jdbcType=VARCHAR}, - `status` = #{record.status,jdbcType=INTEGER} - - - - - - update anchor_bill_record - - - `uid` = #{uid,jdbcType=BIGINT}, - - - qingxun_no = #{qingxunNo,jdbcType=BIGINT}, - - - nick = #{nick,jdbcType=VARCHAR}, - - - avatar = #{avatar,jdbcType=VARCHAR}, - - - gold_num = #{goldNum,jdbcType=BIGINT}, - - - diamond_num = #{diamondNum,jdbcType=DOUBLE}, - - - admin_id = #{adminId,jdbcType=INTEGER}, - - - admin_name = #{adminName,jdbcType=VARCHAR}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - remark = #{remark,jdbcType=VARCHAR}, - - - `status` = #{status,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=BIGINT} - - - update anchor_bill_record - set `uid` = #{uid,jdbcType=BIGINT}, - qingxun_no = #{qingxunNo,jdbcType=BIGINT}, - nick = #{nick,jdbcType=VARCHAR}, - avatar = #{avatar,jdbcType=VARCHAR}, - gold_num = #{goldNum,jdbcType=BIGINT}, - diamond_num = #{diamondNum,jdbcType=DOUBLE}, - admin_id = #{adminId,jdbcType=INTEGER}, - admin_name = #{adminName,jdbcType=VARCHAR}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, - remark = #{remark,jdbcType=VARCHAR}, - `status` = #{status,jdbcType=INTEGER} - where id = #{id,jdbcType=BIGINT} - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorBillRecordMapperExpand.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorBillRecordMapperExpand.xml deleted file mode 100644 index 1dad93d4f..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorBillRecordMapperExpand.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - INSERT INTO anchor_bill_record(`uid`, `qingxun_no`, `nick`, `avatar`, `gold_num`, `diamond_num`, `admin_id`, `admin_name`, `create_time`, `update_time`, `remark`, `status`) - VALUES - - (#{item.uid,jdbcType=BIGINT}, #{item.qingxunNo,jdbcType=BIGINT}, #{item.nick,jdbcType=VARCHAR}, #{item.avatar,jdbcType=VARCHAR}, #{item.goldNum,jdbcType=BIGINT}, #{item.diamondNum,jdbcType=VARCHAR}, #{item.adminId,jdbcType=INTEGER}, #{item.adminName,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateTime,jdbcType=TIMESTAMP}, #{item.remark,jdbcType=VARCHAR}, #{item.status,jdbcType=INTEGER} ) - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansExperRecordMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansExperRecordMapper.xml deleted file mode 100644 index 5800f9c8f..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansExperRecordMapper.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansLevelExperienceMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansLevelExperienceMapper.xml deleted file mode 100644 index 9a21c981f..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansLevelExperienceMapper.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansPrivilegeConfigMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansPrivilegeConfigMapper.xml deleted file mode 100644 index 064dc9c89..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansPrivilegeConfigMapper.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansTaskMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansTaskMapper.xml deleted file mode 100644 index d9b0516d2..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansTaskMapper.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansTeamAudioRecordMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansTeamAudioRecordMapper.xml deleted file mode 100644 index 9412e9024..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansTeamAudioRecordMapper.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansTeamMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansTeamMapper.xml deleted file mode 100644 index f776ec3e8..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansTeamMapper.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansTeamMemberMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansTeamMemberMapper.xml deleted file mode 100644 index d695674ac..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansTeamMemberMapper.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansTeamMpPicMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansTeamMpPicMapper.xml deleted file mode 100644 index 6a0688965..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorFansTeamMpPicMapper.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - insert into anchor_fans_team_mp_pic(team_id,privilege_id,level_seq,fans_mp_pic,negative_mp_pic, - active_mp_pic,create_time,update_time - ) values - - ( #{levelPic.teamId}, #{levelPic.privilegeId},#{levelPic.levelSeq},#{levelPic.fansMpPic}, - #{levelPic.negativeMpPic},#{levelPic.activeMpPic},#{levelPic.createTime},#{levelPic.updateTime} ) - - - - update anchor_fans_team_mp_pic - - - - - when id=#{levelPic.id} then #{levelPic.teamId} - - - - - - - when id=#{levelPic.id} then #{levelPic.privilegeId} - - - - - - - when id=#{levelPic.id} then #{levelPic.levelSeq} - - - - - - - when id=#{levelPic.id} then #{levelPic.fansMpPic} - - - - - - - when id=#{levelPic.id} then #{levelPic.negativeMpPic} - - - - - - - when id=#{levelPic.id} then #{levelPic.activeMpPic} - - - - - - - when id=#{levelPic.id} then #{levelPic.createTime} - - - - - - - when id=#{levelPic.id} then #{levelPic.updateTime} - - - - - - - id = #{levelPic.id} - - - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorWhitelistMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorWhitelistMapper.xml deleted file mode 100644 index fc8f05896..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AnchorWhitelistMapper.xml +++ /dev/null @@ -1,267 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - `uid`, erban_no, nick, operate_time, operate_reason, `status`, admin_id, admin_name - - - - - delete from anchor_whitelist - where `uid` = #{uid,jdbcType=BIGINT} - - - delete from anchor_whitelist - - - - - - insert into anchor_whitelist (`uid`, erban_no, nick, - operate_time, operate_reason, `status`, - admin_id, admin_name) - values (#{uid,jdbcType=BIGINT}, #{erbanNo,jdbcType=BIGINT}, #{nick,jdbcType=VARCHAR}, - #{operateTime,jdbcType=TIMESTAMP}, #{operateReason,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, - #{adminId,jdbcType=INTEGER}, #{adminName,jdbcType=VARCHAR}) - - - insert into anchor_whitelist - - - `uid`, - - - erban_no, - - - nick, - - - operate_time, - - - operate_reason, - - - `status`, - - - admin_id, - - - admin_name, - - - - - #{uid,jdbcType=BIGINT}, - - - #{erbanNo,jdbcType=BIGINT}, - - - #{nick,jdbcType=VARCHAR}, - - - #{operateTime,jdbcType=TIMESTAMP}, - - - #{operateReason,jdbcType=VARCHAR}, - - - #{status,jdbcType=INTEGER}, - - - #{adminId,jdbcType=INTEGER}, - - - #{adminName,jdbcType=VARCHAR}, - - - - - - update anchor_whitelist - - - `uid` = #{record.uid,jdbcType=BIGINT}, - - - erban_no = #{record.erbanNo,jdbcType=BIGINT}, - - - nick = #{record.nick,jdbcType=VARCHAR}, - - - operate_time = #{record.operateTime,jdbcType=TIMESTAMP}, - - - operate_reason = #{record.operateReason,jdbcType=VARCHAR}, - - - `status` = #{record.status,jdbcType=INTEGER}, - - - admin_id = #{record.adminId,jdbcType=INTEGER}, - - - admin_name = #{record.adminName,jdbcType=VARCHAR}, - - - - - - - - update anchor_whitelist - set `uid` = #{record.uid,jdbcType=BIGINT}, - erban_no = #{record.erbanNo,jdbcType=BIGINT}, - nick = #{record.nick,jdbcType=VARCHAR}, - operate_time = #{record.operateTime,jdbcType=TIMESTAMP}, - operate_reason = #{record.operateReason,jdbcType=VARCHAR}, - `status` = #{record.status,jdbcType=INTEGER}, - admin_id = #{record.adminId,jdbcType=INTEGER}, - admin_name = #{record.adminName,jdbcType=VARCHAR} - - - - - - update anchor_whitelist - - - erban_no = #{erbanNo,jdbcType=BIGINT}, - - - nick = #{nick,jdbcType=VARCHAR}, - - - operate_time = #{operateTime,jdbcType=TIMESTAMP}, - - - operate_reason = #{operateReason,jdbcType=VARCHAR}, - - - `status` = #{status,jdbcType=INTEGER}, - - - admin_id = #{adminId,jdbcType=INTEGER}, - - - admin_name = #{adminName,jdbcType=VARCHAR}, - - - where `uid` = #{uid,jdbcType=BIGINT} - - - update anchor_whitelist - set erban_no = #{erbanNo,jdbcType=BIGINT}, - nick = #{nick,jdbcType=VARCHAR}, - operate_time = #{operateTime,jdbcType=TIMESTAMP}, - operate_reason = #{operateReason,jdbcType=VARCHAR}, - `status` = #{status,jdbcType=INTEGER}, - admin_id = #{adminId,jdbcType=INTEGER}, - admin_name = #{adminName,jdbcType=VARCHAR} - where `uid` = #{uid,jdbcType=BIGINT} - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AppVersionMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AppVersionMapper.xml deleted file mode 100644 index 47a988332..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AppVersionMapper.xml +++ /dev/null @@ -1,362 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - version_id, os, version, platform, status, download_link, file_md5, publish_time, create_time, update_time - - - version_desc - - - - - - delete from app_version - where version_id = #{versionId,jdbcType=INTEGER} - - - delete from app_version - - - - - - insert into app_version (os, version, platform, - status, download_link, file_md5, - publish_time, create_time, update_time, version_desc - ) - values (#{os,jdbcType=VARCHAR}, #{version,jdbcType=VARCHAR}, #{platform,jdbcType=VARCHAR}, - #{status,jdbcType=TINYINT}, #{downloadLink,jdbcType=VARCHAR}, #{fileMd5,jdbcType=VARCHAR}, - #{publishTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, - #{versionDesc,jdbcType=LONGVARCHAR} - ) - - - insert into app_version - - - os, - - - version, - - - platform, - - - status, - - - download_link, - - - file_md5, - - - publish_time, - - - create_time, - - - update_time, - - - version_desc, - - - - - #{os,jdbcType=VARCHAR}, - - - #{version,jdbcType=VARCHAR}, - - - #{platform,jdbcType=VARCHAR}, - - - #{status,jdbcType=TINYINT}, - - - #{downloadLink,jdbcType=VARCHAR}, - - - #{fileMd5,jdbcType=VARCHAR}, - - - #{publishTime,jdbcType=TIMESTAMP}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - #{versionDesc,jdbcType=LONGVARCHAR}, - - - - - - update app_version - - - version_id = #{record.versionId,jdbcType=INTEGER}, - - - os = #{record.os,jdbcType=VARCHAR}, - - - version = #{record.version,jdbcType=VARCHAR}, - - - platform = #{record.platform,jdbcType=VARCHAR}, - - - status = #{record.status,jdbcType=TINYINT}, - - - download_link = #{record.downloadLink,jdbcType=VARCHAR}, - - - file_md5 = #{record.fileMd5,jdbcType=VARCHAR}, - - - publish_time = #{record.publishTime,jdbcType=TIMESTAMP}, - - - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - - - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - - - version_desc = #{record.versionDesc,jdbcType=LONGVARCHAR}, - - - - - - - - update app_version - set version_id = #{record.versionId,jdbcType=INTEGER}, - os = #{record.os,jdbcType=VARCHAR}, - version = #{record.version,jdbcType=VARCHAR}, - platform = #{record.platform,jdbcType=VARCHAR}, - status = #{record.status,jdbcType=TINYINT}, - download_link = #{record.downloadLink,jdbcType=VARCHAR}, - file_md5 = #{record.fileMd5,jdbcType=VARCHAR}, - publish_time = #{record.publishTime,jdbcType=TIMESTAMP}, - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - version_desc = #{record.versionDesc,jdbcType=LONGVARCHAR} - - - - - - update app_version - set version_id = #{record.versionId,jdbcType=INTEGER}, - os = #{record.os,jdbcType=VARCHAR}, - version = #{record.version,jdbcType=VARCHAR}, - platform = #{record.platform,jdbcType=VARCHAR}, - status = #{record.status,jdbcType=TINYINT}, - download_link = #{record.downloadLink,jdbcType=VARCHAR}, - file_md5 = #{record.fileMd5,jdbcType=VARCHAR}, - publish_time = #{record.publishTime,jdbcType=TIMESTAMP}, - create_time = #{record.createTime,jdbcType=TIMESTAMP} - update_time = #{record.updateTime,jdbcType=TIMESTAMP} - - - - - - update app_version - - - os = #{os,jdbcType=VARCHAR}, - - - version = #{version,jdbcType=VARCHAR}, - - - platform = #{platform,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=TINYINT}, - - - download_link = #{downloadLink,jdbcType=VARCHAR}, - - - file_md5 = #{fileMd5,jdbcType=VARCHAR}, - - - publish_time = #{publishTime,jdbcType=TIMESTAMP}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - version_desc = #{versionDesc,jdbcType=LONGVARCHAR}, - - - where version_id = #{versionId,jdbcType=INTEGER} - - - update app_version - set os = #{os,jdbcType=VARCHAR}, - version = #{version,jdbcType=VARCHAR}, - platform = #{platform,jdbcType=VARCHAR}, - status = #{status,jdbcType=TINYINT}, - download_link = #{downloadLink,jdbcType=VARCHAR}, - file_md5 = #{fileMd5,jdbcType=VARCHAR}, - publish_time = #{publishTime,jdbcType=TIMESTAMP}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, - version_desc = #{versionDesc,jdbcType=LONGVARCHAR} - where version_id = #{versionId,jdbcType=INTEGER} - - - update app_version - set os = #{os,jdbcType=VARCHAR}, - version = #{version,jdbcType=VARCHAR}, - platform = #{platform,jdbcType=VARCHAR}, - status = #{status,jdbcType=TINYINT}, - download_link = #{downloadLink,jdbcType=VARCHAR}, - file_md5 = #{fileMd5,jdbcType=VARCHAR}, - publish_time = #{publishTime,jdbcType=TIMESTAMP}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP} - where version_id = #{versionId,jdbcType=INTEGER} - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AudioCardMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AudioCardMapper.xml deleted file mode 100644 index 667469478..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AudioCardMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/GiftCompoundRecordMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/GiftCompoundRecordMapper.xml deleted file mode 100644 index 71b72d51d..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/GiftCompoundRecordMapper.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/HomeRoomFlowPeriodMapperMgr.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/HomeRoomFlowPeriodMapperMgr.xml deleted file mode 100644 index 3e017de79..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/HomeRoomFlowPeriodMapperMgr.xml +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RedeemCodeMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RedeemCodeMapper.xml deleted file mode 100644 index d4f2b373b..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RedeemCodeMapper.xml +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - code, amount, use_uid, use_ip, use_imei, use_status, use_time, create_time - - - - - delete from redeem_code - where code = #{code,jdbcType=VARCHAR} - - - delete from redeem_code - - - - - - insert into redeem_code (code, amount, use_uid, - use_ip, use_imei, use_status, - use_time, create_time) - values (#{code,jdbcType=VARCHAR}, #{amount,jdbcType=BIGINT}, #{useUid,jdbcType=BIGINT}, - #{useIp,jdbcType=VARCHAR}, #{useImei,jdbcType=VARCHAR}, #{useStatus,jdbcType=INTEGER}, - #{useTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}) - - - insert into redeem_code - - - code, - - - amount, - - - use_uid, - - - use_ip, - - - use_imei, - - - use_status, - - - use_time, - - - create_time, - - - - - #{code,jdbcType=VARCHAR}, - - - #{amount,jdbcType=BIGINT}, - - - #{useUid,jdbcType=BIGINT}, - - - #{useIp,jdbcType=VARCHAR}, - - - #{useImei,jdbcType=VARCHAR}, - - - #{useStatus,jdbcType=INTEGER}, - - - #{useTime,jdbcType=TIMESTAMP}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - - - - update redeem_code - - - code = #{record.code,jdbcType=VARCHAR}, - - - amount = #{record.amount,jdbcType=BIGINT}, - - - use_uid = #{record.useUid,jdbcType=BIGINT}, - - - use_ip = #{record.useIp,jdbcType=VARCHAR}, - - - use_imei = #{record.useImei,jdbcType=VARCHAR}, - - - use_status = #{record.useStatus,jdbcType=INTEGER}, - - - use_time = #{record.useTime,jdbcType=TIMESTAMP}, - - - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - - - - - - - - update redeem_code - set code = #{record.code,jdbcType=VARCHAR}, - amount = #{record.amount,jdbcType=BIGINT}, - use_uid = #{record.useUid,jdbcType=BIGINT}, - use_ip = #{record.useIp,jdbcType=VARCHAR}, - use_imei = #{record.useImei,jdbcType=VARCHAR}, - use_status = #{record.useStatus,jdbcType=INTEGER}, - use_time = #{record.useTime,jdbcType=TIMESTAMP}, - create_time = #{record.createTime,jdbcType=TIMESTAMP} - - - - - - update redeem_code - - - amount = #{amount,jdbcType=BIGINT}, - - - use_uid = #{useUid,jdbcType=BIGINT}, - - - use_ip = #{useIp,jdbcType=VARCHAR}, - - - use_imei = #{useImei,jdbcType=VARCHAR}, - - - use_status = #{useStatus,jdbcType=INTEGER}, - - - use_time = #{useTime,jdbcType=TIMESTAMP}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - where code = #{code,jdbcType=VARCHAR} - - - update redeem_code - set amount = #{amount,jdbcType=BIGINT}, - use_uid = #{useUid,jdbcType=BIGINT}, - use_ip = #{useIp,jdbcType=VARCHAR}, - use_imei = #{useImei,jdbcType=VARCHAR}, - use_status = #{useStatus,jdbcType=INTEGER}, - use_time = #{useTime,jdbcType=TIMESTAMP}, - create_time = #{createTime,jdbcType=TIMESTAMP} - where code = #{code,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RedeemCodeRecordMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RedeemCodeRecordMapper.xml deleted file mode 100644 index a8151a3e0..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RedeemCodeRecordMapper.xml +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - record_id, code, uid, ip, imei, amount, create_time - - - - - delete from redeem_code_record - where record_id = #{recordId,jdbcType=VARCHAR} - - - delete from redeem_code_record - - - - - - insert into redeem_code_record (record_id, code, uid, - ip, imei, amount, create_time - ) - values (#{recordId,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{uid,jdbcType=BIGINT}, - #{ip,jdbcType=VARCHAR}, #{imei,jdbcType=VARCHAR}, #{amount,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP} - ) - - - insert into redeem_code_record - - - record_id, - - - code, - - - uid, - - - ip, - - - imei, - - - amount, - - - create_time, - - - - - #{recordId,jdbcType=VARCHAR}, - - - #{code,jdbcType=VARCHAR}, - - - #{uid,jdbcType=BIGINT}, - - - #{ip,jdbcType=VARCHAR}, - - - #{imei,jdbcType=VARCHAR}, - - - #{amount,jdbcType=BIGINT}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - - - - update redeem_code_record - - - record_id = #{record.recordId,jdbcType=VARCHAR}, - - - code = #{record.code,jdbcType=VARCHAR}, - - - uid = #{record.uid,jdbcType=BIGINT}, - - - ip = #{record.ip,jdbcType=VARCHAR}, - - - imei = #{record.imei,jdbcType=VARCHAR}, - - - amount = #{record.amount,jdbcType=BIGINT}, - - - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - - - - - - - - update redeem_code_record - set record_id = #{record.recordId,jdbcType=VARCHAR}, - code = #{record.code,jdbcType=VARCHAR}, - uid = #{record.uid,jdbcType=BIGINT}, - ip = #{record.ip,jdbcType=VARCHAR}, - imei = #{record.imei,jdbcType=VARCHAR}, - amount = #{record.amount,jdbcType=BIGINT}, - create_time = #{record.createTime,jdbcType=TIMESTAMP} - - - - - - update redeem_code_record - - - code = #{code,jdbcType=VARCHAR}, - - - uid = #{uid,jdbcType=BIGINT}, - - - ip = #{ip,jdbcType=VARCHAR}, - - - imei = #{imei,jdbcType=VARCHAR}, - - - amount = #{amount,jdbcType=BIGINT}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - where record_id = #{recordId,jdbcType=VARCHAR} - - - update redeem_code_record - set code = #{code,jdbcType=VARCHAR}, - uid = #{uid,jdbcType=BIGINT}, - ip = #{ip,jdbcType=VARCHAR}, - imei = #{imei,jdbcType=VARCHAR}, - amount = #{amount,jdbcType=BIGINT}, - create_time = #{createTime,jdbcType=TIMESTAMP} - where record_id = #{recordId,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/SeizeTreasureConvertItemMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/SeizeTreasureConvertItemMapper.xml deleted file mode 100644 index 77c4190b7..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/SeizeTreasureConvertItemMapper.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/SeizeTreasureConvertRecordMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/SeizeTreasureConvertRecordMapper.xml deleted file mode 100644 index 8ed507f3b..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/SeizeTreasureConvertRecordMapper.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/SeizeTreasurePoolDrawRecordMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/SeizeTreasurePoolDrawRecordMapper.xml deleted file mode 100644 index a83865e15..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/SeizeTreasurePoolDrawRecordMapper.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/SeizeTreasurePoolItemMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/SeizeTreasurePoolItemMapper.xml deleted file mode 100644 index f6549369e..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/SeizeTreasurePoolItemMapper.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/SeizeTreasureRewardMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/SeizeTreasureRewardMapper.xml deleted file mode 100644 index 55cbe1d13..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/SeizeTreasureRewardMapper.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/SeizeTreasureUserProp.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/SeizeTreasureUserProp.xml deleted file mode 100644 index 44c18cfb5..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/SeizeTreasureUserProp.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - UPDATE - seize_treasure_user_prop st - SET - st.prop_num = st.prop_num + #{addNum} - WHERE - st.uid = #{uid} - AND st.prop_id = #{propId} - - - UPDATE - seize_treasure_user_prop st - SET - st.prop_num = st.prop_num - #{reduceNum} - WHERE - st.uid = #{uid} - AND st.prop_id = #{propId} - AND st.prop_num >= #{minNum} - - - UPDATE - seize_treasure_user_prop st - SET - st.prop_num = st.prop_num - #{reduceNum} - WHERE - st.uid = #{uid} - AND st.prop_id IN - - #{item} - - AND st.prop_num >= #{minNum} - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/SeizeTreasureUserPropRecordMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/SeizeTreasureUserPropRecordMapper.xml deleted file mode 100644 index 17dfaaa5f..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/SeizeTreasureUserPropRecordMapper.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/common/BaseController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/common/BaseController.java index 2f8258a49..644e24478 100644 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/common/BaseController.java +++ b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/common/BaseController.java @@ -59,16 +59,13 @@ public class BaseController { log.info("decryptSensitiveInfo, client{} ", client); boolean isH5 = "h5".equals(client); if (isH5 || null != deviceInfo.getAppVersion()) { - String appVersion = deviceInfo.getAppVersion(); - if (isH5 || AppVersionUtil.compareVersion(appVersion, Constant.ENCRYPT_SENSITIVE_INFO_APP_VERSION) >= 0) { - String desInfo = null; - try { - desInfo = DESUtils.DESAndBase64Decrypt(sensitiveInfo, KeyStore.DES_ENCRYPT_KEY); - } catch (Exception e) { - throw new ServiceException(BusiStatus.SERVERBUSY); - } - return desInfo; + String desInfo = null; + try { + desInfo = DESUtils.DESAndBase64Decrypt(sensitiveInfo, KeyStore.DES_ENCRYPT_KEY); + } catch (Exception e) { + throw new ServiceException(BusiStatus.SERVERBUSY); } + return desInfo; } return sensitiveInfo; } diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/config/WebMVCConfig.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/config/WebMVCConfig.java index bb5dd0f3a..2f6979ba8 100644 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/config/WebMVCConfig.java +++ b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/config/WebMVCConfig.java @@ -40,11 +40,6 @@ public class WebMVCConfig implements WebMvcConfigurer { return new XssInterceptor(); } - @Bean - public AppVersionInterceptor getAppVersionInterceptor() { - return new AppVersionInterceptor(); - } - /** * 添加拦截器 * @param registry diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/AppVersionController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/AppVersionController.java deleted file mode 100644 index 507629b88..000000000 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/AppVersionController.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.accompany.business.controller; - -import com.accompany.business.service.AppVersionService; -import com.accompany.business.vo.AppVersionVo; -import com.accompany.common.constant.Constant; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import com.accompany.core.service.SysConfService; -import com.accompany.core.util.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.HashMap; -import java.util.Map; - -/** - * Created by liuguofu on 2017/7/10. - */ -@RestController -@RequestMapping("/version") -public class AppVersionController { - @Autowired - private AppVersionService appVersionService; - @Autowired - private SysConfService sysConfService; - private static final Logger logger = LoggerFactory.getLogger(AppVersionController.class); - - @RequestMapping(value = "getNewestVersion",method = RequestMethod.GET) - public BusiResult getNewestVersion(String appVersion,String os,String channel){ - if(StringUtils.isBlank(appVersion)||StringUtils.isBlank(os)){ - return new BusiResult<>(BusiStatus.PARAMETERILLEGAL); - } - AppVersionVo vo = appVersionService.getNewestVersion(appVersion, os, channel); - return new BusiResult<>(vo); - } - - @RequestMapping(value = "get",method = RequestMethod.GET) - public BusiResult getVersionInfo(Long uid, String appVersion,String os,String channel){ - if(StringUtils.isBlank(appVersion)||StringUtils.isBlank(os)){ - return new BusiResult(BusiStatus.PARAMETERILLEGAL,"参数异常"); - } - // 审核的测试用户例外 - if (appVersionService.checkIsAuditingUid(uid)) { - AppVersionVo appVersionVo = new AppVersionVo(); - appVersionVo.setStatus((byte) 2); - return new BusiResult(BusiStatus.SUCCESS, appVersionVo); - } - - BusiResult busiResult=null; - try { - busiResult=appVersionService.getAppVersionInfo(appVersion,os,channel); - } catch (Exception e) { - logger.error("getVersionInfo error..version="+appVersion,e); - return new BusiResult(BusiStatus.BUSIERROR); - } - return busiResult; - } - - @RequestMapping(value = "get/tips", method = RequestMethod.GET) - public BusiResult getAuditVersion(@RequestParam String appVersion, @RequestParam String channel, @RequestParam String os) { - - return new BusiResult(BusiStatus.SUCCESS, appVersionService.getNotAuditingVersionTips(appVersion, channel,os)); - } - - @RequestMapping(value = "update",method = RequestMethod.GET) - public BusiResult updateVersion(String version,Byte status){ - if(StringUtils.isBlank(version)||status==null){ - return new BusiResult(BusiStatus.PARAMETERILLEGAL,"参数异常"); - } - BusiResult busiResult=null; - try { - busiResult=appVersionService.updateVersion(version,status); - } catch (Exception e) { - logger.error("getVersionInfo error..version="+version,e); - return new BusiResult(BusiStatus.BUSIERROR); - } - return busiResult; - } - - @RequestMapping(value = "refresh",method = RequestMethod.GET) - public BusiResult refreshAllVersionInfo(){ - BusiResult busiResult=new BusiResult(BusiStatus.SUCCESS); - try { - appVersionService.cleanCache(); - } catch (Exception e) { - logger.error("refreshAllVersionInfo error..version=",e); - return new BusiResult(BusiStatus.BUSIERROR); - } - return busiResult; - } - - @RequestMapping(value = "list",method = RequestMethod.GET) - public BusiResult getVersionInfoList(){ - BusiResult busiResult=null; - try { - busiResult=appVersionService.getAllAppVersionList(); - } catch (Exception e) { - logger.error("getVersionInfoList error.....",e); - return new BusiResult(BusiStatus.BUSIERROR); - } - return busiResult; - } - - @RequestMapping(value = "add",method = RequestMethod.POST) - public BusiResult addVersion(){ - BusiResult busiResult=null; - try { - busiResult=appVersionService.getAllAppVersionList(); - } catch (Exception e) { - logger.error("addVersion error.....",e); - return new BusiResult(BusiStatus.BUSIERROR); - } - return busiResult; - } - - @RequestMapping(value = "update",method = RequestMethod.POST) - public BusiResult updateVersion(){ - BusiResult busiResult=null; - try { - busiResult=appVersionService.getAllAppVersionList(); - } catch (Exception e) { - logger.error("updateVersion error.....",e); - return new BusiResult(BusiStatus.BUSIERROR); - } - return busiResult; - } - - @GetMapping(value = "/download/link") - public BusiResult getDownloadLink(){ - String androidLink = sysConfService.getSysConfValueById(Constant.SysConfId.ANDROID_DOWNLOAD_LINK); - String iosLink = sysConfService.getSysConfValueById(Constant.SysConfId.IOS_DOWNLOAD_LINK); - Map retMap = new HashMap<>(); - retMap.put("androidLink",androidLink); - retMap.put("iosLink",iosLink); - return new BusiResult(retMap); - } -} diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/activity/GiftCompoundController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/activity/GiftCompoundController.java deleted file mode 100644 index 698c13000..000000000 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/activity/GiftCompoundController.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.accompany.business.controller.activity; - -import com.accompany.business.common.BaseController; -import com.accompany.business.model.Gift; -import com.accompany.business.model.GiftCompoundRecord; -import com.accompany.business.param.GiftCompoundParam; -import com.accompany.business.service.gift.GiftCompoundRecordService; -import com.accompany.business.service.gift.GiftCompoundService; -import com.accompany.business.vo.gift.CompoundGiftVo; -import com.accompany.business.vo.giftCompound.GiftCompoundRecordVo; -import com.accompany.common.annotation.Authorization; -import com.accompany.common.constant.Constant; -import com.accompany.common.result.BusiResult; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * @author guojicong - * @Description - * @create 2022-06-20 - */ -@RestController -@ApiOperation("礼物合成") -@RequestMapping("/gift/compound") -public class GiftCompoundController extends BaseController { - - @Autowired - private GiftCompoundRecordService giftCompoundRecordService; - - @Autowired - private GiftCompoundService giftCompoundService; - - @ApiOperation("合成礼物列表") - @Authorization - @GetMapping(value = "/giftList") - public BusiResult> getCompoundGiftList() { - return new BusiResult<>(giftCompoundService.getCompoundGiftList(getUid(),Constant.GiftCompound.GiftRewardType.NORMAL)); - } - - @ApiOperation("限时合成礼物列表") - @Authorization - @GetMapping(value = "/limit/giftList") - public BusiResult> getLimitCompoundGiftList() { - return new BusiResult<>(giftCompoundService.getCompoundGiftList(getUid(),Constant.GiftCompound.GiftRewardType.LIMIT)); - } - - @ApiOperation("合成礼物") - @Authorization - @PostMapping(value = "") - public BusiResult compound(@RequestBody GiftCompoundParam compoundParam) { - return new BusiResult<>(giftCompoundService.compound(getUid(), compoundParam)); - } - - @ApiOperation("当前用户礼物合成记录") - @GetMapping(value = "/record") - @Authorization - public BusiResult> record(Integer pageNum, Integer pageSize) { - if (pageNum == null || pageNum < 1) { - pageNum = 1; - } - if (pageSize == null || pageSize < 1) { - pageSize = 1; - } - return new BusiResult<>(giftCompoundRecordService.getRecordByUid(getUid(), pageNum, pageSize)); - } - - @ApiOperation("轮播展示合成记录") - @GetMapping(value = "/record/top") - public BusiResult> recordTop() { - return new BusiResult<>(giftCompoundRecordService.getTopRecord()); - } - -} diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/anchor/AnchorFansTeamController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/anchor/AnchorFansTeamController.java deleted file mode 100644 index b2c78ccb6..000000000 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/anchor/AnchorFansTeamController.java +++ /dev/null @@ -1,182 +0,0 @@ -package com.accompany.business.controller.anchor; - -import com.accompany.business.annotation.CancelUidTag; -import com.accompany.business.common.BaseController; -import com.accompany.business.service.anchor.AnchorFansTeamService; -import com.accompany.business.service.netease.YidunCheckUtil; -import com.accompany.business.vo.anchor.*; -import com.accompany.common.annotation.Authorization; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.util.StringUtils; -import com.google.common.util.concurrent.RateLimiter; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; -import java.util.concurrent.TimeUnit; - -/** - * 主播粉丝团 - */ -@RestController -@Slf4j -@Api(tags = "主播粉丝团",value = "主播粉丝团") -@RequestMapping("/anchorFansTeam") -public class AnchorFansTeamController extends BaseController { - - @Autowired - private AnchorFansTeamService anchorFansTeamService; - - private RateLimiter sendAllLimiter = RateLimiter.create(1500.0); // 1秒1500并发 - - - @ApiOperation("进房初始化当前用户与房间粉丝团关系") - @Authorization - @GetMapping(value="/initInRoomFansTeam") - @ApiImplicitParams({ - @ApiImplicitParam(name = "teamUid", value = "粉丝团uid", required = true, dataType = "Integer", paramType = "query"), - }) - public BusiResult initInRoomFansTeam(Long teamUid){ - Long uid = getUid(); - return new BusiResult<>(anchorFansTeamService.initInRoomFansTeam(teamUid,uid)); - } - - @ApiOperation("获取可申请的特权粉丝铭牌") - @Authorization - @GetMapping(value="/getApplyPrivilegeFansMpVoList") - public BusiResult> getApplyFansTeamMpList() { - return new BusiResult<>(anchorFansTeamService.getApplyPrivilegeFansMpVoList()); - } - - @ApiOperation("开通粉丝团 申请粉丝团铭牌") - @Authorization - @PostMapping(value="/applyFansTeamMp") - @ApiImplicitParams({ - @ApiImplicitParam(name = "privilegeId", value = "特权id", required = true, dataType = "Integer", paramType = "query"), - @ApiImplicitParam(name = "mpTx", value = "申请粉丝铭牌文案", required = true, dataType = "String", paramType = "query") - }) - public BusiResult applyFansTeamMp(Integer privilegeId, String mpTx){ - Long uid = getUid(); - anchorFansTeamService.applyFansTeamMp(uid,privilegeId,mpTx); - return new BusiResult(BusiStatus.SUCCESS); - } - - @ApiOperation("开通粉丝团 粉丝团申请记录") - @Authorization - @GetMapping(value="/getApplyRecordList") - public BusiResult> getApplyRecordList(){ - Long uid = getUid(); - return new BusiResult<>(anchorFansTeamService.getApplyRecordList(uid)); - } - - - @ApiOperation("我的粉丝团列表") - @Authorization - @GetMapping(value="/getJoinFansTeamList") - public BusiResult> applyFansTeam(){ - Long uid = getUid(); - return new BusiResult<>(anchorFansTeamService.getJoinFansTeamList(uid)); - } - - @ApiOperation("加入粉丝团 --弹窗内容") - @Authorization - @GetMapping(value="/applyFansTeamPopInfoVo") - @ApiImplicitParams({ - @ApiImplicitParam(name = "teamUid", value = "粉丝团主播uid", required = true, dataType = "Long", paramType = "query"), - }) - public BusiResult applyFansTeamPopInfoVo(Long teamUid){ - Long memberUid = getUid(); - return new BusiResult<>(anchorFansTeamService.applyFansTeamPopInfoVo(teamUid,memberUid)); - } - - @ApiOperation("退出粉丝团") - @Authorization - @GetMapping(value="/outAnchorFansTeam") - @ApiImplicitParams({ - @ApiImplicitParam(name = "teamUid", value = "粉丝团主播uid", required = true, dataType = "Long", paramType = "query"), - }) - public BusiResult outAnchorFansTeam(Long teamUid){ - Long memberUid = getUid(); - anchorFansTeamService.outAnchorFansTeam(teamUid,memberUid); - return new BusiResult<>(BusiStatus.SUCCESS); - } - - @ApiOperation("粉丝团任务列表") - @Authorization - @GetMapping(value="/getFansTaskInfo") - @ApiImplicitParams({ - @ApiImplicitParam(name = "teamUid", value = "粉丝团主播uid", required = true, dataType = "Long", paramType = "query"), - }) - public BusiResult getFansTaskList(Long teamUid){ - Long memberUid = getUid(); - return new BusiResult<>(anchorFansTeamService.getFansTaskInfo(teamUid,memberUid)); - } - - @ApiOperation("主播视角 我的粉丝") - @Authorization - @GetMapping(value="/getFansMemberVoList") - @ApiImplicitParams({ - @ApiImplicitParam(name = "teamUid", value = "粉丝团主播uid", required = true, dataType = "Long", paramType = "query"), - }) - public BusiResult> getFansMemberVoList(@RequestParam(defaultValue = "20")Integer pageSize, @RequestParam(defaultValue = "1")Integer pageNum){ - Long uid = getUid(); - return new BusiResult<>(anchorFansTeamService.getFansMemberVoList(uid,pageNum,pageSize)); - } - - - @ApiOperation("粉丝榜") - @Authorization - @GetMapping(value="/getFansMemberRankVo") - @ApiImplicitParams({ - @ApiImplicitParam(name = "teamUid", value = "粉丝团主播uid", required = true, dataType = "Long", paramType = "query"), - @ApiImplicitParam(name = "pageSize", value = "粉丝团主播uid", required = true, dataType = "Integer", paramType = "query"), - @ApiImplicitParam(name = "pageNum", value = "粉丝团主播uid", required = true, dataType = "Integer", paramType = "query"), - }) - public BusiResult getFansMemberRankVo(Long teamUid, @RequestParam(defaultValue = "20")Integer pageSize, @RequestParam(defaultValue = "1")Integer pageNum){ - Long memberUid = getUid(); - return new BusiResult<>(anchorFansTeamService.getFansMemberRankVo(teamUid,memberUid,pageNum,pageSize)); - } - - @ApiOperation("加入粉丝团 送入团礼物接口") - @Authorization - @PostMapping(value="/sendJoinTeamGift") - @CancelUidTag(paramName = {"targetUids"}) - public BusiResult sendJoinTeamGift(@RequestParam(value = "targetUids") Long[] targetUids - , Long roomUid, int giftId, int giftNum, byte sendType, String msg, byte giftSource,String chatSessionId) { - Long sendUid = getUid(); - log.info("sendJoinTeamGift param==>>> uid:{},targetUids:{},roomUid:{},giftId:{},giftNum:{},sendType:{},giftSource:{}", - sendUid, targetUids, roomUid, giftId, giftNum, sendType, giftSource); - if (giftNum <= 0 || targetUids == null || targetUids.length != 1) { - return new BusiResult(BusiStatus.BUSIERROR); - } - if (giftNum > 1) { - return new BusiResult(BusiStatus.SEND_GIFT_NUM_TOO_LARGE); - } - // 对接口限流 - if (!sendAllLimiter.tryAcquire(5, TimeUnit.SECONDS)) { - return new BusiResult(BusiStatus.SERVERBUSY); - } - if (StringUtils.isNotBlank(msg) && YidunCheckUtil.checkHasSensitiveWord(msg)) { - return new BusiResult(BusiStatus.HAS_SENSITIVE, "当前内容不符合规范,请修改后重试哦~", null); - } - - try { - return new BusiResult(anchorFansTeamService.sendJoinTeamGift(sendUid, targetUids, roomUid, giftId, giftNum, msg, giftSource, sendType)); - } catch (ServiceException s){ - return new BusiResult(s.getBusiStatus(), s.getMessage(), null); - }catch (Exception e){ - log.error("sendV4 error param==>>> uid:{},targetUids:{},roomUid:{},giftId:{},giftNum:{},sendType:{},giftSource:{}", - sendUid, targetUids, roomUid, giftId, giftNum, sendType, giftSource,e); - return new BusiResult(BusiStatus.BUSIERROR); - } - } - - -} diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/audiocard/AudioCardController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/audiocard/AudioCardController.java deleted file mode 100644 index c43be6b2f..000000000 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/audiocard/AudioCardController.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.accompany.business.controller.audiocard; - -import com.accompany.business.common.BaseController; -import com.accompany.business.service.audiocard.AudioCardService; -import com.accompany.common.annotation.Authorization; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.vo.audiocard.UserAudioCardVo; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -@Slf4j -@RestController -@RequestMapping("/audioCard") -public class AudioCardController extends BaseController { - - @Autowired - private AudioCardService audioCardService; - - @GetMapping("/get") - @Authorization - public BusiResult get(Long uid){ - if (null == uid){ - throw new ServiceException(BusiStatus.PARAMERROR); - } - Long me = getUid(); - UserAudioCardVo vo = audioCardService.getVo(me, uid); - return new BusiResult<>(vo); - } - - @PostMapping("/save") - @Authorization - public BusiResult save(UserAudioCardVo vo){ - if (null == vo){ - throw new ServiceException(BusiStatus.PARAMERROR); - } - Long me = getUid(); - audioCardService.save(me, vo); - return new BusiResult<>(BusiStatus.SUCCESS); - } - - @PostMapping("/del") - @Authorization - public BusiResult del(){ - Long me = getUid(); - audioCardService.del(me); - return new BusiResult<>(BusiStatus.SUCCESS); - } - -} diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/charge/LuckyTarotChargeController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/charge/LuckyTarotChargeController.java deleted file mode 100644 index d49f1ff50..000000000 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/charge/LuckyTarotChargeController.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.accompany.business.controller.charge; - -import com.accompany.business.common.BaseController; -import com.accompany.business.service.charge.LuckyTarotChargeService; -import com.accompany.common.annotation.Authorization; -import com.accompany.common.constant.Constant; -import com.accompany.common.device.DeviceInfo; -import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.AppVersionUtil; -import com.accompany.common.utils.IPUtils; -import com.accompany.common.utils.StringUtils; -import com.accompany.core.vo.BaseRequestVO; -import com.accompany.core.vo.BaseResponseVO; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; - -/** - * @Author: yangming - * @Date: 2019/11/4 17:10 - * @Description: 幸运塔罗充值 - **/ -@RestController -@RequestMapping("lucky/tarot") -@Slf4j -public class LuckyTarotChargeController extends BaseController { - - @Autowired - private LuckyTarotChargeService luckyTarotChargeService; - - /** - * 塔罗充值接口 - * @param request - * @param uid - * @param roomUid - * @param cardList - * @param chargeProdId - * @return - * @throws Exception - */ - @PostMapping("/charge") - @Authorization - public BaseResponseVO tarotCharge(HttpServletRequest request, Long uid, Long roomUid, String cardList, - String chargeProdId, String successUrl) throws Exception{ - BaseRequestVO baseRequestVO = new BaseRequestVO(); - uid = baseRequestVO.getMyUserId(); - if(uid == null || StringUtils.isBlank(cardList) || StringUtils.isBlank(chargeProdId)){ - return new BaseResponseVO(BusiStatus.PARAMERROR); - } - DeviceInfo deviceInfo = getDeviceInfo(request); - String appVersion = deviceInfo.getAppVersion(); - if (AppVersionUtil.compareVersion(Constant.LUCKY_TAROT_LIMIT_APP_VERSION, appVersion) > 0) { - return new BaseResponseVO(BusiStatus.VERSIONTOLOW); - } - String clientIp = IPUtils.getRealIpAddress(request); - luckyTarotChargeService.checkLuckyTarotIsOpen(); - return luckyTarotChargeService.tarotCharge(uid,roomUid,cardList,chargeProdId, - Constant.ChargeChannel.lucky_tarot,clientIp, successUrl, deviceInfo); - } - - /** - * 默认获取最新的二十条中奖记录 - * @param count - * @return - */ - @GetMapping("/draw/list") - @Authorization - public BaseResponseVO getDrawList(@RequestParam(defaultValue = "20") Integer count){ - luckyTarotChargeService.checkLuckyTarotIsOpen(); - return luckyTarotChargeService.getDrawList(count); - } - - /** - * 获取中奖结果 - * @param uid - * @param chargeRecordId - * @return - */ - @PostMapping("/draw/status") - @Authorization - public BaseResponseVO getDrawResult(@RequestParam Long uid, @RequestParam String chargeRecordId){ - BaseRequestVO baseRequestVO = new BaseRequestVO(); - uid = baseRequestVO.getMyUserId(); - luckyTarotChargeService.checkLuckyTarotIsOpen(); - return luckyTarotChargeService.getDrawResult(uid,chargeRecordId); - } - - /** - * 获取用户充值记录 - * @param uid - * @param page - * @param pageSize - * @return - */ - @GetMapping("/user/record") - @Authorization - public BaseResponseVO getUserDrawRecord(@RequestParam Long uid, @RequestParam(defaultValue = "1") Integer page, - @RequestParam(defaultValue = "10") Integer pageSize){ - BaseRequestVO baseRequestVO = new BaseRequestVO(); - uid = baseRequestVO.getMyUserId(); - luckyTarotChargeService.checkLuckyTarotIsOpen(); - return luckyTarotChargeService.getUserDrawRecord(uid,page,pageSize); - } - - @GetMapping("headwear") - @Authorization - public BaseResponseVO getTarotHeadwear(){ - luckyTarotChargeService.checkLuckyTarotIsOpen(); - return luckyTarotChargeService.getTarotHeadwear(); - } -} diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/charge/RedeemCodeController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/charge/RedeemCodeController.java deleted file mode 100644 index ede9508b2..000000000 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/charge/RedeemCodeController.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.accompany.business.controller.charge; - -import com.accompany.business.common.BaseController; -import com.accompany.business.model.RedeemCode; -import com.accompany.business.service.charge.RedeemCodeService; -import com.accompany.common.annotation.Authorization; -import com.accompany.common.device.DeviceInfo; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.BlankUtil; -import com.accompany.common.utils.DateTimeUtil; -import com.accompany.common.utils.IPUtils; -import com.accompany.core.service.common.JedisService; -import com.google.common.collect.Lists; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; - -import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.List; - -/** - * - * 兑换码 - * - */ -@Controller -@RequestMapping("/redeemcode") -public class RedeemCodeController extends BaseController { - private static final Logger logger = LoggerFactory.getLogger(RedeemCodeController.class); - - @Autowired - private RedeemCodeService redeemCodeService; - @Autowired - private JedisService jedisService; - - /** - * 使用兑换码 - * - * @param code 兑换码 - * @param uid 兑换用户UID - * @param deviceInfo 客户端设备信息 - * @return - */ - @RequestMapping(value = "/use") - @ResponseBody - @Authorization - public BusiResult useRedeemCode(HttpServletRequest request, String code, Long uid, DeviceInfo deviceInfo) { - if (BlankUtil.isBlank(code) || code.length() > 20 || uid == null) { - return new BusiResult(BusiStatus.PARAMETERILLEGAL); - } - - // 限制同一IP的访问次数 - String clientIp = IPUtils.getRealIpAddress(request); - String ipCountKey = RedisKey.redeem_code_ip.getKey(DateTimeUtil.getTodayStr() + "_" + clientIp); - Long ipCount = jedisService.incr(ipCountKey); - if (ipCount != null && ipCount > 1000) { - return new BusiResult(BusiStatus.NOAUTHORITY, "系统检测到您兑换操作太频繁,将停止您的兑换码充值功能", null); - } - - // 判断用户是否存在 - if (!redeemCodeService.isExistUser(uid)) { - return new BusiResult(BusiStatus.USERNOTEXISTS); - } - - // 限制输入的错误次数 - String inputKey = RedisKey.redeem_code_input.getKey(DateTimeUtil.getTodayStr() + "_" + uid.toString()); - String inputCount = jedisService.read(inputKey); - int errorCount = 0; // 输入的错误次数 - if (!BlankUtil.isBlank(inputCount)) { - errorCount = Integer.valueOf(inputCount); - if (errorCount >= 5) { - return new BusiResult(BusiStatus.NOAUTHORITY, "对不起,您今天已累计5次输入有误,系统将停止您的兑换码充值功能", null); - } - } - return redeemCodeService.useRedeemCode(code,uid,clientIp,deviceInfo,inputKey); - } - - - /** - * 生成兑换码 - * - * @param num 指定生成的数量 - * @return - */ - @RequestMapping(value = "/gener") - @ResponseBody - public BusiResult generRedeemCode(Integer num, long amount, Integer len) { - BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS); - if (num == null || num < 1) { - num = 10; - } - if (len == null || len < 8) { - len = 16; - } - - // 用于存储生成的兑换码 - List codes = Lists.newArrayList(); - int tmp = 0; - while (tmp < num) { - RedeemCode redeemCode = new RedeemCode(); - redeemCode.setCode(redeemCodeService.buildRandomCode(len)); - redeemCode.setAmount(amount); - redeemCode.setUseStatus(1); - redeemCode.setCreateTime(new Date()); - int result = redeemCodeService.insertRedeemCode(redeemCode); - if (result == 1) { - tmp++; - codes.add(redeemCode.getCode()); - } - } -// busiResult.setData(codes); - return busiResult; - } - -} diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/dealer/DealerController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/dealer/DealerController.java deleted file mode 100644 index 27bce26e1..000000000 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/dealer/DealerController.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.accompany.business.controller.dealer; - -import com.accompany.business.service.dealer.DealerService; -import com.accompany.business.vo.dealer.*; -import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.IPUtils; -import com.google.common.util.concurrent.RateLimiter; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; -import java.util.concurrent.TimeUnit; - -@RequestMapping("/dealer") -@RestController -public class DealerController { - - @Autowired - private DealerService dealerService; - - private final RateLimiter certificationLimit = RateLimiter.create(200); - - @GetMapping("/account") - public DealerResponse accountInfo(String secretKey, HttpServletRequest request) { - if (!certificationLimit.tryAcquire(5, TimeUnit.SECONDS)) { - return new DealerResponse(BusiStatus.SERVERBUSY.getCode(), BusiStatus.SERVERBUSY.getReasonPhrase()); - } - String ipAddress = IPUtils.getRealIpAddress(request); - DealerConfigVO dealerConfigVO = dealerService.getConfigVo(secretKey); - DealerResponse dealerResponse = dealerService.checkParam(secretKey, ipAddress, null, dealerConfigVO); - if (dealerResponse.getCode() != DealerBusiStatus.SUCCESS.getCode()) { - return dealerResponse; - } - dealerService.accountInfo(dealerResponse, dealerConfigVO); - return dealerResponse; - } - - @GetMapping("/user-info") - public DealerResponse userInfo(String secretKey, Long userId, HttpServletRequest request) { - if (!certificationLimit.tryAcquire(5, TimeUnit.SECONDS)) { - return new DealerResponse(BusiStatus.SERVERBUSY.getCode(), BusiStatus.SERVERBUSY.getReasonPhrase()); - } - String ipAddress = IPUtils.getRealIpAddress(request); - DealerConfigVO dealerConfigVO = dealerService.getConfigVo(secretKey); - DealerResponse dealerResponse = dealerService.checkParam(secretKey, ipAddress, userId, dealerConfigVO); - if (dealerResponse.getCode() != DealerBusiStatus.SUCCESS.getCode()) { - return dealerResponse; - } - return dealerService.userInfo(userId); - } - - @PostMapping("/sale") - public DealerResponse buy(DealerSaleRequestVO dealerSaleRequestVO, HttpServletRequest request) { - if (!certificationLimit.tryAcquire(5, TimeUnit.SECONDS)) { - return new DealerResponse(BusiStatus.SERVERBUSY.getCode(), BusiStatus.SERVERBUSY.getReasonPhrase()); - } - String ipAddress = IPUtils.getRealIpAddress(request); - DealerConfigVO dealerConfigVO = dealerService.getConfigVo(dealerSaleRequestVO.getSecretKey()); - DealerResponse dealerResponse = dealerService.checkParam(dealerSaleRequestVO.getSecretKey(), ipAddress, dealerSaleRequestVO.getToUserId(), dealerConfigVO); - if (dealerResponse.getCode() != DealerBusiStatus.SUCCESS.getCode()) { - return dealerResponse; - } - return dealerService.sale(dealerSaleRequestVO.getToUserId(), dealerSaleRequestVO.getCoins(), dealerConfigVO); - } - - @GetMapping("/list") - public DealerResponse> list(String secretKey, Integer page, HttpServletRequest request) { - if (!certificationLimit.tryAcquire(5, TimeUnit.SECONDS)) { - return new DealerResponse(BusiStatus.SERVERBUSY.getCode(), BusiStatus.SERVERBUSY.getReasonPhrase()); - } - String ipAddress = IPUtils.getRealIpAddress(request); - DealerConfigVO dealerConfigVO = dealerService.getConfigVo(secretKey); - DealerResponse dealerResponse = dealerService.checkParam(secretKey, ipAddress, null, dealerConfigVO); - if (dealerResponse.getCode() != DealerBusiStatus.SUCCESS.getCode()) { - return dealerResponse; - } - return dealerService.list(page, dealerConfigVO); - } - -} diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/linearlypool/LinearlyPoolController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/linearlypool/LinearlyPoolController.java deleted file mode 100644 index a8eab5241..000000000 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/linearlypool/LinearlyPoolController.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.accompany.business.controller.linearlypool; - -import com.accompany.business.common.BaseController; -import com.accompany.business.constant.activities.ActivitesPackTypeEnum; -import com.accompany.business.model.ActivityPack; -import com.accompany.business.model.user.UserActPropertyInfoV2; -import com.accompany.business.service.activity.ActivityPackService; -import com.accompany.business.service.linearlypool.LinearlyPrizePoolService; -import com.accompany.business.service.purse.UserPurseService; -import com.accompany.business.service.user.UserActPropertyInfoV2Service; -import com.accompany.business.vo.PrizeWithRateVo; -import com.accompany.business.vo.linearlypool.DrawPageResultVO; -import com.accompany.business.vo.linearlypool.DrawResultVO; -import com.accompany.business.vo.linearlypool.UserKeyPageVO; -import com.accompany.business.vo.openbox.DrawPrizeItemVo; -import com.accompany.common.annotation.Authorization; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.vo.BaseResponseVO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * 线性坚持 - */ -@Api(tags = "拔萝卜", value = "拔萝卜") -@RestController -@RequestMapping("/linearlyPool") -public class LinearlyPoolController extends BaseController { - - @Autowired - private LinearlyPrizePoolService linearlyPrizePoolService; - @Autowired - private UserPurseService userPurseService; - @Autowired - private ActivityPackService activityPackService; - @Autowired - private UserActPropertyInfoV2Service userActPropertyInfoV2Service; - - private final int MAX_KEY_NUM = 200; - - @ApiOperation("获取活动礼包列表") - @RequestMapping(value = "/listPack", method = RequestMethod.GET) - public BaseResponseVO> listPack() { - return new BaseResponseVO<>(BusiStatus.SUCCESS, activityPackService.getPackListByType(ActivitesPackTypeEnum.SHIP_ANTICS.getValue().byteValue())); - } - - @ApiOperation("获取奖池内的所有奖品(带概率)") - @GetMapping(value = "prizes/withRate") - public BusiResult prizesWithRate() { - List prizeWithRateVos = linearlyPrizePoolService.listPrizeWithRate(); - return new BusiResult(BusiStatus.SUCCESS, prizeWithRateVos); - } - - @ApiOperation("抽奖") - @PostMapping(value = "draw") - @Authorization - public BusiResult draw(@RequestParam("sendMessage")Boolean sendMessage, - @RequestParam("roomUid")Long roomUid, - @RequestParam("keyNum")Integer keyNum, String deviceId) { - Long uid = getUid(); - if (keyNum <= 0) throw new ServiceException(BusiStatus.KEY_NUM_ERR); - if (keyNum > MAX_KEY_NUM) throw new ServiceException(BusiStatus.KEY_NUM_BEYOND_NUM); - DrawResultVO drawResultVO = linearlyPrizePoolService.draw(uid, roomUid, sendMessage, keyNum, deviceId); - DrawPageResultVO res = DrawPageResultVO.builder() - .prizeItemList(drawResultVO.getPrizeItemVoList()) - .remainKeyNum(drawResultVO.getRemainKeyNum()) - .specialStatus(drawResultVO.getSpecialStatus()) - .goldNum(userPurseService.queryUserPurse(uid).getDiamonds()) - .build(); - return new BusiResult(res); - } - - @ApiOperation("获取用户抽奖消耗道具数量") - @GetMapping(value = "userkey") - @Authorization - public BusiResult useKeys() { - Long uid = getUid(); - Long keyNum = 0L; - UserActPropertyInfoV2 userActPropertyInfo = userActPropertyInfoV2Service.getUserActPropertyInfo(uid, ActivitesPackTypeEnum.SHIP_ANTICS.getValue()); - if (userActPropertyInfo != null) { - keyNum = userActPropertyInfo.getPieceNum(); - } - - Double diamondNum = userPurseService.queryUserPurse(uid).getDiamonds(); - UserKeyPageVO res = UserKeyPageVO.builder() - .goldNum(diamondNum) - .keyNum(keyNum) - .build(); - return new BusiResult(BusiStatus.SUCCESS, res); - } - - @ApiOperation("获取用户中奖记录") - @GetMapping(value = "drawrecord") - public BusiResult drawRecord(@RequestParam("uid")Long uid, - @RequestParam("sortType")String sortType, - @RequestParam(value = "page", defaultValue = "1")Integer page, - @RequestParam(value = "pageSize",defaultValue = "50")Integer pageSize) { - List drawPrizeItemVos = linearlyPrizePoolService.listUserDrawRecordByPage(uid, sortType, page, pageSize); - return new BusiResult(BusiStatus.SUCCESS, drawPrizeItemVos); - } -} diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/linearlypool/LinearlyPoolRankingController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/linearlypool/LinearlyPoolRankingController.java deleted file mode 100644 index 4e7e308a9..000000000 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/linearlypool/LinearlyPoolRankingController.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.accompany.business.controller.linearlypool; - -import com.accompany.business.service.linearlypool.LinearlyPrizePoolRankService; -import com.accompany.business.vo.linearlypool.LinearlyPoolRankParentVo; -import com.accompany.common.annotation.Authorization; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.DateTimeUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import java.util.Date; - -/** - * 开箱子排行榜接口 - */ -@Api(tags = "拔萝卜", value = "拔萝卜排行榜") -@RestController -@RequestMapping("/linearlyPool") -public class LinearlyPoolRankingController { - @Autowired - private LinearlyPrizePoolRankService rankService; - - - /** - * 排行榜列表 - * @param datetype 1、今日 2、昨日 - * @return - */ - @ApiOperation("氪金排行榜") - @Authorization - @GetMapping("rankings") - public BusiResult rankings(@RequestParam("datetype") Byte datetype, - @RequestParam(value = "page", defaultValue = "1") Integer page, - @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { - BusiResult result = new BusiResult(BusiStatus.SUCCESS); - //默认查看今天的榜单 - Date date = new Date(); - if(datetype == 2){ - date = DateTimeUtil.getLastDay(date,1); - } - String keySuffix = DateTimeUtil.convertDate(date, DateTimeUtil.DEFAULT_DATE_PATTERN_); - String key = RedisKey.linearly_pool_krypton_rank.getKey(keySuffix); - LinearlyPoolRankParentVo boxParentRankVo = rankService.ranking(key, page, pageSize); - result.setData(boxParentRankVo); - return result; - } -} diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/room/RoomController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/room/RoomController.java index a5157e498..3d36fe3f7 100644 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/room/RoomController.java +++ b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/room/RoomController.java @@ -17,7 +17,6 @@ import com.accompany.business.service.live.LiveAttestationService; import com.accompany.business.service.redenvelope.RedEnvelopeService; import com.accompany.business.service.room.*; import com.accompany.business.service.roomalbum.RoomAlbumService; -import com.accompany.business.service.treasure.SeizeTreasureShardService; import com.accompany.business.service.user.UserBlackRecordService; import com.accompany.business.service.user.UsersService; import com.accompany.business.vo.RoomVo; @@ -87,8 +86,6 @@ public class RoomController extends BaseController { @Autowired private RoomAlbumService roomAlbumService; @Autowired - private SeizeTreasureShardService seizeTreasureShardService; - @Autowired private RoomManageService roomManageService; @Autowired private RoomRightBottomIconService roomRightBottomIconService; @@ -244,7 +241,6 @@ public class RoomController extends BaseController { roomVo.setShowPkBeginTime(crossRoomPkBeginTime != null); roomVo.setPkBeginTime(crossRoomPkBeginTime); roomVo.setHasRoomAlbum(roomAlbumService.hasRoomAlbum(uid, pubUid)); - roomVo.setSeizeTreasureSwitchVo(seizeTreasureShardService.getConfig()); roomVo.setRightBottomIconConfig(roomRightBottomIconService.getConfig(uid)); Users users = usersService.getUsersByUid(uid); RoomLevelInfo roomLevelInfo = roomLevelService.getRoomLevelByRoomUid(users.getPartitionId(), uid); diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/room/RoomTagController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/room/RoomTagController.java index 0151e1625..deb4b53b8 100644 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/room/RoomTagController.java +++ b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/room/RoomTagController.java @@ -2,7 +2,6 @@ package com.accompany.business.controller.room; import com.accompany.business.common.BaseController; import com.accompany.business.model.RoomTag; -import com.accompany.business.service.AppVersionService; import com.accompany.business.service.room.RoomService; import com.accompany.business.service.room.RoomTagService; import com.accompany.common.result.BusiResult; @@ -28,8 +27,6 @@ public class RoomTagController extends BaseController { @Autowired private RoomTagService roomTagService; @Autowired - AppVersionService appVersionService; - @Autowired RoomService roomService; /** diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/room/RoomTagV3Controller.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/room/RoomTagV3Controller.java index 2bff3831d..ae90da7f0 100644 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/room/RoomTagV3Controller.java +++ b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/room/RoomTagV3Controller.java @@ -2,8 +2,6 @@ package com.accompany.business.controller.room; import com.accompany.business.common.BaseController; import com.accompany.business.model.RoomTag; -import com.accompany.business.service.AppVersionService; -import com.accompany.business.service.room.RoomService; import com.accompany.business.service.room.RoomTagService; import com.accompany.common.result.BusiResult; import com.accompany.common.status.BusiStatus; @@ -27,10 +25,6 @@ public class RoomTagV3Controller extends BaseController { @Autowired private RoomTagService roomTagService; - @Autowired - AppVersionService appVersionService; - @Autowired - RoomService roomService; /** * 顶部标签 diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/treasure/SeizeTreasureController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/treasure/SeizeTreasureController.java deleted file mode 100644 index e2c4fe874..000000000 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/treasure/SeizeTreasureController.java +++ /dev/null @@ -1,359 +0,0 @@ -package com.accompany.business.controller.treasure; - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.NumberUtil; -import com.accompany.business.common.BaseController; -import com.accompany.business.constant.activities.ActivitesPackTypeEnum; -import com.accompany.business.enums.resource.ResourceCodeEnum; -import com.accompany.business.enums.resource.RuleCodeEnum; -import com.accompany.business.model.ActivityPack; -import com.accompany.business.model.resource.Resource; -import com.accompany.business.service.activity.ActivityPackService; -import com.accompany.business.service.resource.ResourceService; -import com.accompany.business.service.treasure.SeizeTreasureService; -import com.accompany.business.vo.treasure.SeizeTreasurePoolItemVo; -import com.accompany.business.vo.treasure.SeizeTreasureStatus; -import com.accompany.business.vo.treasure.compound.SeizeTreasureElfCompoundRecordVo; -import com.accompany.business.vo.treasure.compound.SeizeTreasureElfCompoundReq; -import com.accompany.business.vo.treasure.convert.SeizeTreasureConvertRecordVo; -import com.accompany.business.vo.treasure.convert.SeizeTreasureCovertItemVo; -import com.accompany.business.vo.treasure.elf.SeizeTreasureElfRecordVo; -import com.accompany.business.vo.treasure.elf.SeizeTreasureElfVo; -import com.accompany.business.vo.treasure.rank.SeizeTreasureRankVo; -import com.accompany.business.vo.treasure.record.SeizeTreasurePoolDrawRecordVo; -import com.accompany.business.vo.treasure.reward.SeizeTreasurePoolRewardVo; -import com.accompany.business.vo.treasure.reward.SeizeTreasureRewardBaseVo; -import com.accompany.business.vo.treasure.salvage.SeizeTreasureElfSalvageRecordVo; -import com.accompany.business.vo.treasure.salvage.SeizeTreasureElfSalvageReq; -import com.accompany.business.vo.treasure.userinfo.SeizeTreasureUserDrawInfo; -import com.accompany.business.vo.treasure.userinfo.SeizeTreasureUserElfInfo; -import com.accompany.business.vo.treasure.userinfo.SeizeTreasureUserForestInfo; -import com.accompany.business.vo.treasure.userinfo.SeizeTreasureUserInfo; -import com.accompany.common.annotation.Authorization; -import com.accompany.common.constant.SeizeTreasureConstant; -import com.accompany.common.model.PageReq; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import com.accompany.core.exception.ServiceException; -import com.alibaba.fastjson.JSONObject; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.*; - -import java.io.IOException; -import java.time.LocalDate; -import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.stream.Collectors; - -@RestController -@Api(tags = "夺宝精灵") -@RequestMapping("/act/seize-treasure") -public class SeizeTreasureController extends BaseController { - @Autowired - private SeizeTreasureService seizeTreasureService; - - @Autowired - private ActivityPackService activityPackService; - - @Autowired - private ResourceService resourceService; - - public static final List DRAW_NUM_LIST = Arrays.asList(1, 10, 100); - public static final List FOREST_DRAW_NUM_LIST = Arrays.asList(1, 10); - public static final List POOL_LEVEL_LIST = Arrays.asList(1, 2, 3); - - @Authorization - @ApiOperation("夺宝-礼包列表") - @GetMapping("pack/list") - public BusiResult> getPackList() { - return new BusiResult<>(activityPackService.getPackListByType(ActivitesPackTypeEnum.SEIZE_TREASURE_TICKET.getValue().byteValue())); - } - - @Authorization - @ApiOperation("夺宝-奖励列表") - @ApiImplicitParam(name = "orderType", value = "排序方式 1:奖池order升序;2:礼物价值降序", allowableValues = "1,2", defaultValue = "1", required = false) - @GetMapping("draw/pool/list") - public BusiResult> getTreasurePoolList(Integer orderType) { - List poolItemList = seizeTreasureService.getPoolItemList(SeizeTreasureConstant.PoolType.TREASURE, null, null); - List resultList = null == orderType || SeizeTreasureConstant.OrderType.POOL.equals(orderType) ? - poolItemList : poolItemList.stream().sorted(Comparator.comparingInt(SeizeTreasurePoolItemVo::getRewardShowValue).reversed()).collect(Collectors.toList()); - return new BusiResult<>(resultList); - } - - @Authorization - @ApiOperation("夺宝-用户信息") - @GetMapping("/user/draw/info") - public BusiResult getUserDrawInfo() { - return new BusiResult<>(seizeTreasureService.getUserDrawInfo(getUid())); - } - - /** - * 夺宝-抽奖 - * - * @param roomUid - * @param drawNum - * @return - * @throws IOException - */ - @Authorization - @ApiOperation("夺宝-抽奖") - @ApiImplicitParams({ - @ApiImplicitParam(name = "roomUid", value = "房间UID", required = true), - @ApiImplicitParam(name = "drawNum", value = "抽奖次数", allowableValues = "1,10,100", required = true), - }) - @PostMapping("/draw") - public BusiResult> draw(Long roomUid, Integer drawNum) throws IOException { - if (!DRAW_NUM_LIST.contains(drawNum)) { - throw new ServiceException(BusiStatus.PARAMETERILLEGAL); - } - return new BusiResult<>(seizeTreasureService.treasureDraw(getUid(), roomUid, drawNum)); - } - - @Authorization - @ApiOperation("夺宝-抽奖记录") - @GetMapping("/draw/record") - public BusiResult> getDrawRecordList(PageReq pageReq) { - return new BusiResult<>( - seizeTreasureService.getDrawRecordList( - getUid(), - Arrays.asList(SeizeTreasureConstant.PoolType.TREASURE, SeizeTreasureConstant.PoolType.TREASURE_DRAW_NUM), - pageReq)); - } - - @Authorization - @ApiOperation("猛犸森林-用户信息") - @GetMapping("/user/forest/info") - public BusiResult getUserForestInfo() { - return new BusiResult<>(seizeTreasureService.getUserForestInfo(getUid())); - } - - @Authorization - @ApiOperation("猛犸森林-抽奖") - @ApiImplicitParams({ - @ApiImplicitParam(name = "poolLevel", value = "奖池类型 1:初级;2:中级;3:高级;", required = true), - @ApiImplicitParam(name = "drawNum", value = "抽奖次数", allowableValues = "1,10", required = true) - }) - @PostMapping("/forest/draw") - public BusiResult> forestDraw(Integer poolLevel, Integer drawNum) throws IOException { - if (!POOL_LEVEL_LIST.contains(poolLevel)) { - throw new ServiceException(BusiStatus.PARAMETERILLEGAL); - } - if (!FOREST_DRAW_NUM_LIST.contains(drawNum)) { - throw new ServiceException(BusiStatus.PARAMETERILLEGAL); - } - return new BusiResult<>(seizeTreasureService.forestDraw(getUid(), poolLevel, drawNum)); - } - - @Authorization - @ApiOperation("猛犸森林-奖池奖励列表") - @ApiImplicitParam(name = "poolLevel", value = "奖池类型 1:初级;2:中级;3:高级;", required = true) - @GetMapping("draw/forest/item") - public BusiResult> getForestPoolItemList(Integer poolLevel) { - poolLevel = poolLevel == null ? 1 : poolLevel; - return new BusiResult<>(seizeTreasureService.getPoolItemList(SeizeTreasureConstant.PoolType.FOREST, null, poolLevel)); - } - - @Authorization - @ApiOperation("猛犸森林-抽奖记录") - @GetMapping("/forest/draw/record") - public BusiResult> getForestDrawRecordList(PageReq pageReq) { - return new BusiResult<>(seizeTreasureService.getDrawRecordList(getUid(), - Collections.singletonList(SeizeTreasureConstant.PoolType.FOREST), pageReq)); - } - - @Authorization - @ApiOperation("精灵-用户信息") - @GetMapping("/elf/user/info") - public BusiResult getUserElvesInfo() { - return new BusiResult<>(seizeTreasureService.getUserElvesInfo(getUid())); - } - - @Authorization - @ApiOperation("精灵-赠予") - @PostMapping("/elf/send") - public BusiResult sendElf(Long elfId, Long targetUid) { - seizeTreasureService.sendElf(getUid(), elfId, targetUid); - return new BusiResult<>(Boolean.TRUE); - } - - @Authorization - @ApiOperation("精灵-索要") - @PostMapping("/elf/askFor") - public BusiResult askForElf(Long elfId, Long targetUid) { - seizeTreasureService.askForElf(elfId, getUid(), targetUid); - return new BusiResult<>(Boolean.TRUE); - } - - @Authorization - @ApiOperation("精灵-赠予/获赠记录") - @GetMapping("/elf/record") - public BusiResult> getUserElfRecord(PageReq pageReq) { - return new BusiResult<>(seizeTreasureService.getUserElfRecord(getUid(), pageReq)); - } - - /** - * 精灵-试炼 - * - * @param compoundReqs - * @return - */ - @Authorization - @ApiOperation("精灵-试炼") - @PostMapping("/elf/compound") - public BusiResult compoundElf(@RequestBody SeizeTreasureElfCompoundReq compoundReqs) { - return new BusiResult<>(seizeTreasureService.compoundElf(getUid(), compoundReqs)); - } - - @Authorization - @ApiOperation("精灵-试炼记录") - @GetMapping("/elf/compound/record") - public BusiResult> getElfCompoundRecord(PageReq pageReq) { - return new BusiResult<>(seizeTreasureService.getElfCompoundRecord(getUid(), pageReq)); - } - - @Authorization - @ApiOperation("兑换-精灵召唤列表") - @GetMapping("/convert/elf/list") - public BusiResult> getElfConvertList() { - List convertItems = seizeTreasureService.getElfConvertList(); - if (CollectionUtil.isNotEmpty(convertItems)) { - for (SeizeTreasureCovertItemVo convertItem : convertItems) { - Integer rewardNum = convertItem.getRewardNum(); - Integer effectDay = convertItem.getEffectDay(); - if (effectDay == null || effectDay == 0) { - effectDay = 1; - } - convertItem.setRewardNum(rewardNum * effectDay); - } - } - return new BusiResult<>(convertItems); - } - - /** - * @return - */ - @Authorization - @ApiOperation("兑换-碎片兑换列表") - @GetMapping("/convert/chip/list") - public BusiResult> getChipConvertList() { - List convertItems = seizeTreasureService.getChipConvertList(); - if (CollectionUtil.isNotEmpty(convertItems)) { - for (SeizeTreasureCovertItemVo convertItem : convertItems) { - Integer rewardNum = convertItem.getRewardNum(); - Integer effectDay = convertItem.getEffectDay(); - if (effectDay == null || effectDay == 0) { - effectDay = 1; - } - convertItem.setRewardNum(rewardNum * effectDay); - } - } - return new BusiResult<>(convertItems); - } - - @Authorization - @ApiOperation("兑换-兑换") - @ApiImplicitParams({ - @ApiImplicitParam(name = "itemId", value = "兑换品ID", required = true), - @ApiImplicitParam(name = "roomUid", value = "房间UID", required = true), - @ApiImplicitParam(name = "propIdStr", value = "多个精灵ID(逗号拼接)"), - @ApiImplicitParam(name = "propNumStr", value = "精灵数量(与多个精灵ID一一对应)"), - }) - @PostMapping("/convert") - public BusiResult getChipConvertList(Long itemId, Long roomUid, String propIdStr, String propNumStr) { - return new BusiResult<>(seizeTreasureService.convert(getUid(), roomUid, itemId)); - } - - @Authorization - @ApiOperation("兑换-兑换记录") - @ApiImplicitParam(name = "convertType", value = "1:精灵召唤 2:碎片兑换", required = false) - @GetMapping("/convert/record") - public BusiResult> getConvertRecord(Integer convertType, PageReq pageReq) { - return new BusiResult<>(seizeTreasureService.getConvertRecord(getUid(), convertType, pageReq)); - } - - @Authorization - @ApiOperation("用户活动信息") - @GetMapping("/user/info") - public BusiResult getUserActInfo() { - return new BusiResult<>(seizeTreasureService.getUserInfo(getUid())); - } - - @Authorization - @ApiOperation("夺宝榜单") - @ApiImplicitParams({ - @ApiImplicitParam(name = "rankDateStr", value = "排行榜日期,默认当日", example = "2022-08-25", required = false), - @ApiImplicitParam(name = "rankNum", value = "排行榜条数,默认10", required = false), - @ApiImplicitParam(name = "showOrder", value = "排名展示最大值,默认30", required = false) - }) - @GetMapping("rank/value") - public BusiResult getValueRank(String rankDateStr, Integer rankNum, Integer showOrder) { - rankDateStr = StringUtils.hasText(rankDateStr) ? rankDateStr : LocalDate.now().toString(); - rankNum = (rankNum == null || rankNum == 0) ? 10 : rankNum; - showOrder = (showOrder == null || showOrder == 0) ? 30 : showOrder; - return new BusiResult<>(seizeTreasureService.getValueRank(getUid(), rankDateStr, rankNum, showOrder)); - } - - @Authorization - @ApiOperation("初始化奖池") - @GetMapping("/t/init/pool") - public BusiResult initPool() { - boolean contains = seizeTreasureService.getActConfig().getWhiteUidList().contains(getUid()); - if (contains) { - seizeTreasureService.initPool(); - } - return new BusiResult<>(contains); - } - - @Authorization - @ApiOperation("发送统计消息") - @GetMapping("/t/send/countMsg") - public BusiResult sendCountMsg() { - boolean contains = seizeTreasureService.getActConfig().getWhiteUidList().contains(getUid()); - if (contains) { - seizeTreasureService.hourCountMsg(); - } - return new BusiResult<>(contains); - } - - /** - * 活动状态 - * - * @return - */ - @Authorization - @ApiOperation("活动状态") - @GetMapping("/status") - public BusiResult getStatus() { - Resource resource = resourceService.getResource(ResourceCodeEnum.SEIZE_TREASURE.name()); - boolean isOpen = resource != null; - int userLevel = 3; - if (resource != null) { - String ruleValue = resource.getRuleValue(); - JSONObject jsonObject = JSONObject.parseObject(ruleValue); - if (jsonObject.containsKey(RuleCodeEnum.USER_LEVEL.name()) && NumberUtil.isNumber(jsonObject.getString(RuleCodeEnum.USER_LEVEL.name()))) { - userLevel = jsonObject.getInteger(RuleCodeEnum.USER_LEVEL.name()); - } - } - return BusiResult.success(new SeizeTreasureStatus(isOpen, userLevel)); - } - - /** - * 精灵-分解 - * - * @param salvageReq - * @return - */ - @Authorization - @ApiOperation("精灵-分解") - @PostMapping("/elf/salvage") - public BusiResult> elfSalvage(@RequestBody SeizeTreasureElfSalvageReq salvageReq) { - return BusiResult.success(seizeTreasureService.elfSalvage(getUid(), salvageReq)); - } -} diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/treasure/SeizeTreasureShardController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/treasure/SeizeTreasureShardController.java deleted file mode 100644 index 337d6358e..000000000 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/treasure/SeizeTreasureShardController.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.accompany.business.controller.treasure; - -import com.accompany.business.service.treasure.SeizeTreasureShardService; -import com.accompany.common.result.BusiResult; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * @author: liaozetao - * @date: 2023/9/4 16:27 - * @description: - */ -@Api(tags = "夺宝精灵-精灵碎片") -@RestController -@RequestMapping("/act/seize-treasure/shard") -public class SeizeTreasureShardController { - - @Autowired - private SeizeTreasureShardService seizeTreasureShardService; - - /** - * 购买 - * - * @param uid - * @param num - * @return - */ - @ApiOperation("购买") - @ApiImplicitParams({ - @ApiImplicitParam(name = "uid", value = "用户UID", required = true), - @ApiImplicitParam(name = "num", value = "门票数量", required = true), - }) - @PostMapping("buy") - public BusiResult buy(@RequestParam("uid") Long uid, @RequestParam("num") Integer num) { - seizeTreasureShardService.buy(uid, num); - return BusiResult.success(); - } -} diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/user/UsersController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/user/UsersController.java index a3f292760..986a73649 100644 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/user/UsersController.java +++ b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/user/UsersController.java @@ -7,7 +7,6 @@ import com.accompany.business.model.dress.ChatBubble; import com.accompany.business.model.dress.InfoCard; import com.accompany.business.mybatismapper.NameplateMapper; import com.accompany.business.service.account.AccountBlockService; -import com.accompany.business.service.audiocard.AudioCardService; import com.accompany.business.service.dfa.DfaService; import com.accompany.business.service.dress.UserChatBubbleService; import com.accompany.business.service.guild.GuildDressUpService; @@ -40,7 +39,6 @@ import com.accompany.core.service.user.UsersBaseService; import com.accompany.core.util.PartitionUtil; import com.accompany.core.util.StringUtils; import com.accompany.core.vo.UserVo; -import com.accompany.core.vo.audiocard.UserAudioCardVo; import com.accompany.core.vo.user.InfoCardVo; import com.accompany.core.vo.vip.UserVipInfoVO; import com.alibaba.fastjson.JSON; @@ -99,8 +97,6 @@ public class UsersController extends BaseController { @Resource(name = "biz-executor") private ThreadPoolExecutor bizExecutor; @Autowired - private AudioCardService audioCardService; - @Autowired private LabelService labelService; @Autowired private RegionService regionService; @@ -181,9 +177,6 @@ public class UsersController extends BaseController { String filterNick = dfaService.filterWord(userVo.getNick()); userVo.setNick(filterNick); - UserAudioCardVo audioCardVo = audioCardService.getVo(uid, uid); - userVo.setAudioCard(audioCardVo); - List labels = labelService.listByUid(uid); userVo.setLabels(labels); diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/interceptor/AppVersionInterceptor.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/interceptor/AppVersionInterceptor.java deleted file mode 100644 index 55b78527a..000000000 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/interceptor/AppVersionInterceptor.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.accompany.business.interceptor; - -import com.accompany.common.constant.ApplicationConstant; -import com.accompany.common.constant.Constant; -import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.AppVersionUtil; -import com.accompany.core.service.SysConfService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.servlet.ModelAndView; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * @author yangziwen - * @description 根据配置动态熔断服务 - * @date 2018/6/22 00:49 - */ -public class AppVersionInterceptor extends BasicInterceptor { - - private static final Logger logger = LoggerFactory.getLogger(AppVersionInterceptor.class); - - @Autowired - private SysConfService sysConfService; - - @Override - public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object object) throws Exception { - String appOs = request.getParameter(ApplicationConstant.PublicParameters.OS); - if (appOs == null) { - // h5不拦截 - return true; - } - if (appOs.equalsIgnoreCase(ApplicationConstant.PublicParameters.OS_ANDROID) || appOs.equalsIgnoreCase(ApplicationConstant.PublicParameters.OS_IOS)) { - String requestAppVer = request.getParameter(ApplicationConstant.PublicParameters.APP_VERSION); - String limitAppVersion = sysConfService.getDefaultSysConfValueById(Constant.SysConfId.APP_VERSION_LIMIT, Constant.LOWEST_VERSION_FOR_USE); - if (AppVersionUtil.compareVersion(requestAppVer, limitAppVersion) < 0) { - logger.warn("app version limit for use, request: {}", request.getRequestURI()); - this.writeResponse(response, HttpServletResponse.SC_OK, BusiStatus.VERSIONTOOOLD); - return false; - } - } - - return true; - } - - @Override - public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception { - - } - - @Override - public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception { - - } - -} diff --git a/accompany-business/accompany-business-web/src/test/java/servicetest/AnchorFansTeamTaskTest.java b/accompany-business/accompany-business-web/src/test/java/servicetest/AnchorFansTeamTaskTest.java deleted file mode 100644 index 177957a79..000000000 --- a/accompany-business/accompany-business-web/src/test/java/servicetest/AnchorFansTeamTaskTest.java +++ /dev/null @@ -1,32 +0,0 @@ -package servicetest; - -import cn.hutool.core.util.StrUtil; -import com.accompany.business.model.anchor.AnchorFansTask; -import com.accompany.business.service.anchor.AnchorFansTaskService; -import com.accompany.business.service.anchor.AnchorFansTeamService; -import com.accompany.business.service.user.UsersService; -import com.accompany.common.constant.Constant; -import com.accompany.common.utils.DateTimeUtil; -import org.junit.Test; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Date; - -public class AnchorFansTeamTaskTest extends CommonTest { - - @Autowired - private AnchorFansTeamService anchorFansTeamService; - @Autowired - private AnchorFansTaskService anchorFansTaskService; - @Autowired - private UsersService usersService; - - @Test - public void test(){ - // anchorFansTeamService.sendDesignGiftAndNameplateStatus(); - AnchorFansTask task = anchorFansTaskService.getAnchorFansTaskByCode(Constant.AnchorFansTaskCode.watchLive); - String todayStr = StrUtil.UNDERLINE + DateTimeUtil.convertDate(new Date(),DateTimeUtil.DEFAULT_DATE_PATTERN); - anchorFansTeamService.finishedTask(1005062l,1005064l,task,todayStr); - } - -} diff --git a/accompany-mq/accompany-mq-sdk/src/main/java/com/accompany/mq/constant/MqConstant.java b/accompany-mq/accompany-mq-sdk/src/main/java/com/accompany/mq/constant/MqConstant.java index 0ffc9f161..63e2c3cba 100644 --- a/accompany-mq/accompany-mq-sdk/src/main/java/com/accompany/mq/constant/MqConstant.java +++ b/accompany-mq/accompany-mq-sdk/src/main/java/com/accompany/mq/constant/MqConstant.java @@ -8,9 +8,6 @@ public interface MqConstant { String OPEN_BOX_TOPIC = "open_box_topic"; String OPEN_BOX_CONSUME_GROUP = "open_box_consume_group"; - String LINEARLY_POOL_TOPIC = "linearly_pool_topic"; - String LINEARLY_POOL_CONSUME_GROUP = "linearly_pool_consume_group"; - String ACTIVITY_PACK_TOPIC = "activity_pack_topic"; String ACTIVITY_PACK_CONSUME_GROUP = "activity_pack_consume_group"; @@ -20,9 +17,6 @@ public interface MqConstant { String YI_DUN_TEXT_ANTI_TOPIC = "yidun_text_anti_topic"; String YI_DUN_TEXT_ANTI_CONSUME_GROUP = "yidun_text_anti_consume_group"; - String CHANGE_TOPIC = "charge_topic"; - String CHARGE_CONSUME_GROUP = "charge_consume_group"; - String ACT_USER_TASK_TOPIC = "act_user_task_topic"; String ACT_USER_TASK_CONSUME_GROUP = "act_user_task_consume_group"; diff --git a/accompany-mq/accompany-mq-web/src/main/java/com/accompany/mq/consumer/LinearlyPoolPrizeMessageConsumer.java b/accompany-mq/accompany-mq-web/src/main/java/com/accompany/mq/consumer/LinearlyPoolPrizeMessageConsumer.java deleted file mode 100644 index b54b66214..000000000 --- a/accompany-mq/accompany-mq-web/src/main/java/com/accompany/mq/consumer/LinearlyPoolPrizeMessageConsumer.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.accompany.mq.consumer; - -import com.accompany.business.message.linearlypool.LinearlyPoolPrizeMessage; -import com.accompany.business.service.linearlypool.LinearlyPoolPrizeMessageService; -import com.accompany.common.redis.RedisKey; -import com.accompany.core.service.common.JedisService; -import com.accompany.mq.constant.MqConstant; -import com.accompany.mq.listener.AbstractMessageListener; -import com.alibaba.fastjson.JSON; -import lombok.extern.slf4j.Slf4j; -import org.apache.rocketmq.spring.annotation.ConsumeMode; -import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; - -/** - * 线性奖池中奖消息 - */ -@Slf4j -//@Component -@ConditionalOnProperty(name = "spring.application.name", havingValue = "web") -@RocketMQMessageListener(topic = MqConstant.LINEARLY_POOL_TOPIC, consumerGroup = MqConstant.LINEARLY_POOL_CONSUME_GROUP, consumeMode = ConsumeMode.ORDERLY) -public class LinearlyPoolPrizeMessageConsumer extends AbstractMessageListener { - - @Autowired - private LinearlyPoolPrizeMessageService prizeMessageService; - @Autowired - private JedisService jedisService; - - @Override - public void onMessage(LinearlyPoolPrizeMessage message) { - Thread thread = Thread.currentThread(); - log.info("{} thread handle linearly-pool-draw-queue message {}", thread.getName(), JSON.toJSONString(message)); - - prizeMessageService.onMessage(message); - - // 删除消息标识 - jedisService.hdel(RedisKey.mq_linearly_pool_prize_status.getKey(), message.getMessId()); - } -} diff --git a/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/support/password/PasswordAuthenticationProvider.java b/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/support/password/PasswordAuthenticationProvider.java index e8142d794..5cce547db 100644 --- a/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/support/password/PasswordAuthenticationProvider.java +++ b/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/support/password/PasswordAuthenticationProvider.java @@ -3,7 +3,6 @@ package com.accompany.oauth2.support.password; import com.accompany.common.constant.Constant; import com.accompany.common.device.DeviceInfo; import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.AppVersionUtil; import com.accompany.common.utils.DESUtils; import com.accompany.common.utils.StringUtils; import com.accompany.core.service.SysConfService; @@ -58,12 +57,7 @@ public class PasswordAuthenticationProvider implements AuthenticationProvider { logger.error("populate deviceInfo fail", e); } try { - if (null != deviceInfo.getAppVersion()) { - String appVersion = deviceInfo.getAppVersion(); - if (AppVersionUtil.compareVersion(appVersion, Constant.ENCRYPT_SENSITIVE_INFO_APP_VERSION) >= 0) { - username = DESUtils.DESAndBase64Decrypt(username, KeyStore.DES_ENCRYPT_KEY); - } - } + username = DESUtils.DESAndBase64Decrypt(username, KeyStore.DES_ENCRYPT_KEY); } catch (Exception e) { throw new CustomOAuth2Exception(CustomOAuth2Exception.ACCOUNT_ERROR, BusiStatus.ACCOUNT_ERROR.getReasonPhrase()); diff --git a/accompany-oauth2/accompany-oauth2-web/src/main/java/com/accompany/oauth2/common/BaseController.java b/accompany-oauth2/accompany-oauth2-web/src/main/java/com/accompany/oauth2/common/BaseController.java index 4bf957fda..98c3da3a8 100644 --- a/accompany-oauth2/accompany-oauth2-web/src/main/java/com/accompany/oauth2/common/BaseController.java +++ b/accompany-oauth2/accompany-oauth2-web/src/main/java/com/accompany/oauth2/common/BaseController.java @@ -4,7 +4,6 @@ import com.accompany.common.constant.ApplicationConstant; import com.accompany.common.constant.Constant; import com.accompany.common.device.DeviceInfo; import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.AppVersionUtil; import com.accompany.common.utils.DESUtils; import com.accompany.core.exception.ServiceException; import com.accompany.core.util.KeyStore; @@ -35,18 +34,6 @@ public class BaseController { return exceptionTranslator.translate(e); } - protected static DeviceInfo getDeviceInfo(HttpServletRequest request){ - DeviceInfo deviceInfo = new DeviceInfo(); - deviceInfo.setApp(request.getParameter(ApplicationConstant.PublicParameters.APP)); - deviceInfo.setAppVersion(request.getParameter(ApplicationConstant.PublicParameters.APP_VERSION)); - deviceInfo.setChannel(request.getParameter(ApplicationConstant.PublicParameters.APP_CHANNEL)); - deviceInfo.setDeviceId(request.getParameter(ApplicationConstant.PublicParameters.DEVICE_ID)); - deviceInfo.setModel(request.getParameter(ApplicationConstant.PublicParameters.MODEL)); - deviceInfo.setOs(request.getParameter(ApplicationConstant.PublicParameters.OS)); - deviceInfo.setOsVersion(request.getParameter(ApplicationConstant.PublicParameters.OS_VERSION)); - return deviceInfo; - } - protected static Long getUid(HttpServletRequest request){ String uid = request.getHeader(ApplicationConstant.PublicParameters.PUB_UID); return StringUtils.isBlank(uid) ? null : Long.parseLong(uid); @@ -58,19 +45,12 @@ public class BaseController { * @return */ protected static String decryptSensitiveInfo(HttpServletRequest request, String sensitiveInfo) { - DeviceInfo deviceInfo = getDeviceInfo(request); - if (null != deviceInfo.getAppVersion()) { - String appVersion = deviceInfo.getAppVersion(); - if (AppVersionUtil.compareVersion(appVersion, Constant.ENCRYPT_SENSITIVE_INFO_APP_VERSION) >= 0) { - String desInfo = null; - try { - desInfo = DESUtils.DESAndBase64Decrypt(sensitiveInfo, KeyStore.DES_ENCRYPT_KEY); - } catch (Exception e) { - throw new ServiceException(BusiStatus.SERVERBUSY); - } - return desInfo; - } + String desInfo = null; + try { + desInfo = DESUtils.DESAndBase64Decrypt(sensitiveInfo, KeyStore.DES_ENCRYPT_KEY); + } catch (Exception e) { + throw new ServiceException(BusiStatus.SERVERBUSY); } - return sensitiveInfo; + return desInfo; } } diff --git a/accompany-scheduler/accompany-scheduler-service/src/main/java/com/accompany/scheduler/task/AnchorFansDesignGiftTask.java b/accompany-scheduler/accompany-scheduler-service/src/main/java/com/accompany/scheduler/task/AnchorFansDesignGiftTask.java deleted file mode 100644 index 08a7f1181..000000000 --- a/accompany-scheduler/accompany-scheduler-service/src/main/java/com/accompany/scheduler/task/AnchorFansDesignGiftTask.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.accompany.scheduler.task; - -import com.accompany.business.service.anchor.AnchorFansTeamService; -import com.accompany.scheduler.base.BaseTask; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -/** - * 每天12点发送粉丝专属礼物 - */ -@Component -@Slf4j -public class AnchorFansDesignGiftTask extends BaseTask { - - @Autowired - private AnchorFansTeamService anchorFansTeamService; - - @Scheduled(cron = "0 2 0 * * ?") - public void createRankKing() { - log.info("赠送粉丝每日专属礼物和初始化粉丝铭牌状态开始...."); - anchorFansTeamService.sendDesignGiftAndNameplateStatus(); - log.info("赠送粉丝每日专属礼物和初始化粉丝铭牌结束...."); - } -} diff --git a/accompany-scheduler/accompany-scheduler-service/src/main/java/com/accompany/scheduler/task/LinearlyPoolTask.java b/accompany-scheduler/accompany-scheduler-service/src/main/java/com/accompany/scheduler/task/LinearlyPoolTask.java deleted file mode 100644 index 2850475fe..000000000 --- a/accompany-scheduler/accompany-scheduler-service/src/main/java/com/accompany/scheduler/task/LinearlyPoolTask.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.accompany.scheduler.task; - -import com.accompany.business.service.linearlypool.LinearlyPrizePoolService; -import com.accompany.common.utils.DateTimeUtil; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Scheduled; - -import java.util.Date; - -//@Component -@Slf4j -public class LinearlyPoolTask { - - @Autowired - private LinearlyPrizePoolService linearlyPrizePoolService; - - @Scheduled(cron = "*/30 * * * * *") - public void createPoolLine() { - log.info("开始检查是否需要创建奖品线任务"); - try { - linearlyPrizePoolService.createPoolLineIfNecessary(); - } catch (Exception e) { - log.error("检查是否需要创建奖品线出错", e); - } - log.info("完成检查是否需要创建奖品线任务"); - } - - @Scheduled(cron = "0 */12 * * * *") - public void clearDrawOutPoolLine() { - log.info("开始清理已抽取完的奖品线任务"); - try { - linearlyPrizePoolService.clearDrawOutPoolLine(); - } catch (Exception e) { - log.error("清理已抽取完的奖品线出错", e); - } - log.info("完成清理已抽取完的奖品线任务"); - } - - /** - * 清理过期的linearly_prize_pool_draw_line_item_day中数据 - */ - @Scheduled(cron = "0 0 9 * * ?") - public void clearExpiredDayDrawRecordDatas() { - try { - log.info("开始清理过期的linearly_prize_pool_draw_line_item_day中数据"); - linearlyPrizePoolService.clearExpiredDrawLineDatas(); - log.info("结束清理过期的linearly_prize_pool_draw_line_item_day中数据"); - } catch (Exception e) { - log.error("清理过期的linearly_prize_pool_draw_line_item_day中数据失败...", e); - } - } - - /** - * 定点播报 - */ - @Scheduled(cron = "${scheduler.linealy-pool.static-report-cron}") - public void reportTotalStatisticsInHour() { - try { - log.info("开始定点播报"); - Date endTime = DateTimeUtil.getCurrHourTimeV2(); - Date startTime = DateTimeUtil.getNextHour(endTime, -1); - linearlyPrizePoolService.reportTotalStatisticsByTime(startTime, endTime); - log.info("结束定点播报"); - } catch (Exception e) { - log.error("定点播报失败...", e); - } - } -} diff --git a/accompany-scheduler/accompany-scheduler-service/src/main/java/com/accompany/scheduler/task/activity/SeizeTreasureTask.java b/accompany-scheduler/accompany-scheduler-service/src/main/java/com/accompany/scheduler/task/activity/SeizeTreasureTask.java deleted file mode 100644 index 120141147..000000000 --- a/accompany-scheduler/accompany-scheduler-service/src/main/java/com/accompany/scheduler/task/activity/SeizeTreasureTask.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.accompany.scheduler.task.activity; - -import com.accompany.business.service.treasure.SeizeTreasureService; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Scheduled; - -//@Component -@Slf4j -public class SeizeTreasureTask { - @Autowired - private SeizeTreasureService seizeTreasureService; - - /** - * 夺宝精灵自动生成奖池 - */ - @Scheduled(cron = "0 * * * * ?") - public void initSeizeTreasurePoolTask() { - log.info("SeizeTreasureTask initSeizeTreasurePoolTask begin"); - seizeTreasureService.initPool(); - log.info("SeizeTreasureTask initSeizeTreasurePoolTask end"); - } - - /** - * 夺宝精灵自动生成奖池 - */ - @Scheduled(cron = "0 0 * * * ?") - public void hourCountMsg() { - log.info("SeizeTreasureTask hourCountMsg begin"); - seizeTreasureService.hourCountMsg(); - log.info("SeizeTreasureTask hourCountMsg end"); - } -} diff --git a/python/peko_seize_treasure_rank_value.py b/python/peko_seize_treasure_rank_value.py deleted file mode 100644 index 775b50bbe..000000000 --- a/python/peko_seize_treasure_rank_value.py +++ /dev/null @@ -1,31 +0,0 @@ -# pip3 install redis - -import redis -import json -from concurrent.futures import ThreadPoolExecutor - -res = None - -def connect(): - res = redis.StrictRedis(host='172.22.0.8', port=6379, db=0, password='pc8DphhaXwTe2jyv') - return res - - -def handle_keys(): - try: - members = res.zrange('peko:seize_treasure:rank:value:2023-10-24', 0, -1, withscores=True) - for m in members: - uid = m[0].decode('utf-8') - score = m[1] - print(uid, ',', score) - except Exception as e: - print("handle_keys error.", e) - - -if __name__ == '__main__': - res = connect() - if res is None: - print("redis connect is error.") - else: - print("redis connect is success.") - handle_keys() diff --git a/python/peko_seize_treasure_user_info.py b/python/peko_seize_treasure_user_info.py deleted file mode 100644 index bba139e2f..000000000 --- a/python/peko_seize_treasure_user_info.py +++ /dev/null @@ -1,52 +0,0 @@ -# pip3 install redis - -import redis -from concurrent.futures import ThreadPoolExecutor - -res = None - - -def connect(): - res = redis.StrictRedis(host='172.22.0.8', port=6379, db=0, password='pc8DphhaXwTe2jyv') - return res - - -def scan(): - # 创建一个包含100条线程的线程池 - thread = ThreadPoolExecutor(max_workers=100) - cursor = 0 - while True: - tup = res.scan(cursor=cursor, match='peko:seize_treasure:user_info:*', count=1000) - k = tup[0] - v = tup[1] - if isinstance(k, int): - cursor = k - if isinstance(v, list): - # 启动线程执行 - try: - handle_keys(v) - except Exception as e: - print("thread submit error.", e) - if cursor == 0: - break - # 关闭线程池 - thread.shutdown() - - -def handle_keys(keys): - try: - for k in keys: - key = k.decode('utf-8') - print(key) - # res.delete(key) - except Exception as e: - print("handle_keys error.", e) - - -if __name__ == '__main__': - res = connect() - if res is None: - print("redis connect is error.") - else: - print("redis connect is success.") - scan()