Explorar o código

Merge remote-tracking branch 'origin/master'

ct hai 3 días
pai
achega
70cc04e3b6
Modificáronse 19 ficheiros con 131 adicións e 14 borrados
  1. 0 1
      fs-admin/src/main/java/com/fs/course/task/CompanyBalanceTask.java
  2. 8 0
      fs-company/src/main/java/com/fs/company/controller/course/FsUserCoursePeriodController.java
  3. 3 0
      fs-service/src/main/java/com/fs/course/service/impl/BalanceRollbackErrorServiceImpl.java
  4. 1 1
      fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java
  5. 3 0
      fs-service/src/main/java/com/fs/course/vo/UserWatchLogListVo.java
  6. 6 6
      fs-service/src/main/resources/application-common.yml
  7. 6 0
      fs-service/src/main/resources/application-config-druid-hdt.yml
  8. 6 0
      fs-service/src/main/resources/application-config-druid-hyt.yml
  9. 6 0
      fs-service/src/main/resources/application-config-druid-jnmy.yml
  10. 6 0
      fs-service/src/main/resources/application-config-druid-jnsyj.yml
  11. 6 0
      fs-service/src/main/resources/application-config-druid-nmgyt.yml
  12. 6 0
      fs-service/src/main/resources/application-config-myhk.yml
  13. 7 1
      fs-service/src/main/resources/application-config-zkzh.yml
  14. 3 1
      fs-service/src/main/resources/mapper/course/FsUserCompanyBindMapper.xml
  15. 10 2
      fs-user-app/src/main/java/com/fs/app/controller/CourseController.java
  16. 20 1
      fs-user-app/src/main/java/com/fs/app/controller/UserController.java
  17. 1 0
      fs-user-app/src/main/java/com/fs/app/controller/course/CourseFsUserController.java
  18. 32 0
      fs-user-app/src/main/java/com/fs/app/controller/course/CourseQwController.java
  19. 1 1
      fs-user-app/src/main/java/com/fs/app/utils/JwtUtils.java

+ 0 - 1
fs-admin/src/main/java/com/fs/course/task/CompanyBalanceTask.java

