Commit 9e8b4153ac9cd00ea74753036ab1d314be168435

Authored by liquanyu
1 parent 8fdbaabeec

产检节点统计

Showing 3 changed files with 66 additions and 10 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AreaCountFacade.java View file @ 9e8b415
... ... @@ -206,7 +206,7 @@
206 206 hospitalIds.subList(i,end),
207 207 startTime,
208 208 endTime,
209   - pointType);
  209 + pointType,recordService);
210 210 listFuture.add(commonThreadPool.submit(checkPointCountWorker));
211 211 }
212 212 for (Future f : listFuture) {
... ... @@ -686,7 +686,7 @@
686 686 }
687 687 }
688 688 map.put("JD_HOSPITAL",buildHosp); //建档机构
689   - map.put("TEL_NO",map.get("TEL_NO")); //联系电话
  689 + map.put("TEL_NO", map.get("TEL_NO")); //联系电话
690 690 results.add(map);
691 691 }
692 692 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/CheckPointCountWorker.java View file @ 9e8b415
1 1 package com.lyms.platform.operate.web.worker;
2 2  
  3 +import com.lyms.platform.biz.service.AntExRecordService;
3 4 import com.lyms.platform.biz.service.AntenatalExaminationService;
4 5 import com.lyms.platform.biz.service.BasicConfigService;
5 6 import com.lyms.platform.biz.service.PatientsService;
... ... @@ -39,6 +40,8 @@
39 40 private Date endTime;
40 41 private Integer pointType;
41 42  
  43 + private AntExRecordService recordService;
  44 +
42 45 public CheckPointCountWorker(PatientsService patientsService,
43 46 AntenatalExaminationService antenatalExaminationService,
44 47 OrganizationService organizationService,
... ... @@ -46,7 +49,9 @@
46 49 List<String> hospitalIds,
47 50 Date startTime,
48 51 Date endTime,
49   - Integer pointType)
  52 + Integer pointType,
  53 + AntExRecordService recordService
  54 + )
50 55 {
51 56 this.patientsService = patientsService;
52 57 this.antenatalExaminationService = antenatalExaminationService;
... ... @@ -57,6 +62,7 @@
57 62 this.endTime = endTime;
58 63 this.endTime = endTime;
59 64 this.pointType = pointType;
  65 + this.recordService = recordService;
60 66 }
61 67  
62 68  
... ... @@ -104,7 +110,7 @@
104 110 for (int week : weeks)
105 111 {
106 112 CheckWeeksNumWorker callable = new CheckWeeksNumWorker(antenatalExaminationService,hId,
107   - startTime, endTime, week,pointType);
  113 + startTime, endTime, week,pointType, recordService);
108 114 futures.add(pool.submit(callable));
109 115 }
110 116  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/CheckWeeksNumWorker.java View file @ 9e8b415
1 1 package com.lyms.platform.operate.web.worker;
2 2  
  3 +import com.lyms.platform.biz.service.AntExRecordService;
3 4 import com.lyms.platform.biz.service.AntenatalExaminationService;
  5 +import com.lyms.platform.pojo.AntExRecordModel;
  6 +import com.lyms.platform.query.AntExRecordQuery;
4 7  
5 8 import java.util.Date;
6 9 import java.util.HashMap;
7 10  
... ... @@ -20,8 +23,9 @@
20 23 private Date endTime;
21 24 private int week;
22 25 private Integer pointType;
  26 + private AntExRecordService recordService;
23 27 public CheckWeeksNumWorker(AntenatalExaminationService antenatalExaminationService, String hospitalId,
24   - Date startTime,Date endTime,int week,Integer pointType)
  28 + Date startTime,Date endTime,int week,Integer pointType,AntExRecordService recordService)
