|
|
@@ -10,6 +10,7 @@ import cn.seecoder.courselearning.util.Constant;
|
|
|
import cn.seecoder.courselearning.vo.*;
|
|
|
import org.omg.CORBA.IntHolder;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
@@ -26,13 +27,29 @@ public class CourseOrderServiceImpl implements CourseOrderService {
|
|
|
CourseOrderMapper orderMapper;
|
|
|
@Resource
|
|
|
CourseOrderCouponMapper courseOrderCouponMapper;
|
|
|
- @Resource
|
|
|
+
|
|
|
UserService userService;
|
|
|
- @Resource
|
|
|
+
|
|
|
CouponService couponService;
|
|
|
- @Resource
|
|
|
+
|
|
|
CourseService courseService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ public void setUserService(UserService userService) {
|
|
|
+ this.userService = userService;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ public void setCouponService(CouponService couponService) {
|
|
|
+ this.couponService = couponService;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ public void setCourseService(CourseService courseService) {
|
|
|
+ this.courseService = courseService;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public ResultVO<CourseOrderVO> updateCourseOrder(Integer orderId, Integer orderStatus) {
|
|
|
CourseOrder order = orderMapper.selectByPrimaryKey(orderId);
|
|
|
@@ -222,16 +239,6 @@ public class CourseOrderServiceImpl implements CourseOrderService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- @Override
|
|
|
- public CourseOrder queryMostRecentOrder(Integer uid, Integer courseId) {
|
|
|
- return orderMapper.queryMostRecentOrder(uid, courseId);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public CourseOrder getByPrimaryKey(Integer orderId) {
|
|
|
- return orderMapper.selectByPrimaryKey(orderId);
|
|
|
- }
|
|
|
-
|
|
|
public void updateBestCost(CourseOrderVO orderVO) {
|
|
|
List<Coupon> usedCoupons = couponService.getByOrderId(orderVO.getId());
|
|
|
boolean[] used = new boolean[usedCoupons.size()];
|