Commit 15edbe47091478963624acf55f26842d8f52e335
1 parent
5e0f4540b4
Exists in
master
and in
1 other branch
复诊修改优化
Showing 1 changed file with 71 additions and 61 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
15edbe4
... | ... | @@ -347,25 +347,83 @@ |
347 | 347 | return new BaseResponse().setErrorcode(ErrorCodeConstants.DATA_EXIST).setErrormsg("同一天只能建一次复诊"); |
348 | 348 | } |
349 | 349 | |
350 | - Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId()); | |
351 | - Patients patients1 = new Patients(); | |
352 | - patients1.setId(patients.getId()); | |
353 | - patients1.setLastCheckEmployeeId(antExAddRequest.getCheckDoctor()); | |
350 | + final Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId()); | |
354 | 351 | |
355 | - model.setPid(patients.getPid()); | |
356 | - if (StringUtils.isNotEmpty(patients.getEnable()) && "0".equals(patients.getEnable())) { | |
357 | - patients1.setEnable("1"); | |
358 | - } | |
352 | + antenatalExaminationService.addOneBabyAnt(model); | |
353 | + final AntenatalExaminationModel modelTemp = model; | |
354 | + commonThreadPool.execute(new Runnable() { | |
355 | + @Override | |
356 | + public void run() { | |
359 | 357 | |
360 | - patientsService.updateNextCheckTime(antExAddRequest.getNextCheckTime(), patients.getId()); | |
361 | - patientsService.updatePatient(patients1); | |
362 | - patientsService.updatePatientOneCol(patients.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(antExAddRequest.getNextCheckTime()) ? null : DateUtil.parseYMD(antExAddRequest.getNextCheckTime())); | |
358 | + Patients patients1 = new Patients(); | |
359 | + patients1.setId(patients.getId()); | |
360 | + patients1.setLastCheckEmployeeId(antExAddRequest.getCheckDoctor()); | |
363 | 361 | |
364 | - antenatalExaminationService.addOneBabyAnt(model); | |
362 | + modelTemp.setPid(patients.getPid()); | |
363 | + if (StringUtils.isNotEmpty(patients.getEnable()) && "0".equals(patients.getEnable())) { | |
364 | + patients1.setEnable("1"); | |
365 | + } | |
365 | 366 | |
366 | 367 | |
367 | - operateLogFacade.addAddOptLog(userId, Integer.parseInt(hospitalId), model, OptActionEnums.ADD.getId(), "添加复诊"); | |
368 | + patientsService.updateNextCheckTime(antExAddRequest.getNextCheckTime(), patients.getId()); | |
369 | + patientsService.updatePatient(patients1); | |
370 | + patientsService.updatePatientOneCol(patients.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(antExAddRequest.getNextCheckTime()) ? null : DateUtil.parseYMD(antExAddRequest.getNextCheckTime())); | |
368 | 371 | |
372 | + operateLogFacade.addAddOptLog(userId, Integer.parseInt(hospitalId), modelTemp, OptActionEnums.ADD.getId(), "添加复诊"); | |
373 | + | |
374 | + | |
375 | + | |
376 | + //修改最后一次检查时间 | |
377 | + setLashCTimes(antExAddRequest.getParentId()); | |
378 | + //修改申请单状态 | |
379 | + updateApplyOrder(modelTemp, antExAddRequest.getParentId()); | |
380 | + //修改孕妇高危等级 | |
381 | + //updatePatientRiskLevel(model, patients); | |
382 | + //修改孕妇高危 | |
383 | + updateLastRisk(antExAddRequest.getParentId()); | |
384 | + | |
385 | + //修改本院最后一次定义高危 | |
386 | + updateLastRhTime(patients.getId(), hospitalId); | |
387 | + | |
388 | + //修改数据 | |
389 | + syncMaster(antExAddRequest.getParentId(), antExAddRequest.getNextCheckTime()); | |
390 | + //复诊,修改产检管理 | |
391 | + antenatalExaminationService.updateAntExRecord(modelTemp.getId(), 2); | |
392 | + if (null != patients.getBuildType() && patients.getBuildType() == 3) { | |
393 | + ReferralApplyOrderQuery referralApplyOrderQuery = new ReferralApplyOrderQuery(); | |
394 | + referralApplyOrderQuery.setParentId(patients.getId()); | |
395 | + String hospital = autoMatchFacade.getHospitalId(userId); | |
396 | + referralApplyOrderQuery.setHospitalId(hospital); | |
397 | + referralApplyOrderQuery.setStatus(1); | |
398 | + List<ReferralApplyOrderModel> orderModelList = applyOrderService.queryReferralApplyOrderWithQuery(referralApplyOrderQuery); | |
399 | + if (CollectionUtils.isNotEmpty(orderModelList)) { | |
400 | + String outHospitalId = orderModelList.get(0).getOutHospitalId(); | |
401 | + ReferralApplyOrderQuery referralApplyOrderQuery1 = new ReferralApplyOrderQuery(); | |
402 | + referralApplyOrderQuery1.setOutHospitalId(outHospitalId); | |
403 | + referralApplyOrderQuery1.setTransferredHospital(hospital); | |
404 | + referralApplyOrderQuery1.setPid(patients.getPid()); | |
405 | + referralApplyOrderQuery1.setStatus(1); | |
406 | + ReferralApplyOrderModel model1 = new ReferralApplyOrderModel(); | |
407 | + //设置接收时间 | |
408 | + model1.setReceived(modelTemp.getCheckDate()); | |
409 | + model1.setRecDoctor(modelTemp.getCheckDoctor()); | |
410 | + model1.setModified(new Date()); | |
411 | + model1.setStatus(2); | |
412 | + applyOrderService.updateByParentId(referralApplyOrderQuery1, model1); | |
413 | + ReferralApplyOrderQuery referralApplyOrderQuery2 = new ReferralApplyOrderQuery(); | |
414 | + referralApplyOrderQuery2.setOutHospitalId(hospital); | |
415 | + referralApplyOrderQuery2.setTransferredHospital(outHospitalId); | |
416 | + referralApplyOrderQuery2.setPid(patients.getPid()); | |
417 | + referralApplyOrderQuery2.setStatus(1); | |
418 | + applyOrderService.updateByParentId(referralApplyOrderQuery2, model1); | |
419 | + } | |
420 | + } | |
421 | + //添加复诊时添加追访信息 | |
422 | + addTrackDownInfo(userId,patients); | |
423 | + } | |
424 | + }); | |
425 | + | |
426 | + | |
369 | 427 | /** 验证产检券是否可用 可用就改为已使用状态 */ |
370 | 428 | if (StringUtils.isNotBlank(antExAddRequest.getCouponCode()) && antExAddRequest.getCouponType() != null) { |
371 | 429 | BaseObjectResponse resp = couponService.validate(antExAddRequest.getCouponCode(), antExAddRequest.getCouponType(), autoMatchFacade.getHospitalId(userId)); |
... | ... | @@ -375,54 +433,6 @@ |
375 | 433 | couponService.use(autoMatchFacade.getHospitalId(userId), antExAddRequest.getCouponCode(), userId, model.getId()); |
376 | 434 | } |
377 | 435 | } |
378 | - | |
379 | - //修改最后一次检查时间 | |
380 | - setLashCTimes(antExAddRequest.getParentId()); | |
381 | - //修改申请单状态 | |
382 | - updateApplyOrder(model, antExAddRequest.getParentId()); | |
383 | - //修改孕妇高危等级 | |
384 | -// updatePatientRiskLevel(model, patients); | |
385 | - //修改孕妇高危 | |
386 | - updateLastRisk(antExAddRequest.getParentId()); | |
387 | - | |
388 | - //修改本院最后一次定义高危 | |
389 | - updateLastRhTime(patients.getId(), hospitalId); | |
390 | - | |
391 | - //修改数据 | |
392 | - syncMaster(antExAddRequest.getParentId(), antExAddRequest.getNextCheckTime()); | |
393 | - //复诊,修改产检管理 | |
394 | - antenatalExaminationService.updateAntExRecord(model.getId(), 2); | |
395 | - if (null != patients.getBuildType() && patients.getBuildType() == 3) { | |
396 | - ReferralApplyOrderQuery referralApplyOrderQuery = new ReferralApplyOrderQuery(); | |
397 | - referralApplyOrderQuery.setParentId(patients.getId()); | |
398 | - String hospital = autoMatchFacade.getHospitalId(userId); | |
399 | - referralApplyOrderQuery.setHospitalId(hospital); | |
400 | - referralApplyOrderQuery.setStatus(1); | |
401 | - List<ReferralApplyOrderModel> orderModelList = applyOrderService.queryReferralApplyOrderWithQuery(referralApplyOrderQuery); | |
402 | - if (CollectionUtils.isNotEmpty(orderModelList)) { | |
403 | - String outHospitalId = orderModelList.get(0).getOutHospitalId(); | |
404 | - ReferralApplyOrderQuery referralApplyOrderQuery1 = new ReferralApplyOrderQuery(); | |
405 | - referralApplyOrderQuery1.setOutHospitalId(outHospitalId); | |
406 | - referralApplyOrderQuery1.setTransferredHospital(hospital); | |
407 | - referralApplyOrderQuery1.setPid(patients.getPid()); | |
408 | - referralApplyOrderQuery1.setStatus(1); | |
409 | - ReferralApplyOrderModel model1 = new ReferralApplyOrderModel(); | |
410 | - //设置接收时间 | |
411 | - model1.setReceived(model.getCheckDate()); | |
412 | - model1.setRecDoctor(model.getCheckDoctor()); | |
413 | - model1.setModified(new Date()); | |
414 | - model1.setStatus(2); | |
415 | - applyOrderService.updateByParentId(referralApplyOrderQuery1, model1); | |
416 | - ReferralApplyOrderQuery referralApplyOrderQuery2 = new ReferralApplyOrderQuery(); | |
417 | - referralApplyOrderQuery2.setOutHospitalId(hospital); | |
418 | - referralApplyOrderQuery2.setTransferredHospital(outHospitalId); | |
419 | - referralApplyOrderQuery2.setPid(patients.getPid()); | |
420 | - referralApplyOrderQuery2.setStatus(1); | |
421 | - applyOrderService.updateByParentId(referralApplyOrderQuery2, model1); | |
422 | - } | |
423 | - } | |
424 | - //添加复诊时添加追访信息 | |
425 | - addTrackDownInfo(userId,patients); | |
426 | 436 | } |
427 | 437 | |
428 | 438 | commonThreadPool.execute(new Runnable() { |