Browse Source

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

caoliqin 4 days ago
parent
commit
677bb95a66
49 changed files with 736 additions and 40 deletions
  1. 6 6
      fs-admin/src/main/java/com/fs/his/controller/FsAdvController.java
  2. 1 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreAfterSalesScrmController.java
  3. 1 0
      fs-admin/src/main/java/com/fs/live/controller/LiveAfterSalesController.java
  4. 33 0
      fs-admin/src/main/java/com/fs/qw/controller/QwFriendWelcomeController.java
  5. 7 0
      fs-admin/src/main/java/com/fs/qw/controller/QwUserController.java
  6. 13 2
      fs-company/src/main/java/com/fs/company/controller/live/LiveWatchLogController.java
  7. 2 1
      fs-company/src/main/java/com/fs/company/controller/qw/QwFriendWelcomeController.java
  8. 19 4
      fs-ipad-task/src/main/java/com/fs/app/service/IpadSendServer.java
  9. 21 6
      fs-qw-task/src/main/java/com/fs/app/taskService/impl/SopLogsTaskServiceImpl.java
  10. 3 0
      fs-service/src/main/java/com/fs/course/mapper/FsCourseRedPacketLogMapper.java
  11. 2 0
      fs-service/src/main/java/com/fs/course/service/IFsCourseRedPacketLogService.java
  12. 24 0
      fs-service/src/main/java/com/fs/course/service/impl/FsCourseRedPacketLogServiceImpl.java
  13. 8 0
      fs-service/src/main/java/com/fs/his/service/impl/FsStorePaymentServiceImpl.java
  14. 6 0
      fs-service/src/main/java/com/fs/hisStore/domain/FsStoreAfterSalesScrm.java
  15. 4 1
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreAfterSalesScrmMapper.java
  16. 2 0
      fs-service/src/main/java/com/fs/hisStore/vo/FsStoreAfterSalesVO.java
  17. 3 0
      fs-service/src/main/java/com/fs/hisStore/vo/FsStoreOrderItemExportRefundZMVO.java
  18. 7 1
      fs-service/src/main/java/com/fs/ipad/IpadSendUtils.java
  19. 31 0
      fs-service/src/main/java/com/fs/ipad/vo/WxSendTextAtMsgVo.java
  20. 3 0
      fs-service/src/main/java/com/fs/live/mapper/LiveWatchLogMapper.java
  21. 8 0
      fs-service/src/main/java/com/fs/live/service/ILiveWatchLogService.java
  22. 5 0
      fs-service/src/main/java/com/fs/live/service/impl/LiveCompletionPointsRecordServiceImpl.java
  23. 10 0
      fs-service/src/main/java/com/fs/live/service/impl/LiveWatchLogServiceImpl.java
  24. 6 0
      fs-service/src/main/java/com/fs/live/vo/LiveAfterSalesVo.java
  25. 118 0
      fs-service/src/main/java/com/fs/live/vo/LiveWatchLogListVO.java
  26. 1 1
      fs-service/src/main/java/com/fs/qw/mapper/QwFriendWelcomeMapper.java
  27. 1 1
      fs-service/src/main/java/com/fs/qw/service/IQwFriendWelcomeService.java
  28. 34 5
      fs-service/src/main/java/com/fs/qw/service/impl/QwFriendWelcomeServiceImpl.java
  29. 3 0
      fs-service/src/main/java/com/fs/qw/vo/QwFriendWelcomeVO.java
  30. 9 0
      fs-service/src/main/java/com/fs/qw/vo/QwSopTempSetting.java
  31. 3 0
      fs-service/src/main/java/com/fs/sop/domain/QwSopTemp.java
  32. 3 0
      fs-service/src/main/java/com/fs/sop/domain/QwSopTempRules.java
  33. 6 0
      fs-service/src/main/java/com/fs/sop/service/impl/QwSopTempServiceImpl.java
  34. 207 0
      fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsInfoServiceImpl.java
  35. 46 0
      fs-service/src/main/java/com/fs/wxwork/dto/WxSendTextAtMsgTwoDTO.java
  36. 7 0
      fs-service/src/main/java/com/fs/wxwork/service/WxWorkServiceNew.java
  37. 1 0
      fs-service/src/main/resources/application-config-dev-jnlzjk.yml
  38. 1 0
      fs-service/src/main/resources/application-config-druid-bjzm-test.yml
  39. 1 0
      fs-service/src/main/resources/application-config-druid-hsyy.yml
  40. 1 0
      fs-service/src/main/resources/application-config-druid-jnlzjk.yml
  41. 1 0
      fs-service/src/main/resources/application-config-druid-sxjz.yml
  42. 3 9
      fs-service/src/main/resources/application-config-druid-ylrz.yml
  43. 2 0
      fs-service/src/main/resources/application-config-zkzh.yml
  44. 1 1
      fs-service/src/main/resources/application-druid-sxjz.yml
  45. 2 1
      fs-service/src/main/resources/mapper/live/LiveAfterSalesMapper.xml
  46. 35 0
      fs-service/src/main/resources/mapper/live/LiveWatchLogMapper.xml
  47. 1 1
      fs-service/src/main/resources/mapper/qw/QwFriendWelcomeMapper.xml
  48. 8 0
      fs-user-app/src/main/java/com/fs/app/controller/course/CourseTransferController.java
  49. 16 0
      fs-user-app/src/main/java/com/fs/app/controller/live/LiveCompletionPointsController.java

+ 6 - 6
fs-admin/src/main/java/com/fs/his/controller/FsAdvController.java

@@ -40,7 +40,7 @@ public class FsAdvController extends BaseController
     /**
      * 查询广告列表
      */
-    @PreAuthorize("@ss.hasPermi('store:adv:list')")
+    @PreAuthorize("@ss.hasPermi('store:adv:list') or @ss.hasPermi('his:adv:list')")
     @GetMapping("/list")
     public TableDataInfo list(FsAdv fsAdv)
     {
@@ -52,7 +52,7 @@ public class FsAdvController extends BaseController
     /**
      * 导出广告列表
      */
-    @PreAuthorize("@ss.hasPermi('store:adv:export')")
+    @PreAuthorize("@ss.hasPermi('store:adv:export') or @ss.hasPermi('his:adv:export')")
     @Log(title = "广告", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(FsAdv fsAdv)
@@ -65,7 +65,7 @@ public class FsAdvController extends BaseController
     /**
      * 获取广告详细信息
      */
-    @PreAuthorize("@ss.hasPermi('store:adv:query')")
+    @PreAuthorize("@ss.hasPermi('store:adv:query') or @ss.hasPermi('his:adv:query')")
     @GetMapping(value = "/{advId}")
     public AjaxResult getInfo(@PathVariable("advId") String advId)
     {
@@ -76,7 +76,7 @@ public class FsAdvController extends BaseController
     /**
      * 新增广告
      */
-    @PreAuthorize("@ss.hasPermi('store:adv:add')")
+    @PreAuthorize("@ss.hasPermi('store:adv:add') or @ss.hasPermi('his:adv:add')")
     @Log(title = "广告", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody FsAdv fsAdv)
@@ -91,7 +91,7 @@ public class FsAdvController extends BaseController
     /**
      * 修改广告
      */
-    @PreAuthorize("@ss.hasPermi('store:adv:edit')")
+    @PreAuthorize("@ss.hasPermi('store:adv:edit') or @ss.hasPermi('his:adv:edit')")
     @Log(title = "广告", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody FsAdv fsAdv)
@@ -105,7 +105,7 @@ public class FsAdvController extends BaseController
     /**
      * 删除广告
      */
-    @PreAuthorize("@ss.hasPermi('store:adv:remove')")
+    @PreAuthorize("@ss.hasPermi('store:adv:remove') or @ss.hasPermi('his:adv:remove')")
     @Log(title = "广告", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{advIds}")
     public AjaxResult remove(@PathVariable String[] advIds)

+ 1 - 0
fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreAfterSalesScrmController.java

@@ -106,6 +106,7 @@ public class FsStoreAfterSalesScrmController extends BaseController
                     .map(vo -> {
                         FsStoreOrderItemExportRefundZMVO zmvo = new FsStoreOrderItemExportRefundZMVO();
                         try {
+                            zmvo.setPayCode(vo.getPayCode());
                             zmvo.setOrderCode(vo.getOrderCode());
                             zmvo.setStatus(vo.getOrderStatus().toString());
                             zmvo.setUserId(vo.getUserId());

+ 1 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveAfterSalesController.java

@@ -120,6 +120,7 @@ public class LiveAfterSalesController extends BaseController
                     .map(vo -> {
                         FsStoreOrderItemExportRefundZMVO zmvo = new FsStoreOrderItemExportRefundZMVO();
                         try {
+                            zmvo.setPayCode(vo.getPayCode());
                             zmvo.setOrderCode(vo.getOrderCode());
                             zmvo.setStatus(vo.getOrderStatus().toString());
                             zmvo.setUserId(vo.getUserId());

+ 33 - 0
fs-admin/src/main/java/com/fs/qw/controller/QwFriendWelcomeController.java

@@ -0,0 +1,33 @@
+package com.fs.qw.controller;
+
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.qw.param.QwFriendWelcomeParam;
+import com.fs.qw.service.IQwFriendWelcomeService;
+import com.fs.qw.vo.QwFriendWelcomeVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/qw/friendWelcome")
+public class QwFriendWelcomeController extends BaseController {
+
+    @Autowired
+    private IQwFriendWelcomeService qwFriendWelcomeService;
+
+    /**
+     * 查询好友欢迎语列表
+     */
+    @PreAuthorize("@ss.hasPermi('qw:friendWelcome:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(QwFriendWelcomeParam qwFriendWelcomeParam) {
+        startPage();
+        List<QwFriendWelcomeVO> list = qwFriendWelcomeService.selectQwFriendWelcomeList(qwFriendWelcomeParam);
+        return getDataTable(list);
+    }
+}

+ 7 - 0
fs-admin/src/main/java/com/fs/qw/controller/QwUserController.java

@@ -354,4 +354,11 @@ public class QwUserController extends BaseController {
         List<QwUserVO> list = qwUserService.selectAllQwUserListVO(qwUser);
         return getDataTable(list);
     }
+
+    @GetMapping("/getQwAllUserList")
+    public R getQwAllUserList(@RequestParam String corpId, @RequestParam Long companyId)
+    {
+        List<QwUserVO> list = companyUserService.selectCompanyQwUserList(corpId, companyId);
+        return  R.ok().put("data",list);
+    }
 }

+ 13 - 2
fs-company/src/main/java/com/fs/company/controller/live/LiveWatchLogController.java

@@ -3,6 +3,10 @@ package com.fs.company.controller.live;
 import java.util.List;
 
 import com.fs.common.core.domain.R;
+import com.fs.common.utils.ServletUtils;
+import com.fs.framework.security.LoginUser;
+import com.fs.framework.service.TokenService;
+import com.fs.live.vo.LiveWatchLogListVO;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -34,7 +38,8 @@ public class LiveWatchLogController extends BaseController
 {
     @Autowired
     private ILiveWatchLogService liveWatchLogService;
-
+    @Autowired
+    private TokenService tokenService;
     /**
      * 查询直播看课记录列表
      */
@@ -43,7 +48,13 @@ public class LiveWatchLogController extends BaseController
     public TableDataInfo list(LiveWatchLog liveWatchLog)
     {
         startPage();
-        List<LiveWatchLog> list = liveWatchLogService.selectLiveWatchLogList(liveWatchLog);
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        if(null == loginUser) {
+           throw new RuntimeException("用户信息错误");
+        }
+        Long companyId = loginUser.getCompany().getCompanyId();
+        liveWatchLog.setCompanyId(companyId);
+        List<LiveWatchLogListVO> list = liveWatchLogService.selectLiveWatchLogListInfo(liveWatchLog);
         return getDataTable(list);
     }
 

+ 2 - 1
fs-company/src/main/java/com/fs/company/controller/qw/QwFriendWelcomeController.java

@@ -17,6 +17,7 @@ import com.fs.qw.domain.QwFriendWelcome;
 import com.fs.qw.param.QwFriendWelcomeParam;
 import com.fs.qw.service.IQwFriendWelcomeService;
 import com.fs.qw.service.IQwUserService;
+import com.fs.qw.vo.QwFriendWelcomeVO;
 import com.fs.qw.vo.QwOptionsVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -59,7 +60,7 @@ public class QwFriendWelcomeController extends BaseController
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         qwFriendWelcomeParam.setCompanyId(loginUser.getCompany().getCompanyId());
         startPage();
-        List<QwFriendWelcome> list = qwFriendWelcomeService.selectQwFriendWelcomeList(qwFriendWelcomeParam);
+        List<QwFriendWelcomeVO> list = qwFriendWelcomeService.selectQwFriendWelcomeList(qwFriendWelcomeParam);
         return getDataTable(list);
     }
 

+ 19 - 4
fs-ipad-task/src/main/java/com/fs/app/service/IpadSendServer.java

@@ -40,10 +40,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import java.time.LocalDateTime;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
+import java.util.*;
 import java.util.stream.Collectors;
 
 @Slf4j
@@ -248,6 +245,21 @@ public class IpadSendServer {
         }
     }
 
+        public void sendTxtAtMsg(BaseVo vo) {
+        WxSendTextAtMsgTwoDTO dto = new WxSendTextAtMsgTwoDTO();
+        List<WxSendTextAtMsgTwoDTO.Contentva> contentvaList = new ArrayList<>();
+        WxSendTextAtMsgTwoDTO.Contentva contentva = new WxSendTextAtMsgTwoDTO.Contentva();
+        contentva.setMsgtype(5);
+        contentva.setVid(0);
+        contentvaList.add(contentva);
+        dto.setContentva(contentvaList);
+        dto.setBase(vo);
+         dto.setUuid(vo.getUuid());
+        dto.setSend_userid(ipadSendUtils.userIds(vo));
+        dto.setIsRoom(true);
+       ipadSendUtils.sendTxtAtMsgVo(dto, vo.getServerId());
+    }
+    
     public void sendVoice(BaseVo vo, QwSopCourseFinishTempSetting.Setting content) {
         if (StringUtils.isEmpty(content.getVoiceUrl()) || StringUtils.isEmpty(content.getVoiceDuration())) {
             log.debug("语音未生成无法发送,转文字发送:{}", vo);
@@ -465,6 +477,9 @@ public class IpadSendServer {
                     // 语音
                     sendWxVideo(vo, content);
                     break;
+                case "99":
+                    // 群发
+                    sendTxtAtMsg(vo);
                 default:
                     // 未知类型,记录警告
                     log.error("SOP_LOG_ID:{}错误的发送类型: {}", qwSopLogs.getId(), content.getContentType());

+ 21 - 6
fs-qw-task/src/main/java/com/fs/app/taskService/impl/SopLogsTaskServiceImpl.java

@@ -676,6 +676,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
             content.setVideoId(e.getVideoId());
             content.setCourseType(e.getCourseType());
             content.setAiTouch(e.getAiTouch());
+            content.setIsAtAll(e.getIsAtAll());
             return content;
         }).sorted(Comparator.comparing(e -> LocalTime.parse(e.getTime() + ":00"))).peek(e -> e.setIndex(i.getAndIncrement())).collect(Collectors.toList());
     }
@@ -700,7 +701,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
         if(content.getSetting() == null){
             return;
         }
-        List<QwSopTempSetting.Content.Setting> setting = content.getSetting().stream().filter(e -> "7".equals(e.getContentType())).collect(Collectors.toList());
+        List<QwSopTempSetting.Content.Setting> setting = content.getSetting().stream().filter(e -> "7".equals(e.getContentType()) || "16".equals(e.getContentType())).collect(Collectors.toList());
         if (!setting.isEmpty()) {
             List<String> valuesList = PubFun.listToNewList(setting, QwSopTempSetting.Content.Setting::getValue);
             if (valuesList != null && !valuesList.isEmpty()) {
@@ -708,13 +709,22 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
                     List<QwSopTempVoice> voiceList = qwSopTempVoiceService.getVoiceByText(Long.parseLong(companyUserId), valuesList);
                     if (voiceList != null && !voiceList.isEmpty()) {
                         Map<String, QwSopTempVoice> collect = voiceList.stream().collect(Collectors.toMap(QwSopTempVoice::getVoiceTxt, e -> e));
-                        setting.parallelStream().filter(e -> "7".equals(e.getContentType())).forEach(st -> {
+
+                        setting.parallelStream().forEach(st -> {
                             QwSopTempVoice voice = collect.get(st.getValue());
-                            if (voice.getVoiceUrl() == null) {
+                            if (voice == null || voice.getVoiceUrl() == null) {
                                 return;
                             }
-                            st.setVoiceUrl(voice.getVoiceUrl());
-                            st.setVoiceDuration(voice.getDuration() + "");
+                            // 企微语音
+                            if ("7".equals(st.getContentType())) {
+                                st.setVoiceUrl(voice.getVoiceUrl());
+                                st.setVoiceDuration(voice.getDuration() + "");
+                            }
+                            // app语音
+                            else if ("16".equals(st.getContentType())) {
+                                st.setVoiceUrl(voice.getUserVoiceUrl());
+                                st.setVoiceDuration(voice.getDuration() + "");
+                            }
                         });
                     }
                 } catch (NumberFormatException e) {
@@ -1023,7 +1033,12 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
             log.error("Cloned content settings are empty, skipping.");
             return;
         }
-
+        //如果是@所有人,就添加
+        if (1 == content.getIsAtAll()) {
+            QwSopTempSetting.Content.Setting atMsg = new QwSopTempSetting.Content.Setting();
+            atMsg.setContentType("99");
+            settings.add(atMsg);
+        }
         // 顺序处理每个 Setting,避免过多的并行导致线程开销
         for (QwSopTempSetting.Content.Setting setting : settings) {
             switch (setting.getContentType()) {

+ 3 - 0
fs-service/src/main/java/com/fs/course/mapper/FsCourseRedPacketLogMapper.java

@@ -75,6 +75,9 @@ public interface FsCourseRedPacketLogMapper
     @Select("select * from fs_course_red_packet_log where out_batch_no = #{outBatchNo}")
     FsCourseRedPacketLog selectFsCourseRedPacketLogByBatchNo(@Param("outBatchNo") String outBatchNo);
 
+    @Select("select * from fs_course_red_packet_log where batch_id = #{batchId}")
+    FsCourseRedPacketLog selectFsCourseRedPacketLogByBatchId(@Param("batchId") String batchId);
+
 
     @Select({"<script> " +
             "select o.*,v.title as video_name,u.phone as user_name  from fs_course_red_packet_log l " +

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

@@ -87,4 +87,6 @@ public interface IFsCourseRedPacketLogService
     void sendRedPacketBf();
 
     void queryRedPacketResult(String startTime, String endTime);
+
+    R getBillsByTransferBillNo(String batchId);
 }

+ 24 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsCourseRedPacketLogServiceImpl.java

@@ -476,4 +476,28 @@ public class FsCourseRedPacketLogServiceImpl implements IFsCourseRedPacketLogSer
                 company.getCompanyId(), moneyLog.getMoney());
     }
 
+    @Override
+    public R getBillsByTransferBillNo(String batchId) {
+        FsCourseRedPacketLog log = fsCourseRedPacketLogMapper.selectFsCourseRedPacketLogByBatchId(batchId);
+        if (log ==null){
+            return R.error("未查询到红包记录!");
+        }
+        String json = configService.selectConfigByKey("redPacket.config");
+        RedPacketConfig config = JSONUtil.toBean(json, RedPacketConfig.class);
+        //创建微信订单
+        WxPayConfig payConfig = new WxPayConfig();
+        BeanUtils.copyProperties(config,payConfig);
+        WxPayService wxPayService = new WxPayServiceImpl();
+        wxPayService.setConfig(payConfig);
+        TransferService transferService=wxPayService.getTransferService();
+
+        try {
+            TransferBillsGetResult queryRedPacketResult = transferService.getBillsByTransferBillNo(batchId);
+            logger.info("FsCourseRedPacketLog-log_id:{},【红包处理】查询批次结果:{}",log.getLogId(),queryRedPacketResult);
+            return R.ok(queryRedPacketResult.toString());
+        } catch (WxPayException e) {
+            logger.error(e.getMessage());
+            return R.error(e.getMessage());
+        }
+    }
 }

+ 8 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsStorePaymentServiceImpl.java

@@ -624,6 +624,10 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
                     break;
                 case 2:
                     json = companyConfigService.selectRedPacketConfigByKey(param.getCompanyId());
+                    //如果分公司配置为空就走总后台的配置
+                    if (StringUtils.isEmpty(json)){
+                        json = configService.selectConfigByKey("redPacket.config");
+                    }
                     config = JSONUtil.toBean(json, RedPacketConfig.class);
                     break;
                 default:
@@ -749,6 +753,10 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
                     break;
                 case 2:
                     json = companyConfigService.selectRedPacketConfigByKey(param.getCompanyId());
+                    //如果分公司配置为空就走总后台的配置
+                    if (StringUtils.isEmpty(json)){
+                        json = configService.selectConfigByKey("redPacket.config");
+                    }
                     config = JSONUtil.toBean(json, RedPacketConfig.class);
                     break;
                 default:

+ 6 - 0
fs-service/src/main/java/com/fs/hisStore/domain/FsStoreAfterSalesScrm.java

@@ -144,4 +144,10 @@ public class FsStoreAfterSalesScrm extends BaseEntity
     @TableField(exist = false)
     private String productName;
 
+    /**
+     * 用于查询汇付订单号
+     */
+    @TableField(exist = false)
+    private String hfOrderCode;
+
 }

+ 4 - 1
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreAfterSalesScrmMapper.java

@@ -91,7 +91,7 @@ public interface FsStoreAfterSalesScrmMapper
             "cu.phonenumber as company_usere_phonenumber,o.pay_money,o.id as orderId,o.create_time as orderCreateTime,o.user_phone," +
             "o.real_name as userName,o.item_json,o.user_address,o.pay_time as orderPayTime,o.pay_price,o.total_postage," +
             "fsps.bank_serial_no,fsps.bank_transaction_id,o.delivery_id as orderDeliveryId,o.delivery_name as orderDeliveryName,o.delivery_sn as orderDeliverySn," +
-            "o.status as orderStatus " +
+            "o.status as orderStatus,fsps.pay_code as payCode " +
             " from fs_store_after_sales_scrm s " +
             " INNER join fs_store_order_scrm o on o.order_code=s.order_code " +
             " left join fs_user u on s.user_id=u.user_id " +
@@ -99,6 +99,9 @@ public interface FsStoreAfterSalesScrmMapper
             " left join company_user cu on cu.user_id=s.company_user_id " +
             " left join fs_store_payment_scrm fsps on fsps.business_order_id = o.id and fsps.status in (-1,1) " +
             " where 1=1 " +
+            "<if test =\"maps.hfOrderCode != null and  maps.hfOrderCode!='' \"> " +
+              "and fsps.pay_code = #{maps.hfOrderCode} " +
+            "</if>" +
             "<if test = 'maps.status != null    '> " +
             "and s.status = #{maps.status} " +
             "</if>" +

+ 2 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsStoreAfterSalesVO.java

@@ -143,4 +143,6 @@ public class FsStoreAfterSalesVO implements Serializable
     private String orderDeliverySn;
     private String orderDeliveryName;
     private String orderDeliveryId;
+
+    private String payCode;
 }

+ 3 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsStoreOrderItemExportRefundZMVO.java

@@ -23,6 +23,9 @@ public class FsStoreOrderItemExportRefundZMVO implements Serializable  {
     @Excel(name = "订单号",sort = 1)
     private String orderCode;
 
+    @Excel(name = "支付单号",sort = 2)
+    private String payCode;
+
     @Excel(name = "订单状态", dictType = "store_order_status",sort = 10)
     private String status;
 

+ 7 - 1
fs-service/src/main/java/com/fs/ipad/IpadSendUtils.java

@@ -221,7 +221,7 @@ public class IpadSendUtils {
      * @param vo 调用接口参数
      * @return 返回的userid
      */
-    private Long userIds(BaseVo vo){
+    public Long userIds(BaseVo vo){
         if(vo.isRoom()){
             return chatIds(vo);
         }
@@ -562,4 +562,10 @@ public class IpadSendUtils {
         }
         return data.stream().map(WxWorkVid2UserIdRespDTO::getUser_id).collect(Collectors.toList());
     }
+    
+    public void sendTxtAtMsgVo(WxSendTextAtMsgTwoDTO dto, Long serverId){
+        WxWorkResponseDTO<WxSendTextAtMsgVo> result = wxWorkService.sendTextAtMsgTwo(dto, serverId);
+        log.info("发送@所有人返回数据:{}", result);
+        if(result.getErrcode() != 0) throw new BaseException("发送@所有人消息错误:" + result.getErrmsg());
+    }
 }

+ 31 - 0
fs-service/src/main/java/com/fs/ipad/vo/WxSendTextAtMsgVo.java

@@ -0,0 +1,31 @@
+package com.fs.ipad.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+
+@Data
+public class WxSendTextAtMsgVo {
+
+    private Long receiver;
+    private Long sender;
+    private List<atList> at_list;
+    private String sender_name;
+    private Long room_conversation_id;
+    private Integer is_room;
+    private Integer sendtime;
+    private Long msg_id;
+    private Long server_id;
+    private Long msgtype;
+    private String content;
+
+    @Data
+    public class atList {
+        private Long user_id;
+        private String nikeName;
+
+    }
+}
+
+

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

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.common.annotation.DataSource;
 import com.fs.common.enums.DataSourceType;
 import com.fs.live.domain.LiveWatchLog;
+import com.fs.live.vo.LiveWatchLogListVO;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -71,4 +72,6 @@ public interface LiveWatchLogMapper extends BaseMapper<LiveWatchLog> {
 
     List<LiveWatchLog> selectLiveWatchLogByLiveId(@Param("liveId")Long liveId);
 
+    List<LiveWatchLogListVO> selectLiveWatchLogListInfo(LiveWatchLog liveWatchLog);
+
 }

+ 8 - 0
fs-service/src/main/java/com/fs/live/service/ILiveWatchLogService.java

@@ -3,6 +3,7 @@ package com.fs.live.service;
 import java.util.List;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fs.live.domain.LiveWatchLog;
+import com.fs.live.vo.LiveWatchLogListVO;
 
 /**
  * 直播看课记录Service接口
@@ -58,4 +59,11 @@ public interface ILiveWatchLogService extends IService<LiveWatchLog>{
      * @return 结果
      */
     int deleteLiveWatchLogByLogId(Long logId);
+
+    /**
+     * 查询列表信息
+     * @param liveWatchLog
+     * @return
+     */
+    List<LiveWatchLogListVO> selectLiveWatchLogListInfo(LiveWatchLog liveWatchLog);
 }

+ 5 - 0
fs-service/src/main/java/com/fs/live/service/impl/LiveCompletionPointsRecordServiceImpl.java

@@ -110,6 +110,11 @@ public class LiveCompletionPointsRecordServiceImpl implements ILiveCompletionPoi
             BigDecimal watchRate = BigDecimal.valueOf(actualWatchDuration)
                     .multiply(BigDecimal.valueOf(100))
                     .divide(BigDecimal.valueOf(videoDuration), 2, RoundingMode.HALF_UP);
+            
+            // 限制完课比例最大值为100.00%(防止数据库字段溢出)
+            if (watchRate.compareTo(BigDecimal.valueOf(100)) > 0) {
+                watchRate = BigDecimal.valueOf(100);
+            }
 
             // 6. 判断是否达到完课标准
             if (watchRate.compareTo(BigDecimal.valueOf(completionRate)) < 0) {

+ 10 - 0
fs-service/src/main/java/com/fs/live/service/impl/LiveWatchLogServiceImpl.java

@@ -3,6 +3,7 @@ package com.fs.live.service.impl;
 import java.util.List;
 import com.fs.common.utils.DateUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.live.vo.LiveWatchLogListVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.fs.live.mapper.LiveWatchLogMapper;
@@ -18,6 +19,9 @@ import com.fs.live.service.ILiveWatchLogService;
 @Service
 public class LiveWatchLogServiceImpl extends ServiceImpl<LiveWatchLogMapper, LiveWatchLog> implements ILiveWatchLogService {
 
+    @Autowired
+    private LiveWatchLogMapper liveWatchLogMapper;
+
     /**
      * 查询直播看课记录
      * 
@@ -42,6 +46,12 @@ public class LiveWatchLogServiceImpl extends ServiceImpl<LiveWatchLogMapper, Liv
         return baseMapper.selectLiveWatchLogList(liveWatchLog);
     }
 
+    @Override
+    public List<LiveWatchLogListVO> selectLiveWatchLogListInfo(LiveWatchLog liveWatchLog){
+
+        return liveWatchLogMapper.selectLiveWatchLogListInfo(liveWatchLog);
+    }
+
     /**
      * 新增直播看课记录
      * 

+ 6 - 0
fs-service/src/main/java/com/fs/live/vo/LiveAfterSalesVo.java

@@ -1,5 +1,6 @@
 package com.fs.live.vo;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fs.common.annotation.Excel;
 import lombok.Data;
@@ -189,6 +190,11 @@ public class LiveAfterSalesVo {
     private String orderDeliverySn;
     private String orderDeliveryName;
     private String orderDeliveryId;
+    /**
+     * 用于查询汇付订单号
+     */
+    private String hfOrderCode;
 
+    private String payCode;
 
 }

+ 118 - 0
fs-service/src/main/java/com/fs/live/vo/LiveWatchLogListVO.java

@@ -0,0 +1,118 @@
+package com.fs.live.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author MixLiu
+ * @date 2025/12/15 下午3:40)
+ */
+
+@Data
+public class LiveWatchLogListVO {
+
+    /** 日志id */
+    private Long logId;
+
+    /** 用户userId */
+    @Excel(name = "用户userId")
+    private Long userId;
+
+    /** 直播间id */
+    @Excel(name = "直播间id")
+    private Long liveId;
+
+    /** 记录类型 1看课中 2完课 3待看课 4看课中断 */
+    @Excel(name = "记录类型 1看课中 2完课 3待看课 4看课中断")
+    private Integer logType;
+
+    /** 外部联系人id */
+    @Excel(name = "外部联系人id")
+    private Long externalContactId;
+
+    /** 销售id */
+    @Excel(name = "销售id")
+    private Long companyUserId;
+
+    /** 公司id */
+    @Excel(name = "公司id")
+    private Long companyId;
+
+    /** 完课时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "完课时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date finishTime;
+
+    /** sop最后创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "sop最后创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date sopCreateTime;
+
+    /** 发送小程序appid */
+    @Excel(name = "发送小程序appid")
+    private String sendAppId;
+
+    /** 日志创建来源:1、个人sop,2、群聊sop,3、一键群发 */
+    @Excel(name = "日志创建来源:1、个人sop,2、群聊sop,3、一键群发")
+    private Integer logSource;
+
+    /** 分享人企微id */
+    @Excel(name = "分享人企微id")
+    private String qwUserId;
+    /**
+     * 查看直播类型:1、直播,2、回放
+     */
+    private Integer watchType;
+
+    /**
+     * 企微主体id
+     */
+    private String corpId;
+
+    /**
+     * 直播购买
+     */
+    private Integer liveBuy;
+
+    /**
+     * 回放购买
+     */
+    private Integer replayBuy;
+
+    /**
+     * 会员昵称
+     */
+    private String userName;
+    /**
+     * 会员头像
+     */
+    private String userAvatar;
+
+    /**
+     * 外部联系人名称
+     */
+    private String qwExternalName;
+
+    /**
+     * 外部联系人头像
+     */
+    private String qwExternalAvatar;
+
+    /**
+     * 直播间名称
+     */
+    private String liveName;
+
+    /**
+     * 所属销售
+     */
+    private String companyUserName;
+
+    /**
+     * 企微用户
+     */
+    private String qwUserName;
+}

+ 1 - 1
fs-service/src/main/java/com/fs/qw/mapper/QwFriendWelcomeMapper.java

@@ -161,5 +161,5 @@ public interface QwFriendWelcomeMapper
      * @param qwFriendWelcomeParam 参数
      * @return  list
      */
-    List<QwFriendWelcome> selectQwFriendWelcomeList(QwFriendWelcomeParam qwFriendWelcomeParam);
+    List<QwFriendWelcomeVO> selectQwFriendWelcomeList(QwFriendWelcomeParam qwFriendWelcomeParam);
 }

+ 1 - 1
fs-service/src/main/java/com/fs/qw/service/IQwFriendWelcomeService.java

@@ -70,5 +70,5 @@ public interface IQwFriendWelcomeService
      * @param qwFriendWelcomeParam 参数
      * @return list
      */
-    List<QwFriendWelcome> selectQwFriendWelcomeList(QwFriendWelcomeParam qwFriendWelcomeParam);
+    List<QwFriendWelcomeVO> selectQwFriendWelcomeList(QwFriendWelcomeParam qwFriendWelcomeParam);
 }

+ 34 - 5
fs-service/src/main/java/com/fs/qw/service/impl/QwFriendWelcomeServiceImpl.java

@@ -5,7 +5,12 @@ import com.fs.common.constant.FsConstants;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.redis.RedisCacheT;
 import com.fs.common.exception.base.BaseException;
+import com.fs.common.utils.StringUtils;
+import com.fs.company.domain.Company;
+import com.fs.company.mapper.CompanyMapper;
+import com.fs.qw.domain.QwCompany;
 import com.fs.qw.domain.QwFriendWelcome;
+import com.fs.qw.mapper.QwCompanyMapper;
 import com.fs.qw.mapper.QwFriendWelcomeItemMapper;
 import com.fs.qw.mapper.QwFriendWelcomeMapper;
 import com.fs.qw.mapper.QwUserMapper;
@@ -28,10 +33,10 @@ import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.net.URL;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 import java.util.concurrent.TimeUnit;
+import java.util.function.Function;
+import java.util.stream.Collectors;
 
 /**
  * 好友欢迎语Service业务层处理
@@ -55,6 +60,10 @@ public class QwFriendWelcomeServiceImpl implements IQwFriendWelcomeService {
 
     @Autowired
     private RedisCacheT<Long> redisCache;
+    @Autowired
+    private CompanyMapper companyMapper;
+    @Autowired
+    private QwCompanyMapper qwCompanyMapper;
 
     /**
      * 查询好友欢迎语
@@ -389,8 +398,28 @@ public class QwFriendWelcomeServiceImpl implements IQwFriendWelcomeService {
      * @return list
      */
     @Override
-    public List<QwFriendWelcome> selectQwFriendWelcomeList(QwFriendWelcomeParam qwFriendWelcomeParam) {
-        return qwFriendWelcomeMapper.selectQwFriendWelcomeList(qwFriendWelcomeParam);
+    public List<QwFriendWelcomeVO> selectQwFriendWelcomeList(QwFriendWelcomeParam qwFriendWelcomeParam) {
+        List<QwFriendWelcomeVO> qwFriendWelcomes = qwFriendWelcomeMapper.selectQwFriendWelcomeList(qwFriendWelcomeParam);
+
+        if (qwFriendWelcomes.isEmpty()) {
+            return qwFriendWelcomes;
+        }
+
+        List<Long> companyIds = qwFriendWelcomes.stream().map(QwFriendWelcomeVO::getCompanyId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
+        List<String> corpIds = qwFriendWelcomes.stream().map(QwFriendWelcomeVO::getCorpId).filter(StringUtils::isNotBlank).distinct().collect(Collectors.toList());
+
+        Map<Long, String> companyMap = companyIds.isEmpty()
+                ? Collections.emptyMap()
+                : companyMapper.selectCompanyByIds(companyIds).stream().collect(Collectors.toMap(Company::getCompanyId, Company::getCompanyName, (a, b) -> a));
+        Map<String, String> corpMap = corpIds.isEmpty()
+                ? Collections.emptyMap()
+                : qwCompanyMapper.selectByCorpIds(corpIds).stream().collect(Collectors.toMap(QwCompany::getCorpId, QwCompany::getCorpName, (a, b) -> a
+        ));
+        qwFriendWelcomes.forEach(qwFriendWelcome -> {
+            qwFriendWelcome.setCompanyName(companyMap.getOrDefault(qwFriendWelcome.getCompanyId(), ""));
+            qwFriendWelcome.setCorpName(corpMap.getOrDefault(qwFriendWelcome.getCorpId(), ""));
+        });
+        return qwFriendWelcomes;
     }
 
     /**

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

@@ -67,4 +67,7 @@ public class QwFriendWelcomeVO extends BaseEntity
 
     public List<QwUserVO> userSelectList;
 
+    private String companyName;
+    private String corpName;
+
 }

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

@@ -44,6 +44,8 @@ public class QwSopTempSetting implements Serializable{
         private String addTag;
 
         private String delTag;
+        
+        private Integer isAtAll;
 
         @Override
         public Content clone() {
@@ -151,6 +153,13 @@ public class QwSopTempSetting implements Serializable{
             //app显示标题 app用的参数
             private String title;
 
+            //福袋id
+            private Long luckyBagId;
+            /**
+             * 业务id
+             */
+            private String businessId;
+
 
             @Override
             public Setting clone() {

+ 3 - 0
fs-service/src/main/java/com/fs/sop/domain/QwSopTemp.java

@@ -150,4 +150,7 @@ public class QwSopTemp implements Serializable
 
     @TableField(exist = false)
     private String createByDeptName;
+    
+    @TableField(exist = false)
+    private String openIsAtAll;
 }

+ 3 - 0
fs-service/src/main/java/com/fs/sop/domain/QwSopTempRules.java

@@ -83,4 +83,7 @@ public class QwSopTempRules{
     private Integer dayNum;
     @TableField(exist = false)
     private FsUserCourseVideoRedPackage red;
+    
+     /**是否@所有人  1是0否**/
+    private Integer isAtAll;
 }

+ 6 - 0
fs-service/src/main/java/com/fs/sop/service/impl/QwSopTempServiceImpl.java

@@ -467,6 +467,12 @@ public class QwSopTempServiceImpl implements IQwSopTempService {
                     rules.setTime(time);
                 }
 
+                if (temp.getOpenIsAtAll() != null && temp.getOpenIsAtAll().equals("1")){
+                    rules.setIsAtAll(1);
+                }else {
+                    rules.setIsAtAll(0);
+                }
+
                 rules.setContentType(2);
                 rules.setType(2);
                 rules.setCourseType(0);

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

@@ -585,6 +585,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                     updateQwUserKey(sopLogs,qwUser.getQwUserId(),param.getSopId(),groupUser.getChatId());
                     //域名
                     String companyUserId = qwUser.getCompanyUserId().toString();
+                    String companyId = String.valueOf(qwUser.getCompanyId()).trim();
                     String domainName = companyUserMapper.selectDomainByUserId(Long.parseLong(companyUserId));
                     if (StringUtils.isEmpty(domainName)) {
                         domainName = config.getRealLinkDomainName();
@@ -705,6 +706,45 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                                 st.setMiniprogramAppid(sysConfig.getAppId());
                                 st.setMiniprogramPage(sortLiveLink);
                                 break;
+                            case "14":
+
+                                linkByMiniApp = createActivityLinkByMiniApp(st,sopLogs, qwGroupChat.getCorpId(), new Date(), param.getCourseId(), param.getVideoId(),
+                                        String.valueOf(qwUser.getId()), qwUser.getCompanyUserId().toString(), qwUser.getCompanyId().toString(),null ,config, groupUser.getChatId());
+
+                                miniAppId = null;
+                                if (!miniMap.isEmpty() && qwUser.getSendMsgType() == 1) {
+                                    Map<Integer, List<CompanyMiniapp>> integerListMap = miniMap.get(Long.valueOf(companyId));
+                                    if (integerListMap != null) {
+                                        int listIndexTemp = 1;
+                                        List<CompanyMiniapp> miniapps = integerListMap.get(listIndexTemp);
+                                        if (miniapps != null && !miniapps.isEmpty()) {
+                                            CompanyMiniapp companyMiniapp = miniapps.get(0);
+                                            if (companyMiniapp != null && !StringUtil.strIsNullOrEmpty(companyMiniapp.getAppId())) {
+                                                miniAppId = companyMiniapp.getAppId();
+                                            }
+                                        }
+                                    }
+                                }
+
+                                if (StringUtil.strIsNullOrEmpty(miniAppId) && !StringUtil.strIsNullOrEmpty(qwCompany.getMiniAppId())) {
+                                    miniAppId = qwCompany.getMiniAppId();
+                                }
+
+                                if (!StringUtil.strIsNullOrEmpty(miniAppId)) {
+                                    st.setMiniprogramAppid(miniAppId);
+                                } else {
+                                    log.error("公司的小程序id为空:采用了前端传的固定值" + sopLogs.getSopId());
+                                }
+
+                                st.setMiniprogramTitle("福袋发放");
+
+                                st.setMiniprogramPage(linkByMiniApp);
+                                break;
+                            case "16":
+                                createVoiceUrl(st, companyUserId, qwSop);
+                                break;
+                            default:
+                                break;
                         }
                     }
                     setting.setSetting(list);
@@ -863,6 +903,60 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                                 st.setMiniprogramAppid(sysConfig.getAppId());
                                 st.setMiniprogramPage(sortLiveLink);
                                 break;
+                            case "14":
+                                String companyId = String.valueOf(qwUser.getCompanyId()).trim();
+                                linkByMiniApp = createActivityLinkByMiniApp(st,sopLogs, qwUser.getCorpId(), new Date(), param.getCourseId(), param.getVideoId(),
+                                        String.valueOf(qwUser.getId()), qwUser.getCompanyUserId().toString(), qwUser.getCompanyId().toString(),null, config, groupChat.getChatId());
+                                miniAppId = null;
+                                if (!miniMap.isEmpty() && qwUser.getSendMsgType() == 1) {
+                                    Map<Integer, List<CompanyMiniapp>> integerListMap = miniMap.get(Long.valueOf(companyId));
+                                    if (integerListMap != null) {
+                                        int listIndexTemp = 1;
+                                        List<CompanyMiniapp> miniapps = integerListMap.get(listIndexTemp);
+                                        if (miniapps != null && !miniapps.isEmpty()) {
+                                            CompanyMiniapp companyMiniapp = miniapps.get(0);
+                                            if (companyMiniapp != null && !StringUtil.strIsNullOrEmpty(companyMiniapp.getAppId())) {
+                                                miniAppId = companyMiniapp.getAppId();
+                                            }
+                                        }
+                                    }
+                                }
+
+                                if (StringUtil.strIsNullOrEmpty(miniAppId) && !StringUtil.strIsNullOrEmpty(qwCompany.getMiniAppId())) {
+                                    miniAppId = qwCompany.getMiniAppId();
+                                }
+
+                                if (!StringUtil.strIsNullOrEmpty(miniAppId)) {
+                                    st.setMiniprogramAppid(miniAppId);
+                                } else {
+                                    log.error("公司的小程序id为空:采用了前端传的固定值" + sopLogs.getSopId());
+                                }
+
+                                st.setMiniprogramTitle("福袋发放");
+
+                                st.setMiniprogramPage(linkByMiniApp);
+                                break;
+                            case "15":
+                                String txt2 = StringUtil.strIsNullOrEmpty(qwUser.getWelcomeText()) ? "" : qwUser.getWelcomeText();
+                                st.setValue(st.getValue().replaceAll("#客服称呼#", txt2).replaceAll("#销售称呼#", txt2));
+                                try {
+                                    replaceContent(st.getContentType(), st.getValue(), st::setValue, words); // 替换 value
+                                } catch (Exception e) {
+                                    throw new RuntimeException(e);
+                                }
+                                break;
+                            case "16":
+                                if (qwUser.getCompanyUserId() != null) {
+                                    createVoiceUrl(st, String.valueOf(qwUser.getCompanyUserId()), qwSop);
+                                }
+                                try {
+                                    if (qwUser.getCompanyUserId() != null) {
+                                        createVoiceUrlToIm(st, String.valueOf(qwUser.getCompanyUserId()), qwSop);
+                                    }
+                                } catch (Exception e) {
+                                    throw new RuntimeException(e);
+                                }
+                                break;
                         }
                     }
                     setting.setSetting(list);
@@ -1074,6 +1168,119 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                             st.setMiniprogramAppid(sysConfig.getAppId());
                             st.setMiniprogramPage(sortLiveLink);
                             break;
+                        case "14":
+                            LuckyBag luckyBag = luckyBagMapper.selectLuckyBagById(st.getLuckyBagId());
+                            if(ObjectUtil.isNotEmpty(luckyBag)&&luckyBag.getDataStatus().equals("0")){
+                                sopLogs.setSendStatus(5L);
+                                sopLogs.setReceivingStatus(0L);
+                                sopLogs.setRemark("福袋配置被禁用");
+                            }
+                            else if (ObjectUtil.isNotEmpty(sopLogs.getFsUserId())){
+                                //获取配置并校验
+                                SysConfig luckyBagConfig = configService.selectConfigByConfigKey("luckyBag.config");
+                                if (ObjectUtil.isEmpty(luckyBagConfig)) {
+                                    sopLogs.setSendStatus(5L);
+                                    sopLogs.setReceivingStatus(0L);
+                                    sopLogs.setRemark("福袋配置不存在");
+                                }
+// 2. 解析配置值
+                                JSONObject jsonObject;
+                                try {
+                                    jsonObject = JSON.parseObject(luckyBagConfig.getConfigValue());
+                                    Integer count = jsonObject.getInteger("weekLimit");
+
+                                    // 查询用户记录并校验次数
+                                    LuckyBagCollectRecord queryRecord = new LuckyBagCollectRecord();
+                                    queryRecord.setUserId(sopLogs.getFsUserId());
+                                    queryRecord.setCollectType("1");
+                                    // 动态计算时间范围
+                                    LocalDate endDate = LocalDate.now();
+                                    LocalDate startDate = endDate.minusDays(6); // 包含今天
+
+                                    Map<String, Object> params = new HashMap<>();
+                                    params.put("beginSendTime", startDate.toString());
+                                    params.put("endSendTime", endDate.toString());
+                                    queryRecord.setParams(params);
+                                    List<LuckyBagCollectRecord> luckyBagCollectRecords =
+                                            luckyBagCollectRecordMapper.selectLuckyBagCollectRecordList(queryRecord);
+
+                                    // 判断是否超过限制
+                                    if (luckyBagCollectRecords.size() >= count) {
+                                        sopLogs.setSendStatus(5L);
+                                        sopLogs.setReceivingStatus(0L);
+                                        sopLogs.setRemark("超过福袋发放次数");
+                                    }
+
+                                } catch (Exception e) {
+                                    // 处理配置解析异常
+                                    sopLogs.setSendStatus(5L);
+                                    sopLogs.setReceivingStatus(0L);
+                                    sopLogs.setRemark("福袋配置解析失败");
+                                }
+                            }
+                            linkByMiniApp = createActivityLinkByMiniApp(st,sopLogs, param.getCorpId(), createTime, param.getCourseId(), param.getVideoId(),
+                                    qwUserId, companyUserId, companyId, item.getExternalId(), config,null);
+
+                            miniAppId = null;
+
+                            if (!miniMap.isEmpty() && qwUser.getSendMsgType() == 1) {
+                                Map<Integer, List<CompanyMiniapp>> integerListMap = miniMap.get(Long.valueOf(companyId));
+                                if (integerListMap != null) {
+                                    int effectiveGradeTemp = (item.getGrade() == null) ? 5 : item.getGrade();
+                                    int listIndexTemp = (effectiveGradeTemp == 1 || effectiveGradeTemp == 2) ? 0 : 1;
+
+                                    //评级是6 S级,则走A类小程序
+                                    if (effectiveGradeTemp==6){
+                                        listIndexTemp=2;
+                                    }
+
+                                    List<CompanyMiniapp> miniapps = integerListMap.get(listIndexTemp);
+
+                                    if (miniapps != null && !miniapps.isEmpty()) {
+                                        CompanyMiniapp companyMiniapp = miniapps.get(0);
+                                        if (companyMiniapp != null && !StringUtil.strIsNullOrEmpty(companyMiniapp.getAppId())) {
+                                            miniAppId = companyMiniapp.getAppId();
+                                        }
+                                    }
+                                }
+                            }
+
+                            if (StringUtil.strIsNullOrEmpty(miniAppId) && !StringUtil.strIsNullOrEmpty(qwCompany.getMiniAppId())) {
+                                miniAppId = qwCompany.getMiniAppId();
+                            }
+
+                            if (!StringUtil.strIsNullOrEmpty(miniAppId)) {
+                                st.setMiniprogramAppid(miniAppId);
+                            } else {
+                                log.error("公司的小程序id为空:采用了前端传的固定值" + sopLogs.getSopId());
+                            }
+
+                            st.setMiniprogramTitle("福袋发放");
+
+                            st.setMiniprogramPage(linkByMiniApp);
+                            break;
+                        case "15":
+                            String txt = StringUtil.strIsNullOrEmpty(qwUser.getWelcomeText()) ? "" : qwUser.getWelcomeText();
+                            st.setValue(st.getValue()
+                                    .replaceAll("#客服称呼#", txt)
+                                    .replaceAll("#销售称呼#", txt)
+                                    .replaceAll("#客户称呼#", StringUtil.strIsNullOrEmpty(contact.getStageStatus()) || "0".equals(contact.getStageStatus()) ? "同学" : contact.getStageStatus()));
+                            try {
+                                replaceContent(st.getContentType(), st.getValue(), st::setValue, words); // 替换 value
+                            } catch (Exception e) {
+                                throw new RuntimeException(e);
+                            }
+                            break;
+                        case "16":
+                            createVoiceUrl(st, companyUserId, qwSop);
+                            try {
+                                if (qwUser.getCompanyUserId() != null) {
+                                    createVoiceUrlToIm(st, String.valueOf(qwUser.getCompanyUserId()), qwSop);
+                                }
+                            } catch (Exception e) {
+                                throw new RuntimeException(e);
+                            }
+                            break;
                         default:
                             break;
 

+ 46 - 0
fs-service/src/main/java/com/fs/wxwork/dto/WxSendTextAtMsgTwoDTO.java

@@ -0,0 +1,46 @@
+package com.fs.wxwork.dto;
+
+import com.fs.ipad.vo.BaseVo;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class WxSendTextAtMsgTwoDTO extends BaseVo {
+    /**
+     * 消息的唯一标识符 (UUID)
+     */
+    private String uuid;
+
+    /**
+     * 要发送的人或群id
+     */
+    private Long send_userid;
+
+    /**
+     * 发送者用户 ID
+     */
+    private List<Contentva> contentva;
+    /**
+     * 是否为群组消息
+     * <p>
+     * true: 群组消息; false: 单聊消息
+     * </p>
+     */
+    private Boolean isRoom;
+
+    @Data
+    public static class Contentva {
+        private Integer msgtype;
+        private String content;
+        /**
+         * "msgtype":5,//@类型
+         * "vid":0 //填0就是所有人
+         * <p>
+         * "msgtype":5, //就是@人的类型
+         * "vid":788130xx38 //@人id
+         */
+        private Integer vid;
+    }
+
+}

+ 7 - 0
fs-service/src/main/java/com/fs/wxwork/service/WxWorkServiceNew.java

@@ -9,6 +9,7 @@ import com.fs.ipad.param.WxSendAtMsgParam;
 import com.fs.ipad.vo.WxGetSessionRoomListVo;
 import com.fs.ipad.vo.WxRoomUserListVo;
 import com.fs.ipad.vo.WxSendAtMsgVo;
+import com.fs.ipad.vo.WxSendTextAtMsgVo;
 import com.fs.qw.domain.QwIpadServer;
 import com.fs.qw.service.IQwIpadServerService;
 import com.fs.wxwork.dto.*;
@@ -232,4 +233,10 @@ public class WxWorkServiceNew {
         String url = getUrl(serverId) + "/RoomIdToChatId";
         return WxWorkHttpUtilNew.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxWorkChatIdToRoomIdResp>>() {}, serverId);
     }
+    
+    
+    public WxWorkResponseDTO<WxSendTextAtMsgVo> sendTextAtMsgTwo(WxSendTextAtMsgTwoDTO param, Long serverId) {
+        String url = getUrl(serverId) + "/SendTextAtMsgTwo";
+        return WxWorkHttpUtil.postWithType(url, param, new TypeReference<WxWorkResponseDTO<WxSendTextAtMsgVo>>() {});
+    }
 }

+ 1 - 0
fs-service/src/main/resources/application-config-dev-jnlzjk.yml

@@ -87,6 +87,7 @@ cloud_host:
   company_name: 济南联志健康
   projectCode: LZJK
   spaceName:
+  volcengineUrl: https://jnlzvolcengine.ylrztop.com
 headerImg:
   imgUrl:
 

+ 1 - 0
fs-service/src/main/resources/application-config-druid-bjzm-test.yml

@@ -86,6 +86,7 @@ cloud_host:
   company_name: 北京卓美
   projectCode: BJZM
   spaceName:
+  volcengineUrl: https://myhkvolcengine.ylrztop.com
 headerImg:
   imgUrl:
 

+ 1 - 0
fs-service/src/main/resources/application-config-druid-hsyy.yml

@@ -83,6 +83,7 @@ cloud_host:
   company_name: 河山医院
   projectCode: heshanyy
   spaceName:
+  volcengineUrl:
 #看课授权时显示的头像
 headerImg:
   imgUrl: https://hsyy-1348049832.cos.ap-chongqing.myqcloud.com/hsyy.jpg

+ 1 - 0
fs-service/src/main/resources/application-config-druid-jnlzjk.yml

@@ -88,6 +88,7 @@ cloud_host:
   company_name: 济南联志健康
   projectCode: LZJK
   spaceName:
+  volcengineUrl: https://jnlzvolcengine.ylrztop.com
 headerImg:
   imgUrl:
 

+ 1 - 0
fs-service/src/main/resources/application-config-druid-sxjz.yml

@@ -88,6 +88,7 @@ cloud_host:
   company_name: 今正科技
   projectCode: SXJZ
   spaceName:
+  volcengineUrl:
 #看课授权时显示的头像
 headerImg:
   imgUrl: https://jz-cos-1356808054.cos.ap-chengdu.myqcloud.com/fs/20250515/0877754b59814ea8a428fa3697b20e68.png

+ 3 - 9
fs-service/src/main/resources/application-config-druid-ylrz.yml

@@ -73,21 +73,15 @@ nuonuo:
 tencent_cloud_config:
   secret_id: AKIDiMq9lDf2EOM9lIfqqfKo7FNgM5meD0sT
   secret_key: u5SuS80342xzx8FRBukza9lVNHKNMSaB
-  bucket: jnlzjk-1323137866
+  bucket: ylrz-1323137866
   app_id: 1323137866
   region: ap-chongqing
-  proxy: jnlzjk
-tmp_secret_config:
-  secret_id: AKIDCj7NSNAovtqeJpBau8GZ4CGB71thXIxX
-  secret_key: lTB5zwqqz7CNhzDOWivFWedgfTBgxgBT
-  bucket: fs-1319721001
-  app_id: 1319721001
-  region: ap-chongqing
-  proxy: fs
+  proxy: ylrz
 cloud_host:
   company_name: 云联融智
   projectCode: YLRZ
   spaceName:
+  volcengineUrl: https://myhkvolcengine.ylrztop.com
 headerImg:
   imgUrl:
 

+ 2 - 0
fs-service/src/main/resources/application-config-zkzh.yml

@@ -115,6 +115,8 @@ tencent_cloud_config:
 cloud_host:
   company_name: 中康
   projectCode: ZKZH
+  spaceName: sxzk-2114522511
+  volcengineUrl:
 headerImg:
   imgUrl: https://zkzh-2025.oss-cn-beijing.aliyuncs.com/fs/20250619/e31b5e051a474a7a9b4ad02575b46196.png
 

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

@@ -164,7 +164,7 @@ token:
 openIM:
     secret: openIM123
     userID: imAdmin
-    url: https://web.im.fbylive.com/api
+    url: https://web.im.xianhthj.cn/api
 #是否使用新im
 im:
     type: NONE

+ 2 - 1
fs-service/src/main/resources/mapper/live/LiveAfterSalesMapper.xml

@@ -68,7 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         las.order_status, las.create_time, las.is_del, las.user_id, las.consignee, las.phone_number, las.address, las.company_id, las.company_user_id, las.dept_id,
         cu.nick_name as company_user_nick_name, c.company_name,lo.order_id,lo.order_code,lo.user_phone,las.user_id,lo.item_json,lo.pay_time as orderPayTime,
         lo.user_address,lo.user_name,lo.pay_price,lo.total_postage,lop.bank_serial_no,lo.delivery_sn as orderDeliveryId,lo.delivery_name as orderDeliveryName,
-        lo.delivery_code as orderDeliverySn,lo.status as orderStatus,lop.bank_transaction_id,lo.pay_money
+        lo.delivery_code as orderDeliverySn,lo.status as orderStatus,lop.bank_transaction_id,lo.pay_money,lop.pay_code as payCode
         from live_after_sales las
         left join live_order lo on lo.order_id = las.order_id
         left join company_user cu on cu.user_id = las.company_user_id
@@ -79,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
 
         <where>
+            <if test="hfOrderCode != null and hfOrderCode != ''"> and lop.pay_code = #{hfOrderCode}</if>
             <if test="liveId != null and liveId != ''"> and las.live_id = #{liveId}</if>
             <if test="companyUserNickName != null and companyUserNickName != ''"> and cu.nick_name like concat(#{companyUserNickName},'%')</if>
             <if test="storeId != null and storeId != ''"> and las.store_id = #{storeId}</if>

+ 35 - 0
fs-service/src/main/resources/mapper/live/LiveWatchLogMapper.xml

@@ -210,4 +210,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectLiveWatchLogByLiveId" resultType="com.fs.live.domain.LiveWatchLog">
         select * from live_watch_log where live_id = #{liveId}
     </select>
+
+    <select id="selectLiveWatchLogListInfo"   parameterType="LiveWatchLog" resultType="com.fs.live.vo.LiveWatchLogListVO">
+        select
+        t2.nick_name as userName,
+        t2.avatar as userAvatar,
+        t3.live_name,
+        t4.name as qwExternalName,
+        t4.avatar as qwExternalAvatar,
+        t5.nick_name as companyUserName,
+        t6.qw_user_name,
+        t1.*
+        from live_watch_log t1
+        left join fs_user t2 on t1.user_id = t2.user_id
+        left join live t3 on t3.live_id = t1.live_id
+        left join qw_external_contact t4 on t4.id = t1.external_contact_id
+        left join company_user t5 on t5.user_id = t1.company_user_id
+        left join qw_user t6 on t6.id = t1.qw_user_id
+        <where>
+            <if test="userId != null "> and t1.user_id = #{userId}</if>
+            <if test="liveId != null "> and t1.live_id = #{liveId}</if>
+            <if test="logType != null "> and t1.log_type = #{logType}</if>
+            <if test="externalContactId != null "> and t1.external_contact_id = #{externalContactId}</if>
+            <if test="companyId != null "> and t1.company_id = #{companyId}</if>
+            <if test="companyUserId != null "> and t1.company_user_id = #{companyUserId}</if>
+            <if test="finishTime != null "> and t1.finish_time = #{finishTime}</if>
+            <if test="sopCreateTime != null "> and t1.sop_create_time = #{sopCreateTime}</if>
+            <if test="sendAppId != null  and sendAppId != ''"> and t1.send_app_id = #{sendAppId}</if>
+            <if test="logSource != null "> and t1.log_source = #{logSource}</if>
+            <if test="qwUserId != null  and qwUserId != ''"> and t1.qw_user_id = #{qwUserId}</if>
+            <if test="watchType != null">and t1.watch_type = #{watchType} </if>
+            <if test="corpId != null">and t1.corp_id = #{corpId} </if>
+            <if test="liveBuy != null">and t1.live_buy = #{liveBuy} </if>
+            <if test="replayBuy != null">and t1.replay_buy = #{replayBuy} </if>
+        </where>
+    </select>
 </mapper>

+ 1 - 1
fs-service/src/main/resources/mapper/qw/QwFriendWelcomeMapper.xml

@@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where id = #{id}
     </select>
 
-    <select id="selectQwFriendWelcomeList" resultType="com.fs.qw.domain.QwFriendWelcome">
+    <select id="selectQwFriendWelcomeList" resultType="com.fs.qw.vo.QwFriendWelcomeVO">
         select
             w.*
         from qw_friend_welcome w

+ 8 - 0
fs-user-app/src/main/java/com/fs/app/controller/course/CourseTransferController.java

@@ -71,4 +71,12 @@ public class CourseTransferController {
         return paymentService.TransferNotifyWithCompanyId(companyId,notifyData,request);
     }
 
+    @Autowired
+    private IFsCourseRedPacketLogService fsCourseRedPacketLogService;
+
+    @GetMapping("/getBillsByTransferBillNo")
+    public R getBillsByTransferBillNo(String transferBillNo){
+        return fsCourseRedPacketLogService.getBillsByTransferBillNo(transferBillNo);
+    }
+
 }

+ 16 - 0
fs-user-app/src/main/java/com/fs/app/controller/live/LiveCompletionPointsController.java

@@ -89,4 +89,20 @@ public class LiveCompletionPointsController extends AppBaseController {
         
         return R.ok().put("data", result);
     }
+
+    /**
+     * 用于测试和调试
+     */
+    @PostMapping("/test/create")
+    public R testCreateRecord(@RequestParam Long liveId, @RequestParam(required = false) Long watchDuration) {
+        Long userId = Long.parseLong(getUserId());
+        
+        try {
+            // 调用完课记录创建方法(watchDuration为null时会自动从数据库累计)
+            completionPointsRecordService.checkAndCreateCompletionRecord(liveId, userId, watchDuration);
+            return R.ok("完课记录创建成功,请查看records接口查看结果");
+        } catch (Exception e) {
+            return R.error("创建失败: " + e.getMessage());
+        }
+    }
 }