Browse Source

Merge remote-tracking branch 'origin/master_saas' into master_saas

zouxuan 3 years ago
parent
commit
261f05c5c3

+ 4 - 0
audio-analysis/src/main/java/com/yonge/netty/dto/UserChannelContext.java

@@ -764,6 +764,10 @@ public class UserChannelContext {
 			totalTimes = totalTimes + entry.getValue();
 		}
 		
+		if(totalTimes == 0){
+			totalTimes = chunkList.size();
+		}
+		
 		if (maxTimes / totalTimes < hardLevel.getIntegrityRange()) {
 			tempo = false;
 			LOGGER.debug("节奏错误原因:不是同一个音");

+ 1 - 1
audio-analysis/src/main/resources/logback-spring.xml

@@ -27,7 +27,7 @@
 		</encoder>
 	</appender>
 
-	<logger name="com.yonge.audio" level="dev" />
+	<logger name="com.yonge" level="dev" />
 
 	<!--开发环境:打印控制台 -->
 	<springProfile name="dev">

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Student.java

@@ -76,6 +76,8 @@ public class Student extends SysUser {
 	private String activityCourseDetail;
 
 	private Integer countFlag;
+	
+	private String extSubjectIds;
 
 	@ApiModelProperty(value = "家长姓名")
 	private String parentName;
@@ -316,4 +318,12 @@ public class Student extends SysUser {
 	public void setParentName(String parentName) {
 		this.parentName = parentName;
 	}
+
+	public String getExtSubjectIds() {
+		return extSubjectIds;
+	}
+
+	public void setExtSubjectIds(String extSubjectIds) {
+		this.extSubjectIds = extSubjectIds;
+	}
 }

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/ImLiveBroadcastRoomService.java

@@ -29,6 +29,8 @@ public interface ImLiveBroadcastRoomService extends IService<ImLiveBroadcastRoom
 
     void update(ImLiveBroadcastRoomDto dto);
 
+    void whetherChat(Integer id, Integer whetherChat);
+
     void roomDestroy(Integer id);
 
     void delete(Integer id);

+ 34 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImLiveBroadcastRoomServiceImpl.java

@@ -39,6 +39,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.io.Serializable;
 import java.util.*;
@@ -150,6 +151,7 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
      * @param dto 直播间信息
      */
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public void add(ImLiveBroadcastRoomDto dto) {
         SysUser sysUser = getSysUser(dto.getSpeakerId());
         ImLiveBroadcastRoom obj = new ImLiveBroadcastRoom();
@@ -173,6 +175,7 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
      * @param dto
      */
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public void update(ImLiveBroadcastRoomDto dto) {
         ImLiveBroadcastRoom obj = this.getById(dto.getId());
         if (obj.getLiveState() == 1) {
@@ -188,11 +191,31 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
     }
 
     /**
+     * 是否禁言
+     *
+     * @param id          房间id
+     * @param whetherChat 是否允许聊天互动  0允许 1不允许
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void whetherChat(Integer id, Integer whetherChat) {
+        ImLiveBroadcastRoom obj = this.getById(id);
+        ImLiveBroadcastRoomDto.RoomConfig roomConfig = getRoomConfig(obj.getRoomConfig()).orElse(null);
+        if (Objects.isNull(roomConfig)) {
+            return;
+        }
+        roomConfig.setWhether_chat(whetherChat);
+        obj.setRoomConfig(JSONObject.toJSONString(roomConfig));
+        this.updateById(obj);
+    }
+
+    /**
      * 删除直播间
      *
      * @param id 直播间id
      */
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public void delete(Integer id) {
         ImLiveBroadcastRoom obj = this.getById(id);
         if (obj.getLiveState() == 1) {
@@ -259,7 +282,7 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
                 //现在时间 大于 (退出房间的时间 + expiredMinute 分钟),则销毁
                 if (Objects.nonNull(speakerInfo.getExitRoomTime())) {
                     Date comparedTime = DateUtil.addMinutes(speakerInfo.getExitRoomTime(), expiredMinute);
-                    if (now.getTime() >= comparedTime.getTime()) {
+                    if (now.getTime() >= comparedTime.getTime() && speakerInfo.getState() != 0) {
                         roomDestroy(room);
                     }
                 }
@@ -620,8 +643,7 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
 
             //查询房间信息是否允许录像
             ImLiveBroadcastRoom one = this.getOne(new QueryWrapper<ImLiveBroadcastRoom>().eq("room_uid_", room.getRoomUid()));
-            boolean video = Optional.ofNullable(one.getRoomConfig())
-                    .map(c -> JSON.parseObject(c, ImLiveBroadcastRoomDto.RoomConfig.class))
+            boolean video = getRoomConfig(one.getRoomConfig())
                     .filter(c -> Objects.nonNull(c.getWhether_video()))
                     .map(c -> c.getWhether_video() == 0)
                     .orElse(false);
@@ -651,6 +673,11 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
         }
     }
 
+    private Optional<ImLiveBroadcastRoomDto.RoomConfig> getRoomConfig(String roomConfig) {
+        return Optional.ofNullable(roomConfig)
+                .map(c -> JSON.parseObject(c, ImLiveBroadcastRoomDto.RoomConfig.class));
+    }
+
     private void getRoomData(ImLiveBroadcastRoomVo roomVo) {
         //点赞数
         Object like = redissonClient.getBucket(LIVE_ROOM_LIKE.replace(ROOM_UID, roomVo.getRoomUid())).get();
@@ -687,6 +714,10 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
      * 测试
      */
     public Map<String, Object> test(String roomUid, Integer userId) {
+        if (1 == 1) {
+            destroyExpiredLiveRoom();
+            return null;
+        }
         //test
         Map<String, Object> result = new HashMap<>();
         //点赞数

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

@@ -126,9 +126,11 @@ public class PayServiceImpl implements PayService {
 	        		throw new BizException("平台收款账户查询失败");
 	        	}
 	        	
+	        	Integer routeOrganId = 38;
+	        	
 	        	StudentPaymentRouteOrder studentPaymentRouteOrder = new StudentPaymentRouteOrder();
 	            studentPaymentRouteOrder.setOrderNo(orderNo);
-	            studentPaymentRouteOrder.setRouteOrganId(organId);
+	            studentPaymentRouteOrder.setRouteOrganId(routeOrganId);
 	            studentPaymentRouteOrder.setFeeFlag("Y");
 	            studentPaymentRouteOrder.setRouteAmount(amount);
 	            studentPaymentRouteOrder.setRouteBalanceAmount(balanceAmount);

+ 9 - 2
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -35,6 +35,7 @@
         <result column="phone_" property="phone"/>
         <result column="username_" property="username"/>
         <result column="count_flag_" property="countFlag"/>
+        <result column="ext_subject_ids_" property="extSubjectIds"/>
         <result column="tenant_id_" property="tenantId"/>
     </resultMap>
 
@@ -88,7 +89,7 @@
         </if>
         teacher_id_,create_time_,update_time_,service_tag_update_time_,cooperation_organ_id_,
         care_package_,come_on_package_,member_rank_setting_id_,membership_start_time_,
-        membership_end_time_,current_grade_num_,current_class_,tenant_id_)
+        membership_end_time_,current_grade_num_,current_class_,ext_subject_ids_,tenant_id_)
         VALUES
         (#{userId},#{schoolName},#{subjectIdList},
         <if test="serviceTag != null">
@@ -99,7 +100,7 @@
         </if>
         #{teacherId},NOW(),NOW(),NOW(),#{cooperationOrganId},
          #{carePackage},#{comeOnPackage},#{memberRankSettingId},#{membershipStartTime},
-         #{membershipEndTime},#{currentGradeNum},#{currentClass},#{tenantId})
+         #{membershipEndTime},#{currentGradeNum},#{currentClass},#{extSubjectIds},#{tenantId})
     </insert>
 
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.Student">
@@ -160,6 +161,9 @@
             <if test="activityCourseDetail != null">
                 activity_course_detail_=#{activityCourseDetail},
             </if>
+            <if test="extSubjectIds != null">
+                ext_subject_ids_=#{extSubjectIds},
+            </if>
                 cooperation_organ_id_=#{cooperationOrganId},
                 update_time_ = NOW()
         </set>
@@ -286,6 +290,9 @@
 	            <if test="item.membershipEndTime != null">
 	                membership_end_time_=#{item.membershipEndTime},
 	            </if>
+	            <if test="item.extSubjectIds != null">
+	                ext_subject_ids_=#{item.extSubjectIds},
+	            </if>
                 update_time_ = NOW()
             </set>
             WHERE user_id_ = #{item.userId} and tenant_id_ = #{item.tenantId}

+ 18 - 4
mec-web/src/main/java/com/ym/mec/web/controller/ImLiveBroadcastRoomController.java

@@ -11,6 +11,7 @@ import com.ym.mec.common.entity.ImUserState;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.WrapperUtil;
 import io.swagger.annotations.*;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -63,7 +64,7 @@ public class ImLiveBroadcastRoomController extends BaseController {
 
     @ApiOperation("创建直播间")
     @PostMapping("/add")
-//    @PreAuthorize("@pcs.hasPermissions('imLiveBroadcastRoom/add')")
+    @PreAuthorize("@pcs.hasPermissions('imLiveBroadcastRoom/add')")
     public HttpResponseResult add(@Valid @RequestBody ImLiveBroadcastRoomDto dto) {
         imLiveBroadcastRoomService.add(dto);
         return succeed();
@@ -71,20 +72,33 @@ public class ImLiveBroadcastRoomController extends BaseController {
 
     @ApiOperation("修改直播间信息-已开播无法修改")
     @PostMapping("/update")
-//    @PreAuthorize("@pcs.hasPermissions('imLiveBroadcastRoom/update')")
+    @PreAuthorize("@pcs.hasPermissions('imLiveBroadcastRoom/update')")
     public HttpResponseResult update(@Valid @RequestBody ImLiveBroadcastRoomDto dto) {
         imLiveBroadcastRoomService.update(dto);
         return succeed();
     }
 
     /**
+     * 修改是否禁言
+     *
+     * @param id          房间表id
+     * @param whetherChat 是否允许聊天互动 0允许 1不允许
+     */
+    @ApiOperation("修改是否禁言")
+    @GetMapping(value = "/whetherChat/{id}")
+    public HttpResponseResult whetherChat(@ApiParam(value = "房间表id", required = true) @PathVariable("id") Integer id,
+                                          @ApiParam(value = "是否允许聊天互动 0允许 1不允许", required = true) Integer whetherChat) {
+        imLiveBroadcastRoomService.whetherChat(id, whetherChat);
+        return succeed();
+    }
+
+    /**
      * 关闭直播间
      *
      * @param id 房间表id
      */
     @ApiOperation("关闭直播间")
     @GetMapping(value = "/roomDestroy/{id}")
-//    @PreAuthorize("@pcs.hasPermissions('imLiveBroadcastRoom/roomDestroy')")
     public HttpResponseResult roomDestroy(@ApiParam(value = "房间表id", required = true) @PathVariable("id") Integer id) {
         imLiveBroadcastRoomService.roomDestroy(id);
         return succeed();
@@ -95,7 +109,7 @@ public class ImLiveBroadcastRoomController extends BaseController {
     })
     @ApiOperation("删除直播间信息-已开播无法删除")
     @PostMapping("/delete")
-//    @PreAuthorize("@pcs.hasPermissions('imLiveBroadcastRoom/delete')")
+    @PreAuthorize("@pcs.hasPermissions('imLiveBroadcastRoom/delete')")
     public HttpResponseResult delete(@RequestBody Map<String, Object> param) {
         Integer id = WrapperUtil.toInt(param, "id", "请传入房间id");
         imLiveBroadcastRoomService.delete(id);

+ 4 - 4
mec-web/src/main/java/com/ym/mec/web/controller/StudentRegistrationController.java

@@ -316,12 +316,12 @@ public class StudentRegistrationController extends BaseController {
         try {
             HSSFWorkbook workbook = null;
             if (musicGroup.getCourseViewType().equals(CourseViewTypeEnum.MEMBER_FEE)) {
-                String[] header = {"学员编号", "学员姓名", "性别", "联系电话", "年级班级", "选报声部1", "选报声部2","老师推荐专业","选报专业", "是否服从调剂", "乐器准备方式", "练习系统"};
-                String[] body = {"userId", "userName", "gender == 1 ? '男' : '女'", "phone", "currentGrade", "subjectFirstName", "subjectSecondName","teacherRecommandSubjectName","selectionSubjectName", "isAllowAdjust ? '是' : '否'", "kitPurchaseMethod", "cloudTeacherMethod"};
+                String[] header = {"学员编号", "学员姓名", "性别", "联系电话", "年级班级", "选报声部1", "选报声部2","老师推荐专业","选报专业", "乐器准备方式", "练习系统"};
+                String[] body = {"userId", "userName", "gender == 1 ? '男' : '女'", "phone", "currentGrade", "subjectFirstName", "subjectSecondName","teacherRecommandSubjectName","selectionSubjectName", "kitPurchaseMethod", "cloudTeacherMethod"};
                 workbook = POIUtil.exportExcel(header, body, studentPreRegistration.getRows());
             } else {
-                String[] header = {"学员编号", "学员姓名", "性别", "联系电话", "年级班级", "选报声部1", "选报声部2","老师推荐专业","选报专业", "是否服从调剂", "乐器准备方式", "练习系统"};
-                String[] body = {"userId", "userName", "gender == 1 ? '男' : '女'", "phone", "currentGrade", "subjectFirstName", "subjectSecondName","teacherRecommandSubjectName","selectionSubjectName", "isAllowAdjust ? '是' : '否'", "kitPurchaseMethod", "cloudTeacherMethod"};
+                String[] header = {"学员编号", "学员姓名", "性别", "联系电话", "年级班级", "选报声部1", "选报声部2","老师推荐专业","选报专业", "乐器准备方式", "练习系统"};
+                String[] body = {"userId", "userName", "gender == 1 ? '男' : '女'", "phone", "currentGrade", "subjectFirstName", "subjectSecondName","teacherRecommandSubjectName","selectionSubjectName", "kitPurchaseMethod", "cloudTeacherMethod"};
                 workbook = POIUtil.exportExcel(header, body, studentPreRegistration.getRows());
             }