Bläddra i källkod

山西大同功能实现及朱坑部署

xieshengjie 2 år sedan
förälder
incheckning
2832d6d060
23 ändrade filer med 695 tillägg och 43 borttagningar
  1. 3 3
      realtime/generation-service/src/main/resources/application-jn.yml
  2. 20 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/controller/InputoroutputspeedtotalController.java
  3. 20 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/controller/NatureController.java
  4. 20 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/controller/ShutdowneventController.java
  5. 16 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/controller/ghost/GhostController.java
  6. 0 1
      web/gdsx-ghost/src/main/java/com/gyee/ghost/init/CacheContext.java
  7. 16 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/mapper/auto/InputoroutputspeedtotalMapper.java
  8. 16 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/mapper/auto/NatureMapper.java
  9. 22 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/mapper/auto/ShutdowneventMapper.java
  10. 164 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/model/auto/Inputoroutputspeedtotal.java
  11. 56 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/model/auto/Nature.java
  12. 62 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/model/auto/Shutdownevent.java
  13. 112 5
      web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/GhostService.java
  14. 16 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/IInputoroutputspeedtotalService.java
  15. 16 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/INatureService.java
  16. 20 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/IShutdowneventService.java
  17. 20 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/impl/InputoroutputspeedtotalServiceImpl.java
  18. 20 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/impl/NatureServiceImpl.java
  19. 30 0
      web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/impl/ShutdowneventServiceImpl.java
  20. 13 1
      web/gdsx-ghost/src/main/java/com/gyee/ghost/task/SaticScheduleTask.java
  21. 24 24
      web/gdsx-ghost/src/main/resources/application-dev.yml
  22. 8 8
      web/gdsx-ghost/src/main/resources/application.yml
  23. 1 1
      web/gdsx-ghost/src/test/java/com/gyee/ghost/GhostTest.java

+ 3 - 3
realtime/generation-service/src/main/resources/application-jn.yml

@@ -85,11 +85,11 @@ logging:
 db:
   url: http://10.81.3.152:8011/ts
 #参与计算的场站
-runWindpowerstation: GJY_FDC,DJY_FDC,YF_FDC,HSM_FDC,PTZ_FDC,YLZ_FDC
+runWindpowerstation: GJY_FDC,DJY_FDC,YF_FDC,HSM_FDC,PTZ_FDC,YLZ_FDC,ZK_FDC
 #计算状态用ai或者di
 clauStatus:
   ai: GJY03_GC,YLZ01_GC   #配置期次
-  di: GJY01_GC,GJY02_GC,DJY01_GC,DJY02_GC,YF01_GC,YF02_GC,HSM01_GC,PTZ01_GC
+  di: GJY01_GC,GJY02_GC,DJY01_GC,DJY02_GC,YF01_GC,YF02_GC,HSM01_GC,PTZ01_GC,ZK01_GC
 #判断数据终端
 second: 1800
 #判断降出力
@@ -100,7 +100,7 @@ AI178: 17.4    #转矩给定
 #计算电量直接取,如果不是1就是相减算
 typeOfElectric:
   #直接取
-  direct: GJY02_GC,YF01_GC,YF02_GC,HSM01_GC,PTZ01_GC
+  direct: GJY02_GC,YF01_GC,YF02_GC,HSM01_GC,PTZ01_GC,ZK01_GC
 
 
 

+ 20 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/controller/InputoroutputspeedtotalController.java

@@ -0,0 +1,20 @@
+package com.gyee.ghost.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-04
+ */
+@RestController
+@RequestMapping("//inputoroutputspeedtotal")
+public class InputoroutputspeedtotalController {
+
+}

+ 20 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/controller/NatureController.java

@@ -0,0 +1,20 @@
+package com.gyee.ghost.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-04
+ */
+@RestController
+@RequestMapping("//nature")
+public class NatureController {
+
+}

+ 20 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/controller/ShutdowneventController.java

