Browse Source

fit:督察问题完善(查询条件)

master
pengwei 4 months ago
parent
commit
037f2c36f9
  1. 11
      src/main/java/com/biutag/supervision/controller/mobileSupervision/TaskProblemController.java
  2. 8
      src/main/java/com/biutag/supervision/pojo/param/TaskProblemQueryParam.java

11
src/main/java/com/biutag/supervision/controller/mobileSupervision/TaskProblemController.java

@ -13,10 +13,13 @@ import com.biutag.supervision.pojo.entity.SupTaskPerson;
import com.biutag.supervision.pojo.entity.SupTaskProblem;
import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.pojo.param.TaskProblemQueryParam;
import com.biutag.supervision.service.SupDepartService;
import com.biutag.supervision.service.SupTaskProblemService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@ -31,12 +34,20 @@ public class TaskProblemController {
private final SupTaskProblemService taskProblemService;
private final SupDepartService departService;
@GetMapping
public Result<Page<SupTaskProblem>> page(TaskProblemQueryParam queryParam) {
LambdaQueryWrapper<SupTaskProblem> queryWrapper = new LambdaQueryWrapper<>();
List<String> orgIds =new ArrayList<>();
if(StrUtil.isNotBlank(queryParam.getDepartId())){
orgIds = departService.getAllNodeIds(queryParam.getDepartId());
}
queryWrapper.eq(StrUtil.isNotBlank(queryParam.getTaskType()), SupTaskProblem::getTaskType, queryParam.getTaskType())
.eq(Objects.nonNull(queryParam.getTaskId()), SupTaskProblem::getTaskId, queryParam.getTaskId())
.eq(StrUtil.isNotBlank(queryParam.getContentId()), SupTaskProblem::getContentId, queryParam.getContentId())
.eq(StrUtil.isNotBlank(queryParam.getDistributionState()),SupTaskProblem::getDistributionState,queryParam.getDistributionState())
.like(StrUtil.isNotBlank(queryParam.getThingDesc()),SupTaskProblem::getThingDesc,queryParam.getThingDesc())
.in(StrUtil.isNotBlank(queryParam.getDepartId()),SupTaskProblem::getDepartId,orgIds)
.orderByDesc(SupTaskProblem::getCreateTime);
UserAuth user = UserContextHolder.getCurrentUser();
if (TaskTypeEnum.problem_shooting.name().equals(queryParam.getTaskType()) && !AppConstants.USER_TYPE_SUPER.equals(user.getUserType()) ) {

8
src/main/java/com/biutag/supervision/pojo/param/TaskProblemQueryParam.java

@ -16,6 +16,12 @@ public class TaskProblemQueryParam extends BasePage {
private Integer taskId;
private String contentId;
//问题来源
private String actionType;
//分发状态
private String distributionState;
//涉及单位
private String departId;
//问题描述
private String thingDesc;
}

Loading…
Cancel
Save