Commit 6bc16645 authored by 郑建's avatar 郑建

修改为异步进行

parent acb7c5b0
......@@ -14,7 +14,8 @@ import java.util.concurrent.TimeUnit;
* @date 2021/3/2 - 18:43
**/
@Slf4j
@RestController("/zhudai")
@RestController
@RequestMapping("/manualtool/zhudainew")
public class RepairController {
......@@ -27,14 +28,8 @@ public class RepairController {
@RequestMapping("/repair")
public String mainLoanInfoSend(int startPage){
try{
Stopwatch stopwatch = Stopwatch.createStarted();
repairService.doRepair("normal_lh",startPage);
repairService.doRepair("overdue_lh",startPage);
repairService.doRepair("normal",startPage);
repairService.doRepair("overdue",startPage);
log.info("本次测试总耗时 {}",stopwatch.elapsed(TimeUnit.MILLISECONDS));
log.info("数据补报成功");
return "数据补报成功";
repairService.doRepair(startPage);
return "数据开始补报";
}catch(Exception e){
log.error("数据补报出现异常", e);
return "数据补报出现异常";
......
......@@ -20,6 +20,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.io.File;
......@@ -64,6 +65,17 @@ public class RepairService implements CommonSuperService {
public static final String errorLog = "/home/quant_group/baihang-report/data/baihang/error.txt";
@Async
public void doRepair(int startPage){
Stopwatch stopwatch = Stopwatch.createStarted();
doRepair("normal_lh",startPage);
doRepair("overdue_lh",startPage);
doRepair("normal",startPage);
doRepair("overdue",startPage);
log.info("本次测试总耗时 {}",stopwatch.elapsed(TimeUnit.MILLISECONDS));
log.info("数据补报成功");
}
public void doRepair(String type,int startPage) {
Stopwatch stopwatch = Stopwatch.createStarted();
log.info("开始报送 {}",type);
......
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