Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

ct 2 tygodni temu
rodzic
commit
b199ec510b
22 zmienionych plików z 577 dodań i 28 usunięć
  1. 115 0
      fs-admin/src/main/java/com/fs/course/controller/FsCoursePlaySourceConfigController.java
  2. 10 8
      fs-admin/src/main/java/com/fs/his/controller/FsPackageCateController.java
  3. 62 15
      fs-service/src/main/java/com/fs/core/config/WxMaConfiguration.java
  4. 79 0
      fs-service/src/main/java/com/fs/course/domain/FsCoursePlaySourceConfig.java
  5. 17 0
      fs-service/src/main/java/com/fs/course/mapper/FsCoursePlaySourceConfigMapper.java
  6. 45 0
      fs-service/src/main/java/com/fs/course/param/FsCoursePlaySourceConfigCreateParam.java
  7. 42 0
      fs-service/src/main/java/com/fs/course/param/FsCoursePlaySourceConfigEditParam.java
  8. 16 0
      fs-service/src/main/java/com/fs/course/service/IFsCoursePlaySourceConfigService.java
  9. 27 0
      fs-service/src/main/java/com/fs/course/service/impl/FsCoursePlaySourceConfigServiceImpl.java
  10. 49 0
      fs-service/src/main/java/com/fs/course/vo/FsCoursePlaySourceConfigVO.java
  11. 1 1
      fs-service/src/main/java/com/fs/his/mapper/FsPackageMapper.java
  12. 3 0
      fs-service/src/main/java/com/fs/his/param/FsPackageCateUParam.java
  13. 1 0
      fs-service/src/main/java/com/fs/his/service/IFsPackageCateService.java
  14. 7 0
      fs-service/src/main/java/com/fs/his/service/impl/FsPackageCateServiceImpl.java
  15. 7 0
      fs-service/src/main/java/com/fs/his/service/impl/FsPackageServiceImpl.java
  16. 1 1
      fs-service/src/main/resources/application-druid-yzt.yml
  17. 33 0
      fs-service/src/main/resources/db/20250821-点播播放源配置改造.sql
  18. 20 0
      fs-service/src/main/resources/mapper/course/FsCoursePlaySourceConfigMapper.xml
  19. 18 0
      fs-user-app/src/main/java/com/fs/app/controller/AppLoginController.java
  20. 2 2
      fs-user-app/src/main/java/com/fs/app/controller/PackageController.java
  21. 18 0
      fs-user-app/src/main/java/com/fs/app/controller/UserController.java
  22. 4 1
      fs-user-app/src/main/java/com/fs/framework/aspectj/UserOperationLogAspect.java

+ 115 - 0
fs-admin/src/main/java/com/fs/course/controller/FsCoursePlaySourceConfigController.java

@@ -0,0 +1,115 @@
+package com.fs.course.controller;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+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.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.bean.BeanUtils;
+import com.fs.course.domain.FsCoursePlaySourceConfig;
+import com.fs.course.param.FsCoursePlaySourceConfigCreateParam;
+import com.fs.course.param.FsCoursePlaySourceConfigEditParam;
+import com.fs.course.service.IFsCoursePlaySourceConfigService;
+import com.fs.course.vo.FsCoursePlaySourceConfigVO;
+import com.github.pagehelper.PageHelper;
+import lombok.AllArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.time.LocalDateTime;
+import java.util.*;
+
+@RestController
+@RequestMapping("/course/playSourceConfig")
+@AllArgsConstructor
+public class FsCoursePlaySourceConfigController extends BaseController {
+
+    private final IFsCoursePlaySourceConfigService fsCoursePlaySourceConfigService;
+
+    @PreAuthorize("@ss.hasPermi('course:playSourceConfig:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(@RequestParam(required = false) String name,
+                              @RequestParam(required = false) String appid,
+                              @RequestParam(required = false, defaultValue = "1") Integer pageNum,
+                              @RequestParam(required = false, defaultValue = "10") Integer pageSize) {
+        Map<String, Object> params = new HashMap<>();
+        params.put("name", name);
+        params.put("appid", appid);
+
+        PageHelper.startPage(pageNum, pageSize);
+        List<FsCoursePlaySourceConfigVO> list = fsCoursePlaySourceConfigService.selectCoursePlaySourceConfigVOListByMap(params);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('course:playSourceConfig:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable Long id) {
+        FsCoursePlaySourceConfig config = fsCoursePlaySourceConfigService.getById(id);
+        if (Objects.isNull(config)) {
+            return AjaxResult.success(null);
+        }
+
+        FsCoursePlaySourceConfigVO configVO = new FsCoursePlaySourceConfigVO();
+        BeanUtils.copyProperties(config, configVO);
+        return AjaxResult.success(configVO);
+    }
+
+    @PreAuthorize("@ss.hasPermi('course:playSourceConfig:add')")
+    @Log(title = "点播播放源配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@Valid @RequestBody FsCoursePlaySourceConfigCreateParam param) {
+        Wrapper<FsCoursePlaySourceConfig> queryWrapper = Wrappers.<FsCoursePlaySourceConfig>lambdaQuery()
+                .eq(FsCoursePlaySourceConfig::getAppid, param.getAppid())
+                .eq(FsCoursePlaySourceConfig::getIsDel, 0);
+        if (fsCoursePlaySourceConfigService.count(queryWrapper) > 0) {
+            return AjaxResult.error("appid已存在");
+        }
+
+        FsCoursePlaySourceConfig config = new FsCoursePlaySourceConfig();
+        BeanUtils.copyProperties(param, config);
+
+        config.setIsDel(0);
+        config.setCreateTime(LocalDateTime.now());
+        config.setUpdateTime(LocalDateTime.now());
+        fsCoursePlaySourceConfigService.save(config);
+        return AjaxResult.success();
+    }
+
+    @PreAuthorize("@ss.hasPermi('course:playSourceConfig:edit')")
+    @Log(title = "点播播放源配置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@Valid @RequestBody FsCoursePlaySourceConfigEditParam param) {
+        FsCoursePlaySourceConfig config = fsCoursePlaySourceConfigService.getById(param.getId());
+        if (Objects.isNull(config)) {
+            return AjaxResult.error("点播播放源配置不存在");
+        }
+
+        Wrapper<FsCoursePlaySourceConfig> queryWrapper = Wrappers.<FsCoursePlaySourceConfig>lambdaQuery()
+                .eq(FsCoursePlaySourceConfig::getAppid, param.getAppid())
+                .eq(FsCoursePlaySourceConfig::getIsDel, 0)
+                .last("limit 1");
+        FsCoursePlaySourceConfig one = fsCoursePlaySourceConfigService.getOne(queryWrapper);
+        if (Objects.nonNull(one) && !one.getId().equals(config.getId())) {
+            return AjaxResult.error("appid已存在");
+        }
+
+        BeanUtils.copyProperties(param, config);
+        fsCoursePlaySourceConfigService.updateById(config);
+        return AjaxResult.success();
+    }
+
+    @PreAuthorize("@ss.hasPermi('course:playSourceConfig:remove')")
+    @Log(title = "点播播放源配置", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        Wrapper<FsCoursePlaySourceConfig> updateWrapper = Wrappers.<FsCoursePlaySourceConfig>lambdaUpdate()
+                .set(FsCoursePlaySourceConfig::getIsDel, 1)
+                .in(FsCoursePlaySourceConfig::getId, Arrays.asList(ids));
+        fsCoursePlaySourceConfigService.update(updateWrapper);
+        return AjaxResult.success();
+    }
+}

+ 10 - 8
fs-admin/src/main/java/com/fs/his/controller/FsPackageCateController.java

@@ -7,6 +7,8 @@ import java.util.Map;
 import com.fs.common.core.redis.RedisCache;
 import com.fs.his.param.FsPackageCateUParam;
 import com.fs.his.vo.OptionsVO;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -84,10 +86,10 @@ public class FsPackageCateController extends BaseController
     public AjaxResult add(@RequestBody FsPackageCate fsPackageCate)
     {
         fsPackageCateService.insertFsPackageCate(fsPackageCate);
-        Collection<String> keys = redisCache.keys("getPackagCateList*");
-        for (String key : keys) {
-            redisCache.deleteObject(key);
-        }
+//        Collection<String> keys = redisCache.keys("getPackagCateList*");
+//        for (String key : keys) {
+//            redisCache.deleteObject(key);
+//        }
         return toAjax(1);
     }
 
@@ -100,10 +102,10 @@ public class FsPackageCateController extends BaseController
     public AjaxResult edit(@RequestBody FsPackageCate fsPackageCate)
     {
         fsPackageCateService.updateFsPackageCate(fsPackageCate);
-        Collection<String> keys = redisCache.keys("getPackagCateList*");
-        for (String key : keys) {
-            redisCache.deleteObject(key);
-        }
+//        Collection<String> keys = redisCache.keys("getPackagCateList*");
+//        for (String key : keys) {
+//            redisCache.deleteObject(key);
+//        }
         return toAjax(1);
     }
 

+ 62 - 15
fs-service/src/main/java/com/fs/core/config/WxMaConfiguration.java

@@ -8,7 +8,12 @@ import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl;
 import cn.binarywang.wx.miniapp.message.WxMaMessageHandler;
 import cn.binarywang.wx.miniapp.message.WxMaMessageRouter;
 import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.fs.common.utils.spring.SpringUtils;
 import com.fs.course.config.CourseMaConfig;
+import com.fs.course.domain.FsCoursePlaySourceConfig;
+import com.fs.course.mapper.FsCoursePlaySourceConfigMapper;
 import com.fs.system.domain.SysConfig;
 import com.fs.system.mapper.SysConfigMapper;
 import com.google.common.collect.Lists;
@@ -18,6 +23,7 @@ import lombok.extern.slf4j.Slf4j;
 import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
 import me.chanjar.weixin.common.error.WxErrorException;
 import me.chanjar.weixin.common.error.WxRuntimeException;
+import org.jetbrains.annotations.NotNull;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.ComponentScan;
@@ -41,7 +47,7 @@ public class WxMaConfiguration {
     private static Map<String, WxMaService> maServices;
 
     @Autowired
-    public WxMaConfiguration(SysConfigMapper sysConfigMapper) {
+    public WxMaConfiguration(SysConfigMapper sysConfigMapper, FsCoursePlaySourceConfigMapper configMapper) {
         SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.config");
         String configValue = sysConfig.getConfigValue();
         //下单小程序加载
@@ -73,18 +79,69 @@ public class WxMaConfiguration {
                 }
             }
         }
+
+        //  加载点播配置表配置
+        Wrapper<FsCoursePlaySourceConfig> queryWrapper = Wrappers.<FsCoursePlaySourceConfig>lambdaQuery().eq(FsCoursePlaySourceConfig::getIsDel, 0);
+        for (FsCoursePlaySourceConfig playConfig : configMapper.selectList(queryWrapper)) {
+            boolean isExist = c.stream().anyMatch(item -> item.getAppid().equals(playConfig.getAppid()));
+            if (!isExist){
+                WxMaConfig.Config wxMaConfig = new WxMaConfig.Config();
+                BeanUtils.copyProperties(playConfig, wxMaConfig);
+                c.add(wxMaConfig);
+            }
+        }
+
         wx.setConfigs(c);
         this.properties = wx;
         log.info("配置加载完毕! 配置文件: {}",JSON.toJSONString(this.properties));
     }
 
     public static WxMaService getMaService(String appid) {
+        // 从缓存获取
         WxMaService wxService = maServices.get(appid);
-        if (wxService == null) {
-            throw new IllegalArgumentException(String.format("未找到对应appid=[%s]的配置,请核实!", appid));
+        if (wxService != null) {
+            return wxService;
         }
 
-        return wxService;
+        // 缓存未命中,查询数据库
+        synchronized (WxMaConfiguration.class) {
+            // 双重检查
+            wxService = maServices.get(appid);
+            if (wxService != null) {
+                return wxService;
+            }
+
+            // 查询数据库
+            FsCoursePlaySourceConfigMapper configMapper = SpringUtils.getBean(FsCoursePlaySourceConfigMapper.class);
+            Wrapper<FsCoursePlaySourceConfig> queryWrapper = Wrappers.<FsCoursePlaySourceConfig>lambdaQuery()
+                    .eq(FsCoursePlaySourceConfig::getAppid, appid)
+                    .eq(FsCoursePlaySourceConfig::getIsDel, 0);
+            FsCoursePlaySourceConfig config = configMapper.selectOne(queryWrapper);
+            if (config == null) {
+                throw new IllegalArgumentException(String.format("未找到对应appid=[%s]的配置,请核实!", appid));
+            }
+
+            WxMaService service = getWxMaService(config.getAppid(), config.getSecret(), config.getToken(), config.getAesKey(), config.getMsgDataFormat());
+            maServices.put(appid, service);
+            log.info("Initialized WxMaService for appid: {}", appid);
+            return service;
+        }
+    }
+
+    /**
+     * 初始化WxMaService
+     */
+    private static WxMaService getWxMaService(String appid, String secret, String token, String aesKey, String msgDataFormat) {
+        WxMaDefaultConfigImpl maConfig = new WxMaDefaultConfigImpl();
+        maConfig.setAppid(appid);
+        maConfig.setSecret(secret);
+        maConfig.setToken(token);
+        maConfig.setAesKey(aesKey);
+        maConfig.setMsgDataFormat(msgDataFormat);
+
+        WxMaService service = new WxMaServiceImpl();
+        service.setWxMaConfig(maConfig);
+        return service;
     }
 
     public static WxMaMessageRouter getRouter(String appid) {
@@ -100,17 +157,7 @@ public class WxMaConfiguration {
 
         maServices = configs.stream()
             .map(a -> {
-                WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl();
-//                WxMaDefaultConfigImpl config = new WxMaRedisConfigImpl(new JedisPool());
-                // 使用上面的配置时,需要同时引入jedis-lock的依赖,否则会报类无法找到的异常
-                config.setAppid(a.getAppid());
-                config.setSecret(a.getSecret());
-                config.setToken(a.getToken());
-                config.setAesKey(a.getAesKey());
-                config.setMsgDataFormat(a.getMsgDataFormat());
-
-                WxMaService service = new WxMaServiceImpl();
-                service.setWxMaConfig(config);
+                WxMaService service = getWxMaService(a.getAppid(), a.getSecret(), a.getToken(), a.getAesKey(), a.getMsgDataFormat());
                 routers.put(a.getAppid(), this.newRouter(service));
                 return service;
             }).collect(Collectors.toMap(s -> s.getWxMaConfig().getAppid(), a -> a));

+ 79 - 0
fs-service/src/main/java/com/fs/course/domain/FsCoursePlaySourceConfig.java

@@ -0,0 +1,79 @@
+package com.fs.course.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Data
+@TableName("fs_course_play_source_config")
+public class FsCoursePlaySourceConfig {
+
+    /**
+     * 主键ID
+     */
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 小程序/公众号名称
+     */
+    private String name;
+
+    /**
+     * 小程序/公众号appid
+     */
+    private String appid;
+
+    /**
+     * 小程序/公众号secret
+     */
+    private String secret;
+
+    /**
+     * 小程序/公众号icon图标
+     */
+    private String img;
+
+    /**
+     * 小程序/公众号原始id
+     */
+    private String originalId;
+
+    /**
+     * token
+     */
+    private String token;
+
+    /**
+     * aesKey
+     */
+    private String aesKey;
+
+    /**
+     * msgDataFormat
+     */
+    private String msgDataFormat;
+
+    /**
+     * 类型 1小程序 2公众号
+     */
+    private Integer type;
+
+    /**
+     * 是否删除 0正常 1删除
+     */
+    private Integer isDel;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 修改时间
+     */
+    private LocalDateTime updateTime;
+}

+ 17 - 0
fs-service/src/main/java/com/fs/course/mapper/FsCoursePlaySourceConfigMapper.java

@@ -0,0 +1,17 @@
+package com.fs.course.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.course.domain.FsCoursePlaySourceConfig;
+import com.fs.course.vo.FsCoursePlaySourceConfigVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+public interface FsCoursePlaySourceConfigMapper extends BaseMapper<FsCoursePlaySourceConfig> {
+
+    /**
+     * 查询点播配置列表
+     */
+    List<FsCoursePlaySourceConfigVO> selectCoursePlaySourceConfigVOListByMap(@Param("params") Map<String, Object> params);
+}

+ 45 - 0
fs-service/src/main/java/com/fs/course/param/FsCoursePlaySourceConfigCreateParam.java

@@ -0,0 +1,45 @@
+package com.fs.course.param;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+@Data
+public class FsCoursePlaySourceConfigCreateParam {
+
+    @NotBlank(message = "名称不能为空")
+    @ApiModelProperty("小程序/公众号名称")
+    private String name;
+
+    @NotBlank(message = "appid不能为空")
+    @ApiModelProperty("小程序/公众号appid")
+    private String appid;
+
+    @NotBlank(message = "secret不能为空")
+    @ApiModelProperty("小程序/公众号secret")
+    private String secret;
+
+    @ApiModelProperty("小程序/公众号icon图标")
+    private String img;
+
+    @ApiModelProperty("小程序/公众号原始id")
+    private String originalId;
+
+    @NotBlank(message = "token不能为空")
+    @ApiModelProperty("token")
+    private String token;
+
+    @NotBlank(message = "aesKey不能为空")
+    @ApiModelProperty("aesKey")
+    private String aesKey;
+
+    @NotBlank(message = "msgDataFormat不能为空")
+    @ApiModelProperty("msgDataFormat")
+    private String msgDataFormat;
+
+    @NotNull(message = "类型不能为空")
+    @ApiModelProperty("类型 1小程序 2公众号")
+    private Integer type;
+}

+ 42 - 0
fs-service/src/main/java/com/fs/course/param/FsCoursePlaySourceConfigEditParam.java

@@ -0,0 +1,42 @@
+package com.fs.course.param;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+@Data
+public class FsCoursePlaySourceConfigEditParam {
+
+    @NotNull(message = "主键ID不能为空")
+    @ApiModelProperty("主键ID")
+    private Long id;
+
+    @ApiModelProperty("小程序/公众号名称")
+    private String name;
+
+    @ApiModelProperty("小程序/公众号appid")
+    private String appid;
+
+    @ApiModelProperty("小程序/公众号secret")
+    private String secret;
+
+    @ApiModelProperty("小程序/公众号icon图标")
+    private String img;
+
+    @ApiModelProperty("小程序/公众号原始id")
+    private String originalId;
+
+    @ApiModelProperty("token")
+    private String token;
+
+    @ApiModelProperty("aesKey")
+    private String aesKey;
+
+    @ApiModelProperty("msgDataFormat")
+    private String msgDataFormat;
+
+    @ApiModelProperty("类型 1小程序 2公众号")
+    private Integer type;
+}

+ 16 - 0
fs-service/src/main/java/com/fs/course/service/IFsCoursePlaySourceConfigService.java

@@ -0,0 +1,16 @@
+package com.fs.course.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.course.domain.FsCoursePlaySourceConfig;
+import com.fs.course.vo.FsCoursePlaySourceConfigVO;
+
+import java.util.List;
+import java.util.Map;
+
+public interface IFsCoursePlaySourceConfigService extends IService<FsCoursePlaySourceConfig> {
+
+    /**
+     * 查询点播配置列表
+     */
+    List<FsCoursePlaySourceConfigVO> selectCoursePlaySourceConfigVOListByMap(Map<String, Object> params);
+}

+ 27 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsCoursePlaySourceConfigServiceImpl.java

@@ -0,0 +1,27 @@
+package com.fs.course.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.course.domain.FsCoursePlaySourceConfig;
+import com.fs.course.mapper.FsCoursePlaySourceConfigMapper;
+import com.fs.course.service.IFsCoursePlaySourceConfigService;
+import com.fs.course.vo.FsCoursePlaySourceConfigVO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+@Service
+@Slf4j
+public class FsCoursePlaySourceConfigServiceImpl extends ServiceImpl<FsCoursePlaySourceConfigMapper, FsCoursePlaySourceConfig>
+        implements IFsCoursePlaySourceConfigService {
+
+    /**
+     * 查询点播配置列表
+     */
+    @Override
+    public List<FsCoursePlaySourceConfigVO> selectCoursePlaySourceConfigVOListByMap(Map<String, Object> params) {
+        return baseMapper.selectCoursePlaySourceConfigVOListByMap(params);
+    }
+}

+ 49 - 0
fs-service/src/main/java/com/fs/course/vo/FsCoursePlaySourceConfigVO.java

@@ -0,0 +1,49 @@
+package com.fs.course.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Data
+public class FsCoursePlaySourceConfigVO {
+
+    @ApiModelProperty("主键ID")
+    private Long id;
+
+    @ApiModelProperty("小程序/公众号名称")
+    private String name;
+
+    @ApiModelProperty("小程序/公众号appid")
+    private String appid;
+
+    @ApiModelProperty("小程序/公众号secret")
+    private String secret;
+
+    @ApiModelProperty("小程序/公众号icon图标")
+    private String img;
+
+    @ApiModelProperty("小程序/公众号原始id")
+    private String originalId;
+
+    @ApiModelProperty("token")
+    private String token;
+
+    @ApiModelProperty("aesKey")
+    private String aesKey;
+
+    @ApiModelProperty("msgDataFormat")
+    private String msgDataFormat;
+
+    @ApiModelProperty("类型 1小程序 2公众号")
+    private Integer type;
+
+    @ApiModelProperty("创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime createTime;
+
+    @ApiModelProperty("修改时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime updateTime;
+}

+ 1 - 1
fs-service/src/main/java/com/fs/his/mapper/FsPackageMapper.java

@@ -118,7 +118,7 @@ public interface FsPackageMapper
             "<if test = 'maps.diseaseType != null and maps.diseaseType !=0    '> " +
             "and p.disease_type = #{maps.diseaseType} " +
             "</if>" +
-            "<if test = 'maps.privateType != null and maps.privateType !=0    '> " +
+            "<if test = 'maps.privateType != null'> " +
             "and p.private_type = #{maps.privateType} " +
             "</if>" +
             "<if test = 'maps.isShow != null '> " +

+ 3 - 0
fs-service/src/main/java/com/fs/his/param/FsPackageCateUParam.java

@@ -41,4 +41,7 @@ public class FsPackageCateUParam implements Serializable
 
     private List<Integer> companyPackageCates;
 
+    private Long companyUserId;
+
+
 }

+ 1 - 0
fs-service/src/main/java/com/fs/his/service/IFsPackageCateService.java

@@ -6,6 +6,7 @@ import java.util.Map;
 import com.fs.his.domain.FsPackageCate;
 import com.fs.his.param.FsPackageCateUParam;
 import com.fs.his.vo.OptionsVO;
+import org.springframework.cache.annotation.CacheEvict;
 
 /**
  * 套餐包分类Service接口

+ 7 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsPackageCateServiceImpl.java

@@ -9,6 +9,8 @@ import com.fs.common.exception.CustomException;
 import com.fs.his.param.FsPackageCateUParam;
 import com.fs.his.vo.OptionsVO;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 import com.fs.his.mapper.FsPackageCateMapper;
 import com.fs.his.domain.FsPackageCate;
@@ -45,6 +47,7 @@ public class FsPackageCateServiceImpl implements IFsPackageCateService
      * @return 套餐包分类
      */
     @Override
+    @Cacheable(value = "getPackagCateList", key = "#param")
     public List<FsPackageCate> selectFsPackageCateList(FsPackageCateUParam param)
     {
         return fsPackageCateMapper.selectFsPackageCateList(param);
@@ -57,6 +60,7 @@ public class FsPackageCateServiceImpl implements IFsPackageCateService
      * @return 结果
      */
     @Override
+    @CacheEvict(value = {"getPackageList","getPackagCateList"}, allEntries = true)
     public int insertFsPackageCate(FsPackageCate fsPackageCate)
     {
         Long cateCode = fsPackageCate.getCateCode();
@@ -75,6 +79,7 @@ public class FsPackageCateServiceImpl implements IFsPackageCateService
      * @return 结果
      */
     @Override
+    @CacheEvict(value = {"getPackageList","getPackagCateList"}, allEntries = true)
     public int updateFsPackageCate(FsPackageCate fsPackageCate)
     {
         Long cateCode = fsPackageCate.getCateCode();
@@ -93,6 +98,7 @@ public class FsPackageCateServiceImpl implements IFsPackageCateService
      * @return 结果
      */
     @Override
+    @CacheEvict(value = {"getPackageList","getPackagCateList"}, allEntries = true)
     public int deleteFsPackageCateByCateIds(Long[] cateIds)
     {
         return fsPackageCateMapper.deleteFsPackageCateByCateIds(cateIds);
@@ -105,6 +111,7 @@ public class FsPackageCateServiceImpl implements IFsPackageCateService
      * @return 结果
      */
     @Override
+    @CacheEvict(value = {"getPackageList","getPackagCateList"}, allEntries = true)
     public int deleteFsPackageCateByCateId(Long cateId)
     {
         return fsPackageCateMapper.deleteFsPackageCateByCateId(cateId);

+ 7 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsPackageServiceImpl.java

@@ -27,6 +27,8 @@ import com.fs.system.oss.OSSFactory;
 import com.fs.system.service.ISysConfigService;
 import net.coobird.thumbnailator.Thumbnails;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 import com.fs.his.mapper.FsPackageMapper;
 import com.fs.his.domain.FsPackage;
@@ -77,6 +79,7 @@ public class FsPackageServiceImpl implements IFsPackageService {
      * @return 结果
      */
     @Override
+    @CacheEvict(value = "getPackageList",allEntries = true)
     public int insertFsPackage(FsPackage fsPackage) {
 
         fsPackage.setCreateTime(DateUtils.getNowDate());
@@ -108,6 +111,7 @@ public class FsPackageServiceImpl implements IFsPackageService {
      */
     @Transactional(rollbackFor = Exception.class)
     @Override
+    @CacheEvict(value = "getPackageList",allEntries = true)
     public int updateFsPackage(FsPackage fsPackage) {
         fsPackage.setUpdateTime(DateUtils.getNowDate());
 //        if (fsPackage.getPackageSubType() != null && fsPackage.getPackageSubType() != 1) {
@@ -144,6 +148,7 @@ public class FsPackageServiceImpl implements IFsPackageService {
      * @return 结果
      */
     @Override
+    @CacheEvict(value = "getPackageList",allEntries = true)
     public int deleteFsPackageByPackageIds(Long[] packageIds) {
 
         return fsPackageMapper.deleteFsPackageByPackageIds(packageIds);
@@ -245,6 +250,7 @@ public class FsPackageServiceImpl implements IFsPackageService {
     }
 
     @Override
+    @Cacheable(value = "getPackageList", key = "#param")
     public List<FsPackageListUVO> selectFsPackageListUVO(FsPackageListUParam param) {
         return fsPackageMapper.selectFsPackageListUVO(param);
     }
@@ -255,6 +261,7 @@ public class FsPackageServiceImpl implements IFsPackageService {
     }
 
     @Override
+    @CacheEvict(value = "getPackageList",allEntries = true)
     public int updatePackagesStatus(Long[] packageIds, Long status) {
         return fsPackageMapper.updatePackagesStatus(packageIds, status);
     }

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

@@ -7,7 +7,7 @@ spring:
         host: r-wz9syugp027unhsdmepd.redis.rds.aliyuncs.com
         port: 6333
         # 数据库索引
-        database: 0
+        database: 12
         # 密码
         password: minzhong:Jc6m85WC7iMeULn7
         # 连接超时时间

+ 33 - 0
fs-service/src/main/resources/db/20250821-点播播放源配置改造.sql

@@ -0,0 +1,33 @@
+-- 点播播放源配置表
+drop table if exists `fs_course_play_source_config`;
+create table `fs_course_play_source_config` (
+    `id`            bigint not null auto_increment       comment '主键ID',
+    `name`          varchar(255) not null                comment '小程序/公众号名称',
+    `appid`         varchar(50)  not null                comment '小程序/公众号appid',
+    `secret`        varchar(64)  not null                comment '小程序/公众号secret',
+    `img`           varchar(512)                         comment '小程序/公众号icon图标',
+    `original_id`   varchar(20)                          comment '小程序/公众号原始id',
+    `token`         varchar(255)  not null               comment 'token',
+    `aes_key`       varchar(255)  not null               comment 'aesKey',
+    `msg_data_format` varchar(255)  not null             comment 'msgDataFormat',
+    `type`          tinyint default 1                    comment '类型 1小程序 2公众号',
+    `is_del`        tinyint(1) default 0                 comment '是否删除 0正常 1删除',
+    `create_time`   datetime                             comment '创建时间',
+    `update_time`   datetime                             comment '修改时间',
+    primary key (`id`) using btree,
+    key idx_appid (`appid`),
+    key idx_is_del (`is_del`),
+    key idx_update (`update_time`)
+) engine = Innodb comment '点播播放源配置表';
+
+-- 字典
+INSERT INTO `sys_dict_type`
+    (`dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
+VALUES
+    ('点播播放源类型', 'play_source_type', '0', 'admin', '2021-11-24 23:26:40', '', NULL, '点播播放源类型');
+
+INSERT INTO `sys_dict_data`
+    (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
+VALUES
+    (1, '小程序', '1', 'play_source_type', '', '', 'Y', '0', 'admin', '2021-11-24 23:26:40', '', NULL, '小程序'),
+    (2, '公众号', '2', 'play_source_type', '', '', 'Y', '0', 'admin', '2021-11-24 23:26:40', '', NULL, '公众号');

+ 20 - 0
fs-service/src/main/resources/mapper/course/FsCoursePlaySourceConfigMapper.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.course.mapper.FsCoursePlaySourceConfigMapper">
+
+    <select id="selectCoursePlaySourceConfigVOListByMap" resultType="com.fs.course.vo.FsCoursePlaySourceConfigVO">
+        select
+            fcpsc.*
+        from fs_course_play_source_config fcpsc
+        where fcpsc.is_del = 0
+        <if test="params.name != null and params.name != ''">
+            and fcpsc.name like concat('%', #{params.name}, '%')
+        </if>
+        <if test="params.appid != null and params.appid != ''">
+            and fcpsc.appid like concat('%', #{params.appid}, '%')
+        </if>
+        order by fcpsc.id desc
+    </select>
+</mapper>

+ 18 - 0
fs-user-app/src/main/java/com/fs/app/controller/AppLoginController.java

@@ -25,6 +25,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.Synchronized;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.annotations.Param;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -402,4 +403,21 @@ public class AppLoginController extends AppBaseController{
             return R.error("用户不存在!");
         }
     }
+
+    /**
+     * 更新jpushId
+     */
+    @Login
+    @GetMapping("/updatePushId")
+    public R updatePushId(@Param("pushId") String pushId) {
+        String userId = getUserId();
+        FsUser fsUser = new FsUser();
+        fsUser.setUserId(Long.parseLong(userId));
+        fsUser.setJpushId(pushId);
+        if (userMapper.updateFsUser(fsUser)>0) {
+            return R.ok();
+        } else {
+            return R.error("用户不存在!");
+        }
+    }
 }

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

@@ -67,9 +67,9 @@ public class PackageController extends AppBaseController {
     private ICompanyService companyService;
 
     @ApiOperation("获取套餐分类")
-    @Cacheable(value = "getPackagCateList", key = "#param")
     @GetMapping("/getPackagCateList")
     public R getPackagCateList(FsPackageCateUParam param) {
+        log.info("获取套餐分类: {} ",param);
         try {
             ObjectMapper objectMapper = new ObjectMapper();
             Long companyUserId = getCompanyUserId();
@@ -80,6 +80,7 @@ public class PackageController extends AppBaseController {
             if (param.getType()==2){
                 param.setCompanyPackageCates(cateIdList);
             }
+            param.setCompanyUserId(companyUserId);
         } catch (Exception e) {
             log.info("获取套餐分类:销售未登录");
         } finally {
@@ -90,7 +91,6 @@ public class PackageController extends AppBaseController {
     }
 
     @ApiOperation("获取套餐列表")
-    @Cacheable(value = "getPackageList", key = "#param")
     @GetMapping("/getPackageList")
     public R getPackageList(FsPackageListUParam param) {
         PageHelper.startPage(param.getPageNum(), param.getPageSize());

+ 18 - 0
fs-user-app/src/main/java/com/fs/app/controller/UserController.java

@@ -34,6 +34,7 @@ import com.google.zxing.WriterException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
@@ -293,4 +294,21 @@ public class UserController extends  AppBaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 更新historyApp
+     */
+    @Login
+    @GetMapping("/updateHistoryApp")
+    public R updateHistoryApp(@Param("historyApp") String historyApp) {
+        String userId = getUserId();
+        FsUser fsUser = new FsUser();
+        fsUser.setUserId(Long.parseLong(userId));
+//        fsUser.setHistoryApp(historyApp);
+        if (userService.updateFsUser(fsUser)>0) {
+            return R.ok();
+        } else {
+            return R.error("用户不存在!");
+        }
+    }
+
 }

+ 4 - 1
fs-user-app/src/main/java/com/fs/framework/aspectj/UserOperationLogAspect.java

@@ -82,7 +82,10 @@ public class UserOperationLogAspect {
                     operationLog.setDetails(details.toString());
                 }
             }
-            logMapper.insertFsUserOperationLog(operationLog);
+
+            if (operationLog.getUserId() != null) {
+                logMapper.insertFsUserOperationLog(operationLog);
+            }
         } catch (Exception ex) {
             log.error("操作日志插入异常", ex);
         } finally {