change 4 年 前
コミット
8b25b8c778

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserPlanQueryBo.java

@@ -74,6 +74,6 @@ public class UserPlanQueryBo extends BaseEntity {
 
 	/** 定制的课程 */
 	@ApiModelProperty("定制的课程")
-	private Integer courseId;
+	private Integer[] courseId;
 
 }

+ 5 - 5
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserPlanServiceImpl.java

@@ -208,7 +208,6 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
 
         //最近考试时间七天前到现在的天数,学习视频时长
         Date date1 = new Date(examArrangementTimeVo.getStartTime()*1000L);
-        System.out.println(date1.getTime());
         //获得相隔天数
         Long[] longs ={1L,2L,3L,4L,5L,6L};
         int dutyDays = getDutyDays(new Date(), date1,longs,7L);
@@ -246,18 +245,18 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
                     if (sectionNum == 0){
                         break;
                     }
-                    if (Sec > sectionNum) {
+                    if (Sec < sectionNum) {
                         dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
                         sectionNum = sectionNum-Sec;
-                    }else if (Sec <= sectionNum){
+                    }else if (Sec >= sectionNum){
                         dayStudyVo.setStudyCourseKnob(Convert.toLong(sectionNum));
                         sectionNum = 0;
                     }
                 }else if(month != (cal.get(Calendar.MONTH) + 1) && ifTrue(dayStudyVo.getStudyDay(),longs)){
-                    if (Sec > sectionNum) {
+                    if (Sec < sectionNum) {
                         dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
                         sectionNum = sectionNum-Sec;
-                    }else if (Sec <= sectionNum){
+                    }else if (Sec >= sectionNum){
                         dayStudyVo.setStudyCourseKnob(Convert.toLong(sectionNum));
                         sectionNum = 0;
                     }
@@ -275,6 +274,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
         UserPlanVo userPlanVo = new UserPlanVo();
         userPlanVo.setCalendarStudyVo(calendarStudyVos);
         List<CoursePlanVo> coursePlanVos = new ArrayList<>();
+
         coursePlanVos.add(coursePlanVo);
         userPlanVo.setCoursePlanVo(coursePlanVos);
         return userPlanVo;

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/CoursePlanVo.java

@@ -38,6 +38,9 @@ public class CoursePlanVo {
 	@ApiModelProperty("分类名")
 	private String categoryName;
 
+	@ApiModelProperty("当天学习的节数")
+	private String sectionDayNum;
+
 
 
 

+ 5 - 2
zhongzheng-system/src/main/resources/mapper/modules/user/UserPlanMapper.xml

@@ -46,8 +46,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN course_section cs
         on cc.chapter_id = cs.chapter_id
         WHERE 1=1
-        <if test="courseId != null and courseId !='' ">
-            AND c.course_id in (#{courseId})
+        <if test="courseId != null and courseId !=''">
+            and c.course_id in
+            <foreach collection="courseId" open="(" separator="," close=")" item="courseId">
+                #{courseId}
+            </foreach>
         </if>
         GROUP BY cs.chapter_id,c.course_id)rs LEFT JOIN major_category mc on rs.category_id = mc.category_id
         GROUP BY course_id