Browse Source

增加场站、公司、区域查询接口并注册

wangb 2 years ago
parent
commit
acc45a0d35
19 changed files with 769 additions and 45 deletions
  1. 1 1
      web/backmanagerconfig/src/main/java/com/gyee/backconfig/controller/NewtreeController.java
  2. 24 0
      web/consumer-hb/src/main/java/com/gyee/consumer/config/FeignConfiguration.java
  3. 32 0
      web/consumer-hb/src/main/java/com/gyee/consumer/controller/CompanysPG/CompanysPGController.java
  4. 35 0
      web/consumer-hb/src/main/java/com/gyee/consumer/controller/RegionPG/RegionPGController.java
  5. 32 0
      web/consumer-hb/src/main/java/com/gyee/consumer/controller/WindpowerstationPG/WindpowerstationPGController.java
  6. 17 0
      web/consumer-hb/src/main/java/com/gyee/consumer/fallback/CompanysPG/CompanysPGServiceFallbackFactory.java
  7. 18 0
      web/consumer-hb/src/main/java/com/gyee/consumer/fallback/RegionPG/RegionPGServiceFallbackFactory.java
  8. 17 0
      web/consumer-hb/src/main/java/com/gyee/consumer/fallback/WindpowerstationPG/WindpowerstationPGServiceFallbackFactory.java
  9. 17 0
      web/consumer-hb/src/main/java/com/gyee/consumer/service/CompanysPG/CompanysPGService.java
  10. 17 0
      web/consumer-hb/src/main/java/com/gyee/consumer/service/RegionPG/RegionPGService.java
  11. 16 0
      web/consumer-hb/src/main/java/com/gyee/consumer/service/WindpowerstationPG/WindpowerstationPGService.java
  12. 49 0
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/controller/Companys/CompanysPGController.java
  13. 42 0
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/controller/Region/RegionPGController.java
  14. 45 0
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/controller/WindpowerstationPG/WindpowerstationPGController.java
  15. 16 1
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/CompanysPGService.java
  16. 18 0
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/RegionPGService.java
  17. 39 22
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/WindpowerstationPGService.java
  18. 31 21
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/websocket/GenreSetPushService.java
  19. 303 0
      web/monitor-web-sxjn/src/main/resources/mybatis/auto/ProjectplanPGMapper.xml

+ 1 - 1
web/backmanagerconfig/src/main/java/com/gyee/backconfig/controller/NewtreeController.java

@@ -29,7 +29,7 @@ public class NewtreeController {
     public R wtls(String tag) {
         List<Companys> resultList = newtreeService.cpls(tag);
         if (StringUtils.isNotNull(resultList)) {
-            return com.gyee.backconfig.config.R.ok((int) resultList.size()).data(resultList);
+            return R.ok((int) resultList.size()).data(resultList);
         } else {
             return R.error().message("访问失败");
         }

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

@@ -1,6 +1,9 @@
 package com.gyee.consumer.config;
 
 
+import com.gyee.consumer.fallback.CompanysPG.CompanysPGServiceFallbackFactory;
+import com.gyee.consumer.fallback.RegionPG.RegionPGServiceFallbackFactory;
+import com.gyee.consumer.fallback.WindpowerstationPG.WindpowerstationPGServiceFallbackFactory;
 import com.gyee.consumer.fallback.admin.AdminServiceFallbackFactory;
 import com.gyee.consumer.fallback.alarm.AlarmServiceFallbackFactory;
 import com.gyee.consumer.fallback.compare.CompareServiceFallbackFactory;
@@ -166,6 +169,27 @@ public class FeignConfiguration {
     }
 
 
+    @Bean
+    public CompanysPGServiceFallbackFactory companysPGServiceFallbackFactory(){
+        return new CompanysPGServiceFallbackFactory();
+    }
+
+    @Bean
+    public RegionPGServiceFallbackFactory regionPGServiceFallbackFactory(){
+        return new RegionPGServiceFallbackFactory();
+    }
+
+
+    @Bean
+    public WindpowerstationPGServiceFallbackFactory windpowerstationPGServiceFallbackFactory(){
+        return new WindpowerstationPGServiceFallbackFactory();
+    }
+
+
+
+
+
+
 
 
 }

+ 32 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/controller/CompanysPG/CompanysPGController.java

@@ -0,0 +1,32 @@
+package com.gyee.consumer.controller.CompanysPG;
+
+import com.gyee.common.domain.AjaxResult;
+import com.gyee.consumer.service.CompanysPG.CompanysPGService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+@RestController
+@RequestMapping("/Companys")
+@Api(value = "公司查询",tags =  "公司查询")
+public class CompanysPGController {
+    @Resource
+    private CompanysPGService companysPGService;
+
+    @GetMapping(value = "/listByPage")
+    @ResponseBody
+    @ApiOperation(value = "公司查询", notes = "公司查询")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "公司编号", required = false, dataType = "string", paramType = "query")})
+
+    public AjaxResult findList(@RequestParam("id") String id)  {
+
+        AjaxResult ajax=companysPGService.CompanysPGlist(id);
+
+        return ajax;
+    }
+}

