Bläddra i källkod

项目迭代,加入了订阅消息中对项目名称字段长度的限制,修复了导出表格接口是否授权那一行的显示问题

Astrid Wang 2 år sedan
förälder
incheckning
187c0e2a78

+ 33 - 24
.idea/workspace.xml

@@ -1,18 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="ChangeListManager">
-    <list default="true" id="ebc05332-7d4a-4b94-9ccd-3e5ff3d4f574" name="Default Changelist" comment="">
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/chuanghai/h3c_reporting/controller/InformationReportingController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/chuanghai/h3c_reporting/controller/InformationReportingController.java" afterDir="false" />
+    <list default="true" id="ebc05332-7d4a-4b94-9ccd-3e5ff3d4f574" name="Default Changelist" comment="项目迭代,加入了订阅消息中对项目名称字段长度的限制,修复了导出表格接口是否授权那一行的显示问题">
       <change beforePath="$PROJECT_DIR$/src/main/java/com/chuanghai/h3c_reporting/controller/WxController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/chuanghai/h3c_reporting/controller/WxController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/chuanghai/h3c_reporting/conver/StatusConverter.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/chuanghai/h3c_reporting/conver/StatusConverter.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/chuanghai/h3c_reporting/entity/InformationReporting.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/chuanghai/h3c_reporting/entity/InformationReporting.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/resources/application.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/application.yml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/resources/static/doc/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/static/doc/index.html" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/application.yml" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/application.yml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/chuanghai/h3c_reporting/common/http/HttpsClient.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/chuanghai/h3c_reporting/common/http/HttpsClient.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/chuanghai/h3c_reporting/controller/InformationReportingController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/chuanghai/h3c_reporting/controller/InformationReportingController.class" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/target/classes/com/chuanghai/h3c_reporting/controller/WxController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/chuanghai/h3c_reporting/controller/WxController.class" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/chuanghai/h3c_reporting/conver/StatusConverter.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/chuanghai/h3c_reporting/conver/StatusConverter.class" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/com/chuanghai/h3c_reporting/entity/InformationReporting.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/chuanghai/h3c_reporting/entity/InformationReporting.class" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/target/classes/static/doc/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/static/doc/index.html" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/target/h3c_reporting-0.0.1-SNAPSHOT.jar.original" beforeDir="false" afterPath="$PROJECT_DIR$/target/h3c_reporting-0.0.1-SNAPSHOT.jar.original" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/h3c_reporting-2.8.jar" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" beforeDir="false" afterPath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" beforeDir="false" afterPath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/target/surefire-reports/TEST-com.chuanghai.h3c_reporting.H3cReportingApplicationTests.xml" beforeDir="false" afterPath="$PROJECT_DIR$/target/surefire-reports/TEST-com.chuanghai.h3c_reporting.H3cReportingApplicationTests.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/target/surefire-reports/com.chuanghai.h3c_reporting.H3cReportingApplicationTests.txt" beforeDir="false" afterPath="$PROJECT_DIR$/target/surefire-reports/com.chuanghai.h3c_reporting.H3cReportingApplicationTests.txt" afterDir="false" />
     </list>
@@ -69,6 +70,7 @@
   </component>
   <component name="RecentsManager">
     <key name="CopyClassDialog.RECENTS_KEY">
+      <recent name="com.chuanghai.h3c_reporting.conver" />
       <recent name="com.chuanghai.h3c_reporting.bo" />
     </key>
     <key name="CopyFile.RECENT_KEYS">
@@ -131,7 +133,13 @@
       <workItem from="1697785629436" duration="10281000" />
       <workItem from="1698052897305" duration="1601000" />
       <workItem from="1698129951556" duration="15701000" />
-      <workItem from="1698215009572" duration="8593000" />
+      <workItem from="1698215009572" duration="9399000" />
+      <workItem from="1698227829509" duration="2608000" />
+      <workItem from="1699000696203" duration="3817000" />
+      <workItem from="1699024095380" duration="2470000" />
+      <workItem from="1699235457979" duration="850000" />
+      <workItem from="1699237019727" duration="3994000" />
+      <workItem from="1699340279145" duration="514000" />
     </task>
     <task id="LOCAL-00001" summary="项目迭代">
       <created>1698130112975</created>
