瀏覽代碼

卓美绑定sop发送直播卡片

yuhongqi 1 周之前
父節點
當前提交
0d25068f42

+ 12 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveController.java

@@ -51,6 +51,18 @@ public class LiveController extends BaseController
     @Autowired
     @Autowired
     private ILiveCompanyCodeService liveCompanyCodeService;
     private ILiveCompanyCodeService liveCompanyCodeService;
 
 
+    /**
+     * 查询未结束直播间
+     */
+    @PreAuthorize("@ss.hasPermi('live:live:list')")
+    @GetMapping("/listToLiveNoEnd")
+    public TableDataInfo listToLiveNoEnd(Live live)
+    {
+        startPage();
+        List<Live> list = liveService.listToLiveNoEnd(live);
+        return getDataTable(list);
+    }
+
     /**
     /**
      * 查询直播列表
      * 查询直播列表
      */
      */

+ 22 - 0
fs-qw-task/src/main/java/com/fs/app/taskService/impl/SopLogsTaskServiceImpl.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.fs.app.taskService.SopLogsTaskService;
 import com.fs.app.taskService.SopLogsTaskService;
+import com.fs.common.config.FSSysConfig;
 import com.fs.common.utils.PubFun;
 import com.fs.common.utils.PubFun;
 import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.company.domain.Company;
 import com.fs.company.domain.Company;
@@ -1097,6 +1098,27 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
                         setting.setMiniprogramAppid("未找到匹配的公司的自定义小程序:"+companyId);
                         setting.setMiniprogramAppid("未找到匹配的公司的自定义小程序:"+companyId);
                     }
                     }
 
 
+                    break;
+                //直播小程序单独
+                case "12":
+                    String sortLiveLink;
+                    sortLiveLink = "/pages_course/living?companyId=" + companyId + "&companyUserId=" + companyUserId + "&liveId=" + setting.getLiveId();
+
+
+                    String miniprogramLiveTitle = setting.getMiniprogramTitle();
+                    int maxLiveLength = 17;
+                    setting.setMiniprogramTitle(miniprogramLiveTitle.length() > maxLiveLength ? miniprogramLiveTitle.substring(0, maxLiveLength) + "..." : miniprogramLiveTitle);
+                    String json = configService.selectConfigByKey("his.config");
+                    FSSysConfig sysConfig= JSON.parseObject(json,FSSysConfig.class);
+                    setting.setMiniprogramAppid(sysConfig.getAppId());
+                    setting.setMiniprogramPage(sortLiveLink);
+                    setting.setContentType("4");
+                    try {
+                        setting.setMiniprogramPicUrl(StringUtil.strIsNullOrEmpty(setting.getMiniprogramPicUrl()) ? "https://cos.his.cdwjyyh.com/fs/20250331/ec2b4e73be8048afbd526124a655ad56.png" : setting.getMiniprogramPicUrl());
+                    } catch (Exception e) {
+                        log.error("赋值-小程序封面地址失败-" + e);
+                    }
+
                     break;
                     break;
                 default:
                 default:
                     break;
                     break;

+ 3 - 0
fs-service/src/main/java/com/fs/live/mapper/LiveMapper.java

@@ -170,4 +170,7 @@ public interface LiveMapper
             "WHERE l.live_id = #{liveId} " +
             "WHERE l.live_id = #{liveId} " +
             "GROUP BY l.live_id, l.start_time")
             "GROUP BY l.live_id, l.start_time")
     Integer selectLiveFlagByLiveId(@Param("liveId") Long liveId);
     Integer selectLiveFlagByLiveId(@Param("liveId") Long liveId);
+
+    @Select("SELECT * FROM live WHERE is_audit = 1 and is_del = 0 and status in (1,2,4) and live_type in (2,3) order by create_time desc")
+    List<Live> listToLiveNoEnd(Live live);
 }
 }

+ 2 - 0
fs-service/src/main/java/com/fs/live/service/ILiveService.java

@@ -192,4 +192,6 @@ public interface ILiveService
     String getGotoWxAppLiveLink(String linkStr, String appid);
     String getGotoWxAppLiveLink(String linkStr, String appid);
 
 
     R liveListAll(PageRequest pageRequest);
     R liveListAll(PageRequest pageRequest);
+
+    List<Live> listToLiveNoEnd(Live live);
 }
 }

+ 54 - 49
fs-service/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java

