back_recharge
zhangshanxue 2020-02-21 17:55:45 +08:00
commit a7ed154936
2 changed files with 25 additions and 6 deletions

View File

@ -81,10 +81,6 @@ public class GlobalDataManaager implements IManager {
return openTimeOfFuntionCache.containsKey(id); return openTimeOfFuntionCache.containsKey(id);
} }
public TimeControllerOfFunction getTimeControllerOfFunctionByFunctinoId(int functionId){
return openTimeOfFuntionCache.get(functionId);
}
public TimeControllerOfFunction getTimeControllerOfFunctionByFunctinoType(FunctionIdEnum functionIdEnum){ public TimeControllerOfFunction getTimeControllerOfFunctionByFunctinoType(FunctionIdEnum functionIdEnum){
Map<Integer, SGlobalSystemConfig> sGlobalSystemConfigMap = STableManager.getConfig(SGlobalSystemConfig.class); Map<Integer, SGlobalSystemConfig> sGlobalSystemConfigMap = STableManager.getConfig(SGlobalSystemConfig.class);
for(Map.Entry<Integer,TimeControllerOfFunction> item : openTimeOfFuntionCache.entrySet()){ for(Map.Entry<Integer,TimeControllerOfFunction> item : openTimeOfFuntionCache.entrySet()){
@ -430,6 +426,14 @@ public class GlobalDataManaager implements IManager {
} }
public TimeControllerOfFunction getOpenTimeOfFuntionCacheByType(FunctionIdEnum functionIdEnum ) { public TimeControllerOfFunction getOpenTimeOfFuntionCacheByType(FunctionIdEnum functionIdEnum ) {
return openTimeOfFuntionCache.get(functionIdEnum.getFunctionType()); List<Integer> ids = SGlobalSystemConfig.idsByType.get(functionIdEnum);
if(ids!=null && !ids.isEmpty()){
for(Integer id : ids){
if(openTimeOfFuntionCache.containsKey(id)){
return openTimeOfFuntionCache.get(id);
}
}
}
return null;
} }
} }

View File

@ -1,7 +1,13 @@
package config; package config;
import manager.STableManager;
import manager.Table; import manager.Table;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Table(name ="GlobalSystemConfig") @Table(name ="GlobalSystemConfig")
public class SGlobalSystemConfig implements BaseConfig { public class SGlobalSystemConfig implements BaseConfig {
@ -35,9 +41,18 @@ public class SGlobalSystemConfig implements BaseConfig {
private int[][] openGifts; private int[][] openGifts;
private int isIDdSame; private int isIDdSame;
public static Map<Integer, List<Integer>> idsByType;
@Override @Override
public void init() throws Exception { public void init() throws Exception {
Map<Integer, List<Integer>> idsByTypeTmp = new HashMap<>();
STableManager.getConfig(SGlobalSystemConfig.class).forEach((id,item)->{
if(!idsByTypeTmp.containsKey(item.getType())){
idsByTypeTmp.put(item.getType(),new ArrayList<>());
}
idsByTypeTmp.get(item.getType()).add(item.getId());
});
idsByType = idsByTypeTmp;
} }