|
@@ -1,6 +1,7 @@
|
|
|
package com.zhongzheng.modules.order.service.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.lang.Validator;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
@@ -229,7 +230,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
orderGoods.setCompany(bo.getOrderStudent().getCompany());
|
|
|
//成交价
|
|
|
orderGoods.setGoodsRealPrice(goods.getStandPrice());
|
|
|
- orderGoods.setStudyCount(goods.getStudyCount());
|
|
|
+
|
|
|
orderGoods.setCreateTime(DateUtils.getNowTime());
|
|
|
orderGoods.setUpdateTime(DateUtils.getNowTime());
|
|
|
|
|
@@ -241,6 +242,12 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
boolean canRepeatBuy = false;
|
|
|
//视频商品安排班级
|
|
|
if(goods.getGoodsType()==1){
|
|
|
+ if(Validator.isNotEmpty(goods.getStudyCount())){
|
|
|
+ orderGoods.setStudyCount(goods.getStudyCount()-1); //默认消耗一次学习机会
|
|
|
+ }else{
|
|
|
+ orderGoods.setStudyCount(0L);//没配置则为0
|
|
|
+ }
|
|
|
+
|
|
|
Long gradeId = null;
|
|
|
//判断是否购买历史班级都过期
|
|
|
canRepeatBuy =this.canBuyRepeatGoods(g.getGoodsId(),bo.getUserId());
|
|
@@ -323,7 +330,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
//成交价
|
|
|
orderGoods.setGoodsRealPrice(goods.getStandPrice());
|
|
|
orderGoods.setGoodsPrice(goods.getStandPrice());
|
|
|
- orderGoods.setStudyCount(goods.getStudyCount());
|
|
|
orderGoods.setCreateTime(DateUtils.getNowTime());
|
|
|
orderGoods.setUpdateTime(DateUtils.getNowTime());
|
|
|
//订单价格不计算优惠
|
|
@@ -335,6 +341,11 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
boolean canRepeatBuy = false;
|
|
|
//视频商品安排班级
|
|
|
if(goods.getGoodsType()==1){
|
|
|
+ if(Validator.isNotEmpty(goods.getStudyCount())){
|
|
|
+ orderGoods.setStudyCount(goods.getStudyCount()-1); //默认分班消耗一次学习机会
|
|
|
+ }else{
|
|
|
+ orderGoods.setStudyCount(0L);//没配置则为0
|
|
|
+ }
|
|
|
Long gradeId = null;
|
|
|
//判断是否购买历史班级都过期
|
|
|
canRepeatBuy =this.canBuyRepeatGoods(g.getGoodsId(),bo.getUserId());
|