@@ -469,6 +469,11 @@ public class LiveServiceImpl implements ILiveService
         return R.ok().put("data", result);
         return R.ok().put("data", result);
     }
     }
 
 
+    @Override
+    public List<Live> listToLiveNoEnd(Live live) {
+        return baseMapper.listToLiveNoEnd(live);
+    }
+
     /**
     /**
      * 修改直播
      * 修改直播
      *
      *
@@ -807,43 +812,43 @@ public class LiveServiceImpl implements ILiveService
         if (exist == null) {
         if (exist == null) {
             return R.error("直播间不存在");
             return R.error("直播间不存在");
         }
         }
-        
+
         // 1. 复制直播间基础信息
         // 1. 复制直播间基础信息
         Long newLiveId = copyLiveBasicInfo(exist, live, now);
         Long newLiveId = copyLiveBasicInfo(exist, live, now);
-        
+
         // 2. 创建直播数据
         // 2. 创建直播数据
         createLiveData(newLiveId);
         createLiveData(newLiveId);
-        
+
         // 3. 复制直播视频
         // 3. 复制直播视频
         copyLiveVideos(existLiveId, newLiveId, now);
         copyLiveVideos(existLiveId, newLiveId, now);
-        
+
         // 4. 获取所有自动化任务并按类型分组
         // 4. 获取所有自动化任务并按类型分组
         List<LiveAutoTask> allTasks = liveAutoTaskService.selectLiveAutoTaskByLiveId(existLiveId);
         List<LiveAutoTask> allTasks = liveAutoTaskService.selectLiveAutoTaskByLiveId(existLiveId);
         Map<Long, List<LiveAutoTask>> tasksByType = allTasks.stream()
         Map<Long, List<LiveAutoTask>> tasksByType = allTasks.stream()
                 .collect(Collectors.groupingBy(LiveAutoTask::getTaskType));
                 .collect(Collectors.groupingBy(LiveAutoTask::getTaskType));
-        
+
         // 5. 复制弹幕任务(taskType=3)
         // 5. 复制弹幕任务(taskType=3)
         copyBarrageTasks(tasksByType.get(3L), newLiveId, now);
         copyBarrageTasks(tasksByType.get(3L), newLiveId, now);
-        
+
         // 6. 复制红包配置及任务(taskType=2)
         // 6. 复制红包配置及任务(taskType=2)
         Map<Long, Long> redIdMapping = copyRedConfs(existLiveId, newLiveId, tasksByType.get(2L), now);
         Map<Long, Long> redIdMapping = copyRedConfs(existLiveId, newLiveId, tasksByType.get(2L), now);
-        
+
         // 7. 复制抽奖配置及任务(taskType=4)
         // 7. 复制抽奖配置及任务(taskType=4)
         Map<Long, Long> lotteryIdMapping = copyLotteryConfs(existLiveId, newLiveId, tasksByType.get(4L), now);
         Map<Long, Long> lotteryIdMapping = copyLotteryConfs(existLiveId, newLiveId, tasksByType.get(4L), now);
-        
+
         // 8. 复制商品、商品任务、上下架任务及优惠券关系
         // 8. 复制商品、商品任务、上下架任务及优惠券关系
-        Map<Long, Long> goodsIdMapping = copyGoodsAndTasks(existLiveId, newLiveId, live, 
+        Map<Long, Long> goodsIdMapping = copyGoodsAndTasks(existLiveId, newLiveId, live,
                 tasksByType.get(1L), tasksByType.get(6L), now);
                 tasksByType.get(1L), tasksByType.get(6L), now);
-        
+
         // 9. 复制优惠券关系
         // 9. 复制优惠券关系
         copyCouponRelations(existLiveId, newLiveId, goodsIdMapping);
         copyCouponRelations(existLiveId, newLiveId, goodsIdMapping);
-        
+
         // 10. 复制优惠券自动化任务(taskType=5)
         // 10. 复制优惠券自动化任务(taskType=5)
         copyCouponTasks(tasksByType.get(5L), newLiveId, goodsIdMapping, now);
         copyCouponTasks(tasksByType.get(5L), newLiveId, goodsIdMapping, now);
 
 
         return R.ok("复制成功");
         return R.ok("复制成功");
     }
     }
-    
+
     /**
     /**
      * 复制直播间基础信息
      * 复制直播间基础信息
      */
      */
@@ -865,7 +870,7 @@ public class LiveServiceImpl implements ILiveService
         }
         }
         return liveEntity.getLiveId();
         return liveEntity.getLiveId();
     }
     }
-    
+
     /**
     /**
      * 创建直播数据
      * 创建直播数据
      */
      */
@@ -882,7 +887,7 @@ public class LiveServiceImpl implements ILiveService
         liveData.setFollowNum(0L);
         liveData.setFollowNum(0L);
         liveDataService.insertLiveData(liveData);
         liveDataService.insertLiveData(liveData);
     }
     }
-    
+
     /**
     /**
      * 复制直播视频
      * 复制直播视频
      */
      */
@@ -897,7 +902,7 @@ public class LiveServiceImpl implements ILiveService
             liveVideoService.insertLiveVideo(videoEntity);
             liveVideoService.insertLiveVideo(videoEntity);
         }
         }
     }
     }
-    
+
     /**
     /**
      * 复制弹幕任务(taskType=3)
      * 复制弹幕任务(taskType=3)
      */
      */
@@ -918,20 +923,20 @@ public class LiveServiceImpl implements ILiveService
             liveAutoTaskService.batchInsertLiveAutoTask(addList);
             liveAutoTaskService.batchInsertLiveAutoTask(addList);
         }
         }
     }
     }
-    
+
     /**
     /**
      * 复制红包配置及任务
      * 复制红包配置及任务
      */
      */
-    private Map<Long, Long> copyRedConfs(Long existLiveId, Long newLiveId, 
+    private Map<Long, Long> copyRedConfs(Long existLiveId, Long newLiveId,
                                          List<LiveAutoTask> redTasks, Date now) {
                                          List<LiveAutoTask> redTasks, Date now) {
         Map<Long, Long> redIdMapping = new HashMap<>();
         Map<Long, Long> redIdMapping = new HashMap<>();
         if (redTasks == null) {
         if (redTasks == null) {
             redTasks = Collections.emptyList();
             redTasks = Collections.emptyList();
         }
         }
         Map<Long, LiveAutoTask> redTaskMap = redTasks.stream()
         Map<Long, LiveAutoTask> redTaskMap = redTasks.stream()
-                .collect(Collectors.toMap(task -> parseIdFromContent(task.getContent(), "redId"), 
+                .collect(Collectors.toMap(task -> parseIdFromContent(task.getContent(), "redId"),
                         Function.identity(), (existing, replacement) -> existing));
                         Function.identity(), (existing, replacement) -> existing));
-        
+
         List<LiveRedConf> liveRedConfs = liveRedConfService.selectByLiveId(existLiveId);
         List<LiveRedConf> liveRedConfs = liveRedConfService.selectByLiveId(existLiveId);
         for (LiveRedConf liveRedConf : liveRedConfs) {
         for (LiveRedConf liveRedConf : liveRedConfs) {
             LiveRedConf newRedConf = new LiveRedConf();
             LiveRedConf newRedConf = new LiveRedConf();
@@ -942,32 +947,32 @@ public class LiveServiceImpl implements ILiveService
             newRedConf.setCreateTime(now);
             newRedConf.setCreateTime(now);
             newRedConf.setTotalSend(0L);
             newRedConf.setTotalSend(0L);
             liveRedConfService.insertLiveRedConf(newRedConf);
             liveRedConfService.insertLiveRedConf(newRedConf);
-            
+
             redIdMapping.put(liveRedConf.getRedId(), newRedConf.getRedId());
             redIdMapping.put(liveRedConf.getRedId(), newRedConf.getRedId());
-            
+
             LiveAutoTask task = redTaskMap.get(liveRedConf.getRedId());
             LiveAutoTask task = redTaskMap.get(liveRedConf.getRedId());
             if (task != null) {
             if (task != null) {
-                LiveAutoTask newTask = createAutoTaskEntity(task, newLiveId, now, 
+                LiveAutoTask newTask = createAutoTaskEntity(task, newLiveId, now,
                         JSON.toJSONString(newRedConf));
                         JSON.toJSONString(newRedConf));
                 liveAutoTaskService.directInsertLiveAutoTask(newTask);
                 liveAutoTaskService.directInsertLiveAutoTask(newTask);
             }
             }
         }
         }
         return redIdMapping;
         return redIdMapping;
     }
     }
-    
+
     /**
     /**
      * 复制抽奖配置及任务
      * 复制抽奖配置及任务
      */
      */
