change 3 anni fa
parent
commit
678fc3e905
19 ha cambiato i file con 137 aggiunte e 109 eliminazioni
  1. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseSubjectQueryBo.java
  2. 25 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSubjectServiceImpl.java
  3. 22 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java
  4. 10 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodChapterVo.java
  5. 6 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodVo.java
  6. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformCourseAddBo.java
  7. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformCourseEditBo.java
  8. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformCourseQueryBo.java
  9. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformExamAddBo.java
  10. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformExamEditBo.java
  11. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformExamQueryBo.java
  12. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/domain/InformExam.java
  13. 5 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/impl/InformServiceImpl.java
  14. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/vo/InformExamVo.java
  15. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/vo/InformUserVo.java
  16. 11 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/vo/InformVo.java
  17. 3 0
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseSubjectMapper.xml
  18. 4 103
      zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml
  19. 7 2
      zhongzheng-system/src/main/resources/mapper/modules/grade/UserPeriodStatusMapper.xml

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseSubjectQueryBo.java

@@ -38,6 +38,10 @@ public class CourseSubjectQueryBo extends BaseEntity {
 	private String isAsc;
 
 
+
+	/** id */
+	@ApiModelProperty("id")
+	private Long id;
 	/** 编码KM */
 	@ApiModelProperty("编码KM")
 	private String encoder;

+ 25 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSubjectServiceImpl.java

@@ -2,6 +2,7 @@ package com.zhongzheng.modules.course.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.course.bo.*;
@@ -87,6 +88,15 @@ public class CourseSubjectServiceImpl extends ServiceImpl<CourseSubjectMapper, C
 
     @Override
     public Boolean insertByAddBo(CourseSubjectAddBo bo) {
+        CourseSubjectQueryBo courseSubjectQueryBo = new CourseSubjectQueryBo();
+        courseSubjectQueryBo.setSubjectName(bo.getSubjectName());
+        List<Integer> status = new ArrayList<>();
+        status.add(1);
+        courseSubjectQueryBo.setStatus(status);
+        Collection<CourseSubjectVo> courseSubjectVos = baseMapper.queryList(courseSubjectQueryBo);
+        if (CollectionUtils.isNotEmpty(courseSubjectVos)){
+            throw new RuntimeException("重复科目名称");
+        }
         CourseSubject add = BeanUtil.toBean(bo, CourseSubject.class);
         validEntityBeforeSave(add);
         add.setEncoder(ServletUtils.getEncoded("KM"));
@@ -104,6 +114,21 @@ public class CourseSubjectServiceImpl extends ServiceImpl<CourseSubjectMapper, C
 
     @Override
     public Boolean updateByEditBo(CourseSubjectEditBo bo) {
+        CourseSubjectQueryBo courseSubjectQueryBo = new CourseSubjectQueryBo();
+        courseSubjectQueryBo.setSubjectName(bo.getSubjectName());
+        courseSubjectQueryBo.setId(bo.getId());
+        Collection<CourseSubjectVo> courseSubjectVos = baseMapper.queryList(courseSubjectQueryBo);
+        if (CollectionUtils.isNotEmpty(courseSubjectVos)){
+            CourseSubjectQueryBo courseSubjectQuery = new CourseSubjectQueryBo();
+            courseSubjectQueryBo.setSubjectName(bo.getSubjectName());
+            List<Integer> status = new ArrayList<>();
+            status.add(1);
+            courseSubjectQueryBo.setStatus(status);
+            Collection<CourseSubjectVo> courseSubjectVo = baseMapper.queryList(courseSubjectQuery);
+            if (CollectionUtils.isNotEmpty(courseSubjectVo)){
+                throw new RuntimeException("重复科目名称");
+            }
+        }
         CourseSubject update = BeanUtil.toBean(bo, CourseSubject.class);
         validEntityBeforeSave(update);
         update.setUpdateTime(DateUtils.getNowTime());

+ 22 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -3,6 +3,7 @@ package com.zhongzheng.modules.grade.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
 import com.zhongzheng.common.utils.DateUtils;
+import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
 import com.zhongzheng.modules.grade.service.IUserPeriodStatusService;
 import com.zhongzheng.modules.grade.vo.*;
 import com.zhongzheng.modules.user.bo.SubjectStudyRecordQueryBo;
@@ -188,15 +189,33 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), bo.getGoodsId(),classPeriodVo.getCourseId(), bo.getUserId());
                 classPeriodChapterVos.addAll(baseMapper.listperiodExam(classPeriodVo.getId(), bo.getGoodsId(),classPeriodVo.getCourseId(), bo.getUserId()));
                 for (ClassPeriodChapterVo classPeriodChapterVo : classPeriodChapterVos) {
-                    List<ClassPeriodSectionVo> classPeriodSectionVos = baseMapper.listPeriodSection(classPeriodChapterVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId());
-                    classPeriodChapterVo.setClassPeriodSectionList(classPeriodSectionVos);
+                    if (classPeriodChapterVo.getType() == 4){
+                        UserPeriodQueryBo userPeriodQueryBo = new UserPeriodQueryBo();
+                        userPeriodQueryBo.setExamId(classPeriodChapterVo.getId());
+                        userPeriodQueryBo.setCourseId(classPeriodChapterVo.getCourseId());
+                        userPeriodQueryBo.setGoodsId(bo.getGoodsId());
+                        classPeriodChapterVo.setUserPeriodStatusVos(userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo));
+                    }
+                    if (classPeriodChapterVo.getType() == 2) {
+                        List<ClassPeriodSectionVo> classPeriodSectionVos = baseMapper.listPeriodSection(classPeriodChapterVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId());
+                        for (ClassPeriodSectionVo classPeriodSectionVo : classPeriodSectionVos) {
+                            UserPeriodQueryBo userPeriodQueryBo = new UserPeriodQueryBo();
+                            userPeriodQueryBo.setSectionId(classPeriodSectionVo.getId());
+                            userPeriodQueryBo.setCourseId(classPeriodSectionVo.getCourseId());
+                            userPeriodQueryBo.setGoodsId(bo.getGoodsId());
+                            userPeriodQueryBo.setChapterId(classPeriodChapterVo.getId());
+                            userPeriodQueryBo.setModuleId(classPeriodVo.getId());
+                            classPeriodSectionVo.setUserPeriodStatusVos(userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo));
+                        }
+                        classPeriodChapterVo.setClassPeriodSectionList(classPeriodSectionVos);
+                    }
                 }
