Browse Source

Merge remote-tracking branch 'origin/master'

syh 5 years ago
parent
commit
5feeda8248

+ 25 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/AccountCpaBidJob.java

@@ -34,11 +34,30 @@ public class AccountCpaBidJob implements Job {
      */
      */
     @Override
     @Override
     public void execute(JobExecutionContext jobExecutionContext) {
     public void execute(JobExecutionContext jobExecutionContext) {
-        executorService = Executors.newFixedThreadPool(4);
-        QueryWrapper<Project> queryWrapper = new QueryWrapper<>();
-        List<Project> projects = projectService.list(queryWrapper);
-        if (!Check.isNull(projects)) {
-            projects.stream().filter(project -> BigDecimalUtil.compareToDecimal(project.getMaxDeepCpaBid(), new BigDecimal(0)) <= 0).forEach(project -> executorService.submit(() -> cpaBidWarningService.CpaBidWarning(project)));
-        }
+        Thread thread = new Thread() {
+            @Override
+            public void run() {
+                executorService = Executors.newFixedThreadPool(4);
+                QueryWrapper<Project> queryWrapper = new QueryWrapper<>();
+                List<Project> projects = projectService.list(queryWrapper);
+                if (!Check.isNull(projects)) {
+                    for (Project project : projects) {
+                        if (BigDecimalUtil.compareToDecimal(project.getMaxDeepCpaBid(), new BigDecimal(0)) <= 0) {
+                            continue;
+                        }
+                        executorService.submit(new Runnable() {
+                            @Override
+                            public void run() {
+                                cpaBidWarningService.CpaBidWarning(project);
+                            }
+
+                        });
+                    }
+                    executorService.shutdown();
+                }
+            }
+        };
+        thread.start();
+
     }
     }
 }
 }

+ 0 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/service/impl/BidWarningServiceImpl.java

@@ -62,8 +62,6 @@ public class BidWarningServiceImpl implements IBidWarningService {
                     }
                     }
                     Long maxBid = project.getMaxBid();
                     Long maxBid = project.getMaxBid();
                     Long projectId = project.getId();
                     Long projectId = project.getId();
-
-
                     List<UserAllocation> userAllocations = getUserAllocationsByProjectId(projectId);
                     List<UserAllocation> userAllocations = getUserAllocationsByProjectId(projectId);
                     if (!Check.isNull(userAllocations)) {
                     if (!Check.isNull(userAllocations)) {
                         for (UserAllocation userAllocation : userAllocations) {
                         for (UserAllocation userAllocation : userAllocations) {