Forráskód Böngészése

注册福袋迁移

xgb 21 órája
szülő
commit
37e165c228

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

@@ -1,5 +1,6 @@
 package com.fs.app.service;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -8,11 +9,12 @@ import com.fs.common.exception.base.BaseException;
 import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.date.DateUtil;
 import com.fs.common.utils.spring.SpringUtils;
+import com.fs.company.domain.Company;
 import com.fs.company.domain.CompanyMiniapp;
+import com.fs.company.mapper.CompanyMapper;
 import com.fs.company.service.ICompanyMiniappService;
-import com.fs.course.domain.FsCoursePlaySourceConfig;
-import com.fs.course.domain.FsCourseWatchLog;
-import com.fs.course.domain.FsUserCourseVideo;
+import com.fs.course.config.CourseConfig;
+import com.fs.course.domain.*;
 import com.fs.course.mapper.FsCoursePlaySourceConfigMapper;
 import com.fs.course.mapper.FsUserCourseVideoMapper;
 import com.fs.course.service.IFsCoursePlaySourceConfigService;
@@ -26,6 +28,8 @@ import com.fs.live.mapper.LiveWatchLogMapper;
 import com.fs.qw.domain.QwExternalContact;
 import com.fs.qw.domain.QwUser;
 import com.fs.qw.domain.QwUserVideo;
+import com.fs.qw.mapper.LuckyBagCollectRecordMapper;
+import com.fs.qw.mapper.LuckyBagMapper;
 import com.fs.qw.mapper.QwExternalContactMapper;
 import com.fs.qw.mapper.QwUserMapper;
 import com.fs.qw.service.IQwUserService;
@@ -35,14 +39,18 @@ import com.fs.qwApi.param.QwExternalContactHParam;
 import com.fs.sop.domain.QwSopLogs;
 import com.fs.sop.service.IQwSopLogsService;
 import com.fs.sop.service.impl.QwSopLogsServiceImpl;
+import com.fs.system.service.ISysConfigService;
 import com.fs.wxwork.dto.*;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import java.time.LocalDateTime;
+import java.time.ZoneId;
 import java.util.*;
