优化导出接口;增加洪水预报测试
parent
a7bee4ba37
commit
91dc3007c8
20
pom.xml
20
pom.xml
|
|
@ -71,7 +71,25 @@
|
|||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.79</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.gunshi</groupId>
|
||||
<artifactId>flood_algorithm</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
|
|
|
|||
|
|
@ -2,17 +2,10 @@ package com.gunshi.project.xyt.controller;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.gunshi.project.xyt.entity.vo.StWaterRReorganizeVo;
|
||||
import com.gunshi.project.xyt.entity.vo.StWaterRReorganizeYearVo;
|
||||
import com.gunshi.project.xyt.util.ConvertUtil;
|
||||
import com.gunshi.project.xyt.util.DateUtil;
|
||||
import com.gunshi.project.xyt.util.ExcelUtil;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import com.gunshi.algorithm.RrainfallForecast;
|
||||
import com.gunshi.model.vo.FloodAlgorithemVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
|
|
@ -29,14 +22,20 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.xyt.entity.vo.StWaterRReorganizeVo;
|
||||
import com.gunshi.project.xyt.entity.vo.StWaterRReorganizeYearVo;
|
||||
import com.gunshi.project.xyt.model.StWaterRReorganize;
|
||||
import com.gunshi.project.xyt.service.StWaterRReorganizeService;
|
||||
import com.gunshi.project.xyt.util.ConvertUtil;
|
||||
import com.gunshi.project.xyt.util.DateUtil;
|
||||
import com.gunshi.project.xyt.util.ExcelUtil;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
/**
|
||||
* 描述: 供水量整编表
|
||||
* author: cxw
|
||||
|
|
@ -163,4 +162,13 @@ public class StWaterRReorganizeController {
|
|||
service.getYearStatisticAnalysis(year, resList);
|
||||
ExcelUtil.exportExcel(resList, filename, StWaterRReorganizeYearVo.class, response, "统计分析");
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "洪水预报测试")
|
||||
@PostMapping("/forecastTest")
|
||||
public R<List<FloodAlgorithemVo>> forecastTest() throws Exception {
|
||||
double[] PList = new double[] {6.5, 6.75, 7, 5.25, 3.5, 4, 4.5, 4, 3.5, 4.25, 5, 4, 3, 3, 3, 2.75, 2.5, 1.25, 0, 0.25, 0.5};
|
||||
double[] u = new double[]{1.27, 0.75, 0.45, 0.27, 0.16, 0.09, 0.07, 0.03, 0.02, 0.01, 0.01};
|
||||
return R.ok(RrainfallForecast.getData("2024-06-28 08:00:00", 0.93, 1.0, 120, 0.0, 675.94, 0.5, 100, PList, u));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,25 +25,25 @@ public class StWaterRReorganizeVo {
|
|||
/**
|
||||
* 流量(生态供水)
|
||||
*/
|
||||
@ExcelProperty({"${title}", "流量(生态供水)(m³/s)"})
|
||||
@ExcelProperty({"${title}", "生态供水", "流量(m³/s)"})
|
||||
private BigDecimal ecologyQ;
|
||||
|
||||
/**
|
||||
* 水量(生态供水)
|
||||
*/
|
||||
@ExcelProperty({"${title}", "水量(生态供水)(万m³)"})
|
||||
@ExcelProperty({"${title}", "生态供水", "水量(万m³)"})
|
||||
private BigDecimal ecologyV;
|
||||
|
||||
/**
|
||||
* 流量(生活供水)
|
||||
*/
|
||||
@ExcelProperty({"${title}", "流量(生活供水)(m³/s)"})
|
||||
@ExcelProperty({"${title}", "生活供水", "流量(m³/s)"})
|
||||
private BigDecimal lifeQ;
|
||||
|
||||
/**
|
||||
* 水量(生活供水)
|
||||
*/
|
||||
@ExcelProperty({"${title}", "水量(生活供水)(万m³)"})
|
||||
@ExcelProperty({"${title}", "生活供水", "水量(万m³)"})
|
||||
private BigDecimal lifeV;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
package com.gunshi.project.xyt.entity.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
|
@ -20,53 +17,62 @@ import lombok.Data;
|
|||
public class StWaterRReorganizeYearVo {
|
||||
|
||||
@Schema(description="时间")
|
||||
@ExcelProperty({"${title}", "时间"})
|
||||
private String tm;
|
||||
|
||||
/**
|
||||
* 年度占比(生态供水)
|
||||
*/
|
||||
@Schema(description="年度占比(生态供水)")
|
||||
@ExcelProperty({"${title}", "生态供水", "年度占比"})
|
||||
private String ecologyYearRateV;
|
||||
|
||||
/**
|
||||
* 水量(生态供水)
|
||||
*/
|
||||
@Schema(description="水量(生态供水)")
|
||||
@ExcelProperty({"${title}", "生态供水", "水量"})
|
||||
private String ecologyV;
|
||||
|
||||
/**
|
||||
* 同比(生态供水)
|
||||
*/
|
||||
@Schema(description="水量(生态供水)")
|
||||
@Schema(description="同比(生态供水)")
|
||||
@ExcelProperty({"${title}", "生态供水", "同比"})
|
||||
private String ecologyYoyV;
|
||||
|
||||
/**
|
||||
* 环比(生态供水)
|
||||
*/
|
||||
@Schema(description="水量(生态供水)")
|
||||
@Schema(description="环比(生态供水)")
|
||||
@ExcelProperty({"${title}", "生态供水", "环比"})
|
||||
private String ecologyQoqV;
|
||||
|
||||
/**
|
||||
* 年度占比(生活供水)
|
||||
*/
|
||||
@Schema(description="年度占比(生活供水)")
|
||||
@ExcelProperty({"${title}", "生活供水", "年度占比"})
|
||||
private String lifeYearRateV;
|
||||
|
||||
/**
|
||||
* 水量(生活供水)
|
||||
*/
|
||||
@Schema(description="水量(生活供水)")
|
||||
@ExcelProperty({"${title}", "生活供水", "水量"})
|
||||
private String lifeV;
|
||||
|
||||
/**
|
||||
* 同比(生活供水)
|
||||
*/
|
||||
@Schema(description="同比(生活供水)")
|
||||
@ExcelProperty({"${title}", "生活供水", "同比"})
|
||||
private String lifeYoyV;
|
||||
|
||||
/**
|
||||
* 环比(生活供水)
|
||||
*/
|
||||
@Schema(description="环比(生活供水)")
|
||||
@ExcelProperty({"${title}", "生活供水", "环比"})
|
||||
private String lifeQoqV;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@ public class StWaterRReorganizeService extends ServiceImpl<StWaterRReorganizeMap
|
|||
StWaterRReorganizeYearVo vo = new StWaterRReorganizeYearVo();
|
||||
StWaterRReorganize nowStwrr = nowYearList.get(i);
|
||||
vo.setTm(nowStwrr.getTm());
|
||||
vo.setEcologyYearRateV(nowStwrr.getEcologyV().divide(ecologyVSum, 1, BigDecimal.ROUND_HALF_UP).toString());
|
||||
vo.setEcologyYearRateV(nowStwrr.getEcologyV().divide(ecologyVSum, 1, BigDecimal.ROUND_HALF_UP).toString().concat("%"));
|
||||
vo.setEcologyV(nowStwrr.getEcologyV().toString());
|
||||
vo.setLifeYearRateV(nowStwrr.getEcologyV().divide(lifeVSum, 1, BigDecimal.ROUND_HALF_UP).toString());
|
||||
vo.setLifeYearRateV(nowStwrr.getEcologyV().divide(lifeVSum, 1, BigDecimal.ROUND_HALF_UP).toString().concat("%"));
|
||||
vo.setLifeV(nowStwrr.getLifeV().toString());
|
||||
|
||||
StWaterRReorganize lastStwrr = lastYearList.stream()
|
||||
|
|
|
|||
|
|
@ -23,3 +23,11 @@ spring:
|
|||
mybatis-plus:
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
|
||||
# 洪水预测数据库连接信息
|
||||
algorithem:
|
||||
datasource:
|
||||
url: jdbc:postgresql://10.0.41.112:5432/xiaoyutan?stringtype=unspecified
|
||||
username: gunshiiot
|
||||
password: 1234567a
|
||||
driver-class-name: org.postgresql.Driver
|
||||
|
|
|
|||
|
|
@ -23,3 +23,11 @@ spring:
|
|||
mybatis-plus:
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
|
||||
# 洪水预测数据库连接信息
|
||||
algorithem:
|
||||
datasource:
|
||||
url: jdbc:postgresql://10.0.41.112:5432/xiaoyutan?stringtype=unspecified
|
||||
username: gunshiiot
|
||||
password: 1234567a
|
||||
driver-class-name: org.postgresql.Driver
|
||||
|
|
|
|||
Loading…
Reference in New Issue