فهرست منبع

Merge remote-tracking branch 'origin/master'

wangtao 3 سال پیش
والد
کامیت
4988037f76
54فایلهای تغییر یافته به همراه879 افزوده شده و 1332 حذف شده
  1. 0 18
      ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/constant/CommonConstants.java
  2. 0 14
      ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/constant/SecurityConstants.java
  3. 4 26
      ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/CommonUtil.java
  4. 0 2
      ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/JwtUtil.java
  5. 0 1
      ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/WebUtil.java
  6. 1 1
      ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/EquipmentTypeEnum.java
  7. 77 0
      ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/SysAlarm.java
  8. 1 0
      ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/repository/InverterInfoRepository.java
  9. 13 0
      ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/repository/SysAlarmRepository.java
  10. 11 9
      ipfcst-common/ipfcst-common-data/src/main/java/org/hibernate/cfg/InheritanceState.java
  11. 11 7
      ipfcst-common/ipfcst-common-security/src/main/java/com/jiayue/ipfcst/common/security/util/JwtTokenUtil.java
  12. 0 7
      ipfcst-console/src/main/frontend/router/modules/console.js
  13. 0 391
      ipfcst-console/src/main/frontend/views/console/holidayCalendar/index.vue
  14. 4 1
      ipfcst-console/src/main/frontend/views/console/inverterInfo/index.vue
  15. 4 1
      ipfcst-console/src/main/frontend/views/console/weatherStationInfo/index.vue
  16. 5 2
      ipfcst-console/src/main/frontend/views/console/windTowerInfo/index.vue
  17. 4 1
      ipfcst-console/src/main/frontend/views/console/windTurbineInfo/index.vue
  18. 4 4
      ipfcst-console/src/main/java/com/jiayue/ipfcst/ConsoleApplication.java
  19. 5 14
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/ElectricFieldController.java
  20. 3 2
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/InitJobClassController.java
  21. 147 0
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/SysAlarmController.java
  22. 0 26
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/WindTowerStatusDataController.java
  23. 1 1
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/job/ReceiveDataJob.java
  24. 56 131
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/FileAnalysisService.java
  25. 6 4
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/ForecastPowerShortTermHisService.java
  26. 13 9
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/ForecastPowerShortTermService.java
  27. 8 8
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/ForecastPowerUltraShortTermService.java
  28. 0 91
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/HolidayCalendarService.java
  29. 1 4
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/InverterInfoService.java
  30. 14 45
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/NwpService.java
  31. 0 2
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/OverHaulPlanService.java
  32. 7 8
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/PowerStationDataPacker.java
  33. 1 16
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/PowerStationStatusDataService.java
  34. 0 4
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/PvModuleModelService.java
  35. 27 27
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/QuartzService.java
  36. 33 4
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/ReceiveDataService.java
  37. 116 0
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/SysAlarmService.java
  38. 1 4
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/WeatherStationInfoService.java
  39. 1 4
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/WindTowerInfoService.java
  40. 2 2
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/WindTowerStatusDataService.java
  41. 3 16
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/WindTurbineInfoService.java
  42. 4 4
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/WindTurbineStatusDataService.java
  43. 8 18
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/util/CreateConsoleSh.java
  44. 5 14
      ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/IEC102/Base102Service.java
  45. 6 2
      ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/IEC102/ServerFor102StandardService.java
  46. 5 3
      ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/controller/UploadFileLogController.java
  47. 2 10
      ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/service/BaseUploadFileService.java
  48. 160 140
      ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/service/E63UploadFileService.java
  49. 23 43
      ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/service/FtpUploadTransactionService.java
  50. 7 2
      ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/service/UploadFileChannelService.java
  51. 70 57
      ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/service/UploadFileLogService.java
  52. 0 3
      ipfcst-console/src/main/java/com/jiayue/ipfcst/ftpsftp/service/ContinueFTPService.java
  53. 5 1
      ipfcst-console/src/main/resources/application.yml
  54. 0 128
      ipfcst-console/src/main/resources/sql/t_init_job_class.sql

+ 0 - 18
ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/constant/CommonConstants.java

@@ -1,18 +0,0 @@
-package com.jiayue.ipfcst.common.core.constant;
-
-/**
- * CommonConstants
- *
- * @author L.ym
- * @version 3.0
- **/
-public interface CommonConstants {
-    /**
-     * 成功标记
-     */
-    Integer SUCCESS = 0;
-    /**
-     * 失败标记
-     */
-    Integer FAIL = 1;
-}

+ 0 - 14
ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/constant/SecurityConstants.java

@@ -1,14 +0,0 @@
-package com.jiayue.ipfcst.common.core.constant;
-
-/**
- * SecurityConstants
- *
- * @author L.ym
- * @version 3.0
- **/
-public interface SecurityConstants {
-    /**
-     * 刷新
-     */
-    String REFRESH_TOKEN = "refresh_token";
-}

+ 4 - 26
ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/CommonUtil.java

@@ -21,7 +21,6 @@ import java.util.zip.ZipOutputStream;
 public abstract class CommonUtil {
 
     private static final int BUFFER_SIZE = 2 * 1024;
-    public static Properties props = System.getProperties();
 
     /**
      * 获取随机数
@@ -90,28 +89,15 @@ public abstract class CommonUtil {
      * @throws RuntimeException 压缩失败会抛出运行时异常
      */
     public static void toZip(String srcDir, OutputStream out, boolean KeepDirStructure)
-            throws RuntimeException {
+            throws Exception {
 
         long start = System.currentTimeMillis();
-        ZipOutputStream zos = null;
-        try {
-            zos = new ZipOutputStream(out);
+        try(ZipOutputStream zos = new ZipOutputStream(out);){
             File sourceFile = new File(srcDir);
             compress(sourceFile, zos, sourceFile.getName(), KeepDirStructure);
             long end = System.currentTimeMillis();
-            System.out.println("压缩完成,耗时:" + (end - start) + " ms");
-        } catch (Exception e) {
-            throw new RuntimeException("zip error from ZipUtils", e);
-        } finally {
-            if (zos != null) {
-                try {
-                    zos.close();
-                } catch (IOException e) {
-                    log.error("系统错误", e);
-                }
-            }
+            log.info("压缩完成,耗时:" + (end - start) + " ms");
         }
-
     }
 
     /**
@@ -132,19 +118,11 @@ public abstract class CommonUtil {
             zos.putNextEntry(new ZipEntry(name));
             // copy文件到zip输出流中
             int len;
-            FileInputStream in = null;
-            try {
-                in = new FileInputStream(sourceFile);
+            try(FileInputStream in = new FileInputStream(sourceFile);){
                 while ((len = in.read(buf)) != -1) {
                     zos.write(buf, 0, len);
                 }
                 zos.closeEntry();
-            } catch (Exception e) {
-                e.printStackTrace();
-            } finally {
-                if (in != null) {
-                    in.close();
-                }
             }
         } else {
             File[] listFiles = sourceFile.listFiles();

+ 0 - 2
ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/JwtUtil.java

@@ -28,8 +28,6 @@ public class JwtUtil {
     private final String SECRET = "!@#xwexe3@!#ds123";
     private final String ISSUER = "jiayue";
 
-    private final String ROLE_CLAIMS = "role";
-
     /**
      * @Description: 单位秒,即过期时间是24个小时
      */

+ 0 - 1
ipfcst-common/ipfcst-common-core/src/main/java/com/jiayue/ipfcst/common/core/util/WebUtil.java

@@ -26,7 +26,6 @@ import java.io.PrintWriter;
 @Slf4j
 @UtilityClass
 public class WebUtil extends org.springframework.web.util.WebUtils {
-    private final String BASIC_ = "Basic ";
     private final String UNKNOWN = "unknown";
 
     /**

+ 1 - 1
ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/constant/enums/EquipmentTypeEnum.java

@@ -62,7 +62,7 @@ public enum EquipmentTypeEnum {
 			case 14 :return DZ;
 			case 15 :return JDDZ;
 			case 16 :return DXFDJ;
+			default :return null;
 		}
-		return null;
 	}
 }

+ 77 - 0
ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/entity/SysAlarm.java

@@ -0,0 +1,77 @@
+package com.jiayue.ipfcst.common.data.entity;
+
+import com.jiayue.ipfcst.common.data.abst.AbstractBaseEntity;
+import com.jiayue.ipfcst.common.data.constant.enums.AlarmStatusEnum;
+import com.jiayue.ipfcst.common.data.constant.enums.AlarmTypeEnum;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.hibernate.annotations.GenericGenerator;
+import org.springframework.core.annotation.Order;
+
+import javax.persistence.*;
+
+/**
+ * 系统告警实体
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/7/22 10:23
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+@Entity
+public class SysAlarm extends AbstractBaseEntity {
+
+    @Id
+    @Order(1)
+    @GeneratedValue(strategy = GenerationType.AUTO, generator = "myid")
+    @GenericGenerator(name = "myid", strategy = "com.jiayue.ipfcst.common.data.entity.id.CustomIDGenerator")
+    private Integer id;
+
+    /**
+     * 错误信息
+     */
+    @Column
+    @Lob
+    private String errorInfo;
+
+    /**
+     * 问题类型
+     */
+    @Column
+    @Enumerated(EnumType.STRING)
+    private AlarmTypeEnum alarmTypeEnum;
+
+    /**
+     * 问题名称
+     */
+    @Column
+    private String name;
+
+    /**
+     * 问题描述
+     */
+    @Column
+    @Lob
+    private String describe;
+
+    /**
+     * 问题状态
+     */
+    @Column
+    @Enumerated(EnumType.STRING)
+    private AlarmStatusEnum alarmStatusEnum;
+
+    /**
+     * 处理办法
+     */
+    @Column
+    private String solution;
+
+    /**
+     * 问题优先级
+     */
+    @Column
+    private String pritority;
+
+}

+ 1 - 0
ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/repository/InverterInfoRepository.java

@@ -21,4 +21,5 @@ public interface InverterInfoRepository extends BaseRepository<InverterInfo, Int
 
     InverterInfo findByName(String name);
 
+    List<InverterInfo> findAllByStationCode(String stationCode);
 }

+ 13 - 0
ipfcst-common/ipfcst-common-data/src/main/java/com/jiayue/ipfcst/common/data/repository/SysAlarmRepository.java

@@ -0,0 +1,13 @@
+package com.jiayue.ipfcst.common.data.repository;
+
+import com.jiayue.ipfcst.common.data.entity.SysAlarm;
+
+/**
+ * TODO
+ *
+ * @author zzy
+ * @version 1.0
+ * @since 2019/8/6 10:56
+ */
+public interface SysAlarmRepository extends BaseRepository<SysAlarm, Integer> {
+}

+ 11 - 9
ipfcst-common/ipfcst-common-data/src/main/java/org/hibernate/cfg/InheritanceState.java

@@ -294,19 +294,21 @@ public class InheritanceState {
 
         //ordered to allow proper messages on properties subclassing
         XClass currentClassInHierarchy = clazz;
-        org.hibernate.cfg.InheritanceState superclassState;
+        org.hibernate.cfg.InheritanceState superclassState = null;
         do {
             classesToProcessForMappedSuperclass.add( 0, currentClassInHierarchy );
             XClass superClass = currentClassInHierarchy;
-            do {
-                superClass = superClass.getSuperclass();
-                superclassState = inheritanceStatePerClass.get( superClass );
-            }
-            while ( superClass != null
-                    && !buildingContext.getBootstrapContext().getReflectionManager().equals( superClass, Object.class )
-                    && superclassState == null );
+            if (superClass!=null){
+                do {
+                    superClass = superClass.getSuperclass();
+                    superclassState = inheritanceStatePerClass.get( superClass );
+                }
+                while ( superClass != null
+                        && !buildingContext.getBootstrapContext().getReflectionManager().equals( superClass, Object.class )
+                        && superclassState == null );
 
-            currentClassInHierarchy = superClass;
+                currentClassInHierarchy = superClass;
+            }
         }
         while ( superclassState != null && superclassState.isEmbeddableSuperclass() );
     }

+ 11 - 7
ipfcst-common/ipfcst-common-security/src/main/java/com/jiayue/ipfcst/common/security/util/JwtTokenUtil.java

@@ -49,8 +49,7 @@ public class JwtTokenUtil {
         try {
             claims = Jwts.parser().setSigningKey(secret).parseClaimsJws(token).getBody();
         } catch (Exception e) {
-            e.printStackTrace();
-            claims = null;
+            return null;
         }
         return claims;
     }
@@ -75,12 +74,14 @@ public class JwtTokenUtil {
      * @return 用户名
      */
     public String getUsernameFromToken(String token) {
-        String username;
+        String username = null;
         try {
             Claims claims = getClaimsFromToken(token);
-            username = claims.getSubject();
+            if (claims!=null){
+                username = claims.getSubject();
+            }
         } catch (Exception e) {
-            username = null;
+            return null;
         }
         return username;
     }
@@ -94,8 +95,11 @@ public class JwtTokenUtil {
     public Boolean isTokenExpired(String token) {
         try {
             Claims claims = getClaimsFromToken(token);
-            Date expiration = claims.getExpiration();
-            return expiration.before(new Date());
+            if (claims!=null){
+                Date expirationDate = claims.getExpiration();
+                return expirationDate.before(new Date());
+            }
+            return true;
         } catch (Exception e) {
             return true;
         }

+ 0 - 7
ipfcst-console/src/main/frontend/router/modules/console.js

@@ -27,13 +27,6 @@ const consoleRouter = {
       sign: 'photovoltaic'
     },
     {
-      path: 'holidayCalendar',
-      component: () => import('@/views/console/holidayCalendar/index'),
-      name: 'holidayCalendar',
-      meta: { title: '假期日历', noCache: true },
-      sign: 'currency'
-    },
-    {
       path: 'weatherStationInfo',
       component: () => import('@/views/console/weatherStationInfo/index'),
       name: 'WeatherStationInfo',

+ 0 - 391
ipfcst-console/src/main/frontend/views/console/holidayCalendar/index.vue

@@ -1,391 +0,0 @@
-<template>
-  <div class="app-container">
-    <el-card class="box-carde">
-      <div slot="header" class="clearfix">
-        <span>假期日历</span>
-        <el-button style="float: right;padding:3px 10px 3px 3px;" type="text" @click="exportDataEvent">导出数据
-        </el-button>
-      </div>
-      <el-button type="primary" size="small" @click="insertEvent" style="round-clip: 10px"
-                 :loading="btnLonding">新增
-      </el-button><!--v-loading="false"-->
-      <div style="padding-top: 10px">
-        <vxe-table
-          :keep-source="true"
-          align="center"
-          :loading="loading"
-          ref="xTable"
-          auto-resize
-          border
-          resizable
-          highlight-current-row
-          show-overflow
-          :edit-rules="rules"
-          :data="tableData"
-          v-show="showTable"
-          :edit-config="{trigger: 'manual', mode: 'row',autoClear: false,icon:'none'}"
-        >
-          <vxe-table-column title="假期日历信息">
-            <vxe-table-column field="name" title="假期名称"
-                              :edit-render="{name:'$input',attrs:{type:'text',size:'3'}}"></vxe-table-column>
-            <vxe-table-column field="holidayTypeEnum" title="假期类型"
-                              :edit-render="{name: '$select', options: options}"></vxe-table-column>
-            <vxe-table-column field="timeStartEnd" width="350px" title="开始时间-结束时间"
-                              :edit-render="{props: {type: 'default'}}">
-              <template v-slot:edit="{ row }">
-                <el-date-picker
-                  style="width: 100%"
-                  v-model="timeStartEnd"
-                  type="daterange"
-                  value-format="timestamp"
-                  range-separator="至"
-                  start-placeholder="开始日期"
-                  end-placeholder="结束日期"
-                  :picker-options="pickerOptions1"/>
-              </template>
-              <template v-slot="{ row }">{{ timestampToTime(row.startTime) }} 至 {{timestampToTime(row.endTime) }}
-              </template>
-            </vxe-table-column>
-            <vxe-table-column field="days" title="天数"></vxe-table-column>
-            <vxe-table-column width="15%" title="操作" align="center">
-              <template v-slot="{ row }">
-                <template v-if="$refs.xTable.isActiveByRow(row)">
-                  <el-button
-                    style="padding: 3px 4px 3px 4px;margin: 2px;"
-                    type="success"
-                    size="medium"
-                    icon="el-icon-edit"
-                    :loading="saveLoding"
-                    @click="saveCheck(row)">保存
-                  </el-button>
-                  <el-button
-                    style="padding: 3px 4px 3px 4px;margin: 2px"
-                    class="cancel-btn"
-                    icon="el-icon-refresh"
-                    type="warning"
-                    @click="cancelRowEvent(row)">取消
-                  </el-button>
-                </template>
-                <template v-else>
-                  <el-button
-                    style="padding: 3px 4px 3px 4px;margin: 2px"
-                    size="mini"
-                    icon="el-icon-edit"
-                    @click="editRowEvent(row)"
-                    :loading="btnLonding">编辑
-                  </el-button>
-                  <el-button
-                    type="danger"
-                    style="padding: 3px 4px 3px 4px;margin: 2px"
-                    size="mini"
-                    icon="el-icon-delete"
-                    @click="removeEvent(row)"
-                    :loading=btnLonding>删除
-                  </el-button>
-                </template>
-              </template>
-            </vxe-table-column>
-          </vxe-table-column>
-        </vxe-table>
-        <vxe-pager
-          perfect
-          :current-page.sync="currentPage"
-          :page-size.sync="pageSize"
-          :total="total"
-          :page-sizes=[10,50,100]
-          :layouts="['PrevJump', 'PrevPage','JumpNumber', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total']"
-          @page-change="handlePageChange"
-          v-show="!btnLonding&&showTable"
-        >
-        </vxe-pager>
-      </div>
-
-    </el-card>
-  </div>
-</template>
-<script>
-
-  export default {
-    data() {
-      return {
-        checkSign: false,
-        checkTableDate: [],
-        holidayType: '',
-        timeStartEnd: [],
-        loading: false,
-        saveLoding: false,
-        showTable: true,
-        btnLonding: false,
-        tableData: [],
-        currentPage: 1,
-        pageSize: 10,
-        total: 0,
-        options: [
-          {
-            value: "E1",
-            label: "假期"
-          },
-          {
-            value: "E2",
-            label: "特殊工作日"
-          }
-        ],
-        //表单验证规则
-        rules: {
-          name: [
-            {required: true, message: '假期名称不能为空'},
-            {min: 1, max: 9, message: '假期名称长度在 3 到 9 个字符'}
-          ],
-          holidayTypeEnum: [
-            {required: true, message: '请选择假期类型'}
-          ]
-        },
-        //当前日期之前日期不可选
-        pickerOptions1: {
-          disabledDate(time) {
-            // return time.getTime() < Date.now() - 8.64e7;
-            return time.getTime() <= Date.now();
-          }
-        }
-      }
-    },
-    created() {
-      this.getAll()
-    },
-    methods: {
-      checkDate(v1, v2, v3, v4) {
-        let result = false
-        const item = ''
-        // 修改时所需便利集合
-        const v5 = []
-        // 所有假期存放集合
-
-        // 在修改时,把当前在所有信息集合里要修改的信息去掉(如果不去掉会影响校验)
-        for (let i = 0; i < v2.length; i++) {
-          if (v2[i].id == v4.id) {
-            continue
-          }
-          v5.push(v2[i])
-        }
-        // 在编辑假期信息时 当前时间已存在于所有假期信息中,为防止当前时间被校验,在所有假期信息集合中删除该记录。
-        // 编辑修改
-        if (v3) {
-          // 假期修改
-          for (let i = 0; i < v5.length; i++) {
-            if (v1[0] >= v5[i].startTime && v1[0] <= v5[i].endTime) {
-              result = true
-              break
-            }
-            if (v1[1] >= v5[i].startTime && v1[1] <= v5[i].endTime) {
-              result = true
-              break
-            }
-            if (v1[0] <= v5[i].startTime && v1[1] >= v5[i].endTime) {
-              result = true
-              break
-            }
-            if (v1[0] >= v5[i].startTime && v1[1] <= v5[i].endTime) {
-              result = true
-              break
-            }
-          }
-        } else {
-          for (let i = 0; i < v2.length; i++) {
-            if (v1[0] >= v2[i].startTime && v1[0] <= v2[i].endTime) {
-              result = true
-              break
-            }
-            if (v1[1] >= v2[i].startTime && v1[1] <= v2[i].endTime) {
-              result = true
-              break
-            }
-            if (v1[0] <= v2[i].startTime && v1[1] >= v2[i].endTime) {
-              result = true
-              break
-            }
-            if (v1[0] >= v2[i].startTime && v1[1] <= v2[i].endTime) {
-              result = true
-              break
-            }
-          }
-        }
-        return result
-      },
-      getAll() {
-        this.loading = true
-        this.saveLoding = false
-        this.btnLonding = false
-        this.$axios.get("/holidayCalendar/" + this.currentPage + '/' + this.pageSize).then(response => {
-          if (response.data.content == "") {
-            this.showTable = false
-          } else {
-            this.showTable = true
-          }
-          this.tableData = response.data.content
-          this.total = response.data.totalElements
-          this.loading = false
-        })
-        this.$axios.get("/holidayCalendar/").then(response => {
-          this.checkTableDate = response.data
-        })
-      },
-      //编辑框改变
-      editRowEvent(row) {
-        this.checkSign = true
-        this.timeStartEnd = [row.startTime, row.endTime]
-        this.btnLonding = true
-        this.$refs.xTable.setActiveRow(row)
-      },
-      //数据校验
-      saveCheck(row) {
-        this.$refs.xTable.validate(row, callback => {
-          if (this.timeStartEnd == null) {
-            // callback(new Error('开始结束日期不能为空'))
-            this.$XModal.message({status: 'error', message: '开始结束日期不能为空!'})
-          } else {
-            // 判断开始时间是否是大于当前日期
-            if (row.holidayTypeEnum == 'E2') {
-              const startTime = new Date(this.timeStartEnd[0])
-              const endTime = new Date(this.timeStartEnd[1])
-              // 判断开始时间和结束时间是否是周六周日,切是相邻的周六周日
-              //if ((startTime.getDay() == 6 || startTime.getDay() == 0||endTime.getDay() == 6 || endTime.getDay() == 0) && (this.timeStartEnd[1] - this.timeStartEnd[0] <= 1000 * 60 * 60 * 24 * 2)) {
-              if ((startTime.getDay() < 1 || startTime.getDay() > 5) && (endTime.getDay() < 1 || endTime.getDay() > 5) && (this.timeStartEnd[1] - this.timeStartEnd[0] <= 1000 * 60 * 60 * 24 * 2)) {
-                if (this.checkDate(this.timeStartEnd, this.checkTableDate, this.checkSign, row)) {
-                  this.$XModal.message({status: 'error', message: '当前假日已存在于已有的假期中!'})
-                } else {
-                  callback:this.saveRowEvent(row)
-                }
-              } else {
-
-                this.$XModal.message({status: 'error', message: '特殊工作日必须为周六周日且开始日期和结束日期相邻!'})
-              }
-            } else {
-              if (this.checkDate(this.timeStartEnd, this.checkTableDate, this.checkSign, row)) {
-                this.$XModal.message({status: 'error', message: '当前假日已存在于已有的假期中!'})
-              } else {
-                callback:this.saveRowEvent(row)
-              }
-            }
-          }
-        })
-      },
-      //保存数据操作
-      saveRowEvent(row) {
-        row.startTime = this.timeStartEnd[0]
-        row.endTime = this.timeStartEnd[1]
-        row.days = (row.endTime -row.startTime) / 86400000 + 1
-        this.saveLoding = true
-
-        this.$refs.xTable.validate(valid => {
-          if (valid) {
-            if (row.id == undefined) {
-
-              this.$axios.post("/holidayCalendar/", row).then(response => {
-                this.btnLonding = false
-                this.saveLoding = false
-                this.getAll()
-                this.$XModal.message({status: 'warning', message: response.message})
-
-              })
-            } else {
-              this.$axios.put("/holidayCalendar/", row).then(response => {
-                this.saveLoding = false
-                this.getAll()
-                this.$XModal.message({status: 'warning', message: response.message})
-              })
-            }
-          } else {
-            this.$XModal.message({status: 'error', message: '校验不通过!'})
-            this.saveLoding = false
-          }
-        })
-      },
-      //取消编辑或添加操作
-      cancelRowEvent(row) {
-        this.saveLoding = false
-        this.btnLonding = false
-        const xTable = this.$refs.xTable
-        if (row.id == undefined) {
-          this.$refs.xTable.remove(row)
-        } else {
-          xTable.clearActived().then(() => {
-            // 还原行数据
-            xTable.revertData(row)
-          })
-        }
-      },
-      //删除数据
-      removeEvent(row) {
-        this.$XModal.confirm('您确定要删除该数据?').then(type => {
-          if (type === 'confirm') {
-            this.$axios.delete("/holidayCalendar/", {data: row}).then(response => {
-              this.$XModal.message({status: 'warning', message: response.message})
-              this.getAll()
-            })
-          }
-        })
-      },
-      //时间戳日期转换器
-      timestampToTime(time) {
-        const date = new Date(time) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
-        const Y = date.getFullYear() + '-'
-        const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
-        const D = date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()
-        return Y + M + D
-      },
-      //新增编辑框
-      insertEvent() {
-        this.timeStartEnd = []
-        this.showTable = true
-        this.btnLonding = true
-        this.checkSign = false
-        this.$refs.xTable.insert()
-          .then(({row}) => this.$refs.xTable.setActiveRow(row))
-      },
-      //分页触发事件
-      handlePageChange({currentPage, pageSize}) {
-        this.currentPage = currentPage
-        this.pageSize = pageSize
-        this.getAll()
-      },
-      //导出
-      exportDataEvent() {
-        this.loading = true
-        this.$axios.get('/holidayCalendar/').then(res => {
-          const data = res.data.content
-          this.$refs.xTable.exportData({
-            filename: '假期日历信息',
-            type: 'csv',
-            isHeader: true,
-            isFooter: true,
-            data
-          })
-          this.loading = false
-          // this.loading = false
-        }).catch(e => {
-          this.loading = false
-
-        })
-      },
-      //导入
-      // importDataEvent() {
-      //   this.$refs.xTable.importData({types: ['csv']})
-      // }
-    }
-  }
-</script>
-
-<style lang="scss" scoped>
-  .app-container {
-    /*left: 0;*/
-    /*width: 100%;*/
-    /*min-height: 100%;*/
-    /*height: auto;*/
-    /*background-image: linear-gradient(25deg, #05362d, #145d44, #24875d, #35b477)*/
-  }
-
-  .pagination {
-    margin: 20px 0;
-    text-align: right;
-  }
-</style>

+ 4 - 1
ipfcst-console/src/main/frontend/views/console/inverterInfo/index.vue

@@ -58,7 +58,7 @@
             <vxe-table-column align="center" title="逆变器信息">
               <vxe-table-column type="checkbox" width="3%"></vxe-table-column>
               <vxe-table-column :edit-render="{name: '$input', attrs: {type: 'text'}}" field="stationCode" title="场站编号"
-                                width="6%"></vxe-table-column>
+                                width="10%"></vxe-table-column>
               <vxe-table-column :edit-render="{name:'$input',attrs:{type:'text'}}" field="equipmentNo" title="设备编号"
                                 width="10%"></vxe-table-column>
               <vxe-table-column :edit-render="{name: '$input', attrs: {type: 'text'}}" align="center" field="name" title="名称"
@@ -203,6 +203,9 @@ export default {
       }],
       // 表单验证规则
       rules: {
+        stationCode: [
+          {required: true, message: '场站编号不能为空'},
+        ],
         name: [
           {required: true, validator: checkName}
         ],

+ 4 - 1
ipfcst-console/src/main/frontend/views/console/weatherStationInfo/index.vue

@@ -38,7 +38,7 @@
           :edit-config="{trigger: 'manual', mode: 'row',autoClear: false,icon:'none'}"
         >
           <vxe-table-column title="气象站信息">
-            <vxe-table-column field="stationCode" title="场站编号" width="6%"
+            <vxe-table-column field="stationCode" title="场站编号" width="10%"
                               :edit-render="{name: '$input', attrs: {type: 'text'}}"></vxe-table-column>
             <vxe-table-column field="name" title="名称"width="13%"
                               :edit-render="{name: '$input', attrs: {type: 'text'}}"></vxe-table-column>
@@ -181,6 +181,9 @@
           }
         ],
         rules: {
+          stationCode: [
+            {required: true, message: '场站编号不能为空'},
+          ],
           name: [
             {required: true, validator:checkName},
           ],

+ 5 - 2
ipfcst-console/src/main/frontend/views/console/windTowerInfo/index.vue

@@ -38,9 +38,9 @@
           :edit-config="{trigger: 'manual', mode: 'row',autoClear: false,icon:'none'}"
         >
           <vxe-table-column title="测风塔信息">
-            <vxe-table-column field="stationCode" title="场站编号" width="6%"
+            <vxe-table-column field="stationCode" title="场站编号" width="10%"
                               :edit-render="{name: '$input', attrs: {type: 'text'}}"></vxe-table-column>
-            <vxe-table-column field="name" title="名称"  width="13%"
+            <vxe-table-column field="name" title="名称"  width="10%"
                               :edit-render="{name: '$input', attrs: {type: 'text'}}"></vxe-table-column>
             <vxe-table-column field="manufacturer" title="生产商"  width="13%"
                               :edit-render="{name: '$input', attrs: {type: 'text'}}"></vxe-table-column>
@@ -191,6 +191,9 @@
           }
         ],
         rules: {
+          stationCode: [
+            {required: true, message: '场站编号不能为空'},
+          ],
           name: [
             {required: true,  validator:checkName},
           ],

+ 4 - 1
ipfcst-console/src/main/frontend/views/console/windTurbineInfo/index.vue

@@ -80,7 +80,7 @@
         >
           <vxe-table-column title="风机信息">
             <vxe-table-column type="checkbox" width="3%"/>
-            <vxe-table-column field="stationCode" title="场站编号" width="6%"
+            <vxe-table-column field="stationCode" title="场站编号" width="10%"
                               :edit-render="{name: '$input', attrs: {type: 'text'}}"></vxe-table-column>
             <vxe-table-column
               field="name"
@@ -389,6 +389,9 @@ export default {
       ],
       // 表单验证规则
       rules: {
+        stationCode: [
+          {required: true, message: '场站编号不能为空'},
+        ],
         name: [
           {required: true, validator: checkName}
         ],

+ 4 - 4
ipfcst-console/src/main/java/com/jiayue/ipfcst/ConsoleApplication.java

@@ -38,9 +38,9 @@ import java.util.Properties;
 public class ConsoleApplication {
 
     private final Environment environment;
-    @Qualifier("dataSource")
-    @Autowired
-    private DataSource dataSource;
+//    @Qualifier("dataSource")
+//    @Autowired
+//    private DataSource dataSource;
 
     @Autowired
     public ConsoleApplication(Environment environment) {
@@ -66,7 +66,7 @@ public class ConsoleApplication {
     @Bean
     public SchedulerFactoryBean schedulerFactoryBean(
             PlatformTransactionManager transactionManager, ApplicationContext applicationContext,
-            QuartzJobFactory quartzJobFactory) throws Exception {
+            QuartzJobFactory quartzJobFactory,DataSource dataSource) throws Exception {
         SchedulerFactoryBean schedulerFactoryBean = new SchedulerFactoryBean();
         schedulerFactoryBean.setDataSource(dataSource);
         schedulerFactoryBean.setTransactionManager(transactionManager);

+ 5 - 14
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/ElectricFieldController.java

@@ -13,7 +13,6 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.BufferedOutputStream;
-import java.io.IOException;
 import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
@@ -159,7 +158,6 @@ public class ElectricFieldController {
   //导出所有场站
   @RequestMapping(value = "/export")
   public void export(HttpServletResponse response) {
-    BufferedOutputStream bos = null;
     try {
       StringBuilder templateContent = new StringBuilder();
       response.setCharacterEncoding("UTF-8");
@@ -189,20 +187,13 @@ public class ElectricFieldController {
       response.setContentType("application/x-msdownload;charset=UTF-8");// 文件下载必须配置为application/x-msdownload
       response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode("场站信息数据.csv", "UTF-8"));// 中文文件名必须使用URLEncoder.encode进行转码
       byte[] templateContentBytes = templateContent.toString().getBytes(StandardCharsets.UTF_8);
-      bos = new BufferedOutputStream(response.getOutputStream());// 向response中写入文件流
-      bos.write(new byte[]{(byte) 0xEF, (byte) 0xBB, (byte) 0xBF});// 指定csv文件用UTF-8字符集打开
-      bos.write(templateContentBytes);
-      response.flushBuffer();
+      try(BufferedOutputStream bos = new BufferedOutputStream(response.getOutputStream());) {// 向response中写入文件流
+        bos.write(new byte[]{(byte) 0xEF, (byte) 0xBB, (byte) 0xBF});// 指定csv文件用UTF-8字符集打开
+        bos.write(templateContentBytes);
+        response.flushBuffer();
+      }
     } catch (Exception e) {
       log.error("系统错误:" + e.getMessage(), e);
-      throw new RuntimeException(e);
-    } finally {
-      if (bos != null)
-        try {
-          bos.close();
-        } catch (IOException e) {
-          log.error("系统错误:" + e.getMessage(), e);
-        }
     }
   }
 }

+ 3 - 2
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/InitJobClassController.java

@@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
@@ -115,7 +116,7 @@ public class InitJobClassController {
   @GetMapping(value = "initJobClasses/jobType/{jt}")
   public ResponseVO getJobClassByType(
     @PathVariable final String jt) {
-    final Map<String, Object> map = new Hashtable<>();
+    final Map<String, Object> map = new HashMap<>();
 
     final List<InitJobClass> list = initJobClassService.findByJobClassType(jt);
     map.put("list", list);
@@ -131,7 +132,7 @@ public class InitJobClassController {
   @SneakyThrows
   @GetMapping(value = "initJobClasses/getAllJobClass")
   public ResponseVO getAllJobClass() {
-    final Map<String, Object> map = new Hashtable<>();
+    final Map<String, Object> map = new HashMap<>();
 
     final List<InitJobClass> list = initJobClassService.findAll();
     map.put("list", list);

+ 147 - 0
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/SysAlarmController.java

@@ -0,0 +1,147 @@
+package com.jiayue.ipfcst.console.controller;
+
+import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
+import com.jiayue.ipfcst.common.data.constant.enums.AlarmStatusEnum;
+import com.jiayue.ipfcst.common.data.constant.enums.AlarmTypeEnum;
+import com.jiayue.ipfcst.common.data.entity.SysAlarm;
+import com.jiayue.ipfcst.console.service.SysAlarmService;
+import lombok.SneakyThrows;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 系统告警restful接口
+ *
+ * @author tl
+ * @version 3.0
+ * @since 2020/6/28 10:12
+ */
+@RestController
+@RequestMapping("SysAlarm")
+@Slf4j
+public class SysAlarmController {
+  private final SysAlarmService sysAlarmService;
+
+  @Autowired
+  public SysAlarmController(SysAlarmService sysAlarmService) {
+    this.sysAlarmService = sysAlarmService;
+  }
+
+  /**
+   * 获取告警信息
+   *
+   * @param page
+   * @param size
+   * @return 执行结果
+   */
+  @SneakyThrows
+  @GetMapping(value = "/{page}/{size}")
+  public ResponseVO getAll(@PathVariable("page") Integer page, @PathVariable("size") Integer size) {
+    SysAlarm sysAlarm = new SysAlarm();
+    Page<SysAlarm> sysParameterPage = this.sysAlarmService.get(sysAlarm, page, size);
+    return ResponseVO.success(sysParameterPage);
+  }
+
+  /**
+   * 查询
+   *
+   * @param page
+   * @param size
+   * @return 执行结果
+   */
+  @SneakyThrows
+  @GetMapping(value = "/{page}/{size}/{alarmTypeEnum}")
+  public ResponseVO getForNameAndAlarmTypeEnum(@PathVariable("page") Integer page, @PathVariable("size") Integer size,@PathVariable("alarmTypeEnum") AlarmTypeEnum alarmTypeEnum) {
+    SysAlarm sysAlarm = new SysAlarm();
+    Page<SysAlarm> sysParameterPage = this.sysAlarmService.getForNameAndAlarmTypeEnum(sysAlarm, page, size,alarmTypeEnum);
+    return ResponseVO.success(sysParameterPage);
+  }
+
+
+  /**
+   * 获取告警信息
+   *
+   * @return 执行结果
+   */
+  @SneakyThrows
+  @GetMapping()
+  public ResponseVO getAll() {
+    List<SysAlarm> list = this.sysAlarmService.getAll();
+    return ResponseVO.success(list);
+  }
+
+  /**
+   * 处理告警信息
+   *
+   * @return 执行结果
+   */
+  @SneakyThrows
+  @PutMapping()
+  public ResponseVO update(@RequestBody SysAlarm sysAlarm) {
+    try {
+      sysAlarmService.save(sysAlarm);
+      return ResponseVO.success(1);
+    } catch (Exception ex) {
+      return ResponseVO.success("处理告警信息出错:" + ex);
+    }
+  }
+
+  /**
+   * 获取问题类型枚举
+   *
+   * @return 执行结果
+   */
+  @SneakyThrows
+  @GetMapping("/getAlarmStatusEnum")
+  public ResponseVO getAlarmStatusEnum() {
+    List<Map<String, Object>> list = new ArrayList<>();
+    Map<String, Object> map;
+    try {
+      for (AlarmStatusEnum e : AlarmStatusEnum.values()) {
+        map = new HashMap<>();
+        map.put("label", e.getMessage());
+        map.put("key", e.name());
+        map.put("value", e.name());
+        list.add(map);
+      }
+      return ResponseVO.success(list);
+    } catch (Exception e) {
+      e.printStackTrace();
+      log.error(" 获取问题处理状态异常");
+      return ResponseVO.fail(list);
+    }
+  }
+
+  /**
+   * 获取问题类型枚举
+   *
+   * @return 执行结果
+   */
+  @SneakyThrows
+  @GetMapping("/getAlarmTypeEnum")
+  public ResponseVO getAlarmTypeEnum() {
+    List<Map<String, Object>> list = new ArrayList<>();
+    Map<String, Object> map;
+    try {
+      for (AlarmTypeEnum e : AlarmTypeEnum.values()) {
+        map = new HashMap<>();
+        map.put("label", e.getMessage());
+        map.put("key", e.name());
+        map.put("value", e.name());
+        list.add(map);
+      }
+      return ResponseVO.success(list);
+    } catch (Exception e) {
+      e.printStackTrace();
+      log.error(" 获取问题类型异常");
+      return ResponseVO.fail(list);
+    }
+  }
+}

+ 0 - 26
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/WindTowerStatusDataController.java

@@ -29,32 +29,6 @@ public class WindTowerStatusDataController {
     this.windTowerStatusDataService = windTowerStatusDataService;
   }
 
-//  /**
-//   * 分页查询 测风塔数据
-//   * @param startTime 开始时间
-//   * @param endTime 结束时间
-//   * @param page 页码
-//   * @param size 条数
-//   * @param sortOrder 排序
-//   * @return
-//   */
-//  @GetMapping(value = "/windTowerStatusData/{startTime}/{endTime}/{page}/{size}/{no}")
-//  public ResponseVO findByTimeBetweenForPaging(@PathVariable("startTime") Long startTime,
-//                                               @PathVariable("endTime") Long endTime,
-//                                               @PathVariable("page") Integer page,
-//                                               @PathVariable("size") Integer size,
-//                                               @PathVariable("no") Integer no,
-//                                               String sortOrder){
-//    Map<String,Object> map = new HashMap<>();
-//    try{
-//      map =  windTowerStatusDataService.findByTimeBetweenForPaging(new Date(startTime),new Date(endTime),page,size,no,sortOrder);
-//      return ResponseVO.success(map);
-//    }catch(Exception e){
-//      e.printStackTrace();
-//      log.error("测风塔数据分页查询错误");
-//      return ResponseVO.fail(e.toString());
-//    }
-//  }
 
   @GetMapping(value = "/windTowerStatusData/{stationCode}/{startTime}/{endTime}/{page}/{size}/{no}")
   public ResponseVO findByTimeBetweenAndNoAndTimeStep(@PathVariable("stationCode") String stationCode, @PathVariable("startTime") Long startTime,

+ 1 - 1
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/job/ReceiveDataJob.java

@@ -23,7 +23,7 @@ public class ReceiveDataJob {
   private ReceiveDataService receiveDataService;
 
 
-  @Scheduled(cron = "0 0/1 * * * *")
+  @Scheduled(fixedDelay = 60000)
   public void receiveData() {
 
     log.info("开始向绿能数据中心请求数据");

+ 56 - 131
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/FileAnalysisService.java

@@ -21,6 +21,8 @@ import java.io.*;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -57,8 +59,15 @@ public class FileAnalysisService extends BaseService {
 
   ElectricFieldRepository electricFieldRepository;
 
-  HolidayCalendarService holidayCalendarService;
+  private final String deleteFilelog = "文件删除异常";
 
+  private final String format = "yyyy-MM-dd HH:mm:ss";
+
+  private final String systemErrorLog = "系统错误: ";
+
+  private final String errorLog = "error";
+
+  private final String analysisFaild = "文件解析失败";
   public static void mvFile(File file, String fdPath) {
     try {
       FileUtils.copyFile(file, new File(fdPath), true);
@@ -104,7 +113,6 @@ public class FileAnalysisService extends BaseService {
     for (ElectricField electricField : electricFieldList) {
       eList.add(electricField.getStationCode());
     }
-    //String path = FileUtil.getDownloadFilePath() + File.separator + "new";
     String path = FileUtil.getDownloadFilePath();
     //downloadFile
     File dirFile = new File(path);
@@ -116,34 +124,26 @@ public class FileAnalysisService extends BaseService {
     for (String stationCode : eList) {
       // downLoadFile/场站编号/new
       String dirFiles = dirFile.getPath() + File.separator + stationCode + File.separator + "new";
-      //String dirFiles = "/Users/wanghongchen/fsdownload"+File.separator+ stationCode+ File.separator + "new";
       File filePath = new File(dirFiles);
       if (!filePath.exists()) {
         filePath.mkdirs();
       }
       Collection<File> files = FileUtils.listFiles(filePath, new String[]{"RB"}, false);
       String dayStr = new SimpleDateFormat("yyyyMMdd").format(new Date());//当前时间格式化为年月日
-      if (files.size() > 0) {
+      if (files.isEmpty()) {
         for (File file : files) {
           flag = false;
           String fileName = file.getName();
           if (!fileName.contains(dayStr)) {
-            file.delete();
-            log.info(fileName + "不是当天的文件,删除!");
-            break;
+            try {
+              Files.delete(Paths.get(file.getPath()));
+              log.info(fileName + "不是当天的文件,删除!");
+              break;
+            }catch (IOException e2){
+              log.info(deleteFilelog,e2);
+            }
           }
           if (fileName.length() < 30) {
-            //假期文件
-            if (file.getName().startsWith("JH")) {
-              List<HolidayCalendar> listJq = fileAnalysisJqTerm(file);
-              if (listJq.size() > 0) {
-                holidayCalendarRepository.deleteAll();
-                holidayCalendarRepository.saveAll(listJq);
-                flag = true;
-              } else {
-                flag = false;
-              }
-            }
             if (file.getName().startsWith("DQ")) {
               try {
                 List<ForecastPowerShortTerm> listDq = fileAnalysisShortTerm(file, currentDate, stationCode);
@@ -267,11 +267,9 @@ public class FileAnalysisService extends BaseService {
   private List<Nwp> fileAnalysisNwp(File file, String stationCode) {
     List<Nwp> listNwp = new ArrayList<>();
     if (file.renameTo(file)) {
-      InputStreamReader readNwp = null;
-      BufferedReader bufferedReaderNwp = null;
-      try {
-        readNwp = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8.name());//考虑到编码格式
-        bufferedReaderNwp = new BufferedReader(readNwp);
+      try(
+        InputStreamReader readNwp = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8.name());//考虑到编码格式
+        BufferedReader bufferedReaderNwp = new BufferedReader(readNwp);){
         String lineTxt;
         Nwp nwpData;
         BigDecimal nwpDirectRadiation = new BigDecimal("0.7"); //直接辐射
@@ -281,10 +279,7 @@ public class FileAnalysisService extends BaseService {
           //NWP文件按照Tab方式截取
           String[] datas = lineTxt.split("\t");
           if (datas.length == 35 && datas[0].startsWith("#")) {
-            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-            //过滤当天的数据
-            //if (sdf.parse(datas[5]).getTime() >= TimeUtils.getMillisecondsSubDay() + 24 * 60 * 60 *
-            // 1000) {
+            SimpleDateFormat sdf = new SimpleDateFormat(format);
             nwpData = new Nwp();
 
             //将截取的文件放入nwpData中
@@ -321,81 +316,29 @@ public class FileAnalysisService extends BaseService {
             nwpData.setWd170(new BigDecimal(datas[34]).setScale(2, RoundingMode.HALF_UP));
             nwpData.setStationCode(stationCode);
             listNwp.add(nwpData);
-            //}
           }
         }
       } catch (IOException | ParseException | RuntimeException e) {
-        log.error("系统错误:", e);
+        log.error(systemErrorLog, e);
         // 进行告警
-        File destFile = new File(file.getPath().replaceFirst("new", "error"));
+        File destFile = new File(file.getPath().replaceFirst("new", systemErrorLog));
         if (destFile.exists()) {
-          destFile.delete();
+          try {
+            Files.delete(Paths.get(destFile.getPath()));
+          }catch (IOException e2){
+            log.info(deleteFilelog,e2);
+          }
         }
         try {
           FileUtils.moveFile(file, destFile);
         } catch (IOException e1) {
-          log.error(file.getName() + "文件解析失败", e);
+          log.error(file.getName() + analysisFaild, e);
         }
-      } finally {
-        close(bufferedReaderNwp, readNwp);
       }
     }
     return listNwp;
   }
 
-  /**
-   * 假期解析
-   *
-   * @param file 文件路径
-   * @return 样例集合
-   */
-  private List<HolidayCalendar> fileAnalysisJqTerm(File file) {
-    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-    List<HolidayCalendar> holidayCalendars = new ArrayList<>();
-    // 当文件未被使用时,进行解析上报
-    if (file.renameTo(file)) {
-      InputStreamReader read = null;
-      BufferedReader bufferedReader = null;
-      String stringLine;
-      HolidayCalendar holiday;
-      try {
-        read = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8);
-        bufferedReader = new BufferedReader(read);
-        while ((stringLine = bufferedReader.readLine()) != null) {
-          String[] string_arr = stringLine.split("\t");
-          if (string_arr.length == 7 && string_arr[0].startsWith("#")) {
-            holiday = new HolidayCalendar();
-            holiday.setId(Integer.parseInt(string_arr[1] + ""));
-            holiday.setName(string_arr[2] + "");
-            holiday.setStartTime(sdf.parse(string_arr[3]).getTime());
-            holiday.setEndTime(sdf.parse(string_arr[4]).getTime());
-            holiday.setDays(Integer.parseInt(string_arr[5] + ""));
-            if (string_arr[6].equals("1")) {
-              holiday.setHolidayTypeEnum(HolidayTypeEnum.valueOf(string_arr[6]));
-            }
-            holidayCalendars.add(holiday);
-          }
-        }
-      } catch (IOException | ParseException | RuntimeException e) {
-        log.error("系统错误:", e);
-        // 进行告警
-
-
-        File destFile = new File(file.getPath().replaceFirst("new", "error"));
-        if (destFile.exists()) {
-          destFile.delete();
-        }
-        try {
-          FileUtils.moveFile(file, destFile);
-        } catch (IOException e1) {
-          log.error(file.getName() + "文件解析失败", e);
-        }
-      } finally {
-        close(bufferedReader, read);
-      }
-    }
-    return holidayCalendars;
-  }
 
   /**
    * 短期解析
@@ -405,25 +348,19 @@ public class FileAnalysisService extends BaseService {
    * @return 样例集合
    */
   private List<ForecastPowerShortTerm> fileAnalysisShortTerm(File file, Long currentDate, String stationCode) {
-    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+    SimpleDateFormat sdf = new SimpleDateFormat(format);
     List<ForecastPowerShortTerm> forecastPowerShortTerm = new ArrayList<>();
     // 当文件未被使用时,进行解析上报
     if (file.renameTo(file)) {
-      InputStreamReader read = null;
-      BufferedReader bufferedReader = null;
       String stringLine;
       ForecastPowerShortTerm stf;
-      try {
-        read = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8);
-        bufferedReader = new BufferedReader(read);
+      try (
+        InputStreamReader read = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8);
+        BufferedReader bufferedReader = new BufferedReader(read);){
         while ((stringLine = bufferedReader.readLine()) != null) {
           String[] string_arr = stringLine.split("\t");
 
-          if (string_arr.length == 4 && string_arr[0].startsWith("#")) {
-            if (StringUtils.isNotEmpty(string_arr[2])) {
-              //过滤当天的数据
-              //if (sdf.parse(string_arr[2]).getTime() >= TimeUtils.getMillisecondsSubDay() + 24 * 60 *
-              // 60 * 1000) {
+          if (string_arr.length == 4 && string_arr[0].startsWith("#") && StringUtils.isNotEmpty(string_arr[2])) {
               stf = new ForecastPowerShortTerm();
               stf.setFpValue(new BigDecimal(string_arr[3] + ""));
               stf.setForecastTime(sdf.parse(string_arr[2]).getTime());
@@ -431,24 +368,24 @@ public class FileAnalysisService extends BaseService {
               stf.setPredictionModelEnum(PredictionModelEnum.E1);
               stf.setStationCode(stationCode);
               forecastPowerShortTerm.add(stf);
-              // }
-            }
           }
         }
-      } catch (IOException | ParseException | RuntimeException e) {
-        log.error("系统错误:", e);
+      } catch (Exception e) {
+        log.error(systemErrorLog, e);
         // 进行告警
-        File destFile = new File(file.getPath().replaceFirst("new", "error"));
+        File destFile = new File(file.getPath().replaceFirst("new", systemErrorLog));
         if (destFile.exists()) {
-          destFile.delete();
+          try {
+            Files.delete(Paths.get(destFile.getPath()));
+          }catch (IOException e2){
+            log.info(deleteFilelog,e2);
+          }
         }
         try {
           FileUtils.moveFile(file, destFile);
         } catch (IOException e1) {
-          log.error(file.getName() + "文件解析失败", e);
+          log.error(file.getName() +analysisFaild, e);
         }
-      } finally {
-        close(bufferedReader, read);
       }
     }
     return forecastPowerShortTerm;
@@ -464,7 +401,11 @@ public class FileAnalysisService extends BaseService {
     File destFile = new File(file.getPath().replaceFirst("new", "backupsTemp"));
     log.info("move file :{}, dest file:{}", file, destFile);
     if (destFile.exists()) {
-      destFile.delete();
+      try {
+        Files.delete(Paths.get(destFile.getPath()));
+      }catch (IOException e2){
+        log.info(deleteFilelog,e2);
+      }
     }
     try {
       FileUtils.moveFile(file, destFile);
@@ -508,14 +449,18 @@ public class FileAnalysisService extends BaseService {
    * @param file 文件
    */
   private void moveFileError(File file) {
-    File destFile = new File(file.getPath().replaceFirst("new", "error"));
+    File destFile = new File(file.getPath().replaceFirst("new", systemErrorLog));
     if (destFile.exists()) {
-      destFile.delete();
+      try {
+        Files.delete(Paths.get(destFile.getPath()));
+      }catch (IOException e2){
+        log.info(deleteFilelog,e2);
+      }
     }
     try {
       FileUtils.moveFile(file, destFile);
     } catch (IOException e) {
-      log.error(file.getName() + "文件解析失败", e);
+      log.error(file.getName() + analysisFaild, e);
     }
   }
 
@@ -543,24 +488,4 @@ public class FileAnalysisService extends BaseService {
     fileParsingRecord.setStationCode(staticCode);
     fileAnalysisRecordService.save(fileParsingRecord);
   }
-
-
-  /**
-   * 关闭文件流
-   *
-   * @param bufferedReader 字符数据
-   * @param read           字节流
-   */
-  private void close(BufferedReader bufferedReader, InputStreamReader read) {
-    try {
-      if (bufferedReader != null) {
-        bufferedReader.close();
-      }
-      if (read != null) {
-        read.close();
-      }
-    } catch (IOException e) {
-      log.error("关闭文件流失败:", e);
-    }
-  }
 }

+ 6 - 4
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/ForecastPowerShortTermHisService.java

@@ -28,6 +28,8 @@ import java.util.Map;
  */
 @Service
 public class ForecastPowerShortTermHisService extends BaseService {
+  private final String forecastTime = "forecastTime";
+
   private final ForecastPowerShortTermHisRepository forecastPowerShortTermHisRepository;
 
   @Autowired
@@ -47,9 +49,9 @@ public class ForecastPowerShortTermHisService extends BaseService {
   public Map<String, Object> findByForecastTimeBetweenAndStationCode(Long startTime, Long endTime, String stationCode, Integer page, Integer size, String sortOrder) {
 
     Map<String, Object> map = new HashMap<>();
-    Sort sort = Sort.by(Sort.Direction.DESC, "forecastTime");
+    Sort sort = Sort.by(Sort.Direction.DESC, forecastTime);
     if (sortOrder.contains("asc")) {
-      sort = Sort.by(Sort.Direction.ASC, "forecastTime");
+      sort = Sort.by(Sort.Direction.ASC, forecastTime);
     }
     Specification<ForecastPowerShortTermHis> specification = this.specificationFindByTimeAndNo(startTime, endTime, stationCode);
     Pageable pageable = PageRequest.of(page - 1, size, sort);
@@ -73,11 +75,11 @@ public class ForecastPowerShortTermHisService extends BaseService {
       List<Predicate> predicates = new ArrayList<>();
       if (startTime != null) {
         //大于或等于传入时间
-        predicates.add(cb.greaterThanOrEqualTo(root.get("forecastTime").as(Long.class), startTime));
+        predicates.add(cb.greaterThanOrEqualTo(root.get(forecastTime).as(Long.class), startTime));
       }
       if (endTime != null) {
         //小于传入时间
-        predicates.add(cb.lessThan(root.get("forecastTime").as(Long.class), endTime));
+        predicates.add(cb.lessThan(root.get(forecastTime).as(Long.class), endTime));
       }
       predicates.add(cb.equal(root.get("stationCode").as(String.class), stationCode));
       //添加排序的功能

+ 13 - 9
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/ForecastPowerShortTermService.java

@@ -14,7 +14,7 @@ import com.jiayue.ipfcst.common.data.repository.ForecastPowerShortTermHisReposit
 import com.jiayue.ipfcst.common.data.repository.ForecastPowerShortTermRepository;
 import com.jiayue.ipfcst.common.data.service.BaseService;
 import com.jiayue.ipfcst.console.util.Constant;
-import com.sun.istack.internal.NotNull;
+
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.time.DateFormatUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -28,6 +28,7 @@ import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.persistence.criteria.Predicate;
+import javax.validation.constraints.NotNull;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.text.SimpleDateFormat;
@@ -45,6 +46,11 @@ public class ForecastPowerShortTermService extends BaseService {
   @Autowired
   ElectricFieldService electricFieldService;
 
+
+  private final String format = "yyyy-MM-dd HH:mm:ss";
+
+  private final String forecastTime = "forecastTime";
+
   /**
    * 按场站编号和时间段删除数据,再保存新数据
    *
@@ -70,7 +76,7 @@ public class ForecastPowerShortTermService extends BaseService {
   @Transactional(propagation = Propagation.REQUIRED)
   public List<ForecastPowerShortTermHis> getForecastPowerShortTerm(@NotNull final Long startTime,
                                                                    @NotNull final Long endTime, @NotNull final String stationCode) {
-    log.info(stationCode + "开始获取短期预测功率" + DateFormatUtils.format(startTime, "yyyy-MM-dd HH:mm:ss") + " 至 " + DateFormatUtils.format(endTime, "yyyy-MM-dd HH:mm:ss"));
+    log.info(stationCode + "开始获取短期预测功率" + DateFormatUtils.format(startTime, format) + " 至 " + DateFormatUtils.format(endTime, format));
     // 查询场站信息
     ElectricField electricFieldInfo = electricFieldService.getSingleStation(stationCode);
     // 查询预测时间点对应的开机容量
@@ -183,7 +189,6 @@ public class ForecastPowerShortTermService extends BaseService {
   @Transactional(propagation = Propagation.REQUIRED)
   public ForecastPowerShortTerm generateSolarPowerShortTerm(@NotNull final Long tempTime, BigDecimal openCapacity,
                                                             ElectricField electricFieldInfo) {
-    System.out.println("光补数");
     ForecastPowerShortTerm forecastPowerShortTerm = new ForecastPowerShortTerm();
     forecastPowerShortTerm.setForecastTime(tempTime);
     BigDecimal tempValue;
@@ -214,7 +219,6 @@ public class ForecastPowerShortTermService extends BaseService {
    */
   @Transactional(propagation = Propagation.REQUIRED)
   public ForecastPowerShortTerm generateWindPowerShortTerm(@NotNull final Long tempTime, BigDecimal openCapacity, String stationCode) {
-    System.out.println("风补数");
     ForecastPowerShortTerm forecastPowerShortTerm = new ForecastPowerShortTerm();
     forecastPowerShortTerm.setForecastTime(tempTime);
     BigDecimal randomValue = BigDecimal.valueOf(CommonUtil.getRandom(97, 99) / 100.0d);
@@ -248,7 +252,7 @@ public class ForecastPowerShortTermService extends BaseService {
 
     long startTimeLong = startTime;
     long endTimeLong = endTime;
-    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+    SimpleDateFormat sdf = new SimpleDateFormat(format);
     long timeStep = 900000L;
     if (startTimeLong % timeStep != 0) {
       startTimeLong = startTimeLong - (startTimeLong % timeStep) + timeStep;
@@ -285,9 +289,9 @@ public class ForecastPowerShortTermService extends BaseService {
    */
   public Map<String, Object> findByTimeBetweenAndNoForPaging(Long startTime, Long endTime, String stationCode, Integer page, Integer size, String sortOrder) {
     Map<String, Object> map = new HashMap<>();
-    Sort sort = Sort.by(Sort.Direction.DESC, "forecastTime");
+    Sort sort = Sort.by(Sort.Direction.DESC, forecastTime);
     if (sortOrder.contains("asc")) {
-      sort = Sort.by(Sort.Direction.ASC, "forecastTime");
+      sort = Sort.by(Sort.Direction.ASC, forecastTime);
     }
     Specification<ForecastPowerShortTerm> specification = this.specificationFindByTimeAndNo(startTime, endTime, stationCode);
     Pageable pageable = PageRequest.of(page - 1, size, sort);
@@ -310,11 +314,11 @@ public class ForecastPowerShortTermService extends BaseService {
       List<Predicate> predicates = new ArrayList<>();
       if (startTime != null) {
         //大于或等于传入时间
-        predicates.add(cb.greaterThanOrEqualTo(root.get("forecastTime").as(Long.class), startTime));
+        predicates.add(cb.greaterThanOrEqualTo(root.get(forecastTime).as(Long.class), startTime));
       }
       if (endTime != null) {
         //小于传入时间
-        predicates.add(cb.lessThan(root.get("forecastTime").as(Long.class), endTime));
+        predicates.add(cb.lessThan(root.get(forecastTime).as(Long.class), endTime));
       }
       predicates.add(cb.equal(root.get("stationCode").as(String.class), stationCode));
       //添加排序的功能

+ 8 - 8
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/ForecastPowerUltraShortTermService.java

@@ -12,7 +12,6 @@ import com.jiayue.ipfcst.common.data.repository.ForecastPowerUltraShortTermHisRe
 import com.jiayue.ipfcst.common.data.repository.ForecastPowerUltraShortTermRepository;
 import com.jiayue.ipfcst.common.data.repository.PowerStationStatusDataRepository;
 import com.jiayue.ipfcst.common.data.service.BaseService;
-import com.sun.istack.internal.NotNull;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.time.DateFormatUtils;
 import org.apache.commons.lang.time.DateUtils;
@@ -21,6 +20,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.validation.constraints.NotNull;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.text.SimpleDateFormat;
@@ -53,7 +53,7 @@ public class ForecastPowerUltraShortTermService extends BaseService {
   ForecastPowerShortTermService forecastPowerShortTermService;
   @Autowired
   PowerStationStatusDataService powerStationStatusDataService;
-
+  private final String format = "yyyy-MM-dd HH:mm:ss";
   /**
    * 获取超短期预测功率,当数据库中超短期预测记录不足查询所需时,进行本地化计算,用于上报专用
    *
@@ -64,13 +64,13 @@ public class ForecastPowerUltraShortTermService extends BaseService {
   @SuppressWarnings("WeakerAccess")
   @Transactional(propagation = Propagation.REQUIRED)
   public List<ForecastPowerUltraShortTermHis> getForecastPowerUltraShortTerm(@NotNull final Long startTime, @NotNull final Long endTime, @NotNull final String stationCode) {
-    log.info(stationCode + "开始获取超短期实时预测功率" + DateFormatUtils.format(startTime, "yyyy-MM-dd HH:mm:ss") + " 至 " + DateFormatUtils.format(endTime, "yyyy-MM-dd HH:mm:ss"));
+    log.info(stationCode + "开始获取超短期实时预测功率" + DateFormatUtils.format(startTime, format) + " 至 " + DateFormatUtils.format(endTime, format));
     // 查询场站信息
     ElectricField electricFieldInfo = electricFieldService.getSingleStation(stationCode);
     // 查询预测时间点对应的开机容量
     Map<Long, BigDecimal> openCapacityMap = null;
     try {
-      openCapacityMap = super.queryOpenCapacity(startTime, endTime, electricFieldInfo.getCapacity(), stationCode);
+      openCapacityMap =  super.queryOpenCapacity(startTime, endTime, electricFieldInfo.getCapacity(), stationCode);
     } catch (BusinessException e) {
       log.error(stationCode + "超短期数据生成获取开机容量出错:" + CommonUtil.printStackTraceToString(e));
     }
@@ -154,7 +154,6 @@ public class ForecastPowerUltraShortTermService extends BaseService {
       forecastPowerUltraShortTermHis.setStationCode(stationCode);
       forecastPowerUltraShortTermHiss.add(forecastPowerUltraShortTermHis);
     }
-//    List<ForecastPowerUltraShortTermHis> forecastPowerUltraShortTermHiss = forecastPowerUltraShortTermHiss1.stream().filter(t -> t.getForecastHowLongAgo() <=16).collect(Collectors.toList());
     // 获取实际功率替换超短期点位参数
     int replacePoint;
     String realpower_replace_cdq = sysParameterService.getSysParameter("realpower_replace_cdq", "0", stationCode);
@@ -235,7 +234,7 @@ public class ForecastPowerUltraShortTermService extends BaseService {
             forecastPowerShortTermList.stream().collect(Collectors.groupingBy(ForecastPowerShortTerm::getForecastTime));
           Map<Long, BigDecimal> openCapacityMap = null;
           try {
-            openCapacityMap = super.queryOpenCapacity(startTime, endTime, electricField.getCapacity(), stationCode);
+            openCapacityMap =  super.queryOpenCapacity(startTime, endTime, electricField.getCapacity(), stationCode);
           } catch (BusinessException e) {
             log.error("预测数据生成获取开机容量出错:" + CommonUtil.printStackTraceToString(e));
           }
@@ -279,6 +278,7 @@ public class ForecastPowerUltraShortTermService extends BaseService {
     }
   }
 
+
   /**
    * 执行风电场超短期预测
    *
@@ -400,13 +400,13 @@ public class ForecastPowerUltraShortTermService extends BaseService {
     List<ForecastPowerUltraShortTermHis> list = forecastPowerUltraShortTermHisRepository.findByForecastTimeBetweenAndForecastHowLongAgo(startTime, endTime, ago);
     list.sort(Comparator.comparing(ForecastPowerUltraShortTermHis::getForecastTime));
     long timeStep = 900000L;
-    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+    SimpleDateFormat sdf = new SimpleDateFormat(format);
     List<String> times = new ArrayList<>();
     List<Float> datas = new ArrayList<>();
     if (startTime % timeStep != 0) {
       startTime = startTime - (startTime % timeStep) + timeStep;
     }
-    if (list != null && list.size() > 0) {
+    if ( list.size() > 0) {
       for (long i = startTime; i < endTime; i = i + timeStep) {
         long finalI = i;
         List<ForecastPowerUltraShortTermHis> filterList = list.stream().filter(t -> t.getForecastTime() == finalI).collect(Collectors.toList());

+ 0 - 91
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/HolidayCalendarService.java

@@ -1,91 +0,0 @@
-package com.jiayue.ipfcst.console.service;
-
-import com.jiayue.ipfcst.common.core.exception.BusinessException;
-import com.jiayue.ipfcst.common.data.entity.HolidayCalendar;
-import com.jiayue.ipfcst.common.data.repository.HolidayCalendarRepository;
-import com.jiayue.ipfcst.common.data.service.BaseService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.*;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Propagation;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.List;
-
-/**
- * 假期日历业务类
- *
- * @author tl
- * @version 1.0
- * @since 2020/03/11 9:49
- */
-@Service
-@Slf4j
-public class HolidayCalendarService extends BaseService {
-  private final HolidayCalendarRepository holidayCalendarRepository;
-
-  @Autowired
-  public HolidayCalendarService(HolidayCalendarRepository holidayCalendarRepository) {
-    this.holidayCalendarRepository = holidayCalendarRepository;
-  }
-
-  /**
-   * 新增假期日历信息
-   *
-   * @param holidayCalendar 假期日历信息
-   */
-  public void save(HolidayCalendar holidayCalendar)
-    throws BusinessException {
-    this.holidayCalendarRepository.save(holidayCalendar);
-  }
-
-  /**
-   * 删除假期日历信息
-   */
-  @Transactional(rollbackFor = Exception.class, propagation = Propagation.SUPPORTS)
-  public void delete(final Integer id) throws BusinessException {
-    this.holidayCalendarRepository.deleteById(id);
-  }
-
-  /**
-   * 修改假期日历信息
-   */
-  @Transactional(rollbackFor = Exception.class, propagation = Propagation.SUPPORTS)
-  public void update(HolidayCalendar holidayCalendar)
-    throws BusinessException {
-    if (holidayCalendar.getId() == null) {
-      throw new BusinessException("日历编号不能为空");
-    } else {
-      this.holidayCalendarRepository.save(holidayCalendar);
-    }
-  }
-
-  /**
-   * 分页查询
-   */
-  @Transactional(rollbackFor = Exception.class, propagation = Propagation.SUPPORTS, readOnly = true)
-  public Page<HolidayCalendar> get(
-    final HolidayCalendar holidayCalendar, final Integer page, final Integer size) {
-    ExampleMatcher matcher =
-      ExampleMatcher.matching().withMatcher("id", ExampleMatcher.GenericPropertyMatchers.contains());
-    Example<HolidayCalendar> example = Example.of(holidayCalendar, matcher);
-    Pageable pageable = PageRequest.of(page - 1, size);
-    return this.holidayCalendarRepository.findAll(example, pageable);
-
-  }
-
-
-  @Transactional(rollbackFor = Exception.class, propagation = Propagation.SUPPORTS, readOnly = true)
-  public List<HolidayCalendar> getAll() {
-
-    return this.holidayCalendarRepository.findAll();
-
-  }
-
-  @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
-  public void saveCloud(List<HolidayCalendar> beans) {
-    holidayCalendarRepository.deleteAll();
-    holidayCalendarRepository.saveAll(beans);
-  }
-}

+ 1 - 4
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/InverterInfoService.java

@@ -202,10 +202,7 @@ public class InverterInfoService extends BaseService {
 
   @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
   public void saveCloud(InverterInfo bean) {
-//        InverterInfo inverterInfo = inverterInfoRepository.findByName(bean.getName());
-//        if (null != inverterInfo) {
-//            bean.setId(inverterInfo.getId());
-//        }
+
     inverterInfoRepository.save(bean);
   }
 

+ 14 - 45
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/NwpService.java

@@ -9,7 +9,6 @@ import com.jiayue.ipfcst.common.data.repository.NwpHisRepository;
 import com.jiayue.ipfcst.common.data.repository.NwpRepository;
 import com.jiayue.ipfcst.common.data.service.BaseService;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang.time.DateFormatUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.PageRequest;
@@ -38,6 +37,9 @@ public class NwpService extends BaseService {
   @Autowired
   ElectricFieldService electricFieldService;
 
+  private final String fs100 = "ws100";
+  private final String fs170 = "ws170";
+  private final String preTime = "preTime";
   /**
    * 保存全部
    *
@@ -60,39 +62,6 @@ public class NwpService extends BaseService {
     nwpRepository.saveAll(listNwp);
   }
 
-  private Nwp createNwpData(Long preTime) {
-    long systemTime = System.currentTimeMillis();
-    Nwp nwpData = new Nwp();
-    nwpData.setFarmId("1");
-    nwpData.setScDate(DateFormatUtils.format(systemTime, "yyyy-MM-dd"));
-    nwpData.setScTime(DateFormatUtils.format(systemTime, "HH:mm:ss"));
-    nwpData.setPreTime(preTime);
-    nwpData.setPreDate(DateFormatUtils.format(preTime, "yyyy-MM-dd"));
-    nwpData.setPressure(BigDecimal.valueOf(CommonUtil.getRandom(1, 5000) / 10.0).setScale(2, RoundingMode.UP));
-    nwpData.setT(BigDecimal.valueOf(CommonUtil.getRandom(1, 5000) / 10.0).setScale(2, RoundingMode.UP));
-    nwpData.setRh(BigDecimal.valueOf(CommonUtil.getRandom(1, 5000) / 10.0).setScale(2, RoundingMode.UP));
-    nwpData.setSenf(BigDecimal.valueOf(CommonUtil.getRandom(1, 5000) / 10.0).setScale(2, RoundingMode.UP));
-    nwpData.setSwr(BigDecimal.valueOf(CommonUtil.getRandom(1, 5000) / 10.0).setScale(2, RoundingMode.UP));
-    nwpData.setLwr(BigDecimal.valueOf(CommonUtil.getRandom(1, 5000) / 10.0).setScale(2, RoundingMode.UP));
-
-    nwpData.setWd10(BigDecimal.valueOf(CommonUtil.getRandom(1, 5000) / 10.0).setScale(2, RoundingMode.UP));
-    nwpData.setWd30(BigDecimal.valueOf(CommonUtil.getRandom(1, 5000) / 10.0).setScale(2, RoundingMode.UP));
-    nwpData.setWd50(BigDecimal.valueOf(CommonUtil.getRandom(1, 5000) / 10.0).setScale(2, RoundingMode.UP));
-    nwpData.setWd70(BigDecimal.valueOf(CommonUtil.getRandom(1, 5000) / 10.0).setScale(2, RoundingMode.UP));
-    nwpData.setWd80(BigDecimal.valueOf(CommonUtil.getRandom(1, 5000) / 10.0).setScale(2, RoundingMode.UP));
-    nwpData.setWd90(BigDecimal.valueOf(CommonUtil.getRandom(1, 5000) / 10.0).setScale(2, RoundingMode.UP));
-    nwpData.setWd100(BigDecimal.valueOf(CommonUtil.getRandom(1, 5000) / 10.0).setScale(2, RoundingMode.UP));
-    nwpData.setWd170(BigDecimal.valueOf(CommonUtil.getRandom(1, 5000) / 10.0).setScale(2, RoundingMode.UP));
-    nwpData.setWs10(BigDecimal.valueOf(CommonUtil.getRandom(1, 5000) / 10.0).setScale(2, RoundingMode.UP));
-    nwpData.setWs30(BigDecimal.valueOf(CommonUtil.getRandom(1, 5000) / 10.0).setScale(2, RoundingMode.UP));
-    nwpData.setWs50(BigDecimal.valueOf(CommonUtil.getRandom(1, 5000) / 10.0).setScale(2, RoundingMode.UP));
-    nwpData.setWs70(BigDecimal.valueOf(CommonUtil.getRandom(1, 5000) / 10.0).setScale(2, RoundingMode.UP));
-    nwpData.setWs80(BigDecimal.valueOf(CommonUtil.getRandom(1, 5000) / 10.0).setScale(2, RoundingMode.UP));
-    nwpData.setWs90(BigDecimal.valueOf(CommonUtil.getRandom(1, 5000) / 10.0).setScale(2, RoundingMode.UP));
-    nwpData.setWs100(BigDecimal.valueOf(CommonUtil.getRandom(1, 5000) / 10.0).setScale(2, RoundingMode.UP));
-    nwpData.setWs170(BigDecimal.valueOf(CommonUtil.getRandom(1, 5000) / 10.0).setScale(2, RoundingMode.UP));
-    return nwpData;
-  }
 
 
   /**
@@ -157,8 +126,8 @@ public class NwpService extends BaseService {
       datas.put("ws70", ws70Collect);
       datas.put("ws80", ws80Collect);
       datas.put("ws90", ws90Collect);
-      datas.put("ws100", ws100Collect);
-      datas.put("ws170", ws170Collect);
+      datas.put(fs100, ws100Collect);
+      datas.put(fs170, ws170Collect);
       Map<String, String> map1 = new HashMap<>();
       map1.put("ws10", "10米风速");
       map1.put("ws30", "30米风速");
@@ -166,8 +135,8 @@ public class NwpService extends BaseService {
       map1.put("ws70", "70米风速");
       map1.put("ws80", "80米风速");
       map1.put("ws90", "90米风速");
-      map1.put("ws100", "100米风速");
-      map1.put("ws170", "170米风速");
+      map1.put(fs100, "100米风速");
+      map1.put(fs170, "170米风速");
       map.put("cName", map1);
       map.put("stationType", "0");
     }
@@ -273,11 +242,11 @@ public class NwpService extends BaseService {
       List<Predicate> predicates = new ArrayList<>();
       if (startTime != null) {
         //大于或等于传入时间
-        predicates.add(cb.greaterThanOrEqualTo(root.get("preTime").as(Long.class), startTime));
+        predicates.add(cb.greaterThanOrEqualTo(root.get(preTime).as(Long.class), startTime));
       }
       if (endTime != null) {
         //小于传入时间
-        predicates.add(cb.lessThan(root.get("preTime").as(Long.class), endTime));
+        predicates.add(cb.lessThan(root.get(preTime).as(Long.class), endTime));
       }
       predicates.add(cb.equal(root.get("stationCode").as(String.class), stationCode));
       //添加排序的功能
@@ -288,9 +257,9 @@ public class NwpService extends BaseService {
 
   public Map<String, Object> findByTimeBetweenAndNoForPaging(Long startTime, Long endTime, String stationCode, Integer page, Integer size, String sortOrder) {
     Map<String, Object> map = new HashMap<>();
-    Sort sort = Sort.by(Sort.Direction.DESC, "preTime");
+    Sort sort = Sort.by(Sort.Direction.DESC, preTime);
     if (sortOrder.contains("asc")) {
-      sort = Sort.by(Sort.Direction.ASC, "preTime");
+      sort = Sort.by(Sort.Direction.ASC, preTime);
     }
     Specification<Nwp> specification = specificationFindByTimeAndNo(startTime, endTime, stationCode);
     Pageable pageable = PageRequest.of(page - 1, size, sort);
@@ -301,7 +270,7 @@ public class NwpService extends BaseService {
     map.put("content", datas);
     map.put("count", nwps.getTotalElements());
     Map<String, String> map1 = new HashMap<>();
-    map1.put("preTime", "预测时间");
+    map1.put(preTime, "预测时间");
     map1.put("scTime", "生成时间");
     map1.put("pressure", "气压");
     map1.put("t", "温度");
@@ -316,8 +285,8 @@ public class NwpService extends BaseService {
     map1.put("ws70", "70米风速");
     map1.put("ws80", "80米风速");
     map1.put("ws90", "90米风速");
-    map1.put("ws100", "100米风速");
-    map1.put("ws170", "170米风速");
+    map1.put(fs100, "100米风速");
+    map1.put(fs170, "170米风速");
     map1.put("wd10", "10米风向");
     map1.put("wd30", "30米风向");
     map1.put("wd50", "50米风向");

+ 0 - 2
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/OverHaulPlanService.java

@@ -75,7 +75,6 @@ public class OverHaulPlanService {
    * 查询检修计划信息(分页)
    */
   public Page<OverhaulPlan> get(final OverhaulPlan overhaulPlan, final Integer page, final Integer size) {
-//    getAll();
     ExampleMatcher matcher =
       ExampleMatcher.matching().withMatcher("id", ExampleMatcher.GenericPropertyMatchers.contains());
     Example<OverhaulPlan> example = Example.of(overhaulPlan, matcher);
@@ -88,7 +87,6 @@ public class OverHaulPlanService {
    * 查询检修计划信息(分页)
    */
   public Page<OverhaulPlan> getByStationCode(final OverhaulPlan overhaulPlan, final Integer page, final Integer size, final String stationCode) {
-//    getAll();
     overhaulPlan.setStationCode(stationCode);
     ExampleMatcher matcher =
       ExampleMatcher.matching().withMatcher("id", ExampleMatcher.GenericPropertyMatchers.contains())

+ 7 - 8
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/PowerStationDataPacker.java

@@ -107,7 +107,7 @@ public class PowerStationDataPacker {
   List<Field> fields = new ArrayList<>();
   @Setter
   @Getter
-  private PowerStationStatusData t = new PowerStationStatusData();
+  private Class<PowerStationStatusData> t = PowerStationStatusData.class;
   /**
    * 场站信息
    */
@@ -176,10 +176,8 @@ public class PowerStationDataPacker {
     }
     //对日升和日落各宽恕30min  如果在日升前30min到 日落后30min 之间
     //如果时间处于日出前30分钟    日落后30分钟   则判定功率为0
-    if (electricField != null && ElectricFieldTypeEnum.E1.equals(electricField.getElectricFieldTypeEnum())) {
-      if (time.isBefore(getSunUpTime().minusMillis(30)) || time.isAfter(getSunDownTime().plusMillis(30))) {
-        power = BigDecimal.ZERO;
-      }
+    if (electricField != null && ElectricFieldTypeEnum.E1.equals(electricField.getElectricFieldTypeEnum()) && time.isBefore(getSunUpTime().minusMillis(30)) || time.isAfter(getSunDownTime().plusMillis(30))) {
+      power = BigDecimal.ZERO;
     }
     return power;
   }
@@ -201,6 +199,7 @@ public class PowerStationDataPacker {
         } else {
           log.info("{}样板机方式计算参考值为空返回倍率计算方式",electricField.getName());
         }
+        break;
       case "2":
         log.info("{}使用测风/光法方式计算参考值",electricField.getName());
         if (powerStationStatusData.getReferencePowerByMeasuring() != null) {
@@ -208,7 +207,9 @@ public class PowerStationDataPacker {
         } else {
           log.info("{}测风/光法方式计算参考值为空返回倍率计算方式",electricField.getName());
         }
+        break;
       default:
+        break;
     }
     log.info("{}不判断限电,直接判断不限电",electricField.getName());
     return BigDecimal.valueOf(-99);
@@ -260,7 +261,7 @@ public class PowerStationDataPacker {
    * 初始化实体域集合
    */
   private void initEntityFields() {
-    fields.addAll(Arrays.asList(t.getClass().getDeclaredFields()));
+    fields.addAll(Arrays.asList(t.getDeclaredFields()));
     fields.addAll(Arrays.asList(AbstractEquipmentStatusData.class.getDeclaredFields()));
     for (Field f : fields) {
       f.setAccessible(true);
@@ -427,7 +428,6 @@ public class PowerStationDataPacker {
       powerStationStatusData.setOffSiteObstructed(powerStationStatusData.getAbleValue().subtract(powerStationStatusData.getRealValue()));
     } catch (Exception e) {
       log.error("{}组装场站状态数据时发生异常",electricField.getName(), e);
-      throw new RuntimeException(electricField.getName()+"组装场站状态数据时发生异常");
     }
 
     if (powerStationStatusData.getAbleValue().compareTo(BigDecimal.valueOf(-99)) == 0) {
@@ -551,7 +551,6 @@ public class PowerStationDataPacker {
         this.compiledExp = AviatorEvaluator.compile(formula);
       } catch (ExpressionSyntaxErrorException e) {
         log.error("{}公式解析失败,公式不可用",electricField.getName(), e);
-        throw new RuntimeException(electricField.getName()+"公式解析失败,公式不可用");
       }
       if (electricField.getElectricFieldTypeEnum() == ElectricFieldTypeEnum.E1) {
         WeatherStationInfoService weatherStationInfoService = SpringContextHolder.getBean(WeatherStationInfoService.class);

+ 1 - 16
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/PowerStationStatusDataService.java

@@ -37,7 +37,7 @@ public class PowerStationStatusDataService extends BaseService {
   @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
   public Map<String, Object> findByTimeBetweenForContrast(Date startTime, Date endTime, Long timeStep) {
     Map<String, Object> map = new HashMap<>();
-    List<PowerStationStatusData> list = new ArrayList<>();
+    List<PowerStationStatusData> list ;
 
     list = powerStationStatusDataRepository.findByTimeBetween(startTime, endTime);
 
@@ -179,22 +179,7 @@ public class PowerStationStatusDataService extends BaseService {
       resultList.add(map);
 
     }
-
-//    Sort sort = Sort.by(Sort.Direction.DESC, "time");
-//    if (sortOrder.contains("asc")) {
-//      sort = Sort.by(Sort.Direction.ASC, "time");
-//    }
-//    Specification<PowerStationStatusData> specification = this.Specification(startTime, endTime);
-//    Pageable pageable = PageRequest.of(page - 1, size, sort);
-//    Page pages = powerStationStatusDataRepository.findAll(specification, pageable);
-//    List<PowerStationStatusData> datas = new ArrayList<>();
-//    datas = pages.getContent();
-//    map.put("content", datas);
-//    map.put("count", pages.getTotalElements());
-
     return resultList;
-
-
   }
 
   /**

+ 0 - 4
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/PvModuleModelService.java

@@ -113,10 +113,6 @@ public class PvModuleModelService extends BaseService {
 
   @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
   public void saveCloud(PvModuleModel bean) {
-//        PvModuleModel beanOld = pvModuleModelRepository.findByModel(bean.getModel());
-//        if (null != beanOld) {
-//            bean.setId(beanOld.getId());
-//        }
     pvModuleModelRepository.save(bean);
   }
 

+ 27 - 27
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/QuartzService.java

@@ -1,5 +1,7 @@
 package com.jiayue.ipfcst.console.service;
 
+import com.jiayue.ipfcst.common.core.exception.BusinessException;
+import com.jiayue.ipfcst.common.data.entity.InverterInfo;
 import com.jiayue.ipfcst.common.data.entity.Quartz;
 import com.jiayue.ipfcst.common.data.repository.QuartzRepository;
 import com.jiayue.ipfcst.common.data.service.BaseService;
@@ -22,10 +24,7 @@ import javax.persistence.criteria.Predicate;
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * 定时逻辑
@@ -80,9 +79,8 @@ public class QuartzService extends BaseService {
       flag = updateState(qt);
     } catch (Exception e) {
       log.error("系统错误", e);
-    } finally {
-      return flag;
     }
+    return flag;
   }
 
   /**
@@ -99,23 +97,31 @@ public class QuartzService extends BaseService {
         String[] id = ids.split(",");
         if (null != id && id.length > 0) {
           for (String did : id) {
-            Quartz quartz = quartzRepository.findById(Integer.parseInt(did)).get();
+            Optional<Quartz> optional = quartzRepository.findById(Integer.parseInt(did));
+            if (optional.isPresent()) {
+              Quartz quartz = optional.get();
+              deleteJob(quartz.getJobName());
+              quartzRepository.delete(quartz);
+            } else {
+              throw new BusinessException("定时任务不存在!");
+            }
+          }
+        } else {
+          Optional<Quartz> optional = quartzRepository.findById(Integer.parseInt(ids));
+          if (optional.isPresent()) {
+            Quartz quartz = optional.get();
             deleteJob(quartz.getJobName());
             quartzRepository.delete(quartz);
+          } else {
+            throw new BusinessException("定时任务不存在!");
           }
-        } else {
-          Quartz quartz = quartzRepository.findById(Integer.parseInt(ids)).get();
-          deleteJob(quartz.getJobName());
-          quartzRepository.delete(quartz);
-
         }
         flag = true;
       }
     } catch (Exception e) {
       log.error("系统错误", e);
-    } finally {
-      return flag;
     }
+    return flag;
   }
 
   /**
@@ -135,7 +141,7 @@ public class QuartzService extends BaseService {
     Pageable pageable = PageRequest.of(page - 1, size); //页码:前端从1开始,jpa从0开始,做个转换
     Page pageUser = quartzRepository.findAll(specification, pageable);
     List<Quartz> quartzs = pageUser.getContent();// 结果集
-    if (null != quartzs && quartzs.size() > 0) {
+    if ( quartzs.size() > 0) {
       for (Quartz quartz : quartzs) {
         quartz.setJobState(getJobStatus(quartz.getJobName()));
         quartz.setLaetFireTime(getJobPreviousFireTime(quartz.getJobName()));
@@ -150,7 +156,7 @@ public class QuartzService extends BaseService {
   @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
   public List<Quartz> getAll() throws SchedulerException {
     List<Quartz> quartzs = quartzRepository.findAll();
-    if (null != quartzs && quartzs.size() > 0) {
+    if (quartzs.size() > 0) {
       for (Quartz quartz : quartzs) {
         quartz.setJobState(getJobStatus(quartz.getJobName()));
         quartz.setLaetFireTime(getJobPreviousFireTime(quartz.getJobName()));
@@ -185,11 +191,11 @@ public class QuartzService extends BaseService {
 
       Class c = Class.forName(quartz.getExecuteClass());
       c.newInstance();
-      if (quartz.getCronExpression().indexOf(" ") != -1) {
+      if (quartz.getCronExpression().indexOf(' ') != -1) {
         scheduleJob(c, quartz.getJobName(), quartz.getStartTime(), quartz.getCronExpression(), null);
       } else {
         scheduleJob(c, quartz.getJobName(), quartz.getStartTime(),
-          Long.valueOf(Integer.parseInt(quartz.getCronExpression()) * 1000), null);
+          Long.valueOf(Integer.parseInt(quartz.getCronExpression()) * 1000L), null);
       }
 
       if (quartz.getJobState().equals("暂停")) {
@@ -206,9 +212,8 @@ public class QuartzService extends BaseService {
 
     } catch (Exception e) {
       log.error("系统错误" + e);
-    } finally {
-      return flag;
     }
+    return flag;
   }
 
   /**
@@ -219,13 +224,8 @@ public class QuartzService extends BaseService {
     Connection connection = null;
 
     try {
-      String driverClassName = this.driverClassName;
-      String url = this.url;
-      String username = this.username;
-      String password = this.password;
-
-      Class.forName(driverClassName);
-      connection = DriverManager.getConnection(url, username, password);
+      Class.forName(this.driverClassName);
+      connection = DriverManager.getConnection(this.url, this.username, this.password);
 
       ClassPathResource rc = new ClassPathResource("sql/jobload/E63_JOB.sql");
       EncodedResource er = new EncodedResource(rc, "utf-8");

+ 33 - 4
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/ReceiveDataService.java

@@ -10,6 +10,7 @@ import com.jiayue.ipfcst.common.data.entity.*;
 import com.jiayue.ipfcst.common.data.repository.*;
 import com.jiayue.ipfcst.console.util.RedisUtils;
 import org.apache.http.HttpEntity;
+import org.apache.http.client.config.RequestConfig;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpPost;
 import org.apache.http.entity.StringEntity;
@@ -21,6 +22,8 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+
+import java.io.IOException;
 import java.math.BigDecimal;
 import java.nio.charset.StandardCharsets;
 import java.text.SimpleDateFormat;
@@ -69,8 +72,14 @@ public class ReceiveDataService {
   private  String port;
   @Value("${receive.path}")
   private  String path;
+  private  final String Active = "activePower";
+
+  //请求超时时间,这个时间定义了socket读数据的超时时间,也就是连接到服务器之后到从服务器获取响应数据需要等待的时间,发生超时,会抛出SocketTimeoutException异常。
+  private static final int SOCKET_TIME_OUT = 5000;
+  //连接超时时间,这个时间定义了通过网络与服务器建立连接的超时时间,也就是取得了连接池中的某个连接之后到接通目标url的连接等待时间。发生超时,会抛出ConnectionTimeoutException异常
+  private static final int CONNECT_TIME_OUT = 3000;
+
 
-  private  String Active = "activePower";
   public void receive() {
     List<ElectricField> electricFieldList = electricFieldService.getAll();
     //每个场站请求一次
@@ -232,9 +241,8 @@ public class ReceiveDataService {
       }else {
         log.info(electricField.getStationCode()+ "-" +equipmentType.getMessage() + "-" + equipmentId+"无数据,不进行任何操作");
       }
-
     } catch (Exception e) {
-      log.info("接数程序异常");
+      log.info(electricField.getName()+equipmentType.getMessage()+"接数程序异常");
       e.printStackTrace();
     }
   }
@@ -251,13 +259,20 @@ public class ReceiveDataService {
       HttpPost httpPost = new HttpPost("http://"+ip+":"+port+path);
       StringEntity entity = new StringEntity(JSON.toJSONString(paramMap),"UTF-8");
       httpPost.setEntity(entity);
+      //设置请求超时时间,链接超时时间
+      RequestConfig reqConfig = RequestConfig.custom().setSocketTimeout(SOCKET_TIME_OUT).setConnectTimeout(CONNECT_TIME_OUT).build();
+      httpPost.setConfig(reqConfig);
       httpPost.setHeader("Content-Type", "application/json; charset=utf-8");
       CloseableHttpResponse response;
       response = httpClient.execute(httpPost);
       HttpEntity responseEntity = response.getEntity();
       body = EntityUtils.toString(responseEntity, StandardCharsets.UTF_8);
-    }catch (Exception e){
+    }catch (RuntimeException | IOException e){
       e.printStackTrace();
+      log.info("请求异常");
+      log.info("所用线程"+Thread.currentThread().getName());
+      log.info("停止请求数据");
+      Thread.currentThread().stop();
     }
     return body;
   }
@@ -298,4 +313,18 @@ public class ReceiveDataService {
       e.printStackTrace();
     }
   }
+  public  void stop(){
+    Thread thread = new Thread(() -> {
+      while (Thread.currentThread().isInterrupted()) {
+        log.info("停止请求数据");
+      }
+    });
+    thread.start();
+    try {
+      Thread.sleep(1);
+    } catch (Exception e) {
+      e.printStackTrace();
+    }
+    thread.interrupt();
+  }
 }

+ 116 - 0
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/SysAlarmService.java

@@ -0,0 +1,116 @@
+package com.jiayue.ipfcst.console.service;
+
+import com.jiayue.ipfcst.common.data.constant.enums.AlarmTypeEnum;
+import com.jiayue.ipfcst.common.data.entity.SysAlarm;
+import com.jiayue.ipfcst.common.data.repository.SysAlarmRepository;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.*;
+import org.springframework.data.jpa.domain.Specification;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.persistence.criteria.Predicate;
+import java.util.ArrayList;
+import java.util.List;
+
+@Service
+@Slf4j
+public class SysAlarmService {
+    private final SysAlarmRepository sysAlarmRepository;
+
+    @Autowired
+    public SysAlarmService(SysAlarmRepository sysAlarmRepository) {
+        this.sysAlarmRepository = sysAlarmRepository;
+    }
+
+    /**
+     * 插入告警信息
+     *
+     * @param
+     */
+    @Transactional(propagation = Propagation.SUPPORTS)
+    public void save(SysAlarm sysAlarm) {
+
+        this.sysAlarmRepository.save(sysAlarm);
+    }
+
+    /**
+     * 删除告警信息
+     */
+    @Transactional(propagation = Propagation.SUPPORTS)
+    public void delete(Integer id) {
+        sysAlarmRepository.deleteById(id);
+    }
+
+    /**
+     * 查询告警信息
+     *
+     * @return 告警信息
+     */
+    @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
+    public Page<SysAlarm> get(
+            final SysAlarm sysAlarm, final Integer page, final Integer size) {
+      List<Sort.Order> orders = new ArrayList<Sort.Order>();
+
+      orders.add(new Sort.Order(Sort.Direction.DESC, "createTime"));
+
+
+      Sort sort = Sort.by(orders);
+      Specification<SysAlarm> specification = this.specification();
+      Pageable pageable = PageRequest.of(page - 1, size, sort);
+      Page windTurbineStatusDatas = sysAlarmRepository.findAll(specification,pageable);
+
+      return windTurbineStatusDatas;
+    }
+
+  /**
+   * 根据时间和编号 分页查询条件 yh
+   *
+   * @return 过滤条件
+   */
+  Specification<SysAlarm> specification() {
+    return (Specification<SysAlarm>) (root, criteriaQuery, cb) -> {
+      List<Predicate> predicates = new ArrayList<>();
+      //添加排序的功能
+      return cb.and(predicates.toArray(new Predicate[predicates.size()]));
+
+    };
+  }
+
+    /**
+      * 查询告警信息
+     *
+       * @return 告警信息
+     */
+  @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
+  public List<SysAlarm> getAll(){
+    return this.sysAlarmRepository.findAll();
+  }
+
+    public static void main(String[] args) {
+        String val = "http://www.163.com?id=";
+        for (int i = 1; i < 97; i++) {
+            val = val + i + ":20.22|";
+        }
+        System.out.println(val);
+    }
+
+  /**
+   * 根据描述查询告警信息
+   *
+   * @return 告警信息
+   */
+  @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
+  public Page<SysAlarm> getForNameAndAlarmTypeEnum(SysAlarm sysAlarm, Integer page, Integer size, AlarmTypeEnum alarmTypeEnum){
+    sysAlarm.setAlarmTypeEnum(alarmTypeEnum);
+    ExampleMatcher matcher = ExampleMatcher.matching().withMatcher("modelNumber", ExampleMatcher.GenericPropertyMatchers.contains())
+      .withMatcher("alarmTypeEnum", ExampleMatcher.GenericPropertyMatchers.contains());
+    Example<SysAlarm> example = Example.of(sysAlarm, matcher);
+    Pageable pageable = PageRequest.of(page - 1, size);
+    return this.sysAlarmRepository.findAll(example, pageable);
+  }
+
+
+}

+ 1 - 4
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/WeatherStationInfoService.java

@@ -121,10 +121,7 @@ public class WeatherStationInfoService extends BaseService {
 
   @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
   public void saveCloud(WeatherStationInfo bean) {
-//        WeatherStationInfo weatherStationInfo = weatherStationInfoRepository.findByName(bean.getName());
-//        if (null != weatherStationInfo) {
-//            bean.setId(weatherStationInfo.getId());
-//        }
+
     weatherStationInfoRepository.save(bean);
   }
 

+ 1 - 4
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/WindTowerInfoService.java

@@ -146,10 +146,7 @@ public class WindTowerInfoService extends BaseService {
 
   @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
   public void saveCloud(WindTowerInfo bean) {
-//        WindTowerInfo windTowerInfo = windTowerInfoRepository.findByName(bean.getName());
-//        if (null != windTowerInfo) {
-//            bean.setId(windTowerInfo.getId());
-//        }
+
     windTowerInfoRepository.save(bean);
   }
 

+ 2 - 2
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/WindTowerStatusDataService.java

@@ -120,8 +120,8 @@ public class WindTowerStatusDataService extends BaseService {
    */
   public List<String> getWindTowerStatusDataAttributeName() {
     List<String> attributeName = new ArrayList<>();
-    WindTowerStatusData windTowerStatusData = new WindTowerStatusData();
-    Class c = windTowerStatusData.getClass();
+    Class<WindTowerStatusData> windTowerStatusData = WindTowerStatusData.class;
+    Class c = windTowerStatusData;
     Field[] fs = c.getDeclaredFields();
     for (Field f : fs) {
       attributeName.add(f.getName());

+ 3 - 16
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/WindTurbineInfoService.java

@@ -44,12 +44,7 @@ public class WindTurbineInfoService extends BaseService {
   @Transactional(propagation = Propagation.SUPPORTS)
   public void add(WindTurbineInfo windTurbine) throws BusinessException {
     this.windTurbineInfoRepository.save(windTurbine);
-//        boolean b = this.windTurbineRepository.existsById(windTurbine.getNo());
-//        if (b) {// 编号已存在
-//            throw new BusinessException("风机编号已存在!");
-//        } else {
-//            this.windTurbineRepository.save(windTurbine);
-//        }
+
   }
 
   /**
@@ -160,10 +155,7 @@ public class WindTurbineInfoService extends BaseService {
 
   @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
   public void saveCloud(WindTurbineInfo bean) {
-//        WindTurbineInfo beanOld = windTurbineInfoRepository.findByName(bean.getName());
-//        if (null != beanOld) {
-//            bean.setId(beanOld.getId());
-//        }
+
     windTurbineInfoRepository.save(bean);
   }
 
@@ -217,12 +209,7 @@ public class WindTurbineInfoService extends BaseService {
     }
 
 
-//        boolean b = this.inverterRepository.existsById(inverter.getNo());
-//        if (b) {// 逆变器编号已存在
-//            throw new BusinessException("逆变器编号已存在!");
-//        } else {
-//
-//        }
+
   }
 
   /**

+ 4 - 4
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/WindTurbineStatusDataService.java

@@ -34,7 +34,7 @@ public class WindTurbineStatusDataService {
     this.windTurbineStatusDataRepository = windTurbineStatusDataRepository;
   }
 
-
+  private final String equipmentNo = "equipmentNo";
   /**
    * 根据时间和编号 分页查询 逆变器数据 yh
    *
@@ -61,9 +61,9 @@ public class WindTurbineStatusDataService {
     }
 
     if (noSortOrder.contains("asc")) {
-      orders.add(new Sort.Order(Sort.Direction.ASC, "equipmentNo"));
+      orders.add(new Sort.Order(Sort.Direction.ASC, equipmentNo));
     } else {
-      orders.add(new Sort.Order(Sort.Direction.DESC, "equipmentNo"));
+      orders.add(new Sort.Order(Sort.Direction.DESC, equipmentNo));
     }
 
     Sort sort = Sort.by(orders);
@@ -98,7 +98,7 @@ public class WindTurbineStatusDataService {
         predicates.add(cb.lessThan(root.get("time").as(Date.class), endTime));
       }
       if (no != null) {
-        CriteriaBuilder.In<Integer> in = cb.in(root.get("equipmentNo"));
+        CriteriaBuilder.In<Integer> in = cb.in(root.get(equipmentNo));
         for (Integer integer : no) {
           in.value(integer);
         }

+ 8 - 18
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/util/CreateConsoleSh.java

@@ -7,7 +7,6 @@ import org.apache.velocity.runtime.RuntimeConstants;
 import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
 
 import java.io.FileOutputStream;
-import java.io.IOException;
 import java.io.StringWriter;
 import java.nio.charset.StandardCharsets;
 
@@ -20,8 +19,6 @@ import java.nio.charset.StandardCharsets;
 public class CreateConsoleSh {
   public static void main(String[] args) {
     System.out.println("==============执行console的启动sh文件生成=============");
-    FileOutputStream os = null;
-    try {
       VelocityEngine ve = new VelocityEngine();
       ve.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath");
       ve.setProperty("classpath.resource.loader.class", ClasspathResourceLoader.class.getName());
@@ -31,21 +28,14 @@ public class CreateConsoleSh {
       ctx.put("version", args[0]);
       StringWriter sw = new StringWriter();
       t.merge(ctx, sw);
-      os = new FileOutputStream("../syjy/ipfcstV3/bin/start-console.sh");
-      // 采用UTF-8字符集
-      os.write(sw.toString().getBytes(StandardCharsets.UTF_8));
-      os.flush();
-    } catch (IOException e) {
-      e.printStackTrace();
-    } finally {
-      if (os != null) {
-        try {
-          os.close();
-        } catch (IOException e) {
-          //noinspection ThrowablePrintedToSystemOut
-          System.out.println(e);
-        }
+      try (FileOutputStream os = new FileOutputStream("../syjy/ipfcstV3/bin/start-console.sh");){
+        // 采用UTF-8字符集
+        os.write(sw.toString().getBytes(StandardCharsets.UTF_8));
+        os.flush();
+      }
+      catch (Exception e){
+        System.out.println("生成console启动脚本文件失败");
+        e.printStackTrace();
       }
-    }
   }
 }

+ 5 - 14
ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/IEC102/Base102Service.java

@@ -179,16 +179,15 @@ public class Base102Service {
    * @return
    */
   public String createFileMessageHex(String filePath, String charsetName, Logger log) {
-    InputStreamReader isr = null;
+
     String fileMessageHex = "";
-    try {
-      isr = new InputStreamReader(new FileInputStream(filePath), StandardCharsets.UTF_8);
-      StringBuilder sb = new StringBuilder();
-      int len1;
+
+    try (InputStreamReader isr = new InputStreamReader(new FileInputStream(filePath), "UTF-8");){
+      StringBuffer sb = new StringBuffer("");
+      int len1 = 0;
       while ((len1 = isr.read()) != -1) {
         sb.append((char) len1);
       }
-      isr.close();
 
       String str = sb.toString();
       fileMessageHex = ByteUtil.Byte2String(str.getBytes(charsetName));
@@ -208,14 +207,6 @@ public class Base102Service {
 //      osw.close();
     } catch (Exception e) {
       log.error("读取本地文件失败", e);
-    } finally {
-      if (isr != null) {
-        try {
-          isr.close();
-        } catch (IOException e) {
-          e.printStackTrace();
-        }
-      }
     }
     return fileMessageHex;
   }

+ 6 - 2
ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/IEC102/ServerFor102StandardService.java

@@ -88,7 +88,9 @@ public class ServerFor102StandardService extends Base102Service {
           for (Map.Entry<String, FileMutableInteger> entry : filterMap.entrySet()) {
             fileNameKey = entry.getKey();
             log.info(ctx.channel().remoteAddress() + " - " + "上传文件===>" + entry.getKey());
-            break;
+            if (!fileNameKey.isEmpty()){
+              break;
+            }
           }
         } else {
           // 从待上报的缓存中取一个文件放入次数变量中
@@ -99,7 +101,9 @@ public class ServerFor102StandardService extends Base102Service {
             FileConstant.uploadCountMap.put(entry.getKey(), fileMutableInteger);
             log.info(ctx.channel().remoteAddress() + " - " + "找到文件===>" + entry.getKey());
             fileNameKey = entry.getKey();
-            break;
+            if (!fileNameKey.isEmpty()){
+              break;
+            }
           }
         }
         if ("".equals(fileNameKey)) {

+ 5 - 3
ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/controller/UploadFileLogController.java

@@ -23,6 +23,8 @@ public class UploadFileLogController {
 
   private final UploadFileLogService uploadFileLogService;
 
+  static String MESSAGE = "message";
+
   @Autowired
   public UploadFileLogController(UploadFileLogService uploadFileLogService) {
     this.uploadFileLogService = uploadFileLogService;
@@ -50,7 +52,7 @@ public class UploadFileLogController {
     for (FileStatusEnum fileStatusEnum : FileStatusEnum.values()) {
       Map<String, String> map = new HashMap<>();
       map.put("name", fileStatusEnum.name());
-      map.put("message", fileStatusEnum.getMessage());
+      map.put(MESSAGE, fileStatusEnum.getMessage());
       list.add(map);
     }
     return ResponseVO.success(list);
@@ -62,7 +64,7 @@ public class UploadFileLogController {
     for (UploadProtocolEnum uploadProtocolEnum : UploadProtocolEnum.values()) {
       Map<String, String> map = new HashMap<>();
       map.put("name", uploadProtocolEnum.name());
-      map.put("message", uploadProtocolEnum.getMessage());
+      map.put(MESSAGE, uploadProtocolEnum.getMessage());
       list.add(map);
     }
     return ResponseVO.success(list);
@@ -74,7 +76,7 @@ public class UploadFileLogController {
     for (FileTypeEnum fileTypeEnum : FileTypeEnum.values()) {
       Map<String, String> map = new HashMap<>();
       map.put("name", fileTypeEnum.name());
-      map.put("message", fileTypeEnum.getMessage());
+      map.put(MESSAGE, fileTypeEnum.getMessage());
       list.add(map);
     }
     return ResponseVO.success(list);

+ 2 - 10
ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/service/BaseUploadFileService.java

@@ -114,9 +114,8 @@ public abstract class BaseUploadFileService extends BaseService {
    * @param uploadFileEndTime
    */
   protected void copyUploadFile(StringWriter writer, File file, String fileType, Long uploadFileEndTime, Date createTime, String stationCode) {
-    FileOutputStream os = null;
-    try {
-      os = new FileOutputStream(file);
+    try (
+      FileOutputStream os = new FileOutputStream(file);) {
       // 采用UTF-8字符集
       os.write(writer.toString().getBytes(StandardCharsets.UTF_8));
       os.flush();
@@ -125,13 +124,6 @@ public abstract class BaseUploadFileService extends BaseService {
     } catch (IOException e) {
       throw new RuntimeException(e);
     } finally {
-      if (os != null) {
-        try {
-          os.close();
-        } catch (IOException e) {
-          log.error("文件生成关闭流失败", e);
-        }
-      }
       try {
         FileUtils.forceDelete(file.getParentFile());
       } catch (IOException e) {

+ 160 - 140
ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/service/E63UploadFileService.java

@@ -1,6 +1,7 @@
 package com.jiayue.ipfcst.fileupload.service;
 
 import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSON;
 import com.jiayue.ipfcst.common.core.exception.BusinessException;
 import com.jiayue.ipfcst.common.core.util.DateMomentUtil;
 import com.jiayue.ipfcst.common.data.abst.equipmentinfo.AbstractEquipmentInfo;
@@ -106,7 +107,7 @@ public class E63UploadFileService extends BaseUploadFileService {
       try {
         Template template;
         // 获取短期模板
-        if (electricFieldInfo.getElectricFieldTypeEnum().equals("E1")) {
+        if (electricFieldInfo.getElectricFieldTypeEnum().toString().equals("E1")) {
           template = this.velocityEngine.getTemplate(this.vmsPath + "/DQ.vm");
         } else {
           template = this.velocityEngine.getTemplate(this.vmsPath + "/DQ_F.vm");
@@ -147,7 +148,7 @@ public class E63UploadFileService extends BaseUploadFileService {
             //场站装机容量
             velocityContext.put("capacity", electricFieldInfo.getCapacity());
             //系统当前日期
-            if (electricFieldInfo.getElectricFieldTypeEnum().equals("E1")) {
+            if (electricFieldInfo.getElectricFieldTypeEnum().toString().equals("E1")) {
               velocityContext.put("currentTime", DateFormatUtils.format(systemDate, "yyyy-MM-dd_" + "00:00:00"));
             } else {
               velocityContext.put("currentTime", DateFormatUtils.format(systemDate, "yyyy-MM-dd " + "00:00"));
@@ -186,7 +187,7 @@ public class E63UploadFileService extends BaseUploadFileService {
       try {
         Template template;
         // 获取短期模板
-        if (electricFieldInfo.getElectricFieldTypeEnum().equals("E1")) {
+        if (electricFieldInfo.getElectricFieldTypeEnum().toString().equals("E1")) {
           template = this.velocityEngine.getTemplate(this.vmsPath + "/DQ_USE.vm");
         } else {
           template = this.velocityEngine.getTemplate(this.vmsPath + "/DQ_USE_F.vm");
@@ -259,7 +260,7 @@ public class E63UploadFileService extends BaseUploadFileService {
       try {
         Template template;
         // 获取短期模板
-        if (electricFieldInfo.getElectricFieldTypeEnum().equals("E1")) {
+        if (electricFieldInfo.getElectricFieldTypeEnum().toString().equals("E1")) {
           template = this.velocityEngine.getTemplate(this.vmsPath + "/CDQ.vm");
         } else {
           template = this.velocityEngine.getTemplate(this.vmsPath + "/CDQ_F.vm");
@@ -301,7 +302,7 @@ public class E63UploadFileService extends BaseUploadFileService {
             // 场站装机容量
             velocityContext.put("capacity", electricFieldInfo.getCapacity());
             // 系统当前日期
-            if (electricFieldInfo.getElectricFieldTypeEnum().equals("E1")) {
+            if (electricFieldInfo.getElectricFieldTypeEnum().toString().equals("E1")) {
               velocityContext.put("currentTime", DateFormatUtils.format(systemDate, "yyyy-MM-dd_HH:mm" + ":00"));
             } else {
               velocityContext.put("currentTime", DateFormatUtils.format(systemDate, "yyyy-MM-dd HH:mm" + ":00"));
@@ -339,7 +340,7 @@ public class E63UploadFileService extends BaseUploadFileService {
       try {
         Template template;
         // 获取短期模板
-        if (electricFieldInfo.getElectricFieldTypeEnum().equals("E1")) {
+        if (electricFieldInfo.getElectricFieldTypeEnum().toString().equals("E1")) {
           template = this.velocityEngine.getTemplate(this.vmsPath + "/CDQ_USE.vm");
         } else {
           template = this.velocityEngine.getTemplate(this.vmsPath + "/CDQ_USE_F.vm");
@@ -384,7 +385,7 @@ public class E63UploadFileService extends BaseUploadFileService {
             // 场站装机容量
             velocityContext.put("capacity", electricFieldInfo.getCapacity());
             // 系统当前日期
-            if (electricFieldInfo.getElectricFieldTypeEnum().equals("E1")) {
+            if (electricFieldInfo.getElectricFieldTypeEnum().toString().equals("E1")) {
               velocityContext.put("currentTime", DateFormatUtils.format(systemDate, "yyyy-MM-dd_HH:mm" + ":00"));
             } else {
               velocityContext.put("currentTime", DateFormatUtils.format(systemDate, "yyyy-MM-dd HH:mm" + ":00"));
@@ -477,10 +478,10 @@ public class E63UploadFileService extends BaseUploadFileService {
         String time = qxzMap.get("time");
         long timestamp = new Date().getTime();
         SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        try{
+        try {
           Date d = sf.parse(time);// 日期转换为时间戳
           timestamp = d.getTime();
-        }catch (Exception e){
+        } catch (Exception e) {
           log.info("日期转换异常");
           e.printStackTrace();
         }
@@ -609,15 +610,15 @@ public class E63UploadFileService extends BaseUploadFileService {
         String time = cftMap.get("time");
         long timestamp = new Date().getTime();
         SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        try{
+        try {
           Date d = sf.parse(time);// 日期转换为时间戳
           timestamp = d.getTime();
-        }catch (Exception e){
+        } catch (Exception e) {
           log.info("日期转换异常");
           e.printStackTrace();
         }
         if (StrUtil.isNotBlank(time)) {
-          if (timestamp>= startTime && timestamp <= endTime) {
+          if (timestamp >= startTime && timestamp <= endTime) {
             // 从缓存里赋值
             ws10 = cftMap.get("wsInst10") == null ? new BigDecimal("-99") : new BigDecimal(cftMap.get("wsInst10"));
             wd10 = cftMap.get("wdInst10") == null ? new BigDecimal("-99") : new BigDecimal(cftMap.get("wdInst10"));
@@ -948,10 +949,10 @@ public class E63UploadFileService extends BaseUploadFileService {
           String time = fjMap.get("time");
           long timestamp = new Date().getTime();
           SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-          try{
+          try {
             Date d = sf.parse(time);// 日期转换为时间戳
             timestamp = d.getTime();
-          }catch (Exception e){
+          } catch (Exception e) {
             log.info("日期转换异常");
             e.printStackTrace();
           }
@@ -1091,151 +1092,170 @@ public class E63UploadFileService extends BaseUploadFileService {
    */
   private void generateNbqFile(String fileName, Template template, ElectricField electricFieldInfo, Date date, Long startTime, Long endTime) {
     // 获取逆变器
-    List<InverterInfo> inverterInfoList = inverterInfoRepository.findAll();
+    List<InverterInfo> inverterInfoList = inverterInfoRepository.findAllByStationCode(electricFieldInfo.getStationCode());
     // 过滤上报的逆变器
     List<InverterInfo> filterInverterInfoList = inverterInfoList.stream().filter(AbstractEquipmentInfo::getReport).collect(Collectors.toList());
     if (filterInverterInfoList.size() > 0) {
-      List<Map<String, String>> dtaInverterList = new ArrayList<>();
+      SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+      long timestamp = new Date().getTime();
+      List<InverterStatusData> redisList = new ArrayList<>();
       for (InverterInfo inverterInfo : filterInverterInfoList) {
-        Map<String, String> map = new HashMap<>();
-        //场站名称
-        map.put("czmc", electricFieldInfo.getName());
-        // 名称
-        map.put("name", inverterInfo.getName());
-        //集电线名称
-        map.put("CollectorCircuit", inverterInfo.getCollectorCircuit());
-        //额定容量
-        map.put("RatedCapacity", div(inverterInfo.getCapacity(), new BigDecimal("1000"), 2).toString());
-        // 开机容量
-        map.put("nbqCapacity", inverterInfo.getCapacity().toString());
-        //型号
-        map.put("modelNumber", inverterInfo.getModelNumber());
-        // 是否样板
-        map.put("sample", inverterInfo.getSample() ? "1" : "0");
-        //是否组串
-        map.put("IsString", inverterInfo.getGroupSeries() ? "1" : "0");
+        // 获取redis
         String nbqId = String.valueOf(inverterInfo.getId());
         Map<String, String> nbqMap = redisUtils.hgetall("nbq-" + electricFieldInfo.getStationCode() + "-" + nbqId);
-        DecimalFormat df = new DecimalFormat("0.00");
-        // 状态
-        String status = "1";
-        // 有功
-        BigDecimal activePower = new BigDecimal("0");
-        // 无功
-        BigDecimal reactivePower = new BigDecimal("0");
-        // 功率因数
-        BigDecimal powerFactor = new BigDecimal("0");
-        // 电压
-        BigDecimal voltage = new BigDecimal("0");
-        // 电流
-        BigDecimal electricalCurrent = new BigDecimal("0");
-        // 当日发电量
-        BigDecimal dayElectricQuantity = new BigDecimal("0");
-        // 累积发电量
-        BigDecimal cumulativeGeneratedEnergy = new BigDecimal("0");
-        boolean isUseRedis = false;
-
         if (!nbqMap.isEmpty()) {
           String time = nbqMap.get("time");
-          long timestamp = new Date().getTime();
-          SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-          try{
-            Date d = sf.parse(time);// 日期转换为时间戳
-             timestamp = d.getTime();
-          }catch (Exception e){
-            log.info("日期转换异常");
-            e.printStackTrace();
-          }
-
           if (StrUtil.isNotBlank(time)) {
+            try {
+              Date d = sf.parse(time);// 日期转换为时间戳
+              timestamp = d.getTime();
+            } catch (Exception e) {
+              log.info("日期转换异常");
+              e.printStackTrace();
+            }
             if (timestamp >= startTime && timestamp <= endTime) {
-              if (nbqMap.get("status") != null) {
-                status = nbqMap.get("status");
-              }
-              if (nbqMap.get("activePower") != null) {
-                activePower = new BigDecimal(nbqMap.get("activePower"));
-              }
-              if (nbqMap.get("reactivePower") != null) {
-                reactivePower = new BigDecimal(nbqMap.get("reactivePower"));
-              }
-              if (nbqMap.get("powerFactor") != null) {
-                powerFactor = new BigDecimal(nbqMap.get("powerFactor"));
-              }
-              if (nbqMap.get("voltage") != null) {
-                voltage = new BigDecimal(nbqMap.get("voltage"));
-              }
-              if (nbqMap.get("electricalCurrent") != null) {
-                electricalCurrent = new BigDecimal(nbqMap.get("electricalCurrent"));
-              }
-              if (nbqMap.get("dayElectricQuantity") != null) {
-                dayElectricQuantity = new BigDecimal(nbqMap.get("dayElectricQuantity"));
-              }
-              if (nbqMap.get("cumulativeGeneratedEnergy") != null) {
-                cumulativeGeneratedEnergy = new BigDecimal(nbqMap.get("cumulativeGeneratedEnergy"));
-              }
-              isUseRedis = true;
-              log.info(electricFieldInfo.getStationCode() + "生成逆变器数据用缓存");
+              // 将有效的reids内容存入list
+              InverterStatusData inverterStatusData = JSON.parseObject(JSON.toJSONString(nbqMap), InverterStatusData.class);
+              redisList.add(inverterStatusData);
             }
           }
         }
-
-        if (!isUseRedis) {
-          List<InverterStatusData> inverterStatusDataList = inverterStatusDataRepository.findByTimeBetweenAndEquipmentId(new Date(startTime), new Date(endTime), nbqId);
-          if (!inverterStatusDataList.isEmpty()) {
-            inverterStatusDataList.stream().sorted(Comparator.comparing(InverterStatusData::getTime).reversed()).collect(Collectors.toList());
-            InverterStatusData inverterStatusData = inverterStatusDataList.get(0);
-            if (inverterStatusData.getStatus() != null) {
-              status = String.valueOf(inverterStatusData.getStatus());
-            }
+      }
+      List<Map<String, String>> dtaInverterList = new ArrayList<>();
+      if (redisList.size() == filterInverterInfoList.size() && redisList.size() > 0) {
+        // redis里有全部的数据
+        for (InverterInfo inverterInfo : filterInverterInfoList) {
+          Map<String, String> map = new HashMap<>();
+          //场站名称
+          map.put("czmc", electricFieldInfo.getName());
+          // 名称
+          map.put("name", inverterInfo.getName());
+          //集电线名称
+          map.put("CollectorCircuit", inverterInfo.getCollectorCircuit());
+          //额定容量
+          map.put("RatedCapacity", div(inverterInfo.getCapacity(), new BigDecimal("1000"), 2).toString());
+          // 开机容量
+          map.put("nbqCapacity", inverterInfo.getCapacity().toString());
+          //型号
+          map.put("modelNumber", inverterInfo.getModelNumber());
+          // 是否样板
+          map.put("sample", inverterInfo.getSample() ? "1" : "0");
+          //是否组串
+          map.put("IsString", inverterInfo.getGroupSeries() ? "1" : "0");
+          List<InverterStatusData> redisFilterList = redisList.stream().filter(s -> s.getId().equals(inverterInfo.getId())).collect(Collectors.toList());
+          InverterStatusData redisValue = redisFilterList.get(0);
+          // 状态
+          String status = String.valueOf(redisValue.getStatus());
+          // 有功
+          BigDecimal activePower = redisValue.getActivePower();
+          // 无功
+          BigDecimal reactivePower = redisValue.getReactivePower();
+          // 功率因数
+          BigDecimal powerFactor = redisValue.getPowerFactor();
+          // 电压
+          BigDecimal voltage = redisValue.getVoltage();
+          // 电流
+          BigDecimal electricalCurrent = redisValue.getElectricalCurrent();
+          // 当日发电量
+          BigDecimal dayElectricQuantity = redisValue.getDayElectricQuantity();
+          // 累积发电量
+          BigDecimal cumulativeGeneratedEnergy = redisValue.getCumulativeGeneratedEnergy();
+          DecimalFormat df = new DecimalFormat("0.00");
+          map.put("status", status);
+          // 有功
+          map.put("NbqActivePower", div(activePower, new BigDecimal("1000"), 2).toString());
+          // 无功
+          map.put("NbqReActivePower", div(reactivePower, new BigDecimal("1000"), 2).toString());
+          // 电压
+          map.put("Voltage", df.format(voltage));
+          // 电流
+          map.put("GalvanicCurrent", df.format(electricalCurrent));
+          // 功率因数
+          map.put("PowerFactor", df.format(powerFactor));
+          // 日发电量
+          map.put("NbqDailyOutPut", df.format(dayElectricQuantity));
+          // 累计发电量
+          map.put("GeneratingCap", df.format(cumulativeGeneratedEnergy));
+          dtaInverterList.add(map);
+        }
+      } else {
+        // 取库里的数据
+        List<InverterStatusData> inverterStatusDataList = inverterStatusDataRepository.findByTimeBetween(new Date(startTime), new Date(endTime));
+        for (InverterInfo inverterInfo : filterInverterInfoList) {
+          // 状态
+          String status = "1";
+          // 有功
+          BigDecimal activePower = new BigDecimal("0");
+          // 无功
+          BigDecimal reactivePower = new BigDecimal("0");
+          // 功率因数
+          BigDecimal powerFactor = new BigDecimal("0");
+          // 电压
+          BigDecimal voltage = new BigDecimal("0");
+          // 电流
+          BigDecimal electricalCurrent = new BigDecimal("0");
+          // 当日发电量
+          BigDecimal dayElectricQuantity = new BigDecimal("0");
+          // 累积发电量
+          BigDecimal cumulativeGeneratedEnergy = new BigDecimal("0");
+          Map<String, String> map = new HashMap<>();
+          //场站名称
+          map.put("czmc", electricFieldInfo.getName());
+          // 名称
+          map.put("name", inverterInfo.getName());
+          //集电线名称
+          map.put("CollectorCircuit", inverterInfo.getCollectorCircuit());
+          //额定容量
+          map.put("RatedCapacity", div(inverterInfo.getCapacity(), new BigDecimal("1000"), 2).toString());
+          // 开机容量
+          map.put("nbqCapacity", inverterInfo.getCapacity().toString());
+          //型号
+          map.put("modelNumber", inverterInfo.getModelNumber());
+          // 是否样板
+          map.put("sample", inverterInfo.getSample() ? "1" : "0");
+          //是否组串
+          map.put("IsString", inverterInfo.getGroupSeries() ? "1" : "0");
+
+          List<InverterStatusData> filterList = inverterStatusDataList.stream().filter(s -> s.getId().equals(inverterInfo.getId())).collect(Collectors.toList());
+          if (filterList.size() > 0) {
+            // 用数据库
+            filterList.sort(Comparator.comparing(InverterStatusData::getTime).reversed());
+            InverterStatusData inverterStatusData = filterList.get(0);
+            // 状态
+            status = String.valueOf(inverterStatusData.getStatus());
             // 有功
-            if (inverterStatusData.getActivePower() != null) {
-              activePower = inverterStatusData.getActivePower();
-            }
+            activePower = inverterStatusData.getActivePower();
             // 无功
-            if (inverterStatusData.getReactivePower() != null) {
-              reactivePower = inverterStatusData.getReactivePower();
-            }
+            reactivePower = inverterStatusData.getReactivePower();
+            // 功率因数
+            powerFactor = inverterStatusData.getPowerFactor();
             // 电压
-            if (inverterStatusData.getVoltage() != null) {
-              voltage = inverterStatusData.getVoltage();
-            }
+            voltage = inverterStatusData.getVoltage();
             // 电流
-            if (inverterStatusData.getElectricalCurrent() != null) {
-              electricalCurrent = inverterStatusData.getElectricalCurrent();
-            }
-            // 功率因数
-            if (inverterStatusData.getPowerFactor() != null) {
-              powerFactor = inverterStatusData.getPowerFactor();
-            }
-            // 日发电量
-            if (inverterStatusData.getDayElectricQuantity() != null) {
-              dayElectricQuantity = inverterStatusData.getDayElectricQuantity();
-            }
-            // 累计发电量
-            if (inverterStatusData.getCumulativeGeneratedEnergy() != null) {
-              cumulativeGeneratedEnergy = inverterStatusData.getCumulativeGeneratedEnergy();
-            }
-            log.info(electricFieldInfo.getStationCode() + "生成逆变器数据用数据表");
-          } else {
-            log.info(electricFieldInfo.getStationCode() + "生成逆变器数据缓存和数据表都没有值,使用默认0");
+            electricalCurrent = inverterStatusData.getElectricalCurrent();
+            // 当日发电量
+            dayElectricQuantity = inverterStatusData.getDayElectricQuantity();
+            // 累积发电量
+            cumulativeGeneratedEnergy = inverterStatusData.getCumulativeGeneratedEnergy();
           }
+          DecimalFormat df = new DecimalFormat("0.00");
+          map.put("status", status);
+          // 有功
+          map.put("NbqActivePower", div(activePower, new BigDecimal("1000"), 2).toString());
+          // 无功
+          map.put("NbqReActivePower", div(reactivePower, new BigDecimal("1000"), 2).toString());
+          // 电压
+          map.put("Voltage", df.format(voltage));
+          // 电流
+          map.put("GalvanicCurrent", df.format(electricalCurrent));
+          // 功率因数
+          map.put("PowerFactor", df.format(powerFactor));
+          // 日发电量
+          map.put("NbqDailyOutPut", df.format(dayElectricQuantity));
+          // 累计发电量
+          map.put("GeneratingCap", df.format(cumulativeGeneratedEnergy));
+          dtaInverterList.add(map);
         }
-        map.put("status", status);
-        // 有功
-        map.put("NbqActivePower", div(activePower, new BigDecimal("1000"), 2).toString());
-        // 无功
-        map.put("NbqReActivePower", div(reactivePower, new BigDecimal("1000"), 2).toString());
-        // 电压
-        map.put("Voltage", df.format(voltage));
-        // 电流
-        map.put("GalvanicCurrent", df.format(electricalCurrent));
-        // 功率因数
-        map.put("PowerFactor", df.format(powerFactor));
-        // 日发电量
-        map.put("NbqDailyOutPut", df.format(dayElectricQuantity));
-        // 累计发电量
-        map.put("GeneratingCap", df.format(cumulativeGeneratedEnergy));
-        dtaInverterList.add(map);
       }
       // 创建上报文件
       File file = super.createTempFile(fileName);

+ 23 - 43
ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/service/FtpUploadTransactionService.java

@@ -34,8 +34,6 @@ import java.util.stream.Collectors;
 @Service
 public class FtpUploadTransactionService extends BaseUploadFileService {
   @Autowired
-  UploadFileLogRepository uploadFileLogRepository;
-  @Autowired
   UploadFileLogDetailRepository uploadFileLogDetailRepository;
 
 
@@ -55,19 +53,22 @@ public class FtpUploadTransactionService extends BaseUploadFileService {
     //明日凌晨
     logger.info("准备上报:" + srcPath);
     try {
-      InputStreamReader isr = null;
-      InputStream uploadFileIs = null;
+      String str = "";
+      try (
+        InputStreamReader isr = new InputStreamReader(new FileInputStream(srcPath), StandardCharsets.UTF_8);){
+        StringBuilder sb = new StringBuilder();
+        int len1;
+        while ((len1 = isr.read()) != -1) {
+          sb.append((char) len1);
+        }
+        str = sb.toString();
+      }
+      catch (Exception e){
+        logger.error("读取文件失败", e);
+      }
       if (ftp != null) {
-        try {
-          isr = new InputStreamReader(new FileInputStream(srcPath), StandardCharsets.UTF_8);
-          StringBuilder sb = new StringBuilder();
-          int len1;
-          while ((len1 = isr.read()) != -1) {
-            sb.append((char) len1);
-          }
-          isr.close();
-          String str = sb.toString();
-          uploadFileIs = new ByteArrayInputStream(str.getBytes(uploadObject.getUploadFileCharSetEnum().getMessage()));
+        try (
+          InputStream uploadFileIs = new ByteArrayInputStream(str.getBytes(uploadObject.getUploadFileCharSetEnum().getMessage()));){
           String uploadFileName = new String(new File(srcPath).getName().getBytes(StandardCharsets.UTF_8), uploadObject.getUploadFileCharSetEnum().getMessage());
           // 是否每个文件类型一个路径
           if (StrUtil.hasBlank(uploadFileChannel.getBackupC()) || "0".equals(uploadFileChannel.getBackupC())) {
@@ -78,28 +79,13 @@ public class FtpUploadTransactionService extends BaseUploadFileService {
             UploadURL uploadURL = uploadURLList.stream().filter(c -> c.getFileTypeEnum().name().equals(keys[1])).collect(Collectors.toList()).get(0);
             isSuccess = ftp.upload(uploadURL.getUploadURL(), uploadFileName, uploadFileIs);
           }
-        } catch (Exception e) {
-          logger.error("ftp上传失败", e);
-          throw e;
-        } finally {
-          if (isr != null) {
-            isr.close();
-          }
-          if (uploadFileIs != null) {
-            uploadFileIs.close();
-          }
+        }
+        catch (Exception e){
+          logger.error("读取文件失败", e);
         }
       } else {
-        try {
-          isr = new InputStreamReader(new FileInputStream(srcPath), StandardCharsets.UTF_8);
-          StringBuilder sb = new StringBuilder();
-          int len1;
-          while ((len1 = isr.read()) != -1) {
-            sb.append((char) len1);
-          }
-          isr.close();
-          String str = sb.toString();
-          uploadFileIs = new ByteArrayInputStream(str.getBytes(uploadObject.getUploadFileCharSetEnum().getMessage()));
+        try (
+          InputStream uploadFileIs = new ByteArrayInputStream(str.getBytes(uploadObject.getUploadFileCharSetEnum().getMessage()));){
           String uploadFileName = new String(new File(srcPath).getName().getBytes(StandardCharsets.UTF_8), uploadObject.getUploadFileCharSetEnum().getMessage());
 
           if (StrUtil.hasBlank(uploadFileChannel.getBackupC()) || "0".equals(uploadFileChannel.getBackupC())) {
@@ -110,23 +96,17 @@ public class FtpUploadTransactionService extends BaseUploadFileService {
             UploadURL uploadURL = uploadURLList.stream().filter(c -> c.getFileTypeEnum().name().equals(keys[1])).collect(Collectors.toList()).get(0);
             sftp.getClient().put(uploadFileIs, uploadURL.getUploadURL() + "/" + uploadFileName);
           }
-
           logger.info("上传远端put结束:" + keys[2]);
           isSuccess = true;
-        } finally {
-          if (isr != null) {
-            isr.close();
-          }
-          if (uploadFileIs != null) {
-            uploadFileIs.close();
-          }
+        }
+        catch (Exception e){
+          logger.error("读取文件失败", e);
         }
       }
     } catch (Exception e) {
       isSuccess = false;
       logger.error("上报通道:" + uploadFileChannel.getChannelName() + "," + keys[2] + "上报失败", e);
       Integer id = FileConstant.fileShouldMomentMap.get(entry.getKey());
-
       Optional<UploadFileLog> optional = uploadFileLogRepository.findById(id);
       UploadFileLog uploadFileLog = new UploadFileLog();
       if (optional.isPresent()) {

+ 7 - 2
ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/service/UploadFileChannelService.java

@@ -2,7 +2,9 @@ package com.jiayue.ipfcst.fileupload.service;
 
 import cn.hutool.core.convert.Convert;
 import cn.hutool.core.util.StrUtil;
+import com.jiayue.ipfcst.common.core.exception.BusinessException;
 import com.jiayue.ipfcst.common.data.constant.enums.ChannelStatusEnum;
+import com.jiayue.ipfcst.common.data.entity.InverterInfo;
 import com.jiayue.ipfcst.common.data.entity.UploadFileChannel;
 import com.jiayue.ipfcst.common.data.entity.UploadObject;
 import com.jiayue.ipfcst.common.data.repository.UploadFileChannelRepository;
@@ -155,8 +157,11 @@ public class UploadFileChannelService {
   }
 
   public UploadFileChannel getById(Integer id) {
-    Optional<UploadFileChannel> channel = uploadFileChannelRepository.findById(id);
-    return channel.get();
+    Optional<UploadFileChannel> optional = uploadFileChannelRepository.findById(id);
+    if (optional.isPresent()) {
+      return optional.get();
+    }
+    return null;
   }
 
   /**

+ 70 - 57
ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/service/UploadFileLogService.java

@@ -81,7 +81,11 @@ public class UploadFileLogService {
       }
 
       if (uploadObjectId > 0) {
-        UploadObject uploadObject = uploadObjectRepository.findById(uploadObjectId).get();
+        UploadObject uploadObject = null;
+        Optional<UploadObject> optional = uploadObjectRepository.findById(uploadObjectId);
+        if (optional.isPresent()) {
+          uploadObject = optional.get();
+        }
         uploadObjectList.add(uploadObject);
       } else {
         uploadObjectList = uploadObjectRepository.findAll();
@@ -217,65 +221,71 @@ public class UploadFileLogService {
     long et = DateTimeUtil.getMillisecondsSubDay() + 1000 * 60 * 60 * 24 - 1;
     UploadFileLog uploadFileLog = uploadFileLogRepository.findByUploadObjectIdAndFileNameAndCreateTimeBetween(objectId, file.getOriginalFilename(), new Date(st), new Date(et));
     try {
-      UploadObject uploadObject = uploadObjectRepository.findById(objectId).get();
-
-      // 上报文件目录
-      String destFileDir = FileUtil.getFileUploadPath() + File.separator + "process" + File.separator + uploadObject.getObjectNo() + File.separator + fileType;
-      File destDir = new File(destFileDir);
-      if (!destDir.exists()) {// 如果目录不存在则创建目录
-        boolean b = destDir.mkdirs();
-        if (!b) // 如果创建失败则抛出异常
-          throw new RuntimeException(destFileDir + " 目录创建失败");
-      }
+      UploadObject uploadObject;
+      Optional<UploadObject> optional = uploadObjectRepository.findById(objectId);
+      if (optional.isPresent()) {
+        uploadObject = optional.get();
+        // 上报文件目录
+        String destFileDir = FileUtil.getFileUploadPath() + File.separator + "process" + File.separator + uploadObject.getObjectNo() + File.separator + fileType;
+        File destDir = new File(destFileDir);
+        if (!destDir.exists()) {// 如果目录不存在则创建目录
+          boolean b = destDir.mkdirs();
+          if (!b) // 如果创建失败则抛出异常
+            throw new RuntimeException(destFileDir + " 目录创建失败");
+        }
 
-      File destFirFile = new File(destFileDir + File.separator + file.getOriginalFilename());
-      if (destFirFile.exists()) {
-        File reNameFile = new File(destFileDir + File.separator + file.getOriginalFilename() + "(被替换文件)");
-        if (reNameFile.exists()) {
-          reNameFile.delete();
+        File destFirFile = new File(destFileDir + File.separator + file.getOriginalFilename());
+        if (destFirFile.exists()) {
+          File reNameFile = new File(destFileDir + File.separator + file.getOriginalFilename() + "(被替换文件)");
+          if (reNameFile.exists()) {
+            reNameFile.delete();
+          }
+          boolean b = destFirFile.renameTo(reNameFile);
+          if (!b) {
+            return false;
+          }
         }
-        boolean b = destFirFile.renameTo(reNameFile);
-        if (!b) {
-          return false;
+        file.transferTo(destFirFile);
+        if (uploadFileLog == null) {
+          UploadFileLog newUploadFileLog = new UploadFileLog();
+          newUploadFileLog.setUploadObjectId(uploadObject.getId());
+          newUploadFileLog.setUploadObjectName(uploadObject.getUploadObjectName());
+          newUploadFileLog.setUploadObjectNo(uploadObject.getObjectNo());
+          newUploadFileLog.setFileName(file.getOriginalFilename());
+          newUploadFileLog.setFileTypeEnum(FileTypeEnum.valueOf(fileType));
+          newUploadFileLog.setFileStatusEnum(FileStatusEnum.E1);
+          newUploadFileLog.setUploadProtocolEnum(uploadObject.getUploadProtocolEnum());
+          newUploadFileLog.setUploadCounter(0);
+          newUploadFileLog.setUploadFileEndTime(null);
+          newUploadFileLog.setStationCode(uploadObject.getStationCode());
+          newUploadFileLog.setFileRemarks("手动上传文件");
+          uploadFileLog = this.uploadFileLogRepository.save(newUploadFileLog);
+          String readyFileKey = uploadObject.getObjectNo() + "@" + fileType + "@" + file.getOriginalFilename();
+          FileConstant.readyUploadFileMap.put(readyFileKey, newUploadFileLog);
+          FileConstant.fileShouldMomentMap.put(readyFileKey, uploadFileLog.getId());
+          log.info("上报对象编号:" + uploadObject.getObjectNo() + ",上传文件" + file.getOriginalFilename() + "成功");
+        } else {
+          uploadFileLog.setUploadCounter(0);
+          String readyFileKey = uploadObject.getObjectNo() + "@" + fileType + "@" + file.getOriginalFilename();
+          FileConstant.readyUploadFileMap.put(readyFileKey, uploadFileLog);
+          FileConstant.fileShouldMomentMap.put(readyFileKey, uploadFileLog.getId());
+          log.info("上报对象编号:" + uploadObject.getObjectNo() + ",覆盖上传文件" + file.getOriginalFilename() + "成功");
         }
+        ManualUploadLog manualUploadLog = new ManualUploadLog();
+        manualUploadLog.setFileName(uploadFileLog.getFileName());
+        manualUploadLog.setFileTypeEnum(uploadFileLog.getFileTypeEnum());
+        manualUploadLog.setUploadEquipmentID(uploadFileLog.getUploadEquipmentID());
+        manualUploadLog.setUploadObjectId(uploadFileLog.getUploadObjectId());
+        manualUploadLog.setUploadObjectName(uploadFileLog.getUploadObjectName());
+        manualUploadLog.setUploadObjectNo(uploadFileLog.getUploadObjectNo());
+        manualUploadLog.setUploadCatalog(destFileDir);
+        manualUploadLog.setUploadDate(new Date());
+        manualUploadLogRepository.save(manualUploadLog);
+        return true;
       }
-      file.transferTo(destFirFile);
-      if (uploadFileLog == null) {
-        UploadFileLog newUploadFileLog = new UploadFileLog();
-        newUploadFileLog.setUploadObjectId(uploadObject.getId());
-        newUploadFileLog.setUploadObjectName(uploadObject.getUploadObjectName());
-        newUploadFileLog.setUploadObjectNo(uploadObject.getObjectNo());
-        newUploadFileLog.setFileName(file.getOriginalFilename());
-        newUploadFileLog.setFileTypeEnum(FileTypeEnum.valueOf(fileType));
-        newUploadFileLog.setFileStatusEnum(FileStatusEnum.E1);
-        newUploadFileLog.setUploadProtocolEnum(uploadObject.getUploadProtocolEnum());
-        newUploadFileLog.setUploadCounter(0);
-        newUploadFileLog.setUploadFileEndTime(null);
-        newUploadFileLog.setStationCode(uploadObject.getStationCode());
-        newUploadFileLog.setFileRemarks("手动上传文件");
-        uploadFileLog = this.uploadFileLogRepository.save(newUploadFileLog);
-        String readyFileKey = uploadObject.getObjectNo() + "@" + fileType + "@" + file.getOriginalFilename();
-        FileConstant.readyUploadFileMap.put(readyFileKey, newUploadFileLog);
-        FileConstant.fileShouldMomentMap.put(readyFileKey, uploadFileLog.getId());
-        log.info("上报对象编号:" + uploadObject.getObjectNo() + ",上传文件" + file.getOriginalFilename() + "成功");
-      } else {
-        uploadFileLog.setUploadCounter(0);
-        String readyFileKey = uploadObject.getObjectNo() + "@" + fileType + "@" + file.getOriginalFilename();
-        FileConstant.readyUploadFileMap.put(readyFileKey, uploadFileLog);
-        FileConstant.fileShouldMomentMap.put(readyFileKey, uploadFileLog.getId());
-        log.info("上报对象编号:" + uploadObject.getObjectNo() + ",覆盖上传文件" + file.getOriginalFilename() + "成功");
+      else{
+        return false;
       }
-      ManualUploadLog manualUploadLog = new ManualUploadLog();
-      manualUploadLog.setFileName(uploadFileLog.getFileName());
-      manualUploadLog.setFileTypeEnum(uploadFileLog.getFileTypeEnum());
-      manualUploadLog.setUploadEquipmentID(uploadFileLog.getUploadEquipmentID());
-      manualUploadLog.setUploadObjectId(uploadFileLog.getUploadObjectId());
-      manualUploadLog.setUploadObjectName(uploadFileLog.getUploadObjectName());
-      manualUploadLog.setUploadObjectNo(uploadFileLog.getUploadObjectNo());
-      manualUploadLog.setUploadCatalog(destFileDir);
-      manualUploadLog.setUploadDate(new Date());
-      manualUploadLogRepository.save(manualUploadLog);
-      return true;
     } catch (IOException e) {
       log.info("手动上传上报文件发生错误!");
       e.printStackTrace();
@@ -291,8 +301,11 @@ public class UploadFileLogService {
       Optional<UploadFileLog> uploadFileLogOptional = uploadFileLogRepository.findById(id);
       if (uploadFileLogOptional.isPresent()) {
         UploadFileLog uploadFileLog = uploadFileLogOptional.get();
-        UploadObject uploadObject = uploadObjectRepository.findById(uploadFileLog.getUploadObjectId()).get();
-
+        UploadObject uploadObject = null;
+        Optional<UploadObject> optional = uploadObjectRepository.findById(uploadFileLog.getUploadObjectId());
+        if (optional.isPresent()) {
+          uploadObject = optional.get();
+        }
         // 上报文件目录
         String destFileDir = FileUtil.getFileUploadPath() + File.separator + "process" + File.separator + uploadObject.getObjectNo() + File.separator + uploadFileLog.getFileTypeEnum().name();
         File destDir = new File(destFileDir);

+ 0 - 3
ipfcst-console/src/main/java/com/jiayue/ipfcst/ftpsftp/service/ContinueFTPService.java

@@ -42,9 +42,6 @@ public class ContinueFTPService {
   public FTPFile[] listFiles(String remotepath) throws IOException {
     client.enterLocalPassiveMode();
     remotepath = new String(remotepath.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1);
-    if (client == null) {
-      return null;
-    }
     client.changeWorkingDirectory(remotepath);//获取所有的目录
     return client.listFiles();//返回获取到的目录信息
   }

+ 5 - 1
ipfcst-console/src/main/resources/application.yml

@@ -6,6 +6,10 @@ server:
     key-store-password: jiayue6677*
     key-store-type: JKS
 spring:
+  task:
+    scheduling:
+      pool:
+        size: 10
   redis:
     host: 192.168.1.205
     port: 6379
@@ -38,7 +42,7 @@ spring:
       # 数据源配置
       username: root
       password: '!QAZ2root'
-      url: jdbc:mysql://localhost:3306/focus?useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8&autoReconnect=true&rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai
+      url: jdbc:mysql://192.168.1.205:3306/focus?useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8&autoReconnect=true&rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai
       driver-class-name: com.mysql.cj.jdbc.Driver
       # 初始化 最小 最大
       initial-size: 10

+ 0 - 128
ipfcst-console/src/main/resources/sql/t_init_job_class.sql

@@ -1,135 +1,7 @@
 INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '短期', 'com.jiayue.ipfcst.fileupload.job.UploadFileE1Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '短期') ;
 INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '超短期', 'com.jiayue.ipfcst.fileupload.job.UploadFileE2Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '超短期') ;
 INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '理论功率', 'com.jiayue.ipfcst.fileupload.job.UploadFileE3Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '理论功率') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '24NWP', 'com.jiayue.ipfcst.fileupload.job.UploadFileE4Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '24NWP') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '72NWP', 'com.jiayue.ipfcst.fileupload.job.UploadFileE5Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '72NWP') ;
 INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '气象站', 'com.jiayue.ipfcst.fileupload.job.UploadFileE6Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '气象站') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '测风塔', 'com.jiayue.ipfcst.fileupload.job.UploadFileE7Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '测风塔') ;
 INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '逆变器', 'com.jiayue.ipfcst.fileupload.job.UploadFileE8Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '逆变器') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '风机信息', 'com.jiayue.ipfcst.fileupload.job.UploadFileE9Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '风机信息') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '光伏组件信息', 'com.jiayue.ipfcst.fileupload.job.UploadFileE10Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '光伏组件信息') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '检修计划', 'com.jiayue.ipfcst.fileupload.job.UploadFileE11Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '检修计划') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '昨日开机容量', 'com.jiayue.ipfcst.fileupload.job.UploadFileE12Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '昨日开机容量') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '短期发电计划', 'com.jiayue.ipfcst.fileupload.job.UploadFileE13Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '短期发电计划') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '超短期发电计划', 'com.jiayue.ipfcst.fileupload.job.UploadFileE14Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '超短期发电计划') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '日前预测', 'com.jiayue.ipfcst.fileupload.job.UploadFileE15Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '日前预测') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '日前预测14', 'com.jiayue.ipfcst.fileupload.job.UploadFileE16Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '日前预测14') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '短期168', 'com.jiayue.ipfcst.fileupload.job.UploadFileE17Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '短期168') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '限电计划', 'com.jiayue.ipfcst.fileupload.job.UploadFileE18Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '限电计划') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '弃电计划', 'com.jiayue.ipfcst.fileupload.job.UploadFileE19Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '弃电计划') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '场站信息', 'com.jiayue.ipfcst.fileupload.job.UploadFileE20Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '场站信息') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '短期_集控', 'com.jiayue.ipfcst.fileupload.job.UploadFileE21Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '短期_集控') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '超短期_集控', 'com.jiayue.ipfcst.fileupload.job.UploadFileE22Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '超短期_集控') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '测风塔_集控', 'com.jiayue.ipfcst.fileupload.job.UploadFileE23Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '测风塔_集控') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '72NWP_集控', 'com.jiayue.ipfcst.fileupload.job.UploadFileE24Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '72NWP_集控') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '短期_D5000', 'com.jiayue.ipfcst.fileupload.job.UploadFileE25Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '短期_D5000') ;
 INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '可用短期', 'com.jiayue.ipfcst.fileupload.job.UploadFileE26Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '可用短期') ;
 INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '可用超短期', 'com.jiayue.ipfcst.fileupload.job.UploadFileE27Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '可用超短期') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '理论超短期', 'com.jiayue.ipfcst.fileupload.job.UploadFileE28Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '理论超短期') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '短期预测风速风向', 'com.jiayue.ipfcst.fileupload.job.UploadFileE29Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '短期预测风速风向') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '实测功率', 'com.jiayue.ipfcst.fileupload.job.UploadFileE30Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '实测功率') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '短期预测辐照度', 'com.jiayue.ipfcst.fileupload.job.UploadFileE31Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '短期预测辐照度') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '短期日志', 'com.jiayue.ipfcst.fileupload.job.UploadFileE32Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '短期日志') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '超短期日志', 'com.jiayue.ipfcst.fileupload.job.UploadFileE33Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '超短期日志') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '短期可用日志', 'com.jiayue.ipfcst.fileupload.job.UploadFileE34Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '短期可用日志') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '超短期可用日志', 'com.jiayue.ipfcst.fileupload.job.UploadFileE35Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '超短期可用日志') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '气象站日志', 'com.jiayue.ipfcst.fileupload.job.UploadFileE36Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '气象站日志') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '理论功率日志', 'com.jiayue.ipfcst.fileupload.job.UploadFileE37Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '理论功率日志') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '逆变器日志', 'com.jiayue.ipfcst.fileupload.job.UploadFileE38Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '逆变器日志') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '风机信息日志', 'com.jiayue.ipfcst.fileupload.job.UploadFileE39Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '风机信息日志') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '测风塔日志', 'com.jiayue.ipfcst.fileupload.job.UploadFileE40Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '测风塔日志') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '指标数据', 'com.jiayue.ipfcst.fileupload.job.UploadFileE41Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '指标数据') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '电网上报状态', 'com.jiayue.ipfcst.fileupload.job.UploadFileE42Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '电网上报状态') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '预测准确率', 'com.jiayue.ipfcst.fileupload.job.UploadFileE43Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '预测准确率') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '升压变', 'com.jiayue.ipfcst.fileupload.job.UploadFileE44Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '升压变') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '超短期预测风速风向', 'com.jiayue.ipfcst.fileupload.job.UploadFileE45Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '超短期预测风速风向') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '超短期SFTP', 'com.jiayue.ipfcst.fileupload.job.UploadFileE46Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '超短期SFTP') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '短期SFTP', 'com.jiayue.ipfcst.fileupload.job.UploadFileE49Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '短期SFTP') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '超短期预测辐照度', 'com.jiayue.ipfcst.fileupload.job.UploadFileE47Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '超短期预测辐照度') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '单机', 'com.jiayue.ipfcst.fileupload.job.UploadFileE48Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '单机') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '准确率统计', 'com.jiayue.ipfcst.calculate.job.AccuracyPassRateCalculateJob', 'other', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '准确率统计') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '短期02', 'com.jiayue.ipfcst.fileupload.job.UploadFileE59Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '短期02') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '离线理论功率', 'com.jiayue.ipfcst.fileupload.job.UploadFileE60Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '离线理论功率') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '在线理论功率', 'com.jiayue.ipfcst.fileupload.job.UploadFileE61Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '在线理论功率') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '湖北短期', 'com.jiayue.ipfcst.fileupload.job.UploadFileE62Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '湖北短期') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '湖北超短期', 'com.jiayue.ipfcst.fileupload.job.UploadFileE63Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '湖北超短期') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '湖北72nwp', 'com.jiayue.ipfcst.fileupload.job.UploadFileE64Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '湖北72nwp') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '湖北气象站', 'com.jiayue.ipfcst.fileupload.job.UploadFileE65Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '湖北气象站') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '湖北测风塔', 'com.jiayue.ipfcst.fileupload.job.UploadFileE66Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '湖北测风塔') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '湖北单机', 'com.jiayue.ipfcst.fileupload.job.UploadFileE67Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '湖北单机') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '湖北逆变器', 'com.jiayue.ipfcst.fileupload.job.UploadFileE84Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '湖北逆变器') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '湖北地调短期', 'com.jiayue.ipfcst.fileupload.job.UploadFileE68Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '湖北地调短期') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '湖北地调超短期', 'com.jiayue.ipfcst.fileupload.job.UploadFileE69Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '湖北地调超短期') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '湖北地调72nwp', 'com.jiayue.ipfcst.fileupload.job.UploadFileE70Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '湖北地调72nwp') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '湖北地调测风塔', 'com.jiayue.ipfcst.fileupload.job.UploadFileE72Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '湖北地调测风塔') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '湖北地调单机', 'com.jiayue.ipfcst.fileupload.job.UploadFileE73Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '湖北地调单机') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '湖北地调风机信息', 'com.jiayue.ipfcst.fileupload.job.UploadFileE74Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '湖北地调风机信息') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '湖北地调气象站', 'com.jiayue.ipfcst.fileupload.job.UploadFileE71Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '湖北地调气象站') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '湖北地调逆变器', 'com.jiayue.ipfcst.fileupload.job.UploadFileE75Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '湖北地调逆变器') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '升压站信息', 'com.jiayue.ipfcst.fileupload.job.UploadFileE50Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '升压站信息') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select 'AGC_AVC信息', 'com.jiayue.ipfcst.fileupload.job.UploadFileE51Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = 'AGC_AVC信息') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '风电总体信息', 'com.jiayue.ipfcst.fileupload.job.UploadFileE52Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '风电总体信息') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '光伏总体信息', 'com.jiayue.ipfcst.fileupload.job.UploadFileE53Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '光伏总体信息') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '统计信息', 'com.jiayue.ipfcst.fileupload.job.UploadFileE54Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '统计信息') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '光伏逆变器/汇流箱信息', 'com.jiayue.ipfcst.fileupload.job.UploadFileE55Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '光伏逆变器/汇流箱信息') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '海南短期预测', 'com.jiayue.ipfcst.fileupload.job.UploadFileE56Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '海南短期预测') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '海南超短期预测', 'com.jiayue.ipfcst.fileupload.job.UploadFileE57Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '海南超短期预测') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '海南风电机组', 'com.jiayue.ipfcst.fileupload.job.UploadFileE76Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '海南风电机组') ;
-
-
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '新疆网调气象站', 'com.jiayue.ipfcst.fileupload.job.UploadFileE78Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '新疆网调气象站') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '新疆网调超短期', 'com.jiayue.ipfcst.fileupload.job.UploadFileE79Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '新疆网调超短期') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '新疆网调短期', 'com.jiayue.ipfcst.fileupload.job.UploadFileE80Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '新疆网调短期') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '新疆网调实时量测', 'com.jiayue.ipfcst.fileupload.job.UploadFileE81Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '新疆网调实时量测') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '新疆网调集电线', 'com.jiayue.ipfcst.fileupload.job.UploadFileE82Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '新疆网调集电线') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '新疆网调逆变器', 'com.jiayue.ipfcst.fileupload.job.UploadFileE77Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '新疆网调逆变器') ;
-
--- INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '海南压缩包', 'com.jiayue.ipfcst.fileupload.job.UploadFileE83Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '海南压缩包') ;
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '浙江地调102客户端', 'com.jiayue.ipfcst.fileupload.job.ZheJiang102ClientJob', 'other', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '浙江地调102客户端') ;
-
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '青海理论功率(风)', 'com.jiayue.ipfcst.fileupload.job.UploadFileE85Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '青海理论功率(风)');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select 'D5000样板机', 'com.jiayue.ipfcst.fileupload.job.UploadFileE58Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = 'D5000样板机');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '超短期数据生成', 'com.jiayue.ipfcst.fileupload.job.GenerateUltraShortDataJob', 'other', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '超短期数据生成');
-
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '省调短期', 'com.jiayue.ipfcst.fileupload.job.UploadFileE90Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '省调短期');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '省调昨日开机容量', 'com.jiayue.ipfcst.fileupload.job.UploadFileE91Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '省调昨日开机容量');
-
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '短期_辽宁龙源集控', 'com.jiayue.ipfcst.fileupload.job.UploadFileE86Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '短期_辽宁龙源集控');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '超短期_辽宁龙源集控', 'com.jiayue.ipfcst.fileupload.job.UploadFileE87Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '超短期_辽宁龙源集控');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '测风塔_辽宁龙源集控', 'com.jiayue.ipfcst.fileupload.job.UploadFileE88Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '测风塔_辽宁龙源集控');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '风机_辽宁龙源集控', 'com.jiayue.ipfcst.fileupload.job.UploadFileE89Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '风机_辽宁龙源集控');
-
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '湖北逆变器信息', 'com.jiayue.ipfcst.fileupload.job.UploadFileE92Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '湖北逆变器信息');
-
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '黄冈地调短期', 'com.jiayue.ipfcst.fileupload.job.UploadFileE93Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '黄冈地调短期');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '黄冈地调超短期', 'com.jiayue.ipfcst.fileupload.job.UploadFileE94Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '黄冈地调超短期');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '黄冈地调72nwp', 'com.jiayue.ipfcst.fileupload.job.UploadFileE95Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '黄冈地调72nwp');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '黄冈地调气象站', 'com.jiayue.ipfcst.fileupload.job.UploadFileE96Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '黄冈地调气象站');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '黄冈地调测风塔', 'com.jiayue.ipfcst.fileupload.job.UploadFileE97Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '黄冈地调测风塔');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '黄冈地调风机', 'com.jiayue.ipfcst.fileupload.job.UploadFileE98Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '黄冈地调风机');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '黄冈地调逆变器', 'com.jiayue.ipfcst.fileupload.job.UploadFileE99Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '黄冈地调逆变器');
-
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '随州地调短期', 'com.jiayue.ipfcst.fileupload.job.UploadFileE100Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '随州地调短期');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '随州地调超短期', 'com.jiayue.ipfcst.fileupload.job.UploadFileE101Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '随州地调超短期');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '随州地调nwp', 'com.jiayue.ipfcst.fileupload.job.UploadFileE102Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '随州地调nwp');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '随州地调气象站', 'com.jiayue.ipfcst.fileupload.job.UploadFileE103Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '随州地调气象站');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '随州地调逆变器', 'com.jiayue.ipfcst.fileupload.job.UploadFileE104Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '随州地调逆变器');
-
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '广东中调短期WPD', 'com.jiayue.ipfcst.fileupload.job.UploadFileE105Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '广东中调短期WPD');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '广东中调超短期WPD', 'com.jiayue.ipfcst.fileupload.job.UploadFileE106Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '广东中调超短期WPD');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '广东中调气象站WPD', 'com.jiayue.ipfcst.fileupload.job.UploadFileE107Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '广东中调气象站WPD');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '广东中调逆变器WPD', 'com.jiayue.ipfcst.fileupload.job.UploadFileE108Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '广东中调逆变器WPD');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '广东中调短期dat', 'com.jiayue.ipfcst.fileupload.job.UploadFileE109Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '广东中调短期dat');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '广东中调超短期dat', 'com.jiayue.ipfcst.fileupload.job.UploadFileE110Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '广东中调超短期dat');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '广东中调气象站dat', 'com.jiayue.ipfcst.fileupload.job.UploadFileE111Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '广东中调气象站dat');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '广东中调逆变器dat', 'com.jiayue.ipfcst.fileupload.job.UploadFileE112Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '广东中调逆变器dat');
-
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select 'NWP_辽宁龙源集控', 'com.jiayue.ipfcst.fileupload.job.UploadFileE113Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = 'NWP_辽宁龙源集控');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '蒙东南瑞集控测风塔', 'com.jiayue.ipfcst.fileupload.job.UploadFileE114Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '蒙东南瑞集控测风塔');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '龙源南瑞集控测风塔', 'com.jiayue.ipfcst.fileupload.job.UploadFileE115Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '龙源南瑞集控测风塔');
-
-
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '总调短期', 'com.jiayue.ipfcst.fileupload.job.UploadFileE116Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '总调短期');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '总调超短期', 'com.jiayue.ipfcst.fileupload.job.UploadFileE117Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '总调超短期');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '总调气象站', 'com.jiayue.ipfcst.fileupload.job.UploadFileE118Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '总调气象站');
-INSERT INTO t_init_job_class  (C_JOB_CLASS_NAME, C_JOB_CLASS_PATH, C_JOB_CLASS_TYPE, C_STATION_CODE) select '总调逆变器', 'com.jiayue.ipfcst.fileupload.job.UploadFileE119Job', 'fileCreate', '' from dual where not exists (select C_JOB_CLASS_NAME from t_init_job_class where C_JOB_CLASS_NAME = '总调逆变器');