Commit 3417ee0e4000fc1bd00a6f4316ef11e7c84e451c
1 parent
4325f10816
Exists in
master
and in
6 other branches
update
Showing 1 changed file with 119 additions and 144 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/HealthChargeFacade.java
View file @
3417ee0
... | ... | @@ -84,11 +84,11 @@ |
84 | 84 | * @param hospitalId 医院id |
85 | 85 | * @param healthType 打印类型 1体重 2 血糖 3 血压 4妊高症 4-儿童膳食 6体成分分析 7 孕期微量元素 8孕期骨密度 9儿童微量元素 10 儿童骨密度 |
86 | 86 | * @param foreignId 档案id (院内建档或者临时档案id)孕妇/儿童 |
87 | - * @param type 打印报告类别 1普通报告 2高危报告(暂时不用) | |
88 | - * @param source 档案来源类型 1院内建档 2零时建档 (暂时不用) | |
89 | - * @param userId 当前登陆用户id | |
90 | - * @param doctorId 报表解读人id | |
91 | - * @param isBaby 是否为儿童 | |
87 | + * @param type 打印报告类别 1普通报告 2高危报告(暂时不用) | |
88 | + * @param source 档案来源类型 1院内建档 2零时建档 (暂时不用) | |
89 | + * @param userId 当前登陆用户id | |
90 | + * @param doctorId 报表解读人id | |
91 | + * @param isBaby 是否为儿童 | |
92 | 92 | * @return |
93 | 93 | */ |
94 | 94 | public BaseResponse addHealthCharge(String hospitalId, |
95 | 95 | |
... | ... | @@ -98,11 +98,11 @@ |
98 | 98 | Integer source, |
99 | 99 | Integer userId, |
100 | 100 | String doctorId, |
101 | - boolean isBaby){ | |
101 | + boolean isBaby) { | |
102 | 102 | HealthChargeRequest request = new HealthChargeRequest(); |
103 | 103 | request.setHospitalId(hospitalId); |
104 | 104 | request.setHealthType(healthType); |
105 | - if (isBaby){ | |
105 | + if (isBaby) { | |
106 | 106 | request.setSource(source); |
107 | 107 | request.setBabyForeignId(foreignId); |
108 | 108 | } else { |
109 | 109 | |
... | ... | @@ -122,11 +122,11 @@ |
122 | 122 | Integer userId, |
123 | 123 | String doctorId, |
124 | 124 | boolean isBaby, |
125 | - String babyNutritionId){ | |
125 | + String babyNutritionId) { | |
126 | 126 | HealthChargeRequest request = new HealthChargeRequest(); |
127 | 127 | request.setHospitalId(hospitalId); |
128 | 128 | request.setHealthType(healthType); |
129 | - if (isBaby){ | |
129 | + if (isBaby) { | |
130 | 130 | request.setBabyForeignId(foreignId); |
131 | 131 | request.setBabyNutritionId(babyNutritionId); |
132 | 132 | } else { |
133 | 133 | |
134 | 134 | |
... | ... | @@ -140,16 +140,16 @@ |
140 | 140 | |
141 | 141 | /** |
142 | 142 | * 打印体重、血糖、血压调用接口 |
143 | + * | |
143 | 144 | * @param hospitalId 医院id |
144 | 145 | * @param healthType 打印类型 1体重 2 血糖 3 血压 4妊高症 5-儿童 |
145 | - * @param foreignId 档案id (院内建档或者临时档案id) | |
146 | - * @param type 打印报告类别 1普通报告 2高危报告 | |
147 | - * @param source 档案来源类型 1院内建档 2零时建档 | |
148 | - * @param userId 当前登陆用户id | |
146 | + * @param foreignId 档案id (院内建档或者临时档案id) | |
147 | + * @param type 打印报告类别 1普通报告 2高危报告 | |
148 | + * @param source 档案来源类型 1院内建档 2零时建档 | |
149 | + * @param userId 当前登陆用户id | |
149 | 150 | * @return |
150 | 151 | */ |
151 | - public BaseResponse addHealthCharge(String hospitalId,Integer healthType,String foreignId,Integer type,Integer source, Integer userId) | |
152 | - { | |
152 | + public BaseResponse addHealthCharge(String hospitalId, Integer healthType, String foreignId, Integer type, Integer source, Integer userId) { | |
153 | 153 | HealthChargeRequest request = new HealthChargeRequest(); |
154 | 154 | request.setHospitalId(hospitalId); |
155 | 155 | request.setHealthType(healthType); |
156 | 156 | |
157 | 157 | |
158 | 158 | |
159 | 159 | |
160 | 160 | |
161 | 161 | |
162 | 162 | |
163 | 163 | |
164 | 164 | |
165 | 165 | |
... | ... | @@ -162,52 +162,46 @@ |
162 | 162 | |
163 | 163 | /** |
164 | 164 | * 添加 |
165 | + * | |
165 | 166 | * @param request |
166 | 167 | * @param userId |
167 | 168 | * @return |
168 | 169 | */ |
169 | 170 | public BaseResponse addHealthCharge(HealthChargeRequest request, Integer userId) { |
170 | 171 | |
171 | - HealthChargeQuery healthChargeQuery = new HealthChargeQuery(); | |
172 | + HealthChargeQuery healthChargeQuery = new HealthChargeQuery(); | |
172 | 173 | String babyForeignId = request.getBabyForeignId(); |
173 | - if (StringUtils.isNotEmpty(babyForeignId)){ | |
174 | + if (StringUtils.isNotEmpty(babyForeignId)) { | |
174 | 175 | // 儿童 |
175 | 176 | healthChargeQuery.setBabyForeignId(babyForeignId); |
176 | 177 | healthChargeQuery.setBabyNutritionId(request.getBabyNutritionId()); |
177 | - }else { | |
178 | + } else { | |
178 | 179 | // 孕妇 |
179 | 180 | healthChargeQuery.setForeignId(request.getForeignId()); |
180 | 181 | healthChargeQuery.setSource(request.getSource()); |
181 | 182 | } |
182 | 183 | healthChargeQuery.setHealthType(request.getHealthType()); |
183 | - List<HealthChargeModel> list = healthChargeService.queryHealthChargeList(healthChargeQuery); | |
184 | + List <HealthChargeModel> list = healthChargeService.queryHealthChargeList(healthChargeQuery); | |
184 | 185 | |
185 | 186 | boolean isSave = false; |
186 | - if (CollectionUtils.isNotEmpty(list)) | |
187 | - { | |
187 | + if (CollectionUtils.isNotEmpty(list)) { | |
188 | 188 | HealthChargeModel model = list.get(0); |
189 | 189 | |
190 | - if (DateUtil.getyyyy_MM_dd(new Date()).equals(DateUtil.getyyyy_MM_dd(model.getCreated()))) | |
191 | - { | |
190 | + if (DateUtil.getyyyy_MM_dd(new Date()).equals(DateUtil.getyyyy_MM_dd(model.getCreated()))) { | |
192 | 191 | String doctorId = request.getDoctorId(); |
193 | - if (StringUtils.isNotEmpty(doctorId)){ | |
192 | + if (StringUtils.isNotEmpty(doctorId)) { | |
194 | 193 | model.setDoctorId(doctorId); |
195 | 194 | } |
196 | 195 | model.setType(request.getType()); |
197 | 196 | model.setModified(new Date()); |
198 | 197 | healthChargeService.updateHealthCharge(model); |
199 | - } | |
200 | - else | |
201 | - { | |
198 | + } else { | |
202 | 199 | isSave = true; |
203 | 200 | } |
204 | - } | |
205 | - else | |
206 | - { | |
201 | + } else { | |
207 | 202 | isSave = true; |
208 | 203 | } |
209 | - if (isSave) | |
210 | - { | |
204 | + if (isSave) { | |
211 | 205 | HealthChargeModel model = request.convertToDataModel(); |
212 | 206 | model.setStatus(1); |
213 | 207 | model.setOperateUserId(String.valueOf(userId)); |
214 | 208 | |
... | ... | @@ -220,11 +214,10 @@ |
220 | 214 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
221 | 215 | } |
222 | 216 | |
223 | - public BaseResponse getHealthCharges(Integer healthType, String hospitalId,String time,Integer source,Integer status,Integer type,Integer page,Integer limit,Integer userId, String doctorId) | |
224 | - { | |
217 | + public BaseResponse getHealthCharges(Integer healthType, String hospitalId, String time, Integer source, Integer status, Integer type, Integer page, Integer limit, Integer userId, String doctorId) { | |
225 | 218 | |
226 | - List<Map> listData = new ArrayList<>(); | |
227 | - HealthChargeQuery healthChargeQuery = new HealthChargeQuery(); | |
219 | + List <Map> listData = new ArrayList <>(); | |
220 | + HealthChargeQuery healthChargeQuery = new HealthChargeQuery(); | |
228 | 221 | healthChargeQuery.setPage(page); |
229 | 222 | healthChargeQuery.setLimit(limit); |
230 | 223 | healthChargeQuery.setNeed("true"); |
231 | 224 | |
232 | 225 | |
233 | 226 | |
234 | 227 | |
235 | 228 | |
... | ... | @@ -241,28 +234,25 @@ |
241 | 234 | healthChargeQuery.setCreatedEnd(DateUtil.parseYMDHMS(dates[1] + " 23:59:59")); |
242 | 235 | } |
243 | 236 | } |
244 | - if (StringUtils.isNotEmpty(doctorId)){ | |
237 | + if (StringUtils.isNotEmpty(doctorId)) { | |
245 | 238 | healthChargeQuery.setDoctorId(doctorId); |
246 | 239 | } |
247 | 240 | |
248 | - List<HealthChargeModel> list = healthChargeService.queryHealthChargeList(healthChargeQuery); | |
241 | + List <HealthChargeModel> list = healthChargeService.queryHealthChargeList(healthChargeQuery); | |
249 | 242 | |
250 | - if (CollectionUtils.isNotEmpty(list)) | |
251 | - { | |
243 | + if (CollectionUtils.isNotEmpty(list)) { | |
252 | 244 | |
253 | - for (HealthChargeModel model : list) | |
254 | - { | |
245 | + for (HealthChargeModel model : list) { | |
255 | 246 | |
256 | 247 | Map map = getData(model); |
257 | - if (map == null) | |
258 | - { | |
248 | + if (map == null) { | |
259 | 249 | continue; |
260 | 250 | } |
261 | 251 | |
262 | 252 | String name = ""; |
263 | 253 | String id = model.getDoctorId(); |
264 | 254 | if (StringUtils.isNotEmpty(id)) { |
265 | - if (StringUtils.isNotEmpty(id)){ | |
255 | + if (StringUtils.isNotEmpty(id)) { | |
266 | 256 | Users users = usersService.getUsers(Integer.parseInt(id)); |
267 | 257 | name = users.getName(); |
268 | 258 | } |
... | ... | @@ -277,6 +267,7 @@ |
277 | 267 | |
278 | 268 | /** |
279 | 269 | * 体重报告结算导入2007 excle的方法 |
270 | + * | |
280 | 271 | * @author 武涛涛 |
281 | 272 | */ |
282 | 273 | public BaseResponse importHealthCharges(MultipartFile file, Integer id, HttpServletResponse response) { |
... | ... | @@ -297,7 +288,7 @@ |
297 | 288 | int rowNum = sheet.getLastRowNum(); |
298 | 289 | // 定义单元 |
299 | 290 | XSSFCell cell = null; |
300 | - List<HealthChargeModel> healthChargeModelList = new ArrayList<>(); | |
291 | + List <HealthChargeModel> healthChargeModelList = new ArrayList <>(); | |
301 | 292 | // 按行循环读取 |
302 | 293 | |
303 | 294 | for (int j = 1; j <= rowNum; j++) { |
... | ... | @@ -308,7 +299,7 @@ |
308 | 299 | int colNum = rowLine.getLastCellNum(); |
309 | 300 | StringBuffer sb = new StringBuffer(); |
310 | 301 | // 按列读取每一行的各个单元格内容 |
311 | - for (int i = 1; i < colNum; i++) { | |
302 | + for (int i = 0; i < colNum; i++) { | |
312 | 303 | //获取该行索引,对应的单元格,Value |
313 | 304 | cell = rowLine.getCell(i); |
314 | 305 | String cellValue = null; |
315 | 306 | |
... | ... | @@ -316,10 +307,11 @@ |
316 | 307 | switch (cell.getCellType()) { |
317 | 308 | // 如果是数字格式 |
318 | 309 | case XSSFCell.CELL_TYPE_NUMERIC: |
319 | - Integer number = new Integer( (int) cell.getNumericCellValue());// 数字 | |
310 | + Integer number = new Integer((int) cell.getNumericCellValue());// 数字 | |
320 | 311 | cellValue = String.valueOf(number); |
321 | 312 | break; |
322 | - case XSSFCell.CELL_TYPE_STRING: cellValue = cell.getStringCellValue();// 字符串 | |
313 | + case XSSFCell.CELL_TYPE_STRING: | |
314 | + cellValue = cell.getStringCellValue();// 字符串 | |
323 | 315 | break; |
324 | 316 | default: |
325 | 317 | cellValue = ""; |
326 | 318 | |
327 | 319 | |
328 | 320 | |
329 | 321 | |
... | ... | @@ -351,16 +343,27 @@ |
351 | 343 | chargeModel.setHospitalId(hospitalId); //医院id |
352 | 344 | chargeModel.setHealthType(1);// 1体重 |
353 | 345 | chargeModel.setYn(YnEnums.YES.getId()); |
354 | - chargeModel.setDoctorId(getUsersId(hospitalId, chargeModel.getDoctorName())); | |
355 | - chargeModel.setCreated(DateUtil.parseYMD(chargeModel.getCreatedStr())); | |
346 | + String doctorId = getUsersId(hospitalId, chargeModel.getDoctorName()); | |
347 | + if (StringUtils.isEmpty(doctorId)) { | |
348 | + continue; | |
349 | + } | |
350 | + chargeModel.setDoctorId(doctorId); | |
356 | 351 | |
352 | + Date date = DateUtil.parseYMD(chargeModel.getCreatedStr()); | |
353 | + if (date == null) { | |
354 | + continue; | |
355 | + } | |
356 | + chargeModel.setCreated(date); | |
357 | + | |
357 | 358 | String foreignId = getForeignId(hospitalId, chargeModel); |
359 | + if (StringUtils.isEmpty(foreignId)) { | |
360 | + continue; | |
361 | + } | |
358 | 362 | chargeModel.setForeignId(foreignId);//建档id或者临时档案id |
363 | + | |
359 | 364 | chargeModel.setOperateUserId(String.valueOf(id)); |
360 | 365 | chargeModel.setModified(new Date()); |
361 | - if(StringUtils.isNotEmpty(foreignId)){ | |
362 | - healthChargeService.addHealthCharge(chargeModel); | |
363 | - } | |
366 | + healthChargeService.addHealthCharge(chargeModel); | |
364 | 367 | //System.out.println("chargeModel.toString(): " + chargeModel.toString()); |
365 | 368 | } |
366 | 369 | |
... | ... | @@ -378,7 +381,7 @@ |
378 | 381 | patientsQuery.setCardNo(chargeModel.getCardNo()); |
379 | 382 | patientsQuery.setExtSource(false); |
380 | 383 | List <Patients> patientsList = patientsService.queryPatient(patientsQuery); |
381 | - if(CollectionUtils.isNotEmpty(patientsList)){ | |
384 | + if (CollectionUtils.isNotEmpty(patientsList)) { | |
382 | 385 | Patients patients = patientsList.get(0); |
383 | 386 | return patients.getId(); |
384 | 387 | } |
... | ... | @@ -387,7 +390,7 @@ |
387 | 390 | } |
388 | 391 | |
389 | 392 | private String getUsersId(String hospitalId, String doctorName) { |
390 | - if(StringUtils.isEmpty(doctorName) || StringUtils.isEmpty(hospitalId)){ | |
393 | + if (StringUtils.isEmpty(doctorName) || StringUtils.isEmpty(hospitalId)) { | |
391 | 394 | return null; |
392 | 395 | } |
393 | 396 | UsersQuery usersQuery = new UsersQuery(); |
... | ... | @@ -397,7 +400,7 @@ |
397 | 400 | List <Users> users = usersService.queryUsers(usersQuery); |
398 | 401 | if (CollectionUtils.isNotEmpty(users)) { |
399 | 402 | Users users1 = users.get(0); |
400 | - return users1.getId() !=null ? users1.getId().toString(): null; | |
403 | + return users1.getId() != null ? users1.getId().toString() : null; | |
401 | 404 | } |
402 | 405 | return null; |
403 | 406 | } |
404 | 407 | |
405 | 408 | |
406 | 409 | |
407 | 410 | |
408 | 411 | |
409 | 412 | |
410 | 413 | |
411 | 414 | |
412 | 415 | |
413 | 416 | |
414 | 417 | |
415 | 418 | |
416 | 419 | |
... | ... | @@ -405,62 +408,52 @@ |
405 | 408 | |
406 | 409 | /** |
407 | 410 | * 返回列表字段 |
411 | + * | |
408 | 412 | * @param model |
409 | 413 | * @return |
410 | 414 | */ |
411 | - private Map getData(HealthChargeModel model) | |
412 | - { | |
415 | + private Map getData(HealthChargeModel model) { | |
413 | 416 | Map map = new HashMap(); |
414 | 417 | |
415 | - if (model.getSource() == 1) | |
416 | - { | |
418 | + if (model.getSource() == 1) { | |
417 | 419 | |
418 | - if (StringUtils.isNotEmpty(model.getBabyForeignId())) | |
419 | - { | |
420 | + if (StringUtils.isNotEmpty(model.getBabyForeignId())) { | |
420 | 421 | BabyModel babyModel = babyBookbuildingService.queryBabyBuildById(model.getBabyForeignId()); |
421 | - if (babyModel == null) | |
422 | - { | |
422 | + if (babyModel == null) { | |
423 | 423 | return null; |
424 | 424 | } |
425 | - map.put("userName",babyModel.getName()); | |
425 | + map.put("userName", babyModel.getName()); | |
426 | 426 | map.put("age", DateUtil.getBabyMonthAge(babyModel.getBirth(), new Date())); |
427 | 427 | map.put("checkMonth", DateUtil.getBabyMonthAge(babyModel.getBirth(), model.getCreated())); |
428 | - } | |
429 | - else | |
430 | - { | |
428 | + } else { | |
431 | 429 | Patients patients = patientsService.findOnePatientById(model.getForeignId()); |
432 | - if (patients == null) | |
433 | - { | |
430 | + if (patients == null) { | |
434 | 431 | return null; |
435 | 432 | } |
436 | - map.put("risk",getLastRisk(patients,model.getCreated())); | |
433 | + map.put("risk", getLastRisk(patients, model.getCreated())); | |
437 | 434 | map.put("userName", patients.getUsername()); |
438 | - map.put("age",DateUtil.getAge(patients.getBirth(), model.getCreated())); | |
439 | - map.put("week",DateUtil.getWeekDesc(patients.getLastMenses(),model.getCreated())); | |
435 | + map.put("age", DateUtil.getAge(patients.getBirth(), model.getCreated())); | |
436 | + map.put("week", DateUtil.getWeekDesc(patients.getLastMenses(), model.getCreated())); | |
440 | 437 | } |
441 | - } | |
442 | - else | |
443 | - { | |
438 | + } else { | |
444 | 439 | //获取临时用户信息 |
445 | 440 | getTemporaryUserInfo(map, model.getForeignId(), model.getCreated()); |
446 | 441 | } |
447 | 442 | map.put("status", model.getStatus() == 1 ? "未结算" : "已结算"); |
448 | 443 | map.put("type", model.getType() == null ? "" : model.getType() == 1 ? "标准报告" : "高危报告"); |
449 | - map.put("source",model.getSource() == 1 ? "院内" : "临时"); | |
444 | + map.put("source", model.getSource() == 1 ? "院内" : "临时"); | |
450 | 445 | map.put("time", DateUtil.getyyyy_MM_dd(model.getCreated())); |
451 | 446 | return map; |
452 | 447 | } |
453 | 448 | |
454 | 449 | |
455 | - private String getLastRisk(Patients patients,Date lastDate) | |
456 | - { | |
450 | + private String getLastRisk(Patients patients, Date lastDate) { | |
457 | 451 | String ri = ""; |
458 | 452 | AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); |
459 | 453 | antExRecordQuery.setPid(patients.getPid()); |
460 | 454 | antExRecordQuery.setCheckTimeEnd(lastDate); |
461 | - List<AntExRecordModel> antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery, Sort.Direction.DESC, "created"); | |
462 | - if (CollectionUtils.isNotEmpty(antExRecordModelList)) | |
463 | - { | |
455 | + List <AntExRecordModel> antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery, Sort.Direction.DESC, "created"); | |
456 | + if (CollectionUtils.isNotEmpty(antExRecordModelList)) { | |
464 | 457 | |
465 | 458 | AntExRecordModel model = antExRecordModelList.get(0); |
466 | 459 | |
... | ... | @@ -478,7 +471,7 @@ |
478 | 471 | } |
479 | 472 | } |
480 | 473 | |
481 | - List<Map<String, Object>> results = commonService.resolveOtherRisk(risk); | |
474 | + List <Map <String, Object>> results = commonService.resolveOtherRisk(risk); | |
482 | 475 | StringBuffer name = new StringBuffer(); |
483 | 476 | Integer score = 0; |
484 | 477 | if (CollectionUtils.isNotEmpty(results)) { |
485 | 478 | |
486 | 479 | |
487 | 480 | |
488 | 481 | |
489 | 482 | |
490 | 483 | |
... | ... | @@ -506,32 +499,30 @@ |
506 | 499 | } |
507 | 500 | |
508 | 501 | |
509 | - | |
510 | 502 | /** |
511 | 503 | * 获取临时用户信息 |
504 | + * | |
512 | 505 | * @param map |
513 | 506 | * @param id |
514 | 507 | * @param created |
515 | 508 | */ |
516 | - private void getTemporaryUserInfo(Map map,String id,Date created) | |
517 | - { | |
509 | + private void getTemporaryUserInfo(Map map, String id, Date created) { | |
518 | 510 | TemporaryUserModel temporaryWeightModel = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(id).and("yn").is(String.valueOf(YnEnums.YES.getId()))), |
519 | 511 | TemporaryUserModel.class); |
520 | - if (temporaryWeightModel != null) | |
521 | - { | |
522 | - setMap(map, temporaryWeightModel.getUserName(), DateUtil.getAge(temporaryWeightModel.getBirth(),new Date()), temporaryWeightModel.getLastMenses(), created); | |
512 | + if (temporaryWeightModel != null) { | |
513 | + setMap(map, temporaryWeightModel.getUserName(), DateUtil.getAge(temporaryWeightModel.getBirth(), new Date()), temporaryWeightModel.getLastMenses(), created); | |
523 | 514 | } |
524 | 515 | } |
525 | 516 | |
526 | - private void setMap(Map map,String userName,Integer age,Date lastMenses,Date created) | |
527 | - { | |
517 | + private void setMap(Map map, String userName, Integer age, Date lastMenses, Date created) { | |
528 | 518 | map.put("userName", userName); |
529 | - map.put("age",age); | |
530 | - map.put("week",DateUtil.getWeekDesc(lastMenses,created)); | |
519 | + map.put("age", age); | |
520 | + map.put("week", DateUtil.getWeekDesc(lastMenses, created)); | |
531 | 521 | } |
532 | 522 | |
533 | 523 | /** |
534 | 524 | * 更新条件查询到的结算状态 |
525 | + * | |
535 | 526 | * @param healthType |
536 | 527 | * @param hospitalId |
537 | 528 | * @param time |
538 | 529 | |
... | ... | @@ -541,12 +532,11 @@ |
541 | 532 | * @param userId |
542 | 533 | * @return |
543 | 534 | */ |
544 | - public BaseResponse setHealthCharged(String doctorId,Integer healthType, String hospitalId, String time, Integer source, Integer status, Integer type, Integer userId) | |
545 | - { | |
535 | + public BaseResponse setHealthCharged(String doctorId, Integer healthType, String hospitalId, String time, Integer source, Integer status, Integer type, Integer userId) { | |
546 | 536 | |
547 | 537 | ChargeRecordModel recordModel = new ChargeRecordModel(); |
548 | 538 | |
549 | - HealthChargeQuery healthChargeQuery = new HealthChargeQuery(); | |
539 | + HealthChargeQuery healthChargeQuery = new HealthChargeQuery(); | |
550 | 540 | healthChargeQuery.setHealthType(healthType); |
551 | 541 | healthChargeQuery.setYn(YnEnums.YES.getId()); |
552 | 542 | healthChargeQuery.setHospitalId(hospitalId); |
553 | 543 | |
... | ... | @@ -554,12 +544,10 @@ |
554 | 544 | healthChargeQuery.setSource(source); |
555 | 545 | healthChargeQuery.setStatus(status); |
556 | 546 | healthChargeQuery.setType(type); |
557 | - if (StringUtils.isNotEmpty(time)) | |
558 | - { | |
547 | + if (StringUtils.isNotEmpty(time)) { | |
559 | 548 | String[] dates = time.split(" - "); |
560 | 549 | healthChargeQuery.setCreatedStart(DateUtil.parseYMD(dates[0])); |
561 | - if (dates.length == 2) | |
562 | - { | |
550 | + if (dates.length == 2) { | |
563 | 551 | healthChargeQuery.setCreatedEnd(DateUtil.parseYMDHMS(dates[1] + " 23:59:59")); |
564 | 552 | } |
565 | 553 | recordModel.setStartDate(DateUtil.parseYMD(dates[0])); |
566 | 554 | |
567 | 555 | |
568 | 556 | |
569 | 557 | |
570 | 558 | |
... | ... | @@ -580,42 +568,37 @@ |
580 | 568 | HealthChargeModel model = new HealthChargeModel(); |
581 | 569 | model.setChargeRecordId(recordModel.getId()); |
582 | 570 | model.setStatus(2); |
583 | - healthChargeService.updateHealthCharges(healthChargeQuery,model); | |
571 | + healthChargeService.updateHealthCharges(healthChargeQuery, model); | |
584 | 572 | |
585 | 573 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
586 | 574 | } |
587 | 575 | |
588 | - public BaseResponse getChargeRecords(Integer healthType, String hospitalId, String time, String doctorId, Integer page, Integer limit, Integer userId) | |
589 | - { | |
590 | - List<Map> listData = new ArrayList<>(); | |
591 | - ChargeRecordQuery chargeRecordQuery = new ChargeRecordQuery(); | |
576 | + public BaseResponse getChargeRecords(Integer healthType, String hospitalId, String time, String doctorId, Integer page, Integer limit, Integer userId) { | |
577 | + List <Map> listData = new ArrayList <>(); | |
578 | + ChargeRecordQuery chargeRecordQuery = new ChargeRecordQuery(); | |
592 | 579 | chargeRecordQuery.setHealthType(healthType); |
593 | 580 | chargeRecordQuery.setHospitalId(hospitalId); |
594 | 581 | chargeRecordQuery.setOperateUserId(doctorId); |
595 | 582 | chargeRecordQuery.setPage(page); |
596 | 583 | chargeRecordQuery.setLimit(limit); |
597 | 584 | chargeRecordQuery.setNeed("true"); |
598 | - if (StringUtils.isNotEmpty(time)) | |
599 | - { | |
585 | + if (StringUtils.isNotEmpty(time)) { | |
600 | 586 | String[] dates = time.split(" - "); |
601 | 587 | chargeRecordQuery.setCreatedStart(DateUtil.parseYMD(dates[0])); |
602 | - if (dates.length == 2) | |
603 | - { | |
588 | + if (dates.length == 2) { | |
604 | 589 | chargeRecordQuery.setCreatedEnd(DateUtil.parseYMDHMS(dates[1] + " 23:59:59")); |
605 | 590 | } |
606 | 591 | } |
607 | - List<ChargeRecordModel> list = chargeRecordService.queryChargeRecordList(chargeRecordQuery); | |
608 | - if (CollectionUtils.isNotEmpty(list)) | |
609 | - { | |
610 | - for (ChargeRecordModel model : list) | |
611 | - { | |
592 | + List <ChargeRecordModel> list = chargeRecordService.queryChargeRecordList(chargeRecordQuery); | |
593 | + if (CollectionUtils.isNotEmpty(list)) { | |
594 | + for (ChargeRecordModel model : list) { | |
612 | 595 | Map map = new HashMap(); |
613 | - map.put("id",model.getId()); | |
614 | - map.put("startDate",DateUtil.getyyyy_MM_dd(model.getStartDate())); | |
615 | - map.put("endDate",DateUtil.getyyyy_MM_dd(model.getEndDate())); | |
616 | - map.put("chargeCount",model.getChargeCount()); | |
617 | - map.put("doctorName",usersService.getUsers(Integer.parseInt(model.getOperateUserId())).getName()); | |
618 | - map.put("created",DateUtil.getyyyy_MM_dd(model.getCreated())); | |
596 | + map.put("id", model.getId()); | |
597 | + map.put("startDate", DateUtil.getyyyy_MM_dd(model.getStartDate())); | |
598 | + map.put("endDate", DateUtil.getyyyy_MM_dd(model.getEndDate())); | |
599 | + map.put("chargeCount", model.getChargeCount()); | |
600 | + map.put("doctorName", usersService.getUsers(Integer.parseInt(model.getOperateUserId())).getName()); | |
601 | + map.put("created", DateUtil.getyyyy_MM_dd(model.getCreated())); | |
619 | 602 | listData.add(map); |
620 | 603 | } |
621 | 604 | } |
622 | 605 | |
623 | 606 | |
624 | 607 | |
625 | 608 | |
626 | 609 | |
627 | 610 | |
628 | 611 | |
629 | 612 | |
630 | 613 | |
... | ... | @@ -624,50 +607,44 @@ |
624 | 607 | |
625 | 608 | /** |
626 | 609 | * 导出 |
610 | + * | |
627 | 611 | * @param id |
628 | 612 | * @param response |
629 | 613 | */ |
630 | - public void exportChargeRecords(String id, HttpServletResponse response) | |
631 | - { | |
614 | + public void exportChargeRecords(String id, HttpServletResponse response) { | |
632 | 615 | |
633 | 616 | try { |
634 | 617 | |
635 | 618 | |
636 | - ChargeRecordQuery chargeRecordQuery = new ChargeRecordQuery(); | |
619 | + ChargeRecordQuery chargeRecordQuery = new ChargeRecordQuery(); | |
637 | 620 | chargeRecordQuery.setId(id); |
638 | 621 | |
639 | 622 | String time = ""; |
640 | - List<ChargeRecordModel> chargeRecordModels = chargeRecordService.queryChargeRecordList(chargeRecordQuery); | |
641 | - if (CollectionUtils.isNotEmpty(chargeRecordModels)) | |
642 | - { | |
623 | + List <ChargeRecordModel> chargeRecordModels = chargeRecordService.queryChargeRecordList(chargeRecordQuery); | |
624 | + if (CollectionUtils.isNotEmpty(chargeRecordModels)) { | |
643 | 625 | time = DateUtil.getyyyy_MM_dd(chargeRecordModels.get(0).getCreated()); |
644 | 626 | } |
645 | 627 | |
646 | - List<Map<String, Object>> listData = new ArrayList<>(); | |
647 | - HealthChargeQuery healthChargeQuery = new HealthChargeQuery(); | |
628 | + List <Map <String, Object>> listData = new ArrayList <>(); | |
629 | + HealthChargeQuery healthChargeQuery = new HealthChargeQuery(); | |
648 | 630 | healthChargeQuery.setChargeRecordId(id); |
649 | - List<HealthChargeModel> list = healthChargeService.queryHealthChargeList(healthChargeQuery); | |
650 | - if (CollectionUtils.isNotEmpty(list)) | |
651 | - { | |
652 | - for (HealthChargeModel model : list) | |
653 | - { | |
631 | + List <HealthChargeModel> list = healthChargeService.queryHealthChargeList(healthChargeQuery); | |
632 | + if (CollectionUtils.isNotEmpty(list)) { | |
633 | + for (HealthChargeModel model : list) { | |
654 | 634 | Map map = getData(model); |
655 | - map.put("time",time); | |
635 | + map.put("time", time); | |
656 | 636 | listData.add(map); |
657 | 637 | } |
658 | 638 | } |
659 | 639 | |
660 | 640 | OutputStream out = response.getOutputStream(); |
661 | - Map<String, String> cnames = new LinkedHashMap<>(); | |
641 | + Map <String, String> cnames = new LinkedHashMap <>(); | |
662 | 642 | cnames.put("userName", "姓名"); |
663 | 643 | cnames.put("age", "年龄"); |
664 | 644 | |
665 | - if (CollectionUtils.isNotEmpty(list) && listData.get(0).get("checkMonth") != null) | |
666 | - { | |
645 | + if (CollectionUtils.isNotEmpty(list) && listData.get(0).get("checkMonth") != null) { | |
667 | 646 | cnames.put("checkMonth", "检查月龄"); |
668 | - } | |
669 | - else | |
670 | - { | |
647 | + } else { | |
671 | 648 | cnames.put("week", "孕周"); |
672 | 649 | } |
673 | 650 | cnames.put("type", "报告类型"); |
... | ... | @@ -678,9 +655,7 @@ |
678 | 655 | response.setCharacterEncoding("UTF-8"); |
679 | 656 | response.setHeader("Content-Disposition", "attachment;fileName=data.xls"); |
680 | 657 | ExcelUtil.toExcel(out, listData, cnames); |
681 | - } | |
682 | - catch (Exception e) | |
683 | - { | |
658 | + } catch (Exception e) { | |
684 | 659 | e.printStackTrace(); |
685 | 660 | } |
686 | 661 | } |