|
|
|
@ -7,6 +7,9 @@ import cn.hutool.core.util.ObjectUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.project.appeal.domain.entity.AppealEntity; |
|
|
|
import com.project.appeal.domain.enums.AppealStatusEnum; |
|
|
|
import com.project.appeal.mapper.AppealMapper; |
|
|
|
import com.project.base.domain.exception.MissingParameterException; |
|
|
|
import com.project.base.domain.result.PageResult; |
|
|
|
import com.project.base.domain.result.Result; |
|
|
|
@ -61,6 +64,9 @@ public class SearchTaskDomainServiceImpl implements SearchTaskDomainService { |
|
|
|
@Autowired |
|
|
|
private ProductLineMapper productLineMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private AppealMapper appealMapper; |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result<PageResult<TaskDTO>> search(TaskParam param) throws Exception { |
|
|
|
LambdaQueryWrapper<TaskEntity> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
@ -194,6 +200,14 @@ public class SearchTaskDomainServiceImpl implements SearchTaskDomainService { |
|
|
|
dto.setParticipantUserDTOList(participantUserDTOList); |
|
|
|
dto.setParticipantUserIdList(participantUserDTOList.stream().map(UserDTO::getId).toList()); |
|
|
|
dto.setTotalQuestionNum(dto.getSingleChoiceNum() + dto.getMultipleChoiceNum() + dto.getTrueFalseNum() + dto.getShortAnswerNum()); |
|
|
|
|
|
|
|
// 查询是否存在待审批的申诉
|
|
|
|
Long pendingAppealCount = appealMapper.selectCount( |
|
|
|
new LambdaQueryWrapper<AppealEntity>() |
|
|
|
.eq(AppealEntity::getTaskId, dto.getId()) |
|
|
|
.eq(AppealEntity::getStatus, AppealStatusEnum.PENDING_REVIEW.getValue())); |
|
|
|
dto.setHasPendingAppeal(pendingAppealCount > 0); |
|
|
|
|
|
|
|
return dto; |
|
|
|
} |
|
|
|
|
|
|
|
|