Compare commits
3 Commits
4564cfbbf2
...
master
Author | SHA1 | Date | |
---|---|---|---|
4eb1d55b1b | |||
a4768691bb | |||
230f81fd98 |
@@ -1894,7 +1894,7 @@ 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_CAR = DEFAULT_DOMAIN + "/default_car.png";
|
||||
|
@@ -319,9 +319,9 @@ public enum I18nAlertEnum {
|
||||
GOLD_BEAN_NAME("Gold Bean"),
|
||||
DIAMOND_NAME("DIAMOND"),
|
||||
GUILD_CREATE_TASK_MSG("你在公会的卓越表现,获得了精美奖励。快去背包看看吧!"),
|
||||
EXTRA_GUILD_MSG("你的钻石奖励已经发放,请注意查收。"),
|
||||
EXTRA_GUILD_MEMBER_MSG("你的钻石奖励已经发放,请注意查收。"),
|
||||
EXTRA_ROOM_MSG("你的钻石奖励已经发放,请注意查收。"),
|
||||
EXTRA_GUILD_MSG("尊敬的用户,根据政策,您的公会长次日奖励{0}钻石已到账,您可以前往【我的钱包】查看。"),
|
||||
EXTRA_GUILD_MEMBER_MSG("尊敬的用户,根据政策,您的主播次日奖励{0}钻石已到账,您可以前往【我的钱包】查看。"),
|
||||
EXTRA_ROOM_MSG("尊敬的用户,根据政策,您每周一结算的奖励{0}钻石已到账,您可以前往【我的钱包】查看。"),
|
||||
;
|
||||
|
||||
private final String defaultStr;
|
||||
|
@@ -547,15 +547,12 @@ public class GuildManagerService {
|
||||
Collections.shuffle(guildList);
|
||||
guildList = guildList.subList(0, 10);
|
||||
}
|
||||
List<Integer> guildIds = guildList.stream().map(Guild::getId).collect(Collectors.toList());
|
||||
Map<Integer, GuildSSRankDetailVo> ssMarkMap = ssGuildService.getSSMarkByGuildId(partitionInfo.getId(), guildIds);
|
||||
Map<Integer, Integer> memberNumMap = guildService.getGuildMemberNumMapByGuildIds(guildIds);
|
||||
for (Guild guild: guildList){
|
||||
SimpleGuildVo vo = new SimpleGuildVo();
|
||||
vo.setGuildId(guild.getId());
|
||||
vo.setGuildName(guild.getName());
|
||||
vo.setMemberNumLimit(guild.getMemberNumLimit());
|
||||
|
||||
vo.setOwnerUid(guild.getOwnerUid());
|
||||
vo.setWeekIncome(weekIncomeMap.getOrDefault(guild.getId(), 0D));
|
||||
voList.add(vo);
|
||||
}
|
||||
|
@@ -138,19 +138,20 @@ public class ExtraDiamondDayService {
|
||||
boolean updateBatchById = guildExtraDiamondDayService.updateBatchById(guildExtraDiamondDays);
|
||||
if (!updateBatchById) {
|
||||
}
|
||||
HashSet<Long> uids = new HashSet<>();
|
||||
Map<Long, BigDecimal> sendGoldMap = new HashMap<>();
|
||||
for (GuildExtraDiamondDay extraDiamondDay : guildExtraDiamondDays) {
|
||||
BigDecimal sendGold = BigDecimal.ZERO;
|
||||
if (extraDiamondDay.getAnchorExtraNum().compareTo(BigDecimal.ZERO) > 0) {
|
||||
userPurseService.addGold(extraDiamondDay.getUid(), extraDiamondDay.getAnchorExtraNum().doubleValue(), ANCHOR_EXTRA_GOLD);
|
||||
uids.add(extraDiamondDay.getUid());
|
||||
sendGold = sendGold.add(extraDiamondDay.getAnchorExtraNum());
|
||||
}
|
||||
if (extraDiamondDay.getAnchorExtraLuckyNum().compareTo(BigDecimal.ZERO) > 0) {
|
||||
userPurseService.addGold(extraDiamondDay.getUid(), extraDiamondDay.getAnchorExtraLuckyNum().doubleValue(), ANCHOR_EXTRA_LUCKY_GOLD);
|
||||
uids.add(extraDiamondDay.getUid());
|
||||
sendGold = sendGold.add(extraDiamondDay.getAnchorExtraLuckyNum());
|
||||
}
|
||||
sendGoldMap.put(extraDiamondDay.getUid(), sendGold);
|
||||
}
|
||||
String message = I18NMessageSourceUtil.getMessage(I18nAlertEnum.EXTRA_GUILD_MEMBER_MSG, partitionId);
|
||||
this.sendMessage(message, uids);
|
||||
this.sendMessage(I18nAlertEnum.EXTRA_GUILD_MEMBER_MSG, sendGoldMap, partitionId);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("sendGuildMemberExtraDiamondTask anchor error" , e);
|
||||
@@ -204,15 +205,14 @@ public class ExtraDiamondDayService {
|
||||
ownerExtra = ownerExtra == null ? add : ownerExtra.add(add);
|
||||
ownerExtraMap.put(ownerUid, ownerExtra);
|
||||
}
|
||||
HashSet<Long> uids = new HashSet<>();
|
||||
Map<Long, BigDecimal> sendGoldMap = new HashMap<>();
|
||||
for (Map.Entry<Long, BigDecimal> decimalEntry : ownerExtraMap.entrySet()) {
|
||||
if (decimalEntry.getValue().compareTo(BigDecimal.ZERO) > 0) {
|
||||
userPurseService.addGold(decimalEntry.getKey(), decimalEntry.getValue().doubleValue(), OWNER_EXTRA_GOLD);
|
||||
uids.add(decimalEntry.getKey());
|
||||
sendGoldMap.put(decimalEntry.getKey(), decimalEntry.getValue());
|
||||
}
|
||||
}
|
||||
String message = I18NMessageSourceUtil.getMessage(I18nAlertEnum.EXTRA_GUILD_MSG, partitionId);
|
||||
this.sendMessage(message, uids);
|
||||
this.sendMessage(I18nAlertEnum.EXTRA_GUILD_MSG, sendGoldMap, partitionId);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("sendGuildExtraDiamondTask anchor error" , e);
|
||||
@@ -258,18 +258,17 @@ public class ExtraDiamondDayService {
|
||||
},
|
||||
BigDecimal::add
|
||||
));
|
||||
HashSet<Long> uids = new HashSet<>();
|
||||
Map<Long, BigDecimal> sendGoldMap = new HashMap<>();
|
||||
extraDiamondMap.entrySet().stream()
|
||||
.filter(entry -> entry.getValue().compareTo(BigDecimal.ZERO) > 0)
|
||||
.forEach(entry -> {
|
||||
Long roomUid = entry.getKey();
|
||||
BigDecimal extraDiamond = entry.getValue();
|
||||
userPurseService.addGold(roomUid, extraDiamond.doubleValue(), ROOM_EXTRA_GOLD);
|
||||
uids.add(roomUid);
|
||||
sendGoldMap.put(roomUid, extraDiamond);
|
||||
});
|
||||
|
||||
String message = I18NMessageSourceUtil.getMessage(I18nAlertEnum.EXTRA_GUILD_MEMBER_MSG, partitionId);
|
||||
this.sendMessage(message, uids);
|
||||
this.sendMessage(I18nAlertEnum.EXTRA_ROOM_MSG, sendGoldMap, partitionId);
|
||||
} catch (Exception e) {
|
||||
log.error("sendLastDayDiamondtask room error" , e);
|
||||
} finally {
|
||||
@@ -280,9 +279,13 @@ public class ExtraDiamondDayService {
|
||||
}
|
||||
|
||||
@Async
|
||||
public void sendMessage(String msg, Set<Long> uids) {
|
||||
uids.forEach(uid -> {
|
||||
baseSendService.sendSystemMsg(uid.toString(), msg);
|
||||
public void sendMessage(I18nAlertEnum msg, Map<Long, BigDecimal> sendGoldMap, Integer partitionId) {
|
||||
sendGoldMap.entrySet().forEach(entry -> {
|
||||
if (entry.getValue().compareTo(BigDecimal.ZERO) <= 0) {
|
||||
return;
|
||||
}
|
||||
String message = I18NMessageSourceUtil.getMessage(msg, new Object[]{entry.getValue()}, partitionId);
|
||||
baseSendService.sendSystemMsg(entry.getKey().toString(), message);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user