Commit 5e237ee2aca79a37db229417ef22a04fcf6a3f7c
1 parent
b8f8086b9c
Exists in
master
and in
6 other branches
1
Showing 2 changed files with 39 additions and 98 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanPatientWorker.java
View file @
5e237ee
... | ... | @@ -55,14 +55,14 @@ |
55 | 55 | UsersService usersService, |
56 | 56 | String hospital, |
57 | 57 | AntenatalExaminationService antExService, |
58 | - BasicConfigService basicConfigService,PatientsService patientsService,OrganizationService organizationService) { | |
58 | + BasicConfigService basicConfigService, PatientsService patientsService, OrganizationService organizationService) { | |
59 | 59 | this.patientses = patientses; |
60 | 60 | this.usersService = usersService; |
61 | 61 | this.antExService = antExService; |
62 | 62 | this.hospital = hospital; |
63 | 63 | this.basicConfigService = basicConfigService; |
64 | - this.patientsService=patientsService; | |
65 | - this.organizationService=organizationService; | |
64 | + this.patientsService = patientsService; | |
65 | + this.organizationService = organizationService; | |
66 | 66 | } |
67 | 67 | |
68 | 68 | @Override |
69 | 69 | |
... | ... | @@ -100,9 +100,9 @@ |
100 | 100 | i = ant.size(); |
101 | 101 | for (AntenatalExaminationModel a : ant) { |
102 | 102 | try { |
103 | - if(StringUtils.isNotEmpty(a.getHospitalId())){ | |
103 | + if (StringUtils.isNotEmpty(a.getHospitalId())) { | |
104 | 104 | Organization og = organizationService.getOrganization(Integer.valueOf(a.getHospitalId())); |
105 | - if(null!=og){ | |
105 | + if (null != og) { | |
106 | 106 | quanPatientsResult.setCurrentCh(og.getName()); |
107 | 107 | break; |
108 | 108 | } |
109 | 109 | |
110 | 110 | |
111 | 111 | |
... | ... | @@ -111,16 +111,16 @@ |
111 | 111 | quanPatientsResult.setCurrentCh(""); |
112 | 112 | } |
113 | 113 | } |
114 | - }else{ | |
115 | - AntExChuQuery antExChuQuery1=new AntExChuQuery(); | |
114 | + } else { | |
115 | + AntExChuQuery antExChuQuery1 = new AntExChuQuery(); | |
116 | 116 | antExChuQuery1.setPid(patients.getPid()); |
117 | 117 | antExChuQuery1.setYn(YnEnums.YES.getId()); |
118 | - List<AntExChuModel> chu= antExService.queryAntExChu(antExChuQuery1); | |
118 | + List<AntExChuModel> chu = antExService.queryAntExChu(antExChuQuery1); | |
119 | 119 | for (AntExChuModel a : chu) { |
120 | 120 | try { |
121 | - if(StringUtils.isNotEmpty(a.getHospitalId())){ | |
121 | + if (StringUtils.isNotEmpty(a.getHospitalId())) { | |
122 | 122 | Organization og = organizationService.getOrganization(Integer.valueOf(a.getHospitalId())); |
123 | - if(null!=og){ | |
123 | + if (null != og) { | |
124 | 124 | quanPatientsResult.setCurrentCh(og.getName()); |
125 | 125 | break; |
126 | 126 | } |
127 | 127 | |
128 | 128 | |
129 | 129 | |
130 | 130 | |
131 | 131 | |
132 | 132 | |
133 | 133 | |
... | ... | @@ -150,70 +150,26 @@ |
150 | 150 | stopWatch.stop(); |
151 | 151 | String nextCheckTime = ""; |
152 | 152 | stopWatch.start("query antex list"); |
153 | - List<AntenatalExaminationModel> examinationModels = antExService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); | |
154 | - if (CollectionUtils.isNotEmpty(examinationModels)) { | |
155 | - //设置最后一次检查时间 | |
156 | - if (null == patients.getLastCTime()) { | |
157 | - List<Date> list = new ArrayList<>(); | |
158 | - for (AntenatalExaminationModel antEx : examinationModels) { | |
159 | - list.add(antEx.getCheckDate()); | |
160 | - } | |
161 | 153 | |
162 | - Collections.sort(list, new Comparator<Date>() { | |
163 | - @Override | |
164 | - public int compare(Date o1, Date o2) { | |
165 | - if (o1 != null && o1.after(o2)) { | |
166 | - return -1; | |
167 | - } | |
168 | - if (o1 != null && o1.before(o2)) { | |
169 | - return 1; | |
170 | - } | |
171 | - return 0; | |
172 | - } | |
173 | - }); | |
174 | - Patients patients1=new Patients(); | |
175 | - patients1.setId(patients.getId()); | |
176 | - patients1.setLastCTime(list.get(0)); | |
177 | - patientsService.updatePatient(patients1); | |
178 | - } | |
179 | 154 | |
155 | + if (null != patients.getNextCheckTime()) { | |
180 | 156 | nextCheckTime = DateUtil.getyyyy_MM_dd(patients.getNextCheckTime()); |
157 | + } | |
181 | 158 | |
182 | - if (StringUtils.isNotEmpty(patients.getLastCheckEmployeeId())) { | |
183 | - if (NumberUtils.isNumber(patients.getLastCheckEmployeeId())) { | |
184 | - Users users = usersService.getUsers(NumberUtils.toInt(patients.getLastCheckEmployeeId())); | |
185 | - if (null != users) { | |
186 | - quanPatientsResult.setCheckDoctor(users.getName()); | |
187 | - } else { | |
188 | - quanPatientsResult.setCheckDoctor(patients.getLastCheckEmployeeId()); | |
189 | - } | |
159 | + if (StringUtils.isNotEmpty(patients.getLastCheckEmployeeId())) { | |
160 | + if (NumberUtils.isNumber(patients.getLastCheckEmployeeId())) { | |
161 | + Users users = usersService.getUsers(NumberUtils.toInt(patients.getLastCheckEmployeeId())); | |
162 | + if (null != users) { | |
163 | + quanPatientsResult.setCheckDoctor(users.getName()); | |
190 | 164 | } else { |
191 | 165 | quanPatientsResult.setCheckDoctor(patients.getLastCheckEmployeeId()); |
192 | 166 | } |
167 | + } else { | |
168 | + quanPatientsResult.setCheckDoctor(patients.getLastCheckEmployeeId()); | |
193 | 169 | } |
194 | - | |
195 | - } else { | |
196 | - List<AntExChuModel> list = antExService.queryAntExChu(antExChuQuery); | |
197 | - if (CollectionUtils.isNotEmpty(list)) { | |
198 | - nextCheckTime = DateUtil.getyyyy_MM_dd(patients.getNextCheckTime()); | |
199 | - if (StringUtils.isNotEmpty(patients.getLastCheckEmployeeId())) { | |
200 | - if (NumberUtils.isNumber(patients.getLastCheckEmployeeId())) { | |
201 | - Users users = usersService.getUsers(NumberUtils.toInt(patients.getLastCheckEmployeeId())); | |
202 | - if (null != users) { | |
203 | - quanPatientsResult.setCheckDoctor(users.getName()); | |
204 | - } else { | |
205 | - quanPatientsResult.setCheckDoctor(patients.getLastCheckEmployeeId()); | |
206 | - } | |
207 | - } else { | |
208 | - quanPatientsResult.setCheckDoctor(patients.getLastCheckEmployeeId()); | |
209 | - } | |
210 | - } | |
211 | - /*Patients patients1=new Patients(); | |
212 | - patients1.setId(patients.getId()); | |
213 | - patients1.setLastCTime(list.get(0).getCheckTime()); | |
214 | - patientsService.updatePatient(patients1);*/ | |
215 | - } | |
216 | 170 | } |
171 | + | |
172 | + | |
217 | 173 | stopWatch.stop(); |
218 | 174 | //注册地址 |
219 | 175 | quanPatientsResult.setRegisterAddr(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService)); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/WorkHR.java
View file @
5e237ee
... | ... | @@ -53,14 +53,14 @@ |
53 | 53 | |
54 | 54 | public WorkHR(List<Patients> patientses, UsersService usersService, String hospital, |
55 | 55 | BasicConfigService basicConfigService, |
56 | - AntenatalExaminationService antExService, PatientsService patientsService,OrganizationService organizationService) { | |
56 | + AntenatalExaminationService antExService, PatientsService patientsService, OrganizationService organizationService) { | |
57 | 57 | this.patientses = patientses; |
58 | 58 | this.usersService = usersService; |
59 | 59 | this.hospital = hospital; |
60 | 60 | this.basicConfigService = basicConfigService; |
61 | 61 | this.antExService = antExService; |
62 | 62 | this.patientsService = patientsService; |
63 | - this.organizationService=organizationService; | |
63 | + this.organizationService = organizationService; | |
64 | 64 | } |
65 | 65 | |
66 | 66 | public List<RiskPatientsResult> call() { |
67 | 67 | |
... | ... | @@ -96,9 +96,9 @@ |
96 | 96 | i = ant.size(); |
97 | 97 | for (AntenatalExaminationModel a : ant) { |
98 | 98 | try { |
99 | - if(StringUtils.isNotEmpty(a.getHospitalId())){ | |
99 | + if (StringUtils.isNotEmpty(a.getHospitalId())) { | |
100 | 100 | Organization og = organizationService.getOrganization(Integer.valueOf(a.getHospitalId())); |
101 | - if(null!=og){ | |
101 | + if (null != og) { | |
102 | 102 | riskPatientsResult.setCurrentCh(og.getName()); |
103 | 103 | break; |
104 | 104 | } |
105 | 105 | |
106 | 106 | |
107 | 107 | |
... | ... | @@ -107,16 +107,16 @@ |
107 | 107 | riskPatientsResult.setCurrentCh(""); |
108 | 108 | } |
109 | 109 | } |
110 | - }else{ | |
111 | - AntExChuQuery antExChuQuery1=new AntExChuQuery(); | |
110 | + } else { | |
111 | + AntExChuQuery antExChuQuery1 = new AntExChuQuery(); | |
112 | 112 | antExChuQuery1.setPid(patients.getPid()); |
113 | 113 | antExChuQuery1.setYn(YnEnums.YES.getId()); |
114 | - List<AntExChuModel> chu= antExService.queryAntExChu(antExChuQuery1); | |
114 | + List<AntExChuModel> chu = antExService.queryAntExChu(antExChuQuery1); | |
115 | 115 | for (AntExChuModel a : chu) { |
116 | 116 | try { |
117 | - if(StringUtils.isNotEmpty(a.getHospitalId())){ | |
117 | + if (StringUtils.isNotEmpty(a.getHospitalId())) { | |
118 | 118 | Organization og = organizationService.getOrganization(Integer.valueOf(a.getHospitalId())); |
119 | - if(null!=og){ | |
119 | + if (null != og) { | |
120 | 120 | riskPatientsResult.setCurrentCh(og.getName()); |
121 | 121 | break; |
122 | 122 | } |
123 | 123 | |
124 | 124 | |
... | ... | @@ -144,33 +144,18 @@ |
144 | 144 | String nextCheckTime = ""; |
145 | 145 | stopWatch.stop(); |
146 | 146 | stopWatch.start("query antex count"); |
147 | - | |
148 | - List<AntenatalExaminationModel> examinationModels = antExService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); | |
149 | - if (CollectionUtils.isNotEmpty(examinationModels)) { | |
150 | - | |
151 | - if (NumberUtils.isNumber(patients.getLastCheckEmployeeId())) { | |
152 | - Users users = usersService.getUsers(NumberUtils.toInt(patients.getLastCheckEmployeeId())); | |
153 | - if (null != users) { | |
154 | - riskPatientsResult.setCheckDoctor(users.getName()); | |
155 | - } else { | |
156 | - riskPatientsResult.setCheckDoctor(patients.getLastCheckEmployeeId()); | |
157 | - } | |
158 | - } | |
147 | + if(null!=patients.getNextCheckTime()){ | |
159 | 148 | nextCheckTime = DateUtil.getyyyy_MM_dd(patients.getNextCheckTime()); |
160 | - } else { | |
161 | - List<AntExChuModel> list = antExService.queryAntExChu(antExChuQuery); | |
162 | - if (CollectionUtils.isNotEmpty(list)) { | |
163 | - nextCheckTime = DateUtil.getyyyy_MM_dd(patients.getNextCheckTime()); | |
164 | - if (NumberUtils.isNumber(patients.getLastCheckEmployeeId())) { | |
165 | - Users users = usersService.getUsers(NumberUtils.toInt(patients.getLastCheckEmployeeId())); | |
166 | - if (null != users) { | |
167 | - riskPatientsResult.setCheckDoctor(users.getName()); | |
168 | - } else { | |
169 | - riskPatientsResult.setCheckDoctor(patients.getLastCheckEmployeeId()); | |
170 | - } | |
171 | - } | |
149 | + } | |
150 | + if (NumberUtils.isNumber(patients.getLastCheckEmployeeId())) { | |
151 | + Users users = usersService.getUsers(NumberUtils.toInt(patients.getLastCheckEmployeeId())); | |
152 | + if (null != users) { | |
153 | + riskPatientsResult.setCheckDoctor(users.getName()); | |
154 | + } else { | |
155 | + riskPatientsResult.setCheckDoctor(patients.getLastCheckEmployeeId()); | |
172 | 156 | } |
173 | 157 | } |
158 | + | |
174 | 159 | stopWatch.stop(); |
175 | 160 | //注册地址 |
176 | 161 | riskPatientsResult.setRegisterAddr(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService)); |