|
|
@@ -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.StrUtil;
|
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
@@ -21,7 +22,10 @@ import com.zhongzheng.modules.order.mapper.OrderMapper;
|
|
|
import com.zhongzheng.modules.order.service.IOrderGoodsService;
|
|
|
import com.zhongzheng.modules.order.service.IOrderService;
|
|
|
import com.zhongzheng.modules.order.vo.OrderVo;
|
|
|
+import com.zhongzheng.modules.user.domain.OrderPossessUser;
|
|
|
import com.zhongzheng.modules.user.domain.User;
|
|
|
+import com.zhongzheng.modules.user.service.IOrderPossessUserService;
|
|
|
+import com.zhongzheng.modules.user.service.IUserBankQuestionRecordService;
|
|
|
import com.zhongzheng.modules.user.service.IUserService;
|
|
|
import com.zhongzheng.modules.user.vo.UserVo;
|
|
|
import com.zhongzheng.modules.wx.service.IWxPayService;
|
|
|
@@ -66,6 +70,11 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
@Autowired
|
|
|
private IExamNoteService iExamNoteService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IOrderPossessUserService iOrderPossessUserService;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public OrderVo queryById(Long orderId){
|
|
|
Order db = this.baseMapper.selectById(orderId);
|
|
|
@@ -202,6 +211,10 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|
|
}
|
|
|
g.setGoodsPrice(examNoteVo.getPrice());
|
|
|
}
|
|
|
+ OrderPossessUser orderPossess =iOrderPossessUserService.queryByTypeAndId(g.getGoodsId(),g.getGoodsType());
|
|
|
+ if(Validator.isNotNull(orderPossess)){
|
|
|
+ throw new CustomException("你已购买该商品");
|
|
|
+ }
|
|
|
if(!iOrderGoodsService.insertByAddBo(g)){
|
|
|
throw new CustomException("商品错误");
|
|
|
}
|