he2802 2 жил өмнө
parent
commit
6852dfd589
17 өөрчлөгдсөн 42 нэмэгдсэн , 8 устгасан
  1. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CoursePhotoLogAddBo.java
  2. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CoursePhotoLogQueryBo.java
  3. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/domain/CoursePhotoLog.java
  4. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CoursePhotoLogServiceImpl.java
  5. 6 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java
  6. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CoursePhotoLogVo.java
  7. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseUserVo.java
  8. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodStudentVo.java
  9. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodUserVo.java
  10. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserBankRecordQueryBo.java
  11. 5 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserBankRecordServiceImpl.java
  12. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java
  13. 2 0
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml
  14. 5 0
      zhongzheng-system/src/main/resources/mapper/modules/course/CoursePhotoLogMapper.xml
  15. 5 1
      zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml
  16. 1 1
      zhongzheng-system/src/main/resources/mapper/modules/order/OrderGoodsMapper.xml
  17. 3 0
      zhongzheng-system/src/main/resources/mapper/modules/user/UserBankRecordMapper.xml

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CoursePhotoLogAddBo.java

@@ -66,4 +66,5 @@ public class CoursePhotoLogAddBo {
     /** 课程ID */
     @ApiModelProperty("课程ID")
     private Long courseId;
+    private Long orderGoodsId;
 }

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CoursePhotoLogQueryBo.java

@@ -62,4 +62,5 @@ public class CoursePhotoLogQueryBo extends BaseEntity {
 	/** 课程ID */
 	@ApiModelProperty("课程ID")
 	private Long courseId;
+	private Long orderGoodsId;
 }

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/domain/CoursePhotoLog.java

@@ -60,4 +60,5 @@ private static final long serialVersionUID=1L;
     private String timeInterval;
     /** 课程ID */
     private Long courseId;
+    private Long orderGoodsId;
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CoursePhotoLogServiceImpl.java

@@ -1,7 +1,9 @@
 package com.zhongzheng.modules.course.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
+import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.course.bo.CoursePhotoLogAddBo;
 import com.zhongzheng.modules.course.bo.CoursePhotoLogEditBo;
@@ -70,6 +72,9 @@ public class CoursePhotoLogServiceImpl extends ServiceImpl<CoursePhotoLogMapper,
 
     @Override
     public Boolean insertByAddBo(CoursePhotoLogAddBo bo) {
+        if(Validator.isEmpty(bo.getOrderGoodsId())){
+            throw new CustomException("缺OrderGoodsId");
+        }
         CoursePhotoLog add = BeanUtil.toBean(bo, CoursePhotoLog.class);
         validEntityBeforeSave(add);
         add.setCreateTime(DateUtils.getNowTime());

+ 6 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java

@@ -376,8 +376,9 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public boolean editRebuild(ClassGradeUserQueryBo bo) {
-        if(Validator.isEmpty(bo.getGradeId())||Validator.isEmpty(bo.getUserId())){
+        if(Validator.isEmpty(bo.getGradeId())||Validator.isEmpty(bo.getUserId())||Validator.isEmpty(bo.getOrderGoodsId())){
             throw new CustomException("参数错误");
         }
         //将该班级下的学员作弊的节改成待重修
@@ -403,6 +404,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
             objectLambdaUpdateWrapper.eq(CoursePhotoLog::getGoodsId, vo.getGoodsId());
             objectLambdaUpdateWrapper.eq(CoursePhotoLog::getSectionId,vo.getSectionId());
             objectLambdaUpdateWrapper.eq(CoursePhotoLog::getGradeId,vo.getGradeId());
+            objectLambdaUpdateWrapper.eq(Validator.isNotEmpty(vo.getOrderGoodsId()),CoursePhotoLog::getOrderGoodsId,vo.getOrderGoodsId());
             objectLambdaUpdateWrapper.eq(CoursePhotoLog::getModuleId,vo.getModuleId());
             objectLambdaUpdateWrapper.eq(CoursePhotoLog::getChapterId,vo.getChapterId());
             objectLambdaUpdateWrapper.eq(CoursePhotoLog::getCourseId,vo.getCourseId());
@@ -415,6 +417,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
             objectLambdaUpdateWrapper1.eq(UserStudyRecord::getGoodsId, vo.getGoodsId());
             objectLambdaUpdateWrapper1.eq(UserStudyRecord::getSectionId,vo.getSectionId());
             objectLambdaUpdateWrapper1.eq(UserStudyRecord::getGradeId,vo.getGradeId());
+            objectLambdaUpdateWrapper1.eq(Validator.isNotEmpty(vo.getOrderGoodsId()),UserStudyRecord::getOrderGoodsId,vo.getOrderGoodsId());
             objectLambdaUpdateWrapper1.eq(UserStudyRecord::getModuleId,vo.getModuleId());
             objectLambdaUpdateWrapper1.eq(UserStudyRecord::getChapterId,vo.getChapterId());
             objectLambdaUpdateWrapper1.eq(UserStudyRecord::getCourseId,vo.getCourseId());
@@ -427,6 +430,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
             objectLambdaUpdateWrapper2.eq(UserBankRecord::getGoodsId, vo.getGoodsId());
             objectLambdaUpdateWrapper2.eq(UserBankRecord::getExamId,vo.getExamId());
             objectLambdaUpdateWrapper2.eq(UserBankRecord::getGradeId,vo.getGradeId());
+            objectLambdaUpdateWrapper2.eq(Validator.isNotEmpty(vo.getOrderGoodsId()),UserBankRecord::getOrderGoodsId,vo.getOrderGoodsId());
             objectLambdaUpdateWrapper2.eq(UserBankRecord::getModuleId,vo.getModuleId());
             objectLambdaUpdateWrapper2.eq(UserBankRecord::getChapterId,vo.getChapterId());
             objectLambdaUpdateWrapper2.eq(UserBankRecord::getCourseId,vo.getCourseId());
@@ -661,6 +665,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
             subjectStudyRecordQueryBo.setUserId(bo.getUserId());
             subjectStudyRecordQueryBo.setGradeId(courseUserVo.getGradeId());
             subjectStudyRecordQueryBo.setCourseId(courseUserVo.getCourseId());
+            subjectStudyRecordQueryBo.setOrderGoodsId(courseUserVo.getOrderGoodsId());
             List<SubjectStudyRecordVo> subjectStudyRecordVos = iUserStudyRecordService.listSubject(subjectStudyRecordQueryBo);
             if (!CollectionUtils.isEmpty(subjectStudyRecordVos)){
                 courseUserVo.setStuAllNum(subjectStudyRecordVos.get(0).getRecordNum());

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CoursePhotoLogVo.java

@@ -80,4 +80,5 @@ public class CoursePhotoLogVo {
 	@Excel(name = "课程ID")
 	@ApiModelProperty("课程ID")
 	private Long courseId;
+	private Long orderGoodsId;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseUserVo.java

@@ -131,4 +131,6 @@ public class CourseUserVo {
 	/** 已做试卷 */
 	@ApiModelProperty("已做试卷")
 	private Long recordNum;
+
+	private Long orderGoodsId;
 }

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodStudentVo.java

@@ -230,4 +230,5 @@ public class ClassPeriodStudentVo {
 	@ApiModelProperty("")
 	private String token;
 	private Long orderGoodsId;
+	private String sevenYear;
 }

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

@@ -145,5 +145,5 @@ public class ClassPeriodUserVo {
 
 	@ApiModelProperty("官方班级")
 	private String officialName;
-
+	private String sevenYear;
 }

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

@@ -86,5 +86,5 @@ public class UserBankRecordQueryBo extends BaseEntity {
 
 	@ApiModelProperty("周查询结束时间")
 	private Long searchWeekEndTime;
-
+	private Long orderGoodsId;
 }

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

@@ -158,8 +158,8 @@ public class UserBankRecordServiceImpl extends ServiceImpl<UserBankRecordMapper,
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Long insertByAddBo(UserBankRecordAddBo bo) {
-        if(Validator.isEmpty(bo.getGradeId())){
-            throw new CustomException("参数缺失");
+        if(Validator.isEmpty(bo.getGradeId())||Validator.isEmpty(bo.getOrderGoodsId())){
+            throw new CustomException("OrderGoodsId参数缺失");
         }
         UserBankRecord add = BeanUtil.toBean(bo, UserBankRecord.class);
         validEntityBeforeSave(add);
@@ -342,6 +342,9 @@ public class UserBankRecordServiceImpl extends ServiceImpl<UserBankRecordMapper,
 
     @Override
     public Boolean checkBankRecord(UserBankRecordQueryBo bo) {
+        if(Validator.isEmpty(bo.getOrderGoodsId())){
+            throw new CustomException("缺失OrderGoodsId");
+        }
         List<Integer> counts = baseMapper.checkBankRecord(bo);
         long count = counts.stream().filter(x -> ObjectUtils.isNotNull(x) && x > 0).count();
         return ObjectUtils.isNotNull(count) && count > 0;

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java

@@ -347,7 +347,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
 
 
         CourseSectionVo courseSectionVo =iCourseSectionService.queryById(bo.getSectionId());
-        if(Validator.isEmpty(courseSectionVo)){
+        if(Validator.isEmpty(courseSectionVo)||Validator.isEmpty(bo.getSectionId())){
             throw new CustomException("节数据错误");
         }
         GoodsVo goodsVo = iGoodsService.queryById(bo.getGoodsId());

+ 2 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml

@@ -499,6 +499,7 @@
           AND ups.`status` = 0
           AND up.exam_id = 0
           and up.grade_id = #{gradeId}
+          and (up.order_goods_id = #{orderGoodsId} or up.order_goods_id is null)
         UNION
         SELECT
             ups.id,
@@ -518,6 +519,7 @@
           AND ups.`status` = 0
           AND up.section_id = 0
           and up.grade_id = #{gradeId}
+          and (up.order_goods_id = #{orderGoodsId} or up.order_goods_id is null)
     </select>
 
     <select id="goodsRebuildStatus" parameterType="com.zhongzheng.modules.course.bo.CourseQueryBo"  resultType="Long">

+ 5 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CoursePhotoLogMapper.xml

@@ -22,6 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="currentStatus" column="current_status"/>
         <result property="timeInterval" column="time_interval"/>
         <result property="courseId" column="course_id"/>
+        <result property="orderGoodsId" column="order_goods_id"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.course.vo.CoursePhotoLogVo" id="CoursePhotoLogVoResult">
@@ -40,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="currentStatus" column="current_status"/>
         <result property="timeInterval" column="time_interval"/>
         <result property="courseId" column="course_id"/>
+        <result property="orderGoodsId" column="order_goods_id"/>
     </resultMap>
 
     <select id="getLastInfo" parameterType="com.zhongzheng.modules.course.bo.CoursePhotoLogQueryBo"  resultMap="CoursePhotoLogVoResult">
@@ -61,6 +63,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="chapterId != null">
             and chapter_id = #{chapterId}
         </if>
+        <if test="orderGoodsId != null">
+            and (order_goods_id = #{orderGoodsId} or order_goods_id is null )
+        </if>
     </select>
 
 </mapper>

+ 5 - 1
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -132,6 +132,7 @@
         <result property="recordEndTime" column="record_end_time"/>
         <result property="onLineTime" column="on_line_time"/>
         <result property="orderGoodsId" column="order_goods_id"/>
+        <result property="sevenYear" column="seven_year"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodUserVo" id="ClassPeriodUserVo">
@@ -163,6 +164,7 @@
         <result property="classStartTime" column="class_start_time"/>
         <result property="classEndTime" column="class_end_time"/>
         <result property="officialName" column="official_name"/>
+        <result property="sevenYear" column="seven_year"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodVo" id="ClassPeriodVo">
@@ -404,6 +406,7 @@
             up.key_value,
         </if>
         cgu.period_wait_time as end_time,
+        (SELECT og.seven_year FROM order_goods og  where og.order_goods_id = cgu.order_goods_id ) as seven_year,
         (SELECT og.service_start_time FROM order_goods og  where og.order_goods_id = cgu.order_goods_id ) as service_start_time,
         (SELECT og.service_end_time FROM order_goods og  where og.order_goods_id = cgu.order_goods_id ) as service_end_time,
         (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr  where ubr.`status`=1 and ubr.`type` in (1,3) and ubr.report_status=1 and ubr.order_goods_id = cgu.order_goods_id and ubr.grade_id = cgu.grade_id and ubr.user_id = cgu.user_id and ubr.current_status = 1) as record_num
@@ -856,7 +859,8 @@
         (SELECT
         COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.section_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where ups.`status`
         =2 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and up.order_goods_id=cgu.order_goods_id and up.user_id = #{userId} and up.`type`  in (2,3)) as exam_pending,
-        (SELECT up.key_value FROM user_profile up where up.goods_id = #{goodsId} and up.user_id =#{userId} and up.order_goods_id = cgu.order_goods_id and up.current_status = 1 and up.`status` = 1 and up.type_status =1 LIMIT 1) as key_value
+        (SELECT up.key_value FROM user_profile up where up.goods_id = #{goodsId} and up.user_id =#{userId} and up.order_goods_id = cgu.order_goods_id and up.current_status = 1 and up.`status` = 1 and up.type_status =1 LIMIT 1) as key_value,
+        (SELECT og.seven_year FROM order_goods og  where og.order_goods_id = cgu.order_goods_id ) as seven_year
         <if test="userId != null and userId !='' ">
             ,(SELECT MIN(first_start_time) from user_study_record where user_id = #{userId} and grade_id = #{gradeId} and order_goods_id=#{orderGoodsId}) as study_start_time,
             (SELECT MAX(end_time) from user_study_record where user_id = #{userId} and grade_id = #{gradeId} and order_goods_id=#{orderGoodsId}) as study_end_time

+ 1 - 1
zhongzheng-system/src/main/resources/mapper/modules/order/OrderGoodsMapper.xml

@@ -485,7 +485,7 @@
         and c.goods_id = g.goods_id) as exam_num,
         (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr LEFT JOIN
         class_grade_goods cgg on cgg.goods_id
-        = ubr.goods_id where ubr.`status`=1 and ubr.report_status=1 and ubr.grade_id = og.grade_id and ubr.user_id =
+        = ubr.goods_id where ubr.`status`=1 and ubr.report_status=1 and ubr.grade_id = og.grade_id and ubr.order_goods_id = og.order_goods_id and ubr.user_id =
         o.user_id and ubr.current_status = 1) as record_num,
         (case WHEN (SELECT COUNT(1) FROM exam_apply_goods eag LEFT JOIN exam_apply ea on eag.apply_id = ea.apply_id LEFT JOIN exam_apply_user eau on eau.apply_id = ea.apply_id where   eag.goods_id = g.goods_id and ea.`status` = 1 and unix_timestamp(now()) BETWEEN ea.apply_start_time and ea.apply_end_time) >0 then 1 ELSE 0 end) as apply_status,
         us.exam_status  as sub_exam_status,

+ 3 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserBankRecordMapper.xml

@@ -212,6 +212,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="gradeId != null and gradeId != ''">
             AND ubr.grade_id = #{gradeId}
         </if>
+        <if test="orderGoodsId != null and orderGoodsId != ''">
+            AND ubr.order_goods_id = #{orderGoodsId}
+        </if>
         <if test="goodsId != null and goodsId != ''">
             AND ubr.goods_id = #{goodsId}
         </if>