+ 35 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/controller/RegionPG/RegionPGController.java

@@ -0,0 +1,35 @@
+package com.gyee.consumer.controller.RegionPG;
+
+import com.gyee.common.domain.AjaxResult;
+import com.gyee.consumer.service.RegionPG.RegionPGService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+@RestController
+@RequestMapping("/Region")
+@Api(value = "区域查询",tags =  "区域查询")
+public class RegionPGController {
+    @Resource
+    private RegionPGService regionPGService;
+
+    @GetMapping("/list")
+    @ResponseBody
+    @ApiOperation(value = "区域查询", notes = "区域查询")
+    @ApiImplicitParams({
+
+            @ApiImplicitParam(name = "id", value = "区域编号", required = false, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "companyid", value = "公司编号", required = false, dataType = "string", paramType = "query")})
+
+    public AjaxResult findList(@RequestParam("id") String id, @RequestParam("companyid") String companyid)  {
+
+        AjaxResult ajax=regionPGService.RegionPGlist(id, companyid);
+
+        return ajax;
+    }
+
+}

+ 32 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/controller/WindpowerstationPG/WindpowerstationPGController.java

@@ -0,0 +1,32 @@
+package com.gyee.consumer.controller.WindpowerstationPG;
+
+import com.gyee.common.domain.AjaxResult;
+import com.gyee.consumer.service.WindpowerstationPG.WindpowerstationPGService;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+@RestController
+@RequestMapping("//windpowerstation")
+public class WindpowerstationPGController {
+    @Resource
+    private WindpowerstationPGService windpowerstationPGService;
+    @GetMapping(value = "/list")
+    @ResponseBody
+    @ApiOperation(value = "区域查询", notes = "区域查询")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "区域编号", required = false, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "companyid", value = "公司编号", required = false, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "regionid", value = "公司编号", required = false, dataType = "string", paramType = "query")})
+    public AjaxResult findList(@RequestParam("id") String id,String companyid, String regionid)  {
+
+        AjaxResult ajax=windpowerstationPGService.stationlsPG(id,companyid,regionid);
+
+        return ajax;
+    }
+}
+

+ 17 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/fallback/CompanysPG/CompanysPGServiceFallbackFactory.java

@@ -0,0 +1,17 @@
+package com.gyee.consumer.fallback.CompanysPG;
+
+import com.gyee.common.domain.AjaxResult;
+import com.gyee.consumer.service.CompanysPG.CompanysPGService;
+import feign.hystrix.FallbackFactory;
+
+public class CompanysPGServiceFallbackFactory implements FallbackFactory<CompanysPGService> {
+    @Override
+    public CompanysPGService create(Throwable throwable) {
+        return new CompanysPGService() {
+            @Override
+            public AjaxResult CompanysPGlist(String id) {
+                return  AjaxResult.error(throwable.getMessage());
+            }
+        };
+    }
+}

+ 18 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/fallback/RegionPG/RegionPGServiceFallbackFactory.java

@@ -0,0 +1,18 @@
+package com.gyee.consumer.fallback.RegionPG;
+
+import com.gyee.common.domain.AjaxResult;
+import com.gyee.consumer.service.RegionPG.RegionPGService;
+import feign.hystrix.FallbackFactory;
+
+public class RegionPGServiceFallbackFactory  implements FallbackFactory<RegionPGService> {
+
+    @Override
+    public RegionPGService create(Throwable throwable) {
+        return new RegionPGService() {
+            @Override
+            public AjaxResult RegionPGlist(String id, String companyid) {
+                return  AjaxResult.error(throwable.getMessage());
+            }
+        };
+    }
+}

+ 17 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/fallback/WindpowerstationPG/WindpowerstationPGServiceFallbackFactory.java

@@ -0,0 +1,17 @@
+package com.gyee.consumer.fallback.WindpowerstationPG;
+
+import com.gyee.common.domain.AjaxResult;
+import com.gyee.consumer.service.WindpowerstationPG.WindpowerstationPGService;
+import feign.hystrix.FallbackFactory;
+
+public class WindpowerstationPGServiceFallbackFactory implements FallbackFactory <WindpowerstationPGService>{
+    @Override
+    public WindpowerstationPGService create(Throwable throwable) {
+        return new WindpowerstationPGService() {
+            @Override
+            public AjaxResult stationlsPG(String id, String companyid, String regionid) {
+                return  AjaxResult.error(throwable.getMessage());
+            }
+        };
+    }
+}

+ 17 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/service/CompanysPG/CompanysPGService.java

@@ -0,0 +1,17 @@
+package com.gyee.consumer.service.CompanysPG;
+
+import com.gyee.common.domain.AjaxResult;
+import com.gyee.consumer.config.FeignConfiguration;
+import com.gyee.consumer.fallback.CompanysPG.CompanysPGServiceFallbackFactory;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+@FeignClient(name = "CompanysPG",url = "${provider.analysisurl}",
+        fallbackFactory = CompanysPGServiceFallbackFactory.class,
+        configuration = FeignConfiguration.class)
+public interface CompanysPGService {
+    @GetMapping("/Companys/listByPage")
+    public AjaxResult CompanysPGlist(@RequestParam("id") String id) ;
+
+}

+ 17 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/service/RegionPG/RegionPGService.java

@@ -0,0 +1,17 @@
+package com.gyee.consumer.service.RegionPG;
+
+import com.gyee.common.domain.AjaxResult;
+import com.gyee.consumer.config.FeignConfiguration;
+import com.gyee.consumer.fallback.RegionPG.RegionPGServiceFallbackFactory;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+@FeignClient(name = "RegionPG",url = "${provider.analysisurl}",
+        fallbackFactory = RegionPGServiceFallbackFactory.class,
+        configuration = FeignConfiguration.class)
+public interface RegionPGService {
+    @GetMapping("/Region/list")
+    public AjaxResult RegionPGlist(@RequestParam("id") String id, @RequestParam("companyid") String companyid) ;
+
+}

+ 16 - 0
web/consumer-hb/src/main/java/com/gyee/consumer/service/WindpowerstationPG/WindpowerstationPGService.java

@@ -0,0 +1,16 @@
+package com.gyee.consumer.service.WindpowerstationPG;
+
+import com.gyee.common.domain.AjaxResult;
+import com.gyee.consumer.config.FeignConfiguration;
+import com.gyee.consumer.fallback.CompanysPG.CompanysPGServiceFallbackFactory;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+@FeignClient(name = "windpowerstation",url = "${provider.analysisurl}",
+        fallbackFactory = CompanysPGServiceFallbackFactory.class,
+        configuration = FeignConfiguration.class)
+public interface WindpowerstationPGService {
+    @GetMapping("/windpowerstation/list")
+    public AjaxResult stationlsPG(@RequestParam("id") String id, @RequestParam("companyid") String companyid, @RequestParam("regionid") String regionid) ;
+}

+ 49 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/controller/Companys/CompanysPGController.java

@@ -0,0 +1,49 @@
+package com.gyee.frame.controller.Companys;
+
+
+import com.gyee.common.config.R;
+import com.gyee.frame.model.auto.CompanysPG;
+import com.gyee.frame.service.CompanysPGService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * <p>
+ * 前端控制器(公司)
+ * </p>
+ *
+ * @author wang
+ * @since 2022-09-23
+ */
+@RestController
+@RequestMapping("/Companys")
+@Api(value = "公司查询",tags =  "公司查询")
+public class CompanysPGController {
+    @Resource
+    private CompanysPGService companysPGService;
+
+    /**
+     * 查询
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping(value = "/listByPage")
+    @ResponseBody
+    @ApiOperation(value = "公司查询", notes = "公司查询")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "公司编号", required = false, dataType = "string", paramType = "query")})
+    public R findList(String id) {
+        List<CompanysPG> list = companysPGService.CompanysPGlist(id);
+        if (null != list) {
+            return R.ok().data(list);
+        } else {
+            return R.error().data("查询失败!");
+        }
+    }
+}

+ 42 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/controller/Region/RegionPGController.java

@@ -0,0 +1,42 @@
+package com.gyee.frame.controller.Region;
+
+import com.gyee.common.config.R;
+import com.gyee.frame.model.auto.RegionPG;
+import com.gyee.frame.service.RegionPGService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@RestController
+@RequestMapping("/Region")
+@Api(value = "区域查询",tags =  "区域查询")
+public class RegionPGController {
+    @Resource
+    private RegionPGService regionPGService;
+
+    /**
+     * 查询
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping(value = "/list")
+    @ResponseBody
+    @ApiOperation(value = "区域查询", notes = "区域查询")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "区域编号", required = false, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "companyid", value = "公司编号", required = false, dataType = "string", paramType = "query")})
+    public R findList(String id ,String companyid) {
+        List<RegionPG> list = regionPGService.RegionPGlist(id,companyid);
+        if (null != list) {
+            return R.ok().data(list);
+        } else {
+            return R.error().data("查询失败!");
+        }
+    }
+}

+ 45 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/controller/WindpowerstationPG/WindpowerstationPGController.java

@@ -0,0 +1,45 @@
+package com.gyee.frame.controller.WindpowerstationPG;
+
+import com.gyee.common.config.R;
+import com.gyee.frame.model.auto.RegionPG;
+import com.gyee.frame.model.auto.WindpowerstationPG;
+import com.gyee.frame.service.WindpowerstationPGService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@RestController
+@RequestMapping("//windpowerstation")
+@Api(value = "场站查询",tags =  "场站查询")
+public class WindpowerstationPGController {
+    @Resource
+    private WindpowerstationPGService windpowerstationPGService;
+    /**
+     * 查询
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping(value = "/list")
+    @ResponseBody
+    @ApiOperation(value = "场站查询", notes = "场站查询")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "companyid", value = "公司编号", required = false, dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "regionid", value = "区域编号", required = false, dataType = "string", paramType = "query")})
+    public R findList( String companyid, String regionid) {
+        List<WindpowerstationPG> list = windpowerstationPGService.stationlsPG(companyid,regionid);
+        if (null != list) {
+            return R.ok().data(list);
+        } else {
+            return R.error().data("查询失败!");
+        }
+    }
+}

+ 16 - 1
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/CompanysPGService.java

@@ -42,7 +42,7 @@ public class CompanysPGService implements BaseService<CompanysPG, CompanysPGExam
 	
 	@Override
 	public CompanysPG selectByPrimaryKey(String id) {
-				
+
 			return companysPGMapper.selectByPrimaryKey(id);
 				
 	}
@@ -113,6 +113,21 @@ public class CompanysPGService implements BaseService<CompanysPG, CompanysPGExam
 
 	}
 
+	@DataSource(value = DataSourceType.SLAVE)
+	public List<CompanysPG> CompanysPGlist(String id) {
+
+		List<CompanysPG> list=new ArrayList<>();
+
+		CompanysPGExample example=new CompanysPGExample();
+		example.setOrderByClause(" id asc");
+
+		CompanysPGExample.Criteria criteria =example.createCriteria();
+		criteria.andIdEqualTo("QJNY");
+		list= companysPGMapper.selectByExample(example);
+		return list;
+
+	}
+
 
 
 }

+ 18 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/RegionPGService.java

@@ -78,4 +78,22 @@ public class RegionPGService implements BaseService<RegionPG, RegionPGExample> {
         return list;
 
     }
+
+    @DataSource(value = DataSourceType.SLAVE)
+    public List<RegionPG> RegionPGlist(String id ,String companyid) {
+
+        List<RegionPG> list=new ArrayList<>();
+
+        RegionPGExample example=new RegionPGExample();
+        example.setOrderByClause(" id asc");
+
+        RegionPGExample.Criteria cr =example.createCriteria();
+        cr.andIdEqualTo(id);
+
+        RegionPGExample.Criteria criteria =example.createCriteria();
+        criteria.andCompanyidEqualTo(companyid);
+        list= regionPGMapper.selectByExample(example);
+        return list;
+
+    }
 }

+ 39 - 22
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/WindpowerstationPGService.java

@@ -23,6 +23,7 @@ public class WindpowerstationPGService implements BaseService<WindpowerstationPG
 
     @Resource
     private WindpowerstationPGMapper windpowerstationPGMapper;
+
     @Override
     public int deleteByPrimaryKey(String id) {
         return 0;
@@ -71,65 +72,83 @@ public class WindpowerstationPGService implements BaseService<WindpowerstationPG
 
 
     @DataSource(value = DataSourceType.SLAVE)
-    public List<WindpowerstationPG> findWindpowerstationPG(String companyid,String regionid,String station ) {
+    public List<WindpowerstationPG> findWindpowerstationPG(String companyid, String regionid, String station) {
 
-        List<WindpowerstationPG> list=new ArrayList<>();
+        List<WindpowerstationPG> list = new ArrayList<>();
 
-        WindpowerstationPGExample example=new WindpowerstationPGExample();
+        WindpowerstationPGExample example = new WindpowerstationPGExample();
         example.setOrderByClause(" id asc");
-        WindpowerstationPGExample.Criteria criteria =example.createCriteria();
-        if(null != companyid){
+        WindpowerstationPGExample.Criteria criteria = example.createCriteria();
+        if (null != companyid) {
             criteria.andCompanyidEqualTo(companyid);
         }
-        if(null != regionid){
+        if (null != regionid) {
             criteria.andRegionidEqualTo(regionid);
         }
-        if(null != station){
+        if (null != station) {
             criteria.andIdEqualTo(station);
         }
 
 
-
-        list= windpowerstationPGMapper.selectByExample(example);
+        list = windpowerstationPGMapper.selectByExample(example);
         return list;
 
     }
+
     @DataSource(value = DataSourceType.SLAVE)
-    public PageInfo<WindpowerstationPG> list(Tablepar tablepar, String name){
-        WindpowerstationPGExample testExample=new WindpowerstationPGExample();
+    public PageInfo<WindpowerstationPG> list(Tablepar tablepar, String name) {
+        WindpowerstationPGExample testExample = new WindpowerstationPGExample();
         testExample.setOrderByClause("id ASC");
-        if(name!=null&&!"".equals(name)){
-            testExample.createCriteria().andCodeLike("%"+name+"%");
+        if (name != null && !"".equals(name)) {
+            testExample.createCriteria().andCodeLike("%" + name + "%");
         }
 
         PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
-        List<WindpowerstationPG> list= windpowerstationPGMapper.selectByExample(testExample);
+        List<WindpowerstationPG> list = windpowerstationPGMapper.selectByExample(testExample);
         PageInfo<WindpowerstationPG> pageInfo = new PageInfo<WindpowerstationPG>(list);
-        return  pageInfo;
+        return pageInfo;
     }
+
     @DataSource(value = DataSourceType.SLAVE)
     public List<WindpowerstationPG> findstationPG() {
 
+        List<WindpowerstationPG> list = new ArrayList<>();
+
+        WindpowerstationPGExample example = new WindpowerstationPGExample();
+        example.setOrderByClause(" id asc");
+
+        WindpowerstationPGExample.Criteria criteria = example.createCriteria();
+        criteria.andIdEqualTo("QJNY");
+        list = windpowerstationPGMapper.selectByExample(example);
+        return list;
+
+    }
+
+    @DataSource(value = DataSourceType.SLAVE)
+    public List<WindpowerstationPG> stationlsPG(String companyid, String regionid) {
+
         List<WindpowerstationPG> list=new ArrayList<>();
 
         WindpowerstationPGExample example=new WindpowerstationPGExample();
         example.setOrderByClause(" id asc");
 
         WindpowerstationPGExample.Criteria criteria =example.createCriteria();
-        criteria.andIdEqualTo("QJNY");
+        criteria.andCompanyidEqualTo(companyid);
+        WindpowerstationPGExample.Criteria cr =example.createCriteria();
+        cr.andRegionidEqualTo(regionid);
         list= windpowerstationPGMapper.selectByExample(example);
         return list;
-
     }
+
     @DataSource(value = DataSourceType.SLAVE)
     public List<Map> hso() {
 //        QueryWrapper<WindpowerstationPGPG> qw = new QueryWrapper<>();
 //        List<WindpowerstationPGPG> list = baseMapper.selectList(qw);
 
-        List<WindpowerstationPG> list=new ArrayList<>();
-        WindpowerstationPGExample example=new WindpowerstationPGExample();
+        List<WindpowerstationPG> list = new ArrayList<>();
+        WindpowerstationPGExample example = new WindpowerstationPGExample();
         example.setOrderByClause(" id asc");
-        list= windpowerstationPGMapper.selectByExample(example);
+        list = windpowerstationPGMapper.selectByExample(example);
 
         //产业光伏
         List<WindpowerstationPG> sxgf = new ArrayList<>();
@@ -756,6 +775,4 @@ public class WindpowerstationPGService implements BaseService<WindpowerstationPG
     }
 
 
-
-
 }

+ 31 - 21
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/websocket/GenreSetPushService.java

@@ -14,6 +14,8 @@ import com.gyee.frame.service.photovolatic.PhotovoltaicTestingPointNewService;
 import com.gyee.frame.service.weather.WeatherDay5Service;
 import com.gyee.frame.service.weather.WeatherService;
 import com.gyee.frame.util.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -25,6 +27,7 @@ import java.util.*;
 @Service
 public class GenreSetPushService {
 
+    private static Logger logger = LoggerFactory.getLogger(GenreSetPushService.class);
 
     @Resource
     private WindPowerstationTestingPoint2Service windPowerstationTestingPoint2Service;
@@ -4320,30 +4323,37 @@ public class GenreSetPushService {
     public Map Stationinformation(String wpId) {
 
 
-        WindpowerstationPG windpowerstationPG = InitialRunner.wppgmap.get(wpId);
-        List<ProjectPG> projectPGs = InitialRunner.pjpggroupmap.get(windpowerstationPG.getId());
-        Map czxx = new LinkedHashMap();
-        List<Map> qc = new ArrayList<>();
-
-        int linenum = 0;
-        int i = 0;
+        try {
+            WindpowerstationPG windpowerstationPG = InitialRunner.wppgmap.get(wpId);
+            String code = windpowerstationPG.getId();
+            List<ProjectPG> projectPGs = InitialRunner.pjpggroupmap.get(code);
+            Map czxx = new LinkedHashMap();
+            List<Map> qc = new ArrayList<>();
+
+            int linenum = 0;
+            int i = 0;
+
+            czxx.put("zjrl", windpowerstationPG.getCapacity());//装机容量
+            for (ProjectPG p : projectPGs) {
+                Map qcls = new LinkedHashMap();
+                i++;
+                qcls.put("id",i);
+                qcls.put("name",p.getName()); //name : GJY01_GC
+                qcls.put("value",  p.getCapacity());//value :45
+                linenum = linenum + InitialRunner.pjlnpgmap.get(p.getId()).size();
+                qc.add(qcls);
+            }
 
-        czxx.put("zjrl", windpowerstationPG.getCapacity());//装机容量
-        for (ProjectPG p : projectPGs) {
-            Map qcls = new LinkedHashMap();
-            i++;
-            qcls.put("id",i);
-            qcls.put("name",p.getName()); //name : GJY01_GC
-            qcls.put("value",  p.getCapacity());//value :45
-            linenum = linenum + InitialRunner.pjlnpgmap.get(p.getId()).size();
-            qc.add(qcls);
+            czxx.put("linenum", linenum);
+            czxx.put("fjts", windpowerstationPG.getQuantity());//风机台数
+            czxx.put("issue",qc);
+            return czxx;
+        } catch (Exception e) {
+            e.printStackTrace();
+            logger.error("异常",e);
+            return null;
         }
 
-        czxx.put("linenum", linenum);
-        czxx.put("fjts", windpowerstationPG.getQuantity());//风机台数
-        czxx.put("issue",qc);
-        return czxx;
-
 
 //        List<WindpowerstationPG> wppglist = InitialRunner.wppgallls;
 //

+ 303 - 0
web/monitor-web-sxjn/src/main/resources/mybatis/auto/ProjectplanPGMapper.xml

@@ -0,0 +1,303 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.gyee.frame.mapper.auto.ProjectplanPGMapper">
+  <resultMap id="BaseResultMap" type="com.gyee.frame.model.auto.ProjectplanPG">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    <id column="id" jdbcType="VARCHAR" property="id" />
+    <result column="projectid" jdbcType="VARCHAR" property="projectid" />
+    <result column="generatingcapacity" jdbcType="VARCHAR" property="generatingcapacity" />
+    <result column="outagehours" jdbcType="NUMERIC" property="outagehours" />
+    <result column="year" jdbcType="VARCHAR" property="year" />
+    <result column="month" jdbcType="VARCHAR" property="month" />
+    <result column="windpower" jdbcType="VARCHAR" property="windpower" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    id, projectid, generatingcapacity, outagehours, year, month, windpower
+  </sql>
+  <select id="selectByExample" parameterType="com.gyee.frame.model.auto.ProjectplanPGExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from projectplan
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from projectplan
+    where id = #{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    delete from projectplan
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.gyee.frame.model.auto.ProjectplanPGExample">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    delete from projectplan
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.gyee.frame.model.auto.ProjectplanPG">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    insert into projectplan (id, projectid, generatingcapacity, 
+      outagehours, year, month, 
+      windpower)
+    values (#{id,jdbcType=VARCHAR}, #{projectid,jdbcType=VARCHAR}, #{generatingcapacity,jdbcType=VARCHAR}, 
+      #{outagehours,jdbcType=NUMERIC}, #{year,jdbcType=VARCHAR}, #{month,jdbcType=VARCHAR}, 
+      #{windpower,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.gyee.frame.model.auto.ProjectplanPG">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    insert into projectplan
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="projectid != null">
+        projectid,
+      </if>
+      <if test="generatingcapacity != null">
+        generatingcapacity,
+      </if>
+      <if test="outagehours != null">
+        outagehours,
+      </if>
+      <if test="year != null">
+        year,
+      </if>
+      <if test="month != null">
+        month,
+      </if>
+      <if test="windpower != null">
+        windpower,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="projectid != null">
+        #{projectid,jdbcType=VARCHAR},
+      </if>
+      <if test="generatingcapacity != null">
+        #{generatingcapacity,jdbcType=VARCHAR},
+      </if>
+      <if test="outagehours != null">
+        #{outagehours,jdbcType=NUMERIC},
+      </if>
+      <if test="year != null">
+        #{year,jdbcType=VARCHAR},
+      </if>
+      <if test="month != null">
+        #{month,jdbcType=VARCHAR},
+      </if>
+      <if test="windpower != null">
+        #{windpower,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.gyee.frame.model.auto.ProjectplanPGExample" resultType="java.lang.Long">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    select count(*) from projectplan
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    update projectplan
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=VARCHAR},
+      </if>
+      <if test="record.projectid != null">
+        projectid = #{record.projectid,jdbcType=VARCHAR},
+      </if>
+      <if test="record.generatingcapacity != null">
+        generatingcapacity = #{record.generatingcapacity,jdbcType=VARCHAR},
+      </if>
+      <if test="record.outagehours != null">
+        outagehours = #{record.outagehours,jdbcType=NUMERIC},
+      </if>
+      <if test="record.year != null">
+        year = #{record.year,jdbcType=VARCHAR},
+      </if>
+      <if test="record.month != null">
+        month = #{record.month,jdbcType=VARCHAR},
+      </if>
+      <if test="record.windpower != null">
+        windpower = #{record.windpower,jdbcType=VARCHAR},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    update projectplan
+    set id = #{record.id,jdbcType=VARCHAR},
+      projectid = #{record.projectid,jdbcType=VARCHAR},
+      generatingcapacity = #{record.generatingcapacity,jdbcType=VARCHAR},
+      outagehours = #{record.outagehours,jdbcType=NUMERIC},
+      year = #{record.year,jdbcType=VARCHAR},
+      month = #{record.month,jdbcType=VARCHAR},
+      windpower = #{record.windpower,jdbcType=VARCHAR}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.gyee.frame.model.auto.ProjectplanPG">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    update projectplan
+    <set>
+      <if test="projectid != null">
+        projectid = #{projectid,jdbcType=VARCHAR},
+      </if>
+      <if test="generatingcapacity != null">
+        generatingcapacity = #{generatingcapacity,jdbcType=VARCHAR},
+      </if>
+      <if test="outagehours != null">
+        outagehours = #{outagehours,jdbcType=NUMERIC},
+      </if>
+      <if test="year != null">
+        year = #{year,jdbcType=VARCHAR},
+      </if>
+      <if test="month != null">
+        month = #{month,jdbcType=VARCHAR},
+      </if>
+      <if test="windpower != null">
+        windpower = #{windpower,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.gyee.frame.model.auto.ProjectplanPG">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+    -->
+    update projectplan
+    set projectid = #{projectid,jdbcType=VARCHAR},
+      generatingcapacity = #{generatingcapacity,jdbcType=VARCHAR},
+      outagehours = #{outagehours,jdbcType=NUMERIC},
+      year = #{year,jdbcType=VARCHAR},
+      month = #{month,jdbcType=VARCHAR},
+      windpower = #{windpower,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+</mapper>