Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master'

三七 6 giorni fa
parent
commit
8eec124dad

+ 4 - 0
fs-company/src/main/java/com/fs/user/FsUserAdminController.java

@@ -14,6 +14,7 @@ import com.fs.framework.service.TokenService;
 
 import com.fs.his.domain.FsUser;
 import com.fs.his.service.IFsUserService;
+import com.fs.his.utils.PhoneUtil;
 import com.fs.qw.domain.CustomerTransferApproval;
 import com.fs.qw.dto.FsUserTransferParamDTO;
 import com.fs.qw.service.ICustomerTransferApprovalService;
@@ -60,6 +61,9 @@ public class FsUserAdminController extends BaseController {
         }else {
             param.setCompanyId(loginUser.getCompany().getCompanyId());
         }
+        if(param.getPhone()!=null && !"".equals(param.getPhone())){
+            param.setPhone(PhoneUtil.encryptPhone(param.getPhone()));
+        }
 //        if(param.getCompanyUserId() == null) {
 //            throw new IllegalArgumentException("当前销售不存在!");
 //        }

+ 2 - 2
fs-service/src/main/java/com/fs/core/config/WxOpenProperties.java

@@ -9,7 +9,7 @@ import org.springframework.context.annotation.Configuration;
 @ConfigurationProperties("wx.open")
 public class WxOpenProperties {
 
-    private String appId = "wx703c4bd07bbd1695";
+    private String appId = "wxcb1e78baf03c0662";
 
-    private String secret = "034f5cc8d9b5151f9d25da9628541e35";
+    private String secret = "d041d3e2392a68a3e86dc22d976ed4a0";
 }

+ 5 - 0
fs-service/src/main/java/com/fs/course/mapper/FsCourseWatchLogMapper.java

@@ -424,4 +424,9 @@ public interface FsCourseWatchLogMapper extends BaseMapper<FsCourseWatchLog> {
     List<QwExternalContact> selectQwWatchLogFomExtContact(@Param("logIds") List<Long> logIds);
 
     List<FsCourseWatchLogListVO> selectListBytrainingCampId(PeriodStatisticCountParam param);
+    @Select("select * from fs_course_watch_log " +
+            "where " +
+            "video_id = #{videoId} " +
+            "and user_id = #{userId} limit 1 ")
+    FsCourseWatchLog getWatchCourseVideoByUserId(@Param("userId") Long userId,@Param("videoId") Long videoId);
 }

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

@@ -64,4 +64,6 @@ public class FsUserCourseVideoAddKfUParam implements Serializable {
     private String chatId;
     private String nickName;
 
+    private Integer isOpenCourse;
+
 }

+ 1 - 1
fs-service/src/main/java/com/fs/course/param/newfs/FsUserCourseAddCompanyUserParam.java

@@ -36,5 +36,5 @@ public class FsUserCourseAddCompanyUserParam implements Serializable {
 //    @NotNull(message = "项目id不能为空")
     @ApiModelProperty(value = "项目ID")
     private Long projectId;
-
+    private Integer isOpenCourse;
 }

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

