Commit 10f7e81e88cdaff97e538d9e6408747b1b2d99ee
1 parent
3c7599f0b2
Exists in
master
and in
6 other branches
update
Showing 2 changed files with 46 additions and 21 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/annualReportController.java
View file @
10f7e81
| ... | ... | @@ -29,13 +29,13 @@ |
| 29 | 29 | @RequestMapping(value = "/annualReport", method = RequestMethod.GET) |
| 30 | 30 | public void queryAnnualReport(HttpServletRequest request, |
| 31 | 31 | @RequestParam(required = false) String time, |
| 32 | - @RequestParam(required = false) String proviceId, | |
| 32 | + @RequestParam(required = false) String provinceId, | |
| 33 | 33 | @RequestParam(required = false) String cityId, |
| 34 | 34 | HttpServletResponse httpServletResponse) { |
| 35 | - if (StringUtils.isEmpty(proviceId) && StringUtils.isEmpty(cityId) && StringUtils.isEmpty(time)) { | |
| 35 | + if (StringUtils.isEmpty(provinceId) && StringUtils.isEmpty(cityId) && StringUtils.isEmpty(time)) { | |
| 36 | 36 | return; |
| 37 | 37 | } |
| 38 | - annualReportFacade.queryAnnualReport(getUserId(request), time, proviceId, cityId, httpServletResponse); | |
| 38 | + annualReportFacade.queryAnnualReport(getUserId(request), time, provinceId, cityId, httpServletResponse); | |
| 39 | 39 | |
| 40 | 40 | } |
| 41 | 41 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/annualReportFacade.java
View file @
10f7e81
| ... | ... | @@ -73,7 +73,7 @@ |
| 73 | 73 | @Autowired |
| 74 | 74 | private MongoTemplate mongoTemplate; |
| 75 | 75 | |
| 76 | - public void queryAnnualReport(Integer userId, String time, String proviceId, String cityId, HttpServletResponse httpServletResponse) { | |
| 76 | + public void queryAnnualReport(Integer userId, String time, String provinceId, String cityId, HttpServletResponse httpServletResponse) { | |
| 77 | 77 | |
| 78 | 78 | //本市户籍 |
| 79 | 79 | BasicConfigQuery basicConfigQuery = new BasicConfigQuery(); |
| 80 | 80 | |
| 81 | 81 | |
| 82 | 82 | |
| ... | ... | @@ -90,14 +90,19 @@ |
| 90 | 90 | listArea.add(basicConfig.getId()); |
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | + | |
| 94 | + | |
| 93 | 95 | try { |
| 94 | 96 | Map<Object, List<String>> map = new HashMap<>(); |
| 95 | 97 | for (String area : listArea) { |
| 96 | - List<String> hospitalIds = this.getCurrentUserHospPermissions(userId, proviceId, cityId, area); | |
| 98 | + List<String> hospitalIds = this.getCurrentUserHospPermissions(userId, provinceId, cityId, area); | |
| 97 | 99 | map.put(area, hospitalIds); |
| 98 | 100 | } |
| 99 | 101 | |
| 102 | + | |
| 100 | 103 | List<Map<String, String>> mapList = this.getDates(map, organizationService, time, babyService, matDeliverService, antExRecordService, antenatalExaminationService, sieveService, matDeliverFollowService, patientsService, mongoTemplate); |
| 104 | + | |
| 105 | + System.out.println(mapList); | |
| 101 | 106 | this.sum(mapList); |
| 102 | 107 | httpServletResponse.setContentType("application/force-download"); |
| 103 | 108 | httpServletResponse.setHeader("Content-Disposition", "attachment;filename=" + new String(("年报表.xls").getBytes("UTF-8"), "ISO-8859-1")); |
| ... | ... | @@ -213,8 +218,8 @@ |
| 213 | 218 | int bigBoyCount = 0;//巨大儿人数 |
| 214 | 219 | int zcBabyCount = 0;//早产儿数 |
| 215 | 220 | int babySiChanSiTaiCount = 0;//死胎人数 |
| 216 | - | |
| 217 | - | |
| 221 | + int patientCount = 0;// | |
| 222 | + int babyCount = 0;//产儿总数 | |
| 218 | 223 | if (CollectionUtils.isNotEmpty(list)) { |
| 219 | 224 | for (Map<String, String> map : list) { |
| 220 | 225 | huoChanCount += Integer.parseInt(map.get("huoChanCount")); //分娩方式 剖宫产 |
| ... | ... | @@ -251,8 +256,8 @@ |
| 251 | 256 | bigBoyCount += Integer.parseInt(map.get("bigBoyCount")); |
| 252 | 257 | zcBabyCount += Integer.parseInt(map.get("zcBabyCount")); |
| 253 | 258 | babySiChanSiTaiCount += Integer.parseInt(map.get("babySiChanSiTaiCount")); |
| 254 | - | |
| 255 | - | |
| 259 | + patientCount += Integer.parseInt(map.get("patientCount")); | |
| 260 | + babyCount += Integer.parseInt(map.get("babyCount")); | |
| 256 | 261 | } |
| 257 | 262 | } |
| 258 | 263 | Map<String, String> totalMap = new LinkedHashMap<>(); |
| ... | ... | @@ -265,7 +270,7 @@ |
| 265 | 270 | totalMap.put("maternalCount", String.valueOf(maternalCount)); |
| 266 | 271 | totalMap.put("maternalPercent", this.division(maternalCount, chanCount)); |
| 267 | 272 | totalMap.put("antexCount", String.valueOf(antexCount)); |
| 268 | - totalMap.put("antexPercent", this.division(antexCount, antexCount)); | |
| 273 | + totalMap.put("antexPercent", this.division(antexCount, patientCount)); | |
| 269 | 274 | totalMap.put("fiveCount", String.valueOf(fiveCount)); |
| 270 | 275 | totalMap.put("fivePercent", this.division(fiveCount, antexCount)); |
| 271 | 276 | totalMap.put("antexcCout", String.valueOf(antexcCout)); |
| 272 | 277 | |
| ... | ... | @@ -274,9 +279,9 @@ |
| 274 | 279 | totalMap.put("hemoglobinCount", String.valueOf(hemoglobinCount)); |
| 275 | 280 | totalMap.put("hemoglobinPervent", this.division(hemoglobinCount, hemoglobin)); |
| 276 | 281 | totalMap.put("hivCount", String.valueOf(hivCount)); |
| 277 | - totalMap.put("hivPervent", this.division(hivCount, chanCount)); | |
| 282 | + totalMap.put("hivPervent", this.division(hivCount, antexCount)); | |
| 278 | 283 | totalMap.put("hivYang", String.valueOf(hivYang)); |
| 279 | - totalMap.put("hivYangPervent", this.division(hivYang, chanCount)); | |
| 284 | + totalMap.put("hivYangPervent", String.valueOf((double) hivYang != 0.0 ? (double) hivYang / 100000 : 0.0)); | |
| 280 | 285 | totalMap.put("veroleCount", String.valueOf(veroleCount)); |
| 281 | 286 | totalMap.put("verolePervent", this.division(veroleCount, chanCount)); |
| 282 | 287 | totalMap.put("veroleYang", String.valueOf(veroleYang)); |
| 283 | 288 | |
| 284 | 289 | |
| ... | ... | @@ -298,11 +303,11 @@ |
| 298 | 303 | totalMap.put("gravidaCount", String.valueOf(gravidaCount)); |
| 299 | 304 | totalMap.put("gravidaPervent", this.division(gravidaCount, chanCount)); |
| 300 | 305 | totalMap.put("fmZuYuanCount", String.valueOf(fmZuYuanCount)); |
| 301 | - totalMap.put("fmZuYuanPervent", "最后处理"); | |
| 306 | + totalMap.put("fmZuYuanPervent", this.division(fmZuYuanCount, babyCount)); | |
| 302 | 307 | totalMap.put("fmPoGongCount", String.valueOf(fmPoGongCount)); |
| 303 | - totalMap.put("fmPogongPervent", "后面处理"); | |
| 308 | + totalMap.put("fmPogongPervent", this.division(fmPoGongCount, babyCount)); | |
| 304 | 309 | totalMap.put("killCount", String.valueOf(killCount)); |
| 305 | - Double killPervent = killCount != 0 ? killCount / 100000 : 0.0; | |
| 310 | + Double killPervent = (double) killCount != 0.0 ? (double) killCount / 100000 : 0; | |
| 306 | 311 | totalMap.put("killPervent", String.valueOf(killPervent)); |
| 307 | 312 | totalMap.put("chuXueCount", String.valueOf(chuXueCount)); |
| 308 | 313 | totalMap.put("chuXuePervent", this.division(chuXueCount, chanCount)); |
| ... | ... | @@ -401,6 +406,17 @@ |
| 401 | 406 | map.put("maternalCount", String.valueOf(chanCount)); |
| 402 | 407 | //产妇建卡 百分比 |
| 403 | 408 | map.put("maternalPercent", this.division(chanCount, chanCount)); |
| 409 | + | |
| 410 | + //获取所有建档人数 | |
| 411 | + PatientsQuery patientsQuerys = new PatientsQuery(); | |
| 412 | + patientsQuerys.setYn(YnEnums.YES.getId()); | |
| 413 | + if (StringUtils.isNotEmpty(time)) { | |
| 414 | + patientsQuerys.setCreatedTimeStart(DateUtil.getSNDate(time)[0]); | |
| 415 | + patientsQuerys.setCreatedTimeEnd(DateUtil.getSNDate(time)[1]); | |
| 416 | + } | |
| 417 | + patientsQuerys.setHospitalList(entry.getValue()); | |
| 418 | + int patientCount = patientsService.queryPatientCount(patientsQuerys); | |
| 419 | + | |
| 404 | 420 | //产检 人数 |
| 405 | 421 | AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); |
| 406 | 422 | if (StringUtils.isNotEmpty(time)) { |
| ... | ... | @@ -416,7 +432,7 @@ |
| 416 | 432 | count.add(antExRecord.getParentId()); |
| 417 | 433 | } |
| 418 | 434 | map.put("antexCount", String.valueOf(antexMap.size())); |
| 419 | - map.put("antexPercent", this.division(antexMap.size(), chanCount)); | |
| 435 | + map.put("antexPercent", this.division(antexMap.size(), patientCount)); | |
| 420 | 436 | //产检>=5次 |
| 421 | 437 | Map<String, Integer> maps = new HashMap<>(); |
| 422 | 438 | for (String string : count) { |
| ... | ... | @@ -514,7 +530,7 @@ |
| 514 | 530 | int hiv = antenatalExaminationService.queryAntExChuCount(antExChuQuery.convertToQuery()); |
| 515 | 531 | map.put("hivYang", String.valueOf(hiv)); |
| 516 | 532 | //感染人数的10万分之1 |
| 517 | - map.put("hivYangPervent", String.valueOf(hiv != 0 ? hiv / 100000 : 0)); | |
| 533 | + map.put("hivYangPervent", String.valueOf((double) hiv != 0.0 ? hiv / 100000 : 0)); | |
| 518 | 534 | //产妇梅毒检测人数 |
| 519 | 535 | |
| 520 | 536 | AntExChuQuery veroleChuQuery1 = new AntExChuQuery(); |
| ... | ... | @@ -690,7 +706,7 @@ |
| 690 | 706 | matDeliverKillQuery.setMaternalInfo("2"); |
| 691 | 707 | int killCount = matDeliverService.count(matDeliverKillQuery); |
| 692 | 708 | map.put("killCount", String.valueOf(killCount)); |
| 693 | - Double s = killCount != 0 ? killCount / 100000 : 0.0; | |
| 709 | + Double s = (double) killCount != 0.0 ? (double) killCount / 100000 : 0; | |
| 694 | 710 | map.put("killPervent", String.valueOf(s)); |
| 695 | 711 | |
| 696 | 712 | //产科出血人数 |
| ... | ... | @@ -866,6 +882,10 @@ |
| 866 | 882 | } |
| 867 | 883 | babySiWangList.clear(); |
| 868 | 884 | map.put("babySiChanSiTaiCount", String.valueOf(babySiChanCount + babySiTaiCount)); |
| 885 | + | |
| 886 | + map.put("patientCount", String.valueOf(patientCount)); | |
| 887 | + map.put("babyCount", String.valueOf(babyCount)); | |
| 888 | + | |
| 869 | 889 | list.add(map); |
| 870 | 890 | } |
| 871 | 891 | |
| 872 | 892 | |
| ... | ... | @@ -895,10 +915,15 @@ |
| 895 | 915 | } |
| 896 | 916 | |
| 897 | 917 | public static void main(String[] args) { |
| 898 | - int s = 12; | |
| 899 | - int d = s != 0 ? s / 1 : 0; | |
| 900 | - System.out.println(d); | |
| 918 | + double s = 12; | |
| 919 | + double d; | |
| 920 | + if (s != 0.0) { | |
| 921 | + d = s / 10000; | |
| 922 | + System.out.println(d); | |
| 923 | + } | |
| 924 | + | |
| 901 | 925 | } |
| 926 | + | |
| 902 | 927 | |
| 903 | 928 | } |