liujc 11 月之前
父節點
當前提交
2cae5fd64c

+ 44 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CustomerServiceBatchSendingServiceImpl.java

@@ -303,10 +303,33 @@ public class CustomerServiceBatchSendingServiceImpl extends ServiceImpl<Customer
             info.setSendNumber(0);
             List<Integer> receiveNums = Lists.newCopyOnWriteArrayList();
             // 条件匹配的老师、学生数量
-            query.getClientTypes().parallelStream().forEach(item -> {
+            Arrays.stream(query.getTargetGroup().split(",")).parallel().forEach(item -> {
+
+                // TEACHER: '平台老师',
+                //      STUDENT: '平台学生',
+                //      TENANT_TEACHER: '机构老师',
+                //      TENANT_STUDENT: '机构学生',
+                boolean tenantFlag = false;
+                switch (item) {
+                    case "TEACHER":
+                        item = "TEACHER";
+                        break;
+                    case "STUDENT":
+                        item = "STUDENT";
+                        break;
+                    case "TENANT_TEACHER":
+                        item = "TEACHER";
+                        tenantFlag = true;
+                        break;
+                    case "TENANT_STUDENT":
+                        item = "STUDENT";
+                        tenantFlag = true;
+                        break;
+                }
 
                 CustomerService.NotifyMessage receiveQuery = CustomerService.NotifyMessage.builder()
                     .clientType(ClientEnum.valueOf(item))
+                    .tenantFlag(tenantFlag)
                     .delFlag(0)
                     .lockFlag(0)
                     //.subjectIds(Arrays.stream(info.getSendSubject().split(",")).collect(Collectors.toList()))
@@ -475,9 +498,27 @@ public class CustomerServiceBatchSendingServiceImpl extends ServiceImpl<Customer
                         List<String> targetGroups = Arrays.stream(info.getTargetGroup().split(",")).collect(Collectors.toList());
 
                         targetGroups.forEach(clientType -> {
+                            boolean tenantFlag = false;
+                            switch (clientType) {
+                                case "TEACHER":
+                                    clientType = "TEACHER";
+                                    break;
+                                case "STUDENT":
+                                    clientType = "STUDENT";
+                                    break;
+                                case "TENANT_TEACHER":
+                                    clientType = "TEACHER";
+                                    tenantFlag = true;
+                                    break;
+                                case "TENANT_STUDENT":
+                                    clientType = "STUDENT";
+                                    tenantFlag = true;
+                                    break;
+                            }
 
                             CustomerService.NotifyMessage receiveQuery = CustomerService.NotifyMessage.builder()
                                 .clientType(ClientEnum.valueOf(clientType))
+                                .tenantFlag(tenantFlag)
                                 .lockFlag(0)
                                 .delFlag(0)
                                 //.subjectIds(Arrays.stream(info.getSendSubject().split(",")).collect(Collectors.toList()))
@@ -503,8 +544,9 @@ public class CustomerServiceBatchSendingServiceImpl extends ServiceImpl<Customer
                                         .map(x -> String.valueOf(x.getUserId()))
                                         .collect(Collectors.toList());
 
+                                String finalClientType = clientType;
                                 receiveUserIds = receiveUserIds.stream()
-                                        .map(x -> imGroupService.getImUserId(x, clientType))
+                                        .map(x -> imGroupService.getImUserId(x, finalClientType))
                                         .collect(Collectors.toList());
 
                                 // 累加线程休眠计算器,若大于指定阀值时,线程休眠1分钟

+ 11 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/ImUserFriendServiceImpl.java

@@ -288,6 +288,12 @@ public class ImUserFriendServiceImpl extends ServiceImpl<ImUserFriendDao, ImUser
      */
     @Override
     public Integer registerUserBindCustomerService(Long userId, List<Long> friendIds, ClientEnum clientType) {
+
+        // 不在加客服好友
+        if (true) {
+            return 0;
+        }
+
         if(userId == null || CollectionUtils.isEmpty(friendIds)){
             return 0;
         }
@@ -414,6 +420,11 @@ public class ImUserFriendServiceImpl extends ServiceImpl<ImUserFriendDao, ImUser
             return;
         }
 
+        // 客服不加好友
+        if (true) {
+            return;
+        }
+
         try {
             if (StringUtils.isEmpty(sendMessage)) {
                 sendMessage = MK.IM_SYS_FRIEND;

+ 1 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/im/CustomerService.java

@@ -37,6 +37,7 @@ public class CustomerService {
         private String txtMessage;
         private String imgMessage;
         private String imgUrl;
+        boolean tenantFlag;
 
         public static NotifyMessage from(String recv) {
 

+ 9 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/CustomerServiceBatchSendingMapper.xml

@@ -67,6 +67,15 @@
             <if test="param.subjectIds != null">
                 AND (<foreach collection="param.subjectIds" separator="OR" item="item"> FIND_IN_SET(#{item}, t2.subject_id_) </foreach>)
             </if>
+            <if test="param.tenantFlag != null">
+                <if test="param.tenantFlag == 1">
+                    AND t2.tenant_id_ &gt; 0
+                </if>
+                <if test="param.tenantFlag == 0">
+                    AND (t2.tenant_id_  is null or t2.tenant_id_ &lt; 0)
+                </if>
+
+            </if>
         </where>
     </select>
     <!--客服消息接收者-->

+ 6 - 6
cooleshow-user/user-biz/src/main/resources/config/mybatis/MusicSheetAuthRecordMapper.xml

@@ -67,12 +67,12 @@
             </if>
             <if test="param.authStatus != null">
                 and msar.audit_state_ = #{param.authStatus}
-                <if test="param.authStatus == 'PASS'">
-                    AND ms.state_ = 1
-                </if>
-                <if test="param.authStatus == 'OUT_SALE'">
-                    AND ms.state_ = 0
-                </if>
+<!--                <if test="param.authStatus == 'PASS'">-->
+<!--                    AND ms.state_ = 1-->
+<!--                </if>-->
+<!--                <if test="param.authStatus == 'OUT_SALE'">-->
+<!--                    AND ms.state_ = 0-->
+<!--                </if>-->
             </if>
             <if test="param.createBy != null">
                 and ms.create_by_ = #{param.createBy}