2019-09-06 11:04:28 +08:00
|
|
|
package config;
|
|
|
|
|
|
|
|
import manager.STableManager;
|
|
|
|
import manager.Table;
|
2019-10-11 16:32:20 +08:00
|
|
|
import util.TimeUtils;
|
2019-09-06 11:04:28 +08:00
|
|
|
|
2019-11-27 15:43:24 +08:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
2019-09-06 11:04:28 +08:00
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
@Table(name ="GlobalActivity")
|
|
|
|
public class SGlobalActivity implements BaseConfig {
|
|
|
|
|
|
|
|
private int id;
|
|
|
|
|
|
|
|
private int type;
|
|
|
|
|
|
|
|
private String startTime;
|
|
|
|
|
|
|
|
private String endtime;
|
|
|
|
|
|
|
|
private int time;
|
|
|
|
|
|
|
|
private long startTimeLong;
|
|
|
|
|
|
|
|
private long endTimeLong;
|
|
|
|
|
|
|
|
private static Map<Integer, SGlobalActivity> sGlobalActivityMap;
|
|
|
|
|
|
|
|
private String sesc;
|
|
|
|
|
|
|
|
private int isSaving;
|
|
|
|
|
|
|
|
private int isMail;
|
|
|
|
|
2019-10-15 10:22:08 +08:00
|
|
|
private int[] ifOpen;
|
2019-09-06 11:04:28 +08:00
|
|
|
|
|
|
|
private int shopId;
|
|
|
|
|
2019-10-11 16:32:20 +08:00
|
|
|
private int resetGrade;
|
|
|
|
|
2019-10-30 14:18:22 +08:00
|
|
|
private int openRanking;
|
|
|
|
|
2019-11-24 19:42:22 +08:00
|
|
|
private int[] openRules;
|
|
|
|
|
2019-11-25 11:42:07 +08:00
|
|
|
private int[] foreshow;
|
2019-09-06 11:04:28 +08:00
|
|
|
|
2019-12-13 17:19:26 +08:00
|
|
|
private int gapTime;
|
|
|
|
|
2019-11-27 15:43:24 +08:00
|
|
|
public static Map<Integer, List<SGlobalActivity>> sGlobalActivityMapByType;
|
|
|
|
|
|
|
|
|
2019-09-06 11:04:28 +08:00
|
|
|
@Override
|
|
|
|
public void init() throws Exception {
|
2019-11-27 15:43:24 +08:00
|
|
|
sGlobalActivityMapByType = new HashMap<>();
|
2019-10-11 16:32:20 +08:00
|
|
|
Map<Integer, SGlobalActivity> config = STableManager.getConfig(SGlobalActivity.class);
|
2019-09-06 11:04:28 +08:00
|
|
|
for(SGlobalActivity sGlobalActivity : config.values()){
|
2019-11-27 15:43:24 +08:00
|
|
|
sGlobalActivityMapByType.computeIfAbsent(sGlobalActivity.getType(),n->new ArrayList<>()).add(sGlobalActivity);
|
2019-09-06 11:04:28 +08:00
|
|
|
int time = sGlobalActivity.getTime();
|
|
|
|
String startTime = sGlobalActivity.getStartTime();
|
|
|
|
String endtime = sGlobalActivity.getEndtime();
|
2019-10-11 16:32:20 +08:00
|
|
|
if(time == 1 ){//ActivityType.OPEN_TYPE_TIME
|
2019-09-06 11:04:28 +08:00
|
|
|
if(!"0".equals(startTime)){
|
|
|
|
sGlobalActivity.setStartTimeLong(TimeUtils.parseTimeToMiles(startTime,TimeUtils.Stand_CeHua_Data_format));
|
|
|
|
}
|
|
|
|
if(!"0".equals(endtime)){
|
|
|
|
sGlobalActivity.setEndTimeLong(TimeUtils.parseTimeToMiles(endtime,TimeUtils.Stand_CeHua_Data_format));
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
sGlobalActivity.setStartTimeLong(Long.parseLong(startTime));
|
|
|
|
sGlobalActivity.setEndTimeLong(Long.parseLong(endtime));
|
2019-10-30 14:18:22 +08:00
|
|
|
|
2019-09-06 11:04:28 +08:00
|
|
|
}
|
2019-10-11 16:32:20 +08:00
|
|
|
sGlobalActivityMap = config;
|
2019-09-06 11:04:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
public static Map<Integer, SGlobalActivity> getsGlobalActivityMap() {
|
|
|
|
return sGlobalActivityMap;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getId() {
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getType() {
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getStartTime() {
|
|
|
|
return startTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getEndtime() {
|
|
|
|
return endtime;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getTime() {
|
|
|
|
return time;
|
|
|
|
}
|
|
|
|
|
2019-10-11 16:32:20 +08:00
|
|
|
|
2019-09-06 11:04:28 +08:00
|
|
|
|
|
|
|
public void setStartTimeLong(long startTimeLong) {
|
|
|
|
this.startTimeLong = startTimeLong;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setEndTimeLong(long endTimeLong) {
|
|
|
|
this.endTimeLong = endTimeLong;
|
|
|
|
}
|
|
|
|
|
2019-10-11 16:32:20 +08:00
|
|
|
public long getStartTimeLong() {
|
|
|
|
return startTimeLong;
|
|
|
|
}
|
|
|
|
|
|
|
|
public long getEndTimeLong() {
|
|
|
|
return endTimeLong;
|
|
|
|
}
|
|
|
|
|
2019-09-06 11:04:28 +08:00
|
|
|
public String getSesc() { return sesc; }
|
|
|
|
|
|
|
|
public int getIsSaving() {
|
|
|
|
return isSaving;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getIsMail() {
|
|
|
|
return isMail;
|
|
|
|
}
|
|
|
|
|
2019-10-15 10:22:08 +08:00
|
|
|
public int[] getIfOpen() {
|
2019-09-06 11:04:28 +08:00
|
|
|
return ifOpen;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getShopId() {
|
|
|
|
return shopId;
|
|
|
|
}
|
2019-10-11 16:32:20 +08:00
|
|
|
|
|
|
|
public int getResetGrade() {
|
|
|
|
return resetGrade;
|
|
|
|
}
|
|
|
|
|
2019-10-30 15:25:21 +08:00
|
|
|
public int getOpenRanking() {
|
|
|
|
return openRanking;
|
|
|
|
}
|
2019-11-24 19:42:22 +08:00
|
|
|
|
|
|
|
public int[] getOpenRules() {
|
|
|
|
return openRules;
|
|
|
|
}
|
2019-11-25 11:42:07 +08:00
|
|
|
|
|
|
|
public int[] getForeshow() {
|
|
|
|
return foreshow;
|
|
|
|
}
|
2019-12-13 17:19:26 +08:00
|
|
|
|
|
|
|
public int getGapTime() {
|
|
|
|
return gapTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setType(int type) {
|
|
|
|
this.type = type;
|
|
|
|
}
|
2019-09-06 11:04:28 +08:00
|
|
|
}
|