|
@@ -1,17 +1,18 @@
|
|
package com.qmth.exam.reserve.service.impl;
|
|
package com.qmth.exam.reserve.service.impl;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.List;
|
|
|
|
-
|
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
|
-
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
+import com.qmth.exam.reserve.bean.examsite.ExamSiteInfo;
|
|
import com.qmth.exam.reserve.bean.stdapply.CategoryVO;
|
|
import com.qmth.exam.reserve.bean.stdapply.CategoryVO;
|
|
import com.qmth.exam.reserve.dao.ExamSiteDao;
|
|
import com.qmth.exam.reserve.dao.ExamSiteDao;
|
|
import com.qmth.exam.reserve.entity.ExamSiteEntity;
|
|
import com.qmth.exam.reserve.entity.ExamSiteEntity;
|
|
import com.qmth.exam.reserve.service.ExamSiteService;
|
|
import com.qmth.exam.reserve.service.ExamSiteService;
|
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
+
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
public class ExamSiteServiceImpl extends ServiceImpl<ExamSiteDao, ExamSiteEntity> implements ExamSiteService {
|
|
public class ExamSiteServiceImpl extends ServiceImpl<ExamSiteDao, ExamSiteEntity> implements ExamSiteService {
|
|
@@ -33,4 +34,26 @@ public class ExamSiteServiceImpl extends ServiceImpl<ExamSiteDao, ExamSiteEntity
|
|
return categoryList;
|
|
return categoryList;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public List<ExamSiteInfo> getExamSiteListForStudent(Long categoryId) {
|
|
|
|
+ LambdaQueryWrapper<ExamSiteEntity> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ wrapper.select(ExamSiteEntity::getId, ExamSiteEntity::getName, ExamSiteEntity::getAddress);
|
|
|
|
+ wrapper.eq(ExamSiteEntity::getCategoryId, categoryId);
|
|
|
|
+ wrapper.eq(ExamSiteEntity::getEnable, Boolean.TRUE);
|
|
|
|
+ List<ExamSiteEntity> entities = baseMapper.selectList(wrapper);
|
|
|
|
+
|
|
|
|
+ List<ExamSiteInfo> list = new ArrayList<>();
|
|
|
|
+ if (CollectionUtils.isNotEmpty(entities)) {
|
|
|
|
+ for (ExamSiteEntity entity : entities) {
|
|
|
|
+ ExamSiteInfo info = new ExamSiteInfo();
|
|
|
|
+ info.setExamSiteId(entity.getId());
|
|
|
|
+ info.setExamSiteName(entity.getName());
|
|
|
|
+ info.setExamSiteAddress(entity.getAddress());
|
|
|
|
+ list.add(info);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|