96 lines
3.6 KiB
Java
96 lines
3.6 KiB
Java
|
|
package com.gunshi.project.hsz.controller;
|
||
|
|
|
||
|
|
|
||
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||
|
|
import com.gunshi.core.result.R;
|
||
|
|
import com.gunshi.project.hsz.common.validate.markers.Insert;
|
||
|
|
import com.gunshi.project.hsz.common.validate.markers.Update;
|
||
|
|
import com.gunshi.project.hsz.entity.dto.RiceWaterCaculateDto;
|
||
|
|
import com.gunshi.project.hsz.entity.so.AttCctvBasePage;
|
||
|
|
import com.gunshi.project.hsz.entity.so.RiceRqWaterPageSo;
|
||
|
|
import com.gunshi.project.hsz.entity.vo.RiceRqWaterCaculateVo;
|
||
|
|
import com.gunshi.project.hsz.model.*;
|
||
|
|
import com.gunshi.project.hsz.service.RiceRqWaterService;
|
||
|
|
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.security.core.annotation.AuthenticationPrincipal;
|
||
|
|
import org.springframework.validation.annotation.Validated;
|
||
|
|
import org.springframework.web.bind.annotation.*;
|
||
|
|
|
||
|
|
import java.util.List;
|
||
|
|
|
||
|
|
@Tag(name = "农业需水预测")
|
||
|
|
@RestController
|
||
|
|
@RequestMapping(value="/riceRqWater")
|
||
|
|
public class RiceRqWaterController {
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
private RiceRqWaterService riceRqWaterService;
|
||
|
|
|
||
|
|
|
||
|
|
@Operation(summary = "分页")
|
||
|
|
@PostMapping("/page")
|
||
|
|
public R<Page<RiceRqWater>> page(@RequestBody @Validated RiceRqWaterPageSo page) {
|
||
|
|
return R.ok(riceRqWaterService.pageQuery(page));
|
||
|
|
}
|
||
|
|
|
||
|
|
@Operation(summary = "新增")
|
||
|
|
@PostMapping("/insert")
|
||
|
|
public R<RiceRqWater> insert(@Validated(Insert.class) @RequestBody RiceRqWater dto) {
|
||
|
|
return R.ok(riceRqWaterService.saveData(dto));
|
||
|
|
}
|
||
|
|
|
||
|
|
@Operation(summary = "修改")
|
||
|
|
@PostMapping("/update")
|
||
|
|
public R<RiceRqWater> update(@Validated(Update.class) @RequestBody RiceRqWater dto) {
|
||
|
|
return R.ok(riceRqWaterService.updateData(dto));
|
||
|
|
}
|
||
|
|
|
||
|
|
@Operation(summary = "删除")
|
||
|
|
@GetMapping("/del/{id}")
|
||
|
|
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Long id) {
|
||
|
|
return R.ok(riceRqWaterService.delData(id));
|
||
|
|
}
|
||
|
|
|
||
|
|
@Operation(summary = "阶段耗水量计算")
|
||
|
|
@PostMapping("/stage/caculate")
|
||
|
|
public R<List<RiceWaterKi>> stageCaculate(@RequestBody RiceWaterCaculateDto dto){
|
||
|
|
List<RiceWaterKi> res = riceRqWaterService.stageCaculate(dto);
|
||
|
|
return R.ok(res);
|
||
|
|
}
|
||
|
|
|
||
|
|
@Operation(summary = "综合计算")
|
||
|
|
@PostMapping("/caculate")
|
||
|
|
public R<RiceRqWaterCaculateVo> caculate(@RequestBody RiceWaterCaculateDto dto){
|
||
|
|
RiceRqWaterCaculateVo res = riceRqWaterService.caculate(dto);
|
||
|
|
return R.ok(res);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
@Operation(summary = "灌区用水量计算")
|
||
|
|
@PostMapping("/irrigation/caculate")
|
||
|
|
public R<List<RiceIrrigationUse>> irrigationCaculate(@RequestBody RiceWaterCaculateDto dto){
|
||
|
|
List<RiceIrrigationUse> res = riceRqWaterService.irrigationCaculate(dto);
|
||
|
|
return R.ok(res);
|
||
|
|
}
|
||
|
|
|
||
|
|
@Operation(summary = "灌区综合用水量计算-按月份计算")
|
||
|
|
@PostMapping("/irrigation/caculate/month")
|
||
|
|
public R<List<RiceWaterForecastMonth>> irrigationCaculateMonth(@RequestBody RiceWaterCaculateDto dto){
|
||
|
|
List<RiceWaterForecastMonth> res = riceRqWaterService.irrigationComprehensiveCaculateMonth(dto);
|
||
|
|
return R.ok(res);
|
||
|
|
}
|
||
|
|
|
||
|
|
@Operation(summary = "灌区综合用水量计算-按生长周期计算")
|
||
|
|
@PostMapping("/irrigation/caculate/cycle")
|
||
|
|
public R<List<RiceWaterForecastCycle>> irrigationCaculateCycle(@RequestBody RiceWaterCaculateDto dto){
|
||
|
|
List<RiceWaterForecastCycle> res = riceRqWaterService.irrigationComprehensiveCaculateCycle(dto);
|
||
|
|
return R.ok(res);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|