Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
commit
e2554bae0f
|
|
@ -1,5 +1,6 @@
|
|||
package com.sqx.modules.orders.controller.app;
|
||||
|
||||
import com.sqx.common.annotation.Debounce;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.app.annotation.Login;
|
||||
import com.sqx.modules.orders.service.OrdersService;
|
||||
|
|
@ -36,6 +37,7 @@ public class AppOrdersController extends AbstractController {
|
|||
@Login
|
||||
@GetMapping("/insertCourseOrders")
|
||||
@ApiOperation("生成商品订单")
|
||||
@Debounce(value = "#userId,#courseDetailsId")
|
||||
public Result insertCourseOrders(Long courseId,Long courseDetailsId, @RequestAttribute("userId") Long userId) {
|
||||
return ordersService.insertCourseOrders(courseId, courseDetailsId,userId);
|
||||
}
|
||||
|
|
@ -64,6 +66,7 @@ public class AppOrdersController extends AbstractController {
|
|||
@Login
|
||||
@PostMapping("/payOrders")
|
||||
@ApiOperation("支付订单")
|
||||
@Debounce(value = "#orderId")
|
||||
public Result payOrders(Long orderId){
|
||||
return ordersService.payMoney(orderId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
|||
@Override
|
||||
public Result insertCourseOrders(Long courseId, Long courseDetailsId, Long userId) {
|
||||
log.info("生成商品订单信息接口入参为:{},{}", courseId, userId);
|
||||
reentrantReadWriteLock.writeLock().lock();
|
||||
// reentrantReadWriteLock.writeLock().lock();
|
||||
try {
|
||||
CourseDetails courseDetail = courseDetailsService.getById(courseDetailsId);
|
||||
if (courseDetail != null && courseDetail.getIsPrice().equals(2)) {
|
||||
|
|
@ -325,9 +325,10 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
|||
|
||||
} catch (Exception e) {
|
||||
log.error("生成商品订单错误!!!" + e.getMessage());
|
||||
} finally {
|
||||
reentrantReadWriteLock.writeLock().unlock();
|
||||
}
|
||||
// finally {
|
||||
// reentrantReadWriteLock.writeLock().unlock();
|
||||
// }
|
||||
return Result.error("系统繁忙,请稍后再试!");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue