Commit f4724411 by 陶光胜

取数平台调整

parent 6b563d69
......@@ -4,7 +4,7 @@ import cn.medubi.client.utils.LogPak;
import com.ctrip.framework.apollo.Config;
import com.ctrip.framework.apollo.ConfigService;
import com.gic.cloud.data.hook.api.dto.DownloadRecord;
import com.gic.cloud.data.hook.service.impl.FlatQueryResultServiceImpl;
import com.gic.cloud.data.hook.api.dto.DownloadTask;
import java.net.InetAddress;
import java.net.NetworkInterface;
......@@ -15,13 +15,17 @@ import java.util.List;
public class DataInitUtils {
private static LogPak log = new LogPak(DataInitUtils.class);
private static String host = "";
static {
host = getHost();
}
public static List<DownloadRecord> listByHost(List<DownloadRecord> allList){
List<DownloadRecord> list = new ArrayList<>();
Config config = ConfigService.getConfig("application");
String customRouterHost = config.getProperty("customRouterHost", "");
String customRouterEnterpriseId = config.getProperty("customRouterEnterpriseId", "");
String host = getHost();
log.debug("查询本机的内网ip", host);
for(DownloadRecord downloadRecord : allList){
if(host.equals(customRouterHost)){
......@@ -37,6 +41,26 @@ public class DataInitUtils {
return list;
}
public static List<DownloadTask> listTaskByHost(List<DownloadTask> allList){
List<DownloadTask> list = new ArrayList<>();
Config config = ConfigService.getConfig("application");
String customRouterHost = config.getProperty("customRouterHost", "");
String customRouterEnterpriseId = config.getProperty("customRouterEnterpriseId", "");
log.debug("查询本机的内网ip", host);
for(DownloadTask downloadTask : allList){
if(host.equals(customRouterHost)){
if(customRouterEnterpriseId.equals(downloadTask.getEnterpriseId())){
list.add(downloadTask);
}
} else {
if(!customRouterEnterpriseId.equals(downloadTask.getEnterpriseId())){
list.add(downloadTask);
}
}
}
return list;
}
private static String getHost(){
String localip = null;// 本地IP,如果没有配置外网IP则返回它
String netip = null;// 外网IP
......
......@@ -18,6 +18,7 @@ import com.google.common.collect.Lists;
import com.opencsv.CSVWriter;
import com.opencsv.ResultSetHelper;
import io.netty.handler.codec.http.HttpUtil;
import javafx.scene.chart.PieChart;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
......@@ -358,6 +359,7 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
public Integer estimateFlatQueryDownloadTask(String tableId, List<String> enterpriseIds,
List<FlatQueryCondition> queryConditions, String orderField,
String orderDir, Boolean execDistinct, List<String> authStoreIdList) {
log.debug("estimateFlatQueryDownloadTask", tableId);
Integer result = -1;
// 生成正式查询
String preQuery = this.buildFlatQuerySQL(
......@@ -904,12 +906,13 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
@Override
public void run() {
List<DownloadTask> waitingTasks = DownloadTaskServiceImpl.getInstance().getDownloadTaskOfWaiting(QueryDataSource.FLAT_QUERY);
waitingTasks = DataInitUtils.listTaskByHost(waitingTasks);
for (DownloadTask task : waitingTasks) {
log.debug("自助指标待审批任务状态变更", JSON.toJSONString(task));
//log.debug("自助指标待审批任务状态变更", JSON.toJSONString(task));
if (!task.getApplyId().equals("")) {
// String applyStatusText = HttpUtils.doGet("http://www.gicdev.com/api-admin/apply-info?type=2&applyId=" + task.getApplyId());
String applyStatusText = HttpUtils.doGet("http://hope.demogic.com/api-admin/apply-info?type=2&applyId=" + task.getApplyId());
log.debug("runApplyTask.run", "查询自助指标查询 " + task.getId() + " 审核状态码" + applyStatusText);
//log.debug("runApplyTask.run", "查询自助指标查询 " + task.getId() + " 审核状态码" + applyStatusText);
if(StringUtils.isBlank(applyStatusText)){
break;
}
......
......@@ -99,6 +99,7 @@ public class FreeQueryServiceImpl implements IFreeQueryService {
@Override
public List<FreeQueryTable> getFreeQueryTableList() {
log.debug("getFreeQueryTableList", "getFreeQueryTableList");
return MysqlHelper.getFreeQueryTableList();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment