|
@@ -212,13 +212,17 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
|
|
//因为页面再点击购买按钮时,会请求/userOrder/getPendingOrder接口,如果有支付中的订单,用户选择继续支付或取消订单
|
|
//因为页面再点击购买按钮时,会请求/userOrder/getPendingOrder接口,如果有支付中的订单,用户选择继续支付或取消订单
|
|
OrderSearch query = new OrderSearch();
|
|
OrderSearch query = new OrderSearch();
|
|
query.setUserId(id);
|
|
query.setUserId(id);
|
|
- query.setGoodTypes(Lists.newArrayList(GoodTypeEnum.LIVE.getCode(),GoodTypeEnum.GROUP.getCode()));
|
|
|
|
|
|
+ query.setGoodTypes(Lists.newArrayList(group.getType()));
|
|
query.setBizId(groupId);
|
|
query.setBizId(groupId);
|
|
query.setStatus(OrderStatusEnum.PAID.getCode());
|
|
query.setStatus(OrderStatusEnum.PAID.getCode());
|
|
List<UserOrderVo> userOrderVos = userOrderService.selectAllList(query);
|
|
List<UserOrderVo> userOrderVos = userOrderService.selectAllList(query);
|
|
- result.setExistBuy(0);
|
|
|
|
if (CollectionUtils.isNotEmpty(userOrderVos)) {
|
|
if (CollectionUtils.isNotEmpty(userOrderVos)) {
|
|
result.setExistBuy(1);
|
|
result.setExistBuy(1);
|
|
|
|
+ }else {
|
|
|
|
+ result.setExistBuy(0);
|
|
|
|
+ if(StringUtils.equals("GROUP",group.getType()) && Objects.equals(group.getMaxStudentNum(), group.getPreStudentNum())){
|
|
|
|
+ result.setExistBuy(2);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
@@ -351,6 +355,7 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
|
|
group.setSalesEndDate(dto.getSalesEndDate());
|
|
group.setSalesEndDate(dto.getSalesEndDate());
|
|
group.setBackgroundPic(dto.getBackgroundPic());
|
|
group.setBackgroundPic(dto.getBackgroundPic());
|
|
group.setMixStudentNum(dto.getMixStudentNum());
|
|
group.setMixStudentNum(dto.getMixStudentNum());
|
|
|
|
+ group.setMaxStudentNum(dto.getMaxStudentNum());
|
|
group.setCreatedBy(dto.getTeacherId());
|
|
group.setCreatedBy(dto.getTeacherId());
|
|
group.setCreatedTime(now);
|
|
group.setCreatedTime(now);
|
|
this.save(group);
|
|
this.save(group);
|