ChannelJob.java
1.65 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
package com.cnlive.shenhe.job;
import com.cnlive.shenhe.entity.ShyChannel;
import com.cnlive.shenhe.entity.ShyComments;
import com.cnlive.shenhe.serviceImpl.ChannelServiceImpl;
import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl;
import com.cnlive.shenhe.serviceImpl.SitesServiceImpl;
import com.cnlive.shenhe.serviceImpl.UsersServiceImpl;
import com.cnlive.shenhe.utils.AuditPass;
import com.cnlive.shenhe.utils.CommonConst;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public class ChannelJob {
private static Logger logger = LoggerFactory.getLogger(ChannelJob.class);
@Autowired
SitesServiceImpl sitesService;
@Autowired
AuditPass Pass;
@Autowired
ChannelServiceImpl channelService;
@Autowired
UsersServiceImpl usersService;
@Scheduled(fixedRate = 60 * 1000)
public void updateChannel() {
//遍历免审的spid去更改状态值
ShyChannel shyChannel = new ShyChannel();
shyChannel.setShenhe_type(CommonConst.AUDIT_TYPE_FREE);// 审核类型为免审
shyChannel.setShenhe_status(CommonConst.AUDIT_INTT);
List<ShyChannel> channelList = channelService.findshyChannel(shyChannel);
if (channelList.size() > 0) {
for (ShyChannel channel : channelList) {
channelService.updateState(channel.getId().toString(), CommonConst.AUDIT_SUCCESS, "","白名单","白名单通过");
}
}
}
}