2 Commits dc6492b3bc ... 52ab6f204b

Author SHA1 Message Date
  zouxuan 52ab6f204b Merge branch 'zx_online_update_1218' of http://git.dayaedu.com/yonge/cooleshow into develop-new 2 days ago
  zouxuan e4a432e40e 小组课 2 days ago

+ 13 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/LiveCourseGroupDto.java

@@ -76,6 +76,11 @@ public class LiveCourseGroupDto implements Serializable {
     @ApiModelProperty(value = "最少成课人数")
     @ApiModelProperty(value = "最少成课人数")
     private Integer mixStudentNum;
     private Integer mixStudentNum;
 
 
+    @NotNull(message = "最少成课人数不能为空")
+    @Positive(message = "最少成课人数必须大于0")
+    @ApiModelProperty(value = "最少成课人数")
+    private Integer maxStudentNum;
+
     @ApiModelProperty(value = "课程类型")
     @ApiModelProperty(value = "课程类型")
     private String courseType;
     private String courseType;
 
 
@@ -144,6 +149,14 @@ public class LiveCourseGroupDto implements Serializable {
         }
         }
     }
     }
 
 
+    public Integer getMaxStudentNum() {
+        return maxStudentNum;
+    }
+
+    public void setMaxStudentNum(Integer maxStudentNum) {
+        this.maxStudentNum = maxStudentNum;
+    }
+
     public String getCourseType() {
     public String getCourseType() {
         return courseType;
         return courseType;
     }
     }

+ 7 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseGroupServiceImpl.java

@@ -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);

+ 1 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/CourseGroupVo.java

@@ -89,7 +89,7 @@ public class CourseGroupVo implements Serializable {
     @ApiModelProperty(value = "直播课成课后生成的im群id")
     @ApiModelProperty(value = "直播课成课后生成的im群id")
     private String imGroupId;
     private String imGroupId;
 
 
-    @ApiModelProperty(value = "当前学生有没有购买该课程组   0没有购买    1已经购买过 ")
+    @ApiModelProperty(value = "当前学生有没有购买该课程组   0没有购买,1已经购买过,2不可购买")
     private Integer existBuy;
     private Integer existBuy;
 
 
     @ApiModelProperty("下架原因")
     @ApiModelProperty("下架原因")