清理废弃功能代码-Anchor
This commit is contained in:
@@ -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<TarotRecordTotalVo> pageInfo;
|
||||
|
||||
/** 总的记录相加 */
|
||||
private TarotRecordTotalVo tarotRecordTotalVo;
|
||||
}
|
@@ -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;
|
||||
}
|
@@ -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;
|
||||
}
|
@@ -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;
|
||||
}
|
||||
}
|
@@ -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<LinearlyPrizePoolItemDraft> poolItems;
|
||||
|
||||
private Byte prizePoolType;
|
||||
}
|
@@ -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<LinearlyPrizePoolItem> poolItems;
|
||||
|
||||
}
|
@@ -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;
|
||||
}
|
@@ -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;
|
||||
}
|
@@ -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;
|
||||
}
|
@@ -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}
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
@@ -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;
|
||||
|
||||
}
|
@@ -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;
|
||||
}
|
@@ -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;
|
||||
}
|
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* 文 件 名: LinearlyPoolDrawRecordVO
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建时间: 2021/9/17
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.accompany.admin.vo.linearlypool;
|
||||
|
||||
import com.accompany.business.model.linearlypool.LinearlyPrizePoolDrawLineItem;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <br>类描述: 抽奖记录vo
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @date [2021/9/17]
|
||||
*/
|
||||
@Data
|
||||
public class LinearlyPoolDrawRecordVO extends LinearlyPrizePoolDrawLineItem {
|
||||
|
||||
private Long erbanNo;
|
||||
|
||||
private String nick;
|
||||
}
|
@@ -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<PrizeItemVO> deployedNormalPrizes;
|
||||
/**
|
||||
* 已发布的高级礼物组列表
|
||||
*/
|
||||
private List<PrizeItemVO> deployedSeniorPrizes;
|
||||
|
||||
/**
|
||||
* 当前奖品线id
|
||||
*/
|
||||
private Long currentPoolLineId;
|
||||
/**
|
||||
* 已生成的最大奖品线id
|
||||
*/
|
||||
private Long maxLineId;
|
||||
}
|
@@ -1,19 +0,0 @@
|
||||
package com.accompany.admin.vo.linearlypool;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class PrizeGroupVO {
|
||||
|
||||
/**
|
||||
* 奖品列表
|
||||
*/
|
||||
private List<PrizeItemVO> prizeItems;
|
||||
|
||||
/**
|
||||
* 是否未发布
|
||||
*/
|
||||
private Boolean isUndeploy;
|
||||
}
|
@@ -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;
|
||||
|
||||
}
|
@@ -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;
|
||||
|
||||
}
|
@@ -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<Long> getPropIds() {
|
||||
if (StrUtil.isEmpty(propIdsJson)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return JSONArray.parseArray(propIdsJson, Long.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Integer> getPropNums() {
|
||||
if (StrUtil.isEmpty(propNumsJson)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return JSONArray.parseArray(propNumsJson, Integer.class);
|
||||
}
|
||||
}
|
@@ -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;
|
||||
}
|
@@ -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;
|
||||
}
|
@@ -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);
|
||||
}
|
||||
}
|
@@ -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;
|
||||
}
|
@@ -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;
|
||||
}
|
@@ -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<SeizeTreasurePoolItemAdminVo> normalPoolItems;
|
||||
|
||||
/**
|
||||
* 高级
|
||||
*/
|
||||
@ApiModelProperty("高级")
|
||||
private List<SeizeTreasurePoolItemAdminVo> seniorPoolItems;
|
||||
}
|
@@ -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;
|
||||
}
|
@@ -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<SeizeTreasureUserPropRecord> expends;
|
||||
|
||||
/**
|
||||
* 试炼产出
|
||||
*/
|
||||
@ApiModelProperty("试炼产出")
|
||||
private String propName;
|
||||
|
||||
/**
|
||||
* 试炼时间
|
||||
*/
|
||||
@ApiModelProperty("试炼时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
}
|
@@ -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<GiftCompoundRewardAdminVo> getGiftCompoundList();
|
||||
|
||||
GiftCompoundRewardAdminVo getGiftCompoundById(Integer id);
|
||||
|
||||
List<GiftCompoundRewardAdminVo> getGiftCompoundLimitList(@Param("rewardId") Integer rewardId);
|
||||
|
||||
GiftCompoundRewardAdminVo getGiftCompoundLimitById(@Param("id") Integer id);
|
||||
|
||||
List<GiftCompoundRewardAdminVo> getPoolItem(@Param("id") Integer id);
|
||||
|
||||
}
|
@@ -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<PublicChatTopRecordAdminVo> selectPage(Page<PublicChatTopRecordAdminVo> page, @Param("erbanNo") Long erbanNo, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("partitionId") Integer partitionId);
|
||||
}
|
@@ -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<UserDrawStatisAdminVo> getUserStatisList(@Param("uid") Long uid, @Param("minDis") Integer minDis, @Param("maxDis") Integer maxDis, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
}
|
@@ -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<Integer> poolTypeList, @Param("poolGroupList") List<Integer> poolGroupList, @Param("poolLevelList") List<Integer> poolLevelList, @Param("uid") Long uid, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||
|
||||
List<SeizeTreasureDailyRecordVo> getRecordDaily(@Param("poolTypeList") List<Integer> poolTypeList, @Param("poolGroupList") List<Integer> poolGroupList, @Param("poolLevelList") List<Integer> poolLevelList, @Param("uid") Long uid, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||
|
||||
List<SeizeTreasureRecordVo> getRecord(@Param("poolTypeList") List<Integer> poolTypeList, @Param("poolGroupList") List<Integer> poolGroupList, @Param("poolLevelList") List<Integer> poolLevelList, @Param("uid") Long uid, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||
|
||||
}
|
@@ -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<SeizeTreasurePoolDrawRecordAdminVo> totalPage(Page<SeizeTreasurePoolDrawRecordAdminVo> page, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("uidList") List<Long> uidList);
|
||||
}
|
@@ -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<SeizeTreasurePoolItemAdminVo> page(Page<SeizeTreasurePoolItemAdminVo> page, @Param("rewardName") String rewardName, @Param("poolType") Integer poolType, @Param("poolGroup") Integer poolGroup, @Param("poolLevel") Integer poolLevel);
|
||||
}
|
@@ -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<Account> 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;
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -1,15 +0,0 @@
|
||||
package com.accompany.admin.service.analysis;
|
||||
|
||||
/**
|
||||
* @author: liaozetao
|
||||
* @date: 2023/9/16 15:08
|
||||
* @description:
|
||||
*/
|
||||
public interface AnalysisAdminService {
|
||||
|
||||
/**
|
||||
* 初始化数据
|
||||
*/
|
||||
void initData();
|
||||
|
||||
}
|
@@ -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<Long> 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<String, Object> userMap = jdbcTemplate.queryForObject("select uid, erban_no, nick from users where uid = " + uid, (rs, i) -> {
|
||||
Map<String, Object> 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<Long> 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<String> 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<Double> 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<String> 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... ====");
|
||||
}
|
||||
}
|
@@ -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<AnchorWhitelist> queryUsersForPages(Long erbanNo, Integer pageNumber, Integer pageSize) {
|
||||
PageHelper.startPage(pageNumber, pageSize);
|
||||
return new PageInfo<>(queryWhiteLists(erbanNo));
|
||||
}
|
||||
|
||||
public List<AnchorWhitelist> 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<AnchorWhitelist> 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<AnchorWhitelist> 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<AnchorWhitelist> 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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@@ -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<AnchorBillCheck> queryBillCheckForPages(Integer pageNumber, Integer pageSize) {
|
||||
PageHelper.startPage(pageNumber, pageSize);
|
||||
return new PageInfo<>(queryAnchorBillCheckLists());
|
||||
}
|
||||
|
||||
public List<AnchorBillCheck> queryAnchorBillCheckLists() {
|
||||
|
||||
AnchorBillCheckExample anchorBillCheckExample = new AnchorBillCheckExample();
|
||||
anchorBillCheckExample.setOrderByClause("update_time desc");
|
||||
List<AnchorBillCheck> 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;
|
||||
}
|
||||
|
||||
}
|
@@ -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<AnchorFansPrivilegeConfig> 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<AnchorFansTeam> 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<AnchorFansTeam> 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<String> smembers = jedisService.smembers(key);
|
||||
List<Long> 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);
|
||||
}
|
||||
}
|
@@ -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<String, Object> 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<String, Object> statisticsMap = Maps.newHashMap();
|
||||
page = page != null ? page : Constant.DEFAULT_PAGE;
|
||||
pageSize = pageSize != null ? pageSize : Constant.DEFAULT_PAGE_SIZE;
|
||||
PageHelper.startPage(page, pageSize);
|
||||
List<AnchorFansTeamStatsVo> fansTeamStatsVoList = anchorFansTeamMapper.getAnchorWithFansteam(uid);
|
||||
PageInfo<AnchorFansTeamStatsVo> pageInfo = new PageInfo<>(fansTeamStatsVoList);
|
||||
statisticsMap.put("rows", pageInfo.getList());
|
||||
statisticsMap.put("total", pageInfo.getTotal());
|
||||
return statisticsMap;
|
||||
}
|
||||
|
||||
|
||||
public Map<String, Object> fansTeamDetailList(Integer page, Integer pageSize, Long uid) {
|
||||
Map<String, Object> 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<AnchorFansTeamStatsDetailVo> list = anchorFansTeamMapper.getAnchorFansTeamDetailList(team.getId());
|
||||
PageInfo<AnchorFansTeamStatsDetailVo> pageInfo = new PageInfo<>(list);
|
||||
statisticsMap.put("rows", pageInfo.getList());
|
||||
statisticsMap.put("total", pageInfo.getTotal());
|
||||
return statisticsMap;
|
||||
}
|
||||
}
|
@@ -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<AnchorBillRecord> queryUsersForPages(Long erbanNo, String remark, Integer pageNumber, Integer pageSize) {
|
||||
PageHelper.startPage(pageNumber, pageSize);
|
||||
return new PageInfo<>(queryAnchorBillLists(erbanNo, remark));
|
||||
}
|
||||
|
||||
public List<AnchorBillRecord> 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<AnchorBillRecord> anchorBillRecordList = anchorBillRecordMapper.selectByExample(anchorBillRecordExample);
|
||||
return anchorBillRecordList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@@ -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<AudioCardMapper, UserAudioCard> {
|
||||
|
||||
@Autowired
|
||||
private RedissonClient redissonClient;
|
||||
@Autowired
|
||||
private UsersService usersService;
|
||||
@Autowired
|
||||
private SendSysMsgService sendSysMsgService;
|
||||
|
||||
public void page(Page<UserAudioCardAdminVo> page, Long erbanNo, String startTime, String endTime, Byte status) {
|
||||
Page<UserAudioCard> 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<UserAudioCard> records = pageInfo.getRecords();
|
||||
List<Long> uids = records.stream().map(UserAudioCard::getUid).distinct().collect(Collectors.toList());
|
||||
Map<Long, Users> userMap = usersService.getUsersListByUids(uids).stream().collect(Collectors.toMap(Users::getUid, user->user));
|
||||
List<UserAudioCardAdminVo> 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);
|
||||
}
|
||||
|
||||
}
|
@@ -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<RedeemCode> 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<RedeemCode> 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));
|
||||
}
|
||||
}
|
||||
}
|
@@ -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<LuckyTarotRecordVo> 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<LuckyTarotRecordVo> recordVos = luckyTarotRecordMapperExpand.getRecordListByPage(record,start,pageSize);
|
||||
Integer count = luckyTarotRecordMapperExpand.getRecordCount(record);
|
||||
PageInfo<LuckyTarotRecordVo> pageInfo = new PageInfo<>(recordVos);
|
||||
pageInfo.setTotal(count);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
public PageInfo<TarotRecordStatisVo> 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<TarotRecordStatisVo> 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<TarotRecordStatisVo> 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<TarotRecordTotalVo> 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<TarotRecordTotalVo> 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;
|
||||
}
|
||||
}
|
@@ -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<PublicChatTopRecordAdminVo> page(Long erbanNo, String startTime, String endTime, Integer partitionId, Integer pageNum, Integer pageSize);
|
||||
}
|
@@ -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<PublicChatTopRecordAdminVo> page(Long erbanNo, String startTime, String endTime, Integer partitionId, Integer pageNum, Integer pageSize) {
|
||||
return publicChatTopRecordAdminMapper.selectPage(new Page<>(pageNum, pageSize), erbanNo, startTime, endTime, partitionId);
|
||||
}
|
||||
}
|
@@ -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);
|
||||
}
|
||||
}
|
@@ -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<GiftCompoundRewardAdminVo> getList(Integer pageNum, Integer pageSize) {
|
||||
PageHelper.startPage(pageNum,pageSize);
|
||||
List<GiftCompoundRewardAdminVo> giftCompoundList = giftCompoundAdminMapper.getGiftCompoundList();
|
||||
return giftCompoundList;
|
||||
}
|
||||
|
||||
public List<GiftCompoundRewardAdminVo> limtList(Integer pageNum, Integer pageSize, Integer rewardId) {
|
||||
PageHelper.startPage(pageNum,pageSize);
|
||||
List<GiftCompoundRewardAdminVo> giftCompoundList = giftCompoundAdminMapper.getGiftCompoundLimitList(rewardId);
|
||||
return giftCompoundList;
|
||||
}
|
||||
|
||||
public long getCount(Integer giftRewardType) {
|
||||
QueryWrapper<GiftCompoundReward> 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<GiftCompoundRewardPool>().eq(GiftCompoundRewardPool::getRewardId, giftCompoundReward.getId()));
|
||||
rewardPool.setGiftId(giftCompoundReward.getGiftId()).setServiceNotice(rewardVo.getServiceNotice());
|
||||
giftcompoundRewardPoolService.updateById(rewardPool);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void delReward(Integer rewardId) {
|
||||
giftcompoundRewardPoolService.remove(new LambdaQueryWrapper<GiftCompoundRewardPool>().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<GiftCompoundRewardPool>()
|
||||
.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<GiftCompoundRewardAdminVo> getPoolItem() {
|
||||
List<GiftCompoundRewardAdminVo> 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<GiftCompoundRewardPool>()
|
||||
.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;
|
||||
}
|
||||
}
|
@@ -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<HomeNewFriendAdminVo> page(PageReq req);
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param erBanNoStr
|
||||
* @param expireTimeStr
|
||||
*/
|
||||
void save(String erBanNoStr, String expireTimeStr);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param uid
|
||||
*/
|
||||
void del(Long uid);
|
||||
}
|
@@ -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<HomeNewFriendAdminVo> page(PageReq req) {
|
||||
String redisKey = RedisKey.home_new_friend_uid.getKey();
|
||||
Set<Map<String, Object>> set = jedisService.zrange(redisKey, req.getStartNum(), req.getEndNum());
|
||||
List<HomeNewFriendAdminVo> admins = new ArrayList<>();
|
||||
for (Map<String, Object> 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<HomeNewFriendAdminVo> 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<String> 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);
|
||||
}
|
||||
}
|
@@ -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<LinearlyPoolDrawRecordVO> getRecordList(Long uid, String prizeName, Integer pageNumber, Integer pageSize, Date startDate, Date endDate) {
|
||||
IPage<LinearlyPrizePoolDrawLineItem> queryPage = new Page<>(pageNumber, pageSize);
|
||||
QueryWrapper<LinearlyPrizePoolDrawLineItem> queryWrapper = genRecordQuery(uid, prizeName, startDate, endDate);
|
||||
IPage<LinearlyPrizePoolDrawLineItem> page = drawLineItemService.page(queryPage, queryWrapper);
|
||||
List<LinearlyPoolDrawRecordVO> recordList = convertToDrawRecordVoList(page.getRecords());
|
||||
PageInfo<LinearlyPoolDrawRecordVO> resPage = new PageInfo(recordList);
|
||||
resPage.setTotal(page.getTotal());
|
||||
return resPage;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private QueryWrapper<LinearlyPrizePoolDrawLineItem> genRecordQuery(Long uid, String prizeName, Date startDate, Date endDate) {
|
||||
QueryWrapper<LinearlyPrizePoolDrawLineItem> 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<UserDrawStatisAdminVo> 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<UserDrawStatisAdminVo> getHistoryList(Long uid, Integer minDis, Integer maxDis,
|
||||
String startTime, String endTime){
|
||||
List<UserDrawStatisAdminVo> drawBoxHistoryMsgByTimeRange =
|
||||
linearlyPoolAdminMapper.getUserStatisList(uid, minDis, maxDis, startTime, endTime);
|
||||
return drawBoxHistoryMsgByTimeRange;
|
||||
}
|
||||
|
||||
private List<UserDrawStatisAdminVo> convertToVo(List<UserDrawStatisAdminVo> list){
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
List<String> 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<Long, Users> 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<LinearlyPoolDrawRecordVO> convertToDrawRecordVoList(List<LinearlyPrizePoolDrawLineItem> list){
|
||||
if (CollectionUtil.isEmpty(list)) {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
List<LinearlyPoolDrawRecordVO> voList = Lists.newArrayList();
|
||||
Map<Long, Users> 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<List> buildExcelData(List<LinearlyPoolDrawRecordVO> records) {
|
||||
FastDateFormat format = FastDateFormat.getInstance("yyyy-MM-dd HH:mm:ss");
|
||||
List<List> excelRows = new ArrayList(records.size());
|
||||
records.forEach((record) -> {
|
||||
List<Object> 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<LinearlyPoolDrawRecordStatisVo> list = Lists.newArrayList();
|
||||
List<Date> 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<List> listExportRecordRows(Long uid, String prizeName, Date startDate, Date endDate) {
|
||||
QueryWrapper<LinearlyPrizePoolDrawLineItem> queryWrapper = genRecordQuery(uid, prizeName, startDate, endDate);
|
||||
List<LinearlyPrizePoolDrawLineItem> resultList = drawLineItemService.list(queryWrapper);
|
||||
List<LinearlyPoolDrawRecordVO> recordList = convertToDrawRecordVoList(resultList);
|
||||
return buildExcelData(recordList);
|
||||
}
|
||||
}
|
@@ -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<PrizeItemVO> deployedNormalPrizes = getDeployedPrizes(LinearlyPrizePoolTypeEnum.normal_prize_pool);
|
||||
List<PrizeItemVO> 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<PrizeItemVO> getDeployedPrizes(LinearlyPrizePoolTypeEnum poolType) {
|
||||
List<LinearlyPrizePoolItem> poolItems = linearlyPrizePoolItemService.listByPoolType(poolType.getValue());
|
||||
return convertToPrizeItemVOList(poolItems);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private PrizeGroupVO getPrizeGroupVO(LinearlyPrizePoolTypeEnum poolType) {
|
||||
boolean isUndeploy = false;
|
||||
// 先查询未发布的
|
||||
|
||||
List<LinearlyPrizePoolItem> poolItems = Collections.emptyList();
|
||||
List<LinearlyPrizePoolItemDraft> 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<PrizeItemVO> convertToPrizeItemVOList(List<LinearlyPrizePoolItem> poolItems) {
|
||||
if (CollectionUtil.isEmpty(poolItems)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<Integer> prizeIds = poolItems.stream().map(LinearlyPrizePoolItem::getPrizeId).collect(Collectors.toList());
|
||||
PrizeExample prizeExample = new PrizeExample();
|
||||
prizeExample.createCriteria().andIdIn(prizeIds);
|
||||
List<Prize> prizes = prizeMapper.selectByExample(prizeExample);
|
||||
Map<Integer, Prize> 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<LinearlyPrizePoolItemDraft> oldItems = linearlyPrizePoolItemDraftService.listByPoolType(params.getPrizePoolType());
|
||||
List<Long> oldIds;
|
||||
if (CollectionUtil.isNotEmpty(oldItems)) {
|
||||
oldIds = oldItems.stream().map(LinearlyPrizePoolItemDraft::getId).collect(Collectors.toList());
|
||||
} else {
|
||||
oldIds = Collections.emptyList();
|
||||
}
|
||||
List<LinearlyPrizePoolItemDraft> newItems = new ArrayList<>();
|
||||
List<LinearlyPrizePoolItemDraft> 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<LinearlyPrizePoolItemDraft> draftPoolItems = linearlyPrizePoolItemDraftService.listByPoolType(poolType.getValue());
|
||||
if (CollectionUtil.isEmpty(draftPoolItems)) {
|
||||
return ;
|
||||
}
|
||||
List<Long> draftIds = draftPoolItems.stream().map(LinearlyPrizePoolItemDraft::getId).collect(Collectors.toList());
|
||||
List<LinearlyPrizePoolItem> oldPoolItems = linearlyPrizePoolItemService.listByPoolType(poolType.getValue());
|
||||
// 以prizeId作为key的map
|
||||
Map<Integer, LinearlyPrizePoolItem> oldPoolItemMap = oldPoolItems.stream().collect(Collectors.toMap(LinearlyPrizePoolItem::getPrizeId, it -> it, (k1, k2) -> k1));
|
||||
|
||||
List<LinearlyPrizePoolItem> newItems = new ArrayList<>();
|
||||
List<LinearlyPrizePoolItem> 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<Long> 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<PrizeItemVO> listDeployedPoolItems() {
|
||||
List<LinearlyPrizePoolItem> list = linearlyPrizePoolItemService.list();
|
||||
return convertToPrizeItemVOList(list);
|
||||
}
|
||||
|
||||
public void updateShowRatio(PoolItemShowRatioReqParams params) {
|
||||
if (params == null || CollectionUtil.isEmpty(params.getPoolItems())) {
|
||||
throw new AdminServiceException(BusiStatus.PARAMERROR, "必须传入奖品列表");
|
||||
}
|
||||
|
||||
List<LinearlyPrizePoolItem> 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);
|
||||
}
|
||||
}
|
@@ -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<String, String> 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<String, String> 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<AnchorFansPrivilegeConfig> 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<AnchorFansPrivilegeConfig> 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);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* 生成铭牌图片
|
||||
|
@@ -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<UsersVo> getUserList(String erNos, Integer page, Integer pageSize) {
|
||||
if (BlankUtil.isBlank(erNos)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
String[] arr = erNos.split("\n");
|
||||
List<Long> 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<UsersVo> usersVoList = userMapperExpand.selectUserWithGold(data);
|
||||
return usersVoList;
|
||||
}
|
||||
|
||||
public int getUserCount(String erNos){
|
||||
if (BlankUtil.isBlank(erNos)) {
|
||||
return 0;
|
||||
}
|
||||
String[] arr = erNos.split("\n");
|
||||
List<Long> erNoList = Lists.newArrayList();
|
||||
for (String erNo : arr) {
|
||||
erNoList.add(Long.valueOf(erNo.trim()));
|
||||
}
|
||||
return userMapperExpand.getUserWithGoldCount(erNoList);
|
||||
}
|
||||
}
|
@@ -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<AppVersion, AppVersionExample>{
|
||||
@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<AppVersion> 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<AppVersion> appVersionList = appVersionMapper.selectByExample(example);
|
||||
return new PageInfo<>(appVersionList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量更新状态
|
||||
* @param ids
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
private int updateStatusByIds(List<Integer> 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<Integer> 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<AppVersion> 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<Integer> ids) {
|
||||
AppVersionExample example = new AppVersionExample();
|
||||
example.createCriteria().andVersionIdIn(ids);
|
||||
List<AppVersion> dbList = appVersionMapper.selectByExample(example);
|
||||
//更新状态在同一个os和channel分组下只能由一个
|
||||
if (isNeedUpdateStatus(status)){
|
||||
Optional<List<AppVersion>> 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<AppVersion> 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<String> sysConfIdList = Arrays.asList(newestKey);
|
||||
sysConfNacosAdminService.delByIds(sysConfIdList);
|
||||
} catch (NacosException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public List<String> getPlatform(String os){
|
||||
List<String> platformLits = new ArrayList<>();
|
||||
|
||||
List<String> 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<String> 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<AppVersion, AppVersionExample> 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);
|
||||
}
|
||||
}
|
||||
|
@@ -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<SeizeTreasureDailyRecordVo> recordDaily = seizeTreasureAdminMapper.getRecordDaily(
|
||||
recordReq.getPoolTypeList(), recordReq.getPoolGroupList(), recordReq.getPoolLevelList(), userByErbanNo == null ? null : userByErbanNo.getUid(),
|
||||
recordReq.getStartTime(), recordReq.getEndTime());
|
||||
PageInfo<SeizeTreasureDailyRecordVo> 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<SeizeTreasureRecordVo> recordDaily = seizeTreasureAdminMapper.getRecord(
|
||||
recordReq.getPoolTypeList(), recordReq.getPoolGroupList(), recordReq.getPoolLevelList(), userByErbanNo == null ? null : userByErbanNo.getUid(),
|
||||
recordReq.getStartTime(), recordReq.getEndTime());
|
||||
PageInfo<SeizeTreasureRecordVo> 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<SeizeTreasureRecordVo> pagination = getRecord(params, pageReq);
|
||||
List<SeizeTreasureRecordDto> datas = new ArrayList<>();
|
||||
List<SeizeTreasureRecordVo> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -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<SeizeTreasureConvertRecordAdminVo> page(Integer convertType, Integer currentPage, Integer pageSize);
|
||||
}
|
@@ -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<SeizeTreasureConvertItemAdminVo> page(Integer page, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param admin
|
||||
*/
|
||||
void save(SeizeTreasureConvertItemAdminVo admin);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
void del(Long id);
|
||||
}
|
@@ -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<SeizeTreasurePoolDrawRecordAdminVo> totalPage(String startTime, String endTime, Long erBanNo, Integer currentPage, Integer pageSize);
|
||||
}
|
@@ -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<SeizeTreasurePoolItemAdminVo> 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);
|
||||
}
|
@@ -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<SeizeTreasureProp> list(Integer type, Integer level);
|
||||
|
||||
}
|
@@ -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<SeizeTreasureReward> page(PageReq req);
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param reward
|
||||
*/
|
||||
void save(SeizeTreasureReward reward);
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param rewardType
|
||||
* @return
|
||||
*/
|
||||
List<SeizeTreasureReward> list(String rewardType);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
void del(Long id);
|
||||
}
|
@@ -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<SeizeTreasureUserPropRecordAdminVo> 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);
|
||||
|
||||
}
|
@@ -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<SeizeTreasureConvertRecordAdminVo> page(Integer convertType, Integer currentPage, Integer pageSize) {
|
||||
IPage<SeizeTreasureConvertRecord> page = seizeTreasureConvertRecordService.page(new Page<>(currentPage, pageSize), Wrappers.<SeizeTreasureConvertRecord>lambdaQuery()
|
||||
.eq(convertType != null, SeizeTreasureConvertRecord::getConvertType, convertType)
|
||||
.orderByDesc(SeizeTreasureConvertRecord::getCreateTime));
|
||||
List<SeizeTreasureConvertRecord> records = page.getRecords();
|
||||
List<SeizeTreasureConvertRecordAdminVo> admins = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(records)) {
|
||||
List<Long> uidList = records.stream().map(SeizeTreasureConvertRecord::getUid).distinct().collect(Collectors.toList());
|
||||
List<Users> userList = usersBaseService.getUsersListByUids(uidList);
|
||||
for (SeizeTreasureConvertRecord record : records) {
|
||||
SeizeTreasureConvertRecordAdminVo admin = new SeizeTreasureConvertRecordAdminVo();
|
||||
BeanUtils.copyProperties(record, admin);
|
||||
if (CollectionUtil.isNotEmpty(userList)) {
|
||||
Optional<Users> 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<SeizeTreasureConvertRecordAdminVo> iPage = new Page<>(currentPage, pageSize);
|
||||
iPage.setTotal(page.getTotal());
|
||||
iPage.setRecords(admins);
|
||||
return iPage;
|
||||
}
|
||||
}
|
@@ -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<SeizeTreasureConvertItemAdminVo> page(Integer currentPage, Integer pageSize) {
|
||||
IPage<SeizeTreasureConvertItem> iPage = seizeTreasureConvertItemService.page(new Page<>(currentPage, pageSize), Wrappers.<SeizeTreasureConvertItem>lambdaQuery()
|
||||
.orderByDesc(SeizeTreasureConvertItem::getType)
|
||||
.orderByAsc(SeizeTreasureConvertItem::getSeq));
|
||||
List<SeizeTreasureConvertItem> records = iPage.getRecords();
|
||||
List<SeizeTreasureConvertItemAdminVo> admins = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(records)) {
|
||||
List<Long> rewardIds = records.stream().map(SeizeTreasureConvertItem::getRewardId).distinct().collect(Collectors.toList());
|
||||
List<SeizeTreasureReward> seizeTreasureRewards = seizeTreasureRewardService.list(Wrappers.<SeizeTreasureReward>lambdaQuery()
|
||||
.in(SeizeTreasureReward::getId, rewardIds));
|
||||
for (SeizeTreasureConvertItem record : records) {
|
||||
Long rewardId = record.getRewardId();
|
||||
List<Long> propIds = record.getPropIds();
|
||||
List<Integer> 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<SeizeTreasureReward> 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<SeizeTreasureConvertItemAdminVo> 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<Long> propIds = admin.getPropIds();
|
||||
List<Integer> 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);
|
||||
}
|
||||
}
|
@@ -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<SeizeTreasurePoolDrawRecordAdminVo> totalPage(String startTime, String endTime, Long erBanNo, Integer currentPage, Integer pageSize) {
|
||||
List<Long> uidList = null;
|
||||
if (erBanNo != null) {
|
||||
uidList = usersMapper.getUidByErBanNo(String.valueOf(erBanNo));
|
||||
}
|
||||
Page<SeizeTreasurePoolDrawRecordAdminVo> page = seizeTreasurePoolDrawRecordAdminMapper.totalPage(new Page<>(currentPage, pageSize), startTime, endTime, uidList);
|
||||
List<SeizeTreasurePoolDrawRecordAdminVo> records = page.getRecords();
|
||||
if (CollectionUtil.isNotEmpty(records)) {
|
||||
Map<Long, Users> 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;
|
||||
}
|
||||
}
|
@@ -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<SeizeTreasurePoolItemAdminVo> 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<SeizeTreasurePoolItem> poolItems = seizeTreasurePoolItemService.list(Wrappers.<SeizeTreasurePoolItem>lambdaQuery()
|
||||
.eq(SeizeTreasurePoolItem::getPoolType, poolType));
|
||||
if (CollectionUtil.isNotEmpty(poolItems)) {
|
||||
Map<Integer, List<SeizeTreasurePoolItem>> poolGroupMap = poolItems.stream().collect(Collectors.groupingBy(SeizeTreasurePoolItem::getPoolGroup));
|
||||
List<SeizeTreasurePoolItem> 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<SeizeTreasurePoolItem> poolItems = seizeTreasurePoolItemService.getPoolItem(poolType, null, null);
|
||||
if (CollectionUtil.isEmpty(poolItems)) {
|
||||
return deployedItem;
|
||||
}
|
||||
List<SeizeTreasurePoolItemAdminVo> 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<SeizeTreasurePoolItemAdminVo> normalItems = admins.stream().filter(v -> SeizeTreasureConstant.TreasurePoolGroup.BASE.equals(v.getPoolGroup())).collect(Collectors.toList());
|
||||
List<SeizeTreasurePoolItemAdminVo> 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<SeizeTreasurePoolItem> poolItems = seizeTreasurePoolItemService.list(Wrappers.<SeizeTreasurePoolItem>lambdaQuery()
|
||||
.eq(SeizeTreasurePoolItem::getPoolType, poolType));
|
||||
if (CollectionUtil.isEmpty(poolItems)) {
|
||||
return admin;
|
||||
}
|
||||
List<SeizeTreasureReward> seizeTreasureRewards = seizeTreasureRewardMapper.selectBatchIds(poolItems.stream().map(SeizeTreasurePoolItem::getRewardId).distinct().collect(Collectors.toList()));
|
||||
if (CollectionUtil.isEmpty(seizeTreasureRewards)) {
|
||||
return admin;
|
||||
}
|
||||
Map<Long, SeizeTreasureReward> rewardMap = seizeTreasureRewards.stream().collect(Collectors.toMap(SeizeTreasureReward::getId, Function.identity(), (v1, v2) -> v1));
|
||||
Map<Integer, List<SeizeTreasurePoolItem>> 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<SeizeTreasurePoolItem> 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);
|
||||
}
|
||||
}
|
@@ -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<SeizeTreasureProp> list(Integer type, Integer level) {
|
||||
return seizeTreasurePropService.list(Wrappers.<SeizeTreasureProp>lambdaQuery()
|
||||
.eq(type != null, SeizeTreasureProp::getType, type)
|
||||
.eq(level != null, SeizeTreasureProp::getLevel, level));
|
||||
}
|
||||
}
|
@@ -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<SeizeTreasureReward> page(PageReq req) {
|
||||
return (Page<SeizeTreasureReward>) seizeTreasureRewardService.page(new Page<>(req.getPage(), req.getPageSize()), Wrappers.<SeizeTreasureReward>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<SeizeTreasureReward> list(String rewardType) {
|
||||
return seizeTreasureRewardService.list(Wrappers.<SeizeTreasureReward>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);
|
||||
}
|
||||
|
||||
}
|
@@ -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<SeizeTreasureUserPropRecordAdminVo> page(Long erBanNo, String startTime, String endTime, Integer currentPage, Integer pageSize) {
|
||||
List<Long> uidList = null;
|
||||
if (erBanNo != null) {
|
||||
uidList = usersMapper.getUidByErBanNo(String.valueOf(erBanNo));
|
||||
}
|
||||
IPage<SeizeTreasureUserPropRecord> page = seizeTreasureUserPropRecordMapper.selectPage(new Page<>(currentPage, pageSize), Wrappers.<SeizeTreasureUserPropRecord>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<SeizeTreasureUserPropRecord> records = page.getRecords();
|
||||
List<SeizeTreasureUserPropRecordAdminVo> admins = new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(records)) {
|
||||
Map<Long, Users> 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.<SeizeTreasureUserPropRecord>lambdaQuery()
|
||||
.eq(SeizeTreasureUserPropRecord::getType, SeizeTreasureConstant.PropRecordType.COMPOUND_EXPEND)
|
||||
.eq(SeizeTreasureUserPropRecord::getBizId, recordId)));
|
||||
admins.add(admin);
|
||||
}
|
||||
}
|
||||
Page<SeizeTreasureUserPropRecordAdminVo> 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<SeizeTreasureUserPropRecordAdminDto> datas = new ArrayList<>();
|
||||
Page<SeizeTreasureUserPropRecordAdminVo> page = page(erBanNo, startTime, endTime, 1, 1000000);
|
||||
List<SeizeTreasureUserPropRecordAdminVo> records = page.getRecords();
|
||||
if (CollectionUtil.isNotEmpty(records)) {
|
||||
for (SeizeTreasureUserPropRecordAdminVo record : records) {
|
||||
Date createTime = record.getCreateTime();
|
||||
List<SeizeTreasureUserPropRecord> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,53 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.accompany.admin.mapper.GiftCompoundAdminMapper">
|
||||
|
||||
<select id="getGiftCompoundList" resultType="com.accompany.admin.vo.GiftCompoundRewardAdminVo">
|
||||
select gc.id,gp.gift_id,gp.rate,gc.order_no,gp.service_notice,gf.gift_name,gf.gold_price
|
||||
from gift_compound_reward_pool gp
|
||||
left join gift_compound_reward gc on gc.id = gp.reward_id
|
||||
left join gift gf on gf.gift_id = gp.gift_id
|
||||
where gc.reward_type = 1
|
||||
ORDER BY gc.order_no desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getGiftCompoundById" resultType="com.accompany.admin.vo.GiftCompoundRewardAdminVo">
|
||||
select gc.id,gp.gift_id,gp.rate,gc.order_no,gp.service_notice,gf.gift_name,gf.gold_price
|
||||
from gift_compound_reward_pool gp
|
||||
left join gift_compound_reward gc on gc.id = gp.reward_id
|
||||
left join gift gf on gf.gift_id = gp.gift_id
|
||||
where gc.reward_type = 1
|
||||
and gc.id = #{id}
|
||||
ORDER BY gc.order_no desc
|
||||
</select>
|
||||
|
||||
<select id="getGiftCompoundLimitList" resultType="com.accompany.admin.vo.GiftCompoundRewardAdminVo">
|
||||
select gp.id,gp.gift_id,gp.rate,gc.order_no,gp.service_notice,gf.gift_name,gf.gold_price,gp.rate as 'giftRate',gc.expend_value,(gf.gold_price * (gp.rate / 100)) as expectValue
|
||||
from gift_compound_reward_pool gp
|
||||
left join gift_compound_reward gc on gc.id = gp.reward_id
|
||||
left join gift gf on gf.gift_id = gp.gift_id
|
||||
where gc.reward_type = 2 and gc.id = #{rewardId}
|
||||
ORDER BY gp.gift_id,gc.order_no desc
|
||||
</select>
|
||||
|
||||
<select id="getGiftCompoundLimitById" resultType="com.accompany.admin.vo.GiftCompoundRewardAdminVo">
|
||||
select gp.id,gp.gift_id,gp.rate,gc.order_no,gp.service_notice,gf.gift_name,gf.gold_price,gp.rate as 'giftRate',gc.expend_value
|
||||
from gift_compound_reward_pool gp
|
||||
left join gift_compound_reward gc on gc.id = gp.reward_id
|
||||
left join gift gf on gf.gift_id = gp.gift_id
|
||||
where gc.reward_type = 2
|
||||
and gp.id = #{id}
|
||||
ORDER BY gc.order_no desc
|
||||
</select>
|
||||
|
||||
<select id="getPoolItem" resultType="com.accompany.admin.vo.GiftCompoundRewardAdminVo">
|
||||
select gc.id,gc.gift_id,gc.order_no,gf.gift_name,gf.gold_price,gc.expend_value
|
||||
from gift_compound_reward gc, gift gf
|
||||
where gc.gift_id = gf.gift_id and gc.reward_type = 2
|
||||
<if test="id != null">
|
||||
and gc.id = #{id}
|
||||
</if>
|
||||
ORDER BY gc.order_no desc
|
||||
</select>
|
||||
</mapper>
|
@@ -1,87 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.accompany.admin.mapper.linearlypool.LinearlyPoolAdminMapper" >
|
||||
<resultMap id="BaseResultMap" type="com.accompany.admin.vo.linearlypool.LinearlyPoolDrawRecordStatisVo">
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
<result column="count_num" property="countNum" jdbcType="INTEGER" />
|
||||
<result column="user_total_pay" property="userTotalPay" jdbcType="BIGINT" />
|
||||
<result column="total_platform_value" property="totalPlatformValue" jdbcType="BIGINT" />
|
||||
<result column="total_actual_value" property="totalActualValue" jdbcType="BIGINT" />
|
||||
<result column="total_gift_actual_value" property="totalGiftActualValue" jdbcType="BIGINT" />
|
||||
<result column="total_not_gift_actual_value" property="totalNotGiftActualValue" jdbcType="BIGINT" />
|
||||
<result column="total_real_gift_actual_value" property="totalRealGiftActualValue" jdbcType="BIGINT" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="UserDrawStatisResultMap" type="com.accompany.admin.vo.linearlypool.UserDrawStatisAdminVo" >
|
||||
<result column="uid" property="uid" jdbcType="BIGINT" />
|
||||
<result column="total_purchase_money" property="totalPurchaseMoney" jdbcType="BIGINT" />
|
||||
<result column="total_draw_money" property="totalDrawMoney" jdbcType="BIGINT" />
|
||||
<result column="total_platform_value" property="totalPlatformValue" jdbcType="BIGINT" />
|
||||
<result column="total_actual_value" property="totalActualValue" jdbcType="BIGINT" />
|
||||
<result column="deviation" property="deviation" jdbcType="BIGINT"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getDrawStaticList" resultMap="BaseResultMap">
|
||||
select
|
||||
count(1) as count_num,
|
||||
sum(key_price) as user_total_pay,
|
||||
sum(platform_value) as total_platform_value,
|
||||
sum(actual_value) as total_actual_value,
|
||||
sum(case when prize_type = 2 then actual_value else 0 end) total_gift_actual_value,
|
||||
sum(case when prize_type != 2 then actual_value else 0 end) as total_not_gift_actual_value,
|
||||
sum(case when prize_type = 6 then actual_value else 0 end) as total_real_gift_actual_value
|
||||
from
|
||||
<choose>
|
||||
<when test="tableType == 'days'">
|
||||
linearly_prize_pool_draw_line_item_day
|
||||
</when>
|
||||
<otherwise>
|
||||
linearly_prize_pool_draw_line_item
|
||||
</otherwise>
|
||||
</choose>
|
||||
where draw_status = ${@com.accompany.common.constant.Constant$LinearlyPoolDrawStatus@HAS_DRAW}
|
||||
<if test="startTime != null">
|
||||
and draw_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and draw_time <= #{endTime}
|
||||
</if>
|
||||
<if test="uid != null">
|
||||
and uid = #{uid}
|
||||
</if>
|
||||
|
||||
</select>
|
||||
<select id="getUserStatisList" resultMap="UserDrawStatisResultMap">
|
||||
select
|
||||
a.*,
|
||||
a.total_draw_money - a.total_actual_value as deviation
|
||||
from(select
|
||||
uid,
|
||||
sum(key_price) as total_purchase_money,
|
||||
sum(key_price) as total_draw_money,
|
||||
sum(actual_value) as total_actual_value,
|
||||
sum(platform_value) as total_platform_value
|
||||
from linearly_prize_pool_draw_line_item
|
||||
WHERE draw_status = ${@com.accompany.common.constant.Constant$LinearlyPoolDrawStatus@HAS_DRAW}
|
||||
<if test="uid != null">
|
||||
and uid = #{uid}
|
||||
</if>
|
||||
<if test="startTime !=null and startTime != ''">
|
||||
and draw_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime !=null and endTime != ''">
|
||||
and draw_time <= #{endTime}
|
||||
</if>
|
||||
group by uid
|
||||
) a
|
||||
where 1 = 1
|
||||
<if test="maxDis !=null">
|
||||
and ( a.total_draw_money - a.total_actual_value) <= #{maxDis}
|
||||
</if>
|
||||
<if test="minDis !=null">
|
||||
and ( a.total_draw_money - a.total_actual_value) >= #{minDis}
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
@@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.accompany.admin.mapper.chat.PublicChatTopRecordAdminMapper">
|
||||
<select id="selectPage" resultType="com.accompany.admin.vo.chat.PublicChatTopRecordAdminVo">
|
||||
select
|
||||
u.erban_no as erbanNo,
|
||||
u.nick,
|
||||
pi.`desc` as partitionDesc,
|
||||
pctr.uid,
|
||||
pctr.pay_money_num as payMoneyNum,
|
||||
pctr.create_time as createTime,
|
||||
pctr.content
|
||||
from public_chat_top_record as pctr
|
||||
left join users as u on u.uid = pctr.uid
|
||||
left join partition_info as pi on pi.id = u.partition_id
|
||||
<where>
|
||||
<if test="erbanNo != null">
|
||||
and u.erban_no = #{erbanNo}
|
||||
</if>
|
||||
<if test="partitionId != null">
|
||||
and u.partition_id = #{partitionId}
|
||||
</if>
|
||||
<if test="startTime != null and startTime !=''">
|
||||
and pctr.create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime !=''">
|
||||
and pctr.create_time <= #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
order by pctr.create_time desc
|
||||
</select>
|
||||
</mapper>
|
@@ -1,97 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.accompany.admin.mapper.treasure.SeizeTreasureAdminMapper">
|
||||
<select id="getRecordTotal" resultType="com.accompany.business.vo.treasure.record.SeizeTreasureStaticVo">
|
||||
select
|
||||
count(distinct stpdr.uid) as drawPeopleNum,
|
||||
count(if(stpdr.pool_type = 1, stpdr.id, null)) as drawCountNum,
|
||||
sum(if(stpdr.pool_type = 1, 100, 0)) as drawInputValue,
|
||||
ifnull(sum(ifnull(stpdr.reward_value, 0) * ifnull(stpdr.reward_num, 0)), 0) as drawOutputValue,
|
||||
sum(if(stpdr.reward_type = 'gift', (ifnull(stpdr.reward_value, 0) * ifnull(stpdr.reward_num, 0)), 0)) as drawOutputGiftValue,
|
||||
sum(if(stpdr.reward_type = 'activityProps', (ifnull(stpdr.reward_value, 0) * ifnull(stpdr.reward_num, 0)), 0)) as drawOutputPropValue
|
||||
from
|
||||
seize_treasure_pool_draw_record as stpdr
|
||||
where 1 = 1
|
||||
<if test="uid != null" >
|
||||
and stpdr.uid = #{uid}
|
||||
</if>
|
||||
<if test="startTime != null" >
|
||||
and stpdr.create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null" >
|
||||
and stpdr.create_time < #{endTime}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getRecordDaily" resultType="com.accompany.admin.vo.treasure.SeizeTreasureDailyRecordVo">
|
||||
SELECT
|
||||
date(stpdr.create_time) as dateStr,
|
||||
count(distinct stpdr.uid) as drawPeopleNum,
|
||||
count(if(stpdr.pool_type = 1, stpdr.id, null)) as drawCountNum,
|
||||
sum(if(stpdr.pool_type = 1, 100, 0)) as drawInputValue,
|
||||
ifnull(sum(ifnull(stpdr.reward_value, 0) * ifnull(stpdr.reward_num, 0)), 0) as drawOutputValue,
|
||||
sum(if(stpdr.reward_type = 'gift', (ifnull(stpdr.reward_value, 0) * ifnull(stpdr.reward_num, 0)), 0)) as drawOutputGiftValue,
|
||||
sum(if(stpdr.reward_type = 'activityProps', (ifnull(stpdr.reward_value, 0) * ifnull(stpdr.reward_num, 0)), 0)) as drawOutputPropValue
|
||||
from seize_treasure_pool_draw_record stpdr
|
||||
where 1 = 1
|
||||
<if test="uid != null" >
|
||||
and stpdr.uid = #{uid}
|
||||
</if>
|
||||
<if test="startTime != null" >
|
||||
and stpdr.create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null" >
|
||||
and stpdr.create_time < #{endTime}
|
||||
</if>
|
||||
group by dateStr
|
||||
</select>
|
||||
<select id="getRecord" resultType="com.accompany.admin.vo.treasure.SeizeTreasureRecordVo">
|
||||
SELECT
|
||||
stpdr.id,
|
||||
u.erban_no,
|
||||
u.nick AS userNick,
|
||||
( CASE stpdr.pool_type WHEN 1 THEN '夺宝奖池' WHEN 2 THEN '幸运值奖池' WHEN 3 THEN '森林奖池' END ) AS poolType,
|
||||
IF( stpdr.pool_group = 1, '基础奖池组', '高级奖池组' ) AS poolGroup,
|
||||
( CASE stpdr.pool_level WHEN 1 THEN '初级奖池' WHEN 2 THEN '中级奖池' WHEN 3 THEN '高级奖池' END ) AS poolLevel,
|
||||
stpdr.reward_id,
|
||||
str.reward_ref_id,
|
||||
(CASE str.reward_type WHEN 'gift' THEN '礼物' WHEN 'activityProps' THEN '活动道具' ELSE '其他' END) AS rewardType,
|
||||
str.reward_name,
|
||||
str.reward_num,
|
||||
str.reward_level,
|
||||
str.reward_show_value,
|
||||
stpdr.create_time
|
||||
FROM
|
||||
seize_treasure_pool_draw_record stpdr
|
||||
LEFT JOIN seize_treasure_reward str ON stpdr.reward_id = str.id
|
||||
left join users u on stpdr.uid = u.uid
|
||||
WHERE 1 = 1
|
||||
<if test="poolTypeList != null and poolTypeList.size > 0">
|
||||
and stpdr.pool_type IN
|
||||
<foreach collection="poolTypeList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="uid != null" >
|
||||
AND stpdr.uid = #{uid}
|
||||
</if>
|
||||
<if test="poolGroupList != null and poolGroupList.size() > 0">
|
||||
AND stpdr.pool_group IN
|
||||
<foreach collection="poolGroupList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="poolLevelList != null and poolLevelList.size() > 0">
|
||||
AND stpdr.pool_level IN
|
||||
<foreach collection="poolLevelList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="startTime != null" >
|
||||
AND stpdr.create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null" >
|
||||
AND stpdr.create_time < #{endTime}
|
||||
</if>
|
||||
ORDER BY stpdr.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
@@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.accompany.admin.mapper.treasure.SeizeTreasurePoolDrawRecordAdminMapper">
|
||||
<select id="totalPage" resultType="com.accompany.admin.vo.treasure.SeizeTreasurePoolDrawRecordAdminVo">
|
||||
select
|
||||
stpdr.uid,
|
||||
(count(1) * 100) as drawAmount,
|
||||
ifnull(sum(ifnull(stpdr.reward_value, 0) * ifnull(stpdr.reward_num, 0)), 0) as rewardAmount
|
||||
from seize_treasure_pool_draw_record as stpdr
|
||||
where 1 = 1
|
||||
<if test="uidList != null and uidList.size > 0">
|
||||
and stpdr.uid in
|
||||
<foreach collection="uidList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
and stpdr.create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
and stpdr.create_time < #{endTime}
|
||||
</if>
|
||||
group by stpdr.uid
|
||||
order by rewardAmount desc
|
||||
</select>
|
||||
</mapper>
|
@@ -1,40 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.accompany.admin.mapper.treasure.SeizeTreasurePoolItemAdminMapper">
|
||||
<select id="page" resultType="com.accompany.admin.vo.treasure.SeizeTreasurePoolItemAdminVo">
|
||||
select
|
||||
stpi.id,
|
||||
stpi.pool_type as poolType,
|
||||
stpi.pool_group as poolGroup,
|
||||
stpi.pool_level as poolLevel,
|
||||
stpi.reward_id as rewardId,
|
||||
stpi.pool_num as poolNum,
|
||||
stpi.ratio,
|
||||
stpi.show_ratio as showRatio,
|
||||
stpi.item_index as itemIndex,
|
||||
stpi.item_order as itemOrder,
|
||||
stpi.creator,
|
||||
stpi.create_time as createTime,
|
||||
stpi.update_time as updateTime,
|
||||
str.reward_name as rewardName,
|
||||
str.reward_value as rewardValue,
|
||||
str.reward_show_value as rewardShowValue
|
||||
from seize_treasure_pool_item as stpi
|
||||
left join seize_treasure_reward as str on str.id = stpi.reward_id
|
||||
<where>
|
||||
<if test="rewardName != null and rewardName != ''">
|
||||
and str.reward_name like concat('%', #{rewardName}, '%')
|
||||
</if>
|
||||
<if test="poolType != null">
|
||||
and stpi.pool_type = #{poolType}
|
||||
</if>
|
||||
<if test="poolGroup != null">
|
||||
and stpi.pool_group = #{poolGroup}
|
||||
</if>
|
||||
<if test="poolLevel != null">
|
||||
and stpi.pool_level = #{poolLevel}
|
||||
</if>
|
||||
</where>
|
||||
order by stpi.pool_type, stpi.pool_group, stpi.item_order
|
||||
</select>
|
||||
</mapper>
|
@@ -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<Void> initData() {
|
||||
analysisAdminService.initData();
|
||||
return BusiResult.success();
|
||||
}
|
||||
}
|
@@ -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<AnchorWhitelist> 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@@ -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<AnchorFansTeamAudioRecordVo> 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, "操作成功");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@@ -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<String, Object> 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<String, Object> 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");
|
||||
}
|
||||
}
|
@@ -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<AnchorBillRecord> 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<AnchorBillCheck> 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;
|
||||
}
|
||||
|
||||
}
|
@@ -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<UserAudioCardAdminVo> page(Page<UserAudioCardAdminVo> page,
|
||||
Long erbanNo, String startTime, String endTime, Byte status){
|
||||
audioCardAdminService.page(page, erbanNo, startTime, endTime, status);
|
||||
return new PageResult<>(page);
|
||||
}
|
||||
|
||||
@PostMapping("/verify")
|
||||
public BusiResult<Void> verify(Long id, Byte status){
|
||||
int adminId = getAdminId();
|
||||
String adminName = adminUserService.getAdminName(adminId);
|
||||
audioCardAdminService.operate(id, status, adminName);
|
||||
return new BusiResult<>(BusiStatus.SUCCESS);
|
||||
}
|
||||
|
||||
}
|
@@ -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<RedeemCode> 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<String> 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);
|
||||
}
|
||||
}
|
||||
}
|
@@ -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<LuckyTarotRecordVo> 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<TarotRecordStatisVo> 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());
|
||||
}
|
||||
}
|
@@ -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<PublicChatTopRecordAdminVo>> page(Long erbanNo, String startTime, String endTime, Integer partitionId, Integer pageNum, Integer pageSize) {
|
||||
return BusiResult.success(publicChatTopRecordAdminService.page(erbanNo, startTime, endTime, partitionId, pageNum, pageSize));
|
||||
}
|
||||
}
|
@@ -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);
|
||||
}
|
||||
}
|
@@ -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<GiftCompoundRewardAdminVo> 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<GiftCompoundRewardAdminVo> 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<GiftCompoundRewardAdminVo> 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<GiftCompoundRewardAdminVo> 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);
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -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<HomeNewFriendAdminVo> page(PageReq req) {
|
||||
return new PageResult<>(homeNewFriendAdminService.page(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param erBanNoStr
|
||||
* @param expireTimeStr
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("保存")
|
||||
@PostMapping("save")
|
||||
public BusiResult<Void> save(String erBanNoStr, String expireTimeStr) {
|
||||
homeNewFriendAdminService.save(erBanNoStr, expireTimeStr);
|
||||
return BusiResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param uid
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("删除")
|
||||
@DeleteMapping("del")
|
||||
public BusiResult<Void> del(Long uid) {
|
||||
homeNewFriendAdminService.del(uid);
|
||||
return BusiResult.success();
|
||||
}
|
||||
|
||||
}
|
@@ -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<LinearlyPoolItemAdminPageVO> getPrizeGroupsInfo() {
|
||||
LinearlyPoolItemAdminPageVO result = linearlyPoolItemAdminService.getPrizeGroupsInfo();
|
||||
|
||||
return new BusiResult<>(BusiStatus.SUCCESS, result);
|
||||
}
|
||||
|
||||
@GetMapping("/listDeployedPoolItems")
|
||||
public BusiResult<List<PrizeItemVO>> listDeployedPoolItems() {
|
||||
List<PrizeItemVO> 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<LinearlyPoolDeployResultVO> 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);
|
||||
}
|
||||
}
|
@@ -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<String> 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<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));
|
||||
}
|
||||
}
|
@@ -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<UsersVo> userList = userService.getUserList(ernos, page, pageSize);
|
||||
List<Long> uids = userList.stream().map(item -> item.getUid()).collect(Collectors.toList());
|
||||
// List<UsersVo> userList = userService.getUserList(ernos, page, pageSize);
|
||||
// List<Long> uids = userList.stream().map(item -> item.getUid()).collect(Collectors.toList());
|
||||
|
||||
List<UserKeyVo> list = officialGiveKeyService.getUserPrizeKeyBatch(uids);
|
||||
int count = userService.getUserCount(ernos);
|
||||
Map<String, Object> data = Maps.newHashMap();
|
||||
data.put("total", count);
|
||||
data.put("rows", list);
|
||||
writeJson(JSONObject.toJSONString(data));
|
||||
// List<UserKeyVo> list = officialGiveKeyService.getUserPrizeKeyBatch(uids);
|
||||
// int count = userService.getUserCount(ernos);
|
||||
// Map<String, Object> 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, "查询失败");
|
||||
|
@@ -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<UsersVo> list = userService.getUserList(ernos, page, pageSize);
|
||||
int count = userService.getUserCount(ernos);
|
||||
Map<String, Object> data = Maps.newHashMap();
|
||||
data.put("total", count);
|
||||
data.put("rows", list);
|
||||
writeJson(JSONObject.toJSONString(data));
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping("/record")
|
||||
|
@@ -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;
|
||||
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<PageResult<SmsRecord>> page(PageReq pageReq, String phone) {
|
||||
Page<SmsRecord> pageInfo = smsRecordAdminService.page(pageReq, phone);
|
||||
return BusiResult.success(new PageResult<>(pageInfo));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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<AppVersion> 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<Integer> 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<Integer> 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<String> 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<UploadFileInfoVo> 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<String, Object> 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<String, Object> 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<String, Object> 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, "推送成功");
|
||||
}*/
|
||||
}
|
@@ -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<Integer> DEFAULT_POOL_TYPE_LIST = Arrays.asList(
|
||||
SeizeTreasureConstant.PoolType.TREASURE, SeizeTreasureConstant.PoolType.TREASURE_DRAW_NUM, SeizeTreasureConstant.PoolType.FOREST);
|
||||
|
||||
@GetMapping("/treasure/record/total")
|
||||
public BusiResult<SeizeTreasureStaticVo> 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));
|
||||
}
|
||||
}
|
@@ -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<SeizeTreasureConvertRecordAdminVo> page(Integer convertType, PageReq req) {
|
||||
return new PageResult<>(seizeTreasureConvertRecordAdminService.page(convertType, req.getPage(), req.getPageSize()));
|
||||
}
|
||||
}
|
@@ -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<SeizeTreasureConvertItemAdminVo> page(PageReq req) {
|
||||
return new PageResult<>(seizeTreasureCovertItemAdminService.page(req.getPage(), req.getPageSize()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param admin
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("保存")
|
||||
@PostMapping("save")
|
||||
public BusiResult<Void> save(SeizeTreasureConvertItemAdminVo admin) {
|
||||
seizeTreasureCovertItemAdminService.save(admin);
|
||||
return BusiResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("删除")
|
||||
@GetMapping("del")
|
||||
public BusiResult<Void> del(Long id) {
|
||||
seizeTreasureCovertItemAdminService.del(id);
|
||||
return BusiResult.success();
|
||||
}
|
||||
|
||||
}
|
@@ -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<SeizeTreasurePoolDrawRecordAdminVo> totalPage(String startTime, String endTime, Long erbanNo, PageReq req) {
|
||||
return new PageResult<>(seizeTreasurePoolDrawRecordAdminService.totalPage(startTime, endTime, erbanNo, req.getPage(), req.getPageSize()));
|
||||
}
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user