Commit 56405bdda3670186ba4d03fedfe87d804daf0ebc
1 parent
77c15f8e10
Exists in
dev
#fix:优化预产期统计查询,增加搜索条件
Showing 5 changed files with 44 additions and 11 deletions
- platform-biz-service/src/main/resources/mainOrm/master/PatientService.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientServiceController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PredictedStatisticsController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PredictedStatisticsFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/PredictedStatisticsSumRequest.java
platform-biz-service/src/main/resources/mainOrm/master/PatientService.xml
View file @
56405bd
... | ... | @@ -313,7 +313,7 @@ |
313 | 313 | <if test="isOld != null and isOld != ''"> |
314 | 314 | and is_old = #{isOld,jdbcType=INTEGER} |
315 | 315 | </if> |
316 | - <if test="perType != null and perType != ''"> | |
316 | + <if test="perType != null and perType >= 0"> | |
317 | 317 | and per_type = #{perType,jdbcType=INTEGER} |
318 | 318 | </if> |
319 | 319 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientServiceController.java
View file @
56405bd
... | ... | @@ -151,7 +151,7 @@ |
151 | 151 | try { |
152 | 152 | PatientsQuery patientsQuery = new PatientsQuery(); |
153 | 153 | patientsQuery.setCardNo(yxzhVO.getIdno()); |
154 | - patientsQuery.setName(yxzhVO.getName()); | |
154 | + //patientsQuery.setName(yxzhVO.getName()); | |
155 | 155 | patientsQuery.setYn(YnEnums.YES.getId()); |
156 | 156 | //patientsQuery.setType(1); |
157 | 157 | List<Patients> patientsList = patientsService.queryPatient(patientsQuery); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PredictedStatisticsController.java
View file @
56405bd
... | ... | @@ -5,7 +5,9 @@ |
5 | 5 | import com.lyms.platform.common.base.LoginContext; |
6 | 6 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
7 | 7 | import com.lyms.platform.common.result.BaseListResponse; |
8 | +import com.lyms.platform.common.utils.DateUtil; | |
8 | 9 | import com.lyms.platform.common.utils.ExceptionUtils; |
10 | +import com.lyms.platform.common.utils.StringUtils; | |
9 | 11 | import com.lyms.platform.operate.web.facade.PredictedStatisticsFacade; |
10 | 12 | import com.lyms.platform.operate.web.request.PredictedStatisticsRequest; |
11 | 13 | import com.lyms.platform.operate.web.request.PredictedStatisticsSumRequest; |
12 | 14 | |
... | ... | @@ -69,11 +71,16 @@ |
69 | 71 | @TokenRequired |
70 | 72 | @RequestMapping(value = "predictedStatisticsSum", method = RequestMethod.GET) |
71 | 73 | public BaseListResponse predictedStatisticsSum(HttpServletRequest httpServletRequest, |
72 | - @RequestParam(required = false) String doctorId) { | |
74 | + @RequestParam(required = false) String doctorId, | |
75 | + @RequestParam(required = false) String dueDate) { | |
73 | 76 | BaseListResponse baseListResponse; |
74 | 77 | try { |
75 | 78 | PredictedStatisticsSumRequest predictedStatisticsRequest = new PredictedStatisticsSumRequest(); |
76 | 79 | predictedStatisticsRequest.setDoctorId(doctorId); |
80 | + if (StringUtils.isNotEmpty(dueDate)){ | |
81 | + //分娩日期格式为yyyy-MM | |
82 | + predictedStatisticsRequest.setDueDate(DateUtil.yyyyMMParse(dueDate)); | |
83 | + } | |
77 | 84 | |
78 | 85 | predictedStatisticsRequest.setOperatorId(((LoginContext) httpServletRequest.getAttribute("loginContext")).getId()); |
79 | 86 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PredictedStatisticsFacade.java
View file @
56405bd
... | ... | @@ -139,22 +139,37 @@ |
139 | 139 | patientsQuery.setLastCheckEmployeeId(doctorId); |
140 | 140 | } |
141 | 141 | patientsQuery.setBuildTypeNot(1); |
142 | - for (int i = 0; i < 10; i++) { | |
143 | - Date temp = DateUtil.addMonth(date, i); | |
144 | - // System.out.println(temp); | |
145 | - Date startDate = DateUtil.getMonthStart(temp); | |
146 | - Date endDate = DateUtil.getMonthEndTime(temp); | |
142 | + Date dueDate=predictedStatisticsRequest.getDueDate(); | |
143 | + if (dueDate!=null){ | |
144 | + Date startDate = DateUtil.getMonthStart(dueDate); | |
145 | + Date endDate = DateUtil.getMonthEndTime(dueDate); | |
147 | 146 | patientsQuery.setDueDateStart(startDate); |
148 | 147 | patientsQuery.setDueDateEnd(endDate); |
149 | 148 | //patientsQuery.setNotEnable("2"); 王平说的 |
150 | 149 | int count = patientsService.queryPatientCount(patientsQuery); |
151 | - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM"); | |
152 | - String dateStr = simpleDateFormat.format(new Date()); | |
153 | 150 | PredictedStatisticsCountModel predictedStatisticsCountModel = new PredictedStatisticsCountModel(); |
154 | - predictedStatisticsCountModel.setPredicted(DateUtil.addMonthWith0(dateStr, i)); | |
151 | + predictedStatisticsCountModel.setPredicted(DateUtil.getYm(dueDate)); | |
155 | 152 | predictedStatisticsCountModel.setNumber(String.valueOf(count)); |
156 | 153 | predictedStatisticsCountModelList.add(predictedStatisticsCountModel); |
154 | + }else { | |
155 | + /* SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM"); | |
156 | + String dateStr = simpleDateFormat.format(new Date());*/ | |
157 | + for (int i = 0; i < 10; i++) { | |
158 | + Date temp = DateUtil.addMonth(date, i); | |
159 | + // System.out.println(temp); | |
160 | + Date startDate = DateUtil.getMonthStart(temp); | |
161 | + Date endDate = DateUtil.getMonthEndTime(temp); | |
162 | + patientsQuery.setDueDateStart(startDate); | |
163 | + patientsQuery.setDueDateEnd(endDate); | |
164 | + //patientsQuery.setNotEnable("2"); 王平说的 | |
165 | + int count = patientsService.queryPatientCount(patientsQuery); | |
166 | + PredictedStatisticsCountModel predictedStatisticsCountModel = new PredictedStatisticsCountModel(); | |
167 | + predictedStatisticsCountModel.setPredicted(DateUtil.getYm(temp)); | |
168 | + predictedStatisticsCountModel.setNumber(String.valueOf(count)); | |
169 | + predictedStatisticsCountModelList.add(predictedStatisticsCountModel); | |
170 | + } | |
157 | 171 | } |
172 | + | |
158 | 173 | predictedStatisticsSumResult.setData(predictedStatisticsCountModelList); |
159 | 174 | |
160 | 175 | predictedStatisticsSumResult.setErrorcode(ErrorCodeConstants.SUCCESS); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/PredictedStatisticsSumRequest.java
View file @
56405bd
1 | 1 | package com.lyms.platform.operate.web.request; |
2 | 2 | |
3 | +import java.util.Date; | |
4 | + | |
3 | 5 | /** |
4 | 6 | * @auther HuJiaqi |
5 | 7 | * @createTime 2016年11月30日 10时14分 |
... | ... | @@ -9,6 +11,15 @@ |
9 | 11 | |
10 | 12 | private Integer operatorId; |
11 | 13 | private String doctorId; |
14 | + private Date dueDate; | |
15 | + | |
16 | + public Date getDueDate() { | |
17 | + return dueDate; | |
18 | + } | |
19 | + | |
20 | + public void setDueDate(Date dueDate) { | |
21 | + this.dueDate = dueDate; | |
22 | + } | |
12 | 23 | |
13 | 24 | public String getDoctorId() { |
14 | 25 | return doctorId; |