Commit c48cb32e by 陶光胜

取数平台下载优化

parent 89a1d234
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.gic</groupId>
<artifactId>gic-cloud-data-hook-api</artifactId>
<version>2.28</version>
<dependencies>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-cloud-web-service-api</artifactId>
<version>3.73</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>log4j</artifactId>
<groupId>log4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-cloud-commons</artifactId>
<version>3.63</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<artifactId>log4j</artifactId>
<groupId>log4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-platform-config</artifactId>
<version>2.19</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>20.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
......@@ -246,4 +246,14 @@ public class DownloadRecord implements Serializable {
public void setApplyPermitted(String applyPermitted) {
this.applyPermitted = applyPermitted;
}
private Integer applyStatus = 0;
public Integer getApplyStatus() {
return applyStatus;
}
public void setApplyStatus(Integer applyStatus) {
this.applyStatus = applyStatus;
}
}
#Dubbo Registry Cache
#Tue Sep 15 11:35:18 CST 2020
#Wed Sep 16 09:40:39 CST 2020
com.gic.cloud.data.hook.api.service.SearchLogService=empty\://192.168.1.217\:20338/com.gic.cloud.data.hook.api.service.SearchLogService?anyhost\=true&application\=gic-cloud-data-hook&category\=configurators&check\=false&default.dispatcher\=maintenance&default.queues\=10000&default.retries\=0&default.threads\=30&default.timeout\=10000&dubbo\=2.8.5&generic\=false&interface\=com.gic.cloud.data.hook.api.service.SearchLogService&methods\=saveLog&payload\=41557050&pid\=16652&side\=provider&timeout\=120000&timestamp\=1600140918276
com.gic.cloud.data.hook.api.service.IDownloadTaskService=empty\://192.168.1.217\:20338/com.gic.cloud.data.hook.api.service.IDownloadTaskService?anyhost\=true&application\=gic-cloud-data-hook&category\=configurators&check\=false&default.dispatcher\=maintenance&default.queues\=10000&default.retries\=0&default.threads\=30&default.timeout\=10000&dubbo\=2.8.5&generic\=false&interface\=com.gic.cloud.data.hook.api.service.IDownloadTaskService&methods\=createRiskModeRecord,listUnDownloadTask,createDownloadRecord,getRiskModeRecordPage,getDownloadRecordPage,deleteDownloadTask,getDownloadProcess,getDownloadTaskPage&payload\=41557050&pid\=16652&side\=provider&timeout\=120000&timestamp\=1600140918147
com.gic.cloud.data.hook.api.service.IFlatQueryTableService=empty\://192.168.1.217\:20338/com.gic.cloud.data.hook.api.service.IFlatQueryTableService?anyhost\=true&application\=gic-cloud-data-hook&category\=configurators&check\=false&default.dispatcher\=maintenance&default.queues\=10000&default.retries\=0&default.threads\=30&default.timeout\=10000&dubbo\=2.8.5&generic\=false&interface\=com.gic.cloud.data.hook.api.service.IFlatQueryTableService&methods\=queryFlatQueryFavo,queryFlatQueryTableById,queryFlatQueryTablePage,createFlatQueryFavo,removeFlatQueryFavo,queryFlatQueryTableDetailByTableId&payload\=41557050&pid\=16652&side\=provider&timeout\=120000&timestamp\=1600140918020
......
......@@ -475,6 +475,14 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
for(DownloadRecord record : list){
if(StringUtils.isNotBlank(record.getDownloadCondition())){
FlatQueryTaskCondition condition = JSON.parseObject(record.getDownloadCondition(), FlatQueryTaskCondition.class);
if(record.getApplyStatus().equals(DownloadApplyStatus.TIMEOUT)){
continue;
}
if(condition.getBuildPermitted().equals(Global.NO)){
if(record.getApplyPermitted().equals(Global.YES)){
condition.setBuildPermitted(Global.YES);
}
}
this.taskConditions.add(condition);
}
}
......@@ -504,6 +512,7 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
FlatQueryTaskCondition condition = null;
//FlatQueryTaskCondition condition = taskConditions.remove(0); // 移除并获取第一个任务条件
for (int i=0; i<taskConditions.size(); i++ ) {
log.debug("自助指标当前正在执行的任务为:", JSON.toJSONString(taskConditions.get(i)));
if (taskConditions.get(i).getBuildPermitted().equals(Global.YES)) {
condition = taskConditions.remove(i); // 移除并获取第一个任务条件
break;
......@@ -684,6 +693,7 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
public void run() {
List<DownloadTask> waitingTasks = DownloadTaskServiceImpl.getInstance().getDownloadTaskOfWaiting(QueryDataSource.FLAT_QUERY);
for (DownloadTask task : waitingTasks) {
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());
......
......@@ -362,6 +362,7 @@ public class FreeQueryServiceImpl implements IFreeQueryService {
//FreeQueryTaskCondition condition = taskConditions.remove(0); // 移除并获取第一个任务条件
FreeQueryTaskCondition condition = null;
for (int i = 0; i < taskConditions.size(); i++) {
log.debug("自定义查询下载当前任务:", JSON.toJSONString(taskConditions.get(i)));
if (taskConditions.get(i).getBuildPermitted().equals(Global.YES)) {
condition = taskConditions.remove(i); // 移除并获取第一个任务条件
break;
......@@ -525,6 +526,7 @@ public class FreeQueryServiceImpl implements IFreeQueryService {
public void run() {
List<DownloadTask> waitingTasks = DownloadTaskServiceImpl.getInstance().getDownloadTaskOfWaiting(QueryDataSource.FREE_QUERY);
for (DownloadTask task : waitingTasks) {
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());
......
......@@ -109,11 +109,12 @@
report_id,
desensi_type,
download_condition,
apply_permitted
apply_permitted,
apply_status
FROM
dh_download_task
WHERE query_data_source = #{source} and (status = 'building' or status = 'waiting') and start_time &gt;= CONCAT(DATE_FORMAT(NOW(),'%Y-%m-%d'),' 00:00:00')
and start_time &lt;= CONCAT(DATE_FORMAT(NOW(),'%Y-%m-%d'),' 23:59:59')
and start_time &lt;= CONCAT(DATE_FORMAT(NOW(),'%Y-%m-%d'),' 23:59:59') order by start_time
</select>
</mapper>
\ No newline at end of file
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