+import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 @Slf4j
@@ -62,6 +70,13 @@ public class IpadSendServer {
     private final IFsCoursePlaySourceConfigService playSourceConfigService;
     private final FsUserMapper fsUserMapper;
     private final FsUserCourseVideoMapper fsUserCourseVideoMapper;
+    private final ISysConfigService configService;
+    private final LuckyBagMapper luckyBagMapper;
+
+    private final CompanyMapper companyMapper;
+
+    @Autowired
+    private LuckyBagCollectRecordMapper luckyBagCollectRecordMapper;
 
 
     private static final List<String> PROJECT_NAMES = Arrays.asList("济南联志健康", "北京存在文化","宽益堂");
@@ -263,7 +278,7 @@ public class IpadSendServer {
         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);
@@ -607,6 +622,20 @@ public class IpadSendServer {
                     // 语音
                     sendWxVideo(vo, content);
                     break;
+                case "13":
+                    // 注册过的不在发送了
+                    QwExternalContact qwExternalContact =qwExternalContactMapper.selectQwExternalContactById(qwSopLogs.getExternalId());
+                    if(qwExternalContact!=null && qwExternalContact.getFsUserId()!=null){
+                        qwSopLogsService.updateQwSopLogsByWatchLogType(qwSopLogs.getId(), "已经注册过的客户不发送");
+                    }
+                    sendMiniProgram(vo, content, miniMap, qwUser.getCompanyId());
+                case "14":
+                    // 记录福袋发送记录
+                    Long businessId = addLuckyBagCollectRecord(qwUser, content,qwSopLogs);
+                    if (ObjectUtil.isEmpty(businessId)) {
+                        qwSopLogsService.updateQwSopLogsByWatchLogType(qwSopLogs.getId(), "福袋发放失败,请重新发送!");
+                    }
+                    sendMiniProgram(vo, content, miniMap, qwUser.getCompanyId());
                 case "99":
                     // 群发
                     sendTxtAtMsg(vo);
@@ -625,4 +654,180 @@ public class IpadSendServer {
     public void loginOut(QwUser user) {
         ipadSendUtils.loginOut(user.getUid(), user.getServerId());
     }
+
+    /**
+     * @Description: 生成福袋记录
+     * @Param:
+     * @Return:
+     * @Author xgb
+     * @Date 2026/2/4 11:39
+     */
+    private Long addLuckyBagCollectRecord(QwUser qwUser, QwSopCourseFinishTempSetting.Setting content, QwSopLogs qwSopLogs) {
+
+        try{
+            String json = configService.selectConfigByKey("course.config");
+            CourseConfig config = JSON.parseObject(json, CourseConfig.class);
+            Date updateTime = createUpdateTime(content, new Date(), config);
+            LuckyBag luckyBag = luckyBagMapper.selectLuckyBagById(content.getLuckyBagId());
+            String companyUserId = String.valueOf(qwUser.getCompanyUserId()).trim();
+            String companyId = String.valueOf(qwUser.getCompanyId()).trim();
+            Long businessId = addLuckyBagCollectRecord(qwUser,luckyBag,content,qwSopLogs,updateTime,companyUserId,companyId,content.getChatId());
+            return businessId;
+        }catch (Exception e){
+            log.error("福袋创建失败:qwUser={},qwSopLogs={}",qwUser,qwSopLogs);
+            return null;
+        }
+    }
+
+    /**
+     * 过期时间
+     *
+     * @param setting
+     * @param sendTime
+     * @param config
+     * @return
+     */
+    private Date createUpdateTime(QwSopCourseFinishTempSetting.Setting setting, Date sendTime, CourseConfig config) {
+
+        Integer expireDays = (setting.getExpiresDays() == null || setting.getExpiresDays() == 0)
+                ? config.getVideoLinkExpireDate()
+                : setting.getExpiresDays();
+
+//         使用 Java 8 时间 API 计算过期时间
+        LocalDateTime sendDateTime = sendTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
+        LocalDateTime expireDateTime = sendDateTime.plusDays(expireDays - 1);
+        expireDateTime = expireDateTime.toLocalDate().atTime(23, 59, 59);
+        Date updateTime = Date.from(expireDateTime.atZone(ZoneId.systemDefault()).toInstant());
+
+        return updateTime;
+    }
+
+    /**
+     * 增加福袋发放记录、领取记录
+     *
+     * @param companyId
+     * @param qwUser
+     * @param luckyBag
+     * @param content
+     * @param qwSopLogs
+     * @param sendTime
+     * @param companyUserId
+     * @param chatId
+     */
+    private Long addLuckyBagCollectRecord(QwUser qwUser, LuckyBag luckyBag, QwSopCourseFinishTempSetting.Setting content,
+                                          QwSopLogs qwSopLogs,
+                                          Date sendTime,
+                                          String companyUserId,
+                                          String companyId,
+                                          String chatId) {
+        try {
+            // 参数校验
+            if (content == null || qwSopLogs == null || sendTime == null) {
+                log.error("添加福袋记录失败:必要参数为空 [content:{}, qwSopLogs:{}, sendTime:{}]",
+                        content, qwSopLogs, sendTime);
+                return null;
+            }
+
+            // 验证福袋ID
+            if (content.getLuckyBagId() == null) {
+                log.error("福袋ID为空");
+                return null;
+            }
+
+            // 查询福袋信息
+            if (luckyBag == null) {
+                log.error("未找到对应的福袋信息 [luckyBagId:{}]", content.getLuckyBagId());
+                return null;
+            }
+
+            // 检查福袋状态
+            if (luckyBag.getDataStatus() != null && luckyBag.getDataStatus().equals(0)) {
+                log.error("福袋被禁用 [luckyBagId:{}]", content.getLuckyBagId());
+                return null;
+            }
+
+            // 查询公司信息
+            Company company = (Company)redisCache.getCacheObject("companyId:"+companyId);
+            if (company == null) {
+                company = companyMapper.selectCompanyById(Long.valueOf(companyId));
+                redisCache.setCacheObject("companyId:"+companyId, company, 1 , TimeUnit.DAYS);
+                log.error("未找到对应的公司信息 [companyId:{}]", companyId);
+            }
+
+            // 构建福袋记录
+            LuckyBagCollectRecord luckyBagCollectRecord = buildLuckyBagRecord(qwUser,content, qwSopLogs, sendTime,
+                    companyUserId, companyId, chatId, company, luckyBag);
+            luckyBagCollectRecord.setSendTime(new Date());
+            luckyBagCollectRecord.setCollectType("0");
+            // 插入记录并返回ID
+            int result = luckyBagCollectRecordMapper.insertLuckyBagCollectRecord(luckyBagCollectRecord);
+            if (result <= 0) {
+                log.error("福袋记录插入失败 [luckyBagId:{}]", content.getLuckyBagId());
+                return null;
+            }
+
+            // 返回新增记录的ID
+            Long recordId = luckyBagCollectRecord.getId();
+            if (recordId == null) {
+                log.error("福袋记录插入成功但未返回ID [luckyBagId:{}]", content.getLuckyBagId());
+                return null;
+            }
+
+            log.info("福袋记录添加成功 [recordId:{}, luckyBagId:{}]", recordId, content.getLuckyBagId());
+            return recordId;
+
+        } catch (NumberFormatException e) {
+            log.error("ID转换失败 [companyId:{}, companyUserId:{}]", companyId, companyUserId, e);
+            return null;
+        } catch (Exception e) {
+            log.error("ID:" + (content != null ? content.getLuckyBagId() : "unknown") + "-添加福袋记录失败", e);
+            return null;
+        }
+    }
+
+
+    /**
+     * 构建福袋记录对象
+     */
+    private LuckyBagCollectRecord buildLuckyBagRecord(QwUser qwUser,QwSopCourseFinishTempSetting.Setting content,
+                                                      QwSopLogs qwSopLogs,
+                                                      Date sendTime,
+                                                      String companyUserId,
+                                                      String companyId,
+                                                      String chatId,
+                                                      Company company,
+                                                      LuckyBag luckyBag) {
+        LuckyBagCollectRecord record = new LuckyBagCollectRecord();
+        record.setQwUserId(qwUser.getQwUserId());
+        record.setQwUserName(qwUser.getQwUserName());
+        record.setLuckyBagId(content.getLuckyBagId());
+        record.setExpiryTime(sendTime);
+        record.setCollectType("3");
+        record.setCompanyId(Long.valueOf(companyId));
+        record.setUserId(qwSopLogs.getFsUserId());
+        if (ObjectUtil.isNotEmpty(qwSopLogs.getFsUserId())){
+            FsUser fsUser = fsUserMapper.selectFsUserByUserId(qwSopLogs.getFsUserId());
+            record.setUserName(ObjectUtil.isNotEmpty(fsUser)?fsUser.getNickName():null);
+        }
+        record.setCompanyName(company.getCompanyName());
+        record.setCompanyUserId(Long.valueOf(companyUserId));
+        record.setSendLink(content.getMiniprogramPage());
+
+        // 设置奖励类型和聊天信息
+        if (StringUtils.isNotEmpty(chatId)) {
+            record.setRewardType(1L);
+            record.setChatId(chatId);
+            record.setExternalUserName(qwSopLogs.getExternalUserName());
+        } else {
+            record.setRewardType(2L);
+        }
+
+        // 设置币种金额
+        if (luckyBag.getRewardType() != null && luckyBag.getRewardType().equals("1")) {
+            record.setCoinAmount(luckyBag.getAmount());
+        }
+
+        return record;
+    }
+
 }

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 465 - 101
fs-qw-task/src/main/java/com/fs/app/taskService/impl/SopLogsTaskServiceImpl.java


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

@@ -135,6 +135,10 @@ public class QwSopCourseFinishTempSetting implements Serializable,Cloneable{
          * 业务id
          */
         private String businessId;
+        /**
+         * 群id
+         */
+        private String chatId;
         @Override
         public Setting clone() {
             try {

+ 188 - 4
fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsInfoServiceImpl.java

@@ -614,6 +614,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                             replaceContent(st.getContentType(), st.getLinkDescribe(), st::setLinkDescribe, words); // 替换 linkTitle
                         }
 
+                        String miniAppId = null;
                         switch (st.getContentType()) {
                             //文字和短链一起
                             case "1":
@@ -664,7 +665,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                                 String linkByMiniApp = createLinkByMiniApp(st, param.getCorpId(), new Date(), param.getCourseId(), param.getVideoId(),
                                         qwUser.getId(), qwUser.getCompanyUserId().toString(), qwUser.getCompanyId().toString(), null, config, qwGroupChat.getChatId());
 
-                                String miniAppId = null;
+
 
                                 int listIndex = 1;
                                 if (!miniMap.isEmpty() && qwUser.getSendMsgType() == 1) {
@@ -718,6 +719,47 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                                 st.setMiniprogramAppid(sysConfig.getAppId());
                                 st.setMiniprogramPage(sortLiveLink);
                                 break;
+                            // 注册
+                            case "13":
+                                try{
+
+                                    linkByMiniApp = createGroupRegisteredLinkByMiniApp(st, qwGroupChat.getCorpId(), new Date(), param.getCourseId(), param.getVideoId(),
+                                            qwUser.getId(), qwUser.getCompanyUserId().toString(), qwUser.getCompanyId().toString(), config, groupUser.getChatId());
+
+//                                    String luckyjson = configService.selectConfigByKey("luckyBag.config");
+//                                    Map<String, Object> luckyBagConfig = JSON.parseObject(luckyjson, Map.class);
+//                                    miniAppId = String.valueOf(luckyBagConfig.get("appId"));
+
+
+                                   if (!miniMap.isEmpty() && qwUser.getSendMsgType() == 1) {
+                                        Map<Integer, List<CompanyMiniapp>> integerListMap = miniMap.get(Long.valueOf(companyId));
+                                        if (integerListMap != null) {
+                                            int listIndexNum = 1;
+                                            List<CompanyMiniapp> miniapps = integerListMap.get(listIndexNum);
+                                            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);
+
+                                }catch (Exception e) {
+                                    log.error("注册链接发送异常:"+e.getMessage());
+                                }
+                                break;
                             case "14":
 
                                 linkByMiniApp = createActivityLinkByMiniApp(st,sopLogs, qwGroupChat.getCorpId(), new Date(), param.getCourseId(), param.getVideoId(),
@@ -814,6 +856,8 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                             replaceContent(st.getContentType(), st.getLinkTitle(), st::setLinkTitle, words); // 替换 linkTitle
                             replaceContent(st.getContentType(), st.getLinkDescribe(), st::setLinkDescribe, words); // 替换 linkTitle
                         }
+                        String miniAppId = null;
+                        String companyId = String.valueOf(qwUser.getCompanyId()).trim();
                         switch (st.getContentType()) {
                             //文字和短链一起
                             case "1":
@@ -860,7 +904,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                                 String linkByMiniApp = createLinkByMiniApp(st, param.getCorpId(), new Date(), param.getCourseId(), param.getVideoId(),
                                         qwUser.getId(), qwUser.getCompanyUserId().toString(), qwUser.getCompanyId().toString(), null, config, groupChat.getChatId());
 
-                                String miniAppId = null;
+
 
                                 int listIndex = 1;
                                 if (!miniMap.isEmpty() && qwUser.getSendMsgType() == 1) {
@@ -921,8 +965,38 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                                 st.setMiniprogramAppid(sysConfig.getAppId());
                                 st.setMiniprogramPage(sortLiveLink);
                                 break;
+                            case "13":
+
+                                linkByMiniApp = createGroupRegisteredLinkByMiniApp(st, qwUser.getCorpId(), new Date(), param.getCourseId(), param.getVideoId(),
+                                        qwUser.getId(), qwUser.getCompanyUserId().toString(), qwUser.getCompanyId().toString(), config, groupChat.getChatId());
+//                                String luckyjson = configService.selectConfigByKey("luckyBag.config");
+//                                Map<String, Object> luckyBagConfig = JSON.parseObject(luckyjson, Map.class);
+//                                miniAppId = String.valueOf(luckyBagConfig.get("appId"));
+                               if (!miniMap.isEmpty() && qwUser.getSendMsgType() == 1) {
+                                    Map<Integer, List<CompanyMiniapp>> integerListMap = miniMap.get(Long.valueOf(companyId));
+                                    if (integerListMap != null) {
+                                        int listIndexNum = 1;
+                                        List<CompanyMiniapp> miniapps = integerListMap.get(listIndexNum);
+                                        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 "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;
@@ -1063,6 +1137,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                         replaceContent(st.getContentType(), st.getLinkDescribe(), st::setLinkDescribe, words); // 替换 linkTitle
                     }
 
+                    String miniAppId = null;
                     switch (st.getContentType()){
                         //文字和短链一起
                         case "1":
@@ -1111,7 +1186,6 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                             String linkByMiniApp = createLinkByMiniApp(st, param.getCorpId(), createTime, param.getCourseId(), param.getVideoId(),
                                     Long.valueOf(qwUserId), companyUserId, companyId, item.getExternalId(), config, null);
 
-                            String miniAppId = null;
 
                             int effectiveGrade = (item.getGrade() == null) ? 5 : item.getGrade();
                             int listIndex = (effectiveGrade == 1 || effectiveGrade == 2) ? 0 : 1;
@@ -1192,6 +1266,56 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                             st.setMiniprogramAppid(sysConfig.getAppId());
                             st.setMiniprogramPage(sortLiveLink);
                             break;
+                        case "13":
+
+                            if (sopLogs.getFsUserId() != null && !Objects.equals(0L, sopLogs.getFsUserId())) {
+                                sopLogs.setSendStatus(5L);
+                                sopLogs.setReceivingStatus(0L);
+                                sopLogs.setRemark("已经注册过的客户不发送");
+                            }
+
+                            linkByMiniApp = createRegisteredLinkByMiniApp(st, param.getCorpId(), createTime, param.getCourseId(), param.getVideoId(),
+                                    Long.valueOf(qwUserId), companyUserId, companyId, item.getExternalId(), config);
+//                            String luckyjson1 = configService.selectConfigByKey("luckyBag.config");
+//                            Map<String, Object> luckyBagConfig1 = JSON.parseObject(luckyjson1, Map.class);
+//                            miniAppId = String.valueOf(luckyBagConfig1.get("appId"));
+
+                            if (!miniMap.isEmpty() && qwUser.getSendMsgType() == 1) {
+                                Map<Integer, List<CompanyMiniapp>> integerListMap = miniMap.get(Long.valueOf(companyId));
+                                if (integerListMap != null) {
+                                    int effectiveGradeNum = (item.getGrade() == null) ? 5 : item.getGrade();
+                                    int listIndexNum = (effectiveGradeNum == 1 || effectiveGradeNum == 2) ? 0 : 1;
+
+                                    //评级是6 S级,则走A类小程序
+                                    if (effectiveGradeNum==6){
+                                        listIndexNum=2;
+                                    }
+
+                                    List<CompanyMiniapp> miniapps = integerListMap.get(listIndexNum);
+
+                                    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 "14":
                             LuckyBag luckyBag = luckyBagMapper.selectLuckyBagById(st.getLuckyBagId());
                             if(ObjectUtil.isNotEmpty(luckyBag)&&luckyBag.getDataStatus().equals("0")){
@@ -2384,4 +2508,64 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
         return record;
     }
 
+    private String createGroupRegisteredLinkByMiniApp(QwSopCourseFinishTempSetting.Setting setting, String corpId, Date sendTime,
+                                                      Integer courseId, Integer videoId, Long qwUserId,
+                                                      String companyUserId, String companyId, CourseConfig config, String chatId) {
+
+        FsCourseLink link = createFsCourseLink(corpId, sendTime, courseId, videoId, qwUserId,
+                companyUserId, companyId, null, 3, chatId);
+
+
+
+        FsCourseRealLink courseMap = new FsCourseRealLink();
+        BeanUtils.copyProperties(link, courseMap);
+
+        String realLinkFull = registeredRealLink + JSON.toJSONString(courseMap);
+        link.setRealLink(realLinkFull);
+
+        Date updateTime = createUpdateTime(setting, sendTime, config);
+
+        link.setUpdateTime(updateTime);
+        //存短链-
+        fsCourseLinkMapper.insertFsCourseLink(link);
+        return link.getRealLink();
+    }
+
+    private String createRegisteredLinkByMiniApp(QwSopCourseFinishTempSetting.Setting setting, String corpId, Date sendTime,
+                                                 Integer courseId, Integer videoId, Long qwUserId,
+                                                 String companyUserId, String companyId, Long externalId, CourseConfig config) {
+
+        FsCourseLink link = new FsCourseLink();
+        link.setCompanyId(Long.parseLong(companyId));
+        link.setQwUserId(qwUserId);
+        link.setCompanyUserId(Long.parseLong(companyUserId));
+        link.setVideoId(videoId.longValue());
+        link.setCorpId(corpId);
+        link.setCourseId(courseId.longValue());
+        link.setQwExternalId(externalId);
+        link.setLinkType(3); //小程序
+        link.setUNo(UUID.randomUUID().toString());
+        String randomString = generateRandomStringWithLock();
+        if (StringUtil.strIsNullOrEmpty(randomString)) {
+            link.setLink(UUID.randomUUID().toString().replace("-", ""));
+        } else {
+            link.setLink(randomString);
+        }
+        link.setCreateTime(sendTime);;
+        Date updateTime = createUpdateTime(setting, sendTime, config);
+        link.setUpdateTime(updateTime);
+
+
+        FsCourseRealLink courseMap = new FsCourseRealLink();
+        BeanUtils.copyProperties(link, courseMap);
+
+        String realLinkFull = registeredRealLink + JSON.toJSONString(courseMap);
+        link.setRealLink(realLinkFull);
+
+        log.error("存入fs_course_link:" + registeredRealLink );
+        //存短链-
+        fsCourseLinkMapper.insertFsCourseLink(link);
+        return link.getRealLink();
+    }
+
 }

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott