Browse Source

增加保底视频不存在报警

xueyiming 4 months ago
parent
commit
89f25d1346

+ 14 - 1
we-com-server/src/main/java/com/tzld/piaoquan/wecom/job/WeComMessageDataJob.java

@@ -126,7 +126,7 @@ public class WeComMessageDataJob {
         for (VideoParam videoParam : guaranteedParam.getVideoParamList()) {
             if (videoParam.getStaffId() == null) {
                 LarkRobotUtil.sendMessage("保底视频获取异常,StaffId为空" + DateUtil.getThatDayDateString());
-                throw new RuntimeException();
+                continue;
             }
             if (videoParam.getStaffId() != 0) {
                 if (!CollectionUtils.isEmpty(staffIds) && !staffIds.contains(videoParam.getStaffId())) {
@@ -554,4 +554,17 @@ public class WeComMessageDataJob {
     }
 
 
+    @XxlJob("existGuaranteesJob")
+    public ReturnT<String> existGuarantees(String param) {
+        //保底视频获取
+        String key = String.format(GUARANTEED_MINI_PROGRAM_KEY, DateUtil.getNextDayDateString());
+        GuaranteedParam guaranteedParam = (GuaranteedParam) redisTemplate.opsForValue().get(key);
+        if (guaranteedParam == null
+                || CollectionUtils.isEmpty(guaranteedParam.getVideoParamList())) {
+            LarkRobotUtil.sendMessage("保底视频异常,请检查" + DateUtil.getNextDayDateString());
+        }
+        return ReturnT.SUCCESS;
+    }
+
+
 }

+ 6 - 0
we-com-server/src/main/java/com/tzld/piaoquan/wecom/utils/DateUtil.java

@@ -31,6 +31,12 @@ public class DateUtil {
         return dateFormat.format(today);
     }
 
+    public static String getNextDayDateString() {
+        DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        LocalDate tomorrow = LocalDate.now().minusDays(-1);
+        return dateFormat.format(tomorrow);
+    }
+
 
     public static String getDayDateString(String pattern) {
         DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern(pattern);