1
0

2 کامیت‌ها 7abe5b8497 ... fbf0a2cd0d

نویسنده SHA1 پیام تاریخ
  mingfu fbf0a2cd0d Merge branch 'master' of http://49.234.186.218:9000/root/ieplus 1 هفته پیش
  mingfu f974ec6c76 专业技能考试提示等修改 1 هفته پیش

+ 23 - 1
ie-admin/src/main/java/com/ruoyi/web/controller/front/FrontStudentController.java

@@ -25,6 +25,7 @@ import com.ruoyi.ie.service.IAEnrollUniversityService;
 import com.ruoyi.ie.service.IAMarjorPlanService;
 import com.ruoyi.learn.domain.*;
 import com.ruoyi.learn.service.*;
+import com.ruoyi.sy.domain.SyMajor;
 import com.ruoyi.sy.service.ISyMajorService;
 import com.ruoyi.system.service.ISysUserService;
 import com.ruoyi.web.service.ExamService;
@@ -44,6 +45,7 @@ import java.text.ParseException;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 @RestController
@@ -124,7 +126,27 @@ public class FrontStudentController extends BaseController {
     @ApiOperation("02 计划院校专业及上级")
     @GetMapping(value = "university/major")
     public AjaxResult getUniversityMajor(@ApiParam("院校ID") Long universityId) {
-        return AjaxResult.success(syMajorService.selectPlanMajorList(VistorContextHolder.getContext(), universityId));
+        SysUser sysUser = VistorContextHolder.getContext();
+        DzControl dzControl = dzControlService.selectDzControl(sysUser);
+        List<SyMajor> syMajorList = syMajorService.selectPlanMajorList(dzControl.getPlanYear(), sysUser, universityId);
+
+        LearnDirectedKnowledge dkCond = new LearnDirectedKnowledge();
+        dkCond.setUniversityId(universityId);
+        dkCond.setYear(dzControl.getPlanYear());
+        dkCond.setLocations(sysUser.getLocation());
+        dkCond.setExamineeTypes(sysUser.getExamType().name());
+        Map<String, LearnDirectedKnowledge> directedKnowledgeMap = learnDirectedKnowledgeService.selectLearnDirectedKnowledgeList(dkCond).stream().collect(Collectors.toMap(LearnDirectedKnowledge::getDirectKey, t -> t));
+        return AjaxResult.success(syMajorList.stream().map(t -> {
+            String majorGroup = t.getExamType();
+            String majorName = t.getParentCode();
+            t.setParentCode(null);
+            t.setExamType(null);
+            t.setParams(null);
+            JSONObject o = JSONObject.from(t);
+            LearnDirectedKnowledge learnDirectedKnowledge = learnTeacherService.getBestLearnDirectedKnowledge(majorGroup, majorName, directedKnowledgeMap);
+            o.put("notice", null != learnDirectedKnowledge && "技能展示/实践操作".equals(learnDirectedKnowledge.getModules()) ? "该专业只考技能展示/实践操作" : "");
+            return o;
+        }).collect(Collectors.toList()));
     }
 
     @ApiOperation("30 计划院校专业信息")

+ 6 - 3
ie-admin/src/main/java/com/ruoyi/web/service/LearnTeacherService.java

@@ -508,15 +508,18 @@ public class LearnTeacherService {
     }
 
     private LearnDirectedKnowledge getBestLearnDirectedKnowledge(AMarjorPlan plan, Map<String, LearnDirectedKnowledge> directedKnowledgeMap) {
+        return getBestLearnDirectedKnowledge(plan.getMajorGroup(), plan.getMajorName(), directedKnowledgeMap);
+    }
+    public LearnDirectedKnowledge getBestLearnDirectedKnowledge(String majorGroup, String majorName, Map<String, LearnDirectedKnowledge> directedKnowledgeMap) {
         LearnDirectedKnowledge directedKnowledge = null;
-        String groupName = StringUtils.trimToEmpty(plan.getMajorGroup());
-        if(null != (directedKnowledge = directedKnowledgeMap.get(groupName + "_" + plan.getMajorName()))) {
+        String groupName = StringUtils.trimToEmpty(majorGroup);
+        if(null != (directedKnowledge = directedKnowledgeMap.get(groupName + "_" + majorName))) {
             return directedKnowledge;
         }
         for(String directKey : directedKnowledgeMap.keySet()) {
             if(directKey.contains("、") && (directKey.startsWith(groupName + "_"))) {
                 Set<String> marjorSet = Arrays.stream(directKey.split("_|、")).filter(t -> !t.isEmpty()).collect(Collectors.toSet());
-                if(marjorSet.contains(plan.getMajorName())) {
+                if(marjorSet.contains(majorName)) {
                     return directedKnowledgeMap.get(directKey);
                 }
             }

+ 7 - 1
ie-admin/src/main/java/com/ruoyi/web/service/SysRegisterService.java

@@ -197,7 +197,13 @@ public class SysRegisterService
         upCard.setOutDate(cardUserBody.getOutDate());
         userService.updateUserInfo(upUser);
         cardsService.updateDzCards(upCard);
-        //TODO 修改learn_student的classId
+
+        LearnStudent upStudent = new LearnStudent();
+        upStudent.setStudentId(upUser.getUserId());
+        upStudent.setClassId(NumberUtils.isPositive(upCard.getCampusClassId()) ? upCard.getCampusClassId() : upCard.getClassId());
+        upStudent.setSchoolId(upCard.getSchoolId());
+        upStudent.setCampusId(upCard.getCampusId());
+        learnStudentMapper.updateLearnStudent(upStudent);
         /**LearnStudent learnStudent = learnStudentMapper.selectLearnStudentByStudentId(userId);
         if (null!=learnStudent){
             learnStudent.setStudentName(register.getNickName());

+ 1 - 1
ie-system/src/main/java/com/ruoyi/sy/service/ISyMajorService.java

@@ -67,7 +67,7 @@ public interface ISyMajorService
     public int deleteSyMajorById(Long id);
 
 
-    List<SyMajor> selectPlanMajorList(SysUser user, Long universityId);
+    List<SyMajor> selectPlanMajorList(Integer planYear, SysUser user, Long universityId);
 
     public List<SyMajor> selectMajorsByPlan(String location);
 

+ 2 - 3
ie-system/src/main/java/com/ruoyi/sy/service/impl/SyMajorServiceImpl.java

@@ -119,9 +119,8 @@ public class SyMajorServiceImpl implements ISyMajorService
     }
 
     @Override
-    public List<SyMajor> selectPlanMajorList(SysUser user, Long universityId) {
-        DzControl dzControl = dzControlService.selectDzControl(user);
-        return syMajorMapper.selectSyMajorByPlan(dzControl.getPlanYear(), user.getExamType().title(), universityId, user.getLocation());
+    public List<SyMajor> selectPlanMajorList(Integer planYear, SysUser user, Long universityId) {
+        return syMajorMapper.selectSyMajorByPlan(planYear, user.getExamType().title(), universityId, user.getLocation());
     }
 
     @Override

+ 1 - 1
ie-system/src/main/resources/mapper/dz/DzAgentMapper.xml

@@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 AND (t1.dept_id = #{deptId} OR t1.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
             </if>
             <if test="teacherId != null ">
-                AND t1.agent_id in (select distinct t.agent_id  from `dz_teacher` t where t.`teacher_id` = 1 and t.agent_id is not null)
+                AND t1.agent_id in (select distinct t.agent_id  from `dz_teacher` t where t.`teacher_id` = #{teacherId} and t.agent_id is not null)
             </if>
             <if test="name != null  and name != ''"> and t1.name like concat('%', #{name}, '%')</if>
             <if test="phonenumber != null  and phonenumber != ''"> and t1.phonenumber  like concat('%', #{phonenumber}, '%')</if>

+ 1 - 1
ie-system/src/main/resources/mapper/sy/SyMajorMapper.xml

@@ -120,7 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <select id="selectSyMajorByPlan" resultMap="SyMajorResult">
-        SELECT mp.id, m.`type`, m.`code`, CONCAT(m.`name`, IF(mp.`majorDirection` = '', '', CONCAT('(', mp.`majorDirection`, ')'))) `name`, CONCAT(m2.`name`, '&gt;', m1.`name`) `ancestors`
+        SELECT mp.id, m.`type`, mp.`majorName` parent_code, mp.`majorGroup` exam_type, m.`code`, CONCAT(m.`name`, IF(mp.`majorDirection` = '', '', CONCAT('(', mp.`majorDirection`, ')'))) `name`, CONCAT(m2.`name`, '&gt;', m1.`name`) `ancestors`
         FROM `a_marjor_plan` mp
                  JOIN `sy_major` m ON mp.`majorName` = m.`name` AND mp.`level` = m.`type` AND IF(mp.`examineeType` = '职高对口升学', '职高对口升学', '单招(应届普高)') = m.`exam_type`
                  LEFT JOIN `sy_major` m1 ON m1.`code` = m.`parent_code` AND m1.`exam_type` = m.`exam_type` AND m1.type = m.type AND m1.level + 1 = m.level