25 29 {
26 30 this.antenatalExaminationService = antenatalExaminationService;
27 31 this.hospitalId = hospitalId;
... ... @@ -29,6 +33,7 @@
29 33 this.endTime = endTime;
30 34 this.week = week;
31 35 this.pointType = pointType;
  36 + this.recordService = recordService;
32 37 }
33 38  
34 39 /**
35 40  
36 41  
37 42  
38 43  
39 44  
40 45  
... ... @@ -43,31 +48,76 @@
43 48 @Override
44 49 public Map<String,Integer> call() throws Exception {
45 50 Map<String,Integer> map = new HashMap<>();
  51 +
  52 + AntExRecordQuery antExRecordQuery = new AntExRecordQuery();
  53 + antExRecordQuery.setBirthStart(startTime);
  54 + antExRecordQuery.setBuildTimeEnd(endTime);
  55 + antExRecordQuery.setHospitalId(hospitalId);
  56 + antExRecordQuery.setIsFirst(pointType);
  57 +
46 58 if (week == 0)
47 59 {
48   - int itemnum12 = antenatalExaminationService.queryWeekPointCount(0, 12, hospitalId, startTime, endTime, pointType);
  60 +
  61 + antExRecordQuery.setcDueWeekStart(0);
  62 + antExRecordQuery.setcDueWeekEnd((12 + 1) * 7 - 1);
  63 + int itemnum12 = recordService.count(antExRecordQuery);
49 64 map.put("itemnum12",itemnum12);
50 65 }
51 66 else if (week == 16)
52 67 {
53   - int itemnum20 = antenatalExaminationService.queryWeekPointCount(16, 20, hospitalId, startTime, endTime, pointType);
  68 + antExRecordQuery.setcDueWeekStart(16*7);
  69 + antExRecordQuery.setcDueWeekEnd((20 + 1) * 7 - 1);
  70 + int itemnum20 = recordService.count(antExRecordQuery);
54 71 map.put("itemnum20",itemnum20);
55 72 }
56 73 else if (week == 21)
57 74 {
58   - int itemnum24 = antenatalExaminationService.queryWeekPointCount(21, 24, hospitalId, startTime, endTime, pointType);
  75 + antExRecordQuery.setcDueWeekStart(21*7);
  76 + antExRecordQuery.setcDueWeekEnd((24 + 1) * 7 - 1);
  77 + int itemnum24 = recordService.count(antExRecordQuery);
59 78 map.put("itemnum24",itemnum24);
60 79 }
61 80 else if (week == 28)
62 81 {
63   - int itemnum36 = antenatalExaminationService.queryWeekPointCount(28, 36, hospitalId, startTime, endTime, pointType);
  82 + antExRecordQuery.setcDueWeekStart(28*7);
  83 + antExRecordQuery.setcDueWeekEnd((36 + 1) * 7 - 1);
  84 + int itemnum36 = recordService.count(antExRecordQuery);
64 85 map.put("itemnum36",itemnum36);
65 86 }
66 87 else if (week == 37)
67 88 {
68   - int itemnum40 = antenatalExaminationService.queryWeekPointCount(37, 40, hospitalId, startTime,endTime, pointType);
  89 + antExRecordQuery.setcDueWeekStart(37*7);
  90 + antExRecordQuery.setcDueWeekEnd((40 + 1) * 7 - 1);
  91 + int itemnum40 = recordService.count(antExRecordQuery);
69 92 map.put("itemnum40",itemnum40);
70 93 }
  94 +
  95 +
  96 +// if (week == 0)
  97 +// {
  98 +// int itemnum12 = antenatalExaminationService.queryWeekPointCount(0, 12, hospitalId, startTime, endTime, pointType);
  99 +// map.put("itemnum12",itemnum12);
  100 +// }
  101 +// else if (week == 16)
  102 +// {
  103 +// int itemnum20 = antenatalExaminationService.queryWeekPointCount(16, 20, hospitalId, startTime, endTime, pointType);
  104 +// map.put("itemnum20",itemnum20);
  105 +// }
  106 +// else if (week == 21)
  107 +// {
  108 +// int itemnum24 = antenatalExaminationService.queryWeekPointCount(21, 24, hospitalId, startTime, endTime, pointType);
  109 +// map.put("itemnum24",itemnum24);
  110 +// }
  111 +// else if (week == 28)
  112 +// {
  113 +// int itemnum36 = antenatalExaminationService.queryWeekPointCount(28, 36, hospitalId, startTime, endTime, pointType);
  114 +// map.put("itemnum36",itemnum36);
  115 +// }
  116 +// else if (week == 37)
  117 +// {
  118 +// int itemnum40 = antenatalExaminationService.queryWeekPointCount(37, 40, hospitalId, startTime,endTime, pointType);
  119 +// map.put("itemnum40",itemnum40);
  120 +// }
71 121 return map;
72 122 }
73 123 }