| | |
| | | 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.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 报汛记录 |
| | |
| | | public class ReportFloodRecordController extends BladeController { |
| | | |
| | | private IReportFloodRecordService reportFloodRecordService; |
| | | private IFlowClient flowClient; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | |
| | | return R.status(reportFloodRecordService.completeTask(reportFloodRecord,taskUser,currentUser)); |
| | | } |
| | | |
| | | /** |
| | | * 查询待办 |
| | | */ |
| | | @PostMapping("reportFlood-todo-list") |
| | | @ApiOperation(value = "查询待办") |
| | | public R reportFloodToDoList(ReportFloodRecordVO reportFloodRecordVO, Query query){ |
| | | BladeFlowVO bladeFlow2 = new BladeFlowVO(); |
| | | //获取待办 |
| | | R<BladeFlowPage> res = flowClient.getTodoBladeFlowList(query.getSize(),query.getCurrent(),reportFloodRecordVO.getCurrentUserId(), bladeFlow2); |
| | | IPage<BladeFlowVO> bladeFlowVOIPage = new Page<>(); |
| | | List<BladeFlowVO> bladeFlowVOList = new ArrayList<>(); |
| | | |
| | | if (res.isSuccess()){ |
| | | List<Object> data = res.getData().getData(); |
| | | data.forEach(obj -> { |
| | | BladeFlowVO<ReportFloodRecord> bladeFlow = JSON.parseObject(JSON.toJSONString(obj),BladeFlowVO.class); |
| | | ReportFloodRecordVO byId = reportFloodRecordService.customizeGetDetail(bladeFlow.getBusinessId()); |
| | | bladeFlow.setDetail(byId); |
| | | bladeFlowVOList.add(bladeFlow); |
| | | }); |
| | | } |
| | | //设置数据集 |
| | | bladeFlowVOIPage.setRecords(bladeFlowVOList); |
| | | //设置当前页 |
| | | bladeFlowVOIPage.setCurrent(res.getData().getCurrent()); |
| | | //设置页数 |
| | | bladeFlowVOIPage.setSize(res.getData().getSize()); |
| | | //设置总数 |
| | | bladeFlowVOIPage.setTotal(res.getData().getTotal()); |
| | | return R.data(bladeFlowVOIPage); |
| | | } |
| | | |
| | | /** |
| | | * 查询已办 |
| | | */ |
| | | @PostMapping("reportFlood-done-list") |
| | | @ApiOperation(value = "查询待办") |
| | | public R reportFloodDoneList(ReportFloodRecordVO reportFloodRecordVO, Query query){ |
| | | BladeFlowVO bladeFlow2 = new BladeFlowVO(); |
| | | //获取待办 |
| | | R<BladeFlowPage> res = flowClient.getDoneBladeFlowList(query.getSize(),query.getCurrent(),reportFloodRecordVO.getCurrentUserId(), bladeFlow2); |
| | | IPage<BladeFlowVO> bladeFlowVOIPage = new Page<>(); |
| | | List<BladeFlowVO> bladeFlowVOList = new ArrayList<>(); |
| | | |
| | | if (res.isSuccess()){ |
| | | List<Object> data = res.getData().getData(); |
| | | data.forEach(obj -> { |
| | | BladeFlowVO<ReportFloodRecord> bladeFlow = JSON.parseObject(JSON.toJSONString(obj),BladeFlowVO.class); |
| | | ReportFloodRecordVO byId = reportFloodRecordService.customizeGetDetail(bladeFlow.getBusinessId()); |
| | | bladeFlow.setDetail(byId); |
| | | bladeFlowVOList.add(bladeFlow); |
| | | }); |
| | | } |
| | | //设置数据集 |
| | | bladeFlowVOIPage.setRecords(bladeFlowVOList); |
| | | //设置当前页 |
| | | bladeFlowVOIPage.setCurrent(res.getData().getCurrent()); |
| | | //设置页数 |
| | | bladeFlowVOIPage.setSize(res.getData().getSize()); |
| | | //设置总数 |
| | | bladeFlowVOIPage.setTotal(res.getData().getTotal()); |
| | | return R.data(bladeFlowVOIPage); |
| | | } |
| | | } |
| | | |