修复bug

This commit is contained in:
guo 2023-10-09 11:25:29 +08:00
parent db534e7c00
commit 641462d591
2 changed files with 15 additions and 0 deletions

View File

@ -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+projectSntime
*/
@ -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);

View File

@ -15,6 +15,15 @@ public class EnvironmentUtil {
@Value("${active.environment.name}")
private String activeEnvironment;
/**
* 是否本地开发环境
*
* @return
*/
public boolean isDev() {
return "dev".equals(activeEnvironment);
}
/**
* 是否jlw生产环境
*