@@ -49,7 +49,6 @@ public class CompanyBalanceTask {
      * @Author xgb
      * @Date 2025/10/22 11:52
      */
-    @EventListener(ApplicationReadyEvent.class)
     public void initCompanyBalance() {
         balanceRollbackErrorService.initCompanyBalance();
 

+ 8 - 0
fs-company/src/main/java/com/fs/company/controller/course/FsUserCoursePeriodController.java

@@ -1,11 +1,13 @@
 package com.fs.company.controller.course;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.fs.common.annotation.Log;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
+import com.fs.common.exception.CustomException;
 import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.course.domain.FsUserCoursePeriod;
@@ -74,6 +76,9 @@ public class FsUserCoursePeriodController extends BaseController {
     @ApiOperation("自定义查询主列表分页")
     public R pageList(@RequestBody FsUserCoursePeriod fsUserCoursePeriod)
     {
+        if (ObjectUtil.isNotEmpty(fsUserCoursePeriod.getTrainingCampId())){
+            throw new CustomException("训练营不能为空!");
+        }
 //        startPage();
         PageHelper.startPage(fsUserCoursePeriod.getPageNum(), fsUserCoursePeriod.getPageSize());
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
@@ -120,6 +125,9 @@ public class FsUserCoursePeriodController extends BaseController {
     @PostMapping
     public AjaxResult add(@RequestBody FsUserCoursePeriod fsUserCoursePeriod)
     {
+        if (ObjectUtil.isNotEmpty(fsUserCoursePeriod.getTrainingCampId())){
+            throw new CustomException("训练营不能为空!");
+        }
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         fsUserCoursePeriod.setCompanyId(loginUser.getCompany().getCompanyId().toString());
         return toAjax(fsUserCoursePeriodService.insertFsUserCoursePeriod(fsUserCoursePeriod));

+ 3 - 0
fs-service/src/main/java/com/fs/course/service/impl/BalanceRollbackErrorServiceImpl.java

@@ -15,6 +15,8 @@ import org.redisson.api.RedissonClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.context.event.ApplicationReadyEvent;
+import org.springframework.context.event.EventListener;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
@@ -87,6 +89,7 @@ public class BalanceRollbackErrorServiceImpl extends ServiceImpl<BalanceRollback
     }
 
     @Override
+    @EventListener(ApplicationReadyEvent.class)
     public void initCompanyBalance() {
 
         // 查询公司表 Company

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

@@ -1822,7 +1822,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
         redPacketLog.setWatchLogId(log.getLogId() !=null ? log.getLogId() : null);
         redPacketLog.setPeriodId(param.getPeriodId());
         redPacketLogMapper.insertFsCourseRedPacketLog(redPacketLog);
-        return R.ok("奖励发放成功").put("rewardType",config.getRewardType());
+        return R.ok("积分奖励发放成功").put("rewardType",config.getRewardType());
     }
 
     @Override

+ 3 - 0
fs-service/src/main/java/com/fs/course/vo/UserWatchLogListVo.java

@@ -25,6 +25,9 @@ public class UserWatchLogListVo {
     private String projectName;
     private String courseName;
     private String videoName;
+    //所属企微
     private String qwUserName;
+    //所属企微主体
+    private String corpName;
 
 }

+ 6 - 6
fs-service/src/main/resources/application-common.yml

@@ -14,12 +14,12 @@ fs:
   addressEnabled: false
   # 验证码类型 math 数组计算 char 字符验证
   captchaType: math
-  jwt:
-    # 加密秘钥
-    secret: f4e2e52034348f86b67cde581c0f9eb5
-    # token有效时长,7天,单位秒
-    expire: 31536000
-    header: AppToken
+#  jwt:
+#    # 加密秘钥
+#    secret: f4e2e52034348f86b67cde581c0f9eb5
+#    # token有效时长,7天,单位秒
+#    expire: 31536000
+#    header: AppToken
 # 开发环境配置
 server:
   servlet:

+ 6 - 0
fs-service/src/main/resources/application-config-druid-hdt.yml

@@ -65,6 +65,12 @@ watch:
 fs :
   commonApi: http://192.168.0.70:8010
   h5CommonApi: http://119.29.195.254:8010
+  jwt:
+    # 加密秘钥
+    secret: f4e2e52034348f86b67cde581c0f9eb6
+    # token有效时长,7天,单位秒
+    expire: 31536000
+    header: AppToken
 nuonuo:
   key: 10924508
   secret: A2EB20764D304D16

+ 6 - 0
fs-service/src/main/resources/application-config-druid-hyt.yml

@@ -57,6 +57,12 @@ watch:
 fs :
   commonApi: http://192.168.0.18:7771
   h5CommonApi: http://192.168.0.18:7771
+  jwt:
+    # 加密秘钥
+    secret: f4e2e52034348f86b67cde581c0f9e16
+    # token有效时长,7天,单位秒
+    expire: 31536000
+    header: AppToken
 nuonuo:
   key: 10924509
   secret: A2EB20764D304D16

+ 6 - 0
fs-service/src/main/resources/application-config-druid-jnmy.yml

@@ -60,6 +60,12 @@ watch:
 fs :
   commonApi: http://192.168.0.18:7771
   h5CommonApi: http://192.168.0.18:7771
+  jwt:
+    # 加密秘钥
+    secret: f4e2e52034348f86b67cde581c0f9eb8
+    # token有效时长,7天,单位秒
+    expire: 31536000
+    header: AppToken
 nuonuo:
   key: 10924508
   secret: A2EB20764D304D16

+ 6 - 0
fs-service/src/main/resources/application-config-druid-jnsyj.yml

@@ -65,6 +65,12 @@ watch:
 fs :
   commonApi: http://172.16.0.29:8010
   h5CommonApi: http://119.29.195.254:8010
+  jwt:
+    # 加密秘钥
+    secret: f4e2e52034348f86b67cde581c0f9e19
+    # token有效时长,7天,单位秒
+    expire: 31536000
+    header: AppToken
 nuonuo:
   key: 10924508
   secret: A2EB20764D304D16

+ 6 - 0
fs-service/src/main/resources/application-config-druid-nmgyt.yml

@@ -65,6 +65,12 @@ watch:
 fs :
   commonApi: http://172.16.0.9:8010
   h5CommonApi: http://192.168.0.18:7771
+  jwt:
+    # 加密秘钥
+    secret: f4e2e52034348f86b67cde581c0f9e17
+    # token有效时长,7天,单位秒
+    expire: 31536000
+    header: AppToken
 nuonuo:
   key: 10924508
   secret: A2EB20764D304D16

+ 6 - 0
fs-service/src/main/resources/application-config-myhk.yml

@@ -65,6 +65,12 @@ watch:
 
 fs :
   commonApi: http://172.27.0.7:8010
+  jwt:
+    # 加密秘钥
+    secret: f4e2e52034348f86b67cde581c0f9e10
+    # token有效时长,7天,单位秒
+    expire: 31536000
+    header: AppToken
 nuonuo:
   key: 10924508
   secret: A2EB20764D304D16

+ 7 - 1
fs-service/src/main/resources/application-config-zkzh.yml

@@ -110,7 +110,7 @@ tencent_cloud_config:
   secret_key: u5SuS80342xzx8FRBukza9lVNHKNMSaB
   bucket: zkzh-1323137866
   app_id: 1323137866
-  region: chongqing
+  region: ap-chongqing
   proxy: zkzh
 cloud_host:
   company_name: 中康
@@ -134,6 +134,12 @@ watch:
 
 fs:
   commonApi: http://172.21.76.167:8010
+  jwt:
+    # 加密秘钥
+    secret: f4e2e52034348f86b67cde581c0f9eb9
+    # token有效时长,7天,单位秒
+    expire: 31536000
+    header: AppToken
 nuonuo:
   key: 10924508
   secret: A2EB20764D304D16

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

@@ -135,7 +135,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         c.dict_label projectName,
         e.course_name,
         IF(g.company_user_id = #{userId}, g.qw_user_name, '其他') qwUserName,
-        f.title videoName
+        f.title videoName,
+        qc.corp_name
         from
         fs_user_company_bind a
         left join fs_user b on a.fs_user_id = b.user_id
@@ -143,6 +144,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         left join fs_user_course e on a.course_id = e.course_id
         left join fs_user_course_video f on a.video_id = f.video_id
         left join qw_user g on g.id = a.qw_user_id
+        left join qw_company qc on qc.id = a.qw_company_id
         <where>
             <if test="externalUserId != null">
                 and a.qw_external_contact_id = #{externalUserId}

+ 10 - 2
fs-user-app/src/main/java/com/fs/app/controller/CourseController.java

@@ -45,7 +45,8 @@ public class CourseController extends  AppBaseController{
     private IFsUserCourseStudyLogService courseStudyLogService;
     @Autowired
     private IFsCourseSopAppLinkService courseSopAppLinkService;
-
+    @Autowired
+    ITencentCloudCosService tencentCloudCosService;
 
 //    @Cacheable(value="getCourseCate" )
     @ApiOperation("获取分类")
@@ -332,5 +333,12 @@ public class CourseController extends  AppBaseController{
         param.setUserId(Long.parseLong(getUserId()));
         return courseService.getIntegralByCourseVideo(param);
     }
-
+    @GetMapping("/videoTranscode")
+    public void videoTranscode(){
+        tencentCloudCosService.videoTranscode();
+    }
+    @GetMapping("/updateUrl")
+    public void updateUrl(){
+        tencentCloudCosService.updateUrl();
+    }
 }

+ 20 - 1
fs-user-app/src/main/java/com/fs/app/controller/UserController.java

@@ -12,6 +12,7 @@ import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.exception.CustomException;
 import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.sign.Md5Utils;
+import com.fs.company.domain.CompanyUser;
 import com.fs.course.service.IFsUserCourseVideoService;
 import com.fs.his.domain.FsDoctor;
 import com.fs.his.domain.FsPackage;
@@ -39,6 +40,7 @@ import com.google.zxing.WriterException;
 import io.jsonwebtoken.lang.Assert;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.BeanUtils;
@@ -134,7 +136,24 @@ public class UserController extends  AppBaseController {
             return R.error("操作异常");
         }
     }
-
+    @Login
+    @ApiOperation("获取用户信息ByUserId")
+    @GetMapping("/getUserInfoByUserId")
+    public R getUserInfoByUserId(
+            @ApiParam(required = true, name = "userId", value = "用户ID") @RequestParam(value = "userId", required = false) Long userId,
+            HttpServletRequest request){
+        try {
+            FsUser user=userService.selectFsUserByUserId(userId);
+            if (user.getPhone()!=null&&user.getPhone().length()>11&&!user.getPhone().matches("\\d+")){
+                user.setPhone(decryptPhoneMk(user.getPhone()));
+            }
+            Map<String,Object> map=new HashMap<>();
+            map.put("user",user);
+            return R.ok(map);
+        } catch (Exception e){
+            return R.error("操作异常");
+        }
+    }
     @Login
     @ApiOperation("判断用户是否存在头像昵称")
     @GetMapping("/checkUserInfo")

+ 1 - 0
fs-user-app/src/main/java/com/fs/app/controller/course/CourseFsUserController.java

@@ -113,6 +113,7 @@ public class CourseFsUserController extends AppBaseController {
     @ApiOperation("答题")
     @PostMapping("/courseAnswer")
     @UserOperationLog(operationType = FsUserOperationEnum.ANSWER)
+    @RepeatSubmit
     public R courseAnswer(@RequestBody FsCourseQuestionAnswerUParam param){
         if (ObjectUtil.isEmpty(param.getUserId())){
             Long userId = Long.parseLong(getUserId());

+ 32 - 0
fs-user-app/src/main/java/com/fs/app/controller/course/CourseQwController.java

@@ -7,6 +7,7 @@ import com.fs.app.annotation.Login;
 import com.fs.app.controller.AppBaseController;
 import com.fs.common.annotation.RepeatSubmit;
 import com.fs.common.core.domain.R;
+import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.core.utils.OrderCodeUtils;
 import com.fs.course.config.CourseConfig;
@@ -24,6 +25,7 @@ import com.fs.system.service.ISysConfigService;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.hc.openapi.tool.fastjson.JSON;
+import io.jsonwebtoken.Claims;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -36,7 +38,9 @@ import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.HttpServletRequest;
 import javax.validation.Valid;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 @Api("企微看课接口")
 @RestController
@@ -413,4 +417,32 @@ public class CourseQwController extends AppBaseController {
         return R.ok().put("data",course);
     }
 
+
+    @ApiOperation("检测是否登录")
+    @GetMapping("/checkLogin")
+    public R checkLogin(){
+        try {
+            HttpServletRequest request = ServletUtils.getRequest();
+            //获取用户凭证
+            String token = request.getHeader(jwtUtils.getHeader());
+            if(StringUtils.isBlank(token)){
+                token = request.getParameter(jwtUtils.getHeader());
+            }
+            //检查token是否存在
+            if (StringUtils.isBlank(token)) {
+                return R.error(4001, "登录凭证不能为空,重新授权");
+            }
+            Claims claims=jwtUtils.getClaimByToken(token);
+            if(claims==null || jwtUtils.isTokenExpired(claims.getExpiration())){
+                return R.error(4004,"回传token校验失败,重新授权");
+            }
+            return R.ok();
+
+        }catch (Exception e){
+            logger.error("检测登录状态异常: {}", e.getMessage(), e);
+            return R.error("系统异常,请稍后重试");
+        }
+
+    }
+
 }

+ 1 - 1
fs-user-app/src/main/java/com/fs/app/utils/JwtUtils.java

@@ -49,7 +49,7 @@ public class JwtUtils {
                     .parseClaimsJws(token)
                     .getBody();
         }catch (Exception e){
-            logger.debug("validate is token error ", e);
+            logger.error("验证令牌错误", e);
             return null;
         }
     }