Ver código fonte

fix 做题列表

he2802 3 anos atrás
pai
commit
1c51fb5a66

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsAttachedVo.java

@@ -73,5 +73,9 @@ public class GoodsAttachedVo {
 	private Integer recordStatus;
 	@ApiModelProperty("做卷类型  1练习 2考试")
 	private Integer doType;
+	@ApiModelProperty("做题数量")
+	private Integer doNum;
+	@ApiModelProperty("试卷可以做次数")
+	private Integer answerNum;
 
 }

+ 4 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsUserVo.java

@@ -245,11 +245,11 @@ public class GoodsUserVo {
 	private Long secAllNum;
 
 	/** 学习进度 */
-	@ApiModelProperty("0无预约考试 1有预约考试")
+	@ApiModelProperty("商品关联考试安排状态")
 	private Long applyStatus;
 
 	/** 学习进度 */
-	@ApiModelProperty("0无刷题 1有刷题")
+	@ApiModelProperty("商品关联前培状态")
 	private Long beforeStatus;
 
 	/** 学习进度 */
@@ -322,5 +322,7 @@ public class GoodsUserVo {
 	@Excel(name = "开班状态 0未开班 1开班")
 	@ApiModelProperty("开班状态 0未开班 1开班")
 	private Integer classStatus;
+	@ApiModelProperty("预约ID")
+	private Integer subscribeId;
 
 }

+ 4 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java

@@ -525,7 +525,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         bo.setPastDue(1L);
         List<ClassGradeVo> list = iClassGradeService.queryList(bo);
         if(list!=null&&list.size()>0){
-            throw new CustomException("存在已购买【班级有效期未过期】的商品,不可以重复购买商品");
+            throw new CustomException("存在已购买【班级有效期未过期】的商品,不可以重复购买商品",511);
         }
         //判断是否有锁定的班级
         ClassGradeUserTempQueryBo gradeUserTempQueryBo = new ClassGradeUserTempQueryBo();
@@ -534,7 +534,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         gradeUserTempQueryBo.setStatus(ClassGradeUserTemp.STATUS_LOCK);
         List<ClassGradeUserTempVo> list1 = iClassGradeUserTempService.queryList(gradeUserTempQueryBo);
         if(list1!=null&&list1.size()>0){
-            throw new CustomException("购买商品尚有订单未支付");
+            throw new CustomException("购买商品尚有订单未支付",510);
         }
         return true;
     }
@@ -547,11 +547,11 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         bo.setGoodsId(goodsId);
         Long num = iOrderGoodsService.getBuyGoodsHistory(bo);
         if(num.longValue()>0){
-            throw new CustomException("不可以重复购买商品");
+            throw new CustomException("无法重复购买商品",511);
         }
         Long num1 = iOrderGoodsService.getBuyGoodsReadyPay(bo);
         if(num1.longValue()>0){
-            throw new CustomException("购买商品尚有订单未支付");
+            throw new CustomException("购买商品尚有订单未支付",510);
         }
         return false;
     }

+ 2 - 1
zhongzheng-system/src/main/resources/mapper/modules/course/CourseChapterSectionMapper.xml

@@ -204,7 +204,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="learningExamCheck" parameterType="map"  resultType="integer">
         SELECT
-            IFNULL(ubr.report_status,-1)
+            IFNULL(MAX(ubr.report_status),-1)
         FROM
             user_bank_record ubr
         WHERE
@@ -214,6 +214,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           AND ubr.course_id=#{courseId}
           AND ubr.chapter_id = #{chapterId}
           AND ubr.exam_id = #{examId}
+          AND ubr.current_status = 1
         ORDER BY
             ubr.record_id DESC
             LIMIT 1

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

@@ -180,6 +180,7 @@
         <result property="subApplySiteEndTime" column="sub_apply_site_end_time"/>
         <result property="subApplySiteExamTime" column="sub_apply_site_exam_time"/>
         <result property="gradeId" column="grade_id"/>
+        <result property="subscribeId" column="subscribe_id"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassGradeVo" id="ClassGradeVoResult">
@@ -473,6 +474,7 @@
         (SELECT exam_status from user_subscribe where user_id = #{userId} and goods_id = g.goods_id and subscribe_status = 1 ORDER BY subscribe_id desc limit 1)as sub_exam_status,
         (SELECT performance from user_subscribe where user_id = #{userId}and goods_id = g.goods_id and subscribe_status = 1 ORDER BY subscribe_id desc limit 1)as sub_performance,
         (SELECT `result` from user_subscribe where user_id = #{userId} and goods_id = g.goods_id and subscribe_status = 1 ORDER BY subscribe_id desc limit 1)as sub_result,
+        (SELECT subscribe_id from user_subscribe where user_id = #{userId} and goods_id = g.goods_id and subscribe_status = 1 ORDER BY subscribe_id desc limit 1)as subscribe_id,
         (SELECT apply_site_start_time from user_subscribe where user_id = #{userId} and goods_id = g.goods_id and subscribe_status = 1 ORDER BY subscribe_id desc limit 1)as sub_apply_site_start_time,
         (SELECT apply_site_end_time from user_subscribe where user_id = #{userId} and goods_id = g.goods_id and subscribe_status = 1 ORDER BY subscribe_id desc limit 1)as sub_apply_site_end_time,
         (SELECT apply_site_exam_time from user_subscribe where user_id = #{userId} and goods_id = g.goods_id and subscribe_status = 1 ORDER BY subscribe_id desc limit 1)as sub_apply_site_exam_time

+ 20 - 0
zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsAttachedMapper.xml

@@ -32,6 +32,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<result property="recordStatus" column="record_status"/>
 		<result property="recordId" column="record_id"/>
 		<result property="doType" column="do_type"/>
+		<result property="doNum" column="do_num"/>
+		<result property="answerNum" column="answer_num"/>
     </resultMap>
 
     <select id="selectList" parameterType="com.zhongzheng.modules.goods.bo.GoodsAttachedQueryBo" resultMap="GoodsAttachedResultVo">
@@ -101,6 +103,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 				WHEN ga.type = 3 THEN
 				ifnull( (select record_id from user_exam_record uer where uer.exam_id = ga.major_id and uer.user_id = #{userId} and ga.goods_id =uer.goods_id ORDER BY uer.record_id desc limit 1),-1)
 				END record_id
+				,
+				CASE
+				WHEN ga.type = 1 THEN
+				-1
+				WHEN ga.type = 2 THEN
+				-1
+				WHEN ga.type = 3 THEN
+				e.answer_num
+				END answer_num
+				,
+				CASE
+				WHEN ga.type = 1 THEN
+				-1
+				WHEN ga.type = 2 THEN
+				-1
+				WHEN ga.type = 3 THEN
+				(select count(*) from user_exam_record uer where uer.exam_id = ga.major_id and uer.user_id = #{userId} and ga.goods_id =uer.goods_id )
+				END do_num
 			</if>
 		FROM
 			goods_attached ga