|
@@ -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();
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|