-
                 classPeriodVo.setClassPeriods(classPeriodChapterVos);
             }
             if (classPeriodVo.getType() == 2){
                 List<ClassPeriodSectionVo> classPeriodSectionVos = baseMapper.listPeriodSection(classPeriodVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId());
                 classPeriodSectionVos.addAll(baseMapper.listPeriodSectionExam(classPeriodVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId()));
+
                 classPeriodVo.setClassPeriodSectionList(classPeriodSectionVos);
             }
         }

+ 10 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodChapterVo.java

@@ -25,6 +25,11 @@ public class ClassPeriodChapterVo {
 	@ApiModelProperty("学员ID")
 	private Long userId;
 
+	/** 课程ID */
+	@Excel(name = "课程ID")
+	@ApiModelProperty("课程ID")
+	private Long courseId;
+
 	/**  */
 	@Excel(name = "id")
 	@ApiModelProperty("id")
@@ -82,5 +87,10 @@ public class ClassPeriodChapterVo {
 	@ApiModelProperty("章下面得节")
 	private List<ClassPeriodSectionVo> classPeriodSectionList;
 
+	/** 审核数量*/
+	@Excel(name = "以往审核记录")
+	@ApiModelProperty("以往审核记录")
+	private List<UserPeriodStatusVo> userPeriodStatusVos;
+
 
 }

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodVo.java

@@ -87,4 +87,10 @@ public class ClassPeriodVo {
 	private List<ClassPeriodSectionVo> classPeriodSectionList;
 
 
+	/** 审核数量*/
+	@Excel(name = "以往审核记录")
+	@ApiModelProperty("以往审核记录")
+	private List<UserPeriodStatusVo> userPeriodStatusVos;
+
+
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformCourseAddBo.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.modules.inform.bo;
 
+import com.zhongzheng.common.annotation.Excel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -42,4 +43,8 @@ public class InformCourseAddBo {
     /** 题目位置 */
     @ApiModelProperty("题目位置")
     private Long topicNum;
+
+    @Excel(name = "商品ID")
+    @ApiModelProperty("商品ID")
+    private Long goodsId;
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformCourseEditBo.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.modules.inform.bo;
 
+import com.zhongzheng.common.annotation.Excel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -46,4 +47,8 @@ public class InformCourseEditBo {
     @ApiModelProperty("章ID")
     private Long chapterId;
 
+    @Excel(name = "商品ID")
+    @ApiModelProperty("商品ID")
+    private Long goodsId;
+
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformCourseQueryBo.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.modules.inform.bo;
 
+import com.zhongzheng.common.annotation.Excel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -51,4 +52,8 @@ public class InformCourseQueryBo extends BaseEntity {
 	/** 章ID */
 	@ApiModelProperty("章ID")
 	private Long chapterId;
+
+	@Excel(name = "商品ID")
+	@ApiModelProperty("商品ID")
+	private Long goodsId;
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformExamAddBo.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.modules.inform.bo;
 
+import com.zhongzheng.common.annotation.Excel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -42,4 +43,8 @@ public class InformExamAddBo {
     /** 题目位置 */
     @ApiModelProperty("题目位置")
     private Long topicNum;
+
+    @Excel(name = "商品ID")
+    @ApiModelProperty("商品ID")
+    private Long goodsId;
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformExamEditBo.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.modules.inform.bo;
 
+import com.zhongzheng.common.annotation.Excel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -46,4 +47,8 @@ public class InformExamEditBo {
     @ApiModelProperty("章ID")
     private Long chapterId;
 
+    @Excel(name = "商品ID")
+    @ApiModelProperty("商品ID")
+    private Long goodsId;
+
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformExamQueryBo.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.modules.inform.bo;
 
+import com.zhongzheng.common.annotation.Excel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -51,4 +52,7 @@ public class InformExamQueryBo extends BaseEntity {
 	/** 章ID */
 	@ApiModelProperty("章ID")
 	private Long chapterId;
+	@Excel(name = "商品ID")
+	@ApiModelProperty("商品ID")
+	private Long goodsId;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/domain/InformExam.java

@@ -1,6 +1,7 @@
 package com.zhongzheng.modules.inform.domain;
 
 import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
@@ -44,4 +45,6 @@ private static final long serialVersionUID=1L;
     private Long chapterId;
     /** 题目位置 */
     private Long topicNum;
+
+    private Long goodsId;
 }

+ 5 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/impl/InformServiceImpl.java

@@ -138,6 +138,10 @@ public class InformServiceImpl extends ServiceImpl<InformMapper, Inform> impleme
 
     @Override
     public List<InformVo> listInform(InformQueryBo bo) {
-        return baseMapper.listInform(bo);
+        List<InformVo> informVos = baseMapper.listInform(bo);
+        for (InformVo informVo : informVos) {
+
+        }
+        return informVos;
     }
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/vo/InformExamVo.java

@@ -48,4 +48,8 @@ public class InformExamVo {
 	@Excel(name = "题目位置")
 	@ApiModelProperty("题目位置")
 	private Long topicNum;
+
+	@Excel(name = "商品ID")
+	@ApiModelProperty("商品ID")
+	private Long goodsId;
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/vo/InformUserVo.java

@@ -53,6 +53,10 @@ public class InformUserVo {
 	@ApiModelProperty("电话")
 	private String telPhone;
 
+	@Excel(name = "商品ID")
+	@ApiModelProperty("商品ID")
+	private Long goodsId;
+
 
 	@Excel(name = "班级名称")
 	@ApiModelProperty("班级名称")

+ 11 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/vo/InformVo.java

@@ -87,6 +87,17 @@ public class InformVo {
 	@Excel(name = "已读人数")
 	@ApiModelProperty("已读人数")
 	private Long receiptNum;
+
+	/** 绑定试卷*/
+	@Excel(name = "绑定试卷")
+	@ApiModelProperty("绑定试卷")
+	private InformExamVo informExamVo;
+
+	/** 绑定课程*/
+	@Excel(name = "绑定课程")
+	@ApiModelProperty("绑定课程")
+	private InformCourseVo informCourseVo;
+
 }
 
 

+ 3 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseSubjectMapper.xml

@@ -87,6 +87,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="wrong != null and wrong!=0 ">
               and (select COUNT(v.id) FROM course_subject_project v where s.id=v.subject_id) = 0
         </if>
+        <if test="id != null and id!='' ">
+            and s.id = #{id}
+        </if>
         order by s.update_time desc
     </select>
 

+ 4 - 103
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -95,6 +95,7 @@
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodChapterVo" id="ClassPeriodChapterVo">
         <result property="userId" column="user_id"/>
         <result property="id" column="id"/>
+        <result property="courseId" column="course_id"/>
         <result property="typeName" column="type_name"/>
         <result property="realName" column="realname"/>
         <result property="classHours" column="class_hours"/>
@@ -417,108 +418,6 @@
         AND cm.type=3
     </select>
 
-    <select id="listPeriodAuditSection" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
-            resultMap="ClassPeriodVo">
-        SELECT
-        cm.menu_id as id,
-        cm.course_id,
-        (SELECT u.realname FROM `user` u where 1=1
-        <if test="userId != null and userId !='' ">
-            and u.user_id = #{userId}
-        </if>
-        ) as realname,
-        (SELECT u.user_id FROM `user` u where 1=1
-        <if test="userId != null and userId !='' ">
-            and u.user_id = #{userId}
-        </if>
-        ) as user_id,
-        (SELECT cs.`name` FROM course_section cs where cm.menu_id = cs.section_id) as type_name,
-        null as class_hours,
-        3 as type,
-        (
-        SELECT
-        ups.record_start_time
-        FROM
-        user_period_status ups
-        LEFT JOIN user_period up ON up.id = ups.period_id
-        WHERE
-        period_status = 1
-        AND up.course_id = gc.course_id
-        <if test="goodsId != null and goodsId !='' ">
-            AND up.goods_id = #{goodsId}
-        </if>
-
-        AND up.section_id = cm.menu_id
-
-        ) AS study_start_time,
-        (
-        SELECT
-        ups.record_end_time
-        FROM
-        user_period_status ups
-        LEFT JOIN user_period up ON up.id = ups.period_id
-        WHERE
-        period_status = 1
-
-        AND up.course_id = gc.course_id
-
-        <if test="goodsId != null and goodsId !='' ">
-            AND up.goods_id = #{goodsId}
-        </if>
-        AND up.section_id = cm.menu_id
-        ) AS study_end_time,
-        (
-        SELECT
-        ups.`status`
-        FROM
-        user_period_status ups
-        LEFT JOIN user_period up ON up.id = ups.period_id
-        WHERE
-        period_status = 1
-        AND up.course_id = gc.course_id
-        <if test="goodsId != null and goodsId !='' ">
-            AND up.goods_id = #{goodsId}
-        </if>
-        AND up.section_id = cm.menu_id
-        ) AS STATUS,
-        (
-        SELECT
-        ups.create_time
-        FROM
-        user_period_status ups
-        LEFT JOIN user_period up ON up.id = ups.period_id
-        WHERE
-        period_status = 1
-        AND up.course_id = gc.course_id
-        <if test="goodsId != null and goodsId !='' ">
-            AND up.goods_id = #{goodsId}
-        </if>
-        AND up.section_id = cm.menu_id
-        ) AS audit_time,
-        (
-        SELECT
-        COUNT( ups.id )
-        FROM
-        user_period_status ups
-        LEFT JOIN user_period up ON up.id = ups.period_id
-        WHERE
-        period_status = 1
-        AND up.course_id = gc.course_id
-        <if test="goodsId != null and goodsId !='' ">
-            AND up.goods_id = #{goodsId}
-        </if>
-        AND up.section_id = cm.menu_id
-        ) AS audit_num
-        FROM
-        course_menu cm
-        LEFT JOIN goods_course gc on gc.course_id = cm.course_id
-        where 1=1
-        <if test="goodsId != null and goodsId !='' ">
-            and gc.goods_id = #{goodsId}
-        </if>
-        AND cm.type=3
-    </select>
-
     <select id="listPeriodAuditExam"  parameterType="map" resultMap="ClassPeriodChapterVo">
         SELECT
         cme.exam_id as id,
@@ -618,7 +517,9 @@
         LEFT JOIN goods_course gc on gc.course_id = cme.course_id
         LEFT JOIN course_menu cm on cme.section_id = cm.menu_id
         where 1=1
-        and gc.goods_id=11
+        <if test="goodsId != null and goodsId !='' ">
+            and gc.goods_id= #{goodsId}
+        </if>
         AND cm.type=3 and cme.chapter_id=0 and cme.module_id=0 and cme.type=1 and cm.type=3
     </select>
 

+ 7 - 2
zhongzheng-system/src/main/resources/mapper/modules/grade/UserPeriodStatusMapper.xml

@@ -38,8 +38,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="chapterId != null and chapterId != ''">
             up.chapter_id = #{chapterId}
         </if>
-          AND ups.period_status = 2
+        <if test="courseId != null and courseId != ''">
+            up.course_id = #{courseId}
+        </if>
+        <if test="examId != null and examId != ''">
+            up.exam_id = #{examId}
+        </if>
         ORDER BY
-            ups.create_time DESC
+            ups.create_time asc
     </select>
 </mapper>