清理废弃功能代码

This commit is contained in:
2025-09-17 14:44:44 +08:00
parent ce25fa666c
commit 2f0b55098a
938 changed files with 78 additions and 75731 deletions

View File

@@ -1,24 +0,0 @@
package com.accompany.admin.dto;
import lombok.Data;
import java.util.Date;
/**
* {这里添加描述}
*
* @author fangchengyan
* @date 2020-02-20 2:49 下午
*/
@Data
public class ChannelDistributeSearchDto {
private String appId;
private String channel;
private Date startTime;
private Date endTime;
}

View File

@@ -1,106 +0,0 @@
package com.accompany.admin.dto;
import java.util.Date;
/**
* 后台 头条数据
*/
public class TopLineRequestDto {
private Long id;
private String title;
// 0 是没有跳转 1是跳转链接 2是房间id
private Integer paramType;
private String params;
/**
* 图片 路径
*/
private String img;
/**
* 是否发布
*/
private Boolean publish = false;
/**
* 发布时间
*/
private Long publishTime;
/**
* 发布时间
*/
private Date publishTimeDate;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getImg() {
return img;
}
public void setImg(String img) {
this.img = img;
}
public boolean isPublish() {
return publish;
}
public void setPublish(boolean publish) {
this.publish = publish;
}
public Long getPublishTime() {
return publishTime;
}
public void setPublishTime(Long publishTime) {
this.publishTime = publishTime;
}
public Integer getParamType() {
return paramType;
}
public void setParamType(Integer paramType) {
this.paramType = paramType;
}
public String getParams() {
return params;
}
public void setParams(String params) {
this.params = params;
}
public Date getPublishTimeDate() {
return publishTimeDate;
}
public void setPublishTimeDate(Date publishTimeDate) {
this.publishTimeDate = publishTimeDate;
}
}

View File

@@ -1,159 +0,0 @@
package com.accompany.admin.dto.batch;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* @author: liaozetao
* @date: 2023/9/22 18:36
* @description:
*/
@Data
public class FlowDataBatchSearchDetailAdminDto {
/**
* 新增时间
*/
@ExcelProperty("新增时间")
private String signUpTimeStr;
/**
* 新增归因ID
*/
@ExcelProperty("新增归因ID")
private Long erBanNo;
/**
* 用户昵称
*/
@ExcelProperty("用户昵称")
private String nick;
/**
* 是否进归因房
*/
@ExcelProperty("是否进归因房")
private String isInRoomStr = "";
/**
* 设备号
*/
@ExcelProperty("设备号")
private String deviceId;
/**
* 是否为新设备
*/
@ExcelProperty("是否为新设备")
private String isNewDevice = "";
/**
* 活动期间私聊行为数
*/
@ExcelProperty("活动期间私聊行为数")
private Integer chatCount = 0;
/**
* 新增当天充值
*/
@ExcelProperty("新增当天充值")
private BigDecimal chargeAmount = BigDecimal.ZERO;
/**
* 3天充值
*/
@ExcelProperty("3天充值")
private BigDecimal threeChargeAmount = BigDecimal.ZERO;
/**
* 7天充值
*/
@ExcelProperty("7天充值")
private BigDecimal sevenChargeAmount = BigDecimal.ZERO;
/**
* 15天充值
*/
@ExcelProperty("15天充值")
private BigDecimal fifteenChargeAmount = BigDecimal.ZERO;
/**
* 30天充值
*/
@ExcelProperty("30天充值")
private BigDecimal thirtyChargeAmount = BigDecimal.ZERO;
/**
* 新增当天收到转赠
*/
@ExcelProperty("新增当天收到转赠")
private BigDecimal giveDiamondNum = BigDecimal.ZERO;
/**
* 3天收到转赠
*/
@ExcelProperty("3天收到转赠")
private BigDecimal threeGiveDiamondNum = BigDecimal.ZERO;
/**
* 7天收到转赠
*/
@ExcelProperty("7天收到转赠")
private BigDecimal sevenGiveDiamondNum = BigDecimal.ZERO;
/**
* 15天收到转赠
*/
@ExcelProperty("15天收到转赠")
private BigDecimal fifteenGiveDiamondNum = BigDecimal.ZERO;
/**
* 30天收到转赠
*/
@ExcelProperty("30天收到转赠")
private BigDecimal thirtyGiveDiamondNum = BigDecimal.ZERO;
/**
* 累计充值
*/
@ExcelProperty("累计充值")
private BigDecimal totalChargeAmount = BigDecimal.ZERO;
/**
* 累计接受转赠钻石
*/
@ExcelProperty("累计接受转赠钻石")
private BigDecimal totalGiveDiamondNum = BigDecimal.ZERO;
/**
* 次日是否访问
*/
@ExcelProperty("次日是否访问")
private Integer isRemain = 0;
/**
* 第3日是否访问
*/
@ExcelProperty("第3日是否访问")
private Integer isThreeRemain = 0;
/**
* 第7日是否访问
*/
@ExcelProperty("第7日是否访问")
private Integer isSevenRemain = 0;
/**
* 第15日是否访问
*/
@ExcelProperty("第15日是否访问")
private Integer isFifteenRemain = 0;
/**
* 第30日是否访问
*/
@ExcelProperty("第30日是否访问")
private Integer isThirtyRemain = 0;
}

View File

@@ -1,64 +0,0 @@
package com.accompany.admin.dto.batch;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import lombok.Data;
/**
* @author: liaozetao
* @date: 2023/9/23 16:07
* @description:
*/
@Data
@ApiModel
public class FlowDataBatchSearchGrowAdminDto {
/**
* 统计项
*/
@ExcelProperty("统计项")
private String countItem;
/**
* 当天情况
*/
@ExcelProperty("当天情况")
private String currCondition;
/**
* 次日情况
*/
@ExcelProperty("次日情况")
private String nextCondition;
/**
* 3日情况
*/
@ExcelProperty("3日情况")
private String threeCondition;
/**
* 7日情况
*/
@ExcelProperty("7日情况")
private String sevenCondition;
/**
* 15日情况
*/
@ExcelProperty("15日情况")
private String fifteenCondition;
/**
* 30日情况
*/
@ExcelProperty("30日情况")
private String thirtyCondition;
/**
* 累计到目前
*/
@ExcelProperty("累计到目前")
private String totalCondition;
}

View File

@@ -1,76 +0,0 @@
package com.accompany.admin.dto.gamepartner;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* @author: liaozetao
* @date: 2023/8/24 16:51
* @description:
*/
@Data
public class GamePartnerOrderAdminDto {
/**
* 订单号
*/
@ExcelProperty("订单号")
private String orderNo;
/**
* 下单用户id
*/
@ExcelProperty("下单用户id")
private Long fromErBanNo;
/**
* 下单用户昵称
*/
@ExcelProperty("下单用户昵称")
private String fromNick;
/**
* 接单用户id
*/
@ExcelProperty("接单用户id")
private Long toErBanNo;
/**
* 接单用户昵称
*/
@ExcelProperty("接单用户昵称")
private String toNick;
/**
* 接单用户收益(水晶)
*/
@ExcelProperty("接单用户收益(水晶)")
private BigDecimal income;
/**
* 下单游戏
*/
@ExcelProperty("下单游戏")
private String gameName;
/**
* 下单局数
*/
@ExcelProperty("下单局数")
private Integer inning;
/**
* 下单金额
*/
@ExcelProperty("下单金额")
private BigDecimal amount;
/**
* 下单时间
*/
@ExcelProperty("下单时间")
private String orderTime;
}

View File

@@ -1,39 +0,0 @@
package com.accompany.admin.dto.withdraw;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
/**
* @author: liaozetao
* @date: 2023/7/13 17:20
* @description:
*/
@Data
public class WithdrawUserAdminDto {
/**
* 耳伴号
*/
@ExcelProperty("Peko号")
private Long erbanNo;
/**
* 昵称
*/
@ExcelProperty("昵称")
private String nick;
/**
* 创建时间
*/
@ExcelProperty("首次绑定时间")
private String createTimeStr;
/**
* 提现账户
*/
@ExcelProperty("提现账户")
private String withdrawAccount;
}

View File

@@ -1,22 +0,0 @@
package com.accompany.admin.dto.withdraw;
import com.accompany.business.model.withdraw.WithdrawUserLimit;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author: liaozetao
* @date: 2023/7/10 18:40
* @description:
*/
@Data
@ApiModel
public class WithdrawUserLimitAdminDto extends WithdrawUserLimit {
/**
* 耳伴号
*/
@ApiModelProperty("耳伴号")
private String erbanNo;
}

View File

@@ -1,68 +0,0 @@
package com.accompany.admin.dto.withdraw;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
/**
* @author: liaozetao
* @date: 2023/8/3 19:16
* @description:
*/
@Data
public class WithdrawUserLimitExportDto {
/**
* Peko号
*/
@ExcelProperty("Peko号")
private Long erbanNo;
/**
* 昵称
*/
@ExcelProperty("昵称")
private String nick;
/**
* 所属房间
*/
@ExcelProperty("所属房间")
private String roomName;
/**
* 所属房间ID
*/
@ExcelProperty("所属房间ID")
private Long roomErBanNo;
/**
* 所属公会
*/
@ExcelProperty("所属公会")
private String hallRoomName;
/**
* 所属公会ID
*/
@ExcelProperty("所属公会ID")
private Long hallErBanNo;
/**
* 当前账户金币余额
*/
@ExcelProperty("当前账户金币余额")
private Double golds;
/**
* 限制内容
*/
@ExcelProperty("限制内容")
private String limitContent;
/**
* 限制时间
*/
@ExcelProperty("限制时间")
private String limitTimeStr;
}

View File

@@ -1,75 +0,0 @@
package com.accompany.admin.dto.withdraw;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* @author: liaozetao
* @date: 2023/7/13 17:12
* @description:
*/
@Data
public class WithdrawUserRecordAdminDto {
/**
* 平台号
*/
@ExcelProperty("Peko号")
private String erbanNo;
/**
* 昵称
*/
@ExcelProperty("昵称")
private String nick;
/**
* 用户当前状态
*/
@ExcelProperty("用户当前状态")
private String blockStatusName;
/**
* 创建时间
*/
@ExcelProperty("申请时间")
private String createTimeStr;
/**
* 提现账户
*/
@ExcelProperty("提现账户")
private String accountName;
/**
* 提现金额
*/
@ExcelProperty("提现金额USD")
private BigDecimal cashAmount;
/**
* 币种类型
*/
@ExcelProperty("发放币种")
private String currency;
/**
* 币种金额
*/
@ExcelProperty("发放金额")
private BigDecimal currencyAmount;
/**
* 手续费
*/
@ExcelProperty("手续费")
private String handlingRateStr;
/**
* 金币数量
*/
@ExcelProperty("核销金币")
private Integer goldNum;
}

View File

@@ -1,55 +0,0 @@
package com.accompany.admin.model;
import java.util.Date;
public class AdminDict extends AdminDictKey {
private String dictval;
private Boolean status;
private Integer showorder;
private Date createtime;
private String description;
public String getDictval() {
return dictval;
}
public void setDictval(String dictval) {
this.dictval = dictval == null ? null : dictval.trim();
}
public Boolean getStatus() {
return status;
}
public void setStatus(Boolean status) {
this.status = status;
}
public Integer getShoworder() {
return showorder;
}
public void setShoworder(Integer showorder) {
this.showorder = showorder;
}
public Date getCreatetime() {
return createtime;
}
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
}

View File

