Browse Source

Merge remote-tracking branch 'origin/feature/0529-live' into feature/0529-live

shangke 2 years ago
parent
commit
689f5e1ce1

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ImLiveBroadcastRoomDto.java

@@ -30,6 +30,9 @@ public class ImLiveBroadcastRoomDto implements Serializable {
     @ApiModelProperty(value = "主讲人id/老师id")
     private Integer speakerId;
 
+
+    @ApiModelProperty(value = "主讲人名称")
+    private String speakerName;
     @ApiModelProperty("用户类型 TEACHER 老师 EDUCATION 教务端")
     private SysUserType clientType;
 
@@ -79,6 +82,15 @@ public class ImLiveBroadcastRoomDto implements Serializable {
     @ApiModelProperty("声部")
     private String subjectId;
 
+
+    public String getSpeakerName() {
+        return speakerName;
+    }
+
+    public void setSpeakerName(String speakerName) {
+        this.speakerName = speakerName;
+    }
+
     public ImLiveBroadcastRoomDto groupType(String groupType) {
         this.groupType = groupType;
         return this;

+ 36 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -248,6 +248,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
     @Autowired
     private SysUserCashAccountLogService sysUserCashAccountLogService;
 
+    @Autowired
+    private ImLiveBroadcastRoomService imLiveBroadcastRoomService;
+
     private static final Logger LOGGER = LoggerFactory.getLogger(VipGroup.class);
 
     @Override
@@ -374,6 +377,10 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
             // 计算老师课薪
             costInfo = countVipGroupPredictFee1(vipGroupApplyBaseInfoDto, vipGroupApplyBaseInfoDto.getUserId(), null);
         }
+        if (CourseSchedule.CourseScheduleType.LIVE.getCode().equals(groupType)) {
+            costInfo.put("totalPrice",
+                    vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice().multiply(new BigDecimal(vipGroupApplyBaseInfoDto.getOnlineClassesNum())));
+        }
 
         vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.PASS);
 
@@ -383,7 +390,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 //			vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.ING);
 //		}
 
-        vipGroupApplyBaseInfoDto.setTotalPrice(costInfo.getOrDefault("totalPrice", ZERO));
+         vipGroupApplyBaseInfoDto.setTotalPrice(costInfo.getOrDefault("totalPrice", ZERO));
         if (CollectionUtils.isEmpty(vscps)) {
             vscps = new ArrayList<>();
             for (Integer canBuyStudentId : canBuyStudentIds) {
@@ -1601,6 +1608,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
     public PageInfo<VipGroup> findVipGroups(VipGroupQueryInfo queryInfo) {
         if (queryInfo.getGroupType().equals(GroupType.LIVE.getCode())) {
             queryInfo.setOrganId(null);
+            queryInfo.setLiveOrganId(null);
         }
         PageInfo pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
         Map<String, Object> params = new HashMap<>();
@@ -4441,13 +4449,39 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
         VipGroupApplyBaseInfoDto baseInfoDto = JSON.parseObject(JSON.toJSONString(vipGroup), VipGroupApplyBaseInfoDto.class);
 
+        vipGroupApplyDto.setVipGroupApplyBaseInfo(baseInfoDto);
         //  分部名  声部  乐团主管
 
         String organIdList = baseInfoDto.getOrganIdList();
 
         baseInfoDto.setOrganName(organizationDao.findByOrganIds(organIdList).stream().collect(Collectors.joining(",")));
 
-        // todo
+        Integer educationalTeacherId = baseInfoDto.getEducationalTeacherId();
+        if (Objects.nonNull(educationalTeacherId)) {
+            baseInfoDto.setEducationalTeacherName(sysUserService.queryUserById(educationalTeacherId).getRealName());
+        }
+
+        // 设置课程
+        List<CourseSchedule> courseSchedules = JSON.parseArray(baseInfoDto.getCourseSchedulesJson(), CourseSchedule.class);
+
+        vipGroupApplyDto.setCourseSchedules(courseSchedules);
+
+        // 直播信息
+        ImLiveBroadcastRoomDto imLiveBroadcastRoomDto = JSON.parseObject(baseInfoDto.getLiveConfigJson(), ImLiveBroadcastRoomDto.class);
+
+        vipGroupApplyDto.setLiveBroadcastRoom(imLiveBroadcastRoomDto);
+        // 主讲人信息
+        SysUser sysUser = sysUserService.queryUserById(imLiveBroadcastRoomDto.getSpeakerId());
+        imLiveBroadcastRoomDto.setSpeakerName(sysUser.getRealName());
+
+
+        String subjectId = imLiveBroadcastRoomDto.getSubjectId();
+        if ("-1".equals(subjectId)) {
+            baseInfoDto.setSubjectName("乐理");
+        } else {
+            baseInfoDto.setSubjectName(subjectDao.findNames(subjectId));
+        }
+
         return vipGroupApplyDto;
 
     }

+ 1 - 0
mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml

@@ -47,6 +47,7 @@
         <result column="educational_teacher_id_" property="educationalTeacherId"/>
         <result column="vip_group_category_name_" property="vipGroupCategoryName"/>
         <result column="educational_teacher_name_" property="educationalTeacherName" />
+        <result column="live_config_json_" property="liveConfigJson" />
         <result column="tenant_id_" property="tenantId" />
     </resultMap>
 

+ 2 - 2
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/eseal/provider/TsignPlugin.java

@@ -57,7 +57,7 @@ public class TsignPlugin implements ESealPlugin, InitializingBean, DisposableBea
 
     @Override
     public void afterPropertiesSet() {
-        /*ProjectConfig projectconfig = new ProjectConfig();
+        ProjectConfig projectconfig = new ProjectConfig();
         projectconfig.setProjectId(projectId);
         projectconfig.setProjectSecret(projectSecret);
         projectconfig.setItsmApiUrl(apisUrl);
@@ -69,7 +69,7 @@ public class TsignPlugin implements ESealPlugin, InitializingBean, DisposableBea
         serviceClient = ServiceClientManager.get(projectId);
         if (serviceClient == null) {
             throw new ThirdpartyException("获取e签宝客户端失败");
-        }*/
+        }
     }
 
     @Override

+ 3 - 0
mec-web/src/main/java/com/ym/mec/web/controller/TaskController.java

@@ -628,7 +628,10 @@ public class TaskController extends BaseController {
     @ApiOperation("定时任务-修改训练营状态-每天0点执行")
     @GetMapping(value = "/checkCampState")
     public void  checkCampState(){
+		//修改训练营状态
         tempLittleArtistTrainingCampService.checkCampState();
+		//直播课排课
+
     }
 
     @ApiOperation("统计老师课程云教练使用时长")