소스 검색

短信生成

三七 18 시간 전
부모
커밋
af703b3f4b

+ 10 - 33
fs-qw-task/src/main/java/com/fs/app/taskService/impl/SopLogsTaskServiceImpl.java

@@ -1368,15 +1368,14 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
         link.setUNo(UUID.randomUUID().toString());
         link.setQwUserId(Long.valueOf(qwUserId));
         link.setCompanyUserId(Long.parseLong(companyUserId));
-        link.setVideoId(videoId.longValue());
+        link.setVideoId(videoId);
         link.setCorpId(logVo.getCorpId());
-        link.setCourseId(courseId.longValue());
+        link.setCourseId(courseId);
         link.setQwExternalId(Long.parseLong(externalId));
 
         if (StringUtil.strIsNullOrEmpty(isOfficial)) {
             link.setLinkType(0);
         } else {
-//            link.setLinkType(isOfficial.equals("1") ? 5 : 0);
             if (isOfficial.equals("1")) {
                 if (fsUserId == null || Long.valueOf(0L).equals(fsUserId)) {
                     link.setLinkType(0);
@@ -1391,36 +1390,6 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
         }
 
 
-        FsCourseRealLink courseMap = new FsCourseRealLink();
-        courseMap.setCompanyId(link.getCompanyId());
-        courseMap.setQwUserId(link.getQwUserId());
-        courseMap.setCompanyUserId(link.getCompanyUserId());
-        courseMap.setVideoId(link.getVideoId());
-        courseMap.setCorpId(link.getCorpId());
-        courseMap.setCourseId(link.getCourseId());
-        courseMap.setQwExternalId(link.getQwExternalId());
-
-
-        if (StringUtil.strIsNullOrEmpty(isOfficial)) {
-            courseMap.setLinkType(0);
-        } else {
-            if (isOfficial.equals("1")) {
-                if (fsUserId == null || Long.valueOf(0L).equals(fsUserId)) {
-                    courseMap.setLinkType(0);
-                } else {
-                    courseMap.setLinkType(5);
-                }
-            } else if (isOfficial.equals("0")) {
-                courseMap.setLinkType(0);
-            } else {
-                courseMap.setLinkType(0);
-            }
-        }
-
-        String courseJson = JSON.toJSONString(courseMap);
-        String realLinkFull = REAL_LINK_PREFIX + courseJson;
-        link.setRealLink(realLinkFull);
-
         String randomString = ShortCodeGeneratorUtils.generate8();
         if (StringUtil.strIsNullOrEmpty(randomString)) {
             link.setLink(UUID.randomUUID().toString().replace("-", ""));
@@ -1430,6 +1399,14 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
 
         link.setCreateTime(sendTime);
 
+        FsCourseRealLink courseMap = new FsCourseRealLink();
+        BeanUtils.copyProperties(link, courseMap);
+
+        String courseJson = JSON.toJSONString(courseMap);
+        String realLinkFull = REAL_LINK_PREFIX + courseJson;
+        link.setRealLink(realLinkFull);
+
+
         Integer expireDays = (setting.getExpiresDays() == null || setting.getExpiresDays() == 0)
                 ? config.getVideoLinkExpireDate()
                 : setting.getExpiresDays();

+ 1 - 2
fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsInfoServiceImpl.java

@@ -1532,7 +1532,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
         FsCourseRealLink courseMap = new FsCourseRealLink();
         BeanUtils.copyProperties(link, courseMap);
 
-        String realLinkFull = registeredRealLink + JSON.toJSONString(courseMap);
+        String realLinkFull = REAL_LINK_PREFIX + JSON.toJSONString(courseMap);
         link.setRealLink(realLinkFull);
         fsCourseLinkMapper.insertFsCourseLink(link);
         if(StringUtils.isEmpty(config.getSmsDomainName())){
@@ -1542,7 +1542,6 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
         return config.getSmsDomainName() + "/" + link.getLink();
     }
 
-
     private List<QwSopCourseFinishTempSetting.Setting> parseSettings(String jsonData) {
         try {
             if (jsonData.startsWith("[") && jsonData.endsWith("]")) {