Compare commits
298 Commits
feature/20
...
83f083242e
Author | SHA1 | Date | |
---|---|---|---|
83f083242e | |||
708c96092b | |||
07e09ae405 | |||
b7fe71661b | |||
18c449a55c | |||
ea67975ce9 | |||
7b37a423d8 | |||
b8f9b63c14 | |||
8791d647ee | |||
230f81fd98 | |||
4564cfbbf2 | |||
3ebfa34e88 | |||
bccd82f021 | |||
b4a3e3f37a | |||
7819a92f27 | |||
4184e3210c | |||
89bea63b86 | |||
d4c256c522 | |||
37fc0a79c3 | |||
a788956f90 | |||
c19589c674 | |||
c22cb3e2a5 | |||
5b03031cdb | |||
bb8d6a75a6 | |||
532b9ede0c | |||
d49b215522 | |||
fd98d87aa4 | |||
1de27e6cd0 | |||
8db6d82c4a | |||
cb5040c1fc | |||
334635fb4a | |||
9cf6b05473 | |||
109e8a1148 | |||
ec51e1f36d | |||
25f6c3311e | |||
89d5c46407 | |||
a152f3b03f | |||
5c53180fbd | |||
d2e2654ecf | |||
c8961081d3 | |||
68ea614405 | |||
e66803cdaf | |||
0563963c64 | |||
305b77fa25 | |||
3d2e6d9cfd | |||
1226992c78 | |||
5042b17c79 | |||
e3862d4a82 | |||
37a4ded3c8 | |||
b3f84a4402 | |||
56bf486adf | |||
dc1f9ade6d | |||
481b034b3b | |||
14b1c2d28e | |||
72a5829b58 | |||
103b463078 | |||
bc30048c64 | |||
b208651ed3 | |||
d5baf49fe3 | |||
ff0ecfce6e | |||
ec53df66c6 | |||
b24fa952cf | |||
5dc7fe6bf0 | |||
d8a5f54f03 | |||
99922e8630 | |||
75d3bca541 | |||
ff07d21e02 | |||
4f3ddab6f7 | |||
5118107ead | |||
e4e60e999f | |||
c8315fcfa7 | |||
23836f8dc3 | |||
878576d5fe | |||
d63fcbc9b1 | |||
683d040eb8 | |||
19df12bf2a | |||
2aaa87dd9d | |||
ae30f4fc01 | |||
8a70f0fc74 | |||
43e71cffb0 | |||
db5c90ea63 | |||
87dc61ae91 | |||
49a6a58ab7 | |||
82fe4f4c1c | |||
c98ffef5ae | |||
309d6132e6 | |||
58aeb8485d | |||
14ef00e5d9 | |||
9573275843 | |||
c7f1b164e0 | |||
20bbbc6334 | |||
8b2fbc1b96 | |||
5c7035591c | |||
963dc072d1 | |||
70ce45adac | |||
2c0c809871 | |||
8cbad22cdf | |||
8de692ce1c | |||
154fb35ea3 | |||
5d2608bdfe | |||
6030c9b2e0 | |||
1b8fd5809f | |||
4610632a4d | |||
1b9e5a6e97 | |||
e57ecad216 | |||
32c3616052 | |||
9c2aed50e0 | |||
36708c0a4b | |||
711c4fccc5 | |||
e65236de28 | |||
0e989dbb22 | |||
1ece3f668f | |||
abb0b2e9f3 | |||
e010b2e824 | |||
fe5120740b | |||
c8442b06d4 | |||
1d77171763 | |||
643103531e | |||
53f93c04a0 | |||
faa924328b | |||
e7f9939dd8 | |||
8efd6bbdae | |||
1fc9390014 | |||
ff3893a029 | |||
bddcb51404 | |||
723b1c57d8 | |||
ec423e930a | |||
2fb4f445cc | |||
d359a33319 | |||
9411ace176 | |||
ac45026e88 | |||
79ffb83481 | |||
7a47adbbc3 | |||
![]() |
f36b17ee46 | ||
e433b4dfde | |||
8873022807 | |||
6d93e929fb | |||
3c141b03bd | |||
4fe4c7f809 | |||
d9a738ecdc | |||
b6f39a5fbb | |||
4d8d6ef945 | |||
c28a93e0c3 | |||
187059a3ce | |||
3d304e0d73 | |||
64eb667638 | |||
fec55f903f | |||
7d0a978c40 | |||
db41be407d | |||
158c9786e4 | |||
e027c783e6 | |||
f43ab72757 | |||
2b2c615b28 | |||
5562bbafc6 | |||
26467ee2df | |||
ee7fd3ae29 | |||
b9cee71c31 | |||
c947bb1256 | |||
e520926097 | |||
27e72bf8ec | |||
d2f00bb7f8 | |||
7f54afc166 | |||
fffe747456 | |||
93a4a6bb97 | |||
15b0134c0a | |||
![]() |
95b93c7d08 | ||
![]() |
36a1bed313 | ||
a15559c89a | |||
54f2fe4f7d | |||
57ad350ca7 | |||
8f4b511813 | |||
3bfd4d4694 | |||
8103dd0fbb | |||
e70fe58beb | |||
07f7ff281e | |||
efc5789557 | |||
3843d5f443 | |||
0f612c1fee | |||
c055ce34f3 | |||
22cc5bcd78 | |||
ff9ac36cb5 | |||
0cd1c010c5 | |||
0e67b34133 | |||
c018c64d6a | |||
ddaa15e7f5 | |||
6aec5657e6 | |||
d53a574fba | |||
e8313d0e1e | |||
937429eed0 | |||
e16a6ad65a | |||
efd6503229 | |||
0a3b7ae1e0 | |||
fdfee7a543 | |||
6d905178d3 | |||
46563a758a | |||
1c6062cd6d | |||
7dd8568110 | |||
ac4096bf61 | |||
0686d61029 | |||
19fed0ff2a | |||
58e0d121bb | |||
543a7b8ad6 | |||
02f183d8ba | |||
800b0cf1dd | |||
d3677bb8c4 | |||
2ecc60a88d | |||
4364974176 | |||
43716719f3 | |||
83be77b688 | |||
a2515ad7a9 | |||
9057a22bdc | |||
4c4d720404 | |||
0aa971bb9d | |||
272111e246 | |||
eae1a021af | |||
3400ee2e41 | |||
e92feb8728 | |||
1205ba59a3 | |||
c9c35639e7 | |||
0e3615b252 | |||
0fa01562cb | |||
45a8199a64 | |||
0f778f78fa | |||
3c0fbae36e | |||
aa1b93cb8b | |||
88dd96c605 | |||
124b3e47c1 | |||
c0fef64f12 | |||
14d61bd46e | |||
cf5ccb33e1 | |||
254e876d50 | |||
1e402cdbed | |||
b7e2e2c590 | |||
f2d56a7e48 | |||
1a12722bdf | |||
79b957f3fb | |||
0165dd10ee | |||
8bab25c084 | |||
0180e27f53 | |||
8f572701ab | |||
2831797f51 | |||
fc5105c0cb | |||
a869b3846d | |||
5b4f0efe2e | |||
3eb4c280b0 | |||
ac980ac0f8 | |||
abbeab333b | |||
fd62c2a88d | |||
a565d0803d | |||
4c274489d4 | |||
3fb754a359 | |||
b74b467cf7 | |||
392c25119b | |||
87497109ff | |||
324711f35a | |||
ad241e3f83 | |||
72a0752cf6 | |||
bbc1b911e1 | |||
113dd31983 | |||
fc0806233b | |||
ec02c04451 | |||
f5fc0de086 | |||
98ffd02b94 | |||
b43380bbf7 | |||
8da2b3a91e | |||
3c78ec1efd | |||
70887963fa | |||
440a2cc46b | |||
f6e42005fc | |||
40a49976f5 | |||
2ab0cab74d | |||
b0393b40d7 | |||
b1490d32e1 | |||
f921859138 | |||
d509e2a589 | |||
acc7bf1402 | |||
ac2c8050df | |||
02bea7d9c5 | |||
b6b7ce920c | |||
2e24686939 | |||
13cab0f9d6 | |||
457f6a750f | |||
b258e18ef7 | |||
e6582b0e57 | |||
37838aa909 | |||
f37f652aa5 | |||
d26cd0996c | |||
0bb8700959 | |||
e79b44a5ca | |||
c161422b32 | |||
b81d267f14 | |||
e832871488 | |||
cae4550e96 | |||
69b3a5f465 | |||
cf7304f2cb | |||
1f6795b049 | |||
f63c16d680 | |||
46888c5579 |
@@ -71,6 +71,10 @@ public class ChargeRecordAdminVo {
|
||||
@FieldComment("创建时间")
|
||||
public String createTime; // 创建时间
|
||||
|
||||
@ExcelProperty("更新时间")
|
||||
@FieldComment("更新时间")
|
||||
public String updateTime; // 创建时间
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@@ -0,0 +1,16 @@
|
||||
package com.accompany.admin.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class ChargeRecordPartitionRegionVo {
|
||||
|
||||
private String channel;
|
||||
public String regionName;
|
||||
public BigDecimal usd = BigDecimal.ZERO;
|
||||
|
||||
}
|
||||
|
||||
|
@@ -2,38 +2,64 @@ package com.accompany.admin.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@ApiModel("家族成员周等级奖励统计")
|
||||
public class FamilyMemberWeekLevelRewardStatAdminVo {
|
||||
|
||||
@ExcelProperty("周期")
|
||||
@ApiModelProperty("周期")
|
||||
private String cycleDate;
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("家族成员ID")
|
||||
private Long familyMemberId;
|
||||
@ExcelProperty("公会id")
|
||||
@ApiModelProperty("公会ID")
|
||||
private Integer familyId;
|
||||
@ExcelProperty("公会名")
|
||||
@ApiModelProperty("公会名称")
|
||||
private String familyName;
|
||||
@ExcelProperty("会长id")
|
||||
@ApiModelProperty("会长ID")
|
||||
private Long familyOwnerId;
|
||||
@ExcelProperty("会长昵称")
|
||||
@ApiModelProperty("会长昵称")
|
||||
private String familyOwnerNick;
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("用户UID")
|
||||
private Long uid;
|
||||
@ExcelProperty("主播id")
|
||||
@ApiModelProperty("主播ID")
|
||||
private Long erbanNo;
|
||||
@ExcelProperty("主播昵称")
|
||||
@ApiModelProperty("主播昵称")
|
||||
private String nick;
|
||||
@ExcelProperty("周奖励等级")
|
||||
private Integer level;
|
||||
@ExcelProperty("周奖励等级")
|
||||
private String levelName;
|
||||
@ExcelProperty("钻石流水")
|
||||
@ApiModelProperty("钻石流水")
|
||||
private BigDecimal processNum;
|
||||
@ExcelProperty("已获得金币")
|
||||
@ExcelProperty("钻石奖励")
|
||||
@ApiModelProperty("钻石奖励")
|
||||
private BigDecimal rewardNum;
|
||||
@ExcelProperty("在麦有效天数")
|
||||
@ApiModelProperty("在麦有效天数")
|
||||
private Integer micValidDay;
|
||||
@ExcelProperty("时长奖励")
|
||||
@ApiModelProperty("时长奖励")
|
||||
private BigDecimal bonusRewardNum;
|
||||
@ExcelProperty("目标领取金币")
|
||||
@ApiModelProperty("目标领取金币")
|
||||
private BigDecimal totalRewardNum;
|
||||
@ExcelProperty("已领取金币")
|
||||
@ApiModelProperty("已领取金币")
|
||||
private BigDecimal receivedNum;
|
||||
|
||||
}
|
||||
}
|
@@ -31,6 +31,9 @@ public class Lucky24ConfigAdminVo {
|
||||
@ApiModelProperty("白名单用户id对比值N对应表")
|
||||
private Map<Long, BigDecimal> whiteErbanNoProductionRatioMap;
|
||||
|
||||
@ApiModelProperty("后台关注用户id列表")
|
||||
private List<Long> adminFollowErbanNoList;
|
||||
|
||||
@ApiModelProperty("")
|
||||
private Long preJudgeValue_H;
|
||||
@ApiModelProperty("")
|
||||
|
@@ -14,6 +14,9 @@ public class UserPurseVo {
|
||||
|
||||
private Double golds;
|
||||
|
||||
private Double guildUsd;
|
||||
private Double guildCrystal;
|
||||
|
||||
private Boolean firstCharge;
|
||||
|
||||
private Date updateTime;
|
||||
|
@@ -13,4 +13,5 @@ public class UsersVo extends Users {
|
||||
private double diamondsNum;
|
||||
|
||||
private double guildUsdNum;
|
||||
private double guildCrystalNum;
|
||||
}
|
||||
|
@@ -19,9 +19,16 @@ public class GuildAdminVo {
|
||||
@ApiModelProperty("公会长昵称")
|
||||
@ExcelProperty("公会长昵称")
|
||||
private String ownerNick;
|
||||
@ExcelIgnore
|
||||
private Integer partitionId;
|
||||
@ApiModelProperty("公会长分区")
|
||||
@ExcelProperty("公会长分区")
|
||||
private String ownerPartitionName;
|
||||
@ExcelIgnore
|
||||
private Integer regionId;
|
||||
@ApiModelProperty("公会地区")
|
||||
@ExcelProperty("公会地区")
|
||||
private String regionName;
|
||||
@ApiModelProperty("公会长地区")
|
||||
@ExcelProperty("公会长地区")
|
||||
private String ownerRegionName;
|
||||
|
@@ -0,0 +1,18 @@
|
||||
package com.accompany.admin.vo.guild;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GuildCreateAdminVo {
|
||||
private Long erbanNo;
|
||||
private Integer id;
|
||||
private String name;
|
||||
private String avatar;
|
||||
private String backgroundUrl;
|
||||
private Integer memberNumLimit;
|
||||
private String guildContactType;
|
||||
private String guildContact;
|
||||
private Long inviteErbanNo;
|
||||
private Integer operatorId;
|
||||
private Integer regionId;
|
||||
}
|
@@ -47,6 +47,9 @@ public class GuildMemberAdminVo {
|
||||
@ExcelProperty("加入时间")
|
||||
@ApiModelProperty("加入时间")
|
||||
private Date createTime;
|
||||
@ExcelProperty("操作/退出时间")
|
||||
@ApiModelProperty("操作/退出时间")
|
||||
private Date updateTime;
|
||||
@ExcelProperty("是否有效状态")
|
||||
@ApiModelProperty("是否有效状态")
|
||||
private Boolean enable;
|
||||
|
@@ -0,0 +1,48 @@
|
||||
package com.accompany.admin.vo.miniGame;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel("休闲游戏时长明细VO")
|
||||
public class MiniGameForSudAdminDetailVo {
|
||||
|
||||
@ApiModelProperty("日期")
|
||||
private String date;
|
||||
/**
|
||||
* 游戏ID
|
||||
*/
|
||||
@ApiModelProperty("游戏ID")
|
||||
private Long gameId;
|
||||
|
||||
/**
|
||||
* 游戏名称
|
||||
*/
|
||||
@ApiModelProperty("游戏名称")
|
||||
private String gameName;
|
||||
|
||||
/**
|
||||
* 房间ID
|
||||
*/
|
||||
@ApiModelProperty("房间ID")
|
||||
private Long roomUid;
|
||||
|
||||
@ApiModelProperty("房间编号")
|
||||
private Long erbanNo;
|
||||
|
||||
/**
|
||||
* 分区ID
|
||||
*/
|
||||
@ApiModelProperty("分区ID")
|
||||
private Long partitionId;
|
||||
|
||||
@ApiModelProperty("分区描述")
|
||||
private String partitionDesc;
|
||||
|
||||
/**
|
||||
* 游戏时长(秒)
|
||||
*/
|
||||
@ApiModelProperty("游戏时长(秒)")
|
||||
private Integer duration;
|
||||
}
|
@@ -0,0 +1,63 @@
|
||||
package com.accompany.admin.vo.miniGame;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel("休闲游戏时长统计VO")
|
||||
public class MiniGameForSudAdminStatsVo {
|
||||
/**
|
||||
* 游戏ID
|
||||
*/
|
||||
@ApiModelProperty("游戏ID")
|
||||
private String gameId;
|
||||
|
||||
/**
|
||||
* 游戏名称
|
||||
*/
|
||||
@ApiModelProperty("游戏名称")
|
||||
private String gameName;
|
||||
|
||||
/**
|
||||
* 统计月份
|
||||
*/
|
||||
@ApiModelProperty("统计月份")
|
||||
private String statMonth;
|
||||
|
||||
/**
|
||||
* 总时长(秒)
|
||||
*/
|
||||
@ApiModelProperty("总时长(秒)")
|
||||
private Long totalDuration;
|
||||
|
||||
/**
|
||||
* 英文区时长(秒)
|
||||
*/
|
||||
@ApiModelProperty("英文区时长(秒)")
|
||||
private Long enDuration;
|
||||
|
||||
/**
|
||||
* 阿拉伯语区时长(秒)
|
||||
*/
|
||||
@ApiModelProperty("阿拉伯语区时长(秒)")
|
||||
private Long arDuration;
|
||||
|
||||
/**
|
||||
* 中文区时长(秒)
|
||||
*/
|
||||
@ApiModelProperty("中文区时长(秒)")
|
||||
private Long zhDuration;
|
||||
|
||||
/**
|
||||
* 土耳其语区时长(秒)
|
||||
*/
|
||||
@ApiModelProperty("土耳其语区时长(秒)")
|
||||
private Long trDuration;
|
||||
|
||||
/**
|
||||
* 英文2区时长(秒)
|
||||
*/
|
||||
@ApiModelProperty("英文2区时长(秒)")
|
||||
private Long en2Duration;
|
||||
}
|
@@ -48,4 +48,19 @@ public class I18nMessageAdminVo {
|
||||
*/
|
||||
@ApiModelProperty("葡萄牙语")
|
||||
private String pt;
|
||||
/**
|
||||
* 英语
|
||||
*/
|
||||
@ApiModelProperty("西班牙语")
|
||||
private String es;
|
||||
/**
|
||||
* 英语
|
||||
*/
|
||||
@ApiModelProperty("俄罗斯语")
|
||||
private String ru;
|
||||
/**
|
||||
* 英语
|
||||
*/
|
||||
@ApiModelProperty("乌兹别克语")
|
||||
private String uz;
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@ package com.accompany.admin.mapper;
|
||||
|
||||
import com.accompany.admin.vo.ChargeRecordAdminVo;
|
||||
import com.accompany.admin.vo.ChargeRecordCountryVo;
|
||||
import com.accompany.admin.vo.ChargeRecordPartitionRegionVo;
|
||||
import com.accompany.admin.vo.ChargeRecordPartitionVo;
|
||||
import com.accompany.payment.model.ChargeRecord;
|
||||
import com.accompany.payment.vo.ChargeRecordRefundVo;
|
||||
@@ -16,10 +17,14 @@ public interface ChargeRecordAdminMapper extends BaseMapper<ChargeRecord> {
|
||||
|
||||
Page<ChargeRecordAdminVo> page(Page<ChargeRecordAdminVo> p, @Param("erbanNo") Long erbanNo, @Param("channel") String channel,
|
||||
@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("status") Integer status,
|
||||
@Param("newUser") Boolean newUser, @Param("appChannel") String appChannel, @Param("regionId") Integer regionId);
|
||||
@Param("newUser") Boolean newUser, @Param("appChannel") String appChannel, @Param("regionId") Integer regionId,
|
||||
@Param("chargeRecordId") String chargeRecordId,
|
||||
@Param("pingxxChargeId") String pingxxChargeId);
|
||||
List<ChargeRecordAdminVo> pageTotal(@Param("erbanNo") Long erbanNo, @Param("channel") String channel, @Param("startTime") Date startTime,
|
||||
@Param("endTime") Date endTime, @Param("status") Integer status, @Param("newUser") Boolean newUser,
|
||||
@Param("appChannel") String appChannel, @Param("regionId") Integer regionId);
|
||||
@Param("appChannel") String appChannel, @Param("regionId") Integer regionId,
|
||||
@Param("chargeRecordId") String chargeRecordId,
|
||||
@Param("pingxxChargeId") String pingxxChargeId);
|
||||
|
||||
List<ChargeRecord> listFisrChargeRecordByUids(@Param("uids") List<Long> uids);
|
||||
|
||||
@@ -27,6 +32,9 @@ public interface ChargeRecordAdminMapper extends BaseMapper<ChargeRecord> {
|
||||
|
||||
List<ChargeRecordPartitionVo> getPartitionGoldDetail(@Param("partitionId") Integer partitionId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||
|
||||
List<ChargeRecordPartitionRegionVo> getPartitionRegionGoldDetail(@Param("partitionId") Integer partitionId, @Param("startTime") Date startTime,
|
||||
@Param("endTime") Date endTime, @Param("channel") String channel);
|
||||
|
||||
/**
|
||||
* 充值统计
|
||||
* @param uidList
|
||||
|
@@ -1,31 +0,0 @@
|
||||
package com.accompany.admin.mapper;
|
||||
|
||||
import com.accompany.admin.model.TestPurse;
|
||||
import com.accompany.admin.model.TestPurseExample;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TestPurseMapper {
|
||||
int countByExample(TestPurseExample example);
|
||||
|
||||
int deleteByExample(TestPurseExample example);
|
||||
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(TestPurse record);
|
||||
|
||||
int insertSelective(TestPurse record);
|
||||
|
||||
List<TestPurse> selectByExample(TestPurseExample example);
|
||||
|
||||
TestPurse selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") TestPurse record, @Param("example") TestPurseExample example);
|
||||
|
||||
int updateByExample(@Param("record") TestPurse record, @Param("example") TestPurseExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(TestPurse record);
|
||||
|
||||
int updateByPrimaryKey(TestPurse record);
|
||||
}
|
@@ -0,0 +1,40 @@
|
||||
package com.accompany.admin.mapper.miniGame;
|
||||
|
||||
import com.accompany.admin.vo.miniGame.MiniGameForSudAdminDetailVo;
|
||||
import com.accompany.admin.vo.miniGame.MiniGameForSudAdminStatsVo;
|
||||
import com.accompany.business.model.miniGame.MiniGameRound;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface MiniGameForSudAdminMapper extends BaseMapper<MiniGameRound> {
|
||||
/**
|
||||
* 按月份统计游戏总时长
|
||||
*
|
||||
* @param gameId 游戏ID
|
||||
* @param startTime 开始时间戳
|
||||
* @param endTime 结束时间戳
|
||||
* @return 统计结果
|
||||
*/
|
||||
List<MiniGameForSudAdminStatsVo> statGameDurationByMonth(@Param("gameId") String gameId,
|
||||
@Param("startTime") Long startTime,
|
||||
@Param("endTime") Long endTime);
|
||||
|
||||
/**
|
||||
* 按月份统计游戏总时长
|
||||
*
|
||||
* @param gameId 游戏ID
|
||||
* @param startTime 开始时间戳
|
||||
* @param endTime 结束时间戳
|
||||
* @return 统计结果
|
||||
*/
|
||||
Page<MiniGameForSudAdminDetailVo> pageGameRoundDetail(Page<MiniGameForSudAdminDetailVo> page,
|
||||
@Param("gameId") String gameId,
|
||||
@Param("startTime") Long startTime,
|
||||
@Param("endTime") Long endTime);
|
||||
|
||||
}
|
@@ -61,7 +61,7 @@ public class FamilyMemberWeekLevelRewardRecordAdminService {
|
||||
PartitionInfo partitionInfo = partitionInfoService.getById(partitionId);
|
||||
if (null == partitionInfo
|
||||
|| (!Constant.ClanMode.FAMILY.equals(partitionInfo.getClanMode()) && !Constant.ClanMode.GUILD.equals(partitionInfo.getClanMode())
|
||||
&& !Constant.ClanMode.GUILD_POLICY2.equals(partitionInfo.getClanMode()))){
|
||||
&& !Constant.ClanMode.GUILD_POLICY2.equals(partitionInfo.getClanMode()))) {
|
||||
throw new AdminServiceException(BusiStatus.PARAMERROR);
|
||||
} else if (!StringUtils.hasText(cycleDate)) {
|
||||
throw new AdminServiceException(BusiStatus.PARAMERROR);
|
||||
@@ -70,42 +70,42 @@ public class FamilyMemberWeekLevelRewardRecordAdminService {
|
||||
Page<FamilyMemberWeekLevelRewardStatAdminVo> voPage = new Page<>(pageNo, pageSize);
|
||||
|
||||
Long uid = null;
|
||||
if (null != erbanNo){
|
||||
if (null != erbanNo) {
|
||||
Users u = usersService.getUserByErbanNo(erbanNo);
|
||||
if (null == u){
|
||||
if (null == u) {
|
||||
return voPage;
|
||||
}
|
||||
uid = u.getUid();
|
||||
}
|
||||
|
||||
if (Constant.ClanMode.FAMILY.equals(partitionInfo.getClanMode())){
|
||||
if (Constant.ClanMode.FAMILY.equals(partitionInfo.getClanMode())) {
|
||||
Page<FamilyMember> poPage = new Page<>(pageNo, pageSize);
|
||||
LambdaQueryWrapper<FamilyMember> queryWrapper = Wrappers.<FamilyMember>lambdaQuery()
|
||||
.eq(null != uid, FamilyMember::getUid, uid);
|
||||
.eq(null != uid, FamilyMember::getUid, uid);
|
||||
familyMemberMapper.selectPage(poPage, queryWrapper);
|
||||
|
||||
if (CollectionUtils.isEmpty(poPage.getRecords())){
|
||||
if (CollectionUtils.isEmpty(poPage.getRecords())) {
|
||||
return voPage;
|
||||
}
|
||||
|
||||
Set<Long> uidSet = poPage.getRecords().stream().map(FamilyMember::getUid).collect(Collectors.toSet());
|
||||
List<Long> familyMemberIdList = poPage.getRecords().stream().map(FamilyMember::getId).collect(Collectors.toList());
|
||||
Map<Long, FamilyMember> familyMemberMap = poPage.getRecords().stream().collect(Collectors.toMap(FamilyMember::getId, f->f));
|
||||
Map<Long, FamilyMember> familyMemberMap = poPage.getRecords().stream().collect(Collectors.toMap(FamilyMember::getId, f -> f));
|
||||
List<Integer> familyIdList = familyMemberMap.values().stream().map(FamilyMember::getFamilyId).distinct().collect(Collectors.toList());
|
||||
Map<Integer, Family> familyMap = familyMapper.selectByIds(familyIdList).stream().collect(Collectors.toMap(Family::getId, f->f));
|
||||
Map<Integer, Family> familyMap = familyMapper.selectByIds(familyIdList).stream().collect(Collectors.toMap(Family::getId, f -> f));
|
||||
List<Long> familyOwnerUid = familyMap.values().stream().map(Family::getOwnerUid).distinct().collect(Collectors.toList());
|
||||
|
||||
List<FamilyMemberWeekLevelReward> weekLevelRewardList = familyMemberWeekLevelRewardService.lambdaQuery()
|
||||
.orderByAsc(FamilyMemberWeekLevelReward::getLevel)
|
||||
.list();
|
||||
Set<String> mapKeySet = familyMemberIdList.stream().map(familyMemberId->{
|
||||
Set<String> mapKeySet = familyMemberIdList.stream().map(familyMemberId -> {
|
||||
List<String> keyList = new ArrayList<>();
|
||||
for (FamilyMemberWeekLevelReward levelReward: weekLevelRewardList){
|
||||
keyList.add(String.join("_", familyMemberId.toString(), levelReward.getLevel().toString()));
|
||||
for (FamilyMemberWeekLevelReward levelReward : weekLevelRewardList) {
|
||||
keyList.add(String.join("_" , familyMemberId.toString(), levelReward.getLevel().toString()));
|
||||
}
|
||||
keyList.add(String.join("_", familyMemberId.toString(), "process"));
|
||||
keyList.add(String.join("_" , familyMemberId.toString(), "process"));
|
||||
return keyList;
|
||||
}).flatMap(List::stream).collect(Collectors.toSet());
|
||||
}).flatMap(List::stream).collect(Collectors.toSet());
|
||||
Map<String, Number> weekMap = familyMemberWeekLevelRewardService.getWeekMap(cycleDate, partitionId).getAll(mapKeySet);
|
||||
|
||||
uidSet.addAll(familyOwnerUid);
|
||||
@@ -117,16 +117,16 @@ public class FamilyMemberWeekLevelRewardRecordAdminService {
|
||||
vo.setCycleDate(cycleDate);
|
||||
vo.setFamilyMemberId(po.getId());
|
||||
|
||||
String processKey = String.join("_", po.getId().toString(), "process");
|
||||
String processKey = String.join("_" , po.getId().toString(), "process");
|
||||
vo.setProcessNum(BigDecimal.valueOf(weekMap.getOrDefault(processKey, 0d).doubleValue()));
|
||||
|
||||
int level = 0;
|
||||
BigDecimal rewardNum = BigDecimal.ZERO;
|
||||
BigDecimal receiverdNum = BigDecimal.ZERO;
|
||||
for (FamilyMemberWeekLevelReward rewardItem: weekLevelRewardList){
|
||||
String key = String.join("_", po.getId().toString(), rewardItem.getLevel().toString());
|
||||
for (FamilyMemberWeekLevelReward rewardItem : weekLevelRewardList) {
|
||||
String key = String.join("_" , po.getId().toString(), rewardItem.getLevel().toString());
|
||||
Byte status = weekMap.getOrDefault(key, Constant.status.delete).byteValue();
|
||||
if (Constant.status.valid.equals(status)){
|
||||
if (Constant.status.valid.equals(status)) {
|
||||
level = rewardItem.getLevel();
|
||||
rewardNum = rewardNum.add(rewardItem.getRewardNum());
|
||||
} else if (Constant.status.invalid.equals(status)) {
|
||||
@@ -143,21 +143,21 @@ public class FamilyMemberWeekLevelRewardRecordAdminService {
|
||||
vo.setUid(po.getUid());
|
||||
|
||||
Users u = usersMap.get(po.getUid());
|
||||
if (null != u){
|
||||
if (null != u) {
|
||||
vo.setErbanNo(u.getErbanNo());
|
||||
vo.setNick(u.getNick());
|
||||
}
|
||||
|
||||
FamilyMember familyMember = familyMemberMap.get(po.getId());
|
||||
if (null != familyMember){
|
||||
if (null != familyMember) {
|
||||
vo.setFamilyId(familyMember.getFamilyId());
|
||||
|
||||
Family family = familyMap.get(familyMember.getFamilyId());
|
||||
if (null != family){
|
||||
if (null != family) {
|
||||
vo.setFamilyName(family.getName());
|
||||
|
||||
Users owner = usersMap.get(family.getOwnerUid());
|
||||
if (null != owner){
|
||||
if (null != owner) {
|
||||
vo.setFamilyOwnerId(owner.getErbanNo());
|
||||
vo.setFamilyOwnerNick(owner.getNick());
|
||||
}
|
||||
@@ -176,26 +176,27 @@ public class FamilyMemberWeekLevelRewardRecordAdminService {
|
||||
.eq(null != uid, GuildMember::getUid, uid);
|
||||
guildMemberMapper.selectPage(poPage, queryWrapper);
|
||||
|
||||
if (CollectionUtils.isEmpty(poPage.getRecords())){
|
||||
if (CollectionUtils.isEmpty(poPage.getRecords())) {
|
||||
return voPage;
|
||||
}
|
||||
|
||||
Set<Long> uidSet = poPage.getRecords().stream().map(GuildMember::getUid).collect(Collectors.toSet());
|
||||
List<Long> guildMemberIdList = poPage.getRecords().stream().map(GuildMember::getId).collect(Collectors.toList());
|
||||
Map<Long, GuildMember> guildMemberMap = poPage.getRecords().stream().collect(Collectors.toMap(GuildMember::getId, f->f));
|
||||
Map<Long, GuildMember> guildMemberMap = poPage.getRecords().stream().collect(Collectors.toMap(GuildMember::getId, f -> f));
|
||||
List<Integer> guildIdList = guildMemberMap.values().stream().map(GuildMember::getGuildId).distinct().collect(Collectors.toList());
|
||||
Map<Integer, Guild> guildMap = guildMapper.selectByIds(guildIdList).stream().collect(Collectors.toMap(Guild::getId, f->f));
|
||||
Map<Integer, Guild> guildMap = guildMapper.selectByIds(guildIdList).stream().collect(Collectors.toMap(Guild::getId, f -> f));
|
||||
List<Long> guildOwnerUid = guildMap.values().stream().map(Guild::getOwnerUid).distinct().collect(Collectors.toList());
|
||||
|
||||
List<GuildMemberWeekLevelReward> weekLevelRewardList = guildMemberWeekLevelRewardService.lambdaQuery()
|
||||
.eq(GuildMemberWeekLevelReward::getPartitionId, partitionId)
|
||||
.orderByAsc(GuildMemberWeekLevelReward::getLevel)
|
||||
.list();
|
||||
Set<String> mapKeySet = guildMemberIdList.stream().map(guildMemberId->{
|
||||
Set<String> mapKeySet = guildMemberIdList.stream().map(guildMemberId -> {
|
||||
List<String> keyList = new ArrayList<>();
|
||||
for (GuildMemberWeekLevelReward levelReward: weekLevelRewardList){
|
||||
keyList.add(String.join("_", guildMemberId.toString(), levelReward.getLevel().toString()));
|
||||
for (GuildMemberWeekLevelReward levelReward : weekLevelRewardList) {
|
||||
keyList.add(String.join("_" , guildMemberId.toString(), levelReward.getLevel().toString()));
|
||||
}
|
||||
keyList.add(String.join("_", guildMemberId.toString(), "process"));
|
||||
keyList.add(String.join("_" , guildMemberId.toString(), "process"));
|
||||
return keyList;
|
||||
}).flatMap(List::stream).collect(Collectors.toSet());
|
||||
Map<String, Number> weekMap = guildMemberWeekLevelRewardService.getWeekMap(cycleDate, partitionId).getAll(mapKeySet);
|
||||
@@ -209,16 +210,16 @@ public class FamilyMemberWeekLevelRewardRecordAdminService {
|
||||
vo.setCycleDate(cycleDate);
|
||||
vo.setFamilyMemberId(po.getId());
|
||||
|
||||
String processKey = String.join("_", po.getId().toString(), "process");
|
||||
String processKey = String.join("_" , po.getId().toString(), "process");
|
||||
vo.setProcessNum(BigDecimal.valueOf(weekMap.getOrDefault(processKey, 0d).doubleValue()));
|
||||
|
||||
int level = 0;
|
||||
BigDecimal rewardNum = BigDecimal.ZERO;
|
||||
BigDecimal receiverdNum = BigDecimal.ZERO;
|
||||
for (GuildMemberWeekLevelReward rewardItem: weekLevelRewardList){
|
||||
String key = String.join("_", po.getId().toString(), rewardItem.getLevel().toString());
|
||||
for (GuildMemberWeekLevelReward rewardItem : weekLevelRewardList) {
|
||||
String key = String.join("_" , po.getId().toString(), rewardItem.getLevel().toString());
|
||||
Byte status = weekMap.getOrDefault(key, Constant.status.delete).byteValue();
|
||||
if (Constant.status.valid.equals(status)){
|
||||
if (Constant.status.valid.equals(status)) {
|
||||
level = rewardItem.getLevel();
|
||||
rewardNum = rewardNum.add(rewardItem.getRewardNum());
|
||||
} else if (Constant.status.invalid.equals(status)) {
|
||||
@@ -235,21 +236,21 @@ public class FamilyMemberWeekLevelRewardRecordAdminService {
|
||||
vo.setUid(po.getUid());
|
||||
|
||||
Users u = usersMap.get(po.getUid());
|
||||
if (null != u){
|
||||
if (null != u) {
|
||||
vo.setErbanNo(u.getErbanNo());
|
||||
vo.setNick(u.getNick());
|
||||
}
|
||||
|
||||
GuildMember guildMember = guildMemberMap.get(po.getId());
|
||||
if (null != guildMember){
|
||||
if (null != guildMember) {
|
||||
vo.setFamilyId(guildMember.getGuildId());
|
||||
|
||||
Guild guild = guildMap.get(guildMember.getGuildId());
|
||||
if (null != guild){
|
||||
if (null != guild) {
|
||||
vo.setFamilyName(guild.getName());
|
||||
|
||||
Users owner = usersMap.get(guild.getOwnerUid());
|
||||
if (null != owner){
|
||||
if (null != owner) {
|
||||
vo.setFamilyOwnerId(owner.getErbanNo());
|
||||
vo.setFamilyOwnerNick(owner.getNick());
|
||||
}
|
||||
|
@@ -0,0 +1,217 @@
|
||||
package com.accompany.admin.service;
|
||||
|
||||
import com.accompany.admin.vo.FamilyMemberWeekLevelRewardStatAdminVo;
|
||||
import com.accompany.business.model.guild.Guild;
|
||||
import com.accompany.business.model.guild.GuildMember;
|
||||
import com.accompany.business.model.guild.GuildMemberWeekLevelReward;
|
||||
import com.accompany.business.mybatismapper.guild.GuildMapper;
|
||||
import com.accompany.business.mybatismapper.guild.GuildMemberMapper;
|
||||
import com.accompany.business.service.guild.GuildMemberWeekLevelRewardService;
|
||||
import com.accompany.business.service.guild.GuildService;
|
||||
import com.accompany.business.service.user.UsersService;
|
||||
import com.accompany.common.constant.Constant;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.core.exception.AdminServiceException;
|
||||
import com.accompany.core.model.PartitionInfo;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.service.partition.PartitionInfoService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class GuildMemberWeekLevelRewardRecordAdminService {
|
||||
|
||||
@Autowired
|
||||
private UsersService usersService;
|
||||
@Autowired
|
||||
private GuildMemberWeekLevelRewardService guildMemberWeekLevelRewardService;
|
||||
@Autowired
|
||||
private GuildMemberMapper guildMemberMapper;
|
||||
@Autowired
|
||||
private GuildMapper guildMapper;
|
||||
@Autowired
|
||||
private GuildService guildService;
|
||||
@Autowired
|
||||
private PartitionInfoService partitionInfoService;
|
||||
|
||||
public Page<FamilyMemberWeekLevelRewardStatAdminVo> page(int partitionId,
|
||||
String cycleDate,
|
||||
Integer guildId,
|
||||
Long guildOwnerErbanNo,
|
||||
Long erbanNo,
|
||||
int pageNo, int pageSize) {
|
||||
PartitionInfo partitionInfo = partitionInfoService.getById(partitionId);
|
||||
if (null == partitionInfo
|
||||
|| (!Constant.ClanMode.GUILD.equals(partitionInfo.getClanMode())
|
||||
&& !Constant.ClanMode.GUILD_POLICY2.equals(partitionInfo.getClanMode())
|
||||
&& !Constant.ClanMode.SOVIET.equals(partitionInfo.getClanMode()))){
|
||||
throw new AdminServiceException(BusiStatus.PARAMERROR);
|
||||
} else if (!StringUtils.hasText(cycleDate)) {
|
||||
throw new AdminServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
|
||||
Page<FamilyMemberWeekLevelRewardStatAdminVo> voPage = new Page<>(pageNo, pageSize);
|
||||
|
||||
if (null != guildOwnerErbanNo){
|
||||
Users owner = usersService.getUserByErbanNo(guildOwnerErbanNo);
|
||||
if (null == owner){
|
||||
return voPage;
|
||||
}
|
||||
Guild g = guildService.getVaildGuildByOwnerUid(owner.getUid());
|
||||
if (null == g){
|
||||
return voPage;
|
||||
}
|
||||
guildId = g.getId();
|
||||
}
|
||||
|
||||
Long uid = null;
|
||||
if (null != erbanNo){
|
||||
Users u = usersService.getUserByErbanNo(erbanNo);
|
||||
if (null == u){
|
||||
return voPage;
|
||||
}
|
||||
uid = u.getUid();
|
||||
}
|
||||
|
||||
Page<GuildMember> poPage = new Page<>(pageNo, pageSize);
|
||||
LambdaQueryWrapper<GuildMember> queryWrapper = Wrappers.<GuildMember>lambdaQuery()
|
||||
.eq(null != guildId, GuildMember::getGuildId, guildId)
|
||||
.eq(null != uid, GuildMember::getUid, uid);
|
||||
guildMemberMapper.selectPage(poPage, queryWrapper);
|
||||
|
||||
if (CollectionUtils.isEmpty(poPage.getRecords())){
|
||||
return voPage;
|
||||
}
|
||||
|
||||
Set<Long> uidSet = poPage.getRecords().stream().map(GuildMember::getUid).collect(Collectors.toSet());
|
||||
List<Long> guildMemberIdList = poPage.getRecords().stream().map(GuildMember::getId).toList();
|
||||
Map<Long, GuildMember> guildMemberMap = poPage.getRecords().stream().collect(Collectors.toMap(GuildMember::getId, f->f));
|
||||
List<Integer> guildIdList = guildMemberMap.values().stream().map(GuildMember::getGuildId).distinct().collect(Collectors.toList());
|
||||
Map<Integer, Guild> guildMap = guildMapper.selectByIds(guildIdList).stream().collect(Collectors.toMap(Guild::getId, f->f));
|
||||
List<Long> guildOwnerUid = guildMap.values().stream().map(Guild::getOwnerUid).distinct().toList();
|
||||
|
||||
List<GuildMemberWeekLevelReward> weekLevelRewardList = guildMemberWeekLevelRewardService.lambdaQuery()
|
||||
.orderByAsc(GuildMemberWeekLevelReward::getLevel)
|
||||
.list();
|
||||
Set<String> mapKeySet = guildMemberIdList.stream().map(guildMemberId->{
|
||||
List<String> keyList = new ArrayList<>();
|
||||
for (GuildMemberWeekLevelReward levelReward: weekLevelRewardList){
|
||||
String levelId = levelReward.getLevel().toString();
|
||||
keyList.add(String.join("_", guildMemberId.toString(), levelId));
|
||||
keyList.add(String.join("_", guildMemberId.toString(), levelId, "bonus"));
|
||||
}
|
||||
keyList.add(String.join("_", guildMemberId.toString(), "process"));
|
||||
keyList.add(String.join("_", guildMemberId.toString(), "bonus", "process"));
|
||||
return keyList;
|
||||
}).flatMap(List::stream).collect(Collectors.toSet());
|
||||
|
||||
Map<String, Number> weekMap = guildMemberWeekLevelRewardService.getWeekMap(cycleDate, partitionId).getAll(mapKeySet);
|
||||
|
||||
uidSet.addAll(guildOwnerUid);
|
||||
|
||||
Map<Long, Users> usersMap = usersService.getUsersMapByUids(new ArrayList<>(uidSet));
|
||||
|
||||
List<FamilyMemberWeekLevelRewardStatAdminVo> voList = poPage.getRecords().stream().map(po -> {
|
||||
FamilyMemberWeekLevelRewardStatAdminVo vo = new FamilyMemberWeekLevelRewardStatAdminVo();
|
||||
vo.setCycleDate(cycleDate);
|
||||
vo.setFamilyMemberId(po.getId());
|
||||
|
||||
String processKey = String.join("_", po.getId().toString(), "process");
|
||||
BigDecimal processNum = BigDecimal.valueOf(weekMap.getOrDefault(processKey, 0d).doubleValue());
|
||||
vo.setProcessNum(processNum);
|
||||
|
||||
String bonusProcessKey = String.join("_", po.getId().toString(), "bonus", "process");
|
||||
Integer bonusProcessNum = weekMap.getOrDefault(bonusProcessKey, 0).intValue();
|
||||
vo.setMicValidDay(bonusProcessNum);
|
||||
|
||||
Integer level = null;
|
||||
String levelName = "-";
|
||||
BigDecimal rewardNum = BigDecimal.ZERO;
|
||||
BigDecimal bonusRewardNum = BigDecimal.ZERO;
|
||||
BigDecimal receiverdNum = BigDecimal.ZERO;
|
||||
|
||||
BigDecimal preMaxNum = BigDecimal.ZERO;
|
||||
|
||||
for (GuildMemberWeekLevelReward rewardItem: weekLevelRewardList){
|
||||
String key = String.join("_", po.getId().toString(), rewardItem.getLevel().toString());
|
||||
Byte status = weekMap.getOrDefault(key, Constant.status.delete).byteValue();
|
||||
BigDecimal thisMaxNum = preMaxNum.add(rewardItem.getProcessNum());
|
||||
|
||||
if (Constant.status.invalid.equals(status)) {
|
||||
level = rewardItem.getLevel();
|
||||
levelName = rewardItem.getLevelName();
|
||||
rewardNum = rewardNum.add(rewardItem.getRewardNum());
|
||||
receiverdNum = receiverdNum.add(rewardItem.getRewardNum());
|
||||
} else if (processNum.compareTo(thisMaxNum) >= 0) {
|
||||
level = rewardItem.getLevel();
|
||||
levelName = rewardItem.getLevelName();
|
||||
rewardNum = rewardNum.add(rewardItem.getRewardNum());
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
String bonusKey = String.join("_", po.getId().toString(), rewardItem.getLevel().toString(), "bonus");
|
||||
Byte bonusStatus = weekMap.getOrDefault(bonusKey, Constant.status.delete).byteValue();
|
||||
if (Constant.status.invalid.equals(bonusStatus)) {
|
||||
bonusRewardNum = rewardNum.add(rewardItem.getBonusNum());
|
||||
receiverdNum = receiverdNum.add(rewardItem.getBonusNum());
|
||||
} else if (bonusProcessNum.compareTo(rewardItem.getMicValidDay()) >= 0) {
|
||||
bonusRewardNum = rewardNum.add(rewardItem.getBonusNum());
|
||||
}
|
||||
|
||||
preMaxNum = thisMaxNum;
|
||||
}
|
||||
|
||||
vo.setLevel(level);
|
||||
vo.setLevelName(levelName);
|
||||
vo.setRewardNum(rewardNum);
|
||||
vo.setBonusRewardNum(bonusRewardNum);
|
||||
vo.setTotalRewardNum(rewardNum.add(bonusRewardNum));
|
||||
vo.setReceivedNum(receiverdNum);
|
||||
|
||||
vo.setUid(po.getUid());
|
||||
|
||||
Users u = usersMap.get(po.getUid());
|
||||
if (null != u){
|
||||
vo.setErbanNo(u.getErbanNo());
|
||||
vo.setNick(u.getNick());
|
||||
}
|
||||
|
||||
GuildMember guildMember = guildMemberMap.get(po.getId());
|
||||
if (null != guildMember){
|
||||
vo.setFamilyId(guildMember.getGuildId());
|
||||
|
||||
Guild guild = guildMap.get(guildMember.getGuildId());
|
||||
if (null != guild){
|
||||
vo.setFamilyName(guild.getName());
|
||||
|
||||
Users owner = usersMap.get(guild.getOwnerUid());
|
||||
if (null != owner){
|
||||
vo.setFamilyOwnerId(owner.getErbanNo());
|
||||
vo.setFamilyOwnerNick(owner.getNick());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
voPage.setRecords(voList);
|
||||
voPage.setTotal(poPage.getTotal());
|
||||
|
||||
return voPage;
|
||||
}
|
||||
|
||||
}
|
@@ -286,6 +286,8 @@ public class UserCheckAdminService {
|
||||
throw new AdminServiceException("用户钻石余额不为0,不能改变分区");
|
||||
} else if (userPurse.getGuildUsd() > 0d){
|
||||
throw new AdminServiceException("用户金币公会薪资不为0,不能改变分区");
|
||||
} else if (userPurse.getGuildCrystal() > 0d) {
|
||||
throw new AdminServiceException("用户金币公会紫晶不为0,不能改变分区");
|
||||
}
|
||||
|
||||
FamilyClanDecorateVo clanVo = familyClanService.getFamilyClanDecorateVo(users.getUid(), users.getUid());
|
||||
@@ -368,7 +370,6 @@ public class UserCheckAdminService {
|
||||
busiResult.setData(account);
|
||||
return busiResult;
|
||||
}
|
||||
|
||||
private void delUserCache(Users users) {
|
||||
if (users == null) {
|
||||
return;
|
||||
@@ -459,4 +460,12 @@ public class UserCheckAdminService {
|
||||
}
|
||||
return BusiResult.success(result);
|
||||
}
|
||||
|
||||
public UserVo getUser(Long erbanNo) {
|
||||
Users user = usersService.getUserByErbanNo(erbanNo);
|
||||
if (user == null) {
|
||||
throw new AdminServiceException(BusiStatus.USERNOTEXISTS);
|
||||
}
|
||||
return usersService.getUserVoByUid(user.getUid());
|
||||
}
|
||||
}
|
||||
|
@@ -8,30 +8,33 @@ 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.*;
|
||||
import com.accompany.business.service.game.ChargeUserXService;
|
||||
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.guildpolicy2.GuildCrystalSettlementService;
|
||||
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.netease.ErBanNetEaseService;
|
||||
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;
|
||||
@@ -58,7 +61,6 @@ 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;
|
||||
@@ -90,7 +92,7 @@ public class MyApiService {
|
||||
private RoomReciveRankingService roomReciveRankingService;
|
||||
@Autowired
|
||||
private RoomSendRankingService roomSendRankingService;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
@Autowired
|
||||
private UsersService usersService;
|
||||
@@ -152,6 +154,12 @@ public class MyApiService {
|
||||
private WeekGuildPartitionStatService weekGuildPartitionStatService;
|
||||
@Autowired
|
||||
private WeekRechargeAgentPartitionStatService weekRechargeAgentPartitionStatService;
|
||||
@Autowired
|
||||
private GuildOperatorService guildOperatorService;
|
||||
@Autowired
|
||||
private GuildService guildService;
|
||||
@Autowired
|
||||
private ChargeUserXService chargeUserXService;
|
||||
|
||||
public void refreshRoomMoneyRankList() {
|
||||
List<Long> roomUidList = myApiAdminMapper.getExceptionRoomUid();
|
||||
@@ -612,12 +620,18 @@ public class MyApiService {
|
||||
});
|
||||
}
|
||||
|
||||
public void diamondStat(String date) {
|
||||
public void diamondStatAr(String date) {
|
||||
List<Integer> partitionIds = List.of(PartitionEnum.ARAB.getId(), PartitionEnum.TURKEY.getId());
|
||||
Date now = DateTimeUtil.convertStrToDate(date, DateTimeUtil.DEFAULT_DATE_PATTERN);
|
||||
diamondStatService.stat(partitionIds, now);
|
||||
}
|
||||
|
||||
public void diamondStatEn(String date) {
|
||||
List<Integer> partitionIds = List.of(PartitionEnum.ENGLISH.getId(), PartitionEnum.CHINESE.getId(), PartitionEnum.ENGLISH2.getId());
|
||||
Date now = DateTimeUtil.convertStrToDate(date, DateTimeUtil.DEFAULT_DATE_PATTERN);
|
||||
diamondStatService.stat(partitionIds, now);
|
||||
}
|
||||
|
||||
public void dauStat(String date) {
|
||||
Date now = DateTimeUtil.convertStrToDate(date, DateTimeUtil.DEFAULT_DATE_PATTERN);
|
||||
String yesterday = DateTimeUtil.convertDate(DateTimeUtil.addDays(now, -1), DateTimeUtil.DEFAULT_DATE_PATTERN);
|
||||
@@ -689,7 +703,19 @@ 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);
|
||||
@@ -735,7 +761,19 @@ 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);
|
||||
@@ -756,6 +794,93 @@ public class MyApiService {
|
||||
log.info("[refreshWeekGuildStat] today {} last {}", JSON.toJSONString(stat), JSON.toJSONString(lastWeekStat));
|
||||
}
|
||||
stat.setTrActiveCountDetail(JSON.toJSONString(trActiveGuildStatList));
|
||||
|
||||
List<WeekActiveGuildStat> en2ActiveGuildStatList = JSON.parseArray(stat.getEn2ActiveCountDetail(), WeekActiveGuildStat.class);
|
||||
operatorNameMap = guildOperatorService.operatorNameMap(PartitionEnum.ENGLISH2.getId());
|
||||
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(en2ActiveGuildStatList)) {
|
||||
guildMap = new HashMap<>();
|
||||
List<Integer> guildIds = en2ActiveGuildStatList.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 : en2ActiveGuildStatList){
|
||||
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);
|
||||
if (null == lastWeekStat){
|
||||
continue;
|
||||
}
|
||||
activeGuildStat.setLastGuildDiamondFlow(lastWeekStat.getGuildDiamondFlow());
|
||||
activeGuildStat.setLastGuildGoldFlow(lastWeekStat.getGuildGoldFlow());
|
||||
|
||||
BigDecimal guildDiamondFlowWow = lastWeekStat.getGuildDiamondFlow().compareTo(BigDecimal.ZERO) > 0 ?
|
||||
(activeGuildStat.getGuildDiamondFlow().subtract(lastWeekStat.getGuildDiamondFlow())).divide(lastWeekStat.getGuildDiamondFlow(), 2, RoundingMode.HALF_UP): BigDecimal.ONE;
|
||||
activeGuildStat.setGuildDiamondFlowWow(guildDiamondFlowWow);
|
||||
|
||||
BigDecimal guildGoldFlowWow = lastWeekStat.getGuildGoldFlow().compareTo(BigDecimal.ZERO) > 0 ?
|
||||
(activeGuildStat.getGuildGoldFlow().subtract(lastWeekStat.getGuildGoldFlow())).divide(lastWeekStat.getGuildGoldFlow(), 2, RoundingMode.HALF_UP): BigDecimal.ONE;
|
||||
activeGuildStat.setGuildGoldFlowWow(guildGoldFlowWow);
|
||||
|
||||
log.info("[refreshWeekGuildStat] today {} last {}", JSON.toJSONString(stat), JSON.toJSONString(lastWeekStat));
|
||||
}
|
||||
}
|
||||
stat.setEn2ActiveCountDetail(JSON.toJSONString(en2ActiveGuildStatList));
|
||||
}
|
||||
|
||||
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));
|
||||
|
||||
List<WeekActiveGuildStat> en2NewGuildStatList = JSON.parseArray(stat.getEn2NewCountDetail(), WeekActiveGuildStat.class);
|
||||
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(en2NewGuildStatList)) {
|
||||
operatorNameMap = guildOperatorService.operatorNameMap(PartitionEnum.ENGLISH2.getId());
|
||||
List<Integer> guildIds = en2NewGuildStatList.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 : en2NewGuildStatList){
|
||||
Guild guild = guildMap.get(activeGuildStat.getGuildId());
|
||||
if (guild != null && guild.getOperatorId() != null) {
|
||||
activeGuildStat.setOperatorId(guild.getOperatorId());
|
||||
activeGuildStat.setOperatorName(operatorNameMap.get(guild.getOperatorId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
stat.setEn2NewCountDetail(JSON.toJSONString(en2NewGuildStatList));
|
||||
}
|
||||
weekGuildStatMapper.delete(null);
|
||||
weekGuildStatMapper.insert(lastWeekGuildStatList);
|
||||
@@ -805,4 +930,57 @@ 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));
|
||||
}
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private GuildCrystalSettlementService guildCrystalSettlementService;
|
||||
|
||||
public void guildCrystalSettlement(String cycleDate, Integer waitSecond) {
|
||||
Date cycleDateTime = StringUtils.isNotBlank(cycleDate) ? DateTimeUtil.convertStrToDate(cycleDate, DateTimeUtil.DEFAULT_DATE_PATTERN): null;
|
||||
guildCrystalSettlementService.settlement(PartitionEnum.TURKEY.getId(), cycleDateTime, waitSecond);
|
||||
}
|
||||
|
||||
public void mp4TransferGif(String url) {
|
||||
SpringContextHolder.getBean(UploadAvatarService.class).reviewAvatar(null, url, null, null, null, null);
|
||||
}
|
||||
|
||||
public void updateX() {
|
||||
chargeUserXService.updateUserX(new Date());
|
||||
}
|
||||
}
|
||||
|
@@ -37,7 +37,9 @@ public class ChargeRegionAdminServiceImpl implements ChargeRegionAdminService {
|
||||
|
||||
@Override
|
||||
public List<ChargeRegion> list() {
|
||||
return chargeRegionService.list();
|
||||
return chargeRegionService.lambdaQuery()
|
||||
.orderByAsc(ChargeRegion::getSeq)
|
||||
.list();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -0,0 +1,121 @@
|
||||
package com.accompany.admin.service.dailytask;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.accompany.business.constant.dailytask.DailyTaskTypeEnum;
|
||||
import com.accompany.business.model.dailytask.DailyTaskRecvCoinStat;
|
||||
import com.accompany.business.model.dailytask.DailyTaskRewardRecord;
|
||||
import com.accompany.business.model.guild.GuildMember;
|
||||
import com.accompany.business.service.dailytask.DailyTaskRecvCoinStatService;
|
||||
import com.accompany.business.service.dailytask.DailyTaskRewardRecordService;
|
||||
import com.accompany.business.service.dailytask.DailyTaskStatService;
|
||||
import com.accompany.business.service.guild.GuildMemberService;
|
||||
import com.accompany.business.service.user.UsersService;
|
||||
import com.accompany.business.vo.dailytask.DailyCoinRecvRecordVo;
|
||||
import com.accompany.business.vo.dailytask.DailyCoinRecvVo;
|
||||
import com.accompany.common.result.PageResult;
|
||||
import com.accompany.common.utils.DateTimeUtil;
|
||||
import com.accompany.core.enumeration.PartitionEnum;
|
||||
import com.accompany.core.exception.AdminServiceException;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang.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;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class DailyTaskAdminService {
|
||||
|
||||
@Autowired
|
||||
private DailyTaskRecvCoinStatService dailyTaskRecvCoinStatService;
|
||||
@Autowired
|
||||
private DailyTaskStatService dailyTaskStatService;
|
||||
@Autowired
|
||||
private DailyTaskRewardRecordService dailyTaskRewardRecordService;
|
||||
@Autowired
|
||||
private UsersService usersService;
|
||||
@Autowired
|
||||
private GuildMemberService guildMemberService;
|
||||
|
||||
public PageResult<DailyCoinRecvVo> list(Integer pageNo, Integer pageSize, Integer partitionId, String startDate, String endDate) {
|
||||
IPage<DailyTaskRecvCoinStat> dailyTaskRecvCoinStatIPage = dailyTaskRecvCoinStatService.selectDailyCoinRecvStat(partitionId, startDate, endDate, pageNo, pageSize);
|
||||
PageResult<DailyCoinRecvVo> pageResult = new PageResult<>();
|
||||
List<DailyCoinRecvVo> recvVoList = new ArrayList<>();
|
||||
pageResult.setRows(recvVoList);
|
||||
pageResult.setTotal((int) dailyTaskRecvCoinStatIPage.getTotal());
|
||||
List<DailyTaskRecvCoinStat> records = dailyTaskRecvCoinStatIPage.getRecords();
|
||||
if (pageNo == 1) {
|
||||
if (CollectionUtils.isEmpty(records)) {
|
||||
records = new ArrayList<>();
|
||||
}
|
||||
String todayDate = DateTimeUtil.convertWithZoneId(new Date(),
|
||||
PartitionEnum.getByPartitionId(partitionId).getZoneId()).format(DateTimeUtil.dateFormatter);
|
||||
if (StringUtils.isNotEmpty(startDate) && StringUtils.isNotEmpty(endDate)) {
|
||||
if (startDate.compareTo(todayDate) <= 0 && endDate.compareTo(todayDate) >= 0) {
|
||||
records.add(dailyTaskStatService.statDailyCoinRecvStat(partitionId, todayDate, false));
|
||||
}
|
||||
} else {
|
||||
records.add(dailyTaskStatService.statDailyCoinRecvStat(partitionId, todayDate, false));
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isEmpty(records)) {
|
||||
return pageResult;
|
||||
}
|
||||
for (DailyTaskRecvCoinStat record : records) {
|
||||
DailyCoinRecvVo dailyCoinRecvVo = new DailyCoinRecvVo();
|
||||
BeanUtils.copyProperties(record, dailyCoinRecvVo);
|
||||
recvVoList.add(dailyCoinRecvVo);
|
||||
}
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
public PageResult<DailyCoinRecvRecordVo> listRecord(Long erbanNo, Integer partitionId, String statDate,
|
||||
String deviceId, String ip, Integer pageNo, Integer pageSize) {
|
||||
Long uid = null;
|
||||
if (erbanNo != null) {
|
||||
Users user = usersService.getUserByErbanNo(erbanNo);
|
||||
if (user == null) {
|
||||
throw new AdminServiceException("ID:" + erbanNo + ",不存在");
|
||||
}
|
||||
uid = user.getUid();
|
||||
}
|
||||
IPage<DailyTaskRewardRecord> dailyTaskRewardRecordIPage = dailyTaskRewardRecordService
|
||||
.listDetail(uid, partitionId, statDate, DailyTaskTypeEnum.UP_MIC_COIN.name(), deviceId, ip, pageNo, pageSize);
|
||||
PageResult<DailyCoinRecvRecordVo> pageResult = new PageResult<>();
|
||||
List<DailyCoinRecvRecordVo> recordVoList = new ArrayList<>();
|
||||
pageResult.setRows(recordVoList);
|
||||
pageResult.setTotal((int) dailyTaskRewardRecordIPage.getTotal());
|
||||
List<DailyTaskRewardRecord> records = dailyTaskRewardRecordIPage.getRecords();
|
||||
if (CollectionUtils.isEmpty(records)) {
|
||||
return pageResult;
|
||||
}
|
||||
List<Long> uids = records.stream().map(DailyTaskRewardRecord::getUid).collect(Collectors.toList());
|
||||
List<Long> guildMemberIds = records.stream().filter(record -> record.getGuildMemberId() != null)
|
||||
.map(DailyTaskRewardRecord::getGuildMemberId).distinct().collect(Collectors.toList());
|
||||
Map<Long, Users> usersMap = usersService.getUsersMapByUids(uids);
|
||||
Map<Long, GuildMember> guildMemberMap = guildMemberService.mapByIds(guildMemberIds);
|
||||
for (DailyTaskRewardRecord record : records) {
|
||||
DailyCoinRecvRecordVo recordVo = new DailyCoinRecvRecordVo();
|
||||
recordVo.setGuildId(record.getGuildId());
|
||||
recordVo.setUid(record.getUid());
|
||||
Users users = usersMap.get(record.getUid());
|
||||
if (users != null) {
|
||||
recordVo.setErbanNo(users.getErbanNo());
|
||||
}
|
||||
recordVo.setDeviceId(record.getDeviceId());
|
||||
recordVo.setIp(record.getLoginIp());
|
||||
GuildMember guildMember = guildMemberMap.get(record.getGuildMemberId());
|
||||
recordVo.setStatusStr((guildMember == null || !guildMember.getEnable()) ? "无效" : "有效");
|
||||
recordVo.setReceiveTime(DateUtil.formatDateTime(record.getCreateTime()));
|
||||
recordVoList.add(recordVo);
|
||||
}
|
||||
return pageResult;
|
||||
}
|
||||
}
|
@@ -245,7 +245,7 @@ public class GiftAdminService extends AbstractCoreService<Gift, GiftExample> {
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public int save(Gift entity, boolean isEdit, boolean isSelective) {
|
||||
|
||||
log.info("更新礼物: entity:{}, isEdit:{},isSelective:{}", gson.toJson(entity), isEdit, isSelective);
|
||||
// 新增福袋时默认下线
|
||||
if (entity.getGiftId() == null && entity.getGiftType().equals(Constant.GiftType.LUCKY_BAG)) {
|
||||
entity.setGiftStatus(Constant.status.invalid);
|
||||
@@ -305,12 +305,15 @@ public class GiftAdminService extends AbstractCoreService<Gift, GiftExample> {
|
||||
}
|
||||
|
||||
int result = super.save(entity, isEdit, isSelective);
|
||||
log.info("更新礼物-刷新缓存前: entity:{}", gson.toJson(entity));
|
||||
if (Constant.status.valid.equals(entity.getGiftStatus())) {
|
||||
Object id = getId(entity);
|
||||
if (isEdit) {
|
||||
entity = super.get(id);
|
||||
}
|
||||
jedisService.hwrite(RedisKey.gift.getKey(), id.toString(), gson.toJson(entity));
|
||||
String json = gson.toJson(entity);
|
||||
log.info("更新礼物缓存: id:{},entity:{}", id, json);
|
||||
jedisService.hwrite(RedisKey.gift.getKey(), id.toString(), json);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@@ -13,6 +13,7 @@ import com.accompany.business.service.family.FamilyGiftRecordService;
|
||||
import com.accompany.business.service.guild.BdGuildService;
|
||||
import com.accompany.business.service.guild.BdInfoService;
|
||||
import com.accompany.business.service.guild.GuildDiamondStatisticsDayService;
|
||||
import com.accompany.business.service.guildsoviet.GuildExtraDiamondDayService;
|
||||
import com.accompany.business.service.invite.UserInviteFissionRecordService;
|
||||
import com.accompany.business.service.user.UsersService;
|
||||
import com.accompany.business.vo.guild.GuildInfoVo;
|
||||
@@ -56,6 +57,8 @@ public class BdInfoAdminService {
|
||||
private GuildDiamondStatisticsDayService guildDiamondStatisticsDayService;
|
||||
@Autowired
|
||||
private FamilyGiftRecordService familyGiftRecordService;
|
||||
@Autowired
|
||||
private GuildExtraDiamondDayService guildExtraDiamondDayService;
|
||||
|
||||
public final int BOUND_EXPIRE_LIMIT_DAY = 7;
|
||||
|
||||
@@ -134,6 +137,8 @@ public class BdInfoAdminService {
|
||||
Map<Integer, Double> guildDiamondOrGoldMap;
|
||||
if (PartitionEnum.ENGLISH.getId() == partitionId) {
|
||||
guildDiamondOrGoldMap = familyGiftRecordService.mapByFamilyId(DateUtil.formatDateTime(beginTime), DateUtil.formatDateTime(endTime), guildIdList);
|
||||
} else if (PartitionEnum.SOVIET.getId() == partitionId) {
|
||||
guildDiamondOrGoldMap = guildExtraDiamondDayService.mapByStatDate(DateUtil.formatDate(beginTime), DateUtil.formatDate(endTime), partitionId, guildIdList);
|
||||
} else {
|
||||
guildDiamondOrGoldMap = guildDiamondStatisticsDayService.mapByStatDate(DateUtil.formatDate(beginTime), DateUtil.formatDate(endTime), partitionId, guildIdList);
|
||||
}
|
||||
@@ -355,6 +360,16 @@ public class BdInfoAdminService {
|
||||
record.setGoldNum(BigDecimal.valueOf(guildDiamondMap.getOrDefault(record.getGuildId(), 0D)));
|
||||
}
|
||||
}
|
||||
} else if (PartitionEnum.SOVIET.getId() == users.getPartitionId()) {
|
||||
guilds = bdGuildService.guildsByBdId(bdId, pageNo, pageSize);
|
||||
List<GuildInfoVo> records = guilds.getRecords();
|
||||
if (records != null) {
|
||||
List<Integer> guildIds = records.stream().map(x -> x.getGuildId().intValue()).collect(Collectors.toList());
|
||||
Map<Integer, Double> guildDiamondMap = guildExtraDiamondDayService.mapByStatDate(DateUtil.formatDate(beginTime), DateUtil.formatDate(endTime), partitionId, guildIds);
|
||||
for (GuildInfoVo record : records) {
|
||||
record.setDiamondNum(BigDecimal.valueOf(guildDiamondMap.getOrDefault(record.getGuildId(), 0D)));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
guilds = bdGuildService.guildsByBdId(bdId, pageNo, pageSize);
|
||||
List<GuildInfoVo> records = guilds.getRecords();
|
||||
|
@@ -226,7 +226,7 @@ public class GuildApplyAdminService {
|
||||
applyServiceById.setAdminId(admindId);
|
||||
boolean b = guildApplyService.updateById(applyServiceById);
|
||||
if (b) {
|
||||
Integer guildId = guildManageAdminService.addGuildInfo(users, applyServiceById.getApplyTime(), admindId, null, null, applyServiceById.getInviteUid(), applyServiceById, null);
|
||||
Integer guildId = guildManageAdminService.addGuildInfo(users, applyServiceById.getApplyTime(), admindId, null, null, applyServiceById.getInviteUid(), applyServiceById, null, null);
|
||||
applyServiceById.setGuildId(guildId);
|
||||
guildApplyService.updateById(applyServiceById);
|
||||
String rejectSys = I18NMessageSourceUtil.getMessage(I18nAlertEnum.GUILD_APPLY_PASS, users.getPartitionId());
|
||||
|
@@ -74,7 +74,7 @@ public class GuildDiamondStatisticsDayAdminService {
|
||||
Page<GuildDiamondStatisticsDayVo> guildDiamondStatisticsDayPage;
|
||||
if (GUILD_POLICY2.equals(partitionEnum.getClanMode())) {
|
||||
guildDiamondStatisticsDayPage =
|
||||
guildDiamondStatisticsPolicy2Service.listByStatDate4OldPolicy(startDate, endDate, partitionId, regionId, guildId, pageNo, pageSize, inviteUid);
|
||||
guildDiamondStatisticsPolicy2Service.listByStatDate4Policy2(startDate, endDate, partitionId, regionId, guildId, pageNo, pageSize, inviteUid);
|
||||
} else {
|
||||
guildDiamondStatisticsDayPage =
|
||||
guildDiamondStatisticsDayService.listByStatDate(startDate, endDate, partitionId, regionId, guildId, pageNo, pageSize, inviteUid);
|
||||
|
@@ -87,15 +87,15 @@ public class GuildManageAdminService {
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void createGuild(Long erbanNo, Integer adminId, String guildContactType, String guildContact,
|
||||
Long inviteErbanNo,
|
||||
Integer operatorId) {
|
||||
Long inviteErbanNo, Integer operatorId, Integer regionId) {
|
||||
Users u = usersService.getUserByErbanNo(erbanNo);
|
||||
if (null == u){
|
||||
throw new AdminServiceException(BusiStatus.USERNOTEXISTS);
|
||||
}
|
||||
PartitionInfo partitionInfo = partitionInfoService.getById(u.getPartitionId());
|
||||
if (null == partitionInfo || (!Constant.ClanMode.GUILD.equals(partitionInfo.getClanMode())
|
||||
&& !Constant.ClanMode.GUILD_POLICY2.equals(partitionInfo.getClanMode()))){
|
||||
&& !Constant.ClanMode.GUILD_POLICY2.equals(partitionInfo.getClanMode())
|
||||
&& !Constant.ClanMode.SOVIET.equals(partitionInfo.getClanMode()))){
|
||||
throw new AdminServiceException(BusiStatus.PARTITION_ERROR);
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ public class GuildManageAdminService {
|
||||
}
|
||||
|
||||
Date now = new Date();
|
||||
int guildId = addGuildInfo(u, now, adminId, guildContactType, guildContact, inviteUid,null, operatorId);
|
||||
int guildId = addGuildInfo(u, now, adminId, guildContactType, guildContact, inviteUid,null, operatorId, regionId);
|
||||
guildOperatorHistoryAdminService.addGuildRef(guildId, u.getPartitionId(), operatorId, adminId);
|
||||
}
|
||||
|
||||
@@ -140,9 +140,8 @@ public class GuildManageAdminService {
|
||||
* @param operatorId
|
||||
* @return
|
||||
*/
|
||||
public Integer addGuildInfo(Users u, Date now, Integer adminId,
|
||||
String guildContactType, String guildContact,
|
||||
Long inviteUid, GuildApply guildApply, Integer operatorId) {
|
||||
public Integer addGuildInfo(Users u, Date now, Integer adminId, String guildContactType, String guildContact,
|
||||
Long inviteUid, GuildApply guildApply, Integer operatorId, Integer regionId) {
|
||||
Guild guild = new Guild();
|
||||
guild.setPartitionId(u.getPartitionId());
|
||||
guild.setOwnerUid(u.getUid());
|
||||
@@ -169,7 +168,7 @@ public class GuildManageAdminService {
|
||||
guild.setAvatar(u.getAvatar());
|
||||
}
|
||||
guild.setOperatorId(operatorId);
|
||||
|
||||
guild.setRegionId(regionId == null ? u.getRegionId() : regionId);
|
||||
guildService.save(guild);
|
||||
|
||||
applicationContext.publishEvent(new NewGuildEvent(new NewGuildMessage(u.getPartitionId(), guild.getId(), u.getUid(), now)));
|
||||
@@ -197,7 +196,7 @@ public class GuildManageAdminService {
|
||||
public void updateGuild(Integer id, String name,
|
||||
String avatar, String backgroundUrl, Integer memberNumLimit,
|
||||
String guildContactType, String guildContact, Long inviteErbanNo,
|
||||
int adminId, Integer operatorId){
|
||||
int adminId, Integer operatorId, Integer regionId){
|
||||
if (null != memberNumLimit && 1 >= memberNumLimit){
|
||||
throw new AdminServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
@@ -225,6 +224,7 @@ public class GuildManageAdminService {
|
||||
.set(StringUtils.isNotBlank(guildContactType), Guild::getGuildContactType, guildContactType)
|
||||
.set(StringUtils.isNotBlank(guildContact), Guild::getGuildContact, guildContact)
|
||||
.set(inviteUid != null, Guild::getInviteUid, inviteUid)
|
||||
.set(regionId != null, Guild::getRegionId, regionId)
|
||||
.set(null != memberNumLimit, Guild::getMemberNumLimit, memberNumLimit)
|
||||
.set(Guild::getOperatorId, operatorId)
|
||||
.update();
|
||||
@@ -301,11 +301,6 @@ public class GuildManageAdminService {
|
||||
regionGuildIdSet.add(guildId);
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<Guild> queryWrapper = Wrappers.<Guild>lambdaQuery()
|
||||
.in(!CollectionUtils.isEmpty(regionGuildIdSet), Guild::getId, regionGuildIdSet)
|
||||
.eq(Guild::getPartitionId, partitionId)
|
||||
.orderByDesc(Guild::getEnable, Guild::getId);
|
||||
|
||||
Long ownerUid = null;
|
||||
if (null != erbanNo){
|
||||
Users u = usersService.getUserByErbanNo(erbanNo);
|
||||
@@ -396,6 +391,11 @@ public class GuildManageAdminService {
|
||||
vo.setOwnerPartitionName(partitionNameMap.get(u.getPartitionId()));
|
||||
vo.setOwnerRegionName(regionNameMap.get(u.getRegionId()));
|
||||
}
|
||||
vo.setPartitionId(guild.getPartitionId());
|
||||
vo.setRegionId(guild.getRegionId());
|
||||
if (guild.getRegionId() != null) {
|
||||
vo.setRegionName(regionNameMap.get(guild.getRegionId()));
|
||||
}
|
||||
|
||||
vo.setMemberNum(memberNumMap.getOrDefault(guild.getId(), 0L));
|
||||
|
||||
@@ -522,6 +522,7 @@ public class GuildManageAdminService {
|
||||
vo.setPartitionName(partitionNameMap.get(u.getPartitionId()));
|
||||
vo.setRoleType(guildMember.getRoleType());
|
||||
vo.setCreateTime(guildMember.getCreateTime());
|
||||
vo.setUpdateTime(guildMember.getUpdateTime());
|
||||
vo.setEnable(guildMember.getEnable());
|
||||
if (guildMember.getAdminId() != null) {
|
||||
vo.setAdminName(adminUserMap.get(guildMember.getAdminId()));
|
||||
|
@@ -124,7 +124,7 @@ public class GuildSuperAdminService {
|
||||
if (!partitionCheck) {
|
||||
throw new AdminServiceException("会长ID Part Error");
|
||||
}
|
||||
vipSendAdminService.send(uid, vipLevel, adminId, days);
|
||||
vipSendAdminService.send(uid, vipLevel, adminId, days, Boolean.FALSE);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -3,7 +3,6 @@ package com.accompany.admin.service.guild;
|
||||
import com.accompany.business.constant.CountryEnum;
|
||||
import com.accompany.business.constant.guild.GuildConstant;
|
||||
import com.accompany.business.constant.guild.GuildWithdrawAccountTypeEnum;
|
||||
import com.accompany.business.model.guild.GuildMember;
|
||||
import com.accompany.business.model.guild.GuildUsdWithdrawRecord;
|
||||
import com.accompany.business.param.BasePageParams;
|
||||
import com.accompany.business.service.SendSysMsgService;
|
||||
@@ -12,7 +11,9 @@ import com.accompany.business.service.guild.GuildUsdOperateService;
|
||||
import com.accompany.business.service.guild.GuildUsdWithdrawRecordService;
|
||||
import com.accompany.business.vo.guild.AgencyWithdrawExamineVo;
|
||||
import com.accompany.common.constant.Constant;
|
||||
import com.accompany.common.utils.DateTimeUtil;
|
||||
import com.accompany.core.enumeration.I18nAlertEnum;
|
||||
import com.accompany.core.enumeration.PartitionEnum;
|
||||
import com.accompany.core.model.AccountBlock;
|
||||
import com.accompany.core.model.PartitionInfo;
|
||||
import com.accompany.core.service.partition.PartitionInfoService;
|
||||
@@ -23,6 +24,8 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.time.DayOfWeek;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -129,6 +132,10 @@ public class GuildUsdWithdrawRecordAdminService {
|
||||
sendSysMsgService.sendPersonTextMsg(record.getUid(), content);
|
||||
|
||||
guildUsdOperateService.withdrawReject(record.getGuildId(), record.getUid(), record.getGuildUsdNum());
|
||||
Date createTime = record.getCreateTime();
|
||||
ZonedDateTime zonedDateTime = DateTimeUtil.convertWithZoneId(createTime, PartitionEnum.getByPartitionId(record.getPartitionId()).getZoneId());
|
||||
String cycleDate = zonedDateTime.with(DayOfWeek.MONDAY).format(DateTimeUtil.dateFormatter);
|
||||
guildUsdOperateService.withdrawNum(cycleDate, record.getPartitionId()).addAndGet(record.getUid(), -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,113 @@
|
||||
package com.accompany.admin.service.guildpolicy2;
|
||||
|
||||
import com.accompany.business.model.guild.Guild;
|
||||
import com.accompany.business.model.guildpolicy2.GuildMemberCrystalSettlementRecord;
|
||||
import com.accompany.business.service.guild.GuildService;
|
||||
import com.accompany.business.service.guildpolicy2.GuildDiamondClearPolicy2Service;
|
||||
import com.accompany.business.service.guildpolicy2.GuildMemberCrystalSettlementRecordService;
|
||||
import com.accompany.business.service.user.UsersService;
|
||||
import com.accompany.business.vo.guildpolicy.GuildDiamondClearAdminVo;
|
||||
import com.accompany.business.vo.guildpolicy.GuildMemberCrystalSettlementRecordAdminVo;
|
||||
import com.accompany.common.result.PageResult;
|
||||
import com.accompany.common.utils.DateTimeUtil;
|
||||
import com.accompany.core.exception.AdminServiceException;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class GuildCrystalSettlementRecordAdminService {
|
||||
|
||||
@Autowired
|
||||
private UsersService usersService;
|
||||
@Autowired
|
||||
private GuildService guildService;
|
||||
@Autowired
|
||||
private GuildMemberCrystalSettlementRecordService recordService;
|
||||
|
||||
public Page<GuildMemberCrystalSettlementRecordAdminVo> page(Integer pageNo, Integer pageSize,
|
||||
Integer guildId,
|
||||
Long ownerErbanNo,
|
||||
Long erbanNo,
|
||||
Integer partitionId,
|
||||
String cycleDate){
|
||||
Long uid = null;
|
||||
if (erbanNo != null) {
|
||||
Users user = usersService.getUserByErbanNo(erbanNo);
|
||||
if (user == null) {
|
||||
throw new AdminServiceException("主播ID:" + erbanNo + ",不存在");
|
||||
}
|
||||
uid = user.getUid();
|
||||
}
|
||||
|
||||
if (guildId == null && ownerErbanNo != null) {
|
||||
Users user = usersService.getUserByErbanNo(ownerErbanNo);
|
||||
if (user == null) {
|
||||
throw new AdminServiceException("公会长ID:" + ownerErbanNo + ",不存在");
|
||||
}
|
||||
Guild vaildGuildByOwnerUid = guildService.getVaildGuildByOwnerUid(user.getUid());
|
||||
if (vaildGuildByOwnerUid == null) {
|
||||
throw new AdminServiceException("公会长ID:" + ownerErbanNo + ",不存在公会");
|
||||
}
|
||||
guildId = vaildGuildByOwnerUid.getId();
|
||||
}
|
||||
|
||||
Page<GuildMemberCrystalSettlementRecordAdminVo> voPage = new Page<>(pageNo, pageSize);
|
||||
Page<GuildMemberCrystalSettlementRecord> poPage = new Page<>(pageNo, pageSize);
|
||||
|
||||
LambdaQueryWrapper<GuildMemberCrystalSettlementRecord> queryWrapper = Wrappers.<GuildMemberCrystalSettlementRecord>lambdaQuery()
|
||||
.eq(StringUtils.hasText(cycleDate), GuildMemberCrystalSettlementRecord::getCycleDate, cycleDate)
|
||||
.eq(null != uid, GuildMemberCrystalSettlementRecord::getUid, uid)
|
||||
.eq(null != guildId, GuildMemberCrystalSettlementRecord::getGuildId, guildId)
|
||||
.eq(null != partitionId, GuildMemberCrystalSettlementRecord::getPartitionId, partitionId)
|
||||
.orderByDesc(GuildMemberCrystalSettlementRecord::getId);
|
||||
|
||||
recordService.page(poPage, queryWrapper);
|
||||
|
||||
if (CollectionUtils.isEmpty(poPage.getRecords())){
|
||||
return voPage;
|
||||
}
|
||||
|
||||
List<Integer> guildIdList = poPage.getRecords().stream().map(GuildMemberCrystalSettlementRecord::getGuildId).distinct().toList();
|
||||
Map<Integer, String> guildNameMap = guildService.listByIds(guildIdList).stream().collect(Collectors.toMap(Guild::getId, Guild::getName));
|
||||
|
||||
List<Long> uidList = poPage.getRecords().stream().map(GuildMemberCrystalSettlementRecord::getUid).distinct().toList();
|
||||
Map<Long, Users> usersMap = usersService.getUsersMapByUids(uidList);
|
||||
|
||||
List<GuildMemberCrystalSettlementRecordAdminVo> voList = poPage.getRecords().stream().map(po -> {
|
||||
GuildMemberCrystalSettlementRecordAdminVo vo = new GuildMemberCrystalSettlementRecordAdminVo();
|
||||
vo.setCycleDate(po.getCycleDate());
|
||||
vo.setGuildId(po.getGuildId());
|
||||
vo.setGuildName(guildNameMap.get(po.getGuildId()));
|
||||
vo.setUid(po.getUid());
|
||||
|
||||
Users u = usersMap.get(po.getUid());
|
||||
if (null != u){
|
||||
vo.setErbanNo(u.getErbanNo());
|
||||
vo.setNick(u.getNick());
|
||||
}
|
||||
|
||||
vo.setGuildCrystalNum(BigDecimal.valueOf(po.getCrystalNum()));
|
||||
vo.setCreateTime(DateTimeUtil.convertDateTime(po.getCreateTime()));
|
||||
|
||||
return vo;
|
||||
|
||||
}).toList();
|
||||
|
||||
voPage.setRecords(voList);
|
||||
voPage.setTotal(poPage.getTotal());
|
||||
|
||||
return voPage;
|
||||
}
|
||||
}
|
@@ -3,16 +3,16 @@ package com.accompany.admin.service.guildpolicy2;
|
||||
import com.accompany.business.model.guild.Guild;
|
||||
import com.accompany.business.model.guildpolicy2.GuildDiamondWagePolicy2;
|
||||
import com.accompany.business.service.guild.GuildService;
|
||||
import com.accompany.business.service.guildpolicy2.GuildDiamondStatisticsPolicy2Service;
|
||||
import com.accompany.business.service.guildpolicy2.GuildDiamondWagePolicy2Service;
|
||||
import com.accompany.business.service.guildpolicy2.GuildMicStatisticsPolicy2Service;
|
||||
import com.accompany.business.service.guildpolicy2.GuildPolicy2Service;
|
||||
import com.accompany.business.service.guildpolicy2.*;
|
||||
import com.accompany.business.service.user.UsersService;
|
||||
import com.accompany.business.util.FullMonthCycleTimeUtil;
|
||||
import com.accompany.business.vo.guild.CycleDateVo;
|
||||
import com.accompany.business.vo.guildpolicy.GuildMemberMicDayVo;
|
||||
import com.accompany.business.vo.guildpolicy.GuildPolicy2MemberAdminVo;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.result.PageResult;
|
||||
import com.accompany.common.utils.DateTimeUtil;
|
||||
import com.accompany.core.enumeration.PartitionEnum;
|
||||
import com.accompany.core.exception.AdminServiceException;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -22,6 +22,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.TreeMap;
|
||||
|
||||
@@ -40,6 +42,8 @@ public class GuildPolicy2AdminService {
|
||||
private GuildService guildService;
|
||||
@Autowired
|
||||
private GuildMicStatisticsPolicy2Service guildMicStatisticsPolicy2Service;
|
||||
@Autowired
|
||||
private GuildDiamondStatisticsPolicy2SettleService guildDiamondStatisticsPolicy2SettleService;
|
||||
|
||||
public PageResult<GuildPolicy2MemberAdminVo> queryMemberPage(Long ownerErbanNo, Integer guildId, Long erbanNo,
|
||||
Integer partitionId, String startDate, String endDate, Integer pageNo, Integer pageSize) {
|
||||
@@ -65,22 +69,31 @@ public class GuildPolicy2AdminService {
|
||||
}
|
||||
guildId = vaildGuildByOwnerUid.getId();
|
||||
}
|
||||
Page<GuildPolicy2MemberAdminVo> voPage = guildDiamondStatisticsPolicy2Service.listByStatDate(startDate, endDate, partitionId, guildId, uid, pageNo, pageSize);
|
||||
List<GuildPolicy2MemberAdminVo> records = voPage.getRecords();
|
||||
PageResult<GuildPolicy2MemberAdminVo> pageResult = new PageResult<>(voPage);
|
||||
if (CollectionUtils.isEmpty(records)) {
|
||||
return pageResult;
|
||||
}
|
||||
TreeMap<BigDecimal, GuildDiamondWagePolicy2> diamondWageMap = guildDiamondWagePolicy2Service.getDiamondWageMap(partitionId);
|
||||
for (GuildPolicy2MemberAdminVo record : records) {
|
||||
GuildDiamondWagePolicy2 diamondWagePolicy2 = guildDiamondWagePolicy2Service.calDiamondWageVo(diamondWageMap, record.getDiamondNum(), record.getMicDay());
|
||||
if (diamondWagePolicy2 == null) {
|
||||
continue;
|
||||
ZonedDateTime zonedDateTime = DateTimeUtil.convertWithZoneId(new Date(), PartitionEnum.TURKEY.getZoneId());
|
||||
String nowDate = FullMonthCycleTimeUtil.getCycleDate(zonedDateTime);
|
||||
PageResult<GuildPolicy2MemberAdminVo> pageResult;
|
||||
if (nowDate.equals(startDate) || startDate.compareTo("2025-09-01") <= 0) {
|
||||
Page<GuildPolicy2MemberAdminVo> voPage = guildDiamondStatisticsPolicy2Service.listByStatDate(startDate, endDate, partitionId, guildId, uid, pageNo, pageSize);
|
||||
List<GuildPolicy2MemberAdminVo> records = voPage.getRecords();
|
||||
pageResult = new PageResult<>(voPage);
|
||||
if (CollectionUtils.isEmpty(records)) {
|
||||
return pageResult;
|
||||
}
|
||||
record.setAnchorDiamondSalary(diamondWagePolicy2.getAnchorDiamondSalary());
|
||||
record.setOwnerSalary(diamondWagePolicy2.getOwnerSalary());
|
||||
record.setAnchorMicSalary(diamondWagePolicy2.getAnchorMicSalary());
|
||||
TreeMap<BigDecimal, GuildDiamondWagePolicy2> diamondWageMap = guildDiamondWagePolicy2Service.getDiamondWageMap(partitionId);
|
||||
for (GuildPolicy2MemberAdminVo record : records) {
|
||||
GuildDiamondWagePolicy2 diamondWagePolicy2 = guildDiamondWagePolicy2Service.calDiamondWageVo(diamondWageMap, record.getDiamondNum(), record.getMicDay());
|
||||
if (diamondWagePolicy2 == null) {
|
||||
continue;
|
||||
}
|
||||
record.setAnchorDiamondSalary(diamondWagePolicy2.getAnchorDiamondSalary());
|
||||
record.setOwnerSalary(diamondWagePolicy2.getOwnerSalary());
|
||||
record.setAnchorMicSalary(diamondWagePolicy2.getAnchorMicSalary());
|
||||
}
|
||||
} else {
|
||||
Page<GuildPolicy2MemberAdminVo> voPage = guildDiamondStatisticsPolicy2SettleService.listByStatDate(startDate, partitionId, guildId, uid, pageNo, pageSize);
|
||||
pageResult = new PageResult<>(voPage);
|
||||
}
|
||||
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,102 @@
|
||||
package com.accompany.admin.service.guildsoviet;
|
||||
|
||||
import com.accompany.business.model.guild.Guild;
|
||||
import com.accompany.business.service.guild.GuildService;
|
||||
import com.accompany.business.service.guildsoviet.GuildExtraDiamondDayService;
|
||||
import com.accompany.business.service.guildsoviet.RoomExtraDiamondDayService;
|
||||
import com.accompany.business.service.user.UsersService;
|
||||
import com.accompany.business.vo.guildsoviet.GuildMemberSovietAdminVo;
|
||||
import com.accompany.business.vo.guildsoviet.GuildSovietAdminVo;
|
||||
import com.accompany.business.vo.guildsoviet.RoomSovietAdminVo;
|
||||
import com.accompany.common.result.PageResult;
|
||||
import com.accompany.core.exception.AdminServiceException;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class GuildSovietAdminService {
|
||||
@Autowired
|
||||
private GuildExtraDiamondDayService guildExtraDiamondDayService;
|
||||
@Autowired
|
||||
private RoomExtraDiamondDayService roomExtraDiamondDayService;
|
||||
@Autowired
|
||||
private UsersService usersService;
|
||||
@Autowired
|
||||
private GuildService guildService;
|
||||
|
||||
public PageResult<GuildSovietAdminVo> listGuildSovietAdminVo(Integer partitionId, Integer guildId, Long erbanNo,
|
||||
Integer regionId, String startDate, String endDate,
|
||||
Integer pageNo, Integer pageSize) {
|
||||
Long uid = null;
|
||||
if (erbanNo != null) {
|
||||
Users user = usersService.getUserByErbanNo(erbanNo);
|
||||
if (user == null) {
|
||||
throw new AdminServiceException("公会长ID不存在");
|
||||
}
|
||||
uid = user.getUid();
|
||||
}
|
||||
Page<GuildSovietAdminVo> guildSovietAdminVoPage =
|
||||
guildExtraDiamondDayService.pageGuildSovietAdminVo(new Page<>(pageNo, pageSize), partitionId, guildId, uid, regionId, startDate, endDate);
|
||||
return new PageResult<>(guildSovietAdminVoPage);
|
||||
}
|
||||
|
||||
|
||||
public PageResult<GuildMemberSovietAdminVo> listGuildMemberSovietAdminVo(Integer partitionId, Byte ebable,
|
||||
Long ownerErbanNo, Integer guildId,
|
||||
Long erbanNo, Integer regionId,
|
||||
String startDate, String endDate,
|
||||
Integer pageNo, Integer pageSize) {
|
||||
Long uid = null;
|
||||
if (erbanNo != null) {
|
||||
Users user = usersService.getUserByErbanNo(erbanNo);
|
||||
if (user == null) {
|
||||
throw new AdminServiceException("公会长ID不存在");
|
||||
}
|
||||
uid = user.getUid();
|
||||
}
|
||||
Set<Integer> guildIdSet = new HashSet<>();
|
||||
if (guildId != null) {
|
||||
guildIdSet.add(guildId);
|
||||
}
|
||||
if (ownerErbanNo != null) {
|
||||
Users ownUser = usersService.getUserByErbanNo(ownerErbanNo);
|
||||
if (ownUser == null) {
|
||||
throw new AdminServiceException("公会长ID不存在");
|
||||
}
|
||||
List<Guild> guildByOwnerUid = guildService.getGuildByOwnerUid(ownUser.getUid());
|
||||
if (CollectionUtils.isEmpty(guildByOwnerUid)) {
|
||||
throw new AdminServiceException("公会长ID不存在公会");
|
||||
}
|
||||
List<Integer> guilIds = guildByOwnerUid.stream().map(Guild::getId).collect(Collectors.toList());
|
||||
if (guildId != null && !guilIds.contains(guildId)) {
|
||||
throw new AdminServiceException("公会ID与公会ID所在公会不一致");
|
||||
}
|
||||
guildIdSet.addAll(guilIds);
|
||||
}
|
||||
Page<GuildMemberSovietAdminVo> guildSovietAdminVoPage =
|
||||
guildExtraDiamondDayService.pageGuildMemberSovietAdminVo(new Page<>(pageNo, pageSize), guildIdSet, partitionId, uid, regionId, ebable, startDate, endDate);
|
||||
return new PageResult<>(guildSovietAdminVoPage);
|
||||
}
|
||||
|
||||
public PageResult<RoomSovietAdminVo> listRoomSovietAdminVo(Integer partitionId, Long erbanNo,Integer regionId, String cycleDate,
|
||||
Integer pageNo, Integer pageSize) {
|
||||
Long uid = null;
|
||||
if (erbanNo != null) {
|
||||
Users user = usersService.getUserByErbanNo(erbanNo);
|
||||
if (user == null) {}
|
||||
uid = user.getUid();
|
||||
}
|
||||
Page<RoomSovietAdminVo> guildSovietAdminVoPage =
|
||||
roomExtraDiamondDayService.pageRoomSovietAdminVo(new Page<>(pageNo, pageSize), partitionId, uid, regionId, cycleDate);
|
||||
return new PageResult<>(guildSovietAdminVoPage);
|
||||
}
|
||||
|
||||
}
|
@@ -1,6 +1,5 @@
|
||||
package com.accompany.admin.service.lucky;
|
||||
|
||||
import cn.hippo4j.common.toolkit.CollectionUtil;
|
||||
import com.accompany.admin.service.system.SysConfAdminService;
|
||||
import com.accompany.admin.vo.BravoConfigAdminVo;
|
||||
import com.accompany.admin.vo.luckybag.BravoPersonalStatVo;
|
||||
@@ -69,7 +68,7 @@ public class BravoPoolAdminService {
|
||||
@Autowired
|
||||
private BravoUserMetaService userMetaService;
|
||||
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
private String minStartDate = "2025-03-20";
|
||||
@@ -83,7 +82,7 @@ public class BravoPoolAdminService {
|
||||
|
||||
Date now = new Date();
|
||||
List<BravoPool> poList = listPoolByType(type);
|
||||
Map<Integer, BravoPool> poMap = !CollectionUtil.isEmpty(poList)?
|
||||
Map<Integer, BravoPool> poMap = !CollectionUtils.isEmpty(poList)?
|
||||
poList.stream().collect(Collectors.toMap(BravoPool::getId, po->po)):
|
||||
new HashMap<>();
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package com.accompany.admin.service.lucky;
|
||||
|
||||
import cn.hippo4j.common.toolkit.CollectionUtil;
|
||||
import com.accompany.admin.service.system.SysConfAdminService;
|
||||
import com.accompany.admin.vo.Lucky24ConfigAdminVo;
|
||||
import com.accompany.business.dto.lucky.Lucky24GiftConfig;
|
||||
@@ -57,7 +56,7 @@ public class Lucky24PoolAdminService {
|
||||
|
||||
Date now = new Date();
|
||||
List<Lucky24Pool> poList = listPoolByType(type);
|
||||
Map<Integer, Lucky24Pool> poMap = !CollectionUtil.isEmpty(poList)?
|
||||
Map<Integer, Lucky24Pool> poMap = !CollectionUtils.isEmpty(poList)?
|
||||
poList.stream().collect(Collectors.toMap(Lucky24Pool::getId, po->po)):
|
||||
new HashMap<>();
|
||||
|
||||
@@ -119,6 +118,9 @@ public class Lucky24PoolAdminService {
|
||||
Map<Long, Users> blackUserMap = usersService.getUsersMapByUids(config.getBlackUidList());
|
||||
vo.setBlackErbanNoList(blackUserMap.values().stream().map(Users::getErbanNo).collect(Collectors.toList()));
|
||||
|
||||
Map<Long, Users> adminFollowUserMap = usersService.getUsersMapByUids(config.getAdminFollowUidList());
|
||||
vo.setAdminFollowErbanNoList(adminFollowUserMap.values().stream().map(Users::getErbanNo).collect(Collectors.toList()));
|
||||
|
||||
Map<Long, BigDecimal> erbanNoProductionRatioMap = new HashMap<>();
|
||||
Map<Long, Users> whiteUserMap = usersService.getUsersMapByUids(new ArrayList<>(config.getWhiteUidProductionRatioMap().keySet()));
|
||||
for (Long uid: whiteUserMap.keySet()){
|
||||
@@ -177,6 +179,20 @@ public class Lucky24PoolAdminService {
|
||||
config.setBlackUidList(uidList);
|
||||
}
|
||||
}
|
||||
if (null != vo.getAdminFollowErbanNoList()){
|
||||
if (CollectionUtils.isEmpty(vo.getAdminFollowErbanNoList())){
|
||||
config.setAdminFollowUidList(Collections.emptyList());
|
||||
} else {
|
||||
List<Long> uidList = vo.getAdminFollowErbanNoList().stream().map(erbanNo->{
|
||||
Users u = usersService.getUserByErbanNo(erbanNo);
|
||||
if (null != u){
|
||||
return u.getUid();
|
||||
}
|
||||
return null;
|
||||
}).filter(Objects::nonNull).distinct().collect(Collectors.toList());
|
||||
config.setAdminFollowUidList(uidList);
|
||||
}
|
||||
}
|
||||
if (null != vo.getWhiteErbanNoProductionRatioMap()){
|
||||
if (CollectionUtils.isEmpty(vo.getWhiteErbanNoProductionRatioMap())){
|
||||
config.setWhiteUidProductionRatioMap(Collections.emptyMap());
|
||||
|
@@ -6,11 +6,13 @@ import com.accompany.admin.vo.luckybag.Lucky24PersonalStatVo;
|
||||
import com.accompany.admin.vo.luckybag.Lucky24PlatformStatVo;
|
||||
import com.accompany.admin.vo.luckybag.Lucky24RecordAdminVo;
|
||||
import com.accompany.business.constant.Lucky24PoolTypeEnum;
|
||||
import com.accompany.business.dto.lucky.Lucky24GiftConfig;
|
||||
import com.accompany.business.model.Gift;
|
||||
import com.accompany.business.model.lucky.Lucky24Pool;
|
||||
import com.accompany.business.mybatismapper.lucky.Lucky24PoolMapper;
|
||||
import com.accompany.business.mybatismapper.lucky.Lucky24StatMapper;
|
||||
import com.accompany.business.service.gift.GiftService;
|
||||
import com.accompany.business.service.gift.Lucky24GiftSendService;
|
||||
import com.accompany.business.service.user.UsersService;
|
||||
import com.accompany.common.result.PageResult;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
@@ -62,7 +64,7 @@ public class Lucky24RecordAdminService {
|
||||
@Autowired
|
||||
private Lucky24RecordMapper recordMapper;
|
||||
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
private String minStartDate = "2024-09-20";
|
||||
@@ -70,6 +72,8 @@ public class Lucky24RecordAdminService {
|
||||
private Lucky24PoolMapper poolMapper;
|
||||
@Autowired
|
||||
private GiftService giftService;
|
||||
@Autowired
|
||||
private Lucky24GiftSendService lucky24GiftSendService;
|
||||
|
||||
private final Map<String, Function<Lucky24PersonalStat, Object>> fieldExtractors = Map.of(
|
||||
"totalInput", Lucky24PersonalStat::getTotalInput,
|
||||
@@ -108,13 +112,19 @@ public class Lucky24RecordAdminService {
|
||||
Date startTime = DateTimeUtil.getBeginTimeOfDay(DateTimeUtil.convertStrToDate(endDate, DateTimeUtil.DEFAULT_DATE_PATTERN));
|
||||
ZonedDateTime zonedStartTime = startTime.toInstant().atZone(ZoneId.systemDefault());
|
||||
Date systemStartTime = Date.from(zonedStartTime.withZoneSameLocal(ZoneId.of(partitionInfo.getZoneId())).toInstant());
|
||||
String zoneDateTableName = DateTimeUtil.convertDate(systemStartTime, DateTimeUtil.DEFAULT_DATE_PATTERN_);
|
||||
|
||||
Date endTime = DateTimeUtil.getEndTimeOfDay(DateTimeUtil.convertStrToDate(endDate, DateTimeUtil.DEFAULT_DATE_PATTERN));
|
||||
ZonedDateTime zonedEndTime = endTime.toInstant().atZone(ZoneId.systemDefault());
|
||||
Date systemEndTime = Date.from(zonedEndTime.withZoneSameLocal(ZoneId.of(partitionInfo.getZoneId())).toInstant());
|
||||
String systemDateTableName = DateTimeUtil.convertDate(systemEndTime, DateTimeUtil.DEFAULT_DATE_PATTERN_);
|
||||
if (zoneDateTableName.equals(systemDateTableName)){
|
||||
systemDateTableName = null;
|
||||
}
|
||||
|
||||
List<Lucky24PlatformStat> list = null == poolType?
|
||||
recordMapper.listPlatform(endDate, partitionId, poolTypeList, systemStartTime, systemEndTime):
|
||||
recordMapper.listPlatformByPoolType(endDate, partitionId, poolTypeList, systemStartTime, systemEndTime);
|
||||
recordMapper.listPlatformManual(endDate, partitionId, poolTypeList, systemStartTime, systemEndTime, zoneDateTableName, systemDateTableName):
|
||||
recordMapper.listPlatformByPoolTypeManual(endDate, partitionId, poolTypeList, systemStartTime, systemEndTime, zoneDateTableName, systemDateTableName);
|
||||
for (Lucky24PlatformStat stat: list) {
|
||||
statMap.put(stat.getDate(), stat);
|
||||
}
|
||||
@@ -159,25 +169,39 @@ public class Lucky24RecordAdminService {
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public Lucky24PersonalStatVo getPersonal(Integer partitionId, Long erbanNo, String date, String userRechargeLevel, Integer poolType,
|
||||
public Lucky24PersonalStatVo getPersonal(Integer partitionId, List<Long> followUidList, Long erbanNo, String date, String userRechargeLevel, Integer poolType,
|
||||
String sortCol, String sortOrder,
|
||||
int pageNo, int pageSize) {
|
||||
Page<Lucky24PersonalStat> page = new Page<>(pageNo, pageSize);
|
||||
|
||||
Long uid = null;
|
||||
if (null != erbanNo){
|
||||
List<Long> uidList = new ArrayList<>();
|
||||
|
||||
if (!CollectionUtils.isEmpty(followUidList)){
|
||||
List<Users> followUsers = usersService.listUsersFromDbInUids(followUidList);
|
||||
|
||||
List<Long> partitionFollowUidList = followUsers.stream().filter(u->u.getPartitionId().equals(partitionId)).map(Users::getUid).toList();
|
||||
if (CollectionUtils.isEmpty(partitionFollowUidList)){
|
||||
return new Lucky24PersonalStatVo(new PageResult<>(page));
|
||||
}
|
||||
|
||||
uidList.addAll(followUsers.stream().filter(u->u.getPartitionId().equals(partitionId)).map(Users::getUid).toList());
|
||||
|
||||
} else if (null != erbanNo){
|
||||
Users u = usersService.getUserByErbanNo(erbanNo);
|
||||
if (null == u || !u.getPartitionId().equals(partitionId)){
|
||||
return new Lucky24PersonalStatVo(new PageResult<>(page));
|
||||
}
|
||||
|
||||
uid = u.getUid();
|
||||
uidList.add(u.getUid());
|
||||
}
|
||||
|
||||
PartitionInfo partitionInfo = partitionInfoService.getById(partitionId);
|
||||
String zonedDateStr = DateTimeUtil.getZonedTodayStr(partitionInfo.getZoneId());
|
||||
if (StringUtils.hasText(date)){
|
||||
List<Lucky24PersonalStat> list = zonedDateStr.equals(date)? listPersonal(partitionId, partitionInfo.getZoneId(), uid, date, userRechargeLevel, poolType):
|
||||
statMapper.listPersonalStat(partitionId, uid, userRechargeLevel, poolType, date, date);
|
||||
List<Lucky24PersonalStat> list = zonedDateStr.equals(date)? listPersonal(partitionId, partitionInfo.getZoneId(), uidList, date, userRechargeLevel, poolType):
|
||||
statMapper.listPersonalStat(partitionId, uidList, userRechargeLevel, poolType, date, date);
|
||||
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return new Lucky24PersonalStatVo(new PageResult<>(page));
|
||||
@@ -212,7 +236,9 @@ public class Lucky24RecordAdminService {
|
||||
}
|
||||
|
||||
// 如果列表为空或起始索引超出范围,则创建空的子列表
|
||||
List<Lucky24PersonalStat> subList = (list.isEmpty() || startIndex >= list.size())
|
||||
List<Lucky24PersonalStat> subList = pageNo <= 0 || pageSize <= 0?
|
||||
list:
|
||||
(list.isEmpty() || startIndex >= list.size())
|
||||
? Collections.emptyList()
|
||||
: list.subList(startIndex, endIndex);
|
||||
|
||||
@@ -220,7 +246,8 @@ public class Lucky24RecordAdminService {
|
||||
return new Lucky24PersonalStatVo(totalInput, totalOutput, totalProductionRatio, new PageResult<>(page));
|
||||
}
|
||||
|
||||
List<Long> uidList = subList.stream().map(Lucky24PersonalStat::getUid).collect(Collectors.toList());
|
||||
uidList = subList.stream().map(Lucky24PersonalStat::getUid).collect(Collectors.toList());
|
||||
|
||||
Map<Long, Users> usersMap = usersService.getUsersMapByUids(uidList);
|
||||
Map<Long, String> userRechargeLevelMap = userRechargeLevelService.mapLevelByUid(uidList);
|
||||
for (Lucky24PersonalStat stat: subList) {
|
||||
@@ -257,10 +284,10 @@ public class Lucky24RecordAdminService {
|
||||
|
||||
CountDownLatch cdl = new CountDownLatch(2);
|
||||
|
||||
Long finalUid = uid;
|
||||
List<Long> finalUidList = uidList;
|
||||
bizExecutor.execute(()->{
|
||||
try {
|
||||
List<Lucky24PersonalStat> list = listPersonal(partitionId, partitionInfo.getZoneId(), finalUid, zonedDateStr, userRechargeLevel, poolType);
|
||||
List<Lucky24PersonalStat> list = listPersonal(partitionId, partitionInfo.getZoneId(), finalUidList, zonedDateStr, userRechargeLevel, poolType);
|
||||
for (Lucky24PersonalStat stat: list) {
|
||||
statMap.put(stat.getDate(), stat);
|
||||
|
||||
@@ -282,7 +309,7 @@ public class Lucky24RecordAdminService {
|
||||
try {
|
||||
String historyStartDate = dateStrList.get(0);
|
||||
String historyEndDate = dateStrList.get(dateStrList.size() - 1);
|
||||
List<Lucky24PersonalStat> statList = statMapper.listPersonalStat(partitionId, finalUid, userRechargeLevel, poolType, historyStartDate, historyEndDate);
|
||||
List<Lucky24PersonalStat> statList = statMapper.listPersonalStat(partitionId, finalUidList, userRechargeLevel, poolType, historyStartDate, historyEndDate);
|
||||
if (!CollectionUtils.isEmpty(statList)) {
|
||||
for (Lucky24PersonalStat stat: statList) {
|
||||
statMap.put(stat.getDate(), stat);
|
||||
@@ -312,10 +339,11 @@ public class Lucky24RecordAdminService {
|
||||
dateStrList.sort(Comparator.reverseOrder());
|
||||
|
||||
// 按大到小排序
|
||||
int startIndex = (pageNo -1) * pageSize;
|
||||
int endIndex = Math.min(startIndex + pageSize, dateStrList.size());
|
||||
int startIndex = pageNo <= 0 || pageSize <= 0? 0: (pageNo -1) * pageSize;
|
||||
int endIndex = pageNo <= 0 || pageSize <= 0? dateStrList.size(): Math.min(startIndex + pageSize, dateStrList.size());
|
||||
page.setTotal(dateStrList.size());
|
||||
|
||||
Long finalUid = uid;
|
||||
List<String> subDateStrList = dateStrList.subList(startIndex, endIndex);
|
||||
page.setRecords(subDateStrList.parallelStream().map(dateStr->{
|
||||
Lucky24PersonalStat stat = statMap.get(dateStr);
|
||||
@@ -331,7 +359,22 @@ public class Lucky24RecordAdminService {
|
||||
return new Lucky24PersonalStatVo(totalInput, totalOutput, totalProductionRatio, new PageResult<>(page));
|
||||
}
|
||||
|
||||
private List<Lucky24PersonalStat> listPersonal(int partitionId, String zonedId, Long uid, String date, String userRechargeLevel, Integer poolType) {
|
||||
@SneakyThrows
|
||||
public Lucky24PersonalStatVo getFollowUserPersonal(Integer partitionId, String date, String userRechargeLevel, Integer poolType,
|
||||
String sortCol, String sortOrder,
|
||||
int pageNo, int pageSize) {
|
||||
Lucky24GiftConfig config = lucky24GiftSendService.getConfig();
|
||||
List<Long> followUidList = config.getAdminFollowUidList();
|
||||
if (CollectionUtils.isEmpty(followUidList)){
|
||||
return new Lucky24PersonalStatVo(new PageResult<>(new Page<>(pageNo, pageSize)));
|
||||
}
|
||||
|
||||
List<Long> uidList = followUidList.stream().sorted().toList();
|
||||
|
||||
return getPersonal(partitionId, uidList, null, date, userRechargeLevel, poolType, sortCol, sortOrder, pageNo, pageSize);
|
||||
}
|
||||
|
||||
private List<Lucky24PersonalStat> listPersonal(int partitionId, String zonedId, List<Long> uidList, String date, String userRechargeLevel, Integer poolType) {
|
||||
List<Integer> poolTypeList = null == poolType ?
|
||||
Arrays.stream(Lucky24PoolTypeEnum.values()).map(Lucky24PoolTypeEnum::getType).sorted().toList(): Collections.singletonList(poolType);
|
||||
|
||||
@@ -343,9 +386,10 @@ public class Lucky24RecordAdminService {
|
||||
Date endTime = DateTimeUtil.getEndTimeOfDay(DateTimeUtil.convertStrToDate(date, DateTimeUtil.DEFAULT_DATE_PATTERN));
|
||||
ZonedDateTime zonedEndTime = endTime.toInstant().atZone(ZoneId.systemDefault());
|
||||
Date systemEndTime = Date.from(zonedEndTime.withZoneSameLocal(zoneId).toInstant());
|
||||
|
||||
return null == poolType?
|
||||
recordMapper.listPersonal(date, partitionId, poolTypeList, systemStartTime, systemEndTime, uid, userRechargeLevel):
|
||||
recordMapper.listPersonalByPoolType(date, partitionId, poolTypeList, systemStartTime, systemEndTime, uid, userRechargeLevel);
|
||||
recordMapper.listPersonal(date, partitionId, poolTypeList, systemStartTime, systemEndTime, uidList, userRechargeLevel):
|
||||
recordMapper.listPersonalByPoolType(date, partitionId, poolTypeList, systemStartTime, systemEndTime, uidList, userRechargeLevel);
|
||||
}
|
||||
|
||||
public Page<Lucky24RecordAdminVo> pageRecord(Long uid, String date, Integer poolType, int pageNo, int pageSize) {
|
||||
@@ -457,11 +501,13 @@ public class Lucky24RecordAdminService {
|
||||
Long uid = u.getUid();
|
||||
String userRechargeLevel = userRechargeLevelService.getLevelByUid(uid);
|
||||
|
||||
List<Long> uidList = Collections.singletonList(uid);
|
||||
|
||||
PartitionEnum partitionEnum = PartitionEnum.getByPartitionId(u.getPartitionId());
|
||||
String zonedDateStr = DateTimeUtil.getZonedTodayStr(partitionEnum.getZoneId());
|
||||
if (startDate.equals(endDate)){
|
||||
List<Lucky24PersonalStat> list = zonedDateStr.equals(endDate)? listPersonal(partitionEnum.getId(), partitionEnum.getZoneId(), uid, zonedDateStr, null, null):
|
||||
statMapper.listPersonalStat(partitionEnum.getId(), uid, null, null, startDate, endDate);
|
||||
List<Lucky24PersonalStat> list = zonedDateStr.equals(endDate)? listPersonal(partitionEnum.getId(), partitionEnum.getZoneId(), uidList, zonedDateStr, null, null):
|
||||
statMapper.listPersonalStat(partitionEnum.getId(), uidList, null, null, startDate, endDate);
|
||||
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return Collections.emptyList();
|
||||
@@ -478,19 +524,11 @@ public class Lucky24RecordAdminService {
|
||||
}
|
||||
|
||||
if (!endDate.equals(zonedDateStr)){
|
||||
List<Lucky24PersonalStat> statList = statMapper.listPersonalStat(partitionEnum.getId(), uid, null, null, startDate, endDate);
|
||||
List<Lucky24PersonalStat> statList = statMapper.listPersonalStat(partitionEnum.getId(), uidList, null, null, startDate, endDate);
|
||||
if (CollectionUtils.isEmpty(statList)){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
// List<Lucky24OperatorPersonalStatVo> voList = new ArrayList<>(statList.stream().map(stat -> {
|
||||
// BigDecimal receiverReward = BigDecimal.valueOf(stat.getTotalInput()).multiply(receiverRewardRatio);
|
||||
// BigDecimal production = BigDecimal.valueOf(stat.getTotalInput()).multiply(inputRatio).subtract(BigDecimal.valueOf(stat.getTotalInput()));
|
||||
// BigDecimal productionRatio = stat.getTotalOutput() > 0L ?(receiverReward.add(BigDecimal.valueOf(stat.getTotalInput())))
|
||||
// .divide(BigDecimal.valueOf(stat.getTotalOutput()), 4, RoundingMode.HALF_UP): BigDecimal.ZERO;
|
||||
// return new Lucky24OperatorPersonalStatVo(stat.getDate(), partitionEnum.getId(), uid, erbanNo, userRechargeLevel, stat.getTotalInput(), stat.getTotalOutput(), receiverReward.longValue(), production, productionRatio);
|
||||
// }).sorted(Comparator.comparing(Lucky24OperatorPersonalStatVo::getDate).reversed()).toList());
|
||||
|
||||
long totalInput = statList.stream().mapToLong(Lucky24PersonalStat::getTotalInput).sum();
|
||||
long totalOutput = statList.stream().mapToLong(Lucky24PersonalStat::getTotalOutput).sum();
|
||||
BigDecimal receiverReward = BigDecimal.valueOf(totalInput).multiply(receiverRewardRatio);
|
||||
@@ -510,7 +548,7 @@ public class Lucky24RecordAdminService {
|
||||
|
||||
bizExecutor.execute(()->{
|
||||
try {
|
||||
List<Lucky24PersonalStat> list = listPersonal(partitionEnum.getId(), partitionEnum.getZoneId(), uid, zonedDateStr, null, null);
|
||||
List<Lucky24PersonalStat> list = listPersonal(partitionEnum.getId(), partitionEnum.getZoneId(), uidList, zonedDateStr, null, null);
|
||||
for (Lucky24PersonalStat stat: list) {
|
||||
statMap.put(stat.getDate(), stat);
|
||||
}
|
||||
@@ -525,7 +563,7 @@ public class Lucky24RecordAdminService {
|
||||
try {
|
||||
String historyStartDate = dateStrList.get(0);
|
||||
String historyEndDate = dateStrList.get(dateStrList.size() - 1);
|
||||
List<Lucky24PersonalStat> statList = statMapper.listPersonalStat(partitionEnum.getId(), uid, null, null, historyStartDate, historyEndDate);
|
||||
List<Lucky24PersonalStat> statList = statMapper.listPersonalStat(partitionEnum.getId(), uidList, null, null, historyStartDate, historyEndDate);
|
||||
if (CollectionUtils.isEmpty(statList)){
|
||||
return;
|
||||
}
|
||||
@@ -543,20 +581,6 @@ public class Lucky24RecordAdminService {
|
||||
|
||||
dateStrList.add(endDate);
|
||||
|
||||
// List<Lucky24OperatorPersonalStatVo> voList = new ArrayList<>(dateStrList.stream().map(dateStr -> {
|
||||
// Lucky24PersonalStat stat = statMap.get(dateStr);
|
||||
// if (null == stat){
|
||||
// return new Lucky24OperatorPersonalStatVo(dateStr, partitionEnum.getId(), uid, erbanNo, userRechargeLevel,
|
||||
// BigDecimal.ZERO.longValue(), BigDecimal.ZERO.longValue(), BigDecimal.ZERO.longValue(), BigDecimal.ZERO, BigDecimal.ZERO);
|
||||
// }
|
||||
//
|
||||
// BigDecimal receiverReward = BigDecimal.valueOf(stat.getTotalInput()).multiply(receiverRewardRatio);
|
||||
// BigDecimal production = BigDecimal.valueOf(stat.getTotalInput()).multiply(inputRatio).subtract(BigDecimal.valueOf(stat.getTotalInput()));
|
||||
// BigDecimal productionRatio = stat.getTotalOutput() > 0L?
|
||||
// (receiverReward.add(BigDecimal.valueOf(stat.getTotalInput()))).divide(BigDecimal.valueOf(stat.getTotalOutput()), 4, RoundingMode.HALF_UP): BigDecimal.ZERO;
|
||||
// return new Lucky24OperatorPersonalStatVo(stat.getDate(), partitionEnum.getId(), uid, erbanNo, userRechargeLevel, stat.getTotalInput(), stat.getTotalOutput(), receiverReward.longValue(), production, productionRatio);
|
||||
// }).sorted(Comparator.comparing(Lucky24OperatorPersonalStatVo::getDate).reversed()).toList());
|
||||
|
||||
long totalInput = dateStrList.stream().filter(statMap::containsKey).map(statMap::get).mapToLong(Lucky24PersonalStat::getTotalInput).sum();
|
||||
long totalOutput = dateStrList.stream().filter(statMap::containsKey).map(statMap::get).mapToLong(Lucky24PersonalStat::getTotalOutput).sum();
|
||||
BigDecimal receiverReward = BigDecimal.valueOf(totalInput).multiply(receiverRewardRatio);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package com.accompany.admin.service.lucky;
|
||||
|
||||
import cn.hippo4j.common.toolkit.CollectionUtil;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import com.accompany.admin.service.system.SysConfAdminService;
|
||||
import com.accompany.admin.vo.Lucky25ConfigAdminVo;
|
||||
import com.accompany.business.dto.lucky.Lucky25GiftConfig;
|
||||
@@ -58,7 +58,7 @@ public class Lucky25PoolAdminService {
|
||||
|
||||
Date now = new Date();
|
||||
List<Lucky25Pool> poList = listPoolByType(type);
|
||||
Map<Integer, Lucky25Pool> poMap = !CollectionUtil.isEmpty(poList)?
|
||||
Map<Integer, Lucky25Pool> poMap = !CollectionUtils.isEmpty(poList)?
|
||||
poList.stream().collect(Collectors.toMap(Lucky25Pool::getId, po->po)):
|
||||
new HashMap<>();
|
||||
|
||||
|
@@ -53,7 +53,7 @@ public class Lucky25RecordAdminService {
|
||||
@Autowired
|
||||
private Lucky25RecordMapper recordMapper;
|
||||
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
private String minStartDate = "2025-05-04";
|
||||
|
@@ -0,0 +1,107 @@
|
||||
package com.accompany.admin.service.miniGame;
|
||||
|
||||
import com.accompany.admin.vo.miniGame.MiniGameForSudAdminDetailVo;
|
||||
import com.accompany.admin.vo.miniGame.MiniGameForSudAdminStatsVo;
|
||||
import com.accompany.business.model.miniGame.MiniGame;
|
||||
import com.accompany.business.model.miniGame.MiniGameRound;
|
||||
import com.accompany.admin.mapper.miniGame.MiniGameForSudAdminMapper;
|
||||
import com.accompany.business.service.miniGame.MiniGameService;
|
||||
import com.accompany.common.utils.DateTimeUtil;
|
||||
import com.accompany.core.util.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class MiniGameForSudAdminService extends ServiceImpl<MiniGameForSudAdminMapper, MiniGameRound> {
|
||||
|
||||
@Autowired
|
||||
private MiniGameForSudAdminMapper miniGameForSudAdminMapper;
|
||||
|
||||
@Autowired
|
||||
private MiniGameService miniGameService;
|
||||
|
||||
/**
|
||||
* 获取游戏时长统计列表
|
||||
* @param gameId 游戏ID
|
||||
* @param month 月份 (格式: yyyy-MM)
|
||||
* @return 统计列表
|
||||
*/
|
||||
public List<MiniGameForSudAdminStatsVo> listStat(String gameId, String month) {
|
||||
// 获取所有游戏信息
|
||||
List<MiniGame> miniGameList = miniGameService.miniGameAllList(null);
|
||||
if (CollectionUtils.isEmpty(miniGameList)){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
if (!StringUtils.isBlank(gameId)){
|
||||
miniGameList = miniGameList.stream().filter(game -> game.getMgIdStr().equals(gameId)).toList();
|
||||
}
|
||||
|
||||
if (CollectionUtils.isEmpty(miniGameList)){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
// 计算查询时间范围
|
||||
Date monthDateTime = DateTimeUtil.convertStrToDate(month, DateTimeUtil.DEFAULT_DATE_PATTERN_YEAR_MONTH);
|
||||
long startTime = DateTimeUtil.getBeginTimeOfMonth(monthDateTime).getTime() / 1000;
|
||||
long endTime = DateTimeUtil.getEndTimeOfMonth(monthDateTime).getTime() / 1000;
|
||||
|
||||
// 查询统计数据
|
||||
List<MiniGameForSudAdminStatsVo> statList = miniGameForSudAdminMapper.statGameDurationByMonth(gameId, startTime, endTime);
|
||||
if (CollectionUtils.isEmpty(statList)){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
Map<String, MiniGameForSudAdminStatsVo> statMap = statList.stream().collect(Collectors.toMap(MiniGameForSudAdminStatsVo::getGameId, vo -> vo));
|
||||
|
||||
return miniGameList.stream().map(game -> {
|
||||
MiniGameForSudAdminStatsVo vo = statMap.get(game.getMgIdStr());
|
||||
if (vo == null){
|
||||
vo = new MiniGameForSudAdminStatsVo();
|
||||
vo.setGameId(game.getMgIdStr());
|
||||
vo.setGameName(game.getName());
|
||||
vo.setTotalDuration(0L);
|
||||
vo.setEnDuration(0L);
|
||||
vo.setArDuration(0L);
|
||||
vo.setZhDuration(0L);
|
||||
vo.setTrDuration(0L);
|
||||
vo.setEn2Duration(0L);
|
||||
}
|
||||
vo.setGameName(game.getName());
|
||||
vo.setStatMonth(month);
|
||||
return vo;
|
||||
}).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取游戏时长明细列表
|
||||
* @param gameId 游戏ID
|
||||
* @param month 月份 (格式: yyyy-MM)
|
||||
* @param page 页码
|
||||
* @param size 每页大小
|
||||
* @return 明细列表
|
||||
*/
|
||||
public Page<MiniGameForSudAdminDetailVo> pageDetail(String gameId, String month, Integer page, Integer size) {
|
||||
|
||||
Page<MiniGameForSudAdminDetailVo> voPage = new Page<>(page, size);
|
||||
|
||||
// 计算查询时间范围
|
||||
Date monthDateTime = DateTimeUtil.convertStrToDate(month, DateTimeUtil.DEFAULT_DATE_PATTERN_YEAR_MONTH);
|
||||
long startTime = DateTimeUtil.getBeginTimeOfMonth(monthDateTime).getTime() / 1000;
|
||||
long endTime = DateTimeUtil.getEndTimeOfMonth(monthDateTime).getTime() / 1000;
|
||||
|
||||
return miniGameForSudAdminMapper.pageGameRoundDetail(voPage, gameId, startTime, endTime);
|
||||
}
|
||||
|
||||
}
|
@@ -109,7 +109,7 @@ public class PackInfoAdminService {
|
||||
private PackAwardVo coverAwardVo(ActivityH5LevelAward award, Map<Long, PackItem> awardItemMap) {
|
||||
PackAwardVo awardVo = new PackAwardVo();
|
||||
awardVo.setAwardId(award.getId());
|
||||
RewardVo rewardVo = activityH5LevelAwardService.coverRewardByType(award.getAwardType(), award.getAwardId().intValue());
|
||||
RewardVo rewardVo = activityH5LevelAwardService.coverAdminRewardByType(award.getAwardType(), award.getAwardId().intValue());
|
||||
if (rewardVo != null) {
|
||||
awardVo.setAwardName(rewardVo.getName());
|
||||
awardVo.setAwardPic(rewardVo.getPic());
|
||||
|
@@ -19,12 +19,15 @@ public class PersonalCenterAdminService {
|
||||
@Autowired
|
||||
private PersonalCenterMapper personalCenterMapper;
|
||||
|
||||
public IPage getList(Integer pageNum, Integer pageSize, Integer centerId){
|
||||
public IPage getList(Integer pageNum, Integer pageSize, Integer centerId, Integer partitionId){
|
||||
Page page = new Page<>(pageNum, pageSize);
|
||||
QueryWrapper<PersonalCenter> wrapper = new QueryWrapper<>();
|
||||
if(centerId != null){
|
||||
wrapper.lambda().eq(PersonalCenter :: getCenterId, centerId);
|
||||
}
|
||||
if (partitionId != null && partitionId != 0) {
|
||||
wrapper.lambda().eq(PersonalCenter :: getPartitionId, partitionId);
|
||||
}
|
||||
// 我的房间不可更改
|
||||
wrapper.lambda().ne(PersonalCenter::getCenterId,1).orderByAsc(PersonalCenter :: getCenterSeq);
|
||||
return personalCenterMapper.selectPage(page,wrapper);
|
||||
|
@@ -1,52 +0,0 @@
|
||||
package com.accompany.admin.service.push;
|
||||
|
||||
import com.accompany.admin.model.AdminUser;
|
||||
import com.accompany.admin.service.system.AdminUserService;
|
||||
import com.accompany.common.config.WebSecurityConfig;
|
||||
import com.accompany.common.constant.AppEnum;
|
||||
import com.accompany.common.push.MarkdownMessage;
|
||||
import com.accompany.common.utils.EnvComponent;
|
||||
import com.accompany.core.enumeration.PartitionEnum;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.service.message.MessageRobotPushService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class EnterpriseWeChatPushAdminService extends MessageRobotPushService {
|
||||
|
||||
@Autowired
|
||||
private AdminUserService adminUserService;
|
||||
@Autowired
|
||||
private WebSecurityConfig webSecurityConfig;
|
||||
@Autowired
|
||||
private EnvComponent envComponent;
|
||||
|
||||
public void pushMessage(Map<Long, Users> usersMap, Integer partitionId, String title, int adminId, BigDecimal amount, String remark) {
|
||||
if (envComponent.getDevOrNativeEnv()) {
|
||||
return;
|
||||
}
|
||||
|
||||
String userDescList = usersMap.values().stream().map(u-> String.format("%s(%d)", u.getNick(), u.getErbanNo())).collect(Collectors.joining(","));
|
||||
PartitionEnum partitionEnum = PartitionEnum.getByPartitionId(partitionId);
|
||||
|
||||
AdminUser adminUser = adminUserService.getAdminUserById(adminId);
|
||||
MarkdownMessage msg = new MarkdownMessage();
|
||||
msg.addTitle(MarkdownMessage.getHeaderText(3, adminUser.getUsername() + title));
|
||||
msg.add(MarkdownMessage.getReferenceText(title));
|
||||
msg.add(MarkdownMessage.getReferenceText("APP应用: ") + AppEnum.getCurApp().getValue());
|
||||
msg.add(MarkdownMessage.getReferenceText("赠送数量: " + amount.toPlainString()));
|
||||
msg.add(MarkdownMessage.getReferenceText("赠送分区: " + partitionEnum.getDesc()));
|
||||
msg.add(MarkdownMessage.getReferenceText("赠送人数: " + usersMap.size()));
|
||||
msg.add(MarkdownMessage.getReferenceText("赠送用户: " + userDescList));
|
||||
msg.add(MarkdownMessage.getReferenceText("操作者: " + adminUser.getUsername()));
|
||||
msg.add(MarkdownMessage.getReferenceText("备注: " + remark));
|
||||
// 发送消息
|
||||
this.pushMessageByKey(webSecurityConfig.getOfficialDingPushKey(), msg, false);
|
||||
}
|
||||
|
||||
}
|
@@ -42,7 +42,7 @@ public class RechargeRiskUserAdminService {
|
||||
private AccountBlockService accountBlockService;
|
||||
@Autowired
|
||||
private RechargeRiskUserAdminMapper rechargeRiskUserAdminMapper;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
public Page<RechargeRiskUserAdminVo> page(Long erbanNo, PageReq req) {
|
||||
|
@@ -239,36 +239,40 @@ public class RechargeUserAdminServiceImpl implements RechargeUserAdminService {
|
||||
}
|
||||
|
||||
private long saveRechargeUserRegion(List<RechargeUserRegionAdminDto> userRegions, long type, Long uid, Date now) {
|
||||
if (CollectionUtil.isNotEmpty(userRegions)) {
|
||||
log.info("userRegions : {}", JSONObject.toJSON(userRegions));
|
||||
for (RechargeUserRegionAdminDto userRegion : userRegions) {
|
||||
String name = userRegion.getName();
|
||||
Long userRegionType = userRegion.getType();
|
||||
Boolean isCheck = userRegion.getIsCheck();
|
||||
Integer seq = userRegion.getSeq();
|
||||
if (isCheck) {
|
||||
type |= userRegionType;
|
||||
RechargeUserRegion rechargeUserRegion = null;
|
||||
List<RechargeUserRegion> rechargeUserRegions = rechargeUserRegionService.list(Wrappers.<RechargeUserRegion>lambdaQuery()
|
||||
.eq(RechargeUserRegion::getUid, uid)
|
||||
.eq(RechargeUserRegion::getType, userRegionType));
|
||||
if (CollectionUtil.isNotEmpty(rechargeUserRegions)) {
|
||||
rechargeUserRegion = rechargeUserRegions.get(0);
|
||||
} else {
|
||||
rechargeUserRegion = new RechargeUserRegion();
|
||||
rechargeUserRegion.setUid(uid);
|
||||
rechargeUserRegion.setType(userRegionType);
|
||||
rechargeUserRegion.setCreateTime(now);
|
||||
}
|
||||
rechargeUserRegion.setName(name);
|
||||
rechargeUserRegion.setSeq(seq);
|
||||
rechargeUserRegion.setUpdateTime(now);
|
||||
rechargeUserRegionService.saveOrUpdate(rechargeUserRegion);
|
||||
if (CollectionUtil.isEmpty(userRegions)) {
|
||||
return type;
|
||||
}
|
||||
log.info("userRegions : {}", JSONObject.toJSON(userRegions));
|
||||
for (RechargeUserRegionAdminDto userRegion : userRegions) {
|
||||
String name = userRegion.getName();
|
||||
Long userRegionType = userRegion.getType();
|
||||
Boolean isCheck = userRegion.getIsCheck();
|
||||
Integer seq = userRegion.getSeq();
|
||||
if (isCheck && userRegionType != null && userRegionType == 0) {
|
||||
continue;
|
||||
}
|
||||
if (isCheck) {
|
||||
type |= userRegionType;
|
||||
RechargeUserRegion rechargeUserRegion = null;
|
||||
List<RechargeUserRegion> rechargeUserRegions = rechargeUserRegionService.list(Wrappers.<RechargeUserRegion>lambdaQuery()
|
||||
.eq(RechargeUserRegion::getUid, uid)
|
||||
.eq(RechargeUserRegion::getType, userRegionType));
|
||||
if (CollectionUtil.isNotEmpty(rechargeUserRegions)) {
|
||||
rechargeUserRegion = rechargeUserRegions.get(0);
|
||||
} else {
|
||||
rechargeUserRegionService.remove(Wrappers.<RechargeUserRegion>lambdaQuery()
|
||||
.eq(RechargeUserRegion::getUid, uid)
|
||||
.eq(RechargeUserRegion::getType, userRegionType));
|
||||
rechargeUserRegion = new RechargeUserRegion();
|
||||
rechargeUserRegion.setUid(uid);
|
||||
rechargeUserRegion.setType(userRegionType);
|
||||
rechargeUserRegion.setCreateTime(now);
|
||||
}
|
||||
rechargeUserRegion.setName(name);
|
||||
rechargeUserRegion.setSeq(seq);
|
||||
rechargeUserRegion.setUpdateTime(now);
|
||||
rechargeUserRegionService.saveOrUpdate(rechargeUserRegion);
|
||||
} else {
|
||||
rechargeUserRegionService.remove(Wrappers.<RechargeUserRegion>lambdaQuery()
|
||||
.eq(RechargeUserRegion::getUid, uid)
|
||||
.eq(RechargeUserRegion::getType, userRegionType));
|
||||
}
|
||||
}
|
||||
return type;
|
||||
|
@@ -1,12 +1,10 @@
|
||||
package com.accompany.admin.service.record;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.accompany.admin.common.AdminConstants;
|
||||
import com.accompany.admin.mapper.OfficialGoldRecordMapper;
|
||||
import com.accompany.admin.mapper.OfficialGoldRecordMapperExpand;
|
||||
import com.accompany.admin.model.AdminUser;
|
||||
import com.accompany.admin.model.OfficialGoldRecord;
|
||||
import com.accompany.admin.service.push.EnterpriseWeChatPushAdminService;
|
||||
import com.accompany.admin.model.AdminUser;
|
||||
import com.accompany.admin.service.system.AdminUserService;
|
||||
import com.accompany.admin.vo.OfficialGoldAllRecordVo;
|
||||
import com.accompany.admin.vo.OfficialGoldRecordVo;
|
||||
@@ -15,30 +13,34 @@ import com.accompany.business.constant.guild.GuildUsdOperateTypeEnum;
|
||||
import com.accompany.business.model.OfficialGoldBusType;
|
||||
import com.accompany.business.model.UserPurse;
|
||||
import com.accompany.business.model.guild.GuildMember;
|
||||
import com.accompany.business.service.WebConfigService;
|
||||
import com.accompany.business.service.guild.GuildMemberService;
|
||||
import com.accompany.business.service.guild.GuildUsdBillRecordService;
|
||||
import com.accompany.business.service.purse.UserPurseService;
|
||||
import com.accompany.business.service.record.BillRecordService;
|
||||
import com.accompany.business.service.user.UsersService;
|
||||
import com.accompany.business.vo.charge.CommonRecharge4ActVo;
|
||||
import com.accompany.common.config.WebSecurityConfig;
|
||||
import com.accompany.common.constant.AppEnum;
|
||||
import com.accompany.common.constant.Constant;
|
||||
import com.accompany.common.push.MarkdownMessage;
|
||||
import com.accompany.common.redis.RedisKey;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.result.PageResult;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.common.utils.BlankUtil;
|
||||
import com.accompany.common.utils.DateTimeUtil;
|
||||
import com.accompany.common.utils.EnvComponent;
|
||||
import com.accompany.common.utils.StringUtils;
|
||||
import com.accompany.common.utils.UUIDUtil;
|
||||
import com.accompany.core.enumeration.BillObjTypeEnum;
|
||||
import com.accompany.core.enumeration.CurrencyEnum;
|
||||
import com.accompany.core.enumeration.PartitionEnum;
|
||||
import com.accompany.core.exception.AdminServiceException;
|
||||
import com.accompany.core.exception.ServiceException;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.service.base.BaseService;
|
||||
import com.accompany.core.service.common.JedisService;
|
||||
import com.accompany.core.service.message.MessageRobotPushService;
|
||||
import com.accompany.core.service.user.UsersBaseService;
|
||||
import com.accompany.payment.constant.CurrencyTypeEnum;
|
||||
import com.accompany.payment.event.ChargeSuccessEvent;
|
||||
import com.accompany.payment.event.CommonRecharge4ActEvent;
|
||||
import com.accompany.payment.mapper.ChargeRecordMapper;
|
||||
@@ -53,14 +55,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.accompany.common.status.BusiStatus.NOT_ENOUGH_GUILD_USD;
|
||||
|
||||
@Service
|
||||
public class OfficialGoldRecordService extends BaseService {
|
||||
|
||||
@@ -79,16 +79,8 @@ public class OfficialGoldRecordService extends BaseService {
|
||||
@Autowired
|
||||
private OfficialGoldRecordMapperExpand officialGoldRecordMapperExpand;
|
||||
@Autowired
|
||||
private WebConfigService webConfigService;
|
||||
@Autowired
|
||||
private AdminUserService adminUserService;
|
||||
@Autowired
|
||||
private JedisService jedisService;
|
||||
@Autowired
|
||||
private OfficialGoldBusTypeAdminService officialGoldBusTypeAdminService;
|
||||
@Autowired
|
||||
private EnterpriseWeChatPushAdminService enterpriseWeChatPushAdminService;
|
||||
@Autowired
|
||||
private ApplicationContext applicationContext;
|
||||
@Autowired
|
||||
private OfficialGoldRoleLimitService officialGoldRoleLimitService;
|
||||
@@ -96,6 +88,14 @@ public class OfficialGoldRecordService extends BaseService {
|
||||
private GuildMemberService guildMemberService;
|
||||
@Autowired
|
||||
private GuildUsdBillRecordService guildUsdBillRecordService;
|
||||
@Autowired
|
||||
private AdminUserService adminUserService;
|
||||
@Autowired
|
||||
private WebSecurityConfig webSecurityConfig;
|
||||
@Autowired
|
||||
private EnvComponent envComponent;
|
||||
@Autowired
|
||||
private MessageRobotPushService messageRobotPushService;
|
||||
|
||||
public List<Map<String, Object>> listType(int adminId){
|
||||
boolean hasLimit = officialGoldRoleLimitService.hasLimit(adminId);
|
||||
@@ -117,54 +117,179 @@ public class OfficialGoldRecordService extends BaseService {
|
||||
* 后台赠送金币、萝卜
|
||||
*
|
||||
* @param ernos
|
||||
* @param type
|
||||
* @param typeEnum
|
||||
* @param num
|
||||
* @param adminId
|
||||
* @param actualAmount
|
||||
* @param remark
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void handle(String ernos, OfficalSendTypeEnum type, BigDecimal num, int adminId,
|
||||
BigDecimal actualAmount, String remark, Integer busType) throws Exception {
|
||||
if (type == null) {
|
||||
public void handle(String ernos, OfficalSendTypeEnum typeEnum, BigDecimal num, int adminId,
|
||||
String remark, Integer busType) {
|
||||
if (typeEnum == null) {
|
||||
throw new AdminServiceException(BusiStatus.REQUEST_PARAM_ERROR);
|
||||
}
|
||||
|
||||
if (!OfficalSendTypeEnum.OFFICAL_DIAMOND.equals(type) && officialGoldRoleLimitService.hasLimit(adminId)) {
|
||||
if (!OfficalSendTypeEnum.OFFICAL_DIAMOND.equals(typeEnum) && officialGoldRoleLimitService.hasLimit(adminId)) {
|
||||
throw new AdminServiceException(BusiStatus.PARAMETERILLEGAL);
|
||||
}
|
||||
|
||||
switch (type){
|
||||
case OFFICAL_GOLD:
|
||||
giveGold(ernos, type.getValue(), num, adminId, remark, busType);
|
||||
break;
|
||||
case OFFICAL_DIAMOND:
|
||||
case COMPANY_ACCOUNT_DIAMOND:
|
||||
giveDiamond(ernos, type.getValue(), num, adminId, actualAmount, remark, busType);
|
||||
break;
|
||||
//case OFFICAL_RADISH:
|
||||
// giveCrystal(ernos, type.getValue(), num, adminId, remark, busType);
|
||||
// return BusiResult.success();
|
||||
case OFFICAL_REDUCE_DIAMONDS:
|
||||
reduceDiamondNum(ernos, type.getValue(), num, adminId, remark, busType);
|
||||
break;
|
||||
case OFFICAL_MINUS_GUILD_USD:
|
||||
adjustUsd(ernos, type.getValue(), num, adminId, remark, busType, Boolean.FALSE);
|
||||
break;
|
||||
case OFFICAL_PLUS_GUILD_USD:
|
||||
adjustUsd(ernos, type.getValue(), num, adminId, remark, busType, Boolean.TRUE);
|
||||
break;
|
||||
default:
|
||||
throw new AdminServiceException(BusiStatus.REQUEST_PARAM_ERROR);
|
||||
if (OfficalSendTypeEnum.OFFICAL_DIAMOND.equals(typeEnum)
|
||||
&& officialGoldRoleLimitService.overLimit(adminId, num)){
|
||||
throw new AdminServiceException("本月的金币打款已经封顶");
|
||||
}
|
||||
|
||||
// 提取用户查询和分区检查逻辑到统一位置
|
||||
List<String> erbanNos = Arrays.asList(ernos.trim().split("\n"));
|
||||
Map<Long, Users> usersMap = erbanNos.parallelStream().map(Long::parseLong).distinct()
|
||||
.map(erbanNo->{
|
||||
Users u = usersService.getUserByErbanNo(erbanNo);
|
||||
if (u == null) {
|
||||
throw new AdminServiceException(BusiStatus.USERNOTEXISTS);
|
||||
}
|
||||
return u;
|
||||
})
|
||||
.collect(Collectors.toMap(Users::getErbanNo, u->u));
|
||||
List<Integer> partitionIds = usersMap.values().stream().map(Users::getPartitionId).distinct().toList();
|
||||
if (partitionIds.size() > 1){
|
||||
throw new ServiceException(BusiStatus.PARTITION_ERROR, "分区不一致");
|
||||
}
|
||||
Integer partitionId = partitionIds.get(0);
|
||||
|
||||
BigDecimal actualAmount = num.divide(typeEnum.getCurrencyType().getExchangeRate(), 2 , RoundingMode.HALF_UP);
|
||||
|
||||
// 统一获取锁
|
||||
String lockval = null;
|
||||
try {
|
||||
lockval = this.jedisLockService.lock(RedisKey.lock_official_gold_send.getKey(), 3000);
|
||||
if (StringUtils.isEmpty(lockval)) {
|
||||
throw new AdminServiceException(BusiStatus.SERVERBUSY);
|
||||
}
|
||||
|
||||
// 统一发送微信提示消息
|
||||
pushEnterpriseWeChatMessage(usersMap, partitionId, typeEnum.getDesc(), adminId, num, remark);
|
||||
|
||||
switch (typeEnum){
|
||||
case OFFICAL_GOLD:
|
||||
giveGold(usersMap, typeEnum, num, adminId, remark, busType, actualAmount);
|
||||
break;
|
||||
case OFFICAL_DIAMOND:
|
||||
case COMPANY_ACCOUNT_DIAMOND:
|
||||
giveDiamond(usersMap, typeEnum, num, adminId, remark, busType, actualAmount);
|
||||
break;
|
||||
case OFFICAL_REDUCE_DIAMONDS:
|
||||
reduceDiamondNum(usersMap, typeEnum, num, adminId, remark, busType, actualAmount);
|
||||
break;
|
||||
case OFFICAL_MINUS_GUILD_USD:
|
||||
adjustUsd(usersMap, typeEnum, num, adminId, remark, busType, Boolean.FALSE, actualAmount);
|
||||
break;
|
||||
case OFFICAL_PLUS_GUILD_USD:
|
||||
adjustUsd(usersMap, typeEnum, num, adminId, remark, busType, Boolean.TRUE, actualAmount);
|
||||
break;
|
||||
case OFFICAL_PLUS_GUILD_CRYSTAL:
|
||||
adjustGuildCrystal(usersMap, typeEnum, num, adminId, remark, busType, Boolean.TRUE, actualAmount);
|
||||
break;
|
||||
case OFFICAL_MINUS_GUILD_CRYSTAL:
|
||||
adjustGuildCrystal(usersMap, typeEnum, num, adminId, remark, busType, Boolean.FALSE, actualAmount);
|
||||
break;
|
||||
case CLEAR_USER_GOLD:
|
||||
clearUserGold(usersMap, num, adminId, actualAmount);
|
||||
break;
|
||||
default:
|
||||
throw new AdminServiceException(BusiStatus.REQUEST_PARAM_ERROR);
|
||||
}
|
||||
} finally {
|
||||
// 统一释放锁
|
||||
if (StringUtils.isNotEmpty(lockval)) {
|
||||
this.jedisLockService.unlock(RedisKey.lock_official_gold_send.getKey(), lockval);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 赠送钻石
|
||||
*
|
||||
* @param usersMap 用户映射
|
||||
* @param type 赠送类型
|
||||
* @param num 赠送数量
|
||||
* @return
|
||||
*/
|
||||
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);
|
||||
|
||||
addGoldRecord(recordId, users, type.getValue(), Constant.WalletCurrencyType.diamonds, num, adminId, remark, busType, actualAmount);
|
||||
|
||||
BillObjTypeEnum billObjTypeEnum = Constant.OfficialType.chargeByCompanyAccount.byteValue() == type.getValue()? BillObjTypeEnum.CHARGE_BY_COMPANY_ACCOUNT: BillObjTypeEnum.OFFICIAL_GOLD_ADD;
|
||||
|
||||
UserPurse after = userPurseService.addDiamond(users.getUid(), num.doubleValue(), billObjTypeEnum,
|
||||
(userPurse)-> billRecordService.insertGeneralBillRecord(users.getUid(), recordIdStr, billObjTypeEnum, num.doubleValue(), userPurse));
|
||||
|
||||
// 增加充值记录
|
||||
if (Constant.OfficialType.chargeByCompanyAccount.byteValue() == type.getValue()) {
|
||||
BigDecimal amount = actualAmount.multiply(Constant.HUNDRED);
|
||||
String chargeRecordId = UUIDUtil.get();
|
||||
addChargeRecord(chargeRecordId, users.getUid(), num.longValue(), amount.longValue());
|
||||
this.applicationContext.publishEvent(new CommonRecharge4ActEvent(
|
||||
CommonRecharge4ActVo.builder()
|
||||
.uid(users.getUid())
|
||||
.channel(Constant.ChargeChannel.company)
|
||||
.chargeStatus(Constant.ChargeRecordStatus.finish)
|
||||
.totalGoldNum(num.longValue())
|
||||
.createTime(new Date()).build()));
|
||||
}
|
||||
try {
|
||||
userPurseService.sendSysMsgByModifyGold(after);
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("sendSysMsgByModifyGold error, uid:" + users.getUid(), e);
|
||||
}
|
||||
logger.info("giveGold success, erpan_no: {}, type: {}, num: {}, recordId: {}", users.getErbanNo(), type.getValue(), num, recordId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 赠送金币
|
||||
*
|
||||
* @param usersMap 用户映射
|
||||
* @param num 赠送数量
|
||||
* @return
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void giveGold(Map<Long, Users> usersMap, OfficalSendTypeEnum typeEnum, BigDecimal num, int optId, String remark, Integer busType,
|
||||
BigDecimal actualAmount) {
|
||||
// 分隔耳伴号,多个耳伴号用换行分隔
|
||||
for (Users users : usersMap.values()) {
|
||||
Long recordId = DefaultIdentifierGenerator.getInstance().nextId(null);
|
||||
// 增加官方赠送活动记录
|
||||
addGoldRecord(recordId, users, typeEnum.getValue(), Constant.WalletCurrencyType.gold, num, optId, remark, busType, actualAmount);
|
||||
// 更新账户钻石数量
|
||||
userPurseService.addGold(users.getUid(), num.doubleValue(), BillObjTypeEnum.INTER_SEND_DIAMOND);
|
||||
|
||||
logger.info("giveGold success, erpan_no: {}, type: {}, num: {}, recordId: {}", users.getErbanNo(), typeEnum.getValue(), num, recordId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 官方消钻
|
||||
*
|
||||
* @param ernos
|
||||
* @param usersMap 用户映射
|
||||
* @param type
|
||||
* @param num
|
||||
* @param optId
|
||||
@@ -174,166 +299,19 @@ public class OfficialGoldRecordService extends BaseService {
|
||||
* @throws Exception
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void reduceDiamondNum(String ernos, byte type, BigDecimal num, int optId, String remark, Integer busType) {
|
||||
Users user = usersBaseService.getUsersByErBanNo(Long.valueOf(ernos.trim()));
|
||||
if (user == null) {
|
||||
throw new AdminServiceException(BusiStatus.USERNOTEXISTS);
|
||||
public void reduceDiamondNum(Map<Long, Users> usersMap, OfficalSendTypeEnum type, BigDecimal num, int optId, String remark, Integer busType, BigDecimal actualAmount) {
|
||||
for (Users user : usersMap.values()) {
|
||||
Long recordId = DefaultIdentifierGenerator.getInstance().nextId(null);
|
||||
String recordIdStr = String.valueOf(recordId);
|
||||
userPurseService.subDiamond(user.getUid(), num.doubleValue(), BillObjTypeEnum.OFFICIAL_GOLD_REDUCE,
|
||||
(userPurse)-> billRecordService.insertGeneralBillRecord(user.getUid(), recordIdStr, BillObjTypeEnum.OFFICIAL_GOLD_REDUCE, num.doubleValue(), userPurse));
|
||||
addGoldRecord(recordId, user, type.getValue(), Constant.WalletCurrencyType.diamonds, num, optId, remark, busType, actualAmount);
|
||||
}
|
||||
Long recordId = DefaultIdentifierGenerator.getInstance().nextId(null);
|
||||
String recordIdStr = String.valueOf(recordId);
|
||||
userPurseService.subDiamond(user.getUid(), num.doubleValue(), BillObjTypeEnum.OFFICIAL_GOLD_REDUCE,
|
||||
(userPurse)-> billRecordService.insertGeneralBillRecord(user.getUid(), recordIdStr, BillObjTypeEnum.OFFICIAL_GOLD_REDUCE, num.doubleValue(), userPurse));
|
||||
addGoldRecord(recordId, user, type, Constant.WalletCurrencyType.diamonds, num, optId, remark, busType, null);
|
||||
}
|
||||
/**
|
||||
* 赠送钻石
|
||||
*
|
||||
* @param ernos 耳伴号,多个耳伴号用换行符分隔
|
||||
* @param type 赠送类型
|
||||
* @param num 赠送数量
|
||||
* @return
|
||||
*/
|
||||
public void giveDiamond(String ernos, byte type, BigDecimal num, int adminId, BigDecimal actualAmount, String remark, Integer busType) {
|
||||
String lockval = null;
|
||||
try {
|
||||
lockval = this.jedisLockService.lock(RedisKey.lock_official_gold_send.getKey(), 3000);
|
||||
if (StringUtils.isEmpty(lockval)) {
|
||||
throw new AdminServiceException(BusiStatus.SERVERBUSY);
|
||||
}
|
||||
|
||||
OfficalSendTypeEnum typeEnum = OfficalSendTypeEnum.get(type);
|
||||
|
||||
if (OfficalSendTypeEnum.OFFICAL_DIAMOND.equals(typeEnum)
|
||||
&& officialGoldRoleLimitService.overLimit(adminId, num)){
|
||||
throw new AdminServiceException("本月的金币打款已经封顶");
|
||||
}
|
||||
|
||||
// 根据配置,发送微信提示消息
|
||||
List<String> erbanNos = Arrays.asList(ernos.trim().split("\n"));
|
||||
Map<Long, Users> usersMap = erbanNos.parallelStream().map(Long::parseLong).distinct()
|
||||
.map(erbanNo->{
|
||||
Users u = usersService.getUserByErbanNo(erbanNo);
|
||||
if (u == null) {
|
||||
throw new AdminServiceException(BusiStatus.USERNOTEXISTS);
|
||||
}
|
||||
return u;
|
||||
})
|
||||
.collect(Collectors.toMap(Users::getErbanNo, u->u));
|
||||
List<Integer> partitionIds = usersMap.values().stream().map(Users::getPartitionId).distinct().toList();
|
||||
if (partitionIds.size() > 1){
|
||||
throw new ServiceException(BusiStatus.PARTITION_ERROR, "分区不一致");
|
||||
}
|
||||
Integer partitionId = partitionIds.get(0);
|
||||
|
||||
enterpriseWeChatPushAdminService.pushMessage(usersMap, partitionId, typeEnum.getDesc(), adminId, num, remark);
|
||||
// officialGoldSendMsg(ernos,num,optId,remark);
|
||||
|
||||
// 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);
|
||||
|
||||
addGoldRecord(recordId, users, type, Constant.WalletCurrencyType.diamonds, num, adminId, remark, busType, actualAmount);
|
||||
|
||||
BillObjTypeEnum billObjTypeEnum = Constant.OfficialType.chargeByCompanyAccount.byteValue() == type? BillObjTypeEnum.CHARGE_BY_COMPANY_ACCOUNT: BillObjTypeEnum.OFFICIAL_GOLD_ADD;
|
||||
|
||||
UserPurse after = userPurseService.addDiamond(users.getUid(), num.doubleValue(), billObjTypeEnum,
|
||||
(userPurse)-> billRecordService.insertGeneralBillRecord(users.getUid(), recordIdStr, billObjTypeEnum, num.doubleValue(), userPurse));
|
||||
|
||||
// 增加充值记录
|
||||
if (Constant.OfficialType.chargeByCompanyAccount.byteValue() == type) {
|
||||
BigDecimal amount = actualAmount.multiply(Constant.HUNDRED);
|
||||
String chargeRecordId = UUIDUtil.get();
|
||||
addChargeRecord(chargeRecordId, users.getUid(), num.longValue(), amount.longValue());
|
||||
this.applicationContext.publishEvent(new CommonRecharge4ActEvent(
|
||||
CommonRecharge4ActVo.builder()
|
||||
.uid(users.getUid())
|
||||
.channel(Constant.ChargeChannel.company)
|
||||
.chargeStatus(Constant.ChargeRecordStatus.finish)
|
||||
.totalGoldNum(num.longValue())
|
||||
.createTime(new Date()).build()));
|
||||
}
|
||||
try {
|
||||
userPurseService.sendSysMsgByModifyGold(after);
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("sendSysMsgByModifyGold error, uid:" + users.getUid(), e);
|
||||
}
|
||||
logger.info("giveGold success, erpan_no: {}, type: {}, num: {}, recordId: {}", users.getErbanNo(), type, num, recordId);
|
||||
}
|
||||
} finally {
|
||||
this.jedisLockService.unlock(RedisKey.lock_official_gold_send.getKey(), lockval);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 赠送钻石
|
||||
*
|
||||
* @param ernos 耳伴号,多个耳伴号用换行符分隔
|
||||
* @param type 赠送类型
|
||||
* @param num 赠送数量
|
||||
* @return
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void giveGold(String ernos, byte type, BigDecimal num, int optId, String remark, Integer busType) {
|
||||
String lockval = null;
|
||||
try {
|
||||
lockval = this.jedisLockService.lock(RedisKey.lock_official_gold_send.getKey(), 3000);
|
||||
if (StringUtils.isEmpty(lockval)) {
|
||||
throw new AdminServiceException(BusiStatus.SERVERBUSY);
|
||||
}
|
||||
|
||||
// 根据配置,发送微信提示消息
|
||||
List<String> erbanNos = Arrays.asList(ernos.trim().split("\n"));
|
||||
Map<Long, Users> usersMap = erbanNos.parallelStream().map(Long::parseLong).distinct()
|
||||
.map(erbanNo->{
|
||||
Users u = usersService.getUserByErbanNo(erbanNo);
|
||||
if (u == null) {
|
||||
throw new AdminServiceException(BusiStatus.USERNOTEXISTS);
|
||||
}
|
||||
return u;
|
||||
})
|
||||
.collect(Collectors.toMap(Users::getErbanNo, u->u));
|
||||
List<Integer> partitionIds = usersMap.values().stream().map(Users::getPartitionId).distinct().collect(Collectors.toList());
|
||||
if (partitionIds.size() > 1){
|
||||
throw new ServiceException(BusiStatus.PARTITION_ERROR, "分区不一致");
|
||||
}
|
||||
Integer partitionId = partitionIds.get(0);
|
||||
|
||||
enterpriseWeChatPushAdminService.pushMessage(usersMap, partitionId, "后台赠送金币", optId, num, remark);
|
||||
// officialGoldSendMsg(ernos,num,optId,remark);
|
||||
|
||||
// 分隔耳伴号,多个耳伴号用换行分隔
|
||||
for (Users users : usersMap.values()) {
|
||||
Long recordId = DefaultIdentifierGenerator.getInstance().nextId(null);
|
||||
// 增加官方赠送活动记录
|
||||
addGoldRecord(recordId, users, type, Constant.WalletCurrencyType.gold, num, optId, remark, busType, null);
|
||||
// 更新账户钻石数量
|
||||
userPurseService.addGold(users.getUid(), num.doubleValue(), BillObjTypeEnum.INTER_SEND_DIAMOND);
|
||||
|
||||
logger.info("giveGold success, erpan_no: {}, type: {}, num: {}, recordId: {}", users.getErbanNo(), type, num, recordId);
|
||||
}
|
||||
} finally {
|
||||
this.jedisLockService.unlock(RedisKey.lock_official_gold_send.getKey(), lockval);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 官方调整薪资(增加或减少)
|
||||
* @param ernos 用户耳伴号列表,多个用换行分隔
|
||||
* @param usersMap 用户映射
|
||||
* @param type 操作类型
|
||||
* @param num 调整数量
|
||||
* @param optId 操作人ID
|
||||
@@ -343,64 +321,96 @@ public class OfficialGoldRecordService extends BaseService {
|
||||
* @throws Exception
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void adjustUsd(String ernos, byte type, BigDecimal num, int optId, String remark, Integer busType, boolean isPlus) {
|
||||
|
||||
String lockval = null;
|
||||
try {
|
||||
lockval = this.jedisLockService.lock(RedisKey.lock_official_gold_send.getKey(), 3000);
|
||||
if (StringUtils.isEmpty(lockval)) {
|
||||
throw new AdminServiceException(BusiStatus.SERVERBUSY);
|
||||
public void adjustUsd(Map<Long, Users> usersMap, OfficalSendTypeEnum type, BigDecimal num, int optId, String remark, Integer busType, boolean isPlus, BigDecimal actualAmount) {
|
||||
Map<Long, GuildMember> guildMemberMap = new HashMap<>();
|
||||
for (Users u : usersMap.values()) {
|
||||
Long uid = u.getUid();
|
||||
GuildMember guildMemberByUid = guildMemberService.getVaildGuildMemberByUid(uid);
|
||||
if (guildMemberByUid == null) {
|
||||
throw new AdminServiceException("ID:" + u.getErbanNo() + " but not in guild, not allow operate");
|
||||
}
|
||||
guildMemberMap.put(uid, guildMemberByUid);
|
||||
}
|
||||
|
||||
List<String> erbanNos = Arrays.asList(ernos.trim().split("\n"));
|
||||
Map<Long, GuildMember> guildMemberMap = new HashMap<>();
|
||||
Map<Long, Users> usersMap = new HashMap<>();
|
||||
for (String erbanNoStr : erbanNos) {
|
||||
Long erbanNo = Long.parseLong(erbanNoStr.trim());
|
||||
if (usersMap.containsKey(erbanNo)) {
|
||||
continue;
|
||||
}
|
||||
Users u = usersService.getUserByErbanNo(erbanNo);
|
||||
if (u == null) {
|
||||
throw new AdminServiceException(BusiStatus.USERNOTEXISTS);
|
||||
}
|
||||
Long uid = u.getUid();
|
||||
GuildMember guildMemberByUid = guildMemberService.getVaildGuildMemberByUid(uid);
|
||||
if (guildMemberByUid == null) {
|
||||
throw new AdminServiceException("ID:" + erbanNoStr + " but not in guild, not allow operate");
|
||||
}
|
||||
guildMemberMap.put(uid, guildMemberByUid);
|
||||
usersMap.put(uid, u);
|
||||
// 分隔耳伴号,多个耳伴号用换行分隔
|
||||
for (Users users : usersMap.values()) {
|
||||
Long recordId = DefaultIdentifierGenerator.getInstance().nextId(null);
|
||||
Long uid = users.getUid();
|
||||
GuildMember guildMember = guildMemberMap.get(uid);
|
||||
|
||||
// 增加官方赠送活动记录
|
||||
addGoldRecord(recordId, users, type.getValue(), Constant.WalletCurrencyType.guildUsd, num, optId, remark, busType, actualAmount);
|
||||
|
||||
if (isPlus) {
|
||||
// 增加账户usd数量
|
||||
UserPurse userPurse = userPurseService.addGuildUsd(uid, num.doubleValue(), BillObjTypeEnum.PLUS_GUILD_USD,
|
||||
(up) -> billRecordService.insertGeneralBillRecord(uid, uid, BillObjTypeEnum.PLUS_GUILD_USD, num.doubleValue(), up));
|
||||
guildUsdBillRecordService.insert(UUIDUtil.get(), guildMember.getPartitionId(), guildMember.getId(), guildMember.getGuildId(), uid,
|
||||
guildMember.getId(), uid, GuildUsdOperateTypeEnum.SYSTEM_PLUS_USD, null, userPurse, num, null, recordId, remark);
|
||||
logger.info("plusUsd success, erpan_no: {}, type: {}, num: {}, recordId: {}", users.getErbanNo(), type.getValue(), num, recordId);
|
||||
} else {
|
||||
// 减少账户usd数量
|
||||
UserPurse userPurse = userPurseService.subGuildUsd(uid, num, BillObjTypeEnum.MIUNS_GUILD_USD, BusiStatus.NOT_ENOUGH_GUILD_USD,
|
||||
(up)-> billRecordService.insertGeneralBillRecord(uid, uid, BillObjTypeEnum.MIUNS_GUILD_USD, num.doubleValue(), up));
|
||||
guildUsdBillRecordService.insert(UUIDUtil.get(), guildMember.getPartitionId(), guildMember.getId(), guildMember.getGuildId(), uid,
|
||||
guildMember.getId(), uid, GuildUsdOperateTypeEnum.SYSTEM_MIUNS_USD, userPurse, null, num, null, recordId, remark);
|
||||
logger.info("minusUsd success, erpan_no: {}, type: {}, num: {}, recordId: {}", users.getErbanNo(), type.getValue(), num, recordId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 分隔耳伴号,多个耳伴号用换行分隔
|
||||
for (Users users : usersMap.values()) {
|
||||
Long recordId = DefaultIdentifierGenerator.getInstance().nextId(null);
|
||||
Long uid = users.getUid();
|
||||
GuildMember guildMember = guildMemberMap.get(uid);
|
||||
/**
|
||||
* 官方调整水晶(增加或减少)
|
||||
* @param usersMap 用户映射
|
||||
* @param type 操作类型
|
||||
* @param num 调整数量
|
||||
* @param optId 操作人ID
|
||||
* @param remark 备注
|
||||
* @param busType 业务类型
|
||||
* @param isPlus 是否为增加操作 true:增加 false:减少
|
||||
* @throws Exception
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void adjustGuildCrystal(Map<Long, Users> usersMap, OfficalSendTypeEnum type, BigDecimal num, int optId, String remark, Integer busType, boolean isPlus, BigDecimal actualAmount) {
|
||||
// 分隔耳伴号,多个耳伴号用换行分隔
|
||||
for (Users users : usersMap.values()) {
|
||||
Long recordId = DefaultIdentifierGenerator.getInstance().nextId(null);
|
||||
Long uid = users.getUid();
|
||||
|
||||
// 增加官方赠送活动记录
|
||||
addGoldRecord(recordId, users, type, Constant.WalletCurrencyType.usd, num, optId, remark, busType, null);
|
||||
|
||||
if (isPlus) {
|
||||
// 增加账户usd数量
|
||||
UserPurse userPurse = userPurseService.addGuildUsd(uid, num.doubleValue(), BillObjTypeEnum.PLUS_GUILD_USD,
|
||||
(up) -> billRecordService.insertGeneralBillRecord(uid, uid, BillObjTypeEnum.PLUS_GUILD_USD, num.doubleValue(), up));
|
||||
guildUsdBillRecordService.insert(UUIDUtil.get(), guildMember.getPartitionId(), guildMember.getId(), guildMember.getGuildId(), uid,
|
||||
guildMember.getId(), uid, GuildUsdOperateTypeEnum.SYSTEM_PLUS_USD, null, userPurse, num, null, recordId, remark);
|
||||
logger.info("plusUsd success, erpan_no: {}, type: {}, num: {}, recordId: {}", users.getErbanNo(), type, num, recordId);
|
||||
} else {
|
||||
// 减少账户usd数量
|
||||
UserPurse userPurse = userPurseService.subGuildUsd(uid, num, BillObjTypeEnum.MIUNS_GUILD_USD, NOT_ENOUGH_GUILD_USD,
|
||||
(up)-> billRecordService.insertGeneralBillRecord(uid, uid, BillObjTypeEnum.MIUNS_GUILD_USD, num.doubleValue(), up));
|
||||
guildUsdBillRecordService.insert(UUIDUtil.get(), guildMember.getPartitionId(), guildMember.getId(), guildMember.getGuildId(), uid,
|
||||
guildMember.getId(), uid, GuildUsdOperateTypeEnum.SYSTEM_MIUNS_USD, userPurse, null, num, null, recordId, remark);
|
||||
logger.info("minusUsd success, erpan_no: {}, type: {}, num: {}, recordId: {}", users.getErbanNo(), type, num, recordId);
|
||||
}
|
||||
// 增加官方赠送活动记录
|
||||
addGoldRecord(recordId, users, type.getValue(), Constant.WalletCurrencyType.guildCrystal, num, optId, remark, busType, actualAmount);
|
||||
|
||||
if (isPlus) {
|
||||
// 增加账户usd数量
|
||||
userPurseService.addGuildCrystal(uid, num.doubleValue(), BillObjTypeEnum.OFFICIAL_PLUS_GUILD_CRYSTAL);
|
||||
logger.info("plusUsd success, erpan_no: {}, type: {}, num: {}, recordId: {}", users.getErbanNo(), type.getValue(), num, recordId);
|
||||
} else {
|
||||
// 减少账户usd数量
|
||||
userPurseService.subGuildCrystal(uid, num.doubleValue(), BillObjTypeEnum.OFFICIAL_MIUNS_GUILD_CRYSTAL);
|
||||
logger.info("minusUsd success, erpan_no: {}, type: {}, num: {}, recordId: {}", users.getErbanNo(), type.getValue(), num, recordId);
|
||||
}
|
||||
} finally {
|
||||
this.jedisLockService.unlock(RedisKey.lock_official_gold_send.getKey(), lockval);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void clearUserGold(Map<Long, Users> usersMap, BigDecimal num, Integer adminId, BigDecimal actualAmount) {
|
||||
for (Users users: usersMap.values()) {
|
||||
Long uid = users.getUid();
|
||||
UserPurse userPurse = userPurseService.queryUserPurse(uid);
|
||||
BigDecimal golds = BigDecimal.valueOf(userPurse.getGolds());
|
||||
if (golds.compareTo(num) < 0) {
|
||||
throw new AdminServiceException("[" + users.getErbanNo() + "]的用户金币金额低于" + num);
|
||||
}
|
||||
long recordId = DefaultIdentifierGenerator.getInstance().nextId(null);
|
||||
String recordIdStr = String.valueOf(recordId);
|
||||
//扣减金币
|
||||
userPurse = userPurseService.subGold(uid, num.doubleValue(), BillObjTypeEnum.CLEAR_USER_GOLD,
|
||||
(up)-> billRecordService.insertGeneralBillRecord(uid, recordIdStr, BillObjTypeEnum.CLEAR_USER_GOLD, num.doubleValue(), up));
|
||||
//获取更新后的金额
|
||||
BigDecimal currentGoldNum = BigDecimal.valueOf(userPurse.getGolds());
|
||||
//增加官方操作记录
|
||||
addOfficialGoldRecord(recordId, uid, null, num, currentGoldNum, OfficalSendTypeEnum.CLEAR_USER_GOLD.getValue(),
|
||||
Constant.WalletCurrencyType.gold, BillObjTypeEnum.CLEAR_USER_GOLD.getValue(), adminId, BillObjTypeEnum.CLEAR_USER_GOLD.getDesc(), actualAmount);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -409,10 +419,12 @@ public class OfficialGoldRecordService extends BaseService {
|
||||
BigDecimal diamondNum = null;
|
||||
BigDecimal goldNum = null;
|
||||
BigDecimal currentGoldNum = null;
|
||||
if (Constant.OfficialType.interSendGold.byteValue() == type
|
||||
|| Constant.OfficialType.clearUserGold.byteValue() == type
|
||||
if (Constant.OfficialType.interSendGold == type
|
||||
|| Constant.OfficialType.clearUserGold == type
|
||||
|| Constant.OfficialType.plusGuildUsd == type
|
||||
|| Constant.OfficialType.miunsGuildUsd == type) {
|
||||
|| Constant.OfficialType.miunsGuildUsd == type
|
||||
|| Constant.OfficialType.plusGuildCrystal == type
|
||||
|| Constant.OfficialType.miunsGuildCrystal == type) {
|
||||
diamondNum = num;
|
||||
} else {
|
||||
goldNum = num;
|
||||
@@ -424,8 +436,10 @@ public class OfficialGoldRecordService extends BaseService {
|
||||
currentGoldNum = BigDecimal.valueOf(userPurse.getCrystals()).add(num);
|
||||
} else if (currencyType == Constant.WalletCurrencyType.diamonds){
|
||||
currentGoldNum = BigDecimal.valueOf(userPurse.getDiamonds()).add(num);
|
||||
} else if (currencyType == Constant.WalletCurrencyType.usd){
|
||||
} else if (currencyType == Constant.WalletCurrencyType.guildUsd){
|
||||
currentGoldNum = BigDecimal.valueOf(userPurse.getGuildUsd()).add(num);
|
||||
} else if (currencyType == Constant.WalletCurrencyType.guildCrystal){
|
||||
currentGoldNum = BigDecimal.valueOf(userPurse.getGuildCrystal()).add(num);
|
||||
}
|
||||
}
|
||||
return addOfficialGoldRecord(recordId, uid, diamondNum, goldNum, currentGoldNum, type, currencyType, busType, optId, remark, actualAmount);
|
||||
@@ -580,110 +594,6 @@ public class OfficialGoldRecordService extends BaseService {
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台金币充值根据配置,发送微信消息
|
||||
*
|
||||
* @param ernos
|
||||
* @param num
|
||||
* @param optId
|
||||
* @param remark
|
||||
*/
|
||||
public void officialGoldSendMsg(String ernos, long num, int optId, String remark) {
|
||||
boolean flag = true;//true为金额提示消息,false为笔数提示消息
|
||||
String cusDate = DateTimeUtil.getTodayStr();
|
||||
Integer limitTime = Integer.valueOf(webConfigService.getSingleConf(AdminConstants.OFFICIAL_GOLD_LIMIT_TIME));
|
||||
Integer limitGold = Integer.valueOf(webConfigService.getSingleConf(AdminConstants.OFFICIAL_GOLD_LIMIT_GOLD));
|
||||
String openIds = webConfigService.getSingleConf(AdminConstants.OFFICIAL_GOLD_NOTIFY_MEMBER);
|
||||
Assert.notNull(openIds, "通知的openIds不能为空");
|
||||
List<String> openIdList = Arrays.asList(openIds.split(","));
|
||||
|
||||
//获取操作人名字
|
||||
AdminUser user = adminUserService.getAdminUserById(optId);
|
||||
Assert.notNull(user, "该操作人不存在!");
|
||||
//当日累计一次
|
||||
Double rechargeTime = jedisService.zincrby(RedisKey.official_gold_limit_time.getKey(), 1.0, cusDate);
|
||||
//判断后台充值金额是否需要发送消息
|
||||
if (rechargeTime >= limitTime) {
|
||||
flag = false;
|
||||
}
|
||||
|
||||
//根据openId发送微信消息
|
||||
boolean finalFlag = flag;
|
||||
if (rechargeTime >= limitTime || num >= limitGold) {
|
||||
openIdList.forEach((openID) -> {
|
||||
sendMsg(ernos, num, user.getUsername(), remark, rechargeTime.intValue(), finalFlag, openID);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送微信消息
|
||||
*
|
||||
* @param ernos
|
||||
* @param num
|
||||
* @param optName
|
||||
* @param remark
|
||||
* @param countTime
|
||||
* @param flag
|
||||
* @param openId
|
||||
*/
|
||||
public void sendMsg(String ernos, long num, String optName, String remark, int countTime, boolean flag, String openId) {
|
||||
String first = "耳伴管理系统";
|
||||
String keyword1 = "后台管理系统金币充值提醒";
|
||||
String keyword2 = "充值人:" + optName + ",充值:" + num + "元,被充值人:" + ernos + ",原因:" + remark + ",当日累计笔数:" + countTime;
|
||||
String keyword3 = "提醒类型:";
|
||||
if (flag) {
|
||||
keyword3 += "金额";
|
||||
} else {
|
||||
keyword3 += "笔数";
|
||||
}
|
||||
String keyword4 = "充值时间:" + DateTimeUtil.convertDate(new Date(), "yyyy-MM-dd hh:mm");
|
||||
//wxPubService.sendAlertMsg(openId,first,keyword1,keyword2,keyword3,keyword4,"");
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void clearUserGold(String erBanNos, BigDecimal num, Integer adminId) {
|
||||
if (StrUtil.isEmpty(erBanNos)) {
|
||||
throw new AdminServiceException("ID不能为空");
|
||||
}
|
||||
|
||||
// 根据配置,发送微信提示消息
|
||||
List<String> erbanNos = Arrays.asList(erBanNos.trim().split("\n"));
|
||||
Map<Long, Users> usersMap = erbanNos.parallelStream().map(Long::parseLong).distinct()
|
||||
.map(erbanNo->{
|
||||
Users u = usersService.getUserByErbanNo(erbanNo);
|
||||
if (u == null) {
|
||||
throw new AdminServiceException(BusiStatus.USERNOTEXISTS);
|
||||
}
|
||||
return u;
|
||||
})
|
||||
.collect(Collectors.toMap(Users::getErbanNo, u->u));
|
||||
List<Integer> partitionIds = usersMap.values().stream().map(Users::getPartitionId).distinct().collect(Collectors.toList());
|
||||
if (partitionIds.size() > 1){
|
||||
throw new ServiceException(BusiStatus.PARTITION_ERROR, "分区不一致");
|
||||
}
|
||||
|
||||
for (Users users: usersMap.values()) {
|
||||
Long uid = users.getUid();
|
||||
UserPurse userPurse = userPurseService.queryUserPurse(uid);
|
||||
BigDecimal golds = BigDecimal.valueOf(userPurse.getGolds());
|
||||
if (golds.compareTo(num) < 0) {
|
||||
throw new AdminServiceException("[" + users.getErbanNo() + "]的用户金币金额低于" + num);
|
||||
}
|
||||
long recordId = DefaultIdentifierGenerator.getInstance().nextId(null);
|
||||
String recordIdStr = String.valueOf(recordId);
|
||||
//扣减金币
|
||||
userPurse = userPurseService.subGold(uid, num.doubleValue(), BillObjTypeEnum.CLEAR_USER_GOLD,
|
||||
(up)-> billRecordService.insertGeneralBillRecord(uid, recordIdStr, BillObjTypeEnum.CLEAR_USER_GOLD, num.doubleValue(), up));
|
||||
//获取更新后的金额
|
||||
BigDecimal currentGoldNum = BigDecimal.valueOf(userPurse.getGolds());
|
||||
//增加官方操作记录
|
||||
addOfficialGoldRecord(recordId, uid, null, num, currentGoldNum, OfficalSendTypeEnum.CLEAR_USER_GOLD.getValue(),
|
||||
Constant.WalletCurrencyType.gold, BillObjTypeEnum.CLEAR_USER_GOLD.getValue(), adminId, BillObjTypeEnum.CLEAR_USER_GOLD.getDesc(), null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public BusiResult<PageResult<OfficialGoldAllRecordVo>> allRecord(Integer partitionId, Long erbanNo, OfficalSendTypeEnum type,
|
||||
Date beginDate, Date endDate, Integer pageNo, Integer pageSize) {
|
||||
Page<OfficialGoldRecordVo> p = new Page<>(pageNo, pageSize);
|
||||
@@ -725,15 +635,17 @@ public class OfficialGoldRecordService extends BaseService {
|
||||
if (record.getBusType() != null) {
|
||||
vo.setCurrencyTypeDesc(busTypeNameMap.get(record.getBusType()));
|
||||
}
|
||||
if (Constant.WalletCurrencyType.gold.equals(officalSendTypeEnum.getCurrencyType())) {
|
||||
if (CurrencyEnum.GOLD.equals(officalSendTypeEnum.getCurrencyType())) {
|
||||
if (record.getDiamondNum() == null) {
|
||||
vo.setOperationNum(BigDecimal.valueOf(record.getGoldNum()));
|
||||
} else {
|
||||
vo.setOperationNum(BigDecimal.valueOf(record.getDiamondNum()));
|
||||
}
|
||||
} else if (Constant.WalletCurrencyType.diamonds.equals(officalSendTypeEnum.getCurrencyType())) {
|
||||
} else if (CurrencyEnum.DIAMOND.equals(officalSendTypeEnum.getCurrencyType())) {
|
||||
vo.setOperationNum(BigDecimal.valueOf(record.getGoldNum()));
|
||||
} else if (Constant.WalletCurrencyType.usd.equals(officalSendTypeEnum.getCurrencyType())) {
|
||||
} else if (CurrencyEnum.GUILD_USD.equals(officalSendTypeEnum.getCurrencyType())) {
|
||||
vo.setOperationNum(BigDecimal.valueOf(record.getDiamondNum()));
|
||||
} else if (CurrencyEnum.GUILD_CRYSTAL.equals(officalSendTypeEnum.getCurrencyType())) {
|
||||
vo.setOperationNum(BigDecimal.valueOf(record.getDiamondNum()));
|
||||
} else {
|
||||
vo.setOperationNum(BigDecimal.valueOf(record.getGoldNum()));
|
||||
@@ -746,4 +658,36 @@ public class OfficialGoldRecordService extends BaseService {
|
||||
|
||||
return BusiResult.success(pageResult);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送企业微信消息
|
||||
* @param usersMap 用户映射
|
||||
* @param partitionId 分区ID
|
||||
* @param title 标题
|
||||
* @param adminId 管理员ID
|
||||
* @param amount 数量
|
||||
* @param remark 备注
|
||||
*/
|
||||
private void pushEnterpriseWeChatMessage(Map<Long, Users> usersMap, Integer partitionId, String title, int adminId, BigDecimal amount, String remark) {
|
||||
if (envComponent.getDevOrNativeEnv()) {
|
||||
return;
|
||||
}
|
||||
|
||||
String userDescList = usersMap.values().stream().map(u-> String.format("%s(%d)", u.getNick(), u.getErbanNo())).collect(Collectors.joining(","));
|
||||
PartitionEnum partitionEnum = PartitionEnum.getByPartitionId(partitionId);
|
||||
|
||||
AdminUser adminUser = adminUserService.getAdminUserById(adminId);
|
||||
MarkdownMessage msg = new MarkdownMessage();
|
||||
msg.addTitle(MarkdownMessage.getHeaderText(3, adminUser.getUsername() + title));
|
||||
msg.add(MarkdownMessage.getReferenceText(title));
|
||||
msg.add(MarkdownMessage.getReferenceText("APP应用: ") + AppEnum.getCurApp().getValue());
|
||||
msg.add(MarkdownMessage.getReferenceText("赠送数量: " + amount.toPlainString()));
|
||||
msg.add(MarkdownMessage.getReferenceText("赠送分区: " + partitionEnum.getDesc()));
|
||||
msg.add(MarkdownMessage.getReferenceText("赠送人数: " + usersMap.size()));
|
||||
msg.add(MarkdownMessage.getReferenceText("赠送用户: " + userDescList));
|
||||
msg.add(MarkdownMessage.getReferenceText("操作者: " + adminUser.getUsername()));
|
||||
msg.add(MarkdownMessage.getReferenceText("备注: " + remark));
|
||||
// 发送消息
|
||||
messageRobotPushService.pushMessageByKey(webSecurityConfig.getOfficialDingPushKey(), msg, false);
|
||||
}
|
||||
}
|
@@ -19,7 +19,7 @@ public interface AdminResourceService {
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
IPage<Resource> page(Integer type, Integer partitionId, Integer pageNo, Integer pageSize);
|
||||
IPage<Resource> page(Integer type, Integer panelType, String code, Integer partitionId, Integer pageNo, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 保存
|
||||
|
@@ -4,6 +4,7 @@ import com.accompany.admin.service.resource.AdminResourceService;
|
||||
import com.accompany.business.model.resource.Resource;
|
||||
import com.accompany.business.service.resource.ResourceService;
|
||||
import com.accompany.common.constant.Constant;
|
||||
import com.accompany.common.utils.StringUtils;
|
||||
import com.accompany.core.util.I18NMessageSourceUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
@@ -28,10 +29,12 @@ public class AdminResourceServiceImpl implements AdminResourceService {
|
||||
private ResourceService resourceService;
|
||||
|
||||
@Override
|
||||
public IPage<Resource> page(Integer type, Integer partitionId, Integer pageNo, Integer pageSize) {
|
||||
public IPage<Resource> page(Integer type, Integer panelType, String code, Integer partitionId, Integer pageNo, Integer pageSize) {
|
||||
return resourceService.page(new Page<>(pageNo, pageSize), Wrappers.<Resource>lambdaQuery()
|
||||
.eq(Resource::getType, type)
|
||||
.eq(partitionId != null, Resource::getPartitionId, partitionId)
|
||||
.eq(panelType!= null, Resource::getPanelType, panelType)
|
||||
.eq(StringUtils.isNotEmpty(code), Resource::getCode, code)
|
||||
.orderByAsc(Resource::getSkipType)
|
||||
.orderByAsc(Resource::getCreateTime));
|
||||
}
|
||||
|
@@ -402,6 +402,11 @@ public class AdminUserService extends BaseService {
|
||||
return adminUserMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 特殊方法,不能当通用后台用
|
||||
* @param adminId
|
||||
* @return
|
||||
*/
|
||||
public AdminUserVo getByAdminId(Integer adminId) {
|
||||
AdminUser adminUserById = this.getAdminUserById(adminId);
|
||||
List<AdminRefUserRoleKey> roleByAdminId = adminRoleService.getRoleByAdminId(adminId);
|
||||
|
@@ -30,6 +30,9 @@ public class I18nMessageAdminService {
|
||||
Properties arProperties = messageI18nNacosService.getProperties(WebLocaleConfig.Arabic);
|
||||
Properties trProperties = messageI18nNacosService.getProperties(WebLocaleConfig.Turkey);
|
||||
Properties prProperties = messageI18nNacosService.getProperties(WebLocaleConfig.Portuguese);
|
||||
Properties esProperties = messageI18nNacosService.getProperties(WebLocaleConfig.Spanish);
|
||||
Properties ruProperties = messageI18nNacosService.getProperties(WebLocaleConfig.Russian);
|
||||
Properties uzProperties = messageI18nNacosService.getProperties(WebLocaleConfig.Uzbek);
|
||||
for (Object obj : zhProperties.keySet()) {
|
||||
String key = obj.toString();
|
||||
I18nMessageAdminVo admin = new I18nMessageAdminVo();
|
||||
@@ -39,16 +42,22 @@ public class I18nMessageAdminService {
|
||||
admin.setAr(arProperties.getProperty(key));
|
||||
admin.setTr(trProperties.getProperty(key));
|
||||
admin.setPt(prProperties.getProperty(key));
|
||||
admin.setEs(esProperties.getProperty(key));
|
||||
admin.setRu(ruProperties.getProperty(key));
|
||||
admin.setUz(uzProperties.getProperty(key));
|
||||
admins.add(admin);
|
||||
}
|
||||
return admins;
|
||||
}
|
||||
|
||||
public void save(String key, String zh, String en, String ar, String tr, String pt) {
|
||||
public void save(String key, String zh, String en, String ar, String tr, String pt, String es, String ru, String uz) {
|
||||
messageI18nNacosService.saveOrUpdateProperties(WebLocaleConfig.Chinese, key, zh);
|
||||
messageI18nNacosService.saveOrUpdateProperties(WebLocaleConfig.English, key, en);
|
||||
messageI18nNacosService.saveOrUpdateProperties(WebLocaleConfig.Arabic, key, ar);
|
||||
messageI18nNacosService.saveOrUpdateProperties(WebLocaleConfig.Turkey, key, tr);
|
||||
messageI18nNacosService.saveOrUpdateProperties(WebLocaleConfig.Portuguese, key, pt);
|
||||
messageI18nNacosService.saveOrUpdateProperties(WebLocaleConfig.Spanish, key, es);
|
||||
messageI18nNacosService.saveOrUpdateProperties(WebLocaleConfig.Russian, key, ru);
|
||||
messageI18nNacosService.saveOrUpdateProperties(WebLocaleConfig.Uzbek, key, uz);
|
||||
}
|
||||
}
|
||||
|
@@ -2,10 +2,7 @@ package com.accompany.admin.service.user;
|
||||
|
||||
import com.accompany.admin.mapper.ChargeRecordAdminMapper;
|
||||
import com.accompany.admin.service.base.BaseService;
|
||||
import com.accompany.admin.vo.ChargeRecordAdminVo;
|
||||
import com.accompany.admin.vo.ChargeRecordCountryVo;
|
||||
import com.accompany.admin.vo.ChargeRecordPartitionVo;
|
||||
import com.accompany.admin.vo.ChargeRecordPersonAdminVo;
|
||||
import com.accompany.admin.vo.*;
|
||||
import com.accompany.business.constant.ChargeChannelEnum;
|
||||
import com.accompany.business.constant.GenderEnum;
|
||||
import com.accompany.common.constant.Constant;
|
||||
@@ -309,9 +306,11 @@ public class ChargeRecordAdminService extends BaseService {
|
||||
}
|
||||
|
||||
public PageResult<ChargeRecordAdminVo> chargeRecordList(Integer pageNumber, Integer pageSize, Long erbanNo, String channel, Date startTime,
|
||||
Date endTime, Integer status, Boolean newUser, String appChannel, Boolean totalStat, Integer regionId) {
|
||||
Date endTime, Integer status, Boolean newUser, String appChannel, Boolean totalStat, Integer regionId,
|
||||
String chargeRecordId,
|
||||
String pingxxChargeId) {
|
||||
Page<ChargeRecordAdminVo> p = new Page<>(pageNumber, pageSize);
|
||||
chargeRecordAdminMapper.page(p, erbanNo, channel, startTime, endTime, status, newUser, appChannel, regionId);
|
||||
chargeRecordAdminMapper.page(p, erbanNo, channel, startTime, endTime, status, newUser, appChannel, regionId, chargeRecordId, pingxxChargeId);
|
||||
PageResult<ChargeRecordAdminVo> pageResult = new PageResult<>(p);
|
||||
List<ChargeRecordAdminVo> rows = pageResult.getRows();
|
||||
if (CollectionUtils.isEmpty(rows)) {
|
||||
@@ -325,7 +324,8 @@ public class ChargeRecordAdminService extends BaseService {
|
||||
row.setRegionName(regionName.get(row.getRegionId()));
|
||||
}
|
||||
if (totalStat) {
|
||||
List<ChargeRecordAdminVo> chargeRecordAdminVo = chargeRecordAdminMapper.pageTotal(erbanNo, channel, startTime, endTime, status, newUser, appChannel, regionId);
|
||||
List<ChargeRecordAdminVo> chargeRecordAdminVo = chargeRecordAdminMapper
|
||||
.pageTotal(erbanNo, channel, startTime, endTime, status, newUser, appChannel, regionId, chargeRecordId, pingxxChargeId);
|
||||
if (CollectionUtils.isEmpty(chargeRecordAdminVo)) {
|
||||
return pageResult;
|
||||
}
|
||||
@@ -347,8 +347,10 @@ public class ChargeRecordAdminService extends BaseService {
|
||||
|
||||
}
|
||||
|
||||
public void exportChargeRecordList(OutputStream outputStream, Long erbanNo, String channel, Date startTime, Date endTime, Integer status, Boolean newUser, String appChannel, Integer regionId) {
|
||||
PageResult<ChargeRecordAdminVo> page = chargeRecordList(-1, -1, erbanNo, channel, startTime, endTime, status, newUser, appChannel, false, regionId);
|
||||
public void exportChargeRecordList(OutputStream outputStream, Long erbanNo, String channel, Date startTime, Date endTime, Integer status, Boolean newUser,
|
||||
String appChannel, Integer regionId, String chargeRecordId, String pingxxChargeId) {
|
||||
PageResult<ChargeRecordAdminVo> page = chargeRecordList(-1, -1, erbanNo, channel, startTime, endTime,
|
||||
status, newUser, appChannel, false, regionId, chargeRecordId, pingxxChargeId);
|
||||
EasyExcel.write(outputStream, ChargeRecordAdminVo.class).sheet("充值明细").doWrite(page.getRows());
|
||||
}
|
||||
|
||||
@@ -394,6 +396,21 @@ public class ChargeRecordAdminService extends BaseService {
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public List<ChargeRecordPartitionRegionVo> partitionRegionGoldDetail(Integer partitionId, String startDate, String channel) {
|
||||
if (!StringUtils.hasText(startDate)) {
|
||||
throw new AdminServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
|
||||
PartitionInfo partitionInfo = partitionInfoService.getById(partitionId);
|
||||
if (null == partitionInfo){
|
||||
throw new AdminServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
|
||||
Date startTime = DateTimeUtil.getBeginTimeOfDay(DateTimeUtil.convertStrToDate(startDate, DateTimeUtil.DEFAULT_DATE_PATTERN));
|
||||
Date endTime = DateTimeUtil.getEndTimeOfDay(DateTimeUtil.convertStrToDate(startDate, DateTimeUtil.DEFAULT_DATE_PATTERN));
|
||||
return chargeRecordAdminMapper.getPartitionRegionGoldDetail(partitionId, startTime, endTime, channel);
|
||||
}
|
||||
|
||||
public void exportPartitionDetail(ServletOutputStream outputStream, Integer partitionId, String startTime, String endTime) {
|
||||
PartitionInfo partitionInfo = partitionInfoService.getById(partitionId);
|
||||
if (null == partitionInfo){
|
||||
|
@@ -131,7 +131,8 @@ public class UserCancelAdminService extends BaseService {
|
||||
familyManageAdminService.removeMember(vaildFamilyMemberByUid.getId(), 0);
|
||||
}
|
||||
} else if (Constant.ClanMode.GUILD.equals(partitionEnum.getClanMode())
|
||||
|| Constant.ClanMode.GUILD_POLICY2.equals(partitionEnum.getClanMode())) {
|
||||
|| Constant.ClanMode.GUILD_POLICY2.equals(partitionEnum.getClanMode())
|
||||
|| Constant.ClanMode.SOVIET.equals(partitionEnum.getClanMode())) {
|
||||
GuildMember vaildGuildMemberByUid = guildMemberService.getVaildGuildMemberByUid(users.getUid());
|
||||
if (vaildGuildMemberByUid != null && GuildConstant.RoleType.OWNER.equals(vaildGuildMemberByUid.getRoleType())) {
|
||||
Guild validOwnUid = guildManageAdminService.getValidByOwnUid(users.getUid());
|
||||
|
@@ -1,11 +1,8 @@
|
||||
package com.accompany.admin.service.user;
|
||||
|
||||
import com.accompany.admin.mapper.TestPurseMapper;
|
||||
import com.accompany.admin.mapper.UserPurseAdminMapperExpand;
|
||||
import com.accompany.admin.service.base.BaseService;
|
||||
import com.accompany.admin.vo.UserPurseVo;
|
||||
import com.accompany.business.mybatismapper.UserPurseMapper;
|
||||
import com.accompany.core.service.common.JedisService;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -18,15 +15,8 @@ import java.util.List;
|
||||
@Service
|
||||
public class UserPurseAdminService extends BaseService {
|
||||
|
||||
@Autowired
|
||||
private TestPurseMapper testPurseMapper;
|
||||
@Autowired
|
||||
private UserPurseMapper userPurseMapper;
|
||||
|
||||
@Autowired
|
||||
UserPurseAdminMapperExpand userPurseAdminMapperExpand;
|
||||
@Autowired
|
||||
JedisService jedisService;
|
||||
|
||||
public List<UserPurseVo> getUserPurseList(String erbanNoList){
|
||||
List<String> oldList = Arrays.asList(erbanNoList.split(","));
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.accompany.admin.service.vip;
|
||||
|
||||
import com.accompany.admin.model.AdminUser;
|
||||
import com.accompany.admin.service.system.AdminPartitionService;
|
||||
import com.accompany.admin.service.system.AdminUserService;
|
||||
import com.accompany.admin.vo.vip.VipSendRecordVo;
|
||||
import com.accompany.business.model.vip.VipSendRecord;
|
||||
@@ -8,17 +9,16 @@ import com.accompany.business.mybatismapper.vip.VipSendRecordMapper;
|
||||
import com.accompany.business.service.user.UsersService;
|
||||
import com.accompany.business.service.vip.VipSendService;
|
||||
import com.accompany.common.constant.Constant;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.result.PageResult;
|
||||
import com.accompany.common.utils.DateTimeUtil;
|
||||
import com.accompany.core.exception.AdminServiceException;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.util.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
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;
|
||||
@@ -35,6 +35,8 @@ public class VipSendAdminService {
|
||||
private AdminUserService adminUserService;
|
||||
@Autowired
|
||||
private VipSendService vipSendService;
|
||||
@Autowired
|
||||
private AdminPartitionService adminPartitionService;
|
||||
|
||||
public Page<VipSendRecordVo> pageRecord(Long erbanNo, Integer current, Integer pageSize, Integer adminId) {
|
||||
Page<VipSendRecordVo> voPage = new Page<>(current, pageSize);
|
||||
@@ -95,7 +97,14 @@ public class VipSendAdminService {
|
||||
return voPage;
|
||||
}
|
||||
|
||||
public void send(long uid, int vipLevel, int adminId, Integer days) {
|
||||
public void send(long uid, int vipLevel, int adminId, Integer days, boolean checkPartitionId) {
|
||||
if (checkPartitionId) {
|
||||
Users users = usersService.getUsersByUid(uid);
|
||||
List<Integer> partitionIds = adminPartitionService.getAllPartitionId(adminId);
|
||||
if (CollectionUtils.isNotEmpty(partitionIds) && !partitionIds.contains(users.getPartitionId())) {
|
||||
throw new AdminServiceException("PARTITION ERROR");
|
||||
}
|
||||
}
|
||||
vipSendService.send(uid, vipLevel, days, adminId, Constant.OpenVipSource.ADMIN_SEND, Constant.UserVipRecordType.ADMIN_SEND);
|
||||
}
|
||||
}
|
||||
|
@@ -77,7 +77,7 @@ public class DynamicDataAdminService extends BaseService {
|
||||
@Autowired
|
||||
private IWorldService iWorldService;
|
||||
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
public HSSFWorkbook buildPushRecordExcel(List<Dynamic> dynamics) {
|
||||
|
@@ -3,6 +3,7 @@
|
||||
<mapper namespace="com.accompany.admin.mapper.ChargeRecordAdminMapper">
|
||||
<resultMap id="BaseResultMap" type="com.accompany.admin.vo.ChargeRecordAdminVo">
|
||||
<id column="chargeRecordId" property="chargeRecordId" jdbcType="VARCHAR"/>
|
||||
<id column="pingxxChargeId" property="pingxxChargeId" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="page" resultMap="BaseResultMap">
|
||||
@@ -12,6 +13,7 @@
|
||||
app_channel,a.uid,a.channel,p.`desc` `partitionName`,
|
||||
round(a.amount/100,2) amount, local_currency_code localCurrencyCode, round(a.local_amount/100,2) localAmount,
|
||||
a.charge_status status,DATE_FORMAT(a.create_time, '%Y-%m-%d %H:%i:%s') createTime,
|
||||
DATE_FORMAT(a.update_time, '%Y-%m-%d %H:%i:%s') updateTime,
|
||||
if(date(a.create_time)=date(b.create_time), 1, 0) as new_user from charge_record
|
||||
as a
|
||||
join users as b on a.uid=b.uid
|
||||
@@ -35,6 +37,12 @@
|
||||
<if test="regionId != null and regionId != 0">
|
||||
and b.region_id = #{regionId}
|
||||
</if>
|
||||
<if test="chargeRecordId != null and chargeRecordId != ''">
|
||||
and a.charge_record_id = #{chargeRecordId}
|
||||
</if>
|
||||
<if test="pingxxChargeId != null and pingxxChargeId != ''">
|
||||
and a.pingxx_charge_id = #{pingxxChargeId}
|
||||
</if>
|
||||
order by a.create_time desc
|
||||
) as tmp_list
|
||||
where 1=1
|
||||
@@ -82,6 +90,12 @@
|
||||
<if test="regionId != null and regionId != 0">
|
||||
and b.region_id = #{regionId}
|
||||
</if>
|
||||
<if test="chargeRecordId != null and chargeRecordId != ''">
|
||||
and a.charge_record_id = #{chargeRecordId}
|
||||
</if>
|
||||
<if test="pingxxChargeId != null and pingxxChargeId != ''">
|
||||
and a.pingxx_charge_id = #{pingxxChargeId}
|
||||
</if>
|
||||
order by a.create_time desc
|
||||
) as tmp_list
|
||||
where 1=1
|
||||
@@ -142,6 +156,32 @@
|
||||
group by `date`
|
||||
</select>
|
||||
|
||||
<select id="getPartitionRegionGoldDetail" resultType="com.accompany.admin.vo.ChargeRecordPartitionRegionVo">
|
||||
/* SHARDINGSPHERE_HINT: WRITE_ROUTE_ONLY=true */
|
||||
select cr.channel as channel,
|
||||
r.`name` as regionName,
|
||||
ifnull(sum(amount)/100,0) `usd`
|
||||
from charge_record cr
|
||||
inner join users u on cr.uid = u.uid
|
||||
left join region_info r on u.region_id = r.id
|
||||
where cr.create_time >= #{startTime}
|
||||
and cr.create_time <= #{endTime}
|
||||
and cr.charge_status in (2,6)
|
||||
<if test="channel != null and channel != ''">
|
||||
<choose>
|
||||
<when test="channel == 'company'">
|
||||
and cr.charge_prod_id = 'company'
|
||||
</when>
|
||||
<otherwise>
|
||||
and cr.channel = #{channel}
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
and u.partition_id = #{partitionId}
|
||||
GROUP BY r.id
|
||||
order by `usd` desc
|
||||
</select>
|
||||
|
||||
<select id="getChargeCount" resultType="com.accompany.payment.model.ChargeRecord">
|
||||
/* SHARDINGSPHERE_HINT: WRITE_ROUTE_ONLY=true */
|
||||
select
|
||||
|
@@ -0,0 +1,45 @@
|
||||
<?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.miniGame.MiniGameForSudAdminMapper">
|
||||
|
||||
<select id="statGameDurationByMonth"
|
||||
resultType="com.accompany.admin.vo.miniGame.MiniGameForSudAdminStatsVo">
|
||||
SELECT
|
||||
mgr.mg_id as gameId,
|
||||
SUM(battle_duration) as totalDuration,
|
||||
SUM(CASE WHEN u.partition_id = 1 THEN battle_duration ELSE 0 END) AS enDuration,
|
||||
SUM(CASE WHEN u.partition_id = 2 THEN battle_duration ELSE 0 END) AS arDuration,
|
||||
SUM(CASE WHEN u.partition_id = 4 THEN battle_duration ELSE 0 END) AS zhDuration,
|
||||
SUM(CASE WHEN u.partition_id = 8 THEN battle_duration ELSE 0 END) AS trDuration,
|
||||
SUM(CASE WHEN u.partition_id = 16 THEN battle_duration ELSE 0 END) AS en2Duration
|
||||
FROM mini_game_round mgr
|
||||
JOIN users u ON mgr.leader_uid = u.uid
|
||||
WHERE
|
||||
battle_start_at between #{startTime} and #{endTime}
|
||||
<if test="gameId != null and gameId != ''">
|
||||
AND mgr.mg_id = #{gameId}
|
||||
</if>
|
||||
and mgr.state = 2
|
||||
GROUP BY mgr.mg_id
|
||||
</select>
|
||||
|
||||
<select id="pageGameRoundDetail" resultType="com.accompany.admin.vo.miniGame.MiniGameForSudAdminDetailVo">
|
||||
select date(mgr.create_time) `date`, mgr.mg_id as gameId, mg.name as gameName, mgr.room_uid roomUid,
|
||||
u.erban_no as erbanNo,
|
||||
u.partition_id as partitionId,
|
||||
pi.`desc` as partitionDesc,
|
||||
mgr.battle_duration as duration
|
||||
from mini_game_round mgr
|
||||
inner join mini_game mg on mgr.mg_id = mg.mg_id
|
||||
left join users u on mgr.leader_uid = u.uid
|
||||
left join partition_info pi on u.partition_id = pi.id
|
||||
where
|
||||
battle_start_at between #{startTime} and #{endTime}
|
||||
<if test="gameId != null and gameId != ''">
|
||||
and mgr.mg_id = #{gameId}
|
||||
</if>
|
||||
and mgr.state = 2
|
||||
order by mgr.update_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
@@ -1,354 +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.TestPurseMapper" >
|
||||
<resultMap id="BaseResultMap" type="com.accompany.admin.model.TestPurse" >
|
||||
<id column="id" property="id" jdbcType="INTEGER" />
|
||||
<result column="uid" property="uid" jdbcType="BIGINT" />
|
||||
<result column="erban_no" property="erbanNo" jdbcType="BIGINT" />
|
||||
<result column="nick" property="nick" jdbcType="VARCHAR" />
|
||||
<result column="mysql_gold" property="mysqlGold" jdbcType="BIGINT" />
|
||||
<result column="cache_gold" property="cacheGold" jdbcType="BIGINT" />
|
||||
<result column="mysql_charge_gold" property="mysqlChargeGold" jdbcType="BIGINT" />
|
||||
<result column="cache_charge_gold" property="cacheChargeGold" jdbcType="BIGINT" />
|
||||
<result column="mysql_noble_gold" property="mysqlNobleGold" jdbcType="BIGINT" />
|
||||
<result column="cache_noble_gold" property="cacheNobleGold" jdbcType="BIGINT" />
|
||||
<result column="mysql_diamond" property="mysqlDiamond" jdbcType="DOUBLE" />
|
||||
<result column="cache_diamond" property="cacheDiamond" jdbcType="DOUBLE" />
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
<result column="version" property="version" jdbcType="BIGINT" />
|
||||
</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" >
|
||||
id, uid, erban_no, nick, mysql_gold, cache_gold, mysql_charge_gold, cache_charge_gold,
|
||||
mysql_noble_gold, cache_noble_gold, mysql_diamond, cache_diamond, create_time, version
|
||||
</sql>
|
||||
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.accompany.admin.model.TestPurseExample" >
|
||||
select
|
||||
<if test="distinct" >
|
||||
distinct
|
||||
</if>
|
||||
'true' as QUERYID,
|
||||
<include refid="Base_Column_List" />
|
||||
from test_purse
|
||||
<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="java.lang.Integer" >
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from test_purse
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
||||
delete from test_purse
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.accompany.admin.model.TestPurseExample" >
|
||||
delete from test_purse
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.accompany.admin.model.TestPurse" >
|
||||
insert into test_purse (id, uid, erban_no,
|
||||
nick, mysql_gold, cache_gold,
|
||||
mysql_charge_gold, cache_charge_gold, mysql_noble_gold,
|
||||
cache_noble_gold, mysql_diamond, cache_diamond,
|
||||
create_time, version)
|
||||
values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=BIGINT}, #{erbanNo,jdbcType=BIGINT},
|
||||
#{nick,jdbcType=VARCHAR}, #{mysqlGold,jdbcType=BIGINT}, #{cacheGold,jdbcType=BIGINT},
|
||||
#{mysqlChargeGold,jdbcType=BIGINT}, #{cacheChargeGold,jdbcType=BIGINT}, #{mysqlNobleGold,jdbcType=BIGINT},
|
||||
#{cacheNobleGold,jdbcType=BIGINT}, #{mysqlDiamond,jdbcType=DOUBLE}, #{cacheDiamond,jdbcType=DOUBLE},
|
||||
#{createTime,jdbcType=TIMESTAMP}, #{version,jdbcType=BIGINT})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.accompany.admin.model.TestPurse" >
|
||||
insert into test_purse
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
id,
|
||||
</if>
|
||||
<if test="uid != null" >
|
||||
uid,
|
||||
</if>
|
||||
<if test="erbanNo != null" >
|
||||
erban_no,
|
||||
</if>
|
||||
<if test="nick != null" >
|
||||
nick,
|
||||
</if>
|
||||
<if test="mysqlGold != null" >
|
||||
mysql_gold,
|
||||
</if>
|
||||
<if test="cacheGold != null" >
|
||||
cache_gold,
|
||||
</if>
|
||||
<if test="mysqlChargeGold != null" >
|
||||
mysql_charge_gold,
|
||||
</if>
|
||||
<if test="cacheChargeGold != null" >
|
||||
cache_charge_gold,
|
||||
</if>
|
||||
<if test="mysqlNobleGold != null" >
|
||||
mysql_noble_gold,
|
||||
</if>
|
||||
<if test="cacheNobleGold != null" >
|
||||
cache_noble_gold,
|
||||
</if>
|
||||
<if test="mysqlDiamond != null" >
|
||||
mysql_diamond,
|
||||
</if>
|
||||
<if test="cacheDiamond != null" >
|
||||
cache_diamond,
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
create_time,
|
||||
</if>
|
||||
<if test="version != null" >
|
||||
version,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
<if test="id != null" >
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="uid != null" >
|
||||
#{uid,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="erbanNo != null" >
|
||||
#{erbanNo,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="nick != null" >
|
||||
#{nick,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="mysqlGold != null" >
|
||||
#{mysqlGold,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="cacheGold != null" >
|
||||
#{cacheGold,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="mysqlChargeGold != null" >
|
||||
#{mysqlChargeGold,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="cacheChargeGold != null" >
|
||||
#{cacheChargeGold,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="mysqlNobleGold != null" >
|
||||
#{mysqlNobleGold,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="cacheNobleGold != null" >
|
||||
#{cacheNobleGold,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="mysqlDiamond != null" >
|
||||
#{mysqlDiamond,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="cacheDiamond != null" >
|
||||
#{cacheDiamond,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="version != null" >
|
||||
#{version,jdbcType=BIGINT},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.accompany.admin.model.TestPurseExample" resultType="java.lang.Integer" >
|
||||
select count(*) from test_purse
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map" >
|
||||
update test_purse
|
||||
<set >
|
||||
<if test="record.id != null" >
|
||||
id = #{record.id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.uid != null" >
|
||||
uid = #{record.uid,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.erbanNo != null" >
|
||||
erban_no = #{record.erbanNo,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.nick != null" >
|
||||
nick = #{record.nick,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.mysqlGold != null" >
|
||||
mysql_gold = #{record.mysqlGold,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.cacheGold != null" >
|
||||
cache_gold = #{record.cacheGold,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.mysqlChargeGold != null" >
|
||||
mysql_charge_gold = #{record.mysqlChargeGold,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.cacheChargeGold != null" >
|
||||
cache_charge_gold = #{record.cacheChargeGold,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.mysqlNobleGold != null" >
|
||||
mysql_noble_gold = #{record.mysqlNobleGold,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.cacheNobleGold != null" >
|
||||
cache_noble_gold = #{record.cacheNobleGold,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.mysqlDiamond != null" >
|
||||
mysql_diamond = #{record.mysqlDiamond,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="record.cacheDiamond != null" >
|
||||
cache_diamond = #{record.cacheDiamond,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="record.createTime != null" >
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.version != null" >
|
||||
version = #{record.version,jdbcType=BIGINT},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map" >
|
||||
update test_purse
|
||||
set id = #{record.id,jdbcType=INTEGER},
|
||||
uid = #{record.uid,jdbcType=BIGINT},
|
||||
erban_no = #{record.erbanNo,jdbcType=BIGINT},
|
||||
nick = #{record.nick,jdbcType=VARCHAR},
|
||||
mysql_gold = #{record.mysqlGold,jdbcType=BIGINT},
|
||||
cache_gold = #{record.cacheGold,jdbcType=BIGINT},
|
||||
mysql_charge_gold = #{record.mysqlChargeGold,jdbcType=BIGINT},
|
||||
cache_charge_gold = #{record.cacheChargeGold,jdbcType=BIGINT},
|
||||
mysql_noble_gold = #{record.mysqlNobleGold,jdbcType=BIGINT},
|
||||
cache_noble_gold = #{record.cacheNobleGold,jdbcType=BIGINT},
|
||||
mysql_diamond = #{record.mysqlDiamond,jdbcType=DOUBLE},
|
||||
cache_diamond = #{record.cacheDiamond,jdbcType=DOUBLE},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
version = #{record.version,jdbcType=BIGINT}
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.accompany.admin.model.TestPurse" >
|
||||
update test_purse
|
||||
<set >
|
||||
<if test="uid != null" >
|
||||
uid = #{uid,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="erbanNo != null" >
|
||||
erban_no = #{erbanNo,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="nick != null" >
|
||||
nick = #{nick,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="mysqlGold != null" >
|
||||
mysql_gold = #{mysqlGold,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="cacheGold != null" >
|
||||
cache_gold = #{cacheGold,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="mysqlChargeGold != null" >
|
||||
mysql_charge_gold = #{mysqlChargeGold,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="cacheChargeGold != null" >
|
||||
cache_charge_gold = #{cacheChargeGold,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="mysqlNobleGold != null" >
|
||||
mysql_noble_gold = #{mysqlNobleGold,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="cacheNobleGold != null" >
|
||||
cache_noble_gold = #{cacheNobleGold,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="mysqlDiamond != null" >
|
||||
mysql_diamond = #{mysqlDiamond,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="cacheDiamond != null" >
|
||||
cache_diamond = #{cacheDiamond,jdbcType=DOUBLE},
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="version != null" >
|
||||
version = #{version,jdbcType=BIGINT},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.accompany.admin.model.TestPurse" >
|
||||
update test_purse
|
||||
set uid = #{uid,jdbcType=BIGINT},
|
||||
erban_no = #{erbanNo,jdbcType=BIGINT},
|
||||
nick = #{nick,jdbcType=VARCHAR},
|
||||
mysql_gold = #{mysqlGold,jdbcType=BIGINT},
|
||||
cache_gold = #{cacheGold,jdbcType=BIGINT},
|
||||
mysql_charge_gold = #{mysqlChargeGold,jdbcType=BIGINT},
|
||||
cache_charge_gold = #{cacheChargeGold,jdbcType=BIGINT},
|
||||
mysql_noble_gold = #{mysqlNobleGold,jdbcType=BIGINT},
|
||||
cache_noble_gold = #{cacheNobleGold,jdbcType=BIGINT},
|
||||
mysql_diamond = #{mysqlDiamond,jdbcType=DOUBLE},
|
||||
cache_diamond = #{cacheDiamond,jdbcType=DOUBLE},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
version = #{version,jdbcType=BIGINT}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
@@ -6,7 +6,9 @@
|
||||
<result column="nick" property="nick" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
<select id="selectUserPurseVoList" resultMap="BaseResultMap">
|
||||
select * , (select nick from users t2 where t1.uid=t2.uid) as nick, (select erban_no from users t2 where t1.uid=t2.uid) as erban_no from user_purse t1 where uid in (select uid from users where erban_no in
|
||||
select * , (select nick from users t2 where t1.uid=t2.uid) as nick, (select erban_no from users t2 where t1.uid=t2.uid) as erban_no
|
||||
from user_purse t1
|
||||
where uid in (select uid from users where erban_no in
|
||||
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>)
|
||||
|
@@ -42,11 +42,12 @@
|
||||
<result column="radish_num" property="radishNum" jdbcType="BIGINT"/>
|
||||
<result column="diamonds_num" property="diamondsNum" jdbcType="DOUBLE"/>
|
||||
<result column="guild_usd" property="guildUsdNum" jdbcType="DOUBLE"/>
|
||||
<result column="guild_crystal" property="guildCrystalNum" jdbcType="DOUBLE"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectUserWithGold" parameterType="java.util.Map" resultMap="BaseResultMap">
|
||||
/* SHARDINGSPHERE_HINT: WRITE_ROUTE_ONLY=true */
|
||||
select b.erban_no,b.nick,b.avatar,golds as gold_num, diamonds as diamonds_num, crystals as radish_num, guild_usd from
|
||||
select b.erban_no,b.nick,b.avatar,golds as gold_num, diamonds as diamonds_num, crystals as radish_num, guild_usd, guild_crystal from
|
||||
user_purse as a
|
||||
join users as b on a.uid=b.uid
|
||||
where b.erban_no in
|
||||
|
@@ -1,14 +1,13 @@
|
||||
package com.accompany.admin;
|
||||
|
||||
import cn.hippo4j.core.enable.EnableDynamicThreadPool;
|
||||
import io.micrometer.core.instrument.MeterRegistry;
|
||||
import org.dromara.dynamictp.spring.annotation.EnableDynamicTp;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.SpringBootConfiguration;
|
||||
import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.web.servlet.ServletComponentScan;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
@@ -17,7 +16,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
* admin
|
||||
*
|
||||
*/
|
||||
@EnableDynamicThreadPool
|
||||
@EnableDynamicTp
|
||||
@SpringBootApplication
|
||||
@ComponentScan({"com.accompany","com.xuanyin"})
|
||||
@EnableScheduling
|
||||
@@ -27,14 +26,8 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
@SpringBootConfiguration
|
||||
public class AdminApplication {
|
||||
|
||||
|
||||
@Bean
|
||||
MeterRegistryCustomizer<MeterRegistry> configurer() {
|
||||
return (registry) -> registry.config().commonTags("application", "pk_admin");
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AdminApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,107 @@
|
||||
package com.accompany.admin.controller;
|
||||
|
||||
import com.accompany.admin.service.GuildMemberWeekLevelRewardRecordAdminService;
|
||||
import com.accompany.admin.vo.FamilyMemberWeekLevelRewardStatAdminVo;
|
||||
import com.accompany.business.vo.guild.GuildDateCycleVo;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.result.PageResult;
|
||||
import com.accompany.common.utils.DateTimeUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.support.ExcelTypeEnum;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "主播周奖励", value = "主播周奖励")
|
||||
@RequestMapping("/admin/guildMemberWeekLevelReward")
|
||||
@RestController
|
||||
public class GuildMemberWeekLevelRewardAdminController {
|
||||
|
||||
@Autowired
|
||||
private GuildMemberWeekLevelRewardRecordAdminService service;
|
||||
|
||||
@ApiOperation("获取周期")
|
||||
@GetMapping("/listCycleDate")
|
||||
public BusiResult<List<GuildDateCycleVo>> listDateCycle(){
|
||||
List<GuildDateCycleVo> voList = new ArrayList<>();
|
||||
Date now = new Date();
|
||||
for (int i = 0; i < 4; i++) {
|
||||
Date date = DateTimeUtil.addDays(now, i * -7);
|
||||
Date monday = DateTimeUtil.getMonday(date, 0, 0, 0);
|
||||
Date sunday = DateTimeUtil.getSunday(date, 23, 59, 59);
|
||||
String mondayStr = DateTimeUtil.convertDate(monday);
|
||||
|
||||
GuildDateCycleVo vo = new GuildDateCycleVo();
|
||||
vo.setDateCycle(mondayStr);
|
||||
vo.setStartDate(monday);
|
||||
vo.setStartDateStr(mondayStr);
|
||||
vo.setEndDate(sunday);
|
||||
vo.setEndDateStr(DateTimeUtil.convertDate(sunday));
|
||||
vo.setCurrentCycle(i==0);
|
||||
voList.add(vo);
|
||||
}
|
||||
return BusiResult.success(voList);
|
||||
}
|
||||
|
||||
@ApiOperation("查询")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "partitionId", value = "分区id", required = true),
|
||||
@ApiImplicitParam(name = "cycleDate", value = "周期", required = true),
|
||||
@ApiImplicitParam(name = "guildId", value = "公会id"),
|
||||
@ApiImplicitParam(name = "guildOwnerErbanNo", value = "公会长id"),
|
||||
@ApiImplicitParam(name = "erbanNo", value = "id"),
|
||||
@ApiImplicitParam(name = "pageNo", value = "页码"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "页长"),
|
||||
})
|
||||
@GetMapping("/page")
|
||||
public BusiResult<PageResult<FamilyMemberWeekLevelRewardStatAdminVo>> page(int partitionId,
|
||||
String cycleDate,
|
||||
Integer guildId,
|
||||
Long guildOwnerErbanNo,
|
||||
Long erbanNo,
|
||||
int pageNo, int pageSize){
|
||||
Page<FamilyMemberWeekLevelRewardStatAdminVo> page = service.page(partitionId, cycleDate, guildId, guildOwnerErbanNo, erbanNo, pageNo, pageSize);
|
||||
return BusiResult.success(new PageResult<>(page));
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
@ApiOperation("导出")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "partitionId", value = "分区id", required = true),
|
||||
@ApiImplicitParam(name = "cycleDate", value = "周期"),
|
||||
@ApiImplicitParam(name = "guildId", value = "公会id"),
|
||||
@ApiImplicitParam(name = "guildOwnerErbanNo", value = "公会长id"),
|
||||
@ApiImplicitParam(name = "erbanNo", value = "id"),
|
||||
})
|
||||
@GetMapping("/export")
|
||||
public void export(HttpServletResponse response,
|
||||
int partitionId,
|
||||
String cycleDate,
|
||||
Integer guildId,
|
||||
Long guildOwnerErbanNo,
|
||||
Long erbanNo){
|
||||
Page<FamilyMemberWeekLevelRewardStatAdminVo> page = service.page(partitionId, cycleDate, guildId, guildOwnerErbanNo, erbanNo, -1, -1);
|
||||
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
// 这里URLEncoder.encode可以防止中文乱码
|
||||
String excelName = URLEncoder.encode("主播周奖励记录", StandardCharsets.UTF_8);
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + excelName + ExcelTypeEnum.XLSX.getValue());
|
||||
EasyExcel.write(response.getOutputStream(), FamilyMemberWeekLevelRewardStatAdminVo.class).sheet("主播周奖励记录").doWrite(page.getRecords());
|
||||
}
|
||||
|
||||
}
|
@@ -1,7 +1,6 @@
|
||||
package com.accompany.admin.controller.activity;
|
||||
|
||||
import com.accompany.business.common.vo.RewardVo;
|
||||
import com.accompany.business.constant.activity.ActivityType;
|
||||
import com.accompany.business.model.activity.h5.ActivityH5LevelAward;
|
||||
import com.accompany.business.param.ActivityH5Param;
|
||||
import com.accompany.business.service.activity.h5.ActivityH5LevelAwardService;
|
||||
@@ -10,16 +9,13 @@ import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.core.exception.AdminServiceException;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -45,7 +41,7 @@ public class ActivityH5LevelAwardController {
|
||||
@ApiOperation(value = "保存",httpMethod = "POST")
|
||||
@PostMapping("/save")
|
||||
public BusiResult<Void> save(ActivityH5LevelAward activityH5LevelAward) {
|
||||
RewardVo rewardVo = activityH5LevelAwardService.coverRewardByType(activityH5LevelAward.getAwardType(), activityH5LevelAward.getAwardId().intValue());
|
||||
RewardVo rewardVo = activityH5LevelAwardService.coverAdminRewardByType(activityH5LevelAward.getAwardType(), activityH5LevelAward.getAwardId().intValue());
|
||||
if (rewardVo == null) {
|
||||
throw new AdminServiceException("奖励不存在");
|
||||
}
|
||||
|
@@ -220,12 +220,21 @@ public class MyApiController {
|
||||
return BusiResult.success();
|
||||
}
|
||||
|
||||
@GetMapping("/diamondStat")
|
||||
public BusiResult<Void> diamondStat(Long roomId, String date) {
|
||||
@GetMapping("/diamondStatAr")
|
||||
public BusiResult<Void> diamondStatAr(Long roomId, String date) {
|
||||
if (null == roomId || !roomId.equals(603L)) {
|
||||
throw new AdminServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
myApiService.diamondStat(date);
|
||||
myApiService.diamondStatAr(date);
|
||||
return BusiResult.success();
|
||||
}
|
||||
|
||||
@GetMapping("/diamondStatEn")
|
||||
public BusiResult<Void> diamondStatEn(Long roomId, String date) {
|
||||
if (null == roomId || !roomId.equals(603L)) {
|
||||
throw new AdminServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
myApiService.diamondStatEn(date);
|
||||
return BusiResult.success();
|
||||
}
|
||||
|
||||
@@ -334,6 +343,15 @@ public class MyApiController {
|
||||
return BusiResult.success();
|
||||
}
|
||||
|
||||
@RequestMapping("/createPublicRoom")
|
||||
@ResponseBody
|
||||
public BusiResult<Void> createPublicRoom(Long roomId, Integer partitionId) {
|
||||
if (null == roomId || !roomId.equals(603L) || null == partitionId) {
|
||||
throw new AdminServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
myApiService.createPublicRoom(partitionId);
|
||||
return BusiResult.success();
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private GoogleTokenVerifier googleTokenVerifier;
|
||||
@@ -358,4 +376,32 @@ public class MyApiController {
|
||||
miniGameWeekJackpotRankService.settlement(partitionId, DateUtil.parseDateTime(monday), true);
|
||||
return BusiResult.success();
|
||||
}
|
||||
|
||||
@GetMapping("/guildCrystalSettlement")
|
||||
public BusiResult<Void> guildCrystalSettlement(Long roomId, String cycleDate, Integer waitSecond) {
|
||||
if (null == roomId || !roomId.equals(603L)) {
|
||||
throw new AdminServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
myApiService.guildCrystalSettlement(cycleDate, waitSecond);
|
||||
return BusiResult.success();
|
||||
}
|
||||
|
||||
@GetMapping("/mp4TransferGif")
|
||||
public BusiResult<Void> mp4TransferGif(Long roomId) {
|
||||
if (null == roomId || !roomId.equals(603L)) {
|
||||
throw new AdminServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
String url = "https://image.molistar.xyz/64854f73-ea1b-426f-8230-34de49571b8a.mp4";
|
||||
myApiService.mp4TransferGif(url);
|
||||
return BusiResult.success();
|
||||
}
|
||||
|
||||
@GetMapping("/updateX")
|
||||
public BusiResult<Void> updateX(Long roomId) {
|
||||
if (null == roomId || !roomId.equals(603L)) {
|
||||
throw new AdminServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
myApiService.updateX();
|
||||
return BusiResult.success();
|
||||
}
|
||||
}
|
||||
|
@@ -73,34 +73,33 @@ public class RoomBoomAwardRecordAdminController extends BaseController {
|
||||
|
||||
//1 创建IPage分页对象,设置分页参数
|
||||
IPage<RoomBoomSign> page=new Page<>(params.getPageNo(),params.getPageSize());
|
||||
LambdaQueryWrapper<RoomBoomSign> wrapper = new LambdaQueryWrapper<>();
|
||||
Long uid = null;
|
||||
Long roomUid = null;
|
||||
if (params.getRoomErbanNo() != null){
|
||||
Users erbanNo = usersService.getUserByErbanNo(params.getRoomErbanNo());
|
||||
if (erbanNo == null) {
|
||||
throw new AdminServiceException(BusiStatus.SERVERERROR, "房间id不存在");
|
||||
}
|
||||
wrapper.eq(RoomBoomSign::getRoomUid,erbanNo.getUid());
|
||||
roomUid = erbanNo.getUid();
|
||||
}
|
||||
if (params.getErbanNo() != null){
|
||||
Users erbanNo = usersService.getUserByErbanNo(params.getErbanNo());
|
||||
if (erbanNo == null) {
|
||||
throw new AdminServiceException(BusiStatus.SERVERERROR, "触发者id不存在");
|
||||
}
|
||||
wrapper.eq(RoomBoomSign::getUid,erbanNo.getUid());
|
||||
uid = erbanNo.getUid();
|
||||
}
|
||||
if (params.getLevel() != null){
|
||||
wrapper.eq(RoomBoomSign::getLevel,params.getLevel());
|
||||
Date startTime = null, endTime = null;
|
||||
if (StringUtils.isNotEmpty(params.getStartTime())) {
|
||||
startTime = DateUtil.parseDateTime(params.getStartTime());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(params.getStartTime())){
|
||||
wrapper.ge(RoomBoomSign::getCreateTime, (Date)DateUtil.parseDateTime(params.getStartTime()));
|
||||
if (StringUtils.isNotEmpty(params.getEndTime())) {
|
||||
endTime = DateUtil.parseDateTime(params.getEndTime());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(params.getEndTime())){
|
||||
wrapper.le(RoomBoomSign::getCreateTime, (Date)DateUtil.parseDateTime(params.getEndTime()));
|
||||
}
|
||||
wrapper.eq(RoomBoomSign::getStatus,2);
|
||||
wrapper.orderByDesc(RoomBoomSign::getId);
|
||||
//2 执行分页查询
|
||||
IPage<RoomBoomSign> boomSignIPage = roomBoomSignService.page(page, wrapper);
|
||||
IPage<RoomBoomSign> boomSignIPage = roomBoomSignService.list(page, uid, roomUid, params.getLevel(),
|
||||
startTime, endTime, params.getPartitionId());
|
||||
|
||||
Page<RoomBoomSignVO> resultVo = new Page<>();
|
||||
resultVo.setTotal(boomSignIPage.getTotal());
|
||||
List<RoomBoomSignVO> roomBoomSignVOS = new ArrayList<>();
|
||||
|
@@ -116,7 +116,7 @@ public class RoomBoomLevelAwardAdminController {
|
||||
|
||||
if (ObjectUtil.equal(RewardTypeEnum.DIAMOND.getType(), awardType)){
|
||||
awardName = "coin";
|
||||
awardPic = "https://image.molistar.xyz/Molistarcoins.png";
|
||||
awardPic = "https://cdn.moliparty.com/EPartycoins.png";
|
||||
}
|
||||
if (ObjectUtil.equal(RewardTypeEnum.GIFT.getType(), awardType)){
|
||||
Gift gift = giftService.getEachGiftById(awardId.intValue());
|
||||
|
@@ -0,0 +1,84 @@
|
||||
package com.accompany.admin.controller.dailytask;
|
||||
|
||||
import com.accompany.admin.service.dailytask.DailyTaskAdminService;
|
||||
import com.accompany.business.vo.dailytask.DailyCoinRecvRecordVo;
|
||||
import com.accompany.business.vo.dailytask.DailyCoinRecvVo;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.result.PageResult;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.support.ExcelTypeEnum;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
@Api(tags = "每日任务相关", value = "每日任务相关")
|
||||
@RestController
|
||||
@RequestMapping("/admin/dailyTask")
|
||||
public class DailyTaskAdminController {
|
||||
|
||||
@Autowired
|
||||
private DailyTaskAdminService dailyTaskAdminService;
|
||||
|
||||
@GetMapping("/coinRecvNums")
|
||||
@ApiImplicitParams( {
|
||||
@ApiImplicitParam(name = "partitionId", value = "分区id", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "startDate", value = "开始时间", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "endDate", value = "结束时间", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "pageNo", value = "页码", dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer")
|
||||
})
|
||||
@ApiOperation(value = "日任务奖励领取详情", httpMethod = "GET")
|
||||
public BusiResult<PageResult<DailyCoinRecvVo>> list(Integer pageNo, Integer pageSize, @RequestParam(defaultValue = "16") Integer partitionId,
|
||||
String startDate, String endDate) {
|
||||
PageResult<DailyCoinRecvVo> list = dailyTaskAdminService.list(pageNo, pageSize, partitionId, startDate, endDate);
|
||||
return BusiResult.success(list);
|
||||
}
|
||||
|
||||
@GetMapping("/coinRecvDetail")
|
||||
@ApiImplicitParams( {
|
||||
@ApiImplicitParam(name = "partitionId", value = "分区id-列表有带", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "statDate", value = "时间-列表有带", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "erbanNo", value = "主播id", required = true, dataType = "Long"),
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备id", dataType = "String"),
|
||||
@ApiImplicitParam(name = "ip", value = "ip", dataType = "String"),
|
||||
@ApiImplicitParam(name = "pageNo", value = "页码", dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer")
|
||||
})
|
||||
@ApiOperation(value = "日任务奖励领取详情-明细", httpMethod = "GET")
|
||||
public BusiResult<PageResult<DailyCoinRecvRecordVo>> listRecord(Long erbanNo, Integer partitionId, String statDate,
|
||||
String deviceId, String ip, Integer pageNo, Integer pageSize) {
|
||||
PageResult<DailyCoinRecvRecordVo> pageResult = dailyTaskAdminService.listRecord(erbanNo, partitionId, statDate, deviceId, ip, pageNo, pageSize);
|
||||
return BusiResult.success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/coinRecvDetailExport")
|
||||
@ApiImplicitParams( {
|
||||
@ApiImplicitParam(name = "partitionId", value = "分区id-列表有带", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "statDate", value = "时间-列表有带", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "erbanNo", value = "主播id", required = true, dataType = "Long"),
|
||||
@ApiImplicitParam(name = "deviceId", value = "设备id", dataType = "String"),
|
||||
@ApiImplicitParam(name = "ip", value = "ip", dataType = "String"),
|
||||
})
|
||||
@ApiOperation(value = "日任务奖励领取详情-明细-导出", httpMethod = "GET")
|
||||
public void coinRecvDetailExport(HttpServletResponse response, Long erbanNo, Integer partitionId, String statDate,
|
||||
String deviceId, String ip) throws IOException {
|
||||
PageResult<DailyCoinRecvRecordVo> pageResult = dailyTaskAdminService.listRecord(erbanNo, partitionId, statDate, deviceId, ip, -1, -1);
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
// 这里URLEncoder.encode可以防止中文乱码
|
||||
String excelName = URLEncoder.encode("日任务奖励领取明细", StandardCharsets.UTF_8);
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + excelName + ExcelTypeEnum.XLSX.getValue());
|
||||
EasyExcel.write(response.getOutputStream(), DailyCoinRecvRecordVo.class).sheet("日任务奖励领取明细").doWrite(pageResult.getRows());
|
||||
}
|
||||
}
|
@@ -0,0 +1,104 @@
|
||||
package com.accompany.admin.controller.game;
|
||||
|
||||
import com.accompany.admin.controller.BaseController;
|
||||
import com.accompany.admin.model.AdminUser;
|
||||
import com.accompany.admin.service.system.AdminPartitionService;
|
||||
import com.accompany.admin.service.system.AdminUserService;
|
||||
import com.accompany.business.service.game.ChargeUserXDetailService;
|
||||
import com.accompany.business.vo.game.ChargeUserXDetailVo;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.core.exception.AdminServiceException;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.support.ExcelTypeEnum;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户充值等级 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author wxf
|
||||
* @since 2025-06-30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/chargeUserXDetail")
|
||||
public class ChargeUserXDetailAdminController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private AdminUserService adminUserService;
|
||||
@Autowired
|
||||
private AdminPartitionService adminPartitionService;
|
||||
@Autowired
|
||||
private ChargeUserXDetailService chargeUserXDetailService;
|
||||
|
||||
@GetMapping(value = "/list")
|
||||
public BusiResult<IPage<ChargeUserXDetailVo>> listPage(Long erbanNo, String ip,
|
||||
String device, Integer identity, Integer pageNo, Integer pageSize, Integer partitionId) {
|
||||
List<Integer> allPartitionId = adminPartitionService.getAllPartitionId(getAdminId());
|
||||
if (!allPartitionId.contains(partitionId)) {
|
||||
throw new AdminServiceException(5001, "无权查看该区数据权限");
|
||||
}
|
||||
IPage<ChargeUserXDetailVo> ipage = chargeUserXDetailService.listPage(Arrays.asList(partitionId), erbanNo, ip, device, identity, pageNo, pageSize);
|
||||
return BusiResult.success(ipage);
|
||||
}
|
||||
|
||||
@ApiImplicitParam(paramType = "query", name = "erbanNos", value = "逗号隔开ID", required = false)
|
||||
@ApiOperation(value = "新增", httpMethod = "POST")
|
||||
@PostMapping(value = "/save")
|
||||
public BusiResult<Void> save(String erbanNos, String addReason) {
|
||||
if (erbanNos == null) {
|
||||
throw new AdminServiceException(5001, "请填写用户id");
|
||||
}
|
||||
AdminUser adminUserVo = adminUserService.getAdminUserById(getAdminId());
|
||||
|
||||
String[] split = erbanNos.split(",");
|
||||
List<Long> erbanNoList = new ArrayList<>();
|
||||
for (String erbanNo : split) {
|
||||
erbanNoList.add(Long.parseLong(erbanNo.trim()));
|
||||
}
|
||||
chargeUserXDetailService.saveDetail(erbanNoList, addReason, adminUserVo.getId(), adminUserVo.getUsername());
|
||||
return BusiResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除", httpMethod = "POST")
|
||||
@PostMapping(value = "/delete")
|
||||
public BusiResult<Void> delete(Long uid, String removeReason) {
|
||||
AdminUser adminUser = adminUserService.getAdminUserById(getAdminId());
|
||||
// if (StringUtils.isEmpty(removeReason)) {
|
||||
// throw new AdminServiceException(5001, "请填写删除原因");
|
||||
// }
|
||||
chargeUserXDetailService.delete(uid, removeReason, adminUser.getId(), adminUser.getUsername());
|
||||
return BusiResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导出", httpMethod = "POST")
|
||||
@PostMapping("/export")
|
||||
public void export(Long erbanNo, String ip, String device, Integer identity, Integer partitionId, HttpServletResponse response) throws IOException {
|
||||
List<Integer> allPartitionId = adminPartitionService.getAllPartitionId(getAdminId());
|
||||
if (!allPartitionId.contains(partitionId)) {
|
||||
throw new AdminServiceException(5001, "无权查看该区数据权限");
|
||||
}
|
||||
IPage<ChargeUserXDetailVo> ipage = chargeUserXDetailService.listPage(Arrays.asList(partitionId), erbanNo, ip, device, identity, -1, -1);
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
// 这里URLEncoder.encode可以防止中文乱码
|
||||
String excelName = URLEncoder.encode("嫌疑人x用户", StandardCharsets.UTF_8);
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + excelName + ExcelTypeEnum.XLSX.getValue());
|
||||
EasyExcel.write(response.getOutputStream(), ChargeUserXDetailVo.class).sheet("嫌疑人x用户").doWrite(ipage.getRecords());
|
||||
}
|
||||
}
|
@@ -6,8 +6,8 @@ import com.accompany.admin.common.Combobox;
|
||||
import com.accompany.admin.controller.BaseController;
|
||||
import com.accompany.admin.params.RoomFreeGiftConfigParams;
|
||||
import com.accompany.admin.service.gift.GiftAdminService;
|
||||
import com.accompany.admin.service.push.EnterpriseWeChatPushAdminService;
|
||||
import com.accompany.admin.service.system.AdminLogService;
|
||||
import com.accompany.admin.service.system.AdminUserService;
|
||||
import com.accompany.business.dto.room.RoomFreeGiftConfigDto;
|
||||
import com.accompany.business.model.Gift;
|
||||
import com.accompany.business.service.gift.GiftSendRecordService;
|
||||
@@ -15,16 +15,22 @@ import com.accompany.business.service.gift.GiftService;
|
||||
import com.accompany.business.service.gift.RoomExclusiveGiftService;
|
||||
import com.accompany.business.service.user.UsersService;
|
||||
import com.accompany.business.vo.room.RoomExclusiveGiftVo;
|
||||
import com.accompany.common.config.WebSecurityConfig;
|
||||
import com.accompany.common.constant.AppEnum;
|
||||
import com.accompany.common.constant.Constant;
|
||||
import com.accompany.common.push.MarkdownMessage;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.common.tencent.cos.TencentCosUploadService;
|
||||
import com.accompany.common.utils.BlankUtil;
|
||||
import com.accompany.common.utils.EnvComponent;
|
||||
import com.accompany.common.utils.PinYin4JUtil;
|
||||
import com.accompany.common.utils.StringUtils;
|
||||
import com.accompany.core.enumeration.PartitionEnum;
|
||||
import com.accompany.core.exception.AdminServiceException;
|
||||
import com.accompany.core.exception.ServiceException;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.service.message.MessageRobotPushService;
|
||||
import com.accompany.sharding.vo.GiftSendRecordStatistics;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -65,11 +71,17 @@ public class GiftAdminController extends BaseController {
|
||||
@Autowired
|
||||
private AdminLogService adminLogService;
|
||||
@Autowired
|
||||
private EnterpriseWeChatPushAdminService enterpriseWeChatPushAdminService;
|
||||
@Autowired
|
||||
private GiftService giftService;
|
||||
@Autowired
|
||||
private RoomExclusiveGiftService roomExclusiveGiftService;
|
||||
@Autowired
|
||||
private AdminUserService adminUserService;
|
||||
@Autowired
|
||||
private WebSecurityConfig webSecurityConfig;
|
||||
@Autowired
|
||||
private EnvComponent envComponent;
|
||||
@Autowired
|
||||
private MessageRobotPushService messageRobotPushService;
|
||||
|
||||
@GetMapping("/listLuckyBagGift")
|
||||
public BusiResult<List<Gift>> listLuckyBagLinearGift() {
|
||||
@@ -344,7 +356,7 @@ public class GiftAdminController extends BaseController {
|
||||
Integer partitionId = partitionIds.get(0);
|
||||
|
||||
String title = "后台赠送礼物(" + gift.getGiftName() + ") x " + giftNum + "个";
|
||||
enterpriseWeChatPushAdminService.pushMessage(usersMap, partitionId, title, getAdminId(), totalGoldNum, null);
|
||||
pushEnterpriseWeChatMessage(usersMap, partitionId, title, getAdminId(), totalGoldNum, null);
|
||||
|
||||
//赠送失败的平台号
|
||||
List<Long> failErban = new ArrayList<>();
|
||||
@@ -460,6 +472,36 @@ public class GiftAdminController extends BaseController {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送企业微信消息
|
||||
* @param usersMap 用户映射
|
||||
* @param partitionId 分区ID
|
||||
* @param title 标题
|
||||
* @param adminId 管理员ID
|
||||
* @param amount 数量
|
||||
* @param remark 备注
|
||||
*/
|
||||
private void pushEnterpriseWeChatMessage(Map<Long, Users> usersMap, Integer partitionId, String title, int adminId, BigDecimal amount, String remark) {
|
||||
if (envComponent.getDevOrNativeEnv()) {
|
||||
return;
|
||||
}
|
||||
|
||||
String userDescList = usersMap.values().stream().map(u-> String.format("%s(%d)", u.getNick(), u.getErbanNo())).collect(Collectors.joining(","));
|
||||
PartitionEnum partitionEnum = PartitionEnum.getByPartitionId(partitionId);
|
||||
|
||||
com.accompany.admin.model.AdminUser adminUser = adminUserService.getAdminUserById(adminId);
|
||||
MarkdownMessage msg = new MarkdownMessage();
|
||||
msg.addTitle(MarkdownMessage.getHeaderText(3, adminUser.getUsername() + title));
|
||||
msg.add(MarkdownMessage.getReferenceText(title));
|
||||
msg.add(MarkdownMessage.getReferenceText("APP应用: ") + AppEnum.getCurApp().getValue());
|
||||
msg.add(MarkdownMessage.getReferenceText("赠送数量: " + amount.toPlainString()));
|
||||
msg.add(MarkdownMessage.getReferenceText("赠送分区: " + partitionEnum.getDesc()));
|
||||
msg.add(MarkdownMessage.getReferenceText("赠送人数: " + usersMap.size()));
|
||||
msg.add(MarkdownMessage.getReferenceText("赠送用户: " + userDescList));
|
||||
msg.add(MarkdownMessage.getReferenceText("操作者: " + adminUser.getUsername()));
|
||||
msg.add(MarkdownMessage.getReferenceText("备注: " + remark));
|
||||
// 发送消息
|
||||
messageRobotPushService.pushMessageByKey(webSecurityConfig.getOfficialDingPushKey(), msg, false);
|
||||
}
|
||||
}
|
@@ -4,6 +4,7 @@ import com.accompany.admin.controller.BaseController;
|
||||
import com.accompany.admin.service.guild.GuildManageAdminService;
|
||||
import com.accompany.admin.service.system.AdminLogService;
|
||||
import com.accompany.admin.vo.guild.GuildAdminVo;
|
||||
import com.accompany.admin.vo.guild.GuildCreateAdminVo;
|
||||
import com.accompany.admin.vo.guild.GuildMemberAdminVo;
|
||||
import com.accompany.business.constant.guild.GuildConstant;
|
||||
import com.accompany.business.vo.guild.GuildOperateRecordAdminVo;
|
||||
@@ -46,16 +47,18 @@ public class GuildManageAdminController extends BaseController {
|
||||
@ApiImplicitParam(name = "operatorId", value = "公会运营负责人id")
|
||||
})
|
||||
@PostMapping("/create")
|
||||
public BusiResult<Void> createGuild(Long erbanNo,
|
||||
String guildContactType,
|
||||
String guildContact,
|
||||
Long inviteErbanNo,
|
||||
Integer operatorId){
|
||||
public BusiResult<Void> createGuild(@RequestBody GuildCreateAdminVo guildCreateAdminVo){
|
||||
Long erbanNo = guildCreateAdminVo.getErbanNo();
|
||||
String guildContactType = guildCreateAdminVo.getGuildContactType();
|
||||
String guildContact = guildCreateAdminVo.getGuildContact();
|
||||
Long inviteErbanNo = guildCreateAdminVo.getInviteErbanNo();
|
||||
Integer operatorId = guildCreateAdminVo.getOperatorId();
|
||||
Integer regionId = guildCreateAdminVo.getRegionId();
|
||||
if (null == erbanNo){
|
||||
throw new AdminServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
Integer adminId = getAdminId();
|
||||
service.createGuild(erbanNo, adminId, guildContactType, guildContact, inviteErbanNo, operatorId);
|
||||
service.createGuild(erbanNo, adminId, guildContactType, guildContact, inviteErbanNo, operatorId, regionId);
|
||||
adminLogService.insertLog(adminId,getClass().getCanonicalName(),
|
||||
"create guild","params===>>erbanNo:"+erbanNo);
|
||||
return BusiResult.success();
|
||||
@@ -72,15 +75,22 @@ public class GuildManageAdminController extends BaseController {
|
||||
@ApiImplicitParam(name = "operatorId", value = "公会运营负责人id")
|
||||
})
|
||||
@PostMapping("/update")
|
||||
public BusiResult<Void> updateGuild(Integer id, String name,
|
||||
String avatar, String backgroundUrl, Integer memberNumLimit,
|
||||
String guildContactType, String guildContact, Long inviteErbanNo,
|
||||
Integer operatorId){
|
||||
public BusiResult<Void> updateGuild(@RequestBody GuildCreateAdminVo guildCreateAdminVo){
|
||||
String name = guildCreateAdminVo.getName();
|
||||
Integer id = guildCreateAdminVo.getId();
|
||||
String backgroundUrl = guildCreateAdminVo.getBackgroundUrl();
|
||||
Integer memberNumLimit = guildCreateAdminVo.getMemberNumLimit();
|
||||
String avatar = guildCreateAdminVo.getAvatar();
|
||||
String guildContactType = guildCreateAdminVo.getGuildContactType();
|
||||
String guildContact = guildCreateAdminVo.getGuildContact();
|
||||
Long inviteErbanNo = guildCreateAdminVo.getInviteErbanNo();
|
||||
Integer operatorId = guildCreateAdminVo.getOperatorId();
|
||||
Integer regionId = guildCreateAdminVo.getRegionId();
|
||||
if (null == id || null == memberNumLimit){
|
||||
throw new AdminServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
Integer adminId = getAdminId();
|
||||
service.updateGuild(id, name, avatar, backgroundUrl, memberNumLimit, guildContactType, guildContact, inviteErbanNo, adminId, operatorId);
|
||||
service.updateGuild(id, name, avatar, backgroundUrl, memberNumLimit, guildContactType, guildContact, inviteErbanNo, adminId, operatorId, regionId);
|
||||
adminLogService.insertLog(adminId,getClass().getCanonicalName(),
|
||||
"update guild","params===>>id:"+id+",name:"+name+",backgroundUrl:"+backgroundUrl+",memberNumLimit:"+memberNumLimit);
|
||||
return BusiResult.success();
|
||||
|
@@ -0,0 +1,73 @@
|
||||
package com.accompany.admin.controller.guildpolicy;
|
||||
|
||||
import com.accompany.admin.service.guildpolicy2.GuildCrystalSettlementRecordAdminService;
|
||||
import com.accompany.business.vo.guildpolicy.GuildMemberCrystalSettlementRecordAdminVo;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.result.PageResult;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.support.ExcelTypeEnum;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
@Api(tags = "公会紫晶结算清除记录", value = "公会紫晶结算清除记录")
|
||||
@RestController
|
||||
@RequestMapping("/admin/guild/guildCrystal")
|
||||
public class GuildCrystalSettlementRecordAdminController {
|
||||
|
||||
@Autowired
|
||||
private GuildCrystalSettlementRecordAdminService service;
|
||||
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "ownerErbanNo", value = "公会长ID", required = true, dataType = "Long"),
|
||||
@ApiImplicitParam(name = "guildId", value = "公会ID", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "erbanNo", value = "成员号", required = true, dataType = "Long"),
|
||||
@ApiImplicitParam(name = "partitionId", value = "分区ID(预留)", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "cycleDate", value = "周期(传cycle_date)", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "pageNo", value = "页码", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页数量", required = true, dataType = "Integer")
|
||||
})
|
||||
@ApiOperation(value = "分页")
|
||||
@GetMapping("/page")
|
||||
public BusiResult<PageResult<GuildMemberCrystalSettlementRecordAdminVo>> list(Integer pageNo, Integer pageSize,
|
||||
Long ownerErbanNo, Integer guildId, Long erbanNo,
|
||||
@RequestParam(defaultValue = "8") Integer partitionId,
|
||||
String cycleDate) {
|
||||
return BusiResult.success(new PageResult<>(service.page(pageNo, pageSize, guildId, ownerErbanNo, erbanNo, partitionId, cycleDate)));
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "ownerErbanNo", value = "公会长ID", required = true, dataType = "Long"),
|
||||
@ApiImplicitParam(name = "guildId", value = "公会ID", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "erbanNo", value = "成员号", required = true, dataType = "Long"),
|
||||
@ApiImplicitParam(name = "partitionId", value = "分区ID(预留)", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "cycleDate", value = "周期(传cycle_date)", required = true, dataType = "String"),
|
||||
})
|
||||
@ApiOperation(value = "导出")
|
||||
@GetMapping("/export")
|
||||
public void export(HttpServletResponse response, Long ownerErbanNo, Integer guildId, Long erbanNo,
|
||||
@RequestParam(defaultValue = "8") Integer partitionId,
|
||||
String cycleDate) {
|
||||
Page<GuildMemberCrystalSettlementRecordAdminVo> data = service.page(1, -1, guildId, ownerErbanNo, erbanNo, partitionId, cycleDate);
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
// 这里URLEncoder.encode可以防止中文乱码
|
||||
String excelName = URLEncoder.encode("公会紫晶结算清除记录", StandardCharsets.UTF_8);
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + excelName + ExcelTypeEnum.XLSX.getValue());
|
||||
EasyExcel.write(response.getOutputStream(), GuildMemberCrystalSettlementRecordAdminVo.class).sheet("公会紫晶结算清除记录").doWrite(data.getRecords());
|
||||
}
|
||||
}
|
@@ -0,0 +1,166 @@
|
||||
package com.accompany.admin.controller.guildsoviet;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.accompany.admin.service.guildsoviet.GuildSovietAdminService;
|
||||
import com.accompany.business.vo.guild.CycleDateVo;
|
||||
import com.accompany.business.vo.guildsoviet.GuildMemberSovietAdminVo;
|
||||
import com.accompany.business.vo.guildsoviet.GuildSovietAdminVo;
|
||||
import com.accompany.business.vo.guildsoviet.RoomSovietAdminVo;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.result.PageResult;
|
||||
import com.accompany.common.utils.DateTimeUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.support.ExcelTypeEnum;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "CIS公会/主播", value = "CIS公会/主播")
|
||||
@RestController
|
||||
@RequestMapping(value = "/admin/soviet")
|
||||
public class GuildSovietAdminController {
|
||||
|
||||
@Autowired
|
||||
private GuildSovietAdminService guildSovietAdminService;
|
||||
|
||||
@ApiOperation(value = "CIS公会钻石", httpMethod = "GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "guildId", value = "公会id", required = true, dataType = "Byte"),
|
||||
@ApiImplicitParam(name = "erbanNo", value = "公会长ID", required = true, dataType = "Long"),
|
||||
@ApiImplicitParam(name = "regionId", value = "公会国家", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "startDate", value = "开始时间", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "endDate", value = "结束时间", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "pageNo", value = "页码", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页条数", required = true, dataType = "Integer")
|
||||
})
|
||||
@GetMapping("/list")
|
||||
public BusiResult<PageResult<GuildSovietAdminVo>> listGuildSovietAdminVo(@RequestParam(defaultValue = "32") Integer partitionId, Integer guildId, Long erbanNo, Integer regionId,
|
||||
String startDate, String endDate, Integer pageNo, Integer pageSize) {
|
||||
return BusiResult.success(guildSovietAdminService.listGuildSovietAdminVo(partitionId, guildId, erbanNo, regionId, startDate, endDate, pageNo, pageSize));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "CIS公会钻石-导出", httpMethod = "POST")
|
||||
@PostMapping("/export")
|
||||
public void exportGuildSovietAdminVo(HttpServletResponse response, @RequestParam(defaultValue = "32") Integer partitionId,
|
||||
Integer guildId, Long erbanNo, Integer regionId, String startDate, String endDate) throws IOException {
|
||||
Integer pageNo = -1;
|
||||
Integer pageSize = -1;
|
||||
PageResult<GuildSovietAdminVo> pageResult = guildSovietAdminService.listGuildSovietAdminVo(partitionId, guildId, erbanNo, regionId, startDate, endDate, pageNo, pageSize);
|
||||
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
// 这里URLEncoder.encode可以防止中文乱码
|
||||
String excelName = URLEncoder.encode("CIS公会钻石", StandardCharsets.UTF_8);
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + excelName + ExcelTypeEnum.XLSX.getValue());
|
||||
EasyExcel.write(response.getOutputStream(), GuildSovietAdminVo.class).sheet("CIS公会钻石").doWrite(pageResult.getRows());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "CIS公会成员钻石", httpMethod = "GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "erbanNo", value = "用户ID", required = true, dataType = "Long"),
|
||||
@ApiImplicitParam(name = "regionId", value = "用户国家", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "guildId", value = "公会ID", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "ownerErbanNo", value = "公会长ID", required = true, dataType = "Long"),
|
||||
@ApiImplicitParam(name = "startDate", value = "开始时间", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "endDate", value = "结束时间", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "enable", value = "0-无效,1-有效", required = true, dataType = "Byte"),
|
||||
@ApiImplicitParam(name = "pageNo", value = "页码", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页条数", required = true, dataType = "Integer")
|
||||
})
|
||||
@GetMapping("/memberList")
|
||||
public BusiResult<PageResult<GuildMemberSovietAdminVo>> listGuildMemberSovietAdminVo(@RequestParam(defaultValue = "32") Integer partitionId,
|
||||
Integer guildId, Long ownerErbanNo, Byte enable, Long erbanNo, Integer regionId,
|
||||
String startDate, String endDate, Integer pageNo, Integer pageSize) {
|
||||
return BusiResult.success(guildSovietAdminService.listGuildMemberSovietAdminVo(partitionId, enable, ownerErbanNo, guildId, erbanNo, regionId, startDate, endDate, pageNo, pageSize));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "CIS公会钻石-导出", httpMethod = "POST")
|
||||
@PostMapping("/memberExport")
|
||||
public void exportGuildMemberSovietAdminVo(HttpServletResponse response, @RequestParam(defaultValue = "32") Integer partitionId,
|
||||
Integer guildId, Long ownerErbanNo, Byte enable,
|
||||
Long erbanNo, Integer regionId, String startDate, String endDate) throws IOException {
|
||||
Integer pageNo = -1;
|
||||
Integer pageSize = -1;
|
||||
PageResult<GuildMemberSovietAdminVo> pageResult = guildSovietAdminService.listGuildMemberSovietAdminVo(partitionId, enable, ownerErbanNo, guildId, erbanNo, regionId, startDate, endDate, pageNo, pageSize);
|
||||
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
// 这里URLEncoder.encode可以防止中文乱码
|
||||
String excelName = URLEncoder.encode("CIS公会成员钻石", StandardCharsets.UTF_8);
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + excelName + ExcelTypeEnum.XLSX.getValue());
|
||||
EasyExcel.write(response.getOutputStream(), GuildMemberSovietAdminVo.class).sheet("CIS公会成员钻石").doWrite(pageResult.getRows());
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "CIS房主钻石-周期", httpMethod = "GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "erbanNo", value = "用户ID", required = true, dataType = "Long"),
|
||||
@ApiImplicitParam(name = "regionId", value = "用户国家", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "cycleDate", value = "周期", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "pageNo", value = "页码", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页条数", required = true, dataType = "Integer")
|
||||
})
|
||||
@GetMapping("/roomCycleDateList")
|
||||
public List<CycleDateVo> roomCycleDateList() {
|
||||
List<CycleDateVo> cycleDateVoList = new ArrayList<>();
|
||||
Date now = new Date();
|
||||
Date beginOfWeek = DateUtil.beginOfWeek(now);
|
||||
Date endOfWeek = DateUtil.endOfWeek(now);
|
||||
Date offectWeek = DateUtil.parseDateTime("2025-09-01 00:00:00");
|
||||
while (offectWeek.before(beginOfWeek)) {
|
||||
CycleDateVo cycleDateVo = new CycleDateVo();
|
||||
cycleDateVo.setCycleDate(DateUtil.format(beginOfWeek, DateTimeUtil.dateFormatter));
|
||||
cycleDateVo.setIntervalFormatter(DateUtil.format(beginOfWeek, DateTimeUtil.dateFormatter)
|
||||
+ "~" + DateUtil.format(endOfWeek, DateTimeUtil.dateFormatter));
|
||||
cycleDateVo.setStartDate(cycleDateVo.getCycleDate());
|
||||
cycleDateVo.setEndDate(DateUtil.format(endOfWeek, DateTimeUtil.dateFormatter));
|
||||
beginOfWeek = DateUtil.offsetWeek(beginOfWeek, -1);
|
||||
endOfWeek = DateUtil.offsetWeek(endOfWeek, -1);
|
||||
cycleDateVoList.add(cycleDateVo);
|
||||
}
|
||||
return cycleDateVoList;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "CIS房主钻石", httpMethod = "GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "erbanNo", value = "用户ID", required = true, dataType = "Long"),
|
||||
@ApiImplicitParam(name = "regionId", value = "用户国家", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "cycleDate", value = "周期", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "pageNo", value = "页码", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页条数", required = true, dataType = "Integer")
|
||||
})
|
||||
@GetMapping("/roomList")
|
||||
public BusiResult<PageResult<RoomSovietAdminVo>> listRoomSovietAdminVo(@RequestParam(defaultValue = "32") Integer partitionId, Long erbanNo, Integer regionId,
|
||||
String cycleDate, Integer pageNo, Integer pageSize) {
|
||||
return BusiResult.success(guildSovietAdminService.listRoomSovietAdminVo(partitionId, erbanNo, regionId, cycleDate, pageNo, pageSize));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "CIS房主钻石-导出", httpMethod = "POST")
|
||||
@PostMapping("/roomExport")
|
||||
public void exportRoomSovietAdminVo(HttpServletResponse response, @RequestParam(defaultValue = "32") Integer partitionId,
|
||||
Long erbanNo, Integer regionId, String cycleDate) throws IOException {
|
||||
Integer pageNo = -1;
|
||||
Integer pageSize = -1;
|
||||
PageResult<RoomSovietAdminVo> pageResult = guildSovietAdminService.listRoomSovietAdminVo(partitionId, erbanNo, regionId, cycleDate, pageNo, pageSize);
|
||||
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
// 这里URLEncoder.encode可以防止中文乱码
|
||||
String excelName = URLEncoder.encode("CIS房主钻石", StandardCharsets.UTF_8);
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + excelName + ExcelTypeEnum.XLSX.getValue());
|
||||
EasyExcel.write(response.getOutputStream(), RoomSovietAdminVo.class).sheet("CIS房主钻石").doWrite(pageResult.getRows());
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
package com.accompany.admin.controller.guildsoviet;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Api(tags = "CIS房间", value = "CIS房间")
|
||||
@RestController
|
||||
@RequestMapping(value = "/admin/roomSoviet")
|
||||
public class RoomSovietAdminController {
|
||||
}
|
@@ -0,0 +1,86 @@
|
||||
package com.accompany.admin.controller.lucky;
|
||||
|
||||
import com.accompany.admin.controller.BaseController;
|
||||
import com.accompany.admin.service.lucky.Lucky24RecordAdminService;
|
||||
import com.accompany.admin.vo.luckybag.Lucky24PersonalStatVo;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.core.exception.ServiceException;
|
||||
import com.accompany.sharding.vo.Lucky24PersonalStat;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.support.ExcelTypeEnum;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
@Api(tags = "幸运24")
|
||||
@RestController
|
||||
@RequestMapping("/admin/lucky24/followUserRecord")
|
||||
public class Lucky24FollowUserRecordAdminController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private Lucky24RecordAdminService service;
|
||||
|
||||
@ApiOperation("个人数据")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(value = "partitionId", name = "分区ID", required = true),
|
||||
@ApiImplicitParam(value = "erbanNo", name = "用户ID"),
|
||||
@ApiImplicitParam(value = "date", name = "开始日期", required = true),
|
||||
@ApiImplicitParam(value = "userRechargeLevel", name = "用户充值等级", required = false),
|
||||
@ApiImplicitParam(value = "poolType", name = "数组类型", required = true),
|
||||
@ApiImplicitParam(value = "sortCol", name = "排序列", required = true),
|
||||
@ApiImplicitParam(value = "sortOrder", name = "排序方式", required = true),
|
||||
@ApiImplicitParam(value = "pageNo", name = "页号", required = true),
|
||||
@ApiImplicitParam(value = "pageSize", name = "页长", required = true),
|
||||
})
|
||||
@GetMapping("/personal")
|
||||
public BusiResult<Lucky24PersonalStatVo> personal(Integer partitionId, String date, Integer poolType,
|
||||
String sortCol, String sortOrder,
|
||||
int pageNo, int pageSize) {
|
||||
if (null == partitionId || !StringUtils.hasText(date)) {
|
||||
throw new ServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
Lucky24PersonalStatVo vo = service.getFollowUserPersonal(partitionId, date, null, poolType, sortCol, sortOrder, pageNo, pageSize);
|
||||
return BusiResult.success(vo);
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
@ApiOperation("导出个人数据")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(value = "partitionId", name = "分区ID", required = true),
|
||||
@ApiImplicitParam(value = "erbanNo", name = "用户ID"),
|
||||
@ApiImplicitParam(value = "date", name = "开始日期", required = true),
|
||||
@ApiImplicitParam(value = "userRechargeLevel", name = "用户充值等级", required = false),
|
||||
@ApiImplicitParam(value = "poolType", name = "数组类型", required = true),
|
||||
@ApiImplicitParam(value = "sortCol", name = "排序列", required = true),
|
||||
@ApiImplicitParam(value = "sortOrder", name = "排序方式", required = true)
|
||||
})
|
||||
@GetMapping("/personal/export")
|
||||
public void exportPersonal(HttpServletResponse response,
|
||||
Integer partitionId, String date, Integer poolType,
|
||||
String sortCol, String sortOrder) {
|
||||
if (null == partitionId || !StringUtils.hasText(date)) {
|
||||
throw new ServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
Lucky24PersonalStatVo vo = service.getFollowUserPersonal(partitionId, date, null, poolType, sortCol, sortOrder, 1, -1);
|
||||
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
// 这里URLEncoder.encode可以防止中文乱码
|
||||
String excelName = URLEncoder.encode("幸运24关注用户个人数据", StandardCharsets.UTF_8);
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + excelName + ExcelTypeEnum.XLSX.getValue());
|
||||
EasyExcel.write(response.getOutputStream(), Lucky24PersonalStat.class).sheet("幸运24关注用户个人数据").doWrite(vo.getDataPage().getRows());
|
||||
}
|
||||
|
||||
}
|
@@ -10,6 +10,7 @@ import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.result.PageResult;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.core.exception.ServiceException;
|
||||
import com.accompany.sharding.vo.Lucky24PersonalStat;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.support.ExcelTypeEnum;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -17,6 +18,7 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -70,10 +72,38 @@ public class Lucky24RecordAdminController extends BaseController {
|
||||
if (null == partitionId || (null == erbanNo && !StringUtils.hasText(date))) {
|
||||
throw new ServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
Lucky24PersonalStatVo vo = service.getPersonal(partitionId, erbanNo, date, userRechargeLevel, poolType, sortCol, sortOrder, pageNo, pageSize);
|
||||
Lucky24PersonalStatVo vo = service.getPersonal(partitionId, null, erbanNo, date, userRechargeLevel, poolType, sortCol, sortOrder, pageNo, pageSize);
|
||||
return BusiResult.success(vo);
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
@ApiOperation("导出个人数据")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(value = "partitionId", name = "分区ID", required = true),
|
||||
@ApiImplicitParam(value = "erbanNo", name = "用户ID"),
|
||||
@ApiImplicitParam(value = "date", name = "开始日期", required = true),
|
||||
@ApiImplicitParam(value = "userRechargeLevel", name = "用户充值等级", required = false),
|
||||
@ApiImplicitParam(value = "poolType", name = "数组类型", required = true),
|
||||
@ApiImplicitParam(value = "sortCol", name = "排序列", required = true),
|
||||
@ApiImplicitParam(value = "sortOrder", name = "排序方式", required = true)
|
||||
})
|
||||
@GetMapping("/personal/export")
|
||||
public void exportPersonal(HttpServletResponse response,
|
||||
Integer partitionId, Long erbanNo, String date, String userRechargeLevel, Integer poolType,
|
||||
String sortCol, String sortOrder) {
|
||||
if (null == partitionId || (null == erbanNo && !StringUtils.hasText(date))) {
|
||||
throw new ServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
Lucky24PersonalStatVo vo = service.getPersonal(partitionId, null, erbanNo, date, userRechargeLevel, poolType, sortCol, sortOrder, 1, -1);
|
||||
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
// 这里URLEncoder.encode可以防止中文乱码
|
||||
String excelName = URLEncoder.encode("幸运24个人数据", StandardCharsets.UTF_8);
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + excelName + ExcelTypeEnum.XLSX.getValue());
|
||||
EasyExcel.write(response.getOutputStream(), Lucky24PersonalStat.class).sheet("幸运24个人数据").doWrite(vo.getDataPage().getRows());
|
||||
}
|
||||
|
||||
@ApiOperation("运营数据")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(value = "erbanNo", name = "用户ID", required = true),
|
||||
|
@@ -0,0 +1,112 @@
|
||||
package com.accompany.admin.controller.miniGame;
|
||||
|
||||
import com.accompany.admin.service.miniGame.MiniGameForSudAdminService;
|
||||
import com.accompany.admin.vo.miniGame.MiniGameForSudAdminDetailVo;
|
||||
import com.accompany.admin.vo.miniGame.MiniGameForSudAdminStatsVo;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.core.exception.AdminServiceException;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Api(tags = "休闲游戏时长统计")
|
||||
@RestController
|
||||
@RequestMapping("/admin/minigame/sud/stat")
|
||||
public class MiniGameForSudAdminController {
|
||||
|
||||
@Autowired
|
||||
private MiniGameForSudAdminService miniGameForSudAdminService;
|
||||
|
||||
@ApiOperation("获取休闲游戏时长统计列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "gameId", value = "游戏ID", required = false, dataType = "String", paramType = "query"),
|
||||
@ApiImplicitParam(name = "month", value = "月份(格式: yyyy-MM)", required = true, dataType = "String", paramType = "query")
|
||||
})
|
||||
@GetMapping("/listStat")
|
||||
public BusiResult<List<MiniGameForSudAdminStatsVo>> listStat(
|
||||
String gameId,
|
||||
String month) {
|
||||
if (!StringUtils.hasText(month)){
|
||||
throw new AdminServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
List<MiniGameForSudAdminStatsVo> result = miniGameForSudAdminService.listStat(gameId, month);
|
||||
return BusiResult.success(result);
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
@ApiOperation("导出休闲游戏时长统计")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "gameId", value = "游戏ID", required = false, dataType = "String", paramType = "query"),
|
||||
@ApiImplicitParam(name = "month", value = "月份(格式: yyyy-MM)", required = true, dataType = "String", paramType = "query")
|
||||
})
|
||||
@GetMapping("/exportStat")
|
||||
public void exportStat(
|
||||
String gameId,
|
||||
String month,
|
||||
HttpServletResponse response) {
|
||||
if (!StringUtils.hasText(month)){
|
||||
throw new AdminServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
List<MiniGameForSudAdminStatsVo> dataList = miniGameForSudAdminService.listStat(gameId, month);
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
|
||||
String fileName = URLEncoder.encode("休闲游戏时长统计", "UTF-8").replaceAll("\\+", "%20");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
EasyExcel.write(response.getOutputStream(), MiniGameForSudAdminStatsVo.class).sheet("休闲游戏时长统计").doWrite(dataList);
|
||||
}
|
||||
|
||||
@ApiOperation("获取休闲游戏时长明细列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "gameId", value = "游戏ID", required = true, dataType = "String", paramType = "query"),
|
||||
@ApiImplicitParam(name = "month", value = "月份(格式: yyyy-MM)", required = true, dataType = "String", paramType = "query"),
|
||||
@ApiImplicitParam(name = "page", value = "页码", required = true, dataType = "Integer", paramType = "query"),
|
||||
@ApiImplicitParam(name = "size", value = "每页大小", required = true, dataType = "Integer", paramType = "query")
|
||||
})
|
||||
@GetMapping("/pageDetail")
|
||||
public BusiResult<Page<MiniGameForSudAdminDetailVo>> pageDetail(
|
||||
String gameId,
|
||||
String month,
|
||||
@RequestParam(defaultValue = "1") Integer page,
|
||||
@RequestParam(defaultValue = "10") Integer size) {
|
||||
Page<MiniGameForSudAdminDetailVo> result = miniGameForSudAdminService.pageDetail(gameId, month, page, size);
|
||||
return BusiResult.success(result);
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
@ApiOperation("导出休闲游戏时长明细")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "gameId", value = "游戏ID", required = true, dataType = "String", paramType = "query"),
|
||||
@ApiImplicitParam(name = "month", value = "月份(格式: yyyy-MM)", required = true, dataType = "String", paramType = "query")
|
||||
})
|
||||
@GetMapping("/exportDetail")
|
||||
public void exportDetail(
|
||||
String gameId,
|
||||
String month,
|
||||
HttpServletResponse response) {
|
||||
if (null == gameId || !StringUtils.hasText(month)) {
|
||||
throw new AdminServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
Page<MiniGameForSudAdminDetailVo> page = miniGameForSudAdminService.pageDetail(gameId, month, 1, -1);
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
|
||||
String fileName = URLEncoder.encode("休闲游戏时长明细", "UTF-8").replaceAll("\\+", "%20");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
EasyExcel.write(response.getOutputStream(), MiniGameForSudAdminDetailVo.class).sheet("休闲游戏时长明细").doWrite(page.getRecords());
|
||||
}
|
||||
}
|
@@ -23,9 +23,9 @@ public class PersonalCenterAdminController extends BaseController {
|
||||
@ApiOperation("个人中心功能列表")
|
||||
@GetMapping(value = "/list")
|
||||
@ResponseBody
|
||||
public BusiResult getList(Integer pageNum, Integer pageSize, Integer centerId){
|
||||
public BusiResult getList(Integer pageNum, Integer pageSize, Integer centerId, Integer partitionId){
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
IPage pageInfo = personalCenterAdminService.getList(pageNum, pageSize, centerId);
|
||||
IPage pageInfo = personalCenterAdminService.getList(pageNum, pageSize, centerId, partitionId);
|
||||
jsonObject.put("total",pageInfo.getTotal());
|
||||
jsonObject.put("rows", pageInfo.getRecords());
|
||||
return new BusiResult(jsonObject);
|
||||
|
@@ -8,13 +8,11 @@ import com.accompany.admin.vo.OfficialGoldAllRecordVo;
|
||||
import com.accompany.admin.vo.OfficialGoldRecordVo;
|
||||
import com.accompany.admin.vo.UsersVo;
|
||||
import com.accompany.business.constant.OfficalSendTypeEnum;
|
||||
import com.accompany.business.service.purse.UserPurseService;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.result.PageResult;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.common.utils.BlankUtil;
|
||||
import com.accompany.common.utils.DateTimeUtil;
|
||||
import com.accompany.core.enumeration.BillObjTypeEnum;
|
||||
import com.accompany.core.exception.ServiceException;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.support.ExcelTypeEnum;
|
||||
@@ -51,8 +49,6 @@ public class GoldCoinController extends BaseController {
|
||||
private OfficialGoldRecordService officialGoldRecordService;
|
||||
@Autowired
|
||||
private AdminLogService adminLogService;
|
||||
@Autowired
|
||||
private UserPurseService userPurseService;
|
||||
|
||||
@RequestMapping("/listType")
|
||||
@ResponseBody
|
||||
@@ -70,17 +66,16 @@ public class GoldCoinController extends BaseController {
|
||||
* @param num 赠送数量
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/give")
|
||||
@RequestMapping("/operate")
|
||||
@ResponseBody
|
||||
public BusiResult<Void> giveGoldCoin(String ernos, OfficalSendTypeEnum type, BigDecimal num, BigDecimal actualAmount, String remark, Integer busType) throws Exception {
|
||||
public BusiResult<Void> operate(String ernos, OfficalSendTypeEnum type, Integer busType, BigDecimal num, String remark) {
|
||||
if (BlankUtil.isBlank(ernos) || num.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
throw new ServiceException(BusiStatus.PARAMETERILLEGAL);
|
||||
}
|
||||
int adminId = getAdminId();
|
||||
officialGoldRecordService.handle(ernos, type, num, adminId, actualAmount, remark, busType);
|
||||
adminLogService.insertLog(adminId, getClass().getCanonicalName(), "giveGoldCoin"
|
||||
, "params===>>ernos:" + ernos + ", type:" + type + ", num:" + num + ", actualAmount:" + actualAmount
|
||||
+ ", remark:" + remark);
|
||||
officialGoldRecordService.handle(ernos, type, num, adminId, remark, busType);
|
||||
adminLogService.insertLog(adminId, getClass().getCanonicalName(), "operateGoldCoin"
|
||||
, "params===>>ernos:" + ernos + ", type:" + type + ", num:" + num + ", remark:" + remark);
|
||||
return BusiResult.success();
|
||||
}
|
||||
|
||||
@@ -176,48 +171,6 @@ public class GoldCoinController extends BaseController {
|
||||
return workbook;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/return", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public BusiResult returnGoldNum(String uids, String golds, String diamonds) {
|
||||
try {
|
||||
String[] uid = uids.trim().split(",");
|
||||
String[] gold = golds.trim().split(",");
|
||||
String[] diamond = diamonds.trim().split(",");
|
||||
String errorUids = "";
|
||||
if (uid.length != gold.length || uid.length != diamond.length || gold.length != diamond.length) {
|
||||
return new BusiResult(BusiStatus.PARAMETERILLEGAL);
|
||||
}
|
||||
for (int i = 0; i < uid.length; i++) {
|
||||
try {
|
||||
userPurseService.addDiamond(Long.parseLong(uid[i]), Double.parseDouble(gold[i]), BillObjTypeEnum.OFFICIAL_GOLD_ADD);
|
||||
} catch (Exception e) {
|
||||
errorUids = errorUids + ",";
|
||||
}
|
||||
}
|
||||
return new BusiResult(BusiStatus.SUCCESS, errorUids);
|
||||
} catch (Exception e) {
|
||||
logger.error("赠送失败");
|
||||
return new BusiResult(BusiStatus.BUSIERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户金币清除
|
||||
*
|
||||
* @param erBanNos
|
||||
* @param num
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("用户金币清除")
|
||||
@PostMapping("clearUserGold")
|
||||
@ResponseBody
|
||||
public BusiResult<Void> clearUserGold(String erBanNos, BigDecimal num) {
|
||||
int adminId = getAdminId();
|
||||
officialGoldRecordService.clearUserGold(erBanNos, num, adminId);
|
||||
adminLogService.insertLog(adminId, getClass().getCanonicalName(), "clearUserGold", "params===>>erBanNos:" + erBanNos + ",num:" + num);
|
||||
return BusiResult.success();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "转赠记录-全平台", httpMethod = "GET")
|
||||
@RequestMapping("/recordAll")
|
||||
|
@@ -33,10 +33,10 @@ public class AdminResourceController {
|
||||
@ApiImplicitParam(name = "type", value = "资源类型", required = true)
|
||||
@ApiOperation("分页列表")
|
||||
@GetMapping("page")
|
||||
public BusiResult<IPage<Resource>> page(@RequestParam("type") Integer type,
|
||||
public BusiResult<IPage<Resource>> page(@RequestParam("type") Integer type, Integer panelType, String code,
|
||||
@RequestParam(value = "partitionId", required = false) Integer partitionId,
|
||||
PageReq req) {
|
||||
return BusiResult.success(adminResourceService.page(type, partitionId, req.getPage(), req.getPageSize()));
|
||||
return BusiResult.success(adminResourceService.page(type, panelType, code, partitionId, req.getPage(), req.getPageSize()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -24,7 +24,7 @@ import java.nio.charset.StandardCharsets;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/admin/roomDayDiamond")
|
||||
public class RoomDayDiamondRewardController extends BaseController {
|
||||
public class RoomDayDiamondRewardAdminController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private RoomDayDiamondRewardRecordService roomDayDiamondRewardRecordService;
|
||||
@@ -35,7 +35,7 @@ public class RoomDayDiamondRewardController extends BaseController {
|
||||
@ApiImplicitParam(name = "erbanNo", value = "用户id", required = false, dataType = "long"),
|
||||
@ApiImplicitParam(name = "ownerErbanNo", value = "公会长ID", required = false, dataType = "long"),
|
||||
@ApiImplicitParam(name = "guildId", value = "用户id", required = false, dataType = "int"),
|
||||
@ApiImplicitParam(name = "status", value = "发放状态:-1:全部,0:未发放,1已经发放", required = false, dataType = "long"),
|
||||
@ApiImplicitParam(name = "status", value = "发放状态:-1:全部,0:未发放,1已经发放,2当天不可操作", required = false, dataType = "long"),
|
||||
})
|
||||
@GetMapping("/list")
|
||||
public BusiResult<PageResult<RoomDayDiamondRewardRecordVo>> list(Integer regionId, Long erbanNo, Long ownerErbanNo, Integer guildId, Integer status, BasePageParams pageParams) {
|
||||
@@ -51,7 +51,7 @@ public class RoomDayDiamondRewardController extends BaseController {
|
||||
@ApiImplicitParam(name = "erbanNo", value = "用户id", required = false, dataType = "long"),
|
||||
@ApiImplicitParam(name = "ownerErbanNo", value = "ownerErbanNo", required = false, dataType = "long"),
|
||||
@ApiImplicitParam(name = "guildId", value = "用户id", required = false, dataType = "int"),
|
||||
@ApiImplicitParam(name = "status", value = "发放状态:-1:全部,0:未发放,1已经发放", required = false, dataType = "long"),
|
||||
@ApiImplicitParam(name = "status", value = "发放状态:-1:全部,0:未发放,1已经发放,2当天不可操作", required = false, dataType = "long"),
|
||||
})
|
||||
@GetMapping("/export")
|
||||
public void list(HttpServletResponse response, Integer regionId, Long erbanNo, Long ownerErbanNo, Integer guildId, Integer status, BasePageParams pageParams) throws IOException {
|
||||
@@ -69,7 +69,7 @@ public class RoomDayDiamondRewardController extends BaseController {
|
||||
|
||||
@ApiOperation(value = "每日钻石流水列表-发放", httpMethod = "POST")
|
||||
@PostMapping("/send")
|
||||
public BusiResult send(Long id) {
|
||||
public BusiResult send(Long id) throws InterruptedException {
|
||||
return roomDayDiamondRewardRecordService.send(id, getAdminId());
|
||||
}
|
||||
}
|
@@ -49,7 +49,7 @@ public class AppVersionAdminController extends BaseController {
|
||||
private AppVersionAdminService appVersionAdminService;
|
||||
@Autowired
|
||||
private TencentCosUploadService uploadService;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
@Autowired
|
||||
private AdminUserService adminUserService;
|
||||
|
@@ -46,7 +46,7 @@ public class I18nMessageAdminController {
|
||||
@ApiOperation("保存")
|
||||
@PostMapping("save")
|
||||
public BusiResult<Void> save(I18nMessageAdminVo param) {
|
||||
i18nMessageAdminService.save(param.getKey(), param.getZh(), param.getEn(), param.getAr(), param.getTr(), param.getPt());
|
||||
i18nMessageAdminService.save(param.getKey(), param.getZh(), param.getEn(), param.getAr(), param.getTr(), param.getPt(), param.getEs(), param.getRu(), param.getUz());
|
||||
return BusiResult.success();
|
||||
}
|
||||
}
|
||||
|
@@ -4,6 +4,7 @@ import com.accompany.admin.controller.BaseController;
|
||||
import com.accompany.admin.service.user.ChargeRecordAdminService;
|
||||
import com.accompany.admin.vo.ChargeRecordAdminVo;
|
||||
import com.accompany.admin.vo.ChargeRecordCountryVo;
|
||||
import com.accompany.admin.vo.ChargeRecordPartitionRegionVo;
|
||||
import com.accompany.admin.vo.ChargeRecordPartitionVo;
|
||||
import com.accompany.business.service.user.UsersService;
|
||||
import com.accompany.common.constant.Constant;
|
||||
@@ -295,9 +296,11 @@ public class ChargeRecordAdminController extends BaseController {
|
||||
*/
|
||||
@RequestMapping(value = "/list")
|
||||
public BusiResult<PageResult<ChargeRecordAdminVo>> chargeRecordList(Integer pageNumber, Integer pageSize, Long erbanNo, String channel, Date startTime,
|
||||
Date endTime, Integer status, Boolean newUser, String appChannel, Integer regionId) {
|
||||
Date endTime, Integer status, Boolean newUser, String appChannel, Integer regionId,
|
||||
String chargeRecordId,
|
||||
String pingxxChargeId) {
|
||||
PageResult<ChargeRecordAdminVo> pageInfo = chargeRecordAdminService.chargeRecordList(pageNumber, pageSize, erbanNo, channel, startTime,
|
||||
endTime, status, newUser, appChannel, true, regionId);
|
||||
endTime, status, newUser, appChannel, true, regionId, chargeRecordId, pingxxChargeId);
|
||||
return BusiResult.success(pageInfo);
|
||||
}
|
||||
|
||||
@@ -307,13 +310,16 @@ public class ChargeRecordAdminController extends BaseController {
|
||||
*/
|
||||
@RequestMapping(value = "/exportChargeDetail", method = RequestMethod.POST)
|
||||
public void exportChargeDetail(HttpServletResponse response, Long erbanNo, String channel,
|
||||
Date startTime, Date endTime, Integer status, Boolean newUser, String appChannel, Integer regionId) throws IOException {
|
||||
Date startTime, Date endTime, Integer status, Boolean newUser, String appChannel, Integer regionId,
|
||||
String chargeRecordId,
|
||||
String pingxxChargeId) throws IOException {
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
// 这里URLEncoder.encode可以防止中文乱码
|
||||
String excelName = URLEncoder.encode("充值明细", "UTF-8");
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + excelName + ExcelTypeEnum.XLSX.getValue());
|
||||
chargeRecordAdminService.exportChargeRecordList(response.getOutputStream(), erbanNo, channel, startTime, endTime, status, newUser, appChannel, regionId);
|
||||
chargeRecordAdminService.exportChargeRecordList(response.getOutputStream(), erbanNo, channel, startTime,
|
||||
endTime, status, newUser, appChannel, regionId, chargeRecordId, pingxxChargeId);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/countryDetail")
|
||||
@@ -336,6 +342,12 @@ public class ChargeRecordAdminController extends BaseController {
|
||||
return chargeRecordAdminService.getPartitionGoldDetail(partitionId, beginDate, endDate);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/partitionRegionDetail")
|
||||
public BusiResult<List<ChargeRecordPartitionRegionVo>> partitionRegionDetail(Integer partitionId, String beginDate, String channel) {
|
||||
List<ChargeRecordPartitionRegionVo> chargeRecordPartitionRegionVos = chargeRecordAdminService.partitionRegionGoldDetail(partitionId, beginDate, channel);
|
||||
return BusiResult.success(chargeRecordPartitionRegionVos);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/exportPartitionDetail")
|
||||
public void exportPartitionDetail(HttpServletResponse response, Integer partitionId, String beginDate, String endDate) throws IOException {
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
|
@@ -3,6 +3,7 @@ package com.accompany.admin.controller.user;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.accompany.admin.controller.BaseController;
|
||||
import com.accompany.admin.service.UserCheckAdminService;
|
||||
import com.accompany.admin.service.system.AdminPartitionService;
|
||||
import com.accompany.admin.vo.UsersAdminVo;
|
||||
import com.accompany.business.model.PrivatePhoto;
|
||||
import com.accompany.business.service.user.PrivatePhotoService;
|
||||
@@ -10,6 +11,7 @@ import com.accompany.common.constant.Constant;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.common.tencent.cos.TencentCosUploadService;
|
||||
import com.accompany.core.exception.AdminServiceException;
|
||||
import com.accompany.core.model.RegionInfo;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.model.phone.AreaInfo;
|
||||
@@ -19,7 +21,6 @@ import com.accompany.core.service.phone.AreaInfoService;
|
||||
import com.accompany.core.service.region.RegionInfoService;
|
||||
import com.accompany.core.vo.UserVo;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -27,7 +28,6 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/admin/userCheckAdmin")
|
||||
@@ -48,6 +48,8 @@ public class UserCheckAdminController extends BaseController {
|
||||
private RegionInfoService regionInfoService;
|
||||
@Autowired
|
||||
private AreaInfoService areaInfoService;
|
||||
@Autowired
|
||||
private AdminPartitionService adminPartitionService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public BusiResult<List<UsersAdminVo>> getList(String erbanNoList, Integer type) {
|
||||
@@ -82,6 +84,17 @@ public class UserCheckAdminController extends BaseController {
|
||||
return BusiResult.success(usersAdminVo);
|
||||
}
|
||||
|
||||
@RequestMapping("/getUser")
|
||||
@ResponseBody
|
||||
public BusiResult<UserVo> getUser(Long erbanNo) {
|
||||
UserVo userVo = userCheckAdminService.getUser(erbanNo);
|
||||
List<Integer> partitionIds = adminPartitionService.getAllPartitionId(getAdminId());
|
||||
if (CollectionUtils.isNotEmpty(partitionIds) && !partitionIds.contains(userVo.getPartitionId())) {
|
||||
throw new AdminServiceException("PARTITION ERROR");
|
||||
}
|
||||
return BusiResult.success(userVo);
|
||||
}
|
||||
|
||||
@RequestMapping("/saveUser")
|
||||
@ResponseBody
|
||||
public BusiResult<Users> saveUser(String nick, Integer gender, String avatar, Long uid, String phoneAreaCode, String phone, String email,
|
||||
|
@@ -2,17 +2,22 @@ package com.accompany.admin.controller.vip;
|
||||
|
||||
import com.accompany.admin.controller.BaseController;
|
||||
import com.accompany.admin.service.system.AdminLogService;
|
||||
import com.accompany.admin.service.system.AdminPartitionService;
|
||||
import com.accompany.admin.service.vip.VipSendAdminService;
|
||||
import com.accompany.admin.vo.vip.VipSendRecordVo;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.result.PageResult;
|
||||
import com.accompany.core.exception.AdminServiceException;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Api(tags = "赠送vip")
|
||||
@RequestMapping("/vipSend")
|
||||
@@ -23,6 +28,8 @@ public class VipSendAdminController extends BaseController {
|
||||
private VipSendAdminService vipSendService;
|
||||
@Autowired
|
||||
private AdminLogService adminLogService;
|
||||
@Autowired
|
||||
private AdminPartitionService adminPartitionService;
|
||||
|
||||
@ApiOperation("分页获取赠送记录")
|
||||
@ApiImplicitParams({
|
||||
@@ -32,8 +39,12 @@ public class VipSendAdminController extends BaseController {
|
||||
})
|
||||
@GetMapping("/pageRecord")
|
||||
public BusiResult<PageResult<VipSendRecordVo>> pageRecord(Long erbanNo,
|
||||
int current, int size) {
|
||||
Page<VipSendRecordVo> pageInfo = vipSendService.pageRecord(erbanNo, current, size, null);
|
||||
int current, int size, Integer ads) {
|
||||
Integer adminId = null;
|
||||
if (ads != null && ads == 1) {
|
||||
adminId = getAdminId();
|
||||
}
|
||||
Page<VipSendRecordVo> pageInfo = vipSendService.pageRecord(erbanNo, current, size, adminId);
|
||||
return BusiResult.success(new PageResult<>(pageInfo));
|
||||
}
|
||||
|
||||
@@ -47,7 +58,24 @@ public class VipSendAdminController extends BaseController {
|
||||
public BusiResult<Void> pageRecord(long uid, int vipLevel, Integer days) {
|
||||
int adminId = getAdminId();
|
||||
adminLogService.insertLog(adminId, getClass().getCanonicalName(),"send vip","params===>>uid:"+uid+",===>>vipLevel:"+vipLevel+",===>>days:"+days );
|
||||
vipSendService.send(uid, vipLevel, adminId, days);
|
||||
vipSendService.send(uid, vipLevel, adminId, days, Boolean.FALSE);
|
||||
return BusiResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("赠送-客服")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "uid", value = "uid", required = true),
|
||||
@ApiImplicitParam(name = "vipLevel", value = "vip等级", required = true),
|
||||
@ApiImplicitParam(name = "days", value = "days", required = true)
|
||||
})
|
||||
@PostMapping("/customerSend")
|
||||
public BusiResult<Void> customerSend(long uid, int vipLevel, Integer days) {
|
||||
if (vipLevel > 5) {
|
||||
throw new AdminServiceException("赠送vip等级不能大于5");
|
||||
}
|
||||
int adminId = getAdminId();
|
||||
adminLogService.insertLog(adminId, getClass().getCanonicalName(),"customerSend vip","params===>>uid:"+uid+",===>>vipLevel:"+vipLevel+",===>>days:"+days );
|
||||
vipSendService.send(uid, vipLevel, adminId, days, Boolean.TRUE);
|
||||
return BusiResult.success();
|
||||
}
|
||||
|
||||
|
@@ -19,7 +19,7 @@ spring:
|
||||
nacos:
|
||||
config:
|
||||
server-addr: 124.156.164.187:8848
|
||||
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
||||
namespace: aeb633ac-d6eb-4d3e-b40d-80b5458064b0
|
||||
file-extension: yml
|
||||
shared-configs:
|
||||
- data-id: application.yml
|
||||
@@ -30,7 +30,7 @@ spring:
|
||||
refresh: true
|
||||
- data-id: sysconf.yml
|
||||
refresh: true
|
||||
- data-id: threadpool.yml
|
||||
- data-id: dtp.yml
|
||||
refresh: true
|
||||
|
||||
---
|
||||
@@ -42,7 +42,7 @@ spring:
|
||||
nacos:
|
||||
config:
|
||||
server-addr: 124.156.164.187:8848
|
||||
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
||||
namespace: aeb633ac-d6eb-4d3e-b40d-80b5458064b0
|
||||
file-extension: yml
|
||||
shared-configs:
|
||||
- data-id: application.yml
|
||||
@@ -53,7 +53,7 @@ spring:
|
||||
refresh: true
|
||||
- data-id: sysconf.yml
|
||||
refresh: true
|
||||
- data-id: threadpool.yml
|
||||
- data-id: dtp.yml
|
||||
refresh: true
|
||||
- data-id: database.yml
|
||||
refresh: true
|
||||
@@ -67,7 +67,7 @@ spring:
|
||||
nacos:
|
||||
config:
|
||||
server-addr: 172.19.16.15:8848
|
||||
namespace: 0c9bf047-19ca-4969-bf5d-bbc1f86b501a
|
||||
namespace: aeb633ac-d6eb-4d3e-b40d-80b5458064b0
|
||||
file-extension: yml
|
||||
shared-configs:
|
||||
- data-id: application.yml
|
||||
@@ -78,7 +78,7 @@ spring:
|
||||
refresh: true
|
||||
- data-id: sysconf.yml
|
||||
refresh: true
|
||||
- data-id: threadpool.yml
|
||||
- data-id: dtp.yml
|
||||
refresh: true
|
||||
- data-id: database.yml
|
||||
refresh: true
|
@@ -7,7 +7,7 @@
|
||||
|
||||
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
|
||||
<property name="LOG_HOME" value="/data/java/weblog/accompany-admin"/>
|
||||
<property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] [%X{trace_uuid}] %-5level %logger{36} %line - %msg%n" />
|
||||
<property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] [%X{traceId}] %-5level %logger{36} %line - %msg%n" />
|
||||
|
||||
<!--写入日志到控制台的appender,用默认的,但是要去掉charset,否则windows下tomcat下乱码-->
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package com.accompany.flowteam.admin;
|
||||
|
||||
import cn.hippo4j.core.enable.EnableDynamicThreadPool;
|
||||
import org.dromara.dynamictp.spring.annotation.EnableDynamicTp;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.SpringBootConfiguration;
|
||||
@@ -14,7 +14,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
* admin
|
||||
*
|
||||
*/
|
||||
@EnableDynamicThreadPool
|
||||
@EnableDynamicTp
|
||||
@SpringBootApplication
|
||||
@ComponentScan({"com.accompany","com.xuanyin"})
|
||||
@EnableScheduling
|
||||
|
@@ -19,7 +19,7 @@ spring:
|
||||
nacos:
|
||||
config:
|
||||
server-addr: 124.156.164.187:8848
|
||||
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
||||
namespace: aeb633ac-d6eb-4d3e-b40d-80b5458064b0
|
||||
file-extension: yml
|
||||
shared-configs:
|
||||
- data-id: application.yml
|
||||
@@ -30,7 +30,7 @@ spring:
|
||||
refresh: true
|
||||
- data-id: sysconf.yml
|
||||
refresh: true
|
||||
- data-id: threadpool.yml
|
||||
- data-id: dtp.yml
|
||||
refresh: true
|
||||
|
||||
---
|
||||
@@ -42,7 +42,7 @@ spring:
|
||||
nacos:
|
||||
config:
|
||||
server-addr: 124.156.164.187:8848
|
||||
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
||||
namespace: aeb633ac-d6eb-4d3e-b40d-80b5458064b0
|
||||
file-extension: yml
|
||||
shared-configs:
|
||||
- data-id: application.yml
|
||||
@@ -53,7 +53,7 @@ spring:
|
||||
refresh: true
|
||||
- data-id: sysconf.yml
|
||||
refresh: true
|
||||
- data-id: threadpool.yml
|
||||
- data-id: dtp.yml
|
||||
refresh: true
|
||||
- data-id: database.yml
|
||||
refresh: true
|
||||
@@ -66,7 +66,7 @@ spring:
|
||||
nacos:
|
||||
config:
|
||||
server-addr: 172.19.16.15:8848
|
||||
namespace: 0c9bf047-19ca-4969-bf5d-bbc1f86b501a
|
||||
namespace: aeb633ac-d6eb-4d3e-b40d-80b5458064b0
|
||||
file-extension: yml
|
||||
shared-configs:
|
||||
- data-id: application.yml
|
||||
@@ -77,7 +77,7 @@ spring:
|
||||
refresh: true
|
||||
- data-id: sysconf.yml
|
||||
refresh: true
|
||||
- data-id: threadpool.yml
|
||||
- data-id: dtp.yml
|
||||
refresh: true
|
||||
- data-id: database.yml
|
||||
refresh: true
|
||||
|
@@ -76,4 +76,6 @@ public interface UsersMapper {
|
||||
|
||||
|
||||
List<Users> listUid(@Param("start") Integer start, @Param("len") Integer len);
|
||||
|
||||
Integer recharegeCount(@Param("uid") Long uid);
|
||||
}
|
@@ -22,7 +22,6 @@ import com.google.gson.reflect.TypeToken;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
@@ -523,4 +522,9 @@ public class UsersBaseService extends BaseService {
|
||||
deleteUserRelateCache(uid.toString());
|
||||
}
|
||||
|
||||
|
||||
public Integer rechargeUserCount(Long uid) {
|
||||
return usersMapper.recharegeCount(uid);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -140,7 +140,7 @@ public class I18NMessageSourceUtil {
|
||||
@SneakyThrows
|
||||
public static void deserialization(Object obj, List<String> fieldNames) {
|
||||
MessageI18nNacosService messageI18nNacosService = SpringContextHolder.getBean(MessageI18nNacosService.class);
|
||||
ThreadPoolExecutor bizExecutor = SpringContextHolder.getBean(ThreadPoolExecutor.class);
|
||||
ThreadPoolExecutor bizExecutor = SpringContextHolder.getBean("biz-executor");
|
||||
Class<?> clazz = obj.getClass();
|
||||
Set<Locale> refreshLocalSet = new HashSet<>();
|
||||
for (Field field : clazz.getDeclaredFields()) {
|
||||
|
@@ -1082,4 +1082,8 @@
|
||||
/* SHARDINGSPHERE_HINT: WRITE_ROUTE_ONLY=true */
|
||||
select uid, partition_id partitionId from users order by uid asc limit #{start},#{len}
|
||||
</select>
|
||||
|
||||
<select id="recharegeCount" resultType="java.lang.Integer">
|
||||
select ifnull(count(1),0) from recharge_user where uid = #{uid}
|
||||
</select>
|
||||
</mapper>
|
@@ -15,9 +15,20 @@ public class Attach {
|
||||
private String message;
|
||||
private Object data;
|
||||
|
||||
//用于携带给客户端,用于区分同一组first和second的消息,是单房间消息,还是轮询全服房间遍历发送的单房间消息
|
||||
//已使用公聊房机制,解决轮询全服房间发送消息的云信im限频问题
|
||||
private Integer allRoomMsg;
|
||||
|
||||
public Attach(int first, int second, Object data) {
|
||||
this.first = first;
|
||||
this.second = second;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public Attach(int first, int second, Object data, int allRoomMsg) {
|
||||
this.first = first;
|
||||
this.second = second;
|
||||
this.data = data;
|
||||
this.allRoomMsg = allRoomMsg;
|
||||
}
|
||||
}
|
||||
|
@@ -978,6 +978,19 @@ public enum BusiStatus {
|
||||
|
||||
GUILD_H5_INVITE_EMAIL_ALREADY_BOUND(33001, "该邮箱地址不是新的"),
|
||||
GUILD_H5_INVITE_JOIN_GUILD_NOT_EXIST(33002, "邀请人公会不存在"),
|
||||
DAILY_TASK_LIMIT(500, "ACCESS DENIED"),
|
||||
ROOM_DAY_DIAMOND_REWARD_RECV_RECORD_EXIST(500, "RECEIVED"),
|
||||
ROOM_DAY_DIAMOND_REWARD_SEND(500, "SEND"),
|
||||
DAILY_TASK_RECEIVE_END(500, "RECEIVED EXPIRE"),
|
||||
SUPER_BLOCK_NOAUTHORITY(500, "NOAUTHORITY OPERATE"),
|
||||
SUPER_BLOCK_MUST_BLOCK_REASON(500, "MUST SIGN BLOCK REASON"),
|
||||
DAILY_TASK_REWARD_ERROR(500, "DAILY TASK REWARD ERROR"),
|
||||
RECHARGE_REGION_GIVE_LIMIT(500,"你暂时还未开启该区域业务"),
|
||||
RECHARGE_REGION_SALARY_LIMIT(500,"该代理暂不代理该区域业务"),
|
||||
ROOM_DAY_DIAMOND_REWARD_DATE_CHECK(500, "TODAY NOT ALLOW RECEIVE"),
|
||||
GUILD_USD_OPT_LIMIT(500, "该交易类型已达到本周交易次数上限"),
|
||||
GUILD_MEMBER_REMOVE_LIMIT(500, "仅在每个月1号、2号、3号才可以移除主播"),
|
||||
H5_RECHARGE_USER_NOT_OPEN(1404, "Your account has not enabled this function yet, so it cannot be used."),
|
||||
;
|
||||
|
||||
private final int value;
|
||||
|
@@ -7,7 +7,7 @@ import java.util.Set;
|
||||
public class ImageFileUtils {
|
||||
|
||||
// 定义一个包含常见静态图片扩展名的数组
|
||||
private static final Set<String> imageFileExtensionSet = Set.of("jpg", "jpeg", "png", "gif", "svga");
|
||||
private static final Set<String> imageFileExtensionSet = Set.of("jpg", "jpeg", "png", "gif", "svga", "mp4");
|
||||
|
||||
public static boolean isImageFile(String url) {
|
||||
String extension = StringUtils.substringAfterLast(url, ".");
|
||||
@@ -19,4 +19,9 @@ public class ImageFileUtils {
|
||||
return "gif".equals(extension);
|
||||
}
|
||||
|
||||
public static boolean isMp4(String url){
|
||||
String extension = StringUtils.substringAfterLast(url, ".");
|
||||
return "mp4".equals(extension);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -84,24 +84,30 @@
|
||||
<artifactId>spring-boot-starter-freemarker</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hippo4j</groupId>
|
||||
<artifactId>hippo4j-config-spring-boot-starter</artifactId>
|
||||
<version>${hippo4j-config-spring-boot-starter.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hippo4j</groupId>
|
||||
<artifactId>hippo4j-spring-boot-starter-monitor-micrometer</artifactId>
|
||||
<version>${hippo4j-config-spring-boot-starter.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.rocketmq</groupId>
|
||||
<artifactId>rocketmq-spring-boot-starter</artifactId>
|
||||
<version>${rocketmq-spring-boot.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara.dynamictp</groupId>
|
||||
<artifactId>dynamic-tp-spring-cloud-starter-nacos</artifactId>
|
||||
<version>${dynamic-tp.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara.dynamictp</groupId>
|
||||
<artifactId>dynamic-tp-spring-boot-starter-adapter-webserver</artifactId>
|
||||
<version>${dynamic-tp.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara.dynamictp</groupId>
|
||||
<artifactId>dynamic-tp-spring-boot-starter-adapter-rocketmq</artifactId>
|
||||
<version>${dynamic-tp.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
@@ -29,7 +29,7 @@ import java.util.stream.Collectors;
|
||||
@Component
|
||||
public class ApiRequestLogAspect {
|
||||
|
||||
public static final String TRACE_UUID = "trace_uuid";
|
||||
public static final String TRACE_ID = "traceId";
|
||||
|
||||
@Autowired
|
||||
private ObjectMapper objectMapper;
|
||||
@@ -56,7 +56,8 @@ public class ApiRequestLogAspect {
|
||||
return joinPoint.proceed();
|
||||
}
|
||||
|
||||
MDC.put(TRACE_UUID, UUID.randomUUID().toString());
|
||||
String requestUuid = UUID.randomUUID().toString();
|
||||
MDC.put(TRACE_ID, requestUuid);
|
||||
|
||||
requestInfo(joinPoint, request, requestURI);
|
||||
|
||||
@@ -79,7 +80,7 @@ public class ApiRequestLogAspect {
|
||||
|
||||
log.info("====== Api called end ====== [URL] {} [CostTime] {} ms! [RESULT] {}", requestURI, (end - start), resultStr);
|
||||
|
||||
MDC.remove(TRACE_UUID);
|
||||
MDC.remove(TRACE_ID);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,28 @@
|
||||
package com.accompany.common.config;
|
||||
|
||||
import com.accompany.core.base.SpringContextHolder;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.AsyncConfigurer;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
@Slf4j
|
||||
@EnableAsync
|
||||
@Configuration
|
||||
public class ExecutorConfig implements AsyncConfigurer {
|
||||
|
||||
@Override
|
||||
public Executor getAsyncExecutor() {
|
||||
return SpringContextHolder.getBean("async-executor");
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
|
||||
return (ex,method,params)->log.error("@Async 执行异步方法{} 错误,参数{}", method, JSON.toJSONString(params), ex);
|
||||
}
|
||||
|
||||
}
|
@@ -32,4 +32,6 @@ public class TencentCosConfig {
|
||||
|
||||
private Boolean accelerate = false;
|
||||
|
||||
private String gifJobTemplateId;
|
||||
|
||||
}
|
||||
|
@@ -1,6 +1,8 @@
|
||||
package com.accompany.common.constant;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@@ -13,13 +15,15 @@ public enum AppEnum {
|
||||
|
||||
other("other", "other", "api.pekolive.com", "image.pekolive.com", "api.pekolive.com", "pekolive", Map.of()),
|
||||
youmi("youmi", "molistar ios马甲包", "api.hfighting.com", "image.molistar.xyz", "api.hfighting.com", "molistar",
|
||||
Map.of(Pattern.compile("baishun.minigame.*"), "baishun.minigame.molistar.xyz")),
|
||||
Map.of(Pattern.compile("baishun.minigame.*"), "baishun.minigame.moliparty.com")),
|
||||
molistar("molistar", "molistar google马甲包", "api.molistar.xyz", "image.molistar.xyz", "api.molistar.xyz", "molistar",
|
||||
Map.of(Pattern.compile("baishun.minigame.*"), "baishun.minigame.molistar.xyz")),
|
||||
moliparty("MoliParty", "moliparty google马甲包", "api.moliparty.com", "cdn.moliparty.com", "api.moliparty.com", "moliparty",
|
||||
Map.of(Pattern.compile("baishun.minigame.*"), "baishun.minigame.moliparty.com")),
|
||||
;
|
||||
|
||||
public static AppEnum getCurApp(){
|
||||
return AppEnum.molistar;
|
||||
return AppEnum.moliparty;
|
||||
}
|
||||
|
||||
private String value;
|
||||
@@ -74,4 +78,15 @@ public enum AppEnum {
|
||||
return patternMap;
|
||||
}
|
||||
|
||||
|
||||
public static List<AppEnum> getOtherAppEnums(AppEnum currentApp) {
|
||||
List<AppEnum> otherApps = new ArrayList<>();
|
||||
// 遍历所有枚举,排除传入的 app 对应的枚举
|
||||
for (AppEnum app : AppEnum.values()) {
|
||||
if (!app.equals(currentApp)) {
|
||||
otherApps.add(app);
|
||||
}
|
||||
}
|
||||
return otherApps;
|
||||
}
|
||||
}
|
||||
|
@@ -39,13 +39,14 @@ public class Constant {
|
||||
*/
|
||||
public static class OfficialType {
|
||||
public static Byte interSendDiamond = 12; // 官方直接送钻石
|
||||
public static Byte actReward = 17; // 活动奖励
|
||||
public static Byte chargeByCompanyAccount = 20; // 打款至公账充值金币
|
||||
public static Byte officalDiamondReduce = 51; // 官方钻石支出
|
||||
public static Byte clearUserGold = 61; //用户金币清除
|
||||
public static Byte interSendGold = 62; // 官方直接送钻石
|
||||
public static Byte miunsGuildUsd = 63; // 官方直接消除薪资
|
||||
public static Byte plusGuildUsd = 64; // 官方直接赠送薪资
|
||||
public static Byte miunsGuildCrystal = 65; // 官方直接消除薪资
|
||||
public static Byte plusGuildCrystal = 66; // 官方直接赠送薪资
|
||||
}
|
||||
|
||||
public static class AppVersion {
|
||||
@@ -1385,6 +1386,20 @@ public class Constant {
|
||||
public static final String USER_SET_LIMIT_CONFIG = "user_set_limit_config";
|
||||
|
||||
public static final String OFFICIAL_GOLD_ROLE_LIMIT_CONFIG = "official_gold_role_limit_config";
|
||||
|
||||
public static final String GUILD_USD_PROD_TAB_SHOW_CONFIG = "guild_usd_prod_tab_show_config";
|
||||
|
||||
public static final String GUILD_WEEK_LEVEL_R_FILTER = "guild_week_level_R_filter";
|
||||
|
||||
public static final String GUILD_MEMBER_NEW_UP_ACCEPT_REGION = "guild_member_new_up_accept_region";
|
||||
|
||||
public static final String EXTRA_DIAMOND_RATE_CONFIG = "extra_diamond_rate_config";
|
||||
|
||||
public static final String CP_MIC_SVGA_URL = "cp_mic_svga_url";
|
||||
|
||||
public static final String CHARGE_USER_X_GOLD = "charge_user_x_gold";
|
||||
|
||||
public static final String GUILD_OPERATE_CONFIG = "guild_operate_config";
|
||||
}
|
||||
|
||||
public static class WithDrawStatus {
|
||||
@@ -1879,9 +1894,9 @@ public class Constant {
|
||||
public static final Byte invalid = 0; //无效
|
||||
}
|
||||
|
||||
public static String DEFAULT_DOMAIN = "https://img.molistar.xyz";
|
||||
public static String DEFAULT_DOMAIN = "https://cdn.moliparty.com";
|
||||
public static String DEFAULT_NICK = "Platform New User";
|
||||
public static String DEFAULT_AVATAR = DEFAULT_DOMAIN + "/default_avatar_molistar.png";
|
||||
public static String DEFAULT_AVATAR = DEFAULT_DOMAIN + "/useavater_MP.png";
|
||||
public static String DEFAULT_CAR = DEFAULT_DOMAIN + "/default_car.png";
|
||||
|
||||
/**
|
||||
@@ -2531,7 +2546,8 @@ public class Constant {
|
||||
public static final Byte gold = 0; // 金币 现为钻石
|
||||
public static final Byte radish = 1; // 水晶
|
||||
public static final Byte diamonds = 2; //钻石 现为金币
|
||||
public static final Byte usd = 4;
|
||||
public static final Byte guildUsd = 4;
|
||||
public static final Byte guildCrystal = 6;
|
||||
}
|
||||
|
||||
public static class PrizePoolType {
|
||||
@@ -4071,6 +4087,7 @@ public class Constant {
|
||||
public static final String FAMILY = "family";
|
||||
public static final String GUILD = "guild";
|
||||
public static final String GUILD_POLICY2 = "guild_policy2";
|
||||
public static final String SOVIET = "soviet";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4083,5 +4100,6 @@ public class Constant {
|
||||
public static final int ADD = 2;
|
||||
}
|
||||
|
||||
public static final String GLOBAL_CODE = "Global";
|
||||
}
|
||||
|
||||
|
@@ -58,6 +58,7 @@ public enum RedisKey {
|
||||
lock_user_diamond, // 钻石分布式锁
|
||||
lock_user_crystal, // 水晶分布式锁
|
||||
lock_user_guild_usd, // 公会usd分布式锁
|
||||
lock_user_guild_crystal, // 公会usd分布式锁
|
||||
lock_gift_message, // 消费送礼物消息锁
|
||||
mq_gift_status, // 礼物消息的状态
|
||||
mq_prize_status, // 中奖消息的状态
|
||||
@@ -1327,6 +1328,7 @@ public enum RedisKey {
|
||||
guild_member_room_mic_record_vo,
|
||||
guild_week_rank,
|
||||
guild_month_rank,
|
||||
guild_crystal_settlement,
|
||||
|
||||
//幸运24
|
||||
lucky_24_stock,
|
||||
@@ -1335,8 +1337,7 @@ public enum RedisKey {
|
||||
lucky_24_user_history,
|
||||
lucky_24_user_lock,
|
||||
lucky_24_robot_push_msg,
|
||||
lucky_24_status, // 礼物消息的状态
|
||||
lock_lucky_24_message, // 消费送礼物消息锁
|
||||
lucky_24_record_message, // 礼物消息的状态
|
||||
lucky_24_user_10w_stat, // 消费送礼物消息锁
|
||||
|
||||
lucky_24_extra_stock,
|
||||
@@ -1360,6 +1361,8 @@ public enum RedisKey {
|
||||
family_member_week_level_reward,
|
||||
guild_member_week_level_reward,
|
||||
|
||||
guild_member_room_mic_day_duration,
|
||||
|
||||
partition_info,
|
||||
|
||||
app_ui_setting,//app UI设置
|
||||
@@ -1386,7 +1389,6 @@ public enum RedisKey {
|
||||
charge_floating_count, //充值飘屏计数器
|
||||
|
||||
bill_record_message,
|
||||
lock_bill_record_message,
|
||||
|
||||
|
||||
//小游戏重复订单
|
||||
@@ -1465,11 +1467,11 @@ public enum RedisKey {
|
||||
lock_user_pack, //礼包锁
|
||||
|
||||
v5pay_lock, //v5pay支付锁
|
||||
;
|
||||
|
||||
public String getKey() {
|
||||
return ("molistar_" + name()).toLowerCase();
|
||||
}
|
||||
guild_usd_withdraw_num, //公会薪资提现次数
|
||||
guild_usd_to_recharge_num,//公会薪资转代理次数
|
||||
charge_user_x_detail,//嫌疑用户
|
||||
;
|
||||
|
||||
public String getKey(String suffix) {
|
||||
if (StringUtils.isEmpty(suffix)) {
|
||||
@@ -1498,6 +1500,10 @@ public enum RedisKey {
|
||||
}
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return ("molistar_" + name()).toLowerCase();
|
||||
}
|
||||
|
||||
public static String getCacheSign() {
|
||||
return "molistar_";
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user