|
@@ -6,6 +6,8 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
|
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.order.bo.*;
|
|
|
import com.zhongzheng.modules.order.domain.Order;
|
|
|
import com.zhongzheng.modules.order.domain.OrderBusiness;
|
|
@@ -43,6 +45,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
|
|
|
@Autowired
|
|
|
private IOrderBusinessService iOrderBusinessService;
|
|
|
+ @Autowired
|
|
|
+ private IGoodsService iGoodsService;
|
|
|
+
|
|
|
|
|
|
|
|
|
@Autowired
|
|
@@ -153,6 +158,11 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
//生成订单
|
|
|
Collection<OrderGoods> coll = new HashSet<>();
|
|
|
for (OrderGoodsAddBo g : goodsList) {
|
|
|
+ //订单商品
|
|
|
+ Goods goods = iGoodsService.getOne(new LambdaQueryWrapper<Goods>().eq(Goods::getGoodsId,g.getGoodsId()));
|
|
|
+ if(goods.getGoodsStatus()!=1){
|
|
|
+ throw new CustomException("商品尚未上架");
|
|
|
+ }
|
|
|
OrderGoods orderGoods = BeanUtil.toBean(g, OrderGoods.class);
|
|
|
orderGoods.setOrderSn(out_trade_no);
|
|
|
if(g.getGoodsInputData()!=null){
|
|
@@ -175,6 +185,12 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
totalPrice = totalPrice.add(g.getGoodsPrice());
|
|
|
//暂不计算优惠券
|
|
|
payPrice = payPrice.add(g.getGoodsPrice());
|
|
|
+ //视频商品安排班级
|
|
|
+ if(goods.getGoodsType()==1){
|
|
|
+ if(g.getGoodsInputData().getClassId()!=null){
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
iOrderGoodsService.saveBatch(coll);
|
|
|
|