Commit ff68f37af4d99011699f8fe512f25486783b8f0f
Exists in
master
and in
6 other branches
Merge remote-tracking branch 'origin/master'
Showing 16 changed files
- platform-common/src/main/java/com/lyms/platform/common/base/ExceptionHandlerController.java
- platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
- platform-dal/src/main/java/com/lyms/platform/pojo/ArchiveData.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RemoteController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/RiskReportFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MatDeliverFollowAddRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MatDeliverFollowQueryRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/RiskPatientsCountRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IReportService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/SyncDataTaskService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodPressureServiceImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/MongoUtil.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/BuildSerToPatientSerWorker.java
platform-common/src/main/java/com/lyms/platform/common/base/ExceptionHandlerController.java
View file @
ff68f37
... | ... | @@ -151,6 +151,8 @@ |
151 | 151 | Map<String, Object> resultMap = new HashMap<>(); |
152 | 152 | resultMap.put("errorcode", ErrorCodeConstants.SYSTEM_ERROR); |
153 | 153 | resultMap.put("errormsg", "服务器异常."); |
154 | + resultMap.put("message", e.getMessage()); | |
155 | + resultMap.put("exception", e.getClass()); | |
154 | 156 | if(!e.getClass().getSimpleName() .equals("ClientAbortException") ){ |
155 | 157 | ExceptionUtils.catchException(e, "ExceptionHandlerController Exception. queryStr: " +httpServletRequest.getRequestURI() + "?"+httpServletRequest.getQueryString()); |
156 | 158 | } |
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
View file @
ff68f37
... | ... | @@ -1330,20 +1330,28 @@ |
1330 | 1330 | List<Map<String, Date>> restList = new ArrayList<>(); |
1331 | 1331 | if(start != null && end != null) { |
1332 | 1332 | List<Date> dates = getMonthBetween(start, end); |
1333 | - for (int i = 0; i < dates.size(); i++) { | |
1333 | + if(dates.size() == 1) { | |
1334 | 1334 | Map<String, Date> temp = new HashMap<>(); |
1335 | - temp.put("cname", dates.get(i)); | |
1336 | - if(i == 0) { | |
1337 | - temp.put("start", start); | |
1338 | - temp.put("end", dates.get(i + 1)); | |
1339 | - } else if(i == dates.size() - 1) { | |
1340 | - temp.put("start", dates.get(dates.size() - 1)); | |
1341 | - temp.put("end", end); | |
1342 | - } else { | |
1343 | - temp.put("start", dates.get(i)); | |
1344 | - temp.put("end", dates.get(i + 1)); | |
1345 | - } | |
1335 | + temp.put("cname", dates.get(0)); | |
1336 | + temp.put("start", start); | |
1337 | + temp.put("end", end); | |
1346 | 1338 | restList.add(temp); |
1339 | + } else { | |
1340 | + for (int i = 0; i < dates.size(); i++) { | |
1341 | + Map<String, Date> temp = new HashMap<>(); | |
1342 | + temp.put("cname", dates.get(i)); | |
1343 | + if(i == 0) { | |
1344 | + temp.put("start", start); | |
1345 | + temp.put("end", dates.get(i + 1)); | |
1346 | + } else if(i == dates.size() - 1) { | |
1347 | + temp.put("start", dates.get(dates.size() - 1)); | |
1348 | + temp.put("end", end); | |
1349 | + } else { | |
1350 | + temp.put("start", dates.get(i)); | |
1351 | + temp.put("end", dates.get(i + 1)); | |
1352 | + } | |
1353 | + restList.add(temp); | |
1354 | + } | |
1347 | 1355 | } |
1348 | 1356 | } |
1349 | 1357 | return restList; |
platform-dal/src/main/java/com/lyms/platform/pojo/ArchiveData.java
View file @
ff68f37
... | ... | @@ -4,6 +4,8 @@ |
4 | 4 | import com.lyms.platform.common.result.BaseModel; |
5 | 5 | import org.springframework.data.mongodb.core.mapping.Document; |
6 | 6 | |
7 | +import java.util.Date; | |
8 | + | |
7 | 9 | /** |
8 | 10 | * Created by riecard on 2016/10/19. |
9 | 11 | */ |
10 | 12 | |
... | ... | @@ -18,7 +20,15 @@ |
18 | 20 | private String phone; |
19 | 21 | private String hospitalId; |
20 | 22 | private String jsonData; |
23 | + private Date created; | |
21 | 24 | |
25 | + public Date getCreated() { | |
26 | + return created; | |
27 | + } | |
28 | + | |
29 | + public void setCreated(Date created) { | |
30 | + this.created = created; | |
31 | + } | |
22 | 32 | |
23 | 33 | public String getCardNum() { |
24 | 34 | return cardNum; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RemoteController.java
View file @
ff68f37
... | ... | @@ -30,6 +30,7 @@ |
30 | 30 | import java.io.IOException; |
31 | 31 | import java.io.UnsupportedEncodingException; |
32 | 32 | import java.net.URLEncoder; |
33 | +import java.util.Date; | |
33 | 34 | import java.util.HashMap; |
34 | 35 | import java.util.List; |
35 | 36 | import java.util.Map; |
... | ... | @@ -136,6 +137,7 @@ |
136 | 137 | data.setCardNum(cardNum); |
137 | 138 | data.setPhone(phone); |
138 | 139 | data.setJsonData(jsonData); |
140 | + data.setCreated(new Date()); | |
139 | 141 | archiveDataServicer.addOrUpdate(data); |
140 | 142 | } |
141 | 143 | catch (Exception e) |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java
View file @
ff68f37
... | ... | @@ -59,10 +59,21 @@ |
59 | 59 | @RequestMapping(value = "/patients/export", method = RequestMethod.GET) |
60 | 60 | public void patientsExport(String provinceId, String cityId, String areaId, String streetId, Integer statistType, |
61 | 61 | Integer ageType, Integer patientType, Date startDate, Date endDate, HttpServletRequest request, HttpServletResponse response) { |
62 | - reportService.patientsExport(provinceId, cityId, areaId, streetId, statistType, ageType, patientType, startDate, endDate, getUserId(request), response); | |
62 | + reportService.patientsExport(provinceId, cityId, areaId, streetId, statistType, ageType == null ? ageType : ageType + 1, patientType, startDate, endDate, getUserId(request), response); | |
63 | 63 | // reportService.patientsExport(provinceId, cityId, aredId, streetId, statistType, ageType, patientType, startDate, endDate, 1000000185, response); |
64 | 64 | } |
65 | 65 | |
66 | + /** | |
67 | + * 统计报表导出 | |
68 | + * @return | |
69 | + */ | |
70 | + @ResponseBody | |
71 | + @TokenRequired | |
72 | + @RequestMapping(value = "/patients/export2", method = RequestMethod.GET) | |
73 | + public void patientsExport2(String provinceId, String cityId, String areaId, String streetId, Integer ageType, Integer patientType, Date startDate, Date endDate, HttpServletRequest request, HttpServletResponse response) { | |
74 | + reportService.patientsExport2(provinceId, cityId, areaId, streetId, ageType, patientType, startDate, endDate, getUserId(request), response); | |
75 | +// reportService.patientsExport2(provinceId, cityId, areaId, streetId, ageType, patientType, startDate, endDate, 1000000185, response); | |
76 | + } | |
66 | 77 | |
67 | 78 | /** |
68 | 79 | * 未发放优惠券统计 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
ff68f37
... | ... | @@ -148,7 +148,6 @@ |
148 | 148 | //排查本院隐藏建档 |
149 | 149 | patientsQuery.setExtEnable(false); |
150 | 150 | patientsQuery.setBuildTypeNot(1); |
151 | - // patientsQuery.setServiceType(ServiceTypeEnums.ADD_SERVICE.getId()); | |
152 | 151 | patientsQuery.setYn(YnEnums.YES.getId()); |
153 | 152 | patientsQuery.setType(1); |
154 | 153 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/RiskReportFacade.java
View file @
ff68f37
... | ... | @@ -304,182 +304,177 @@ |
304 | 304 | int orgNumTotal = 0; |
305 | 305 | |
306 | 306 | //统计城市和区县表格数据 |
307 | -// if (addrType < 3) | |
308 | -// { | |
309 | -// List<BasicConfig> configList = basicConfigService.queryBasicConfig(basicQuery); | |
310 | -// OrganizationQuery query = new OrganizationQuery(); | |
311 | -// query.setYn(YnEnums.YES.getId()); | |
312 | -// if (CollectionUtils.isNotEmpty(configList)) | |
313 | -// { | |
314 | -// for(BasicConfig c : configList) | |
315 | -// { | |
316 | -// if (addrType == 1) | |
317 | -// { | |
318 | -// query.setCityId(c.getId()); | |
319 | -// } | |
320 | -// else if(addrType == 2) | |
321 | -// { | |
322 | -// query.setAreaId(c.getId()); | |
323 | -// } | |
324 | -// //查询机构数 | |
325 | -// List<Organization> orgs = organizationService.queryOrganization(query); | |
307 | + if (addrType < 3) | |
308 | + { | |
309 | + List<BasicConfig> configList = basicConfigService.queryBasicConfig(basicQuery); | |
310 | + OrganizationQuery query = new OrganizationQuery(); | |
311 | + query.setYn(YnEnums.YES.getId()); | |
312 | + if (CollectionUtils.isNotEmpty(configList)) | |
313 | + { | |
314 | + for(BasicConfig c : configList) | |
315 | + { | |
316 | + if (addrType == 1) | |
317 | + { | |
318 | + query.setCityId(c.getId()); | |
319 | + } | |
320 | + else if(addrType == 2) | |
321 | + { | |
322 | + query.setAreaId(c.getId()); | |
323 | + } | |
324 | + //查询机构数 | |
325 | + List<Organization> orgs = organizationService.queryOrganization(query); | |
326 | + | |
327 | + orgNumTotal += CollectionUtils.isNotEmpty(orgs) ? orgs.size() : 0 ; | |
328 | + | |
329 | + List<String> hids = getConditionHospitalIds(currentUserHospPermissions,orgs); | |
330 | + | |
331 | + for (BasicConfig level : riskLevelConfig) | |
332 | + { | |
333 | + List<String> topList = new ArrayList<>(); | |
334 | + topList.add(String.valueOf(++seq)); | |
335 | + topList.add(c.getName()); | |
336 | + topList.add(orgs == null ? "0" : String.valueOf(orgs.size())); | |
337 | + topList.add(level.getName()); | |
338 | + int riskPatientCount = 0; | |
339 | + | |
340 | + if (StringUtils.isNotEmpty(countRequest.getTimeStart()) ) | |
341 | + { | |
342 | + if (CollectionUtils.isNotEmpty(times)) | |
343 | + { | |
344 | + for (Map<String, Date> time : times) | |
345 | + { | |
346 | + if (CollectionUtils.isNotEmpty(hids)) | |
347 | + { | |
348 | + patientsQuery.setBookbuildingDateStart(time.get("start")); | |
349 | + patientsQuery.setBookbuildingDateEnd(time.get("end")); | |
350 | + | |
351 | + //权限 | |
352 | + patientsQuery.setHospitalList(hids); | |
353 | + | |
354 | + //高危等级 | |
355 | + patientsQuery.setrLevel(level.getId()); | |
356 | + | |
357 | + riskPatientCount = patientsService.queryPatientCount(patientsQuery); | |
358 | + } | |
359 | + topList.add(String.valueOf(riskPatientCount)); | |
360 | + } | |
361 | + } | |
362 | + } | |
363 | + | |
364 | + //权限和筛选条件不未空的时候就查询孕妇高危数量 | |
365 | + if (CollectionUtils.isNotEmpty(hids)) | |
366 | + { | |
367 | + //权限 | |
368 | + patientsQuery.setHospitalList(hids); | |
369 | + | |
370 | + //高危等级 | |
371 | + patientsQuery.setrLevel(level.getId()); | |
372 | + | |
373 | + //单个高危因素孕产妇条数 | |
374 | + riskPatientCount = patientsService.queryPatientCount(patientsQuery); | |
375 | + } | |
376 | + | |
377 | + topList.add(String.valueOf(riskPatientCount)); | |
378 | + result.add(topList); | |
379 | + } | |
380 | + } | |
381 | + } | |
382 | + } | |
383 | + //统计医院的表格数据 | |
384 | + else | |
385 | + { | |
386 | + OrganizationQuery query = new OrganizationQuery(); | |
387 | + query.setYn(YnEnums.YES.getId()); | |
388 | + query.setAreaId(countRequest.getAreaId()); | |
389 | + List<Organization> orgs = organizationService.queryOrganization(query); | |
390 | + if (CollectionUtils.isNotEmpty(orgs)) { | |
391 | + for (Organization org : orgs) { | |
392 | + for (BasicConfig level : riskLevelConfig) { | |
393 | + List<String> topList = new ArrayList<>(); | |
394 | + topList.add(String.valueOf(++seq)); | |
395 | + topList.add(org.getName()); | |
396 | + topList.add(level.getName()); | |
397 | + | |
398 | + int riskPatientCount = 0; | |
399 | + | |
400 | + if (StringUtils.isNotEmpty(countRequest.getTimeStart()) ) | |
401 | + { | |
402 | + if (CollectionUtils.isNotEmpty(times)) | |
403 | + { | |
404 | + for (Map<String, Date> time : times) | |
405 | + { | |
406 | + if (currentUserHospPermissions.contains(String.valueOf(org.getId()))) | |
407 | + { | |
408 | + patientsQuery.setBookbuildingDateStart(time.get("start")); | |
409 | + patientsQuery.setBookbuildingDateEnd(time.get("end")); | |
410 | + | |
411 | + List<String> hids = new ArrayList<>(); | |
412 | + hids.add(String.valueOf(org.getId())); | |
413 | + //权限 | |
414 | + patientsQuery.setHospitalList(hids); | |
415 | + | |
416 | + //高危等级 | |
417 | + patientsQuery.setrLevel(level.getId()); | |
418 | + | |
419 | + riskPatientCount = patientsService.queryPatientCount(patientsQuery); | |
420 | + } | |
421 | + topList.add(String.valueOf(riskPatientCount)); | |
422 | + } | |
423 | + } | |
424 | + } | |
425 | + | |
426 | + if (currentUserHospPermissions.contains(String.valueOf(org.getId()))) | |
427 | + { | |
428 | + List<String> hids = new ArrayList<>(); | |
429 | + hids.add(String.valueOf(org.getId())); | |
430 | + //权限 | |
431 | + patientsQuery.setHospitalList(hids); | |
432 | + //高危等级 | |
433 | + patientsQuery.setrLevel(level.getId()); | |
434 | + //单个高危因素孕产妇条数 | |
435 | + riskPatientCount = patientsService.queryPatientCount(patientsQuery); | |
436 | + } | |
437 | + | |
438 | + topList.add(String.valueOf(riskPatientCount)); | |
439 | + result.add(topList); | |
440 | + } | |
441 | + } | |
442 | + } | |
443 | + } | |
444 | + | |
445 | + //表格合计计算 | |
446 | + if(CollectionUtils.isNotEmpty(result)) | |
447 | + { | |
448 | + List<List<String>> totalAllList = new ArrayList<>(); | |
449 | + for (BasicConfig level : riskLevelConfig) { | |
450 | + List<String> totalList = new ArrayList<>(); | |
451 | + totalList.add(String.valueOf(++seq)); | |
452 | + totalList.add("合计"); | |
453 | + | |
454 | + if (addrType < 3) { | |
455 | + totalList.add(String.valueOf(orgNumTotal)); | |
456 | + } | |
457 | + totalList.add(level.getName()); | |
458 | + | |
459 | + int index = addrType < 3 ? 4 : 3; | |
460 | + | |
461 | + for (int i = index ; i <= (times == null ? 0+index : times.size()+index) ; i++) | |
462 | + { | |
463 | + int total = 0; | |
464 | + for (List<String> items : result) | |
465 | + { | |
466 | + if (items.contains(level.getName())) | |
467 | + { | |
468 | + total+=Integer.valueOf(items.get(i)); | |
469 | + } | |
470 | + } | |
471 | + totalList.add(String.valueOf(total)); | |
472 | + } | |
473 | + totalAllList.add(totalList); | |
474 | + } | |
475 | + result.addAll(totalAllList); | |
476 | + } | |
326 | 477 | // |
327 | -// orgNumTotal += CollectionUtils.isNotEmpty(orgs) ? orgs.size() : 0 ; | |
328 | -// | |
329 | -// List<String> hids = getConditionHospitalIds(currentUserHospPermissions,orgs); | |
330 | -// | |
331 | -// for (BasicConfig level : riskLevelConfig) | |
332 | -// { | |
333 | -// | |
334 | -// List<String> topList = new ArrayList<>(); | |
335 | -// topList.add(String.valueOf(++seq)); | |
336 | -// topList.add(c.getName()); | |
337 | -// topList.add(orgs == null ? "0" : String.valueOf(orgs.size())); | |
338 | -// topList.add(level.getName()); | |
339 | -// int riskPatientCount = 0; | |
340 | -// | |
341 | -// if (StringUtils.isNotEmpty(countRequest.getTimeStart()) ) | |
342 | -// { | |
343 | -// if (CollectionUtils.isNotEmpty(times)) | |
344 | -// { | |
345 | -// for (Map<String, Date> time : times) | |
346 | -// { | |
347 | -// if (CollectionUtils.isNotEmpty(hids)) | |
348 | -// { | |
349 | -// patientsQuery.setBookbuildingDateStart(time.get("start")); | |
350 | -// patientsQuery.setBookbuildingDateEnd(time.get("end")); | |
351 | -// | |
352 | -// //权限 | |
353 | -// patientsQuery.setHospitalList(hids); | |
354 | -// | |
355 | -// //高危等级 | |
356 | -// patientsQuery.setrLevel(level.getId()); | |
357 | -// | |
358 | -// riskPatientCount = patientsService.queryPatientCount(patientsQuery); | |
359 | -// } | |
360 | -// topList.add(String.valueOf(riskPatientCount)); | |
361 | -// } | |
362 | -// } | |
363 | -// } | |
364 | -// | |
365 | -// | |
366 | -// //权限和筛选条件不未空的时候就查询孕妇高危数量 | |
367 | -// if (CollectionUtils.isNotEmpty(hids)) | |
368 | -// { | |
369 | -// | |
370 | -// //权限 | |
371 | -// patientsQuery.setHospitalList(hids); | |
372 | -// | |
373 | -// //高危等级 | |
374 | -// patientsQuery.setrLevel(level.getId()); | |
375 | -// | |
376 | -// | |
377 | -// //单个高危因素孕产妇条数 | |
378 | -// riskPatientCount = patientsService.queryPatientCount(patientsQuery); | |
379 | -// } | |
380 | -// | |
381 | -// topList.add(String.valueOf(riskPatientCount)); | |
382 | -// result.add(topList); | |
383 | -// } | |
384 | -// } | |
385 | -// } | |
386 | -// } | |
387 | -// //统计医院的表格数据 | |
388 | -// else | |
389 | -// { | |
390 | -// OrganizationQuery query = new OrganizationQuery(); | |
391 | -// query.setYn(YnEnums.YES.getId()); | |
392 | -// query.setAreaId(countRequest.getAreaId()); | |
393 | -// List<Organization> orgs = organizationService.queryOrganization(query); | |
394 | -// if (CollectionUtils.isNotEmpty(orgs)) { | |
395 | -// for (Organization org : orgs) { | |
396 | -// for (BasicConfig level : riskLevelConfig) { | |
397 | -// List<String> topList = new ArrayList<>(); | |
398 | -// topList.add(String.valueOf(++seq)); | |
399 | -// topList.add(org.getName()); | |
400 | -// topList.add(level.getName()); | |
401 | -// | |
402 | -// int riskPatientCount = 0; | |
403 | -// | |
404 | -// if (StringUtils.isNotEmpty(countRequest.getTimeStart()) ) | |
405 | -// { | |
406 | -// if (CollectionUtils.isNotEmpty(times)) | |
407 | -// { | |
408 | -// for (Map<String, Date> time : times) | |
409 | -// { | |
410 | -// if (currentUserHospPermissions.contains(String.valueOf(org.getId()))) | |
411 | -// { | |
412 | -// patientsQuery.setBookbuildingDateStart(time.get("start")); | |
413 | -// patientsQuery.setBookbuildingDateEnd(time.get("end")); | |
414 | -// | |
415 | -// List<String> hids = new ArrayList<>(); | |
416 | -// hids.add(String.valueOf(org.getId())); | |
417 | -// //权限 | |
418 | -// patientsQuery.setHospitalList(hids); | |
419 | -// | |
420 | -// //高危等级 | |
421 | -// patientsQuery.setrLevel(level.getId()); | |
422 | -// | |
423 | -// riskPatientCount = patientsService.queryPatientCount(patientsQuery); | |
424 | -// } | |
425 | -// topList.add(String.valueOf(riskPatientCount)); | |
426 | -// } | |
427 | -// } | |
428 | -// } | |
429 | -// | |
430 | -// if (currentUserHospPermissions.contains(String.valueOf(org.getId()))) | |
431 | -// { | |
432 | -// List<String> hids = new ArrayList<>(); | |
433 | -// hids.add(String.valueOf(org.getId())); | |
434 | -// //权限 | |
435 | -// patientsQuery.setHospitalList(hids); | |
436 | -// //高危等级 | |
437 | -// patientsQuery.setrLevel(level.getId()); | |
438 | -// //单个高危因素孕产妇条数 | |
439 | -// riskPatientCount = patientsService.queryPatientCount(patientsQuery); | |
440 | -// } | |
441 | -// | |
442 | -// topList.add(String.valueOf(riskPatientCount)); | |
443 | -// result.add(topList); | |
444 | -// } | |
445 | -// } | |
446 | -// } | |
447 | -// } | |
448 | -// | |
449 | -// //表格合计计算 | |
450 | -// if(CollectionUtils.isNotEmpty(result)) | |
451 | -// { | |
452 | -// | |
453 | -// List<List<String>> totalAllList = new ArrayList<>(); | |
454 | -// for (BasicConfig level : riskLevelConfig) { | |
455 | -// List<String> totalList = new ArrayList<>(); | |
456 | -// totalList.add(String.valueOf(++seq)); | |
457 | -// totalList.add("合计"); | |
458 | -// | |
459 | -// if (addrType < 3) { | |
460 | -// totalList.add(String.valueOf(orgNumTotal)); | |
461 | -// } | |
462 | -// totalList.add(level.getName()); | |
463 | -// | |
464 | -// int index = addrType < 3 ? 4 : 3; | |
465 | -// | |
466 | -// for (int i = index ; i <= (times == null ? 0+index : times.size()+index) ; i++) | |
467 | -// { | |
468 | -// int total = 0; | |
469 | -// for (List<String> items : result) | |
470 | -// { | |
471 | -// if (items.contains(level.getName())) | |
472 | -// { | |
473 | -// total+=Integer.valueOf(items.get(i)); | |
474 | -// } | |
475 | -// } | |
476 | -// totalList.add(String.valueOf(total)); | |
477 | -// } | |
478 | -// totalAllList.add(totalList); | |
479 | -// } | |
480 | -// result.addAll(totalAllList); | |
481 | -// } | |
482 | -// | |
483 | 478 | // for (List<String> items : result) |
484 | 479 | // { |
485 | 480 | // for (String item : items) |
... | ... | @@ -558,10 +553,6 @@ |
558 | 553 | map.put("data",items); |
559 | 554 | series.add(map); |
560 | 555 | } |
561 | - | |
562 | - //计算占比 | |
563 | - List<Map<String,Object>> bfbItem = handzb(series); | |
564 | - series.addAll(bfbItem); | |
565 | 556 | } |
566 | 557 | } |
567 | 558 | else if (addrType == 3) |
... | ... | @@ -607,10 +598,6 @@ |
607 | 598 | } |
608 | 599 | series.add(map); |
609 | 600 | } |
610 | - | |
611 | - //计算占比 | |
612 | - List<Map<String,Object>> bfbItem = handzb(series); | |
613 | - series.addAll(bfbItem); | |
614 | 601 | } |
615 | 602 | } |
616 | 603 | datas.put("series",series); |
... | ... | @@ -1005,6 +992,92 @@ |
1005 | 992 | |
1006 | 993 | return hids; |
1007 | 994 | } |
995 | + | |
996 | + | |
997 | + | |
998 | + //计算占比 | |
999 | +// List<Map<String,Object>> proportion = handzb(series); | |
1000 | +// series.addAll(proportion); | |
1001 | + | |
1002 | + | |
1003 | + //计算环比 | |
1004 | +// List<Map<String,Object>> mom = new ArrayList<>(); | |
1005 | +// | |
1006 | +// //环比 1月 2 季度 3半年 4年 | |
1007 | +// Integer momType = countRequest.getMomType(); | |
1008 | +// | |
1009 | +// String requestStart = countRequest.getTimeStart(); | |
1010 | +// Date requestStartDate = DateUtil.parseYMD(requestStart); | |
1011 | +// | |
1012 | +// Date previousMomStart = null; | |
1013 | +// Date previousMomEnd = null; | |
1014 | +// | |
1015 | +// Date momStart = null; | |
1016 | +// Date momEnd = null; | |
1017 | +// if (momType == 1) | |
1018 | +// { | |
1019 | +// momStart = DateUtil.getMonthDay(requestStartDate, 0, 1); | |
1020 | +// momEnd = DateUtil.addDay(DateUtil.getMonthDay(requestStartDate, 0, 0), 1); | |
1021 | +// | |
1022 | +// previousMomStart = DateUtil.addMonth(momStart, -1); | |
1023 | +// previousMomEnd = DateUtil.addMonth(momEnd, -1); | |
1024 | +// | |
1025 | +// System.out.println(DateUtil.getyyyy_MM_dd(momStart)); | |
1026 | +// System.out.println(DateUtil.getyyyy_MM_dd(momEnd)); | |
1027 | +// System.out.println(DateUtil.getyyyy_MM_dd(previousMomStart)); | |
1028 | +// System.out.println(DateUtil.getyyyy_MM_dd(previousMomEnd)); | |
1029 | +// } | |
1030 | +// | |
1031 | +// OrganizationQuery idQuery = new OrganizationQuery(); | |
1032 | +// idQuery.setYn(YnEnums.YES.getId()); | |
1033 | +// | |
1034 | +// for (BasicConfig config : riskLevelConfig) | |
1035 | +// { | |
1036 | +// | |
1037 | +// Map<String,Object> momMap = new HashMap<>(); | |
1038 | +// momMap.put("name",config.getName()); | |
1039 | +// momMap.put("type", "line"); | |
1040 | +// | |
1041 | +// List<String> momParcent = new ArrayList<>(); | |
1042 | +// for (Map<String, Object> addr : list) | |
1043 | +// { | |
1044 | +// | |
1045 | +// String id = String.valueOf(addr.get("id")); | |
1046 | +// if (addrType == 1) | |
1047 | +// { | |
1048 | +// idQuery.setCityId(id); | |
1049 | +// } | |
1050 | +// else if(addrType == 2) | |
1051 | +// { | |
1052 | +// idQuery.setAreaId(id); | |
1053 | +// } | |
1054 | +// | |
1055 | +// //查询机构数 | |
1056 | +// List<Organization> orgs = organizationService.queryOrganization(idQuery); | |
1057 | +// List<String> hids = getConditionHospitalIds(currentUserHospPermissions, orgs); | |
1058 | +// | |
1059 | +// patientsQuery.setHospitalList(hids); | |
1060 | +// //高危等级 | |
1061 | +// patientsQuery.setrLevel(config.getId()); | |
1062 | +// patientsQuery.setLastCTimeStart(momStart); | |
1063 | +// patientsQuery.setLastCTimeEnd(momEnd); | |
1064 | +// //当前值 | |
1065 | +// int num = patientsService.queryPatientCount(patientsQuery); | |
1066 | +// | |
1067 | +// patientsQuery.setLastCTimeStart(previousMomStart); | |
1068 | +// patientsQuery.setLastCTimeEnd(previousMomEnd); | |
1069 | +// //上期值 | |
1070 | +// int num1 = patientsService.queryPatientCount(patientsQuery); | |
1071 | +// String momValue = MathUtil.getProportion(num-num1,num1); | |
1072 | +// momParcent.add(momValue); | |
1073 | +// } | |
1074 | +// momMap.put("data",momParcent); | |
1075 | +// | |
1076 | +// mom.add(momMap); | |
1077 | +// } | |
1078 | +// | |
1079 | +// series.addAll(mom); | |
1080 | + | |
1008 | 1081 | |
1009 | 1082 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MatDeliverFollowAddRequest.java
View file @
ff68f37
... | ... | @@ -143,11 +143,11 @@ |
143 | 143 | /** |
144 | 144 | * 乳房 |
145 | 145 | */ |
146 | - private String breast; | |
146 | + private Integer breast; | |
147 | 147 | /** |
148 | 148 | * 恶露 |
149 | 149 | */ |
150 | - private String lochia; | |
150 | + private Integer lochia; | |
151 | 151 | /** |
152 | 152 | * 子宫 |
153 | 153 | */ |
... | ... | @@ -155,7 +155,7 @@ |
155 | 155 | /** |
156 | 156 | * 伤口 |
157 | 157 | */ |
158 | - private String wound; | |
158 | + private Integer wound; | |
159 | 159 | /** |
160 | 160 | * 其他 |
161 | 161 | */ |
... | ... | @@ -203,6 +203,30 @@ |
203 | 203 | return matdeliverFollowModel; |
204 | 204 | } |
205 | 205 | |
206 | + public Integer getBreast() { | |
207 | + return breast; | |
208 | + } | |
209 | + | |
210 | + public void setBreast(Integer breast) { | |
211 | + this.breast = breast; | |
212 | + } | |
213 | + | |
214 | + public Integer getLochia() { | |
215 | + return lochia; | |
216 | + } | |
217 | + | |
218 | + public void setLochia(Integer lochia) { | |
219 | + this.lochia = lochia; | |
220 | + } | |
221 | + | |
222 | + public Integer getWound() { | |
223 | + return wound; | |
224 | + } | |
225 | + | |
226 | + public void setWound(Integer wound) { | |
227 | + this.wound = wound; | |
228 | + } | |
229 | + | |
206 | 230 | public Date getUpdateDate() { |
207 | 231 | return updateDate; |
208 | 232 | } |
209 | 233 | |
... | ... | @@ -475,36 +499,12 @@ |
475 | 499 | this.bpk = bpk; |
476 | 500 | } |
477 | 501 | |
478 | - public String getBreast() { | |
479 | - return breast; | |
480 | - } | |
481 | - | |
482 | - public void setBreast(String breast) { | |
483 | - this.breast = breast; | |
484 | - } | |
485 | - | |
486 | - public String getLochia() { | |
487 | - return lochia; | |
488 | - } | |
489 | - | |
490 | - public void setLochia(String lochia) { | |
491 | - this.lochia = lochia; | |
492 | - } | |
493 | - | |
494 | 502 | public String getMatrix() { |
495 | 503 | return matrix; |
496 | 504 | } |
497 | 505 | |
498 | 506 | public void setMatrix(String matrix) { |
499 | 507 | this.matrix = matrix; |
500 | - } | |
501 | - | |
502 | - public String getWound() { | |
503 | - return wound; | |
504 | - } | |
505 | - | |
506 | - public void setWound(String wound) { | |
507 | - this.wound = wound; | |
508 | 508 | } |
509 | 509 | |
510 | 510 | public String getOtherDesc() { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MatDeliverFollowQueryRequest.java
View file @
ff68f37
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/RiskPatientsCountRequest.java
View file @
ff68f37
... | ... | @@ -45,8 +45,8 @@ |
45 | 45 | //对比指标 1 占比 2 环比 |
46 | 46 | private Integer compareType; |
47 | 47 | |
48 | - //环比 周 1月 2 季度 3半年 4年 | |
49 | - private Integer hbType; | |
48 | + //环比 1月 2 季度 3半年 4年 | |
49 | + private Integer momType; | |
50 | 50 | |
51 | 51 | //孕周 0 全部孕周 1:孕12周前 2:13-19 3:20-25 4:26-30 5:31-36 6:37-40 7:40-分娩前 |
52 | 52 | private Integer week; |
53 | 53 | |
... | ... | @@ -75,12 +75,12 @@ |
75 | 75 | this.queryStreetId = queryStreetId; |
76 | 76 | } |
77 | 77 | |
78 | - public Integer getHbType() { | |
79 | - return hbType; | |
78 | + public Integer getMomType() { | |
79 | + return momType; | |
80 | 80 | } |
81 | 81 | |
82 | - public void setHbType(Integer hbType) { | |
83 | - this.hbType = hbType; | |
82 | + public void setMomType(Integer momType) { | |
83 | + this.momType = momType; | |
84 | 84 | } |
85 | 85 | |
86 | 86 | public Integer getWeek() { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IReportService.java
View file @
ff68f37
... | ... | @@ -101,5 +101,7 @@ |
101 | 101 | BaseObjectResponse patients(String provinceId, String cityId, String aredId, String streetId, Integer statistType, Integer statistVal, Integer ageType, Integer patientType, Date startDate, Date endDate, Integer userId); |
102 | 102 | |
103 | 103 | void patientsExport(String provinceId, String cityId, String aredId, String streetId, Integer statistType, Integer ageType, Integer patientType, Date startDate, Date endDate, Integer userId, HttpServletResponse response); |
104 | + | |
105 | + void patientsExport2(String provinceId, String cityId, String areaId, String streetId, Integer ageType, Integer patientType, Date startDate, Date endDate, Integer userId, HttpServletResponse response); | |
104 | 106 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/SyncDataTaskService.java
View file @
ff68f37
... | ... | @@ -56,6 +56,7 @@ |
56 | 56 | urls.put("area-kaifeng-api.healthbaby.com.cn:12356","开封"); |
57 | 57 | urls.put("area-weixian-api.healthbaby.com.cn:12356","威县"); |
58 | 58 | urls.put("area-zhucheng-api.healthbaby.com.cn:12356","诸城市妇幼保健院"); |
59 | + urls.put("area-weihai.healthbaby.com.cn:12356","威海"); | |
59 | 60 | } |
60 | 61 | |
61 | 62 | @Autowired |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodPressureServiceImpl.java
View file @
ff68f37
... | ... | @@ -53,7 +53,8 @@ |
53 | 53 | temp.put("ssy", bloodPressure.getSsy()); |
54 | 54 | temp.put("pulse", bloodPressure.getPulse()); |
55 | 55 | temp.put("hospitalId", hospitalId); |
56 | - if(StringUtils.isEmpty(bloodPressure.getId())) { | |
56 | + BloodPressure bp = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(bloodPressure.getParentId()).and("yn").ne(0)), BloodPressure.class); | |
57 | + if(bp == null) { | |
57 | 58 | String parentId = mongoUtil.doHidePatient(bloodPressure.getParentId(), hospitalId); |
58 | 59 | bloodPressure.setParentId(parentId); |
59 | 60 | bloodPressure.setYn(YnEnums.YES.getId()); |
... | ... | @@ -65,7 +66,7 @@ |
65 | 66 | bloodPressure.setInfos(infos); |
66 | 67 | bloodPressureService.add(bloodPressure); |
67 | 68 | } else { |
68 | - Map<String, Map<String, Object>> infos = mongoTemplate.findById(bloodPressure.getId(), BloodPressure.class).getInfos(); | |
69 | + Map<String, Map<String, Object>> infos = bp.getInfos(); | |
69 | 70 | infos.put(DateUtil.getyyyy_MM_dd(new Date()), temp); |
70 | 71 | bloodPressureService.update(bloodPressure); |
71 | 72 | } |
... | ... | @@ -156,7 +157,6 @@ |
156 | 157 | pulse.add(infos.containsKey(date) ? (Integer) infos.get(date).get("pulse") : 0); |
157 | 158 | } |
158 | 159 | } |
159 | - | |
160 | 160 | return RespBuilder.buildSuccess("xyInfos", xyInfos, "szyMin", szyMin, "ssyMax", ssyMax, "ssy", ssy, "szy", szy, "pulse", pulse); |
161 | 161 | } |
162 | 162 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
ff68f37
... | ... | @@ -439,10 +439,17 @@ |
439 | 439 | } |
440 | 440 | |
441 | 441 | private void setCountList(List<List<String>> tabList, List<String> countList, int index) { |
442 | - countList.add(tabList.size() + ""); | |
443 | - countList.add("合计"); | |
444 | - countList.add("建档总数"); | |
445 | 442 | if(tabList.size() > 1) { |
443 | + countList.add(tabList.size() + ""); | |
444 | + countList.add("合计"); | |
445 | + if(index == 4) { | |
446 | + int orgCount = 0; | |
447 | + for (int i = 1; i < tabList.size(); i++) { | |
448 | + orgCount += Integer.parseInt(tabList.get(i).get(2)); | |
449 | + } | |
450 | + countList.add(orgCount + ""); | |
451 | + } | |
452 | + countList.add("建档总数"); | |
446 | 453 | for (int i = index; i < tabList.get(0).size(); i++) { |
447 | 454 | int count = 0; |
448 | 455 | for (int j = 1; j < tabList.size(); j++) { |
449 | 456 | |
... | ... | @@ -450,10 +457,8 @@ |
450 | 457 | } |
451 | 458 | countList.add(count + ""); |
452 | 459 | } |
453 | - | |
460 | + tabList.add(countList); | |
454 | 461 | } |
455 | - tabList.add(countList); | |
456 | - | |
457 | 462 | } |
458 | 463 | |
459 | 464 | private void setTabListInfo(List<List<String>> tabList, int index) { |
... | ... | @@ -531,7 +536,6 @@ |
531 | 536 | cnames.put("bookbuildingDate", "建档日期"); |
532 | 537 | cnames.put("doctorName", "建档医生"); |
533 | 538 | |
534 | - | |
535 | 539 | List<Map<String,Object>> results = new ArrayList<>(); |
536 | 540 | if(org.apache.commons.collections.CollectionUtils.isNotEmpty(patients)) { |
537 | 541 | int i = 0; |
... | ... | @@ -559,6 +563,29 @@ |
559 | 563 | } |
560 | 564 | } |
561 | 565 | |
566 | + ResponseUtil.responseExcel(cnames, results, response); | |
567 | + } | |
568 | + | |
569 | + @Override | |
570 | + public void patientsExport2(String provinceId, String cityId, String areaId, String streetId, Integer ageType, Integer patientType, Date startDate, Date endDate, Integer userId, HttpServletResponse response) { | |
571 | + Map<String, Object> restMap = (Map<String, Object>) patients(provinceId, cityId, areaId, streetId, 1, 1, ageType, patientType, startDate, endDate, userId).getData(); | |
572 | + List<List<String>> tabList = (List<List<String>>) restMap.get("tabList"); | |
573 | + List<String> titles = tabList.get(0); | |
574 | + Map<String, String> cnames = new LinkedHashMap<>(); | |
575 | + for (int i = 0; i < titles.size(); i++) { | |
576 | + cnames.put(i + "", titles.get(i)); | |
577 | + } | |
578 | + List<Map<String,Object>> results = new ArrayList<>(); | |
579 | + if(tabList.size() > 1) { | |
580 | + for (int i = 1; i < tabList.size(); i++) { | |
581 | + Map<String, Object> result = new LinkedHashMap<>(); | |
582 | + List<String> list = tabList.get(i); | |
583 | + for (int j = 0; j < list.size(); j++) { | |
584 | + result.put(j + "", list.get(j)); | |
585 | + } | |
586 | + results.add(result); | |
587 | + } | |
588 | + } | |
562 | 589 | ResponseUtil.responseExcel(cnames, results, response); |
563 | 590 | } |
564 | 591 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/MongoUtil.java
View file @
ff68f37
... | ... | @@ -546,15 +546,18 @@ |
546 | 546 | /** |
547 | 547 | * 获取高危等级(颜色) |
548 | 548 | */ |
549 | - public List<String> getRiskLevels(Patients p) { | |
550 | - List<String> colors = new ArrayList<>(); | |
549 | + public List<Map<String, Object>> getRiskLevels(Patients p) { | |
550 | + List<Map<String, Object>> colors = new ArrayList<>(); | |
551 | 551 | if (p != null && StringUtils.isNotEmpty(p.getRiskLevelId())) { |
552 | 552 | List<String> ids = JsonUtil.jkstr2Obj(p.getRiskLevelId(), List.class); |
553 | 553 | if(CollectionUtils.isNotEmpty(ids)) { |
554 | 554 | for (String id : ids) { |
555 | 555 | String name = findName(id); |
556 | 556 | if(StringUtils.isNotEmpty(name)) { |
557 | - colors.add( "risk_" + RiskDefaultTypeEnum.getColor(name)); | |
557 | + Map<String, Object> temp = new HashMap<>(); | |
558 | + temp.put("color", "risk_" + RiskDefaultTypeEnum.getColor(name)); | |
559 | + temp.put("name", name.replace("预警", "")); | |
560 | + colors.add(temp); | |
558 | 561 | } |
559 | 562 | } |
560 | 563 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/BuildSerToPatientSerWorker.java
View file @
ff68f37
... | ... | @@ -83,7 +83,7 @@ |
83 | 83 | patientsMap.put(pt.getId(),1); |
84 | 84 | } |
85 | 85 | if (pt.getServiceType() == null) { |
86 | - System.out.println("跳过数据:"+pt.getId()); | |
86 | + System.out.println("服务类型不存在跳过数据:"+pt.getId()); | |
87 | 87 | continue; |
88 | 88 | } |
89 | 89 | |
... | ... | @@ -143,7 +143,6 @@ |
143 | 143 | |
144 | 144 | List<PatientService> patientServices = patientServiceService.queryPatientService(patientQuery); |
145 | 145 | if (CollectionUtils.isNotEmpty(patientServices)) { |
146 | - System.out.println("增量查询数据存在:"+pt.getId()); | |
147 | 146 | continue; |
148 | 147 | } |
149 | 148 | } |