Explorar o código

优化ipad获取用户appid查询sql

yjwang hai 1 semana
pai
achega
3b9e886f37

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

@@ -60,7 +60,7 @@ public class IpadSendServer {
     private final ICompanyMiniappService companyMiniappService;
     private final IFsCoursePlaySourceConfigService playSourceConfigService;
     private final FsUserMapper fsUserMapper;
-    private static final List<String> PROJECT_NAMES = Arrays.asList("济南联志健康", "北京存在文化","宽益堂");
+    private static final List<String> PROJECT_NAMES = Arrays.asList("济南联志健康", "北京存在文化","宽益堂","医健宝");
     private void sendMiniProgram(BaseVo vo, QwSopCourseFinishTempSetting.Setting content, Map<String, FsCoursePlaySourceConfig> miniMap, Long companyId) {
         // 发送参数原本的appid
         String appid = content.getMiniprogramAppid();
@@ -86,7 +86,7 @@ public class IpadSendServer {
                         // 当前外部联系是否绑定用户数据,如果数据为空则是没看过小程序的新用户,不用去判断小程序,跳过判断
                         if(qwExternalContact.getFsUserId() != null){
                             // 根据用户绑定信息去查询用户信息
-                            FsUser fsUser = fsUserMapper.selectFsUserByUserId(qwExternalContact.getFsUserId());
+                            FsUser fsUser = fsUserMapper.getUserLookAppIdByuserId(qwExternalContact.getFsUserId());//优化升级获取用户登录的appId
                             // 判断用户是否有看过其他的小程序多个
                             if(StringUtils.isNotEmpty(fsUser.getAppId())){
                                 // 获取用户看过的小程序ID集合

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

@@ -15,7 +15,6 @@ import com.fs.his.param.FsUserParam;
 import com.fs.his.vo.FsUserVO;
 import com.fs.his.vo.FsUserExportListVO;
 import com.fs.his.vo.OptionsVO;
-import com.fs.hisStore.domain.FsUserScrm;
 import com.fs.hisStore.vo.FsCompanyUserListQueryVO;
 import com.fs.qw.dto.FsUserTransferParamDTO;
 import com.fs.qw.param.QwFsUserParam;
@@ -443,4 +442,10 @@ public interface FsUserMapper
     @Select("select * from fs_user where ma_open_id=#{openid}")
     FsUser selectFsUserByMaOpenId(String openid);
 
+    /**
+     * 获取用户看过的小程序ID
+     * @param userId 用户ID
+     * @return  FsUser
+     * **/
+    FsUser getUserLookAppIdByuserId(@Param("userId") Long userId);
 }

+ 12 - 0
fs-service/src/main/resources/mapper/his/FsUserMapper.xml

@@ -2264,4 +2264,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
     </select>
 
+    <select id="getUserLookAppIdByuserId" resultType="FsUser">
+        SELECT
+            fu.user_id,
+            GROUP_CONCAT( fuw.app_id ) appid,
+            fu.create_time
+        FROM
+            fs_user fu
+                INNER JOIN fs_user_wx fuw ON fu.user_id = fuw.fs_user_id
+        WHERE
+            fu.user_id = #{userId}
+    </select>
+
 </mapper>