소스 검색

excel/csv抓取test

wangggziwen 3 년 전
부모
커밋
4ff3500918

+ 3 - 0
src/main/java/io/renren/RenrenApplication.java

@@ -22,6 +22,7 @@ public class RenrenApplication {
     public static void main(String[] args) {
         SpringApplication.run(RenrenApplication.class, args);
         System.out.println("==========数据抓取测试==========");
+        System.out.println("----------csv----------");
         DashboardDataPullUtils dashboardDataPullUtils = new DashboardDataPullUtils();
         System.out.println("-> Sheet 1");
         dashboardDataPullUtils.getCsvData1();
@@ -29,6 +30,8 @@ public class RenrenApplication {
         dashboardDataPullUtils.getCsvData2();
         System.out.println("-> Sheet 3");
         dashboardDataPullUtils.getCsvData3();
+        System.out.println("----------excel----------");
+        dashboardDataPullUtils.getExcelData(new TElecdashboardRealtimeEntity());
     }
 
 }

+ 9 - 0
src/main/java/io/renren/modules/aspen/entity/base/TElecdashboard.java

@@ -23,6 +23,7 @@ public abstract class TElecdashboard {
     private String stgPowerGenLevel;    // STG 发电水平
     private String stgEfficiency;       // STG 效率(百分比)
     private String totalPowerGen;       // 总发电量
+    private String totalEfficiency;     // 总发电效率
 
     private String steamHhp; // 蒸汽 HHP
     private String steamHp;  // 蒸汽 HP
@@ -534,6 +535,14 @@ public abstract class TElecdashboard {
         this.totalPowerGen = totalPowerGen;
     }
 
+    public String getTotalEfficiency() {
+        return totalEfficiency;
+    }
+
+    public void setTotalEfficiency(String totalEfficiency) {
+        this.totalEfficiency = totalEfficiency;
+    }
+
     public String getSteamHhp() {
         return steamHhp;
     }

+ 2 - 0
src/main/java/io/renren/modules/aspen/utils/DashboardDataPullUtils.java

@@ -147,6 +147,7 @@ public class DashboardDataPullUtils {
             String stgPowerGenLevel = this.getCellData(true, sheet1, 2, 5);   // STG发电水平
             String stgEfficiency = this.getCellData(true, sheet1, 3, 5);      // STG效率(百分比)
             String totalPowerGen = this.getCellData(true, sheet1, 2, 6);      // 总发电量
+            String totalEfficiency = this.getCellData(true, sheet1, 3, 6);      // 总发电效率
             TElecDashboard.setGtg1PowerGenLevel(gtg1PowerGenLevel);
             TElecDashboard.setGtg1Efficiency(gtg1Efficiency);
             TElecDashboard.setGtg2PowerGenLevel(gtg2PowerGenLevel);
@@ -156,6 +157,7 @@ public class DashboardDataPullUtils {
             TElecDashboard.setStgPowerGenLevel(stgPowerGenLevel);
             TElecDashboard.setStgEfficiency(stgEfficiency);
             TElecDashboard.setTotalPowerGen(totalPowerGen);
+            TElecDashboard.setTotalEfficiency(totalEfficiency);
             // 蒸汽
             String steamHhp = this.getCellData(true, sheet1, 6, 2);    // 蒸汽HHP
             String steamHp = this.getCellData(true, sheet1, 6, 3);     // 蒸汽HP

+ 2 - 0
src/main/resources/mapper/aspen/TElecdashboardRealtimeDao.xml

@@ -20,6 +20,7 @@
             <if test="stgPowerGenLevel != null">stg_power_gen_level,</if>
             <if test="stgEfficiency != null">stg_efficiency,</if>
             <if test="totalPowerGen != null">total_power_gen,</if>
+            <if test="totalEfficiency != null">total_efficiency,</if>
             <if test="steamHhp != null">steam_hhp,</if>
             <if test="steamHp != null">steam_hp,</if>
             <if test="steamMp != null">steam_mp,</if>
@@ -242,6 +243,7 @@
             <if test="stgPowerGenLevel != null">#{stgPowerGenLevel},</if>
             <if test="stgEfficiency != null">#{stgEfficiency},</if>
             <if test="totalPowerGen != null">#{totalPowerGen},</if>
+            <if test="totalEfficiency != null">#{totalEfficiency},</if>
             <if test="steamHhp != null">#{steamHhp},</if>
             <if test="steamHp != null">#{steamHp},</if>
             <if test="steamMp != null">#{steamMp},</if>