package com.vci.ubcs.code.applyjtcodeservice.Scheduling;
|
|
import com.vci.ubcs.starter.web.enumpck.BooleanEnum;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.stereotype.Component;
|
|
import javax.annotation.PostConstruct;
|
import javax.annotation.Resource;
|
import java.text.SimpleDateFormat;
|
import java.util.Date;
|
|
/**
|
* 集成任务定时器
|
* 插入dockingtask中
|
* 从dockingtask中取出来数据,推送出去的操作
|
*/
|
@Component
|
@Slf4j
|
public class DockingApplyGroupCodeSyncScheduling {
|
|
@Resource
|
private IGroupCodeDuckingSyncService groupCodeDuckingSyncService;
|
|
@Value("${apply.groupCode.isStart:false}")
|
public boolean APPLY_GRUPCODE_SYNC_ISSTARE;
|
|
/**
|
* 是否初始化完成了
|
*/
|
public static volatile String FINISH_INIT = "false";
|
|
/**
|
* 在初始化完成后执行
|
*/
|
@PostConstruct()
|
public void onInit(){
|
FINISH_INIT = "true";
|
}
|
|
//默认每分钟执行方法
|
@Scheduled(cron = "${groupcode.cronTime:0 0/10 * * * ?}")
|
public void scheduled() {
|
log.info("执行调用集团编码申请接口申请集团编码 start:");
|
if(APPLY_GRUPCODE_SYNC_ISSTARE && BooleanEnum.TRUE.getValue().equalsIgnoreCase(FINISH_INIT)) {
|
//a codeDuckingSyncServiceI.DockingClassSyncScheduing();
|
SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.");
|
String time = formatter.format(new Date());
|
String outinfo = "============在 "+time+" 执行了分类集成推送";
|
log.info(outinfo);
|
}
|
log.info("执行调用集团编码申请接口申请集团编码 end: "+ "开关是否开启:" +APPLY_GRUPCODE_SYNC_ISSTARE);
|
}
|
}
|