瀏覽代碼

增加待发送消息落库

xueyiming 7 月之前
父節點
當前提交
adc3a6c426

+ 0 - 10
we-com-server/src/main/java/com/tzld/piaoquan/wecom/job/WeComMessageDataJob.java

@@ -275,16 +275,6 @@ public class WeComMessageDataJob {
         if (CollectionUtils.isEmpty(pushList)) {
             throw new RuntimeException("推送视频生成失败");
         }
-//        try {
-//            // 创建一个打印输出流,输出的目标是D盘下的1.txt文件
-//            PrintStream ps = new PrintStream("/Users/shimeng/Desktop/test.txt");
-//            //可能会出现异常,直接throws就行了
-//            System.setOut(ps);
-//            System.out.println(pushList);
-//            ps.close();
-//        }catch (Exception e){
-//            e.printStackTrace();
-//        }
 
         System.out.println(pushList);
         for (JSONObject jsonObject : pushList) {

+ 1 - 2
we-com-server/src/main/java/com/tzld/piaoquan/wecom/job/WeComMessageDataJob2.java

@@ -301,8 +301,7 @@ public class WeComMessageDataJob2 {
             throw new RuntimeException("推送视频生成失败");
         }
         for (JSONObject pushJsonObject : pushList) {
-            System.out.println(pushJsonObject);
-//            messageService.pushMessage(pushJsonObject);
+            messageService.pushMessage(pushJsonObject);
         }
 
         //TODO 发送成功更新发送状态

+ 5 - 6
we-com-server/src/main/java/com/tzld/piaoquan/wecom/job/WeComUserDataJob.java

@@ -128,12 +128,11 @@ public class WeComUserDataJob {
     }
 
     public void updateStaffWithUser() {
-//        UserExample userExample = new UserExample();
-//        userExample.setOrderByClause("create_time desc");
-//        userExample.setPage(new Page<>(1, 1));
-//        List<User> userList = userMapper.selectByExample(userExample);
-//        long startTime = userList.get(0).getCreateTime().getTime() / 1000;
-        long startTime = 1727467200L;
+        UserExample userExample = new UserExample();
+        userExample.setOrderByClause("create_time desc");
+        userExample.setPage(new Page<>(1, 1));
+        List<User> userList = userMapper.selectByExample(userExample);
+        long startTime = userList.get(0).getCreateTime().getTime() / 1000;
         long endTime = System.currentTimeMillis() / 1000;
         StaffExample example = new StaffExample();
         List<Staff> staffList = staffMapper.selectByExample(example);