Bladeren bron

Merge branch 'feature/0529-live' into master_saas

shangke 2 jaren geleden
bovenliggende
commit
f71f2f8a43

+ 24 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ImLiveBroadcastRoom.java

@@ -123,6 +123,14 @@ public class ImLiveBroadcastRoom implements Serializable {
     @ApiModelProperty("购物车标题")
     private String shoppingTitle;
 
+    @TableField("group_type_")
+    @ApiModelProperty("直播间类型")
+    private String groupType;
+
+    @TableField("subject_id_")
+    @ApiModelProperty("声部编号")
+    private String subjectId;
+
     @TableField("created_by_")
     @ApiModelProperty(value = "创建人")
     private Integer createdBy;
@@ -383,5 +391,21 @@ public class ImLiveBroadcastRoom implements Serializable {
     public void setShoppingTitle(String shoppingTitle) {
         this.shoppingTitle = shoppingTitle;
     }
+
+    public String getGroupType() {
+        return groupType;
+    }
+
+    public void setGroupType(String groupType) {
+        this.groupType = groupType;
+    }
+
+    public String getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(String subjectId) {
+        this.subjectId = subjectId;
+    }
 }
 

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/VipGroupCategory.java

@@ -46,6 +46,9 @@ public class VipGroupCategory extends BaseEntity {
 	@ApiModelProperty(value = "是否乐理课")
 	private Boolean musicTheory = false;
 
+	@ApiModelProperty("购买单价id")
+	private Integer unitPriceId;
+
 	public Boolean getMusicTheory() {
 		return musicTheory;
 	}
@@ -134,6 +137,14 @@ public class VipGroupCategory extends BaseEntity {
 		this.groupType = groupType;
 	}
 
+	public Integer getUnitPriceId() {
+		return unitPriceId;
+	}
+
+	public void setUnitPriceId(Integer unitPriceId) {
+		this.unitPriceId = unitPriceId;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 3 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupDefaultClassesUnitPriceServiceImpl.java

@@ -2,6 +2,7 @@ package com.ym.mec.biz.service.impl;
 
 import com.ym.mec.biz.dal.dao.VipGroupDefaultClassesUnitPriceDao;
 import com.ym.mec.biz.dal.entity.VipGroupDefaultClassesUnitPrice;
+import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.service.VipGroupDefaultClassesUnitPriceService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
@@ -26,7 +27,8 @@ public class VipGroupDefaultClassesUnitPriceServiceImpl extends BaseServiceImpl<
 
 	@Override
 	public long insert(VipGroupDefaultClassesUnitPrice bean) {
-		if(Objects.isNull(bean.getOrganId())){
+
+		if(Objects.isNull(bean.getOrganId()) && GroupType.VIP.getCode().equals(bean.getGroupType())) {
 			throw new BizException("请选择分部");
 		}
 		VipGroupDefaultClassesUnitPrice byVipGroupCategory = vipGroupDefaultClassesUnitPriceDao.getByVipGroupCategory(bean.getVipGroupCategoryId(),

+ 3 - 1
mec-biz/src/main/resources/config/mybatis/VipGroupCategoryMapper.xml

@@ -16,6 +16,7 @@
 		<result column="online_classes_unit_price_" property="onlineClassesUnitPrice" />
 		<result column="offline_classes_unit_price_" property="offlineClassesUnitPrice" />
         <result column="tenant_id_" property="tenantId"/>
+		<result column="unit_price_id_" property="unitPriceId" />
 	</resultMap>
 
 	<!-- 根据主键查询一条记录 -->
@@ -36,8 +37,9 @@
 		    vgc.*
 		    , vgdcup.online_classes_unit_price_
 		    , vgdcup.offline_classes_unit_price_
+			, vgdcup.id_ AS unit_price_id_
 		FROM vip_group_category vgc
-		LEFT JOIN vip_group_default_classes_unit_price_ vgdcup ON vgc.id_=vgdcup.vip_group_category_id_ AND FIND_IN_SET(vgdcup.organ_id_,#{organId})
+		LEFT JOIN vip_group_default_classes_unit_price_ vgdcup ON vgc.id_=vgdcup.vip_group_category_id_ <if test="organId != null"> AND FIND_IN_SET(vgdcup.organ_id_,#{organId})</if>
 		WHERE vgc.del_flag_ != 1
 		<if test="groupType != null">
 			AND vgc.group_type_ = #{groupType}

+ 1 - 1
mec-teacher/src/main/java/com/ym/mec/teacher/controller/VipGroupCategoryController.java

@@ -108,7 +108,7 @@ public class VipGroupCategoryController extends BaseController {
 		if (CourseSchedule.CourseScheduleType.LIVE.getCode().equals(vipGroupCategory.getGroupType())) {
 
 			VipGroupDefaultClassesUnitPrice vipGroupDefaultClassesUnitPrice = new VipGroupDefaultClassesUnitPrice();
-			vipGroupDefaultClassesUnitPrice.setOrganId(-1);
+			vipGroupDefaultClassesUnitPrice.setOrganId(vipGroupCategory.getTenantId());
 			vipGroupDefaultClassesUnitPrice.setVipGroupCategoryId(vipGroupCategory.getId());
 			vipGroupDefaultClassesUnitPrice.setGroupType(vipGroupCategory.getGroupType());
 			vipGroupDefaultClassesUnitPrice.setCreateTime(DateTime.now().toDate());

+ 8 - 1
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupCategoryController.java

@@ -6,6 +6,7 @@ import com.ym.mec.biz.dal.entity.VipGroupDefaultClassesUnitPrice;
 import com.ym.mec.biz.service.VipGroupCategoryService;
 import com.ym.mec.biz.service.VipGroupDefaultClassesUnitPriceService;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.tenant.TenantContextHolder;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -46,6 +47,12 @@ public class VipGroupCategoryController extends BaseController {
 	@GetMapping(value = "/queryAll")
     @PreAuthorize("@pcs.hasPermissions('vipGroupCategory/queryAll')")
 	public Object queryAll(String organId, @RequestParam(defaultValue = "VIP") String groupType) {
+
+		// 直播课强制转换为
+		if (CourseSchedule.CourseScheduleType.LIVE.getCode().equals(groupType)) {
+			organId = String.valueOf(TenantContextHolder.getTenantId());
+		}
+
 		return succeed(vipGroupCategoryService.findAllByOrgan(organId, groupType));
 	}
 
@@ -84,7 +91,7 @@ public class VipGroupCategoryController extends BaseController {
 		if (CourseSchedule.CourseScheduleType.LIVE.getCode().equals(vipGroupCategory.getGroupType())) {
 
 			VipGroupDefaultClassesUnitPrice vipGroupDefaultClassesUnitPrice = new VipGroupDefaultClassesUnitPrice();
-			vipGroupDefaultClassesUnitPrice.setOrganId(-1);
+			vipGroupDefaultClassesUnitPrice.setOrganId(vipGroupCategory.getTenantId());
 			vipGroupDefaultClassesUnitPrice.setVipGroupCategoryId(vipGroupCategory.getId());
 			vipGroupDefaultClassesUnitPrice.setGroupType(vipGroupCategory.getGroupType());
 			vipGroupDefaultClassesUnitPrice.setCreateTime(DateTime.now().toDate());