| | |
| | | package cn.gistack.sm.patrol.controller; |
| | | |
| | | import cn.gistack.sm.patrol.entity.PatrolGroupItem; |
| | | import cn.gistack.sm.patrol.entity.PatrolRecord; |
| | | import cn.gistack.sm.patrol.entity.PatrolReport; |
| | | import cn.gistack.sm.patrol.entity.PatrolType; |
| | | import cn.gistack.flow.core.entity.BladeFlow; |
| | | import cn.gistack.flow.core.feign.IFlowClient; |
| | | import cn.gistack.flow.core.vo.BladeFlowVO; |
| | | import cn.gistack.sm.patrol.entity.*; |
| | | import cn.gistack.sm.patrol.service.IPatrolGroupItemService; |
| | | import cn.gistack.sm.patrol.service.IPatrolRecordService; |
| | | import cn.gistack.sm.patrol.vo.PatrolGroupItemVO; |
| | | import cn.gistack.sm.patrol.vo.PatrolRecordVO; |
| | | import cn.gistack.sm.patrol.vo.RecordBatchVO; |
| | | import cn.gistack.sm.patrol.vo.RecordVO; |
| | | import cn.gistack.sm.patrol.vo.*; |
| | | 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; |
| | | |
| | |
| | | @AllArgsConstructor |
| | | public class PatrolRecordController extends BladeController { |
| | | private IPatrolRecordService patrolRecordService; |
| | | private IFlowClient flowClient; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | |
| | | |
| | | /** |
| | | * 通过taskId,itemsIds查询(用来判断是否完成任务) |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="巡查记录-通过taskId,itemsIds查询", notes="巡查记录-通过taskId,itemsIds查询") |
| | |
| | | |
| | | /** |
| | | * 通过taskId,itemsIds查询(用来查询巡查记录) |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="巡查记录-通过itemId查询", notes="巡查记录-通过itemId查询") |
| | |
| | | |
| | | /** |
| | | * 获取处理情况 |
| | | * |
| | | * @param patrolRecord |
| | | * @return |
| | | */ |
| | |
| | | return R.data(res); |
| | | } |
| | | |
| | | /** |
| | | * 获取待办列表 |
| | | * |
| | | * @return |
| | | */ |
| | | @GetMapping("getToDoList") |
| | | public R getToDoList(String currentUserId) { |
| | | BladeFlow bladeFlow = new BladeFlow(); |
| | | //获取我的待办列表 |
| | | List<BladeFlow> toDoList = flowClient.getMyToDoList(bladeFlow,currentUserId); |
| | | List<PatrolRecordVO> result = new ArrayList<>(); |
| | | |
| | | toDoList.forEach(flow -> { |
| | | PatrolRecordVO byId = patrolRecordService.customizeGetById(flow.getBusinessId()); |
| | | if (byId != null) { |
| | | byId.setFlow(flow); |
| | | result.add(byId); |
| | | } |
| | | }); |
| | | |
| | | return R.data(result); |
| | | } |
| | | |
| | | /** |
| | | * 获取已办列表 |
| | | * |
| | | * @return |
| | | */ |
| | | @GetMapping("getDoneList") |
| | | public R getDoneList(String currentUserId) { |
| | | BladeFlow bladeFlow = new BladeFlow(); |
| | | //获取我的已办列表 |
| | | |
| | | List<BladeFlow> doneList = flowClient.getMyDoneList(bladeFlow,currentUserId); |
| | | |
| | | List<PatrolRecordVO> result = new ArrayList<>(); |
| | | |
| | | doneList.forEach(flow -> { |
| | | PatrolRecordVO byId = patrolRecordService.customizeGetById(flow.getBusinessId()); |
| | | if (byId != null) { |
| | | byId.setFlow(flow); |
| | | result.add(byId); |
| | | } |
| | | }); |
| | | |
| | | return R.data(result); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取已办分页 |
| | | * |
| | | * @return |
| | | */ |
| | | @GetMapping("getDonePage") |
| | | public R getDonePage(String currentUserId,Query query) { |
| | | BladeFlow bladeFlow = new BladeFlow(); |
| | | Integer current = query.getCurrent(); |
| | | Integer size = query.getSize(); |
| | | |
| | | //获取我的已办列表 |
| | | List<BladeFlow> doneList = flowClient.getMyDonePage(bladeFlow,currentUserId,current,size); |
| | | |
| | | List<PatrolRecordVO> result = new ArrayList<>(); |
| | | |
| | | doneList.forEach(flow -> { |
| | | PatrolRecordVO byId = patrolRecordService.customizeGetById(flow.getBusinessId()); |
| | | if (byId != null) { |
| | | byId.setFlow(flow); |
| | | result.add(byId); |
| | | } |
| | | }); |
| | | |
| | | IPage<PatrolRecordVO> page = Condition.getPage(query); |
| | | page.setRecords(result); |
| | | page.setSize(size); |
| | | page.setCurrent(current); |
| | | |
| | | return R.data(page); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |