From b27c14afedacfd5a2ff4f7250e70747d586173ff Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 9 Nov 2021 16:37:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/DemoController.java | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index c053346087..6fefc845b6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -943,9 +943,25 @@ public class DemoController { @Autowired private ScreenProjectCategoryOrgDailyService screenProjectCategoryOrgDailyService; - @PostMapping("orgdaily") - public Result orgDaily(@RequestParam("customerId")String customerId,@RequestParam("dateId")String dateId){ - screenProjectCategoryOrgDailyService.extractProjectCategoryOrgData(customerId,dateId); + @PostMapping("gridandorgdaily") + public Result orgDaily(@RequestParam("customerId")String customerId,@RequestParam("dateId")String dateId, + @RequestParam(name = "startDate",required = false)String startDate, + @RequestParam(name = "endDate",required = false)String endDate + ){ + long start = System.currentTimeMillis(); + if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)){ + List daysBetween = DateUtils.getDaysBetween(startDate, endDate); + daysBetween.forEach(d -> { + projectCategoryGridDailyService.extractProjectCategoryData(customerId,d); + screenProjectCategoryOrgDailyService.extractProjectCategoryOrgData(customerId,d); + }); + }else { + projectCategoryGridDailyService.extractProjectCategoryData(customerId,dateId); + screenProjectCategoryOrgDailyService.extractProjectCategoryOrgData(customerId,dateId); + } + long end = System.currentTimeMillis(); + long l = (end - start) / 1000; + log.info("gridAndOrgDaily耗时" + l+ "s"); return new Result(); }