|
@@ -31,6 +31,8 @@ import com.zhongzheng.modules.order.service.IOrderService;
|
|
|
import com.zhongzheng.modules.order.vo.OrderGoodsVo;
|
|
|
import com.zhongzheng.modules.order.vo.OrderListVo;
|
|
|
import com.zhongzheng.modules.order.vo.OrderVo;
|
|
|
+import com.zhongzheng.modules.user.bo.UserExamGoodsQueryBo;
|
|
|
+import com.zhongzheng.modules.user.service.IUserExamGoodsService;
|
|
|
import io.swagger.models.auth.In;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -70,6 +72,9 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
|
|
|
@Autowired
|
|
|
private IClassGradeGoodsService iClassGradeGoodsService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IUserExamGoodsService iUserExamGoodsService;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public OrderGoodsVo queryById(Long orderGoodsId) {
|
|
@@ -139,9 +144,6 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
|
|
|
}
|
|
|
//关闭订单
|
|
|
if(bo.getStatus()==0){
|
|
|
- orderGoods.setStatus(bo.getStatus());
|
|
|
- orderGoods.setUpdateTime(DateUtils.getNowTime());
|
|
|
- updateById(orderGoods);
|
|
|
GoodsVo goodsVo = iGoodsService.selectDetail(orderGoods.getGoodsId());
|
|
|
if(goodsVo.getGoodsType()==1){
|
|
|
//视频商品
|
|
@@ -157,7 +159,17 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
|
|
|
//题库商品
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+ if(goodsVo.getGoodsType()==3||goodsVo.getGoodsType()==4){
|
|
|
+ //补考
|
|
|
+ UserExamGoodsQueryBo examGoodsQueryBo = new UserExamGoodsQueryBo();
|
|
|
+ examGoodsQueryBo.setOrderGoodsId(orderGoods.getOrderGoodsId());
|
|
|
+ if(!iUserExamGoodsService.canRefund(examGoodsQueryBo)){
|
|
|
+ throw new CustomException("补考次数/前培次数已经被使用,不符号关闭条件");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ orderGoods.setStatus(bo.getStatus());
|
|
|
+ orderGoods.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ updateById(orderGoods);
|
|
|
}
|
|
|
return true;
|
|
|
}
|