|
@@ -4,14 +4,17 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.jeecg.modules.app.dto.evaluate.FindEvaluateDTO;
|
|
|
import org.jeecg.modules.system.app.dto.evaluate.FindEvaluateRequestDTO;
|
|
|
import org.jeecg.modules.system.app.dto.evaluate.FindEvaluateResponseDTO;
|
|
|
import org.jeecg.modules.system.app.entity.Evaluate;
|
|
|
+import org.jeecg.modules.system.app.mapper.AppCoursesMapper;
|
|
|
import org.jeecg.modules.system.app.mapper.EvaluateMapper;
|
|
|
import org.jeecg.modules.system.app.service.IEvaluateService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
@@ -27,6 +30,9 @@ public class EvaluateServiceImpl extends ServiceImpl<EvaluateMapper, Evaluate> i
|
|
|
|
|
|
@Autowired
|
|
|
EvaluateMapper evaluateMapper;
|
|
|
+ @Autowired
|
|
|
+ private AppCoursesMapper appCoursesMapper;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public IPage<FindEvaluateResponseDTO> findPage(Integer pageNo, Integer pageSize, FindEvaluateRequestDTO findEvaluateRequestDTO) {
|
|
@@ -45,4 +51,22 @@ public class EvaluateServiceImpl extends ServiceImpl<EvaluateMapper, Evaluate> i
|
|
|
}
|
|
|
return findEvaluateResponseDTOIPage;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public IPage<FindEvaluateResponseDTO> findByOrderPage(FindEvaluateDTO findEvaluateDTO) {
|
|
|
+ Page<FindEvaluateResponseDTO> page = new Page<FindEvaluateResponseDTO>(findEvaluateDTO.getPageNo(), findEvaluateDTO.getPageSize());
|
|
|
+ IPage<FindEvaluateResponseDTO> findEvaluateResponseDTOIPage=null;
|
|
|
+ List<String> coursesIds = new ArrayList<>();
|
|
|
+ if (StringUtils.isNotEmpty(findEvaluateDTO.getSiteId())){
|
|
|
+ findEvaluateResponseDTOIPage = evaluateMapper.findBySiteId(page,findEvaluateDTO.getSiteId());
|
|
|
+ } else if (StringUtils.isNotEmpty(findEvaluateDTO.getInstructorId())) {
|
|
|
+ coursesIds = appCoursesMapper.findByInstructorId(findEvaluateDTO.getInstructorId());
|
|
|
+ } else if (StringUtils.isNotEmpty(findEvaluateDTO.getCoursesId())) {
|
|
|
+ coursesIds.add(findEvaluateDTO.getCoursesId());
|
|
|
+ }
|
|
|
+ if (coursesIds!=null&&!coursesIds.isEmpty()){
|
|
|
+ findEvaluateResponseDTOIPage = evaluateMapper.findByCoursesId(page,coursesIds);
|
|
|
+ }
|
|
|
+ return findEvaluateResponseDTOIPage;
|
|
|
+ }
|
|
|
}
|