Procházet zdrojové kódy

Merge branch 'dev_v1.3.8_20221209'

Eric před 2 roky
rodič
revize
7b2f07178b

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

@@ -130,9 +130,20 @@ public class CustomerServiceBatchSendingServiceImpl extends ServiceImpl<Customer
         Map<Long, String> subjectNameMap = subjectService.findBySubjectByIdList(subjectIds).stream()
                 .collect(Collectors.toMap(Subject::getId, Subject::getName, (o, n) -> n));
 
+        // 创建用户
+        List<Long> userIds = sendings.stream()
+                .map(CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending::getCreateBy)
+                .filter(Objects::nonNull).distinct().collect(Collectors.toList());
+
+        Map<Long, String> usernameMap = sysUserMapper.selectBatchIds(userIds).stream()
+                .collect(Collectors.toMap(SysUser::getId, SysUser::getUsername, (o, n) -> n));
+
         // 发送群体,发送声部
         for (CustomerServiceBatchSendingWrapper.CustomerServiceBatchSending item : sendings) {
 
+            // 创建用户
+            item.setCreateUser(usernameMap.getOrDefault(item.getCreateBy(), ""));
+
             List<Long> collect = Arrays.stream(Optional.ofNullable(item.getSendSubject()).orElse("").split(","))
                     .map(Long::parseLong).distinct().collect(Collectors.toList());
 
@@ -435,6 +446,7 @@ public class CustomerServiceBatchSendingServiceImpl extends ServiceImpl<Customer
                             .eq(CustomerServiceBatchSending::getId, info.getId())
                             .set(CustomerServiceBatchSending::getSendStatus, EImSendStatus.SEND)
                             .set(CustomerServiceBatchSending::getReceiveNumber, receiveNums.stream().mapToInt(Integer::intValue).sum())
+                            //.set(CustomerServiceBatchSending::getSendTime, DateTime.now().toDate())
                             .update();
 
                 } catch (Exception e) {

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

@@ -64,8 +64,8 @@
             <if test="param.clientType.code == 'STUDENT'"> LEFT JOIN student t2 ON (t1.id_ = t2.user_id_)</if>
         </if>
         <where>
-            <if test="param.subjectId != null">
-                AND FIND_IN_SET(#{param.subjectId}, t2.subject_id_)
+            <if test="param.subjectIds != null">
+                AND (<foreach collection="param.subjectIds" separator="OR" item="item"> FIND_IN_SET(#{item}, t2.subject_id_) </foreach>)
             </if>
         </where>
     </select>