diff --git a/juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/AnalyzeController.java b/juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/AnalyzeController.java index 2e4f283..76e2afc 100644 --- a/juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/AnalyzeController.java +++ b/juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/AnalyzeController.java @@ -90,13 +90,13 @@ public class AnalyzeController extends JeecgController impleme public void updateStudentWithThreads(List list) { // 线程数量 - final Integer threadCount = 15; + final Integer threadCount = 1; //每个线程处理的数据量 final Integer dataPartionLength = (list.size() + threadCount - 1) / threadCount; diff --git a/juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/GaHouseholdServiceImpl.java b/juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/GaHouseholdServiceImpl.java index 8ba4438..6525f83 100644 --- a/juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/GaHouseholdServiceImpl.java +++ b/juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/GaHouseholdServiceImpl.java @@ -31,7 +31,10 @@ public class GaHouseholdServiceImpl extends ServiceImpl getGaHouseholds(Map gaDemographics) { Map familyMap = new HashMap<>(); try { + long startTime = System.currentTimeMillis(); List families = gaHouseholdMapper.getGaHouseholds(); + System.out.println("数据查询时间" + (System.currentTimeMillis() - startTime) / 1000 + "秒"); + long startTime2 = System.currentTimeMillis(); if (oConvertUtils.isNotEmpty(families)) { families.parallelStream().forEach(g -> { if (oConvertUtils.isNotEmpty(g) && oConvertUtils.isNotEmpty(g.getIdentity())) { @@ -39,6 +42,7 @@ public class GaHouseholdServiceImpl extends ServiceImpl implements public void updateStudentWithThreads(List list) { // 线程数量 - final Integer threadCount = 15; + final Integer threadCount = 1; //每个线程处理的数据量 final Integer dataPartionLength = (list.size() + threadCount - 1) / threadCount; diff --git a/juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/MrSchoolServiceImpl.java b/juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/MrSchoolServiceImpl.java index 3cad3d8..37c8d19 100644 --- a/juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/MrSchoolServiceImpl.java +++ b/juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/MrSchoolServiceImpl.java @@ -90,7 +90,7 @@ public class MrSchoolServiceImpl extends ServiceImpl i public void updateStudentWithThreads(List list) { // 线程数量 - final Integer threadCount = 15; + final Integer threadCount = 1; //每个线程处理的数据量 final Integer dataPartionLength = (list.size() + threadCount - 1) / threadCount;