wangchangsheng 2 years ago
parent
commit
658d276c44

+ 27 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/config/FeignConfiguration.java

@@ -9,6 +9,10 @@ import com.gyee.consumer.fallback.health.HealthServiceFallbackFactory;
 import com.gyee.consumer.fallback.leaderboard.LeaderboardServiceFallbackFactory;
 import com.gyee.consumer.fallback.monitor.*;
 import com.gyee.consumer.fallback.outputspeed.InputoroutputspeedtotalServiceFallbackFactory;
+import com.gyee.consumer.fallback.peranalysis.EbapersisServiceFallbackFactory;
+import com.gyee.consumer.fallback.peranalysis.ElePerAnalysisServiceFallbackFactory;
+import com.gyee.consumer.fallback.peranalysis.PointPerSisServiceFallbackFactory;
+import com.gyee.consumer.fallback.peranalysis.StationPerSisServiceFallbackFactory;
 import com.gyee.consumer.fallback.powercompare.PowerCompareServiceFallbackFactory;
 import com.gyee.consumer.fallback.powersaturation.PowersaturationServiceFallbackFactory;
 import com.gyee.consumer.fallback.projectplan.ProjectPlanServiceFallbackFactory;
@@ -141,4 +145,27 @@ public class FeignConfiguration {
     }
 
 
+    @Bean
+    public EbapersisServiceFallbackFactory ebapersisServiceFallbackFactory() {
+        return new EbapersisServiceFallbackFactory();
+    }
+    @Bean
+    public ElePerAnalysisServiceFallbackFactory elePerAnalysisServiceFallbackFactory() {
+        return new ElePerAnalysisServiceFallbackFactory();
+    }
+
+    @Bean
+    public PointPerSisServiceFallbackFactory pointPerSisServiceFallbackFactory(){
+        return new PointPerSisServiceFallbackFactory();
+
+    }
+    
+    @Bean
+    public StationPerSisServiceFallbackFactory stationPerSisServiceFallbackFactory(){
+        return new StationPerSisServiceFallbackFactory();
+    }
+
+
+
+
 }

+ 6 - 7
web/consumer-hb/src/main/java/com/gyee/consumer/controller/peranalysis/EBAPerSisController.java

@@ -1,21 +1,20 @@
 package com.gyee.consumer.controller.peranalysis;
 
 import com.gyee.common.domain.AjaxResult;
-import com.gyee.consumer.service.peranalysis.EBApersisService;
+import com.gyee.consumer.service.peranalysis.EbapersisService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.stereotype.Controller;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import javax.annotation.Resource;
 
 @RestController
 @RequestMapping("/ebapersis")
 @Api(value = "EBA能效分析", tags = "EBA能效分析")
-public class EBAPerSisController {
+public class EbapersisController {
 
-    @Resource
-    private EBApersisService ebApersisService;
+    @Autowired
+    private EbapersisService ebapersisService;
 
 
     /**
@@ -33,7 +32,7 @@ public class EBAPerSisController {
                                        @RequestParam(value = "year") String year,
                                        @RequestParam(value = "month") String month) {
 
-        AjaxResult ajax = ebApersisService.getEBAPerSisList(companyid,regionid,station,year,month);
+        AjaxResult ajax = ebapersisService.getEBAPerSisList(companyid,regionid,station,year,month);
 
         return ajax;
     }

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

@@ -5,16 +5,16 @@ import com.gyee.common.domain.AjaxResult;
 import com.gyee.consumer.service.peranalysis.ElePerAnalysisService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import javax.annotation.Resource;
 
 @RestController
 @RequestMapping("/eleperanalysis")
 @Api(value = "月电量分析", tags = "月电量分析")
 public class ElePerAnalysisController {
 
-    @Resource
+    @Autowired
     private ElePerAnalysisService elePerAnalysisService;
 
     @GetMapping("/geteleperanalysislist")

+ 2 - 1
web/consumer-hb/src/main/java/com/gyee/consumer/controller/peranalysis/PointPerSisController.java

@@ -3,6 +3,7 @@ package com.gyee.consumer.controller.peranalysis;
 import com.gyee.consumer.service.peranalysis.PointPerSisService;
 import com.gyee.common.domain.AjaxResult;
 import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -13,7 +14,7 @@ import javax.annotation.Resource;
 public class PointPerSisController {
 
 
-    @Resource
+    @Autowired
     private PointPerSisService pointPerSisService;
 
     /**

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

@@ -4,9 +4,9 @@ import com.gyee.common.domain.AjaxResult;
 import com.gyee.consumer.service.peranalysis.StationPerSisService;
 
 import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import javax.annotation.Resource;
 
 @RestController
 @RequestMapping("/stationPersis")
@@ -14,7 +14,7 @@ import javax.annotation.Resource;
 public class StationPerSisController {
 
 
-    @Resource
+    @Autowired
     private StationPerSisService stationPerSisService;
 
     /**

+ 4 - 5
web/consumer-hb/src/main/java/com/gyee/consumer/fallback/peranalysis/EBApersisServiceFallbackFactory.java

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

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

@@ -2,16 +2,16 @@ 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 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 = "ebapersis", url = "${provider.peranalyurl}",
-        fallbackFactory = EBApersisServiceFallbackFactory.class,
+        fallbackFactory = EbapersisServiceFallbackFactory.class,
         configuration = FeignConfiguration.class)
-public interface EBApersisService {
+public interface EbapersisService {
 
 
 

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

@@ -5,6 +5,7 @@ import com.gyee.consumer.config.FeignConfiguration;
 import com.gyee.consumer.fallback.peranalysis.ElePerAnalysisServiceFallbackFactory;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 

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

@@ -5,6 +5,7 @@ import com.gyee.common.domain.AjaxResult;
 import com.gyee.consumer.config.FeignConfiguration;
 import com.gyee.consumer.fallback.peranalysis.PointPerSisServiceFallbackFactory;
 import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 

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

@@ -5,6 +5,7 @@ import com.gyee.common.domain.AjaxResult;
 import com.gyee.consumer.config.FeignConfiguration;
 import com.gyee.consumer.fallback.peranalysis.StationPerSisServiceFallbackFactory;
 import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestParam;