xiexiang 1 year ago
parent
commit
13f53bc0a5

+ 32 - 0
src/main/java/cn/cslg/pas/factorys/PatentExportFactory/GetTextContentValue.java

@@ -0,0 +1,32 @@
+package cn.cslg.pas.factorys.PatentExportFactory;
+
+import cn.cslg.pas.common.model.cronModel.SystemFile;
+import cn.cslg.pas.domain.es.Text;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/2/20
+ */
+@Component
+public class GetTextContentValue implements GetValueImp{
+    @Override
+    public String getValue(Object value) {
+        try {
+            String text = JSONObject.toJSONString(value);
+            List<Text> texts = JSONObject.parseArray(text, Text.class);
+            if (!texts.isEmpty()) {
+                return texts.get(0).getTextContent();
+            } else {
+                return "";
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            return "";
+        }
+    }
+}

+ 4 - 2
src/main/resources/jsons/patent.json

@@ -151,7 +151,8 @@
     "defaultHidden": "true",
     "ifStats": "false",
     "groupBy": "text",
-    "ifSort": "true"
+    "ifSort": "true",
+    "exportClass": "getTextContentValue"
   },
   {
     "name": "标题",
@@ -166,7 +167,8 @@
     "ifAsCondition": "true",
     "ifStats": "false",
     "groupBy": "text",
-    "ifSort": "false"
+    "ifSort": "false",
+    "exportClass": "getTextContentValue"
   },
   {
     "name": "申请人",