Commit ba48ca3e47c5aa1f85874e795d361a830a436d12
Exists in
master
and in
1 other branch
Merge remote-tracking branch 'origin/master'
Showing 8 changed files
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PremaritalCheckupController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanChanResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanPatientsResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/RiskPatientsResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanChanPatientWorker.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanPatientWorker.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/WorkHR.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PremaritalCheckupController.java
View file @
ba48ca3
... | ... | @@ -36,12 +36,12 @@ |
36 | 36 | */ |
37 | 37 | @RequestMapping(value = "/addPremaritalCheckup", method = RequestMethod.POST) |
38 | 38 | @ResponseBody |
39 | -// @TokenRequired | |
39 | + @TokenRequired | |
40 | 40 | public BaseResponse addPremaritalCheckup(@RequestBody PremaritalCheckupAddRequest addRequest, |
41 | 41 | HttpServletRequest request){ |
42 | 42 | //获取当前登录用户ID |
43 | 43 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
44 | - return premaritalCheckupFacade.addPremaritalCheckup(addRequest , 1); | |
44 | + return premaritalCheckupFacade.addPremaritalCheckup(addRequest , loginState.getId()); | |
45 | 45 | } |
46 | 46 | |
47 | 47 | |
... | ... | @@ -56,7 +56,7 @@ |
56 | 56 | */ |
57 | 57 | @RequestMapping(value = "/getPremaritalCheckup", method = RequestMethod.GET) |
58 | 58 | @ResponseBody |
59 | -// @TokenRequired | |
59 | + @TokenRequired | |
60 | 60 | public BaseObjectResponse getPremaritalCheckup(@RequestParam(value = "vcCardNo",required = false) String vcCardNo, |
61 | 61 | @RequestParam(value = "cardNo",required = false) String certificateNum, |
62 | 62 | @RequestParam(value = "hospitalId",required = false)String hospitalId, |
... | ... | @@ -72,7 +72,7 @@ |
72 | 72 | param.setVcCardNo(vcCardNo); |
73 | 73 | param.setCertificateNum(certificateNum); |
74 | 74 | } |
75 | - return premaritalCheckupFacade.getPremaritalCheckup(param, 1); | |
75 | + return premaritalCheckupFacade.getPremaritalCheckup(param, loginState.getId()); | |
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
79 | 79 | |
... | ... | @@ -83,12 +83,12 @@ |
83 | 83 | */ |
84 | 84 | @RequestMapping(value = "/queryPremaritalCheckup", method = RequestMethod.GET) |
85 | 85 | @ResponseBody |
86 | -// @TokenRequired | |
86 | + @TokenRequired | |
87 | 87 | public BaseListResponse queryPremaritalCheckup(@Valid PremaritalCheckupQueryRequest queryRequest, |
88 | 88 | HttpServletRequest request){ |
89 | 89 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
90 | 90 | |
91 | - return premaritalCheckupFacade.queryPremaritalCheckup(queryRequest, 1); | |
91 | + return premaritalCheckupFacade.queryPremaritalCheckup(queryRequest, loginState.getId()); | |
92 | 92 | } |
93 | 93 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
ba48ca3
... | ... | @@ -481,7 +481,7 @@ |
481 | 481 | if (end > patientses.size()) { |
482 | 482 | end = patientses.size(); |
483 | 483 | } |
484 | - listFuture.add(threadPoolExecutor.submit(new QuanChanPatientWorker(patientses.subList(i, end), hospital, usersService, postReviewService, matDeliverService, patientsService))); | |
484 | + listFuture.add(threadPoolExecutor.submit(new QuanChanPatientWorker(patientses.subList(i, end), hospital, usersService, postReviewService, matDeliverService, patientsService,organizationService,basicConfigService))); | |
485 | 485 | } |
486 | 486 | for (Future f : listFuture) { |
487 | 487 | try { |
... | ... | @@ -504,7 +504,7 @@ |
504 | 504 | if (end > patientses.size()) { |
505 | 505 | end = patientses.size(); |
506 | 506 | } |
507 | - listFuture.add(threadPoolExecutor.submit(new QuanPatientWorker(patientses.subList(i, end), usersService, hospital, antExService, basicConfigService, patientsService))); | |
507 | + listFuture.add(threadPoolExecutor.submit(new QuanPatientWorker(patientses.subList(i, end), usersService, hospital, antExService, basicConfigService, patientsService,organizationService))); | |
508 | 508 | } |
509 | 509 | for (Future f : listFuture) { |
510 | 510 | try { |
... | ... | @@ -532,7 +532,7 @@ |
532 | 532 | if (end > patientses.size()) { |
533 | 533 | end = patientses.size(); |
534 | 534 | } |
535 | - listFuture.add(threadPoolExecutor.submit(new WorkHR(patientses.subList(i, end), usersService, hospital, basicConfigService, antExService, patientsService))); | |
535 | + listFuture.add(threadPoolExecutor.submit(new WorkHR(patientses.subList(i, end), usersService, hospital, basicConfigService, antExService, patientsService,organizationService))); | |
536 | 536 | } |
537 | 537 | for (Future f : listFuture) { |
538 | 538 | try { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanChanResult.java
View file @
ba48ca3
... | ... | @@ -48,6 +48,57 @@ |
48 | 48 | //操纵者 |
49 | 49 | private String operator; |
50 | 50 | |
51 | + //户籍地 | |
52 | + private String registerAddr; | |
53 | + //居住地 | |
54 | + private String addr; | |
55 | + //首次建档医院 | |
56 | + private String firstBH; | |
57 | + //分娩医院 | |
58 | + private String fCh; | |
59 | + //建档时间 | |
60 | + private String bTime; | |
61 | + | |
62 | + public String getbTime() { | |
63 | + return bTime; | |
64 | + } | |
65 | + | |
66 | + public void setbTime(String bTime) { | |
67 | + this.bTime = bTime; | |
68 | + } | |
69 | + | |
70 | + public String getRegisterAddr() { | |
71 | + return registerAddr; | |
72 | + } | |
73 | + | |
74 | + public void setRegisterAddr(String registerAddr) { | |
75 | + this.registerAddr = registerAddr; | |
76 | + } | |
77 | + | |
78 | + public String getAddr() { | |
79 | + return addr; | |
80 | + } | |
81 | + | |
82 | + public void setAddr(String addr) { | |
83 | + this.addr = addr; | |
84 | + } | |
85 | + | |
86 | + public String getFirstBH() { | |
87 | + return firstBH; | |
88 | + } | |
89 | + | |
90 | + public void setFirstBH(String firstBH) { | |
91 | + this.firstBH = firstBH; | |
92 | + } | |
93 | + | |
94 | + public String getfCh() { | |
95 | + return fCh; | |
96 | + } | |
97 | + | |
98 | + public void setfCh(String fCh) { | |
99 | + this.fCh = fCh; | |
100 | + } | |
101 | + | |
51 | 102 | public String getOperator() { |
52 | 103 | return operator; |
53 | 104 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanPatientsResult.java
View file @
ba48ca3
... | ... | @@ -59,6 +59,57 @@ |
59 | 59 | //操纵者 |
60 | 60 | private String operator; |
61 | 61 | |
62 | + //户籍地 | |
63 | + private String registerAddr; | |
64 | + //居住地 | |
65 | + private String addr; | |
66 | + //首次建档医院 | |
67 | + private String firstBH; | |
68 | + //当前产检医院 | |
69 | + private String currentCh; | |
70 | + //建档时间 | |
71 | + private String bTime; | |
72 | + | |
73 | + public String getbTime() { | |
74 | + return bTime; | |
75 | + } | |
76 | + | |
77 | + public void setbTime(String bTime) { | |
78 | + this.bTime = bTime; | |
79 | + } | |
80 | + | |
81 | + public String getRegisterAddr() { | |
82 | + return registerAddr; | |
83 | + } | |
84 | + | |
85 | + public void setRegisterAddr(String registerAddr) { | |
86 | + this.registerAddr = registerAddr; | |
87 | + } | |
88 | + | |
89 | + public String getAddr() { | |
90 | + return addr; | |
91 | + } | |
92 | + | |
93 | + public void setAddr(String addr) { | |
94 | + this.addr = addr; | |
95 | + } | |
96 | + | |
97 | + public String getFirstBH() { | |
98 | + return firstBH; | |
99 | + } | |
100 | + | |
101 | + public void setFirstBH(String firstBH) { | |
102 | + this.firstBH = firstBH; | |
103 | + } | |
104 | + | |
105 | + public String getCurrentCh() { | |
106 | + return currentCh; | |
107 | + } | |
108 | + | |
109 | + public void setCurrentCh(String currentCh) { | |
110 | + this.currentCh = currentCh; | |
111 | + } | |
112 | + | |
62 | 113 | public String getOperator() { |
63 | 114 | return operator; |
64 | 115 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/RiskPatientsResult.java
View file @
ba48ca3
... | ... | @@ -70,60 +70,54 @@ |
70 | 70 | private String serviceStatus; |
71 | 71 | |
72 | 72 | //户籍地 |
73 | - private String hjAddress; | |
74 | - | |
75 | - //居住地址 | |
76 | - private String jzAddress; | |
77 | - | |
73 | + private String registerAddr; | |
74 | + //居住地 | |
75 | + private String addr; | |
78 | 76 | //首次建档医院 |
79 | - private String firstHospital; | |
77 | + private String firstBH; | |
78 | + //当前产检医院 | |
79 | + private String currentCh; | |
80 | + //建档时间 | |
81 | + private String bTime; | |
80 | 82 | |
83 | + public String getbTime() { | |
84 | + return bTime; | |
85 | + } | |
81 | 86 | |
82 | - //当前产检医院 | |
83 | - private String currentCheckHospital; | |
87 | + public void setbTime(String bTime) { | |
88 | + this.bTime = bTime; | |
89 | + } | |
84 | 90 | |
85 | - public String getHjAddress() { | |
86 | - if(null==hjAddress){ | |
87 | - return SPIT; | |
88 | - } | |
89 | - return hjAddress; | |
91 | + public String getRegisterAddr() { | |
92 | + return registerAddr; | |
90 | 93 | } |
91 | 94 | |
92 | - public void setHjAddress(String hjAddress) { | |
93 | - this.hjAddress = hjAddress; | |
95 | + public void setRegisterAddr(String registerAddr) { | |
96 | + this.registerAddr = registerAddr; | |
94 | 97 | } |
95 | 98 | |
96 | - public String getJzAddress() { | |
97 | - if(null==jzAddress){ | |
98 | - return SPIT; | |
99 | - } | |
100 | - return jzAddress; | |
99 | + public String getAddr() { | |
100 | + return addr; | |
101 | 101 | } |
102 | 102 | |
103 | - public void setJzAddress(String jzAddress) { | |
104 | - this.jzAddress = jzAddress; | |
103 | + public void setAddr(String addr) { | |
104 | + this.addr = addr; | |
105 | 105 | } |
106 | 106 | |
107 | - public String getFirstHospital() { | |
108 | - if(null==firstHospital){ | |
109 | - return SPIT; | |
110 | - } | |
111 | - return firstHospital; | |
107 | + public String getFirstBH() { | |
108 | + return firstBH; | |
112 | 109 | } |
113 | 110 | |
114 | - public void setFirstHospital(String firstHospital) { | |
115 | - this.firstHospital = firstHospital; | |
111 | + public void setFirstBH(String firstBH) { | |
112 | + this.firstBH = firstBH; | |
116 | 113 | } |
117 | 114 | |
118 | - public String getCurrentCheckHospital() { | |
119 | - if(null==currentCheckHospital){ | |
120 | - return SPIT; | |
121 | - } | |
122 | - return currentCheckHospital; | |
115 | + public String getCurrentCh() { | |
116 | + return currentCh; | |
123 | 117 | } |
124 | 118 | |
125 | - public void setCurrentCheckHospital(String currentCheckHospital) { | |
126 | - this.currentCheckHospital = currentCheckHospital; | |
119 | + public void setCurrentCh(String currentCh) { | |
120 | + this.currentCh = currentCh; | |
127 | 121 | } |
128 | 122 | |
129 | 123 | public String getServiceType() { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanChanPatientWorker.java
View file @
ba48ca3
... | ... | @@ -8,7 +8,9 @@ |
8 | 8 | import com.lyms.platform.operate.web.facade.PatientFacade; |
9 | 9 | import com.lyms.platform.operate.web.facade.SmsConfigFacade; |
10 | 10 | import com.lyms.platform.operate.web.result.QuanChanResult; |
11 | +import com.lyms.platform.operate.web.utils.CommonsHelper; | |
11 | 12 | import com.lyms.platform.permission.model.Users; |
13 | +import com.lyms.platform.permission.service.OrganizationService; | |
12 | 14 | import com.lyms.platform.permission.service.UsersService; |
13 | 15 | import com.lyms.platform.pojo.MaternalDeliverModel; |
14 | 16 | import com.lyms.platform.pojo.Patients; |
15 | 17 | |
16 | 18 | |
... | ... | @@ -46,18 +48,22 @@ |
46 | 48 | |
47 | 49 | private MatDeliverService matDeliverService; |
48 | 50 | private String hospital; |
51 | + private OrganizationService organizationService; | |
52 | + private BasicConfigService basicConfigService; | |
49 | 53 | |
50 | 54 | public QuanChanPatientWorker(List<Patients> patientses, |
51 | 55 | String hospital, |
52 | 56 | UsersService usersService, |
53 | 57 | PostReviewService postReviewService, |
54 | - MatDeliverService matDeliverService,PatientsService patientsService) { | |
58 | + MatDeliverService matDeliverService,PatientsService patientsService,OrganizationService organizationService,BasicConfigService basicConfigService) { | |
55 | 59 | this.patientses = patientses; |
56 | 60 | this.matDeliverService = matDeliverService; |
57 | 61 | this.postReviewService = postReviewService; |
58 | 62 | this.patientsService=patientsService; |
59 | 63 | this.hospital = hospital; |
60 | 64 | this.usersService = usersService; |
65 | + this.organizationService=organizationService; | |
66 | + this.basicConfigService=basicConfigService; | |
61 | 67 | } |
62 | 68 | |
63 | 69 | |
... | ... | @@ -83,6 +89,15 @@ |
83 | 89 | chanResult.setlName(patients.getBookbuildingDoctor()); |
84 | 90 | } |
85 | 91 | } |
92 | + chanResult.setbTime(DateUtil.getyyyy_MM_dd(patients.getBookbuildingDate())); | |
93 | + //注册地址 | |
94 | + chanResult.setRegisterAddr(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService)); | |
95 | + chanResult.setAddr(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService)); | |
96 | + try { | |
97 | + chanResult.setFirstBH(organizationService.getOrganization(Integer.valueOf(patients.getHospitalId())).getName()); | |
98 | + } catch (Exception e) { | |
99 | + chanResult.setFirstBH(""); | |
100 | + } | |
86 | 101 | MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); |
87 | 102 | matDeliverQuery.setPid(patients.getPid()); |
88 | 103 | matDeliverQuery.setCreatedStart(patients.getLastMenses()); |
... | ... | @@ -91,6 +106,12 @@ |
91 | 106 | List<MaternalDeliverModel> maternalDeliverModels = matDeliverService.query(matDeliverQuery); |
92 | 107 | if (CollectionUtils.isNotEmpty(maternalDeliverModels)) { |
93 | 108 | chanResult.setDueWeek(maternalDeliverModels.get(0).getDueDate()); |
109 | + | |
110 | + try { | |
111 | + chanResult.setfCh(organizationService.getOrganization(Integer.valueOf(maternalDeliverModels.get(0).getHospitalId())).getName()); | |
112 | + } catch (Exception e) { | |
113 | + chanResult.setfCh(""); | |
114 | + } | |
94 | 115 | } |
95 | 116 | stopWatch.stop(); |
96 | 117 | //复查次数 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanPatientWorker.java
View file @
ba48ca3
... | ... | @@ -13,7 +13,10 @@ |
13 | 13 | import com.lyms.platform.operate.web.facade.PatientFacade; |
14 | 14 | import com.lyms.platform.operate.web.result.HighScoreResult; |
15 | 15 | import com.lyms.platform.operate.web.result.QuanPatientsResult; |
16 | +import com.lyms.platform.operate.web.utils.CommonsHelper; | |
17 | +import com.lyms.platform.permission.model.Organization; | |
16 | 18 | import com.lyms.platform.permission.model.Users; |
19 | +import com.lyms.platform.permission.service.OrganizationService; | |
17 | 20 | import com.lyms.platform.permission.service.UsersService; |
18 | 21 | import com.lyms.platform.pojo.AntExChuModel; |
19 | 22 | import com.lyms.platform.pojo.AntenatalExaminationModel; |
20 | 23 | |
21 | 24 | |
... | ... | @@ -46,18 +49,20 @@ |
46 | 49 | private AntenatalExaminationService antExService; |
47 | 50 | private BasicConfigService basicConfigService; |
48 | 51 | private PatientsService patientsService; |
52 | + private OrganizationService organizationService; | |
49 | 53 | |
50 | 54 | public QuanPatientWorker(List<Patients> patientses, |
51 | 55 | UsersService usersService, |
52 | 56 | String hospital, |
53 | 57 | AntenatalExaminationService antExService, |
54 | - BasicConfigService basicConfigService,PatientsService patientsService) { | |
58 | + BasicConfigService basicConfigService,PatientsService patientsService,OrganizationService organizationService) { | |
55 | 59 | this.patientses = patientses; |
56 | 60 | this.usersService = usersService; |
57 | 61 | this.antExService = antExService; |
58 | 62 | this.hospital = hospital; |
59 | 63 | this.basicConfigService = basicConfigService; |
60 | 64 | this.patientsService=patientsService; |
65 | + this.organizationService=organizationService; | |
61 | 66 | } |
62 | 67 | |
63 | 68 | @Override |
... | ... | @@ -66,6 +71,7 @@ |
66 | 71 | AntExChuQuery antExChuQuery = new AntExChuQuery(); |
67 | 72 | AntExQuery antExQuery = new AntExQuery(); |
68 | 73 | for (Patients patients : patientses) { |
74 | + | |
69 | 75 | StopWatch stopWatch = new StopWatch("QuanPatientWorker -" + patients.getId()); |
70 | 76 | QuanPatientsResult quanPatientsResult = new QuanPatientsResult(); |
71 | 77 | quanPatientsResult.convertToResult(patients); |
72 | 78 | |
... | ... | @@ -83,11 +89,29 @@ |
83 | 89 | quanPatientsResult.setlName(patients.getBookbuildingDoctor()); |
84 | 90 | } |
85 | 91 | } |
86 | - | |
92 | + quanPatientsResult.setbTime(DateUtil.getyyyy_MM_dd(patients.getBookbuildingDate())); | |
87 | 93 | antExQuery.setHospitalId(null); |
88 | 94 | stopWatch.start("query ant count"); |
89 | 95 | //复诊次数 |
90 | - int i = antExService.queryAntenatalExaminationCount(antExQuery.convertToQuery()); | |
96 | + List<AntenatalExaminationModel> ant = antExService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); | |
97 | + int i = 0; | |
98 | + if (CollectionUtils.isNotEmpty(ant)) { | |
99 | + //复诊次数 | |
100 | + i = ant.size(); | |
101 | + for (AntenatalExaminationModel a : ant) { | |
102 | + try { | |
103 | + if(StringUtils.isNotEmpty(a.getHospitalId())){ | |
104 | + Organization og = organizationService.getOrganization(Integer.valueOf(a.getHospitalId())); | |
105 | + if(null!=og){ | |
106 | + quanPatientsResult.setCurrentCh(og.getName()); | |
107 | + break; | |
108 | + } | |
109 | + } | |
110 | + } catch (Exception e) { | |
111 | + quanPatientsResult.setCurrentCh(""); | |
112 | + } | |
113 | + } | |
114 | + } | |
91 | 115 | antExChuQuery.setPid(patients.getPid()); |
92 | 116 | antExChuQuery.setYn(YnEnums.YES.getId()); |
93 | 117 | antExChuQuery.setHospitalId(null); |
... | ... | @@ -173,6 +197,15 @@ |
173 | 197 | } |
174 | 198 | } |
175 | 199 | stopWatch.stop(); |
200 | + //注册地址 | |
201 | + quanPatientsResult.setRegisterAddr(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService)); | |
202 | + quanPatientsResult.setAddr(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService)); | |
203 | + try { | |
204 | + quanPatientsResult.setFirstBH(organizationService.getOrganization(Integer.valueOf(patients.getHospitalId())).getName()); | |
205 | + } catch (Exception e) { | |
206 | + quanPatientsResult.setFirstBH(""); | |
207 | + } | |
208 | + | |
176 | 209 | quanPatientsResult.setServiceType(ServiceTypeEnums.getTitleById(patients.getServiceType())); |
177 | 210 | quanPatientsResult.setServiceStatus(ServiceStatusEnums.getNameById(patients.getServiceStatus())); |
178 | 211 | //修改获取建档里面的高危等级不用在重新去算 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/WorkHR.java
View file @
ba48ca3
... | ... | @@ -13,7 +13,10 @@ |
13 | 13 | import com.lyms.platform.operate.web.facade.PatientFacade; |
14 | 14 | import com.lyms.platform.operate.web.result.HighScoreResult; |
15 | 15 | import com.lyms.platform.operate.web.result.RiskPatientsResult; |
16 | +import com.lyms.platform.operate.web.utils.CommonsHelper; | |
17 | +import com.lyms.platform.permission.model.Organization; | |
16 | 18 | import com.lyms.platform.permission.model.Users; |
19 | +import com.lyms.platform.permission.service.OrganizationService; | |
17 | 20 | import com.lyms.platform.permission.service.UsersService; |
18 | 21 | import com.lyms.platform.pojo.AntExChuModel; |
19 | 22 | import com.lyms.platform.pojo.AntenatalExaminationModel; |
20 | 23 | |
... | ... | @@ -33,9 +36,7 @@ |
33 | 36 | import java.util.concurrent.Callable; |
34 | 37 | |
35 | 38 | /** |
36 | - * | |
37 | 39 | * 高危孕妇列表线程处理 |
38 | - * | |
39 | 40 | */ |
40 | 41 | public class WorkHR implements Callable<List<RiskPatientsResult>> { |
41 | 42 | |
42 | 43 | |
43 | 44 | |
... | ... | @@ -48,15 +49,18 @@ |
48 | 49 | private String hospital; |
49 | 50 | private PatientsService patientsService; |
50 | 51 | |
52 | + private OrganizationService organizationService; | |
53 | + | |
51 | 54 | public WorkHR(List<Patients> patientses, UsersService usersService, String hospital, |
52 | 55 | BasicConfigService basicConfigService, |
53 | - AntenatalExaminationService antExService,PatientsService patientsService) { | |
56 | + AntenatalExaminationService antExService, PatientsService patientsService,OrganizationService organizationService) { | |
54 | 57 | this.patientses = patientses; |
55 | 58 | this.usersService = usersService; |
56 | 59 | this.hospital = hospital; |
57 | 60 | this.basicConfigService = basicConfigService; |
58 | 61 | this.antExService = antExService; |
59 | - this.patientsService=patientsService; | |
62 | + this.patientsService = patientsService; | |
63 | + this.organizationService=organizationService; | |
60 | 64 | } |
61 | 65 | |
62 | 66 | public List<RiskPatientsResult> call() { |
... | ... | @@ -85,8 +89,26 @@ |
85 | 89 | antExQuery.setYn(YnEnums.YES.getId()); |
86 | 90 | antExQuery.setHospitalId(null); |
87 | 91 | stopWatch.start("cap antex count"); |
88 | - //复诊次数 | |
89 | - int i = antExService.queryAntenatalExaminationCount(antExQuery.convertToQuery()); | |
92 | + List<AntenatalExaminationModel> ant = antExService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); | |
93 | + int i = 0; | |
94 | + if (CollectionUtils.isNotEmpty(ant)) { | |
95 | + //复诊次数 | |
96 | + i = ant.size(); | |
97 | + for (AntenatalExaminationModel a : ant) { | |
98 | + try { | |
99 | + if(StringUtils.isNotEmpty(a.getHospitalId())){ | |
100 | + Organization og = organizationService.getOrganization(Integer.valueOf(a.getHospitalId())); | |
101 | + if(null!=og){ | |
102 | + riskPatientsResult.setCurrentCh(og.getName()); | |
103 | + break; | |
104 | + } | |
105 | + } | |
106 | + } catch (Exception e) { | |
107 | + riskPatientsResult.setCurrentCh(""); | |
108 | + } | |
109 | + } | |
110 | + } | |
111 | + riskPatientsResult.setbTime(DateUtil.getyyyy_MM_dd(patients.getBookbuildingDate())); | |
90 | 112 | antExChuQuery.setPid(patients.getPid()); |
91 | 113 | antExChuQuery.setYn(YnEnums.YES.getId()); |
92 | 114 | //初诊次数 |
... | ... | @@ -126,7 +148,7 @@ |
126 | 148 | return 0; |
127 | 149 | } |
128 | 150 | }); |
129 | - Patients patients1=new Patients(); | |
151 | + Patients patients1 = new Patients(); | |
130 | 152 | patients1.setId(patients.getId()); |
131 | 153 | patients1.setLastCTime(list.get(0)); |
132 | 154 | patientsService.updatePatient(patients1); |
133 | 155 | |
134 | 156 | |
... | ... | @@ -153,14 +175,23 @@ |
153 | 175 | riskPatientsResult.setCheckDoctor(list.get(0).getProdDoctor()); |
154 | 176 | } |
155 | 177 | } |
156 | - Patients patients1=new Patients(); | |
178 | + Patients patients1 = new Patients(); | |
157 | 179 | patients1.setId(patients.getId()); |
158 | 180 | patients1.setLastCTime(list.get(0).getCheckTime()); |
159 | 181 | patientsService.updatePatient(patients1); |
160 | 182 | } |
161 | 183 | } |
162 | 184 | stopWatch.stop(); |
185 | + //注册地址 | |
186 | + riskPatientsResult.setRegisterAddr(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService)); | |
187 | + riskPatientsResult.setAddr(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService)); | |
188 | + try { | |
189 | + riskPatientsResult.setFirstBH(organizationService.getOrganization(Integer.valueOf(patients.getHospitalId())).getName()); | |
190 | + } catch (Exception e) { | |
191 | + riskPatientsResult.setFirstBH(""); | |
192 | + } | |
163 | 193 | |
194 | + | |
164 | 195 | riskPatientsResult.setServiceType(ServiceTypeEnums.getTitleById(patients.getServiceType())); |
165 | 196 | riskPatientsResult.setServiceStatus(ServiceStatusEnums.getNameById(patients.getServiceStatus())); |
166 | 197 | riskPatientsResult.setcTime(nextCheckTime); |
... | ... | @@ -200,7 +231,7 @@ |
200 | 231 | if (name.indexOf("预警") > -1) { |
201 | 232 | name = name.replace("预警", ""); |
202 | 233 | } |
203 | - map.put("name",name); | |
234 | + map.put("name", name); | |
204 | 235 | map.put("color", "risk_" + RiskDefaultTypeEnum.getColor(name)); |
205 | 236 | level.add(map); |
206 | 237 | } |
207 | 238 | |
... | ... | @@ -218,14 +249,15 @@ |
218 | 249 | } |
219 | 250 | return dataList; |
220 | 251 | } |
221 | - public static void main(String[] args){ | |
252 | + | |
253 | + public static void main(String[] args) { | |
222 | 254 | List level = new ArrayList(); |
223 | 255 | Map map = new HashMap(); |
224 | 256 | String name = "黄色预警"; |
225 | 257 | if (name.indexOf("预警") > -1) { |
226 | 258 | name = name.replace("预警", ""); |
227 | 259 | } |
228 | - map.put("name",name); | |
260 | + map.put("name", name); | |
229 | 261 | map.put("color", "risk_" + RiskDefaultTypeEnum.getColor(name)); |
230 | 262 | |
231 | 263 | Map map1 = new HashMap(); |
... | ... | @@ -233,7 +265,7 @@ |
233 | 265 | if (name.indexOf("预警") > -1) { |
234 | 266 | name1 = name1.replace("预警", ""); |
235 | 267 | } |
236 | - map1.put("name",name1); | |
268 | + map1.put("name", name1); | |
237 | 269 | map1.put("color", "risk_" + RiskDefaultTypeEnum.getColor(name1)); |
238 | 270 | level.add(map1); |
239 | 271 |