| | |
| | | package cn.gistack.sm.reportFlood.controller; |
| | | |
| | | import cn.gistack.flow.core.feign.IFlowClient; |
| | | import cn.gistack.flow.core.vo.BladeFlowVO; |
| | | import cn.gistack.sm.patrol.entity.PatrolConfig; |
| | | import cn.gistack.sm.patrol.entity.PatrolTask; |
| | | import cn.gistack.sm.patrol.service.IPatrolConfigService; |
| | | import cn.gistack.sm.patrol.vo.BladeFlowPage; |
| | | import cn.gistack.sm.patrol.vo.PatrolTaskVO; |
| | | import cn.gistack.sm.reportFlood.entity.ReportFloodRecord; |
| | | import cn.gistack.sm.reportFlood.service.IReportFloodRecordService; |
| | | import cn.gistack.sm.reportFlood.vo.ReportFloodRecordVO; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | */ |
| | | @ApiOperation(value = "报汛记录-分页列表查询", notes = "报汛记录-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public R<IPage<ReportFloodRecord>> queryPageList(ReportFloodRecord reportFloodRecord, Query query) { |
| | | IPage<ReportFloodRecord> pageList = reportFloodRecordService.selectReportFloodRecordPages(Condition.getPage(query), reportFloodRecord); |
| | | public R<IPage<ReportFloodRecordVO>> queryPageList(ReportFloodRecordVO reportFloodRecord, Query query) { |
| | | |
| | | String code = reportFloodRecord.getAdCode(); |
| | | if (StringUtil.isNoneBlank(code)){ |
| | | if (code.substring(0,4).indexOf("00") > -1) { |
| | | reportFloodRecord.setAdCode(code.substring(0,2)); |
| | | } else if (code.substring(0,6).indexOf("00") > -1) { |
| | | reportFloodRecord.setAdCode(code.substring(0,4)); |
| | | } |
| | | } |
| | | IPage<ReportFloodRecordVO> pageList = reportFloodRecordService.selectReportFloodRecordPages(Condition.getPage(query), reportFloodRecord); |
| | | return R.data(pageList); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "报汛记录-通过id删除", notes = "报汛记录-通过id删除") |
| | | @DeleteMapping(value = "/delete") |
| | | @PostMapping(value = "/delete") |
| | | public R delete(@RequestParam(name = "id", required = true) String id) { |
| | | return R.data(reportFloodRecordService.removeById(id)); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "报汛记录-批量删除", notes = "报汛记录-批量删除") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | @PostMapping(value = "/deleteBatch") |
| | | public R deleteBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | | return R.data(this.reportFloodRecordService.removeByIds(Arrays.asList(ids.split(",")))); |
| | | } |
| | |
| | | @ApiOperation(value = "报汛记录-通过id查询", notes = "报汛记录-通过id查询") |
| | | @GetMapping(value = "/queryById") |
| | | public R queryById(@RequestParam(name = "id", required = true) String id) { |
| | | ReportFloodRecord reportFloodRecord = reportFloodRecordService.getById(id); |
| | | ReportFloodRecordVO reportFloodRecord = reportFloodRecordService.getDetailVO(id); |
| | | return R.data(reportFloodRecord); |
| | | } |
| | | |
| | | /** |
| | | * 根据水库id返回最新审核通过的报汛记录 |
| | | * |
| | | * @param reservoirId |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "报汛记录-根据水库id返回最新审核通过的报汛记录", notes = "报汛记录-根据水库id返回最新审核通过的报汛记录") |
| | | @GetMapping(value = "/getLatestRecord") |
| | | public R getLatestRecord(String reservoirId) { |
| | | ReportFloodRecord reportFloodRecord = reportFloodRecordService.getLatestRecord(reservoirId); |
| | | return R.data(reportFloodRecord); |
| | | } |
| | | } |