From 5f9b025178e7e9d6d474399f28c38791616734cd Mon Sep 17 00:00:00 2001 From: zhc077 <565291854@qq.com> Date: Fri, 30 Aug 2024 17:10:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=A2=E9=98=9F=E8=B5=9B=E9=98=9F=E5=91=98?= =?UTF-8?q?=E4=BD=8D=E6=AC=A1=E6=AF=94=E5=80=BC=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/UserHomePageController.java | 8 ++++---- .../homepage/service/UserHomePageService.java | 4 ++-- .../service/UserHomePageServiceImpl.java | 20 ++++++++++--------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/controller/UserHomePageController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/controller/UserHomePageController.java index 66e0b0bd..8b6cc28a 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/controller/UserHomePageController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/controller/UserHomePageController.java @@ -48,15 +48,15 @@ public class UserHomePageController { @AutoLog(value = "学校管理员-分析报告") @ApiOperation(value = "河南机电-学校综合报告", notes = "河南机电-学校综合报告") @GetMapping(value = "/report4School") - public Result report4School(String year, boolean recreateFlag) { - Object result = homePageService.report4School(year,recreateFlag); + public Result report4School(String annualId, boolean recreateFlag) { + Object result = homePageService.report4School(annualId,recreateFlag); return Result.ok(result); } @AutoLog(value = "部门管理员-分析报告") @ApiOperation(value = "河南机电-部门综合报告", notes = "河南机电-部门综合报告") @GetMapping(value = "/report4Depart") - public Result report4Depart(String year,String orgCode, boolean recreateFlag) { - return Result.ok(homePageService.report4Depart(year,orgCode, recreateFlag)); + public Result report4Depart(String annualId,String orgCode, boolean recreateFlag) { + return Result.ok(homePageService.report4Depart(annualId,orgCode, recreateFlag)); } } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/service/UserHomePageService.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/service/UserHomePageService.java index b2cdd97f..62815f20 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/service/UserHomePageService.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/service/UserHomePageService.java @@ -8,7 +8,7 @@ public interface UserHomePageService { Map homePage4School(); - Object report4School(String year,boolean recreateFlag); + Object report4School(String annualId,boolean recreateFlag); - Object report4Depart(String year,String orgCode, boolean recreateFlag); + Object report4Depart(String annualId,String orgCode, boolean recreateFlag); } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/service/UserHomePageServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/service/UserHomePageServiceImpl.java index 040a7918..fcaad6d1 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/service/UserHomePageServiceImpl.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/homepage/service/UserHomePageServiceImpl.java @@ -363,12 +363,13 @@ public class UserHomePageServiceImpl implements UserHomePageService { } @Override - public Object report4School(String yearStr, boolean recreateFlag) { + public Object report4School(String annualId, boolean recreateFlag) { String currentYear; - if (StringUtils.isNotBlank(yearStr)) { - currentYear = yearStr; - } else { + if (StringUtils.isNotBlank(annualId)) { + Annual annual = iAnnualService.getById(annualId); + currentYear = annual.getAnnualName(); + }else { currentYear = DateUtils.getCurrentYear() + ""; } final String REPORT4SCHOOL = "report4School-" + currentYear; @@ -598,7 +599,7 @@ public class UserHomePageServiceImpl implements UserHomePageService { if (hasKey) { return redisUtil.get(REPORT4SCHOOL); } else { - return this.report4School(yearStr, true); + return this.report4School(annualId, true); } } } @@ -618,13 +619,14 @@ public class UserHomePageServiceImpl implements UserHomePageService { } @Override - public Object report4Depart(String yearStr, String orgCode, boolean recreateFlag) { + public Object report4Depart(String annualId, String orgCode, boolean recreateFlag) { Assert.notNull(orgCode, "部门编号不能为空"); Map resultMap = new LinkedHashMap<>(); String currentYear; - if (StringUtils.isNotBlank(yearStr)) { - currentYear = yearStr; + if (StringUtils.isNotBlank(annualId)) { + Annual annual = iAnnualService.getById(annualId); + currentYear = annual.getAnnualName(); } else { currentYear = DateUtils.getCurrentYear() + ""; } @@ -825,7 +827,7 @@ public class UserHomePageServiceImpl implements UserHomePageService { if (hasKey) { return redisUtil.get(REPORT4DEPART); } else { - return this.report4Depart(yearStr, orgCode, true); + return this.report4Depart(annualId, orgCode, true); } } }