@@ -1,661 +0,0 @@
package com.accompany.admin.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class AdminDictExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public AdminDictExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andCodeIsNull() {
addCriterion("code is null");
return (Criteria) this;
}
public Criteria andCodeIsNotNull() {
addCriterion("code is not null");
return (Criteria) this;
}
public Criteria andCodeEqualTo(String value) {
addCriterion("code =", value, "code");
return (Criteria) this;
}
public Criteria andCodeNotEqualTo(String value) {
addCriterion("code <>", value, "code");
return (Criteria) this;
}
public Criteria andCodeGreaterThan(String value) {
addCriterion("code >", value, "code");
return (Criteria) this;
}
public Criteria andCodeGreaterThanOrEqualTo(String value) {
addCriterion("code >=", value, "code");
return (Criteria) this;
}
public Criteria andCodeLessThan(String value) {
addCriterion("code <", value, "code");
return (Criteria) this;
}
public Criteria andCodeLessThanOrEqualTo(String value) {
addCriterion("code <=", value, "code");
return (Criteria) this;
}
public Criteria andCodeLike(String value) {
addCriterion("code like", value, "code");
return (Criteria) this;
}
public Criteria andCodeNotLike(String value) {
addCriterion("code not like", value, "code");
return (Criteria) this;
}
public Criteria andCodeIn(List<String> values) {
addCriterion("code in", values, "code");
return (Criteria) this;
}
public Criteria andCodeNotIn(List<String> values) {
addCriterion("code not in", values, "code");
return (Criteria) this;
}
public Criteria andCodeBetween(String value1, String value2) {
addCriterion("code between", value1, value2, "code");
return (Criteria) this;
}
public Criteria andCodeNotBetween(String value1, String value2) {
addCriterion("code not between", value1, value2, "code");
return (Criteria) this;
}
public Criteria andDictkeyIsNull() {
addCriterion("dictkey is null");
return (Criteria) this;
}
public Criteria andDictkeyIsNotNull() {
addCriterion("dictkey is not null");
return (Criteria) this;
}
public Criteria andDictkeyEqualTo(String value) {
addCriterion("dictkey =", value, "dictkey");
return (Criteria) this;
}
public Criteria andDictkeyNotEqualTo(String value) {
addCriterion("dictkey <>", value, "dictkey");
return (Criteria) this;
}
public Criteria andDictkeyGreaterThan(String value) {
addCriterion("dictkey >", value, "dictkey");
return (Criteria) this;
}
public Criteria andDictkeyGreaterThanOrEqualTo(String value) {
addCriterion("dictkey >=", value, "dictkey");
return (Criteria) this;
}
public Criteria andDictkeyLessThan(String value) {
addCriterion("dictkey <", value, "dictkey");
return (Criteria) this;
}
public Criteria andDictkeyLessThanOrEqualTo(String value) {
addCriterion("dictkey <=", value, "dictkey");
return (Criteria) this;
}
public Criteria andDictkeyLike(String value) {
addCriterion("dictkey like", value, "dictkey");
return (Criteria) this;
}
public Criteria andDictkeyNotLike(String value) {
addCriterion("dictkey not like", value, "dictkey");
return (Criteria) this;
}
public Criteria andDictkeyIn(List<String> values) {
addCriterion("dictkey in", values, "dictkey");
return (Criteria) this;
}
public Criteria andDictkeyNotIn(List<String> values) {
addCriterion("dictkey not in", values, "dictkey");
return (Criteria) this;
}
public Criteria andDictkeyBetween(String value1, String value2) {
addCriterion("dictkey between", value1, value2, "dictkey");
return (Criteria) this;
}
public Criteria andDictkeyNotBetween(String value1, String value2) {
addCriterion("dictkey not between", value1, value2, "dictkey");
return (Criteria) this;
}
public Criteria andDictvalIsNull() {
addCriterion("dictval is null");
return (Criteria) this;
}
public Criteria andDictvalIsNotNull() {
addCriterion("dictval is not null");
return (Criteria) this;
}
public Criteria andDictvalEqualTo(String value) {
addCriterion("dictval =", value, "dictval");
return (Criteria) this;
}
public Criteria andDictvalNotEqualTo(String value) {
addCriterion("dictval <>", value, "dictval");
return (Criteria) this;
}
public Criteria andDictvalGreaterThan(String value) {
addCriterion("dictval >", value, "dictval");
return (Criteria) this;
}
public Criteria andDictvalGreaterThanOrEqualTo(String value) {
addCriterion("dictval >=", value, "dictval");
return (Criteria) this;
}
public Criteria andDictvalLessThan(String value) {
addCriterion("dictval <", value, "dictval");
return (Criteria) this;
}
public Criteria andDictvalLessThanOrEqualTo(String value) {
addCriterion("dictval <=", value, "dictval");
return (Criteria) this;
}
public Criteria andDictvalLike(String value) {
addCriterion("dictval like", value, "dictval");
return (Criteria) this;
}
public Criteria andDictvalNotLike(String value) {
addCriterion("dictval not like", value, "dictval");
return (Criteria) this;
}
public Criteria andDictvalIn(List<String> values) {
addCriterion("dictval in", values, "dictval");
return (Criteria) this;
}
public Criteria andDictvalNotIn(List<String> values) {
addCriterion("dictval not in", values, "dictval");
return (Criteria) this;
}
public Criteria andDictvalBetween(String value1, String value2) {
addCriterion("dictval between", value1, value2, "dictval");
return (Criteria) this;
}
public Criteria andDictvalNotBetween(String value1, String value2) {
addCriterion("dictval not between", value1, value2, "dictval");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("status is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("status is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Boolean value) {
addCriterion("status =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Boolean value) {
addCriterion("status <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Boolean value) {
addCriterion("status >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Boolean value) {
addCriterion("status >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(Boolean value) {
addCriterion("status <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Boolean value) {
addCriterion("status <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<Boolean> values) {
addCriterion("status in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Boolean> values) {
addCriterion("status not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(Boolean value1, Boolean value2) {
addCriterion("status between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Boolean value1, Boolean value2) {
addCriterion("status not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andShoworderIsNull() {
addCriterion("showOrder is null");
return (Criteria) this;
}
public Criteria andShoworderIsNotNull() {
addCriterion("showOrder is not null");
return (Criteria) this;
}
public Criteria andShoworderEqualTo(Integer value) {
addCriterion("showOrder =", value, "showorder");
return (Criteria) this;
}
public Criteria andShoworderNotEqualTo(Integer value) {
addCriterion("showOrder <>", value, "showorder");
return (Criteria) this;
}
public Criteria andShoworderGreaterThan(Integer value) {
addCriterion("showOrder >", value, "showorder");
return (Criteria) this;
}
public Criteria andShoworderGreaterThanOrEqualTo(Integer value) {
addCriterion("showOrder >=", value, "showorder");
return (Criteria) this;
}
public Criteria andShoworderLessThan(Integer value) {
addCriterion("showOrder <", value, "showorder");
return (Criteria) this;
}
public Criteria andShoworderLessThanOrEqualTo(Integer value) {
addCriterion("showOrder <=", value, "showorder");
return (Criteria) this;
}
public Criteria andShoworderIn(List<Integer> values) {
addCriterion("showOrder in", values, "showorder");
return (Criteria) this;
}
public Criteria andShoworderNotIn(List<Integer> values) {
addCriterion("showOrder not in", values, "showorder");
return (Criteria) this;
}
public Criteria andShoworderBetween(Integer value1, Integer value2) {
addCriterion("showOrder between", value1, value2, "showorder");
return (Criteria) this;
}
public Criteria andShoworderNotBetween(Integer value1, Integer value2) {
addCriterion("showOrder not between", value1, value2, "showorder");
return (Criteria) this;
}
public Criteria andCreatetimeIsNull() {
addCriterion("createTime is null");
return (Criteria) this;
}
public Criteria andCreatetimeIsNotNull() {
addCriterion("createTime is not null");
return (Criteria) this;
}
public Criteria andCreatetimeEqualTo(Date value) {
addCriterion("createTime =", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeNotEqualTo(Date value) {
addCriterion("createTime <>", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeGreaterThan(Date value) {
addCriterion("createTime >", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeGreaterThanOrEqualTo(Date value) {
addCriterion("createTime >=", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeLessThan(Date value) {
addCriterion("createTime <", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeLessThanOrEqualTo(Date value) {
addCriterion("createTime <=", value, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeIn(List<Date> values) {
addCriterion("createTime in", values, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeNotIn(List<Date> values) {
addCriterion("createTime not in", values, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeBetween(Date value1, Date value2) {
addCriterion("createTime between", value1, value2, "createtime");
return (Criteria) this;
}
public Criteria andCreatetimeNotBetween(Date value1, Date value2) {
addCriterion("createTime not between", value1, value2, "createtime");
return (Criteria) this;
}
public Criteria andDescriptionIsNull() {
addCriterion("description is null");
return (Criteria) this;
}
public Criteria andDescriptionIsNotNull() {
addCriterion("description is not null");
return (Criteria) this;
}
public Criteria andDescriptionEqualTo(String value) {
addCriterion("description =", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotEqualTo(String value) {
addCriterion("description <>", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionGreaterThan(String value) {
addCriterion("description >", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionGreaterThanOrEqualTo(String value) {
addCriterion("description >=", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionLessThan(String value) {
addCriterion("description <", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionLessThanOrEqualTo(String value) {
addCriterion("description <=", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionLike(String value) {
addCriterion("description like", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotLike(String value) {
addCriterion("description not like", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionIn(List<String> values) {
addCriterion("description in", values, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotIn(List<String> values) {
addCriterion("description not in", values, "description");
return (Criteria) this;
}
public Criteria andDescriptionBetween(String value1, String value2) {
addCriterion("description between", value1, value2, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotBetween(String value1, String value2) {
addCriterion("description not between", value1, value2, "description");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@@ -1,23 +0,0 @@
package com.accompany.admin.model;
public class AdminDictKey {
private String code;
private String dictkey;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code == null ? null : code.trim();
}
public String getDictkey() {
return dictkey;
}
public void setDictkey(String dictkey) {
this.dictkey = dictkey == null ? null : dictkey.trim();
}
}

View File

@@ -1,135 +0,0 @@
package com.accompany.admin.model.batch;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author: liaozetao
* @date: 2023/9/22 15:25
* @description:
*/
@Data
@TableName("flow_data_batch_search")
public class FlowDataBatchSearch {
/**
* 主键
*/
@ApiModelProperty("主键")
@TableId(type = IdType.AUTO)
private Long id;
/**
* 名称
*/
@ApiModelProperty("名称")
private String name;
/**
* 负责人
*/
@ApiModelProperty("负责人")
private String person;
/**
* 预算
*/
@ApiModelProperty("预算")
private BigDecimal amount;
/**
* 关键字
*/
@ApiModelProperty("关键字")
private String searchKey;
/**
* 房间UID
*/
@ApiModelProperty("房间UID")
private Long roomUid;
/**
* 开始时间
*/
@ApiModelProperty("开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startTime;
/**
* 结束时间
*/
@ApiModelProperty("结束时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
/**
* 创建时间
*/
@ApiModelProperty("创建时间")
private Date createTime;
/**
* 更新时间
*/
@ApiModelProperty("更新时间")
private Date updateTime;
/**
* 期间新增UV
*/
@ApiModelProperty("期间新增UV")
private Integer timeUv = 0;
/**
* 新增成本
*/
@ApiModelProperty("新增成本")
private BigDecimal costAmount = BigDecimal.ZERO;
/**
* 归因新增UV
*/
@ApiModelProperty("归因新增UV")
private Integer ascribeTimeUv = 0;
/**
* 归因后进入归因房间UV
*/
@ApiModelProperty("归因后进入归因房间UV")
private Integer inRoomUv = 0;
/**
* 归因新增成本
*/
@ApiModelProperty("归因新增成本")
private BigDecimal ascribeCostAmount = BigDecimal.ZERO;
/**
* 活动内私聊用户数
*/
@ApiModelProperty("活动内私聊用户数")
private Integer chatNum = 0;
/**
* 私聊用户成本
*/
@ApiModelProperty("私聊用户成本")
private BigDecimal chatCostAmount = BigDecimal.ZERO;
/**
* 是否固定
*/
@ApiModelProperty("是否固定")
private Integer isFixed = 0;
}

View File

@@ -1,28 +0,0 @@
/*
* 文 件 名: LuckySeaItemSaveReqParams
* 版 权:
* 描 述: <描述>
* 创建人: H1
* 创建时间: 2021/9/26
* 修改人:
* 修改内容:
* 修改时间:
*/
package com.accompany.admin.params;
import com.accompany.business.model.callbattle.ActCallBattleItem;
import lombok.Data;
import java.util.List;
/**
* <br>类描述:
* <br>功能详细描述:
*
* @author H1
* @date [2021/9/26]
*/
@Data
public class ActCallBattleItemSaveReqParams {
private List<ActCallBattleItem> items;
}

View File

@@ -1,28 +0,0 @@
/*
* 文 件 名: LuckySeaItemSaveReqParams
* 版 权:
* 描 述: <描述>
* 创建人: H1
* 创建时间: 2021/9/26
* 修改人:
* 修改内容:
* 修改时间:
*/
package com.accompany.admin.params;
import com.accompany.business.model.activity.luckysea.LuckySeaItem;
import lombok.Data;
import java.util.List;
/**
* <br>类描述:
* <br>功能详细描述:
*
* @author H1
* @date [2021/9/26]
*/
@Data
public class LuckySeaItemSaveReqParams {
private List<LuckySeaItem> items;
}

View File

@@ -1,125 +0,0 @@
package com.accompany.admin.vo;
import java.util.Date;
public class OperationSmsRecordVo {
private Long recordId;
private Long uid;
private Long erbanNo;
private String phone;
private Integer templateId;
private String templateName;
private Integer sendStatus;
private Date createTime;
private Date sendTime;
private String errorMsg;
private Integer operator;
private String operatorName;
public Long getRecordId() {
return recordId;
}
public void setRecordId(Long recordId) {
this.recordId = recordId;
}
public Long getUid() {
return uid;
}
public void setUid(Long uid) {
this.uid = uid;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone == null ? null : phone.trim();
}
public Integer getTemplateId() {
return templateId;
}
public void setTemplateId(Integer templateId) {
this.templateId = templateId;
}
public Integer getSendStatus() {
return sendStatus;
}
public void setSendStatus(Integer sendStatus) {
this.sendStatus = sendStatus;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getSendTime() {
return sendTime;
}
public void setSendTime(Date sendTime) {
this.sendTime = sendTime;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg == null ? null : errorMsg.trim();
}
public Integer getOperator() {
return operator;
}
public void setOperator(Integer operator) {
this.operator = operator;
}
public Long getErbanNo() {
return erbanNo;
}
public void setErbanNo(Long erbanNo) {
this.erbanNo = erbanNo;
}
public String getTemplateName() {
return templateName;
}
public void setTemplateName(String templateName) {
this.templateName = templateName;
}
public String getOperatorName() {
return operatorName;
}
public void setOperatorName(String operatorName) {
this.operatorName = operatorName;
}
}

View File

@@ -1,31 +0,0 @@
package com.accompany.admin.vo;
import com.accompany.common.annotation.FieldComment;
import com.accompany.core.vo.BaseVo;
import lombok.Data;
import java.util.Date;
@Data
public class PhoneAuthApplyRecordExcelVo extends BaseVo {
private static final long serialVersionUID = 1L;
@FieldComment("id")
public Long id;
@FieldComment("申请区号")
public String phoneAreaCode;
@FieldComment("申请手机号")
public String phone;
@FieldComment("授权码")
public String authCode;
@FieldComment("授权状态")
public Byte status;
@FieldComment("申请时间")
public Date createTime;
@FieldComment("备注")
public String remark;
@FieldComment("操作人")
public String operator;
@FieldComment("更新授权时间")
public Date updateTime;
}

View File

@@ -1,102 +0,0 @@
package com.accompany.admin.vo;
import java.util.Date;
/**
* {这里添加描述}
*
* @author fangchengyan
* @date 2019-05-20 14:49
*/
public class UserCertifyRecordVo {
private Long recordId;
private Long uid;
private String name;
private String idCardNum;
private String phone;
private Byte bindStatus;
private String certifyType;
private Date createTime;
private Long erbanNo;
public Long getRecordId() {
return recordId;
}
public void setRecordId(Long recordId) {
this.recordId = recordId;
}
public Long getUid() {
return uid;
}
public void setUid(Long uid) {
this.uid = uid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getIdCardNum() {
return idCardNum;
}
public void setIdCardNum(String idCardNum) {
this.idCardNum = idCardNum;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public Byte getBindStatus() {
return bindStatus;
}
public void setBindStatus(Byte bindStatus) {
this.bindStatus = bindStatus;
}
public String getCertifyType() {
return certifyType;
}
public void setCertifyType(String certifyType) {
this.certifyType = certifyType;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Long getErbanNo() {
return erbanNo;
}
public void setErbanNo(Long erbanNo) {
this.erbanNo = erbanNo;
}
}

View File

@@ -1,38 +0,0 @@
package com.accompany.admin.vo.apply;
import com.accompany.core.model.phone.PhoneAuthApplyRecord;
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/11/20 17:40
* @description:
*/
@Data
@ApiModel
public class PhoneAuthApplyRecordAdminVo extends PhoneAuthApplyRecord {
/**
* 用户ID
*/
@ApiModelProperty("用户ID")
private Long erbanNo;
/**
* 昵称
*/
@ApiModelProperty("昵称")
private String nick;
/**
* 注册时间
*/
@ApiModelProperty("注册时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date signTime;
}

View File

@@ -1,23 +0,0 @@
package com.accompany.admin.vo.batch;
import com.accompany.admin.model.batch.FlowDataBatchSearch;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author: liaozetao
* @date: 2023/9/22 15:40
* @description:
*/
@Data
@ApiModel
public class FlowDataBatchSearchAdminVo extends FlowDataBatchSearch {
/**
* 房间名称
*/
@ApiModelProperty("归因房间名称")
private String roomName;
}

View File

@@ -1,69 +0,0 @@
package com.accompany.admin.vo.batch;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author: liaozetao
* @date: 2023/9/22 18:00
* @description:
*/
@Data
@ApiModel
public class FlowDataBatchSearchGrowAdminVo {
/**
* 统计项
*/
@ApiModelProperty("统计项")
private String countItem;
/**
* 是否百分比
*/
@ApiModelProperty("是否百分比")
private Boolean isPercentage = false;
/**
* 当天情况
*/
@ApiModelProperty("当天情况")
private Double currCondition = 0D;
/**
* 次日情况
*/
@ApiModelProperty("次日情况")
private Double nextCondition = 0D;
/**
* 3日情况
*/
@ApiModelProperty("3日情况")
private Double threeCondition = 0D;
/**
* 7日情况
*/
@ApiModelProperty("7日情况")
private Double sevenCondition = 0D;
/**
* 15日情况
*/
@ApiModelProperty("15日情况")
private Double fifteenCondition = 0D;
/**
* 30日情况
*/
@ApiModelProperty("30日情况")
private Double thirtyCondition = 0D;
/**
* 累计到目前
*/
@ApiModelProperty("累计到目前")
private Double totalCondition = 0D;
}

View File

@@ -1,35 +0,0 @@
/*
* 文 件 名: LuckySeaActAdminRecordVo
* 版 权:
* 描 述: <描述>
* 创建人: H1
* 创建时间: 2021/1/12
* 修改人:
* 修改内容:
* 修改时间:
*/
package com.accompany.admin.vo.callbattle;
import lombok.Data;
import java.util.Date;
/**
* <br>类描述:
* <br>功能详细描述:
*
* @author H1
* @date [2021/1/12]
*/
@Data
public class ActCallBattleAdminRecordVo {
private String roundId;
private Date startTime;
private Date endTime;
private Integer memberNum;
private Long userInputPieceNum;
private Long prizePieceNum;
private Double ticket;
private String prizeName;
private String restraintName;
}

View File

@@ -1,29 +0,0 @@
/*
* 文 件 名: LuckySeaActAdminRoundDetailVo
* 版 权:
* 描 述: <描述>
* 创建人: H1
* 创建时间: 2021/1/12
* 修改人:
* 修改内容:
* 修改时间:
*/
package com.accompany.admin.vo.callbattle;
import lombok.Data;
/**
* <br>类描述:
* <br>功能详细描述:
*
* @author H1
* @date [2021/1/12]
*/
@Data
public class ActCallBattleAdminRoundDetailVo {
private Long uid;
private Long erbanNo;
private String nick;
private Long costPieceNum;
private Long prizePieceNum;
}

View File

@@ -1,33 +0,0 @@
/*
* 文 件 名: LuckySeaActAdminUserDrawRecord
* 版 权:
* 描 述: <描述>
* 创建人: H1
* 创建时间: 2021/1/12
* 修改人:
* 修改内容:
* 修改时间:
*/
package com.accompany.admin.vo.callbattle;
import lombok.Data;
import java.util.Date;
/**
* <br>类描述:
* <br>功能详细描述:
*
* @author H1
* @date [2021/1/12]
*/
@Data
public class ActCallBattleAdminUserDrawRecord {
private Long uid;
private Long erbanNo;
private String nick;
private String roundId;
private Date endTime;
private Long costPieceNum;
private Long prizePieceNum;
}

View File

@@ -1,34 +0,0 @@
/*
* 文 件 名: LuckySeaActPlatformStatVo
* 版 权:
* 描 述: <描述>
* 创建人: H1
* 创建时间: 2021/1/11
* 修改人:
* 修改内容:
* 修改时间:
*/
package com.accompany.admin.vo.callbattle;
import lombok.Data;
import java.util.Date;
/**
* <br>类描述: 召唤战斗活动平台数据统计vo
* <br>功能详细描述:
*
* @author H1
* @date [2021/1/11]
*/
@Data
public class ActCallBattlePlatformStatVo {
private Date queryDate;
private Integer memberNum;
private Integer totalPlayTimes;
private Integer roundNum;
private Long totalPiece;
private Long totalPlatformValue;
private Double totalTicket;
}

View File

@@ -1,52 +0,0 @@
package com.accompany.admin.vo.gamepartner;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* @author: liaozetao
* @date: 2023/8/24 14:53
* @description:
*/
@Data
public class GamePartnerOrderDayAdminVo {
/**
* 日期
*/
@ApiModelProperty("日期")
@ExcelProperty("日期")
private String orderTime;
/**
* 下单用户数
*/
@ApiModelProperty("下单用户数")
@ExcelProperty("下单用户数")
private Integer orderNum;
/**
* 累积下单局数
*/
@ApiModelProperty("累积下单局数")
@ExcelProperty("累积下单局数")
private Integer totalInning;
/**
* 累积下单次数
*/
@ApiModelProperty("累积下单次数")
@ExcelProperty("累积下单次数")
private Integer orderCount;
/**
* 累积下单金额(钻)
*/
@ApiModelProperty("累积下单金额(钻)")
@ExcelProperty("累积下单金额(钻)")
private BigDecimal totalAmount;
}

View File

@@ -1,77 +0,0 @@
package com.accompany.admin.vo.gamepartner;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author: liaozetao
* @date: 2023/8/24 15:39
* @description:
*/
@Data
public class GamePartnerOrderDayDetailAdminVo {
/**
* 下单用户id
*/
@ApiModelProperty("下单用户id")
@ExcelProperty("下单用户id")
private String fromErBanNo;
/**
* 下单用户昵称
*/
@ApiModelProperty("下单用户昵称")
@ExcelProperty("下单用户昵称")
private String fromNick;
/**
* 接单用户id
*/
@ApiModelProperty("接单用户id")
@ExcelProperty("接单用户id")
private String toErBanNo;
/**
* 接单用户昵称
*/
@ApiModelProperty("接单用户昵称")
@ExcelProperty("接单用户昵称")
private String toNick;
/**
* 房主id
*/
@ApiModelProperty("房主id")
@ExcelProperty("房主id")
private String hallErBanNo;
/**
* 房间名称
*/
@ApiModelProperty("房间名称")
@ExcelProperty("房间名称")
private String hallRoomName;
/**
* 下单游戏
*/
@ApiModelProperty("下单游戏")
@ExcelProperty("下单游戏")
private String gameName;
/**
* 下单金额(钻)
*/
@ApiModelProperty("下单金额(钻)")
@ExcelProperty("下单金额(钻)")
private String amount;
/**
* 下单时间
*/
@ApiModelProperty("下单时间")
@ExcelProperty("下单时间")
private String orderTime;
}

View File

@@ -1,54 +0,0 @@
package com.accompany.admin.vo.gamepartner;
import com.accompany.business.model.gamepartner.UserGamePartner;
import com.accompany.business.vo.gamepartner.UserGamePartnerInfoVo;
import com.accompany.common.constant.Constant;
import com.accompany.common.utils.DateTimeUtil;
import com.accompany.core.model.Users;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.List;
@ApiModel
@Data
public class UserGamePartnerInfoAdminVo {
@ApiModelProperty("uid")
private Long uid;
@ApiModelProperty("id")
private Long erbanNo;
@ApiModelProperty("昵称")
private String nick;
@ApiModelProperty("游戏信息")
private List<UserGamePartnerInfoVo> games;
@ApiModelProperty("状态")
private Boolean status;
@ApiModelProperty("更新时间")
private String updateTime;
@ApiModelProperty("操作人")
private String adminName;
public UserGamePartnerInfoAdminVo(){
}
public UserGamePartnerInfoAdminVo(UserGamePartner db, Users u, List<UserGamePartnerInfoVo> games, String adminName) {
this.uid = db.getUid();
if (null != u){
this.erbanNo = u.getErbanNo();
this.nick = u.getNick();
}
if (!CollectionUtils.isEmpty(games)){
this.games = games;
}
this.status = Constant.StatusV2.valid.equals(db.getStatus());
this.updateTime = DateTimeUtil.convertDate(db.getUpdateTime());
if (StringUtils.hasText(adminName)){
this.adminName = adminName;
}
}
}

View File

@@ -1,34 +0,0 @@
/*
* 文 件 名: LuckySeaActAdminRecordVo
* 版 权:
* 描 述: <描述>
* 创建人: H1
* 创建时间: 2021/1/12
* 修改人:
* 修改内容:
* 修改时间:
*/
package com.accompany.admin.vo.luckysea;
import lombok.Data;
import java.util.Date;
/**
* <br>类描述:
* <br>功能详细描述:
*
* @author H1
* @date [2021/1/12]
*/
@Data
public class LuckySeaActAdminRecordVo {
private String roundId;
private Date startTime;
private Date endTime;
private Integer memberNum;
private Long userInputPieceNum;
private Long prizePieceNum;
private Double ticket;
private String prizeName;
}

View File

@@ -1,29 +0,0 @@
/*
* 文 件 名: LuckySeaActAdminRoundDetailVo
* 版 权:
* 描 述: <描述>
* 创建人: H1
* 创建时间: 2021/1/12
* 修改人:
* 修改内容:
* 修改时间:
*/
package com.accompany.admin.vo.luckysea;
import lombok.Data;
/**
* <br>类描述:
* <br>功能详细描述:
*
* @author H1
* @date [2021/1/12]
*/
@Data
public class LuckySeaActAdminRoundDetailVo {
private Long uid;
private Long erbanNo;
private String nick;
private Long costPieceNum;
private Long prizePieceNum;
}

View File

@@ -1,33 +0,0 @@
/*
* 文 件 名: LuckySeaActAdminUserDrawRecord
* 版 权:
* 描 述: <描述>
* 创建人: H1
* 创建时间: 2021/1/12
* 修改人:
* 修改内容:
* 修改时间:
*/
package com.accompany.admin.vo.luckysea;
import lombok.Data;
import java.util.Date;
/**
* <br>类描述:
* <br>功能详细描述:
*
* @author H1
* @date [2021/1/12]
*/
@Data
public class LuckySeaActAdminUserDrawRecord {
private Long uid;
private Long erbanNo;
private String nick;
private String roundId;
private Date endTime;
private Long costPieceNum;
private Long prizePieceNum;
}

View File

@@ -1,40 +0,0 @@
/*
* 文 件 名: LuckySeaActPlatformStatVo
* 版 权:
* 描 述: <描述>
* 创建人: H1
* 创建时间: 2021/1/11
* 修改人:
* 修改内容:
* 修改时间:
*/
package com.accompany.admin.vo.luckysea;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
/**
* <br>类描述: 深海奇缘活动平台数据统计vo
* <br>功能详细描述:
*
* @author H1
* @date [2021/1/11]
*/
@Data
public class LuckySeaActPlatformStatVo {
@ExcelProperty("日期")
private String queryDate;
@ExcelProperty("总人数")
private Integer memberNum;
@ExcelProperty("总人次")
private Integer totalPlayTimes;
@ExcelProperty("总轮数")
private Integer roundNum;
@ExcelProperty("总投入")
private Long totalPiece;
@ExcelProperty("总平台价值")
private Long totalPlatformValue;
@ExcelProperty("门票")
private Double totalTicket;
}

View File

@@ -1,31 +0,0 @@
package com.accompany.admin.vo.luckysea;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* <br>类描述: 深海奇缘活动奖项item
* <br>功能详细描述:
*
* @author H1
* @date [2020/12/30]
*/
@Data
@ApiModel
public class LuckySeaItemGroupAdminVo {
@ApiModelProperty("id")
private Long id;
private String name;
@ApiModelProperty("itemIds")
private String itemIds;
@ApiModelProperty("itemNames")
private String itemNames;
private Byte status;
}

View File

@@ -1,67 +0,0 @@
package com.accompany.admin.vo.official;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author: liaozetao
* @date: 2024/1/18 14:26
* @description:
*/
@Data
public class OfficialBrowseCountVo {
/**
* 日期
*/
@ApiModelProperty("日期")
private String dateTime;
/**
* 无线官网UV
*/
@ApiModelProperty("无线官网UV")
private Integer clientUv = 0;
/**
* 无线官网PV
*/
@ApiModelProperty("无线官网PV")
private Integer clientPv = 0;
/**
* 无线 iOS下载点击次数
*/
@ApiModelProperty("无线 iOS下载点击次数")
private Integer iosDownloadPv = 0;
/**
* 无线 安卓下载点击次数
*/
@ApiModelProperty("无线 安卓下载点击次数")
private Integer androidDownloadPv = 0;
/**
* PC官网UV
*/
@ApiModelProperty("PC官网UV")
private Integer pcUv = 0;
/**
* PC官网PV
*/
@ApiModelProperty("PC官网PV")
private Integer pcPv = 0;
/**
* PC iOS下载点击次数
*/
@ApiModelProperty("PC iOS下载点击次数")
private Integer pcIosDownloadPv = 0;
/**
* PC 安卓下载点击次数
*/
@ApiModelProperty("PC 安卓下载点击次数")
private Integer pcAndroidDownloadPv = 0;
}

View File

@@ -1,35 +0,0 @@
package com.accompany.admin.vo.withdraw;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
@Data
public class WithdrawAccountAdminVo {
@ExcelProperty("用户UID")
private Long uid;
@ExcelProperty("平台ID")
private Long erbanNo;
@ExcelProperty("昵称")
private String nick;
@ExcelProperty("swift code/BIC")
private String swift;
@ExcelProperty("bank name")
private String bankName;
@ExcelProperty("account number")
private String accountNumber;
@ExcelProperty("account name")
private String accountName;
@ExcelProperty("address")
private String address;
@ExcelProperty("city")
private String city;
@ExcelProperty("province")
private String province;
@ExcelProperty("post code")
private String postCode;
@ExcelProperty("申请时间")
private String createTime;
@ExcelProperty("更新时间")
private String updateTime;
}

View File

@@ -1,88 +0,0 @@
package com.accompany.admin.vo.withdraw;
import java.util.Date;
/**
* Created by yuanyi on 2019/4/22.
*/
public class WithdrawBlockVo {
private Integer id;
private Long uid;
private Long erbanNo;
private String nick;
private Byte status;
private String remark;
private Date createTime;
private Date updateTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Long getUid() {
return uid;
}
public void setUid(Long uid) {
this.uid = uid;
}
public Long getErbanNo() {
return erbanNo;
}
public void setErbanNo(Long erbanNo) {
this.erbanNo = erbanNo;
}
public String getNick() {
return nick;
}
public void setNick(String nick) {
this.nick = nick;
}
public Byte getStatus() {
return status;
}
public void setStatus(Byte status) {
this.status = status;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}

View File

@@ -1,77 +0,0 @@
package com.accompany.admin.vo.withdraw;
import com.accompany.business.model.withdraw.ExchangeRate;
import com.accompany.business.model.withdraw.WithdrawAccountDtl;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Data
@ApiModel
public class WithdrawConfigAdminVo {
private String role;
private Integer times;//周提现次数
private Double fee;
private Double min;
private Double max;
/**
* 主键
*/
@ApiModelProperty("主键")
private Long id;
/**
* 最小提现金币
*/
@ApiModelProperty("最小提现金币")
private Long minValue;
/**
* 周提现上限
*/
@ApiModelProperty("周提现上限")
private Long weekMaxValue;
/**
* 周提现次数
*/
@ApiModelProperty("周提现次数")
private Integer weekLimitCount;
/**
* 提现手续费率
*/
@ApiModelProperty("提现手续费率")
private BigDecimal chargeRate;
/**
* 账户
*/
@ApiModelProperty("账户")
private List<WithdrawAccountDtl> accounts;
/**
* 汇率
*/
@ApiModelProperty("汇率")
private List<ExchangeRate> rates;
/**
* 上次更新汇率时间
*/
@ApiModelProperty("上次更新汇率时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date lastRateTime;
}

View File

@@ -1,49 +0,0 @@
package com.accompany.admin.vo.withdraw;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
@Data
public class WithdrawRecordAdminVo {
@ExcelProperty("申请ID")
private Long id;
@ExcelProperty("用户UID")
private Long uid;
@ExcelProperty("平台ID")
private Long erbanNo;
@ExcelProperty("昵称")
private String nick;
@ExcelProperty("申请提现金币")
private Double golds;
@ExcelProperty("手续费")
private String fee;
@ExcelProperty("实际可提现金币")
private Double actualGolds;
@ExcelProperty("swift code/BIC")
private String swift;
@ExcelProperty("bank name")
private String bankName;
@ExcelProperty("account number")
private String accountNumber;
@ExcelProperty("account name")
private String accountName;
@ExcelProperty("address")
private String address;
@ExcelProperty("city")
private String city;
@ExcelProperty("province")
private String province;
@ExcelProperty("post code")
private String postCode;
@ExcelProperty("备注")
private String remark;
@ExcelProperty("状态")
private String status;
@ExcelProperty("申请时间")
private String createTime;
@ExcelProperty("更新时间")
private String updateTime;
@ExcelProperty("操作人")
private String operator;
}

View File

@@ -1,131 +0,0 @@
package com.accompany.admin.vo.withdraw;
import com.accompany.business.constant.withdraw.WithdrawAccountTypeConstant;
import com.accompany.business.model.withdraw.WithdrawUser;
import com.accompany.common.constant.Constant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author: liaozetao
* @date: 2023/7/7 15:32
* @description:
*/
@Data
@ApiModel
public class WithdrawUserAdminVo extends WithdrawUser {
/**
* 耳伴号
*/
@ApiModelProperty("耳伴号")
private Long erbanNo;
/**
* 昵称
*/
@ApiModelProperty("昵称")
private String nick;
/**
* 中国大陆银联
*/
@ApiModelProperty("中国大陆银联")
private Integer isChinaUnionPay = 0;
/**
* 马来西亚银行
*/
@ApiModelProperty("马来西亚银行")
private Integer isMayBank = 0;
/**
* 新加坡银行
*/
@ApiModelProperty("新加坡银行")
private Integer isBankOfSingapore = 0;
/**
* 其它账户
*/
@ApiModelProperty("其它账户")
private Integer isOrderAccount = 0;
/**
* 台湾地区银行
*/
@ApiModelProperty("台湾地区银行")
private Integer isTaiWanBank = 0;
/**
* 提现账户
*/
@ApiModelProperty("提现账户")
private String withdrawAccount;
public Integer getIsChinaUnionPay() {
Integer accountFlag = this.getAccountFlag();
if (accountFlag == null) {
accountFlag = 0;
}
if ((accountFlag & WithdrawAccountTypeConstant.CHINA_UNION_PAY) != 0) {
isChinaUnionPay = Constant.Yes1No0.YES;
} else {
isChinaUnionPay = Constant.Yes1No0.NO;
}
return isChinaUnionPay;
}
public Integer getIsMayBank() {
Integer accountFlag = this.getAccountFlag();
if (accountFlag == null) {
accountFlag = 0;
}
if ((accountFlag & WithdrawAccountTypeConstant.MAY_BANK) != 0) {
isMayBank = Constant.Yes1No0.YES;
} else {
isMayBank = Constant.Yes1No0.NO;
}
return isMayBank;
}
public Integer getIsBankOfSingapore() {
Integer accountFlag = this.getAccountFlag();
if (accountFlag == null) {
accountFlag = 0;
}
if ((accountFlag & WithdrawAccountTypeConstant.BANK_OF_SINGAPORE) != 0) {
isBankOfSingapore = Constant.Yes1No0.YES;
} else {
isBankOfSingapore = Constant.Yes1No0.NO;
}
return isBankOfSingapore;
}
public Integer getIsOrderAccount() {
Integer accountFlag = this.getAccountFlag();
if (accountFlag == null) {
accountFlag = 0;
}
if ((accountFlag & WithdrawAccountTypeConstant.ORDER_ACCOUNT) != 0) {
isOrderAccount = Constant.Yes1No0.YES;
} else {
isOrderAccount = Constant.Yes1No0.NO;
}
return isOrderAccount;
}
public Integer getIsTaiWanBank() {
Integer accountFlag = this.getAccountFlag();
if (accountFlag == null) {
accountFlag = 0;
}
if ((accountFlag & WithdrawAccountTypeConstant.TAI_WAN_BANK) != 0) {
isTaiWanBank = Constant.Yes1No0.YES;
} else {
isTaiWanBank = Constant.Yes1No0.NO;
}
return isTaiWanBank;
}
}

View File

@@ -1,98 +0,0 @@
package com.accompany.admin.vo.withdraw;
import com.accompany.business.constant.withdraw.WithdrawUserLimitConstant;
import com.accompany.business.model.withdraw.WithdrawUserLimit;
import com.accompany.common.constant.Constant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author: liaozetao
* @date: 2023/7/10 18:09
* @description:
*/
@Data
@ApiModel
public class WithdrawUserLimitAdminVo extends WithdrawUserLimit {
/**
* 耳伴号
*/
@ApiModelProperty("耳伴号")
private Long erbanNo;
/**
* 昵称
*/
@ApiModelProperty("昵称")
private String nick;
/**
* 提现
*/
@ApiModelProperty("提现")
private Integer isCash = 0;
/**
* 钻石
*/
@ApiModelProperty("钻石")
private Integer isDiamond = 0;
/**
* 所属房间
*/
@ApiModelProperty("所属房间")
private String roomName;
/**
* 所属房间ID
*/
@ApiModelProperty("所属房间ID")
private Long roomErBanNo;
/**
* 所属公会
*/
@ApiModelProperty("所属公会")
private String hallRoomName;
/**
* 所属公会ID
*/
@ApiModelProperty("所属公会ID")
private Long hallErBanNo;
/**
* 当前账户金币余额
*/
@ApiModelProperty("当前账户金币余额")
private Double golds;
public Integer getIsCash() {
Integer limitType = this.getLimitType();
if (limitType == null) {
limitType = 0;
}
if ((limitType & WithdrawUserLimitConstant.LIMIT_TYPE_OF_CASH) != 0) {
isCash = Constant.Yes1No0.YES;
} else {
isCash = Constant.Yes1No0.NO;
}
return isCash;
}
public Integer getIsDiamond() {
Integer limitType = this.getLimitType();
if (limitType == null) {
limitType = 0;
}
if ((limitType & WithdrawUserLimitConstant.LIMIT_TYPE_OF_DIAMOND) != 0) {
isDiamond = Constant.Yes1No0.YES;
} else {
isDiamond = Constant.Yes1No0.NO;
}
return isDiamond;
}
}

View File

@@ -1,22 +0,0 @@
package com.accompany.admin.vo.withdraw;
import com.accompany.business.vo.withdraw.WithdrawUserRecordVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author: liaozetao
* @date: 2023/7/10 15:03
* @description:
*/
@Data
@ApiModel
public class WithdrawUserRecordAdminVo extends WithdrawUserRecordVo {
/**
* 用户当前状态
*/
@ApiModelProperty("用户状态名称")
private String blockStatusName;
}

View File

@@ -1,19 +0,0 @@
package com.accompany.admin.vo.withdraw;
import com.accompany.business.model.WithdrawRecord;
/**
* Created by yuanyi on 2019/5/2.
*/
public class WithdrawVo extends WithdrawRecord {
private Byte withDrawBlockStatus; // 提现黑名单状态
public Byte getWithDrawBlockStatus() {
return withDrawBlockStatus;
}
public void setWithDrawBlockStatus(Byte withDrawBlockStatus) {
this.withDrawBlockStatus = withDrawBlockStatus;
}
}

View File

@@ -1,32 +0,0 @@
package com.accompany.admin.mapper;
import com.accompany.admin.model.AdminDict;
import com.accompany.admin.model.AdminDictExample;
import com.accompany.admin.model.AdminDictKey;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface AdminDictMapper {
int countByExample(AdminDictExample example);
int deleteByExample(AdminDictExample example);
int deleteByPrimaryKey(AdminDictKey key);
int insert(AdminDict record);
int insertSelective(AdminDict record);
List<AdminDict> selectByExample(AdminDictExample example);
AdminDict selectByPrimaryKey(AdminDictKey key);
int updateByExampleSelective(@Param("record") AdminDict record, @Param("example") AdminDictExample example);
int updateByExample(@Param("record") AdminDict record, @Param("example") AdminDictExample example);
int updateByPrimaryKeySelective(AdminDict record);
int updateByPrimaryKey(AdminDict record);
}

View File

@@ -1,66 +0,0 @@
/*
* 文 件 名: LuckySeaActAdminMapper
* 版 权:
* 描 述: <描述>
* 创建人: H1
* 创建时间: 2021/1/11
* 修改人:
* 修改内容:
* 修改时间:
*/
package com.accompany.admin.mapper;
import com.accompany.admin.vo.luckysea.LuckySeaActAdminRecordVo;
import com.accompany.admin.vo.luckysea.LuckySeaActAdminRoundDetailVo;
import com.accompany.admin.vo.luckysea.LuckySeaActAdminUserDrawRecord;
import com.accompany.admin.vo.luckysea.LuckySeaActPlatformStatVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <br>接口描述: 深海奇缘mapper
* <br>功能详细描述:
*
* @author H1
* @date [2021/1/11]
*/
public interface LuckySeaActAdminMapper {
/**
* 分页获取游戏平台数据统计
* @param page
* @param startTime
* @param endTime
* @return
*/
Page<LuckySeaActPlatformStatVo> pagePlatformStat(Page<LuckySeaActPlatformStatVo> page, @Param("startTime") String startTime, @Param("endTime")String endTime);
/**
* 分页获取用户的游戏记录
* @param startTime
* @param endTime
* @param erbanNoList
* @return
*/
List<LuckySeaActAdminUserDrawRecord> listUserDrawRecord(@Param("startTime") String startTime, @Param("endTime")String endTime,
@Param("erbanNoList") List<String> erbanNoList);
/**
* 分页获取游戏记录
* @param startTime
* @param endTime
* @param roundId
* @return
*/
List<LuckySeaActAdminRecordVo> listActRecord(@Param("startTime") String startTime, @Param("endTime")String endTime,
@Param("roundId") String roundId);
/**
* 分页获取某轮游戏下的参与详情列表
* @param roundId
* @return
*/
List<LuckySeaActAdminRoundDetailVo> listRoundDrawDetail(String roundId);
}

View File

@@ -1,50 +0,0 @@
package com.accompany.admin.mapper;
import com.accompany.admin.vo.OperationSmsRecordVo;
import com.accompany.business.model.OperationSmsRecord;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author yangming
* @date 2019-04-08
*/
public interface OperationSmsRecordMapperExpand {
/**
* 批量保存
* @param record
*/
void batchSave(List<OperationSmsRecord> record);
/**
* 分页查询
* @param erbanNo
* @param templateId
* @param sendStatus
* @param createTime
* @param sendTime
* @param start
* @param pageSize
* @return
*/
List<OperationSmsRecordVo> getList(@Param("erbanNo") Long erbanNo, @Param("templateId") Integer templateId,
@Param("sendStatus") Integer sendStatus, @Param("createTime") String createTime,
@Param("sendTime") String sendTime, @Param("start") Integer start,
@Param("pageSize") Integer pageSize);
/**
* 统计数量
* @param erbanNo
* @param templateId
* @param sendStatus
* @param createTime
* @param sendTime
* @return
*/
Integer count(@Param("erbanNo") Long erbanNo, @Param("templateId") Integer templateId,
@Param("sendStatus") Integer sendStatus, @Param("createTime") String createTime,
@Param("sendTime") String sendTime);
}

View File

@@ -1,19 +0,0 @@
package com.accompany.admin.mapper;
import com.accompany.admin.model.WithdrawBlock;
import com.accompany.admin.vo.withdraw.WithdrawBlockVo;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
* Created by yuanyi on 2019/4/22.
*/
public interface WithdrawBlockMapperExpand {
List<WithdrawBlockVo> selectWithdrawBlockVoList(@Param("erbanNoList") List<Long> erbanNoList, @Param("status") Byte status, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
List<Long> selectWithdrawBlockUid(@Param("blockStatus") Byte blockStatus);
int insertOrUpdate(WithdrawBlock withdrawBlock);
}

View File

@@ -1,196 +0,0 @@
package com.accompany.admin.mapper.batch;
import com.accompany.admin.dto.batch.FlowDataBatchSearchDetailAdminDto;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author: liaozetao
* @date: 2023/9/23 11:35
* @description:
*/
public interface FlowDataBatchSearchAdminMapper {
/**
* 期间新增UV
*
* @param startTime
* @param endTime
* @return
*/
Integer getTimeUv(@Param("startTime") String startTime, @Param("endTime") String endTime);
/**
* 归因新增UV
*
* @param searchKey
* @param startTime
* @param endTime
* @return
*/
Integer getAscribeTimeUv(@Param("searchKey") String searchKey, @Param("startTime") String startTime, @Param("endTime") String endTime);
/**
* 归因后进入归因房间UV
*
* @param roomUid
* @param startTime
* @param endTime
* @return
*/
Integer getInRoomUv(@Param("searchKey") String searchKey, @Param("roomUid") Long roomUid, @Param("startTime") String startTime, @Param("endTime") String endTime);
/**
* 活动内私聊用户数
*
* @param searchKey
* @param yearMonths
* @param startTime
* @param endTime
* @return
*/
Integer getChatNum(@Param("searchKey") String searchKey, @Param("yearMonths") List<String> yearMonths, @Param("startTime") String startTime, @Param("endTime") String endTime);
/**
* 充值UV
*
* @param searchKey
* @param startTime
* @param endTime
* @param searchStartTime
* @param searchEndTime
* @return
*/
Double getChargeUv(@Param("searchKey") String searchKey, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("searchStartTime") String searchStartTime, @Param("searchEndTime") String searchEndTime);
/**
* 收到转赠UV
*
* @param searchKey
* @param startTime
* @param endTime
* @param searchStartTime
* @param searchEndTime
* @return
*/
Double getGiveUv(@Param("searchKey") String searchKey, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("searchStartTime") String searchStartTime, @Param("searchEndTime") String searchEndTime);
/**
* 全量付费UV
*
* @param searchKey
* @param startTime
* @param endTime
* @param searchStartTime
* @param searchEndTime
* @return
*/
Double getPayUv(@Param("searchKey") String searchKey, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("searchStartTime") String searchStartTime, @Param("searchEndTime") String searchEndTime);
/**
* 直充付费金额
*
* @param searchKey
* @param startTime
* @param endTime
* @param searchStartTime
* @param searchEndTime
* @return
*/
Double getChargeAmount(@Param("searchKey") String searchKey, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("searchStartTime") String searchStartTime, @Param("searchEndTime") String searchEndTime);
/**
* 收到转赠的数额
*
* @param searchKey
* @param startTime
* @param endTime
* @param searchStartTime
* @param searchEndTime
* @return
*/
Double getGiveAmount(@Param("searchKey") String searchKey, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("searchStartTime") String searchStartTime, @Param("searchEndTime") String searchEndTime);
/**
* 留存用户数
*
* @param searchKey
* @param startTime
* @param endTime
* @param remainDay
* @return
*/
Double getRemainCount(@Param("searchKey") String searchKey, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("remainDay") Integer remainDay);
/**
* 获取用户明细
*
* @param searchKey
* @param startTime
* @param endTime
* @return
*/
List<FlowDataBatchSearchDetailAdminDto> getUserDetail(@Param("searchKey") String searchKey, @Param("startTime") String startTime, @Param("endTime") String endTime);
/**
* 获取设备
*
* @param erBanNos
* @return
*/
List<FlowDataBatchSearchDetailAdminDto> getDevice(@Param("erBanNos") List<Long> erBanNos);
/**
* 获取进房
*
* @param erBanNos
* @param roomUid
* @param startTime
* @param endTime
* @return
*/
List<FlowDataBatchSearchDetailAdminDto> getInRoom(@Param("erBanNos") List<Long> erBanNos, @Param("roomUid") Long roomUid, @Param("startTime") String startTime, @Param("endTime") String endTime);
/**
* 活动期间私聊行为数
*
* @param uid
* @param yearMonths
* @param startTime
* @param endTime
* @return
*/
Integer getChatCount(@Param("uid") Long uid, @Param("yearMonths") List<String> yearMonths, @Param("startTime") String startTime, @Param("endTime") String endTime);
/**
* 充值列表
*
* @param erBanNos
* @param startTime
* @param endTime
* @return
*/
List<FlowDataBatchSearchDetailAdminDto> getChargeAmountList(@Param("erBanNos") List<Long> erBanNos, @Param("startTime") String startTime, @Param("endTime") String endTime);
/**
* 转赠列表
*
* @param erBanNos
* @param startTime
* @param endTime
* @return
*/
List<FlowDataBatchSearchDetailAdminDto> getGiveAmountList(@Param("erBanNos") List<Long> erBanNos, @Param("startTime") String startTime, @Param("endTime") String endTime);
/**
* 是否访问
*
* @param erBanNos
* @param startTime
* @param endTime
* @param remainDay
* @return
*/
List<FlowDataBatchSearchDetailAdminDto> getRemainCountList(@Param("erBanNos") List<Long> erBanNos, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("remainDay") Integer remainDay);
}

View File

@@ -1,12 +0,0 @@
package com.accompany.admin.mapper.batch;
import com.accompany.admin.model.batch.FlowDataBatchSearch;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author: liaozetao
* @date: 2023/9/22 15:31
* @description:
*/
public interface FlowDataBatchSearchMapper extends BaseMapper<FlowDataBatchSearch> {
}

View File

@@ -1,64 +0,0 @@
/*
* 文 件 名: LuckySeaActAdminMapper
* 版 权:
* 描 述: <描述>
* 创建人: H1
* 创建时间: 2021/1/11
* 修改人:
* 修改内容:
* 修改时间:
*/
package com.accompany.admin.mapper.callbattle;
import com.accompany.admin.vo.callbattle.ActCallBattleAdminRecordVo;
import com.accompany.admin.vo.callbattle.ActCallBattleAdminRoundDetailVo;
import com.accompany.admin.vo.callbattle.ActCallBattleAdminUserDrawRecord;
import com.accompany.admin.vo.callbattle.ActCallBattlePlatformStatVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <br>接口描述: 深海奇缘mapper
* <br>功能详细描述:
*
* @author H1
* @date [2021/1/11]
*/
public interface ActCallBattleAdminMapper {
/**
* 分页获取游戏平台数据统计
* @param startTime
* @param endTime
* @return
*/
List<ActCallBattlePlatformStatVo> listPlatformStat(@Param("startTime") String startTime, @Param("endTime")String endTime);
/**
* 分页获取用户的游戏记录
* @param startTime
* @param endTime
* @param erbanNoList
* @return
*/
List<ActCallBattleAdminUserDrawRecord> listUserDrawRecord(@Param("startTime") String startTime, @Param("endTime")String endTime,
@Param("erbanNoList") List<String> erbanNoList);
/**
* 分页获取游戏记录
* @param startTime
* @param endTime
* @param roundId
* @return
*/
List<ActCallBattleAdminRecordVo> listActRecord(@Param("startTime") String startTime, @Param("endTime")String endTime,
@Param("roundId") String roundId);
/**
* 分页获取某轮游戏下的参与详情列表
* @param roundId
* @return
*/
List<ActCallBattleAdminRoundDetailVo> listRoundDrawDetail(String roundId);
}

View File

@@ -1,48 +0,0 @@
package com.accompany.admin.mapper.gamepartner;
import com.accompany.admin.vo.gamepartner.GamePartnerOrderDayAdminVo;
import com.accompany.admin.vo.gamepartner.GamePartnerOrderDayDetailAdminVo;
import com.accompany.business.vo.gamepartner.GamePartnerOrderVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
/**
* @author: liaozetao
* @date: 2023/8/24 14:07
* @description:
*/
public interface GamePartnerOrderAdminMapper {
/**
* 订单记录查询
*
* @param page
* @param fromErBanNo
* @param toErBanNo
* @param gameId
* @param orderNo
* @param startTime
* @param endTime
* @return
*/
Page<GamePartnerOrderVo> orderPage(Page<GamePartnerOrderVo> page, @Param("fromErBanNo") String fromErBanNo, @Param("toErBanNo") String toErBanNo, @Param("gameId") Integer gameId, @Param("orderNo") String orderNo, @Param("startTime") String startTime, @Param("endTime") String endTime);
/**
* 订单统计
*
* @param page
* @param startTime
* @param endTime
* @return
*/
Page<GamePartnerOrderDayAdminVo> dayPage(Page<GamePartnerOrderDayAdminVo> page, @Param("startTime") String startTime, @Param("endTime") String endTime);
/**
* 订单详情
*
* @param page
* @param orderDate
* @return
*/
Page<GamePartnerOrderDayDetailAdminVo> dayDetailPage(Page<GamePartnerOrderDayDetailAdminVo> page, @Param("orderDate") String orderDate);
}

View File

@@ -1,15 +0,0 @@
package com.accompany.admin.mapper.official;
import com.accompany.admin.vo.official.OfficialBrowseCountVo;
import java.util.List;
/**
* @author: liaozetao
* @date: 2024/1/18 12:08
* @description:
*/
public interface OfficialRecordAdminMapper {
List<OfficialBrowseCountVo> browseFor30Days();
}

View File

@@ -1,29 +0,0 @@
package com.accompany.admin.mapper.withdraw;
import com.accompany.admin.vo.withdraw.WithdrawUserLimitAdminVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
/**
* @author: liaozetao
* @date: 2023/8/3 15:47
* @description:
*/
public interface WithdrawUserLimitAdminMapper {
/**
*
* @param page
* @param erBanNo
* @param limitType
* @param roomErBanNo
* @param hallErBanNo
* @return
*/
Page<WithdrawUserLimitAdminVo> selectPage(Page<WithdrawUserLimitAdminVo> page,
@Param("erBanNo") String erBanNo,
@Param("limitType") Integer limitType,
@Param("roomErBanNo") String roomErBanNo,
@Param("hallErBanNo") String hallErBanNo);
}

View File

@@ -1,88 +0,0 @@
package com.accompany.admin.service;
import com.accompany.admin.dto.ChannelDistributeSearchDto;
import com.accompany.business.model.ChannelDistribute;
import com.accompany.business.model.ChannelDistributeExample;
import com.accompany.business.mybatismapper.ChannelDistributeMapper;
import com.accompany.business.mybatismapper.ChannelDistributeMapperExpand;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
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;
/**
* {这里添加描述}
*
* @author fangchengyan
* @date 2020-02-20 2:20 下午
*/
@Service
public class ChannelDistributeAdminService {
@Autowired
private ChannelDistributeMapper channelDistributeMapper;
@Autowired
private ChannelDistributeMapperExpand channelDistributeMapperExpand;
public int save(ChannelDistribute record) {
if (record.getId() == null) {
Date now = new Date();
record.setCreateTime(now);
record.setUpdateTime(now);
String[] channels = record.getChannel().split(",");
List<ChannelDistribute> list = new ArrayList<>(channels.length);
for(String channel : channels) {
if(StringUtils.isBlank(channel)) {
continue;
}
ChannelDistribute newOne = new ChannelDistribute();
BeanUtils.copyProperties(record, newOne);
newOne.setChannel(channel);
list.add(newOne);
}
return channelDistributeMapperExpand.insertOrUpdateBatch(list);
} else {
record.setUpdateTime(new Date());
return channelDistributeMapperExpand.updateValue(record);
}
}
public ChannelDistribute getById(Long id) {
return channelDistributeMapper.selectByPrimaryKey(id);
}
public PageInfo<ChannelDistribute> queryForPages(ChannelDistributeSearchDto searchDto, Integer pageNumber, Integer pageSize) {
PageHelper.startPage(pageNumber, pageSize);
return new PageInfo<>(queryList(searchDto));
}
public List<ChannelDistribute> queryList(ChannelDistributeSearchDto searchDto) {
ChannelDistributeExample example = new ChannelDistributeExample();
ChannelDistributeExample.Criteria criteria = example.createCriteria();
if(StringUtils.isNotBlank(searchDto.getAppId())) {
criteria.andAppIdEqualTo(searchDto.getAppId());
}
if(StringUtils.isNotBlank(searchDto.getChannel())) {
criteria.andChannelLike("%" + searchDto.getChannel() + "%");
}
if(null != searchDto.getStartTime()) {
criteria.andCreateTimeGreaterThanOrEqualTo(searchDto.getStartTime());
}
if(null != searchDto.getEndTime()) {
criteria.andCreateTimeLessThanOrEqualTo(searchDto.getEndTime());
}
List<ChannelDistribute> chargeActivityList = channelDistributeMapper.selectByExample(example);
return chargeActivityList;
}
public int deleteById(long id) {
return channelDistributeMapper.deleteByPrimaryKey(id);
}
}

View File

@@ -1,89 +0,0 @@
/*
* 文 件 名: LuckySeaActAdminService
* 版 权:
* 描 述: <描述>
* 创建人: H1
* 创建时间: 2021/1/11
* 修改人:
* 修改内容:
* 修改时间:
*/
package com.accompany.admin.service.activity;
import com.accompany.admin.params.ActCallBattleItemSaveReqParams;
import com.accompany.business.model.callbattle.ActCallBattleItem;
import java.util.Map;
/**
* <br>类描述: 召唤战斗活动
* <br>功能详细描述:
*
* @author H1
* @date [2021/1/11]
*/
public interface ActCallBattleAdminService {
/**
* 新增或者编辑奖品配置
* @param item
*/
void addActItem(ActCallBattleItem item);
/**
* 编辑奖品
* @param params
*/
void saveActItems(ActCallBattleItemSaveReqParams params);
/**
* 分页获取配置列表
*
* @param name
* @param pageNum
* @param pageSize
* @return
*/
Map<String, Object> listItem(String name, Integer pageNum, Integer pageSize);
/**
* 分页获取平台数据
* @param startTime
* @param endTime
* @param page
* @param pageSize
* @return
*/
Map<String, Object> listPlatformStat(String startTime, String endTime, Integer page, Integer pageSize);
/**
* 分页获取用户游戏记录列表
* @param startTime
* @param endTime
* @param erbanNoStr
* @param page
* @param pageSize
* @return
*/
Map<String, Object> listUserDrawRecordList(String startTime, String endTime, String erbanNoStr, Integer page, Integer pageSize);
/**
* 分页获取游戏记录列表
* @param startTime
* @param endTime
* @param roundId
* @param page
* @param pageSize
* @return
*/
Map<String, Object> listActRecord(String startTime, String endTime, String roundId, Integer page, Integer pageSize);
/**
* 分页获取某轮游戏用户参与情况
* @param roundId
* @param page
* @param pageSize
* @return
*/
Map<String, Object> listRoundDrawDetail(String roundId, Integer page, Integer pageSize);
}

View File

@@ -1,101 +0,0 @@
/*
* 文 件 名: LuckySeaActAdminService
* 版 权:
* 描 述: <描述>
* 创建人: H1
* 创建时间: 2021/1/11
* 修改人:
* 修改内容:
* 修改时间:
*/
package com.accompany.admin.service.activity;
import com.accompany.admin.params.LuckySeaItemSaveReqParams;
import com.accompany.admin.vo.luckysea.LuckySeaActPlatformStatVo;
import com.accompany.admin.vo.luckysea.LuckySeaItemGroupAdminVo;
import com.accompany.business.model.activity.luckysea.LuckySeaItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
import java.util.Map;
/**
* <br>类描述: 深海奇缘活动
* <br>功能详细描述:
*
* @author H1
* @date [2021/1/11]
*/
public interface LuckySeaActAdminService {
/**
* 新增或者编辑深海奖品配置
* @param item
*/
void addLuckySeaActItem(LuckySeaItem item);
/**
* 编辑奖品
* @param params
*/
void saveLuckySeaActItems(LuckySeaItemSaveReqParams params);
/**
* 分页获取配置列表
*
* @param name
* @param pageNum
* @param pageSize
* @return
*/
Map<String, Object> listLuckySeaItem(String name, Integer pageNum, Integer pageSize);
/**
* 分页获取平台数据
* @param startTime
* @param endTime
* @param page
* @param pageSize
* @return
*/
Page<LuckySeaActPlatformStatVo> pagePlatformStat(String startTime, String endTime, Integer page, Integer pageSize);
/**
* 分页获取用户游戏记录列表
* @param startTime
* @param endTime
* @param erbanNoStr
* @param page
* @param pageSize
* @return
*/
Map<String, Object> listUserDrawRecordList(String startTime, String endTime, String erbanNoStr, Integer page, Integer pageSize);
/**
* 分页获取游戏记录列表
* @param startTime
* @param endTime
* @param roundId
* @param page
* @param pageSize
* @return
*/
Map<String, Object> listActRecord(String startTime, String endTime, String roundId, Integer page, Integer pageSize);
/**
* 分页获取某轮游戏用户参与情况
* @param roundId
* @param page
* @param pageSize
* @return
*/
Map<String, Object> listRoundDrawDetail(String roundId, Integer page, Integer pageSize);
List<LuckySeaItemGroupAdminVo> listLuckySeaItemGroup();
void delLuckySeaItemGroup(Long id);
void saveLuckySeaItemGroup(Long id, String name, String itemIds, Byte status);
}

View File

@@ -1,67 +0,0 @@
package com.accompany.admin.service.activity;
import com.accompany.admin.service.base.BaseService;
import com.accompany.business.model.OperationAct;
import com.accompany.business.model.OperationActExample;
import com.accompany.business.mybatismapper.OperationActMapper;
import com.accompany.common.constant.Constant;
import com.accompany.common.redis.RedisKey;
import com.accompany.core.service.common.JedisService;
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;
/**
* Created by yuanyi on 2018/10/5.
*/
@Service
public class OperationActAdminService extends BaseService {
@Autowired
private OperationActMapper operationActMapper;
@Autowired
private JedisService jedisService;
/**
* 获取列表
* @param pageNum
* @param pageSize
* @return
*/
public PageInfo queryList(Integer pageNum, Integer pageSize){
OperationActExample example = new OperationActExample();
OperationActExample.Criteria criteria = example.createCriteria();
criteria.andStatusEqualTo(Constant.status.valid);
example.setOrderByClause("id");
PageHelper.startPage(pageNum,pageSize);
List<OperationAct> list = operationActMapper.selectByExample(example);
return new PageInfo(list);
}
public void saveOperationAct(OperationAct operationAct){
Integer id = operationAct.getId();
if(id == null){
operationActMapper.insertSelective(operationAct);
}else{
operationActMapper.updateByPrimaryKeySelective(operationAct);
}
jedisService.hset(RedisKey.oper_act.getKey(),operationAct.getId().toString(),gson.toJson(operationAct));
}
/**
* 删除运营活动,此处只是修改状态量,并不是真正的删除
*/
public void delOperationAct(Integer id){
OperationAct operationAct = operationActMapper.selectByPrimaryKey(id);
if(operationAct == null){
return;
}
operationAct.setStatus(Constant.status.invalid);
operationActMapper.updateByPrimaryKey(operationAct);
jedisService.hdel(RedisKey.oper_act.getKey(),id.toString());
}
}

View File

@@ -1,51 +0,0 @@
package com.accompany.admin.service.activity;
import com.accompany.business.model.activity.PageActivity;
import com.accompany.business.service.activity.PageActivityService;
import com.accompany.business.vo.activities.PageActivityVO;
import com.accompany.core.util.BeanUtils;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Calendar;
/**
* 页面静态活动配置 service
*
* @author linuxea
* @date 2019/10/9 11:01
*/
@Service
@Slf4j
@Transactional(rollbackFor = Exception.class)
public class StaticActivityPageService {
private final PageActivityService pageActivityService;
@Autowired
public StaticActivityPageService(PageActivityService pageActivityService) {
this.pageActivityService = pageActivityService;
}
public IPage<PageActivity> queryList(Integer pageNumber, Integer pageSize) {
return pageActivityService.pageList(null, pageNumber, pageSize);
}
public void save(PageActivityVO pageActivityVo) {
PageActivity pageActivity = BeanUtils.map(pageActivityVo, PageActivity.class);
pageActivity.setCreateTime(Calendar.getInstance().getTime());
pageActivity.setUpdateTime(Calendar.getInstance().getTime());
pageActivityService.save(pageActivity);
}
public void deleteByActivityId(Integer id) {
pageActivityService.removeById(id);
}
public Boolean existByCode(String actCode) {
return pageActivityService.countByCode(actCode) > 0;
}
}

View File

@@ -1,270 +0,0 @@
/*
* 文 件 名: LuckySeaActAdminServiceImpl
* 版 权:
* 描 述: <描述>
* 创建人: H1
* 创建时间: 2021/1/11
* 修改人:
* 修改内容:
* 修改时间:
*/
package com.accompany.admin.service.activity.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.accompany.admin.mapper.callbattle.ActCallBattleAdminMapper;
import com.accompany.admin.params.ActCallBattleItemSaveReqParams;
import com.accompany.admin.service.activity.ActCallBattleAdminService;
import com.accompany.admin.vo.callbattle.ActCallBattleAdminRecordVo;
import com.accompany.admin.vo.callbattle.ActCallBattleAdminRoundDetailVo;
import com.accompany.admin.vo.callbattle.ActCallBattleAdminUserDrawRecord;
import com.accompany.admin.vo.callbattle.ActCallBattlePlatformStatVo;
import com.accompany.business.model.callbattle.ActCallBattleItem;
import com.accompany.business.service.callbattle.ActCallBattleItemService;
import com.accompany.common.constant.Constant;
import com.accompany.common.status.BusiStatus;
import com.accompany.core.exception.ServiceException;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
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.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
;
/**
* <br>类描述: 深海奇缘
* <br>功能详细描述:
*
* @author H1
* @date [2021/1/11]
*/
@Service
@Slf4j
@Transactional(rollbackFor = Exception.class)
public class ActCallBattleAdminServiceImpl implements ActCallBattleAdminService {
@Autowired
private ActCallBattleItemService actCallBattleItemService;
@Autowired
private ActCallBattleAdminMapper actCallBattleAdminMapper;
//@Autowired
//private SysConfService sysConfService;
@Override
public void addActItem(ActCallBattleItem item) {
checkItemName(item.getName(), item.getRestraintName());
if (null == item.getId()) {
// 新增
if (StringUtils.isBlank(item.getName())) {
throw new ServiceException("名称不能为空");
}
if (StringUtils.isBlank(item.getImgUrl())) {
throw new ServiceException("图片不能为空");
}
if (null == item.getMultiple()) {
throw new ServiceException("倍数不能为空");
}
if (StringUtils.isBlank(item.getRestraintName())) {
throw new ServiceException("克制物名称不能为空");
}
if (StringUtils.isBlank(item.getRestraintImageUrl())) {
throw new ServiceException("克制物图片不能为空");
}
if (item.getMultiple() < 1) {
throw new ServiceException("倍数需要大于等于1");
}
item.setCreateTime(new Date());
item.setStatus(Constant.status.valid);
} else {
if (null != item.getMultiple() && item.getMultiple() < 1) {
throw new ServiceException("倍数需要大于等于1");
}
}
item.setUpdateTime(new Date());
actCallBattleItemService.saveOrUpdate(item);
}
private void checkItemInfo(ActCallBattleItem item) {
if (StringUtils.isBlank(item.getName())) {
throw new ServiceException("名称不能为空");
}
if (StringUtils.isBlank(item.getImgUrl())) {
throw new ServiceException("图片不能为空");
}
if (null == item.getMultiple()) {
throw new ServiceException("倍数不能为空");
}
if (item.getMultiple() < 1) {
throw new ServiceException("倍数需要大于等于1");
}
if (StringUtils.isBlank(item.getRestraintName())) {
throw new ServiceException("克制物名称不能为空");
}
if (StringUtils.isBlank(item.getRestraintImageUrl())) {
throw new ServiceException("克制物图片不能为空");
}
checkItemName(item.getName(), item.getRestraintName());
}
@Override
public void saveActItems(ActCallBattleItemSaveReqParams params) {
List<ActCallBattleItem> items = params.getItems();
if (CollectionUtils.isEmpty(items)) {
throw new ServiceException(BusiStatus.PARAMERROR, "配置不能为空");
}
QueryWrapper<ActCallBattleItem> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(ActCallBattleItem::getStatus, Constant.status.valid);
List<ActCallBattleItem> oldItems = actCallBattleItemService.list(queryWrapper);
List<Long> oldIds;
if (CollectionUtil.isNotEmpty(oldItems)) {
oldIds = oldItems.stream().map(ActCallBattleItem::getId).collect(Collectors.toList());
} else {
oldIds = Collections.emptyList();
}
List<ActCallBattleItem> newItems = new ArrayList<>();
List<ActCallBattleItem> updateItems = new ArrayList<>();
// 检查倍数配置是否合理
/*String ticketRateStr = sysConfService.getSysConfValueById(Constant.SysConfId.CALL_BATTLE_TICKET);
double ticketRate = Double.parseDouble(ticketRateStr);
ActCallBattleItem minMultipleItem = items.stream().min(Comparator.comparing(ActCallBattleItem::getMultiple)).get();
log.info("配置中,倍数最小的是 {}", JSON.toJSONString(minMultipleItem));
if (items.size() * (1 - ticketRate) <= minMultipleItem.getMultiple()) {
throw new ServiceException(BusiStatus.SERVERERROR, "当前配置不符合要求,请检查组数、门票和最小倍数的关系是否合理");
}*/
items.forEach(item -> {
checkItemInfo(item);
if (item.getId() == null || !oldIds.contains(item.getId())) {
item.setStatus(Constant.status.valid);
item.setCreateTime(new Date());
item.setUpdateTime(new Date());
newItems.add(item);
} else {
updateItems.add(item);
// 从原id列表中移除
oldIds.remove(item.getId());
}
});
if (CollectionUtil.isNotEmpty(newItems)) {
log.info("新增配置列表: {}", JSONObject.toJSONString(newItems));
actCallBattleItemService.saveBatch(newItems);
}
if (CollectionUtil.isNotEmpty(updateItems)) {
log.info("更新配置列表: {}", JSONObject.toJSONString(updateItems));
actCallBattleItemService.updateBatchById(updateItems);
}
if (CollectionUtil.isNotEmpty(oldIds)) {
log.info("移除的配置列表: {}", JSONObject.toJSONString(oldIds));
actCallBattleItemService.removeByIds(oldIds);
}
}
@Override
public Map<String, Object> listItem(String name, Integer pageNum, Integer pageSize) {
Map data = Maps.newHashMap();
pageNum = pageNum != null ? pageNum : Constant.DEFAULT_PAGE;
pageSize = pageSize != null ? pageSize : Constant.DEFAULT_PAGE_SIZE;
PageHelper.startPage(pageNum, pageSize);
QueryWrapper<ActCallBattleItem> wrapper = new QueryWrapper<>();
LambdaQueryWrapper<ActCallBattleItem> lambda = wrapper.lambda();
lambda.eq(ActCallBattleItem::getStatus, Constant.status.valid);
if (StringUtils.isNotBlank(name)) {
lambda.eq(ActCallBattleItem::getName, name);
}
lambda.orderByDesc(ActCallBattleItem::getId);
List<ActCallBattleItem> list = actCallBattleItemService.list(wrapper);
PageInfo<ActCallBattleItem> pageInfo = new PageInfo<>(list);
data.put("rows", pageInfo.getList());
data.put("total", pageInfo.getTotal());
return data;
}
@Override
public Map<String, Object> listPlatformStat(String startTime, String endTime, Integer page, Integer pageSize) {
Map data = Maps.newHashMap();
page = page != null ? page : Constant.DEFAULT_PAGE;
pageSize = pageSize != null ? pageSize : Constant.DEFAULT_PAGE_SIZE;
PageHelper.startPage(page, pageSize);
List<ActCallBattlePlatformStatVo> statList = actCallBattleAdminMapper.listPlatformStat(startTime, endTime);
PageInfo<ActCallBattlePlatformStatVo> pageInfo = new PageInfo<>(statList);
data.put("rows", pageInfo.getList());
data.put("total", pageInfo.getTotal());
return data;
}
@Override
public Map<String, Object> listUserDrawRecordList(String startTime, String endTime, String erbanNoStr, Integer page, Integer pageSize) {
Map data = Maps.newHashMap();
page = page != null ? page : Constant.DEFAULT_PAGE;
pageSize = pageSize != null ? pageSize : Constant.DEFAULT_PAGE_SIZE;
PageHelper.startPage(page, pageSize);
List<String> erbanNoList = new ArrayList<>();
if (StringUtils.isNotBlank(erbanNoStr)) {
erbanNoList = Arrays.asList(erbanNoStr.trim().replaceAll("", ",").split(","));
}
List<ActCallBattleAdminUserDrawRecord> recordList = actCallBattleAdminMapper.listUserDrawRecord(startTime, endTime, erbanNoList);
PageInfo<ActCallBattleAdminUserDrawRecord> pageInfo = new PageInfo<>(recordList);
data.put("rows", pageInfo.getList());
data.put("total", pageInfo.getTotal());
return data;
}
@Override
public Map<String, Object> listActRecord(String startTime, String endTime, String roundId, Integer page, Integer pageSize) {
Map data = Maps.newHashMap();
page = page != null ? page : Constant.DEFAULT_PAGE;
pageSize = pageSize != null ? pageSize : Constant.DEFAULT_PAGE_SIZE;
PageHelper.startPage(page, pageSize);
List<ActCallBattleAdminRecordVo> recordList = actCallBattleAdminMapper.listActRecord(startTime, endTime, roundId);
PageInfo<ActCallBattleAdminRecordVo> pageInfo = new PageInfo<>(recordList);
data.put("rows", pageInfo.getList());
data.put("total", pageInfo.getTotal());
return data;
}
@Override
public Map<String, Object> listRoundDrawDetail(String roundId, Integer page, Integer pageSize) {
Map data = Maps.newHashMap();
page = page != null ? page : Constant.DEFAULT_PAGE;
pageSize = pageSize != null ? pageSize : Constant.DEFAULT_PAGE_SIZE;
PageHelper.startPage(page, pageSize);
List<ActCallBattleAdminRoundDetailVo> recordList = actCallBattleAdminMapper.listRoundDrawDetail(roundId);
PageInfo<ActCallBattleAdminRoundDetailVo> pageInfo = new PageInfo<>(recordList);
data.put("rows", pageInfo.getList());
data.put("total", pageInfo.getTotal());
return data;
}
/**
* 校验配置的名称
* @param itemName
*/
private void checkItemName(String itemName, String restraintName) {
Pattern r = Pattern.compile("^[\\u4E00-\\u9FA5A-Za-z0-9_]+$");
if (StringUtils.isNotBlank(itemName)) {
Matcher m = r.matcher(itemName);
if (!m.matches()) {
throw new ServiceException("配置名称只能为中文,数字,大小写英文与下划线");
}
}
if (StringUtils.isNotBlank(restraintName)) {
Matcher rMatcher = r.matcher(restraintName);
if (!rMatcher.matches()) {
throw new ServiceException("配置名称只能为中文,数字,大小写英文与下划线");
}
}
}
}

View File

@@ -1,319 +0,0 @@
/*
* 文 件 名: LuckySeaActAdminServiceImpl
* 版 权:
* 描 述: <描述>
* 创建人: H1
* 创建时间: 2021/1/11
* 修改人:
* 修改内容:
* 修改时间:
*/
package com.accompany.admin.service.activity.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.accompany.admin.mapper.LuckySeaActAdminMapper;
import com.accompany.admin.params.LuckySeaItemSaveReqParams;
import com.accompany.admin.service.activity.LuckySeaActAdminService;
import com.accompany.admin.vo.luckysea.*;
import com.accompany.business.model.activity.luckysea.LuckySeaItem;
import com.accompany.business.model.activity.luckysea.LuckySeaItemGroup;
import com.accompany.business.service.activities.luckySea.LuckySeaActInfoService;
import com.accompany.business.service.activities.luckySea.LuckySeaItemGroupService;
import com.accompany.business.service.activities.luckySea.LuckySeaItemService;
import com.accompany.common.constant.Constant;
import com.accompany.common.status.BusiStatus;
import com.accompany.common.utils.StringUtils;
import com.accompany.core.exception.AdminServiceException;
import com.accompany.core.service.SysConfService;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Maps;
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.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
* <br>类描述: 深海奇缘
* <br>功能详细描述:
*
* @author H1
* @date [2021/1/11]
*/
@Service
@Slf4j
@Transactional(rollbackFor = Exception.class)
public class LuckySeaActAdminServiceImpl implements LuckySeaActAdminService {
@Autowired
private LuckySeaItemGroupService luckySeaItemGroupService;
@Autowired
private LuckySeaItemService luckySeaItemService;
@Autowired
private LuckySeaActAdminMapper luckySeaActAdminMapper;
@Autowired
private LuckySeaActInfoService luckySeaActInfoService;
@Autowired
private SysConfService sysConfService;
@Override
public void addLuckySeaActItem(LuckySeaItem item) {
if (null == item.getId()) {
// 新增
if (StringUtils.isBlank(item.getName())) {
throw new AdminServiceException("名称不能为空");
}
if (StringUtils.isBlank(item.getImgUrl())) {
throw new AdminServiceException("图片不能为空");
}
if (null == item.getMultiple()) {
throw new AdminServiceException("倍数不能为空");
}
if (item.getMultiple() < 1) {
throw new AdminServiceException("倍数需要大于等于1");
}
checkItemName(item.getName());
item.setCreateTime(new Date());
item.setStatus(Constant.status.valid);
} else {
// 编辑
if (StringUtils.isNotBlank(item.getName())) {
checkItemName(item.getName());
}
if (null != item.getMultiple() && item.getMultiple() < 1) {
throw new AdminServiceException("倍数需要大于等于1");
}
}
item.setUpdateTime(new Date());
luckySeaItemService.saveOrUpdate(item);
}
private void checkItemInfo(LuckySeaItem item) {
if (StringUtils.isBlank(item.getName())) {
throw new AdminServiceException("名称不能为空");
}
if (StringUtils.isBlank(item.getImgUrl())) {
throw new AdminServiceException("图片不能为空");
}
if (null == item.getMultiple()) {
throw new AdminServiceException("倍数不能为空");
}
if (item.getMultiple() < 1) {
throw new AdminServiceException("倍数需要大于等于1");
}
}
@Override
public void saveLuckySeaActItems(LuckySeaItemSaveReqParams params) {
List<LuckySeaItem> items = params.getItems();
if (CollectionUtils.isEmpty(items)) {
throw new AdminServiceException(BusiStatus.PARAMERROR, "配置不能为空");
}
QueryWrapper<LuckySeaItem> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(LuckySeaItem::getStatus, Constant.status.valid);
List<LuckySeaItem> oldItems = luckySeaItemService.list(queryWrapper);
List<Long> oldIds;
if (CollectionUtil.isNotEmpty(oldItems)) {
oldIds = oldItems.stream().map(LuckySeaItem::getId).collect(Collectors.toList());
} else {
oldIds = Collections.emptyList();
}
List<LuckySeaItem> newItems = new ArrayList<>();
List<LuckySeaItem> updateItems = new ArrayList<>();
// 检查倍数配置是否合理
String ticketRateStr = sysConfService.getSysConfValueById(Constant.SysConfId.LUCKY_SEA_TICKET);
Double ticketRate = Double.valueOf(ticketRateStr);
LuckySeaItem minMultipleItem = items.stream().min(Comparator.comparing(LuckySeaItem::getMultiple)).get();
log.info("配置中,倍数最小的是 {}", JSON.toJSONString(minMultipleItem));
if (items.size() * (1 - ticketRate) <= minMultipleItem.getMultiple()) {
throw new AdminServiceException(BusiStatus.SERVERERROR, "当前配置不符合要求,请检查组数、门票和最小倍数的关系是否合理");
}
items.forEach(item -> {
checkItemInfo(item);
if (item.getId() == null || !oldIds.contains(item.getId())) {
item.setStatus(Constant.status.valid);
item.setCreateTime(new Date());
item.setUpdateTime(new Date());
newItems.add(item);
} else {
updateItems.add(item);
// 从原id列表中移除
oldIds.remove(item.getId());
}
});
if (CollectionUtil.isNotEmpty(newItems)) {
if (oldItems.size() + newItems.size() > 8){
throw new AdminServiceException(BusiStatus.SERVERERROR, "最多只能存在 8 个档位");
}
log.info("新增配置列表: {}", JSONObject.toJSONString(newItems));
luckySeaItemService.saveBatch(newItems);
}
if (CollectionUtil.isNotEmpty(updateItems)) {
log.info("更新配置列表: {}", JSONObject.toJSONString(updateItems));
luckySeaItemService.updateBatchById(updateItems);
}
if (CollectionUtil.isNotEmpty(oldIds)) {
log.info("移除的配置列表: {}", JSONObject.toJSONString(oldIds));
luckySeaItemService.removeByIds(oldIds);
}
}
@Override
public Map<String, Object> listLuckySeaItem(String name, Integer pageNum, Integer pageSize) {
Map data = Maps.newHashMap();
pageNum = pageNum != null ? pageNum : Constant.DEFAULT_PAGE;
pageSize = pageSize != null ? pageSize : Constant.DEFAULT_PAGE_SIZE;
PageHelper.startPage(pageNum, pageSize);
QueryWrapper<LuckySeaItem> wrapper = new QueryWrapper<>();
LambdaQueryWrapper<LuckySeaItem> lambda = wrapper.lambda();
lambda.eq(LuckySeaItem::getStatus, Constant.status.valid);
if (StringUtils.isNotBlank(name)) {
lambda.eq(LuckySeaItem::getName, name);
}
lambda.orderByDesc(LuckySeaItem::getId);
List<LuckySeaItem> list = luckySeaItemService.list(wrapper);
PageInfo<LuckySeaItem> pageInfo = new PageInfo<>(list);
data.put("rows", pageInfo.getList());
data.put("total", pageInfo.getTotal());
return data;
}
@Override
public Page<LuckySeaActPlatformStatVo> pagePlatformStat(String startTime, String endTime, Integer page, Integer pageSize) {
page = page != null ? page : Constant.DEFAULT_PAGE;
pageSize = pageSize != null ? pageSize : Constant.DEFAULT_PAGE_SIZE;
Page<LuckySeaActPlatformStatVo> pageInfo = new Page<>(page, pageSize);
return luckySeaActAdminMapper.pagePlatformStat(pageInfo, startTime, endTime);
}
@Override
public Map<String, Object> listUserDrawRecordList(String startTime, String endTime, String erbanNoStr, Integer page, Integer pageSize) {
Map data = Maps.newHashMap();
page = page != null ? page : Constant.DEFAULT_PAGE;
pageSize = pageSize != null ? pageSize : Constant.DEFAULT_PAGE_SIZE;
PageHelper.startPage(page, pageSize);
List<String> erbanNoList = new ArrayList<>();
if (StringUtils.isNotBlank(erbanNoStr)) {
erbanNoList = Arrays.asList(erbanNoStr.trim().replaceAll("", ",").split(","));
}
List<LuckySeaActAdminUserDrawRecord> recordList = luckySeaActAdminMapper.listUserDrawRecord(startTime, endTime, erbanNoList);
PageInfo<LuckySeaActAdminUserDrawRecord> pageInfo = new PageInfo<>(recordList);
data.put("rows", pageInfo.getList());
data.put("total", pageInfo.getTotal());
return data;
}
@Override
public Map<String, Object> listActRecord(String startTime, String endTime, String roundId, Integer page, Integer pageSize) {
Map data = Maps.newHashMap();
page = page != null ? page : Constant.DEFAULT_PAGE;
pageSize = pageSize != null ? pageSize : Constant.DEFAULT_PAGE_SIZE;
PageHelper.startPage(page, pageSize);
List<LuckySeaActAdminRecordVo> recordList = luckySeaActAdminMapper.listActRecord(startTime, endTime, roundId);
PageInfo<LuckySeaActAdminRecordVo> pageInfo = new PageInfo<>(recordList);
data.put("rows", pageInfo.getList());
data.put("total", pageInfo.getTotal());
return data;
}
@Override
public Map<String, Object> listRoundDrawDetail(String roundId, Integer page, Integer pageSize) {
Map data = Maps.newHashMap();
page = page != null ? page : Constant.DEFAULT_PAGE;
pageSize = pageSize != null ? pageSize : Constant.DEFAULT_PAGE_SIZE;
PageHelper.startPage(page, pageSize);
List<LuckySeaActAdminRoundDetailVo> recordList = luckySeaActAdminMapper.listRoundDrawDetail(roundId);
PageInfo<LuckySeaActAdminRoundDetailVo> pageInfo = new PageInfo<>(recordList);
data.put("rows", pageInfo.getList());
data.put("total", pageInfo.getTotal());
return data;
}
@Override
public List<LuckySeaItemGroupAdminVo> listLuckySeaItemGroup() {
List<LuckySeaItemGroupAdminVo> voList = new ArrayList<>();
List<LuckySeaItemGroup> doList = luckySeaItemGroupService.list();
if (!CollectionUtils.isEmpty(doList)){
List<LuckySeaItem> itemList = luckySeaItemService.listItem();
Map<Long, String> itemNameMap = itemList.stream().collect(Collectors.toMap(LuckySeaItem::getId, LuckySeaItem::getName));
for (LuckySeaItemGroup group: doList) {
LuckySeaItemGroupAdminVo vo = new LuckySeaItemGroupAdminVo();
BeanUtils.copyProperties(group, vo);
vo.setItemIds(group.getItemIds().stream().map(Object::toString).collect(Collectors.joining(",")));
vo.setItemNames(group.getItemIds().stream().map(itemNameMap::get).collect(Collectors.joining(",")));
voList.add(vo);
}
}
return voList;
}
@Override
public void delLuckySeaItemGroup(Long id) {
luckySeaItemGroupService.removeById(id);
}
@Override
public void saveLuckySeaItemGroup(Long id, String name, String itemIdsStr, Byte status) {
Date now = new Date();
List<Long> itemIds = Arrays.stream(itemIdsStr.split(","))
.map(Long::parseLong).sorted().collect(Collectors.toList());
if (itemIds.stream().distinct().count() < itemIds.size()){
throw new AdminServiceException("该组合存在相同ID");
}
List<LuckySeaItemGroup> allList = luckySeaItemGroupService.list();
if (allList.stream().anyMatch(g->g.getName().equals(name) && !g.getId().equals(id))){
throw new AdminServiceException("已经有相同名称的组合");
}
if (allList.stream().anyMatch(g->g.getItemIds().equals(itemIds) && !g.getId().equals(id))){
throw new AdminServiceException("已经有相同开奖ID组合");
}
List<LuckySeaItem> itemList = luckySeaItemService.listItem();
Set<Long> itemIdSet = itemList.stream().map(LuckySeaItem::getId).collect(Collectors.toSet());
Optional<Long> optional = itemIds.stream().filter(i->!itemIdSet.contains(i)).findAny();
if (optional.isPresent()){
throw new AdminServiceException(String.format("开奖ID %d 不存在", optional.get()));
}
LuckySeaItemGroup db = new LuckySeaItemGroup();
db.setId(id);
db.setName(name);
db.setItemIds(itemIds);
db.setStatus(status);
db.setCreateTime(now);
db.setUpdateTime(now);
luckySeaItemGroupService.saveOrUpdate(db);
}
/**
* 校验配置的名称
* @param itemName
*/
private void checkItemName(String itemName) {
Pattern r = Pattern.compile("^[\\u4E00-\\u9FA5A-Za-z0-9_]+$");
Matcher m = r.matcher(itemName);
if (!m.matches()) {
throw new AdminServiceException("配置名称只能为中文,数字,大小写英文与下划线");
}
}
}

View File

@@ -8,33 +8,25 @@ import com.accompany.admin.service.UserLevelExperienceExportService;
import com.accompany.business.constant.guild.GuildConstant;
import com.accompany.business.dto.WeekActiveGuildStat;
import com.accompany.business.model.*;
import com.accompany.business.model.guild.Guild;
import com.accompany.business.model.guild.GuildMember;
import com.accompany.business.model.relation.RelationUser;
import com.accompany.business.mybatismapper.*;
import com.accompany.business.service.*;
import com.accompany.business.service.activity.WeekStarService;
import com.accompany.business.service.apple.IOSRefundV2Service;
import com.accompany.business.service.guild.GuildDressUpService;
import com.accompany.business.service.guild.GuildMemberService;
import com.accompany.business.service.guild.GuildOperatorService;
import com.accompany.business.service.guild.GuildService;
import com.accompany.business.service.guild.*;
import com.accompany.business.service.level.LevelService;
import com.accompany.business.service.lucky.BravoRecordService;
import com.accompany.business.service.lucky.Lucky24RecordService;
import com.accompany.business.service.relation.impl.RelationUserServiceImpl;
import com.accompany.business.service.room.RoomManageService;
import com.accompany.business.service.room.RoomReciveRankingService;
import com.accompany.business.service.room.RoomSendRankingService;
import com.accompany.business.service.room.RoomService;
import com.accompany.business.service.room.*;
import com.accompany.business.service.user.UsersService;
import com.accompany.business.vo.RoomVo;
import com.accompany.common.config.SystemConfig;
import com.accompany.common.constant.Constant;
import com.accompany.common.netease.neteaseacc.result.RoomMemberRet;
import com.accompany.common.netease.neteaseacc.result.RoomRet;
import com.accompany.common.redis.RedisKey;
import com.accompany.common.status.BusiStatus;
import com.accompany.common.utils.CommonUtil;
import com.accompany.common.utils.DateTimeUtil;
import com.accompany.common.utils.StringUtils;
import com.accompany.common.utils.*;
import com.accompany.core.base.SpringContextHolder;
import com.accompany.core.enumeration.PartitionEnum;
import com.accompany.core.exception.AdminServiceException;
@@ -44,23 +36,20 @@ import com.accompany.core.mybatismapper.UsersMapper;
import com.accompany.core.service.account.AccountService;
import com.accompany.core.service.common.JedisService;
import com.accompany.core.service.region.RegionService;
import com.accompany.core.vo.UserLevelVo;
import com.accompany.payment.apple.ApplePublisher;
import com.accompany.payment.iospay.JWTTranscationInfoPayload;
import com.accompany.payment.model.ChargeRecord;
import com.accompany.payment.service.ChargeRecordService;
import com.accompany.payment.service.RechargeUserService;
import com.accompany.payment.service.UserRechargeLevelService;
import com.accompany.sharding.mapper.GiftSendRecordMapperExpand;
import com.accompany.sharding.model.GiftSendRecord;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RedissonClient;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -123,16 +112,8 @@ public class MyApiService {
@Autowired
private GiftSendRecordMapperExpand giftSendRecordMapperExpand;
@Autowired
private UserGiftWallMapperMgr userGiftWallMapperMgr;
@Autowired
private RechargeUserService rechargeUserService;
@Autowired
private DiamondGiveHistoryMapper diamondGiveHistoryMapper;
@Autowired
private RelationUserServiceImpl relationUserService;
@Autowired
private UserYearReportMapper userYearReportMapper;
@Autowired
private DiamondStatService diamondStatService;
@Autowired
private DnuStatService dnuStatService;
@@ -154,10 +135,6 @@ public class MyApiService {
private WeekGuildPartitionStatService weekGuildPartitionStatService;
@Autowired
private WeekRechargeAgentPartitionStatService weekRechargeAgentPartitionStatService;
@Autowired
private GuildOperatorService guildOperatorService;
@Autowired
private GuildService guildService;
public void refreshRoomMoneyRankList() {
List<Long> roomUidList = myApiAdminMapper.getExceptionRoomUid();
@@ -563,60 +540,6 @@ public class MyApiService {
}
}
public void calUserYearReport() {
Date limitDate = DateTimeUtil.convertStrToDate("2025-01-01 00:00:00");
UsersExample example = new UsersExample();
example.createCriteria().andCreateTimeLessThan(limitDate);
List<Users> userList = usersMapper.selectByExample(example);
if (CollectionUtils.isEmpty(userList)){
return;
}
userList.parallelStream().forEach(u->{
UserYearReport userYearReport = new UserYearReport();
userYearReport.setUid(u.getUid());
userYearReport.setCreateTime(u.getCreateTime());
UserLevelVo levelVo = levelService.getUserLevelVo(u.getUid());
userYearReport.setExperienceValue(levelVo.getExperAmount());
userYearReport.setExperienceLevel(levelVo.getExperLevelSeq());
userYearReport.setCharmValue(levelVo.getCharmAmount());
userYearReport.setCharmLevel(levelVo.getCharmLevelSeq());
List<UserGiftWall> wallList = userGiftWallMapperMgr.getUserWallListByUidOrderByCount(u.getUid());
if (CollectionUtils.isEmpty(wallList)){
userYearReport.setGiftWallCount(0);
} else {
userYearReport.setGiftWallCount(wallList.size());
userYearReport.setGiftId(wallList.get(0).getGiftId());
userYearReport.setGiftName(wallList.get(0).getGiftName());
}
List<RelationUser> relationUserList = relationUserService.getOrgCPList(u.getUid(), 0, 1);
if (!CollectionUtils.isEmpty(relationUserList)){
RelationUser relationUser = relationUserList.get(0);
userYearReport.setCpUid(relationUser.getLoverUid());
userYearReport.setCpCreateTime(relationUser.getCreateTime());
userYearReport.setCpValue(relationUser.getIntimacy());
}
boolean isRechargeUser = rechargeUserService.isRechargeUser(u.getUid());
if (isRechargeUser){
Wrapper<DiamondGiveHistory> wrapper = Wrappers.<DiamondGiveHistory>query()
.select("diamond_num", "sum(diamond_num) `diamond_num`")
.eq("from_uid", u.getUid())
.lt("create_time", limitDate)
.groupBy("from_uid");
DiamondGiveHistory history = diamondGiveHistoryMapper.selectOne(wrapper);
if (null !=history){
userYearReport.setGiveDiamond(history.getDiamondNum());
}
}
log.info(JSON.toJSONString(userYearReport));
userYearReportMapper.insertOrUpdate(userYearReport);
});
}
public void diamondStatAr(String date) {
List<Integer> partitionIds = List.of(PartitionEnum.ARAB.getId(), PartitionEnum.TURKEY.getId());
@@ -701,19 +624,7 @@ public class MyApiService {
stat.setEnActiveCountDetail(JSON.toJSONString(enActiveGuildStatList));
List<WeekActiveGuildStat> arActiveGuildStatList = JSON.parseArray(stat.getArActiveCountDetail(), WeekActiveGuildStat.class);
Map<Integer, String> operatorNameMap = guildOperatorService.operatorNameMap(PartitionEnum.ARAB.getId());
Map<Integer, Guild> guildMap = new HashMap<>();
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(arActiveGuildStatList)) {
List<Integer> guildIds = arActiveGuildStatList.stream().map(WeekActiveGuildStat::getGuildId).collect(Collectors.toList());
List<Guild> guildList = guildService.listByIds(guildIds);
guildMap = guildList.stream().collect(Collectors.toMap(Guild::getId, guild->guild));
}
for (WeekActiveGuildStat activeGuildStat : arActiveGuildStatList){
Guild guild = guildMap.get(activeGuildStat.getGuildId());
if (guild != null && guild.getOperatorId() != null) {
activeGuildStat.setOperatorId(guild.getOperatorId());
activeGuildStat.setOperatorName(operatorNameMap.get(guild.getOperatorId()));
}
String lastWeek = DateTimeUtil.convertDate(DateTimeUtil.addDays(DateTimeUtil.convertStrToDate(activeGuildStat.getDate(), DateTimeUtil.DEFAULT_DATE_PATTERN), -7));
String lastWeekGroupByKey = String.join("_", lastWeek, activeGuildStat.getPartitionId().toString(), activeGuildStat.getGuildId().toString());
WeekActiveGuildStat lastWeekStat = lastWeekActiveGuildStatMap.get(lastWeekGroupByKey);
@@ -759,19 +670,7 @@ public class MyApiService {
stat.setZhActiveCountDetail(JSON.toJSONString(zhActiveGuildStatList));
List<WeekActiveGuildStat> trActiveGuildStatList = JSON.parseArray(stat.getTrActiveCountDetail(), WeekActiveGuildStat.class);
operatorNameMap = guildOperatorService.operatorNameMap(PartitionEnum.TURKEY.getId());
guildMap = new HashMap<>();
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(trActiveGuildStatList)) {
List<Integer> guildIds = trActiveGuildStatList.stream().map(WeekActiveGuildStat::getGuildId).collect(Collectors.toList());
List<Guild> guildList = guildService.listByIds(guildIds);
guildMap = guildList.stream().collect(Collectors.toMap(Guild::getId, guild->guild));
}
for (WeekActiveGuildStat activeGuildStat : trActiveGuildStatList){
Guild guild = guildMap.get(activeGuildStat.getGuildId());
if (guild != null && guild.getOperatorId() != null) {
activeGuildStat.setOperatorId(guild.getOperatorId());
activeGuildStat.setOperatorName(operatorNameMap.get(guild.getOperatorId()));
}
String lastWeek = DateTimeUtil.convertDate(DateTimeUtil.addDays(DateTimeUtil.convertStrToDate(activeGuildStat.getDate(), DateTimeUtil.DEFAULT_DATE_PATTERN), -7));
String lastWeekGroupByKey = String.join("_", lastWeek, activeGuildStat.getPartitionId().toString(), activeGuildStat.getGuildId().toString());
WeekActiveGuildStat lastWeekStat = lastWeekActiveGuildStatMap.get(lastWeekGroupByKey);
@@ -792,44 +691,6 @@ public class MyApiService {
log.info("[refreshWeekGuildStat] today {} last {}", JSON.toJSONString(stat), JSON.toJSONString(lastWeekStat));
}
stat.setTrActiveCountDetail(JSON.toJSONString(trActiveGuildStatList));
}
Map<Integer, String> operatorNameMap;
Map<Integer, Guild> guildMap;
for (WeekGuildStat stat : lastWeekGuildStatList) {
List<WeekActiveGuildStat> arNewCountDetail = JSON.parseArray(stat.getArNewCountDetail(), WeekActiveGuildStat.class);
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(arNewCountDetail)) {
operatorNameMap = guildOperatorService.operatorNameMap(PartitionEnum.ARAB.getId());
List<Integer> guildIds = arNewCountDetail.stream().map(WeekActiveGuildStat::getGuildId).collect(Collectors.toList());
List<Guild> guildList = guildService.listByIds(guildIds);
guildMap = guildList.stream().collect(Collectors.toMap(Guild::getId, guild->guild));
for (WeekActiveGuildStat newCountstat : arNewCountDetail){
Guild guild = guildMap.get(newCountstat.getGuildId());
if (guild != null && guild.getOperatorId() != null) {
newCountstat.setOperatorId(guild.getOperatorId());
newCountstat.setOperatorName(operatorNameMap.get(guild.getOperatorId()));
}
}
}
stat.setArNewCountDetail(JSON.toJSONString(arNewCountDetail));
List<WeekActiveGuildStat> trNewGuildStatList = JSON.parseArray(stat.getTrNewCountDetail(), WeekActiveGuildStat.class);
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(trNewGuildStatList)) {
operatorNameMap = guildOperatorService.operatorNameMap(PartitionEnum.TURKEY.getId());
List<Integer> guildIds = trNewGuildStatList.stream().map(WeekActiveGuildStat::getGuildId).collect(Collectors.toList());
List<Guild> guildList = guildService.listByIds(guildIds);
guildMap = guildList.stream().collect(Collectors.toMap(Guild::getId, guild->guild));
for (WeekActiveGuildStat activeGuildStat : trNewGuildStatList){
Guild guild = guildMap.get(activeGuildStat.getGuildId());
if (guild != null && guild.getOperatorId() != null) {
activeGuildStat.setOperatorId(guild.getOperatorId());
activeGuildStat.setOperatorName(operatorNameMap.get(guild.getOperatorId()));
}
}
}
stat.setTrNewCountDetail(JSON.toJSONString(trNewGuildStatList));
}
weekGuildStatMapper.delete(null);
weekGuildStatMapper.insert(lastWeekGuildStatList);
@@ -879,4 +740,41 @@ public class MyApiService {
}
}
@SneakyThrows
public void createPublicRoom(Integer partitionId) {
Long uid = Long.parseLong(SystemConfig.secretaryUid);
Users u = usersService.getNotNullUsersByUid(uid);
Room room = new Room();
room.setUid(uid);
room.setTitle("public chat");
room.setPartitionId(partitionId);
Date now = new Date();
room.setValid(true);
room.setIsPermitRoom(Constant.PermitType.NO_PERMIT_ROOM); // 非牌照房
room.setMeetingName(UUIDUtil.get());
room.setOperatorStatus(Constant.RoomOptStatus.in);
room.setOpenTime(now);
room.setOnlineNum(0);
room.setCreateTime(now);
room.setUpdateTime(now);
room.setIsExceptionClose(false);
room.setAvatar(u.getAvatar());
room.setHasAnimationEffect(true);
room.setAudioQuality((byte) Constant.Yes1No0.YES);
room.setIsCloseScreen(false);
//默认开启魔力值
room.setShowGiftValue(true);
Byte roomType = room.getType();
if (roomType != null) {
RoomServiceFactory.getServiceByType(roomType).wrapRoom(room);
}
// 通知云信服务器创建聊天室
log.info("创建房间 : {}", GsonUtil.getDefGson().toJson(room));
RoomRet roomRet = roomService.createNetEaseRoomInfo(room);
if (!roomRet.isSuccess()) {
throw new Exception("createRoom error, code=" + roomRet.getCode() + "&uid=" + room.getUid() + "json=" + JSON.toJSONString(roomRet));
}
}
}

View File

@@ -1,74 +0,0 @@
package com.accompany.admin.service.batch;
import com.accompany.admin.model.batch.FlowDataBatchSearch;
import com.accompany.admin.vo.batch.FlowDataBatchSearchAdminVo;
import com.accompany.admin.vo.batch.FlowDataBatchSearchGrowAdminVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.context.request.ServletWebRequest;
import java.util.List;
/**
* @author: liaozetao
* @date: 2023/9/22 15:35
* @description:
*/
public interface FlowDataBatchSearchAdminService {
/**
* 分页
*
* @param searchKey
* @param batchId
* @param currentPage
* @param pageSize
* @return
*/
Page<FlowDataBatchSearchAdminVo> page(String searchKey, Long batchId, Integer currentPage, Integer pageSize);
/**
* 列表
*
* @return
*/
List<FlowDataBatchSearch> list();
/**
* 删除
*
* @param batchId
*/
void del(Long batchId);
/**
* 保存
*
* @param param
*/
void save(FlowDataBatchSearch param);
/**
* 付费成长
*
* @param batchId
* @return
*/
List<FlowDataBatchSearchGrowAdminVo> growList(Long batchId);
/**
* 付费成长导出
*
* @param batchId
* @param servletWebRequest
*/
void growExport(Long batchId, ServletWebRequest servletWebRequest);
/**
* 导出用户明细
*
* @param batchId
* @param servletWebRequest
*/
void detailExport(Long batchId, ServletWebRequest servletWebRequest);
}

View File

@@ -1,12 +0,0 @@
package com.accompany.admin.service.batch;
import com.accompany.admin.model.batch.FlowDataBatchSearch;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author: liaozetao
* @date: 2023/9/22 15:32
* @description:
*/
public interface FlowDataBatchSearchService extends IService<FlowDataBatchSearch> {
}

View File

@@ -1,704 +0,0 @@
package com.accompany.admin.service.batch.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.util.StrUtil;
import com.accompany.admin.dto.batch.FlowDataBatchSearchDetailAdminDto;
import com.accompany.admin.dto.batch.FlowDataBatchSearchGrowAdminDto;
import com.accompany.admin.mapper.batch.FlowDataBatchSearchAdminMapper;
import com.accompany.admin.model.batch.FlowDataBatchSearch;
import com.accompany.admin.service.batch.FlowDataBatchSearchAdminService;
import com.accompany.admin.service.batch.FlowDataBatchSearchService;
import com.accompany.admin.vo.batch.FlowDataBatchSearchAdminVo;
import com.accompany.admin.vo.batch.FlowDataBatchSearchGrowAdminVo;
import com.accompany.business.model.room.RoomSearchLog;
import com.accompany.business.mybatismapper.RoomSearchLogMapper;
import com.accompany.business.service.room.RoomService;
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.model.Room;
import com.accompany.core.model.Users;
import com.accompany.core.service.common.JedisService;
import com.accompany.core.service.user.UsersBaseService;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
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 org.springframework.web.context.request.ServletWebRequest;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLEncoder;
import java.time.YearMonth;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author: liaozetao
* @date: 2023/9/22 15:35
* @description:
*/
@Slf4j
@Service
public class FlowDataBatchSearchAdminServiceImpl implements FlowDataBatchSearchAdminService {
@Autowired
private FlowDataBatchSearchAdminMapper flowDataBatchSearchAdminMapper;
@Autowired
private RoomSearchLogMapper roomSearchLogMapper;
@Autowired
private UsersBaseService usersBaseService;
@Autowired
private RoomService roomService;
@Autowired
private FlowDataBatchSearchService flowDataBatchSearchService;
@Autowired
private JedisService jedisService;
@Override
public Page<FlowDataBatchSearchAdminVo> page(String searchKey, Long batchId, Integer currentPage, Integer pageSize) {
IPage<FlowDataBatchSearch> page = flowDataBatchSearchService.page(new Page<>(currentPage, pageSize), Wrappers.<FlowDataBatchSearch>lambdaQuery()
.eq(StrUtil.isNotEmpty(searchKey), FlowDataBatchSearch::getSearchKey, searchKey)
.eq(batchId != null && batchId != 0, FlowDataBatchSearch::getId, batchId)
.orderByDesc(FlowDataBatchSearch::getCreateTime));
List<FlowDataBatchSearchAdminVo> admins = new ArrayList<>();
Page<FlowDataBatchSearchAdminVo> iPage = new Page<>(currentPage, pageSize);
List<FlowDataBatchSearch> records = page.getRecords();
if (CollectionUtil.isNotEmpty(records)) {
List<Long> roomUidList = records.stream().map(FlowDataBatchSearch::getRoomUid).filter(Objects::nonNull).distinct().collect(Collectors.toList());
Map<Long, Room> roomMap = roomService.getRoomMap(roomUidList);
Date now = new Date();
for (FlowDataBatchSearch record : records) {
Date startTime = record.getStartTime();
Date endTime = record.getEndTime();
BigDecimal amount = record.getAmount();
Integer isFixed = record.getIsFixed();
FlowDataBatchSearchAdminVo admin = null;
String objStr = jedisService.hget(RedisKey.flow_data_batch_search_hash.getKey(), String.valueOf(record.getId()));
if (StrUtil.isNotEmpty(objStr)) {
admin = JSONObject.parseObject(objStr, FlowDataBatchSearchAdminVo.class);
BeanUtils.copyProperties(record, admin);
} else {
admin = new FlowDataBatchSearchAdminVo();
BeanUtils.copyProperties(record, admin);
String key = record.getSearchKey();
Long roomUid = record.getRoomUid();
if (roomMap.containsKey(roomUid)) {
Room room = roomMap.get(roomUid);
admin.setRoomName(room.getTitle());
}
if (isFixed != null && (isFixed == Constant.Yes1No0.NO || endTime.after(now))) {
if (amount == null) {
amount = BigDecimal.ZERO;
}
String startTimeStr = DateTimeUtil.convertDate(startTime, DatePattern.NORM_DATETIME_PATTERN);
String endTimeStr = DateTimeUtil.convertDate(endTime, DatePattern.NORM_DATETIME_PATTERN);
//期间新增UV
Integer timeUv = flowDataBatchSearchAdminMapper.getTimeUv(startTimeStr, endTimeStr);
admin.setTimeUv(timeUv);
//新增成本
BigDecimal costAmount = BigDecimal.ZERO;
if (timeUv != null && timeUv > 0) {
costAmount = amount.divide(BigDecimal.valueOf(timeUv), 2, RoundingMode.HALF_UP);
}
admin.setCostAmount(costAmount);
//归因新增UV
Integer ascribeTimeUv = flowDataBatchSearchAdminMapper.getAscribeTimeUv(key, startTimeStr, endTimeStr);
admin.setAscribeTimeUv(ascribeTimeUv);
//归因后进入归因房间UV
Integer inRoomUv = flowDataBatchSearchAdminMapper.getInRoomUv(key, record.getRoomUid(), startTimeStr, endTimeStr);
admin.setInRoomUv(inRoomUv);
//归因新增成本
BigDecimal ascribeCostAmount = BigDecimal.ZERO;
if (ascribeTimeUv != null && ascribeTimeUv > 0) {
ascribeCostAmount = amount.divide(BigDecimal.valueOf(ascribeTimeUv), 2, RoundingMode.HALF_UP);
}
admin.setAscribeCostAmount(ascribeCostAmount);
List<String> yearMonths = DateTimeUtil.getYearMonths(startTimeStr, endTimeStr);
//活动内私聊用户数
Integer chatNum = flowDataBatchSearchAdminMapper.getChatNum(key, yearMonths, startTimeStr, endTimeStr);
admin.setChatNum(chatNum);
//私聊用户成本
BigDecimal chatCostAmount = BigDecimal.ZERO;
if (chatNum != null && chatNum > 0) {
chatCostAmount = amount.divide(BigDecimal.valueOf(chatNum), 2, RoundingMode.HALF_UP);
}
admin.setChatCostAmount(chatCostAmount);
//更新是否固定标识
if (now.after(endTime)) {
admin.setIsFixed(Constant.Yes1No0.YES);
}
//实时更新
flowDataBatchSearchService.updateById(admin);
}
jedisService.hset(RedisKey.flow_data_batch_search_hash.getKey(), String.valueOf(record.getId()), JSONObject.toJSONString(admin));
jedisService.expire(RedisKey.flow_data_batch_search_hash.getKey(), 10 * 60);
}
admins.add(admin);
}
}
iPage.setTotal(page.getTotal());
iPage.setRecords(admins);
return iPage;
}
@Override
public List<FlowDataBatchSearch> list() {
return flowDataBatchSearchService.list(Wrappers.<FlowDataBatchSearch>lambdaQuery()
.orderByDesc(FlowDataBatchSearch::getCreateTime));
}
@Override
public void del(Long batchId) {
flowDataBatchSearchService.removeById(batchId);
}
@Override
public void save(FlowDataBatchSearch param) {
Date now = new Date();
Long id = param.getId();
String searchKey = param.getSearchKey();
Date startTime = param.getStartTime();
Date endTime = param.getEndTime();
String startYearMonthStr = DateTimeUtil.convertDate(startTime, DateTimeUtil.DATE_FORMAT_YEAR_MONTH);
String endYearMonthStr = DateTimeUtil.convertDate(endTime, DateTimeUtil.DATE_FORMAT_YEAR_MONTH);
assert startYearMonthStr != null;
YearMonth startMonth = YearMonth.parse(startYearMonthStr, DateTimeFormatter.ofPattern(DateTimeUtil.DATE_FORMAT_YEAR_MONTH));
assert endYearMonthStr != null;
YearMonth endMonth = YearMonth.parse(endYearMonthStr, DateTimeFormatter.ofPattern(DateTimeUtil.DATE_FORMAT_YEAR_MONTH));
if (startMonth.getMonthValue() != endMonth.getMonthValue()) {
throw new AdminServiceException("归因场次不允许跨月");
}
List<RoomSearchLog> roomSearchLogs = roomSearchLogMapper.selectList(Wrappers.<RoomSearchLog>lambdaQuery()
.eq(RoomSearchLog::getSearchType, Constant.SearchType.total)
.eq(RoomSearchLog::getSearchKey, searchKey)
.ge(RoomSearchLog::getCreateTime, startTime)
.le(RoomSearchLog::getCreateTime, endTime));
if (CollectionUtil.isNotEmpty(roomSearchLogs)) {
Optional<RoomSearchLog> any = roomSearchLogs.stream().filter(v -> CollectionUtil.isNotEmpty(v.getResultUids()) && v.getResultUids().size() == 1).findAny();
if (any.isPresent()) {
RoomSearchLog roomSearchLog = any.get();
List<Long> resultUidList = roomSearchLog.getResultUids();
if (CollectionUtil.isNotEmpty(resultUidList)) {
param.setRoomUid(resultUidList.get(0));
}
}
}
if (param.getRoomUid() == null) {
Users users = usersBaseService.getUsersByErBanNo(Long.valueOf(searchKey));
if (users != null) {
param.setRoomUid(users.getUid());
}
}
if (param.getRoomUid() == null) {
throw new AdminServiceException("未找到归因房间");
}
if (id == null) {
param.setCreateTime(now);
}
param.setUpdateTime(now);
param.setIsFixed(Constant.Yes1No0.NO);
flowDataBatchSearchService.saveOrUpdate(param);
}
@Override
public List<FlowDataBatchSearchGrowAdminVo> growList(Long batchId) {
List<FlowDataBatchSearchGrowAdminVo> admins = new ArrayList<>();
FlowDataBatchSearch search = flowDataBatchSearchService.getById(batchId);
if (search == null) {
return admins;
}
//预算
BigDecimal amount = search.getAmount();
if (amount == null) {
amount = BigDecimal.ZERO;
}
//关键字
String searchKey = search.getSearchKey();
Date startTime = search.getStartTime();
Date endTime = search.getEndTime();
String startTimeStr = DateTimeUtil.convertDate(startTime, DatePattern.NORM_DATETIME_PATTERN);
String endTimeStr = DateTimeUtil.convertDate(endTime, DatePattern.NORM_DATETIME_PATTERN);
Date beginTimeOfDay = DateTimeUtil.getEndTimeOfDay(DateTimeUtil.getBeginTimeOfDay(startTime));
Date endTimeOfDay = DateTimeUtil.getEndTimeOfDay(endTime);
Date now = new Date();
String objStr = jedisService.hget(RedisKey.flow_data_batch_search_detail_hash.getKey(), String.valueOf(batchId));
if (StrUtil.isNotEmpty(objStr)) {
admins = JSONArray.parseArray(objStr, FlowDataBatchSearchGrowAdminVo.class);
} else {
//本场归因到的UV
Integer ascribeTimeUv = flowDataBatchSearchAdminMapper.getAscribeTimeUv(searchKey, startTimeStr, endTimeStr);
if (ascribeTimeUv == null) {
ascribeTimeUv = 0;
}
//充值UV
FlowDataBatchSearchGrowAdminVo chargeUv = new FlowDataBatchSearchGrowAdminVo();
chargeUv.setCountItem("充值UV");
chargeUv.setCurrCondition(flowDataBatchSearchAdminMapper.getChargeUv(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(endTimeOfDay, DatePattern.NORM_DATETIME_PATTERN)));
chargeUv.setNextCondition(flowDataBatchSearchAdminMapper.getChargeUv(searchKey, startTimeStr, endTimeStr, DateTimeUtil.convertDate(DateTimeUtil.getBeginTimeOfDay(DateTimeUtil.addDays(beginTimeOfDay, 1)), DatePattern.NORM_DATETIME_PATTERN), DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 1), DatePattern.NORM_DATETIME_PATTERN)));
chargeUv.setThreeCondition(flowDataBatchSearchAdminMapper.getChargeUv(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 2), DatePattern.NORM_DATETIME_PATTERN)));
chargeUv.setSevenCondition(flowDataBatchSearchAdminMapper.getChargeUv(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 6), DatePattern.NORM_DATETIME_PATTERN)));
chargeUv.setFifteenCondition(flowDataBatchSearchAdminMapper.getChargeUv(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 14), DatePattern.NORM_DATETIME_PATTERN)));
chargeUv.setThirtyCondition(flowDataBatchSearchAdminMapper.getChargeUv(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 29), DatePattern.NORM_DATETIME_PATTERN)));
chargeUv.setTotalCondition(flowDataBatchSearchAdminMapper.getChargeUv(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(now, DatePattern.NORM_DATETIME_PATTERN)));
admins.add(chargeUv);
//收到转赠UV
FlowDataBatchSearchGrowAdminVo giveUv = new FlowDataBatchSearchGrowAdminVo();
giveUv.setCountItem("收到转赠UV");
giveUv.setCurrCondition(flowDataBatchSearchAdminMapper.getGiveUv(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(endTimeOfDay, DatePattern.NORM_DATETIME_PATTERN)));
giveUv.setNextCondition(flowDataBatchSearchAdminMapper.getGiveUv(searchKey, startTimeStr, endTimeStr, DateTimeUtil.convertDate(DateTimeUtil.getBeginTimeOfDay(DateTimeUtil.addDays(beginTimeOfDay, 1)), DatePattern.NORM_DATETIME_PATTERN), DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 1), DatePattern.NORM_DATETIME_PATTERN)));
giveUv.setThreeCondition(flowDataBatchSearchAdminMapper.getGiveUv(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 2), DatePattern.NORM_DATETIME_PATTERN)));
giveUv.setSevenCondition(flowDataBatchSearchAdminMapper.getGiveUv(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 6), DatePattern.NORM_DATETIME_PATTERN)));
giveUv.setFifteenCondition(flowDataBatchSearchAdminMapper.getGiveUv(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 14), DatePattern.NORM_DATETIME_PATTERN)));
giveUv.setThirtyCondition(flowDataBatchSearchAdminMapper.getGiveUv(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 29), DatePattern.NORM_DATETIME_PATTERN)));
giveUv.setTotalCondition(flowDataBatchSearchAdminMapper.getGiveUv(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(now, DatePattern.NORM_DATETIME_PATTERN)));
admins.add(giveUv);
//全量付费UV
FlowDataBatchSearchGrowAdminVo payUv = new FlowDataBatchSearchGrowAdminVo();
payUv.setCountItem("全量付费UV");
payUv.setCurrCondition(flowDataBatchSearchAdminMapper.getPayUv(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(endTimeOfDay, DatePattern.NORM_DATETIME_PATTERN)));
payUv.setNextCondition(flowDataBatchSearchAdminMapper.getPayUv(searchKey, startTimeStr, endTimeStr, DateTimeUtil.convertDate(DateTimeUtil.getBeginTimeOfDay(DateTimeUtil.addDays(beginTimeOfDay, 1)), DatePattern.NORM_DATETIME_PATTERN), DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 1), DatePattern.NORM_DATETIME_PATTERN)));
payUv.setThreeCondition(flowDataBatchSearchAdminMapper.getPayUv(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 2), DatePattern.NORM_DATETIME_PATTERN)));
payUv.setSevenCondition(flowDataBatchSearchAdminMapper.getPayUv(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 6), DatePattern.NORM_DATETIME_PATTERN)));
payUv.setFifteenCondition(flowDataBatchSearchAdminMapper.getPayUv(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 14), DatePattern.NORM_DATETIME_PATTERN)));
payUv.setThirtyCondition(flowDataBatchSearchAdminMapper.getPayUv(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 29), DatePattern.NORM_DATETIME_PATTERN)));
payUv.setTotalCondition(flowDataBatchSearchAdminMapper.getPayUv(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(now, DatePattern.NORM_DATETIME_PATTERN)));
admins.add(payUv);
//直充付费率
FlowDataBatchSearchGrowAdminVo chargeRate = new FlowDataBatchSearchGrowAdminVo();
chargeRate.setCountItem("直充付费率");
chargeRate.setIsPercentage(true);
chargeRate.setCurrCondition(ascribeTimeUv != 0 ? chargeUv.getCurrCondition() / ascribeTimeUv : 0);
chargeRate.setNextCondition(ascribeTimeUv != 0 ? chargeUv.getNextCondition() / ascribeTimeUv : 0);
chargeRate.setThreeCondition(ascribeTimeUv != 0 ? chargeUv.getThreeCondition() / ascribeTimeUv : 0);
chargeRate.setSevenCondition(ascribeTimeUv != 0 ? chargeUv.getSevenCondition() / ascribeTimeUv : 0);
chargeRate.setFifteenCondition(ascribeTimeUv != 0 ? chargeUv.getFifteenCondition() / ascribeTimeUv : 0);
chargeRate.setThirtyCondition(ascribeTimeUv != 0 ? chargeUv.getThirtyCondition() / ascribeTimeUv : 0);
chargeRate.setTotalCondition(ascribeTimeUv != 0 ? chargeUv.getTotalCondition() / ascribeTimeUv : 0);
admins.add(chargeRate);
//直充付费成本
FlowDataBatchSearchGrowAdminVo chargeCost = new FlowDataBatchSearchGrowAdminVo();
chargeCost.setCountItem("直充付费成本");
chargeCost.setCurrCondition(chargeUv.getCurrCondition() != 0 ? amount.divide(BigDecimal.valueOf(chargeUv.getCurrCondition()), 2, RoundingMode.HALF_UP).doubleValue() : 0);
chargeCost.setNextCondition(chargeUv.getNextCondition() != 0 ? amount.divide(BigDecimal.valueOf(chargeUv.getNextCondition()), 2, RoundingMode.HALF_UP).doubleValue() : 0);
chargeCost.setThreeCondition(chargeUv.getThreeCondition() != 0 ? amount.divide(BigDecimal.valueOf(chargeUv.getThreeCondition()), 2, RoundingMode.HALF_UP).doubleValue() : 0);
chargeCost.setSevenCondition(chargeUv.getSevenCondition() != 0 ? amount.divide(BigDecimal.valueOf(chargeUv.getSevenCondition()), 2, RoundingMode.HALF_UP).doubleValue() : 0);
chargeCost.setFifteenCondition(chargeUv.getFifteenCondition() != 0 ? amount.divide(BigDecimal.valueOf(chargeUv.getFifteenCondition()), 2, RoundingMode.HALF_UP).doubleValue() : 0);
chargeCost.setThirtyCondition(chargeUv.getThirtyCondition() != 0 ? amount.divide(BigDecimal.valueOf(chargeUv.getThirtyCondition()), 2, RoundingMode.HALF_UP).doubleValue() : 0);
chargeCost.setTotalCondition(chargeUv.getTotalCondition() != 0 ? amount.divide(BigDecimal.valueOf(chargeUv.getTotalCondition()), 2, RoundingMode.HALF_UP).doubleValue() : 0);
admins.add(chargeCost);
//直充付费金额
FlowDataBatchSearchGrowAdminVo chargeAmount = new FlowDataBatchSearchGrowAdminVo();
chargeAmount.setCountItem("直充付费金额");
chargeAmount.setCurrCondition(flowDataBatchSearchAdminMapper.getChargeAmount(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(endTimeOfDay, DatePattern.NORM_DATETIME_PATTERN)));
chargeAmount.setNextCondition(flowDataBatchSearchAdminMapper.getChargeAmount(searchKey, startTimeStr, endTimeStr, DateTimeUtil.convertDate(DateTimeUtil.getBeginTimeOfDay(DateTimeUtil.addDays(beginTimeOfDay, 1)), DatePattern.NORM_DATETIME_PATTERN), DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 1), DatePattern.NORM_DATETIME_PATTERN)));
chargeAmount.setThreeCondition(flowDataBatchSearchAdminMapper.getChargeAmount(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 2), DatePattern.NORM_DATETIME_PATTERN)));
chargeAmount.setSevenCondition(flowDataBatchSearchAdminMapper.getChargeAmount(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 6), DatePattern.NORM_DATETIME_PATTERN)));
chargeAmount.setFifteenCondition(flowDataBatchSearchAdminMapper.getChargeAmount(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 14), DatePattern.NORM_DATETIME_PATTERN)));
chargeAmount.setThirtyCondition(flowDataBatchSearchAdminMapper.getChargeAmount(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 29), DatePattern.NORM_DATETIME_PATTERN)));
chargeAmount.setTotalCondition(flowDataBatchSearchAdminMapper.getChargeAmount(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(now, DatePattern.NORM_DATETIME_PATTERN)));
admins.add(chargeAmount);
//收到转赠的数额
FlowDataBatchSearchGrowAdminVo giveAmount = new FlowDataBatchSearchGrowAdminVo();
giveAmount.setCountItem("收到转赠的数额");
giveAmount.setCurrCondition(flowDataBatchSearchAdminMapper.getGiveAmount(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(endTimeOfDay, DatePattern.NORM_DATETIME_PATTERN)));
giveAmount.setNextCondition(flowDataBatchSearchAdminMapper.getGiveAmount(searchKey, startTimeStr, endTimeStr, DateTimeUtil.convertDate(DateTimeUtil.getBeginTimeOfDay(DateTimeUtil.addDays(beginTimeOfDay, 1)), DatePattern.NORM_DATETIME_PATTERN), DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 1), DatePattern.NORM_DATETIME_PATTERN)));
giveAmount.setThreeCondition(flowDataBatchSearchAdminMapper.getGiveAmount(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 2), DatePattern.NORM_DATETIME_PATTERN)));
giveAmount.setSevenCondition(flowDataBatchSearchAdminMapper.getGiveAmount(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 6), DatePattern.NORM_DATETIME_PATTERN)));
giveAmount.setFifteenCondition(flowDataBatchSearchAdminMapper.getGiveAmount(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 14), DatePattern.NORM_DATETIME_PATTERN)));
giveAmount.setThirtyCondition(flowDataBatchSearchAdminMapper.getGiveAmount(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 29), DatePattern.NORM_DATETIME_PATTERN)));
giveAmount.setTotalCondition(flowDataBatchSearchAdminMapper.getGiveAmount(searchKey, startTimeStr, endTimeStr, startTimeStr, DateTimeUtil.convertDate(now, DatePattern.NORM_DATETIME_PATTERN)));
admins.add(giveAmount);
//全量付费率
FlowDataBatchSearchGrowAdminVo payRate = new FlowDataBatchSearchGrowAdminVo();
payRate.setCountItem("全量付费率");
payRate.setIsPercentage(true);
payRate.setCurrCondition(ascribeTimeUv != 0 ? payUv.getCurrCondition() / ascribeTimeUv : 0);
payRate.setNextCondition(ascribeTimeUv != 0 ? payUv.getNextCondition() / ascribeTimeUv : 0);
payRate.setThreeCondition(ascribeTimeUv != 0 ? payUv.getThreeCondition() / ascribeTimeUv : 0);
payRate.setSevenCondition(ascribeTimeUv != 0 ? payUv.getSevenCondition() / ascribeTimeUv : 0);
payRate.setFifteenCondition(ascribeTimeUv != 0 ? payUv.getFifteenCondition() / ascribeTimeUv : 0);
payRate.setThirtyCondition(ascribeTimeUv != 0 ? payUv.getThirtyCondition() / ascribeTimeUv : 0);
payRate.setTotalCondition(ascribeTimeUv != 0 ? payUv.getTotalCondition() / ascribeTimeUv : 0);
admins.add(payRate);
//全量付费成本
FlowDataBatchSearchGrowAdminVo payCost = new FlowDataBatchSearchGrowAdminVo();
payCost.setCountItem("全量付费成本");
payCost.setCurrCondition(payUv.getCurrCondition() != 0 ? amount.divide(BigDecimal.valueOf(payUv.getCurrCondition()), 2, RoundingMode.HALF_UP).doubleValue() : 0);
payCost.setNextCondition(payUv.getNextCondition() != 0 ? amount.divide(BigDecimal.valueOf(payUv.getNextCondition()), 2, RoundingMode.HALF_UP).doubleValue() : 0);
payCost.setThreeCondition(payUv.getThreeCondition() != 0 ? amount.divide(BigDecimal.valueOf(payUv.getThreeCondition()), 2, RoundingMode.HALF_UP).doubleValue() : 0);
payCost.setSevenCondition(payUv.getSevenCondition() != 0 ? amount.divide(BigDecimal.valueOf(payUv.getSevenCondition()), 2, RoundingMode.HALF_UP).doubleValue() : 0);
payCost.setFifteenCondition(payUv.getFifteenCondition() != 0 ? amount.divide(BigDecimal.valueOf(payUv.getFifteenCondition()), 2, RoundingMode.HALF_UP).doubleValue() : 0);
payCost.setThirtyCondition(payUv.getThirtyCondition() != 0 ? amount.divide(BigDecimal.valueOf(payUv.getThirtyCondition()), 2, RoundingMode.HALF_UP).doubleValue() : 0);
payCost.setTotalCondition(payUv.getTotalCondition() != 0 ? amount.divide(BigDecimal.valueOf(payUv.getTotalCondition()), 2, RoundingMode.HALF_UP).doubleValue() : 0);
admins.add(payCost);
//全量付费金额
FlowDataBatchSearchGrowAdminVo payAmount = new FlowDataBatchSearchGrowAdminVo();
payAmount.setCountItem("全量付费金额");
payAmount.setCurrCondition(chargeAmount.getCurrCondition() + giveAmount.getCurrCondition());
payAmount.setNextCondition(chargeAmount.getNextCondition() + giveAmount.getNextCondition());
payAmount.setThreeCondition(chargeAmount.getThreeCondition() + giveAmount.getThreeCondition());
payAmount.setSevenCondition(chargeAmount.getSevenCondition() + giveAmount.getSevenCondition());
payAmount.setFifteenCondition(chargeAmount.getFifteenCondition() + giveAmount.getFifteenCondition());
payAmount.setThirtyCondition(chargeAmount.getThirtyCondition() + giveAmount.getThirtyCondition());
payAmount.setTotalCondition(chargeAmount.getTotalCondition() + giveAmount.getTotalCondition());
admins.add(payAmount);
//直充ROI
FlowDataBatchSearchGrowAdminVo chargeRoi = new FlowDataBatchSearchGrowAdminVo();
chargeRoi.setCountItem("直充ROI");
chargeRoi.setCurrCondition(amount.doubleValue() != 0 ? chargeAmount.getCurrCondition() / amount.doubleValue() : 0);
chargeRoi.setNextCondition(amount.doubleValue() != 0 ? chargeAmount.getNextCondition() / amount.doubleValue() : 0);
chargeRoi.setThreeCondition(amount.doubleValue() != 0 ? chargeAmount.getThreeCondition() / amount.doubleValue() : 0);
chargeRoi.setSevenCondition(amount.doubleValue() != 0 ? chargeAmount.getSevenCondition() / amount.doubleValue() : 0);
chargeRoi.setFifteenCondition(amount.doubleValue() != 0 ? chargeAmount.getFifteenCondition() / amount.doubleValue() : 0);
chargeRoi.setThirtyCondition(amount.doubleValue() != 0 ? chargeAmount.getThirtyCondition() / amount.doubleValue() : 0);
chargeRoi.setTotalCondition(amount.doubleValue() != 0 ? chargeAmount.getTotalCondition() / amount.doubleValue() : 0);
admins.add(chargeRoi);
//全量付费ROI
FlowDataBatchSearchGrowAdminVo payRoi = new FlowDataBatchSearchGrowAdminVo();
payRoi.setCountItem("全量付费ROI");
payRoi.setCurrCondition(amount.doubleValue() != 0 ? payAmount.getCurrCondition() / amount.doubleValue() : 0);
payRoi.setNextCondition(amount.doubleValue() != 0 ? payAmount.getNextCondition() / amount.doubleValue() : 0);
payRoi.setThreeCondition(amount.doubleValue() != 0 ? payAmount.getThreeCondition() / amount.doubleValue() : 0);
payRoi.setSevenCondition(amount.doubleValue() != 0 ? payAmount.getSevenCondition() / amount.doubleValue() : 0);
payRoi.setFifteenCondition(amount.doubleValue() != 0 ? payAmount.getFifteenCondition() / amount.doubleValue() : 0);
payRoi.setThirtyCondition(amount.doubleValue() != 0 ? payAmount.getThirtyCondition() / amount.doubleValue() : 0);
payRoi.setTotalCondition(amount.doubleValue() != 0 ? payAmount.getTotalCondition() / amount.doubleValue() : 0);
admins.add(payRoi);
//留存用户数
Double nextRemainCount = flowDataBatchSearchAdminMapper.getRemainCount(searchKey, startTimeStr, endTimeStr, 1);
Double threeRemainCount = flowDataBatchSearchAdminMapper.getRemainCount(searchKey, startTimeStr, endTimeStr, 2);
Double sevenRemainCount = flowDataBatchSearchAdminMapper.getRemainCount(searchKey, startTimeStr, endTimeStr, 6);
Double fifteenRemainCount = flowDataBatchSearchAdminMapper.getRemainCount(searchKey, startTimeStr, endTimeStr, 14);
Double thirtyRemainCount = flowDataBatchSearchAdminMapper.getRemainCount(searchKey, startTimeStr, endTimeStr, 29);
Double totalRemainCount = flowDataBatchSearchAdminMapper.getRemainCount(searchKey, startTimeStr, endTimeStr, -1);
FlowDataBatchSearchGrowAdminVo remainCount = new FlowDataBatchSearchGrowAdminVo();
remainCount.setCountItem("留存用户数");
remainCount.setNextCondition(nextRemainCount != null ? nextRemainCount : 0);
remainCount.setThreeCondition(threeRemainCount != null ? threeRemainCount : 0);
remainCount.setSevenCondition(sevenRemainCount != null ? sevenRemainCount : 0);
remainCount.setFifteenCondition(fifteenRemainCount != null ? fifteenRemainCount : 0);
remainCount.setThirtyCondition(thirtyRemainCount != null ? thirtyRemainCount : 0);
remainCount.setTotalCondition(totalRemainCount != null ? totalRemainCount : 0);
admins.add(remainCount);
//留存率
FlowDataBatchSearchGrowAdminVo remainRate = new FlowDataBatchSearchGrowAdminVo();
remainRate.setCountItem("留存率");
remainRate.setIsPercentage(true);
remainRate.setNextCondition(ascribeTimeUv != 0 ? remainCount.getNextCondition() / ascribeTimeUv : 0);
remainRate.setThreeCondition(ascribeTimeUv != 0 ? remainCount.getThreeCondition() / ascribeTimeUv : 0);
remainRate.setSevenCondition(ascribeTimeUv != 0 ? remainCount.getSevenCondition() / ascribeTimeUv : 0);
remainRate.setFifteenCondition(ascribeTimeUv != 0 ? remainCount.getFifteenCondition() / ascribeTimeUv : 0);
remainRate.setThirtyCondition(ascribeTimeUv != 0 ? remainCount.getThirtyCondition() / ascribeTimeUv : 0);
remainRate.setTotalCondition(ascribeTimeUv != 0 ? remainCount.getTotalCondition() / ascribeTimeUv : 0);
admins.add(remainRate);
//留存成本
FlowDataBatchSearchGrowAdminVo remainCost = new FlowDataBatchSearchGrowAdminVo();
remainCost.setCountItem("留存成本");
remainCost.setNextCondition(remainCount.getNextCondition() != 0 ? amount.divide(BigDecimal.valueOf(remainCount.getNextCondition()), 2, RoundingMode.HALF_UP).doubleValue() : 0);
remainCost.setThreeCondition(remainCount.getThreeCondition() != 0 ? amount.divide(BigDecimal.valueOf(remainCount.getThreeCondition()), 2, RoundingMode.HALF_UP).doubleValue() : 0);
remainCost.setSevenCondition(remainCount.getSevenCondition() != 0 ? amount.divide(BigDecimal.valueOf(remainCount.getSevenCondition()), 2, RoundingMode.HALF_UP).doubleValue() : 0);
remainCost.setFifteenCondition(remainCount.getFifteenCondition() != 0 ? amount.divide(BigDecimal.valueOf(remainCount.getFifteenCondition()), 2, RoundingMode.HALF_UP).doubleValue() : 0);
remainCost.setThirtyCondition(remainCount.getThirtyCondition() != 0 ? amount.divide(BigDecimal.valueOf(remainCount.getThirtyCondition()), 2, RoundingMode.HALF_UP).doubleValue() : 0);
remainCost.setTotalCondition(remainCount.getTotalCondition() != 0 ? amount.divide(BigDecimal.valueOf(remainCount.getTotalCondition()), 2, RoundingMode.HALF_UP).doubleValue() : 0);
admins.add(remainCost);
jedisService.hset(RedisKey.flow_data_batch_search_detail_hash.getKey(), String.valueOf(batchId), JSONArray.toJSONString(admins));
jedisService.expire(RedisKey.flow_data_batch_search_detail_hash.getKey(), 10 * 60);
}
return admins;
}
@Override
public void growExport(Long batchId, ServletWebRequest servletWebRequest) {
List<FlowDataBatchSearchGrowAdminDto> datas = new ArrayList<>();
List<FlowDataBatchSearchGrowAdminVo> records = growList(batchId);
if (CollectionUtil.isNotEmpty(records)) {
for (FlowDataBatchSearchGrowAdminVo record : records) {
FlowDataBatchSearchGrowAdminDto admin = new FlowDataBatchSearchGrowAdminDto();
Boolean isPercentage = record.getIsPercentage();
admin.setCountItem(record.getCountItem());
if (isPercentage) {
admin.setCurrCondition(BigDecimal.valueOf(record.getCurrCondition() * 100).setScale(2, RoundingMode.HALF_UP) + "%");
admin.setNextCondition(BigDecimal.valueOf(record.getNextCondition() * 100).setScale(2, RoundingMode.HALF_UP) + "%");
admin.setThreeCondition(BigDecimal.valueOf(record.getThreeCondition() * 100).setScale(2, RoundingMode.HALF_UP) + "%");
admin.setSevenCondition(BigDecimal.valueOf(record.getSevenCondition() * 100).setScale(2, RoundingMode.HALF_UP) + "%");
admin.setFifteenCondition(BigDecimal.valueOf(record.getFifteenCondition() * 100).setScale(2, RoundingMode.HALF_UP) + "%");
admin.setThirtyCondition(BigDecimal.valueOf(record.getThirtyCondition() * 100).setScale(2, RoundingMode.HALF_UP) + "%");
admin.setTotalCondition(BigDecimal.valueOf(record.getTotalCondition() * 100).setScale(2, RoundingMode.HALF_UP) + "%");
} else {
admin.setCurrCondition(String.valueOf(BigDecimal.valueOf(record.getCurrCondition()).setScale(2, RoundingMode.HALF_UP)));
admin.setNextCondition(String.valueOf(BigDecimal.valueOf(record.getNextCondition()).setScale(2, RoundingMode.HALF_UP)));
admin.setThreeCondition(String.valueOf(BigDecimal.valueOf(record.getThreeCondition()).setScale(2, RoundingMode.HALF_UP)));
admin.setSevenCondition(String.valueOf(BigDecimal.valueOf(record.getSevenCondition()).setScale(2, RoundingMode.HALF_UP)));
admin.setFifteenCondition(String.valueOf(BigDecimal.valueOf(record.getFifteenCondition()).setScale(2, RoundingMode.HALF_UP)));
admin.setThirtyCondition(String.valueOf(BigDecimal.valueOf(record.getThirtyCondition()).setScale(2, RoundingMode.HALF_UP)));
admin.setTotalCondition(String.valueOf(BigDecimal.valueOf(record.getTotalCondition()).setScale(2, RoundingMode.HALF_UP)));
}
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(), FlowDataBatchSearchGrowAdminDto.class).sheet("付费成长数据").doWrite(datas);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
}
private List<FlowDataBatchSearchDetailAdminDto> getDetailList(Long batchId) {
FlowDataBatchSearch search = flowDataBatchSearchService.getById(batchId);
if (search == null) {
return Collections.emptyList();
}
String searchKey = search.getSearchKey();
Long roomUid = search.getRoomUid();
Date startTime = search.getStartTime();
Date endTime = search.getEndTime();
String startTimeStr = DateTimeUtil.convertDate(startTime, DatePattern.NORM_DATETIME_PATTERN);
String endTimeStr = DateTimeUtil.convertDate(endTime, DatePattern.NORM_DATETIME_PATTERN);
Date beginTimeOfDay = DateTimeUtil.getEndTimeOfDay(DateTimeUtil.getBeginTimeOfDay(startTime));
Date endTimeOfDay = DateTimeUtil.getEndTimeOfDay(endTime);
Date now = new Date();
List<String> yearMonths = DateTimeUtil.getYearMonths(startTimeStr, endTimeStr);
//用户
List<FlowDataBatchSearchDetailAdminDto> userDetails = flowDataBatchSearchAdminMapper.getUserDetail(searchKey, startTimeStr, endTimeStr);
if (CollectionUtil.isEmpty(userDetails)) {
return Collections.emptyList();
}
Users roomUsers = usersBaseService.getUsersByUid(roomUid);
if (roomUsers == null) {
return Collections.emptyList();
}
List<Long> erBanNos = userDetails.stream().map(FlowDataBatchSearchDetailAdminDto::getErBanNo).collect(Collectors.toList());
//设备
List<FlowDataBatchSearchDetailAdminDto> userDevices = flowDataBatchSearchAdminMapper.getDevice(erBanNos);
//进房
List<FlowDataBatchSearchDetailAdminDto> inRooms = flowDataBatchSearchAdminMapper.getInRoom(erBanNos, roomUid, startTimeStr, endTimeStr);
//当天充值
List<FlowDataBatchSearchDetailAdminDto> currChargeAmounts = flowDataBatchSearchAdminMapper.getChargeAmountList(erBanNos, startTimeStr, DateTimeUtil.convertDate(endTimeOfDay, DatePattern.NORM_DATETIME_PATTERN));
//3天充值
List<FlowDataBatchSearchDetailAdminDto> threeChargeAmounts = flowDataBatchSearchAdminMapper.getChargeAmountList(erBanNos, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 2), DatePattern.NORM_DATETIME_PATTERN));
//7天充值
List<FlowDataBatchSearchDetailAdminDto> sevenChargeAmounts = flowDataBatchSearchAdminMapper.getChargeAmountList(erBanNos, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 6), DatePattern.NORM_DATETIME_PATTERN));
//15天充值
List<FlowDataBatchSearchDetailAdminDto> fifteenChargeAmounts = flowDataBatchSearchAdminMapper.getChargeAmountList(erBanNos, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 14), DatePattern.NORM_DATETIME_PATTERN));
//30天充值
List<FlowDataBatchSearchDetailAdminDto> thirtyChargeAmounts = flowDataBatchSearchAdminMapper.getChargeAmountList(erBanNos, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 29), DatePattern.NORM_DATETIME_PATTERN));
//累计充值
List<FlowDataBatchSearchDetailAdminDto> totalChargeAmounts = flowDataBatchSearchAdminMapper.getChargeAmountList(erBanNos, startTimeStr, DateTimeUtil.convertDate(now, DatePattern.NORM_DATETIME_PATTERN));
//当天转赠
List<FlowDataBatchSearchDetailAdminDto> currGiveDiamondNums = flowDataBatchSearchAdminMapper.getGiveAmountList(erBanNos, startTimeStr, DateTimeUtil.convertDate(endTimeOfDay, DatePattern.NORM_DATETIME_PATTERN));
//3天转赠
List<FlowDataBatchSearchDetailAdminDto> threeGiveDiamondNums = flowDataBatchSearchAdminMapper.getGiveAmountList(erBanNos, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 2), DatePattern.NORM_DATETIME_PATTERN));
//7天转赠
List<FlowDataBatchSearchDetailAdminDto> sevenGiveDiamondNums = flowDataBatchSearchAdminMapper.getGiveAmountList(erBanNos, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 6), DatePattern.NORM_DATETIME_PATTERN));
//15天转赠
List<FlowDataBatchSearchDetailAdminDto> fifteenGiveDiamondNums = flowDataBatchSearchAdminMapper.getGiveAmountList(erBanNos, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 14), DatePattern.NORM_DATETIME_PATTERN));
//30天转赠
List<FlowDataBatchSearchDetailAdminDto> thirtyGiveDiamondNums = flowDataBatchSearchAdminMapper.getGiveAmountList(erBanNos, startTimeStr, DateTimeUtil.convertDate(DateTimeUtil.addDays(beginTimeOfDay, 29), DatePattern.NORM_DATETIME_PATTERN));
//累计转赠
List<FlowDataBatchSearchDetailAdminDto> totalGiveDiamondNums = flowDataBatchSearchAdminMapper.getGiveAmountList(erBanNos, startTimeStr, DateTimeUtil.convertDate(now, DatePattern.NORM_DATETIME_PATTERN));
//次日是否访问
List<FlowDataBatchSearchDetailAdminDto> twoRemainCounts = flowDataBatchSearchAdminMapper.getRemainCountList(erBanNos, startTimeStr, endTimeStr, 1);
//第3日是否访问
List<FlowDataBatchSearchDetailAdminDto> threeRemainCounts = flowDataBatchSearchAdminMapper.getRemainCountList(erBanNos, startTimeStr, endTimeStr, 2);
//第7日是否访问
List<FlowDataBatchSearchDetailAdminDto> sevenRemainCounts = flowDataBatchSearchAdminMapper.getRemainCountList(erBanNos, startTimeStr, endTimeStr, 6);
//第15日是否访问
List<FlowDataBatchSearchDetailAdminDto> fifteenRemainCounts = flowDataBatchSearchAdminMapper.getRemainCountList(erBanNos, startTimeStr, endTimeStr, 14);
//第30日是否访问
List<FlowDataBatchSearchDetailAdminDto> thirtyRemainCounts = flowDataBatchSearchAdminMapper.getRemainCountList(erBanNos, startTimeStr, endTimeStr, 29);
for (FlowDataBatchSearchDetailAdminDto userDetail : userDetails) {
Long erBanNo = userDetail.getErBanNo();
String deviceId = userDetail.getDeviceId();
Users users = usersBaseService.getUsersByErBanNo(erBanNo);
if (users == null) {
continue;
}
Long uid = users.getUid();
if (StrUtil.isNotEmpty(deviceId) && CollectionUtil.isNotEmpty(userDevices)) {
userDevices.stream()
.filter(v -> deviceId.equals(v.getDeviceId()))
.findAny()
.ifPresent(v -> userDetail.setIsNewDevice(v.getIsNewDevice()));
}
if (CollectionUtil.isNotEmpty(inRooms)) {
inRooms.stream()
.filter(v -> erBanNo.equals(v.getErBanNo()))
.findAny()
.ifPresent(v -> userDetail.setIsInRoomStr(v.getIsInRoomStr()));
}
//活动期间私聊行为数
userDetail.setChatCount(flowDataBatchSearchAdminMapper.getChatCount(uid, yearMonths, startTimeStr, endTimeStr));
//当天充值
if (CollectionUtil.isNotEmpty(currChargeAmounts)) {
currChargeAmounts.stream()
.filter(v -> erBanNo.equals(v.getErBanNo()))
.findAny()
.ifPresent(v -> userDetail.setChargeAmount(v.getChargeAmount()));
}
//3天充值
if (CollectionUtil.isNotEmpty(threeChargeAmounts)) {
threeChargeAmounts.stream()
.filter(v -> erBanNo.equals(v.getErBanNo()))
.findAny()
.ifPresent(v -> userDetail.setThreeChargeAmount(v.getChargeAmount()));
}
//7天充值
if (CollectionUtil.isNotEmpty(sevenChargeAmounts)) {
sevenChargeAmounts.stream()
.filter(v -> erBanNo.equals(v.getErBanNo()))
.findAny()
.ifPresent(v -> userDetail.setSevenChargeAmount(v.getChargeAmount()));
}
//15天充值
if (CollectionUtil.isNotEmpty(fifteenChargeAmounts)) {
fifteenChargeAmounts.stream()
.filter(v -> erBanNo.equals(v.getErBanNo()))
.findAny()
.ifPresent(v -> userDetail.setFifteenChargeAmount(v.getChargeAmount()));
}
//30天充值
if (CollectionUtil.isNotEmpty(thirtyChargeAmounts)) {
thirtyChargeAmounts.stream()
.filter(v -> erBanNo.equals(v.getErBanNo()))
.findAny()
.ifPresent(v -> userDetail.setThirtyChargeAmount(v.getChargeAmount()));
}
//累计充值
if (CollectionUtil.isNotEmpty(totalChargeAmounts)) {
totalChargeAmounts.stream()
.filter(v -> erBanNo.equals(v.getErBanNo()))
.findAny()
.ifPresent(v -> userDetail.setTotalChargeAmount(v.getChargeAmount()));
}
//当天转赠
if (CollectionUtil.isNotEmpty(currGiveDiamondNums)) {
currGiveDiamondNums.stream()
.filter(v -> erBanNo.equals(v.getErBanNo()))
.findAny()
.ifPresent(v -> userDetail.setGiveDiamondNum(v.getGiveDiamondNum()));
}
//3天转赠
if (CollectionUtil.isNotEmpty(threeGiveDiamondNums)) {
threeGiveDiamondNums.stream()
.filter(v -> erBanNo.equals(v.getErBanNo()))
.findAny()
.ifPresent(v -> userDetail.setThreeGiveDiamondNum(v.getGiveDiamondNum()));
}
//7天转赠
if (CollectionUtil.isNotEmpty(sevenGiveDiamondNums)) {
sevenGiveDiamondNums.stream()
.filter(v -> erBanNo.equals(v.getErBanNo()))
.findAny()
.ifPresent(v -> userDetail.setSevenGiveDiamondNum(v.getGiveDiamondNum()));
}
//15天转赠
if (CollectionUtil.isNotEmpty(fifteenGiveDiamondNums)) {
fifteenGiveDiamondNums.stream()
.filter(v -> erBanNo.equals(v.getErBanNo()))
.findAny()
.ifPresent(v -> userDetail.setFifteenGiveDiamondNum(v.getGiveDiamondNum()));
}
//30天转赠
if (CollectionUtil.isNotEmpty(thirtyGiveDiamondNums)) {
thirtyGiveDiamondNums.stream()
.filter(v -> erBanNo.equals(v.getErBanNo()))
.findAny()
.ifPresent(v -> userDetail.setThirtyGiveDiamondNum(v.getGiveDiamondNum()));
}
//累计转赠
if (CollectionUtil.isNotEmpty(totalGiveDiamondNums)) {
totalGiveDiamondNums.stream()
.filter(v -> erBanNo.equals(v.getErBanNo()))
.findAny()
.ifPresent(v -> userDetail.setTotalGiveDiamondNum(v.getGiveDiamondNum()));
}
//次日是否访问
if (CollectionUtil.isNotEmpty(twoRemainCounts)) {
twoRemainCounts.stream()
.filter(v -> erBanNo.equals(v.getErBanNo()))
.findAny()
.ifPresent(v -> userDetail.setIsRemain(v.getIsRemain()));
}
//第3日是否访问
if (CollectionUtil.isNotEmpty(threeRemainCounts)) {
threeRemainCounts.stream()
.filter(v -> erBanNo.equals(v.getErBanNo()))
.findAny()
.ifPresent(v -> userDetail.setIsThreeRemain(v.getIsRemain()));
}
//第7日是否访问
if (CollectionUtil.isNotEmpty(sevenRemainCounts)) {
sevenRemainCounts.stream()
.filter(v -> erBanNo.equals(v.getErBanNo()))
.findAny()
.ifPresent(v -> userDetail.setIsSevenRemain(v.getIsRemain()));
}
//第15日是否访问
if (CollectionUtil.isNotEmpty(fifteenRemainCounts)) {
fifteenRemainCounts.stream()
.filter(v -> erBanNo.equals(v.getErBanNo()))
.findAny()
.ifPresent(v -> userDetail.setIsFifteenRemain(v.getIsRemain()));
}
//第30日是否访问
if (CollectionUtil.isNotEmpty(thirtyRemainCounts)) {
thirtyRemainCounts.stream()
.filter(v -> erBanNo.equals(v.getErBanNo()))
.findAny()
.ifPresent(v -> userDetail.setIsThirtyRemain(v.getIsRemain()));
}
}
return userDetails;
}
@Override
public void detailExport(Long batchId, ServletWebRequest servletWebRequest) {
List<FlowDataBatchSearchDetailAdminDto> datas = null;
String objStr = jedisService.hget(RedisKey.flow_data_batch_search_export_hash.getKey(), String.valueOf(batchId));
if (StrUtil.isNotEmpty(objStr)) {
datas = JSONArray.parseArray(objStr, FlowDataBatchSearchDetailAdminDto.class);
} else {
datas = getDetailList(batchId);
if (CollectionUtil.isNotEmpty(datas)) {
jedisService.hset(RedisKey.flow_data_batch_search_export_hash.getKey(), String.valueOf(batchId), JSONArray.toJSONString(datas));
jedisService.expire(RedisKey.flow_data_batch_search_export_hash.getKey(), 10 * 60);
}
}
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(), FlowDataBatchSearchDetailAdminDto.class).sheet("用户明细").doWrite(datas);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
}
}

View File

@@ -1,18 +0,0 @@
package com.accompany.admin.service.batch.impl;
import com.accompany.admin.mapper.batch.FlowDataBatchSearchMapper;
import com.accompany.admin.model.batch.FlowDataBatchSearch;
import com.accompany.admin.service.batch.FlowDataBatchSearchService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* @author: liaozetao
* @date: 2023/9/22 15:32
* @description:
*/
@Slf4j
@Service
public class FlowDataBatchSearchServiceImpl extends ServiceImpl<FlowDataBatchSearchMapper, FlowDataBatchSearch> implements FlowDataBatchSearchService {
}

View File

@@ -2,7 +2,6 @@ package com.accompany.admin.service.charge.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.accompany.admin.service.charge.ChargeRegionAdminService;
import com.accompany.business.service.withdraw.ExchangeRateService;
import com.accompany.common.redis.RedisKey;
import com.accompany.payment.model.ChargeRegion;
import com.accompany.payment.service.ChargeRegionService;
@@ -32,8 +31,6 @@ public class ChargeRegionAdminServiceImpl implements ChargeRegionAdminService {
@Autowired
private ChargeRegionService chargeRegionService;
@Autowired
private ExchangeRateService exchangeRateService;
@Override
public List<ChargeRegion> list() {
@@ -59,11 +56,6 @@ public class ChargeRegionAdminServiceImpl implements ChargeRegionAdminService {
public void save(ChargeRegion chargeRegion) {
chargeRegion.setUpdateTime(new Date());
chargeRegionService.updateById(chargeRegion);
//货币
//String currency = chargeRegion.getCurrency();
//BigDecimal rate = chargeRegion.getRate();
//更新汇率
//exchangeRateService.updateRate(currency, rate);
RMap<Object, Object> rMap = redissonClient.getMap(RedisKey.charge_region.getKey());
if (CollectionUtil.isNotEmpty(rMap)) {
rMap.delete();

View File

@@ -1,108 +0,0 @@
package com.accompany.admin.service.finance;
import com.accompany.admin.mapper.UserPurseAdminMapperExpand;
import com.accompany.admin.service.base.BaseService;
import com.accompany.business.model.FinanceGoldDiamond;
import com.accompany.business.model.FinanceGoldDiamondDetail;
import com.accompany.business.model.FinanceGoldDiamondDetailExample;
import com.accompany.business.model.FinanceGoldDiamondExample;
import com.accompany.business.mybatismapper.*;
import com.accompany.business.service.record.BillRecordService;
import com.accompany.common.redis.RedisKey;
import com.accompany.common.result.BusiResult;
import com.accompany.common.status.BusiStatus;
import com.accompany.common.utils.DateTimeUtil;
import com.accompany.common.utils.StringUtils;
import com.accompany.core.service.common.JedisService;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* Created by yanpengcheng on 2019/2/19
*/
@Service
public class FinanceAdminService extends BaseService {
@Autowired
JedisService jedisService;
@Autowired
FinanceTypeConfigMapper financeTypeConfigMapper;
@Autowired
FinanceGoldDiamondDetailMapperExpand financeGoldDiamondDetailMapperExpand;
@Autowired
FinanceGoldDiamondDetailMapper financeGoldDiamondDetailMapper;
@Autowired
DrawLotteryRecordMapperWebExpand drawLotteryRecordMapperExpand;
@Autowired
UserPurseAdminMapperExpand userPurseAdminMapperExpand;
@Autowired
FinanceGoldDiamondMapper financeGoldDiamondMapper;
@Autowired
BillRecordService billRecordService;
public BusiResult statistics(String beginDateStr, String endDateStr, Integer pageNum,
Integer pageSize) {
BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS);
JSONObject data = new JSONObject();
FinanceGoldDiamondExample financeGoldDiamondExample = new FinanceGoldDiamondExample();
FinanceGoldDiamondExample.Criteria criteria = financeGoldDiamondExample.createCriteria();
if (StringUtils.isNotEmpty(beginDateStr)) {
Date beginDate = DateTimeUtil.convertStrToDate(beginDateStr,DateTimeUtil.DEFAULT_DATE_PATTERN);
criteria.andBillTimeGreaterThanOrEqualTo(beginDate);
}
if (StringUtils.isNotEmpty(endDateStr)) {
Date endDate = DateTimeUtil.getEndTimeOfDay(DateTimeUtil.convertStrToDate(endDateStr,DateTimeUtil.DEFAULT_DATE_PATTERN));
criteria.andBillTimeLessThanOrEqualTo(endDate);
}
financeGoldDiamondExample.setOrderByClause("create_time desc");
PageHelper.startPage(pageNum, pageSize);
List<FinanceGoldDiamond> financeGoldDiamondList =
financeGoldDiamondMapper.selectByExample(financeGoldDiamondExample);
int count = financeGoldDiamondMapper.countByExample(financeGoldDiamondExample);
data.put("rows", financeGoldDiamondList);
data.put("total", count);
String updateTime = "";
String updateTimeRedis = jedisService.get(RedisKey.finance_date_update_time.getKey());
if (StringUtils.isNotEmpty(updateTimeRedis)) {
updateTime = updateTimeRedis;
}
if (StringUtils.isEmpty(updateTime)) {
updateTime = "暂无更新时间记录";
}
data.put("updateTime", updateTime);
busiResult.setData(data);
return busiResult;
}
public BusiResult exportDetail(String beginStr, String endStr) {
BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS);
FinanceGoldDiamondDetailExample financeGoldDiamondDetailExample = new FinanceGoldDiamondDetailExample();
Date beginDate = DateTimeUtil.convertStrToDate(beginStr,DateTimeUtil.DEFAULT_DATE_PATTERN);
Date endDate = DateTimeUtil.getEndTimeOfDay(DateTimeUtil.convertStrToDate(endStr,DateTimeUtil.DEFAULT_DATE_PATTERN));
financeGoldDiamondDetailExample.createCriteria().andBillTimeGreaterThanOrEqualTo(beginDate).andBillTimeLessThanOrEqualTo(endDate);
financeGoldDiamondDetailExample.setOrderByClause("bill_time asc,big_obj_type asc,obj_type asc");
PageHelper.startPage(1, 5000);
List<FinanceGoldDiamondDetail> financeGoldDiamondList =
financeGoldDiamondDetailMapper.selectByExample(financeGoldDiamondDetailExample);
busiResult.setData(financeGoldDiamondList);
return busiResult;
}
public BusiResult exportTotal(String beginStr, String endStr) {
BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS);
FinanceGoldDiamondExample financeGoldDiamondExample = new FinanceGoldDiamondExample();
Date beginDate = DateTimeUtil.convertStrToDate(beginStr,DateTimeUtil.DEFAULT_DATE_PATTERN);
Date endDate = DateTimeUtil.getEndTimeOfDay(DateTimeUtil.convertStrToDate(endStr,DateTimeUtil.DEFAULT_DATE_PATTERN));
financeGoldDiamondExample.createCriteria().andBillTimeGreaterThanOrEqualTo(beginDate).andBillTimeLessThanOrEqualTo(endDate);
financeGoldDiamondExample.setOrderByClause("id asc");
PageHelper.startPage(1, 5000);
List<FinanceGoldDiamond> financeGoldDiamondList =
financeGoldDiamondMapper.selectByExample(financeGoldDiamondExample);
busiResult.setData(financeGoldDiamondList);
return busiResult;
}
}

View File

@@ -1,80 +0,0 @@
package com.accompany.admin.service.gamepartner;
import com.accompany.admin.vo.gamepartner.GamePartnerOrderDayAdminVo;
import com.accompany.admin.vo.gamepartner.GamePartnerOrderDayDetailAdminVo;
import com.accompany.business.vo.gamepartner.GamePartnerOrderVo;
import com.accompany.common.model.PageReq;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.context.request.ServletWebRequest;
/**
* @author: liaozetao
* @date: 2023/8/22 11:18
* @description:
*/
public interface GamePartnerOrderAdminService {
/**
* 订单记录查询
*
* @param fromErBanNo
* @param toErBanNo
* @param gameId
* @param orderNo
* @param startTime
* @param endTime
* @param req
* @return
*/
Page<GamePartnerOrderVo> orderPage(String fromErBanNo, String toErBanNo, Integer gameId, String orderNo, String startTime, String endTime, PageReq req);
/**
* 订单统计
*
* @param startTime
* @param endTime
* @param req
* @return
*/
Page<GamePartnerOrderDayAdminVo> dayPage(String startTime, String endTime, PageReq req);
/**
* 订单详情
*
* @param orderDate
* @param req
* @return
*/
Page<GamePartnerOrderDayDetailAdminVo> dayDetailPage(String orderDate, PageReq req);
/**
* 订单记录导出
*
* @param fromErBanNo
* @param toErBanNo
* @param gameId
* @param orderNo
* @param startTime
* @param endTime
* @param servletWebRequest
*/
void orderExport(String fromErBanNo, String toErBanNo, Integer gameId, String orderNo, String startTime, String endTime, ServletWebRequest servletWebRequest);
/**
* 订单统计导出
*
* @param startTime
* @param endTime
* @param servletWebRequest
*/
void dayExport(String startTime, String endTime, ServletWebRequest servletWebRequest);
/**
* 订单详情导出
*
* @param orderDate
* @param servletWebRequest
*/
void dayDetailExport(String orderDate, ServletWebRequest servletWebRequest);
}

View File

@@ -1,251 +0,0 @@
package com.accompany.admin.service.gamepartner;
import com.accompany.admin.model.AdminUser;
import com.accompany.admin.service.system.AdminUserService;
import com.accompany.admin.vo.gamepartner.UserGamePartnerInfoAdminVo;
import com.accompany.business.model.gamepartner.UserGamePartner;
import com.accompany.business.model.gamepartner.UserGamePartnerInfo;
import com.accompany.business.model.gamepartner.UserGamePartnerInfoTag;
import com.accompany.business.mybatismapper.gamepartner.UserGamePartnerMapper;
import com.accompany.business.service.gamepartner.UserGamePartnerInfoService;
import com.accompany.business.service.gamepartner.UserGamePartnerService;
import com.accompany.business.service.user.UsersService;
import com.accompany.business.vo.gamepartner.UserGamePartnerInfoVo;
import com.accompany.common.constant.Constant;
import com.accompany.common.status.BusiStatus;
import com.accompany.core.exception.AdminServiceException;
import com.accompany.core.model.Users;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class UserGamePartnerInfoAdminService {
@Autowired
private UserGamePartnerService service;
@Autowired
private UserGamePartnerInfoService infoService;
@Autowired
private UserGamePartnerMapper mapper;
@Autowired
private UsersService usersService;
@Autowired
private AdminUserService adminUserService;
public Page<UserGamePartnerInfoAdminVo> pageUserGamePartnerInfo(Integer pageNum, Integer pageSize,
Long erbanNo, Integer gameId,
String startTime, String endTime) {
Page<UserGamePartnerInfoAdminVo> voPage = new Page<>(pageNum, pageSize);
QueryWrapper<UserGamePartner> queryWrapper = getQueryWrapper(erbanNo, gameId, startTime, endTime);
Page<UserGamePartner> page = new Page<>(pageNum, pageSize);
mapper.selectPage(page, queryWrapper);
voPage.setTotal(page.getTotal());
if (CollectionUtils.isEmpty(page.getRecords())){
return voPage;
}
List<UserGamePartner> dbList = page.getRecords();
List<Long> uidList = dbList.stream().map(UserGamePartner::getUid).collect(Collectors.toList());
List<Integer> adminIdList = dbList.stream().map(UserGamePartner::getAdminId).distinct().collect(Collectors.toList());
Map<Long, Users> usersMap = usersService.getUsersMapByUids(uidList);
List<UserGamePartnerInfoVo> userInfoList = infoService.listUserGamePartnerInfo(uidList);
Map<Long, List<UserGamePartnerInfoVo>> userInfoMap = null == userInfoList?
Collections.EMPTY_MAP:
userInfoList.stream().collect(Collectors.groupingBy(UserGamePartnerInfoVo::getUid));
List<AdminUser> adminUserList = adminUserService.listAdminUser(adminIdList);
Map<Integer, String> adminUserMap = null == adminUserList?
Collections.EMPTY_MAP:
adminUserList.stream().collect(Collectors.toMap(AdminUser::getId, AdminUser::getUsername));
List<UserGamePartnerInfoAdminVo> voList = dbList.stream().map(d->{
Users u = usersMap.get(d.getUid());
List<UserGamePartnerInfoVo> userInfo = userInfoMap.get(d.getUid());
String adminName = adminUserMap.get(d.getAdminId());
return new UserGamePartnerInfoAdminVo(d, u, userInfo, adminName);
}).collect(Collectors.toList());
voPage.setRecords(voList);
return voPage;
}
private QueryWrapper<UserGamePartner> getQueryWrapper(Long erbanNo, Integer gameId,
String startTime, String endTime){
Long uid = null;
List<Long> queryUidList = new ArrayList<>();
if (null != erbanNo){
Users u = usersService.getUserByErbanNo(erbanNo);
if (null == u){
return null;
}
uid = u.getUid();
queryUidList.add(u.getUid());
}
if (null != gameId){
QueryWrapper<UserGamePartnerInfo> queryWrapper = Wrappers.query();
queryWrapper.lambda().select(UserGamePartnerInfo::getUid)
.eq(null != uid, UserGamePartnerInfo::getUid, uid)
.eq(UserGamePartnerInfo::getGameId, gameId);
List<UserGamePartnerInfo> gameUidList = infoService.list(queryWrapper);
if (CollectionUtils.isEmpty(gameUidList)){
return null;
}
queryUidList = gameUidList.stream().map(UserGamePartnerInfo::getUid).distinct().collect(Collectors.toList());
}
QueryWrapper<UserGamePartner> queryWrapper = Wrappers.query();
queryWrapper.lambda().in(!CollectionUtils.isEmpty(queryUidList), UserGamePartner::getUid, queryUidList)
.gt(StringUtils.hasText(startTime), UserGamePartner::getUpdateTime, startTime)
.lt(StringUtils.hasText(endTime), UserGamePartner::getUpdateTime, endTime)
.orderByDesc(UserGamePartner::getUpdateTime);
return queryWrapper;
}
@Transactional(rollbackFor = Exception.class)
public void save(UserGamePartnerInfoAdminVo param, Integer adminId) {
vaildSaveParam(param);
Long uid = param.getUid();
QueryWrapper<UserGamePartner> queryWrapper = Wrappers.query();
queryWrapper.lambda().eq(UserGamePartner::getUid, uid);
UserGamePartner ugp = mapper.selectOne(queryWrapper);
if (null == ugp){
ugp = new UserGamePartner();
ugp.setUid(uid);
ugp.setStatus(Constant.StatusV2.valid);
ugp.setUpdateTime(new Date());
ugp.setAdminId(adminId);
mapper.insert(ugp);
} else {
ugp.setUpdateTime(new Date());
ugp.setAdminId(adminId);
UpdateWrapper<UserGamePartner> updateWrapper = Wrappers.update();
updateWrapper.lambda().eq(UserGamePartner::getUid, ugp.getUid());
mapper.update(ugp, updateWrapper);
}
List<UserGamePartnerInfoVo> gameList = param.getGames();
List<Integer> gameIdList = gameList.stream().map(UserGamePartnerInfoVo::getGameId).distinct().collect(Collectors.toList());
QueryWrapper<UserGamePartnerInfo> infoQueryWrapper = Wrappers.query();
infoQueryWrapper.lambda().eq(UserGamePartnerInfo::getUid, uid).in(UserGamePartnerInfo::getGameId, gameIdList);
Map<Integer, UserGamePartnerInfo> dbMap = infoService.list(infoQueryWrapper).stream().collect(Collectors.toMap(UserGamePartnerInfo::getGameId, i->i));
List<UserGamePartnerInfo> insertList = new ArrayList<>();
List<UserGamePartnerInfo> updateList = new ArrayList<>();
for (UserGamePartnerInfoVo vo: gameList){
UserGamePartnerInfo db = dbMap.get(vo.getGameId());
if (null == db){
db = new UserGamePartnerInfo();
db.setUid(uid);
db.setGameId(vo.getGameId());
db.setPrice(vo.getPrice());
db.setProficiency(vo.getProficiency());
db.setFinishNum(0);
db.setSeq(vo.getSeq());
db.setTags(vo.getTags());
insertList.add(db);
} else {
db.setPrice(vo.getPrice());
db.setProficiency(vo.getProficiency());
db.setTags(vo.getTags());
updateList.add(db);
}
}
if (!CollectionUtils.isEmpty(insertList)){
infoService.saveBatch(insertList);
}
if (!CollectionUtils.isEmpty(updateList)){
for (UserGamePartnerInfo info: updateList) {
UpdateWrapper<UserGamePartnerInfo> updateWrapper = Wrappers.update();
updateWrapper.lambda().eq(UserGamePartnerInfo::getUid, info.getUid()).eq(UserGamePartnerInfo::getGameId, info.getGameId());
infoService.update(info, updateWrapper);
}
}
service.freshCache();
}
private void vaildSaveParam(UserGamePartnerInfoAdminVo param) {
Long erbanNo = param.getErbanNo();
if (null == erbanNo){
throw new AdminServiceException(BusiStatus.PARAMERROR, "用户不存在");
}
Users u = usersService.getUserByErbanNo(erbanNo);
if (null == u){
throw new AdminServiceException(BusiStatus.PARAMERROR, "用户不存在");
}
if (null == param.getUid()){
UserGamePartner userGamePartner = mapper.selectById(u.getUid());
if (null != userGamePartner){
throw new AdminServiceException(BusiStatus.PARAMERROR, u.getErbanNo() + "已是陪玩用户,不能重复添加");
}
}
param.setUid(u.getUid());
List<UserGamePartnerInfoVo> gameList = param.getGames();
if (CollectionUtils.isEmpty(gameList)){
throw new AdminServiceException(BusiStatus.PARAMERROR, "没有配置游戏");
}
List<Integer> gameIdList = gameList.stream().map(UserGamePartnerInfoVo::getGameId).distinct().collect(Collectors.toList());
if (gameIdList.size() < gameList.size()){
throw new AdminServiceException(BusiStatus.PARAMERROR, "不能重复配置同一个游戏");
}
for (UserGamePartnerInfoVo game: gameList) {
for (UserGamePartnerInfoTag tag: game.getTags()) {
if ("区服".equals(tag.getTagName()) && tag.getTagVal().length() > 12){
throw new AdminServiceException(BusiStatus.PARAMERROR, "区服不可超过12个字符");
} else if ("段位".equals(tag.getTagName()) && tag.getTagVal().length() > 6) {
throw new AdminServiceException(BusiStatus.PARAMERROR, "段位不可超过6个字符");
} else if ("擅长".equals(tag.getTagName()) && tag.getTagVal().length() > 6) {
throw new AdminServiceException(BusiStatus.PARAMERROR, "擅长不可超过6个字符");
}
}
}
}
public void changeStatus(String uidStr, Byte status, Integer adminId) {
List<Long> uidList = Arrays.stream(uidStr.split(","))
.map(Long::parseLong).sorted()
.collect(Collectors.toList());
if (CollectionUtils.isEmpty(uidList)){
throw new AdminServiceException(BusiStatus.PARAMERROR);
}
UpdateWrapper<UserGamePartner> updateWrapper = Wrappers.update();
updateWrapper.lambda().in(UserGamePartner::getUid, uidList);
UserGamePartner updateEntity = new UserGamePartner();
updateEntity.setStatus(status);
updateEntity.setAdminId(adminId);
updateEntity.setUpdateTime(new Date());
mapper.update(updateEntity, updateWrapper);
service.freshCache();
}
}

View File

@@ -1,124 +0,0 @@
package com.accompany.admin.service.gamepartner.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.accompany.admin.dto.gamepartner.GamePartnerOrderAdminDto;
import com.accompany.admin.mapper.gamepartner.GamePartnerOrderAdminMapper;
import com.accompany.admin.service.gamepartner.GamePartnerOrderAdminService;
import com.accompany.admin.vo.gamepartner.GamePartnerOrderDayAdminVo;
import com.accompany.admin.vo.gamepartner.GamePartnerOrderDayDetailAdminVo;
import com.accompany.business.vo.gamepartner.GamePartnerOrderVo;
import com.accompany.common.model.PageReq;
import com.alibaba.excel.EasyExcel;
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 org.springframework.web.context.request.ServletWebRequest;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
/**
* @author: liaozetao
* @date: 2023/8/22 11:18
* @description:
*/
@Slf4j
@Service
public class GamePartnerOrderAdminServiceImpl implements GamePartnerOrderAdminService {
@Autowired
private GamePartnerOrderAdminMapper gamePartnerOrderAdminMapper;
@Override
public Page<GamePartnerOrderVo> orderPage(String fromErBanNo, String toErBanNo, Integer gameId, String orderNo, String startTime, String endTime, PageReq req) {
return gamePartnerOrderAdminMapper.orderPage(new Page<>(req.getPage(), req.getPageSize()), fromErBanNo, toErBanNo, gameId, orderNo, startTime, endTime);
}
@Override
public Page<GamePartnerOrderDayAdminVo> dayPage(String startTime, String endTime, PageReq req) {
return gamePartnerOrderAdminMapper.dayPage(new Page<>(req.getPage(), req.getPageSize()), startTime, endTime);
}
@Override
public Page<GamePartnerOrderDayDetailAdminVo> dayDetailPage(String orderDate, PageReq req) {
return gamePartnerOrderAdminMapper.dayDetailPage(new Page<>(req.getPage(), req.getPageSize()), orderDate);
}
@Override
public void orderExport(String fromErBanNo, String toErBanNo, Integer gameId, String orderNo, String startTime, String endTime, ServletWebRequest servletWebRequest) {
PageReq req = new PageReq();
req.setPage(1);
req.setPageSize(100000000);
List<GamePartnerOrderAdminDto> datas = new ArrayList<>();
Page<GamePartnerOrderVo> page = orderPage(fromErBanNo, toErBanNo, gameId, orderNo, startTime, endTime, req);
List<GamePartnerOrderVo> records = page.getRecords();
if (CollectionUtil.isNotEmpty(records)) {
for (GamePartnerOrderVo record : records) {
GamePartnerOrderAdminDto admin = new GamePartnerOrderAdminDto();
BeanUtils.copyProperties(record, admin);
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(), GamePartnerOrderAdminDto.class).sheet("订单记录").doWrite(datas);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
}
@Override
public void dayExport(String startTime, String endTime, ServletWebRequest servletWebRequest) {
PageReq req = new PageReq();
req.setPage(1);
req.setPageSize(100000000);
Page<GamePartnerOrderDayAdminVo> page = dayPage(startTime, endTime, req);
List<GamePartnerOrderDayAdminVo> records = page.getRecords();
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(), GamePartnerOrderDayAdminVo.class).sheet("订单统计").doWrite(records);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
}
@Override
public void dayDetailExport(String orderDate, ServletWebRequest servletWebRequest) {
PageReq req = new PageReq();
req.setPage(1);
req.setPageSize(100000000);
Page<GamePartnerOrderDayDetailAdminVo> page = dayDetailPage(orderDate, req);
List<GamePartnerOrderDayDetailAdminVo> records = page.getRecords();
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(), GamePartnerOrderDayDetailAdminVo.class).sheet("订单详情").doWrite(records);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
}
}

View File

@@ -1,20 +0,0 @@
package com.accompany.admin.service.official;
import com.accompany.admin.vo.official.OfficialBrowseCountVo;
import java.util.List;
/**
* @author: liaozetao
* @date: 2024/1/17 10:41
* @description:
*/
public interface OfficialBrowseRecordAdminService {
/**
* 官网访问数据-最近30天
*
* @return
*/
List<OfficialBrowseCountVo> browseFor30Days();
}

View File

@@ -1,28 +0,0 @@
package com.accompany.admin.service.official;
import com.accompany.business.model.official.OfficialConfig;
import java.util.List;
/**
* @author: liaozetao
* @date: 2024/1/17 10:20
* @description:
*/
public interface OfficialConfigAdminService {
/**
* 列表
*
* @return
*/
List<OfficialConfig> list();
/**
* 保存
*
* @param config
*/
void save(OfficialConfig config);
}

View File

@@ -1,28 +0,0 @@
package com.accompany.admin.service.official.impl;
import com.accompany.admin.mapper.official.OfficialRecordAdminMapper;
import com.accompany.admin.service.official.OfficialBrowseRecordAdminService;
import com.accompany.admin.vo.official.OfficialBrowseCountVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author: liaozetao
* @date: 2024/1/17 10:41
* @description:
*/
@Slf4j
@Service
public class OfficialBrowseRecordAdminServiceImpl implements OfficialBrowseRecordAdminService {
@Autowired
private OfficialRecordAdminMapper officialRecordAdminMapper;
@Override
public List<OfficialBrowseCountVo> browseFor30Days() {
return officialRecordAdminMapper.browseFor30Days();
}
}

View File

@@ -1,43 +0,0 @@
package com.accompany.admin.service.official.impl;
import com.accompany.admin.service.official.OfficialConfigAdminService;
import com.accompany.business.model.official.OfficialConfig;
import com.accompany.business.service.official.OfficialConfigService;
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.Date;
import java.util.List;
/**
* @author: liaozetao
* @date: 2024/1/17 10:20
* @description:
*/
@Slf4j
@Service
public class OfficialConfigAdminServiceImpl implements OfficialConfigAdminService {
@Autowired
private OfficialConfigService officialConfigService;
@Override
public List<OfficialConfig> list() {
return officialConfigService.list(Wrappers.<OfficialConfig>lambdaQuery()
.orderByDesc(OfficialConfig::getUpdateTime));
}
@Override
public void save(OfficialConfig config) {
Date now = new Date();
Long id = config.getId();
if (id != null) {
config.setUpdateTime(now);
} else {
config.setCreateTime(now);
}
officialConfigService.saveOrUpdate(config);
}
}

View File

@@ -223,18 +223,8 @@ public class OfficialGoldRecordService extends BaseService {
public void giveDiamond(Map<Long, Users> usersMap, OfficalSendTypeEnum type, BigDecimal num, int adminId, String remark, Integer busType,
BigDecimal actualAmount) {
// AdminDict adminDict = adminDictService.getOneAdminDict("official_gold_limit_" + type, "limit_time");
// AdminDict adminDict2 = adminDictService.getOneAdminDict("official_gold_limit_" + type, "limit_count");
// int limitTime = Integer.valueOf(adminDict.getDictval());
// int limitCount = Integer.valueOf(adminDict2.getDictval());
// 分隔耳伴号,多个耳伴号用换行分隔
for (Users users : usersMap.values()) {
// if (!isCanGiveGold(users, type, num, limitTime, limitCount)) {
// busiResult.setCode(-1);
// busiResult.setMessage("兔兔号为" + erNo + "的用户被赠送的次数大于" + limitTime + "或者金币余额大于" + limitCount);
// return busiResult;
// }
// 增加官方赠送活动记录
long recordId = DefaultIdentifierGenerator.getInstance().nextId(null);
String recordIdStr = String.valueOf(recordId);

View File

@@ -1,316 +0,0 @@
package com.accompany.admin.service.sms;
import com.accompany.admin.mapper.OperationSmsRecordMapperExpand;
import com.accompany.admin.service.base.BaseService;
import com.accompany.admin.vo.OperationSmsRecordVo;
import com.accompany.business.model.OperationSmsRecord;
import com.accompany.business.model.OperationSmsRecordExample;
import com.accompany.business.model.SmsTemplate;
import com.accompany.business.model.SmsTemplateExample;
import com.accompany.business.mybatismapper.OperationSmsRecordMapper;
import com.accompany.business.mybatismapper.SmsTemplateMapper;
import com.accompany.business.service.user.UsersService;
import com.accompany.common.constant.Constant;
import com.accompany.common.redis.RedisKey;
import com.accompany.common.result.BusiResult;
import com.accompany.common.status.BusiStatus;
import com.accompany.common.utils.DateTimeUtil;
import com.accompany.common.utils.StringUtils;
import com.accompany.core.exception.AdminServiceException;
import com.accompany.core.model.Users;
import com.accompany.core.service.account.NetEaseService;
import com.accompany.core.service.common.JedisService;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import com.google.gson.reflect.TypeToken;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@Service
public class OperationSmsAdminService extends BaseService {
@Autowired
private UsersService usersService;
@Autowired
private OperationSmsRecordMapperExpand operationSmsRecordMapperExpand;
@Autowired
private SmsTemplateMapper smsTemplateMapper;
@Autowired
private JedisService jedisService;
@Autowired
private OperationSmsRecordMapper operationSmsRecordMapper;
@Autowired
private NetEaseService netEaseService;
// 一次性批量保存数量
private static final Integer BATCH_SIZE = 1000;
/**
* 解析EXCLE数据并插入数据库
* @param templateId
* @param sheet
* @param adminId
* @return
* @throws Exception
*/
public BusiResult insertFileDate(Integer templateId, Sheet sheet, Integer adminId) throws Exception{
//从第二行开始读,第一行是列名
int firstRow = sheet.getFirstRowNum()+1;
int lastRow = sheet.getLastRowNum();
if(lastRow > 10000){
return new BusiResult(BusiStatus.FILE_SIZE_TOO_LARGE);
}
Vector<OperationSmsRecord> list = new Vector<>();
final CountDownLatch latch = new CountDownLatch(lastRow);
ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() * 4 - 1);
//遍历列
for(int i = firstRow; i<=lastRow; i++) {
final int j = i;
executorService.execute(() -> {
try {
Row row = sheet.getRow(j);
if (row == null) {
throw new AdminServiceException(BusiStatus.ROW_IS_EMPTY);
}
OperationSmsRecord record = new OperationSmsRecord();
//第一列为平台号,第二列为手机号码
Cell firstCell = row.getCell(row.getFirstCellNum());
Cell secondCell = row.getCell(row.getFirstCellNum() + 1);
if (firstCell != null) {
Long erbanNo = Double.valueOf(firstCell.getNumericCellValue()).longValue();
Users users = usersService.getUserByErbanNo(erbanNo);
Long uid = users == null ? null : users.getUid();
String phone = users == null ? "" : users.getPhone();
record.setUid(uid);
record.setPhone(phone);
}
//如果填写了手机号码,以填写的手机号码为准
if (secondCell != null) {
Long phone = Double.valueOf(secondCell.getNumericCellValue()).longValue();
record.setPhone(phone.toString());
}
record.setTemplateId(templateId);
record.setCreateTime(Calendar.getInstance().getTime());
record.setSendStatus(Constant.OperationSmsStatus.PENDING);
record.setOperator(adminId);
list.add(record);
}catch (Exception e){
logger.error("scan excel error,e:{}",e.getMessage());
}finally {
latch.countDown();
}
});
}
//等待数据解析完成,批量保存
latch.await();
batchSaveData(list);
return new BusiResult(BusiStatus.SUCCESS);
}
/**
* 批量插入数据库
* @param vector
*/
public void batchSaveData(Vector<OperationSmsRecord> vector){
int count = vector.size();
long times = count % BATCH_SIZE == 0 ? (count / BATCH_SIZE) : (count / BATCH_SIZE) + 1;
for (int i = 0; i < times; i++) {
Integer fromIndex = i * BATCH_SIZE;
Integer toIndex = fromIndex + BATCH_SIZE >= count ? count : fromIndex + BATCH_SIZE;
List<OperationSmsRecord> list = vector.subList(fromIndex,toIndex);
operationSmsRecordMapperExpand.batchSave(list);
}
}
/**
* 获取发送的短信列表
* @param erbanNo
* @param templateId
* @param sendStatus
* @param createTime
* @param sendTime
* @param page
* @param pageSize
* @return
*/
public PageInfo<OperationSmsRecordVo> getList(Long erbanNo, Integer templateId, Integer sendStatus, String createTime,
String sendTime, Integer page, Integer pageSize){
Integer start = (page-1)*pageSize;
if(templateId ==null || templateId <= 0){
templateId = null;
}
if(sendStatus == null || sendStatus <= 0){
sendStatus = null;
}
if(StringUtils.isBlank(createTime)){
createTime = null;
}
if(StringUtils.isBlank(sendTime)){
sendTime = null;
}
List<OperationSmsRecordVo> list = operationSmsRecordMapperExpand.getList(erbanNo,templateId,sendStatus,
createTime,sendTime,start,pageSize);
Integer count = operationSmsRecordMapperExpand.count(erbanNo,templateId,sendStatus,
createTime,sendTime);
PageInfo pageInfo = new PageInfo<>(list);
pageInfo.setTotal(count);
return pageInfo;
}
/**
* 根据查询条件批量发送
* @param erbanNo
* @param templateId
* @param sendStatus
* @param createTime
* @param sendTime
* @throws Exception
*/
public void batchSendByQuery(Long erbanNo, Integer templateId, Integer sendStatus, String createTime,
String sendTime) throws Exception{
OperationSmsRecordExample example = new OperationSmsRecordExample();
OperationSmsRecordExample.Criteria criteria = example.createCriteria();
criteria.andSendStatusEqualTo(Constant.OperationSmsStatus.PENDING);
if(erbanNo!=null && erbanNo > 0){
Users users = usersService.getUserByErbanNo(erbanNo);
Long uid = users == null ? 0L : users.getUid();
criteria.andUidEqualTo(uid);
}
if(templateId != null && templateId > 0){
criteria.andTemplateIdEqualTo(templateId);
}
if(StringUtils.isNotBlank(createTime)){
criteria.andCreateTimeGreaterThan(DateTimeUtil.convertStrToDate(createTime,DateTimeUtil.DEFAULT_DATETIME_PATTERN));
}
if(StringUtils.isNotBlank(sendTime)){
criteria.andSendTimeGreaterThan(DateTimeUtil.convertStrToDate(sendTime,DateTimeUtil.DEFAULT_DATETIME_PATTERN));
}
List<OperationSmsRecord> smsRecords = operationSmsRecordMapper.selectByExample(example);
//一次最多推送1万条
if(smsRecords.size()>10000){
smsRecords.subList(0,10000);
}
batchSendMsg(smsRecords);
}
/**
* 根据选择的数据批量更新
* @param recordIds
* @throws Exception
*/
public void batchSendByPage(List<Long> recordIds) throws Exception{
OperationSmsRecordExample example = new OperationSmsRecordExample();
example.createCriteria().andRecordIdIn(recordIds);
List<OperationSmsRecord> operationSmsRecords = operationSmsRecordMapper.selectByExample(example);
batchSendMsg(operationSmsRecords);
}
/**
* 单个发送
* @param recordId
* @throws Exception
*/
public void sendForOne(Long recordId) throws Exception{
OperationSmsRecord record = operationSmsRecordMapper.selectByPrimaryKey(recordId);
try {
List<String> mobiles = Arrays.asList(record.getPhone());
// SmsRet smsRet = netEaseService.sendTemplate(JSONObject.toJSONString(mobiles), record.getTemplateId());
// if (smsRet.getCode() == 200) {
// record.setSendStatus(Constant.OperationSmsStatus.SUCCESS);
// } else {
// record.setSendStatus(Constant.OperationSmsStatus.ERROR);
// record.setErrorMsg(smsRet.getMsg());
// }
}catch (Exception e){
logger.error("send msg error,uid:{},phone:{},errorMsg:{}",record.getUid(),record.getPhone(),
e.getMessage());
record.setSendStatus(Constant.OperationSmsStatus.ERROR);
record.setErrorMsg(e.getMessage());
}
record.setSendTime(Calendar.getInstance().getTime());
operationSmsRecordMapper.updateByPrimaryKeySelective(record);
}
/**
* 批量发送短信
* @param smsRecords
* @throws Exception
*/
private void batchSendMsg(List<OperationSmsRecord> smsRecords) throws Exception{
Vector<Long> success = new Vector<>();
Vector<Long> fail = new Vector<>();
final CountDownLatch latch = new CountDownLatch(smsRecords.size());
ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() * 4 - 1);
for(OperationSmsRecord record : smsRecords){
executorService.execute(() -> {
try {
// List<String> mobiles = Arrays.asList(record.getPhone());
// SmsRet smsRet = netEaseService.sendTemplate(JSONObject.toJSONString(mobiles),record.getTemplateId());
// if(smsRet.getCode() == 200){
// success.add(record.getRecordId());
// }else{
// fail.add(record.getRecordId());
// logger.error("send msg error,uid:{},phone:{},errorMsg:{}",record.getUid(),record.getPhone(),
// smsRet.getMsg());
// }
}catch (Exception e){
fail.add(record.getRecordId());
logger.error("send msg error,uid:{},phone:{},errorMsg:{}",record.getUid(),record.getPhone(),
e.getMessage());
}finally {
latch.countDown();
}
});
}
latch.await();
updateAllRecord(success,fail);
}
/**
* 更新记录
* @param success
* @param fail
*/
private void updateAllRecord(Vector<Long> success,Vector<Long> fail){
updateRecord(success,Constant.OperationSmsStatus.SUCCESS);
updateRecord(fail,Constant.OperationSmsStatus.ERROR);
}
/**
* 更新记录
* @param list
* @param status
*/
private void updateRecord(Vector<Long> list,Integer status){
if(!list.isEmpty()) {
OperationSmsRecordExample example = new OperationSmsRecordExample();
example.createCriteria().andRecordIdIn(list);
OperationSmsRecord operationSmsRecord = new OperationSmsRecord();
operationSmsRecord.setSendStatus(status);
operationSmsRecord.setSendTime(Calendar.getInstance().getTime());
operationSmsRecordMapper.updateByExampleSelective(operationSmsRecord, example);
}
}
/**
* 单条删除
* @param recordId
*/
public void delForOne(Long recordId){
operationSmsRecordMapper.deleteByPrimaryKey(recordId);
}
}

View File

@@ -1,70 +0,0 @@
package com.accompany.admin.service.system;
import com.accompany.admin.mapper.AdminDictMapper;
import com.accompany.admin.model.AdminDict;
import com.accompany.admin.model.AdminDictExample;
import com.accompany.admin.model.AdminDictKey;
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.Date;
import java.util.List;
@Service("adminDictService")
public class AdminDictService {
@Autowired
private AdminDictMapper adminDictMapper;
/**
* 分页查询
*
* @param code 名称
* @param page
* @param size
* @return
*/
public PageInfo getDictByPage(String code, int page, int size) {
AdminDictExample example = new AdminDictExample();
if (!BlankUtil.isBlank(code)) {
example.createCriteria().andCodeEqualTo(code);
}
PageHelper.startPage(page, size);
List<AdminDict> list = adminDictMapper.selectByExample(example);
return new PageInfo(list);
}
public int saveDict(AdminDict adminDict, boolean isEdit) {
if (isEdit) {
return adminDictMapper.updateByPrimaryKey(adminDict);
} else {
adminDict.setCreatetime(new Date());
return adminDictMapper.insert(adminDict);
}
}
public AdminDict getOneAdminDict(String code, String dictkey) {
AdminDictKey adminDictKey = new AdminDictKey();
adminDictKey.setCode(code);
adminDictKey.setDictkey(dictkey);
return adminDictMapper.selectByPrimaryKey(adminDictKey);
}
public void delAdminDict(String code, String dictkey) {
AdminDictKey adminDictKey = new AdminDictKey();
adminDictKey.setCode(code);
adminDictKey.setDictkey(dictkey);
adminDictMapper.deleteByPrimaryKey(adminDictKey);
}
public List<AdminDict> getDictByCode(String code) {
AdminDictExample example = new AdminDictExample();
example.createCriteria().andCodeEqualTo(code);
return adminDictMapper.selectByExample(example);
}
}

View File

@@ -1,35 +0,0 @@
package com.accompany.admin.service.system;
import com.accompany.business.model.AdminPicture;
import com.accompany.business.model.AdminPictureExample;
import com.accompany.business.mybatismapper.AdminPictureMapper;
import com.accompany.core.util.StringUtils;
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;
/**
* Created by liuyang on 2019/2/21.
*/
@Service("adminPictureService")
public class AdminPictureService {
@Autowired
private AdminPictureMapper pictureMapper;
public PageInfo<AdminPicture> gameInfoList(String appId, Integer pageNumber, Integer pageSize) {
AdminPictureExample example = new AdminPictureExample();
example.setOrderByClause("update_time desc");
AdminPictureExample.Criteria criteria = example.createCriteria();
if(StringUtils.isNotBlank(appId)) {
criteria.andAppIdEqualTo(appId);
}
PageHelper.startPage(pageNumber, pageSize);
List<AdminPicture> pictureList = pictureMapper.selectByExample(example);
PageInfo<AdminPicture> info = new PageInfo<>(pictureList);
return info;
}
}

View File

@@ -1,228 +0,0 @@
package com.accompany.admin.service.user;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.accompany.admin.service.base.BaseService;
import com.accompany.admin.vo.PhoneAuthApplyRecordExcelVo;
import com.accompany.admin.vo.apply.PhoneAuthApplyRecordAdminVo;
import com.accompany.business.model.ip.IpRegionWhite;
import com.accompany.business.service.ip.IpRegionWhiteService;
import com.accompany.common.constant.Constant;
import com.accompany.common.redis.RedisKey;
import com.accompany.common.status.BusiStatus;
import com.accompany.common.utils.GsonUtil;
import com.accompany.common.utils.StringUtils;
import com.accompany.core.exception.AdminServiceException;
import com.accompany.core.model.Users;
import com.accompany.core.model.phone.PhoneAuthApplyRecord;
import com.accompany.core.service.common.JedisService;
import com.accompany.core.service.phone.PhoneAuthApplyRecordService;
import com.accompany.core.service.user.UsersBaseService;
import com.accompany.sms.config.AliyunSmsConfig;
import com.accompany.sms.enums.SmsAppEnum;
import com.accompany.sms.enums.SmsTypeEnum;
import com.accompany.sms.strategy.SmsContext;
import com.accompany.sms.strategy.SmsFactory;
import com.accompany.sms.strategy.SmsResponse;
import com.accompany.sms.strategy.SmsStrategy;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class PhoneAuthApplyRecordAdiminService extends BaseService {
@Autowired
private PhoneAuthApplyRecordService phoneAuthApplyRecordService;
@Autowired
private JedisService jedisService;
@Autowired
private AliyunSmsConfig aliyunSmsConfig;
@Autowired
private UsersBaseService usersBaseService;
@Autowired
private IpRegionWhiteService ipRegionWhiteService;
public PageInfo<PhoneAuthApplyRecordAdminVo> getPageList(Integer pageNumber, Integer pageSize, String phone, String authCode, Date beginTime, Date endTime, Byte status) {
List<PhoneAuthApplyRecordAdminVo> admins = new ArrayList<>();
IPage<PhoneAuthApplyRecord> page = phoneAuthApplyRecordService.page(new Page<>(pageNumber, pageSize), getQueryWrapper(phone, authCode, beginTime, endTime, status));
List<PhoneAuthApplyRecord> records = page.getRecords();
if (CollectionUtil.isNotEmpty(records)) {
List<String> phones = records.stream().filter(v -> StrUtil.isNotEmpty(v.getPhoneAreaCode()) && StrUtil.isNotEmpty(v.getPhone())).map(v -> v.getPhoneAreaCode() + v.getPhone()).distinct().collect(Collectors.toList());
List<Users> usersList = usersBaseService.getUsersByPhoneList(phones);
for (PhoneAuthApplyRecord record : records) {
PhoneAuthApplyRecordAdminVo admin = new PhoneAuthApplyRecordAdminVo();
BeanUtils.copyProperties(record, admin);
String authPhone = record.getPhoneAreaCode() + record.getPhone();
if (CollectionUtil.isNotEmpty(usersList)) {
Optional<Users> any = usersList.stream().filter(v -> v.getPhone().equals(authPhone)).findAny();
if (any.isPresent()) {
Users users = any.get();
admin.setErbanNo(users.getErbanNo());
admin.setNick(users.getNick());
admin.setSignTime(users.getCreateTime());
}
}
admins.add(admin);
}
}
PageInfo<PhoneAuthApplyRecordAdminVo> pageInfo = new PageInfo<>();
pageInfo.setPageNum(pageNumber);
pageInfo.setPageSize(pageSize);
pageInfo.setList(admins);
pageInfo.setTotal(page.getTotal());
return pageInfo;
}
private LambdaQueryWrapper<PhoneAuthApplyRecord> getQueryWrapper(String phone, String authCode, Date beginTime, Date endTime, Byte status) {
LambdaQueryWrapper<PhoneAuthApplyRecord> queryWrapper = new LambdaQueryWrapper<>();
if (beginTime != null) {
queryWrapper.ge(PhoneAuthApplyRecord::getCreateTime, beginTime);
}
if (endTime != null) {
queryWrapper.le(PhoneAuthApplyRecord::getCreateTime, endTime);
}
if (status != null) {
queryWrapper.eq(PhoneAuthApplyRecord::getStatus, status);
}
if (StringUtils.isNotBlank(phone)) {
queryWrapper.eq(PhoneAuthApplyRecord::getPhone, phone);
}
if (StringUtils.isNotBlank(authCode)) {
queryWrapper.eq(PhoneAuthApplyRecord::getAuthCode, authCode);
}
queryWrapper.orderByDesc(PhoneAuthApplyRecord::getCreateTime);
return queryWrapper;
}
public int changeStatus(Long id, Byte status, String adminName) {
if (status == null || id == null) {
throw new AdminServiceException(BusiStatus.PARAMETERILLEGAL);
}
if (status < 0 || status > 3) {
throw new AdminServiceException(BusiStatus.PARAMETERILLEGAL);
}
PhoneAuthApplyRecord applyRecord = phoneAuthApplyRecordService.getById(id);
if (applyRecord == null) {
throw new AdminServiceException("该记录不存在或已删除");
}
String lockeKey = RedisKey.phone_auth_apply_lock.getKey(applyRecord.getPhone());
String lockVal = jedisService.lock(lockeKey);
if (StringUtils.isEmpty(lockVal)) {
throw new AdminServiceException(BusiStatus.SERVERBUSY);
}
try {
if (!Objects.equals(applyRecord.getStatus(), Constant.PhoneAuthApplyStatus.wait_audit)) {
throw new AdminServiceException("该记录已审核!请刷新后重试");
}
PhoneAuthApplyRecord record = phoneAuthApplyRecordService.getById(id);
record.setStatus(status);
record.setOperator(adminName);
record.setUpdateTime(new Date());
record.setHasUsed((byte) 0);
phoneAuthApplyRecordService.updateById(record);
//加入白名单
if (Constant.PhoneAuthApplyStatus.pass.equals(status)) {
ipRegionWhiteService.addIpRegionWhite(null, applyRecord.getPhoneAreaCode() + applyRecord.getPhone(), IpRegionWhite.Source.PHONE.getSource(), null);
}
//sendSms(record);
return 1;
} finally {
jedisService.unlock(lockeKey, lockVal);
}
}
private void sendSms(PhoneAuthApplyRecord record) {
Byte status = record.getStatus();
String phone = record.getPhone();
String phoneAreaCode = record.getPhoneAreaCode();
// 区号+手机号
String mobile = phoneAreaCode + phone;
//String smsType = sysConfService.getDefaultSysConfValueById(Constant.SysConfId.SMS_SDK_TYPE, SmsTypeEnum.TENCENT.name().toLowerCase());
String smsType = SmsTypeEnum.ALIYUN.name();
String appName = null;
String templateId = null;
Map<String, Object> params = new LinkedHashMap<>();
if (SmsTypeEnum.ALIYUN.name().equals(smsType)) {
if (Constant.PhoneAuthApplyStatus.pass.equals(status)) {
templateId = aliyunSmsConfig.getAuthSuccessTemplateCode();
params.put("authorization", record.getAuthCode());
} else {
// 失败
templateId = aliyunSmsConfig.getAuthFailTemplateCode();
params.put("number", getEndFourNum(phone));
}
} else {
if (Constant.PhoneAuthApplyStatus.pass.equals(status)) {
appName = SmsAppEnum.PHONE_AUTH_SUCCESS.name();
} else {
appName = SmsAppEnum.PHONE_AUTH_FAIL.name();
}
}
//短信发送sdk
SmsStrategy smsStrategy = SmsFactory.getInstance(smsType);
SmsContext context = new SmsContext();
context.setMobile(mobile);
context.setApp(appName);
context.setTemplateId(templateId);
context.setParams(params);
try {
SmsResponse response = smsStrategy.sendSms(context);
logger.info("sendSms mobile : {}, appName : {}, templateId : {}, response msg : {}", mobile, appName, templateId, GsonUtil.getDefGson().toJson(response));
} catch (Exception e) {
logger.error("发送短信出现异常", e);
}
}
private String getEndFourNum(String str) {
// return StrUtil.sub(str, 7,11);
StringBuilder tailNum = new StringBuilder();
if (str != null) {
int len = str.length();
for (int i = len - 1; i >= len - 4; i--) {
tailNum.append(str.charAt(i));
}
tailNum.reverse();
}
return tailNum.toString();
}
public void remark(Long id, String message, String adminName) {
PhoneAuthApplyRecord record = phoneAuthApplyRecordService.getById(id);
if (record == null) {
throw new AdminServiceException("该记录不存在或已删除");
}
record.setRemark(message);
record.setOperator(adminName);
phoneAuthApplyRecordService.saveOrUpdate(record);
}
public List<PhoneAuthApplyRecordExcelVo> export(String phone, String authCode, Date beginTime, Date endTime, Byte status) {
LambdaQueryWrapper<PhoneAuthApplyRecord> queryWrapper = getQueryWrapper(phone, authCode, beginTime, endTime, status);
List<PhoneAuthApplyRecordExcelVo> vos = new ArrayList<>();
List<PhoneAuthApplyRecord> records = phoneAuthApplyRecordService.list(queryWrapper);
if (CollectionUtils.isNotEmpty(records)) {
for (PhoneAuthApplyRecord record : records) {
PhoneAuthApplyRecordExcelVo vo = new PhoneAuthApplyRecordExcelVo();
BeanUtils.copyProperties(record, vo);
vos.add(vo);
}
}
return vos;
}
}

View File

@@ -1,80 +0,0 @@
package com.accompany.admin.service.user;
import com.accompany.admin.service.base.BaseService;
import com.accompany.business.model.TopicBoxItem;
import com.accompany.business.model.TopicBoxItemExample;
import com.accompany.business.mybatismapper.TopicBoxItemMapper;
import com.accompany.common.constant.Constant;
import com.accompany.common.redis.RedisKey;
import com.accompany.core.service.common.JedisService;
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.Date;
import java.util.List;
/**
* {这里添加描述}
*
* @author fangchengyan
* @date 2019-05-30 18:59
*/
@Service
public class TopicBoxItemAdminService extends BaseService {
@Autowired
private TopicBoxItemMapper topicBoxItemMapper;
@Autowired
private JedisService jedisService;
public PageInfo<TopicBoxItem> queryForPages(Byte status, int pageNumber, int pageSize) {
PageHelper.startPage(pageNumber, pageSize);
return new PageInfo<>(queryList(status));
}
public List<TopicBoxItem> queryList(Byte status) {
TopicBoxItemExample example = new TopicBoxItemExample();
example.setOrderByClause(" seq_no asc, create_time desc ");
TopicBoxItemExample.Criteria criteria = example.createCriteria();
if(null != status) {
criteria.andStatusEqualTo(status);
}
return topicBoxItemMapper.selectByExample(example);
}
public int save(TopicBoxItem record) {
int result = 0;
if(null == record.getId()) {
Date now = new Date();
record.setCreateTime(now);
record.setUpdateTime(now);
result = topicBoxItemMapper.insertSelective(record);
} else {
record.setUpdateTime(new Date());
result = topicBoxItemMapper.updateByPrimaryKeySelective(record);
}
if(result > 0) {
jedisService.del(RedisKey.topic_box_msg_items.getKey());
}
return result;
}
public int deleteById(Integer id) {
TopicBoxItem record = new TopicBoxItem();
record.setId(id);
record.setUpdateTime(new Date());
record.setStatus(Constant.status.delete);
int result = topicBoxItemMapper.updateByPrimaryKeySelective(record);
if(result > 0) {
jedisService.del(RedisKey.topic_box_msg_items.getKey());
}
return result;
}
public TopicBoxItem getById(Integer id) {
return topicBoxItemMapper.selectByPrimaryKey(id);
}
}

View File

@@ -1,120 +0,0 @@
package com.accompany.admin.service.user;
import cn.hutool.core.collection.CollectionUtil;
import com.accompany.admin.vo.UserCertifyRecordVo;
import com.accompany.business.model.UserCertifyRecord;
import com.accompany.business.model.UserCertifyRecordExample;
import com.accompany.business.mybatismapper.UserCertifyRecordMapper;
import com.accompany.business.service.certification.AbstractCertifyService;
import com.accompany.business.service.certification.RealPeopleCertifyService;
import com.accompany.business.service.user.UsersService;
import com.accompany.core.model.Users;
import com.accompany.core.util.StringUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
/**
* {这里添加描述}
*
* @author fangchengyan
* @date 2019-05-20 14:45
*/
@Service
public class UserCertifyRecordAdminService extends AbstractCertifyService {
@Autowired
private UserCertifyRecordMapper userCertifyRecordMapper;
@Autowired
private UsersService usersService;
@Autowired
private RealPeopleCertifyService realPeopleCertifyService;
public PageInfo<UserCertifyRecordVo> queryForPages(List<String> uidList, String idCardNum, Byte bindStatus, int pageNumber, int pageSize) {
UserCertifyRecordExample example = new UserCertifyRecordExample();
UserCertifyRecordExample.Criteria criteria = example.createCriteria();
if (CollectionUtil.isNotEmpty(uidList)) {
criteria.andUidIn(uidList.stream().map(Long::new).collect(Collectors.toList()));
}
if (StringUtils.isNotBlank(idCardNum)) {
criteria.andIdCardNumEqualTo(idCardNum);
}
if (null != bindStatus) {
criteria.andBindStatusEqualTo(bindStatus);
}
example.setOrderByClause(" createTime desc ");
PageHelper.startPage(pageNumber, pageSize);
List<UserCertifyRecord> userCertifyRecords = userCertifyRecordMapper.selectByExample(example);
if (CollectionUtils.isEmpty(userCertifyRecords)) {
return new PageInfo<>(Lists.newArrayList());
}
long total = new PageInfo<>(userCertifyRecords).getTotal();
List<UserCertifyRecordVo> results = userCertifyRecords.stream().map(userCertifyRecord -> {
UserCertifyRecordVo vo = new UserCertifyRecordVo();
vo.setBindStatus(userCertifyRecord.getBindStatus());
vo.setCertifyType(userCertifyRecord.getCertifyType());
vo.setCreateTime(userCertifyRecord.getCreatetime());
vo.setIdCardNum(userCertifyRecord.getIdCardNum());
vo.setName(userCertifyRecord.getName());
vo.setPhone(userCertifyRecord.getPhone());
vo.setRecordId(userCertifyRecord.getRecordId());
vo.setUid(userCertifyRecord.getUid());
Users users = usersService.getUsersByUid(userCertifyRecord.getUid());
if (null != users) {
vo.setErbanNo(users.getErbanNo());
}
return vo;
}).collect(Collectors.toList());
PageInfo<UserCertifyRecordVo> pageInfo = new PageInfo<>(results);
pageInfo.setTotal(total);
return pageInfo;
}
public int deleteById(Long recordId) {
UserCertifyRecord record = userCertifyRecordMapper.selectByPrimaryKey(recordId);
if (null == record) {
return 0;
}
if (RealPeopleCertifyService.CERTIFY_RESULT_DELETE.equals(record.getBindStatus())) {
return 0;
}
//将状态设置为删除
UserCertifyRecord updateRecord = new UserCertifyRecord();
updateRecord.setRecordId(recordId);
updateRecord.setBindStatus(RealPeopleCertifyService.CERTIFY_RESULT_DELETE);
updateRecord.setUpdateTime(new Date());
int result = userCertifyRecordMapper.updateByPrimaryKeySelective(updateRecord);
//删除成功后,要减去绑定的次数
if (RealPeopleCertifyService.CERTIFY_RESULT_SUCCESS.equals(record.getBindStatus()) && result > 0) {
Users user = usersService.getUsersByUid(record.getUid());
user.setRealName("");
user.setIdCardNum("");
user.setCertifyModifyTimes(0);
user.setUpdateTime(new Date());
this.updateUsersInDBAndCache(user);
realPeopleCertifyService.decreaseBindCount(record.getIdCardNum());
}
return result;
}
public int deleteBatch(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return 0;
}
AtomicInteger counter = new AtomicInteger(0);
ids.forEach(id -> {
int result = deleteById(id);
counter.addAndGet(result);
});
return counter.get();
}
}

View File

@@ -1,198 +0,0 @@
package com.accompany.admin.service.user;
import com.accompany.admin.common.AdminConstants;
import com.accompany.admin.model.WithdrawBlock;
import com.accompany.admin.service.withdraw.WithdrawBlockAdminService;
import com.accompany.admin.util.PropertyUtil;
import com.accompany.admin.vo.withdraw.WithdrawVo;
import com.accompany.business.model.WithdrawRecord;
import com.accompany.business.mybatismapper.WithdrawRecordMapper;
import com.accompany.business.param.neteasepush.NeteaseSendMsgParam;
import com.accompany.business.service.SendSysMsgService;
import com.accompany.business.service.record.BillRecordService;
import com.accompany.business.service.user.UsersService;
import com.accompany.common.constant.AccountTypeEnum;
import com.accompany.common.constant.Constant;
import com.accompany.core.enumeration.BillObjTypeEnum;
import com.accompany.core.util.StringUtils;
import com.accompany.sharding.model.BillRecord;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
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 org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
/**
* @author yangziwen
* @description
* @date 2018/1/31 21:05
*/
@Slf4j
@Service
public class WithdrawAdminService {
@Autowired
private UsersService usersService;
@Autowired
private WithdrawRecordMapper withdrawMapper;
@Autowired
private BillRecordService billRecordService;
@Autowired
private WithdrawBlockAdminService withdrawBlockAdminService;
@Autowired
private SendSysMsgService sendSysMsgService;
public IPage<WithdrawRecord> getWithdrawList(String erbanNo, String account, String accountName, String phone, String beginDate,
String endDate, Byte status, String payStatus, Byte blockStatus, List<Long> blockUids, Byte accountType, Integer pageNum, Integer pageSize) throws Exception {
QueryWrapper<WithdrawRecord> wrapper = configExample(erbanNo, account, accountName, phone, beginDate, endDate, status, payStatus, blockUids, blockStatus, accountType);
IPage<WithdrawRecord> page = new Page<>(pageNum,pageSize);
return this.withdrawMapper.selectPage(page,wrapper);
}
private QueryWrapper<WithdrawRecord> configExample(String erbanNo, String account, String accountName, String phone, String beginDate, String endDate, Byte status, String payStatus, List<Long> blockedUids, Byte blockStatus, Byte accountType) {
QueryWrapper<WithdrawRecord> wrapper = new QueryWrapper<>();
wrapper.lambda()
.eq(StringUtils.isNotBlank(accountName),WithdrawRecord::getAccountName,accountName)
.ge(StringUtils.isNotBlank(beginDate),WithdrawRecord::getCreateTime,beginDate)
.le(StringUtils.isNotBlank(endDate),WithdrawRecord::getCreateTime,endDate)
.eq(status != null && status != -1,WithdrawRecord::getStatus,status)
.orderByDesc(WithdrawRecord::getCreateTime);
return wrapper;
}
@Transactional(rollbackFor = Exception.class)
public String approveWithdraw(String id) {
WithdrawRecord withdraw = this.withdrawMapper.selectById(id);
if (withdraw == null) {
log.error("illegal data, withdraw record or billId not exists[id={}]", id);
return "提现申请记录不存在或者账单号为空";
}
if (!withdraw.getStatus().equals(Constant.WithDrawStatus.ing)) {
log.error("request is not in progress[id={}]", id);
return "该请求不是发起提现状态";
}
Long uid = withdraw.getUid();
WithdrawBlock withdrawBlock = this.withdrawBlockAdminService.getSingleWithdrawBlockByUid(uid);
if(withdrawBlock != null && AdminConstants.Status.VALID.equals(withdrawBlock.getStatus())){
log.error("the user of request is in withdraw blocklist[id={}]", id);
return "账户是黑名单,无法转账";
}
QueryWrapper<BillRecord> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(BillRecord::getObjId,id).eq(BillRecord::getObjType,BillObjTypeEnum.WITHDRAW.getValue());
List<BillRecord> billRecord =billRecordService.list(wrapper);
if (CollectionUtils.isEmpty(billRecord)) {
return "找不到账单记录";
}
withdraw.setStatus(Constant.WithDrawStatus.APPROVED);
withdraw.setUpdateTime(Calendar.getInstance().getTime());
this.withdrawMapper.updateById(withdraw);
return null;
}
/**
* 驳回提现申请
*
* @param withdrawId
* @param remark
*/
public void reject(String withdrawId, String remark) {
WithdrawRecord withdraw = this.withdrawMapper.selectById(withdrawId);
if (withdraw == null || !Constant.WithDrawStatus.APPROVED.equals(withdraw.getStatus())) {
withdraw.setStatus(Constant.WithDrawStatus.reject);
withdraw.setRemark(remark);
withdraw.setUpdateTime(Calendar.getInstance().getTime());
this.withdrawMapper.updateById(withdraw);
}
}
public void batchReject(List<String> withdrawIds){
log.info("batchTransfer(), withdrawIds={}", withdrawIds);
StringBuilder builder = new StringBuilder();
for (String withdrawId : withdrawIds) {
this.reject(withdrawId,null);
}
}
public List<WithdrawVo> convertToVo(List<WithdrawRecord> list,List<Long> blockUids,Byte blockStatus) throws Exception{
// List<Long> uids = new ArrayList<>();
List<WithdrawVo> newList = new ArrayList<>();
// for(WithdrawRecord withdraw:list){
// Long uid = withdraw.getUid();
// uids.add(uid);
// }
// List<WithdrawBlock> blockList = this.withdrawBlockAdminService.getBatchBlockList(uids);
//
// Map<Long,WithdrawBlock> blockMap = blockList.stream().collect(Collectors.toMap(WithdrawBlock::getUid, withdrawBlock -> withdrawBlock));
for(WithdrawRecord withdraw:list){
Long uid = withdraw.getUid();
WithdrawVo withdrawVo = null;
if(!AdminConstants.Status.ALL.equals(blockStatus)){
withdrawVo = this.buildWithdrawVo(withdraw,blockStatus);
}else if(CollectionUtils.isEmpty(blockUids)){
withdrawVo = this.buildWithdrawVo(withdraw,AdminConstants.Status.INVALID);
}else {
Boolean containBol = blockUids.contains(uid);
if(containBol){
withdrawVo = this.buildWithdrawVo(withdraw,AdminConstants.Status.VALID);
}else{
withdrawVo = this.buildWithdrawVo(withdraw,AdminConstants.Status.INVALID);
}
}
newList.add(withdrawVo);
}
return newList;
}
private WithdrawVo buildWithdrawVo(WithdrawRecord withdraw,Byte withdrawBlockStatus) throws Exception{
WithdrawVo withdrawVo = new WithdrawVo();
BeanUtils.copyProperties(withdraw,withdrawVo);
if(withdrawBlockStatus != null) {
withdrawVo.setWithDrawBlockStatus(withdrawBlockStatus);
}else{
withdrawVo.setWithDrawBlockStatus(AdminConstants.Status.INVALID);
}
return withdrawVo;
}
/**
* 小秘书通知
*
* @param toUid
*/
private void sendWithdrawMsg(long toUid, byte accountType) {
String msg = String.format("你的提现申请已通过并发放至%s请注意查收", AccountTypeEnum.getNameByType(accountType));
NeteaseSendMsgParam neteaseSendMsgParam = new NeteaseSendMsgParam();
neteaseSendMsgParam.setType(0);
neteaseSendMsgParam.setFrom(PropertyUtil.getProperty("SECRETARY_UID"));
neteaseSendMsgParam.setOpe(0);
neteaseSendMsgParam.setTo(String.valueOf(toUid));
neteaseSendMsgParam.setBody(msg);
sendSysMsgService.sendMsg(neteaseSendMsgParam);
}
}

View File

@@ -1,29 +0,0 @@
package com.accompany.admin.service.withdraw;
import com.accompany.business.dto.exchange.ExchangeRateDto;
import com.accompany.business.model.withdraw.ExchangeRate;
import java.util.List;
/**
* @author: liaozetao
* @date: 2023/7/7 18:08
* @description:
*/
public interface ExchangeRateAdminService {
/**
* 保存
*
* @param rate
*/
void save(ExchangeRateDto rate);
/**
* 列表
*
* @return
*/
List<ExchangeRate> list();
}

View File

@@ -1,72 +0,0 @@
package com.accompany.admin.service.withdraw;
import com.accompany.admin.service.base.BaseService;
import com.accompany.admin.vo.withdraw.WithdrawAccountAdminVo;
import com.accompany.business.model.WithdrawAccount;
import com.accompany.business.service.exchange.WithdrawAccountService;
import com.accompany.business.service.user.UsersService;
import com.accompany.common.utils.DateTimeUtil;
import com.accompany.core.model.Users;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
/**
* Created by yuanyi on 2019/5/4.
*/
@Service
public class WithdrawAccountAdminService extends BaseService {
@Autowired
private WithdrawAccountService withdrawAccountService;
@Autowired
private UsersService usersService;
public Page<WithdrawAccountAdminVo> pageWithdrawAccount(Integer pageNum, Integer pageSize, Long erbanNo) {
Page<WithdrawAccountAdminVo> voPage = new Page<>(pageNum, pageSize);
Page<WithdrawAccount> dbPage = new Page<>(pageNum, pageSize);
Long uid = null;
if (null != erbanNo){
Users users = usersService.getUserByErbanNo(erbanNo);
if (null != users){
uid = users.getUid();
}
}
QueryWrapper<WithdrawAccount> wrapper = Wrappers.query();
wrapper.lambda().eq(null != uid, WithdrawAccount::getUid, uid)
.orderByDesc(WithdrawAccount::getCreateTime);
withdrawAccountService.page(dbPage, wrapper);
if (!CollectionUtils.isEmpty(dbPage.getRecords())){
List<WithdrawAccount> accounts = dbPage.getRecords();
List<Long> uids = accounts.stream().map(WithdrawAccount::getUid).distinct().collect(Collectors.toList());
Map<Long, Users> usersMap = usersService.getUsersListByUids(uids).stream().collect(Collectors.toMap(Users::getUid, users -> users));
List<WithdrawAccountAdminVo> voList = accounts.stream().map(account->{
WithdrawAccountAdminVo vo = new WithdrawAccountAdminVo();
BeanUtils.copyProperties(account, vo);
Optional.ofNullable(usersMap.get(account.getUid())).ifPresent(users -> {
vo.setErbanNo(users.getErbanNo());
vo.setNick(users.getNick());
});
vo.setCreateTime(DateTimeUtil.convertDate(account.getCreateTime()));
vo.setUpdateTime(DateTimeUtil.convertDate(account.getUpdateTime()));
return vo;
}).collect(Collectors.toList());
voPage.setRecords(voList);
voPage.setTotal(dbPage.getTotal());
}
return voPage;
}
}

View File

@@ -1,21 +0,0 @@
package com.accompany.admin.service.withdraw;
import com.accompany.business.model.withdraw.WithdrawAccountDtl;
import java.util.List;
/**
* @author: liaozetao
* @date: 2023/7/7 18:44
* @description:
*/
public interface WithdrawAccountDtlAdminService {
/**
* 列表
*
* @return
*/
List<WithdrawAccountDtl> list();
}

View File

@@ -1,145 +0,0 @@
package com.accompany.admin.service.withdraw;
import com.accompany.admin.service.base.BaseService;
import com.accompany.admin.vo.withdraw.WithdrawRecordAdminVo;
import com.accompany.business.model.WithdrawRecord;
import com.accompany.business.service.exchange.WithdrawRecordService;
import com.accompany.business.service.purse.UserPurseService;
import com.accompany.business.service.record.BillRecordService;
import com.accompany.business.service.user.UsersService;
import com.accompany.common.constant.Constant;
import com.accompany.common.status.BusiStatus;
import com.accompany.common.utils.DateTimeUtil;
import com.accompany.core.enumeration.BillObjTypeEnum;
import com.accompany.core.exception.AdminServiceException;
import com.accompany.core.model.Users;
import com.accompany.core.util.StringUtils;
import com.accompany.sharding.model.BillRecord;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.BeanUtils;
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.text.NumberFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
/**
* Created by yuanyi on 2019/5/4.
*/
@Service
public class WithdrawApplyAdminService extends BaseService {
@Autowired
private WithdrawRecordService withdrawRecordService;
@Autowired
private UsersService usersService;
@Autowired
private BillRecordService billRecordService;
@Autowired
private UserPurseService userPurseService;
public Page<WithdrawRecordAdminVo> pageWithdrawRecord(Integer pageNum, Integer pageSize, Long erbanNo, String beginDate, String endDate, Byte status) {
Page<WithdrawRecordAdminVo> voPage = new Page<>(pageNum, pageSize);
Page<WithdrawRecord> dbPage = new Page<>(pageNum, pageSize);
Long uid = null;
if (null != erbanNo){
Users users = usersService.getUserByErbanNo(erbanNo);
if (null != users){
uid = users.getUid();
}
}
LambdaQueryWrapper<WithdrawRecord> wrapper = Wrappers.lambdaQuery();
wrapper.ge(StringUtils.isNotBlank(beginDate),WithdrawRecord::getCreateTime,beginDate)
.le(StringUtils.isNotBlank(endDate),WithdrawRecord::getCreateTime,endDate)
.eq(null != uid, WithdrawRecord::getUid, uid)
.eq(status != null && status != -1, WithdrawRecord::getStatus, status)
.orderByDesc(WithdrawRecord::getCreateTime);
withdrawRecordService.page(dbPage, wrapper);
if (!CollectionUtils.isEmpty(dbPage.getRecords())){
List<WithdrawRecord> records = dbPage.getRecords();
List<Long> uids = records.stream().map(WithdrawRecord::getUid).distinct().collect(Collectors.toList());
Map<Long, Users> usersMap = usersService.getUsersListByUids(uids).stream().collect(Collectors.toMap(Users::getUid, users -> users));
NumberFormat percent = NumberFormat.getPercentInstance();
percent.setMaximumFractionDigits(0);
List<WithdrawRecordAdminVo> voList = records.stream().map(record->{
WithdrawRecordAdminVo vo = new WithdrawRecordAdminVo();
BeanUtils.copyProperties(record, vo);
Optional.ofNullable(usersMap.get(record.getUid())).ifPresent(users -> {
vo.setErbanNo(users.getErbanNo());
vo.setNick(users.getNick());
});
vo.setFee(percent.format(record.getFee()));
vo.setStatus(translationStatus(record.getStatus()));
vo.setCreateTime(DateTimeUtil.convertDate(record.getCreateTime()));
vo.setUpdateTime(DateTimeUtil.convertDate(record.getUpdateTime()));
return vo;
}).collect(Collectors.toList());
voPage.setRecords(voList);
voPage.setTotal(dbPage.getTotal());
}
return voPage;
}
private String translationStatus(Byte status){
if (Constant.WithDrawStatus.ing.equals(status)){
return "申请中";
} else if (Constant.WithDrawStatus.APPROVED.equals(status)){
return "已发放";
} else if (Constant.WithDrawStatus.reject.equals(status)){
return "已驳回";
}
return StringUtils.EMPTY;
}
@Transactional(rollbackFor = Exception.class)
public void updateWithdrawStatus(Long id, Byte status, String adminName) {
WithdrawRecord withdraw = withdrawRecordService.getById(id);
if (withdraw == null) {
throw new AdminServiceException(BusiStatus.SERVERERROR, "提现申请记录不存在或者账单号为空");
}
if (!withdraw.getStatus().equals(Constant.WithDrawStatus.ing)) {
throw new AdminServiceException(BusiStatus.SERVERERROR, "该记录不是发起提现状态");
}
Long uid = withdraw.getUid();
Users users = usersService.getUsersByUid(uid);
if (users.getUseStatus().equals(Constant.UserStatus.FROZEN)){
throw new AdminServiceException(BusiStatus.SERVERERROR, "账户是黑名单,无法转账");
}
QueryWrapper<BillRecord> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(BillRecord::getObjId,id).eq(BillRecord::getObjType,BillObjTypeEnum.WITHDRAW.getValue());
List<BillRecord> billRecord =billRecordService.list(wrapper);
if (CollectionUtils.isEmpty(billRecord)) {
throw new AdminServiceException(BusiStatus.SERVERERROR, "找不到账单记录");
}
withdraw.setStatus(status);
withdraw.setUpdateTime(new Date());
withdraw.setOperator(adminName);
withdrawRecordService.updateById(withdraw);
if (Constant.WithDrawStatus.APPROVED.equals(status)){
logger.info("[提现申请] {} {} {} {} 已审批", withdraw.getId(), withdraw.getUid(), withdraw.getGolds(), withdraw.getCreateTime());
// todo 小秘书通知
} else if (Constant.WithDrawStatus.reject.equals(status)){
userPurseService.addGold(withdraw.getUid(), withdraw.getGolds(), BillObjTypeEnum.REJECT_WITHDRAW,
(userPurse)-> billRecordService.insertGeneralBillRecord(uid, withdraw.getId().toString(), BillObjTypeEnum.REJECT_WITHDRAW, withdraw.getGolds(), userPurse));
logger.info("[提现申请] {} {} {} {} 已退回", withdraw.getId(), withdraw.getUid(), withdraw.getGolds(), withdraw.getCreateTime());
}
}
}

View File

@@ -1,144 +0,0 @@
package com.accompany.admin.service.withdraw;
import com.accompany.admin.common.AdminConstants;
import com.accompany.admin.mapper.WithdrawBlockMapper;
import com.accompany.admin.mapper.WithdrawBlockMapperExpand;
import com.accompany.admin.model.WithdrawBlock;
import com.accompany.admin.model.WithdrawBlockExample;
import com.accompany.admin.service.base.BaseService;
import com.accompany.admin.vo.withdraw.WithdrawBlockVo;
import com.accompany.business.service.user.UserQueryService;
import com.accompany.core.exception.AdminServiceException;
import com.accompany.core.model.Users;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.stream.Collectors;
/**
* Created by yuanyi on 2019/4/22.
*/
@Service
public class WithdrawBlockAdminService extends BaseService {
@Autowired
private WithdrawBlockMapper withdrawBlockMapper;
@Autowired
private WithdrawBlockMapperExpand withdrawBlockMapperExpand;
@Autowired
private UserQueryService userQueryService;
/**
* 获取黑名单列表
* @param erbanNoList
* @param status
* @param pageSize
* @param pageNo
* @return
*/
public List<WithdrawBlockVo> getBlockList(String erbanNoList, Byte status, Integer pageSize, Integer pageNo, Date startDate, Date endDate) {
List<Long> newList = null;
if(!StringUtils.isEmpty(erbanNoList)){
List<String> oldList = Arrays.asList(erbanNoList.split(","));
newList = new ArrayList<>(oldList.size());
for(String erbanNoStr:oldList){
Long erbanNo = Long.valueOf(erbanNoStr);
newList.add(erbanNo);
}
}
if(AdminConstants.Status.ALL.equals(status)){
status = null;
}
PageHelper.startPage(pageNo,pageSize);
List<WithdrawBlockVo> list = this.withdrawBlockMapperExpand.selectWithdrawBlockVoList(newList,status,startDate,endDate);
return list;
}
/**
* 单个删除,恢复,批量恢复,删除
* @param uidStr
* @param status
*/
public void batchModify(String uidStr, Byte status){
List<String> oldList = Arrays.asList(uidStr.split(","));
List<Long> uidList = new ArrayList<>(oldList.size());
for(String uids :oldList){
Long uid = Long.valueOf(uids);
uidList.add(uid);
}
WithdrawBlockExample example = new WithdrawBlockExample();
WithdrawBlockExample.Criteria criteria = example.createCriteria();
criteria.andUidIn(uidList);
List<WithdrawBlock> list = this.withdrawBlockMapper.selectByExample(example);
for(WithdrawBlock withdrawBlock:list){
withdrawBlock.setStatus(status);
this.withdrawBlockMapper.updateByPrimaryKeySelective(withdrawBlock);
}
}
public void insertBlock(String erbanNoList,String remark){
List<String> strList = Arrays.asList(erbanNoList.split(","));
if(strList.size() > 500){
throw new AdminServiceException("输入用户已超500个");
}
List<Long> erbanNos = new ArrayList<>();
for(String erbanNoStr:strList){
Long erbanNo = Long.valueOf(erbanNoStr);
erbanNos.add(erbanNo);
}
List<Users> usersList = this.userQueryService.getBatchUsersByErbanNoFromDB(erbanNos);
if(CollectionUtils.isEmpty(usersList)){
throw new AdminServiceException("不存在这批用户");
}
Map<Long,Users> usersMap = usersList.stream().collect(Collectors.toMap(Users::getErbanNo, users -> users));
for(Long erbanNo: erbanNos){
Users users = usersMap.get(erbanNo);
if(users != null){
Long uid = users.getUid();
WithdrawBlock withdrawBlock = this.buildWithdrawBlock(uid,remark);
this.withdrawBlockMapperExpand.insertOrUpdate(withdrawBlock);
}
}
}
public WithdrawBlock getSingleWithdrawBlockByUid(Long uid){
WithdrawBlockExample example = new WithdrawBlockExample();
WithdrawBlockExample.Criteria criteria = example.createCriteria();
criteria.andUidEqualTo(uid);
List<WithdrawBlock> list = withdrawBlockMapper.selectByExample(example);
if(CollectionUtils.isEmpty(list)){
return null;
}
return list.get(0);
}
public List<WithdrawBlock> getBatchBlockList(List<Long> uids){
WithdrawBlockExample example = new WithdrawBlockExample();
WithdrawBlockExample.Criteria criteria = example.createCriteria();
criteria.andUidIn(uids);
return this.withdrawBlockMapper.selectByExample(example);
}
public List<Long> getBlockedUidList(Byte status){
return this.withdrawBlockMapperExpand.selectWithdrawBlockUid(status);
}
private WithdrawBlock buildWithdrawBlock(Long uid,String remark) {
WithdrawBlock withDrawBlock = new WithdrawBlock();
withDrawBlock.setRemark(remark);
withDrawBlock.setUid(uid);
withDrawBlock.setStatus(AdminConstants.Status.VALID);
withDrawBlock.setCreateTime(new Date());
withDrawBlock.setUpdateTime(new Date());
return withDrawBlock;
}
}

View File

@@ -1,153 +0,0 @@
package com.accompany.admin.service.withdraw;
import cn.hutool.core.collection.CollectionUtil;
import com.accompany.admin.service.base.BaseService;
import com.accompany.admin.service.system.SysConfAdminService;
import com.accompany.admin.vo.withdraw.WithdrawConfigAdminVo;
import com.accompany.business.dto.exchange.WithdrawConfigDto;
import com.accompany.business.model.withdraw.WithdrawAccountDtl;
import com.accompany.business.model.withdraw.WithdrawConfig;
import com.accompany.business.service.withdraw.ExchangeRateService;
import com.accompany.business.service.withdraw.WithdrawAccountDtlService;
import com.accompany.business.service.withdraw.WithdrawConfigService;
import com.accompany.common.constant.Constant;
import com.accompany.common.status.BusiStatus;
import com.accompany.core.exception.ServiceException;
import com.alibaba.nacos.api.exception.NacosException;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
/**
* Created by yuanyi on 2019/5/4.
*/
@Service
@Slf4j
public class WithdrawConfigAdminService extends BaseService {
@Autowired
private ObjectMapper objectMapper;
@Autowired
private SysConfAdminService sysConfAdminService;
@Autowired
private WithdrawConfigService withdrawConfigService;
@Autowired
private WithdrawAccountDtlService withdrawAccountDtlService;
@Autowired
private ExchangeRateService exchangeRateService;
public List<WithdrawConfigAdminVo> list() {
List<WithdrawConfigAdminVo> list = new ArrayList<>();
WithdrawConfigDto configDto = getConfig();
WithdrawConfigAdminVo vo = new WithdrawConfigAdminVo();
BeanUtils.copyProperties(configDto, vo);
vo.setRole("全部用户");
list.add(vo);
return list;
}
public void save(WithdrawConfigDto params) {
boolean needSave = false;
WithdrawConfigDto configDto = getConfig();
if (!configDto.getFee().equals(params.getFee())) {
configDto.setFee(params.getFee());
needSave = true;
}
if (!configDto.getTimes().equals(params.getTimes())) {
configDto.setTimes(params.getTimes());
needSave = true;
}
if (!configDto.getMin().equals(params.getMin())) {
configDto.setMin(params.getMin());
needSave = true;
}
if (!configDto.getMax().equals(params.getMin())) {
configDto.setMax(params.getMax());
needSave = true;
}
if (needSave) {
try {
String configStr = objectMapper.writeValueAsString(configDto);
sysConfAdminService.updateConfigValueById(Constant.SysConfId.WITHDRAWAL_CONFIG, configStr);
} catch (JsonProcessingException e) {
log.error("[金币提现] 序列化 config 异常 {}", configDto, e);
throw new ServiceException(BusiStatus.SERVERBUSY);
} catch (NacosException e) {
log.error("[金币提现] 保存到 nacos 异常 {}", configDto, e);
throw new ServiceException(BusiStatus.SERVERBUSY);
}
}
}
private WithdrawConfigDto getConfig() {
String configStr = sysConfAdminService.getSysConfValueById(Constant.SysConfId.WITHDRAWAL_CONFIG);
if (!org.springframework.util.StringUtils.hasText(configStr)) {
log.error("[金币提现] 配置为空 {}", Constant.SysConfId.WITHDRAWAL_CONFIG);
throw new ServiceException(BusiStatus.SERVERBUSY);
}
WithdrawConfigDto config = null;
try {
config = objectMapper.readValue(configStr, WithdrawConfigDto.class);
} catch (IOException e) {
log.error("[金币提现] 获取配置异常 {}", Constant.SysConfId.WITHDRAWAL_CONFIG);
throw new ServiceException(BusiStatus.SERVERBUSY);
}
return config;
}
public void saveConfig(WithdrawConfigDto config) {
WithdrawConfig withdrawConfig = new WithdrawConfig();
BeanUtils.copyProperties(config, withdrawConfig);
Long minValue = withdrawConfig.getMinValue();
Long weekMaxValue = withdrawConfig.getWeekMaxValue();
BigDecimal chargeRate = withdrawConfig.getChargeRate();
if (minValue < 0) {
throw new ServiceException("最小提现金币不能小于零");
}
if (weekMaxValue < 0) {
throw new ServiceException("周提现上限不能小于零");
}
if (minValue > weekMaxValue) {
throw new ServiceException("周提现上限不能小于最小提现金币");
}
if (chargeRate == null || chargeRate.compareTo(BigDecimal.ZERO) < 0) {
throw new ServiceException("提现手续费率不能小于零");
}
withdrawConfig.setIsEnabled((byte) Constant.Yes1No0.YES);
withdrawConfigService.saveOrUpdate(withdrawConfig);
List<WithdrawAccountDtl> accounts = config.getAccounts();
if (CollectionUtil.isNotEmpty(accounts)) {
withdrawAccountDtlService.saveOrUpdateBatch(accounts);
}
}
public WithdrawConfigAdminVo get() {
WithdrawConfigAdminVo admin = new WithdrawConfigAdminVo();
List<WithdrawConfig> configs = withdrawConfigService.list(Wrappers.<WithdrawConfig>lambdaQuery()
.eq(WithdrawConfig::getIsEnabled, Constant.Yes1No0.YES));
if (CollectionUtil.isEmpty(configs)) {
return admin;
}
WithdrawConfig config = configs.get(0);
BeanUtils.copyProperties(config, admin);
admin.setAccounts(withdrawAccountDtlService.list());
admin.setRates(exchangeRateService.list());
admin.setLastRateTime(exchangeRateService.getLastRateTime());
return admin;
}
}

View File

@@ -1,49 +0,0 @@
package com.accompany.admin.service.withdraw;
import com.accompany.admin.vo.withdraw.WithdrawUserAdminVo;
import com.accompany.business.model.withdraw.WithdrawUserAccount;
import com.accompany.common.model.PageReq;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.context.request.ServletWebRequest;
/**
* @author: liaozetao
* @date: 2023/7/7 15:20
* @description:
*/
public interface WithdrawUserAdminService {
/**
* 分页
*
* @param erbanNo
* @param req
* @return
*/
Page<WithdrawUserAdminVo> page(String erbanNo, PageReq req);
/**
* 获取
*
* @param uid
* @param accountType
* @return
*/
WithdrawUserAccount get(Long uid, Integer accountType);
/**
* 导出
*
* @param erBanNo
* @param servletWebRequest
*/
void export(Long erBanNo, ServletWebRequest servletWebRequest);
/**
* 重置
*
* @param id
*/
void reset(Long id);
}

View File

@@ -1,60 +0,0 @@
package com.accompany.admin.service.withdraw;
import com.accompany.admin.dto.withdraw.WithdrawUserLimitAdminDto;
import com.accompany.admin.vo.withdraw.WithdrawUserLimitAdminVo;
import com.accompany.common.model.PageReq;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.context.request.ServletWebRequest;
/**
* @author: liaozetao
* @date: 2023/7/10 14:38
* @description:
*/
public interface WithdrawUserLimitAdminService {
/**
* 分页
*
* @param erbanNo
* @param limitType
* @param roomErBanNo
* @param hallErBanNo
* @param req
* @return
*/
Page<WithdrawUserLimitAdminVo> page(String erbanNo, Integer limitType, String roomErBanNo, String hallErBanNo, PageReq req);
/**
* 保存
*
* @param limit
*/
void save(WithdrawUserLimitAdminDto limit);
/**
* 删除
*
* @param id
*/
void del(Long id);
/**
* 批量删除
*
* @param idStr
*/
void batchDel(String idStr);
/**
* 导出
*
* @param erbanNo
* @param limitType
* @param roomErBanNo
* @param hallErBanNo
* @param servletWebRequest
*/
void export(String erbanNo, Integer limitType, String roomErBanNo, String hallErBanNo, ServletWebRequest servletWebRequest);
}

View File

@@ -1,92 +0,0 @@
package com.accompany.admin.service.withdraw;
import com.accompany.admin.vo.withdraw.WithdrawUserRecordAdminVo;
import com.accompany.common.model.PageReq;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.context.request.ServletWebRequest;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author: liaozetao
* @date: 2023/7/10 14:38
* @description:
*/
public interface WithdrawUserRecordAdminService {
/**
* 分页
*
* @param recordStatus
* @param erBanNo
* @param accountType
* @param applyStartTime
* @param applyEndTime
* @param req
* @return
*/
Page<WithdrawUserRecordAdminVo> page(Integer recordStatus, String erBanNo, Integer accountType, Date applyStartTime, Date applyEndTime, PageReq req);
/**
* 发放
*
* @param adminId
* @param isSecretary
* @param id
*/
void grant(Long id, Integer isSecretary, Integer adminId);
/**
* 导出
*
* @param recordStatus
* @param erbanNo
* @param accountType
* @param applyStartTime
* @param applyEndTime
* @param servletWebRequest
*/
void export(Integer recordStatus, String erbanNo, Integer accountType, Date applyStartTime, Date applyEndTime, ServletWebRequest servletWebRequest);
/**
* 汇总提现金额
*
* @param recordStatus
* @param erbanNo
* @param accountType
* @param applyStartTime
* @param applyEndTime
* @return
*/
BigDecimal totalAmount(Integer recordStatus, String erbanNo, Integer accountType, Date applyStartTime, Date applyEndTime);
/**
* 批量发放
*
* @param recordIdStr
* @param isSecretary
* @param adminId
*/
void batchGrant(String recordIdStr, Integer isSecretary, Integer adminId);
/**
* 驳回
*
* @param id
* @param isReturn
* @param isSecretary
* @param adminId
*/
void reject(Long id, Integer isReturn, Integer isSecretary, Integer adminId);
/**
* 批量驳回
*
* @param recordIdStr
* @param isReturn
* @param isSecretary
* @param adminId
*/
void batchReject(String recordIdStr, Integer isReturn, Integer isSecretary, Integer adminId);
}

View File

@@ -1,88 +0,0 @@
package com.accompany.admin.service.withdraw.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.accompany.admin.service.withdraw.ExchangeRateAdminService;
import com.accompany.business.dto.exchange.ExchangeRateDto;
import com.accompany.business.model.withdraw.ExchangeRate;
import com.accompany.business.service.withdraw.ExchangeRateService;
import com.accompany.payment.constant.CurrencyTypeEnum;
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.math.BigDecimal;
import java.util.Arrays;
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/7/7 18:08
* @description:
*/
@Slf4j
@Service
public class ExchangeRateAdminServiceImpl implements ExchangeRateAdminService {
@Autowired
private ExchangeRateService exchangeRateService;
@Override
public void save(ExchangeRateDto rate) {
BigDecimal cny = rate.getCny();
BigDecimal myr = rate.getMyr();
BigDecimal sgd = rate.getSgd();
BigDecimal other = rate.getOther();
BigDecimal twd = rate.getTwd();
List<ExchangeRate> list = exchangeRateService.list(Wrappers.<ExchangeRate>lambdaQuery()
.in(ExchangeRate::getCurrency, Arrays.asList(
CurrencyTypeEnum.CNY.getValue(),
CurrencyTypeEnum.MYR.getValue(),
CurrencyTypeEnum.SGD.getValue(),
CurrencyTypeEnum.USD.getValue(),
CurrencyTypeEnum.TWD.getValue())));
if (CollectionUtil.isEmpty(list)) {
return;
}
Map<String, ExchangeRate> exchangeRateMap = list.stream().collect(Collectors.toMap(ExchangeRate::getCurrency, Function.identity()));
if (exchangeRateMap.containsKey(CurrencyTypeEnum.CNY.getValue())) {
ExchangeRate exchangeRate = exchangeRateMap.get(CurrencyTypeEnum.CNY.getValue());
exchangeRate.setRate(cny);
exchangeRate.setUpdateTime(new Date());
exchangeRateService.saveOrUpdate(exchangeRate);
}
if (exchangeRateMap.containsKey(CurrencyTypeEnum.MYR.getValue())) {
ExchangeRate exchangeRate = exchangeRateMap.get(CurrencyTypeEnum.MYR.getValue());
exchangeRate.setRate(myr);
exchangeRate.setUpdateTime(new Date());
exchangeRateService.saveOrUpdate(exchangeRate);
}
if (exchangeRateMap.containsKey(CurrencyTypeEnum.SGD.getValue())) {
ExchangeRate exchangeRate = exchangeRateMap.get(CurrencyTypeEnum.SGD.getValue());
exchangeRate.setRate(sgd);
exchangeRate.setUpdateTime(new Date());
exchangeRateService.saveOrUpdate(exchangeRate);
}
if (exchangeRateMap.containsKey(CurrencyTypeEnum.USD.getValue())) {
ExchangeRate exchangeRate = exchangeRateMap.get(CurrencyTypeEnum.USD.getValue());
exchangeRate.setRate(other);
exchangeRate.setUpdateTime(new Date());
exchangeRateService.saveOrUpdate(exchangeRate);
}
if (exchangeRateMap.containsKey(CurrencyTypeEnum.TWD.getValue())) {
ExchangeRate exchangeRate = exchangeRateMap.get(CurrencyTypeEnum.TWD.getValue());
exchangeRate.setRate(twd);
exchangeRate.setUpdateTime(new Date());
exchangeRateService.saveOrUpdate(exchangeRate);
}
}
@Override
public List<ExchangeRate> list() {
return exchangeRateService.list();
}
}

View File

@@ -1,28 +0,0 @@
package com.accompany.admin.service.withdraw.impl;
import com.accompany.admin.service.withdraw.WithdrawAccountDtlAdminService;
import com.accompany.business.model.withdraw.WithdrawAccountDtl;
import com.accompany.business.service.withdraw.WithdrawAccountDtlService;
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/7/7 18:44
* @description:
*/
@Slf4j
@Service
public class WithdrawAccountDtlAdminServiceImpl implements WithdrawAccountDtlAdminService {
@Autowired
private WithdrawAccountDtlService withdrawAccountDtlService;
@Override
public List<WithdrawAccountDtl> list() {
return withdrawAccountDtlService.list();
}
}

View File

@@ -1,219 +0,0 @@
package com.accompany.admin.service.withdraw.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.util.StrUtil;
import com.accompany.admin.dto.withdraw.WithdrawUserAdminDto;
import com.accompany.admin.service.withdraw.WithdrawUserAdminService;
import com.accompany.admin.vo.withdraw.WithdrawUserAdminVo;
import com.accompany.business.constant.withdraw.WithdrawAccountTypeConstant;
import com.accompany.business.model.UserCertifyRecord;
import com.accompany.business.model.UserCertifyRecordExample;
import com.accompany.business.model.withdraw.WithdrawUser;
import com.accompany.business.model.withdraw.WithdrawUserAccount;
import com.accompany.business.mybatismapper.UserCertifyRecordMapper;
import com.accompany.business.service.certification.AbstractCertifyService;
import com.accompany.business.service.certification.FinancialFaceVerifyService;
import com.accompany.business.service.user.UsersService;
import com.accompany.business.service.withdraw.WithdrawUserAccountService;
import com.accompany.business.service.withdraw.WithdrawUserService;
import com.accompany.common.constant.Constant;
import com.accompany.common.model.PageReq;
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/7/7 15:21
* @description:
*/
@Slf4j
@Service
public class WithdrawUserAdminServiceImpl implements WithdrawUserAdminService {
@Autowired
private UsersMapper usersMapper;
@Autowired
private UserCertifyRecordMapper userCertifyRecordMapper;
@Autowired
private UsersService usersService;
@Autowired
private WithdrawUserService withdrawUserService;
@Autowired
private WithdrawUserAccountService withdrawUserAccountService;
@Autowired
private FinancialFaceVerifyService financialFaceVerifyService;
@Override
public Page<WithdrawUserAdminVo> page(String erBanNo, PageReq req) {
List<Long> uidList = null;
if (StrUtil.isNotEmpty(erBanNo)) {
uidList = usersMapper.getUidByErBanNo(erBanNo);
}
if (req == null) {
req = new PageReq(-1, -1);
}
IPage<WithdrawUser> page = null;
if (req.getPage() == -1 && req.getPageSize() == -1) {
page = new Page<>(-1, -1);
page.setRecords(withdrawUserService.list(Wrappers.<WithdrawUser>lambdaQuery()
.in(CollectionUtil.isNotEmpty(uidList), WithdrawUser::getUid, uidList)));
} else {
page = withdrawUserService.page(new Page<>(req.getPage(), req.getPageSize()), Wrappers.<WithdrawUser>lambdaQuery()
.in(CollectionUtil.isNotEmpty(uidList), WithdrawUser::getUid, uidList));
}
List<WithdrawUserAdminVo> admins = new ArrayList<>();
List<WithdrawUser> records = page.getRecords();
if (CollectionUtil.isNotEmpty(records)) {
Map<Long, Users> userMap = usersService.getUsersMapByUids(records.stream().map(WithdrawUser::getUid).collect(Collectors.toList()));
List<WithdrawUserAccount> withdrawUserAccounts = withdrawUserAccountService.list(Wrappers.<WithdrawUserAccount>lambdaQuery()
.in(WithdrawUserAccount::getUid, userMap.keySet())
.eq(WithdrawUserAccount::getAccountType, WithdrawAccountTypeConstant.CHINA_UNION_PAY));
for (WithdrawUser record : records) {
Long uid = record.getUid();
WithdrawUserAdminVo admin = new WithdrawUserAdminVo();
BeanUtils.copyProperties(record, admin);
if (userMap.containsKey(uid)) {
Users users = userMap.get(uid);
admin.setErbanNo(users.getErbanNo());
admin.setNick(users.getNick());
if (CollectionUtil.isNotEmpty(withdrawUserAccounts)) {
withdrawUserAccounts.stream().filter(v -> v.getUid().equals(uid)).findAny().ifPresent(v -> admin.setUpdateTime(v.getUpdateTime()));
}
}
admins.add(admin);
}
}
Page<WithdrawUserAdminVo> iPage = new Page<>(req.getPage(), req.getPageSize());
iPage.setTotal(page.getTotal());
iPage.setRecords(admins);
return iPage;
}
@Override
public WithdrawUserAccount get(Long uid, Integer accountType) {
List<WithdrawUserAccount> accounts = withdrawUserAccountService.list(Wrappers.<WithdrawUserAccount>lambdaQuery()
.eq(WithdrawUserAccount::getUid, uid)
.eq(WithdrawUserAccount::getAccountType, accountType));
if (CollectionUtil.isNotEmpty(accounts)) {
return accounts.get(0);
}
return null;
}
@Override
public void export(Long erBanNo, ServletWebRequest servletWebRequest) {
String erBanNoStr = null;
if (erBanNo != null) {
erBanNoStr = String.valueOf(erBanNo);
}
PageReq req = new PageReq();
req.setPage(-1);
req.setPageSize(-1);
Page<WithdrawUserAdminVo> page = page(erBanNoStr, req);
List<WithdrawUserAdminDto> datas = new ArrayList<>();
List<WithdrawUserAdminVo> records = page.getRecords();
if (CollectionUtil.isNotEmpty(records)) {
for (WithdrawUserAdminVo record : records) {
WithdrawUserAdminDto admin = new WithdrawUserAdminDto();
BeanUtils.copyProperties(record, admin);
Date createTime = record.getCreateTime();
Integer isOrderAccount = record.getIsOrderAccount();
Integer isChinaUnionPay = record.getIsChinaUnionPay();
Integer isMayBank = record.getIsMayBank();
Integer isBankOfSingapore = record.getIsBankOfSingapore();
Integer isTaiWanBank = record.getIsTaiWanBank();
String withdrawAccount = "中国大陆银联 " + (isChinaUnionPay == Constant.Yes1No0.YES ? "已绑定" : "未绑定") + "\n";
withdrawAccount += "马来西亚银行 " + (isMayBank == Constant.Yes1No0.YES ? "已绑定" : "未绑定") + "\n";
withdrawAccount += "新加坡银行 " + (isBankOfSingapore == Constant.Yes1No0.YES ? "已绑定" : "未绑定") + "\n";
withdrawAccount += "其它账户 " + (isOrderAccount == Constant.Yes1No0.YES ? "已绑定" : "未绑定") + "\n";
withdrawAccount += "台湾地区银行 " + (isTaiWanBank == Constant.Yes1No0.YES ? "已绑定" : "未绑定");
admin.setWithdrawAccount(withdrawAccount);
admin.setCreateTimeStr(DateFormatUtils.format(createTime, DatePattern.NORM_DATETIME_PATTERN));
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(), WithdrawUserAdminDto.class).sheet("用户账户信息").doWrite(datas);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
}
@Override
public void reset(Long id) {
WithdrawUserAccount withdrawUserAccount = withdrawUserAccountService.getById(id);
withdrawUserAccountService.removeById(id);
if (withdrawUserAccount == null) {
return;
}
Long uid = withdrawUserAccount.getUid();
Integer accountType = withdrawUserAccount.getAccountType();
List<WithdrawUser> withdrawUsers = withdrawUserService.list(Wrappers.<WithdrawUser>lambdaQuery()
.eq(WithdrawUser::getUid, uid));
if (CollectionUtil.isEmpty(withdrawUsers)) {
return;
}
WithdrawUser withdrawUser = withdrawUsers.get(0);
withdrawUser.setAccountFlag(withdrawUser.getAccountFlag() ^ accountType);
withdrawUser.setUpdateTime(new Date());
withdrawUserService.saveOrUpdate(withdrawUser);
//清除实名记录
UserCertifyRecordExample example = new UserCertifyRecordExample();
example.createCriteria().andUidEqualTo(uid);
List<UserCertifyRecord> records = userCertifyRecordMapper.selectByExample(example);
if (CollectionUtil.isEmpty(records)) {
return;
}
if (accountType == WithdrawAccountTypeConstant.CHINA_UNION_PAY) {
Date now = new Date();
Users users = usersMapper.selectByPrimaryKey(uid);
if (users != null) {
String idCardNum = users.getIdCardNum();
users.setIdCardNum(StrUtil.EMPTY);
users.setRealName(StrUtil.EMPTY);
users.setCertifyModifyTimes(0);
users.setUpdateTime(now);
usersMapper.updateByPrimaryKeySelective(users);
usersService.deleteUserRelateCachesByUid(uid);
financialFaceVerifyService.decreaseBindCount(idCardNum);
}
for (UserCertifyRecord record : records) {
record.setBindStatus((byte) AbstractCertifyService.DELETE);
record.setUpdateTime(now);
userCertifyRecordMapper.updateByPrimaryKey(record);
}
}
}
}

View File

@@ -1,173 +0,0 @@
package com.accompany.admin.service.withdraw.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.util.StrUtil;
import com.accompany.admin.dto.withdraw.WithdrawUserLimitAdminDto;
import com.accompany.admin.dto.withdraw.WithdrawUserLimitExportDto;
import com.accompany.admin.mapper.withdraw.WithdrawUserLimitAdminMapper;
import com.accompany.admin.service.system.AdminRoleService;
import com.accompany.admin.service.withdraw.WithdrawUserLimitAdminService;
import com.accompany.admin.vo.withdraw.WithdrawUserLimitAdminVo;
import com.accompany.business.model.withdraw.WithdrawUserLimit;
import com.accompany.business.service.withdraw.WithdrawUserLimitService;
import com.accompany.common.constant.Constant;
import com.accompany.common.model.PageReq;
import com.accompany.core.exception.ServiceException;
import com.accompany.core.model.Users;
import com.accompany.core.mybatismapper.RoomMapper;
import com.accompany.core.mybatismapper.UsersMapper;
import com.accompany.core.service.user.UsersBaseService;
import com.alibaba.excel.EasyExcel;
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.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author: liaozetao
* @date: 2023/7/10 14:39
* @description:
*/
@Slf4j
@Service
public class WithdrawUserLimitAdminServiceImpl implements WithdrawUserLimitAdminService {
@Autowired
private UsersMapper usersMapper;
@Autowired
private RoomMapper roomMapper;
@Autowired
private WithdrawUserLimitAdminMapper withdrawUserLimitAdminMapper;
@Autowired
private UsersBaseService usersBaseService;
@Autowired
private WithdrawUserLimitService withdrawUserLimitService;
@Autowired
private AdminRoleService adminRoleService;
@Override
public Page<WithdrawUserLimitAdminVo> page(String erbanNo, Integer limitType, String roomErBanNo, String hallErBanNo, PageReq req) {
return withdrawUserLimitAdminMapper.selectPage(new Page<>(req.getPage(), req.getPageSize()), erbanNo, limitType, roomErBanNo, hallErBanNo);
}
@Override
public void save(WithdrawUserLimitAdminDto limit) {
String erbanNo = limit.getErbanNo();
String[] erBanNoArray = null;
if (StrUtil.isNotEmpty(erbanNo)) {
if (erbanNo.contains(StrUtil.COMMA)) {
erBanNoArray = erbanNo.split(StrUtil.COMMA);
}
if (erbanNo.contains("\n")) {
erBanNoArray = erbanNo.split("\n");
}
}
if (erBanNoArray == null) {
erBanNoArray = new String[]{erbanNo};
}
List<String> uidList = usersMapper.findUidByErbanNos(Arrays.asList(erBanNoArray));
if (CollectionUtil.isEmpty(uidList)) {
throw new ServiceException("用户ID不存在");
}
List<Users> userList = usersBaseService.getUsersListByUids(uidList.stream().map(Long::valueOf).collect(Collectors.toList()));
if (CollectionUtil.isEmpty(userList)) {
return;
}
Integer limitType = limit.getLimitType();
for (Users users : userList) {
Long uid = users.getUid();
WithdrawUserLimit withdrawUserLimit = new WithdrawUserLimit();
withdrawUserLimit.setUid(uid);
withdrawUserLimit.setLimitType(limitType);
List<WithdrawUserLimit> withdrawUserLimits = withdrawUserLimitService.list(Wrappers.<WithdrawUserLimit>lambdaQuery()
.eq(WithdrawUserLimit::getUid, uid));
if (CollectionUtil.isNotEmpty(withdrawUserLimits)) {
WithdrawUserLimit userLimit = withdrawUserLimits.get(0);
withdrawUserLimit.setId(userLimit.getId());
withdrawUserLimit.setUpdateTime(new Date());
} else {
withdrawUserLimit.setCreateTime(new Date());
}
withdrawUserLimit.setLimitTime(new Date());
withdrawUserLimitService.saveOrUpdate(withdrawUserLimit);
}
}
@Override
public void del(Long id) {
withdrawUserLimitService.removeById(id);
}
@Override
public void batchDel(String idStr) {
if (StrUtil.isEmpty(idStr)) {
return;
}
String[] idArray = idStr.split(StrUtil.COMMA);
for (String id : idArray) {
del(Long.valueOf(id));
}
}
@Override
public void export(String erbanNo, Integer limitType, String roomErBanNo, String hallErBanNo, ServletWebRequest servletWebRequest) {
PageReq req = new PageReq();
req.setPage(1);
req.setPageSize(1000000);
List<WithdrawUserLimitExportDto> datas = new ArrayList<>();
Page<WithdrawUserLimitAdminVo> page = page(erbanNo, limitType, roomErBanNo, hallErBanNo, req);
List<WithdrawUserLimitAdminVo> records = page.getRecords();
if (CollectionUtil.isNotEmpty(records)) {
for (WithdrawUserLimitAdminVo record : records) {
WithdrawUserLimitExportDto admin = new WithdrawUserLimitExportDto();
BeanUtils.copyProperties(record, admin);
Integer isCash = record.getIsCash();
Integer isDiamond = record.getIsDiamond();
Date limitTime = record.getLimitTime();
String limitContent = StrUtil.EMPTY;
if (isDiamond != null && isDiamond == Constant.Yes1No0.YES) {
limitContent += "兑换钻石\n";
}
if (isCash != null && isCash == Constant.Yes1No0.YES) {
limitContent += "提现\n";
}
admin.setLimitContent(limitContent);
if (limitTime != null) {
admin.setLimitTimeStr(DateFormatUtils.format(limitTime, DatePattern.NORM_DATETIME_PATTERN));
}
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(), WithdrawUserLimitExportDto.class).sheet("用户限制信息").doWrite(datas);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
}
}

View File

@@ -1,243 +0,0 @@
package com.accompany.admin.service.withdraw.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.util.StrUtil;
import com.accompany.admin.dto.withdraw.WithdrawUserRecordAdminDto;
import com.accompany.admin.service.withdraw.WithdrawUserRecordAdminService;
import com.accompany.admin.util.DateTimeUtil;
import com.accompany.admin.vo.withdraw.WithdrawUserRecordAdminVo;
import com.accompany.business.enums.withdraw.RecordStatusEnum;
import com.accompany.business.model.withdraw.WithdrawUserRecord;
import com.accompany.business.param.neteasepush.NeteaseSendMsgBatchParam;
import com.accompany.business.service.SendSysMsgService;
import com.accompany.business.service.purse.UserPurseService;
import com.accompany.business.service.record.BillRecordService;
import com.accompany.business.service.withdraw.WithdrawUserRecordService;
import com.accompany.business.vo.withdraw.WithdrawUserRecordVo;
import com.accompany.common.config.SystemConfig;
import com.accompany.common.constant.Constant;
import com.accompany.common.model.PageReq;
import com.accompany.core.constant.BlockStatusEnum;
import com.accompany.core.enumeration.BillObjTypeEnum;
import com.accompany.core.exception.AdminServiceException;
import com.accompany.core.exception.ServiceException;
import com.alibaba.excel.EasyExcel;
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.transaction.annotation.Transactional;
import org.springframework.web.context.request.ServletWebRequest;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
/**
* @author: liaozetao
* @date: 2023/7/10 14:39
* @description:
*/
@Slf4j
@Service
public class WithdrawUserRecordAdminServiceImpl implements WithdrawUserRecordAdminService {
@Autowired
private WithdrawUserRecordService withdrawUserRecordService;
@Autowired
private SendSysMsgService sendSysMsgService;
@Autowired
private UserPurseService userPurseService;
@Autowired
private BillRecordService billRecordService;
@Override
public Page<WithdrawUserRecordAdminVo> page(Integer recordStatus, String erBanNo, Integer accountType, Date applyStartTime, Date applyEndTime, PageReq req) {
if (req == null) {
req = new PageReq(-1, -1);
}
List<WithdrawUserRecordVo> records = null;
if (req.getPage() == -1 && req.getPageSize() == -1) {
records = withdrawUserRecordService.page(null, recordStatus, erBanNo, accountType, applyStartTime, applyEndTime);
} else {
records = withdrawUserRecordService.page(new Page<>(req.getPage(), req.getPageSize()), recordStatus, erBanNo, accountType, applyStartTime, applyEndTime);
}
List<WithdrawUserRecordAdminVo> admins = new ArrayList<>();
if (CollectionUtil.isNotEmpty(records)) {
for (WithdrawUserRecordVo record : records) {
WithdrawUserRecordAdminVo admin = new WithdrawUserRecordAdminVo();
BeanUtils.copyProperties(record, admin);
admins.add(admin);
}
}
Page<WithdrawUserRecordAdminVo> iPage = new Page<>(req.getPage(), req.getPageSize());
iPage.setRecords(admins);
if (req.getPage() != -1 && req.getPageSize() != -1) {
iPage.setTotal(withdrawUserRecordService.totalCount(recordStatus, erBanNo, accountType, applyStartTime, applyEndTime));
}
return iPage;
}
@Override
public void grant(Long id, Integer isSecretary, Integer adminId) {
if (id == null) {
throw new AdminServiceException("缺少ID");
}
log.info("grant id : {}, adminId : {}", id, adminId);
WithdrawUserRecord record = withdrawUserRecordService.getById(id);
if (record == null) {
throw new AdminServiceException("找不到"+ id +"记录");
}
LocalDateTime now = LocalDateTime.now();
withdrawUserRecordService.update(Wrappers.<WithdrawUserRecord>lambdaUpdate()
.set(WithdrawUserRecord::getOperatorId, adminId)
.set(WithdrawUserRecord::getGrantTime, now)
.set(WithdrawUserRecord::getUpdateTime, now)
.set(WithdrawUserRecord::getRecordStatus, RecordStatusEnum.PASS.ordinal())
.eq(WithdrawUserRecord::getId, id));
if (isSecretary != null && isSecretary == Constant.Yes1No0.YES) {
String currentTime = DateTimeUtil.getCurrentTime();
String message = "尊敬的用戶您好,您於【" + currentTime + "】發起的提領已發放至綁定的賬戶請留意查收到帳時間以當地銀行處理為準如有問題請聯繫官方客服wechatsd245376或linepekoyuyin";
NeteaseSendMsgBatchParam param = new NeteaseSendMsgBatchParam();
param.setType(0);
param.setContent(message);
sendSysMsgService.sendBatchPersonTextMsg(SystemConfig.secretaryUid, Collections.singletonList(record.getUid()), null, message, param);
}
}
@Override
public void export(Integer recordStatus, String erbanNo, Integer accountType, Date applyStartTime, Date applyEndTime, ServletWebRequest servletWebRequest) {
PageReq req = new PageReq();
req.setPage(-1);
req.setPageSize(-1);
List<WithdrawUserRecordAdminDto> datas = new ArrayList<>();
Page<WithdrawUserRecordAdminVo> page = page(recordStatus, erbanNo, accountType, applyStartTime, applyEndTime, req);
List<WithdrawUserRecordAdminVo> records = page.getRecords();
if (CollectionUtil.isNotEmpty(records)) {
for (WithdrawUserRecordAdminVo record : records) {
Integer blockStatus = record.getBlockStatus();
Date createTime = record.getCreateTime();
BigDecimal handlingRate = record.getHandlingRate();
WithdrawUserRecordAdminDto admin = new WithdrawUserRecordAdminDto();
BeanUtils.copyProperties(record, admin);
String blockStatusName = "正常";
if (blockStatus != null) {
if (blockStatus.equals(BlockStatusEnum.BLOCKING.getValue())) {
blockStatusName = "封禁";
}
}
admin.setBlockStatusName(blockStatusName);
if (createTime != null) {
admin.setCreateTimeStr(DateFormatUtils.format(createTime, DatePattern.NORM_DATETIME_PATTERN));
}
admin.setHandlingRateStr(handlingRate + "%");
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(), WithdrawUserRecordAdminDto.class).sheet("提现申请").doWrite(datas);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
}
@Override
public BigDecimal totalAmount(Integer recordStatus, String erbanNo, Integer accountType, Date applyStartTime, Date applyEndTime) {
PageReq req = new PageReq();
req.setPage(-1);
req.setPageSize(-1);
Page<WithdrawUserRecordAdminVo> page = page(recordStatus, erbanNo, accountType, applyStartTime, applyEndTime, req);
List<WithdrawUserRecordAdminVo> records = page.getRecords();
BigDecimal total = BigDecimal.ZERO;
if (CollectionUtil.isNotEmpty(records)) {
for (WithdrawUserRecordAdminVo record : records) {
BigDecimal cashAmount = record.getCashAmount();
if (cashAmount != null) {
total = total.add(cashAmount);
}
}
}
return total.setScale(3, RoundingMode.HALF_UP);
}
@Override
public void batchGrant(String recordIdStr, Integer isSecretary, Integer adminId) {
if (StrUtil.isEmpty(recordIdStr)) {
return;
}
log.info("recordIdStr : {}", recordIdStr);
String[] recordIdArray = recordIdStr.split(StrUtil.COMMA);
for (String idStr : recordIdArray) {
grant(Long.valueOf(idStr), isSecretary, adminId);
}
}
@Transactional(rollbackFor = Exception.class)
@Override
public void reject(Long id, Integer isReturn, Integer isSecretary, Integer adminId) {
if (id == null) {
throw new ServiceException("缺少ID");
}
log.info("reject id : {}, isReturn : {}, isSecretary : {}, adminId : {}", id, isReturn, isSecretary, adminId);
WithdrawUserRecord record = withdrawUserRecordService.getById(id);
if (record == null) {
return;
}
LocalDateTime now = LocalDateTime.now();
withdrawUserRecordService.update(Wrappers.<WithdrawUserRecord>lambdaUpdate()
.set(WithdrawUserRecord::getOperatorId, adminId)
.set(WithdrawUserRecord::getUpdateTime, now)
.set(WithdrawUserRecord::getRecordStatus, RecordStatusEnum.REJECT.ordinal())
.eq(WithdrawUserRecord::getId, id));
if (isReturn != null && isReturn == Constant.Yes1No0.YES) {
Long uid = record.getUid();
Integer goldNum = record.getGoldNum();
log.info("[金币提现退回] {} 提现金币数 {} 开始", uid, goldNum);
//扣减钱包
userPurseService.addGold(uid, goldNum.doubleValue(), BillObjTypeEnum.REJECT_WITHDRAW,
(userPurse)-> billRecordService.insertGeneralBillRecord(uid, record.getId().toString(), BillObjTypeEnum.REJECT_WITHDRAW, goldNum.doubleValue(), userPurse));
log.info("[金币提现退回] {} 提现金币数 {} 成功", uid, goldNum);
}
if (isSecretary != null && isSecretary == Constant.Yes1No0.YES) {
String currentTime = DateTimeUtil.getCurrentTime();
String message = "尊敬的用戶您好,您於【" + currentTime + "】發起的提領由於綁定的賬戶異常導致發放失敗請修正為正確的賬戶如有問題請聯繫官方客服wechatsd245376或linepekoyuyin";
NeteaseSendMsgBatchParam param = new NeteaseSendMsgBatchParam();
param.setType(0);
param.setContent(message);
sendSysMsgService.sendBatchPersonTextMsg(SystemConfig.secretaryUid, Collections.singletonList(record.getUid()), null, message, param);
}
}
@Transactional(rollbackFor = Exception.class)
@Override
public void batchReject(String recordIdStr, Integer isReturn, Integer isSecretary, Integer adminId) {
if (StrUtil.isEmpty(recordIdStr)) {
return;
}
log.info("recordIdStr : {}", recordIdStr);
String[] recordIdArray = recordIdStr.split(StrUtil.COMMA);
for (String idStr : recordIdArray) {
reject(Long.valueOf(idStr), isReturn, isSecretary, adminId);
}
}
}

View File

@@ -1,121 +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.callbattle.ActCallBattleAdminMapper">
<resultMap id="actCallBattlePlatformStatVo" type="com.accompany.admin.vo.callbattle.ActCallBattlePlatformStatVo">
<result column="queryDate" property="queryDate" jdbcType="TIMESTAMP"/>
<result column="memberNum" property="memberNum" jdbcType="INTEGER"/>
<result column="totalPlayTimes" property="totalPlayTimes" jdbcType="INTEGER"/>
<result column="roundNum" property="roundNum" jdbcType="INTEGER"/>
<result column="totalPiece" property="totalPiece" jdbcType="BIGINT"/>
<result column="totalPlatformValue" property="totalPlatformValue" jdbcType="BIGINT"/>
<result column="totalTicket" property="totalTicket" jdbcType="DOUBLE"/>
</resultMap>
<select id="listPlatformStat" resultMap="actCallBattlePlatformStatVo">
SELECT t1.* , t2.* FROM
(SELECT DATE(a.start_time)queryDate,
count(DISTINCT a.round_id, a.round_id)roundNum,
COUNT(DISTINCT r.uid,r.uid) memberNum,
IFNULL(SUM(r.cost_piece_num),0) totalPiece,
count(r.uid) totalPlayTimes,
IFNULL(SUM(IF(r.draw_status = 1, r.cost_piece_num * r.item_multiple,0)),0) totalPlatformValue
FROM act_call_battle_info a LEFT JOIN act_call_battle_draw_record r on a.round_id = r.round_id
GROUP BY DATE(a.start_time)) t1, (SELECT DATE(start_time) queryDate2, IFNULL(sum(ticket),0) totalTicket from act_call_battle_info GROUP BY DATE(start_time)) t2
where t1.queryDate = t2.queryDate2
<if test="startTime != null and startTime != ''">
and t1.queryDate >= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and t1.queryDate &lt; #{endTime}
</if>
</select>
<resultMap id="actCallBattleAdminUserDrawRecord" type="com.accompany.admin.vo.callbattle.ActCallBattleAdminUserDrawRecord">
<result column="uid" property="uid" jdbcType="BIGINT"/>
<result column="erban_no" property="erbanNo" jdbcType="BIGINT"/>
<result column="nick" property="nick" jdbcType="VARCHAR"/>
<result column="roundId" property="roundId" jdbcType="VARCHAR"/>
<result column="endTime" property="endTime" jdbcType="TIMESTAMP"/>
<result column="cost_piece_num" property="costPieceNum" jdbcType="BIGINT"/>
<result column="prizePieceNum" property="prizePieceNum" jdbcType="BIGINT"/>
</resultMap>
<select id="listUserDrawRecord" resultMap="actCallBattleAdminUserDrawRecord">
SELECT u.uid, u.erban_no, u.nick, l.round_id roundId, a.end_time endTime,
(l.cost_piece_num ) cost_piece_num,
IF(l.draw_status = 1,draw_multiple * cost_piece_num ,0) prizePieceNum
FROM act_call_battle_draw_record l, users u, act_call_battle_info a
where l.uid = u.uid
and l.round_id = a.round_id
<if test="startTime != null and startTime != ''">
and a.end_time >= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and a.end_time &lt; #{endTime}
</if>
<if test="erbanNoList != null and erbanNoList.size() > 0">
and u.erban_no in
<foreach collection="erbanNoList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
ORDER BY a.end_time DESC
</select>
<resultMap id="actCallBattleAdminRecordVo" type="com.accompany.admin.vo.callbattle.ActCallBattleAdminRecordVo">
<result column="round_id" property="roundId" jdbcType="VARCHAR"/>
<result column="start_time" property="startTime" jdbcType="TIMESTAMP"/>
<result column="end_time" property="endTime" jdbcType="TIMESTAMP"/>
<result column="memberNum" property="memberNum" jdbcType="INTEGER"/>
<result column="userInputPieceNum" property="userInputPieceNum" jdbcType="BIGINT"/>
<result column="prizePieceNum" property="prizePieceNum" jdbcType="BIGINT"/>
<result column="ticket" property="ticket" jdbcType="DOUBLE"/>
<result column="prizeName" property="prizeName" jdbcType="VARCHAR"/>
<result column="restraintName" property="restraintName" jdbcType="VARCHAR"/>
</resultMap>
<select id="listActRecord" resultMap="actCallBattleAdminRecordVo">
SELECT a.round_id, a.start_time, a.end_time,
COUNT(DISTINCT r.uid, r.uid) memberNum,
IFNULL(SUM(r.cost_piece_num ),0) userInputPieceNum,
IFNULL(SUM(IF(r.draw_status = 1, r.cost_piece_num * r.item_multiple ,0)),0) prizePieceNum,
IFNULL(a.ticket,0) ticket,
a.draw_name prizeName,
a.draw_restraint_name restraintName
from act_call_battle_info a LEFT JOIN act_call_battle_draw_record r ON a.round_id = r.round_id
where 1= 1
<if test="roundId != null and roundId !='' ">
and a.round_id = #{roundId}
</if>
<if test="startTime != null and startTime != '' ">
and a.start_time >= #{startTime}
</if>
<if test="endTime != null and endTime != '' ">
and a.start_time &lt; #{endTime}
</if>
GROUP BY a.round_id
ORDER BY a.start_time DESC
</select>
<resultMap id="actCallBattleAdminRoundDetailVo" type="com.accompany.admin.vo.callbattle.ActCallBattleAdminRoundDetailVo">
<result column="uid" property="uid" jdbcType="BIGINT"/>
<result column="erban_no" property="erbanNo" jdbcType="BIGINT"/>
<result column="nick" property="nick" jdbcType="VARCHAR"/>
<result column="costPieceNum" property="costPieceNum" jdbcType="BIGINT"/>
<result column="prizePieceNum" property="prizePieceNum" jdbcType="BIGINT"/>
</resultMap>
<select id="listRoundDrawDetail" resultMap="actCallBattleAdminRoundDetailVo">
SELECT u.uid, u.erban_no, u.nick,
SUM(l.cost_piece_num ) costPieceNum,
SUM(IF(l.draw_status = 1,l.item_multiple * l.cost_piece_num ,0)) prizePieceNum
from act_call_battle_draw_record l, users u
where l.round_id = #{roundId}
and u.uid = l.uid
GROUP BY l.uid
</select>
</mapper>

View File

@@ -1,244 +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.AdminDictMapper" >
<resultMap id="BaseResultMap" type="com.accompany.admin.model.AdminDict" >
<id column="code" property="code" jdbcType="VARCHAR" />
<id column="dictkey" property="dictkey" jdbcType="VARCHAR" />
<result column="dictval" property="dictval" jdbcType="VARCHAR" />
<result column="status" property="status" jdbcType="BIT" />
<result column="showOrder" property="showorder" jdbcType="INTEGER" />
<result column="createTime" property="createtime" jdbcType="TIMESTAMP" />
<result column="description" property="description" jdbcType="VARCHAR" />
</resultMap>
<sql id="Example_Where_Clause" >
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause" >
<where >
<foreach collection="example.oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
code, dictkey, dictval, status, showOrder, createTime, description
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.accompany.admin.model.AdminDictExample" >
select
<if test="distinct" >
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from admin_dict
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="com.accompany.admin.model.AdminDictKey" >
select
<include refid="Base_Column_List" />
from admin_dict
where code = #{code,jdbcType=VARCHAR}
and dictkey = #{dictkey,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="com.accompany.admin.model.AdminDictKey" >
delete from admin_dict
where code = #{code,jdbcType=VARCHAR}
and dictkey = #{dictkey,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.accompany.admin.model.AdminDictExample" >
delete from admin_dict
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.accompany.admin.model.AdminDict" >
insert into admin_dict (code, dictkey, dictval,
status, showOrder, createTime,
description)
values (#{code,jdbcType=VARCHAR}, #{dictkey,jdbcType=VARCHAR}, #{dictval,jdbcType=VARCHAR},
#{status,jdbcType=BIT}, #{showorder,jdbcType=INTEGER}, #{createtime,jdbcType=TIMESTAMP},
#{description,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.accompany.admin.model.AdminDict" >
insert into admin_dict
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="code != null" >
code,
</if>
<if test="dictkey != null" >
dictkey,
</if>
<if test="dictval != null" >
dictval,
</if>
<if test="status != null" >
status,
</if>
<if test="showorder != null" >
showOrder,
</if>
<if test="createtime != null" >
createTime,
</if>
<if test="description != null" >
description,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="code != null" >
#{code,jdbcType=VARCHAR},
</if>
<if test="dictkey != null" >
#{dictkey,jdbcType=VARCHAR},
</if>
<if test="dictval != null" >
#{dictval,jdbcType=VARCHAR},
</if>
<if test="status != null" >
#{status,jdbcType=BIT},
</if>
<if test="showorder != null" >
#{showorder,jdbcType=INTEGER},
</if>
<if test="createtime != null" >
#{createtime,jdbcType=TIMESTAMP},
</if>
<if test="description != null" >
#{description,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.accompany.admin.model.AdminDictExample" resultType="java.lang.Integer" >
select count(*) from admin_dict
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update admin_dict
<set >
<if test="record.code != null" >
code = #{record.code,jdbcType=VARCHAR},
</if>
<if test="record.dictkey != null" >
dictkey = #{record.dictkey,jdbcType=VARCHAR},
</if>
<if test="record.dictval != null" >
dictval = #{record.dictval,jdbcType=VARCHAR},
</if>
<if test="record.status != null" >
status = #{record.status,jdbcType=BIT},
</if>
<if test="record.showorder != null" >
showOrder = #{record.showorder,jdbcType=INTEGER},
</if>
<if test="record.createtime != null" >
createTime = #{record.createtime,jdbcType=TIMESTAMP},
</if>
<if test="record.description != null" >
description = #{record.description,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
update admin_dict
set code = #{record.code,jdbcType=VARCHAR},
dictkey = #{record.dictkey,jdbcType=VARCHAR},
dictval = #{record.dictval,jdbcType=VARCHAR},
status = #{record.status,jdbcType=BIT},
showOrder = #{record.showorder,jdbcType=INTEGER},
createTime = #{record.createtime,jdbcType=TIMESTAMP},
description = #{record.description,jdbcType=VARCHAR}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.accompany.admin.model.AdminDict" >
update admin_dict
<set >
<if test="dictval != null" >
dictval = #{dictval,jdbcType=VARCHAR},
</if>
<if test="status != null" >
status = #{status,jdbcType=BIT},
</if>
<if test="showorder != null" >
showOrder = #{showorder,jdbcType=INTEGER},
</if>
<if test="createtime != null" >
createTime = #{createtime,jdbcType=TIMESTAMP},
</if>
<if test="description != null" >
description = #{description,jdbcType=VARCHAR},
</if>
</set>
where code = #{code,jdbcType=VARCHAR}
and dictkey = #{dictkey,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.accompany.admin.model.AdminDict" >
update admin_dict
set dictval = #{dictval,jdbcType=VARCHAR},
status = #{status,jdbcType=BIT},
showOrder = #{showorder,jdbcType=INTEGER},
createTime = #{createtime,jdbcType=TIMESTAMP},
description = #{description,jdbcType=VARCHAR}
where code = #{code,jdbcType=VARCHAR}
and dictkey = #{dictkey,jdbcType=VARCHAR}
</update>
</mapper>

View File

@@ -1,288 +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.batch.FlowDataBatchSearchAdminMapper">
<select id="getTimeUv" resultType="java.lang.Integer">
select count(*) from users where create_time between #{startTime} and #{endTime}
</select>
<select id="getAscribeTimeUv" resultType="java.lang.Integer">
select
count(distinct u.uid)
from users as u
left join room_search_log as rsl on rsl.uid = u.uid
where rsl.search_type = 1 and rsl.search_key = #{searchKey}
and rsl.create_time between #{startTime} and #{endTime}
and u.create_time between #{startTime} and #{endTime}
</select>
<select id="getInRoomUv" resultType="java.lang.Integer">
select
count(distinct u.uid)
from users as u
left join room_search_log as rsl on rsl.uid = u.uid
left join users as r on r.uid = #{roomUid}
left join user_in_room_record as uirr on uirr.uid = u.uid and r.uid = uirr.roomUid
where rsl.search_type = 1 and rsl.search_key = #{searchKey}
and rsl.result_uids like concat('%', #{roomUid}, '%')
and rsl.create_time between #{startTime} and #{endTime}
and u.create_time between #{startTime} and #{endTime}
and uirr.create_time between #{startTime} and #{endTime}
</select>
<select id="getChatNum" resultType="java.lang.Integer">
select
count(distinct u.uid)
from users as u
left join room_search_log as rsl on rsl.uid = u.uid
where rsl.search_type = 1 and rsl.search_key = #{searchKey}
and rsl.create_time between #{startTime} and #{endTime}
and u.create_time between #{startTime} and #{endTime}
and u.uid in (
<foreach collection="yearMonths" item="yearMonth" separator="union all">
select
if(ucmr.from_uid = u.uid, ucmr.from_uid, ucmr.to_uid) as from_uid
from user_chat_msg_record_${yearMonth} as ucmr
left join users as u on u.uid = ucmr.from_uid
where ucmr.create_time between #{startTime} and #{endTime}
and (ucmr.from_uid = u.uid or ucmr.to_uid = u.uid)
</foreach>
)
</select>
<select id="getChargeUv" resultType="java.lang.Double">
select
count(distinct cr.uid)
from charge_record as cr
where cr.charge_status in (2,6)
and cr.uid in (
select
distinct u.uid
from users as u
left join room_search_log as rsl on rsl.uid = u.uid
where rsl.search_type = 1 and rsl.search_key = #{searchKey}
and rsl.create_time between #{startTime} and #{endTime}
and u.create_time between #{startTime} and #{endTime}
) and cr.create_time between #{searchStartTime} and #{searchEndTime}
</select>
<select id="getGiveUv" resultType="java.lang.Double">
select
count(distinct dgh.to_uid)
from diamond_give_history as dgh
where dgh.to_uid in (
select
distinct u.uid
from users as u
left join room_search_log as rsl on rsl.uid = u.uid
where rsl.search_type = 1 and rsl.search_key = #{searchKey}
and rsl.create_time between #{startTime} and #{endTime}
and u.create_time between #{startTime} and #{endTime}
) and dgh.create_time between #{searchStartTime} and #{searchEndTime}
</select>
<select id="getPayUv" resultType="java.lang.Double">
select
count(distinct u.uid)
from
(
select
distinct cr.uid as uid
from charge_record as cr
where cr.charge_status in (2,6) and cr.uid in (
select
distinct u.uid
from users as u
left join room_search_log as rsl on rsl.uid = u.uid
where rsl.search_type = 1 and rsl.search_key = #{searchKey}
and rsl.create_time between #{startTime} and #{endTime}
and u.create_time between #{startTime} and #{endTime}
) and cr.create_time between #{searchStartTime} and #{searchEndTime}
union all
select
distinct dgh.to_uid as uid
from diamond_give_history as dgh
where dgh.to_uid in (
select
distinct u.uid
from users as u
left join room_search_log as rsl on rsl.uid = u.uid
where rsl.search_type = 1 and rsl.search_key = #{searchKey}
and rsl.create_time between #{startTime} and #{endTime}
and u.create_time between #{startTime} and #{endTime}
) and dgh.create_time between #{searchStartTime} and #{searchEndTime}
) as u
</select>
<select id="getChargeAmount" resultType="java.lang.Double">
select
ifnull((sum(ifnull(cr.amount, 0)) / 100), 0) as chargeAmount
from charge_record as cr
where cr.charge_status in (2,6)
and cr.uid in (
select
distinct u.uid
from users as u
left join room_search_log as rsl on rsl.uid = u.uid
where rsl.search_type = 1 and rsl.search_key = #{searchKey}
and rsl.create_time between #{startTime} and #{endTime}
and u.create_time between #{startTime} and #{endTime}
) and cr.create_time between #{searchStartTime} and #{searchEndTime}
</select>
<select id="getGiveAmount" resultType="java.lang.Double">
select
ifnull((sum(ifnull(dgh.diamond_num, 0)) / 1000), 0) as giveAmount
from diamond_give_history as dgh
where dgh.to_uid in (
select
distinct u.uid
from users as u
left join room_search_log as rsl on rsl.uid = u.uid
where rsl.search_type = 1 and rsl.search_key = #{searchKey}
and rsl.create_time between #{startTime} and #{endTime}
and u.create_time between #{startTime} and #{endTime}
) and dgh.create_time between #{searchStartTime} and #{searchEndTime}
</select>
<select id="getRemainCount" resultType="java.lang.Double">
select
sum(u.is_remain)
from (
select
if(ifnull(alr.record_id, 0) != 0, 1, 0) as is_remain
from users as u
left join account_login_record as alr on alr.uid = u.uid
<if test="remainDay != null and remainDay != -1">
and date_format(date_add(u.create_time, INTERVAL ${remainDay} DAY), '%Y-%m-%d') = date_format(alr.create_time, '%Y-%m-%d')
</if>
<if test="remainDay != null and remainDay == -1">
and date_format(now(), '%Y-%m-%d') = date_format(alr.create_time, '%Y-%m-%d')
</if>
where
u.create_time between #{startTime} and #{endTime}
and u.uid in (
select
distinct u1.uid
from users as u1
left join room_search_log as rsl on rsl.uid = u1.uid
where rsl.search_type = 1 and rsl.search_key = #{searchKey}
and rsl.create_time between #{startTime} and #{endTime}
and u1.create_time between #{startTime} and #{endTime}
)
group by u.uid
) as u
</select>
<select id="getUserDetail" resultType="com.accompany.admin.dto.batch.FlowDataBatchSearchDetailAdminDto">
select
date_format(u.create_time, '%Y-%m-%d %H:%i:%s') as signUpTimeStr,
u.erban_no as erBanNo,
u.nick,
u.device_id as deviceId
from users as u
where u.create_time between #{startTime} and #{endTime}
and u.uid in (
select rsl.uid from room_search_log as rsl
where rsl.search_type = 1 and rsl.search_key = #{searchKey}
and rsl.create_time between #{startTime} and #{endTime}
)
</select>
<select id="getDevice" resultType="com.accompany.admin.dto.batch.FlowDataBatchSearchDetailAdminDto">
select
u.device_id as deviceId,
if(count(1) > 1, '否', '是') as isNewDevice
from users as u
where u.device_id is not null
<if test="erBanNos != null and erBanNos.size > 0">
and u.erban_no in
<foreach collection="erBanNos" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
group by u.device_id
</select>
<select id="getInRoom" resultType="com.accompany.admin.dto.batch.FlowDataBatchSearchDetailAdminDto">
select
u.erban_no as erBanNo,
if(count(1) >= 1, '是', '否') as isInRoomStr
from user_in_room_record as uirr
left join users as u on u.uid = uirr.uid and u.create_time between #{startTime} and #{endTime}
where uirr.roomUid = #{roomUid}
<if test="erBanNos != null and erBanNos.size > 0">
and u.erban_no in
<foreach collection="erBanNos" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
and uirr.create_time between #{startTime} and #{endTime}
group by uirr.uid
</select>
<select id="getChatCount" resultType="java.lang.Integer">
select
sum(u.chatCount)
from
(
<foreach collection="yearMonths" item="yearMonth" separator="union all">
select
count(1) as chatCount
from user_chat_msg_record_${yearMonth} as ucmr
where ucmr.create_time between #{startTime} and #{endTime}
and (ucmr.from_uid = #{uid} or ucmr.to_uid = #{uid})
</foreach>
) as u
</select>
<select id="getChargeAmountList" resultType="com.accompany.admin.dto.batch.FlowDataBatchSearchDetailAdminDto">
select
u.erban_no as erBanNo,
(sum(cr.amount) / 100) as chargeAmount
from charge_record as cr
left join users as u on u.uid = cr.uid
where cr.charge_status in (2,6)
and cr.create_time between #{startTime} and #{endTime}
<if test="erBanNos != null and erBanNos.size > 0">
and u.erban_no in
<foreach collection="erBanNos" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
group by cr.uid
</select>
<select id="getGiveAmountList" resultType="com.accompany.admin.dto.batch.FlowDataBatchSearchDetailAdminDto">
select
u.erban_no as erBanNo,
sum(dgh.diamond_num) as giveDiamondNum
from diamond_give_history as dgh
left join users as u on u.uid = dgh.to_uid
where dgh.create_time between #{startTime} and #{endTime}
<if test="erBanNos != null and erBanNos.size > 0">
and u.erban_no in
<foreach collection="erBanNos" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
group by dgh.to_uid
</select>
<select id="getRemainCountList" resultType="com.accompany.admin.dto.batch.FlowDataBatchSearchDetailAdminDto">
select
u.erban_no as erBanNo,
if(ifnull(alr.record_id, 0) != 0, 1, 0) as isRemain
from users as u
left join account_login_record as alr on alr.uid = u.uid
and date_format(date_add(u.create_time, INTERVAL ${remainDay} DAY), '%Y-%m-%d') = date_format(alr.create_time, '%Y-%m-%d')
where
u.create_time between #{startTime} and #{endTime}
<if test="erBanNos != null and erBanNos.size > 0">
and u.erban_no in
<foreach collection="erBanNos" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
group by u.uid
</select>
</mapper>

View File

@@ -1,4 +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.batch.FlowDataBatchSearchMapper">
</mapper>

View File

@@ -1,99 +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.gamepartner.GamePartnerOrderAdminMapper">
<select id="orderPage" resultType="com.accompany.business.vo.gamepartner.GamePartnerOrderVo">
select
gpo.id,
gpo.order_no as orderNo,
gpo.from_uid as fromUid,
gpo.to_uid as toUid,
gpo.game_id as gameId,
gpo.inning,
gpo.price,
gpo.amount,
gpo.income,
gpo.`status`,
gpo.create_time as createTime,
gpo.update_time as updateTime,
u1.erban_no as fromErBanNo,
u1.nick as fromNick,
u1.avatar as fromAvatar,
u2.erban_no as toErBanNo,
u2.nick as toNick,
u2.avatar as toAvatar,
gpi.logo as gameLogo,
gpi.game_name as gameName,
date_format(gpo.create_time, '%Y-%m-%d %H:%i:%S') as orderTime
from game_partner_order as gpo
left join users as u1 on u1.uid = gpo.from_uid
left join users as u2 on u2.uid = gpo.to_uid
left join game_partner_info as gpi on gpi.game_id = gpo.game_id
<where>
<if test="fromErBanNo != null and fromErBanNo != ''">
and u1.erban_no like concat('%', #{fromErBanNo}, '%')
</if>
<if test="toErBanNo != null and toErBanNo != ''">
and u2.erban_no like concat('%', #{toErBanNo}, '%')
</if>
<if test="gameId != null">
and gpo.game_id = #{gameId}
</if>
<if test="orderNo != null and orderNo != ''">
and gpo.order_no = #{orderNo}
</if>
<if test="startTime != null and startTime != ''">
and gpo.create_time >= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and gpo.create_time <![CDATA[<=]]> #{endTime}
</if>
</where>
order by gpo.create_time desc
</select>
<select id="dayPage" resultType="com.accompany.admin.vo.gamepartner.GamePartnerOrderDayAdminVo">
select
date_format(gpo.create_time, '%Y-%m-%d') as orderTime,
count(distinct gpo.from_uid) as orderNum,
sum(gpo.inning) as totalInning,
count(1) as orderCount,
sum(gpo.amount) as totalAmount
from game_partner_order as gpo
<where>
<if test="startTime != null and startTime != ''">
and date_format(gpo.create_time, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d')
</if>
<if test="endTime != null and endTime != ''">
and date_format(gpo.create_time, '%Y-%m-%d') <![CDATA[<=]]> date_format(#{endTime}, '%Y-%m-%d')
</if>
</where>
group by orderTime
order by orderTime desc
</select>
<select id="dayDetailPage" resultType="com.accompany.admin.vo.gamepartner.GamePartnerOrderDayDetailAdminVo">
select
u1.erban_no as fromErBanNo,
u1.nick as fromNick,
u2.erban_no as toErBanNo,
u2.nick as toNick,
gpi.game_name as gameName,
u3.erban_no as hallErBanNo,
r.title as hallRoomName,
gpo.amount,
date_format(gpo.create_time, '%Y-%m-%d %H:%i:%S') as orderTime
from game_partner_order as gpo
left join users as u1 on u1.uid = gpo.from_uid
left join users as u2 on u2.uid = gpo.to_uid
left join game_partner_info as gpi on gpi.game_id = gpo.game_id
left join hall_member as hm on hm.uid = u2.uid and hm.`status` = 1
left join hall as h on h.id = hm.hall_id and h.`status` = 1
left join room as r on r.uid = h.owner_uid
left join users as u3 on u3.uid = r.uid
<where>
<if test="orderDate != null and orderDate != ''">
and date_format(gpo.create_time, '%Y-%m-%d') = date_format(#{orderDate}, '%Y-%m-%d')
</if>
</where>
order by gpo.create_time desc
</select>
</mapper>

Some files were not shown because too many files have changed in this diff Show More