|
@@ -2,16 +2,16 @@ package com.lantone.qc.kernel.util;
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Maps;
|
|
import com.google.common.collect.Maps;
|
|
|
|
+import com.google.common.collect.Sets;
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
import lombok.Getter;
|
|
import lombok.Getter;
|
|
import lombok.Setter;
|
|
import lombok.Setter;
|
|
import org.apache.commons.collections.MapUtils;
|
|
import org.apache.commons.collections.MapUtils;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
-import java.util.Set;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Description: 页面模板映射工具类
|
|
* @Description: 页面模板映射工具类
|
|
@@ -25,7 +25,7 @@ public class ModuleMappingUtil {
|
|
@Value("${qc.hospital_id}")
|
|
@Value("${qc.hospital_id}")
|
|
private String hospitalId;
|
|
private String hospitalId;
|
|
private List<String> xmlDataTypeHospitalIds = Lists.newArrayList("1", "3");
|
|
private List<String> xmlDataTypeHospitalIds = Lists.newArrayList("1", "3");
|
|
- private Map<Set<String>, String> xmlDataTypeModuleInfo = Maps.newHashMap();
|
|
|
|
|
|
+ private Map<Set<String>, String> xmlDataTypeModuleInfo = Maps.newLinkedHashMap();
|
|
|
|
|
|
public void moduleIdInsert(Map<String, Object> pageData) {
|
|
public void moduleIdInsert(Map<String, Object> pageData) {
|
|
if (xmlDataTypeHospitalIds.contains(hospitalId)) {
|
|
if (xmlDataTypeHospitalIds.contains(hospitalId)) {
|
|
@@ -46,10 +46,28 @@ public class ModuleMappingUtil {
|
|
sourceMaps.add((Map) object);
|
|
sourceMaps.add((Map) object);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+
|
|
sourceMaps.forEach(sourceMap -> {
|
|
sourceMaps.forEach(sourceMap -> {
|
|
if (MapUtils.isNotEmpty(sourceMap)) {
|
|
if (MapUtils.isNotEmpty(sourceMap)) {
|
|
- String modeId = xmlDataTypeModuleInfo.get(sourceMap.keySet());
|
|
|
|
|
|
+ Set<String> set = sourceMap.keySet();
|
|
|
|
+ List list = new ArrayList(set);
|
|
|
|
+ list.sort(new Comparator<String>() {
|
|
|
|
+ @Override
|
|
|
|
+ public int compare(String arg0, String arg1) {
|
|
|
|
+ return arg0.compareTo(arg1);//这是顺序
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ set = Sets.newLinkedHashSet(list);
|
|
|
|
+// if (set.size() == 335) {
|
|
|
|
+// System.out.println(" ");
|
|
|
|
+// for (Map.Entry<Set<String>, String> entry : xmlDataTypeModuleInfo.entrySet()) {
|
|
|
|
+// System.out.println(StringUtils.join(entry.getKey(), ","));
|
|
|
|
+// }
|
|
|
|
+// System.out.println(StringUtils.join(set, ","));
|
|
|
|
+// }
|
|
|
|
+ String modeId = xmlDataTypeModuleInfo.get(set);
|
|
if (StringUtil.isNotBlank(modeId)) {
|
|
if (StringUtil.isNotBlank(modeId)) {
|
|
|
|
+// System.out.println("modeId : " + modeId);
|
|
sourceMap.put("mode_id", modeId);
|
|
sourceMap.put("mode_id", modeId);
|
|
}
|
|
}
|
|
}
|
|
}
|