Selaa lähdekoodia

添加心注册接口

wangchangsheng 2 vuotta sitten
vanhempi
commit
ad46f715e7

+ 39 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/controller/peranalysis/EBAPerSisController.java

@@ -0,0 +1,39 @@
+package com.gyee.consumer.controller.peranalysis;
+
+import com.gyee.common.domain.AjaxResult;
+import com.gyee.consumer.service.peranalysis.EBApersisService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+@RestController
+@RequestMapping("/ebapersis")
+@Api(value = "EBA能效分析", tags = "EBA能效分析")
+public class EBAPerSisController {
+
+    @Resource
+    private EBApersisService ebApersisService;
+
+
+    /**
+     * 报警类型列表
+     *
+     * @return
+     */
+    @GetMapping("/getebapersislist")
+    @ResponseBody
+    @CrossOrigin
+    @ApiOperation(value = "EBA能效分析", notes = "EBA能效分析")
+    public AjaxResult getEBAPerSisList(@RequestParam(value = "companyid", required = false) String companyid,
+                                       @RequestParam(value = "regionid", required = false) String regionid,
+                                       @RequestParam(value = "station", required = false) String station,
+                                       @RequestParam(value = "year", required = false) String year,
+                                       @RequestParam(value = "month", required = false) String month) {
+
+        AjaxResult ajax = ebApersisService.getEBAPerSisList(companyid,regionid,station,year,month);
+
+        return ajax;
+    }
+}

+ 34 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/controller/peranalysis/ElePerAnalysisController.java

@@ -0,0 +1,34 @@
+package com.gyee.consumer.controller.peranalysis;
+
+
+import com.gyee.consumer.service.peranalysis.ElePerAnalysisService;
+import com.gyee.frame.common.domain.AjaxResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+@RestController
+@RequestMapping("/eleperanalysis")
+@Api(value = "月电量分析", tags = "月电量分析")
+public class ElePerAnalysisController {
+
+    @Resource
+    private ElePerAnalysisService elePerAnalysisService;
+
+    @GetMapping("/geteleperanalysislist")
+    @ResponseBody
+    @ApiOperation(value = "月电量分析", notes = "月电量分析")
+    public AjaxResult ElePerAnalysisList(
+            @RequestParam(value = "companyid", required = false) String companyid,
+            @RequestParam(value = "regionid", required = false) String regionid,
+            @RequestParam(value = "station", required = false) String station,
+            @RequestParam(value = "year", required = false) String year,
+            @RequestParam(value = "month", required = false) String month
+    ) throws Exception {
+        AjaxResult ajax = elePerAnalysisService.getElePerAnalysisList(companyid,regionid,station,year,month);
+
+        return ajax;
+    }
+}

+ 55 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/controller/peranalysis/PointPerSisController.java

@@ -0,0 +1,55 @@
+package com.gyee.consumer.controller.peranalysis;
+
+import com.gyee.consumer.service.peranalysis.PointPerSisService;
+import com.gyee.frame.common.domain.AjaxResult;
+import io.swagger.annotations.Api;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+@RestController
+@RequestMapping("/pointpersis")
+@Api(value = "测点曲线分析", tags = "测点曲线分析")
+public class PointPerSisController {
+
+
+    @Resource
+    private PointPerSisService pointPerSisService;
+
+    /**
+     * 测点曲线分析
+     * @param wtid
+     * @param beginDate
+     * @param endDate
+     * @param interval
+     * @param uniformcodes
+     * @return
+     */
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    @GetMapping(value = "/getPointPerSisList")
+    public AjaxResult getPointPerSisList(
+            @RequestParam(value = "wtid",required = true)String wtid,
+            @RequestParam(value = "beginDate",required = true)Long beginDate,
+            @RequestParam(value = "endDate",required = true)Long endDate,
+            @RequestParam(value = "interval",required = true)Integer interval,
+            @RequestParam(value = "uniformcodes",required = true)String uniformcodes
+
+    ){
+
+        AjaxResult ajax = pointPerSisService.getPointPerSisList(wtid,beginDate,endDate,interval,uniformcodes);
+
+        return ajax;
+
+    }
+
+
+    /**
+     * 获取测点
+     * @return
+     */
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    @GetMapping(value = "/getpoints")
+    public AjaxResult getpoints(){
+        return null;
+    }
+}

+ 40 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/controller/peranalysis/StationPerSisController.java

