| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.estate.expert.admin.domain.business.check.Check; |
| | | import com.estate.expert.admin.domain.business.onduty.OnDuty; |
| | | import com.estate.expert.admin.domain.business.position.Position; |
| | | import com.estate.expert.admin.domain.common.request.AddCheckInfoRequest; |
| | | import com.estate.expert.admin.domain.common.request.AddOnDutyRequest; |
| | |
| | | * 在岗情况列表查询 |
| | | * 支持"全部/我创建的"筛选 |
| | | */ |
| | | @ApiOperation("【APP】在岗情况列表") |
| | | @ApiOperation(value = "【APP】在岗情况列表",response = OnDuty.class) |
| | | @PostMapping("/onduty/list") |
| | | public Result listOnDutyRecords(@ApiParam(hidden = true) Session session, |
| | | @RequestParam(value = "planId", required = false) Integer planId, |
| | | public Result< PageRespMp<OnDuty>> listOnDutyRecords(@ApiParam(hidden = true) Session session, |
| | | @RequestParam(value = "checkTaskId") Integer checkTaskId, |
| | | @RequestParam(value = "mine", required = false) Boolean mine, |
| | | @Validated @RequestBody PageReq pageReq) { |
| | | // 根据 mine 参数决定是否筛选"我创建的" |
| | | var creatorId = mine != null && mine ? ((User) session.getUser()).getId() : null; |
| | | |
| | | // 调用 Service 层的 JPA 查询方法 |
| | | return Result.success(onDutyService.listOnDutyRecords(planId, creatorId, pageReq)); |
| | | return Result.success(onDutyService.listOnDutyRecords(checkTaskId, creatorId, pageReq)); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | @ApiOperation(value = "【APP】岗位列表") |
| | | @PostMapping("/position/list") |
| | | public Result list(@Validated @RequestBody PageReq pageReq) { |
| | | Page<Position> page = positionService.lambdaQuery().page(new Page<>(pageReq.getPage(), pageReq.getSize())); |
| | | public Result<PageRespMp<Position>> list(@Validated @RequestBody PageReq pageReq) { |
| | | Page<Position> page = positionService.lambdaQuery().orderByDesc(Position::getId).page(new Page<>(pageReq.getPage(), pageReq.getSize())); |
| | | return Result.success(PageRespMp.of(page)); |
| | | } |
| | | |
| | | /** |
| | | * 岗位详情 |
| | | */ |
| | | @ApiOperation(value = "【APP】岗位详情") |
| | | @ApiOperation(value = "【APP】岗位详情",response = Position.class) |
| | | @GetMapping("/position/detail") |
| | | public Result getPositionDetail(@RequestParam("id") Integer id) { |
| | | public Result<Position> getPositionDetail(@RequestParam("id") Integer id) { |
| | | Position position = positionService.getById(id); |
| | | if (position == null) { |
| | | throw new RuntimeException("岗位不存在"); |
| | |
| | | * 检查情况列表查询 |
| | | * 支持"全部/我创建的"筛选 |
| | | */ |
| | | @ApiOperation("【APP】检查情况列表") |
| | | @ApiOperation(value = "【APP】检查情况列表",response = Check.class) |
| | | @PostMapping("/checkinfo/list") |
| | | public Result listCheckInfoRecords(@ApiParam(hidden = true) Session session, |
| | | @RequestParam(value = "planId", required = false) Integer planId, |
| | | public Result<PageRespMp<Check>> listCheckInfoRecords(@ApiParam(hidden = true) Session session, |
| | | @RequestParam(value = "checkTaskId") Integer checkTaskId, |
| | | @RequestParam(value = "mine", required = false) Boolean mine, |
| | | @Validated @RequestBody PageReq pageReq) { |
| | | // 根据 mine 参数决定是否筛选"我创建的" |
| | | var creatorId = mine != null && mine ? ((User) session.getUser()).getId() : null; |
| | | |
| | | // 调用 Service 层的 JPA 查询方法 |
| | | return Result.success(checkService.listCheckInfoRecords(planId, creatorId, pageReq)); |
| | | return Result.success(checkService.listCheckInfoRecords(checkTaskId, creatorId, pageReq)); |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 检查信息详情 |
| | | */ |
| | | @ApiOperation("【APP】检查信息详情") |
| | | @ApiOperation(value = "【APP】检查信息详情", response = Check.class) |
| | | @GetMapping("/checkinfo/detail") |
| | | public Result getCheckInfoDetail(@RequestParam("id") Integer id) { |
| | | public Result<Check> getCheckInfoDetail(@RequestParam("id") Integer id) { |
| | | Check check = checkService.getById(id); |
| | | if (check == null) { |
| | | throw new RuntimeException("检查信息不存在"); |