@@ -0,0 +1,20 @@
+package com.gyee.ghost.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-04
+ */
+@RestController
+@RequestMapping("//shutdownevent")
+public class ShutdowneventController {
+
+}

+ 16 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/controller/ghost/GhostController.java

@@ -7,6 +7,7 @@ import com.gyee.common.config.R;
 import com.gyee.common.model.StringUtils;
 import com.gyee.ghost.init.CacheContext;
 import com.gyee.ghost.model.auto.Fanoperation;
+import com.gyee.ghost.model.auto.Nature;
 import com.gyee.ghost.model.auto.Windpowerstation;
 import com.gyee.ghost.service.auto.GhostService;
 import org.springframework.web.bind.annotation.*;
@@ -47,4 +48,19 @@ public class GhostController {
             return R.error().message("访问失败");
         }
     }
+
+    @GetMapping("/nature")
+    @ResponseBody
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    public R nature(
+            @RequestParam(value = "wpid",required = true)String wpid,
+            @RequestParam(value = "beginDate",required = true)String beginDate,
+            @RequestParam(value = "endDate",required = true)String endDate){
+        List<Nature> resultList = ghostService.listNature(wpid,beginDate,endDate);
+        if (StringUtils.isNotNull(resultList)) {
+            return R.ok((long) resultList.size()).data(resultList);
+        }else{
+            return R.error().message("访问失败");
+        }
+    }
 }

+ 0 - 1
web/gdsx-ghost/src/main/java/com/gyee/ghost/init/CacheContext.java

@@ -53,6 +53,5 @@ public class CacheContext implements CommandLineRunner {
 
 
 
-        ghostService.saveFanoperation("2022-08-01","2022-08-02");
     }
 }

+ 16 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/mapper/auto/InputoroutputspeedtotalMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.ghost.mapper.auto;
+
+import com.gyee.ghost.model.auto.Inputoroutputspeedtotal;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-04
+ */
+public interface InputoroutputspeedtotalMapper extends BaseMapper<Inputoroutputspeedtotal> {
+
+}

+ 16 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/mapper/auto/NatureMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.ghost.mapper.auto;
+
+import com.gyee.ghost.model.auto.Nature;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-04
+ */
+public interface NatureMapper extends BaseMapper<Nature> {
+
+}

+ 22 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/mapper/auto/ShutdowneventMapper.java

@@ -0,0 +1,22 @@
+package com.gyee.ghost.mapper.auto;
+
+import com.gyee.ghost.model.auto.Shutdownevent;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-04
+ */
+public interface ShutdowneventMapper extends BaseMapper<Shutdownevent> {
+    @Select("select * from shutdownevent where to_char(stoptime,'yyyy-MM-dd')  = to_char(#{date},'yyyy-MM-dd') ")
+    List<Shutdownevent> selectByRecordate(@Param("date") Date date);
+}

+ 164 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/model/auto/Inputoroutputspeedtotal.java

