|
@@ -3,7 +3,10 @@ package com.fs.course.service.impl;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.fs.common.utils.DateUtils;
|
|
import com.fs.common.utils.DateUtils;
|
|
|
|
|
+import com.fs.common.utils.StringUtils;
|
|
|
|
|
+import com.fs.company.domain.CompanyUser;
|
|
|
import com.fs.company.mapper.CompanyUserMapper;
|
|
import com.fs.company.mapper.CompanyUserMapper;
|
|
|
|
|
+import com.fs.company.service.impl.CompanyUserServiceImpl;
|
|
|
import com.fs.course.domain.FsCourseFinishTemp;
|
|
import com.fs.course.domain.FsCourseFinishTemp;
|
|
|
import com.fs.course.domain.FsCourseWatchLog;
|
|
import com.fs.course.domain.FsCourseWatchLog;
|
|
|
import com.fs.course.mapper.FsCourseFinishTempMapper;
|
|
import com.fs.course.mapper.FsCourseFinishTempMapper;
|
|
@@ -37,6 +40,7 @@ import java.util.*;
|
|
|
import java.util.function.Consumer;
|
|
import java.util.function.Consumer;
|
|
|
import java.util.regex.Matcher;
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
import java.util.regex.Pattern;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 完课模板Service业务层处理
|
|
* 完课模板Service业务层处理
|
|
@@ -73,6 +77,9 @@ public class FsCourseFinishTempServiceImpl implements IFsCourseFinishTempService
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IQwCourseFinishRemarkRtyService finishRemarkRtyService;
|
|
private IQwCourseFinishRemarkRtyService finishRemarkRtyService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private CompanyUserServiceImpl companyUserServiceImpl;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 查询完课模板
|
|
* 查询完课模板
|
|
|
*
|
|
*
|
|
@@ -87,13 +94,27 @@ public class FsCourseFinishTempServiceImpl implements IFsCourseFinishTempService
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public FsCourseFinishTempVO selectFsCourseFinishTempByIdVO(Long id) {
|
|
public FsCourseFinishTempVO selectFsCourseFinishTempByIdVO(Long id) {
|
|
|
|
|
+
|
|
|
FsCourseFinishTempVO fsCourseFinishTemp = fsCourseFinishTempMapper.selectFsCourseFinishTempByIdVO(id);
|
|
FsCourseFinishTempVO fsCourseFinishTemp = fsCourseFinishTempMapper.selectFsCourseFinishTempByIdVO(id);
|
|
|
|
|
+ //处理部门ids
|
|
|
|
|
+ if (null != fsCourseFinishTemp) {
|
|
|
|
|
+ String deptIds = fsCourseFinishTemp.getDeptIds();
|
|
|
|
|
+ if (StringUtils.isNotBlank(deptIds)) {
|
|
|
|
|
+ List<Integer> collect = Arrays.stream(deptIds.split(",")).mapToInt(Integer::parseInt).boxed().collect(Collectors.toList());
|
|
|
|
|
+ fsCourseFinishTemp.setDeptArrs(collect);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
String companyUserIds = fsCourseFinishTemp.getCompanyUserIds();
|
|
String companyUserIds = fsCourseFinishTemp.getCompanyUserIds();
|
|
|
- List<String> qwUserIdsList = Arrays.asList(companyUserIds.split(","));
|
|
|
|
|
|
|
|
|
|
- List<QwUserVO> qwUserByIds = qwUserMapper.getQwUserByIdsNoCropId(qwUserIdsList);
|
|
|
|
|
- fsCourseFinishTemp.setUserSelectList(qwUserByIds);
|
|
|
|
|
|
|
+ if (!StringUtil.strIsNullOrEmpty(companyUserIds)) {
|
|
|
|
|
+ List<String> qwUserIdsList = Arrays.asList(companyUserIds.split(","));
|
|
|
|
|
+
|
|
|
|
|
+ List<QwUserVO> qwUserByIds = qwUserMapper.getQwUserByIdsNoCropId(qwUserIdsList);
|
|
|
|
|
+
|
|
|
|
|
+ fsCourseFinishTemp.setUserSelectList(qwUserByIds);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
return fsCourseFinishTemp;
|
|
return fsCourseFinishTemp;
|
|
|
}
|
|
}
|
|
@@ -385,6 +406,32 @@ public class FsCourseFinishTempServiceImpl implements IFsCourseFinishTempService
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public FsCourseFinishTemp getFsCourseFinishTempSop(Long companyUserId, Long companyId, Long videoId, Long userId) {
|
|
|
|
|
+
|
|
|
|
|
+ FsCourseFinishTemp userTemp = fsCourseFinishTempMapper.selectFsCourseFinishTempByCompanyUserIdAndCompanyId(companyUserId, videoId,companyId);
|
|
|
|
|
+ if (userTemp != null) {
|
|
|
|
|
+ return userTemp;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //获取用户部门id userId
|
|
|
|
|
+ CompanyUser companyUser = companyUserServiceImpl.selectCompanyUserByCompanyUserId(userId);
|
|
|
|
|
+ Long deptId = companyUser.getDeptId();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ FsCourseFinishTemp deptTemp = fsCourseFinishTempMapper.selectFsCourseFinishTempByDeptId(deptId, videoId);
|
|
|
|
|
+ if(null != deptTemp){
|
|
|
|
|
+ return deptTemp;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ FsCourseFinishTemp companyTemp = fsCourseFinishTempMapper.selectAllCompanyFsCourseFinishTempByCompanyId(companyId, videoId);
|
|
|
|
|
+ if(null != companyTemp){
|
|
|
|
|
+ return companyTemp;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// @Override
|
|
// @Override
|
|
|
// public void updateFsCourseFinishTempByCompanyUserId() {
|
|
// public void updateFsCourseFinishTempByCompanyUserId() {
|
|
|
// List<FsCourseFinishTemp> fsCourseFinishTemps = fsCourseFinishTempMapper.selectFsCourseFinishTempByCompanyList();
|
|
// List<FsCourseFinishTemp> fsCourseFinishTemps = fsCourseFinishTempMapper.selectFsCourseFinishTempByCompanyList();
|