|
@@ -2,6 +2,7 @@ package com.persagy.proxy.adm.utils;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.ArrayUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.fasterxml.jackson.databind.node.ArrayNode;
|
|
@@ -45,17 +46,19 @@ public class AdmEntityTransferUtil {
|
|
|
continue;
|
|
|
}
|
|
|
ArrayNode nullList = (ArrayNode) nullNode;
|
|
|
+ ArrayNode removeNode = jsonNode.putArray("$remove");
|
|
|
for(int k=0; k < nullList.size(); k++){
|
|
|
String node = nullList.get(k).textValue();
|
|
|
+ if(StrUtil.isBlank(node)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
if(node.startsWith("infos.")){
|
|
|
node = node.replace("infos.","");
|
|
|
- jsonNode.remove(node);
|
|
|
- nullList.remove(i);
|
|
|
- nullList.add(node);
|
|
|
}
|
|
|
+ jsonNode.remove(node);
|
|
|
+ removeNode.add(node);
|
|
|
}
|
|
|
jsonNode.remove("nullList");
|
|
|
- jsonNode.putPOJO("$remove", nullList);
|
|
|
}
|
|
|
return arrayNode;
|
|
|
}
|