Browse Source

义务数据更新

rengb 4 years atrás
parent
commit
4b231bf71c

+ 6 - 2
dbanaly/src/main/java/com/lantone/qc/dbanaly/facade/comsis/ModuleHelper.java

@@ -118,22 +118,26 @@ public class ModuleHelper {
     }
 
     private void loadHtmlModuleInfoByHospitalId(String hospitalId) {
+        Map<String, String> result = Maps.newHashMap();
         List<String> list = moduleInfoService.getBaseMapper().getAnameModidMap(Long.parseLong(hospitalId));
         list.forEach(i -> {
             String[] arry = i.split("=");
-            ModuleMappingUtil.htmlDataTypeModuleInfo.put(arry[0], arry[1]);
+            result.put(arry[0], arry[1]);
         });
+        ModuleMappingUtil.htmlDataTypeModuleInfo.put(hospitalId, result);
     }
 
     private void loadStandardModule(String hospitalId) {
+        Map<String, String> result = Maps.newHashMap();
         QueryWrapper<ModuleInfo> moduleInfoQe = new QueryWrapper<>();
         moduleInfoQe.eq("is_deleted", "N");
         moduleInfoQe.eq("default_module", 1);
         moduleInfoQe.eq("hospital_id", Long.parseLong(hospitalId));
         Map<Long, List<ModuleInfo>> modeIdMsMap = moduleInfoService.list(moduleInfoQe).stream().collect(Collectors.groupingBy(i -> i.getModeId()));
         modeIdMsMap.keySet().forEach(key -> {
-            ModuleMappingUtil.standardModuleInfo.put(key + "", modeIdMsMap.get(key).get(0).getId() + "");
+            result.put(key + "", modeIdMsMap.get(key).get(0).getId() + "");
         });
+        ModuleMappingUtil.standardModuleInfo.put(hospitalId, result);
     }
 
 }

+ 11 - 5
dbanaly/src/main/java/com/lantone/qc/dbanaly/util/ModuleMappingUtil.java

@@ -19,11 +19,11 @@ import java.util.Set;
 public class ModuleMappingUtil {
 
     public static final Map<String, Map<Set<String>, String>> xmlDataTypeModuleInfo = Maps.newHashMap();
-    public static final Map<String, String> htmlDataTypeModuleInfo = Maps.newHashMap();
-    public static final Map<String, String> standardModuleInfo = Maps.newHashMap();
+    public static final Map<String, Map<String, String>> htmlDataTypeModuleInfo = Maps.newHashMap();
+    public static final Map<String, Map<String, String>> standardModuleInfo = Maps.newHashMap();
+    private static final SpecialStorageUtil specialStorageUtil = SpringContextUtil.getBean("specialStorageUtil");
 
     public static String getXmlDataTypeModuleId(Map<String, String> sourceMap) {
-        SpecialStorageUtil specialStorageUtil = SpringContextUtil.getBean("specialStorageUtil");
         if (MapUtils.isEmpty(sourceMap)
                 || MapUtils.isEmpty(xmlDataTypeModuleInfo.get(specialStorageUtil.getHospitalIdThreadLocal().get()))) {
             return null;
@@ -41,11 +41,17 @@ public class ModuleMappingUtil {
     }
 
     public static String getHtmlDataTypeModuleId(String recTitle) {
-        return htmlDataTypeModuleInfo.get(recTitle);
+        if (MapUtils.isEmpty(htmlDataTypeModuleInfo.get(specialStorageUtil.getHospitalIdThreadLocal().get()))) {
+            return null;
+        }
+        return htmlDataTypeModuleInfo.get(specialStorageUtil.getHospitalIdThreadLocal().get()).get(recTitle);
     }
 
     public static String getStandardModuleId(String modeId) {
-        return standardModuleInfo.get(modeId);
+        if (MapUtils.isEmpty(standardModuleInfo.get(specialStorageUtil.getHospitalIdThreadLocal().get()))) {
+            return null;
+        }
+        return standardModuleInfo.get(specialStorageUtil.getHospitalIdThreadLocal().get()).get(modeId);
     }
 
 }