Commit af25c6b9e607294925f4dd81d435bd8badbd9bf1
1 parent
e4b08764ab
Exists in
master
and in
6 other branches
update
Showing 2 changed files with 18 additions and 114 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
af25c6b
| ... | ... | @@ -2454,118 +2454,7 @@ |
| 2454 | 2454 | return objectResponse; |
| 2455 | 2455 | } |
| 2456 | 2456 | |
| 2457 | - public BaseListResponse queryObstetricDiagnosisQhdList1(BabyManageRequest request, Integer userId) { | |
| 2458 | 2457 | |
| 2459 | - String hospitalName = ""; | |
| 2460 | - String hospitalId = ""; | |
| 2461 | - //得到当前登录的医院id | |
| 2462 | - List<String> hospitalIdList = new ArrayList<>(); | |
| 2463 | - List<BabyManageListResult> list = null; | |
| 2464 | - BabyModelQuery babyQuery = null; | |
| 2465 | - List<BabyModel> models = null; | |
| 2466 | - try { | |
| 2467 | - if (userId != null) { | |
| 2468 | - Users dbuser = usersService.getUsers(userId); | |
| 2469 | - if (dbuser != null) { | |
| 2470 | - hospitalId = String.valueOf(dbuser.getOrgId()); | |
| 2471 | - hospitalIdList.add(hospitalId); | |
| 2472 | - hospitalName = organizationService.getOrganization(Integer.valueOf(hospitalId)).getName(); | |
| 2473 | - } | |
| 2474 | - } | |
| 2475 | - //获取全部儿童信息 | |
| 2476 | - list = new ArrayList<>(); | |
| 2477 | - babyQuery = new BabyModelQuery(); | |
| 2478 | - babyQuery.setNeed("true"); | |
| 2479 | - babyQuery.setPage(request.getPage()); | |
| 2480 | - babyQuery.setLimit(request.getLimit()); | |
| 2481 | - babyQuery.setQueryNo(request.getQueryNo()); | |
| 2482 | - babyQuery.setHospitalIdList(hospitalIdList); | |
| 2483 | - List buildType = new ArrayList(); | |
| 2484 | - buildType.add(1);//儿童直接建档 | |
| 2485 | - buildType.add(2);//产妇分娩建档 | |
| 2486 | - babyQuery.setBuildTypeList(buildType); | |
| 2487 | - babyQuery.setDataStatus(true);//排除自动建档数据 | |
| 2488 | - babyQuery.setYn(YnEnums.YES.getId()); | |
| 2489 | - babyQuery.setMphone(request.getMphone());//母亲联系方式 | |
| 2490 | - if (StringUtils.isNotEmpty(request.getBirthStart()) && StringUtils.isNotEmpty(request.getBirthEnd())) {//生日 | |
| 2491 | - babyQuery.setBirthStart(DateUtil.parseYMD(request.getBirthStart())); | |
| 2492 | - babyQuery.setBirthEnd(new Date(DateUtil.parseYMD(request.getBirthEnd()).getTime() + 24 * 60 * 60 * 1000 - 1)); | |
| 2493 | - } | |
| 2494 | - models = babyBookbuildingService.queryBabyBuildByCond(babyQuery, "created", Sort.Direction.DESC); | |
| 2495 | - //如果有高危儿多项就加一下 | |
| 2496 | - if (CollectionUtils.isNotEmpty(request.getHighRiskInfos())) { | |
| 2497 | - List<String> parentids = new ArrayList<>(); | |
| 2498 | - for (BabyModel model : models) { | |
| 2499 | - if (StringUtils.isNotEmpty(model.getParentId())) { | |
| 2500 | - parentids.add(model.getParentId()); | |
| 2501 | - } | |
| 2502 | - } | |
| 2503 | - AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); | |
| 2504 | - antExRecordQuery.setNeed("true"); | |
| 2505 | - antExRecordQuery.setParentIds(parentids); | |
| 2506 | - antExRecordQuery.setrFactorList(request.getHighRiskInfos());//高危儿多项 | |
| 2507 | - List<AntExRecordModel> antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery, Sort.Direction.DESC, "created"); | |
| 2508 | - List<String> antExRecordModelparentids = new ArrayList<>(); | |
| 2509 | - for (AntExRecordModel antExRecordModel : antExRecordModelList) { | |
| 2510 | - if (StringUtils.isNotEmpty(antExRecordModel.getParentId())) { | |
| 2511 | - antExRecordModelparentids.add(antExRecordModel.getParentId()); | |
| 2512 | - } | |
| 2513 | - } | |
| 2514 | - //如果有高危条件,没有查询到高危信息,那就返回null | |
| 2515 | - if (CollectionUtils.isEmpty(antExRecordModelparentids)) { | |
| 2516 | - models = null; | |
| 2517 | - babyQuery.mysqlBuild(0); | |
| 2518 | - } else { | |
| 2519 | - babyQuery.setParentIds(antExRecordModelparentids); | |
| 2520 | - models = babyBookbuildingService.queryBabyBuildByCond(babyQuery, "created", Sort.Direction.DESC); | |
| 2521 | - | |
| 2522 | - } | |
| 2523 | - | |
| 2524 | - } | |
| 2525 | - } catch (NumberFormatException e) { | |
| 2526 | - e.printStackTrace(); | |
| 2527 | - } | |
| 2528 | - | |
| 2529 | - if (CollectionUtils.isNotEmpty(models)) { | |
| 2530 | - int batchSize = 50; | |
| 2531 | - int end = 0; | |
| 2532 | - List<Future> futures = new ArrayList<>(); | |
| 2533 | - for (int i = 0; i < models.size(); i += batchSize) { | |
| 2534 | - end = (end + batchSize); | |
| 2535 | - if (end > models.size()) { | |
| 2536 | - end = models.size(); | |
| 2537 | - } | |
| 2538 | - List<BabyModel> ms = models.subList(i, end); | |
| 2539 | - Callable c = new BabyListQhdTask( | |
| 2540 | - basicConfigFacade, | |
| 2541 | - recordService, | |
| 2542 | - commonService, | |
| 2543 | - basicConfigService, | |
| 2544 | - organizationService, | |
| 2545 | - babyCheckFacade, | |
| 2546 | - ms, hospitalName); | |
| 2547 | - Future f = commonThreadPool.submit(c); | |
| 2548 | - futures.add(f); | |
| 2549 | - } | |
| 2550 | - if (CollectionUtils.isNotEmpty(futures)) { | |
| 2551 | - for (Future f : futures) { | |
| 2552 | - try { | |
| 2553 | - list.addAll((List<BabyManageListResult>) f.get()); | |
| 2554 | - } catch (Exception e) { | |
| 2555 | - ExceptionUtils.catchException(e, "baby list error."); | |
| 2556 | - } | |
| 2557 | - } | |
| 2558 | - } | |
| 2559 | - } | |
| 2560 | - | |
| 2561 | - BaseListResponse objectResponse = new BaseListResponse(); | |
| 2562 | - objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 2563 | - objectResponse.setData(list); | |
| 2564 | - objectResponse.setPageInfo(babyQuery.getPageInfo()); | |
| 2565 | - objectResponse.setErrormsg("成功"); | |
| 2566 | - return objectResponse; | |
| 2567 | - } | |
| 2568 | - | |
| 2569 | 2458 | public BaseListResponse queryObstetricDiagnosisQhdList(BabyManageRequest request, Integer userId) { |
| 2570 | 2459 | |
| 2571 | 2460 | String hospitalName = ""; |
| ... | ... | @@ -2736,7 +2625,7 @@ |
| 2736 | 2625 | buildType.add(1);//儿童直接建档 |
| 2737 | 2626 | buildType.add(2);//产妇分娩建档 |
| 2738 | 2627 | babyQuery.setBuildTypeList(buildType); |
| 2739 | - babyQuery.setDataStatus(true);//排除自动建档数据 | |
| 2628 | +// babyQuery.setDataStatus(true);//排除自动建档数据 | |
| 2740 | 2629 | babyQuery.setYn(YnEnums.YES.getId()); |
| 2741 | 2630 | babyQuery.setMphone(request.getMphone());//母亲联系方式 |
| 2742 | 2631 | if (StringUtils.isNotEmpty(request.getBirthStart()) && StringUtils.isNotEmpty(request.getBirthEnd())) {//生日 |
| ... | ... | @@ -2766,6 +2655,7 @@ |
| 2766 | 2655 | Callable c = new BabyListQhdTask( |
| 2767 | 2656 | basicConfigFacade, |
| 2768 | 2657 | recordService, |
| 2658 | + patientsService, | |
| 2769 | 2659 | commonService, |
| 2770 | 2660 | basicConfigService, |
| 2771 | 2661 | organizationService, |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/BabyListQhdTask.java
View file @
af25c6b
| ... | ... | @@ -3,6 +3,7 @@ |
| 3 | 3 | import com.lyms.platform.biz.service.AntExRecordService; |
| 4 | 4 | import com.lyms.platform.biz.service.BasicConfigService; |
| 5 | 5 | import com.lyms.platform.biz.service.CommonService; |
| 6 | +import com.lyms.platform.biz.service.PatientsService; | |
| 6 | 7 | import com.lyms.platform.common.enums.ServiceStatusEnums; |
| 7 | 8 | import com.lyms.platform.common.enums.ServiceTypeEnums; |
| 8 | 9 | import com.lyms.platform.common.enums.SexEnum; |
| 9 | 10 | |
| ... | ... | @@ -15,8 +16,10 @@ |
| 15 | 16 | import com.lyms.platform.pojo.AntExRecordModel; |
| 16 | 17 | import com.lyms.platform.pojo.BabyModel; |
| 17 | 18 | import com.lyms.platform.pojo.BasicConfig; |
| 19 | +import com.lyms.platform.pojo.Patients; | |
| 18 | 20 | import com.lyms.platform.query.AntExRecordQuery; |
| 19 | 21 | import org.apache.commons.collections.CollectionUtils; |
| 22 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 20 | 23 | import org.springframework.data.domain.Sort; |
| 21 | 24 | |
| 22 | 25 | import java.util.ArrayList; |
| 23 | 26 | |
| ... | ... | @@ -40,13 +43,14 @@ |
| 40 | 43 | private String hospitalName; |
| 41 | 44 | |
| 42 | 45 | private BasicConfigFacade basicConfigFacade; |
| 43 | - | |
| 46 | + private PatientsService patientsService; | |
| 44 | 47 | private AntExRecordService recordService; |
| 45 | 48 | private CommonService commonService; |
| 46 | 49 | |
| 47 | 50 | public BabyListQhdTask( |
| 48 | 51 | BasicConfigFacade basicConfigFacade, |
| 49 | 52 | AntExRecordService recordService, |
| 53 | + PatientsService patientsService, | |
| 50 | 54 | CommonService commonService, |
| 51 | 55 | BasicConfigService basicConfigService, |
| 52 | 56 | OrganizationService organizationService, |
| ... | ... | @@ -55,6 +59,7 @@ |
| 55 | 59 | String hospitalName) { |
| 56 | 60 | this.basicConfigFacade = basicConfigFacade; |
| 57 | 61 | this.recordService = recordService; |
| 62 | + this.patientsService = patientsService; | |
| 58 | 63 | this.commonService = commonService; |
| 59 | 64 | this.basicConfigService = basicConfigService; |
| 60 | 65 | this.organizationService = organizationService; |
| ... | ... | @@ -77,7 +82,7 @@ |
| 77 | 82 | result.setHighRisk("高危"); |
| 78 | 83 | } |
| 79 | 84 | if(StringUtils.isNotEmpty(model.getParentId())){ |
| 80 | - AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); | |
| 85 | + /* AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); | |
| 81 | 86 | antExRecordQuery.setParentId(model.getParentId());//产检记录没有yn |
| 82 | 87 | List<AntExRecordModel> antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery, Sort.Direction.DESC, "created"); |
| 83 | 88 | if(CollectionUtils.isNotEmpty(antExRecordModelList)){ |
| ... | ... | @@ -88,6 +93,15 @@ |
| 88 | 93 | String ri = commonService.resloveFactor(list1); |
| 89 | 94 | result.setHighRiskInfo(ri); |
| 90 | 95 | } |
| 96 | + } | |
| 97 | + }*/ | |
| 98 | + | |
| 99 | + Patients patients = patientsService.findOnePatientById(model.getParentId()); | |
| 100 | + if(patients!=null && CollectionUtils.isNotEmpty(patients.getRiskFactorId())){ | |
| 101 | + List list1 = patients.getRiskFactorId(); | |
| 102 | + if(CollectionUtils.isNotEmpty(list1)){ | |
| 103 | + String ri = commonService.resloveFactor(list1); | |
| 104 | + result.setHighRiskInfo(ri); | |
| 91 | 105 | } |
| 92 | 106 | } |
| 93 | 107 | } |