优化导出接口;增加洪水预报
parent
d690aa8d5b
commit
9960f2b9fe
5
pom.xml
5
pom.xml
|
|
@ -95,6 +95,11 @@
|
|||
<artifactId>artemis-http-client</artifactId>
|
||||
<version>1.1.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-quartz</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-starter-data-elasticsearch</artifactId>-->
|
||||
|
|
|
|||
|
|
@ -0,0 +1,80 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.model.ForecastHQ;
|
||||
import com.gunshi.project.xyt.service.ForecastHQService;
|
||||
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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 预报_水位-泄流量表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Tag(name = "预报_水位-泄流量表")
|
||||
@RestController
|
||||
@RequestMapping(value="/forecastHQ")
|
||||
public class ForecastHQController {
|
||||
|
||||
@Autowired
|
||||
private ForecastHQService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ForecastHQ> insert(@Validated(Insert.class) @RequestBody ForecastHQ dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ForecastHQ> update(@Validated(Update.class) @RequestBody ForecastHQ dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ForecastHQ>> list(@RequestBody @Validated ForecastHQ forecastHQ) {
|
||||
QueryWrapper<ForecastHQ> wrapper = new QueryWrapper<ForecastHQ>();
|
||||
if(StringUtils.isNotBlank(forecastHQ.getSortField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastHQ.getIsAsc()) ? false : forecastHQ.getIsAsc(), forecastHQ.getSortField());
|
||||
}
|
||||
return R.ok(service.list(wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<ForecastHQ>> page(@RequestBody @Validated ForecastHQ forecastHQ) {
|
||||
QueryWrapper<ForecastHQ> wrapper = new QueryWrapper<ForecastHQ>();
|
||||
if(StringUtils.isNotBlank(forecastHQ.getSortField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastHQ.getIsAsc()) ? false : forecastHQ.getIsAsc(), forecastHQ.getSortField());
|
||||
}
|
||||
return R.ok(service.page(forecastHQ.getPageSo().toPage(), wrapper));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.model.ForecastHV;
|
||||
import com.gunshi.project.xyt.service.ForecastHVService;
|
||||
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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 预报_水位-库容
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Tag(name = "预报_水位-库容")
|
||||
@RestController
|
||||
@RequestMapping(value="/forecastHV")
|
||||
public class ForecastHVController {
|
||||
|
||||
@Autowired
|
||||
private ForecastHVService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ForecastHV> insert(@Validated(Insert.class) @RequestBody ForecastHV dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ForecastHV> update(@Validated(Update.class) @RequestBody ForecastHV dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ForecastHV>> list(@RequestBody @Validated ForecastHV forecastHV) {
|
||||
QueryWrapper<ForecastHV> wrapper = new QueryWrapper<ForecastHV>();
|
||||
if(StringUtils.isNotBlank(forecastHV.getSortField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastHV.getIsAsc()) ? false : forecastHV.getIsAsc(), forecastHV.getSortField());
|
||||
}
|
||||
return R.ok(service.list(wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<ForecastHV>> page(@RequestBody @Validated ForecastHV forecastHV) {
|
||||
QueryWrapper<ForecastHV> wrapper = new QueryWrapper<ForecastHV>();
|
||||
if(StringUtils.isNotBlank(forecastHV.getSortField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastHV.getIsAsc()) ? false : forecastHV.getIsAsc(), forecastHV.getSortField());
|
||||
}
|
||||
return R.ok(service.page(forecastHV.getPageSo().toPage(), wrapper));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.model.ForecastK;
|
||||
import com.gunshi.project.xyt.service.ForecastKService;
|
||||
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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 前期影响雨量折减系数表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Tag(name = "前期影响雨量折减系数表")
|
||||
@RestController
|
||||
@RequestMapping(value="/forecastK")
|
||||
public class ForecastKController {
|
||||
|
||||
@Autowired
|
||||
private ForecastKService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ForecastK> insert(@Validated(Insert.class) @RequestBody ForecastK dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ForecastK> update(@Validated(Update.class) @RequestBody ForecastK dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ForecastK>> list(@RequestBody @Validated ForecastK forecastK) {
|
||||
QueryWrapper<ForecastK> wrapper = new QueryWrapper<ForecastK>();
|
||||
if(StringUtils.isNotBlank(forecastK.getSortField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastK.getIsAsc()) ? false : forecastK.getIsAsc(), forecastK.getSortField());
|
||||
}
|
||||
return R.ok(service.list(wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<ForecastK>> page(@RequestBody @Validated ForecastK forecastK) {
|
||||
QueryWrapper<ForecastK> wrapper = new QueryWrapper<ForecastK>();
|
||||
if(StringUtils.isNotBlank(forecastK.getSortField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastK.getIsAsc()) ? false : forecastK.getIsAsc(), forecastK.getSortField());
|
||||
}
|
||||
return R.ok(service.page(forecastK.getPageSo().toPage(), wrapper));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.model.ForecastPPaR;
|
||||
import com.gunshi.project.xyt.service.ForecastPPaRService;
|
||||
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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 预报_降雨径流关系表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Tag(name = "预报_降雨径流关系表")
|
||||
@RestController
|
||||
@RequestMapping(value="/forecastPPaR")
|
||||
public class ForecastPPaRController {
|
||||
|
||||
@Autowired
|
||||
private ForecastPPaRService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ForecastPPaR> insert(@Validated(Insert.class) @RequestBody ForecastPPaR dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ForecastPPaR> update(@Validated(Update.class) @RequestBody ForecastPPaR dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ForecastPPaR>> list(@RequestBody @Validated ForecastPPaR forecastPPaR) {
|
||||
QueryWrapper<ForecastPPaR> wrapper = new QueryWrapper<ForecastPPaR>();
|
||||
if(StringUtils.isNotBlank(forecastPPaR.getSortField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastPPaR.getIsAsc()) ? false : forecastPPaR.getIsAsc(), forecastPPaR.getSortField());
|
||||
}
|
||||
return R.ok(service.list(wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<ForecastPPaR>> page(@RequestBody @Validated ForecastPPaR forecastPPaR) {
|
||||
QueryWrapper<ForecastPPaR> wrapper = new QueryWrapper<ForecastPPaR>();
|
||||
if(StringUtils.isNotBlank(forecastPPaR.getSortField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastPPaR.getIsAsc()) ? false : forecastPPaR.getIsAsc(), forecastPPaR.getSortField());
|
||||
}
|
||||
return R.ok(service.page(forecastPPaR.getPageSo().toPage(), wrapper));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.model.ForecastPlan;
|
||||
import com.gunshi.project.xyt.service.ForecastPlanService;
|
||||
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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 预测方案管理表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Tag(name = "预测方案管理表")
|
||||
@RestController
|
||||
@RequestMapping(value="/forecastPlan")
|
||||
public class ForecastPlanController {
|
||||
|
||||
@Autowired
|
||||
private ForecastPlanService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ForecastPlan> insert(@Validated(Insert.class) @RequestBody ForecastPlan dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ForecastPlan> update(@Validated(Update.class) @RequestBody ForecastPlan dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ForecastPlan>> list(@RequestBody @Validated ForecastPlan forecastPlan) {
|
||||
QueryWrapper<ForecastPlan> wrapper = new QueryWrapper<ForecastPlan>();
|
||||
if(StringUtils.isNotBlank(forecastPlan.getSortField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastPlan.getIsAsc()) ? false : forecastPlan.getIsAsc(), forecastPlan.getSortField());
|
||||
}
|
||||
return R.ok(service.list(wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<ForecastPlan>> page(@RequestBody @Validated ForecastPlan forecastPlan) {
|
||||
QueryWrapper<ForecastPlan> wrapper = new QueryWrapper<ForecastPlan>();
|
||||
if(StringUtils.isNotBlank(forecastPlan.getSortField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastPlan.getIsAsc()) ? false : forecastPlan.getIsAsc(), forecastPlan.getSortField());
|
||||
}
|
||||
return R.ok(service.page(forecastPlan.getPageSo().toPage(), wrapper));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.algorithm.RrainfallForecast;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.model.vo.FloodAlgorithemVo;
|
||||
import com.gunshi.project.xyt.model.ForecastPlan;
|
||||
import com.gunshi.project.xyt.model.ForecastResults;
|
||||
import com.gunshi.project.xyt.service.ForecastResultsService;
|
||||
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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 预测结果表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Tag(name = "预测结果表")
|
||||
@RestController
|
||||
@RequestMapping(value="/forecastResults")
|
||||
public class ForecastResultsController {
|
||||
|
||||
@Autowired
|
||||
private ForecastResultsService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ForecastResults> insert(@Validated(Insert.class) @RequestBody ForecastResults dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ForecastResults> update(@Validated(Update.class) @RequestBody ForecastResults dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ForecastResults>> list(@RequestBody @Validated ForecastResults forecastResults) {
|
||||
QueryWrapper<ForecastResults> wrapper = new QueryWrapper<ForecastResults>();
|
||||
if(StringUtils.isNotBlank(forecastResults.getSortField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastResults.getIsAsc()) ? false : forecastResults.getIsAsc(), forecastResults.getSortField());
|
||||
}
|
||||
return R.ok(service.list(wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<ForecastResults>> page(@RequestBody @Validated ForecastResults forecastResults) {
|
||||
QueryWrapper<ForecastResults> wrapper = new QueryWrapper<ForecastResults>();
|
||||
if(StringUtils.isNotBlank(forecastResults.getSortField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastResults.getIsAsc()) ? false : forecastResults.getIsAsc(), forecastResults.getSortField());
|
||||
}
|
||||
return R.ok(service.page(forecastResults.getPageSo().toPage(), wrapper));
|
||||
}
|
||||
|
||||
|
||||
@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.0, PList, u));
|
||||
}
|
||||
|
||||
@Operation(summary = "洪水预报测试2")
|
||||
@PostMapping("/forecastTest2")
|
||||
public R<List<FloodAlgorithemVo>> forecastTest2() throws Exception {
|
||||
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
ForecastPlan forecastPlan = new ForecastPlan();
|
||||
forecastPlan.setForecastTm(dateFormat.parse("2024-07-01 22:00:00"));
|
||||
forecastPlan.setStartTm(dateFormat.parse("2024-07-01 16:00:00"));
|
||||
forecastPlan.setEndTm(dateFormat.parse("2024-07-02 03:00:00"));
|
||||
List<FloodAlgorithemVo> floodAlgorithemVos = service.floodForecast(forecastPlan);
|
||||
return R.ok(floodAlgorithemVos);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.model.ForecastU;
|
||||
import com.gunshi.project.xyt.service.ForecastUService;
|
||||
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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 时段单位线表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Tag(name = "时段单位线表")
|
||||
@RestController
|
||||
@RequestMapping(value="/forecastU")
|
||||
public class ForecastUController {
|
||||
|
||||
@Autowired
|
||||
private ForecastUService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ForecastU> insert(@Validated(Insert.class) @RequestBody ForecastU dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ForecastU> update(@Validated(Update.class) @RequestBody ForecastU dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ForecastU>> list(@RequestBody @Validated ForecastU forecastU) {
|
||||
QueryWrapper<ForecastU> wrapper = new QueryWrapper<ForecastU>();
|
||||
if(StringUtils.isNotBlank(forecastU.getSortField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastU.getIsAsc()) ? false : forecastU.getIsAsc(), forecastU.getSortField());
|
||||
}
|
||||
return R.ok(service.list(wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<ForecastU>> page(@RequestBody @Validated ForecastU forecastU) {
|
||||
QueryWrapper<ForecastU> wrapper = new QueryWrapper<ForecastU>();
|
||||
if(StringUtils.isNotBlank(forecastU.getSortField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastU.getIsAsc()) ? false : forecastU.getIsAsc(), forecastU.getSortField());
|
||||
}
|
||||
return R.ok(service.page(forecastU.getPageSo().toPage(), wrapper));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.model.ForecastUseparam;
|
||||
import com.gunshi.project.xyt.service.ForecastUseparamService;
|
||||
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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 预报_通用参数管理
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Tag(name = "预报_通用参数管理")
|
||||
@RestController
|
||||
@RequestMapping(value="/forecastUseparam")
|
||||
public class ForecastUseparamController {
|
||||
|
||||
@Autowired
|
||||
private ForecastUseparamService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ForecastUseparam> insert(@Validated(Insert.class) @RequestBody ForecastUseparam dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ForecastUseparam> update(@Validated(Update.class) @RequestBody ForecastUseparam dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ForecastUseparam>> list(@RequestBody @Validated ForecastUseparam forecastUseparam) {
|
||||
QueryWrapper<ForecastUseparam> wrapper = new QueryWrapper<ForecastUseparam>();
|
||||
if(StringUtils.isNotBlank(forecastUseparam.getSortField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastUseparam.getIsAsc()) ? false : forecastUseparam.getIsAsc(), forecastUseparam.getSortField());
|
||||
}
|
||||
return R.ok(service.list(wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<ForecastUseparam>> page(@RequestBody @Validated ForecastUseparam forecastUseparam) {
|
||||
QueryWrapper<ForecastUseparam> wrapper = new QueryWrapper<ForecastUseparam>();
|
||||
if(StringUtils.isNotBlank(forecastUseparam.getSortField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastUseparam.getIsAsc()) ? false : forecastUseparam.getIsAsc(), forecastUseparam.getSortField());
|
||||
}
|
||||
return R.ok(service.page(forecastUseparam.getPageSo().toPage(), wrapper));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -42,6 +42,7 @@ import java.util.ArrayList;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,22 +1,5 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
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;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
|
|
@ -31,11 +14,24 @@ 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;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 供水量整编表
|
||||
* author: cxw
|
||||
|
|
@ -162,13 +158,4 @@ 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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
package com.gunshi.project.xyt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.xyt.model.ForecastHQ;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 描述: 预报_水位-泄流量表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Mapper
|
||||
public interface ForecastHQMapper extends BaseMapper<ForecastHQ> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.gunshi.project.xyt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.xyt.model.ForecastHV;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 描述: 预报_水位-库容
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Mapper
|
||||
public interface ForecastHVMapper extends BaseMapper<ForecastHV> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.gunshi.project.xyt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.xyt.model.ForecastK;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 描述: 前期影响雨量折减系数表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Mapper
|
||||
public interface ForecastKMapper extends BaseMapper<ForecastK> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.gunshi.project.xyt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.xyt.model.ForecastPPaR;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 描述: 预报_降雨径流关系表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Mapper
|
||||
public interface ForecastPPaRMapper extends BaseMapper<ForecastPPaR> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.gunshi.project.xyt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.xyt.model.ForecastPlan;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 描述: 预测方案管理表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Mapper
|
||||
public interface ForecastPlanMapper extends BaseMapper<ForecastPlan> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.gunshi.project.xyt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.xyt.model.ForecastResults;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 描述: 预测结果表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Mapper
|
||||
public interface ForecastResultsMapper extends BaseMapper<ForecastResults> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.gunshi.project.xyt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.xyt.model.ForecastU;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 描述: 时段单位线表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Mapper
|
||||
public interface ForecastUMapper extends BaseMapper<ForecastU> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.gunshi.project.xyt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.xyt.model.ForecastUseparam;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 描述: 预报_通用参数管理
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Mapper
|
||||
public interface ForecastUseparamMapper extends BaseMapper<ForecastUseparam> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.gunshi.project.xyt.model;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.gunshi.project.xyt.entity.page.GenericPageParams;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 描述: 预报_水位-泄流量表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:23
|
||||
*/
|
||||
@Schema(description="预报_水位-泄流量表")
|
||||
@Data
|
||||
@TableName("public.forecast_h_q")
|
||||
public class ForecastHQ extends GenericPageParams implements Serializable {
|
||||
|
||||
public final static String thisTableName = "ForecastHQ";
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* h
|
||||
*/
|
||||
@TableField(value="h")
|
||||
@Schema(description="h")
|
||||
private BigDecimal h;
|
||||
|
||||
/**
|
||||
* q
|
||||
*/
|
||||
@TableField(value="q")
|
||||
@Schema(description="q")
|
||||
private BigDecimal q;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.gunshi.project.xyt.model;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.gunshi.project.xyt.entity.page.GenericPageParams;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 描述: 预报_水位-库容
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Schema(description="预报_水位-库容")
|
||||
@Data
|
||||
@TableName("public.forecast_h_v")
|
||||
public class ForecastHV extends GenericPageParams implements Serializable {
|
||||
|
||||
public final static String thisTableName = "ForecastHV";
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* h
|
||||
*/
|
||||
@TableField(value="h")
|
||||
@Schema(description="h")
|
||||
private BigDecimal h;
|
||||
|
||||
/**
|
||||
* v
|
||||
*/
|
||||
@TableField(value="v")
|
||||
@Schema(description="v")
|
||||
private BigDecimal v;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.gunshi.project.xyt.model;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import com.gunshi.project.xyt.entity.page.GenericPageParams;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 描述: 前期影响雨量折减系数表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Schema(description="前期影响雨量折减系数表")
|
||||
@Data
|
||||
@TableName("public.forecast_k")
|
||||
public class ForecastK extends GenericPageParams implements Serializable {
|
||||
|
||||
public final static String thisTableName = "ForecastK";
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 月份
|
||||
*/
|
||||
@TableId(value="month", type= IdType.NONE)
|
||||
@Schema(description="月份")
|
||||
private Integer month;
|
||||
|
||||
/**
|
||||
* k值
|
||||
*/
|
||||
@TableField(value="k_value")
|
||||
@Schema(description="k值")
|
||||
private BigDecimal kValue;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value="chtm")
|
||||
@Schema(description="创建时间")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date chtm;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(value="update_time")
|
||||
@Schema(description="修改时间")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package com.gunshi.project.xyt.model;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.gunshi.project.xyt.entity.page.GenericPageParams;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 描述: 预报_降雨径流关系表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Schema(description="预报_降雨径流关系表")
|
||||
@Data
|
||||
@TableName("public.forecast_p_pa_r")
|
||||
public class ForecastPPaR extends GenericPageParams implements Serializable {
|
||||
|
||||
public final static String thisTableName = "ForecastPPaR";
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* r
|
||||
*/
|
||||
@TableField(value="r")
|
||||
@Schema(description="r")
|
||||
private BigDecimal r;
|
||||
|
||||
/**
|
||||
* psum
|
||||
*/
|
||||
@TableField(value="psum")
|
||||
@Schema(description="psum")
|
||||
private BigDecimal psum;
|
||||
|
||||
/**
|
||||
* rsum
|
||||
*/
|
||||
@TableField(value="rsum")
|
||||
@Schema(description="rsum")
|
||||
private BigDecimal rsum;
|
||||
|
||||
/**
|
||||
* pa
|
||||
*/
|
||||
@TableField(value="pa")
|
||||
@Schema(description="pa")
|
||||
private BigDecimal pa;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
package com.gunshi.project.xyt.model;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import com.gunshi.project.xyt.entity.page.GenericPageParams;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 描述: 预测方案管理表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Schema(description="预测方案管理表")
|
||||
@Data
|
||||
@TableName("public.forecast_plan")
|
||||
public class ForecastPlan extends GenericPageParams implements Serializable {
|
||||
|
||||
public final static String thisTableName = "ForecastPlan";
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value="id", type= IdType.AUTO)
|
||||
@Schema(description="主键")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 预报方案名称
|
||||
*/
|
||||
@TableField(value="name")
|
||||
@Schema(description="预报方案名称")
|
||||
@Size(max = 255,message = "预报方案名称最大长度要小于 255")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 类型(1:自动 2:人工)
|
||||
*/
|
||||
@TableField(value="type")
|
||||
@Schema(description="类型(1:自动 2:人工)")
|
||||
@Size(max = 1,message = "类型(1:自动 2:人工)最大长度要小于 1")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 预报时间
|
||||
*/
|
||||
@TableField(value="forecast_tm")
|
||||
@Schema(description="预报时间")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date forecastTm;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@TableField(value="start_tm")
|
||||
@Schema(description="开始时间")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date startTm;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@TableField(value="end_tm")
|
||||
@Schema(description="结束时间")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date endTm;
|
||||
|
||||
/**
|
||||
* 操作人id
|
||||
*/
|
||||
@TableField(value="user_id")
|
||||
@Schema(description="操作人id")
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
* 预见期(小时)
|
||||
*/
|
||||
@TableField(value="forecast_period")
|
||||
@Schema(description="预见期(小时)")
|
||||
private Integer forecastPeriod;
|
||||
|
||||
/**
|
||||
* 预热期(天)
|
||||
*/
|
||||
@TableField(value="forecast_warm")
|
||||
@Schema(description="预热期(天)")
|
||||
private Integer forecastWarm;
|
||||
|
||||
/**
|
||||
* 方案制作时间
|
||||
*/
|
||||
@TableField(value="chtm")
|
||||
@Schema(description="方案制作时间")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date chtm;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(value="update_tm")
|
||||
@Schema(description="修改时间")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date updateTm;
|
||||
|
||||
/**
|
||||
* 任务状态(0:正常 1:暂停 2:删除)
|
||||
*/
|
||||
@TableField(value="status")
|
||||
@Schema(description="任务状态(0:正常 1:暂停 2:删除)")
|
||||
@Size(max = 1,message = "任务状态(0:正常 1:暂停 2:删除)最大长度要小于 1")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 任务时间间隔(分钟)
|
||||
*/
|
||||
@TableField(value="time_interval")
|
||||
@Schema(description="任务时间间隔(分钟)")
|
||||
private String timeInterval;
|
||||
}
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
package com.gunshi.project.xyt.model;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import com.gunshi.project.xyt.entity.page.GenericPageParams;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 描述: 预测结果表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Schema(description="预测结果表")
|
||||
@Data
|
||||
@TableName("public.forecast_results")
|
||||
public class ForecastResults extends GenericPageParams implements Serializable {
|
||||
|
||||
public final static String thisTableName = "ForecastResults";
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value="id", type= IdType.AUTO)
|
||||
@Schema(description="主键")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*/
|
||||
@TableField(value="tm")
|
||||
@Schema(description="时间")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date tm;
|
||||
|
||||
/**
|
||||
* 入库流量
|
||||
*/
|
||||
@TableField(value="rk_q_value")
|
||||
@Schema(description="入库流量")
|
||||
private BigDecimal rkQValue;
|
||||
|
||||
/**
|
||||
* 出库流量
|
||||
*/
|
||||
@TableField(value="ck_q_value")
|
||||
@Schema(description="出库流量")
|
||||
private BigDecimal ckQValue;
|
||||
|
||||
/**
|
||||
* 水库水位
|
||||
*/
|
||||
@TableField(value="sw_h_value")
|
||||
@Schema(description="水库水位")
|
||||
private BigDecimal swHValue;
|
||||
|
||||
/**
|
||||
* 入库时间
|
||||
*/
|
||||
@TableField(value="chtm")
|
||||
@Schema(description="入库时间")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date chtm;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(value="update_tm")
|
||||
@Schema(description="修改时间")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date updateTm;
|
||||
|
||||
/**
|
||||
* 预测方案id
|
||||
*/
|
||||
@TableField(value="plan_id")
|
||||
@Schema(description="预测方案id")
|
||||
private Integer planId;
|
||||
|
||||
/**
|
||||
* 数据生成时间戳
|
||||
*/
|
||||
@TableField(value="create_timestamp")
|
||||
@Schema(description="数据生成时间戳")
|
||||
private Integer createTimestamp;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.gunshi.project.xyt.model;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import com.gunshi.project.xyt.entity.page.GenericPageParams;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 描述: 时段单位线表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Schema(description="时段单位线表")
|
||||
@Data
|
||||
@TableName("public.forecast_u")
|
||||
public class ForecastU extends GenericPageParams implements Serializable {
|
||||
|
||||
public final static String thisTableName = "ForecastU";
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value="id", type= IdType.AUTO)
|
||||
@Schema(description="主键")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* u值
|
||||
*/
|
||||
@TableField(value="u_value")
|
||||
@Schema(description="u值")
|
||||
private BigDecimal uValue;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value="chtm")
|
||||
@Schema(description="创建时间")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date chtm;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(value="update_time")
|
||||
@Schema(description="修改时间")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
package com.gunshi.project.xyt.model;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import com.gunshi.project.xyt.entity.page.GenericPageParams;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 描述: 预报_通用参数管理
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Schema(description="预报_通用参数管理")
|
||||
@Data
|
||||
@TableName("public.forecast_useparam")
|
||||
public class ForecastUseparam extends GenericPageParams implements Serializable {
|
||||
|
||||
public final static String thisTableName = "ForecastUseparam";
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value="id", type= IdType.AUTO)
|
||||
@Schema(description="主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 参数名称
|
||||
*/
|
||||
@TableField(value="param_name")
|
||||
@Schema(description="参数名称")
|
||||
@Size(max = 255,message = "参数名称最大长度要小于 255")
|
||||
@NotBlank(message = "参数名称不能为空")
|
||||
@NotNull(message = "参数名称不能为空")
|
||||
private String paramName;
|
||||
|
||||
/**
|
||||
* 参数名
|
||||
*/
|
||||
@TableField(value="param_code")
|
||||
@Schema(description="参数名")
|
||||
@Size(max = 255,message = "参数名最大长度要小于 255")
|
||||
// @NotBlank(message = "参数名不能为空")
|
||||
// @NotNull(message = "参数名不能为空")
|
||||
private String paramCode;
|
||||
|
||||
/**
|
||||
* 参数值
|
||||
*/
|
||||
@TableField(value="param_value")
|
||||
@Schema(description="参数值")
|
||||
@Size(max = 255,message = "参数值最大长度要小于 255")
|
||||
@NotBlank(message = "参数值不能为空")
|
||||
@NotNull(message = "参数值不能为空")
|
||||
private String paramValue;
|
||||
|
||||
/**
|
||||
* 参数单位
|
||||
*/
|
||||
@TableField(value="param_unit")
|
||||
@Schema(description="参数单位")
|
||||
@Size(max = 255,message = "参数单位最大长度要小于 255")
|
||||
private String paramUnit;
|
||||
|
||||
/**
|
||||
* 参数排序
|
||||
*/
|
||||
@TableField(value="param_sort")
|
||||
@Schema(description="参数排序")
|
||||
private Integer paramSort;
|
||||
|
||||
/**
|
||||
* 参数描述
|
||||
*/
|
||||
@TableField(value="param_remarks")
|
||||
@Schema(description="参数描述")
|
||||
@Size(max = 255,message = "参数描述最大长度要小于 255")
|
||||
private String paramRemarks;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value="chtm")
|
||||
@Schema(description="创建时间")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date chtm;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(value="update_time")
|
||||
@Schema(description="修改时间")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.gunshi.project.xyt.schedule;
|
||||
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.SchedulingConfigurer;
|
||||
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
|
||||
|
||||
/**
|
||||
* @author cxw
|
||||
* @description quartz配置
|
||||
* @classname SchedulerConfig.java
|
||||
* @create 2024-07-30, 星期二, 9:41:34
|
||||
*/
|
||||
@Configuration
|
||||
public class SchedulerConfig implements SchedulingConfigurer {
|
||||
|
||||
@Override
|
||||
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
|
||||
// 注意:这里配置的是Spring的@Scheduled任务,而不是Quartz的Scheduler
|
||||
// 对于Quartz,你通常不需要在这里做任何配置,除非你有特殊需求
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
package com.gunshi.project.xyt.schedule;
|
||||
|
||||
import com.gunshi.project.xyt.model.ForecastPlan;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.quartz.CronScheduleBuilder;
|
||||
import org.quartz.CronTrigger;
|
||||
import org.quartz.JobBuilder;
|
||||
import org.quartz.JobDataMap;
|
||||
import org.quartz.JobDetail;
|
||||
import org.quartz.JobKey;
|
||||
import org.quartz.Scheduler;
|
||||
import org.quartz.SchedulerException;
|
||||
import org.quartz.TriggerBuilder;
|
||||
import org.quartz.TriggerKey;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
|
||||
/**
|
||||
* @author cxw
|
||||
* @description 定时任务动态操作
|
||||
* @classname TaskGroupHandler.java
|
||||
* @create 2024-07-30, 星期二, 9:42:04
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
@Profile("prod")
|
||||
public class TaskGroupHandler {
|
||||
|
||||
@Resource
|
||||
private Scheduler scheduler;
|
||||
|
||||
/**
|
||||
* 新增定时任务
|
||||
* @param jobId
|
||||
*/
|
||||
public void addCronJob(String jobId, ForecastPlan forecastPlan) {
|
||||
try {
|
||||
TriggerKey triggerKey = TriggerKey.triggerKey(jobId, "TaskGroup");
|
||||
|
||||
//构建job信息
|
||||
JobDetail job = JobBuilder.newJob(TaskGroupJob.class).withIdentity(jobId, "TaskGroup")
|
||||
.withDescription("任务组编排").build();
|
||||
JobDataMap jobDataMap = job.getJobDataMap();
|
||||
jobDataMap.put("jobId", jobId);
|
||||
jobDataMap.put("forecastPlan", forecastPlan);
|
||||
//CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule("cron的表达式");
|
||||
String cronExpression = "0 0/" + forecastPlan.getTimeInterval() + " * * * ?";
|
||||
CronTrigger trigger = TriggerBuilder.newTrigger()
|
||||
.withIdentity(triggerKey)
|
||||
.startNow()
|
||||
.withSchedule(CronScheduleBuilder.cronSchedule(cronExpression).withMisfireHandlingInstructionFireAndProceed())
|
||||
.build();
|
||||
|
||||
//SimpleScheduleBuilder.simpleSchedule().withRepeatCount(0).withIntervalInSeconds(20)//每隔多少秒执行一次; withRepeatCount 设置重复的次数
|
||||
//.startNow().withSchedule(cronScheduleBuilder)
|
||||
//交由Scheduler安排触发
|
||||
scheduler.scheduleJob(job, trigger);
|
||||
if(!scheduler.isStarted()){
|
||||
scheduler.start();
|
||||
}
|
||||
log.info("添加定时任务成功, startJob:{}", jobId);
|
||||
} catch (SchedulerException e) {
|
||||
log.error("添加定时任务异常, jobId:{}", jobId, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除任务
|
||||
* @param jobId
|
||||
* @return
|
||||
*/
|
||||
public void removeCronJob(String jobId) {
|
||||
try {
|
||||
// TriggerKey 定义了trigger的名称和组别 ,通过任务名和任务组名获取TriggerKey
|
||||
TriggerKey triggerKey = TriggerKey.triggerKey(jobId,"TaskGroup");
|
||||
// 停止触发器
|
||||
scheduler.resumeTrigger(triggerKey);
|
||||
// 移除触发器
|
||||
scheduler.unscheduleJob(triggerKey);
|
||||
// 移除任务
|
||||
scheduler.deleteJob(JobKey.jobKey(jobId,"TaskGroup"));
|
||||
log.info("删除定时任务成功, jobId:{}", jobId);
|
||||
} catch (SchedulerException e) {
|
||||
log.error("删除定时任务异常, jobId:{}", jobId, e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 暂停定时任务
|
||||
* @param jobId
|
||||
*/
|
||||
public void pauseJob(String jobId) {
|
||||
try {
|
||||
JobKey jobKey = JobKey.jobKey(jobId,"TaskGroup");
|
||||
// 暂停任务
|
||||
scheduler.pauseJob(jobKey);
|
||||
log.info("暂停定时任务成功, jobId:{}", jobId);
|
||||
} catch (SchedulerException e) {
|
||||
log.error("暂停定时任务异常, jobId:{}", jobId, e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 继续定时任务
|
||||
* @param jobId
|
||||
*/
|
||||
@GetMapping("/resumeJob")
|
||||
public void resumeJob(String jobId) {
|
||||
try {
|
||||
// 通过任务名和任务组名获取jobKey
|
||||
JobKey jobKey = JobKey.jobKey(jobId,"TaskGroup");
|
||||
// 继续任务
|
||||
scheduler.resumeJob(jobKey);
|
||||
log.info("继续定时任务成功, jobId:{}", jobId);
|
||||
} catch (SchedulerException e) {
|
||||
log.error("继续定时任务异常, jobId:{}", jobId, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.gunshi.project.xyt.schedule;
|
||||
|
||||
import com.gunshi.model.vo.FloodAlgorithemVo;
|
||||
import com.gunshi.project.xyt.model.ForecastPlan;
|
||||
import com.gunshi.project.xyt.service.ForecastResultsService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobDataMap;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author cxw
|
||||
* @description 实现具体逻辑
|
||||
* @classname TaskGroupJob.java
|
||||
* @create 2024-07-30, 星期二, 9:43:17
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
@Profile("prod")
|
||||
public class TaskGroupJob implements Job {
|
||||
|
||||
private static DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
@Autowired
|
||||
private ForecastResultsService forecastResultsService;
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext context) throws JobExecutionException {
|
||||
JobDataMap jdMap = context.getJobDetail().getJobDataMap();
|
||||
String jobId = (String) jdMap.get("jobId");
|
||||
ForecastPlan forecastPlan = (ForecastPlan) jdMap.get("forecastPlan");
|
||||
log.info("{}----TaskGroupJob-计划执行开始===>jobId:{}", dtf.format(LocalDateTime.now()), jobId);
|
||||
List<FloodAlgorithemVo> floodAlgorithemVos = forecastResultsService.floodForecast(forecastPlan);
|
||||
log.info("{}----TaskGroupJob-计划执行结束===>jobId:{}", dtf.format(LocalDateTime.now()), jobId);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package com.gunshi.project.xyt.schedule;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.gunshi.project.xyt.model.ForecastPlan;
|
||||
import com.gunshi.project.xyt.service.ForecastPlanService;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author cxw
|
||||
* @description 任务预热,预先加载数据库已经配置好的任务
|
||||
* @classname TaskGroupJobRunner.java
|
||||
* @create 2024-07-30, 星期二, 9:42:39
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
@Profile("prod")
|
||||
public class TaskGroupJobRunner implements CommandLineRunner {
|
||||
|
||||
@Resource
|
||||
private TaskGroupHandler taskGroupHandler;
|
||||
|
||||
@Autowired
|
||||
private ForecastPlanService forecastPlanService;
|
||||
|
||||
@Override
|
||||
public void run(String... args) {
|
||||
// 初始加载数据库里状态为自动、正常的定时任务
|
||||
List<ForecastPlan> planList = forecastPlanService.list(new QueryWrapper<ForecastPlan>().eq("type", "1").eq("status", "0"));
|
||||
if (CollectionUtils.isNotEmpty(planList)) {
|
||||
Map<Integer, ForecastPlan> jobMap = planList.stream()
|
||||
.collect(Collectors.toMap(ForecastPlan::getId, Function.identity(), (key1, key2)->key2));
|
||||
for (Map.Entry<Integer, ForecastPlan> entry : jobMap.entrySet()) {
|
||||
taskGroupHandler.addCronJob(String.valueOf(entry.getKey()), entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.gunshi.project.xyt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gunshi.project.xyt.mapper.ForecastHQMapper;
|
||||
import com.gunshi.project.xyt.model.ForecastHQ;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 描述: 预报_水位-泄流量表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class ForecastHQService extends ServiceImpl<ForecastHQMapper, ForecastHQ>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.gunshi.project.xyt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gunshi.project.xyt.mapper.ForecastHVMapper;
|
||||
import com.gunshi.project.xyt.model.ForecastHV;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 描述: 预报_水位-库容
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class ForecastHVService extends ServiceImpl<ForecastHVMapper, ForecastHV>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.gunshi.project.xyt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gunshi.project.xyt.mapper.ForecastKMapper;
|
||||
import com.gunshi.project.xyt.model.ForecastK;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 描述: 前期影响雨量折减系数表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class ForecastKService extends ServiceImpl<ForecastKMapper, ForecastK>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.gunshi.project.xyt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gunshi.project.xyt.mapper.ForecastPPaRMapper;
|
||||
import com.gunshi.project.xyt.model.ForecastPPaR;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 描述: 预报_降雨径流关系表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class ForecastPPaRService extends ServiceImpl<ForecastPPaRMapper, ForecastPPaR>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.gunshi.project.xyt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gunshi.project.xyt.mapper.ForecastPlanMapper;
|
||||
import com.gunshi.project.xyt.model.ForecastPlan;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 描述: 预测方案管理表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class ForecastPlanService extends ServiceImpl<ForecastPlanMapper, ForecastPlan>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,225 @@
|
|||
package com.gunshi.project.xyt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gunshi.model.vo.FloodAlgorithemVo;
|
||||
import com.gunshi.project.xyt.entity.vo.ForeRainTimeVo;
|
||||
import com.gunshi.project.xyt.entity.vo.ForeRainVo;
|
||||
import com.gunshi.project.xyt.grb.RainGrib2Layer;
|
||||
import com.gunshi.project.xyt.mapper.ForecastResultsMapper;
|
||||
import com.gunshi.project.xyt.model.ForecastK;
|
||||
import com.gunshi.project.xyt.model.ForecastPlan;
|
||||
import com.gunshi.project.xyt.model.ForecastResults;
|
||||
import com.gunshi.project.xyt.model.ForecastU;
|
||||
import com.gunshi.project.xyt.model.ForecastUseparam;
|
||||
import com.gunshi.project.xyt.model.StPptnR;
|
||||
import com.gunshi.project.xyt.model.StRsvrR;
|
||||
import com.gunshi.project.xyt.model.StStbprpB;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 描述: 预测结果表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class ForecastResultsService extends ServiceImpl<ForecastResultsMapper, ForecastResults>
|
||||
{
|
||||
|
||||
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
private static SimpleDateFormat eightSdf = new SimpleDateFormat("yyyy-MM-dd 08");
|
||||
private static SimpleDateFormat sixteenSdf = new SimpleDateFormat("yyyy-MM-dd 16");
|
||||
|
||||
@Autowired
|
||||
private ForecastUseparamService forecastUseparamService;
|
||||
|
||||
@Autowired
|
||||
private ForecastUService forecastUService;
|
||||
|
||||
@Autowired
|
||||
private ForecastKService forecastKService;
|
||||
|
||||
@Autowired
|
||||
private StPptnRService stPptnRService;
|
||||
|
||||
@Autowired
|
||||
private StRsvrRService stRsvrRService;
|
||||
|
||||
@Autowired
|
||||
private ForecastService forecastService;
|
||||
|
||||
@Autowired
|
||||
private StStbprpBService stStbprpBService;
|
||||
|
||||
|
||||
/**
|
||||
* @description: 洪水预测
|
||||
* @param forecastPlan
|
||||
* @return: java.util.List<com.gunshi.model.vo.FloodAlgorithemVo>
|
||||
* @auther: cxw
|
||||
* @date: 2024-07-30, 周二, 14:40:45
|
||||
*/
|
||||
public List<FloodAlgorithemVo> floodForecast(ForecastPlan forecastPlan) {
|
||||
List<FloodAlgorithemVo> voList = new ArrayList<>();
|
||||
Date now = new Date();
|
||||
String dateStr = sdf.format(forecastPlan.getForecastTm());
|
||||
Date startTm = forecastPlan.getStartTm();
|
||||
Date endTm = forecastPlan.getEndTm();
|
||||
// 获取配置参数
|
||||
List<ForecastUseparam> paramList = forecastUseparamService.list();
|
||||
List<ForecastU> uList = forecastUService.list();
|
||||
List<ForecastK> kList = forecastKService.list();
|
||||
if (CollectionUtils.isNotEmpty(paramList) && CollectionUtils.isNotEmpty(uList) && CollectionUtils.isNotEmpty(kList)) {
|
||||
// 每小时的单位径流量,单位m³/s
|
||||
double[] u = uList.stream().mapToDouble(forecastU -> forecastU.getUValue().doubleValue()).toArray();
|
||||
// 蒸发率
|
||||
Map<Integer, BigDecimal> kMap = kList.stream().collect(Collectors.toMap(ForecastK::getMonth, ForecastK::getKValue));
|
||||
double k = kMap.get(Integer.valueOf(dateStr.substring(5, 7))).doubleValue();
|
||||
// 其它配置参数
|
||||
Map<String, String> paramMap = paramList.stream().collect(Collectors.toMap(ForecastUseparam::getParamCode,
|
||||
ForecastUseparam::getParamValue));
|
||||
if (!paramMap.get("Im").isEmpty() && !paramMap.get("dt").isEmpty()) {
|
||||
double Wm = Double.parseDouble(paramMap.get("Im"));// 土壤含水量最大值(最大初损值)Im
|
||||
double dt = Double.parseDouble(paramMap.get("dt"));
|
||||
double PaT0 = 0.0;// 昨天的Pa值(一场降雨的初始值可以设为0)
|
||||
double pt = 0.0;// 昨天的降雨值
|
||||
double H1 = 0.0;// 初始水库水位,可以根据H1->V1,H1->q1得到初始的水库库容和下泄流量
|
||||
double PaT1 = 0.0;// 根据昨天的降雨值求今天早上的土壤含水量,这个每天早上8点,根据昨天的降雨值要重新计算。
|
||||
try {
|
||||
// 获取预测时间前的最后水库水位
|
||||
StRsvrR rsvrR = stRsvrRService.getOne(new QueryWrapper<StRsvrR>().eq("stcd", "716153201").le("tm", forecastPlan.getForecastTm()).orderBy(true, false,
|
||||
"tm").last("limit 1"));
|
||||
if (ObjectUtils.isNotEmpty(rsvrR)) {
|
||||
H1 = Double.parseDouble(rsvrR.getRz());
|
||||
} else {
|
||||
return voList;
|
||||
}
|
||||
// 根据预测时间查询降雨序列值
|
||||
List<String> pResultList = new ArrayList<>();
|
||||
List<StPptnR> pptnRAllList = new ArrayList<>();
|
||||
List<StPptnR> pptnRExistedList = new ArrayList<>();
|
||||
List<StPptnR> pptnRFutureList = new ArrayList<>();
|
||||
QueryWrapper<StPptnR> qwExisted = new QueryWrapper<>();
|
||||
// 如果结束时间在当前时间之前,降雨序列从历史降雨表获取
|
||||
if (endTm.compareTo(now) <= 0) {
|
||||
qwExisted = new QueryWrapper<StPptnR>().eq("stcd", "716153201").ge("tm", startTm).le("tm", endTm).orderBy(true, true, "tm");
|
||||
} else {
|
||||
qwExisted = new QueryWrapper<StPptnR>().eq("stcd", "716153201").ge("tm", startTm).le("tm", now).orderBy(true, true, "tm");
|
||||
pptnRFutureList = getForecastDrpData(now, rsvrR.getStcd());
|
||||
}
|
||||
pptnRExistedList = stPptnRService.list(qwExisted);
|
||||
pptnRAllList.addAll(pptnRExistedList);
|
||||
pptnRAllList.addAll(pptnRFutureList);
|
||||
// 根据降雨数据,按照△t的颗粒度,均分
|
||||
if (CollectionUtils.isNotEmpty(pptnRAllList)) {
|
||||
for (int i = 0; i < pptnRAllList.size(); i++) {
|
||||
StPptnR stPptnR = pptnRAllList.get(i);
|
||||
String drp = stPptnR.getDrp();
|
||||
pResultList.add(drp);
|
||||
if (i + 1 == pptnRAllList.size()) {
|
||||
break;
|
||||
} else {
|
||||
StPptnR stPptnRNext = pptnRAllList.get(i + 1);
|
||||
// 两条数据的小时差
|
||||
double diffHours = dateHourDifference(stPptnR.getTm(), stPptnRNext.getTm());
|
||||
int floorNum = (int) Math.floor(diffHours / dt);
|
||||
BigDecimal meanDifference =
|
||||
new BigDecimal(stPptnRNext.getDrp()).subtract(new BigDecimal(drp)).divide(new BigDecimal(floorNum),
|
||||
BigDecimal.ROUND_HALF_UP, 2);
|
||||
for (int j = 1; j < floorNum; j++) {
|
||||
BigDecimal add = new BigDecimal(drp).add(meanDifference.multiply(new BigDecimal(j))).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
pResultList.add(add.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println(pResultList);
|
||||
double[] PList = pResultList.stream().mapToDouble(Double::parseDouble).toArray();
|
||||
// 预测执行
|
||||
// voList = RrainfallForecast.getData(dateStr, k, PaT0, Wm, pt, H1, dt, PaT1, PList, u);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算时间的小时差值
|
||||
*/
|
||||
private static double dateHourDifference(Date beforeDate, Date afterDate) {
|
||||
long time1 = beforeDate.getTime(); // 获取第一个时间的毫秒时间戳
|
||||
long time2 = afterDate.getTime(); // 获取第二个时间的毫秒时间戳
|
||||
// 计算两个时间戳的差值
|
||||
long difference = time2 - time1;
|
||||
// 将差值转换为小时
|
||||
double hours = difference / (60 * 60 * 1000);
|
||||
return hours;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据时间获取气象降雨预报
|
||||
*/
|
||||
private List<StPptnR> getForecastDrpData(Date now, String stcd) {
|
||||
List<StPptnR> pptnRFutureList = new ArrayList<>();
|
||||
StStbprpB stStbprpB = stStbprpBService.getOne(new QueryWrapper<StStbprpB>().eq("stcd", stcd));
|
||||
String tm = "";// 时间格式应为:YYYYMMDDHH其中HH只能为08或20,例如2023062908
|
||||
if (isBeforeEightAM(now)) {
|
||||
tm = eightSdf.format(now);
|
||||
} else {
|
||||
tm = sixteenSdf.format(now);
|
||||
}
|
||||
tm = tm.trim().replace("-", "");
|
||||
List<RainGrib2Layer> gribList = forecastService.getGribData(tm, false);
|
||||
//24小时每个网格的总量
|
||||
List<RainGrib2Layer> total = gribList.stream().filter(o -> o.getTmRange().getInterval() == 24).collect(Collectors.toList());
|
||||
//24小时每个网格的逐小时雨量
|
||||
List<RainGrib2Layer> detail = gribList.stream().filter(o -> o.getTmRange().getInterval() == 1).collect(Collectors.toList());
|
||||
ForeRainVo vo = new ForeRainVo();
|
||||
vo.setStcd(stcd);
|
||||
vo.setLgtd(stStbprpB.getLgtd());
|
||||
vo.setLttd(stStbprpB.getLttd());
|
||||
List<ForeRainTimeVo> data = forecastService.getData(vo, total, detail);
|
||||
if (CollectionUtils.isNotEmpty(data)) {
|
||||
for (ForeRainTimeVo foreRainTimeVo : data) {
|
||||
// 只取当前时间之后的数据
|
||||
if(foreRainTimeVo.getTm().compareTo(now) > 0){
|
||||
StPptnR stPptnR = new StPptnR();
|
||||
stPptnR.setTm(foreRainTimeVo.getTm());
|
||||
stPptnR.setDrp(foreRainTimeVo.getDrp().toString());
|
||||
pptnRFutureList.add(stPptnR);
|
||||
}
|
||||
}
|
||||
}
|
||||
return pptnRFutureList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断date是否在早八点后还是前(true:在8:00前)
|
||||
*/
|
||||
public static boolean isBeforeEightAM(Date date) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 8);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
return date.before(calendar.getTime());
|
||||
}
|
||||
}
|
||||
|
|
@ -103,7 +103,7 @@ public class ForecastService {
|
|||
* @param tm
|
||||
* @return
|
||||
*/
|
||||
private List<RainGrib2Layer> getGribData(String tm,Boolean isOnlyQueryTotal){
|
||||
public List<RainGrib2Layer> getGribData(String tm,Boolean isOnlyQueryTotal){
|
||||
List<RainGrib2Layer> list = new ArrayList<>();
|
||||
String grbLatestUrl = shqxjsCloudowrCnPath + grbgetName + "?tm=" + tm;
|
||||
HttpClient httpClient = HttpClientBuilder.create().build();
|
||||
|
|
@ -205,7 +205,7 @@ public class ForecastService {
|
|||
return list.stream().sorted(Comparator.comparing(ForeRainVo::getH24).reversed()).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private List<ForeRainTimeVo> getData(ForeRainVo vo, List<RainGrib2Layer> total,List<RainGrib2Layer> detail) {
|
||||
public List<ForeRainTimeVo> getData(ForeRainVo vo, List<RainGrib2Layer> total,List<RainGrib2Layer> detail) {
|
||||
List<ForeRainTimeVo> result = new ArrayList<>();
|
||||
RainGrib2Layer layer = total.get(0);
|
||||
BigDecimal dh = layer.getDh();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
package com.gunshi.project.xyt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gunshi.project.xyt.mapper.ForecastUMapper;
|
||||
import com.gunshi.project.xyt.model.ForecastU;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 描述: 时段单位线表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class ForecastUService extends ServiceImpl<ForecastUMapper, ForecastU>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.gunshi.project.xyt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gunshi.project.xyt.mapper.ForecastUseparamMapper;
|
||||
import com.gunshi.project.xyt.model.ForecastUseparam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 描述: 预报_通用参数管理
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class ForecastUseparamService extends ServiceImpl<ForecastUseparamMapper, ForecastUseparam>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?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.gunshi.project.xyt.mapper.ForecastHQMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?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.gunshi.project.xyt.mapper.ForecastHVMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?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.gunshi.project.xyt.mapper.ForecastKMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?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.gunshi.project.xyt.mapper.ForecastPPaRMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?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.gunshi.project.xyt.mapper.ForecastPlanMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?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.gunshi.project.xyt.mapper.ForecastResultsMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?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.gunshi.project.xyt.mapper.ForecastUMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?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.gunshi.project.xyt.mapper.ForecastUseparamMapper">
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue