冲榜发邮件内容优化
parent
7b1ff178d8
commit
445da5f7c0
|
@ -12,10 +12,7 @@ import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
|
||||||
import com.ljsd.jieling.network.server.ProtocolsManager;
|
import com.ljsd.jieling.network.server.ProtocolsManager;
|
||||||
import com.ljsd.jieling.thread.ThreadManager;
|
import com.ljsd.jieling.thread.ThreadManager;
|
||||||
import com.ljsd.jieling.util.*;
|
import com.ljsd.jieling.util.*;
|
||||||
import config.SChongRank;
|
import config.*;
|
||||||
import config.SChongRankInfo;
|
|
||||||
import config.SErrorCodeEerverConfig;
|
|
||||||
import config.SGlobalActivity;
|
|
||||||
import org.luaj.vm2.ast.Str;
|
import org.luaj.vm2.ast.Str;
|
||||||
import org.springframework.data.redis.core.ZSetOperations;
|
import org.springframework.data.redis.core.ZSetOperations;
|
||||||
import util.TimeUtils;
|
import util.TimeUtils;
|
||||||
|
@ -181,7 +178,7 @@ public class OpenServerCompeteRankActivity extends AbstractActivity {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
final int rankId = rank;
|
final int rankId = rank;
|
||||||
final double count = score;
|
final int count = Integer.parseInt(String.valueOf(score));
|
||||||
AyyncWorker ayyncWorker = new AyyncWorker(user, true, user1 -> {
|
AyyncWorker ayyncWorker = new AyyncWorker(user, true, user1 -> {
|
||||||
//sendmail
|
//sendmail
|
||||||
String title = OpenServerCompeteRankActivity.this.getMailTitle(rankType);
|
String title = OpenServerCompeteRankActivity.this.getMailTitle(rankType);
|
||||||
|
@ -223,61 +220,23 @@ public class OpenServerCompeteRankActivity extends AbstractActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getMailTitle(int rankType){
|
private String getMailTitle(int rankType){
|
||||||
String title = "";
|
int mailTitle = SChongRankInfo.getMap().get(id).get(rankType).getMailTitle();
|
||||||
switch (rankType){
|
String msg = SErrorCodeEerverConfig.getMsgById(mailTitle);
|
||||||
case 101:
|
return SErrorCodeEerverConfig.getI18NMessage(msg);
|
||||||
title = "chongrankchongxing_mail_title";
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
title = "chongrankguanka_mail_title";
|
|
||||||
break;
|
|
||||||
case 22:
|
|
||||||
title = "chongrankzhanli_mail_title";
|
|
||||||
break;
|
|
||||||
case 102:
|
|
||||||
title = "chongrankzhuangbei_mail_title";
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
title = "chongrankxinmo_mail_title";
|
|
||||||
break;
|
|
||||||
case 30:
|
|
||||||
title = "chongrankshanhe_mail_title";
|
|
||||||
break;
|
|
||||||
case 103:
|
|
||||||
title = "chongrankhunyin_mail_title";
|
|
||||||
break;
|
|
||||||
default:break;
|
|
||||||
}
|
|
||||||
return SErrorCodeEerverConfig.getI18NMessage(title);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getMailContent(int rankType,double score,int rank){
|
private String getMailContent(int rankType,int score,int rank){
|
||||||
String content = "";
|
// 获取邮件内容格式
|
||||||
switch (rankType){
|
int mailText = SChongRankInfo.getMap().get(id).get(rankType).getMailText();
|
||||||
case 101:
|
String msg = SErrorCodeEerverConfig.getMsgById(mailText);
|
||||||
content = "chongrankchongxing_mail_text";
|
// 分值
|
||||||
break;
|
String scoreStr = String.valueOf(score);
|
||||||
case 3:
|
// 类型3主线编队排行榜的分数需要特殊处理
|
||||||
content = "chongrankguanka_mail_text";
|
if (rankType == 3){
|
||||||
break;
|
SMainLevelConfig config = SMainLevelConfig.getVirtualMap().get(score);
|
||||||
case 22:
|
scoreStr = config.getName();
|
||||||
content = "chongrankzhanli_mail_text";
|
|
||||||
break;
|
|
||||||
case 102:
|
|
||||||
content = "chongrankzhuangbei_mail_text";
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
content = "chongrankxinmo_mail_text";
|
|
||||||
break;
|
|
||||||
case 30:
|
|
||||||
content = "chongrankshanhe_mail_text";
|
|
||||||
break;
|
|
||||||
case 103:
|
|
||||||
content = "chongrankhunyin_mail_text";
|
|
||||||
break;
|
|
||||||
default:break;
|
|
||||||
}
|
}
|
||||||
return SErrorCodeEerverConfig.getFormatMessage(content, new Object[]{(int)score,rank});
|
return SErrorCodeEerverConfig.getFormatMessage(msg, new Object[]{scoreStr,rank});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,10 @@ public class SChongRankInfo implements BaseConfig {
|
||||||
|
|
||||||
private int closeTime;
|
private int closeTime;
|
||||||
|
|
||||||
|
private int mailTitle;
|
||||||
|
|
||||||
|
private int mailText;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* key:活动id:key:排行榜类型:value:对象
|
* key:活动id:key:排行榜类型:value:对象
|
||||||
*/
|
*/
|
||||||
|
@ -65,5 +69,11 @@ public class SChongRankInfo implements BaseConfig {
|
||||||
return closeTime;
|
return closeTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getMailTitle() {
|
||||||
|
return mailTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMailText() {
|
||||||
|
return mailText;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -11,6 +11,8 @@ public class SMainLevelConfig implements BaseConfig {
|
||||||
|
|
||||||
private int id;
|
private int id;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
private int nextLevel;
|
private int nextLevel;
|
||||||
|
|
||||||
private int levelLimit;
|
private int levelLimit;
|
||||||
|
@ -110,7 +112,11 @@ public class SMainLevelConfig implements BaseConfig {
|
||||||
return levelLimit;
|
return levelLimit;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMonsterGroup() {
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMonsterGroup() {
|
||||||
return monsterGroup;
|
return monsterGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue