|
|
|
@ -1,15 +1,14 @@ |
|
|
|
package com.elink.esua.epdc.task.screen; |
|
|
|
package com.elink.esua.epdc.task.screen.impl; |
|
|
|
|
|
|
|
import com.elink.esua.epdc.feign.CloudAnalysisFeignClient; |
|
|
|
import com.elink.esua.epdc.task.screen.PushDataEveryMonthTask; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import java.util.concurrent.Callable; |
|
|
|
import java.util.concurrent.ExecutorService; |
|
|
|
import java.util.concurrent.Executors; |
|
|
|
import java.util.concurrent.Future; |
|
|
|
|
|
|
|
/** |
|
|
|
* @program: esua-epdc |
|
|
|
@ -30,64 +29,26 @@ public class PushDataEveryMonthTaskImpl implements PushDataEveryMonthTask { |
|
|
|
|
|
|
|
@Override |
|
|
|
public void run(String param) { |
|
|
|
for(int i = 0 ; i < 9 ; i++){ |
|
|
|
Integer integer = createThread(i); |
|
|
|
} |
|
|
|
|
|
|
|
// 调用-->党建能力-党员相关指标上报
|
|
|
|
gridpartymemberdata(); |
|
|
|
// 调用-->党建能力-网格相关指标上报
|
|
|
|
gridpartyability(); |
|
|
|
// 调用-->党建能力-街道及社区相关指标
|
|
|
|
orgpartyability(); |
|
|
|
// 调用-->服务能力-网格相关指标
|
|
|
|
gridserviceability(); |
|
|
|
// 调用-->服务能力-组织(街道|社区|全区)相关指标
|
|
|
|
orgserviceability(); |
|
|
|
// 调用-->治理能力-网格相关指标
|
|
|
|
gridgovrnability(); |
|
|
|
// 调用-->治理能力-街道及社区相关指标
|
|
|
|
orggovrnability(); |
|
|
|
// 调用-->治理能力-部门相关指标
|
|
|
|
deptgovrnability(); |
|
|
|
// 调用-->指标数据传输完毕通知接口
|
|
|
|
all(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 创建线程调用 |
|
|
|
* @param methodIndex |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public Integer createThread(Integer methodIndex){ |
|
|
|
//使用Future,Callable实现发送消息后返回发送结果
|
|
|
|
Future<Integer> future = service.submit(new Callable<Integer>() { |
|
|
|
@Override |
|
|
|
public Integer call() throws Exception { |
|
|
|
//调用相对比较耗时的发送消息接口
|
|
|
|
Thread.sleep(200); |
|
|
|
if (methodIndex == 0) { |
|
|
|
// 调用-->党建能力-党员相关指标上报
|
|
|
|
gridpartymemberdata(); |
|
|
|
} else if (methodIndex == 1){ |
|
|
|
// 调用-->党建能力-网格相关指标上报
|
|
|
|
gridpartyability(); |
|
|
|
} else if (methodIndex == 2){ |
|
|
|
// 调用-->党建能力-街道及社区相关指标
|
|
|
|
orgpartyability(); |
|
|
|
} else if (methodIndex == 3){ |
|
|
|
// 调用-->服务能力-网格相关指标
|
|
|
|
gridserviceability(); |
|
|
|
} else if (methodIndex == 4){ |
|
|
|
// 调用-->服务能力-组织(街道|社区|全区)相关指标
|
|
|
|
orgserviceability(); |
|
|
|
} else if (methodIndex == 5){ |
|
|
|
// 调用-->治理能力-网格相关指标
|
|
|
|
gridgovrnability(); |
|
|
|
} else if (methodIndex == 6){ |
|
|
|
// 调用-->治理能力-街道及社区相关指标
|
|
|
|
orggovrnability(); |
|
|
|
} else if (methodIndex == 7){ |
|
|
|
// 调用-->治理能力-部门相关指标
|
|
|
|
deptgovrnability(); |
|
|
|
}else if (methodIndex == 8){ |
|
|
|
// 调用-->指标数据传输完毕通知接口
|
|
|
|
all(); |
|
|
|
} |
|
|
|
return 0; |
|
|
|
} |
|
|
|
}); |
|
|
|
Integer isSuccess = 0; |
|
|
|
try { |
|
|
|
isSuccess = future.get(); |
|
|
|
}catch (Exception e){ |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
return isSuccess; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|