|
@@ -37,6 +37,7 @@ import com.fs.his.service.IFsUserNewTaskService;
|
|
import com.fs.his.vo.OptionsVO;
|
|
import com.fs.his.vo.OptionsVO;
|
|
import com.fs.qw.domain.QwCompany;
|
|
import com.fs.qw.domain.QwCompany;
|
|
import com.fs.qw.service.IQwCompanyService;
|
|
import com.fs.qw.service.IQwCompanyService;
|
|
|
|
+import com.fs.qw.service.impl.AsyncUploadQwCourseImageService;
|
|
import com.fs.qwApi.Result.QwUploadResult;
|
|
import com.fs.qwApi.Result.QwUploadResult;
|
|
import com.fs.qwApi.service.QwApiService;
|
|
import com.fs.qwApi.service.QwApiService;
|
|
import com.fs.system.service.ISysConfigService;
|
|
import com.fs.system.service.ISysConfigService;
|
|
@@ -111,6 +112,10 @@ public class FsUserCourseServiceImpl implements IFsUserCourseService
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private RedisCache redisCache;
|
|
private RedisCache redisCache;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private AsyncUploadQwCourseImageService asyncUploadQwCourseImageService;
|
|
|
|
+
|
|
private static final String realLink = "/courseH5/pages/course/learning?course=";
|
|
private static final String realLink = "/courseH5/pages/course/learning?course=";
|
|
public static final String shortLink = "/courseH5/pages/course/learning?s=";
|
|
public static final String shortLink = "/courseH5/pages/course/learning?s=";
|
|
|
|
|
|
@@ -148,8 +153,14 @@ public class FsUserCourseServiceImpl implements IFsUserCourseService
|
|
@Override
|
|
@Override
|
|
public int insertFsUserCourse(FsUserCourse fsUserCourse)
|
|
public int insertFsUserCourse(FsUserCourse fsUserCourse)
|
|
{
|
|
{
|
|
|
|
+
|
|
|
|
+ if (fsUserCourse.getIsPrivate()==1){
|
|
|
|
+ asyncUploadQwCourseImageService.uploadQwCourseImage(fsUserCourse);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
fsUserCourse.setCreateTime(DateUtils.getNowDate());
|
|
fsUserCourse.setCreateTime(DateUtils.getNowDate());
|
|
- return fsUserCourseMapper.insertFsUserCourse(fsUserCourse);
|
|
|
|
|
|
+ return fsUserCourseMapper.insertFsUserCourse(fsUserCourse);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -161,6 +172,10 @@ public class FsUserCourseServiceImpl implements IFsUserCourseService
|
|
@Override
|
|
@Override
|
|
public int updateFsUserCourse(FsUserCourse fsUserCourse)
|
|
public int updateFsUserCourse(FsUserCourse fsUserCourse)
|
|
{
|
|
{
|
|
|
|
+ if (fsUserCourse.getIsPrivate()==1) {
|
|
|
|
+ asyncUploadQwCourseImageService.uploadQwCourseImage(fsUserCourse);
|
|
|
|
+ }
|
|
|
|
+
|
|
fsUserCourse.setUpdateTime(DateUtils.getNowDate());
|
|
fsUserCourse.setUpdateTime(DateUtils.getNowDate());
|
|
return fsUserCourseMapper.updateFsUserCourse(fsUserCourse);
|
|
return fsUserCourseMapper.updateFsUserCourse(fsUserCourse);
|
|
}
|
|
}
|
|
@@ -726,7 +741,7 @@ public class FsUserCourseServiceImpl implements IFsUserCourseService
|
|
* @param corpId 企业ID
|
|
* @param corpId 企业ID
|
|
* @throws Exception 上传过程中的异常
|
|
* @throws Exception 上传过程中的异常
|
|
*/
|
|
*/
|
|
- private void uploadCourseImage(FsUserCourse course, String corpId) throws Exception {
|
|
|
|
|
|
+ public void uploadCourseImage(FsUserCourse course, String corpId) throws Exception {
|
|
File imageFile = null;
|
|
File imageFile = null;
|
|
try {
|
|
try {
|
|
// 将图片URL转为本地临时文件
|
|
// 将图片URL转为本地临时文件
|