ENSO影响监测
This commit is contained in:
parent
41ad8eebc3
commit
d6a411e858
@ -0,0 +1,109 @@
|
||||
package com.ruoyi.web.controller.yada;
|
||||
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.system.domain_yada.entity.ENSOEventAnalysisEntity;
|
||||
import com.ruoyi.system.domain_yada.entity.ENSOEventRateEntity;
|
||||
import com.ruoyi.system.domain_yada.entity.ENSOMonthEventEntity;
|
||||
import com.ruoyi.system.domain_yada.entity.ENSOYearUnusualRateEntity;
|
||||
import com.ruoyi.system.domain_yada.vo.ENSOEventAnalysisVo;
|
||||
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.ENSOImpactService;
|
||||
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 ENSOImpactController {
|
||||
|
||||
@Resource
|
||||
private ENSOImpactService ensoImpactService;
|
||||
|
||||
@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 = ensoImpactService.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 = ensoImpactService.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 = ensoImpactService.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 = ensoImpactService.subzoneVaiLine(type, region, start, end);
|
||||
return AjaxResult.success(pmKeyValueVo);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/ensoEventRate", method = {RequestMethod.GET})
|
||||
@ApiOperation(value = "四类ENSO事件空间分布统计", httpMethod = "GET")
|
||||
public AjaxResult ensoEventRate(@RequestParam(value = "type") String type,
|
||||
@RequestParam(value = "zone") String zone,
|
||||
@RequestParam(value = "year") String year) {
|
||||
ENSOEventRateEntity ensoEventRateEntity = ensoImpactService.ensoEventRate(type, zone, year);
|
||||
return AjaxResult.success(ensoEventRateEntity);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/ensoYearUnusualRate", method = {RequestMethod.GET})
|
||||
@ApiOperation(value = "特定年份异常占比", httpMethod = "GET")
|
||||
public AjaxResult ensoYearUnusualRate(@RequestParam(value = "year") String year,
|
||||
@RequestParam(value = "zone") String zone,
|
||||
@RequestParam(value = "type") String type) {
|
||||
ENSOYearUnusualRateEntity ensoYearUnusualRateEntity = ensoImpactService.ensoYearUnusualRate(year, zone, type);
|
||||
return AjaxResult.success(ensoYearUnusualRateEntity);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/ensoMonthEvent", method = {RequestMethod.GET})
|
||||
@ApiOperation(value = "逐月时间事件序列", httpMethod = "GET")
|
||||
public AjaxResult ensoMonthEvent(@RequestParam(value = "zone") String zone,
|
||||
@RequestParam(value = "type") String type) {
|
||||
PmKeyValueVo pmKeyValueVo = ensoImpactService.ensoMonthEvent(type, zone);
|
||||
return AjaxResult.success(pmKeyValueVo);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/ensoEventAnalysis", method = {RequestMethod.GET})
|
||||
@ApiOperation(value = "事件历史分析", httpMethod = "GET")
|
||||
public AjaxResult ensoEventAnalysis(@RequestParam(value = "zone") String zone,
|
||||
@RequestParam(value = "type") String type) {
|
||||
ENSOEventAnalysisVo ensoEventAnalysisVo = ensoImpactService.ensoEventAnalysis(type, zone);
|
||||
return AjaxResult.success(ensoEventAnalysisVo);
|
||||
}
|
||||
}
|
@ -1,70 +0,0 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,113 @@
|
||||
package com.ruoyi.system.domain_yada.entity;
|
||||
|
||||
/**
|
||||
* 事件异常分析
|
||||
* @author Mr.C
|
||||
*/
|
||||
public class ENSOEventAnalysisEntity {
|
||||
private Integer id;
|
||||
|
||||
private String year;
|
||||
|
||||
private String type;
|
||||
|
||||
private String zone;
|
||||
|
||||
private String value;
|
||||
|
||||
public ENSOEventAnalysisEntity() {
|
||||
}
|
||||
|
||||
public ENSOEventAnalysisEntity(Integer id, String year, String type, String zone, String value) {
|
||||
this.id = id;
|
||||
this.year = year;
|
||||
this.type = type;
|
||||
this.zone = zone;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @return id
|
||||
*/
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置
|
||||
* @param id
|
||||
*/
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @return year
|
||||
*/
|
||||
public String getYear() {
|
||||
return year;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置
|
||||
* @param year
|
||||
*/
|
||||
public void setYear(String year) {
|
||||
this.year = year;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @return type
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置
|
||||
* @param type
|
||||
*/
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @return zone
|
||||
*/
|
||||
public String getZone() {
|
||||
return zone;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置
|
||||
* @param zone
|
||||
*/
|
||||
public void setZone(String zone) {
|
||||
this.zone = zone;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @return value
|
||||
*/
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置
|
||||
* @param value
|
||||
*/
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ENSOEventAnalysisEntity{id = " + id + ", year = " + year + ", type = " + type + ", zone = " + zone + ", value = " + value + "}";
|
||||
}
|
||||
}
|
@ -0,0 +1,210 @@
|
||||
package com.ruoyi.system.domain_yada.entity;
|
||||
|
||||
/**
|
||||
* 四类ENSO事件空间分布统计
|
||||
* @author Mr.C
|
||||
*/
|
||||
public class ENSOEventRateEntity {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String type;
|
||||
|
||||
private String zone;
|
||||
|
||||
private String event;
|
||||
|
||||
private String eventEn;
|
||||
|
||||
private String obviouslyBetter;
|
||||
|
||||
private String slightlyBetter;
|
||||
|
||||
private String unchanged;
|
||||
|
||||
private String slightlyWorse;
|
||||
|
||||
private String obviouslyWorse;
|
||||
|
||||
|
||||
public ENSOEventRateEntity() {
|
||||
}
|
||||
|
||||
public ENSOEventRateEntity(Integer id, String type, String zone, String event, String eventEn, String obviouslyBetter, String slightlyBetter, String unchanged, String slightlyWorse, String obviouslyWorse) {
|
||||
this.id = id;
|
||||
this.type = type;
|
||||
this.zone = zone;
|
||||
this.event = event;
|
||||
this.eventEn = eventEn;
|
||||
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 zone
|
||||
*/
|
||||
public String getZone() {
|
||||
return zone;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置
|
||||
* @param zone
|
||||
*/
|
||||
public void setZone(String zone) {
|
||||
this.zone = zone;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @return event
|
||||
*/
|
||||
public String getEvent() {
|
||||
return event;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置
|
||||
* @param event
|
||||
*/
|
||||
public void setEvent(String event) {
|
||||
this.event = event;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @return eventEn
|
||||
*/
|
||||
public String getEventEn() {
|
||||
return eventEn;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置
|
||||
* @param eventEn
|
||||
*/
|
||||
public void setEventEn(String eventEn) {
|
||||
this.eventEn = eventEn;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @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 "ENSOEventRateEntity{id = " + id + ", type = " + type + ", zone = " + zone + ", event = " + event + ", eventEn = " + eventEn + ", obviouslyBetter = " + obviouslyBetter + ", slightlyBetter = " + slightlyBetter + ", unchanged = " + unchanged + ", slightlyWorse = " + slightlyWorse + ", obviouslyWorse = " + obviouslyWorse + "}";
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@ package com.ruoyi.system.domain_yada.entity;
|
||||
* ENSO事件影响监测地理g植被异常变化分布及VAI
|
||||
* @author Mr.C
|
||||
*/
|
||||
public class ESNOImpactCountryEntity {
|
||||
public class ENSOImpactCountryEntity {
|
||||
|
||||
private Integer id;
|
||||
private String type;
|
||||
@ -19,10 +19,10 @@ public class ESNOImpactCountryEntity {
|
||||
private String obviouslyWorse;
|
||||
|
||||
|
||||
public ESNOImpactCountryEntity() {
|
||||
public ENSOImpactCountryEntity() {
|
||||
}
|
||||
|
||||
public ESNOImpactCountryEntity(Integer id, String type, String year, String country, String countryEn, String vai, String obviouslyBetter, String slightlyBetter, String unchanged, String slightlyWorse, String obviouslyWorse) {
|
||||
public ENSOImpactCountryEntity(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;
|
@ -4,7 +4,7 @@ package com.ruoyi.system.domain_yada.entity;
|
||||
* ENSO事件影响监测地理亚区植被异常变化分布及VAI
|
||||
* @author Mr.C
|
||||
*/
|
||||
public class ESNOImpactSubzoneEntity {
|
||||
public class ENSOImpactSubzoneEntity {
|
||||
|
||||
private Integer id;
|
||||
private String type;
|
||||
@ -19,10 +19,10 @@ public class ESNOImpactSubzoneEntity {
|
||||
private String obviouslyWorse;
|
||||
|
||||
|
||||
public ESNOImpactSubzoneEntity() {
|
||||
public ENSOImpactSubzoneEntity() {
|
||||
}
|
||||
|
||||
public ESNOImpactSubzoneEntity(Integer id, String type, String year, String region, String regionEn, String vai, String obviouslyBetter, String slightlyBetter, String unchanged, String slightlyWorse, String obviouslyWorse) {
|
||||
public ENSOImpactSubzoneEntity(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;
|
@ -0,0 +1,131 @@
|
||||
package com.ruoyi.system.domain_yada.entity;
|
||||
|
||||
/**
|
||||
* 逐月时间时间序列
|
||||
* @author Mr.C
|
||||
*/
|
||||
public class ENSOMonthEventEntity {
|
||||
private Integer id;
|
||||
|
||||
private String type;
|
||||
|
||||
private String year;
|
||||
|
||||
private String zone;
|
||||
|
||||
private String month;
|
||||
|
||||
private String value;
|
||||
|
||||
public ENSOMonthEventEntity() {
|
||||
}
|
||||
|
||||
public ENSOMonthEventEntity(Integer id, String type, String year, String zone, String month, String value) {
|
||||
this.id = id;
|
||||
this.type = type;
|
||||
this.year = year;
|
||||
this.zone = zone;
|
||||
this.month = month;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @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 zone
|
||||
*/
|
||||
public String getZone() {
|
||||
return zone;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置
|
||||
* @param zone
|
||||
*/
|
||||
public void setZone(String zone) {
|
||||
this.zone = zone;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @return month
|
||||
*/
|
||||
public String getMonth() {
|
||||
return month;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置
|
||||
* @param month
|
||||
*/
|
||||
public void setMonth(String month) {
|
||||
this.month = month;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @return value
|
||||
*/
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置
|
||||
* @param value
|
||||
*/
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "ENSOMonthEventEntity{id = " + id + ", type = " + type + ", year = " + year + ", zone = " + zone + ", month = " + month + ", value = " + value + "}";
|
||||
}
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
package com.ruoyi.system.domain_yada.entity;
|
||||
|
||||
/**
|
||||
* 年份与ENSO事件类型对应关系
|
||||
* @author Mr.C
|
||||
*/
|
||||
public class ENSOYearEventCorrespondingEntity {
|
||||
private Integer id;
|
||||
|
||||
private String year;
|
||||
|
||||
private String event;
|
||||
|
||||
private String eventEn;
|
||||
|
||||
|
||||
public ENSOYearEventCorrespondingEntity() {
|
||||
}
|
||||
|
||||
public ENSOYearEventCorrespondingEntity(Integer id, String year, String event, String eventEn) {
|
||||
this.id = id;
|
||||
this.year = year;
|
||||
this.event = event;
|
||||
this.eventEn = eventEn;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @return id
|
||||
*/
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置
|
||||
* @param id
|
||||
*/
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @return year
|
||||
*/
|
||||
public String getYear() {
|
||||
return year;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置
|
||||
* @param year
|
||||
*/
|
||||
public void setYear(String year) {
|
||||
this.year = year;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @return event
|
||||
*/
|
||||
public String getEvent() {
|
||||
return event;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置
|
||||
* @param event
|
||||
*/
|
||||
public void setEvent(String event) {
|
||||
this.event = event;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @return eventEn
|
||||
*/
|
||||
public String getEventEn() {
|
||||
return eventEn;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置
|
||||
* @param eventEn
|
||||
*/
|
||||
public void setEventEn(String eventEn) {
|
||||
this.eventEn = eventEn;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "ENSOYearEventCorrespondingEntity{id = " + id + ", year = " + year + ", event = " + event + ", eventEn = " + eventEn + "}";
|
||||
}
|
||||
}
|
@ -0,0 +1,191 @@
|
||||
package com.ruoyi.system.domain_yada.entity;
|
||||
|
||||
/**
|
||||
* 特定年份异常占比
|
||||
* @author Mr.C
|
||||
*/
|
||||
public class ENSOYearUnusualRateEntity {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String year;
|
||||
|
||||
private String zone;
|
||||
|
||||
private String type;
|
||||
|
||||
private String obviouslyBetter;
|
||||
|
||||
private String slightlyBetter;
|
||||
|
||||
private String unchanged;
|
||||
|
||||
private String slightlyWorse;
|
||||
|
||||
private String obviouslyWorse;
|
||||
|
||||
|
||||
public ENSOYearUnusualRateEntity() {
|
||||
}
|
||||
|
||||
public ENSOYearUnusualRateEntity(Integer id, String year, String zone, String type, String obviouslyBetter, String slightlyBetter, String unchanged, String slightlyWorse, String obviouslyWorse) {
|
||||
this.id = id;
|
||||
this.year = year;
|
||||
this.zone = zone;
|
||||
this.type = type;
|
||||
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 year
|
||||
*/
|
||||
public String getYear() {
|
||||
return year;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置
|
||||
* @param year
|
||||
*/
|
||||
public void setYear(String year) {
|
||||
this.year = year;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @return zone
|
||||
*/
|
||||
public String getZone() {
|
||||
return zone;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置
|
||||
* @param zone
|
||||
*/
|
||||
public void setZone(String zone) {
|
||||
this.zone = zone;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @return type
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置
|
||||
* @param type
|
||||
*/
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @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 "ENSOYearUnusualRateEntity{id = " + id + ", year = " + year + ", zone = " + zone + ", type = " + type + ", obviouslyBetter = " + obviouslyBetter + ", slightlyBetter = " + slightlyBetter + ", unchanged = " + unchanged + ", slightlyWorse = " + slightlyWorse + ", obviouslyWorse = " + obviouslyWorse + "}";
|
||||
}
|
||||
}
|
@ -1,5 +1,9 @@
|
||||
package com.ruoyi.system.domain_yada.entity;
|
||||
|
||||
/**
|
||||
* 柬埔寨各省对应关系
|
||||
* @author Mr.C
|
||||
*/
|
||||
public class ProvinceCorrespondingEntity {
|
||||
private Integer id;
|
||||
|
||||
|
@ -0,0 +1,93 @@
|
||||
package com.ruoyi.system.domain_yada.vo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 事件异常分析
|
||||
* @author Mr.C
|
||||
*/
|
||||
public class ENSOEventAnalysisVo {
|
||||
private PmKeyValueVo elninoEp;
|
||||
private PmKeyValueVo elninoCp;
|
||||
private PmKeyValueVo laninaEp;
|
||||
private PmKeyValueVo laninaCp;
|
||||
|
||||
public ENSOEventAnalysisVo() {
|
||||
}
|
||||
|
||||
public ENSOEventAnalysisVo(PmKeyValueVo elninoEp, PmKeyValueVo elninoCp, PmKeyValueVo laninaEp, PmKeyValueVo laninaCp) {
|
||||
this.elninoEp = elninoEp;
|
||||
this.elninoCp = elninoCp;
|
||||
this.laninaEp = laninaEp;
|
||||
this.laninaCp = laninaCp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @return elninoEp
|
||||
*/
|
||||
public PmKeyValueVo getElninoEp() {
|
||||
return elninoEp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置
|
||||
* @param elninoEp
|
||||
*/
|
||||
public void setElninoEp(PmKeyValueVo elninoEp) {
|
||||
this.elninoEp = elninoEp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @return elninoCp
|
||||
*/
|
||||
public PmKeyValueVo getElninoCp() {
|
||||
return elninoCp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置
|
||||
* @param elninoCp
|
||||
*/
|
||||
public void setElninoCp(PmKeyValueVo elninoCp) {
|
||||
this.elninoCp = elninoCp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @return laninaEp
|
||||
*/
|
||||
public PmKeyValueVo getLaninaEp() {
|
||||
return laninaEp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置
|
||||
* @param laninaEp
|
||||
*/
|
||||
public void setLaninaEp(PmKeyValueVo laninaEp) {
|
||||
this.laninaEp = laninaEp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @return laninaCp
|
||||
*/
|
||||
public PmKeyValueVo getLaninaCp() {
|
||||
return laninaCp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置
|
||||
* @param laninaCp
|
||||
*/
|
||||
public void setLaninaCp(PmKeyValueVo laninaCp) {
|
||||
this.laninaCp = laninaCp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ENSOEventAnalysisVo{elninoEp = " + elninoEp + ", elninoCp = " + elninoCp + ", laninaEp = " + laninaEp + ", laninaCp = " + laninaCp + "}";
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.ruoyi.system.mapper_yada;
|
||||
|
||||
import com.ruoyi.system.domain_yada.entity.*;
|
||||
import com.ruoyi.system.domain_yada.vo.ESNOImpactCountryVaiVo;
|
||||
import com.ruoyi.system.domain_yada.vo.ESNOImpactSubzoneLineVo;
|
||||
import com.ruoyi.system.domain_yada.vo.ESNOImpactSubzoneVaiVo;
|
||||
@ -13,7 +14,7 @@ import java.util.List;
|
||||
*
|
||||
* @author Mr.C
|
||||
*/
|
||||
public interface ESNOImpactMapper {
|
||||
public interface ENSOImpactMapper {
|
||||
|
||||
/**
|
||||
* 各地理亚区植被异常分布
|
||||
@ -61,4 +62,63 @@ public interface ESNOImpactMapper {
|
||||
@Param("region") String region,
|
||||
@Param("start") String start,
|
||||
@Param("end") String end);
|
||||
|
||||
/**
|
||||
* 年份与ENSO事件对应关系
|
||||
* @param year
|
||||
* @return
|
||||
*/
|
||||
ENSOYearEventCorrespondingEntity ensoYearEventCorresponding(@Param("year") String year);
|
||||
|
||||
/**
|
||||
* ENSO事件与年份对应关系
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
List<ENSOYearEventCorrespondingEntity> ensoEventYearCorresponding(@Param("event") String event);
|
||||
|
||||
|
||||
/**
|
||||
* 四类ENSO事件空间分布统计
|
||||
* @param event
|
||||
* @param zone
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
ENSOEventRateEntity ensoEventRate(@Param("type") String type,
|
||||
@Param("zone") String zone,
|
||||
@Param("event") String event);
|
||||
|
||||
/**
|
||||
* 特定年份异常占比
|
||||
* @param year
|
||||
* @param zone
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
ENSOYearUnusualRateEntity ensoYearUnusualRate(@Param("year") String year,
|
||||
@Param("zone") String zone,
|
||||
@Param("type") String type);
|
||||
|
||||
/**
|
||||
* 逐月时间事件序列
|
||||
* @param type
|
||||
* @param zone
|
||||
* @return
|
||||
*/
|
||||
List<ENSOMonthEventEntity> ensoMonthEvent(@Param("type") String type,
|
||||
@Param("zone") String zone);
|
||||
|
||||
|
||||
/**
|
||||
* 事件异常分析
|
||||
* @param type
|
||||
* @param zone
|
||||
* @param year
|
||||
* @return
|
||||
*/
|
||||
List<ENSOEventAnalysisEntity> ensoEventAnalysis(@Param("type") String type,
|
||||
@Param("zone") String zone,
|
||||
@Param("year") List<String> year);
|
||||
}
|
||||
|
@ -0,0 +1,88 @@
|
||||
package com.ruoyi.system.service_yada;
|
||||
|
||||
import com.ruoyi.system.domain_yada.entity.ENSOEventAnalysisEntity;
|
||||
import com.ruoyi.system.domain_yada.entity.ENSOEventRateEntity;
|
||||
import com.ruoyi.system.domain_yada.entity.ENSOMonthEventEntity;
|
||||
import com.ruoyi.system.domain_yada.entity.ENSOYearUnusualRateEntity;
|
||||
import com.ruoyi.system.domain_yada.vo.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ENSO事件影响监测
|
||||
* @author Mr.C
|
||||
*/
|
||||
public interface ENSOImpactService {
|
||||
|
||||
/**
|
||||
* 各地理亚区植被异常分布
|
||||
* @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);
|
||||
|
||||
/**
|
||||
* 四类ENSO事件空间分布统计
|
||||
* @param type
|
||||
* @param zone
|
||||
* @param year
|
||||
* @return
|
||||
*/
|
||||
ENSOEventRateEntity ensoEventRate(String type,String zone,String year);
|
||||
|
||||
/**
|
||||
* 特定年份异常占比
|
||||
* @param year
|
||||
* @param zone
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
ENSOYearUnusualRateEntity ensoYearUnusualRate(String year,String zone,String type);
|
||||
|
||||
/**
|
||||
* 逐月时间事件序列
|
||||
* @param type
|
||||
* @param zone
|
||||
* @return
|
||||
*/
|
||||
PmKeyValueVo ensoMonthEvent(String type,String zone);
|
||||
|
||||
/**
|
||||
* 事件异常分析
|
||||
* @param type
|
||||
* @param zone
|
||||
* @return
|
||||
*/
|
||||
ENSOEventAnalysisVo ensoEventAnalysis(String type,String zone);
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
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);
|
||||
}
|
@ -0,0 +1,134 @@
|
||||
package com.ruoyi.system.service_yada.impl;
|
||||
|
||||
import com.ruoyi.system.domain_yada.entity.*;
|
||||
import com.ruoyi.system.domain_yada.vo.*;
|
||||
import com.ruoyi.system.mapper_yada.ENSOImpactMapper;
|
||||
import com.ruoyi.system.mapper_yada.MonitorMapper;
|
||||
import com.ruoyi.system.service_yada.ENSOImpactService;
|
||||
import org.apache.ibatis.ognl.ASTList;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* ENSO事件影响监测
|
||||
* @author Mr.C
|
||||
*/
|
||||
@Service
|
||||
public class ENSOImpactImpl implements ENSOImpactService {
|
||||
@Resource
|
||||
private ENSOImpactMapper ensoImpactMapper;
|
||||
@Resource
|
||||
private MonitorMapper monitorMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public ESNOImpactSubzoneVo subzonePie(String type, String year, String region) {
|
||||
return ensoImpactMapper.subzonePie(type,year,region);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PmKeyValueEnVo subzoneVai(String type, String year) {
|
||||
List<ESNOImpactSubzoneVaiVo> list = ensoImpactMapper.subzoneVai(type, year);
|
||||
List<String> key = new ArrayList<>();
|
||||
List<String> keyEn = new ArrayList<>();
|
||||
List<Double> 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<MonitorCountryCorrespondingEntity> list = monitorMapper.countryCorresponding(region);
|
||||
List<String> country = new ArrayList<>();
|
||||
list.forEach(v->country.add(v.getCountry()));
|
||||
List<String> key = new ArrayList<>();
|
||||
List<String> keyEn = new ArrayList<>();
|
||||
List<Double> value = new ArrayList<>();
|
||||
List<ESNOImpactCountryVaiVo> lists = ensoImpactMapper.countryVai(type, year, country);
|
||||
lists.forEach(v->{
|
||||
key.add(v.getCountry());
|
||||
keyEn.add(v.getCountryEn());
|
||||
value.add(Double.valueOf(v.getVai()));
|
||||
});
|
||||
return new PmKeyValueEnVo(key,keyEn,value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PmKeyValueVo subzoneVaiLine(String type,String region, String start, String end) {
|
||||
List<ESNOImpactSubzoneLineVo> list = ensoImpactMapper.subzoneVaiLine(type, region,start, end);
|
||||
list.sort(Comparator.comparing(ESNOImpactSubzoneLineVo::getYear));
|
||||
List<String> key = new ArrayList<>();
|
||||
List<Double> value = new ArrayList<>();
|
||||
list.forEach(v->{
|
||||
key.add(v.getYear());
|
||||
value.add(Double.valueOf(v.getVai()));
|
||||
});
|
||||
return new PmKeyValueVo(key,value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ENSOEventRateEntity ensoEventRate(String type, String zone, String year) {
|
||||
String event = ensoImpactMapper.ensoYearEventCorresponding(year).getEvent();
|
||||
return ensoImpactMapper.ensoEventRate(type, zone, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ENSOYearUnusualRateEntity ensoYearUnusualRate(String year, String zone, String type) {
|
||||
return ensoImpactMapper.ensoYearUnusualRate(year, zone, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PmKeyValueVo ensoMonthEvent(String type, String zone) {
|
||||
List<ENSOMonthEventEntity> list = ensoImpactMapper.ensoMonthEvent(type, zone);
|
||||
List<ENSOMonthEventEntity> collect = list.stream()
|
||||
.sorted(Comparator.comparing((ENSOMonthEventEntity e)-> Integer.valueOf(e.getYear()))
|
||||
.thenComparing((ENSOMonthEventEntity e)-> Integer.valueOf(e.getMonth())))
|
||||
.collect(Collectors.toList());
|
||||
List<String> key = new ArrayList<>();
|
||||
List<Double> value = new ArrayList<>();
|
||||
collect.forEach(v->{
|
||||
if("1".equals(v.getMonth())){
|
||||
key.add(v.getYear()+"-"+v.getMonth());
|
||||
}else {
|
||||
key.add(v.getMonth());
|
||||
}
|
||||
value.add(Double.valueOf(v.getValue()));
|
||||
});
|
||||
return new PmKeyValueVo(key,value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ENSOEventAnalysisVo ensoEventAnalysis(String type, String zone) {
|
||||
List<String> events = Arrays.asList("厄尔尼诺东部型","厄尔尼诺中部型","拉尼娜东部型","拉尼娜中部型");
|
||||
List<PmKeyValueVo> vo = new ArrayList<>();
|
||||
events.forEach(v->{
|
||||
List<ENSOYearEventCorrespondingEntity> list = ensoImpactMapper.ensoEventYearCorresponding(v);
|
||||
List<String> year = new ArrayList<>();
|
||||
list.forEach(e-> year.add(e.getYear()));
|
||||
List<ENSOEventAnalysisEntity> ensoEventAnalysisEntities = ensoImpactMapper.ensoEventAnalysis(type, zone, year);
|
||||
List<String> key = new ArrayList<>();
|
||||
List<Double> value = new ArrayList<>();
|
||||
ensoEventAnalysisEntities.forEach(k->{
|
||||
key.add(k.getYear());
|
||||
value.add(Double.valueOf(k.getValue()));
|
||||
});
|
||||
vo.add(new PmKeyValueVo(key,value));
|
||||
});
|
||||
ENSOEventAnalysisVo ensoEventAnalysisVo = new ENSOEventAnalysisVo();
|
||||
ensoEventAnalysisVo.setElninoEp(vo.get(0));
|
||||
ensoEventAnalysisVo.setElninoCp(vo.get(1));
|
||||
ensoEventAnalysisVo.setLaninaEp(vo.get(2));
|
||||
ensoEventAnalysisVo.setLaninaCp(vo.get(3));
|
||||
return ensoEventAnalysisVo;
|
||||
}
|
||||
}
|
@ -1,75 +0,0 @@
|
||||
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<ESNOImpactSubzoneVaiVo> list = esnoImpactMapper.subzoneVai(type, year);
|
||||
List<String> key = new ArrayList<>();
|
||||
List<String> keyEn = new ArrayList<>();
|
||||
List<Double> 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<MonitorCountryCorrespondingEntity> list = monitorMapper.countryCorresponding(region);
|
||||
List<String> country = new ArrayList<>();
|
||||
list.forEach(v->country.add(v.getCountry()));
|
||||
List<String> key = new ArrayList<>();
|
||||
List<String> keyEn = new ArrayList<>();
|
||||
List<Double> value = new ArrayList<>();
|
||||
List<ESNOImpactCountryVaiVo> lists = esnoImpactMapper.countryVai(type, year, country);
|
||||
lists.forEach(v->{
|
||||
key.add(v.getCountry());
|
||||
keyEn.add(v.getCountryEn());
|
||||
value.add(Double.valueOf(v.getVai()));
|
||||
});
|
||||
return new PmKeyValueEnVo(key,keyEn,value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PmKeyValueVo subzoneVaiLine(String type,String region, String start, String end) {
|
||||
List<ESNOImpactSubzoneLineVo> list = esnoImpactMapper.subzoneVaiLine(type, region,start, end);
|
||||
list.sort(Comparator.comparing(ESNOImpactSubzoneLineVo::getYear));
|
||||
List<String> key = new ArrayList<>();
|
||||
List<Double> value = new ArrayList<>();
|
||||
list.forEach(v->{
|
||||
key.add(v.getYear());
|
||||
value.add(Double.valueOf(v.getVai()));
|
||||
});
|
||||
return new PmKeyValueVo(key,value);
|
||||
}
|
||||
}
|
@ -0,0 +1,187 @@
|
||||
<?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.ruoyi.system.mapper_yada.ENSOImpactMapper">
|
||||
|
||||
<resultMap id="ENSO_Impact_Subzone" type="com.ruoyi.system.domain_yada.vo.ESNOImpactSubzoneVo">
|
||||
<result column="obviously_better" property="obviouslyBetter"/>
|
||||
<result column="slightly_better" property="slightlyBetter"/>
|
||||
<result column="unchanged" property="unchanged"/>
|
||||
<result column="slightly_worse" property="slightlyWorse"/>
|
||||
<result column="obviously_worse" property="obviouslyWorse"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ENSO_Impact_Subzone_Vai" type="com.ruoyi.system.domain_yada.vo.ESNOImpactSubzoneVaiVo">
|
||||
<result column="region" property="region"/>
|
||||
<result column="region_en" property="regionEn"/>
|
||||
<result column="vai" property="vai"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ENSO_Impact_Country_Vai" type="com.ruoyi.system.domain_yada.vo.ESNOImpactCountryVaiVo">
|
||||
<result column="country" property="country"/>
|
||||
<result column="country_en" property="countryEn"/>
|
||||
<result column="vai" property="vai"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ENSO_Impact_Subzone_Line" type="com.ruoyi.system.domain_yada.vo.ESNOImpactSubzoneLineVo">
|
||||
<result column="year" property="year"/>
|
||||
<result column="vai" property="vai"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ENSO_Year_Event_Corresponding"
|
||||
type="com.ruoyi.system.domain_yada.entity.ENSOYearEventCorrespondingEntity">
|
||||
<id column="id" property="id"/>
|
||||
<result column="year" property="year"/>
|
||||
<result column="event" property="event"/>
|
||||
<result column="event_en" property="eventEn"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ENSO_Event_Rate"
|
||||
type="com.ruoyi.system.domain_yada.entity.ENSOEventRateEntity">
|
||||
<id column="id" property="id"/>
|
||||
<result column="type" property="type"/>
|
||||
<result column="zone" property="zone"/>
|
||||
<result column="event" property="event"/>
|
||||
<result column="event_en" property="eventEn"/>
|
||||
<result column="obviously_better" property="obviouslyBetter"/>
|
||||
<result column="slightly_better" property="slightlyBetter"/>
|
||||
<result column="unchanged" property="unchanged"/>
|
||||
<result column="slightly_worse" property="slightlyWorse"/>
|
||||
<result column="obviously_worse" property="obviouslyWorse"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ENSO_Year_Unusual_Rate"
|
||||
type="com.ruoyi.system.domain_yada.entity.ENSOYearUnusualRateEntity">
|
||||
<id column="id" property="id"/>
|
||||
<result column="year" property="year"/>
|
||||
<result column="zone" property="zone"/>
|
||||
<result column="type" property="type"/>
|
||||
<result column="obviously_better" property="obviouslyBetter"/>
|
||||
<result column="slightly_better" property="slightlyBetter"/>
|
||||
<result column="unchanged" property="unchanged"/>
|
||||
<result column="slightly_worse" property="slightlyWorse"/>
|
||||
<result column="obviously_worse" property="obviouslyWorse"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ENSO_Month_Event"
|
||||
type="com.ruoyi.system.domain_yada.entity.ENSOMonthEventEntity">
|
||||
<id column="id" property="id"/>
|
||||
<result column="type" property="type"/>
|
||||
<result column="year" property="year"/>
|
||||
<result column="zone" property="zone"/>
|
||||
<result column="month" property="month"/>
|
||||
<result column="value" property="value"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ENSO_Event_Analysis"
|
||||
type="com.ruoyi.system.domain_yada.entity.ENSOEventAnalysisEntity">
|
||||
<id column="id" property="id"/>
|
||||
<result column="year" property="year"/>
|
||||
<result column="type" property="type"/>
|
||||
<result column="zone" property="zone"/>
|
||||
<result column="value" property="value"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="subzonePie" resultMap="ENSO_Impact_Subzone">
|
||||
select obviously_better, slightly_better, unchanged, slightly_worse, obviously_worse
|
||||
from esno_impact_subzone
|
||||
where type = #{type}
|
||||
and year = #{year}
|
||||
and region = #{region}
|
||||
</select>
|
||||
|
||||
<select id="subzoneVai" resultMap="ENSO_Impact_Subzone_Vai">
|
||||
select region, region_en, vai
|
||||
from esno_impact_subzone
|
||||
where type = #{type}
|
||||
and year = #{year}
|
||||
</select>
|
||||
|
||||
<select id="countryVai" resultMap="ENSO_Impact_Country_Vai">
|
||||
select country, country_en, vai
|
||||
from esno_impact_country
|
||||
where type = #{type}
|
||||
and year = #{year}
|
||||
and country in
|
||||
<foreach collection="country" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="subzoneVaiLine" resultMap="ENSO_Impact_Subzone_Line">
|
||||
select year, vai
|
||||
from esno_impact_subzone
|
||||
where type = #{type}
|
||||
and region = #{region}
|
||||
<if test="start != null and start != ''">
|
||||
and year >= #{start}
|
||||
</if>
|
||||
<if test="end != null and end != ''">
|
||||
and #{end} >= year
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="ensoYearEventCorresponding" resultMap="ENSO_Year_Event_Corresponding">
|
||||
select id, year, event, event_en
|
||||
from enso_year_event_corresponding
|
||||
where year = #{year}
|
||||
</select>
|
||||
|
||||
<select id="ensoEventYearCorresponding" resultMap="ENSO_Year_Event_Corresponding">
|
||||
select id, year, event, event_en
|
||||
from enso_year_event_corresponding
|
||||
where event = #{event}
|
||||
</select>
|
||||
<select id="ensoEventRate" resultMap="ENSO_Event_Rate">
|
||||
select id,
|
||||
type,
|
||||
zone,
|
||||
event,
|
||||
event_en,
|
||||
obviously_better,
|
||||
slightly_better,
|
||||
unchanged,
|
||||
slightly_worse,
|
||||
obviously_worse
|
||||
from enso_event_rate
|
||||
where type = #{type}
|
||||
and zone =#{zone}
|
||||
and event =#{event}
|
||||
</select>
|
||||
|
||||
<select id="ensoYearUnusualRate" resultMap="ENSO_Year_Unusual_Rate">
|
||||
select id,
|
||||
year,
|
||||
zone,
|
||||
type,
|
||||
obviously_better,
|
||||
slightly_better,
|
||||
unchanged,
|
||||
slightly_worse,
|
||||
obviously_worse
|
||||
from enso_year_unusual_rate
|
||||
where year = #{year}
|
||||
and zone =#{zone}
|
||||
and type =#{type}
|
||||
</select>
|
||||
|
||||
<select id="ensoMonthEvent" resultMap="ENSO_Month_Event">
|
||||
select id, type, year, zone, month, value
|
||||
from enso_month_event
|
||||
where type = #{type}
|
||||
and zone =#{zone}
|
||||
</select>
|
||||
|
||||
<select id="ensoEventAnalysis" resultMap="ENSO_Event_Analysis">
|
||||
select id, year, type, zone, value
|
||||
from enso_event_analysis
|
||||
where year in
|
||||
<foreach collection="year" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
and type = #{type}
|
||||
and zone =#{zone}
|
||||
|
||||
</select>
|
||||
</mapper>
|
@ -1,71 +0,0 @@
|
||||
<?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.ruoyi.system.mapper_yada.ESNOImpactMapper">
|
||||
|
||||
<resultMap id="ESNO_Impact_Subzone" type="com.ruoyi.system.domain_yada.vo.ESNOImpactSubzoneVo">
|
||||
<result column="obviously_better" property="obviouslyBetter"/>
|
||||
<result column="slightly_better" property="slightlyBetter"/>
|
||||
<result column="unchanged" property="unchanged"/>
|
||||
<result column="slightly_worse" property="slightlyWorse"/>
|
||||
<result column="obviously_worse" property="obviouslyWorse"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ESNO_Impact_Subzone_Vai" type="com.ruoyi.system.domain_yada.vo.ESNOImpactSubzoneVaiVo">
|
||||
<result column="region" property="region"/>
|
||||
<result column="region_en" property="regionEn"/>
|
||||
<result column="vai" property="vai"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ESNO_Impact_Country_Vai" type="com.ruoyi.system.domain_yada.vo.ESNOImpactCountryVaiVo">
|
||||
<result column="country" property="country"/>
|
||||
<result column="country_en" property="countryEn"/>
|
||||
<result column="vai" property="vai"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ESNO_Impact_Subzone_Line" type="com.ruoyi.system.domain_yada.vo.ESNOImpactSubzoneLineVo">
|
||||
<result column="year" property="year"/>
|
||||
<result column="vai" property="vai"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="subzonePie" resultMap="ESNO_Impact_Subzone">
|
||||
select obviously_better, slightly_better, unchanged, slightly_worse, obviously_worse
|
||||
from esno_impact_subzone
|
||||
where type = #{type}
|
||||
and year = #{year}
|
||||
and region = #{region}
|
||||
</select>
|
||||
|
||||
<select id="subzoneVai" resultMap="ESNO_Impact_Subzone_Vai">
|
||||
select region, region_en, vai
|
||||
from esno_impact_subzone
|
||||
where type = #{type}
|
||||
and year = #{year}
|
||||
</select>
|
||||
|
||||
<select id="countryVai" resultMap="ESNO_Impact_Country_Vai">
|
||||
select country, country_en, vai
|
||||
from esno_impact_country
|
||||
where type = #{type}
|
||||
and year = #{year}
|
||||
and country in
|
||||
<foreach collection="country" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="subzoneVaiLine" resultMap="ESNO_Impact_Subzone_Line">
|
||||
select year, vai
|
||||
from esno_impact_subzone
|
||||
where type = #{type}
|
||||
and region = #{region}
|
||||
<if test="start != null and start != ''">
|
||||
and year >= #{start}
|
||||
</if>
|
||||
<if test="end != null and end != ''">
|
||||
and #{end} >= year
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user