@@ -155,7 +163,8 @@
   </component>
   <component name="VcsManagerConfiguration">
     <MESSAGE value="项目迭代" />
-    <option name="LAST_COMMIT_MESSAGE" value="项目迭代" />
+    <MESSAGE value="项目迭代,加入了订阅消息中对项目名称字段长度的限制,修复了导出表格接口是否授权那一行的显示问题" />
+    <option name="LAST_COMMIT_MESSAGE" value="项目迭代,加入了订阅消息中对项目名称字段长度的限制,修复了导出表格接口是否授权那一行的显示问题" />
   </component>
   <component name="WindowStateProjectService">
     <state x="499" y="171" key="#com.intellij.codeInsight.editorActions.RestoreReferencesDialog" timestamp="1697787744236">
@@ -166,30 +175,30 @@
       <screen x="0" y="0" width="1536" height="824" />
     </state>
     <state x="515" y="221" key="#com.intellij.fileTypes.FileTypeChooser/0.0.1536.824@0.0.1536.824" timestamp="1698052940942" />
-    <state x="354" y="9" key="CommitChangelistDialog2" timestamp="1698215782405">
+    <state x="354" y="9" key="CommitChangelistDialog2" timestamp="1699340807560">
       <screen x="0" y="0" width="1536" height="824" />
     </state>
-    <state x="354" y="9" key="CommitChangelistDialog2/0.0.1536.824@0.0.1536.824" timestamp="1698215782405" />
+    <state x="354" y="9" key="CommitChangelistDialog2/0.0.1536.824@0.0.1536.824" timestamp="1699340807560" />
     <state x="549" y="171" key="FileChooserDialogImpl" timestamp="1694504766669">
       <screen x="0" y="0" width="1536" height="824" />
     </state>
     <state x="549" y="171" key="FileChooserDialogImpl/0.0.1536.824@0.0.1536.824" timestamp="1694504766669" />
-    <state width="1493" height="23" key="GridCell.Tab.0.bottom" timestamp="1698221442036">
+    <state width="1493" height="404" key="GridCell.Tab.0.bottom" timestamp="1699236742986">
       <screen x="0" y="0" width="1536" height="824" />
     </state>
-    <state width="1493" height="23" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1698221442036" />
-    <state width="1493" height="23" key="GridCell.Tab.0.center" timestamp="1698221442036">
+    <state width="1493" height="404" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1699236742986" />
+    <state width="1493" height="404" key="GridCell.Tab.0.center" timestamp="1699236742986">
       <screen x="0" y="0" width="1536" height="824" />
     </state>
-    <state width="1493" height="23" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1698221442036" />
-    <state width="1493" height="23" key="GridCell.Tab.0.left" timestamp="1698221442036">
+    <state width="1493" height="404" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1699236742986" />
+    <state width="1493" height="404" key="GridCell.Tab.0.left" timestamp="1699236742986">
       <screen x="0" y="0" width="1536" height="824" />
     </state>
-    <state width="1493" height="23" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1698221442036" />
-    <state width="1493" height="23" key="GridCell.Tab.0.right" timestamp="1698221442036">
+    <state width="1493" height="404" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1699236742986" />
+    <state width="1493" height="404" key="GridCell.Tab.0.right" timestamp="1699236742986">
       <screen x="0" y="0" width="1536" height="824" />
     </state>
-    <state width="1493" height="23" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1698221442036" />
+    <state width="1493" height="404" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1699236742986" />
     <state width="1493" height="168" key="GridCell.Tab.1.bottom" timestamp="1697796769288">
       <screen x="0" y="0" width="1536" height="824" />
     </state>
@@ -222,10 +231,10 @@
       <screen x="0" y="0" width="1536" height="824" />
     </state>
     <state x="272" y="0" key="SettingsEditor/0.0.1536.824@0.0.1536.824" timestamp="1698131743337" />
-    <state x="461" y="241" key="com.intellij.ide.util.TipDialog" timestamp="1698215009122">
+    <state x="461" y="241" key="com.intellij.ide.util.TipDialog" timestamp="1699340279224">
       <screen x="0" y="0" width="1536" height="824" />
     </state>
