he2802 %!s(int64=3) %!d(string=hai) anos
pai
achega
7a019b97af

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

@@ -1022,9 +1022,11 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
             //为模块搜索下面的章 和节 并搜索学时记录
             if (classPeriodVo.getType() == 1){
                 List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), bo.getGoodsId(),classPeriodVo.getCourseId(), bo.getUserId(),bo.getGradeId());
+                Collections.sort(classPeriodChapterVos);
                 for (ClassPeriodChapterVo classPeriodChapterVo : classPeriodChapterVos) {
                     if (classPeriodChapterVo.getType() == 2) {
                         List<ClassPeriodSectionVo> classPeriodSectionVos = baseMapper.listPeriodSection(classPeriodChapterVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId());
+                        Collections.sort(classPeriodSectionVos);
                         classPeriodSectionVos.addAll(baseMapper.listperiodExam(classPeriodChapterVo.getId(), bo.getGoodsId(),classPeriodVo.getCourseId(), bo.getUserId(),classPeriodVo.getId()));
                         for (ClassPeriodSectionVo classPeriodSectionVo : classPeriodSectionVos) {
                             if (classPeriodSectionVo.getType() == 3) {
@@ -1102,6 +1104,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
             //为章搜索节记录和学时记录
             if (classPeriodVo.getType() == 2){
                 List<ClassPeriodSectionVo> classPeriodSectionVos = baseMapper.listPeriodSection(classPeriodVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId());
+                Collections.sort(classPeriodSectionVos);
                 for (ClassPeriodSectionVo classPeriodSectionVo : classPeriodSectionVos) {
                     UserPeriodQueryBo userPeriodQueryBo = new UserPeriodQueryBo();
                     userPeriodQueryBo.setSectionId(classPeriodSectionVo.getId());

+ 8 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodChapterVo.java

@@ -17,7 +17,7 @@ import java.util.List;
  */
 @Data
 @ApiModel("学员视图对象")
-public class ClassPeriodChapterVo {
+public class ClassPeriodChapterVo implements Comparable<ClassPeriodChapterVo> {
 	private static final long serialVersionUID = 1L;
 
 	/** 学员ID */
@@ -92,5 +92,12 @@ public class ClassPeriodChapterVo {
 	@ApiModelProperty("以往审核记录")
 	private List<UserPeriodStatusVo> userPeriodStatusVos;
 
+	@ApiModelProperty("排序")
+	private Integer sort;
 
+
+	@Override
+	public int compareTo(ClassPeriodChapterVo o) {
+		return this.getSort() - o.getSort();
+	}
 }

+ 8 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodSectionVo.java

@@ -17,7 +17,7 @@ import java.util.List;
  */
 @Data
 @ApiModel("学员视图对象")
-public class ClassPeriodSectionVo {
+public class ClassPeriodSectionVo implements Comparable<ClassPeriodSectionVo> {
 	private static final long serialVersionUID = 1L;
 
 	/** 学员ID */
@@ -145,4 +145,11 @@ public class ClassPeriodSectionVo {
 	@ApiModelProperty("节时长(分钟)")
 	private Long durationTime;
 
+	@ApiModelProperty("sort")
+	private Integer sort;
+
+	@Override
+	public int compareTo(ClassPeriodSectionVo o) {
+		return this.getSort() - o.getSort();
+	}
 }

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

@@ -136,6 +136,7 @@
         <result property="type" column="type"/>
         <result property="studyEndTime" column="study_end_time"/>
         <result property="performance" column="performance"/>
+        <result property="sort" column="sort"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodSectionVo" id="ClassPeriodSectionVo">
@@ -151,6 +152,7 @@
         <result property="type" column="type"/>
         <result property="studyEndTime" column="study_end_time"/>
         <result property="auditNum" column="audit_num"/>
+        <result property="sort" column="sort"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.course.vo.CourseChapterVo" id="CourseChapterResultVo">
@@ -628,6 +630,7 @@
 
     <select id="listperiodChapter" parameterType="map" resultMap="ClassPeriodChapterVo">
         SELECT
+          ccs.sort,
         cc.chapter_id as id,
         cm.course_id,
         ( SELECT u.realname FROM `user` u WHERE 1=1 <if test="userId != null and userId !='' ">
@@ -770,6 +773,7 @@
 
     <select id="listPeriodSection" parameterType="map" resultMap="ClassPeriodSectionVo">
         SELECT
+        ccs.sort,
         cs.section_id AS id,
         #{courseId} AS course_id,
         ( SELECT u.realname FROM `user` u WHERE 1 = 1 <if test="userId != null and userId !='' ">