|
|
@@ -18,9 +18,10 @@ import com.ruoyi.dz.service.IDzSubjectService;
|
|
|
import com.ruoyi.enums.PaperBuildStatus;
|
|
|
import com.ruoyi.enums.QuestionType;
|
|
|
import com.ruoyi.learn.domain.*;
|
|
|
-import com.ruoyi.learn.service.ILearnPaperQuestionService;
|
|
|
import com.ruoyi.learn.service.ILearnPaperService;
|
|
|
import com.ruoyi.learn.service.ILearnTestPaperService;
|
|
|
+import com.ruoyi.syzy.domain.BBusiWishUniversities;
|
|
|
+import com.ruoyi.syzy.mapper.BBusiWishUniversitiesMapper;
|
|
|
import com.ruoyi.web.service.LearnTeacherService;
|
|
|
import com.ruoyi.web.service.PaperService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
@@ -32,6 +33,7 @@ import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.*;
|
|
|
+import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@RestController
|
|
|
@@ -44,14 +46,16 @@ public class LearnTeacherController extends BaseController {
|
|
|
private final PaperService paperService;
|
|
|
private final ILearnPaperService learnPaperService;
|
|
|
private final ILearnTestPaperService testPaperService;
|
|
|
+ private final BBusiWishUniversitiesMapper busiWishUniversitiesMapper;
|
|
|
|
|
|
- public LearnTeacherController(IDzControlService dzControlService, IDzSubjectService dzSubjectService, LearnTeacherService learnTeacherService, PaperService paperService, ILearnPaperService learnPaperService, ILearnTestPaperService testPaperService) {
|
|
|
+ public LearnTeacherController(IDzControlService dzControlService, IDzSubjectService dzSubjectService, LearnTeacherService learnTeacherService, PaperService paperService, ILearnPaperService learnPaperService, ILearnTestPaperService testPaperService, BBusiWishUniversitiesMapper busiWishUniversitiesMapper) {
|
|
|
this.dzControlService = dzControlService;
|
|
|
this.dzSubjectService = dzSubjectService;
|
|
|
this.learnTeacherService = learnTeacherService;
|
|
|
this.paperService = paperService;
|
|
|
this.learnPaperService = learnPaperService;
|
|
|
this.testPaperService = testPaperService;
|
|
|
+ this.busiWishUniversitiesMapper = busiWishUniversitiesMapper;
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -116,10 +120,20 @@ public class LearnTeacherController extends BaseController {
|
|
|
return AjaxResult.success(Collections.emptyList());
|
|
|
}
|
|
|
List<JSONObject> resultList = new ArrayList<>();
|
|
|
+
|
|
|
+ Map uCond = new HashMap();
|
|
|
+ uCond.put("ids", testPaperList.stream().map(LearnTestPaper::getUniversityId).collect(Collectors.toSet()));
|
|
|
+ Map<Long, BBusiWishUniversities> universityMap = busiWishUniversitiesMapper.selectBBusiWishUniversitiesListSimpleByIds(uCond).stream().collect(Collectors.toMap(BBusiWishUniversities::getId, Function.identity()));
|
|
|
for(LearnTestPaper learnTestPaper : testPaperList) {
|
|
|
PaperVO paperVO = paperService.loadPaper(learnTestPaper.getPaperId());
|
|
|
JSONObject root = JSONObject.from(paperVO);
|
|
|
root.remove("id");
|
|
|
+ BBusiWishUniversities u = universityMap.get(learnTestPaper.getUniversityId());
|
|
|
+ if(null != u) {
|
|
|
+ String paperName = paperVO.getPaperName().replaceAll(paperVO.getDirectKey(), "");
|
|
|
+ paperName += u.getName() + "_" + ExamType.valueOf(learnTestPaper.getExamType()).title();
|
|
|
+ root.put("paperName", paperName);
|
|
|
+ }
|
|
|
root.put("paperId", learnTestPaper.getPaperId());
|
|
|
resultList.add(root);
|
|
|
}
|