状态校验修改
This commit is contained in:
parent
c660e1714c
commit
02969a2c75
|
|
@ -39,15 +39,16 @@ public class AppOrdersController extends AbstractController {
|
|||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
private void checkWxBind(Long userId) {
|
||||
private boolean checkWxBind(Long userId) {
|
||||
CommonInfo commonInfo = commonInfoService.findOne(938);
|
||||
if (commonInfo == null || !"1".equals(commonInfo.getValue())) {
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
UserEntity userEntity = userService.queryByUserId(userId);
|
||||
if (StrUtil.isBlank(userEntity.getWxOpenId())) {
|
||||
throw new SqxException("请先绑定微信", 407);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -63,7 +64,9 @@ public class AppOrdersController extends AbstractController {
|
|||
@ApiOperation("生成商品订单")
|
||||
@Debounce(interval = 20000, value = "#userId")
|
||||
public Result insertCourseOrders(Long courseId,Long courseDetailsId, @RequestAttribute("userId") Long userId) {
|
||||
checkWxBind(userId);
|
||||
if (!checkWxBind(userId)) {
|
||||
return Result.error(407, "请先绑定微信");
|
||||
}
|
||||
return ordersService.insertCourseOrders(courseId, courseDetailsId,userId);
|
||||
}
|
||||
|
||||
|
|
@ -78,7 +81,9 @@ public class AppOrdersController extends AbstractController {
|
|||
@GetMapping("/insertCourseOrders/limit10")
|
||||
@ApiOperation("生成商品订单")
|
||||
public Result insertCourseOrdersLimit10(Long courseId, @RequestAttribute("userId") Long userId) {
|
||||
checkWxBind(userId);
|
||||
if (!checkWxBind(userId)) {
|
||||
return Result.error(407, "请先绑定微信");
|
||||
}
|
||||
return ordersService.insertCourseOrdersLimit10(courseId, userId);
|
||||
}
|
||||
|
||||
|
|
@ -86,7 +91,9 @@ public class AppOrdersController extends AbstractController {
|
|||
@GetMapping("/insertVipOrders")
|
||||
@ApiOperation("生成会员订单")
|
||||
public Result insertVipOrders(@ApiParam("会员详情信息") Long vipDetailsId, @RequestAttribute("userId") Long userId) {
|
||||
checkWxBind(userId);
|
||||
if (!checkWxBind(userId)) {
|
||||
return Result.error(407, "请先绑定微信");
|
||||
}
|
||||
return ordersService.insertVipOrders(vipDetailsId, userId);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue