| | |
| | | */ |
| | | package org.springblade.modules.evaluate.wrapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.SpringUtil; |
| | | import org.springblade.modules.evaluate.entity.EvaluateCandidateAssessorEntity; |
| | | import org.springblade.modules.evaluate.entity.EvaluateCandidateEntity; |
| | | import org.springblade.modules.evaluate.service.IEvaluateCandidateService; |
| | | import org.springblade.modules.evaluate.service.IEvaluateTaskService; |
| | | import org.springblade.modules.evaluate.vo.EvaluateCandidateAssessorVO; |
| | | import org.springblade.modules.evaluate.vo.EvaluateCandidateVO; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public class EvaluateCandidateAssessorWrapper extends BaseEntityWrapper<EvaluateCandidateAssessorEntity, EvaluateCandidateAssessorVO> { |
| | | |
| | | private static final IEvaluateCandidateService evaluateCandidateService; |
| | | private static final IEvaluateTaskService evaluateTaskService; |
| | | |
| | | static { |
| | | evaluateCandidateService = SpringUtil.getBean(IEvaluateCandidateService.class); |
| | | evaluateTaskService = SpringUtil.getBean(IEvaluateTaskService.class); |
| | | } |
| | | public static EvaluateCandidateAssessorWrapper build() { |
| | | return new EvaluateCandidateAssessorWrapper(); |
| | | } |
| | |
| | | return evaluateCandidateAssessorVO; |
| | | } |
| | | |
| | | public IPage<EvaluateCandidateAssessorVO> h5PageVO(IPage<EvaluateCandidateAssessorEntity> pages, Long userId) { |
| | | System.out.println(userId); |
| | | List<EvaluateCandidateAssessorVO> records = listVO(pages.getRecords()); |
| | | |
| | | for (EvaluateCandidateAssessorVO vo : records) { |
| | | EvaluateCandidateVO candidateVO = EvaluateCandidateWrapper.build().entityVO(evaluateCandidateService.getById(vo.getEvaluateCandidateId())); |
| | | vo.setEvaluateCandidateVO(candidateVO); |
| | | vo.setEvaluateTaskVO(EvaluateTaskWrapper.build().entityVO(evaluateTaskService.getById(candidateVO.getEvaluateTaskId()))); |
| | | } |
| | | |
| | | IPage<EvaluateCandidateAssessorVO> pageVo = new Page<>(pages.getCurrent(), pages.getSize(), pages.getTotal()); |
| | | pageVo.setRecords(records); |
| | | return pageVo; |
| | | } |
| | | |
| | | |
| | | } |