Commit 302af570e54b17cbd21a64a7d32b0177f8b28cf1
Exists in
master
and in
6 other branches
Merge remote-tracking branch 'origin/master'
Showing 4 changed files
- platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.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/RiskPatientsCountRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/MongoUtil.java
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
View file @
302af57
... | ... | @@ -211,6 +211,19 @@ |
211 | 211 | } |
212 | 212 | } |
213 | 213 | |
214 | + public static Date getYear() | |
215 | + { | |
216 | + lock.lock(); | |
217 | + try { | |
218 | + String year = yyyy.format(new Date()); | |
219 | + return yyyy.parse(year); | |
220 | + } catch (Exception e) { | |
221 | + return null; | |
222 | + }finally { | |
223 | + lock.unlock(); | |
224 | + } | |
225 | + } | |
226 | + | |
214 | 227 | public static Date getNextYearDate(String s) { |
215 | 228 | if (s == null) { |
216 | 229 | return null; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/RiskReportFacade.java
View file @
302af57
... | ... | @@ -239,12 +239,8 @@ |
239 | 239 | List<String> currentUserHospPermissions = areaCountFacade.getCurrentUserHospPermissions(userId, countRequest.getProvinceId(), |
240 | 240 | countRequest.getCityId(), countRequest.getAreaId()); |
241 | 241 | |
242 | - //孕妇基础查询对象 | |
243 | - PatientsQuery patientsQuery = new PatientsQuery(); | |
244 | - patientsQuery.setYn(YnEnums.YES.getId()); | |
242 | + PatientsQuery patientsQuery = getRequestQuery(countRequest); | |
245 | 243 | |
246 | - getRequestQuery(patientsQuery,countRequest); | |
247 | - | |
248 | 244 | List<Map<String, Date>> times = null; |
249 | 245 | |
250 | 246 | if (StringUtils.isNotEmpty(countRequest.getTimeStart()) && StringUtils.isNotEmpty(countRequest.getTimeEnd())) |
251 | 247 | |
252 | 248 | |
253 | 249 | |
... | ... | @@ -267,26 +263,26 @@ |
267 | 263 | basicQuery.setTypeId("b7ea005c-dfac-4c2a-bdae-25239b3f44fd"); |
268 | 264 | |
269 | 265 | |
270 | - | |
271 | - | |
272 | - String addressId = ""; | |
266 | + String parentId = ""; | |
267 | + String childId = ""; | |
273 | 268 | if (StringUtils.isNotEmpty(countRequest.getProvinceId())) |
274 | 269 | { |
275 | 270 | basicQuery.setParentId(countRequest.getProvinceId()); |
276 | 271 | countRequest.setExportType(1); |
277 | - | |
278 | - addressId = countRequest.getProvinceId(); | |
272 | + parentId = countRequest.getProvinceId(); | |
273 | + childId = countRequest.getQueryCityId(); | |
279 | 274 | } |
280 | 275 | |
281 | 276 | if (StringUtils.isNotEmpty(countRequest.getCityId())) |
282 | 277 | { |
283 | 278 | basicQuery.setParentId(countRequest.getCityId()); |
284 | 279 | countRequest.setExportType(2); |
285 | - addressId = countRequest.getCityId(); | |
280 | + parentId = countRequest.getCityId(); | |
281 | + childId = countRequest.getQueryAreaId(); | |
286 | 282 | } |
287 | 283 | |
288 | 284 | //获取地址列表 |
289 | - List<Map<String, Object>> list = mongoUtil.getChilds(addressId); | |
285 | + List<Map<String, Object>> list = mongoUtil.getChilds(parentId,childId); | |
290 | 286 | |
291 | 287 | if (StringUtils.isNotEmpty(countRequest.getAreaId())) |
292 | 288 | { |
293 | 289 | |
... | ... | @@ -295,37 +291,8 @@ |
295 | 291 | } |
296 | 292 | |
297 | 293 | int addrType = countRequest.getExportType(); |
294 | + List<String> title = getTableDataTitle(addrType,times); | |
298 | 295 | |
299 | - List<String> title = new ArrayList<>(); | |
300 | - title.add("序号"); | |
301 | - if (addrType == 1) | |
302 | - { | |
303 | - title.add("地市名称"); | |
304 | - } | |
305 | - else if(addrType == 2) | |
306 | - { | |
307 | - title.add("区县名称"); | |
308 | - } | |
309 | - else | |
310 | - { | |
311 | - title.add("医院名称"); | |
312 | - } | |
313 | - | |
314 | - if (addrType < 3) | |
315 | - { | |
316 | - title.add("机构数"); | |
317 | - } | |
318 | - title.add("统计指标(人)"); | |
319 | - | |
320 | - | |
321 | - | |
322 | - if (CollectionUtils.isNotEmpty(times)) { | |
323 | - for (Map<String, Date> time : times) { | |
324 | - title.add(DateUtil.getyyyy_mm(time.get("cname"))); | |
325 | - } | |
326 | - } | |
327 | - | |
328 | - title.add("合计"); | |
329 | 296 | result.add(title); |
330 | 297 | |
331 | 298 | |
332 | 299 | |
333 | 300 | |
334 | 301 | |
335 | 302 | |
... | ... | @@ -614,14 +581,16 @@ |
614 | 581 | for (Organization org : orgs) |
615 | 582 | { |
616 | 583 | xAxis.add(org.getName()); |
584 | + } | |
617 | 585 | |
586 | + for (BasicConfig config : riskLevelConfig) | |
587 | + { | |
618 | 588 | Map<String,Object> map = new HashMap(); |
619 | - map.put("name",org.getName()); | |
589 | + map.put("name",config.getName()); | |
620 | 590 | map.put("type", "bar"); |
621 | 591 | List<String> items = new ArrayList<>(); |
622 | - for (BasicConfig config : riskLevelConfig) | |
592 | + for (Organization org : orgs) | |
623 | 593 | { |
624 | - | |
625 | 594 | patientsQuery.setHospitalId(String.valueOf(org.getId())); |
626 | 595 | patientsQuery.setHospitalList(null); |
627 | 596 | //高危等级 |
628 | 597 | |
629 | 598 | |
630 | 599 | |
... | ... | @@ -643,14 +612,57 @@ |
643 | 612 | } |
644 | 613 | |
645 | 614 | /** |
615 | + * 表格标题 | |
616 | + * @param addrType | |
617 | + * @return | |
618 | + */ | |
619 | + private List<String> getTableDataTitle(int addrType,List<Map<String, Date>> times) { | |
620 | + | |
621 | + List<String> title = new ArrayList<>(); | |
622 | + title.add("序号"); | |
623 | + if (addrType == 1) | |
624 | + { | |
625 | + title.add("地市名称"); | |
626 | + } | |
627 | + else if(addrType == 2) | |
628 | + { | |
629 | + title.add("区县名称"); | |
630 | + } | |
631 | + else | |
632 | + { | |
633 | + title.add("医院名称"); | |
634 | + } | |
635 | + | |
636 | + if (addrType < 3) | |
637 | + { | |
638 | + title.add("机构数"); | |
639 | + } | |
640 | + title.add("统计指标(人)"); | |
641 | + | |
642 | + if (CollectionUtils.isNotEmpty(times)) { | |
643 | + for (Map<String, Date> time : times) { | |
644 | + title.add(DateUtil.getyyyy_mm(time.get("cname"))); | |
645 | + } | |
646 | + } | |
647 | + | |
648 | + title.add("合计"); | |
649 | + | |
650 | + return title; | |
651 | + } | |
652 | + | |
653 | + /** | |
646 | 654 | * 查询条件 |
647 | - * @param patientsQuery | |
648 | 655 | * @param countRequest |
649 | 656 | */ |
650 | 657 | |
651 | - private void getRequestQuery(PatientsQuery patientsQuery, RiskPatientsCountRequest countRequest) { | |
652 | - Date currentDate = new Date(); | |
658 | + private PatientsQuery getRequestQuery(RiskPatientsCountRequest countRequest) { | |
653 | 659 | |
660 | + //孕妇基础查询对象 | |
661 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
662 | + patientsQuery.setYn(YnEnums.YES.getId()); | |
663 | + | |
664 | + Date currentDate = DateUtil.getYear(); | |
665 | + | |
654 | 666 | //0:全部 1:20岁一下 2:25-30 3:30-40 4:40岁以上 |
655 | 667 | if (countRequest.getAgeRange() != null && countRequest.getAgeRange() != 0) |
656 | 668 | { |
657 | 669 | |
... | ... | @@ -673,10 +685,10 @@ |
673 | 685 | s = 41;e=100; |
674 | 686 | } |
675 | 687 | |
676 | - Date start = DateUtil.addMonth(currentDate, s); | |
688 | + Date start = DateUtil.addYear(currentDate, -s); | |
677 | 689 | patientsQuery.setBirthEnd(start); |
678 | 690 | |
679 | - Date end = DateUtil.addDay(DateUtil.addYear(currentDate, e - 1), 1); | |
691 | + Date end = DateUtil.addYear(currentDate, -e); | |
680 | 692 | patientsQuery.setBirthStart(end); |
681 | 693 | } |
682 | 694 | |
... | ... | @@ -730,6 +742,7 @@ |
730 | 742 | //建档类型 |
731 | 743 | patientsQuery.setBuildTypeList(buildType); |
732 | 744 | |
745 | + return patientsQuery; | |
733 | 746 | } |
734 | 747 | |
735 | 748 | public void exportAreaHighRisk(RiskPatientsCountRequest countRequest, |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/RiskPatientsCountRequest.java
View file @
302af57
... | ... | @@ -21,6 +21,11 @@ |
21 | 21 | private String areaId; |
22 | 22 | private String streetId; |
23 | 23 | |
24 | + //页面查询地址条件 | |
25 | + private String queryCityId; | |
26 | + private String queryAreaId; | |
27 | + private String queryStreetId; | |
28 | + | |
24 | 29 | //医院id |
25 | 30 | private String hospitalId; |
26 | 31 | |
... | ... | @@ -45,6 +50,30 @@ |
45 | 50 | |
46 | 51 | //孕周 0 全部孕周 1:孕12周前 2:13-19 3:20-25 4:26-30 5:31-36 6:37-40 7:40-分娩前 |
47 | 52 | private Integer week; |
53 | + | |
54 | + public String getQueryCityId() { | |
55 | + return queryCityId; | |
56 | + } | |
57 | + | |
58 | + public void setQueryCityId(String queryCityId) { | |
59 | + this.queryCityId = queryCityId; | |
60 | + } | |
61 | + | |
62 | + public String getQueryAreaId() { | |
63 | + return queryAreaId; | |
64 | + } | |
65 | + | |
66 | + public void setQueryAreaId(String queryAreaId) { | |
67 | + this.queryAreaId = queryAreaId; | |
68 | + } | |
69 | + | |
70 | + public String getQueryStreetId() { | |
71 | + return queryStreetId; | |
72 | + } | |
73 | + | |
74 | + public void setQueryStreetId(String queryStreetId) { | |
75 | + this.queryStreetId = queryStreetId; | |
76 | + } | |
48 | 77 | |
49 | 78 | public Integer getHbType() { |
50 | 79 | return hbType; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/MongoUtil.java
View file @
302af57
... | ... | @@ -51,19 +51,23 @@ |
51 | 51 | @Autowired |
52 | 52 | private CouponMapper couponMapper; |
53 | 53 | |
54 | - public List<Map<String, Object>> getChilds(String id) { | |
54 | + public List<Map<String, Object>> getChilds(String parentId,String childId) { | |
55 | 55 | List<Map<String, Object>> childList = new ArrayList<>(); |
56 | - BasicConfig basicConfig = mongoTemplate.findById(id, BasicConfig.class); | |
57 | - if(basicConfig != null) { | |
58 | - List<BasicConfig> childs = mongoTemplate.find(Query.query(Criteria.where("parentId").is(basicConfig.getId()).and("typeId").is("b7ea005c-dfac-4c2a-bdae-25239b3f44fd")), BasicConfig.class); | |
56 | + | |
57 | + Criteria c = Criteria.where("parentId").is(parentId); | |
58 | + if (StringUtils.isNotEmpty(childId)) | |
59 | + { | |
60 | + c.and("id").is(childId); | |
61 | + } | |
62 | + c.and("typeId").is("b7ea005c-dfac-4c2a-bdae-25239b3f44fd"); | |
63 | + | |
64 | + List<BasicConfig> childs = mongoTemplate.find(Query.query(c), BasicConfig.class); | |
59 | 65 | for (BasicConfig child : childs) { |
60 | 66 | Map<String, Object> temp = new HashMap<>(); |
61 | 67 | temp.put("id", child.getId()); |
62 | 68 | temp.put("name", child.getName()); |
63 | 69 | childList.add(temp); |
64 | 70 | } |
65 | - } | |
66 | - | |
67 | 71 | return childList; |
68 | 72 | } |
69 | 73 |