修复功能按类型开
parent
0304f78695
commit
d9b592cc81
|
@ -81,10 +81,6 @@ public class GlobalDataManaager implements IManager {
|
|||
return openTimeOfFuntionCache.containsKey(id);
|
||||
}
|
||||
|
||||
public TimeControllerOfFunction getTimeControllerOfFunctionByFunctinoId(int functionId){
|
||||
return openTimeOfFuntionCache.get(functionId);
|
||||
}
|
||||
|
||||
public TimeControllerOfFunction getTimeControllerOfFunctionByFunctinoType(FunctionIdEnum functionIdEnum){
|
||||
Map<Integer, SGlobalSystemConfig> sGlobalSystemConfigMap = STableManager.getConfig(SGlobalSystemConfig.class);
|
||||
for(Map.Entry<Integer,TimeControllerOfFunction> item : openTimeOfFuntionCache.entrySet()){
|
||||
|
@ -430,6 +426,14 @@ public class GlobalDataManaager implements IManager {
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="GlobalSystemConfig")
|
||||
public class SGlobalSystemConfig implements BaseConfig {
|
||||
|
||||
|
@ -35,9 +41,18 @@ public class SGlobalSystemConfig implements BaseConfig {
|
|||
private int[][] openGifts;
|
||||
|
||||
private int isIDdSame;
|
||||
|
||||
public static Map<Integer, List<Integer>> idsByType;
|
||||
@Override
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue