ソースを参照

Merge remote-tracking branch 'origin/master'

yfh 3 週間 前
コミット
f5f6cb807e

+ 1 - 1
fs-company-app/src/main/java/com/fs/app/controller/CompanyUserController.java

@@ -209,7 +209,7 @@ public class CompanyUserController extends AppBaseController {
         companyUser.setCreateTime(new Date());
         companyUser.setIsAudit(0);
         companyUser.setParentId(upCompanyUser.getUserId());
-        companyUser.setCompanyId(upCompanyUser.getCompanyId());
+//        companyUser.setCompanyId(upCompanyUser.getCompanyId());
         companyUser.setCompanyId(company.getCompanyId());
 
         // 部门

+ 37 - 26
fs-qw-task/src/main/java/com/fs/app/taskService/impl/SopLogsTaskServiceImpl.java

@@ -459,16 +459,6 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
                 return;
             }
 
-//            String[] userKey = logVo.getUserId().split("\\|");
-//            if (userKey.length < 3) {
-//                log.error("用户 ID {} 格式不正确,跳过处理。", logVo.getUserId());
-//                return;
-//            }
-
-//            String qwUserId = userKey[0].trim();
-//            String companyUserId = userKey[1].trim();
-//            String companyId = userKey[2].trim();
-
 
             //获取企业微信员工的称呼//从redis里或者从库里取
             QwUser qwUserByRedis = qwExternalContactService.getQwUserByRedis(logVo.getCorpId(),logVo.getQwUserId());
@@ -943,27 +933,21 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
                     String sortLink = createLinkByMiniApp(setting, logVo, sendTime, courseId, videoId,
                             qwUserId, companyUserId, companyId, externalId,isOfficial,sopLogs.getFsUserId());
 
-                    if (!miniMap.isEmpty() && sendMsgType==1) {
-                        Map<Integer, List<CompanyMiniapp>> integerListMap = miniMap.get(Long.valueOf(companyId));
-                        if (integerListMap != null) {
 
-                            int effectiveGrade = (grade == null) ? 5 : grade;
-                            int listIndex = (effectiveGrade == 1 || effectiveGrade == 2) ? 0 : 1;
-                            List<CompanyMiniapp> miniapps = integerListMap.get(listIndex);
+                    //算主备小程序
+                    String finalAppId = getAppIdFromMiniMap(miniMap, companyId, sendMsgType, grade);
 
-                            if (miniapps != null && !miniapps.isEmpty()) {
-                                CompanyMiniapp companyMiniapp = miniapps.get(0);
-                                if (companyMiniapp != null && !StringUtil.strIsNullOrEmpty(companyMiniapp.getAppId())) {
-                                    setting.setMiniprogramAppid(companyMiniapp.getAppId());
-                                }
-                            }
-                        }
-                    }else if (!StringUtil.strIsNullOrEmpty(miniAppId)){
-                        setting.setMiniprogramAppid(miniAppId);
-                    }else {
+                    if (StringUtil.strIsNullOrEmpty(finalAppId)) {
+                        finalAppId = miniAppId;
+                    }
+
+                    if (!StringUtil.strIsNullOrEmpty(finalAppId)) {
+                        setting.setMiniprogramAppid(finalAppId);
+                    } else {
                         log.error("公司的小程序id为空:采用了前端传的固定值" + sopLogs.getSopId());
                     }
 
+
                     setting.setMiniprogramPage(sortLink.replaceAll("^[\\s\\u2005]+", ""));
 
                     try {
@@ -993,6 +977,33 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
         enqueueQwSopLogs(sopLogs);
     }
 
+    private String getAppIdFromMiniMap(Map<Long, Map<Integer, List<CompanyMiniapp>>> miniMap,
+                                       String companyId,
+                                       int sendMsgType,
+                                       Integer grade) {
+        if (miniMap.isEmpty() || sendMsgType != 1) {
+            return null;
+        }
+
+        Map<Integer, List<CompanyMiniapp>> gradeMap = miniMap.get(Long.valueOf(companyId));
+        if (gradeMap == null) {
+            return null;
+        }
+
+        int effectiveGrade = (grade == null) ? 5 : grade;
+        int listIndex = (effectiveGrade == 1 || effectiveGrade == 2) ? 0 : 1;
+        List<CompanyMiniapp> miniapps = gradeMap.get(listIndex);
+
+        if (miniapps == null || miniapps.isEmpty()) {
+            return null;
+        }
+
+        CompanyMiniapp companyMiniapp = miniapps.get(0);
+        return (companyMiniapp != null && !StringUtil.strIsNullOrEmpty(companyMiniapp.getAppId()))
+                ? companyMiniapp.getAppId()
+                : null;
+    }
+
     /**
      * 深拷贝 Content 对象,避免使用 JSON 进行序列化和反序列化
      */

+ 25 - 17
fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsInfoServiceImpl.java

@@ -839,10 +839,11 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                             String linkByMiniApp = createLinkByMiniApp(st, param.getCorpId(), createTime, param.getCourseId(), param.getVideoId(),
                                     qwUserId, companyUserId, companyId, item.getExternalId(), config);
 
+                            String miniAppId = null;
+
                             if (!miniMap.isEmpty() && qwUser.getSendMsgType() == 1) {
                                 Map<Integer, List<CompanyMiniapp>> integerListMap = miniMap.get(Long.valueOf(companyId));
                                 if (integerListMap != null) {
-
                                     int effectiveGrade = (item.getGrade() == null) ? 5 : item.getGrade();
                                     int listIndex = (effectiveGrade == 1 || effectiveGrade == 2) ? 0 : 1;
                                     List<CompanyMiniapp> miniapps = integerListMap.get(listIndex);
@@ -850,12 +851,18 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                                     if (miniapps != null && !miniapps.isEmpty()) {
                                         CompanyMiniapp companyMiniapp = miniapps.get(0);
                                         if (companyMiniapp != null && !StringUtil.strIsNullOrEmpty(companyMiniapp.getAppId())) {
-                                            st.setMiniprogramAppid(companyMiniapp.getAppId());
+                                            miniAppId = companyMiniapp.getAppId();
                                         }
                                     }
                                 }
-                            } else if (!StringUtil.strIsNullOrEmpty(qwCompany.getMiniAppId())) {
-                                st.setMiniprogramAppid(qwCompany.getMiniAppId());
+                            }
+
+                            if (StringUtil.strIsNullOrEmpty(miniAppId) && !StringUtil.strIsNullOrEmpty(qwCompany.getMiniAppId())) {
+                                miniAppId = qwCompany.getMiniAppId();
+                            }
+
+                            if (!StringUtil.strIsNullOrEmpty(miniAppId)) {
+                                st.setMiniprogramAppid(miniAppId);
                             } else {
                                 log.error("公司的小程序id为空:采用了前端传的固定值" + sopLogs.getSopId());
                             }
@@ -1207,18 +1214,12 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                     String linkByMiniApp = createLinkByMiniApp(st, param.getCorpId(), dataTime, param.getCourseId(), param.getVideoId(),
                             String.valueOf(qwUser.getId()), companyUserId, companyId, item.getExternalId(), config);
 
-//                    if (StringUtil.strIsNullOrEmpty(config.getMiniprogramAppid())){
-//
-//                        log.error("配置中无小程序id,采用默认的");
-//
-//                        st.setMiniprogramAppid("wxc84c6f789ba7f176");
-//                    }else {
-//                        st.setMiniprogramAppid(config.getMiniprogramAppid());
-//                    }
+
+                    String miniAppId = null;
+
                     if (!miniMap.isEmpty() && qwUser.getSendMsgType() == 1) {
                         Map<Integer, List<CompanyMiniapp>> integerListMap = miniMap.get(Long.valueOf(companyId));
                         if (integerListMap != null) {
-
                             int effectiveGrade = (item.getGrade() == null) ? 5 : item.getGrade();
                             int listIndex = (effectiveGrade == 1 || effectiveGrade == 2) ? 0 : 1;
                             List<CompanyMiniapp> miniapps = integerListMap.get(listIndex);
@@ -1226,16 +1227,23 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                             if (miniapps != null && !miniapps.isEmpty()) {
                                 CompanyMiniapp companyMiniapp = miniapps.get(0);
                                 if (companyMiniapp != null && !StringUtil.strIsNullOrEmpty(companyMiniapp.getAppId())) {
-                                    st.setMiniprogramAppid(companyMiniapp.getAppId());
+                                    miniAppId = companyMiniapp.getAppId();
                                 }
                             }
                         }
-                    } else if (!StringUtil.strIsNullOrEmpty(qwCompany.getMiniAppId())) {
-                        st.setMiniprogramAppid(qwCompany.getMiniAppId());
+                    }
+
+                    if (StringUtil.strIsNullOrEmpty(miniAppId) && !StringUtil.strIsNullOrEmpty(qwCompany.getMiniAppId())) {
+                        miniAppId = qwCompany.getMiniAppId();
+                    }
+
+                    if (!StringUtil.strIsNullOrEmpty(miniAppId)) {
+                        st.setMiniprogramAppid(miniAppId);
                     } else {
-                        log.error("企业未配置小程序-" + param.getCorpId());
+                        log.error("企业未配置小程序" +  param.getCorpId());
                     }
 
+
                     st.setMiniprogramPage(linkByMiniApp);
                     break;
                 default:

+ 0 - 73
fs-service/src/main/resources/application-config-druid-fcky.yml

@@ -1,73 +0,0 @@
-baidu:
-  token: 12313231232
-  back-domain: https://www.xxxx.com
-#配置
-logging:
-  level:
-    org.springframework.web: INFO
-    com.github.binarywang.demo.wx.cp: DEBUG
-    me.chanjar.weixin: DEBUG
-wx:
-  miniapp:
-    configs:
-  cp:
-    corpId:
-    appConfigs:
-  pay:
-    appId:  #微信公众号或者小程序等的appid
-    mchId:  #微信支付商户号
-    mchKey:  #微信支付商户密钥
-    subAppId:  #服务商模式下的子商户公众账号ID
-    subMchId:  #服务商模式下的子商户号
-    keyPath:  # p12证书的位置,可以指定绝对路径,也可以指定类路径(以classpath:开头)
-    notifyUrl:
-  mp:
-    useRedis: false
-    redisConfig:
-      host: 127.0.0.1
-      port: 6379
-      timeout: 2000
-    configs:
-      - appId: wxea1da2b708ab3c2f # 第一个公众号的appid  //公众号名称:爱尚佳园
-        secret: 981c60b03292f572039402d7ae09f91f # 公众号的appsecret
-        token: PPKOdAlCoMO # 接口配置里的Token值
-        aesKey: Eswa6VjwtVMCcw03qZy6fWllgrv5aytIA1SZPEU0kU2 # 接口配置里的EncodingAESKey值
-aifabu:  #爱链接
-  appKey: 7b471be905ab17e00f3b858c6710dd117601d008
-watch:
-  watchUrl: watch.ylrzcloud.com/prod-api
-  #  account: tcloud
-  #  password: mdf-m2h_6yw2$hq
-  account1: ccif #866655060138751
-  password1: cp-t5or_6xw7$mt
-  account2: tcloud #rt500台
-  password2: mdf-m2h_6yw2$hq
-  account3: whr
-  password3: v9xsKuqn_$d2y
-
-fs :
-  commonApi: http://10.206.0.16:8010
-  h5CommonApi: http://127.0.0.1:7771
-nuonuo:
-  key: 10924508
-  secret: A2EB20764D304D16
-
-# 存储捅配置
-tencent_cloud_config:
-  secret_id: AKIDiMq9lDf2EOM9lIfqqfKo7FNgM5meD0sT
-  secret_key: u5SuS80342xzx8FRBukza9lVNHKNMSaB
-  bucket: fcky-1323137866
-  app_id: 1323137866
-  region: ap-chongqing
-  proxy: fcky
-cloud_host:
-  company_name: 蜂巢快药
-headerImg:
-  imgUrl: https://fc-1361520560.cos.ap-beijing.myqcloud.com/fs/20250624/490729259f354c338ad6fc0fbbfe0e53.jpg
-ipad:
-  ipadUrl: http://ipad.cdwjyyh.com
-wx_miniapp_temp:
-  pay_order_temp_id:
-  inquiry_temp_id:
-
-

+ 0 - 150
fs-service/src/main/resources/application-druid-fcky.yml

@@ -1,150 +0,0 @@
-# 数据源配置
-spring:
-    profiles:
-        include: config-druid-fcky,common
-    # redis 配置
-    redis:
-        # 地址
-        host: 10.206.0.14
-        # 端口,默认为6379
-        port: 6379
-        # 数据库索引
-        database: 0
-        # 密码
-        password: Ylrz_1q2w3e4r5t6y
-        # 连接超时时间
-        timeout: 20s
-        lettuce:
-            pool:
-                # 连接池中的最小空闲连接
-                min-idle: 0
-                # 连接池中的最大空闲连接
-                max-idle: 8
-                # 连接池的最大数据库连接数
-                max-active: 8
-                # #连接池最大阻塞等待时间(使用负值表示没有限制)
-                max-wait: -1ms
-    datasource:
-        #        clickhouse:
-        #            type: com.alibaba.druid.pool.DruidDataSource
-        #            driverClassName: com.clickhouse.jdbc.ClickHouseDriver
-        #            url: jdbc:clickhouse://cc-2vc8zzo26w0l7m2l6.public.clickhouse.ads.aliyuncs.com/sop?compress=0&use_server_time_zone=true&use_client_time_zone=false&timezone=Asia/Shanghai
-        #            username: rt_2024
-        #            password: Yzx_19860213
-        #            initialSize: 10
-        #            maxActive: 100
-        #            minIdle: 10
-        #            maxWait: 6000
-        mysql:
-            type: com.alibaba.druid.pool.DruidDataSource
-            driverClassName: com.mysql.cj.jdbc.Driver
-            druid:
-                # 主库数据源
-                master:
-                    url: jdbc:mysql://10.206.0.3:3306/fs_his?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-                    username: root
-                    password: Ylrz_1q2w3e4r5t6y
-                # 从库数据源
-                slave:
-                    # 从数据源开关/默认关闭
-                    enabled: false
-                    url:
-                    username:
-                    password:
-                # 初始连接数
-                initialSize: 5
-                # 最小连接池数量
-                minIdle: 10
-                # 最大连接池数量
-                maxActive: 20
-                # 配置获取连接等待超时的时间
-                maxWait: 60000
-                # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-                timeBetweenEvictionRunsMillis: 60000
-                # 配置一个连接在池中最小生存的时间,单位是毫秒
-                minEvictableIdleTimeMillis: 300000
-                # 配置一个连接在池中最大生存的时间,单位是毫秒
-                maxEvictableIdleTimeMillis: 900000
-                # 配置检测连接是否有效
-                validationQuery: SELECT 1 FROM DUAL
-                testWhileIdle: true
-                testOnBorrow: false
-                testOnReturn: false
-                webStatFilter:
-                    enabled: true
-                statViewServlet:
-                    enabled: true
-                    # 设置白名单,不填则允许所有访问
-                    allow:
-                    url-pattern: /druid/*
-                    # 控制台管理用户名和密码
-                    login-username: fs
-                    login-password: 123456
-                filter:
-                    stat:
-                        enabled: true
-                        # 慢SQL记录
-                        log-slow-sql: true
-                        slow-sql-millis: 1000
-                        merge-sql: true
-                    wall:
-                        config:
-                            multi-statement-allow: true
-        sop:
-            type: com.alibaba.druid.pool.DruidDataSource
-            driverClassName: com.mysql.cj.jdbc.Driver
-            druid:
-                # 主库数据源
-                master:
-                    url: jdbc:mysql://10.206.0.3:3306/sop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-                    username: root
-                    password: Ylrz_1q2w3e4r5t6y
-                # 初始连接数
-                initialSize: 5
-                # 最小连接池数量
-                minIdle: 10
-                # 最大连接池数量
-                maxActive: 20
-                # 配置获取连接等待超时的时间
-                maxWait: 60000
-                # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-                timeBetweenEvictionRunsMillis: 60000
-                # 配置一个连接在池中最小生存的时间,单位是毫秒
-                minEvictableIdleTimeMillis: 300000
-                # 配置一个连接在池中最大生存的时间,单位是毫秒
-                maxEvictableIdleTimeMillis: 900000
-                # 配置检测连接是否有效
-                validationQuery: SELECT 1 FROM DUAL
-                testWhileIdle: true
-                testOnBorrow: false
-                testOnReturn: false
-                webStatFilter:
-                    enabled: true
-                statViewServlet:
-                    enabled: true
-                    # 设置白名单,不填则允许所有访问
-                    allow:
-                    url-pattern: /druid/*
-                    # 控制台管理用户名和密码
-                    login-username: fs
-                    login-password: 123456
-                filter:
-                    stat:
-                        enabled: true
-                        # 慢SQL记录
-                        log-slow-sql: true
-                        slow-sql-millis: 1000
-                        merge-sql: true
-                    wall:
-                        config:
-                            multi-statement-allow: true
-rocketmq:
-    name-server: rmq-1243b25nj.rocketmq.gz.public.tencenttdmq.com:8080 # RocketMQ NameServer 地址
-    producer:
-        group: my-producer-group
-        access-key: ak1243b25nj17d4b2dc1a03 # 替换为实际的 accessKey
-        secret-key: sk08a7ea1f9f4b0237 # 替换为实际的 secretKey
-    consumer:
-        group: test-group
-        access-key: ak1243b25nj17d4b2dc1a03 # 替换为实际的 accessKey
-        secret-key: sk08a7ea1f9f4b0237 # 替换为实际的 secretKey

+ 3 - 1
fs-service/src/main/resources/application-druid-myhk-test.yml

@@ -150,4 +150,6 @@ rocketmq:
         group: common-group
         access-key: ak16xj8o92zp984557f83ba2 # 替换为实际的 accessKey
         secret-key: sk2ff1c6b15b74b888 # 替换为实际的 secretKey
-
+openIM:
+    secret: openIM123
+    userID: imAdmin