@@ -0,0 +1,164 @@
+package com.gyee.ghost.model.auto;
+
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-04
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Inputoroutputspeedtotal extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    private Integer id;
+
+    private String windturbineid;
+
+    private Date recorddate;
+
+    private Double dayinputsmall;
+
+    private Double dayinputsmallmin;
+
+    private Double dayinputsmallmax;
+
+    private Double dayinputbig;
+
+    private Double dayinputbigmin;
+
+    private Double dayinputbigmax;
+
+    private Double dayoutputsmall;
+
+    private Double dayoutputsmallmin;
+
+    private Double dayoutputsmallmax;
+
+    private Double dayoutputbig;
+
+    private Double dayoutputbigmin;
+
+    private Double dayoutputbigmax;
+
+    private Double monthinputsmall;
+
+    private Double monthinputsmallmin;
+
+    private Double monthinputsmallmax;
+
+    private Double monthinputbig;
+
+    private Double monthinputbigmin;
+
+    private Double monthinputbigmax;
+
+    private Double monthoutputsmall;
+
+    private Double monthoutputsmallmin;
+
+    private Double monthoutputsmallmax;
+
+    private Double monthoutputbig;
+
+    private Double monthoutputbigmin;
+
+    private Double monthoutputbigmax;
+
+    private Double yearinputsmall;
+
+    private Double yearinputsmallmin;
+
+    private Double yearinputsmallmax;
+
+    private Double yearinputbig;
+
+    private Double yearinputbigmin;
+
+    private Double yearinputbigmax;
+
+    private Double yearoutputsmall;
+
+    private Double yearoutputsmallmin;
+
+    private Double yearoutputsmallmax;
+
+    private Double yearoutputbig;
+
+    private Double yearoutputbigmin;
+
+    private Double yearoutputbigmax;
+
+    private Double inputsmall;
+
+    private Double inputsmallmin;
+
+    private Double inputsmallmax;
+
+    private Double inputbig;
+
+    private Double inputbigmin;
+
+    private Double inputbigmax;
+
+    private Double outputsmall;
+
+    private Double outputsmallmin;
+
+    private Double outputsmallmax;
+
+    private Double outputbig;
+
+    private Double outputbigmin;
+
+    private Double outputbigmax;
+
+    private Double dayinputsmallratio;
+
+    private Double dayoutputsmallratio;
+
+    private Double dayinputbigratio;
+
+    private Double dayoutputbigratio;
+
+    private Double monthinputsmallratio;
+
+    private Double monthoutputsmallratio;
+
+    private Double monthinputbigratio;
+
+    private Double monthoutputbigratio;
+
+    private Double yearinputsmallratio;
+
+    private Double yearoutputsmallratio;
+
+    private Double yearinputbigratio;
+
+    private Double yearoutputbigratio;
+
+    private Double inputsmallratio;
+
+    private Double outputsmallratio;
+
+    private Double inputbigratio;
+
+    private Double outputbigmaxratio;
+
+    private String windpowerstationid;
+
+    private String projectid;
+
+    private String lineid;
+
+
+}

+ 56 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/model/auto/Nature.java

@@ -0,0 +1,56 @@
+package com.gyee.ghost.model.auto;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import java.util.Date;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-04
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Nature extends Model {
+
+    private static final long serialVersionUID = 1L;
+    @TableId(value = "ID",type = IdType.INPUT)
+    private String id;
+
+    private String windturbineid;
+
+    private String windturbinename;
+
+    private String windpowerstationid;
+
+    private Double generatingcapacity;
+
+    private Double inputsmall;
+
+    private String inputsmallspeed;
+
+    private String edinputsmallspeed;
+
+    private String edinputsavgspeed;
+
+    private String edinputbigpower;
+
+    private String edinputavgpower;
+
+    private Double availability;
+
+    private Integer faultcount;
+
+    private Double faulttime;
+
+    private Date recorddate;
+
+
+}

+ 62 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/model/auto/Shutdownevent.java

@@ -0,0 +1,62 @@
+package com.gyee.ghost.model.auto;
+
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import java.util.Date;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-04
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Shutdownevent extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    private String id;
+
+    private String windpowerstationid;
+
+    private String windturbineid;
+
+    private Date stoptime;
+
+    private Date starttime;
+
+    private Double stophours;
+
+    private Double losspower;
+
+    private String stoptypeid;
+
+    private Integer ishandle;
+
+    private String warningid;
+
+    private String projectid;
+
+    private String handleway;
+
+    private String faultview;
+
+    private Integer statuscode;
+
+    private String mainid;
+
+    private String resetrate;
+
+    private String staterate;
+
+    private String failrate;
+
+    private Integer warningrecordsid;
+
+
+}

+ 112 - 5
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/GhostService.java