-    private Map<Long, Long> copyLotteryConfs(Long existLiveId, Long newLiveId, 
+    private Map<Long, Long> copyLotteryConfs(Long existLiveId, Long newLiveId,
                                              List<LiveAutoTask> lotteryTasks, Date now) {
                                              List<LiveAutoTask> lotteryTasks, Date now) {
         Map<Long, Long> lotteryIdMapping = new HashMap<>();
         Map<Long, Long> lotteryIdMapping = new HashMap<>();
         if (lotteryTasks == null) {
         if (lotteryTasks == null) {
             lotteryTasks = Collections.emptyList();
             lotteryTasks = Collections.emptyList();
         }
         }
         Map<Long, LiveAutoTask> lotteryTaskMap = lotteryTasks.stream()
         Map<Long, LiveAutoTask> lotteryTaskMap = lotteryTasks.stream()
-                .collect(Collectors.toMap(task -> parseIdFromContent(task.getContent(), "lotteryId"), 
+                .collect(Collectors.toMap(task -> parseIdFromContent(task.getContent(), "lotteryId"),
                         Function.identity(), (existing, replacement) -> existing));
                         Function.identity(), (existing, replacement) -> existing));
-        
+
         List<LiveLotteryConf> liveLotteryConfs = liveLotteryConfService.selectByLiveId(existLiveId);
         List<LiveLotteryConf> liveLotteryConfs = liveLotteryConfService.selectByLiveId(existLiveId);
         if (!liveLotteryConfs.isEmpty()) {
         if (!liveLotteryConfs.isEmpty()) {
             List<Long> lotteryIds = liveLotteryConfs.stream()
             List<Long> lotteryIds = liveLotteryConfs.stream()
@@ -975,7 +980,7 @@ public class LiveServiceImpl implements ILiveService
             List<LiveLotteryProductConf> products = liveLotteryProductConfMapper.selectEntityByIds(lotteryIds);
             List<LiveLotteryProductConf> products = liveLotteryProductConfMapper.selectEntityByIds(lotteryIds);
             Map<Long, List<LiveLotteryProductConf>> productsByLotteryId = products.stream()
             Map<Long, List<LiveLotteryProductConf>> productsByLotteryId = products.stream()
                     .collect(Collectors.groupingBy(LiveLotteryProductConf::getLotteryId));
                     .collect(Collectors.groupingBy(LiveLotteryProductConf::getLotteryId));
-            
+
             for (LiveLotteryConf liveLotteryConf : liveLotteryConfs) {
             for (LiveLotteryConf liveLotteryConf : liveLotteryConfs) {
                 LiveLotteryConf newLotteryConf = new LiveLotteryConf();
                 LiveLotteryConf newLotteryConf = new LiveLotteryConf();
                 BeanUtils.copyBeanProp(newLotteryConf, liveLotteryConf);
                 BeanUtils.copyBeanProp(newLotteryConf, liveLotteryConf);
@@ -985,9 +990,9 @@ public class LiveServiceImpl implements ILiveService
                 newLotteryConf.setCreateTime(now);
                 newLotteryConf.setCreateTime(now);
                 newLotteryConf.setUpdateTime(now);
                 newLotteryConf.setUpdateTime(now);
                 liveLotteryConfService.insertLiveLotteryConf(newLotteryConf);
                 liveLotteryConfService.insertLiveLotteryConf(newLotteryConf);
-                
+
                 lotteryIdMapping.put(liveLotteryConf.getLotteryId(), newLotteryConf.getLotteryId());
                 lotteryIdMapping.put(liveLotteryConf.getLotteryId(), newLotteryConf.getLotteryId());
-                
+
                 // 复制奖品
                 // 复制奖品
                 List<LiveLotteryProductConf> lotteryProducts = productsByLotteryId.get(liveLotteryConf.getLotteryId());
                 List<LiveLotteryProductConf> lotteryProducts = productsByLotteryId.get(liveLotteryConf.getLotteryId());
                 if (lotteryProducts != null) {
                 if (lotteryProducts != null) {
@@ -999,10 +1004,10 @@ public class LiveServiceImpl implements ILiveService
                         liveLotteryProductConfMapper.insertLiveLotteryProductConf(newProduct);
                         liveLotteryProductConfMapper.insertLiveLotteryProductConf(newProduct);
                     }
                     }
                 }
                 }
-                
+
                 LiveAutoTask task = lotteryTaskMap.get(liveLotteryConf.getLotteryId());
                 LiveAutoTask task = lotteryTaskMap.get(liveLotteryConf.getLotteryId());
                 if (task != null) {
                 if (task != null) {
-                    LiveAutoTask newTask = createAutoTaskEntity(task, newLiveId, now, 
+                    LiveAutoTask newTask = createAutoTaskEntity(task, newLiveId, now,
                             JSON.toJSONString(newLotteryConf));
                             JSON.toJSONString(newLotteryConf));
                     liveAutoTaskService.directInsertLiveAutoTask(newTask);
                     liveAutoTaskService.directInsertLiveAutoTask(newTask);
                 }
                 }
@@ -1010,7 +1015,7 @@ public class LiveServiceImpl implements ILiveService
         }
         }
         return lotteryIdMapping;
         return lotteryIdMapping;
     }
     }
-    
+
     /**
     /**
      * 复制商品、商品任务、上下架任务
      * 复制商品、商品任务、上下架任务
      */
      */
@@ -1023,25 +1028,25 @@ public class LiveServiceImpl implements ILiveService
         if (shelfTasks == null) {
         if (shelfTasks == null) {
             shelfTasks = Collections.emptyList();
             shelfTasks = Collections.emptyList();
         }
         }
-        
+
         Map<Long, LiveAutoTask> goodsTaskMap = goodsTasks.stream()
         Map<Long, LiveAutoTask> goodsTaskMap = goodsTasks.stream()
-                .collect(Collectors.toMap(task -> parseIdFromContent(task.getContent(), "goodsId"), 
+                .collect(Collectors.toMap(task -> parseIdFromContent(task.getContent(), "goodsId"),
                         Function.identity(), (existing, replacement) -> existing));
                         Function.identity(), (existing, replacement) -> existing));
         Map<Long, LiveAutoTask> shelfTaskMap = shelfTasks.stream()
         Map<Long, LiveAutoTask> shelfTaskMap = shelfTasks.stream()
-                .collect(Collectors.toMap(task -> parseIdFromContent(task.getContent(), "goodsId"), 
+                .collect(Collectors.toMap(task -> parseIdFromContent(task.getContent(), "goodsId"),
                         Function.identity(), (existing, replacement) -> existing));
                         Function.identity(), (existing, replacement) -> existing));
-        
+
         LiveGoods queryParam = new LiveGoods();
         LiveGoods queryParam = new LiveGoods();
         queryParam.setLiveId(existLiveId);
         queryParam.setLiveId(existLiveId);
         List<LiveGoodsVo> goodsList = liveGoodsService.selectProductListByLiveId(queryParam);
         List<LiveGoodsVo> goodsList = liveGoodsService.selectProductListByLiveId(queryParam);
-        
+
         if (!goodsList.isEmpty()) {
         if (!goodsList.isEmpty()) {
             List<Long> goodsProductIds = goodsList.stream()
             List<Long> goodsProductIds = goodsList.stream()
                     .map(LiveGoodsVo::getProductId).collect(Collectors.toList());
                     .map(LiveGoodsVo::getProductId).collect(Collectors.toList());
             Map<Long, FsStoreProductScrm> goodsMap = fsStoreProductScrmMapper
             Map<Long, FsStoreProductScrm> goodsMap = fsStoreProductScrmMapper
                     .selectFsStoreProductByProductIds(goodsProductIds).stream()
                     .selectFsStoreProductByProductIds(goodsProductIds).stream()
                     .collect(Collectors.toMap(FsStoreProductScrm::getProductId, Function.identity()));
                     .collect(Collectors.toMap(FsStoreProductScrm::getProductId, Function.identity()));
-            
+
             for (LiveGoodsVo liveGoods : goodsList) {
             for (LiveGoodsVo liveGoods : goodsList) {
                 LiveGoods newGoods = new LiveGoods();
                 LiveGoods newGoods = new LiveGoods();
                 BeanUtils.copyBeanProp(newGoods, liveGoods);
                 BeanUtils.copyBeanProp(newGoods, liveGoods);
@@ -1051,12 +1056,12 @@ public class LiveServiceImpl implements ILiveService
                 newGoods.setIsShow(false);
                 newGoods.setIsShow(false);
                 newGoods.setCompanyId(live.getCompanyId());
                 newGoods.setCompanyId(live.getCompanyId());
                 newGoods.setCompanyUserId(live.getCompanyUserId());
                 newGoods.setCompanyUserId(live.getCompanyUserId());
-                newGoods.setStock(goodsMap.containsKey(liveGoods.getProductId()) 
+                newGoods.setStock(goodsMap.containsKey(liveGoods.getProductId())
                         ? goodsMap.get(liveGoods.getProductId()).getStock() : 0);
                         ? goodsMap.get(liveGoods.getProductId()).getStock() : 0);
                 liveGoodsService.insertLiveGoods(newGoods);
                 liveGoodsService.insertLiveGoods(newGoods);
-                
+
                 goodsIdMapping.put(liveGoods.getGoodsId(), newGoods.getGoodsId());
                 goodsIdMapping.put(liveGoods.getGoodsId(), newGoods.getGoodsId());
-                
+
                 // 复制商品推送任务(taskType=1)
                 // 复制商品推送任务(taskType=1)
                 LiveAutoTask goodsTask = goodsTaskMap.get(liveGoods.getGoodsId());
                 LiveAutoTask goodsTask = goodsTaskMap.get(liveGoods.getGoodsId());
                 if (goodsTask != null) {
                 if (goodsTask != null) {
@@ -1064,17 +1069,17 @@ public class LiveServiceImpl implements ILiveService
                     LiveGoodsVo newGoodsVo = new LiveGoodsVo();
                     LiveGoodsVo newGoodsVo = new LiveGoodsVo();
                     BeanUtils.copyBeanProp(newGoodsVo, liveGoods);
                     BeanUtils.copyBeanProp(newGoodsVo, liveGoods);
                     newGoodsVo.setGoodsId(newGoods.getGoodsId());
                     newGoodsVo.setGoodsId(newGoods.getGoodsId());
-                    LiveAutoTask newTask = createAutoTaskEntity(goodsTask, newLiveId, now, 
+                    LiveAutoTask newTask = createAutoTaskEntity(goodsTask, newLiveId, now,
                             JSON.toJSONString(newGoodsVo));
                             JSON.toJSONString(newGoodsVo));
                     liveAutoTaskService.directInsertLiveAutoTask(newTask);
                     liveAutoTaskService.directInsertLiveAutoTask(newTask);
                 }
                 }
-                
+
                 // 复制上下架任务(taskType=6)
                 // 复制上下架任务(taskType=6)
                 LiveAutoTask shelfTask = shelfTaskMap.get(liveGoods.getGoodsId());
                 LiveAutoTask shelfTask = shelfTaskMap.get(liveGoods.getGoodsId());
                 if (shelfTask != null) {
                 if (shelfTask != null) {
                     JSONObject contentJson = JSON.parseObject(shelfTask.getContent());
                     JSONObject contentJson = JSON.parseObject(shelfTask.getContent());
                     contentJson.put("goodsId", newGoods.getGoodsId());
                     contentJson.put("goodsId", newGoods.getGoodsId());
-                    LiveAutoTask newTask = createAutoTaskEntity(shelfTask, newLiveId, now, 
+                    LiveAutoTask newTask = createAutoTaskEntity(shelfTask, newLiveId, now,
                             contentJson.toJSONString());
                             contentJson.toJSONString());
                     liveAutoTaskService.directInsertLiveAutoTask(newTask);
                     liveAutoTaskService.directInsertLiveAutoTask(newTask);
                 }
                 }
@@ -1082,7 +1087,7 @@ public class LiveServiceImpl implements ILiveService
         }
         }
         return goodsIdMapping;
         return goodsIdMapping;
     }
     }
-    
+
     /**
     /**
      * 复制优惠券关系
      * 复制优惠券关系
      */
      */
@@ -1100,11 +1105,11 @@ public class LiveServiceImpl implements ILiveService
             liveCouponIssueMapper.insertLiveCouponIssueRelation(newRelation);
             liveCouponIssueMapper.insertLiveCouponIssueRelation(newRelation);
         }
         }
     }
     }
-    
+
     /**
     /**
      * 复制优惠券自动化任务(taskType=5)
      * 复制优惠券自动化任务(taskType=5)
      */
      */
