zoujiajian 2 سال پیش
والد
کامیت
9be3e672db

+ 13 - 7
netflix-service/src/main/java/com/cyksj/service/mange/statistics/impl/StatisticsDataServiceImpl.java

@@ -485,16 +485,22 @@ public class StatisticsDataServiceImpl implements StatisticsDataService {
 	public void getSynthesisData(GroupsDataStatisticsView groupsDataStatisticsView, String startDate, String endDate) throws Exception {
 		CountDownLatch latch = new CountDownLatch(2);
 		TASK_POOL.execute(() -> {
-			getNatureOrderData(groupsDataStatisticsView, startDate, endDate);
-			getCategoryOrderData(groupsDataStatisticsView, startDate, endDate);
-			latch.countDown();
+			try {
+				getNatureOrderData(groupsDataStatisticsView, startDate, endDate);
+				getCategoryOrderData(groupsDataStatisticsView, startDate, endDate);
+			} finally {
+				latch.countDown();
+			}
 		});
 		TASK_POOL.execute(() -> {
-			getGroupsOrderCategoryData(groupsDataStatisticsView, startDate, endDate);
-			getRenewOrderData(groupsDataStatisticsView, startDate, endDate);
-			latch.countDown();
+			try {
+				getGroupsOrderCategoryData(groupsDataStatisticsView, startDate, endDate);
+				getRenewOrderData(groupsDataStatisticsView, startDate, endDate);
+			} finally {
+				latch.countDown();
+			}
 		});
-		latch.wait();
+		latch.await();
 	}
 
 	private void exportBusinessMonthlyData(List<ExcelSheetAndData> excelSheetDataList, Long startTime, Long endTime) {