浏览代码

增加notice等调整

mingfu 1 月之前
父节点
当前提交
04c3085b92

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

@@ -169,13 +169,13 @@ public class FrontStudentController extends BaseController {
     public AjaxResult saveStudySchool(@RequestBody JSONArray directionStudy) {
         SysUser user = new SysUser();
         user.setUserId(SecurityUtils.getLoginUser().getUserId());
-        user.setDirectedStudy(directionStudy.toJSONString());
         if(!directionStudy.isEmpty()) {
             JSONObject directed = directionStudy.getJSONObject(0);
             Long planId = directed.getLongValue("majorId");
             Long universityId = directed.getLongValue("universityId");
-            learnTeacherService.updateDirected(user.getUserId(), universityId, planId);
+            directed.put("notice", learnTeacherService.updateDirected(user.getUserId(), universityId, planId));
         }
+        user.setDirectedStudy(directionStudy.toJSONString());
         return sysUserService.updateUserProfile(user) > 0 ? AjaxResult.success("更新成功") : AjaxResult.success("无更新");
     }
 

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

@@ -286,7 +286,7 @@ public class LearnTeacherService {
         return buildTree(ktList, knowledgeIdSet, knowCountMap);
     }
 
-    public void updateDirected(Long studentId, Long universityId, Long planId) {
+    public String updateDirected(Long studentId, Long universityId, Long planId) {
         LearnStudent upStudent = new LearnStudent();
         upStudent.setStudentId(studentId);
         upStudent.setUniversityId(universityId);
@@ -302,12 +302,17 @@ public class LearnTeacherService {
         Map<String, LearnDirectedKnowledge> directedKnowledgeMap = learnDirectedKnowledgeMapper.selectLearnDirectedKnowledgeList(dkCond).stream().collect(Collectors.toMap(LearnDirectedKnowledge::getDirectKey, t -> t));
         LearnDirectedKnowledge directedKnowledge = null;
         String groupName = StringUtils.trimToEmpty(plan.getMajorGroup());
+        String modules = null;
         if(null != (directedKnowledge = directedKnowledgeMap.get(groupName + "_" + plan.getMajorName()))) {
             upStudent.setDirectKey(directedKnowledge.getDirectKey());
+            modules = directedKnowledge.getModules();
         } else if(null != (directedKnowledge = directedKnowledgeMap.get(groupName))) {
             upStudent.setDirectKey(directedKnowledge.getDirectKey());
+            modules = directedKnowledge.getModules();
         }
         learnStudentMapper.updateLearnStudent(upStudent);
+        Set<String> moduleSet = Sets.newHashSet(StringUtils.trimToEmpty(modules).split(","));
+        return moduleSet.size() == 1 && moduleSet.contains("技能展示") ? "专业只考技能展示" : "";
     }
 
     public Set<Long> getSubjectIdSet(Long[] planIds) {

+ 2 - 0
ie-admin/src/main/java/com/ruoyi/web/service/PaperService.java

@@ -83,6 +83,7 @@ public class PaperService {
                 PaperVO.QuestionSeq qg = gropuMap.get(lqs.getTitle0());
                 if(qg == null) {
                     qg = new PaperVO.QuestionSeq();
+                    qg.setTypeId(99);
                     qg.setSubQuestions(Lists.newArrayList());
                     qg.setTitle(lqs.getTitle0());
                     gropuMap.put(lqs.getTitle0(), qg);
@@ -122,6 +123,7 @@ public class PaperService {
                 PaperVO.QuestionAnswer qg = gropuMap.get(lqs.getTitle0());
                 if(qg == null) {
                     qg = new PaperVO.QuestionAnswer();
+                    qg.setTypeId(99);
                     qg.setSubQuestions(Lists.newArrayList());
                     qg.setTitle(lqs.getTitle0());
                     gropuMap.put(lqs.getTitle0(), qg);

+ 11 - 0
ie-system/src/main/java/com/ruoyi/learn/domain/LearnDirectedKnowledge.java

@@ -65,6 +65,9 @@ public class LearnDirectedKnowledge extends BaseEntity
     @Excel(name = "仿真模拟卷要求")
     private String conditions;
 
+    @Excel(name = "包含模块")
+    private String modules;
+
     public void setId(Long id) 
     {
         this.id = id;
@@ -193,6 +196,14 @@ public class LearnDirectedKnowledge extends BaseEntity
         return conditions;
     }
 
+    public String getModules() {
+        return modules;
+    }
+
+    public void setModules(String modules) {
+        this.modules = modules;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 5 - 1
ie-system/src/main/resources/mapper/learn/LearnDirectedKnowledgeMapper.xml

@@ -18,10 +18,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="locations"    column="locations"    />
         <result property="examineeTypes"    column="examineeTypes"    />
         <result property="conditions"    column="conditions"    />
+        <result property="modules"    column="modules"    />
     </resultMap>
 
     <sql id="selectLearnDirectedKnowledgeVo">
-        select id, year, university_id, direct_key, enrollFormula, cultural, professional, subjects, question_types, knowledges, locations, examineeTypes, conditions from learn_directed_knowledge
+        select id, year, university_id, direct_key, enrollFormula, cultural, professional, subjects, question_types, knowledges, locations, examineeTypes, conditions,modules from learn_directed_knowledge
     </sql>
 
     <select id="selectLearnDirectedKnowledgeList" parameterType="LearnDirectedKnowledge" resultMap="LearnDirectedKnowledgeResult">
@@ -67,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="locations != null">locations,</if>
             <if test="examineeTypes != null">examineeTypes,</if>
             <if test="conditions != null">conditions,</if>
+            <if test="modules != null">modules,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="year != null">#{year},</if>
@@ -81,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="locations != null">#{locations},</if>
             <if test="examineeTypes != null">#{examineeTypes},</if>
             <if test="conditions != null">#{conditions},</if>
+            <if test="modules != null">#{modules},</if>
          </trim>
     </insert>
 
@@ -99,6 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="locations != null">locations = #{locations},</if>
             <if test="examineeTypes != null">examineeTypes = #{examineeTypes},</if>
             <if test="conditions != null">conditions = #{conditions},</if>
+            <if test="modules != null">modules = #{modules},</if>
         </trim>
         where id = #{id}
     </update>

+ 3 - 3
ie-system/src/main/resources/mapper/learn/LearnQuestionsMapper.xml

@@ -280,7 +280,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         FROM `learn_knowledge_question` kq
         LEFT JOIN `learn_answer` a ON kq.`question_id` = a.`question_id` AND a.`student_id` = #{studentId}
         JOIN `learn_questions` q ON q.`id` = kq.`question_id`
-        <where>
+        <where> kq.sub = 0
             <if test="knowIds != null"> and kq.`knowledge_id` in <foreach item="id" collection="knowIds" open="(" separator="," close=")">#{id}</foreach></if>
             <if test="types != null"> and q.`qtpye` in <foreach item="id" collection="types" open="(" separator="," close=")">#{id}</foreach></if>
         </where>
@@ -294,7 +294,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
              LEFT JOIN `learn_answer` a ON kq.`question_id` = a.`question_id` AND a.`student_id` = #{studentId}
          </if>
          JOIN `learn_questions` q ON q.`id` = kq.`question_id`
-        <where>
+        <where> kq.sub = 0
             <if test="knowIds != null"> and kq.`knowledge_id` in <foreach item="id" collection="knowIds" open="(" separator="," close=")">#{id}</foreach></if>
             <if test="types != null"> and q.`qtpye` in <foreach item="id" collection="types" open="(" separator="," close=")">#{id}</foreach></if>
             <if test="studentId != null"> AND a.`student_id` IS NULL</if>
@@ -309,7 +309,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             LEFT JOIN `learn_answer` a ON kq.`question_id` = a.`question_id` AND a.`student_id` = #{id}
         </if>
         JOIN `learn_questions` q ON q.`id` = kq.`question_id`
-        <where>
+        <where> kq.sub = 0
             <if test="qtpye != null  and qtpye != ''"> and qtpye = #{qtpye}</if>
             <if test="id != null ">  AND a.`student_id` IS NULL</if>
             <if test="knowledgeId != null "> and kq.knowledge_id  = #{knowledgeId}</if>