|
@@ -1,22 +1,65 @@
|
1
|
1
|
package com.huiju.estateagents.task;
|
2
|
2
|
|
|
3
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
4
|
+import com.huiju.estateagents.common.WxUtils;
|
|
5
|
+import com.huiju.estateagents.entity.TaOrg;
|
|
6
|
+import com.huiju.estateagents.property.service.ITaUserVerifyService;
|
|
7
|
+import com.huiju.estateagents.service.ITaOrgService;
|
3
|
8
|
import com.huiju.estateagents.third.service.ITaMpInfoService;
|
4
|
9
|
import lombok.extern.slf4j.Slf4j;
|
|
10
|
+import me.chanjar.weixin.mp.api.WxMpService;
|
|
11
|
+import org.checkerframework.checker.units.qual.A;
|
5
|
12
|
import org.springframework.beans.factory.annotation.Autowired;
|
6
|
13
|
import org.springframework.scheduling.annotation.Scheduled;
|
7
|
14
|
import org.springframework.stereotype.Component;
|
8
|
15
|
|
|
16
|
+import java.util.HashMap;
|
|
17
|
+import java.util.List;
|
|
18
|
+import java.util.Map;
|
|
19
|
+
|
9
|
20
|
@Slf4j
|
10
|
21
|
@Component
|
11
|
22
|
public class MpMessageEvent {
|
|
23
|
+ @Autowired
|
|
24
|
+ WxUtils wxUtils;
|
12
|
25
|
|
13
|
26
|
@Autowired
|
14
|
27
|
ITaMpInfoService iTaMpInfoService;
|
15
|
28
|
|
|
29
|
+ @Autowired
|
|
30
|
+ ITaOrgService iTaOrgService;
|
|
31
|
+
|
|
32
|
+ @Autowired
|
|
33
|
+ ITaUserVerifyService iTaUserVerifyService;
|
|
34
|
+
|
16
|
35
|
// 发送生日祝福
|
17
|
36
|
@Scheduled(cron = "0 0 8 * * ?")
|
18
|
37
|
public void sendBirthdayMessage() {
|
|
38
|
+ List<TaOrg> orgList = iTaOrgService.list();
|
|
39
|
+ for (TaOrg org: orgList) {
|
|
40
|
+ WxMpService mpService = wxUtils.getMpService(org.getOrgId());
|
|
41
|
+ if (null == mpService) {
|
|
42
|
+ continue;
|
|
43
|
+ }
|
|
44
|
+
|
|
45
|
+ long pageNum = 1L;
|
|
46
|
+ long pageSize = 10L;
|
|
47
|
+ long total = 0L;
|
|
48
|
+
|
|
49
|
+// while (true) {
|
|
50
|
+// Page<Map<String, String>> page = new Page<>(pageNum, pageSize);
|
|
51
|
+// Page<Map<String, String>> result = iTaUserVerifyService.getPropUserByPaged(page, org.getOrgId());
|
|
52
|
+//
|
|
53
|
+//
|
|
54
|
+//
|
|
55
|
+// pageNum = result.getCurrent();
|
|
56
|
+// total = result.getTotal();
|
|
57
|
+// if ((pageNum - 1) * pageSize >= total) {
|
|
58
|
+// break;
|
|
59
|
+// }
|
|
60
|
+// }
|
19
|
61
|
|
|
62
|
+ }
|
20
|
63
|
}
|
21
|
64
|
|
22
|
65
|
// 发送节日祝福
|