@@ -10,17 +10,17 @@ import com.gyee.common.util.DateUtils;
 import com.gyee.common.util.DoubleUtils;
 import com.gyee.common.util.SortUtils;
 import com.gyee.ghost.init.CacheContext;
-import com.gyee.ghost.model.auto.Fanoperation;
-import com.gyee.ghost.model.auto.Windturbine;
-import com.gyee.ghost.model.auto.Windturbineinfoday;
-import com.gyee.ghost.model.auto.Windturbineinfoday3;
+import com.gyee.ghost.model.auto.*;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.sql.Timestamp;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.Optional;
+import java.util.stream.Collectors;
 
 @Service
 public class GhostService {
@@ -30,6 +30,12 @@ public class GhostService {
     private IWindturbineinfoday3Service windturbineinfoday3Service;
     @Resource
     private IFanoperationService fanoperationService;
+    @Resource
+    private INatureService natureService;
+    @Resource
+    private IInputoroutputspeedtotalService inputoroutputspeedtotalService;
+    @Resource
+    private IShutdowneventService shutdowneventService;
     /**
      * 存储fanoperation运行分析表
      */
@@ -95,6 +101,75 @@ public class GhostService {
     }
 
     /**
+     * 存储nature性能分析表
+     */
+    public void saveNature(String beginDate,String endDate){
+        List<String> days = DateUtils.getDays(beginDate, endDate);
+        days.stream().forEach(day->{
+
+            List<Nature> resultList = new ArrayList<>();
+            Date date = DateUtils.parseDate(day);
+
+            QueryWrapper<Nature> delQw = new QueryWrapper<>();
+            delQw.eq("recorddate",date);
+            natureService.remove(delQw);
+
+
+            QueryWrapper<Inputoroutputspeedtotal> inputoroutputspeedtotalQueryWrapper = new QueryWrapper<>();
+            inputoroutputspeedtotalQueryWrapper.eq("recorddate",date);
+            List<Inputoroutputspeedtotal> inputoroutputspeedtotalList = inputoroutputspeedtotalService.list(inputoroutputspeedtotalQueryWrapper);
+
+            QueryWrapper<Windturbineinfoday> windturbineinfodayQueryWrapper = new QueryWrapper<>();
+            windturbineinfodayQueryWrapper.eq("recorddate",date);
+            List<Windturbineinfoday> windturbineinfodayList = windturbineinfodayService.list(windturbineinfodayQueryWrapper);
+
+
+            List<Shutdownevent> shutdowneventList = shutdowneventService.selectByRecordate(date);
+
+
+            List<Windturbine> wtls = CacheContext.wtls;
+            wtls.stream().forEach(wt->{
+                Nature nature = new Nature();
+                nature.setId(CommonUtils.getUUID());
+                nature.setWindturbineid(wt.getId());
+                nature.setWindturbinename(wt.getName());
+                nature.setWindpowerstationid(wt.getWindpowerstationid());
+
+                Optional<Windturbineinfoday> optionalWindturbineinfoday = windturbineinfodayList.stream().filter(w -> w.getWindturbineid().equals(wt.getId())).findFirst();
+                Optional<Inputoroutputspeedtotal> optionalInputoroutputspeedtotal = inputoroutputspeedtotalList.stream().filter(w -> w.getWindturbineid().equals(wt.getId())).findFirst();
+                List<Shutdownevent> shutdownevents = shutdowneventList.stream().filter(w -> w.getWindturbineid().equals(wt.getId())).collect(Collectors.toList());
+
+
+                if (optionalWindturbineinfoday.isPresent()){
+                    Windturbineinfoday windturbineinfoday = optionalWindturbineinfoday.get();
+                    nature.setGeneratingcapacity(DoubleUtils.keepPrecision(windturbineinfoday.getGeneratingcapacity(),2));
+                    nature.setAvailability(DoubleUtils.keepPrecision(windturbineinfoday.getDaysbklyl(),2));
+                    nature.setFaulttime(DoubleUtils.keepPrecision(windturbineinfoday.getFaulttime(),2));
+                }
+                if (optionalInputoroutputspeedtotal.isPresent()){
+                    Inputoroutputspeedtotal inputoroutputspeedtotal = optionalInputoroutputspeedtotal.get();
+                    nature.setInputsmall(DoubleUtils.keepPrecision(inputoroutputspeedtotal.getInputsmallmin(),2));
+                }
+                int size = 0;
+                if (StringUtils.isNotEmpty(shutdownevents)){
+                    size = shutdownevents.size();
+                }
+                nature.setFaultcount(size);
+                nature.setInputsmallspeed("无数据");
+                nature.setEdinputsmallspeed("无数据");
+                nature.setEdinputsavgspeed("无数据");
+                nature.setEdinputavgpower("无数据");
+                nature.setEdinputbigpower("无数据");
+                nature.setRecorddate(date);
+                resultList.add(nature);
+            });
+
+            natureService.saveBatch(resultList);
+
+        });
+    }
+
+    /**
      * 查询运行分析
      * @return
      * @param beginDate
@@ -124,10 +199,42 @@ public class GhostService {
         List<Fanoperation> hjlist = fanoperationService.list(qw);
         if (StringUtils.isNotNull(hjlist)){
             Fanoperation fanoperation = hjlist.get(0);
-            fanoperation.setWindpowerstationid("合计");
+            fanoperation.setWindturbineid("合计");
             fanoperation.setWindturbinename("合计");
             resultList.add(fanoperation);
         }
         return resultList;
     }
+
+
+    public List<Nature> listNature(String wpid, String beginDate, String endDate) {
+        List<Nature> resultList = new ArrayList<>();
+        Date begin = DateUtils.parseDate(beginDate);
+        Date end = DateUtils.parseDate(endDate);
+        QueryWrapper<Nature> qw = new QueryWrapper<>();
+        qw.select("windturbineid,windturbinename,sum(generatingcapacity) generatingcapacity,min(inputsmall) inputsmall,max(inputsmallspeed) inputsmallspeed,max(edinputsmallspeed) edinputsmallspeed,max(edinputsavgspeed) edinputsavgspeed,max(edinputbigpower) edinputbigpower,max(edinputavgpower) edinputavgpower,avg(availability) availability,sum(faultcount) faultcount,sum(faulttime) faulttime");
+        qw.ge("recorddate",begin).le("recorddate",end);
+        if (StringUtils.isNotEmpty(wpid)){
+            qw.eq("windpowerstationid",wpid);
+        }
+        qw.groupBy("windturbineid,windturbinename");
+        List<Nature> list = natureService.list(qw);
+        resultList.addAll(list);
+        SortUtils.sort(resultList,"windturbineid",SortUtils.ASC);
+
+        qw.clear();
+        qw.select("windturbineid,windturbinename,sum(generatingcapacity) generatingcapacity,min(inputsmall) inputsmall,max(inputsmallspeed) inputsmallspeed,max(edinputsmallspeed) edinputsmallspeed,max(edinputsavgspeed) edinputsavgspeed,max(edinputbigpower) edinputbigpower,max(edinputavgpower) edinputavgpower,avg(availability) availability,sum(faultcount) faultcount,sum(faulttime) faulttime");
+        qw.ge("recorddate",begin).le("recorddate",end);
+        if (StringUtils.isNotEmpty(wpid)){
+            qw.eq("windpowerstationid",wpid);
+        }
+        List<Nature> hjlist = natureService.list(qw);
+        if (StringUtils.isNotNull(hjlist)){
+            Nature nature = hjlist.get(0);
+            nature.setWindturbineid("合计");
+            nature.setWindturbinename("合计");
+            resultList.add(nature);
+        }
+        return resultList;
+    }
 }

+ 16 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/IInputoroutputspeedtotalService.java

@@ -0,0 +1,16 @@
+package com.gyee.ghost.service.auto;
+
+import com.gyee.ghost.model.auto.Inputoroutputspeedtotal;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-04
+ */
+public interface IInputoroutputspeedtotalService extends IService<Inputoroutputspeedtotal> {
+
+}

+ 16 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/INatureService.java

@@ -0,0 +1,16 @@
+package com.gyee.ghost.service.auto;
+
+import com.gyee.ghost.model.auto.Nature;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-04
+ */
+public interface INatureService extends IService<Nature> {
+
+}

+ 20 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/IShutdowneventService.java

@@ -0,0 +1,20 @@
+package com.gyee.ghost.service.auto;
+
+import com.gyee.ghost.model.auto.Shutdownevent;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-04
+ */
+public interface IShutdowneventService extends IService<Shutdownevent> {
+
+    List<Shutdownevent> selectByRecordate(Date date);
+}

+ 20 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/impl/InputoroutputspeedtotalServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.ghost.service.auto.impl;
+
+import com.gyee.ghost.model.auto.Inputoroutputspeedtotal;
+import com.gyee.ghost.mapper.auto.InputoroutputspeedtotalMapper;
+import com.gyee.ghost.service.auto.IInputoroutputspeedtotalService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-04
+ */
+@Service
+public class InputoroutputspeedtotalServiceImpl extends ServiceImpl<InputoroutputspeedtotalMapper, Inputoroutputspeedtotal> implements IInputoroutputspeedtotalService {
+
+}

+ 20 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/impl/NatureServiceImpl.java

@@ -0,0 +1,20 @@
+package com.gyee.ghost.service.auto.impl;
+
+import com.gyee.ghost.model.auto.Nature;
+import com.gyee.ghost.mapper.auto.NatureMapper;
+import com.gyee.ghost.service.auto.INatureService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-04
+ */
+@Service
+public class NatureServiceImpl extends ServiceImpl<NatureMapper, Nature> implements INatureService {
+
+}

+ 30 - 0
web/gdsx-ghost/src/main/java/com/gyee/ghost/service/auto/impl/ShutdowneventServiceImpl.java

@@ -0,0 +1,30 @@
+package com.gyee.ghost.service.auto.impl;
+
+import com.gyee.ghost.model.auto.Shutdownevent;
+import com.gyee.ghost.mapper.auto.ShutdowneventMapper;
+import com.gyee.ghost.service.auto.IShutdowneventService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 谢生杰
+ * @since 2022-08-04
+ */
+@Service
+public class ShutdowneventServiceImpl extends ServiceImpl<ShutdowneventMapper, Shutdownevent> implements IShutdowneventService {
+
+    @Resource
+    private ShutdowneventMapper shutdowneventMapper;
+    @Override
+    public List<Shutdownevent> selectByRecordate(Date date) {
+        return shutdowneventMapper.selectByRecordate(date);
+    }
+}

+ 13 - 1
web/gdsx-ghost/src/main/java/com/gyee/ghost/task/SaticScheduleTask.java

@@ -28,7 +28,7 @@ public class SaticScheduleTask {
     @Scheduled(cron = "0 0 1 * * ?")
     //或直接指定时间间隔,例如:5秒
     //@Scheduled(fixedRate=5000)
-    private void analysisTasks() {
+    private void fanoperation() {
         String yesterday = DateUtils.getYesterdayStr("yyyy-MM-dd");
         try {
             ghostService.saveFanoperation(yesterday,yesterday);
@@ -37,5 +37,17 @@ public class SaticScheduleTask {
         }
     }
 
+    @Scheduled(cron = "0 0 2 * * ?")
+    //或直接指定时间间隔,例如:5秒
+    //@Scheduled(fixedRate=5000)
+    private void nature() {
+        String yesterday = DateUtils.getYesterdayStr("yyyy-MM-dd");
+        try {
+            ghostService.saveNature(yesterday,yesterday);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
 
 }

+ 24 - 24
web/gdsx-ghost/src/main/resources/application-dev.yml

@@ -9,18 +9,18 @@ spring:
     name:
   main:
     allow-bean-definition-overriding: true #当遇到同样名字的时候,是否允许覆盖注册
-#  cloud:
-#    nacos:
-#      discovery:
-#        server-addr: 192.168.2.216:8848
-#        #指定yaml格式的配置
-#        file-extension: yaml
-#        cluster-name: master
-#      username: nacos
-#      password: nacos
+  #  cloud:
+  #    nacos:
+  #      discovery:
+  #        server-addr: 192.168.2.216:8848
+  #        #指定yaml格式的配置
+  #        file-extension: yaml
+  #        cluster-name: master
+  #      username: nacos
+  #      password: nacos
   #redis集群
   redis:
-#    host: 10.83.68.94
+    #    host: 10.83.68.94
     host: 11.0.118.57
     port: 6379
     timeout: 100000
@@ -44,24 +44,24 @@ spring:
     exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
   datasource:
     type: com.alibaba.druid.pool.DruidDataSource
-    driver-class-name: oracle.jdbc.OracleDriver
-    外网
-    url: jdbc:oracle:thin:@11.0.118.57:1521:gdsj
+    #    driver-class-name: oracle.jdbc.OracleDriver
+    #    #外网
+    #    url: jdbc:oracle:thin:@11.0.118.57:1521:gdsj
+    #    username: gdprod
+    #    password: gd123
+    #    oracle-schema=:
+
+    #    url: jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf8&serverTimezone=UTC
+    #    username: root
+    #    password: root
+    #    driver-class-name: com.mysql.jdbc.Driver
+
+    driver-class-name: org.postgresql.Driver
+    url: jdbc:postgresql://10.81.3.151:5432/wisdom
     username: gdprod
     password: gd123
     oracle-schema=:
 
-#    url: jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf8&serverTimezone=UTC
-#    username: root
-#    password: root
-#    driver-class-name: com.mysql.jdbc.Driver
-
-#    driver-class-name: org.postgresql.Driver
-#    url: jdbc:postgresql://10.81.3.151:5432/wisdom
-#    username: gdprod
-#    password: gd123
-#    oracle-schema=:
-
     druid:
       max-active: 20
       initial-size: 1

+ 8 - 8
web/gdsx-ghost/src/main/resources/application.yml

@@ -46,9 +46,9 @@ spring:
     type: com.alibaba.druid.pool.DruidDataSource
     driver-class-name: oracle.jdbc.OracleDriver
     #外网
-    url: jdbc:oracle:thin:@11.0.118.57:1521:gdsj
-    username: gdprod
-    password: gd123
+    url: jdbc:oracle:thin:@123.60.213.70:1521:gdnxfd
+    username: nxfdprod
+    password: gdnxfd123
     oracle-schema=:
 
     #    url: jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf8&serverTimezone=UTC
@@ -56,11 +56,11 @@ spring:
     #    password: root
     #    driver-class-name: com.mysql.jdbc.Driver
 
-#        driver-class-name: org.postgresql.Driver
-#        url: jdbc:postgresql://10.81.3.151:5432/wisdom
-#        username: gdprod
-#        password: gd123
-#        oracle-schema=:
+#    driver-class-name: org.postgresql.Driver
+#    url: jdbc:postgresql://10.81.3.151:5432/wisdom
+#    username: gdprod
+#    password: gd123
+#    oracle-schema=:
 
     druid:
       max-active: 20

+ 1 - 1
web/gdsx-ghost/src/test/java/com/gyee/ghost/GhostTest.java

@@ -22,6 +22,6 @@ public class GhostTest {
 
     @Test
     public void test1(){
-        ghostService.saveFanoperation("2022-08-01","2022-08-01");
+        ghostService.saveNature("2021-07-01","2021-07-01");
     }
 }