@@ -0,0 +1,40 @@
+package com.gyee.consumer.controller.peranalysis;
+
+import com.gyee.consumer.service.peranalysis.StationPerSisService;
+import com.gyee.frame.common.domain.AjaxResult;
+import io.swagger.annotations.Api;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+@RestController
+@RequestMapping("/stationPersis")
+@Api(value = "场站性能分析", tags = "场站性能分析")
+public class StationPerSisController {
+
+
+    @Resource
+    private StationPerSisService stationPerSisService;
+
+    /**
+     * 场站性能分析
+     *
+     * @param station
+     * @param startdate
+     * @param enddate
+     */
+    @CrossOrigin(origins = "*", maxAge = 3600)
+    @GetMapping(value = "/getStationPersis")
+    public AjaxResult getStationPersis(
+            @RequestParam(value = "station", required = false) String station,
+            @RequestParam(value = "startdate", required = false) String startdate,
+            @RequestParam(value = "enddate", required = false) String enddate) {
+
+
+        AjaxResult ajax = stationPerSisService.getStationPersis(station, startdate, enddate);
+
+        return ajax;
+
+    }
+
+}

+ 19 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/fallback/peranalysis/EBApersisServiceFallbackFactory.java

@@ -0,0 +1,19 @@
+package com.gyee.consumer.fallback.peranalysis;
+
+import com.gyee.common.domain.AjaxResult;
+import com.gyee.consumer.service.peranalysis.EBApersisService;
+import feign.hystrix.FallbackFactory;
+
+public class EBApersisServiceFallbackFactory implements FallbackFactory<EBApersisService> {
+    @Override
+    public EBApersisService create(Throwable throwable) {
+
+        return new EBApersisService(){
+
+            @Override
+            public AjaxResult getEBAPerSisList(String companyid, String regionid, String station, String year, String month) {
+                return  AjaxResult.error(throwable.getMessage());
+            }
+        };
+    }
+}

+ 18 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/fallback/peranalysis/ElePerAnalysisServiceFallbackFactory.java

@@ -0,0 +1,18 @@
+package com.gyee.consumer.fallback.peranalysis;
+
+import com.gyee.consumer.service.peranalysis.ElePerAnalysisService;
+import com.gyee.frame.common.domain.AjaxResult;
+import feign.hystrix.FallbackFactory;
+
+public class ElePerAnalysisServiceFallbackFactory implements FallbackFactory<ElePerAnalysisService> {
+    @Override
+    public ElePerAnalysisService create(Throwable throwable) {
+        return new ElePerAnalysisService(){
+
+            @Override
+            public AjaxResult getElePerAnalysisList(String companyid, String regionid, String station, String year, String month) {
+                return AjaxResult.error(throwable.getMessage());
+            }
+        };
+    }
+}

+ 25 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/fallback/peranalysis/PointPerSisServiceFallbackFactory.java

@@ -0,0 +1,25 @@
+package com.gyee.consumer.fallback.peranalysis;
+
+import com.gyee.consumer.service.peranalysis.PointPerSisService;
+import com.gyee.frame.common.domain.AjaxResult;
+import feign.hystrix.FallbackFactory;
+
+public class PointPerSisServiceFallbackFactory implements FallbackFactory<PointPerSisService> {
+
+
+    @Override
+    public PointPerSisService create(Throwable throwable) {
+        return new PointPerSisService(){
+
+            @Override
+            public AjaxResult getPointPerSisList(String wtid, Long beginDate, Long endDate, Integer interval, String uniformcodes) {
+                return AjaxResult.error(throwable.getMessage());
+            }
+
+            @Override
+            public AjaxResult getpoints() {
+                return AjaxResult.error(throwable.getMessage());
+            }
+        };
+    }
+}

+ 18 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/fallback/peranalysis/StationPerSisServiceFallbackFactory.java

@@ -0,0 +1,18 @@
+package com.gyee.consumer.fallback.peranalysis;
+
+import com.gyee.consumer.service.peranalysis.StationPerSisService;
+import com.gyee.frame.common.domain.AjaxResult;
+import feign.hystrix.FallbackFactory;
+
+public class StationPerSisServiceFallbackFactory implements FallbackFactory<StationPerSisService> {
+    @Override
+    public StationPerSisService create(Throwable throwable) {
+        return new StationPerSisService() {
+
+            @Override
+            public AjaxResult getStationPersis(String station, String startdate, String enddate) {
+                return AjaxResult.error(throwable.getMessage());
+            }
+        };
+    }
+}

+ 27 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/service/peranalysis/EBApersisService.java

