|
@@ -1,15 +1,12 @@
|
|
package com.lantone.qc.trans.comsis;
|
|
package com.lantone.qc.trans.comsis;
|
|
|
|
|
|
import com.google.common.collect.Maps;
|
|
import com.google.common.collect.Maps;
|
|
|
|
+import com.lantone.qc.dbanaly.util.ModuleMappingUtil;
|
|
import com.lantone.qc.pub.util.DateUtil;
|
|
import com.lantone.qc.pub.util.DateUtil;
|
|
import com.lantone.qc.pub.util.MapUtil;
|
|
import com.lantone.qc.pub.util.MapUtil;
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.HashSet;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
-import java.util.Set;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Description:
|
|
* @Description:
|
|
@@ -20,7 +17,31 @@ public class OrdinaryAssistant {
|
|
|
|
|
|
public static Map<String, String> mapKeyContrast(Map<String, String> sourceMap, List<String> keyContrasts) {
|
|
public static Map<String, String> mapKeyContrast(Map<String, String> sourceMap, List<String> keyContrasts) {
|
|
Map<String, String> retMap = Maps.newHashMap();
|
|
Map<String, String> retMap = Maps.newHashMap();
|
|
- Map<String, String> sourceMap_ = MapUtil.copyMap((Map) sourceMap);
|
|
|
|
|
|
+ String modeId = ModuleMappingUtil.getXmlDataTypeModuleId(sourceMap);
|
|
|
|
+ if (StringUtil.isNotBlank(modeId)) {
|
|
|
|
+ retMap.put("mode_id", modeId);
|
|
|
|
+ sourceMap.put("mode_id", modeId);
|
|
|
|
+ }
|
|
|
|
+ mapKeyContrastCommon(sourceMap, keyContrasts, retMap);
|
|
|
|
+ return retMap;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static Map<String, String> mapKeyContrast(Map<String, String> sourceMap, List<String> keyContrasts, String defaultModeId) {
|
|
|
|
+ Map<String, String> retMap = Maps.newHashMap();
|
|
|
|
+ String modeId = ModuleMappingUtil.getXmlDataTypeModuleId(sourceMap);
|
|
|
|
+ if (StringUtil.isBlank(modeId)) {
|
|
|
|
+ modeId = ModuleMappingUtil.getStandardModuleId(defaultModeId);
|
|
|
|
+ }
|
|
|
|
+ if (StringUtil.isNotBlank(modeId)) {
|
|
|
|
+ retMap.put("mode_id", modeId);
|
|
|
|
+ sourceMap.put("mode_id", modeId);
|
|
|
|
+ }
|
|
|
|
+ mapKeyContrastCommon(sourceMap, keyContrasts, retMap);
|
|
|
|
+ return retMap;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static void mapKeyContrastCommon(Map sourceMap, List<String> keyContrasts, Map<String, String> retMap) {
|
|
|
|
+ Map<String, String> sourceMap_ = MapUtil.copyMap(sourceMap);
|
|
String[] arry = null;
|
|
String[] arry = null;
|
|
String sourceKey = null, targetKey;
|
|
String sourceKey = null, targetKey;
|
|
Set<String> removeKey = new HashSet<>();
|
|
Set<String> removeKey = new HashSet<>();
|
|
@@ -46,7 +67,6 @@ public class OrdinaryAssistant {
|
|
retMap.put(key, sourceMap_.get(key));
|
|
retMap.put(key, sourceMap_.get(key));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return retMap;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|