diff --git a/src/main/java/com/cm/population/config/AuthClientSecurityConfig.java b/src/main/java/com/cm/population/config/AuthClientSecurityConfig.java index 02f8d5e..0256f67 100644 --- a/src/main/java/com/cm/population/config/AuthClientSecurityConfig.java +++ b/src/main/java/com/cm/population/config/AuthClientSecurityConfig.java @@ -41,6 +41,7 @@ public class AuthClientSecurityConfig extends WebSecurityConfigurerAdapter { .and() .logout().logoutSuccessUrl(authServer.getOauthLogout()) .and() +// .authorizeRequests().antMatchers("/app/**", "/resource/**", "/route/file/**", "/assets/**","/route/bigdata/**", "/route/populationinfo-data/**", .authorizeRequests().antMatchers("/app/**", "/resource/**", "/route/file/**", "/assets/**","/route/bigdata/**", "/api/**").permitAll() .and() @@ -48,7 +49,7 @@ public class AuthClientSecurityConfig extends WebSecurityConfigurerAdapter { .anyRequest() .access("@clientRbacService.hasPermission(request, authentication)") .and() - .headers().frameOptions().sameOrigin() + .headers().frameOptions().disable() .and() .cors() .and() diff --git a/src/main/java/com/cm/population/service/population/impl/PopulationServiceImpl.java b/src/main/java/com/cm/population/service/population/impl/PopulationServiceImpl.java index a015e91..dc0d356 100644 --- a/src/main/java/com/cm/population/service/population/impl/PopulationServiceImpl.java +++ b/src/main/java/com/cm/population/service/population/impl/PopulationServiceImpl.java @@ -470,11 +470,14 @@ public class PopulationServiceImpl extends AbstractService implements IPopulatio List populationInfoBaseDTOs = new ArrayList<>(); int size = populationInfoIds.size(); int numThreads = size / 2 + (size % 2 == 0 ? 0 : 1); // 计算需要的线程数 + numThreads = numThreads == 0 ? 1 : numThreads; + ExecutorService executorService = Executors.newFixedThreadPool(numThreads); List>> futures = new ArrayList<>(); // 将populationInfoIds分割成多个子列表,每个子列表由一个任务处理 int chunkSize = (int) Math.ceil((double) populationInfoIds.size() / numThreads); + chunkSize = chunkSize == 0? 1 : chunkSize; List> chunks = Lists.partition(populationInfoIds, chunkSize); for (List chunk : chunks) { diff --git a/src/main/resources/templates/populationinfo/list.html b/src/main/resources/templates/populationinfo/list.html index e1c8b7d..16fd1bc 100644 --- a/src/main/resources/templates/populationinfo/list.html +++ b/src/main/resources/templates/populationinfo/list.html @@ -79,9 +79,9 @@ - + + +