zoujiajian 3 лет назад
Родитель
Сommit
5b0ade1fac

+ 8 - 6
netflix-web/src/main/java/com/cyksj/web/controller/manage/statistics/StatisticsDataController.java

@@ -392,13 +392,15 @@ public class StatisticsDataController {
 		if (lastDate != null) {
 			end = DateUtil.format(DateTime.of(lastDate), "yyyy-MM-dd");
 		}
-		List<PlatOrderDonBrokenLineView> views = beanSearcher.searchAll(PlatOrderDonBrokenLineView.class, MapUtils.builder()
-				.field(PersonDistributeBrokenLineView::getDate, first, end).op(Operator.Between)
-				.orderBy(PersonDistributeBrokenLineView::getDate).asc()
-				.build());
 		BrokenLineObjView brokenLineObjView = orderDonMapper.selectPlatBrokenLineMoney(first, end);
-		Map<Long, List<PlatOrderDonBrokenLineView>> goodsMap = views.stream().collect(Collectors.groupingBy(PlatOrderDonBrokenLineView::getGoodsId));
-		brokenLineObjView.setGoodsData(goodsMap);
+		if (brokenLineObjView != null) {
+			List<PlatOrderDonBrokenLineView> views = beanSearcher.searchAll(PlatOrderDonBrokenLineView.class, MapUtils.builder()
+					.field(PersonDistributeBrokenLineView::getDate, first, end).op(Operator.Between)
+					.orderBy(PersonDistributeBrokenLineView::getDate).asc()
+					.build());
+			Map<Long, List<PlatOrderDonBrokenLineView>> goodsMap = views.stream().collect(Collectors.groupingBy(PlatOrderDonBrokenLineView::getGoodsId));
+			brokenLineObjView.setGoodsData(goodsMap);
+		}
 		return GatewayResponse.SUCCESS.newBuilder().toResult(brokenLineObjView);
 	}
 }

+ 9 - 7
netflix-web/src/main/java/com/cyksj/web/controller/user/DistributePopularizeController.java

@@ -157,14 +157,16 @@ public class DistributePopularizeController {
 		if (lastDate != null) {
 			end = DateUtil.format(DateTime.of(lastDate), "yyyy-MM-dd");
 		}
-		List<PersonDistributeBrokenLineView> views = beanSearcher.searchAll(PersonDistributeBrokenLineView.class, MapUtils.builder()
-				.field(PersonDistributeBrokenLineView::getDate, first, end).op(Operator.Between)
-				.put("userId", String.format("dw.shared_id = %s", userId))
-				.orderBy(PersonDistributeBrokenLineView::getDate).asc()
-				.build());
 		BrokenLineObjView brokenLineObjView = orderDonMapper.selectPersonDistributeBrokenLine(userId, first, end);
-		Map<Long, List<PersonDistributeBrokenLineView>> distributeMap = views.stream().collect(Collectors.groupingBy(PersonDistributeBrokenLineView::getGoodsId));
-		brokenLineObjView.setDistributeData(distributeMap);
+		if (brokenLineObjView != null) {
+			List<PersonDistributeBrokenLineView> views = beanSearcher.searchAll(PersonDistributeBrokenLineView.class, MapUtils.builder()
+					.field(PersonDistributeBrokenLineView::getDate, first, end).op(Operator.Between)
+					.put("userId", String.format("dw.shared_id = %s", userId))
+					.orderBy(PersonDistributeBrokenLineView::getDate).asc()
+					.build());
+			Map<Long, List<PersonDistributeBrokenLineView>> distributeMap = views.stream().collect(Collectors.groupingBy(PersonDistributeBrokenLineView::getGoodsId));
+			brokenLineObjView.setDistributeData(distributeMap);
+		}
 		return GatewayResponse.SUCCESS.newBuilder().toResult(brokenLineObjView);
 	}