From f52a8762265a5261fa08c353a42c0251a68c2ad8 Mon Sep 17 00:00:00 2001 From: songjinsheng Date: Fri, 24 Jun 2022 10:28:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A7=E5=88=B6=E5=99=A8?= =?UTF-8?q?=E5=8F=8A=E6=96=B0=E5=A2=9E=E5=9F=8E=E5=B8=82=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yada/AorestCoverageController.java | 10 +- .../web/controller/yada/CityController.java | 33 ++++++ .../controller/yada/SpecialController.java | 5 - .../yada/SpecialReportController.java | 38 ++++++ .../ruoyi/common/utils/file/WeatherUtils.java | 3 +- .../com/ruoyi/system/domain_yada/CityVo.java | 110 ++++++++++++++++++ .../mapper_yada/AorestCoverageMapper.java | 2 + .../ruoyi/system/mapper_yada/CityMapper.java | 16 +++ .../service_yada/IAorestCoverageService.java | 1 + .../system/service_yada/ICityService.java | 14 +++ .../impl/AorestCoverageServiceimpl.java | 5 + .../service_yada/impl/CityServiceimpl.java | 23 ++++ .../mapper/system/AorestCoverageMapper.xml | 6 + .../resources/mapper/system/CityMapper.xml | 31 +++++ 14 files changed, 289 insertions(+), 8 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/CityController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/SpecialReportController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/CityVo.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/CityMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service_yada/ICityService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/CityServiceimpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/system/CityMapper.xml diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/AorestCoverageController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/AorestCoverageController.java index 247d55980..a6eaf9561 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/AorestCoverageController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/AorestCoverageController.java @@ -159,14 +159,22 @@ public class AorestCoverageController { return upload; } - @RequestMapping(value = "/Dictionary") + @RequestMapping(value = "/Dictionary",method = {RequestMethod.POST}) @ApiOperation(value = "字典查询",httpMethod = "POST") public AjaxResult Dictionary(@RequestBody Dictionary dic) { List diclist=service.selectDic(dic.getCodingType(),dic.getCodingType1(), dic.getCodingType2()); return AjaxResult.success(diclist); + } + @RequestMapping(value = "/selectNow",method = {RequestMethod.GET}) + @ApiOperation(value = "字典查询",httpMethod = "GET") + public AjaxResult selectNow(String type) + { + List diclist=service.selectNow(type); + return AjaxResult.success(diclist); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/CityController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/CityController.java new file mode 100644 index 000000000..440184b0b --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/CityController.java @@ -0,0 +1,33 @@ +package com.ruoyi.web.controller.yada; + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.system.domain_yada.CityVo; +import com.ruoyi.system.service_yada.ICityService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 城市 + */ +@RestController +@RequestMapping(value = "/business-service/api/City") +@Api(tags = "城市") +public class CityController +{ + @Resource + private ICityService cityService; + @RequestMapping(value = "/getImpervious",method = {RequestMethod.GET}) + @ApiOperation(value = "不透水面面积",httpMethod = "GET") + public AjaxResult getImpervious(String city,String country) + { + List cityVos=cityService.selectCity(city,country); + return AjaxResult.success(cityVos); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/SpecialController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/SpecialController.java index 5a2018480..5d5c9bea3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/SpecialController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/SpecialController.java @@ -76,11 +76,6 @@ public class SpecialController { map.put("output","json"); String value= WeatherUtils.httpRequest(url,map); WeatherUtilsVO vo = JSON.parseObject(value,WeatherUtilsVO.class); -// String value2=vo.getForecasts().substring(1,vo.getForecasts().length()-1); -// System.out.println(value2); -// vo.setForecast(JSON.parseObject(value2,ForecastVo.class)); -// JSONObject userJson=JSONObject.parseObject(value); -// WeatherUtilsVO utilsValue= JSON.toJavaObject(userJson,WeatherUtilsVO.class); return AjaxResult.success(vo); } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/SpecialReportController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/SpecialReportController.java new file mode 100644 index 000000000..e9cb3df45 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/SpecialReportController.java @@ -0,0 +1,38 @@ +package com.ruoyi.web.controller.yada; + +import com.ruoyi.common.core.domain.AjaxResult; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * 专题报告 + */ +@RestController +@RequestMapping(value = "/business-service/api/Special", produces = "application/json;charset=UTF-8") +@Api(tags = "专题报告") +public class SpecialReportController +{ + + @RequestMapping(value = "/getWord",method = {RequestMethod.GET}) + @ApiOperation(value = "返回专题报告路径",httpMethod = "GET") + public AjaxResult getWord(@RequestParam("path") String path,@RequestParam("name") String name) + { + String route=""; + switch (path) + { + case "ch": + route="avatar/word/全球生态环境遥感监测2021年度报告-中文版-20220309.docx"; + break; + case "en": + route="avatar/word/全球生态环境遥感监测2021年度报告-英文简本-20211102.docx"; + break; + default: + return AjaxResult.error("未找到对应路径"); + } + return AjaxResult.success(route); + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/WeatherUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/WeatherUtils.java index a29f23031..732d7b4cc 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/WeatherUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/WeatherUtils.java @@ -18,7 +18,7 @@ public class WeatherUtils //buffer用于接受返回的字符 StringBuffer buffer = new StringBuffer(); try { - //建立URL,把请求地址给补全,其中urlencode()方法用于把params里的参数给取出来 + //拼接url连接 URL url = new URL(requestUrl+"?"+urlencode(params)); //打开http连接 HttpURLConnection httpUrlConn = (HttpURLConnection) url.openConnection(); @@ -40,7 +40,6 @@ public class WeatherUtils bufferedReader.close(); inputStreamReader.close(); inputStream.close(); - inputStream = null; //断开连接 httpUrlConn.disconnect(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/CityVo.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/CityVo.java new file mode 100644 index 000000000..0425ab5ee --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/CityVo.java @@ -0,0 +1,110 @@ +package com.ruoyi.system.domain_yada; + +/** + * @Author: JinSheng Song + * @Date: 2022/6/24 9:51 + */ +public class CityVo extends SysBaseEntity +{ + private String id; + + private String city; + + private String area; + + private String year; + + private Double imperviousSurfaceArea; + + private Double imperviousSurfaceCoverage; + + public Double getImperviousSurfaceExpansionSpeed() { + return imperviousSurfaceExpansionSpeed; + } + + public void setImperviousSurfaceExpansionSpeed(Double imperviousSurfaceExpansionSpeed) { + this.imperviousSurfaceExpansionSpeed = imperviousSurfaceExpansionSpeed; + } + + private Double imperviousSurfaceExpansionSpeed; + + private Double imperviousSurfaceExpansionStrength; + + private Double imperviousSurfaceExpansionCntribution ; + + private String countryIdentification; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + + public String getYear() { + return year; + } + + public void setYear(String year) { + this.year = year; + } + + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public Double getImperviousSurfaceArea() { + return imperviousSurfaceArea; + } + + public void setImperviousSurfaceArea(Double imperviousSurfaceArea) { + this.imperviousSurfaceArea = imperviousSurfaceArea; + } + + public Double getImperviousSurfaceCoverage() { + return imperviousSurfaceCoverage; + } + + public void setImperviousSurfaceCoverage(Double imperviousSurfaceCoverage) { + this.imperviousSurfaceCoverage = imperviousSurfaceCoverage; + } + + public Double getImperviousSurfaceExpansionStrength() { + return imperviousSurfaceExpansionStrength; + } + + public void setImperviousSurfaceExpansionStrength(Double imperviousSurfaceExpansionStrength) { + this.imperviousSurfaceExpansionStrength = imperviousSurfaceExpansionStrength; + } + + public Double getImperviousSurfaceExpansionCntribution() { + return imperviousSurfaceExpansionCntribution; + } + + public void setImperviousSurfaceExpansionCntribution(Double imperviousSurfaceExpansionCntribution) { + this.imperviousSurfaceExpansionCntribution = imperviousSurfaceExpansionCntribution; + } + + public String getCountryIdentification() { + return countryIdentification; + } + + public void setCountryIdentification(String countryIdentification) { + this.countryIdentification = countryIdentification; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/AorestCoverageMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/AorestCoverageMapper.java index 7bfa3610d..f2ca49bea 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/AorestCoverageMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/AorestCoverageMapper.java @@ -26,4 +26,6 @@ public interface AorestCoverageMapper { List selectDic(@Param("codingType") String codingType,@Param("codingType1") String codingType1, @Param("codingType2") String codingType2); + + List selectNow(@Param("codingType2") String codingType2); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/CityMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/CityMapper.java new file mode 100644 index 000000000..1c068247f --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/CityMapper.java @@ -0,0 +1,16 @@ +package com.ruoyi.system.mapper_yada; + + +import com.ruoyi.system.domain_yada.CityVo; + +import java.util.List; + +/** + * @Author: JinSheng Song + * @Date: 2022/6/24 10:06 + */ +public interface CityMapper { + + List selectCity(String city,String gj); + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/IAorestCoverageService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/IAorestCoverageService.java index 86ef91dd0..955dd47ee 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/IAorestCoverageService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/IAorestCoverageService.java @@ -28,4 +28,5 @@ public interface IAorestCoverageService { List selectDic(String codingType,String codingType1, String codingType2); + List selectNow(String codingType2); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/ICityService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/ICityService.java new file mode 100644 index 000000000..8491932a7 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/ICityService.java @@ -0,0 +1,14 @@ +package com.ruoyi.system.service_yada; + +import com.ruoyi.system.domain_yada.CityVo; + +import java.util.List; + +/** + * @Author: JinSheng Song + * @Date: 2022/6/24 10:11 + */ +public interface ICityService { + + List selectCity(String city, String gj); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/AorestCoverageServiceimpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/AorestCoverageServiceimpl.java index 334673dbe..3d140f7f3 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/AorestCoverageServiceimpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/AorestCoverageServiceimpl.java @@ -55,4 +55,9 @@ public class AorestCoverageServiceimpl implements IAorestCoverageService { String codingType2) { return coverageMapper.selectDic(codingType,codingType1,codingType2); } + + @Override + public List selectNow(String codingType2) { + return coverageMapper.selectNow(codingType2); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/CityServiceimpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/CityServiceimpl.java new file mode 100644 index 000000000..531fbf7da --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/CityServiceimpl.java @@ -0,0 +1,23 @@ +package com.ruoyi.system.service_yada.impl; + +import com.ruoyi.system.domain_yada.CityVo; +import com.ruoyi.system.mapper_yada.AorestCoverageMapper; +import com.ruoyi.system.mapper_yada.CityMapper; +import com.ruoyi.system.service_yada.ICityService; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @Author: JinSheng Song + * @Date: 2022/6/24 10:12 + */ +public class CityServiceimpl implements ICityService { + + @Resource + private CityMapper cityMapper; + @Override + public List selectCity(String city, String gj) { + return cityMapper.selectCity(city,gj); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/system/AorestCoverageMapper.xml b/ruoyi-system/src/main/resources/mapper/system/AorestCoverageMapper.xml index d19f0ab8b..4fbfb864f 100644 --- a/ruoyi-system/src/main/resources/mapper/system/AorestCoverageMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/AorestCoverageMapper.xml @@ -143,4 +143,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ) + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/CityMapper.xml b/ruoyi-system/src/main/resources/mapper/system/CityMapper.xml new file mode 100644 index 000000000..3b24fe734 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/CityMapper.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file