| New file |
| | |
| | | package cn.gistack.sm.sjztmd.controller; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.TbDykeUnitDanger; |
| | | import cn.gistack.sm.sjztmd.service.ITbDykeUnitDangerService; |
| | | import cn.gistack.sm.sjztmd.vo.TbDykeUnitDangerVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * @Author AIX |
| | | * @Date 2024/6/28 14:12 |
| | | * @Version 1.0 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "堤防危害等级评定") |
| | | @RestController |
| | | @RequestMapping("/sjztmd/tbDykeUnitDanger") |
| | | @AllArgsConstructor |
| | | public class TbDykeUnitDangerController { |
| | | |
| | | private ITbDykeUnitDangerService tbDykeUnitDangerService; |
| | | |
| | | @ApiOperation(value = "堤防危害等级评定-危害列表", notes = "堤防危害等级评定-危害列表") |
| | | @GetMapping(value = "/listDykeUnitDanger") |
| | | public R listDykeUnitDanger(@ApiIgnore TbDykeUnitDangerVO vo) { |
| | | return R.data(tbDykeUnitDangerService.listDykeUnitDanger(vo)); |
| | | } |
| | | |
| | | @ApiOperation(value = "堤防危害等级评定-添加或者修改", notes = "堤防危害等级评定-添加或者修改") |
| | | @PostMapping(value = "/submit") |
| | | public R submit(@RequestBody TbDykeUnitDanger tbDykeUnitDanger) { |
| | | // 获取当前日期 |
| | | LocalDate today = LocalDate.now(); |
| | | // 获取年份 |
| | | int year = today.getYear(); |
| | | tbDykeUnitDanger.setCreateTime(new Date()); |
| | | tbDykeUnitDanger.setTbYear(year); |
| | | return R.data(tbDykeUnitDangerService.saveOrUpdate(tbDykeUnitDanger)); |
| | | } |
| | | |
| | | @ApiOperation(value = "堤防危害等级评定-批量添加或者修改", notes = "堤防危害等级评定-添加或者修改") |
| | | @PostMapping(value = "/submitBatch") |
| | | public R submit(@RequestBody List<TbDykeUnitDanger> tbDykeUnitDangers) { |
| | | return R.data(tbDykeUnitDangerService.saveOrUpdateBatch(tbDykeUnitDangers)); |
| | | } |
| | | |
| | | } |