Browse Source

Revert "去除import"

This reverts commit db439a80ed56815b923563f0e72aa2dfa8abf1c6.
chenjz 3 years ago
parent
commit
724b8b7c1f

+ 10 - 12
src/main/java/com/ylcm/sys/controller/AdTheatreController.java

@@ -33,6 +33,7 @@ import javax.annotation.Resource;
33
 import javax.servlet.http.HttpServletRequest;
33
 import javax.servlet.http.HttpServletRequest;
34
 import javax.servlet.http.HttpServletResponse;
34
 import javax.servlet.http.HttpServletResponse;
35
 import java.util.ArrayList;
35
 import java.util.ArrayList;
36
+import java.util.Comparator;
36
 import java.util.List;
37
 import java.util.List;
37
 import java.util.concurrent.CompletableFuture;
38
 import java.util.concurrent.CompletableFuture;
38
 
39
 
@@ -60,8 +61,8 @@ public class AdTheatreController extends BaseController{
60
 	private AdMediaService adMediaService;
61
 	private AdMediaService adMediaService;
61
 	@Resource
62
 	@Resource
62
 	private AdTheatreTvStatService adTheatreTvStatService;
63
 	private AdTheatreTvStatService adTheatreTvStatService;
63
-    @Resource
64
-	private TaskExecutor taskExecutor;
64
+	@Resource
65
+	private TaskExecutor batchExecutor;
65
 
66
 
66
 	/**
67
 	/**
67
 	 * to 列表页面
68
 	 * to 列表页面
@@ -261,10 +262,15 @@ public class AdTheatreController extends BaseController{
261
 			}
262
 			}
262
 			// 入库
263
 			// 入库
263
 			List<AdTheatre> adTheatres = adTheatreService.batchAdd(list, tvList);
264
 			List<AdTheatre> adTheatres = adTheatreService.batchAdd(list, tvList);
265
+
266
+
267
+            //同步统计数据
268
+			for (AdTheatre adTheatre:adTheatres) {
269
+				adTheatreTvStatService.saveStatByTheatreTv(adTheatre);
270
+			}
271
+
264
 			// 判断执行结果
272
 			// 判断执行结果
265
 			if (adTheatres != null) {
273
 			if (adTheatres != null) {
266
-				//异步统计数据
267
-				asyncBatchSaveStatByTheatreTv(adTheatres);
268
 				request.setAttribute("repeat", 0);
274
 				request.setAttribute("repeat", 0);
269
 				request.setAttribute("code", Constants.CODE_SUCCESS);
275
 				request.setAttribute("code", Constants.CODE_SUCCESS);
270
 				request.setAttribute("msg", msg);
276
 				request.setAttribute("msg", msg);
@@ -282,12 +288,4 @@ public class AdTheatreController extends BaseController{
282
 		return returnHtml;
288
 		return returnHtml;
283
 	}
289
 	}
284
 
290
 
285
-	// 异步统计数据
286
-	private void asyncBatchSaveStatByTheatreTv(List<AdTheatre> adTheatres) {
287
-		CompletableFuture.runAsync(() -> {
288
-			for (AdTheatre adTheatre:adTheatres) {
289
-				adTheatreTvStatService.saveStatByTheatreTv(adTheatre);
290
-			}
291
-		}, taskExecutor);
292
-	}
293
 }
291
 }

+ 1 - 0
src/main/java/com/ylcm/sys/service/AdTheatreTvStatService.java

@@ -3,6 +3,7 @@ package com.ylcm.sys.service;
3
 import com.baomidou.mybatisplus.core.metadata.IPage;
3
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.baomidou.mybatisplus.extension.service.IService;
4
 import com.baomidou.mybatisplus.extension.service.IService;
5
 import com.ylcm.sys.domain.AdTheatre;
5
 import com.ylcm.sys.domain.AdTheatre;
6
+import com.ylcm.sys.domain.AdTheatreTv;
6
 import com.ylcm.sys.domain.AdTheatreTvStat;
7
 import com.ylcm.sys.domain.AdTheatreTvStat;
7
 import com.ylcm.sys.form.AdTheatreAnalysisDetailQueryForm;
8
 import com.ylcm.sys.form.AdTheatreAnalysisDetailQueryForm;
8
 import com.ylcm.sys.form.AdTheatreAnalysisQueryForm;
9
 import com.ylcm.sys.form.AdTheatreAnalysisQueryForm;

+ 0 - 28
yangguang.iml

@@ -1,33 +1,5 @@
1
 <?xml version="1.0" encoding="UTF-8"?>
1
 <?xml version="1.0" encoding="UTF-8"?>
2
 <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
2
 <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3
-  <component name="FacetManager">
4
-    <facet type="jpa" name="JPA">
5
-      <configuration>
6
-        <setting name="validation-enabled" value="true" />
7
-        <datasource-mapping>
8
-          <factory-entry name="yangguang" />
9
-        </datasource-mapping>
10
-        <naming-strategy-map />
11
-      </configuration>
12
-    </facet>
13
-    <facet type="web" name="Web">
14
-      <configuration>
15
-        <descriptors>
16
-          <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
17
-        </descriptors>
18
-        <webroots>
19
-          <root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
20
-        </webroots>
21
-        <sourceRoots>
22
-          <root url="file://$MODULE_DIR$/src/main/java" />
23
-          <root url="file://$MODULE_DIR$/src/main/resource" />
24
-        </sourceRoots>
25
-      </configuration>
26
-    </facet>
27
-    <facet type="Spring" name="Spring">
28
-      <configuration />
29
-    </facet>
30
-  </component>
31
   <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
3
   <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
32
     <output url="file://$MODULE_DIR$/target/classes" />
4
     <output url="file://$MODULE_DIR$/target/classes" />
33
     <output-test url="file://$MODULE_DIR$/target/test-classes" />
5
     <output-test url="file://$MODULE_DIR$/target/test-classes" />