-    private void copyCouponTasks(List<LiveAutoTask> couponTasks, Long newLiveId, 
+    private void copyCouponTasks(List<LiveAutoTask> couponTasks, Long newLiveId,
                                  Map<Long, Long> goodsIdMapping, Date now) {
                                  Map<Long, Long> goodsIdMapping, Date now) {
         if (couponTasks == null || couponTasks.isEmpty()) {
         if (couponTasks == null || couponTasks.isEmpty()) {
             return;
             return;
@@ -1117,7 +1122,7 @@ public class LiveServiceImpl implements ILiveService
                     Long newGoodsId = goodsIdMapping.get(liveCoupon.getGoodsId());
                     Long newGoodsId = goodsIdMapping.get(liveCoupon.getGoodsId());
                     if (newGoodsId != null) {
                     if (newGoodsId != null) {
                         liveCoupon.setGoodsId(newGoodsId);
                         liveCoupon.setGoodsId(newGoodsId);
-                        LiveAutoTask newTask = createAutoTaskEntity(task, newLiveId, now, 
+                        LiveAutoTask newTask = createAutoTaskEntity(task, newLiveId, now,
                                 JSON.toJSONString(liveCoupon));
                                 JSON.toJSONString(liveCoupon));
                         liveAutoTaskService.directInsertLiveAutoTask(newTask);
                         liveAutoTaskService.directInsertLiveAutoTask(newTask);
                     }
                     }
@@ -1127,7 +1132,7 @@ public class LiveServiceImpl implements ILiveService
             }
             }
         }
         }
     }
     }
-    
+
     /**
     /**
      * 创建自动化任务实体
      * 创建自动化任务实体
      */
      */

+ 1 - 0
fs-service/src/main/java/com/fs/live/vo/LiveDataListVo.java

@@ -77,3 +77,4 @@ public class LiveDataListVo {
 
 
 
 
 
 
+

+ 1 - 0
fs-service/src/main/java/com/fs/live/vo/LiveDataStatisticsVo.java

@@ -58,3 +58,4 @@ public class LiveDataStatisticsVo {
 
 
 
 
 
 
+

+ 3 - 0
fs-service/src/main/java/com/fs/qw/vo/QwSopCourseFinishTempSetting.java

@@ -80,6 +80,9 @@ public class QwSopCourseFinishTempSetting implements Serializable,Cloneable{
         /** 小程序page路径 */
         /** 小程序page路径 */
         private String miniprogramPage;
         private String miniprogramPage;
 
 
+        /** 直播间ID */
+        private String liveId;
+
         //链接标题
         //链接标题
         private String linkTitle;
         private String linkTitle;
         //链接描述
         //链接描述

+ 3 - 0
fs-service/src/main/java/com/fs/qw/vo/QwSopTempSetting.java

@@ -112,6 +112,9 @@ public class QwSopTempSetting implements Serializable{
             /** 小程序page路径 */
             /** 小程序page路径 */
             private String miniprogramPage;
             private String miniprogramPage;
 
 
+            /** 直播间Id*/
+            private Long liveId;
+
             //文件地址
             //文件地址
             private String fileUrl;
             private String fileUrl;
             //视频地址
             //视频地址

+ 2 - 0
fs-service/src/main/java/com/fs/sop/service/impl/QwSopLogsServiceImpl.java

@@ -2088,6 +2088,8 @@ public class QwSopLogsServiceImpl extends ServiceImpl<QwSopLogsMapper, QwSopLogs
     // 处理不同类型的内容
     // 处理不同类型的内容
     private void processContent(QwSopTempSetting.Content.Setting set, String corpId,
     private void processContent(QwSopTempSetting.Content.Setting set, String corpId,
                                 QwMsgTemplateSop templateSop, List<QwMsgTemplateSop.Attachment> attachments,Long courseId) {
                                 QwMsgTemplateSop templateSop, List<QwMsgTemplateSop.Attachment> attachments,Long courseId) {
+        // 发送直播卡片兼容处理
+        if(set.getContentType() != null && "12".equals(set.getContentType())) set.setContentType("4");
         switch (set.getContentType()) {
         switch (set.getContentType()) {
             case "1":
             case "1":
                 templateSop.setTextContent(set.getValue());
                 templateSop.setTextContent(set.getValue());

+ 49 - 0
fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsInfoServiceImpl.java

@@ -5,6 +5,7 @@ import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.fs.common.config.FSSysConfig;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.domain.R;
 import com.fs.common.exception.base.BaseException;
 import com.fs.common.exception.base.BaseException;
 import com.fs.common.utils.PubFun;
 import com.fs.common.utils.PubFun;
@@ -663,6 +664,15 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                             case "7":
                             case "7":
                                 createVoiceUrl(st, companyUserId, qwSop);
                                 createVoiceUrl(st, companyUserId, qwSop);
                                 break;
                                 break;
+                            //直播小程序单独
+                            case "12":
+                                String sortLiveLink = "/pages_course/living?companyId=" + qwUser.getCompanyUserId() + "&companyUserId=" + companyUserId + "&liveId=" + st.getLiveId();
+                                st.setContentType("4");
+                                String js = configService.selectConfigByKey("his.config");
+                                FSSysConfig sysConfig= JSON.parseObject(js,FSSysConfig.class);
+                                st.setMiniprogramAppid(sysConfig.getAppId());
+                                st.setMiniprogramPage(sortLiveLink);
+                                break;
                         }
                         }
                     }
                     }
                     setting.setSetting(list);
                     setting.setSetting(list);
@@ -797,6 +807,15 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                                     createVoiceUrl(st, String.valueOf(qwUser.getCompanyUserId()), qwSop);
                                     createVoiceUrl(st, String.valueOf(qwUser.getCompanyUserId()), qwSop);
                                 }
                                 }
                                 break;
                                 break;
+                            //直播小程序单独
+                            case "12":
+                                String sortLiveLink = "/pages_course/living?companyId=" + qwUser.getCompanyUserId() + "&companyUserId=" + qwUser.getCompanyUserId() + "&liveId=" + st.getLiveId();
+                                st.setContentType("4");
+                                String js = configService.selectConfigByKey("his.config");
+                                FSSysConfig sysConfig= JSON.parseObject(js,FSSysConfig.class);
+                                st.setMiniprogramAppid(sysConfig.getAppId());
+                                st.setMiniprogramPage(sortLiveLink);
+                                break;
                         }
                         }
                     }
                     }
                     setting.setSetting(list);
                     setting.setSetting(list);
