修复bug
This commit is contained in:
parent
db534e7c00
commit
641462d591
@ -24,6 +24,7 @@ import com.zhgd.xmgl.modules.worker.entity.*;
|
||||
import com.zhgd.xmgl.modules.worker.mapper.*;
|
||||
import com.zhgd.xmgl.modules.worker.service.*;
|
||||
import com.zhgd.xmgl.task.jzg.*;
|
||||
import com.zhgd.xmgl.util.EnvironmentUtil;
|
||||
import com.zhgd.xmgl.util.IdCardUtils;
|
||||
import com.zhgd.xmgl.util.MessageUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -94,6 +95,8 @@ public class JzgTask {
|
||||
private WorkerAttendancePresenceMapper workerAttendancePresenceMapper;
|
||||
@Autowired
|
||||
private RedisRepository redisRepository;
|
||||
@Autowired
|
||||
private EnvironmentUtil environmentUtil;
|
||||
/**
|
||||
* prefix+projectSn:time
|
||||
*/
|
||||
@ -106,6 +109,9 @@ public class JzgTask {
|
||||
@Scheduled(cron = "0 0 0/1 * * ?")
|
||||
@RequestMapping("/sync")
|
||||
public void realNameSystem() {
|
||||
if (environmentUtil.isDev()) {
|
||||
return;
|
||||
}
|
||||
List<Project> projects = projectMapper.selectList(null);
|
||||
for (Project project : projects) {
|
||||
syncProject(project);
|
||||
|
||||
@ -15,6 +15,15 @@ public class EnvironmentUtil {
|
||||
@Value("${active.environment.name}")
|
||||
private String activeEnvironment;
|
||||
|
||||
/**
|
||||
* 是否本地开发环境
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isDev() {
|
||||
return "dev".equals(activeEnvironment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否jlw生产环境
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user