Browse Source

Merge remote-tracking branch 'origin/master'

ct 2 months ago
parent
commit
7ec41aa535

+ 7 - 1
fs-admin/src/main/java/com/fs/course/controller/FsUserCourseVideoController.java

@@ -191,7 +191,13 @@ public class FsUserCourseVideoController extends BaseController
         // 设置项目ID
         FsUserCourse fsUserCourse = fsUserCourseService.selectFsUserCourseByCourseId(vo.getCourseId());
         vo.setProjectId(fsUserCourse.getProject());
-
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+            vo.setUserId(userId);
+        }
         fsUserCourseVideoService.batchSaveVideo(vo);
         return R.ok();
     }

+ 3 - 2
fs-company/src/main/java/com/fs/user/FsUserAdminController.java

@@ -58,12 +58,13 @@ public class FsUserAdminController extends BaseController {
         //startPage();
 
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        if (param.getIsMyFsUser()){
+       /* if (param.getIsMyFsUser()){
             param.setCompanyId(loginUser.getCompany().getCompanyId());
             param.setCompanyUserId(String.valueOf(loginUser.getUser().getUserId()));
         }else {
             param.setCompanyId(loginUser.getCompany().getCompanyId());
-        }
+        }*/
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
         if(param.getPhone()!=null && !"".equals(param.getPhone())){
             param.setPhone(PhoneUtil.encryptPhone(param.getPhone()));
         }

+ 8 - 3
fs-service/src/main/java/com/fs/company/service/impl/CompanyServiceImpl.java

@@ -45,6 +45,8 @@ import org.springframework.stereotype.Service;
 import com.fs.company.service.ICompanyService;
 import org.springframework.transaction.annotation.Transactional;
 
+import static com.fs.company.service.impl.CompanyMiniappServiceImpl.GET_MINI_APP_STR;
+
 /**
  * 企业Service业务层处理
  *
@@ -105,9 +107,12 @@ public class CompanyServiceImpl implements ICompanyService
      * @return 企业
      */
     @Override
-    public Company selectCompanyById(Long companyId)
-    {
-        return companyMapper.selectCompanyById(companyId);
+    public Company selectCompanyById(Long companyId){
+        Company company = companyMapper.selectCompanyById(companyId);
+        List<CompanyMiniapp> miniApp = companyMiniappService.getMiniAppListByCompanyList(Collections.singletonList(company.getCompanyId()));
+        company.setMiniAppMaster(GET_MINI_APP_STR.apply(0, miniApp));
+        company.setMiniAppServer(GET_MINI_APP_STR.apply(1, miniApp));
+        return company;
     }
 
     /**

+ 2 - 0
fs-service/src/main/java/com/fs/course/param/BatchVideoSvae.java

@@ -11,4 +11,6 @@ public class BatchVideoSvae {
 
     // 项目ID
     private Long projectId;
+
+    private Long userId;
 }

+ 2 - 0
fs-service/src/main/java/com/fs/course/param/FsUserCourseVideoFinishUParam.java

@@ -22,4 +22,6 @@ public class FsUserCourseVideoFinishUParam implements Serializable {
     private Integer linkType;
     private Integer isRoom;//是否群聊
     private Integer isOpen;//是否公开课
+    private Long periodId;
+    private Integer projectId;
 }

+ 1 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -1905,6 +1905,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
 
         List<FsUserCourseVideo> collect = videoResourceList.stream().map(e -> {
             FsUserCourseVideo entity = new FsUserCourseVideo();
+            entity.setUserId(vo.getUserId());
             entity.setTitle(e.getResourceName());
             entity.setVideoUrl(e.getVideoUrl());
             entity.setThumbnail(e.getThumbnail());

+ 3 - 1
fs-service/src/main/resources/mapper/course/FsUserCourseVideoMapper.xml

@@ -163,6 +163,7 @@
         file_size,
         file_key,
         is_transcode,
+        user_id,
         project_id
         )
         values
@@ -184,6 +185,7 @@
             #{item.fileSize},
             #{item.fileKey},
             #{item.isTranscode},
+            #{item.userId},
             #{item.projectId}
             )
         </foreach>
@@ -363,7 +365,7 @@
         select *  from fs_user_course_video
         where video_id=#{videoId} and is_del = 0
         <if test="userId != null">
-            user_id = #{userId}
+           and user_id = #{userId}
         </if>
     </select>