yangdamao 2 năm trước cách đây
mục cha
commit
b104106aac

+ 2 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/goods/GoodsController.java

@@ -2,6 +2,7 @@ package com.zhongzheng.controller.goods;
 
 import cn.hutool.core.lang.Validator;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.zhongzheng.common.core.controller.BaseController;
 import com.zhongzheng.common.core.domain.AjaxResult;
 import com.zhongzheng.common.core.page.PageDomain;
@@ -32,6 +33,7 @@ import com.zhongzheng.modules.goods.service.IGoodsSpecTemplateService;
 import com.zhongzheng.modules.goods.vo.*;
 import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
 import com.zhongzheng.modules.grade.service.IUserPeriodService;
+import com.zhongzheng.modules.order.bo.OrderGoodsSevenBo;
 import com.zhongzheng.modules.order.domain.OrderGoods;
 import com.zhongzheng.modules.order.domain.OrderGoodsFree;
 import com.zhongzheng.modules.order.service.IOrderGoodsFreeService;

+ 15 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderGoodsSevenBo.java

@@ -0,0 +1,15 @@
+package com.zhongzheng.modules.order.bo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2023年08月25日 9:41
+ */
+@Data
+public class OrderGoodsSevenBo implements Serializable {
+
+    private Long orderGoodsId;
+}

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

@@ -2335,7 +2335,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         if (CollectionUtils.isEmpty(classGradeUser)){
             return true;
         }
-        if (!classGradeUser.stream().noneMatch(x -> x.getOrderGoodsId().equals(orderGoodsId))){
+        if (classGradeUser.stream().noneMatch(x -> x.getOrderGoodsId().equals(orderGoodsId))){
             ClassGradeUser gradeUser = classGradeUser.stream().findFirst().orElse(null);
             OrderGoods orderGoodsTwo = iOrderGoodsService.getById(gradeUser.getOrderGoodsId());
             Goods goods = iGoodsService.getById(orderGoodsTwo.getGoodsId());
@@ -2345,12 +2345,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         return true;
     }
 
-    public static void main(String[] args) {
-        List<Integer> integers = Arrays.asList(1, 2, 3, 4, 5);
-        boolean b = integers.stream().noneMatch(x -> x == 3);
-        System.out.println("b = " + b);
-    }
-
     private String createGradeCode(Long goodsId, CourseBusinessVo business) {
 
         Goods goods = iGoodsService.getById(goodsId);

+ 4 - 1
zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsMapper.xml

@@ -589,9 +589,12 @@
                          LEFT JOIN class_grade_goods cgg on cgg.grade_id = cgu.grade_id
                          LEFT JOIN class_grade cg on cg.grade_id = cgu.grade_id
                 where cgu.user_id = #{userId}
+                  <if test="orderGoodsId != null and orderGoodsId != ''">
+                      and cgu.order_goods_id = #{orderGoodsId}
+                  </if>
                   and cgg.goods_id = g.goods_id
                   and cg.`status` = 1
-                  and unix_timestamp(now()) BETWEEN cg.class_start_time and cg.class_end_time)    as grade_id
+                  and unix_timestamp(now()) BETWEEN cg.class_start_time and cg.class_end_time limit 1)    as grade_id
         FROM goods g
                  LEFT JOIN pay_supply ps ON g.supply_id = ps.supply_id
                  LEFT JOIN course_education_type cet ON g.education_type_id = cet.id

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

@@ -1645,7 +1645,7 @@
                 AND og.`status` = 1
                 AND og.refund_status != 2
 	            AND og.pay_status IN ( 2, 3, 4 )
-	            AND cgu.period_status = 0
+	            AND cgu.period_status = -1
 	            AND cgu.finish_status = 0
 	            AND (
 	            SELECT