Przeglądaj źródła

APP生成链接优化,点播加入部门展示,销售加入主备显示、处理同步异常问题

yjwang 1 tydzień temu
rodzic
commit
8765c82613

+ 3 - 1
fs-admin/src/main/java/com/fs/course/controller/FsCoursePlaySourceConfigController.java

@@ -55,7 +55,8 @@ public class FsCoursePlaySourceConfigController extends BaseController {
                               @RequestParam(required = false) Integer isMall,
                               @RequestParam(required = false, defaultValue = "1") Integer pageNum,
                               @RequestParam(required = false, defaultValue = "10") Integer pageSize,
-                              @RequestParam(required = false) Integer status) {
+                              @RequestParam(required = false) Integer status,
+                              @RequestParam(required = false) String deptName) {
         Map<String, Object> params = new HashMap<>();
         params.put("name", name);
         params.put("appid", appid);
@@ -73,6 +74,7 @@ public class FsCoursePlaySourceConfigController extends BaseController {
         }
         params.put("userId", userId);
         params.put("deptId", deptId);
+        params.put("deptName", deptName);
         if(status != null){
             params.put("status", status);
         }

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

@@ -994,6 +994,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
                                 GroupUserExternalVo vo = userMap.get(groupChat.getOwner());
                                 if (vo != null && vo.getId() != null) {
                                     sopLogs.setFsUserId(vo.getFsUserId());
+                                    log.error("进入看课日志方法1-------->{}",1);
                                     addWatchLogIfNeeded(sopLogs, videoId, courseId, sendTime, qwUserId, companyUserId, companyId, vo.getId().toString(), logVo);
                                 }
                             });
@@ -1001,6 +1002,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
                             log.error("群聊创建看课记录失败!", e);
                         }
                     } else {
+                        log.error("进入看课日志方法2-------->{}",2);
                         addWatchLogIfNeeded(sopLogs, videoId, courseId, sendTime, qwUserId, companyUserId, companyId, externalId,logVo);
                     }
 
@@ -1038,6 +1040,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
                     break;
                 //app
                 case "9":
+                    log.error("进入看课日志方法3-------->{}",3);
                     addWatchLogIfNeeded(sopLogs, videoId, courseId, sendTime, qwUserId, companyUserId, companyId, externalId,logVo);
 
                     QwCreateLinkByAppVO linkByApp = createLinkByApp(setting, logVo, sendTime, courseId, videoId,
@@ -1049,6 +1052,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
                     break;
                 //自定义小程序
                 case "10":
+                    log.error("进入看课日志方法4-------->{}",4);
                     addWatchLogIfNeeded(sopLogs, videoId, courseId, sendTime, qwUserId, companyUserId, companyId, externalId,logVo);
 
                     Optional<Company> matchedCompany = companies.stream()
@@ -1445,6 +1449,9 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
         watchLog.setLogType(3);
         watchLog.setUserId(sopLogs.getFsUserId());
         watchLog.setCampPeriodTime(convertStringToDate(logsVo.getStartTime(),"yyyy-MM-dd"));
+        if(watchLog.getSopId() == null && watchLog.getQwUserId() == null){
+            log.error("存在异常看课信息--------》{},打印信息-----》{}", watchLog.getUserId(), watchLog.getVideoId());
+        }
         enqueueWatchLog(watchLog);
     }
 

+ 4 - 0
fs-service/src/main/java/com/fs/company/domain/Company.java

@@ -142,4 +142,8 @@ public class Company extends BaseEntity
     @TableField(exist = false)
     private boolean isAdmin;
 
+    //小程序名称
+    @TableField(exist = false)
+    private String queryAppName;
+
 }

+ 20 - 20
fs-service/src/main/java/com/fs/company/mapper/CompanyMapper.java

@@ -153,26 +153,26 @@ public interface CompanyMapper
     List<Long> selectCompanyByOmsCode(@Param("omsCode") String omsCode);
 
 
-    @Select({"<script> " +
-            "select c.*,cu.user_name,qu.used_num FROM company c LEFT JOIN company_user cu ON c.user_id =cu.user_id  " +
-            "LEFT JOIN (select company_id, count(id) as used_num from qw_user where server_id is not null group by company_id) qu ON qu.company_id = c.company_id " +
-            "where c.is_del=0 " +
-            "            <if test=\"companyName != null  and companyName != ''\"> and c.company_name like concat('%', #{companyName}, '%')</if>\n" +
-            "            <if test=\"companyMobile != null  and companyMobile != ''\"> and c.company_mobile = #{companyMobile}</if>\n" +
-            "            <if test=\"companyAddress != null  and companyAddress != ''\"> and c.company_address = #{companyAddress}</if>\n" +
-            "            <if test=\"status != null \"> and c.status = #{status}</if>\n" +
-            "            <if test=\"startTime != null \"> and c.start_time = #{startTime}</if>\n" +
-            "            <if test=\"limitTime != null \"> and c.limit_time = #{limitTime}</if>\n" +
-            "            <if test=\"money != null \"> and c.money = #{money}</if>\n" +
-            "            <if test=\"companyType != null \"> and c.company_type = #{companyType}</if>\n" +
-            "            <if test=\"userId != null \"> and c.user_id = #{userId}</if>\n" +
-            "            <if test=\"linkName != null  and linkName != ''\"> and c.link_name like concat('%', #{linkName}, '%')</if>\n" +
-            "            <if test=\"limitUserCount != null \"> and c.limit_user_count = #{limitUserCount}</if>\n" +
-            "            <if test=\"isDel != null \"> and c.is_del = #{isDel}</if>\n" +
-            "            <if test=\"deptId != null \"> and c.dept_id = #{deptId}</if> " +
-            "        " +
-            " order by company_id desc" +
-            "</script>"})
+//    @Select({"<script> " +
+//            "select c.*,cu.user_name,qu.used_num FROM company c LEFT JOIN company_user cu ON c.user_id =cu.user_id  " +
+//            "LEFT JOIN (select company_id, count(id) as used_num from qw_user where server_id is not null group by company_id) qu ON qu.company_id = c.company_id " +
+//            "where c.is_del=0 " +
+//            "            <if test=\"companyName != null  and companyName != ''\"> and c.company_name like concat('%', #{companyName}, '%')</if>\n" +
+//            "            <if test=\"companyMobile != null  and companyMobile != ''\"> and c.company_mobile = #{companyMobile}</if>\n" +
+//            "            <if test=\"companyAddress != null  and companyAddress != ''\"> and c.company_address = #{companyAddress}</if>\n" +
+//            "            <if test=\"status != null \"> and c.status = #{status}</if>\n" +
+//            "            <if test=\"startTime != null \"> and c.start_time = #{startTime}</if>\n" +
+//            "            <if test=\"limitTime != null \"> and c.limit_time = #{limitTime}</if>\n" +
+//            "            <if test=\"money != null \"> and c.money = #{money}</if>\n" +
+//            "            <if test=\"companyType != null \"> and c.company_type = #{companyType}</if>\n" +
+//            "            <if test=\"userId != null \"> and c.user_id = #{userId}</if>\n" +
+//            "            <if test=\"linkName != null  and linkName != ''\"> and c.link_name like concat('%', #{linkName}, '%')</if>\n" +
+//            "            <if test=\"limitUserCount != null \"> and c.limit_user_count = #{limitUserCount}</if>\n" +
+//            "            <if test=\"isDel != null \"> and c.is_del = #{isDel}</if>\n" +
+//            "            <if test=\"deptId != null \"> and c.dept_id = #{deptId}</if> " +
+//            "        " +
+//            " order by company_id desc" +
+//            "</script>"})
     List<CompanyVO> selectCompanyListVO(Company param);
 
     List<OptionsVO> selectAllCompanyList(@Param("deptId") Long deptId);

+ 9 - 0
fs-service/src/main/java/com/fs/company/vo/CompanyVO.java

@@ -1,5 +1,6 @@
 package com.fs.company.vo;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fs.common.annotation.Excel;
 import lombok.Data;
@@ -95,4 +96,12 @@ public class CompanyVO implements Serializable
     private Integer usedNum;
     /** 所属部门id */
     private Long deptId;
+
+    //主程序
+    @TableField(exist = false)
+    private String masterAppName;
+
+    //备小程序
+    @TableField(exist = false)
+    private String backupAppName;
 }

+ 13 - 1
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseServiceImpl.java

@@ -591,6 +591,12 @@ public class FsUserCourseServiceImpl implements IFsUserCourseService
         link.setUpdateTime(calendar.getTime());
         int i = fsCourseLinkMapper.insertFsCourseLink(link);
         if (i > 0){
+            if (CloudHostUtils.hasCloudHostName("医健宝")){
+                String domainName = getDomainName(param.getCompanyUserId(), config);
+                String sortLink = domainName + link.getRealLink().replace("/#","");
+                sortLink = sortLink.replaceAll("\\\\", "");
+                return R.ok().put("url", sortLink).put("link", random);
+            }
             String domainName = getDomainName(param.getCompanyUserId(), config);
             String sortLink = domainName + shortLink + link.getLink();
             return R.ok().put("url", sortLink).put("link", random);
@@ -756,11 +762,17 @@ public class FsUserCourseServiceImpl implements IFsUserCourseService
         link.setUpdateTime(calendar.getTime());
         int i = fsCourseLinkMapper.insertFsCourseLink(link);
         if (i > 0){
-            if (CloudHostUtils.hasCloudHostName("中康") || CloudHostUtils.hasCloudHostName("医健宝")){
+            if (CloudHostUtils.hasCloudHostName("中康")){
                 String domainName = getDomainName(param.getCompanyUserId(), config);
                 String sortLink = domainName + link.getRealLink().replace("/#","");
                 return R.ok().put("url", sortLink).put("link", random);
             }
+            if (CloudHostUtils.hasCloudHostName("金牛明医") || CloudHostUtils.hasCloudHostName("医健宝")){
+                String domainName = getDomainName(param.getCompanyUserId(), config);
+                String sortLink = domainName+"/courseH5"+ link.getRealLink().replace("/#","");
+                sortLink = sortLink.replaceAll("\\\\", "");
+                return R.ok().put("url", sortLink).put("link", random);
+            }
             String domainName = getDomainName(param.getCompanyUserId(), config);
             String sortLink = domainName + appShortLink + link.getLink();
             return R.ok().put("url", sortLink).put("link", random);

+ 3 - 0
fs-service/src/main/java/com/fs/course/vo/FsCoursePlaySourceConfigVO.java

@@ -62,4 +62,7 @@ public class FsCoursePlaySourceConfigVO {
      *0未设置1部分设置2已设置
      * **/
     private Integer settingsProtocolType;
+
+    //部门名称
+    private String deptName;
 }

+ 9 - 7
fs-service/src/main/java/com/fs/qw/service/impl/QwUserServiceImpl.java

@@ -945,13 +945,15 @@ public class QwUserServiceImpl implements IQwUserService
             param.setUserid(user.getUserid());
             try {
                 QwOpenidResult qwOpenidResult = qwApiService.useridToOpenid(param, corpId);
-                qwUser.setOpenid(qwOpenidResult.getOpenid());
-                if (qw==null){
-                    qwUserMapper.insertQwUser(qwUser);
-                }else {
-                    qwUser.setId(qw.getId());
-                    qwUser.setIsDel(0);
-                    qwUserMapper.updateQwUser(qwUser);
+                if(qwOpenidResult != null){
+                    qwUser.setOpenid(qwOpenidResult.getOpenid());
+                    if (qw==null){
+                        qwUserMapper.insertQwUser(qwUser);
+                    }else {
+                        qwUser.setId(qw.getId());
+                        qwUser.setIsDel(0);
+                        qwUserMapper.updateQwUser(qwUser);
+                    }
                 }
             }catch (BaseException e){
                 log.error("企微");

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

@@ -15,7 +15,7 @@ public class QwSopCourseFinishTempSetting implements Serializable,Cloneable{
     //普通/课程/订单/ai
     private int type;
 
-    //消息类型
+    //消息类型 -普通0/待看课1/看课中断2/已完课3/待看和中断4
     private Integer courseType;
 
     //课程

+ 71 - 0
fs-service/src/main/resources/mapper/company/CompanyMapper.xml

@@ -249,6 +249,77 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
     </select>
 
+    <select id="selectCompanyListVO" resultType="com.fs.company.vo.CompanyVO">
+            SELECT
+            c.*,
+            cu.user_name,
+            qu.used_num,
+            -- 主小程序名称
+            MAX(CASE WHEN cm.type = 0 THEN sc.`name` END) AS masterAppName,
+            -- 备小程序名称
+            MAX(CASE WHEN cm.type = 1 THEN sc.`name` END) AS backupAppName
+            FROM company c
+            LEFT JOIN company_user cu ON c.user_id = cu.user_id
+            LEFT JOIN (
+            SELECT company_id, COUNT(id) as used_num
+            FROM qw_user
+            WHERE server_id IS NOT NULL
+            GROUP BY company_id
+            ) qu ON qu.company_id = c.company_id
+            LEFT JOIN company_miniapp cm ON c.company_id = cm.company_id
+            LEFT JOIN fs_course_play_source_config sc ON sc.appid = cm.app_id
+            WHERE c.is_del = 0
+            <if test="companyName != null and companyName != ''">
+                AND c.company_name LIKE CONCAT('%', #{companyName}, '%')
+            </if>
+            <if test="companyMobile != null and companyMobile != ''">
+                AND c.company_mobile = #{companyMobile}
+            </if>
+            <if test="companyAddress != null and companyAddress != ''">
+                AND c.company_address = #{companyAddress}
+            </if>
+            <if test="status != null">
+                AND c.status = #{status}
+            </if>
+            <if test="startTime != null">
+                AND c.start_time = #{startTime}
+            </if>
+            <if test="limitTime != null">
+                AND c.limit_time = #{limitTime}
+            </if>
+            <if test="money != null">
+                AND c.money = #{money}
+            </if>
+            <if test="companyType != null">
+                AND c.company_type = #{companyType}
+            </if>
+            <if test="userId != null">
+                AND c.user_id = #{userId}
+            </if>
+            <if test="linkName != null and linkName != ''">
+                AND c.link_name LIKE CONCAT('%', #{linkName}, '%')
+            </if>
+            <if test="limitUserCount != null">
+                AND c.limit_user_count = #{limitUserCount}
+            </if>
+            <if test="isDel != null">
+                AND c.is_del = #{isDel}
+            </if>
+            <if test="deptId != null">
+                AND c.dept_id = #{deptId}
+            </if>
+            <if test="queryAppName != null and queryAppName != ''">
+                AND EXISTS (
+                SELECT 1 FROM company_miniapp cm2
+                LEFT JOIN fs_course_play_source_config sc2 ON sc2.appid = cm2.app_id
+                WHERE cm2.company_id = c.company_id
+                AND sc2.`name` LIKE CONCAT('%', #{queryAppName}, '%')
+                )
+            </if>
+            GROUP BY c.company_id
+            ORDER BY c.company_id DESC
+    </select>
+
     <select id="selectAllCompanyList" resultType="com.fs.his.vo.OptionsVO">
         select company_id dictValue,company_name dictLabel from company where is_del= 0
         <if test="deptId != null">

+ 10 - 4
fs-service/src/main/resources/mapper/course/FsCoursePlaySourceConfigMapper.xml

@@ -5,10 +5,13 @@
 <mapper namespace="com.fs.course.mapper.FsCoursePlaySourceConfigMapper">
 
     <select id="selectCoursePlaySourceConfigVOListByMap" resultType="com.fs.course.vo.FsCoursePlaySourceConfigVO">
-        select
-            fcpsc.*
-        from fs_course_play_source_config fcpsc
-        where fcpsc.is_del = 0
+        SELECT
+        fcpsc.*,
+        sd.dept_name
+        FROM
+        fs_course_play_source_config fcpsc
+        LEFT JOIN sys_dept sd ON fcpsc.create_dept_id = sd.dept_id
+        where fcpsc.is_del = 0 AND sd.del_flag = 0
         <if test="params.name != null and params.name != ''">
             and fcpsc.name like concat('%', #{params.name}, '%')
         </if>
@@ -30,6 +33,9 @@
         <if test="params.status != null">
             and fcpsc.status = #{params.status}
         </if>
+        <if test="params.deptName != null">
+            and sd.dept_name LIKE concat('%', #{params.deptName}, '%')
+        </if>
         order by fcpsc.id desc
     </select>
 </mapper>