Commit f12a24867f21457fc9c7368efcb0bf2bfd973c0e
1 parent
6ba2310ef7
Exists in
master
and in
6 other branches
复诊修改优化
Showing 3 changed files with 95 additions and 69 deletions
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/PatientDaoImpl.java
View file @
f12a248
... | ... | @@ -41,7 +41,7 @@ |
41 | 41 | public void updatePatientOneCol(String id, Object colValue) { |
42 | 42 | this.mongoTemplate.updateFirst(new Query(Criteria.where("id").is(id)), Update.update("nextCheckTime", colValue), Patients.class); |
43 | 43 | //为了使修改为空的时候能够同步到线上 |
44 | - updatePatient( findById(id), id); | |
44 | + //updatePatient( findById(id), id); | |
45 | 45 | } |
46 | 46 | |
47 | 47 | @Override |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java
View file @
f12a248
... | ... | @@ -160,7 +160,7 @@ |
160 | 160 | //修改主档 |
161 | 161 | if (null != patients && StringUtils.isNotEmpty(patients.getSource())) { |
162 | 162 | Patients p = findOnePatientById(patients.getSource()); |
163 | - updatePatientOneCol(p.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(nextCheckTime) == true ? null : DateUtil.parseYMD(nextCheckTime)); | |
163 | + updatePatientOneCol(p.getId(), StringUtils.isEmpty(nextCheckTime) == true ? null : DateUtil.parseYMD(nextCheckTime)); | |
164 | 164 | } else if (null != patients) { |
165 | 165 | PatientsQuery patientsQuery1 = new PatientsQuery(); |
166 | 166 | patientsQuery1.setSource(id); |
167 | 167 | |
... | ... | @@ -168,11 +168,11 @@ |
168 | 168 | List<Patients> list = queryPatient(patientsQuery1); |
169 | 169 | if (CollectionUtils.isNotEmpty(list)) { |
170 | 170 | for (Patients p : list) { |
171 | - updatePatientOneCol(p.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(nextCheckTime) == true ? null : DateUtil.parseYMD(nextCheckTime)); | |
171 | + updatePatientOneCol(p.getId(), StringUtils.isEmpty(nextCheckTime) == true ? null : DateUtil.parseYMD(nextCheckTime)); | |
172 | 172 | } |
173 | 173 | } |
174 | 174 | } |
175 | - updatePatientOneCol(id, com.lyms.platform.common.utils.StringUtils.isEmpty(nextCheckTime) == true ? null : DateUtil.parseYMD(nextCheckTime)); | |
175 | + //updatePatientOneCol(id, com.lyms.platform.common.utils.StringUtils.isEmpty(nextCheckTime) == true ? null : DateUtil.parseYMD(nextCheckTime)); | |
176 | 176 | } |
177 | 177 | } |
178 | 178 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
f12a248
... | ... | @@ -29,10 +29,12 @@ |
29 | 29 | import org.slf4j.Logger; |
30 | 30 | import org.slf4j.LoggerFactory; |
31 | 31 | import org.springframework.beans.factory.annotation.Autowired; |
32 | +import org.springframework.beans.factory.annotation.Qualifier; | |
32 | 33 | import org.springframework.data.domain.Sort; |
33 | 34 | import org.springframework.data.mongodb.core.MongoTemplate; |
34 | 35 | import org.springframework.data.mongodb.core.query.Criteria; |
35 | 36 | import org.springframework.data.mongodb.core.query.Query; |
37 | +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | |
36 | 38 | import org.springframework.stereotype.Component; |
37 | 39 | import org.springframework.util.StopWatch; |
38 | 40 | |
... | ... | @@ -108,6 +110,10 @@ |
108 | 110 | private HosptialHighRiskFacade highRiskFacade; |
109 | 111 | |
110 | 112 | @Autowired |
113 | + @Qualifier("commonThreadPool") | |
114 | + private ThreadPoolTaskExecutor commonThreadPool; | |
115 | + | |
116 | + @Autowired | |
111 | 117 | private MeasureInfoFacade measureInfoFacade; |
112 | 118 | |
113 | 119 | @Autowired |
114 | 120 | |
... | ... | @@ -213,13 +219,13 @@ |
213 | 219 | p1.setRiskFactorId(patients.getRiskFactorId()); |
214 | 220 | p1.setRiskLevelId(patients.getRiskLevelId()); |
215 | 221 | p1.setRiskScore(patients.getRiskScore()); |
216 | - p1.setNextCheckTime(com.lyms.platform.common.utils.StringUtils.isEmpty(nextCheckTime) ? null : DateUtil.parseYMD(nextCheckTime)); | |
222 | + //-- p1.setNextCheckTime(com.lyms.platform.common.utils.StringUtils.isEmpty(nextCheckTime) ? null : DateUtil.parseYMD(nextCheckTime)); | |
217 | 223 | p1.setFmDate(patients.getFmDate()); |
218 | 224 | p1.setServiceStatus(patients.getServiceStatus()); |
219 | 225 | p1.setLastCheckEmployeeId(patients.getLastCheckEmployeeId()); |
220 | 226 | |
221 | 227 | patientsService.updatePatient(p1); |
222 | - patientsService.updatePatientOneCol(masterPatients.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(nextCheckTime) ? null : DateUtil.parseYMD(nextCheckTime)); | |
228 | + //--patientsService.updatePatientOneCol(masterPatients.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(nextCheckTime) ? null : DateUtil.parseYMD(nextCheckTime)); | |
223 | 229 | } else { |
224 | 230 | PatientsQuery patientsQuery1 = new PatientsQuery(); |
225 | 231 | patientsQuery1.setSource(parentId); |
226 | 232 | |
... | ... | @@ -239,12 +245,12 @@ |
239 | 245 | p1.setRiskFactorId(patients.getRiskFactorId()); |
240 | 246 | p1.setRiskLevelId(patients.getRiskLevelId()); |
241 | 247 | p1.setRiskScore(patients.getRiskScore()); |
242 | - p1.setNextCheckTime(com.lyms.platform.common.utils.StringUtils.isEmpty(nextCheckTime) ? null : DateUtil.parseYMD(nextCheckTime)); | |
248 | + //--p1.setNextCheckTime(com.lyms.platform.common.utils.StringUtils.isEmpty(nextCheckTime) ? null : DateUtil.parseYMD(nextCheckTime)); | |
243 | 249 | p1.setFmDate(patients.getFmDate()); |
244 | 250 | p1.setServiceStatus(patients.getServiceStatus()); |
245 | 251 | p1.setLastCheckEmployeeId(patients.getLastCheckEmployeeId()); |
246 | 252 | patientsService.updatePatient(p1); |
247 | - patientsService.updatePatientOneCol(p.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(nextCheckTime) ? null : DateUtil.parseYMD(nextCheckTime)); | |
253 | + //--patientsService.updatePatientOneCol(p.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(nextCheckTime) ? null : DateUtil.parseYMD(nextCheckTime)); | |
248 | 254 | } |
249 | 255 | } |
250 | 256 | } |
251 | 257 | |
252 | 258 | |
... | ... | @@ -257,19 +263,15 @@ |
257 | 263 | * @param antExAddRequest |
258 | 264 | * @return |
259 | 265 | */ |
260 | - public BaseResponse addOneAntEx(AntExAddRequest antExAddRequest, Integer userId) { | |
261 | - String hospitalId = autoMatchFacade.getHospitalId(userId); | |
266 | + public BaseResponse addOneAntEx(final AntExAddRequest antExAddRequest, Integer userId) { | |
267 | + final String hospitalId = autoMatchFacade.getHospitalId(userId); | |
262 | 268 | AntenatalExaminationModel model = antExAddRequest.convertToDataModel(); |
263 | 269 | //表示区域的 |
264 | 270 | if (StringUtils.isNotEmpty(groupsFacade.findByCurrentUserId(hospitalId))) { |
265 | 271 | String parentId = handHideBuild(antExAddRequest.getPid(), antExAddRequest.getParentId(), userId, 1); |
266 | - if (StringUtils.isEmpty(parentId)) { | |
267 | - //打印日志 | |
268 | - } | |
269 | 272 | model.setParentId(parentId); |
270 | 273 | antExAddRequest.setParentId(parentId); |
271 | 274 | Patients p = patientsService.findOnePatientById(parentId); |
272 | - | |
273 | 275 | //加入产筛 |
274 | 276 | patientsService.validata(p); |
275 | 277 | } |
276 | 278 | |
277 | 279 | |
278 | 280 | |
279 | 281 | |
280 | 282 | |
281 | 283 | |
... | ... | @@ -282,27 +284,32 @@ |
282 | 284 | //修改申请单状态 |
283 | 285 | updateApplyOrder(model, antExAddRequest.getParentId()); |
284 | 286 | |
285 | - Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId()); | |
287 | + commonThreadPool.execute(new Runnable() { | |
288 | + @Override | |
289 | + public void run() { | |
290 | + //更新主档案或者子档案下次预约时间冗余到patient表的数据 | |
291 | + patientsService.updateNextCheckTime(antExAddRequest.getNextCheckTime(), antExAddRequest.getParentId()); | |
286 | 292 | |
287 | - patients.setLastCheckEmployeeId(antExAddRequest.getCheckDoctor()); | |
288 | - patientsService.updateNextCheckTime(antExAddRequest.getNextCheckTime(), patients.getId()); | |
289 | - patientsService.updatePatient(patients); | |
290 | - patientsService.updatePatientOneCol(patients.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(antExAddRequest.getNextCheckTime()) ? null : DateUtil.parseYMD(antExAddRequest.getNextCheckTime())); | |
291 | - //修改孕妇高危等级 | |
292 | - updateLastRisk(antExAddRequest.getParentId()); | |
293 | + Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId()); | |
294 | + patients.setLastCheckEmployeeId(antExAddRequest.getCheckDoctor()); | |
295 | + patientsService.updatePatient(patients); | |
293 | 296 | |
294 | - //修改本院最后一次定义高危 | |
295 | - updateLastRhTime(patients.getId(), hospitalId); | |
296 | - //修改最后一次检查时间 | |
297 | - setLashCTimes(antExAddRequest.getParentId()); | |
297 | + //修改孕妇高危等级 | |
298 | + updateLastRisk(antExAddRequest.getParentId()); | |
298 | 299 | |
300 | + //修改本院最后一次定义高危 | |
301 | + updateLastRhTime(patients.getId(), hospitalId); | |
302 | + //修改最后一次检查时间 | |
303 | + setLashCTimes(antExAddRequest.getParentId()); | |
299 | 304 | |
300 | - //修改数据 | |
301 | - syncMaster(antExAddRequest.getParentId(), antExAddRequest.getNextCheckTime()); | |
302 | 305 | |
303 | - //复诊,修改产检管理 | |
304 | - antenatalExaminationService.updateAntExRecord(antExAddRequest.getId(), 2); | |
306 | + //修改数据 | |
307 | + syncMaster(antExAddRequest.getParentId(), antExAddRequest.getNextCheckTime()); | |
305 | 308 | |
309 | + //复诊,修改产检管理 | |
310 | + antenatalExaminationService.updateAntExRecord(antExAddRequest.getId(), 2); | |
311 | + } | |
312 | + }); | |
306 | 313 | |
307 | 314 | AntExQuery antExQuery = new AntExQuery(); |
308 | 315 | antExQuery.setId(antExAddRequest.getId()); |
... | ... | @@ -321,25 +328,6 @@ |
321 | 328 | return new BaseResponse().setErrorcode(ErrorCodeConstants.DATA_EXIST).setErrormsg("同一天只能建一次复诊"); |
322 | 329 | } |
323 | 330 | |
324 | - Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId()); | |
325 | - Patients patients1 = new Patients(); | |
326 | - patients1.setId(patients.getId()); | |
327 | - patients1.setLastCheckEmployeeId(antExAddRequest.getCheckDoctor()); | |
328 | - | |
329 | - model.setPid(patients.getPid()); | |
330 | - if (StringUtils.isNotEmpty(patients.getEnable()) && "0".equals(patients.getEnable())) { | |
331 | - patients1.setEnable("1"); | |
332 | - } | |
333 | - | |
334 | - patientsService.updateNextCheckTime(antExAddRequest.getNextCheckTime(), patients.getId()); | |
335 | - patientsService.updatePatient(patients1); | |
336 | - patientsService.updatePatientOneCol(patients.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(antExAddRequest.getNextCheckTime()) ? null : DateUtil.parseYMD(antExAddRequest.getNextCheckTime())); | |
337 | - | |
338 | - antenatalExaminationService.addOneBabyAnt(model); | |
339 | - | |
340 | - | |
341 | - operateLogFacade.addAddOptLog(userId, Integer.parseInt(hospitalId), model, OptActionEnums.ADD.getId(), "添加复诊"); | |
342 | - | |
343 | 331 | /** 验证产检券是否可用 可用就改为已使用状态 */ |
344 | 332 | if (StringUtils.isNotBlank(antExAddRequest.getCouponCode()) && antExAddRequest.getCouponType() != null) { |
345 | 333 | BaseObjectResponse resp = couponService.validate(antExAddRequest.getCouponCode(), antExAddRequest.getCouponType(), autoMatchFacade.getHospitalId(userId)); |
346 | 334 | |
347 | 335 | |
348 | 336 | |
349 | 337 | |
... | ... | @@ -350,22 +338,52 @@ |
350 | 338 | } |
351 | 339 | } |
352 | 340 | |
353 | - //修改最后一次检查时间 | |
354 | - setLashCTimes(antExAddRequest.getParentId()); | |
355 | 341 | //修改申请单状态 |
356 | 342 | updateApplyOrder(model, antExAddRequest.getParentId()); |
357 | - //修改孕妇高危等级 | |
358 | -// updatePatientRiskLevel(model, patients); | |
359 | - //修改孕妇高危 | |
360 | - updateLastRisk(antExAddRequest.getParentId()); | |
361 | 343 | |
362 | - //修改本院最后一次定义高危 | |
363 | - updateLastRhTime(patients.getId(), hospitalId); | |
344 | + final Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId()); | |
345 | + model.setPid(patients.getPid()); | |
364 | 346 | |
365 | - //修改数据 | |
366 | - syncMaster(antExAddRequest.getParentId(), antExAddRequest.getNextCheckTime()); | |
347 | + antenatalExaminationService.addOneBabyAnt(model); | |
348 | + | |
349 | + commonThreadPool.execute(new Runnable() { | |
350 | + @Override | |
351 | + public void run() { | |
352 | + patientsService.updateNextCheckTime(antExAddRequest.getNextCheckTime(), antExAddRequest.getParentId()); | |
353 | + | |
354 | + Patients patients1 = new Patients(); | |
355 | + patients1.setId(patients.getId()); | |
356 | + patients1.setLastCheckEmployeeId(antExAddRequest.getCheckDoctor()); | |
357 | + | |
358 | + | |
359 | + if (StringUtils.isNotEmpty(patients.getEnable()) && "0".equals(patients.getEnable())) { | |
360 | + patients1.setEnable("1"); | |
361 | + } | |
362 | + | |
363 | + patientsService.updatePatient(patients1); | |
364 | + | |
365 | + //修改最后一次检查时间 | |
366 | + setLashCTimes(antExAddRequest.getParentId()); | |
367 | + | |
368 | + //修改孕妇高危等级 | |
369 | + //updatePatientRiskLevel(model, patients); | |
370 | + //修改孕妇高危 | |
371 | + updateLastRisk(antExAddRequest.getParentId()); | |
372 | + | |
373 | + //修改本院最后一次定义高危 | |
374 | + updateLastRhTime(patients.getId(), hospitalId); | |
375 | + | |
376 | + //修改数据 | |
377 | + syncMaster(antExAddRequest.getParentId(), antExAddRequest.getNextCheckTime()); | |
378 | + | |
379 | + } | |
380 | + }); | |
381 | + | |
367 | 382 | //复诊,修改产检管理 |
368 | 383 | antenatalExaminationService.updateAntExRecord(model.getId(), 2); |
384 | + | |
385 | + operateLogFacade.addAddOptLog(userId, Integer.parseInt(hospitalId), model, OptActionEnums.ADD.getId(), "添加复诊"); | |
386 | + | |
369 | 387 | if (null != patients.getBuildType() && patients.getBuildType() == 3) { |
370 | 388 | ReferralApplyOrderQuery referralApplyOrderQuery = new ReferralApplyOrderQuery(); |
371 | 389 | referralApplyOrderQuery.setParentId(patients.getId()); |
372 | 390 | |
373 | 391 | |
... | ... | @@ -405,19 +423,27 @@ |
405 | 423 | } |
406 | 424 | |
407 | 425 | |
408 | - public void updateApplyOrder(AntenatalExaminationModel antenatalExamination, String parentId) { | |
409 | - ReferralApplyOrderQuery referralApplyOrderQuery = new ReferralApplyOrderQuery(); | |
410 | - referralApplyOrderQuery.setParentId(parentId); | |
426 | + public void updateApplyOrder(final AntenatalExaminationModel antenatalExamination, final String parentId) { | |
411 | 427 | |
412 | - ReferralApplyOrderModel referralApplyOrderModel = new ReferralApplyOrderModel(); | |
413 | - referralApplyOrderModel.setScore(NumberUtils.toInt(antenatalExamination.getRiskScore())); | |
414 | - try { | |
415 | - List l = JsonUtil.toList(antenatalExamination.getRiskFactor(), List.class); | |
416 | - referralApplyOrderModel.setrRisk(queryRiskName(l)); | |
417 | - } catch (Exception e) { | |
418 | - } | |
428 | + commonThreadPool.execute(new Runnable() { | |
429 | + @Override | |
430 | + public void run() { | |
431 | + ReferralApplyOrderQuery referralApplyOrderQuery = new ReferralApplyOrderQuery(); | |
432 | + referralApplyOrderQuery.setParentId(parentId); | |
419 | 433 | |
420 | - applyOrderService.updateByParentId(referralApplyOrderQuery, referralApplyOrderModel); | |
434 | + ReferralApplyOrderModel referralApplyOrderModel = new ReferralApplyOrderModel(); | |
435 | + referralApplyOrderModel.setScore(NumberUtils.toInt(antenatalExamination.getRiskScore())); | |
436 | + try { | |
437 | + List l = JsonUtil.toList(antenatalExamination.getRiskFactor(), List.class); | |
438 | + referralApplyOrderModel.setrRisk(queryRiskName(l)); | |
439 | + } catch (Exception e) { | |
440 | + } | |
441 | + | |
442 | + applyOrderService.updateByParentId(referralApplyOrderQuery, referralApplyOrderModel); | |
443 | + } | |
444 | + }); | |
445 | + | |
446 | + | |
421 | 447 | } |
422 | 448 | |
423 | 449 | /** |