he2802 преди 3 години
родител
ревизия
859ee44a3a

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/bo/ConsoleQueryBo.java

@@ -91,5 +91,7 @@ public class ConsoleQueryBo extends BaseEntity {
 
 	/** 考试登记状态 0 待登记 1正常 2缺考 3作弊 4替考 */
 	private Integer examStatus;
+	@ApiModelProperty("订单商品ID")
+	private Long orderGoodsId;
 
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseMenuVo.java

@@ -72,6 +72,10 @@ public class CourseMenuVo {
 	private Integer examType;
 	@ApiModelProperty("赠送卷名称")
 	private String freeExamName;
+	@ApiModelProperty("编码")
+	private String code;
+	@ApiModelProperty("发布状态")
+	private Long publishStatus;
 	/** 章模块关系 */
 	@Excel(name = "章模块关系")
 	@ApiModelProperty("章模块关系")

+ 12 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsServiceImpl.java

@@ -9,6 +9,7 @@ import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.SecurityUtils;
 import com.zhongzheng.modules.bank.mapper.QuestionMapper;
+import com.zhongzheng.modules.base.bo.ConsoleQueryBo;
 import com.zhongzheng.modules.course.domain.CourseModule;
 import com.zhongzheng.modules.course.vo.CourseVo;
 import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
@@ -38,6 +39,7 @@ import com.zhongzheng.modules.user.domain.User;
 import com.zhongzheng.modules.user.service.IUserExamGoodsService;
 import com.zhongzheng.modules.user.service.IUserService;
 import com.zhongzheng.modules.user.service.IUserStudyRecordService;
+import com.zhongzheng.modules.user.service.IUserSubscribeService;
 import io.swagger.models.auth.In;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -90,6 +92,9 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
     @Autowired
     private IUserService iUserService;
 
+    @Autowired
+    private IUserSubscribeService iUserSubscribeService;
+
 
     @Override
     public OrderGoodsVo queryById(Long orderGoodsId) {
@@ -161,6 +166,12 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
         if(bo.getStatus()==0){
             GoodsVo goodsVo = iGoodsService.selectDetail(orderGoods.getGoodsId());
             if(goodsVo.getGoodsType()==1){
+                ConsoleQueryBo consoleQueryBo = new ConsoleQueryBo();
+                consoleQueryBo.setOrderGoodsId(orderGoods.getOrderGoodsId());
+                Integer usNum = iUserSubscribeService.getConsoleTestSubscribeNum(consoleQueryBo);
+                if(usNum>0){
+                    throw new CustomException("已预约了考试,不符合关闭条件");
+                }
                 //视频商品
                 LambdaUpdateWrapper<ClassGradeUser> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
                 objectLambdaUpdateWrapper.eq(ClassGradeUser::getOrderGoodsId, bo.getOrderGoodsId());
@@ -179,7 +190,7 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
                 UserExamGoodsQueryBo examGoodsQueryBo = new UserExamGoodsQueryBo();
                 examGoodsQueryBo.setOrderGoodsId(orderGoods.getOrderGoodsId());
                 if(!iUserExamGoodsService.canRefund(examGoodsQueryBo)){
-                    throw new CustomException("补考次数/前培次数已经被使用,不符关闭条件");
+                    throw new CustomException("补考次数/前培次数已经被使用,不符关闭条件");
                 }
                 //减去考试和前培次数
                 UserExamGoodsQueryBo examGoodsQueryBo1 = new UserExamGoodsQueryBo();

+ 18 - 1
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMenuMapper.xml

@@ -34,6 +34,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="examType" column="exam_type"/>
         <result property="freeExamId" column="free_exam_id"/>
         <result property="freeExamName" column="free_exam_name"/>
+        <result property="code" column="code"/>
+        <result property="publishStatus" column="publish_status"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.course.vo.CourseUserMenuVo" id="CourseUserMenuVo">
@@ -58,7 +60,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SELECT
             m.*,
             CASE
-
                 WHEN m.type = 1 THEN
                     cm.module_name
                 WHEN m.type = 2 THEN
@@ -67,6 +68,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     cs.`name`
                 END menu_name,
             CASE
+                WHEN m.type = 1 THEN
+                cm.publish_status
+                WHEN m.type = 2 THEN
+                cc.publish_status
+                WHEN m.type = 3 THEN
+                cs.publish_status
+                END publish_status,
+            CASE
+                WHEN m.type = 1 THEN
+                cm.code
+                WHEN m.type = 2 THEN
+                cc.code
+                WHEN m.type = 3 THEN
+                cs.code
+                END code,
+            CASE
 
                 WHEN m.type = 1 THEN
                     0

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

@@ -106,6 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 LEFT JOIN `order` o ON o.order_sn = og.order_sn
         WHERE
             1 = 1
+          and o.status = 1
             <if test="refundStatusList != null and refundStatusList.size()!=0 ">
                 AND og.refund_status in
                 <foreach collection="refundStatusList" item="item" index="index" open="(" close=")" separator=",">

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

@@ -323,6 +323,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN goods g ON us.goods_id = g.goods_id
         WHERE
         1=1
+        <if test="orderGoodsId != null">
+            AND us.order_goods_id = #{orderGoodsId}
+        </if>
         <if test="businessId != null">
             AND g.business_id = #{businessId}
         </if>