EventDealRemindQuartz.java
1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package com.xiniunet.quartz;
import com.xiniunet.framework.security.Passport;
import com.xiniunet.service.railway.biz.EventExtendManager;
import com.xiniunet.service.railway.dal.EventMapper;
import com.xiniunet.service.railway.dal.NoticePersonMapper;
import com.xiniunet.service.railway.po.EventPO;
import com.xiniunet.service.railway.util.thread.EventUrgeTask;
import com.xiniunet.service.railway.util.thread.ThreadPoolUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.stereotype.Component;
import java.util.List;
import static com.xiniunet.service.railway.Constant.RAILWAY_TENANT_ID;
/**
* @author
*/
@Component
@EnableScheduling
public class EventDealRemindQuartz {
private final static int TIMEOUT_SECONDS = 20 * 60;
@Autowired
private EventMapper eventMapper;
@Autowired
private NoticePersonMapper noticePersonMapper;
@Autowired
private EventExtendManager eventExtendManager;
private final Logger LOGGER = LoggerFactory.getLogger(EventDealRemindQuartz.class);
public void execute() {
LOGGER.warn("=========event_quartz---");
Passport passport = new Passport();
passport.setTenantId(RAILWAY_TENANT_ID);
passport.setUserId(0L);
List<EventPO> events = eventMapper.findUnDealEvent(TIMEOUT_SECONDS);
for (EventPO event : events) {
ThreadPoolUtil.submit(new EventUrgeTask(event, noticePersonMapper, eventExtendManager, TIMEOUT_SECONDS / 60, passport));
}
}
}