@@ -0,0 +1,27 @@
+package com.gyee.consumer.service.peranalysis;
+
+import com.gyee.common.domain.AjaxResult;
+import com.gyee.consumer.config.FeignConfiguration;
+import com.gyee.consumer.fallback.peranalysis.EBApersisServiceFallbackFactory;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+@FeignClient(name = "powercompare", url = "${provider.peranalyurl}",
+        fallbackFactory = EBApersisServiceFallbackFactory.class,
+        configuration = FeignConfiguration.class)
+public interface EBApersisService {
+
+
+
+    @GetMapping("/powercompare/getebapersislist")
+    @ApiOperation(value = "EBA能效分析", notes = "EBA能效分析")
+    public AjaxResult getEBAPerSisList(@RequestParam(value = "companyid", required = false) String companyid,
+                                       @RequestParam(value = "regionid", required = false) String regionid,
+                                       @RequestParam(value = "station", required = false) String station,
+                                       @RequestParam(value = "year", required = false) String year,
+                                       @RequestParam(value = "month", required = false) String month);
+
+
+}

+ 26 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/service/peranalysis/ElePerAnalysisService.java

@@ -0,0 +1,26 @@
+package com.gyee.consumer.service.peranalysis;
+
+import com.gyee.consumer.config.FeignConfiguration;
+import com.gyee.consumer.fallback.peranalysis.ElePerAnalysisServiceFallbackFactory;
+import com.gyee.frame.common.domain.AjaxResult;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+@FeignClient(name = "powercompare", url = "${provider.peranalyurl}",
+        fallbackFactory = ElePerAnalysisServiceFallbackFactory.class,
+        configuration = FeignConfiguration.class)
+public interface ElePerAnalysisService {
+
+    @GetMapping("/powercompare/geteleperanalysislist")
+    @ApiOperation(value = "月电量分析", notes = "月电量分析")
+    public AjaxResult getElePerAnalysisList(
+            @RequestParam(value = "companyid", required = false) String companyid,
+            @RequestParam(value = "regionid", required = false) String regionid,
+            @RequestParam(value = "station", required = false) String station,
+            @RequestParam(value = "year", required = false) String year,
+            @RequestParam(value = "month", required = false) String month
+    );
+
+}

+ 46 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/service/peranalysis/PointPerSisService.java

@@ -0,0 +1,46 @@
+package com.gyee.consumer.service.peranalysis;
+
+
+import com.gyee.consumer.config.FeignConfiguration;
+import com.gyee.consumer.fallback.peranalysis.PointPerSisServiceFallbackFactory;
+import com.gyee.frame.common.domain.AjaxResult;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+@FeignClient(name = "pointpersis", url = "${provider.peranalyurl}",
+        fallbackFactory = PointPerSisServiceFallbackFactory.class,
+        configuration = FeignConfiguration.class)
+public interface PointPerSisService {
+
+    /**
+     * 测点曲线分析
+     *
+     * @param wtid
+     * @param beginDate
+     * @param endDate
+     * @param interval
+     * @param uniformcodes
+     * @return
+     */
+    @GetMapping(value = "/pointpersis/getPointPerSisList")
+    public AjaxResult getPointPerSisList(
+            @RequestParam(value = "wtid", required = true) String wtid,
+            @RequestParam(value = "beginDate", required = true) Long beginDate,
+            @RequestParam(value = "endDate", required = true) Long endDate,
+            @RequestParam(value = "interval", required = true) Integer interval,
+            @RequestParam(value = "uniformcodes", required = true) String uniformcodes
+
+    );
+
+
+    /**
+     * 获取测点
+     *
+     * @return
+     */
+    @GetMapping(value = "/pointpersis/getpoints")
+    public AjaxResult getpoints();
+
+
+}

+ 30 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/service/peranalysis/StationPerSisService.java

@@ -0,0 +1,30 @@
+package com.gyee.consumer.service.peranalysis;
+
+
+import com.gyee.consumer.config.FeignConfiguration;
+import com.gyee.consumer.fallback.peranalysis.PointPerSisServiceFallbackFactory;
+import com.gyee.consumer.fallback.peranalysis.StationPerSisServiceFallbackFactory;
+import com.gyee.frame.common.domain.AjaxResult;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+@FeignClient(name = "stationpersis", url = "${provider.peranalyurl}",
+        fallbackFactory = StationPerSisServiceFallbackFactory.class,
+        configuration = FeignConfiguration.class)
+public interface StationPerSisService {
+
+
+    /**
+     * 场站性能分析
+     *
+     * @param station
+     * @param startdate
+     * @param enddate
+     */
+    @GetMapping(value = "/stationpersis/getStationPersis")
+    public AjaxResult getStationPersis(
+            @RequestParam(value = "station", required = false) String station,
+            @RequestParam(value = "startdate", required = false) String startdate,
+            @RequestParam(value = "enddate", required = false) String enddate);
+}