@@ -991,6 +1010,15 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                                 st.setMiniprogramAppid("未找到匹配的公司的自定义小程序:"+companyId);
                                 st.setMiniprogramAppid("未找到匹配的公司的自定义小程序:"+companyId);
                             }
                             }
 
 
+                            break;
+                        //直播小程序单独
+                        case "12":
+                            String sortLiveLink = "/pages_course/living?companyId=" + qwUser.getCompanyUserId() + "&companyUserId=" + qwUser.getCompanyUserId() + "&liveId=" + st.getLiveId();
+                            st.setContentType("4");
+                            String js = configService.selectConfigByKey("his.config");
+                            FSSysConfig sysConfig= JSON.parseObject(js,FSSysConfig.class);
+                            st.setMiniprogramAppid(sysConfig.getAppId());
+                            st.setMiniprogramPage(sortLiveLink);
                             break;
                             break;
                         default:
                         default:
                             break;
                             break;
@@ -1442,6 +1470,27 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                         st.setMiniprogramAppid("未找到匹配的公司的自定义小程序:"+companyId);
                         st.setMiniprogramAppid("未找到匹配的公司的自定义小程序:"+companyId);
                     }
                     }
 
 
+                    break;
+                //直播小程序单独
+                case "12":
+                    String sortLiveLink;
+                    sortLiveLink = "/pages_course/living?companyId=" + companyId + "&companyUserId=" + companyUserId + "&liveId=" + st.getLiveId();
+
+
+                    String miniprogramLiveTitle = st.getMiniprogramTitle();
+                    int maxLiveLength = 17;
+                    st.setMiniprogramTitle(miniprogramLiveTitle.length() > maxLiveLength ? miniprogramLiveTitle.substring(0, maxLiveLength) + "..." : miniprogramLiveTitle);
+                    String json = configService.selectConfigByKey("his.config");
+                    FSSysConfig sysConfig= JSON.parseObject(json,FSSysConfig.class);
+                    st.setMiniprogramAppid(sysConfig.getAppId());
+                    st.setMiniprogramPage(sortLiveLink);
+                    st.setContentType("4");
+                    try {
+                        st.setMiniprogramPicUrl(StringUtil.strIsNullOrEmpty(st.getMiniprogramPicUrl()) ? "https://cos.his.cdwjyyh.com/fs/20250331/ec2b4e73be8048afbd526124a655ad56.png" : st.getMiniprogramPicUrl());
+                    } catch (Exception e) {
+                        log.error("赋值-小程序封面地址失败-" + e);
+                    }
+
                     break;
                     break;
                 default:
                 default:
                     break;
                     break;