Browse Source

fix 计费单商品

he2802 3 năm trước cách đây
mục cha
commit
94a145c37a

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/domain/ClassGradeUser.java

@@ -42,4 +42,8 @@ private static final long serialVersionUID=1L;
     /** 指派操作者 */
     @TableField(fill = FieldFill.INSERT)
     private String createBy;
+    /** 来源 1订单购买 */
+    private Integer fromType;
+    /** 订单商品id */
+    private Long orderGoodsId;
 }

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassGradeVo.java

@@ -130,4 +130,5 @@ public class ClassGradeVo {
 	@ApiModelProperty("学员人数")
 	private Integer studentNum;
 
+
 }

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

@@ -8,6 +8,9 @@ import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.bank.domain.QuestionBusiness;
 import com.zhongzheng.modules.goods.domain.Goods;
 import com.zhongzheng.modules.goods.service.IGoodsService;
+import com.zhongzheng.modules.grade.service.IClassGradeService;
+import com.zhongzheng.modules.grade.service.IClassGradeUserService;
+import com.zhongzheng.modules.grade.vo.ClassGradeVo;
 import com.zhongzheng.modules.order.bo.*;
 import com.zhongzheng.modules.order.domain.Order;
 import com.zhongzheng.modules.order.domain.OrderBusiness;
@@ -47,7 +50,10 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
     private IOrderBusinessService iOrderBusinessService;
     @Autowired
     private IGoodsService iGoodsService;
-
+    @Autowired
+    private IClassGradeService iClassGradeService;
+    @Autowired
+    private IClassGradeUserService iClassGradeUserService;
 
 
     @Autowired
@@ -230,4 +236,24 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         }
         return this.removeByIds(ids);
     }
+
+
+    /**
+     * 加入班级
+     * @param goodsId
+     * @param classId
+     * @return
+     */
+    public boolean joinClass(Long goodsId,Long classId,Long userId){
+        if(classId!=null){
+            ClassGradeVo classGradeVo = iClassGradeService.queryById(classId);
+            if(classGradeVo==null){
+                throw new CustomException("班级不存在");
+            }
+
+
+
+        }
+        return false;
+    }
 }

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

@@ -24,7 +24,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="remark" column="remark"/>
         <result property="interfaceAccountId" column="interface_account_id"/>
         <result property="interfacePeriodId" column="interface_period_id"/>
-        <result property="studentNum" column="student_num"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassGradeVo" id="ClassGradeVoResult">

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

@@ -11,6 +11,8 @@
         <result property="status" column="status"/>
         <result property="createTime" column="create_time"/>
         <result property="updateTime" column="update_time"/>
+        <result property="fromType" column="from_type"/>
+        <result property="orderGoodsId" column="order_goods_id"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassGradeUserVo" id="ClassGradeUserVoResult">

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

@@ -97,6 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 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
+        ORDER BY o.order_id DESC
     </select>