瀏覽代碼

fix 排班

he2802 3 年之前
父節點
當前提交
26dfffde3e

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderQueryBo.java

@@ -105,4 +105,6 @@ public class OrderQueryBo extends BaseEntity {
 	private Integer payStatus;
 	@ApiModelProperty("退款状态 0无  1退款中 2已退款 3拒绝退款")
 	private Integer refundStatus;
+	@ApiModelProperty("商品类型 1视频2题库 3面授 4服务 5组合")
+	private Long goodsType;
 }

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

@@ -257,7 +257,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             lqw.eq(ClassGradeUser::getGradeId,gradeId);
             lqw.eq(ClassGradeUser::getStatus,1);
             int studentNum = iClassGradeUserService.count(lqw);
-            if(classGradeVo.getStudentUpper()>studentNum){
+            //预留2空位避免超人数
+            if(classGradeVo.getStudentUpper()-studentNum>3){
                 //班级还有剩位,直接加入班级
                 return joinGrade(orderGoodsId,gradeId,userId);
             }
@@ -268,7 +269,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             List<ClassGradeVo> classGradeVoList =  iClassGradeService.queryList(bo);
             for(int i = 0; i < classGradeVoList.size(); i++){
                 ClassGradeVo classGradeVo = classGradeVoList.get(i);
-                //无指定班预留2空位避免超人数
+                //预留2空位避免超人数
                 if(classGradeVo.getStudentUpper()-classGradeVo.getStudentNum()>3){
                     //有空位则进入班级
                     gradeId = classGradeVo.getGradeId();

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

@@ -91,12 +91,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             `order` o
                 LEFT JOIN order_goods og ON o.order_sn = og.order_sn
                 LEFT JOIN goods g ON og.goods_id = g.goods_id
-                LEFT JOIN `user` u ON o.user_id = o.user_id
+                LEFT JOIN `user` u ON o.user_id = u.user_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
                 LEFT JOIN school s ON s.id = g.school_id
                 LEFT JOIN major m ON g.major_id = m.id
+        WHERE 1=1
         <if test="educationTypeId != null and educationTypeId != ''">
             AND g.education_type_id = #{educationTypeId}
         </if>
@@ -124,6 +125,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="refundStatus != null">
             AND og.refund_status = #{refundStatus}
         </if>
+        <if test="goodsType != null">
+            AND g.goods_type = #{goodsType}
+        </if>
         ORDER BY o.order_id DESC
     </select>