Browse Source

fix 复购有效期

he2802 3 years ago
parent
commit
dab1e93a2c

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

@@ -1345,7 +1345,11 @@ 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("存在已购买【班级有效期未过期】的商品,不可以重复购买商品", 511);
+            for(ClassGradeVo gradeVo : list){
+                if(Validator.isNotEmpty(gradeVo.getClassEndTime())){
+                    throw new CustomException("存在已购买【班级有效期未过期】的商品,不可以重复购买商品", 511);
+                }
+            }
         }
         //判断是否有锁定的班级
         ClassGradeUserTempQueryBo gradeUserTempQueryBo = new ClassGradeUserTempQueryBo();

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/vo/OrderGoodsVo.java

@@ -231,4 +231,7 @@ public class OrderGoodsVo {
 	private Long liveEndTime;
 	@ApiModelProperty("节数量")
 	private Integer sectionNum;
+
+	@ApiModelProperty("专业名称")
+	private String categoryName;
 }

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

@@ -84,6 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="closeReason" column="close_reason"/>
         <result property="joinLiveNum" column="join_live_num"/>
         <result property="seeTime" column="see_time"/>
+        <result property="categoryName" column="category_name"/>
     </resultMap>
 
     <select id="selectList" parameterType="com.zhongzheng.modules.order.bo.OrderGoodsQueryBo" resultMap="OrderGoodsResultVo">
@@ -156,11 +157,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         cg.official_learning_url,
         cgu.learn_status,
         cgu.official_status,
-        cg.class_status
+        cg.class_status,
+        m.category_name,
         FROM
         order_goods og
         LEFT JOIN class_grade cg on og.grade_id = cg.grade_id
         LEFT JOIN goods g ON og.goods_id = g.goods_id
+        LEFT JOIN major m ON g.major_id = m.id
         LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
         LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
         LEFT JOIN course_business cb ON g.business_id = cb.id