|
|
|
|
@ -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()) ) { |
|
|
|
|
|