From 0e3dbcdd989e682df27ce907c394f4c4fbd987e0 Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Thu, 13 May 2021 11:16:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E7=8F=AD=E8=AE=A1=E5=88=92=E5=92=8C?= =?UTF-8?q?=E8=80=83=E8=AF=95=E7=94=B3=E8=AF=B7=E5=A2=9E=E5=8A=A0=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/examapply/ExamApplyController.java | 8 ++++++ .../api/examcheck/ExamCheckController.java | 8 ++++++ .../tenlion/dao/examapply/IExamApplyDao.java | 7 +++++ .../tenlion/dao/examcheck/IExamCheckDao.java | 8 ++++++ .../service/examapply/IExamApplyService.java | 7 +++++ .../examapply/impl/ExamApplyServiceImpl.java | 27 +++++++++++++++++++ .../service/examcheck/IExamCheckService.java | 6 +++++ .../examcheck/impl/ExamCheckServiceImpl.java | 24 +++++++++++++++++ .../mapper/examapply/exam-apply-mapper.xml | 11 ++++++++ .../mapper/examcheck/exam-check-mapper.xml | 11 ++++++++ 10 files changed, 117 insertions(+) diff --git a/src/main/java/cn/com/tenlion/controller/api/examapply/ExamApplyController.java b/src/main/java/cn/com/tenlion/controller/api/examapply/ExamApplyController.java index b8fe441..6127709 100644 --- a/src/main/java/cn/com/tenlion/controller/api/examapply/ExamApplyController.java +++ b/src/main/java/cn/com/tenlion/controller/api/examapply/ExamApplyController.java @@ -108,4 +108,12 @@ public class ExamApplyController extends DefaultBaseController { return new SuccessResultData<>(examApplyService.count(params)); } + @ApiOperation(value = "考试申请统计", notes = "考试申请统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("statistics") + SuccessResultData> statistics() { + Map params = requestParams(); + return new SuccessResultData<>(examApplyService.statistics(params)); + } + } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/controller/api/examcheck/ExamCheckController.java b/src/main/java/cn/com/tenlion/controller/api/examcheck/ExamCheckController.java index d35d00e..9790aeb 100644 --- a/src/main/java/cn/com/tenlion/controller/api/examcheck/ExamCheckController.java +++ b/src/main/java/cn/com/tenlion/controller/api/examcheck/ExamCheckController.java @@ -108,4 +108,12 @@ public class ExamCheckController extends DefaultBaseController { return new SuccessResultData<>(examCheckService.count(params)); } + @ApiOperation(value = "开班计划统计", notes = "开班计划统计接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("statistics") + SuccessResultData> statistics() { + Map params = requestParams(); + return new SuccessResultData<>(examCheckService.statistics(params)); + } + } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/dao/examapply/IExamApplyDao.java b/src/main/java/cn/com/tenlion/dao/examapply/IExamApplyDao.java index 48f37dc..9226dc4 100644 --- a/src/main/java/cn/com/tenlion/dao/examapply/IExamApplyDao.java +++ b/src/main/java/cn/com/tenlion/dao/examapply/IExamApplyDao.java @@ -117,4 +117,11 @@ public interface IExamApplyDao { */ Integer count(Map params) throws SearchException; + /** + * 考试申请统计 + * @param params + * @return + * @throws SearchException + */ + Integer statisticsCount(Map params) throws SearchException; } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/dao/examcheck/IExamCheckDao.java b/src/main/java/cn/com/tenlion/dao/examcheck/IExamCheckDao.java index 99c7871..239e5c2 100644 --- a/src/main/java/cn/com/tenlion/dao/examcheck/IExamCheckDao.java +++ b/src/main/java/cn/com/tenlion/dao/examcheck/IExamCheckDao.java @@ -117,4 +117,12 @@ public interface IExamCheckDao { */ Integer count(Map params) throws SearchException; + /** + * 开班计划统计 + * @param params + * @return + * @throws SearchException + */ + Integer statisticsCount(Map params) throws SearchException; + } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/service/examapply/IExamApplyService.java b/src/main/java/cn/com/tenlion/service/examapply/IExamApplyService.java index 35d1d89..b34e567 100644 --- a/src/main/java/cn/com/tenlion/service/examapply/IExamApplyService.java +++ b/src/main/java/cn/com/tenlion/service/examapply/IExamApplyService.java @@ -193,4 +193,11 @@ public interface IExamApplyService { * @return */ Integer count(Map params); + + /** + * 考试申请 + * @param params + * @return + */ + Map statistics(Map params); } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/service/examapply/impl/ExamApplyServiceImpl.java b/src/main/java/cn/com/tenlion/service/examapply/impl/ExamApplyServiceImpl.java index 696a6a3..cd3789e 100644 --- a/src/main/java/cn/com/tenlion/service/examapply/impl/ExamApplyServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/examapply/impl/ExamApplyServiceImpl.java @@ -236,4 +236,31 @@ public class ExamApplyServiceImpl extends DefaultBaseService implements IExamApp return count == null ? 0 : count; } + @Override + public Map statistics(Map params) { + params.put("checkStatus", 1); + Integer noCheck = statisticsCount(params); + params.put("checkStatus", 2); + Integer pass = statisticsCount(params); + params.put("checkStatus", 3); + Integer fail = statisticsCount(params); + params = new HashMap<>(1); + params.put("noCheck", noCheck); + params.put("pass", pass); + params.put("fail", fail); + return params; + } + + /** + * 开班计划统计 + * checkStatus == 2 通过率 + * checkStatus == 3 驳回率 + * @param params + * @return + */ + private Integer statisticsCount(Map params) { + Integer count = examApplyDao.statisticsCount(params); + return count == null ? 0 : count; + } + } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/service/examcheck/IExamCheckService.java b/src/main/java/cn/com/tenlion/service/examcheck/IExamCheckService.java index 80b3f23..12f7f7a 100644 --- a/src/main/java/cn/com/tenlion/service/examcheck/IExamCheckService.java +++ b/src/main/java/cn/com/tenlion/service/examcheck/IExamCheckService.java @@ -185,4 +185,10 @@ public interface IExamCheckService { */ Integer count(Map params); + /** + * 开班计划通过率计算 + * @param params + * @return + */ + Map statistics(Map params); } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/service/examcheck/impl/ExamCheckServiceImpl.java b/src/main/java/cn/com/tenlion/service/examcheck/impl/ExamCheckServiceImpl.java index bdab920..a0de183 100644 --- a/src/main/java/cn/com/tenlion/service/examcheck/impl/ExamCheckServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/examcheck/impl/ExamCheckServiceImpl.java @@ -201,4 +201,28 @@ public class ExamCheckServiceImpl extends DefaultBaseService implements IExamChe return count == null ? 0 : count; } + @Override + public Map statistics(Map params) { + params.put("checkStatus", 2); + Integer pass = statisticsCount(params); + params.put("checkStatus", 3); + Integer fail = statisticsCount(params); + params = new HashMap<>(1); + params.put("pass", pass); + params.put("fail", fail); + return params; + } + + /** + * 开班计划统计 + * checkStatus == 2 通过率 + * checkStatus == 3 驳回率 + * @param params + * @return + */ + private Integer statisticsCount(Map params) { + Integer count = examCheckDao.statisticsCount(params); + return count == null ? 0 : count; + } + } \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/examapply/exam-apply-mapper.xml b/src/main/resources/mybatis/mapper/examapply/exam-apply-mapper.xml index 3fbf998..abd155b 100644 --- a/src/main/resources/mybatis/mapper/examapply/exam-apply-mapper.xml +++ b/src/main/resources/mybatis/mapper/examapply/exam-apply-mapper.xml @@ -444,4 +444,15 @@ t1.is_delete = 0 + + + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/examcheck/exam-check-mapper.xml b/src/main/resources/mybatis/mapper/examcheck/exam-check-mapper.xml index 2b81745..1e13e16 100644 --- a/src/main/resources/mybatis/mapper/examcheck/exam-check-mapper.xml +++ b/src/main/resources/mybatis/mapper/examcheck/exam-check-mapper.xml @@ -303,4 +303,15 @@ t1.is_delete = 0 + + + \ No newline at end of file