|
@@ -33,6 +33,7 @@ import javax.annotation.Resource;
|
33
|
33
|
import javax.servlet.http.HttpServletRequest;
|
34
|
34
|
import javax.servlet.http.HttpServletResponse;
|
35
|
35
|
import java.util.ArrayList;
|
|
36
|
+import java.util.Comparator;
|
36
|
37
|
import java.util.List;
|
37
|
38
|
import java.util.concurrent.CompletableFuture;
|
38
|
39
|
|
|
@@ -61,7 +62,7 @@ public class AdTheatreController extends BaseController{
|
61
|
62
|
@Resource
|
62
|
63
|
private AdTheatreTvStatService adTheatreTvStatService;
|
63
|
64
|
@Resource
|
64
|
|
- private TaskExecutor taskExecutor;
|
|
65
|
+ private TaskExecutor batchExecutor;
|
65
|
66
|
|
66
|
67
|
/**
|
67
|
68
|
* to 列表页面
|
|
@@ -257,11 +258,11 @@ public class AdTheatreController extends BaseController{
|
257
|
258
|
// 入库
|
258
|
259
|
List<AdTheatre> adTheatres = adTheatreService.batchAdd(list, tvList);
|
259
|
260
|
|
|
261
|
+
|
260
|
262
|
//同步统计数据
|
261
|
|
- CompletableFuture[] completableFutures = adTheatres.stream().map(x -> CompletableFuture.runAsync(() -> {
|
262
|
|
- adTheatreTvStatService.saveStatByTheatreTv(x);
|
263
|
|
- }, taskExecutor)).toArray(CompletableFuture[]::new);
|
264
|
|
- CompletableFuture.allOf(completableFutures).join();
|
|
263
|
+ for (AdTheatre adTheatre:adTheatres) {
|
|
264
|
+ adTheatreTvStatService.saveStatByTheatreTv(adTheatre);
|
|
265
|
+ }
|
265
|
266
|
|
266
|
267
|
// 判断执行结果
|
267
|
268
|
if (adTheatres != null) {
|