Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/dev' into dev

pans 6 mesi fa
parent
commit
97f5ee1dc1

+ 22 - 0
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/controller/CourseClassHourController.java

@@ -119,6 +119,17 @@ public class CourseClassHourController {
         List<CourseRelate> courseRelates = classHourAddParam.getCourseRelates();
         if(courseRelates!=null && courseRelates.size()>0)
         {
+            //2025.8.15,应爽哥要求,考试试卷关联过的要更新一个状态,使其下次不能被选中
+            for(CourseRelate one:courseRelates)
+            {
+                if(one.getFuncType().equals("4")||one.getFuncType().equals("5"))
+                {
+                    Map upPaperSelectParam =new HashMap();
+                    upPaperSelectParam.put("id", one.getRelateId());
+                    upPaperSelectParam.put("isSelect", "1");
+                    classHourService.updatePaperSelect(upPaperSelectParam);
+                }
+            }
             courseRelates = courseRelates.stream()
                     .peek(oneCourseRelate -> oneCourseRelate.setChapterhourType("1")) // 修改属性
                     .peek(oneCourseRelate -> oneCourseRelate.setMainId(classHour.getId())) // 修改属性
@@ -167,6 +178,17 @@ public class CourseClassHourController {
             List<CourseRelate> delCourseRelateList=courseRelateService.wrapperList(relateParam);
             List<String> delCourseRelateIdList=CollStreamUtil.toList(delCourseRelateList, CourseRelate::getId);
             courseRelateService.deleteByIdsReal(delCourseRelateIdList);
+            //2025.8.15,应爽哥要求,考试试卷关联过的要更新一个状态,使其下次不能被选中
+            for(CourseRelate one:courseRelates)
+            {
+                if(one.getFuncType().equals("4")||one.getFuncType().equals("5"))
+                {
+                    Map upPaperSelectParam =new HashMap();
+                    upPaperSelectParam.put("id", one.getRelateId());
+                    upPaperSelectParam.put("isSelect", "1");
+                    classHourService.updatePaperSelect(upPaperSelectParam);
+                }
+            }
             courseRelates = courseRelates.stream()
                     .peek(oneCourseRelate -> oneCourseRelate.setChapterhourType("1"))
                     .peek(oneCourseRelate -> oneCourseRelate.setMainId(classHour.getId())) // 修改属性

+ 5 - 0
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/controller/CourseInfoController.java

@@ -14,6 +14,7 @@ package vip.xiaonuo.disk.controller;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.IdUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -358,7 +359,11 @@ public class CourseInfoController {
         //1.添加课程信息
         CourseInfo newCourseInfo=new CourseInfo();
         BeanUtil.copyProperties(courseInfo, newCourseInfo);
+        newCourseInfo.setCourseName(courseInfo.getCourseName()+"-复制-"+ DateUtil.format(new Date(), "yyyy-MM-dd"));
         newCourseInfo.setCourseId(null);
+        newCourseInfo.setPutawayStatus("0");
+        newCourseInfo.setCreateTime(null);
+        newCourseInfo.setCreateUser(null);
         newCourseInfo=courseInfoService.addOne(newCourseInfo);
         //2.添加章节和对应课时信息,以及关联信息
         //预添加章节列表

+ 16 - 5
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/controller/CourseQuestionAnswerController.java

@@ -215,15 +215,26 @@ public class CourseQuestionAnswerController {
     public CommonResult<Map<String,Object>> detail(@Valid QuestionAnswerIdParam questionAnswerIdParam, HttpServletRequest req) {
         Map param =new HashMap();
         param.put("id", req.getParameter("id"));
-        Map<String,Object> result=questionAnswerService.queryInfo(param);
+        Map<String,Object> result=new HashMap<>();
+        Map<String,Object> studentAnswer=questionAnswerService.queryInfo(param);
         param.clear();
         param.put("isPid", "0");
         param.put("pid", req.getParameter("id"));
-        //查询二级评论问题
-        List<Map<String, Object>> recordChildList = new ArrayList<>();
+//        result=studentAnswer;
+//        //查询二级评论问题
+//        List<Map<String, Object>> recordChildList = new ArrayList<>();
+//        List<Map<String,Object>> recordTwoList=questionAnswerService.queryMapList(param);
+//        recordChildList.addAll(recordTwoList);
+//        result.put("recordChildList", recordChildList);
+        //原来是父子级,现在变成一个list
+        param.clear();
+        param.put("isPid", "0");
+        param.put("pid", req.getParameter("id"));
+        List<Map<String, Object>> recordList = new ArrayList<>();
         List<Map<String,Object>> recordTwoList=questionAnswerService.queryMapList(param);
-        recordChildList.addAll(recordTwoList);
-        result.put("recordChildList", recordChildList);
+        recordList.add(studentAnswer);
+        recordList.addAll(recordTwoList);
+        result.put("recordList", recordList);
         return CommonResult.data(result);
     }
 

+ 2 - 0
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/ClassHourMapper.java

@@ -51,4 +51,6 @@ public interface ClassHourMapper extends BaseMapper<ClassHour> {
      * 课程章节-详情
      */
     Map<String,Object> queryInfo(Map param);
+
+    int updateByPrimaryKeySelective(Map param);
 }

+ 52 - 1
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/mapping/ClassHourMapper.xml

@@ -1,7 +1,58 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="vip.xiaonuo.disk.mapper.ClassHourMapper">
-   <select id="page" resultType="vip.xiaonuo.disk.vo.classhour.ClassHourVo">
+    <update id="updateByPrimaryKeySelective">
+        update t_exam_paper
+        <set>
+            <if test="name != null">
+                name = #{name,jdbcType=VARCHAR},
+            </if>
+            <if test="subjectId != null">
+                subject_id = #{subjectId,jdbcType=INTEGER},
+            </if>
+            <if test="paperType != null">
+                paper_type = #{paperType,jdbcType=INTEGER},
+            </if>
+            <if test="gradeLevel != null">
+                grade_level = #{gradeLevel,jdbcType=INTEGER},
+            </if>
+            <if test="score != null">
+                score = #{score,jdbcType=INTEGER},
+            </if>
+            <if test="questionCount != null">
+                question_count = #{questionCount,jdbcType=INTEGER},
+            </if>
+            <if test="suggestTime != null">
+                suggest_time = #{suggestTime,jdbcType=INTEGER},
+            </if>
+            <if test="limitStartTime != null">
+                limit_start_time = #{limitStartTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="limitEndTime != null">
+                limit_end_time = #{limitEndTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="frameTextContentId != null">
+                frame_text_content_id = #{frameTextContentId,jdbcType=INTEGER},
+            </if>
+            <if test="createUser != null">
+                create_user = #{createUser,jdbcType=INTEGER},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="deleted != null">
+                deleted = #{deleted,jdbcType=BIT},
+            </if>
+            <if test="taskExamId != null">
+                task_exam_id = #{taskExamId,jdbcType=INTEGER},
+            </if>
+            <if test="isSelect != null">
+                IS_SELECT = #{isSelect,jdbcType=INTEGER}
+            </if>
+        </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="page" resultType="vip.xiaonuo.disk.vo.classhour.ClassHourVo">
        SELECT
            a."id",
            a."start_time",

+ 2 - 2
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/mapping/CourseInfoMapper.xml

@@ -167,7 +167,7 @@
             and ci.COURSE_TYPE=#{param.courseType}
         </if>
         <if test="param.courseName !=null and param.courseName != ''">
-            and ci.COURSE_NAME=#{param.courseName}
+            and ci.COURSE_NAME like CONCAT('%', #{param.courseName}, '%')
         </if>
         <if test="param.beginTime != null and param.beginTime != ''">
             AND ci.PUBLISH_TIME &gt;= #{param.beginTime}
@@ -269,7 +269,7 @@
             and ci.COURSE_TYPE=#{param.courseType}
         </if>
         <if test="param.courseName !=null and param.courseName != ''">
-            and ci.COURSE_NAME=#{param.courseName}
+            and ci.COURSE_NAME like CONCAT('%', #{param.courseName}, '%')
         </if>
         <if test="param.beginTime != null and param.beginTime != ''">
             AND ci.PUBLISH_TIME &gt;= #{param.beginTime}

+ 4 - 0
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/service/ClassHourService.java

@@ -128,4 +128,8 @@ public interface ClassHourService extends IService<ClassHour> {
      */
     Map<String,Object> queryInfo(Map param);
 
+    /**
+     *  更新试卷状态
+     */
+    void updatePaperSelect(Map param);
 }

+ 6 - 0
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/service/impl/ClassHourServiceImpl.java

@@ -151,6 +151,12 @@ public class ClassHourServiceImpl extends ServiceImpl<ClassHourMapper, ClassHour
         return classHourMapper.queryInfo(param);
     }
 
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void updatePaperSelect(Map param) {
+
+        classHourMapper.updateByPrimaryKeySelective(param);
+    }
 
 
 }

+ 2 - 0
snowy-plugin/snowy-plugin-exam/snowy-plugin-exam-func/src/main/java/vip/xiaonuo/exam/service/TExamService.java

@@ -57,6 +57,8 @@ public interface TExamService extends IService<TExam> {
      */
     CommonResult<String> edit(TExamEditParam tExamEditParam);
 
+    void updateSelect(TExamEditParam tExamEditParam);
+
     /**
      * 删除考试表
      *

+ 11 - 0
snowy-plugin/snowy-plugin-exam/snowy-plugin-exam-func/src/main/java/vip/xiaonuo/exam/service/impl/TExamServiceImpl.java

@@ -249,6 +249,17 @@ public class TExamServiceImpl extends ServiceImpl<TExamMapper, TExam> implements
         return CommonResult.ok();
     }
 
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void updateSelect(TExamEditParam tExamEditParam) {
+
+        ExamPaper newExamPaper=new ExamPaper();
+        newExamPaper=new ExamPaper();
+        newExamPaper.setId(Integer.valueOf(tExamEditParam.getPaperId()));
+        newExamPaper.setIsSelect(1);
+        examPaperMapper.updateByPrimaryKeySelective(newExamPaper);
+    }
+
     @Transactional(rollbackFor = Exception.class)
     @Override
     public void delete(List<TExamIdParam> tExamIdParamList) {