You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
package com.docus.bgts.config;
|
|
|
|
|
|
|
|
|
|
import com.docus.bgts.enums.Codes;
|
|
|
|
|
import com.docus.bgts.facade.IBgtsService;
|
|
|
|
|
import com.docus.bgts.utils.FileUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
import javax.annotation.PostConstruct;
|
|
|
|
|
import javax.annotation.PreDestroy;
|
|
|
|
|
|
|
|
|
|
@Component
|
|
|
|
|
public class MyConstruct {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
IBgtsService bgtsService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 开启全量采集
|
|
|
|
|
*/
|
|
|
|
|
@PostConstruct
|
|
|
|
|
public void startCollectAll(){
|
|
|
|
|
String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid"));
|
|
|
|
|
String startCollectTime = String.valueOf(FileUtils.getJsonByName("startCollectTime"));
|
|
|
|
|
String isStartCollect = String.valueOf(FileUtils.getJsonByName("isStartCollect"));
|
|
|
|
|
if(collectorid.equals(Codes.SMCODE.getCode())&& StringUtils.isNotBlank(startCollectTime)&&isStartCollect!=null&&isStartCollect.equals("1")){
|
|
|
|
|
bgtsService.collectAll();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//在spring容器关闭时,释放
|
|
|
|
|
@PreDestroy
|
|
|
|
|
public void destroy() {
|
|
|
|
|
//系统运行结束
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|