Parcourir la source

Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_his_scrm_java

caoliqin il y a 1 semaine
Parent
commit
945c1e2f15
21 fichiers modifiés avec 202 ajouts et 70 suppressions
  1. 6 0
      fs-admin/src/main/java/com/fs/hisStore/task/ExpressTask.java
  2. 12 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveController.java
  3. 22 0
      fs-qw-task/src/main/java/com/fs/app/taskService/impl/SopLogsTaskServiceImpl.java
  4. 6 6
      fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java
  5. 1 1
      fs-service/src/main/java/com/fs/gtPush/service/impl/uniPush2ServiceImpl.java
  6. 1 1
      fs-service/src/main/java/com/fs/his/mapper/FsStoreOrderMapper.java
  7. 3 0
      fs-service/src/main/java/com/fs/live/mapper/LiveMapper.java
  8. 3 3
      fs-service/src/main/java/com/fs/live/mapper/LiveOrderMapper.java
  9. 2 0
      fs-service/src/main/java/com/fs/live/service/ILiveService.java
  10. 54 49
      fs-service/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java
  11. 1 0
      fs-service/src/main/java/com/fs/live/vo/LiveDataListVo.java
  12. 1 0
      fs-service/src/main/java/com/fs/live/vo/LiveDataStatisticsVo.java
  13. 10 1
      fs-service/src/main/java/com/fs/qw/service/impl/AsyncSopTestService.java
  14. 9 0
      fs-service/src/main/java/com/fs/qw/vo/QwSopCourseFinishTempSetting.java
  15. 3 0
      fs-service/src/main/java/com/fs/qw/vo/QwSopTempSetting.java
  16. 2 0
      fs-service/src/main/java/com/fs/sop/service/impl/QwSopLogsServiceImpl.java
  17. 49 0
      fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsInfoServiceImpl.java
  18. 5 3
      fs-service/src/main/java/com/fs/wx/order/service/ShippingService.java
  19. 4 4
      fs-service/src/main/java/com/fs/wx/order/service/WeChatAuthFactory.java
  20. 3 0
      fs-service/src/main/resources/mapper/live/LiveOrderMapper.xml
  21. 5 2
      fs-user-app/src/main/java/com/fs/framework/aspectj/UserOperationLogAspect.java

+ 6 - 0
fs-admin/src/main/java/com/fs/hisStore/task/ExpressTask.java

@@ -20,4 +20,10 @@ public class ExpressTask {
         fsStoreOrderScrmService.syncExpressToWx();
     }
 
+
+    //定时任务刷新订单结算状态
+    public void refreshOrderSettlementStatus(){
+        fsStoreOrderScrmService.refreshOrderSettlementStatus();
+    }
+
 }

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

@@ -51,6 +51,18 @@ public class LiveController extends BaseController
     @Autowired
     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.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.fs.app.taskService.SopLogsTaskService;
+import com.fs.common.config.FSSysConfig;
 import com.fs.common.utils.PubFun;
 import com.fs.common.utils.StringUtils;
 import com.fs.company.domain.Company;
@@ -1097,6 +1098,27 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
                         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;
                 default:
                     break;

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

@@ -503,7 +503,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
         FsUser fsUser = fsUserMapper.selectFsUserByUserId(param.getUserId());
         //用户不存在唤起重新授权
         if (fsUser==null){
-            return R.error(504,"未授权");
+            return R.error(401,"未授权");
         }
 
         if (fsUser.getStatus()==0){
@@ -546,10 +546,10 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
         CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
 
 
-        //服务号授权的,缺mpOpenId的重新登录 linkType = 4为app看课 不需要mp
-        if (param.getLinkType() != 4 && config.getMiniAppAuthType()==2 && StringUtil.strIsNullOrEmpty(fsUser.getMpOpenId())){
-            return R.error(401,"授权后可继续!");
-        }
+//        //服务号授权的,缺mpOpenId的重新登录 linkType = 4为app看课 不需要mp
+//        if (param.getLinkType() != 4 && config.getMiniAppAuthType()==2 && StringUtil.strIsNullOrEmpty(fsUser.getMpOpenId())){
+//            return R.error(401,"授权后可继续!");
+//        }
 
         boolean oneCompanyCourse = config.isOneCompanyCourse();
         if(oneCompanyCourse && fsUser.getQwExtId() != null){
@@ -974,7 +974,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
             qwAddContactWayParam.setType(1);
             qwAddContactWayParam.setScene(2);
             qwAddContactWayParam.setUser(users);
-            qwAddContactWayParam.setSkip_verify(true);
+            qwAddContactWayParam.setSkip_verify(false);
             QwAddContactWayResult qwAddContactWayResult = qwApiService.addContactWay(qwAddContactWayParam, qwUser.getCorpId());
             if (qwAddContactWayResult.getErrcode() == 0) {
                 qwUser.setContactWay(qwAddContactWayResult.getQr_code());

+ 1 - 1
fs-service/src/main/java/com/fs/gtPush/service/impl/uniPush2ServiceImpl.java

@@ -46,7 +46,7 @@ public class uniPush2ServiceImpl implements uniPush2Service {
     public void pushSopAppLinkMsgByExternalIM(String cropId, String linkTile, String linkDescribe,String linkImageUrl, String link, Long companyUserId,Long fsUserId) throws JsonProcessingException {
 
         if (companyUserId!=null&&fsUserId!=null && fsUserId!=0){
-            openIMService.sendCourse(fsUserId,companyUserId,link,linkDescribe,linkImageUrl,cropId);
+            openIMService.sendCourse(fsUserId,companyUserId,link,linkTile,linkImageUrl,cropId);
         }
 
     }

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

@@ -375,7 +375,7 @@ public interface FsStoreOrderMapper
             "LEFT JOIN company c on c.company_id =so.company_id " +
             "LEFT JOIN company_user cu on cu.user_id=so.company_user_id " +
             "LEFT JOIN fs_doctor fd on so.follow_doctor_id =fd.doctor_id " +
-            "LEFT JOIN fs_patient pat ON pat.patient_id=p.patient_id  WHERE so.is_del=0  and order_id= #{orderId}")
+            "LEFT JOIN fs_patient pat ON pat.patient_id=p.patient_id  WHERE so.is_del=0  and so.order_id= #{orderId}")
     FsStoreOrderVO selectFsStoreOrderByOrderIdVO(@Param("orderId") Long orderId);
 
     @Update("update fs_store_order set status=-3 where order_id=#{orderId}")

+ 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} " +
             "GROUP BY l.live_id, l.start_time")
     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);
 }

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

@@ -369,8 +369,8 @@ public interface LiveOrderMapper {
     int batchUpdateErpByOrderIds(@Param("maps")ArrayList<Map<String, String>> maps);
 
     @Select({"<script> " +
-            "select o.order_id,o.order_code,o.item_json,o.pay_price,o.status,o.delivery_id,o.finish_time  from live_order o  " +
-            "where o.is_del=0 and o.is_sys_del=0 " +
+            "select o.order_id,o.order_code,o.item_json,o.pay_price,o.status,o.delivery_sn as delivery_id,o.finish_time  from live_order o  " +
+            "where o.is_del=0 " +
             "<if test = 'maps.status != null and maps.status != \"\"     '> " +
             "and o.status =#{maps.status} " +
             "</if>" +
@@ -389,7 +389,7 @@ public interface LiveOrderMapper {
 
     @Select({"<script> " +
             "select o.*  from live_order o  " +
-            "where o.is_del=0 and o.is_sys_del=0 " +
+            "where o.is_del=0 " +
             "<if test = 'maps.status != null and maps.status != \"\"     '> " +
             "and o.status =#{maps.status} " +
             "</if>" +

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

+ 10 - 1
fs-service/src/main/java/com/fs/qw/service/impl/AsyncSopTestService.java

@@ -27,6 +27,7 @@ import com.fs.voice.utils.StringUtil;
 import com.fs.wxUser.param.CompanyWxUserSopParam;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
 import org.apache.rocketmq.spring.core.RocketMQTemplate;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
@@ -510,7 +511,15 @@ public class AsyncSopTestService {
 
         setting.forEach(item->{
             try {
-                push2Service.pushSopAppLinkMsgByExternalIM(cropId,item.getLinkTitle(),item.getLinkDescribe(),item.getLinkImageUrl(),item.getAppLinkUrl(),companyUserId,fsUserId);
+                String linkImageUrl = item.getLinkImageUrl();
+                String linkTitle = item.getLinkTitle();
+                if (StringUtils.isBlank(linkImageUrl)) {
+                    linkImageUrl = item.getCourseUrl();
+                }
+                if (StringUtils.isBlank(linkTitle)) {
+                    linkTitle = item.getTitle();
+                }
+                push2Service.pushSopAppLinkMsgByExternalIM(cropId, linkTitle,item.getLinkDescribe(), linkImageUrl,item.getAppLinkUrl(),companyUserId,fsUserId);
             } catch (JsonProcessingException e) {
                 e.printStackTrace();
             }

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

@@ -80,6 +80,9 @@ public class QwSopCourseFinishTempSetting implements Serializable,Cloneable{
         /** 小程序page路径 */
         private String miniprogramPage;
 
+        /** 直播间ID */
+        private String liveId;
+
         //链接标题
         private String linkTitle;
         //链接描述
@@ -116,6 +119,12 @@ public class QwSopCourseFinishTempSetting implements Serializable,Cloneable{
 
         //课程id
         private Long courseId;
+
+        //封面图片地址 app用的参数
+        private String courseUrl;
+
+        //app显示标题 app用的参数
+        private String title;
         @Override
         public Setting clone() {
             try {

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

@@ -112,6 +112,9 @@ public class QwSopTempSetting implements Serializable{
             /** 小程序page路径 */
             private String miniprogramPage;
 
+            /** 直播间Id*/
+            private Long liveId;
+
             //文件地址
             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,
                                 QwMsgTemplateSop templateSop, List<QwMsgTemplateSop.Attachment> attachments,Long courseId) {
+        // 发送直播卡片兼容处理
+        if(set.getContentType() != null && "12".equals(set.getContentType())) set.setContentType("4");
         switch (set.getContentType()) {
             case "1":
                 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.JSONArray;
 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.exception.base.BaseException;
 import com.fs.common.utils.PubFun;
@@ -663,6 +664,15 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                             case "7":
                                 createVoiceUrl(st, companyUserId, qwSop);
                                 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);
@@ -797,6 +807,15 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                                     createVoiceUrl(st, String.valueOf(qwUser.getCompanyUserId()), qwSop);
                                 }
                                 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);
@@ -991,6 +1010,15 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                                 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;
                         default:
                             break;
@@ -1442,6 +1470,27 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                         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;
                 default:
                     break;

+ 5 - 3
fs-service/src/main/java/com/fs/wx/order/service/ShippingService.java

@@ -1,5 +1,6 @@
 package com.fs.wx.order.service;
 
+import cn.binarywang.wx.miniapp.api.WxMaService;
 import cn.hutool.core.exceptions.ExceptionUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.http.*;
@@ -7,10 +8,12 @@ import cn.hutool.json.JSONUtil;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fs.core.config.WxMaConfiguration;
 import com.fs.wx.order.dto.UploadShippingInfoRequest;
 import com.fs.wx.order.dto.WeChatApiConfig;
 import com.fs.wx.order.dto.WeChatApiResponse;
 import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.common.error.WxErrorException;
 import org.springframework.stereotype.Service;
 import org.springframework.web.util.UriComponentsBuilder;
 
@@ -30,8 +33,8 @@ public class ShippingService {
      * @param request 发货信息请求体
      * @return 微信 API 的响应
      */
-    public WeChatApiResponse uploadShippingInfo(UploadShippingInfoRequest request) {
-        WeChatAuthService weChatAuthService = WeChatAuthFactory.getWeChatAuthService(request.getAppid());
+    public WeChatApiResponse uploadShippingInfo(UploadShippingInfoRequest request) throws WxErrorException {
+        final WxMaService weChatAuthService = WxMaConfiguration.getMaService(request.getAppid());
         String accessToken = weChatAuthService.getAccessToken(false);
         if (accessToken == null) {
             log.error("获取微信 Access Token 失败");
@@ -81,7 +84,6 @@ public class ShippingService {
                     log.warn("微信接口返回业务错误: code={}, message={}", weChatApiResponse.getErrcode(), weChatApiResponse.getErrmsg());
                     if(ObjectUtil.equal(weChatApiResponse.getErrcode(),40001)) {
                         log.info("token缓存失效,清除token,等待下次执行...");
-                        weChatAuthService.clearToken();
                     }
                 }
                 return weChatApiResponse;

+ 4 - 4
fs-service/src/main/java/com/fs/wx/order/service/WeChatAuthFactory.java

@@ -14,17 +14,17 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
-@Component
-public class WeChatAuthFactory implements ApplicationContextAware, SmartInitializingSingleton {
+//@Component
+public class WeChatAuthFactory  {
     private static ApplicationContext applicationContext;
     private final static Map<String,WeChatAuthService> weChatAuthServices = new ConcurrentHashMap<>();
 
-    @Override
+
     public void setApplicationContext(@NotNull ApplicationContext applicationContext) throws BeansException {
         WeChatAuthFactory.applicationContext = applicationContext;
     }
 
-    @Override
+
     public void afterSingletonsInstantiated() {
         PaymentMiniProgramConfigMapper mapper = applicationContext.getBean(PaymentMiniProgramConfigMapper.class);
         List<PaymentMiniProgramConfig> configs = mapper.selectAll();

+ 3 - 0
fs-service/src/main/resources/mapper/live/LiveOrderMapper.xml

@@ -1067,6 +1067,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="payEndTime != null and payEndTime != ''">
                 AND o.pay_time &lt;= #{payEndTime}
             </if>
+            <if test="userPhone != null and userPhone != ''">
+                AND o.user_phone = #{userPhone}
+            </if>
         </where>
         ORDER BY o.create_time DESC
     </select>

+ 5 - 2
fs-user-app/src/main/java/com/fs/framework/aspectj/UserOperationLogAspect.java

@@ -69,7 +69,7 @@ public class UserOperationLogAspect {
     @AfterReturning(pointcut = "@annotation(userOpLog)", returning = "result")
     public void afterReturning(JoinPoint joinPoint,UserOperationLog userOpLog, Object result) {
         FsUserOperationLog operationLog = LOG_HOLDER.get();
-        if (operationLog == null) return;
+        if (operationLog == null || StringUtils.isBlank(operationLog.getOperationType())) return;
 
         try {
             if (operationLog.getUserId() == null){
@@ -117,7 +117,10 @@ public class UserOperationLogAspect {
             //用户
             Long userId =null;
             try {
-                userId = Long.valueOf(jwtUtils.getClaimByToken(ServletUtils.getRequest().getHeader("APPToken")).getSubject().toString());
+                String appToken = ServletUtils.getRequest().getHeader("APPToken");
+                if (StringUtils.isNotBlank(appToken)){
+                    userId = Long.valueOf(jwtUtils.getClaimByToken(appToken).getSubject().toString());
+                }
             } catch (Exception ie){
                 log.info("获取用户id失败");
             }