|
@@ -13,6 +13,17 @@ object ChangeExtractUtils {
|
|
s"""{"type":${getValueOrNull(type_val)},"name":${getValueOrNull(name)},"date":${getValueOrNull(date)},"no":${getValueOrNull(no)}}""".trim
|
|
s"""{"type":${getValueOrNull(type_val)},"name":${getValueOrNull(name)},"date":${getValueOrNull(date)},"no":${getValueOrNull(no)}}""".trim
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //获取指定字段集的标签Json
|
|
|
|
+ def getTags(fldMap: Map[String, String], type_val: String, fields: Array[String]): String = {
|
|
|
|
+ var json:StringBuilder = new StringBuilder(s"""{"type":${getValueOrNull(type_val)},""")
|
|
|
|
+ fields.map {item=>
|
|
|
|
+ json.append(s"${getValueOrNull(item)}")
|
|
|
|
+ json.append(s":${getValueOrNull(fldMap(item))},")
|
|
|
|
+ }
|
|
|
|
+ json.deleteCharAt(json.lastIndexOf(",")).append("}").toString.trim
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
private def getValueOrNull(value:String):String={
|
|
private def getValueOrNull(value:String):String={
|
|
if(StringUtils.isNotBlank(value)){
|
|
if(StringUtils.isNotBlank(value)){
|
|
"\""+value+"\""
|
|
"\""+value+"\""
|