-    <state x="461" y="241" key="com.intellij.ide.util.TipDialog/0.0.1536.824@0.0.1536.824" timestamp="1698215009122" />
+    <state x="461" y="241" key="com.intellij.ide.util.TipDialog/0.0.1536.824@0.0.1536.824" timestamp="1699340279224" />
     <state x="508" y="314" key="com.intellij.jarRepository.RepositoryAttachDialog-DOWNLOAD" timestamp="1695719124910">
       <screen x="0" y="0" width="1536" height="824" />
     </state>
@@ -234,10 +243,10 @@
       <screen x="0" y="0" width="1536" height="824" />
     </state>
     <state x="564" y="331" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/0.0.1536.824@0.0.1536.824" timestamp="1698217455008" />
-    <state x="327" y="155" width="1092" height="548" key="find.popup" timestamp="1698161515705">
+    <state x="327" y="155" width="1092" height="548" key="find.popup" timestamp="1699003855574">
       <screen x="0" y="0" width="1536" height="824" />
     </state>
-    <state x="327" y="155" width="1092" height="548" key="find.popup/0.0.1536.824@0.0.1536.824" timestamp="1698161515705" />
+    <state x="327" y="155" width="1092" height="548" key="find.popup/0.0.1536.824@0.0.1536.824" timestamp="1699003855574" />
     <state x="178" y="29" key="new project wizard" timestamp="1698166079568">
       <screen x="0" y="0" width="1536" height="824" />
     </state>
@@ -246,9 +255,9 @@
       <screen x="0" y="0" width="1536" height="824" />
     </state>
     <state x="425" y="187" width="672" height="677" key="run.anything.popup/0.0.1536.824@0.0.1536.824" timestamp="1694504735027" />
-    <state x="431" y="145" width="672" height="678" key="search.everywhere.popup" timestamp="1698215071304">
+    <state x="431" y="145" width="672" height="678" key="search.everywhere.popup" timestamp="1699002571279">
       <screen x="0" y="0" width="1536" height="824" />
     </state>
-    <state x="431" y="145" width="672" height="678" key="search.everywhere.popup/0.0.1536.824@0.0.1536.824" timestamp="1698215071304" />
+    <state x="431" y="145" width="672" height="678" key="search.everywhere.popup/0.0.1536.824@0.0.1536.824" timestamp="1699002571279" />
   </component>
 </project>

+ 47 - 0
src/main/java/com/chuanghai/h3c_reporting/conver/LicensingConverter.java

@@ -0,0 +1,47 @@
+package com.chuanghai.h3c_reporting.conver;
+
+import com.alibaba.excel.converters.Converter;
+import com.alibaba.excel.enums.CellDataTypeEnum;
+import com.alibaba.excel.metadata.CellData;
+import com.alibaba.excel.metadata.GlobalConfiguration;
+import com.alibaba.excel.metadata.property.ExcelContentProperty;
+
+
+public class LicensingConverter implements Converter<String> {
+
+    // 在java中的类型是什么
+    @Override
+    public Class supportJavaTypeKey() {
+        return String.class;
+    }
+
+    // 在excel中的类型是什么
+    @Override
+    public CellDataTypeEnum supportExcelTypeKey() {
+        return CellDataTypeEnum.STRING;
+    }
+
+    // 将excel的数据类型转为java数据类型
+    @Override
+    public String convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
+//        return cellData.getStringValue().equals("是") ? 0 : 1;
+        String stringValue = cellData.getStringValue();
+        if("是".equals(stringValue)){
+            return "0";
+        }else {
+            return "1";
+        }
+    }
+
+    // 将java的数据类型转为excel数据类型
+    @Override
+    public CellData convertToExcelData(String value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
+//        return new CellData(value == 0 ? "是" : "否");
+        if(value.equals("0")){
+            return new CellData("是");
+        }else {
+            return new CellData("否");
+        }
+
+    }
+}

BIN
target/classes/com/chuanghai/h3c_reporting/conver/LicensingConverter.class


BIN
target/h3c_reporting-3.1.jar