Ver código fonte

Merge branch 'dev-xym-update-mysql' of Server/we-com-manage into master

xueyiming 5 meses atrás
pai
commit
c64f09e50d

+ 7 - 5
we-com-server/src/main/java/com/tzld/piaoquan/wecom/job/WeComHistoryDataJob.java

@@ -146,6 +146,10 @@ public class WeComHistoryDataJob {
             }
             stringBuilder.append(sendDetail.getRemark());
             long count = sendCountList.get(0) + sendCountList.get(1) + sendCountList.get(2) + sendCountList.get(3);
+            Long notSentCount = sendCountList.get(0);
+            if (notSentCount != 0) {
+                LarkRobotUtil.sendMessage("@薛一鸣 存在未发送记录,请检查");
+            }
             stringBuilder.append("总发送数量:").append(count).append("   ");
             stringBuilder.append("未发送数量:").append(sendCountList.get(0)).append("   ");
             stringBuilder.append("已发送数量:").append(sendCountList.get(1)).append("   ");
@@ -360,12 +364,10 @@ public class WeComHistoryDataJob {
         example.createCriteria().andStaffIdEqualTo(staff.getId())
                 .andSendTimeBetween(new Date(startTime * 1000), new Date(endTime * 1000));
         List<MessageAttachment> messageAttachments = messageAttachmentMapper.selectByExample(example);
-        if (CollectionUtils.isEmpty(messageAttachments)) {
-            LarkRobotUtil.sendMessage("获取保底set失败");
-            return;
+        Set<Long> guaranteedSet = new HashSet<>();
+        if (!CollectionUtils.isEmpty(messageAttachments)) {
+            guaranteedSet = messageAttachments.stream().map(MessageAttachment::getMiniprogramVideoId).collect(Collectors.toSet());
         }
-        Set<Long> guaranteedSet = messageAttachments.stream()
-                .map(MessageAttachment::getMiniprogramVideoId).collect(Collectors.toSet());
         Long sendTime = externalUsers.stream()
                 .map(ExternalUser::getSendTime).filter(Objects::nonNull).findFirst().orElse(null);
         List<HistoryMessage> historyMessageList = new ArrayList<>();

+ 1 - 1
we-com-server/src/main/resources/application-prod.properties

@@ -1,6 +1,6 @@
 spring.datasource.username=crawler
 spring.datasource.password=crawler123456@
-spring.datasource.url=jdbc:mysql://rm-bp1159bu17li9hi94.mysql.rds.aliyuncs.com:3306/piaoquan-crawler?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true
+spring.datasource.url=jdbc:mysql://rm-bp17q95335a99272b.mysql.rds.aliyuncs.com:3306/growth?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true
 
 spring.redis.database=2
 spring.redis.host=r-bp154bpw97gptefiqkpd.redis.rds.aliyuncs.com