|
@@ -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 "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|