Commit 3cb43f20a7e6e27bff5d9c79a04f875185d5c93e
1 parent
983c551b65
Exists in
master
and in
6 other branches
增加登录限制
Showing 3 changed files with 854 additions and 830 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java
View file @
3cb43f2
| 1 | 1 | package com.lyms.platform.operate.web.controller; |
| 2 | 2 | |
| 3 | +import com.lyms.platform.common.annotation.TokenRequired; | |
| 3 | 4 | import com.lyms.platform.common.base.BaseController; |
| 5 | +import com.lyms.platform.common.base.LoginContext; | |
| 4 | 6 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 5 | 7 | import com.lyms.platform.operate.web.service.IReportService; |
| 6 | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | 9 | |
| ... | ... | @@ -35,9 +37,12 @@ |
| 35 | 37 | */ |
| 36 | 38 | @RequestMapping(method = RequestMethod.GET,value = "/getCheckStatistics") |
| 37 | 39 | @ResponseBody |
| 40 | + @TokenRequired | |
| 38 | 41 | public BaseObjectResponse getCheckStatistics(String startDate, String endDate, |
| 39 | - Integer startWeek, Integer endWeek, Integer childBirth) { | |
| 40 | - return reportService.areaCountFacade(startDate, endDate, startWeek, endWeek, childBirth); | |
| 42 | + Integer startWeek, Integer endWeek, Integer childBirth, HttpServletRequest request) { | |
| 43 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 44 | + return reportService.areaCountFacade(startDate, endDate, startWeek, endWeek, childBirth, loginState.getId()); | |
| 45 | +// return reportService.areaCountFacade(startDate, endDate, startWeek, endWeek, childBirth, 753); | |
| 41 | 46 | } |
| 42 | 47 | |
| 43 | 48 | |
| ... | ... | @@ -50,8 +55,12 @@ |
| 50 | 55 | * @param childBirth |
| 51 | 56 | */ |
| 52 | 57 | @RequestMapping(value = "/check/export", method = RequestMethod.GET) |
| 53 | - public void exportCheck(String startDate, String endDate, Integer startWeek, Integer endWeek, Integer childBirth, HttpServletResponse resp) { | |
| 54 | - reportService.exportCheck(startDate, endDate, startWeek, endWeek, childBirth, resp); | |
| 58 | +// @TokenRequired | |
| 59 | + public void exportCheck(String startDate, String endDate, Integer startWeek, Integer endWeek, Integer childBirth, | |
| 60 | + HttpServletRequest request, HttpServletResponse resp) { | |
| 61 | +// LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 62 | +// reportService.exportCheck(startDate, endDate, startWeek, endWeek, childBirth, loginState.getId(), resp); | |
| 63 | + reportService.exportCheck(startDate, endDate, startWeek, endWeek, childBirth, 753, resp); | |
| 55 | 64 | } |
| 56 | 65 | |
| 57 | 66 | /** |
| ... | ... | @@ -107,8 +116,11 @@ |
| 107 | 116 | */ |
| 108 | 117 | @RequestMapping(method = RequestMethod.GET,value = "/doctor") |
| 109 | 118 | @ResponseBody |
| 110 | - public BaseObjectResponse doctorMedical(String startDate, String endDate, Integer childBirth) { | |
| 111 | - return reportService.doctorMedical(startDate, endDate, childBirth); | |
| 119 | + @TokenRequired | |
| 120 | + public BaseObjectResponse doctorMedical(String startDate, String endDate, Integer childBirth, HttpServletRequest request) { | |
| 121 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 122 | +// return reportService.doctorMedical(startDate, endDate, childBirth, loginState.getId()); | |
| 123 | + return reportService.doctorMedical(startDate, endDate, childBirth, 753); | |
| 112 | 124 | } |
| 113 | 125 | |
| 114 | 126 | /** |
| ... | ... | @@ -158,8 +170,12 @@ |
| 158 | 170 | * @return |
| 159 | 171 | */ |
| 160 | 172 | @RequestMapping(method = RequestMethod.GET,value = "/doctor/export") |
| 161 | - public void exportDoctor(String startDate, String endDate, Integer childBirth, HttpServletResponse resp) { | |
| 162 | - reportService.exportDoctor(startDate, endDate, childBirth, resp); | |
| 173 | + @TokenRequired | |
| 174 | + public void exportDoctor(String startDate, String endDate, Integer childBirth, | |
| 175 | + HttpServletRequest request, HttpServletResponse resp) { | |
| 176 | +// LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 177 | +// reportService.exportDoctor(startDate, endDate, childBirth, loginState.getId(), resp); | |
| 178 | + reportService.exportDoctor(startDate, endDate, childBirth, 753, resp); | |
| 163 | 179 | } |
| 164 | 180 | |
| 165 | 181 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IReportService.java
View file @
3cb43f2
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | * @param childBirth |
| 22 | 22 | * @return |
| 23 | 23 | */ |
| 24 | - BaseObjectResponse areaCountFacade(String startDate, String endDate, Integer startWeek, Integer endWeek, Integer childBirth); | |
| 24 | + BaseObjectResponse areaCountFacade(String startDate, String endDate, Integer startWeek, Integer endWeek, Integer childBirth, Integer userId); | |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * 产检医生统计 |
| ... | ... | @@ -30,7 +30,7 @@ |
| 30 | 30 | * @param childBirth |
| 31 | 31 | * @return |
| 32 | 32 | */ |
| 33 | - BaseObjectResponse doctorMedical(String startDate, String endDate, Integer childBirth); | |
| 33 | + BaseObjectResponse doctorMedical(String startDate, String endDate, Integer childBirth, Integer userId); | |
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * 孕产妇明细查看 |
| 37 | 37 | |
| ... | ... | @@ -56,9 +56,9 @@ |
| 56 | 56 | * @param childBirth |
| 57 | 57 | * @param resp |
| 58 | 58 | */ |
| 59 | - void exportCheck(String startDate, String endDate, Integer startWeek, Integer endWeek, Integer childBirth, HttpServletResponse resp); | |
| 59 | + void exportCheck(String startDate, String endDate, Integer startWeek, Integer endWeek, Integer childBirth, Integer userId, HttpServletResponse resp); | |
| 60 | 60 | |
| 61 | - void exportDoctor(String startDate, String endDate, Integer childBirth, HttpServletResponse resp); | |
| 61 | + void exportDoctor(String startDate, String endDate, Integer childBirth, Integer userId, HttpServletResponse resp); | |
| 62 | 62 | |
| 63 | 63 | BaseObjectResponse doctorInfo(String startDate, String endDate, Integer childBirth, Integer number, String name, Integer currentPage, Integer pageSize, Integer userId); |
| 64 | 64 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
3cb43f2
| ... | ... | @@ -30,11 +30,12 @@ |
| 30 | 30 | AutoMatchFacade autoMatchFacade; |
| 31 | 31 | |
| 32 | 32 | @Override |
| 33 | - public BaseObjectResponse areaCountFacade(String startDate, String endDate, Integer startWeek, Integer endWeek, Integer childBirth) { | |
| 33 | + public BaseObjectResponse areaCountFacade(String startDate, String endDate, Integer startWeek, Integer endWeek, Integer childBirth, Integer userId) { | |
| 34 | 34 | BaseObjectResponse rest = new BaseObjectResponse(); |
| 35 | 35 | Map<String, Object> restMap = new HashMap<>(); |
| 36 | 36 | List<Object> params = new ArrayList<>(); |
| 37 | - List<Map<String, Object>> mapList = reportDao.findList(getAreaCountFacadeSql(startDate, endDate, startWeek, endWeek, childBirth, params), params); | |
| 37 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
| 38 | + List<Map<String, Object>> mapList = reportDao.findList(getAreaCountFacadeSql(startDate, endDate, startWeek, endWeek, childBirth, hospitalId, params), params); | |
| 38 | 39 | |
| 39 | 40 | List<Object> peopleList = createPeoples(mapList); |
| 40 | 41 | restMap.put("grid", createGrid( createPeoples(mapList), createProportion(peopleList))); |
| ... | ... | @@ -46,7 +47,7 @@ |
| 46 | 47 | } |
| 47 | 48 | |
| 48 | 49 | @Override |
| 49 | - public BaseObjectResponse doctorMedical(String startDate, String endDate, Integer childBirth) { | |
| 50 | + public BaseObjectResponse doctorMedical(String startDate, String endDate, Integer childBirth, Integer userId) { | |
| 50 | 51 | BaseObjectResponse rest = new BaseObjectResponse(); |
| 51 | 52 | ReportModel reportModel = new ReportModel(); |
| 52 | 53 | List<Object> params = new ArrayList<>(); |
| ... | ... | @@ -150,8 +151,8 @@ |
| 150 | 151 | } |
| 151 | 152 | |
| 152 | 153 | @Override |
| 153 | - public void exportCheck(String startDate, String endDate, Integer startWeek, Integer endWeek, Integer childBirth, HttpServletResponse resp) { | |
| 154 | - BaseObjectResponse rest = areaCountFacade(startDate, endDate, startWeek, endWeek, childBirth); | |
| 154 | + public void exportCheck(String startDate, String endDate, Integer startWeek, Integer endWeek, Integer childBirth, Integer userId, HttpServletResponse resp) { | |
| 155 | + BaseObjectResponse rest = areaCountFacade(startDate, endDate, startWeek, endWeek, childBirth, userId); | |
| 155 | 156 | Map<String, String> cnames = new LinkedHashMap<>(); |
| 156 | 157 | cnames.put("desc", "产检人数"); |
| 157 | 158 | cnames.put("count", "总计"); |
| ... | ... | @@ -169,7 +170,8 @@ |
| 169 | 170 | cnames.put("twelveTimes", "12次"); |
| 170 | 171 | cnames.put("otherTimes", "≥13次"); |
| 171 | 172 | |
| 172 | - List<Map<String, Object>> grid = (List<Map<String, Object>>) ((Map<String, Object>) rest.getData()).get("grid"); | |
| 173 | + @SuppressWarnings("unchecked") | |
| 174 | + List<Map<String, Object>> grid = (List<Map<String, Object>>) ((Map<String, Object>) rest.getData()).get("grid"); | |
| 173 | 175 | List<Map<String,Object>> results = new ArrayList<>(); |
| 174 | 176 | for (Map<String, Object> map : grid) { |
| 175 | 177 | Map<String, Object> result = new LinkedHashMap<>(); |
| ... | ... | @@ -194,8 +196,8 @@ |
| 194 | 196 | } |
| 195 | 197 | |
| 196 | 198 | @Override |
| 197 | - public void exportDoctor(String startDate, String endDate, Integer childBirth, HttpServletResponse resp) { | |
| 198 | - ReportModel data = (ReportModel) doctorMedical(startDate, endDate, childBirth).getData(); | |
| 199 | + public void exportDoctor(String startDate, String endDate, Integer childBirth, Integer userId, HttpServletResponse resp) { | |
| 200 | + ReportModel data = (ReportModel) doctorMedical(startDate, endDate, childBirth, userId).getData(); | |
| 199 | 201 | Map<String, String> cnames = new LinkedHashMap<>(); |
| 200 | 202 | cnames.put("id", "#"); |
| 201 | 203 | cnames.put("doctorName", "产检医生"); |
| ... | ... | @@ -439,7 +441,7 @@ |
| 439 | 441 | return newList; |
| 440 | 442 | } |
| 441 | 443 | |
| 442 | - private String getAreaCountFacadeSql(String startDate, String endDate, Integer startWeek, Integer endWeek, Integer childBirth, List<Object> params) { | |
| 444 | + private String getAreaCountFacadeSql(String startDate, String endDate, Integer startWeek, Integer endWeek, Integer childBirth, String hospitalId, List<Object> params) { | |
| 443 | 445 | StringBuilder sql = new StringBuilder(); |
| 444 | 446 | sql.append("SELECT B.EXAMINE_HISTORY_NUM, ") |
| 445 | 447 | .append("COUNT(B.EXAMINE_ID) AS EXAMINE_CNT ") |
| ... | ... | @@ -453,6 +455,12 @@ |
| 453 | 455 | if(childBirth != null) { |
| 454 | 456 | sql.append("AND A.IS_CHILDBIRTH = ? "); |
| 455 | 457 | params.add(childBirth); |
| 458 | + } | |
| 459 | + | |
| 460 | + | |
| 461 | + if(StringUtils.isNotBlank(hospitalId)) { | |
| 462 | + sql.append("AND C.YCY_STSTEM_ID= ? "); | |
| 463 | + params.add(hospitalId); | |
| 456 | 464 | } |
| 457 | 465 | |
| 458 | 466 | if(startDate != null && endDate != null) { |