|
|
@@ -4,7 +4,7 @@ import cn.hutool.core.lang.Dict;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.google.common.collect.Maps;
|
|
|
import com.google.common.collect.Sets;
|
|
|
-import com.ruoyi.common.utils.NumberUtils;
|
|
|
+import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import com.ruoyi.dz.domain.DzClasses;
|
|
|
import com.ruoyi.dz.mapper.DzClassesMapper;
|
|
|
@@ -287,6 +287,55 @@ public class LearnTeacherService {
|
|
|
return buildTree(ktList, knowledgeIdSet, knowCountMap);
|
|
|
}
|
|
|
|
|
|
+ public void updateDirected(Long studentId, Long universityId, Long planId) {
|
|
|
+ LearnStudent upStudent = new LearnStudent();
|
|
|
+ upStudent.setStudentId(studentId);
|
|
|
+ upStudent.setUniversityId(universityId);
|
|
|
+ upStudent.setMajorPlanId(planId);
|
|
|
+ upStudent.setDirectKey("");
|
|
|
+ AMarjorPlan plan = marjorPlanMapper.selectAMarjorPlanById(planId);
|
|
|
+ LearnDirectedKnowledge dkCond = new LearnDirectedKnowledge();
|
|
|
+ dkCond.setUniversityId(plan.getUniversityId());
|
|
|
+ dkCond.setYear(plan.getYear());
|
|
|
+ SysUser sysUser = SecurityUtils.getLoginUser().getUser();
|
|
|
+ dkCond.setLocations(sysUser.getLocation());
|
|
|
+ dkCond.setExamineeTypes(sysUser.getExamType().name());
|
|
|
+ Map<String, LearnDirectedKnowledge> directedKnowledgeMap = learnDirectedKnowledgeMapper.selectLearnDirectedKnowledgeList(dkCond).stream().collect(Collectors.toMap(LearnDirectedKnowledge::getDirectKey, t -> t));
|
|
|
+ LearnDirectedKnowledge directedKnowledge = null;
|
|
|
+ String groupName = StringUtils.trimToEmpty(plan.getMajorGroup());
|
|
|
+ if(null != (directedKnowledge = directedKnowledgeMap.get(groupName + "_" + plan.getMajorName()))) {
|
|
|
+ upStudent.setDirectKey(directedKnowledge.getDirectKey());
|
|
|
+ } else if(null != (directedKnowledge = directedKnowledgeMap.get(groupName))) {
|
|
|
+ upStudent.setDirectKey(directedKnowledge.getDirectKey());
|
|
|
+ }
|
|
|
+ learnStudentMapper.updateLearnStudent(upStudent);
|
|
|
+ }
|
|
|
+
|
|
|
+ public Set<Long> getSubjectIdSet(Long[] planIds) {
|
|
|
+ Set<Long> subjectIdSet = Sets.newHashSet();
|
|
|
+ if(ArrayUtils.isNotEmpty(planIds)) {
|
|
|
+ List<AMarjorPlan> planList = marjorPlanMapper.selectAMarjorPlanByIds(planIds);
|
|
|
+ AMarjorPlan curr = planList.get(0);
|
|
|
+ LearnDirectedKnowledge dkCond = new LearnDirectedKnowledge();
|
|
|
+ dkCond.setUniversityId(curr.getUniversityId());
|
|
|
+ dkCond.setYear(curr.getYear());
|
|
|
+ SysUser sysUser = SecurityUtils.getLoginUser().getUser();
|
|
|
+ dkCond.setLocations(sysUser.getLocation());
|
|
|
+ dkCond.setExamineeTypes(sysUser.getExamType().name());
|
|
|
+ Map<String, LearnDirectedKnowledge> directedKnowledgeMap = learnDirectedKnowledgeMapper.selectLearnDirectedKnowledgeList(dkCond).stream().collect(Collectors.toMap(LearnDirectedKnowledge::getDirectKey, t -> t));
|
|
|
+ LearnDirectedKnowledge directedKnowledge = null;
|
|
|
+ for(AMarjorPlan plan : planList) {
|
|
|
+ String groupName = StringUtils.trimToEmpty(plan.getMajorGroup());
|
|
|
+ if(null != (directedKnowledge = directedKnowledgeMap.get(groupName + "_" + plan.getMajorName()))) {
|
|
|
+ subjectIdSet.addAll(Stream.of(directedKnowledge.getSubjects().split(",")).map(t -> Long.parseLong(t.trim())).collect(Collectors.toList()));
|
|
|
+ } else if(null != (directedKnowledge = directedKnowledgeMap.get(groupName))) {
|
|
|
+ subjectIdSet.addAll(Stream.of(directedKnowledge.getSubjects().split(",")).map(t -> Long.parseLong(t.trim())).collect(Collectors.toList()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return subjectIdSet;
|
|
|
+ }
|
|
|
+
|
|
|
public Set<Long> getKnowledgeIdSet(Long[] planIds) {
|
|
|
Set<Long> knowledgeIdSet = Sets.newHashSet();
|
|
|
if(ArrayUtils.isNotEmpty(planIds)) {
|
|
|
@@ -295,6 +344,9 @@ public class LearnTeacherService {
|
|
|
LearnDirectedKnowledge dkCond = new LearnDirectedKnowledge();
|
|
|
dkCond.setUniversityId(curr.getUniversityId());
|
|
|
dkCond.setYear(curr.getYear());
|
|
|
+ SysUser sysUser = SecurityUtils.getLoginUser().getUser();
|
|
|
+ dkCond.setLocations(sysUser.getLocation());
|
|
|
+ dkCond.setExamineeTypes(sysUser.getExamType().name());
|
|
|
Map<String, LearnDirectedKnowledge> directedKnowledgeMap = learnDirectedKnowledgeMapper.selectLearnDirectedKnowledgeList(dkCond).stream().collect(Collectors.toMap(LearnDirectedKnowledge::getDirectKey, t -> t));
|
|
|
LearnDirectedKnowledge directedKnowledge = null;
|
|
|
for(AMarjorPlan plan : planList) {
|