|
|
@@ -21,14 +21,16 @@ import com.fs.course.param.*;
|
|
|
import com.fs.course.service.*;
|
|
|
import com.fs.course.service.impl.TencentCloudCosService;
|
|
|
import com.fs.course.vo.*;
|
|
|
+import com.fs.his.domain.FsUser;
|
|
|
import com.fs.his.enums.FsUserOperationEnum;
|
|
|
import com.fs.his.service.IFsIntegralGoodsService;
|
|
|
+import com.fs.his.service.IFsUserService;
|
|
|
import com.fs.sop.domain.QwSop;
|
|
|
import com.fs.sop.service.IQwSopService;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
-import com.hc.openapi.tool.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import io.jsonwebtoken.Claims;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
@@ -85,6 +87,8 @@ public class CourseQwController extends AppBaseController {
|
|
|
private IQwSopService qwSopService;
|
|
|
@Autowired
|
|
|
private FsUserCourseVideoRedPackageMapper fsUserCourseVideoRedPackageMapper;
|
|
|
+ @Autowired
|
|
|
+ private IFsUserService userService;
|
|
|
@ApiOperation("查询全部公域的课程")
|
|
|
@GetMapping("/getAppletCourse")
|
|
|
public R getAppletCourse()
|
|
|
@@ -299,6 +303,21 @@ public class CourseQwController extends AppBaseController {
|
|
|
R r = null;
|
|
|
Long userId = Long.parseLong(getUserId());
|
|
|
param.setUserId(userId);
|
|
|
+
|
|
|
+ // 记录appId到fs_user表
|
|
|
+ if (StringUtils.isNotEmpty(param.getAppId())) {
|
|
|
+ FsUser user = userService.selectFsUserByUserId(userId);
|
|
|
+ if (user != null) {
|
|
|
+ String updatedAppId = addAppIdIfNotExists(user.getAppId(), param.getAppId());
|
|
|
+ if (!updatedAppId.equals(user.getAppId())) {
|
|
|
+ FsUser userUpdate = new FsUser();
|
|
|
+ userUpdate.setUserId(userId);
|
|
|
+ userUpdate.setAppId(updatedAppId);
|
|
|
+ userService.updateFsUser(userUpdate);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if(param.getIsOpen() == null || param.getIsOpen() == 0){
|
|
|
r = courseVideoService.isAddKf(param);
|
|
|
}else{
|
|
|
@@ -467,4 +486,34 @@ public class CourseQwController extends AppBaseController {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 添加appId到用户的appId列表中(如果不存在)
|
|
|
+ * @param currentAppIds 当前用户已有的appId列表(逗号分隔)
|
|
|
+ * @param newAppId 新的appId
|
|
|
+ * @return 更新后的appId列表
|
|
|
+ */
|
|
|
+ private String addAppIdIfNotExists(String currentAppIds, String newAppId) {
|
|
|
+ // 如果新appId为空,返回原值
|
|
|
+ if (StringUtils.isEmpty(newAppId)) {
|
|
|
+ return currentAppIds == null ? "" : currentAppIds;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果当前appId为空,直接返回新appId
|
|
|
+ if (StringUtils.isEmpty(currentAppIds)) {
|
|
|
+ return newAppId;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 检查是否已存在
|
|
|
+ String[] appIdArray = currentAppIds.split(",");
|
|
|
+ for (String appId : appIdArray) {
|
|
|
+ if (appId.trim().equals(newAppId.trim())) {
|
|
|
+ // 已存在,不需要添加
|
|
|
+ return currentAppIds;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 不存在,追加到末尾
|
|
|
+ return currentAppIds + "," + newAppId;
|
|
|
+ }
|
|
|
+
|
|
|
}
|