xiexiang hace 1 año
padre
commit
6f58786fe1

+ 41 - 0
src/main/java/cn/cslg/pas/factorys/PatentExportFactory/GetPatentTypeValue.java

@@ -0,0 +1,41 @@
+package cn.cslg.pas.factorys.PatentExportFactory;
+
+import org.springframework.stereotype.Component;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/6
+ */
+@Component
+public class GetPatentTypeValue implements GetValueImp {
+    @Override
+    public String getValue(Object value) {
+        String patentTypeStr = "";
+        if (value != null) {
+            try {
+                int patentType = Integer.parseInt(value.toString());
+
+                switch (patentType) {
+                    case 1:
+                    case 8:
+                        patentTypeStr = "发明";
+                        break;
+                    case 2:
+                    case 9:
+                        patentTypeStr = "实用新型";
+                        break;
+                    case 3:
+                        patentTypeStr = "外观";
+                        break;
+                    default:
+                        patentTypeStr = "";
+                        break;
+                }
+            } catch (NumberFormatException e) {
+                // 处理无法解析为整数的情况
+                patentTypeStr = "";
+            }
+        }
+        return patentTypeStr;
+    }
+}

+ 39 - 0
src/main/java/cn/cslg/pas/factorys/PatentExportFactory/GetSimpleStatusValue.java

@@ -0,0 +1,39 @@
+package cn.cslg.pas.factorys.PatentExportFactory;
+
+import org.springframework.stereotype.Component;
+
+/**
+ * @Author xiexiang
+ * @Date 2024/6/6
+ */
+@Component
+public class GetSimpleStatusValue implements GetValueImp {
+    @Override
+    public String getValue(Object value) {
+        String statusStr = "";
+        if (value != null) {
+            try {
+                int simpleStatus = Integer.parseInt(value.toString());
+
+                switch (simpleStatus) {
+                    case 1:
+                        statusStr = "有效";
+                        break;
+                    case 2:
+                        statusStr = "无效";
+                        break;
+                    case 3:
+                        statusStr = "审中";
+                        break;
+                    default:
+                        statusStr = "";
+                        break;
+                }
+            } catch (NumberFormatException e) {
+                // 处理无法解析为整数的情况
+                statusStr = "";
+            }
+        }
+        return statusStr;
+    }
+}

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

@@ -1039,7 +1039,7 @@
     "fieldOptionQueryParam": "PATENT_SIMPLE_STATUS",
     "groupBy": "typeStatus",
     "ifSort": "true",
-    "exportClass": "getCommonValue",
+    "exportClass": "getSimpleStatusValue",
     "optionValue": [
       {
         "label": "有效",
@@ -1070,7 +1070,7 @@
     "fieldOptionQueryParam": "PATENT_TYPE",
     "groupBy": "typeStatus",
     "ifSort": "true",
-    "exportClass": "getCommonValue",
+    "exportClass": "getPatentTypeValue",
     "optionValue": [
       {
         "label": "发明",