修复新增接口
parent
6af7dca5fe
commit
e8e8ac1797
|
|
@ -24,11 +24,11 @@ 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 = "前期影响雨量折减系数表")
|
||||
@Tag(name = "预报_前期影响雨量折减系数表")
|
||||
@RestController
|
||||
@RequestMapping(value="/forecastK")
|
||||
public class ForecastKController {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
|
@ -23,13 +24,15 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 预测方案管理表
|
||||
* 描述: 预报_预测方案管理表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Tag(name = "预测方案管理表")
|
||||
@Tag(name = "预报_预测方案管理表")
|
||||
@RestController
|
||||
@RequestMapping(value="/forecastPlan")
|
||||
public class ForecastPlanController {
|
||||
|
|
@ -44,6 +47,7 @@ public class ForecastPlanController {
|
|||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ForecastPlan> insert(@Validated(Insert.class) @RequestBody ForecastPlan dto) {
|
||||
dto.setId(IdWorker.getId());
|
||||
boolean result = service.save(dto);
|
||||
// if(result){
|
||||
// taskGroupHandler.addCronJob(String.valueOf(dto.getId()), dto);
|
||||
|
|
|
|||
|
|
@ -32,11 +32,11 @@ import java.text.DateFormat;
|
|||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 预测结果表
|
||||
* 描述: 预报_预测结果表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Tag(name = "预测结果表")
|
||||
@Tag(name = "预报_预测结果表")
|
||||
@RestController
|
||||
@RequestMapping(value="/forecastResults")
|
||||
public class ForecastResultsController {
|
||||
|
|
|
|||
|
|
@ -24,11 +24,11 @@ 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 = "时段单位线表")
|
||||
@Tag(name = "预报_时段单位线表")
|
||||
@RestController
|
||||
@RequestMapping(value="/forecastU")
|
||||
public class ForecastUController {
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ import java.math.BigDecimal;
|
|||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 描述: 前期影响雨量折减系数表
|
||||
* 描述: 预报_前期影响雨量折减系数表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Schema(description="前期影响雨量折减系数表")
|
||||
@Schema(description="预报_前期影响雨量折减系数表")
|
||||
@Data
|
||||
@TableName("public.forecast_k")
|
||||
public class ForecastK extends GenericPageParams implements Serializable {
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ import java.io.Serializable;
|
|||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 描述: 预测方案管理表
|
||||
* 描述: 预报_预测方案管理表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Schema(description="预测方案管理表")
|
||||
@Schema(description="预报_预测方案管理表")
|
||||
@Data
|
||||
@TableName("public.forecast_plan")
|
||||
public class ForecastPlan extends GenericPageParams implements Serializable {
|
||||
|
|
@ -34,7 +34,7 @@ public class ForecastPlan extends GenericPageParams implements Serializable {
|
|||
*/
|
||||
@TableId(value="id", type= IdType.AUTO)
|
||||
@Schema(description="主键")
|
||||
private Integer id;
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 预报方案名称
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ import java.math.BigDecimal;
|
|||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 描述: 预测结果表
|
||||
* 描述: 预报_预测结果表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Schema(description="预测结果表")
|
||||
@Schema(description="预报_预测结果表")
|
||||
@Data
|
||||
@TableName("public.forecast_results")
|
||||
public class ForecastResults extends GenericPageParams implements Serializable {
|
||||
|
|
@ -34,7 +34,7 @@ public class ForecastResults extends GenericPageParams implements Serializable {
|
|||
*/
|
||||
@TableId(value="id", type= IdType.AUTO)
|
||||
@Schema(description="主键")
|
||||
private Integer id;
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 时间
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ import java.math.BigDecimal;
|
|||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 描述: 时段单位线表
|
||||
* 描述: 预报_时段单位线表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Schema(description="时段单位线表")
|
||||
@Schema(description="预报_时段单位线表")
|
||||
@Data
|
||||
@TableName("public.forecast_u")
|
||||
public class ForecastU extends GenericPageParams implements Serializable {
|
||||
|
|
@ -34,7 +34,7 @@ public class ForecastU extends GenericPageParams implements Serializable {
|
|||
*/
|
||||
@TableId(value="id", type= IdType.AUTO)
|
||||
@Schema(description="主键")
|
||||
private Integer id;
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* u值
|
||||
|
|
|
|||
|
|
@ -38,9 +38,9 @@ public class TaskGroupJobRunner implements CommandLineRunner {
|
|||
// 初始加载数据库里状态为自动、正常的定时任务
|
||||
List<ForecastPlan> planList = forecastPlanService.list(new QueryWrapper<ForecastPlan>().eq("type", "1").eq("status", "0"));
|
||||
if (CollectionUtils.isNotEmpty(planList)) {
|
||||
Map<Integer, ForecastPlan> jobMap = planList.stream()
|
||||
Map<Long, ForecastPlan> jobMap = planList.stream()
|
||||
.collect(Collectors.toMap(ForecastPlan::getId, Function.identity(), (key1, key2)->key2));
|
||||
for (Map.Entry<Integer, ForecastPlan> entry : jobMap.entrySet()) {
|
||||
for (Map.Entry<Long, ForecastPlan> entry : jobMap.entrySet()) {
|
||||
taskGroupHandler.addCronJob(String.valueOf(entry.getKey()), entry.getValue());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue