Przeglądaj źródła

Merge branch 'zx_online_update_1218' of http://git.dayaedu.com/yonge/cooleshow into zx_online_update_1218

刘俊驰 2 dni temu
rodzic
commit
064138ad27

+ 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 = "最少成课人数")
     private Integer mixStudentNum;
 
+    @NotNull(message = "最少成课人数不能为空")
+    @Positive(message = "最少成课人数必须大于0")
+    @ApiModelProperty(value = "最少成课人数")
+    private Integer maxStudentNum;
+
     @ApiModelProperty(value = "课程类型")
     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() {
         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接口,如果有支付中的订单,用户选择继续支付或取消订单
         OrderSearch query = new OrderSearch();
         query.setUserId(id);
-        query.setGoodTypes(Lists.newArrayList(GoodTypeEnum.LIVE.getCode(),GoodTypeEnum.GROUP.getCode()));
+        query.setGoodTypes(Lists.newArrayList(group.getType()));
         query.setBizId(groupId);
         query.setStatus(OrderStatusEnum.PAID.getCode());
         List<UserOrderVo> userOrderVos = userOrderService.selectAllList(query);
-        result.setExistBuy(0);
         if (CollectionUtils.isNotEmpty(userOrderVos)) {
             result.setExistBuy(1);
+        }else {
+            result.setExistBuy(0);
+            if(StringUtils.equals("GROUP",group.getType()) && Objects.equals(group.getMaxStudentNum(), group.getPreStudentNum())){
+                result.setExistBuy(2);
+            }
         }
         return result;
     }
@@ -351,6 +355,7 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
         group.setSalesEndDate(dto.getSalesEndDate());
         group.setBackgroundPic(dto.getBackgroundPic());
         group.setMixStudentNum(dto.getMixStudentNum());
+        group.setMaxStudentNum(dto.getMaxStudentNum());
         group.setCreatedBy(dto.getTeacherId());
         group.setCreatedTime(now);
         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")
     private String imGroupId;
 
-    @ApiModelProperty(value = "当前学生有没有购买该课程组   0没有购买    1已经购买过 ")
+    @ApiModelProperty(value = "当前学生有没有购买该课程组   0没有购买,1已经购买过,2不可购买")
     private Integer existBuy;
 
     @ApiModelProperty("下架原因")