diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/ESNOImpactController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/ESNOImpactController.java new file mode 100644 index 000000000..57589e03f --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/yada/ESNOImpactController.java @@ -0,0 +1,70 @@ +package com.ruoyi.web.controller.yada; + + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.system.domain_yada.entity.MonitorCountryCorrespondingEntity; +import com.ruoyi.system.domain_yada.vo.ESNOImpactSubzoneVo; +import com.ruoyi.system.domain_yada.vo.PmKeyValueEnVo; +import com.ruoyi.system.domain_yada.vo.PmKeyValueVo; +import com.ruoyi.system.service_yada.ESNOImpactService; +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; + +/** + * ENSO事件影响监测 + * + * @author Mr.C + */ +@RestController +@RequestMapping("/business-service/api/enso") +@Api(tags = "ENSO事件影响监测") +public class ESNOImpactController { + + @Resource + private ESNOImpactService esnoImpactService; + + @RequestMapping(value = "/subzonePie", method = {RequestMethod.GET}) + @ApiOperation(value = "各地理亚区植被异常分布", httpMethod = "GET") + public AjaxResult subzonePie(@RequestParam(value = "type") String type, + @RequestParam(value = "year") String year, + @RequestParam(value = "region") String region) { + ESNOImpactSubzoneVo esnoImpactSubzoneVo = esnoImpactService.subzonePie(type, year, region); + return AjaxResult.success(esnoImpactSubzoneVo); + } + + + @RequestMapping(value = "/subzoneVai", method = {RequestMethod.GET}) + @ApiOperation(value = "各地理亚区VAI", httpMethod = "GET") + public AjaxResult subzoneVai(@RequestParam(value = "type") String type, + @RequestParam(value = "year") String year) { + PmKeyValueEnVo pmKeyValueEnVo = esnoImpactService.subzoneVai(type, year); + return AjaxResult.success(pmKeyValueEnVo); + } + + @RequestMapping(value = "/countryVai", method = {RequestMethod.GET}) + @ApiOperation(value = "各国AVI", httpMethod = "GET") + public AjaxResult countryVai(@RequestParam(value = "type") String type, + @RequestParam(value = "year") String year, + @RequestParam(value = "region") String region) { + PmKeyValueEnVo pmKeyValueEnVo = esnoImpactService.countryVai(type, year, region); + return AjaxResult.success(pmKeyValueEnVo); + } + + @RequestMapping(value = "/subzoneVaiLine", method = {RequestMethod.GET}) + @ApiOperation(value = "各地理亚区时间VAI", httpMethod = "GET") + public AjaxResult subzoneVaiLine(@RequestParam(value = "type") String type, + @RequestParam(value = "region") String region, + @RequestParam(value = "start") String start, + @RequestParam(value = "end") String end) { + PmKeyValueVo pmKeyValueVo = esnoImpactService.subzoneVaiLine(type, region,start, end); + return AjaxResult.success(pmKeyValueVo); + } + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/ESNOImpactCountryEntity.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/ESNOImpactCountryEntity.java new file mode 100644 index 000000000..dbe33e98b --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/ESNOImpactCountryEntity.java @@ -0,0 +1,219 @@ +package com.ruoyi.system.domain_yada.entity; + +/** + * ENSO事件影响监测地理g植被异常变化分布及VAI + * @author Mr.C + */ +public class ESNOImpactCountryEntity { + + private Integer id; + private String type; + private String year; + private String country; + private String countryEn; + private String vai; + private String obviouslyBetter; + private String slightlyBetter; + private String unchanged; + private String slightlyWorse; + private String obviouslyWorse; + + + public ESNOImpactCountryEntity() { + } + + public ESNOImpactCountryEntity(Integer id, String type, String year, String country, String countryEn, String vai, String obviouslyBetter, String slightlyBetter, String unchanged, String slightlyWorse, String obviouslyWorse) { + this.id = id; + this.type = type; + this.year = year; + this.country = country; + this.countryEn = countryEn; + this.vai = vai; + this.obviouslyBetter = obviouslyBetter; + this.slightlyBetter = slightlyBetter; + this.unchanged = unchanged; + this.slightlyWorse = slightlyWorse; + this.obviouslyWorse = obviouslyWorse; + } + + /** + * 获取 + * @return id + */ + public Integer getId() { + return id; + } + + /** + * 设置 + * @param id + */ + public void setId(Integer id) { + this.id = id; + } + + /** + * 获取 + * @return type + */ + public String getType() { + return type; + } + + /** + * 设置 + * @param type + */ + public void setType(String type) { + this.type = type; + } + + /** + * 获取 + * @return year + */ + public String getYear() { + return year; + } + + /** + * 设置 + * @param year + */ + public void setYear(String year) { + this.year = year; + } + + /** + * 获取 + * @return country + */ + public String getCountry() { + return country; + } + + /** + * 设置 + * @param country + */ + public void setCountry(String country) { + this.country = country; + } + + /** + * 获取 + * @return countryEn + */ + public String getCountryEn() { + return countryEn; + } + + /** + * 设置 + * @param countryEn + */ + public void setCountryEn(String countryEn) { + this.countryEn = countryEn; + } + + /** + * 获取 + * @return vai + */ + public String getVai() { + return vai; + } + + /** + * 设置 + * @param vai + */ + public void setVai(String vai) { + this.vai = vai; + } + + /** + * 获取 + * @return obviouslyBetter + */ + public String getObviouslyBetter() { + return obviouslyBetter; + } + + /** + * 设置 + * @param obviouslyBetter + */ + public void setObviouslyBetter(String obviouslyBetter) { + this.obviouslyBetter = obviouslyBetter; + } + + /** + * 获取 + * @return slightlyBetter + */ + public String getSlightlyBetter() { + return slightlyBetter; + } + + /** + * 设置 + * @param slightlyBetter + */ + public void setSlightlyBetter(String slightlyBetter) { + this.slightlyBetter = slightlyBetter; + } + + /** + * 获取 + * @return unchanged + */ + public String getUnchanged() { + return unchanged; + } + + /** + * 设置 + * @param unchanged + */ + public void setUnchanged(String unchanged) { + this.unchanged = unchanged; + } + + /** + * 获取 + * @return slightlyWorse + */ + public String getSlightlyWorse() { + return slightlyWorse; + } + + /** + * 设置 + * @param slightlyWorse + */ + public void setSlightlyWorse(String slightlyWorse) { + this.slightlyWorse = slightlyWorse; + } + + /** + * 获取 + * @return obviouslyWorse + */ + public String getObviouslyWorse() { + return obviouslyWorse; + } + + /** + * 设置 + * @param obviouslyWorse + */ + public void setObviouslyWorse(String obviouslyWorse) { + this.obviouslyWorse = obviouslyWorse; + } + + @Override + public String toString() { + return "ESNOImpactCountryEntity{id = " + id + ", type = " + type + ", year = " + year + ", country = " + country + ", countryEn = " + countryEn + ", vai = " + vai + ", obviouslyBetter = " + obviouslyBetter + ", slightlyBetter = " + slightlyBetter + ", unchanged = " + unchanged + ", slightlyWorse = " + slightlyWorse + ", obviouslyWorse = " + obviouslyWorse + "}"; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/ESNOImpactSubzoneEntity.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/ESNOImpactSubzoneEntity.java new file mode 100644 index 000000000..09a162c0d --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/entity/ESNOImpactSubzoneEntity.java @@ -0,0 +1,218 @@ +package com.ruoyi.system.domain_yada.entity; + +/** + * ENSO事件影响监测地理亚区植被异常变化分布及VAI + * @author Mr.C + */ +public class ESNOImpactSubzoneEntity { + + private Integer id; + private String type; + private String year; + private String region; + private String regionEn; + private String vai; + private String obviouslyBetter; + private String slightlyBetter; + private String unchanged; + private String slightlyWorse; + private String obviouslyWorse; + + + public ESNOImpactSubzoneEntity() { + } + + public ESNOImpactSubzoneEntity(Integer id, String type, String year, String region, String regionEn, String vai, String obviouslyBetter, String slightlyBetter, String unchanged, String slightlyWorse, String obviouslyWorse) { + this.id = id; + this.type = type; + this.year = year; + this.region = region; + this.regionEn = regionEn; + this.vai = vai; + this.obviouslyBetter = obviouslyBetter; + this.slightlyBetter = slightlyBetter; + this.unchanged = unchanged; + this.slightlyWorse = slightlyWorse; + this.obviouslyWorse = obviouslyWorse; + } + + /** + * 获取 + * @return id + */ + public Integer getId() { + return id; + } + + /** + * 设置 + * @param id + */ + public void setId(Integer id) { + this.id = id; + } + + /** + * 获取 + * @return type + */ + public String getType() { + return type; + } + + /** + * 设置 + * @param type + */ + public void setType(String type) { + this.type = type; + } + + /** + * 获取 + * @return year + */ + public String getYear() { + return year; + } + + /** + * 设置 + * @param year + */ + public void setYear(String year) { + this.year = year; + } + + /** + * 获取 + * @return region + */ + public String getRegion() { + return region; + } + + /** + * 设置 + * @param region + */ + public void setRegion(String region) { + this.region = region; + } + + /** + * 获取 + * @return regionEn + */ + public String getRegionEn() { + return regionEn; + } + + /** + * 设置 + * @param regionEn + */ + public void setRegionEn(String regionEn) { + this.regionEn = regionEn; + } + + /** + * 获取 + * @return vai + */ + public String getVai() { + return vai; + } + + /** + * 设置 + * @param vai + */ + public void setVai(String vai) { + this.vai = vai; + } + + /** + * 获取 + * @return obviouslyBetter + */ + public String getObviouslyBetter() { + return obviouslyBetter; + } + + /** + * 设置 + * @param obviouslyBetter + */ + public void setObviouslyBetter(String obviouslyBetter) { + this.obviouslyBetter = obviouslyBetter; + } + + /** + * 获取 + * @return slightlyBetter + */ + public String getSlightlyBetter() { + return slightlyBetter; + } + + /** + * 设置 + * @param slightlyBetter + */ + public void setSlightlyBetter(String slightlyBetter) { + this.slightlyBetter = slightlyBetter; + } + + /** + * 获取 + * @return unchanged + */ + public String getUnchanged() { + return unchanged; + } + + /** + * 设置 + * @param unchanged + */ + public void setUnchanged(String unchanged) { + this.unchanged = unchanged; + } + + /** + * 获取 + * @return slightlyWorse + */ + public String getSlightlyWorse() { + return slightlyWorse; + } + + /** + * 设置 + * @param slightlyWorse + */ + public void setSlightlyWorse(String slightlyWorse) { + this.slightlyWorse = slightlyWorse; + } + + /** + * 获取 + * @return obviouslyWorse + */ + public String getObviouslyWorse() { + return obviouslyWorse; + } + + /** + * 设置 + * @param obviouslyWorse + */ + public void setObviouslyWorse(String obviouslyWorse) { + this.obviouslyWorse = obviouslyWorse; + } + + public String toString() { + return "ESNOImpactSubzoneEntity{id = " + id + ", type = " + type + ", year = " + year + ", region = " + region + ", regionEn = " + regionEn + ", vai = " + vai + ", obviouslyBetter = " + obviouslyBetter + ", slightlyBetter = " + slightlyBetter + ", unchanged = " + unchanged + ", slightlyWorse = " + slightlyWorse + ", obviouslyWorse = " + obviouslyWorse + "}"; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ESNOImpactCountryVaiVo.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ESNOImpactCountryVaiVo.java new file mode 100644 index 000000000..89f3118ab --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ESNOImpactCountryVaiVo.java @@ -0,0 +1,74 @@ +package com.ruoyi.system.domain_yada.vo; + +/** + * ENSO事件影响监测各国VAI + * @author Mr.C + */ +public class ESNOImpactCountryVaiVo { + + private String country; + private String countryEn; + private String vai; + + public ESNOImpactCountryVaiVo() { + } + + public ESNOImpactCountryVaiVo(String country, String countryEn, String vai) { + this.country = country; + this.countryEn = countryEn; + this.vai = vai; + } + + /** + * 获取 + * @return country + */ + public String getCountry() { + return country; + } + + /** + * 设置 + * @param country + */ + public void setCountry(String country) { + this.country = country; + } + + /** + * 获取 + * @return countryEn + */ + public String getCountryEn() { + return countryEn; + } + + /** + * 设置 + * @param countryEn + */ + public void setCountryEn(String countryEn) { + this.countryEn = countryEn; + } + + /** + * 获取 + * @return vai + */ + public String getVai() { + return vai; + } + + /** + * 设置 + * @param vai + */ + public void setVai(String vai) { + this.vai = vai; + } + + @Override + public String toString() { + return "ESNOImpactCountryVaiVo{country = " + country + ", countryEn = " + countryEn + ", vai = " + vai + "}"; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ESNOImpactSubzoneLineVo.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ESNOImpactSubzoneLineVo.java new file mode 100644 index 000000000..dd53aeb3c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ESNOImpactSubzoneLineVo.java @@ -0,0 +1,56 @@ +package com.ruoyi.system.domain_yada.vo; + +/** + * ENSO事件影响监测VAI年份折线 + * @author Mr.C + */ +public class ESNOImpactSubzoneLineVo { + + private String year; + + private String vai; + + public ESNOImpactSubzoneLineVo() { + } + + public ESNOImpactSubzoneLineVo(String year, String vai) { + this.year = year; + this.vai = vai; + } + + /** + * 获取 + * @return year + */ + public String getYear() { + return year; + } + + /** + * 设置 + * @param year + */ + public void setYear(String year) { + this.year = year; + } + + /** + * 获取 + * @return vai + */ + public String getVai() { + return vai; + } + + /** + * 设置 + * @param vai + */ + public void setVai(String vai) { + this.vai = vai; + } + + public String toString() { + return "ESNOImpactSubzoneLineVo{year = " + year + ", vai = " + vai + "}"; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ESNOImpactSubzoneVaiVo.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ESNOImpactSubzoneVaiVo.java new file mode 100644 index 000000000..9f17d4585 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ESNOImpactSubzoneVaiVo.java @@ -0,0 +1,74 @@ +package com.ruoyi.system.domain_yada.vo; + +/** + * ENSO事件影响监测地理亚区VAI + * @author Mr.C + */ +public class ESNOImpactSubzoneVaiVo { + + private String region; + private String regionEn; + private String vai; + + + public ESNOImpactSubzoneVaiVo() { + } + + public ESNOImpactSubzoneVaiVo(String region, String regionEn, String vai) { + this.region = region; + this.regionEn = regionEn; + this.vai = vai; + } + + /** + * 获取 + * @return region + */ + public String getRegion() { + return region; + } + + /** + * 设置 + * @param region + */ + public void setRegion(String region) { + this.region = region; + } + + /** + * 获取 + * @return regionEn + */ + public String getRegionEn() { + return regionEn; + } + + /** + * 设置 + * @param regionEn + */ + public void setRegionEn(String regionEn) { + this.regionEn = regionEn; + } + + /** + * 获取 + * @return vai + */ + public String getVai() { + return vai; + } + + /** + * 设置 + * @param vai + */ + public void setVai(String vai) { + this.vai = vai; + } + + public String toString() { + return "ESNOImpactSubzoneVaiVo{region = " + region + ", regionEn = " + regionEn + ", vai = " + vai + "}"; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ESNOImpactSubzoneVo.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ESNOImpactSubzoneVo.java new file mode 100644 index 000000000..a089544f2 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain_yada/vo/ESNOImpactSubzoneVo.java @@ -0,0 +1,110 @@ +package com.ruoyi.system.domain_yada.vo; + +/** + * ENSO事件影响监测地理亚区植被异常变化分布 + * @author Mr.C + */ +public class ESNOImpactSubzoneVo { + + private String obviouslyBetter; + private String slightlyBetter; + private String unchanged; + private String slightlyWorse; + private String obviouslyWorse; + + + public ESNOImpactSubzoneVo() { + } + + public ESNOImpactSubzoneVo(String obviouslyBetter, String slightlyBetter, String unchanged, String slightlyWorse, String obviouslyWorse) { + this.obviouslyBetter = obviouslyBetter; + this.slightlyBetter = slightlyBetter; + this.unchanged = unchanged; + this.slightlyWorse = slightlyWorse; + this.obviouslyWorse = obviouslyWorse; + } + + /** + * 获取 + * @return obviouslyBetter + */ + public String getObviouslyBetter() { + return obviouslyBetter; + } + + /** + * 设置 + * @param obviouslyBetter + */ + public void setObviouslyBetter(String obviouslyBetter) { + this.obviouslyBetter = obviouslyBetter; + } + + /** + * 获取 + * @return slightlyBetter + */ + public String getSlightlyBetter() { + return slightlyBetter; + } + + /** + * 设置 + * @param slightlyBetter + */ + public void setSlightlyBetter(String slightlyBetter) { + this.slightlyBetter = slightlyBetter; + } + + /** + * 获取 + * @return unchanged + */ + public String getUnchanged() { + return unchanged; + } + + /** + * 设置 + * @param unchanged + */ + public void setUnchanged(String unchanged) { + this.unchanged = unchanged; + } + + /** + * 获取 + * @return slightlyWorse + */ + public String getSlightlyWorse() { + return slightlyWorse; + } + + /** + * 设置 + * @param slightlyWorse + */ + public void setSlightlyWorse(String slightlyWorse) { + this.slightlyWorse = slightlyWorse; + } + + /** + * 获取 + * @return obviouslyWorse + */ + public String getObviouslyWorse() { + return obviouslyWorse; + } + + /** + * 设置 + * @param obviouslyWorse + */ + public void setObviouslyWorse(String obviouslyWorse) { + this.obviouslyWorse = obviouslyWorse; + } + + public String toString() { + return "ESNOImpactSubzoneVo{obviouslyBetter = " + obviouslyBetter + ", slightlyBetter = " + slightlyBetter + ", unchanged = " + unchanged + ", slightlyWorse = " + slightlyWorse + ", obviouslyWorse = " + obviouslyWorse + "}"; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/ESNOImpactMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/ESNOImpactMapper.java new file mode 100644 index 000000000..3b8f1f019 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper_yada/ESNOImpactMapper.java @@ -0,0 +1,64 @@ +package com.ruoyi.system.mapper_yada; + +import com.ruoyi.system.domain_yada.vo.ESNOImpactCountryVaiVo; +import com.ruoyi.system.domain_yada.vo.ESNOImpactSubzoneLineVo; +import com.ruoyi.system.domain_yada.vo.ESNOImpactSubzoneVaiVo; +import com.ruoyi.system.domain_yada.vo.ESNOImpactSubzoneVo; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * ENSO事件影响监测 + * + * @author Mr.C + */ +public interface ESNOImpactMapper { + + /** + * 各地理亚区植被异常分布 + * + * @param type + * @param year + * @param region + * @return + */ + ESNOImpactSubzoneVo subzonePie(@Param("type") String type, + @Param("year") String year, + @Param("region") String region); + + /** + * 各地理亚区VAI + * + * @param type + * @param year + * @return + */ + List subzoneVai(@Param("type") String type, + @Param("year") String year); + + /** + * 各国VAI + * + * @param type + * @param year + * @param country + * @return + */ + ESNOImpactCountryVaiVo countryVai(@Param("type") String type, + @Param("year") String year, + @Param("country") String country); + + /** + * 各地理亚区时间VAI + * + * @param type + * @param start + * @param end + * @return + */ + List subzoneVaiLine(@Param("type") String type, + @Param("region") String region, + @Param("start") String start, + @Param("end") String end); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/ESNOImpactService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/ESNOImpactService.java new file mode 100644 index 000000000..aec2415b7 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/ESNOImpactService.java @@ -0,0 +1,48 @@ +package com.ruoyi.system.service_yada; + +import com.ruoyi.system.domain_yada.vo.*; +import org.apache.ibatis.annotations.Param; + +/** + * ENSO事件影响监测 + * @author Mr.C + */ +public interface ESNOImpactService { + + /** + * 各地理亚区植被异常分布 + * @param type + * @param year + * @param region + * @return + */ + ESNOImpactSubzoneVo subzonePie(String type, String year, String region); + + + /** + * 各地理亚区VAI + * @param type + * @param year + * @return + */ + PmKeyValueEnVo subzoneVai(String type,String year); + + /** + * 各国VAI + * @param type + * @param year + * @param region + * @return + */ + PmKeyValueEnVo countryVai(String type,String year,String region); + + /** + * 各地理亚区时间VAI + * @param type + + * @param start + * @param end + * @return + */ + PmKeyValueVo subzoneVaiLine(String type,String region,String start,String end); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/ESNOImpactImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/ESNOImpactImpl.java new file mode 100644 index 000000000..eb035c2f5 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/ESNOImpactImpl.java @@ -0,0 +1,72 @@ +package com.ruoyi.system.service_yada.impl; + +import com.ruoyi.system.domain_yada.entity.MonitorCountryCorrespondingEntity; +import com.ruoyi.system.domain_yada.vo.*; +import com.ruoyi.system.mapper_yada.ESNOImpactMapper; +import com.ruoyi.system.mapper_yada.MonitorMapper; +import com.ruoyi.system.service_yada.ESNOImpactService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; + +/** + * ENSO事件影响监测 + * @author Mr.C + */ +@Service +public class ESNOImpactImpl implements ESNOImpactService { + @Resource + private ESNOImpactMapper esnoImpactMapper; + @Resource + private MonitorMapper monitorMapper; + + + @Override + public ESNOImpactSubzoneVo subzonePie(String type, String year, String region) { + return esnoImpactMapper.subzonePie(type,year,region); + } + + @Override + public PmKeyValueEnVo subzoneVai(String type, String year) { + List list = esnoImpactMapper.subzoneVai(type, year); + List key = new ArrayList<>(); + List keyEn = new ArrayList<>(); + List value = new ArrayList<>(); + list.forEach(v->{ + key.add(v.getRegion()); + keyEn.add(v.getRegionEn()); + value.add(Double.valueOf(v.getVai())); + }); + return new PmKeyValueEnVo(key.subList(0,7),keyEn.subList(0,7),value.subList(0,7)); + } + + @Override + public PmKeyValueEnVo countryVai(String type, String year, String region) { + List list = monitorMapper.countryCorresponding(region); + List key = new ArrayList<>(); + List keyEn = new ArrayList<>(); + List value = new ArrayList<>(); + list.forEach(v->{ + key.add(v.getCountry()); + keyEn.add(v.getCountryEn()); + value.add(Double.valueOf(esnoImpactMapper.countryVai(type, year, v.getCountry()).getVai())); + }); + return new PmKeyValueEnVo(key,keyEn,value); + } + + @Override + public PmKeyValueVo subzoneVaiLine(String type,String region, String start, String end) { + List list = esnoImpactMapper.subzoneVaiLine(type, region,start, end); + list.sort(Comparator.comparing(ESNOImpactSubzoneLineVo::getYear)); + List key = new ArrayList<>(); + List value = new ArrayList<>(); + list.forEach(v->{ + key.add(v.getYear()); + value.add(Double.valueOf(v.getVai())); + }); + return new PmKeyValueVo(key,value); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/MonitorImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/MonitorImpl.java index 4cf8512eb..24beb51c5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/MonitorImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service_yada/impl/MonitorImpl.java @@ -73,7 +73,7 @@ public class MonitorImpl implements MonitorService { break; default: } - return new PmKeyValueEnVo(key, keyEn, value); + return new PmKeyValueEnVo(key.subList(0,7), keyEn.subList(0,7), value.subList(0,7)); } @Override diff --git a/ruoyi-system/src/main/resources/mapper/system/ESNOImpactMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ESNOImpactMapper.xml new file mode 100644 index 000000000..b0cd8f864 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/ESNOImpactMapper.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/MonitorMapper.xml b/ruoyi-system/src/main/resources/mapper/system/MonitorMapper.xml index 4137e7891..bc3290d53 100644 --- a/ruoyi-system/src/main/resources/mapper/system/MonitorMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/MonitorMapper.xml @@ -214,6 +214,5 @@ and #{end} >= mea.year - \ No newline at end of file