127 lines
2.7 KiB
Java
127 lines
2.7 KiB
Java
package config;
|
|
|
|
import manager.STableManager;
|
|
import manager.Table;
|
|
import util.TimeUtils;
|
|
|
|
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;
|
|
|
|
private int[] ifOpen;
|
|
|
|
private int shopId;
|
|
|
|
private int resetGrade;
|
|
|
|
|
|
@Override
|
|
public void init() throws Exception {
|
|
Map<Integer, SGlobalActivity> config = STableManager.getConfig(SGlobalActivity.class);
|
|
for(SGlobalActivity sGlobalActivity : config.values()){
|
|
int time = sGlobalActivity.getTime();
|
|
String startTime = sGlobalActivity.getStartTime();
|
|
String endtime = sGlobalActivity.getEndtime();
|
|
if(time == 1 ){//ActivityType.OPEN_TYPE_TIME
|
|
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));
|
|
}
|
|
sGlobalActivityMap = config;
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
|
|
|
|
public void setStartTimeLong(long startTimeLong) {
|
|
this.startTimeLong = startTimeLong;
|
|
}
|
|
|
|
public void setEndTimeLong(long endTimeLong) {
|
|
this.endTimeLong = endTimeLong;
|
|
}
|
|
|
|
public long getStartTimeLong() {
|
|
return startTimeLong;
|
|
}
|
|
|
|
public long getEndTimeLong() {
|
|
return endTimeLong;
|
|
}
|
|
|
|
public String getSesc() { return sesc; }
|
|
|
|
public int getIsSaving() {
|
|
return isSaving;
|
|
}
|
|
|
|
public int getIsMail() {
|
|
return isMail;
|
|
}
|
|
|
|
public int[] getIfOpen() {
|
|
return ifOpen;
|
|
}
|
|
|
|
public int getShopId() {
|
|
return shopId;
|
|
}
|
|
|
|
public int getResetGrade() {
|
|
return resetGrade;
|
|
}
|
|
|
|
} |