139 lines
3.5 KiB
Java
139 lines
3.5 KiB
Java
|
package config;
|
||
|
|
||
|
|
||
|
|
||
|
import manager.STableManager;
|
||
|
import manager.Table;
|
||
|
|
||
|
import java.util.HashMap;
|
||
|
import java.util.Iterator;
|
||
|
import java.util.Map;
|
||
|
|
||
|
@Table(name ="GlobalSystemConfig")
|
||
|
public class SGlobalSystemConfig implements BaseConfig {
|
||
|
|
||
|
private int id;
|
||
|
|
||
|
private int[] openRules;
|
||
|
|
||
|
private String systemOpen;
|
||
|
|
||
|
private String systemEnd;
|
||
|
|
||
|
private String seasonOpen;
|
||
|
|
||
|
private String seasonEnd;
|
||
|
|
||
|
private int seasonInterval;
|
||
|
|
||
|
|
||
|
private long systemOpenLong;
|
||
|
|
||
|
private long systemEndLong;
|
||
|
|
||
|
private long seasonOpenLong;
|
||
|
|
||
|
private long seasonEndLong;
|
||
|
|
||
|
private int isOpen;
|
||
|
|
||
|
|
||
|
private static Map<Integer,SGlobalSystemConfig> sGlobalSystemConfigMap;
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public void init() throws Exception {
|
||
|
//todo
|
||
|
/* Map<Integer,SGlobalSystemConfig> sGlobalSystemConfigMapTmp = new HashMap<>();
|
||
|
Map<Integer, SGlobalSystemConfig> config = STableManager.getConfig(SGlobalSystemConfig.class);
|
||
|
Iterator<Map.Entry<Integer, SGlobalSystemConfig>> iterator = config.entrySet().iterator();
|
||
|
while (iterator.hasNext()){
|
||
|
Map.Entry<Integer, SGlobalSystemConfig> next = iterator.next();
|
||
|
SGlobalSystemConfig sGlobalSystemConfig = next.getValue();
|
||
|
if(0 == sGlobalSystemConfig.getIsOpen()){
|
||
|
iterator.remove();
|
||
|
continue;
|
||
|
}
|
||
|
sGlobalSystemConfig.setSeasonOpenLong(TimeUtils.parseTimeToMiles(sGlobalSystemConfig.getSeasonOpen(), TimeUtils.Stand_CeHua_Data_format));
|
||
|
sGlobalSystemConfig.setSeasonEndLong(TimeUtils.parseTimeToMiles(sGlobalSystemConfig.getSeasonEnd(), TimeUtils.Stand_CeHua_Data_format));
|
||
|
sGlobalSystemConfig.setSystemOpenLong(TimeUtils.parseTimeToMiles(sGlobalSystemConfig.getSystemOpen(), TimeUtils.Stand_CeHua_Data_format));
|
||
|
sGlobalSystemConfig.setSystemEndLong(TimeUtils.parseTimeToMiles(sGlobalSystemConfig.getSystemEnd(), TimeUtils.Stand_CeHua_Data_format));
|
||
|
}
|
||
|
|
||
|
sGlobalSystemConfigMap = config;*/
|
||
|
}
|
||
|
|
||
|
/* public static SGlobalSystemConfig getsGlobalSystemConfigByFunctionId(FunctionIdEnum workShop) {
|
||
|
return sGlobalSystemConfigMap.get(workShop.getFunctionId());
|
||
|
}*/
|
||
|
|
||
|
public static Map<Integer, SGlobalSystemConfig> getsGlobalSystemConfigMap() {
|
||
|
return sGlobalSystemConfigMap;
|
||
|
}
|
||
|
|
||
|
public int getId() {
|
||
|
return id;
|
||
|
}
|
||
|
|
||
|
public int[] getOpenRules() {
|
||
|
return openRules;
|
||
|
}
|
||
|
|
||
|
private String getSystemOpen() {
|
||
|
return systemOpen;
|
||
|
}
|
||
|
|
||
|
private String getSystemEnd() {
|
||
|
return systemEnd;
|
||
|
}
|
||
|
|
||
|
private String getSeasonOpen() {
|
||
|
return seasonOpen;
|
||
|
}
|
||
|
|
||
|
private String getSeasonEnd() {
|
||
|
return seasonEnd;
|
||
|
}
|
||
|
|
||
|
public int getSeasonInterval() {
|
||
|
return seasonInterval;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
public long getSystemOpenLong() {
|
||
|
return systemOpenLong;
|
||
|
}
|
||
|
|
||
|
public void setSystemOpenLong(long systemOpenLong) {
|
||
|
this.systemOpenLong = systemOpenLong;
|
||
|
}
|
||
|
|
||
|
public long getSystemEndLong() {
|
||
|
return systemEndLong;
|
||
|
}
|
||
|
|
||
|
public void setSystemEndLong(long systemEndLong) {
|
||
|
this.systemEndLong = systemEndLong;
|
||
|
}
|
||
|
|
||
|
public long getSeasonOpenLong() {
|
||
|
return seasonOpenLong;
|
||
|
}
|
||
|
|
||
|
public void setSeasonOpenLong(long seasonOpenLong) {
|
||
|
this.seasonOpenLong = seasonOpenLong;
|
||
|
}
|
||
|
|
||
|
public long getSeasonEndLong() {
|
||
|
return seasonEndLong;
|
||
|
}
|
||
|
|
||
|
public void setSeasonEndLong(long seasonEndLong) {
|
||
|
this.seasonEndLong = seasonEndLong;
|
||
|
}
|
||
|
|
||
|
public int getIsOpen() {
|
||
|
return isOpen;
|
||
|
}
|
||
|
}
|