@@ -284,11 +284,12 @@ public class FsUserCourseServiceImpl implements IFsUserCourseService
 
     @Override
     public List<FsUserCourseListPVO> selectFsUserCourseListPVO(FsUserCourse param) {
+
+        List<FsUserCourseListPVO> list =  fsUserCourseMapper.selectFsUserCourseListPVO(param);
         List<DictVO> dictVOS = sysDictDataMapper.selectDictDataListByType("sys_course_project");
         // Create a map for faster lookup (dictValue -> dictVO)
         Map<String, String> projectMap = dictVOS.stream()
                 .collect(Collectors.toMap(DictVO::getDictValue, DictVO::getDictLabel));
-        List<FsUserCourseListPVO> list =  fsUserCourseMapper.selectFsUserCourseListPVO(param);
         for (FsUserCourseListPVO vo : list) {
             if (vo.getProject() != null) {
                 String projectName = projectMap.get(vo.getProject().toString());

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

@@ -407,7 +407,21 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
         if (fsUser.getStatus()==0){
             return R.error("会员被停用,无权限,请联系客服!");
         }
-
+//        if (param.getIsOpenCourse()!=null&&param.getIsOpenCourse()==1){
+//            FsCourseWatchLog log = courseWatchLogMapper.getWatchCourseVideoByUserId(param.getUserId(), param.getVideoId());
+//            if (log==null){
+//                FsCourseWatchLog userLog = new FsCourseWatchLog();
+//                BeanUtils.copyProperties(param,log);
+//                userLog.setSendType(0);
+//                userLog.setUserId(param.getUserId());
+//                userLog.setVideoId(param.getVideoId());
+//                userLog.setDuration(0L);
+//                userLog.setCreateTime(new Date());
+//                userLog.setLogType(3);
+//                courseWatchLogMapper.insertFsCourseWatchLog(log);
+//            }
+//            return  R.ok();
+//        }
         String msg = "<div style=\"color: red;margin-bottom: 15px;font-weight: bold;\">本课程为会员独享<br>请长按二维码</div>\n" +
                 "\t\t\t\t\t<div style=\"color: #999;font-size: 14px;font-weight: bold;\">添加伴学助手免费领取会员权限</div>";
 //        try {
@@ -1468,7 +1482,29 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
         if (fsUser == null){
             return ResponseResult.fail(404,"当前用户信息不存在");
         }
-
+        //公开课
+        if (param.getIsOpenCourse()!=null && param.getIsOpenCourse()==1){
+            FsCourseWatchLog watchCourseVideo = courseWatchLogMapper.getCourseWatchLogByUser(param.getUserId(), param.getVideoId());
+            //添加判断:该用户是否已经存在此课程的看课记录,并且看课记录的销售id不是传入的销售id
+            if(watchCourseVideo != null){
+                FsCourseWatchLog updateLog = new FsCourseWatchLog();
+                updateLog.setUpdateTime(new Date());
+                courseWatchLogMapper.updateFsCourseWatchLog(updateLog);
+            } else {
+                FsCourseWatchLog fsCourseWatchLog = new FsCourseWatchLog();
+                BeanUtils.copyProperties(param, fsCourseWatchLog);
+                fsCourseWatchLog.setSendType(1);
+                fsCourseWatchLog.setDuration(0L);
+                fsCourseWatchLog.setCreateTime(new Date());
+                fsCourseWatchLog.setLogType(1);
+                courseWatchLogMapper.insertFsCourseWatchLog(fsCourseWatchLog);
+                String redisKey = "h5wxuser:watch:heartbeat:" + param.getUserId() + ":" + param.getVideoId() + ":" + 0;
+                redisCache.setCacheObject(redisKey, LocalDateTime.now().toString());
+                // 设置 Redis 记录的过期时间(例如 5 分钟)
+                redisCache.expire(redisKey, 300, TimeUnit.SECONDS);
+            }
+            return ResponseResult.ok(Boolean.TRUE);
+        }
         //判断该销售是否存在
         CompanyUser companyUser = companyUserMapper.selectCompanyUserById(param.getCompanyUserId());
         if (companyUser == null){
@@ -1791,7 +1827,9 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
         if (param.getLinkType() != null && param.getLinkType() == 1){
             return R.ok();
         }
-
+        if (param.getCompanyUserId()==null){
+            param.setCompanyUserId(0L);
+        }
         // 从Redis中获取观看时长
         String redisKey = "h5wxuser:watch:duration:" + param.getUserId() + ":" + param.getVideoId() + ":" + param.getCompanyUserId();
         log.info("看课redis缓存key:{}", redisKey);

+ 1 - 1
fs-service/src/main/java/com/fs/sop/mapper/QwSopTagMapper.java

@@ -63,7 +63,7 @@ public interface QwSopTagMapper extends BaseMapper<QwSopTag>{
      * @return 结果
      */
     int deleteQwSopTagByIds(Long[] ids);
-    @Select("select * from qw_sop_tag where status=1 and send_time > NOW() ")
+    @Select("select * from  qw_sop_tag where status=1 and send_time > NOW() ")
     List<QwSopTag> selectQwSopTagByStatus1();
 
 }

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

@@ -36,7 +36,7 @@ server:
 # 日志配置
 logging:
   level:
-    com.fs: info
+    com.fs: debug
     org.springframework: warn
 
 express:

+ 18 - 0
fs-service/src/main/resources/application-dev.yml

@@ -144,3 +144,21 @@ rocketmq:
         group: test-group
         access-key: ak1243b25nj17d4b2dc1a03 # 替换为实际的 accessKey
         secret-key: sk08a7ea1f9f4b0237 # 替换为实际的 secretKey
+custom:
+    token: "1o62d3YxvdHd4LEUiltnu7sK"
+    encoding-aes-key: "UJfTQ5qKTKlegjkXtp1YuzJzxeHlUKvq5GyFbERN1iU"
+    corp-id: "ww51717e2b71d5e2d3"
+    secret: "6ODAmw-8W4t6h9mdzHh2Z4Apwj8mnsyRnjEDZOHdA7k"
+    private-key-path: "privatekey.pem"
+    webhook-url: "https://your-server.com/wecom/archive"
+# token配置
+token:
+    # 令牌自定义标识
+    header: Authorization
+    # 令牌密钥
+    secret: abcdefghijklmnopqrstuvwxyz
+    # 令牌有效期(默认30分钟)
+    expireTime: 180
+openIM:
+    secret: openIM123
+    userID: imAdmin

+ 15 - 0
fs-service/src/main/resources/application-druid-fby.yml

@@ -148,6 +148,21 @@ rocketmq:
         group: test-group
         access-key: ak1243b25nj17d4b2dc1a03 # 替换为实际的 accessKey
         secret-key: sk08a7ea1f9f4b0237 # 替换为实际的 secretKey
+custom:
+    token: "1o62d3YxvdHd4LEUiltnu7sK"
+    encoding-aes-key: "UJfTQ5qKTKlegjkXtp1YuzJzxeHlUKvq5GyFbERN1iU"
+    corp-id: "ww51717e2b71d5e2d3"
+    secret: "6ODAmw-8W4t6h9mdzHh2Z4Apwj8mnsyRnjEDZOHdA7k"
+    private-key-path: "privatekey.pem"
+    webhook-url: "https://your-server.com/wecom/archive"
+# token配置
+token:
+    # 令牌自定义标识
+    header: Authorization
+    # 令牌密钥
+    secret: abcdefghijklmnopqrstuvwxyz
+    # 令牌有效期(默认30分钟)
+    expireTime: 180
 openIM:
     secret: openIM123
     userID: imAdmin

+ 18 - 0
fs-service/src/main/resources/application-druid-jzzx-test.yml

@@ -149,3 +149,21 @@ rocketmq:
         group: test-group
         access-key: ak1243b25nj17d4b2dc1a03 # 替换为实际的 accessKey
         secret-key: sk08a7ea1f9f4b0237 # 替换为实际的 secretKey
+custom:
+    token: "1o62d3YxvdHd4LEUiltnu7sK"
+    encoding-aes-key: "UJfTQ5qKTKlegjkXtp1YuzJzxeHlUKvq5GyFbERN1iU"
+    corp-id: "ww51717e2b71d5e2d3"
+    secret: "6ODAmw-8W4t6h9mdzHh2Z4Apwj8mnsyRnjEDZOHdA7k"
+    private-key-path: "privatekey.pem"
+    webhook-url: "https://your-server.com/wecom/archive"
+# token配置
+token:
+    # 令牌自定义标识
+    header: Authorization
+    # 令牌密钥
+    secret: abcdefghijklmnopqrstuvwxyz
+    # 令牌有效期(默认30分钟)
+    expireTime: 180
+openIM:
+    secret: openIM123
+    userID: imAdmin

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

@@ -84,7 +84,7 @@ public class CourseQwController extends AppBaseController {
         }
         return R.ok().put("data",course);
     }
-    @ApiOperation("查询全部公域的课程")
+    @ApiOperation("查询公域的视频")
     @GetMapping("/getAppletCourseVideo")
     public R getAppletCourseVideo(@RequestParam("courseId") Long courseId)
     {

+ 12 - 12
fs-user-app/src/main/java/com/fs/framework/config/RedisConfig.java

@@ -31,18 +31,18 @@ import java.time.Duration;
 public class RedisConfig extends CachingConfigurerSupport
 {
 
-    @Bean
-    public RedisCacheManager cacheManager(RedisConnectionFactory connectionFactory) {
-        RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig()
-                .entryTtl(Duration.ofSeconds(30))
-                .serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer()))
-                .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new GenericJackson2JsonRedisSerializer()))
-                .disableCachingNullValues();
-
-        return RedisCacheManager.builder(connectionFactory)
-                .cacheDefaults(config)
-                .build();
-    }
+//    @Bean
+//    public RedisCacheManager cacheManager(RedisConnectionFactory connectionFactory) {
+//        RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig()
+//                .entryTtl(Duration.ofSeconds(30))
+//                .serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer()))
+//                .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new GenericJackson2JsonRedisSerializer()))
+//                .disableCachingNullValues();
+//
+//        return RedisCacheManager.builder(connectionFactory)
+//                .cacheDefaults(config)
+//                .build();
+//    }
 
     @Bean
     @SuppressWarnings(value = { "unchecked", "rawtypes" })