From af25c6b9e607294925f4dd81d435bd8badbd9bf1 Mon Sep 17 00:00:00 2001 From: wtt Date: Sat, 25 Jul 2020 11:24:53 +0800 Subject: [PATCH] update --- .../operate/web/facade/BabyBookbuildingFacade.java | 114 +-------------------- .../operate/web/utils/BabyListQhdTask.java | 18 +++- 2 files changed, 18 insertions(+), 114 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java index 38da6e1..47afa37 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java @@ -2454,117 +2454,6 @@ public class BabyBookbuildingFacade { return objectResponse; } - public BaseListResponse queryObstetricDiagnosisQhdList1(BabyManageRequest request, Integer userId) { - - String hospitalName = ""; - String hospitalId = ""; - //得到当前登录的医院id - List hospitalIdList = new ArrayList<>(); - List list = null; - BabyModelQuery babyQuery = null; - List models = null; - try { - if (userId != null) { - Users dbuser = usersService.getUsers(userId); - if (dbuser != null) { - hospitalId = String.valueOf(dbuser.getOrgId()); - hospitalIdList.add(hospitalId); - hospitalName = organizationService.getOrganization(Integer.valueOf(hospitalId)).getName(); - } - } - //获取全部儿童信息 - list = new ArrayList<>(); - babyQuery = new BabyModelQuery(); - babyQuery.setNeed("true"); - babyQuery.setPage(request.getPage()); - babyQuery.setLimit(request.getLimit()); - babyQuery.setQueryNo(request.getQueryNo()); - babyQuery.setHospitalIdList(hospitalIdList); - List buildType = new ArrayList(); - buildType.add(1);//儿童直接建档 - buildType.add(2);//产妇分娩建档 - babyQuery.setBuildTypeList(buildType); - babyQuery.setDataStatus(true);//排除自动建档数据 - babyQuery.setYn(YnEnums.YES.getId()); - babyQuery.setMphone(request.getMphone());//母亲联系方式 - if (StringUtils.isNotEmpty(request.getBirthStart()) && StringUtils.isNotEmpty(request.getBirthEnd())) {//生日 - babyQuery.setBirthStart(DateUtil.parseYMD(request.getBirthStart())); - babyQuery.setBirthEnd(new Date(DateUtil.parseYMD(request.getBirthEnd()).getTime() + 24 * 60 * 60 * 1000 - 1)); - } - models = babyBookbuildingService.queryBabyBuildByCond(babyQuery, "created", Sort.Direction.DESC); - //如果有高危儿多项就加一下 - if (CollectionUtils.isNotEmpty(request.getHighRiskInfos())) { - List parentids = new ArrayList<>(); - for (BabyModel model : models) { - if (StringUtils.isNotEmpty(model.getParentId())) { - parentids.add(model.getParentId()); - } - } - AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); - antExRecordQuery.setNeed("true"); - antExRecordQuery.setParentIds(parentids); - antExRecordQuery.setrFactorList(request.getHighRiskInfos());//高危儿多项 - List antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery, Sort.Direction.DESC, "created"); - List antExRecordModelparentids = new ArrayList<>(); - for (AntExRecordModel antExRecordModel : antExRecordModelList) { - if (StringUtils.isNotEmpty(antExRecordModel.getParentId())) { - antExRecordModelparentids.add(antExRecordModel.getParentId()); - } - } - //如果有高危条件,没有查询到高危信息,那就返回null - if (CollectionUtils.isEmpty(antExRecordModelparentids)) { - models = null; - babyQuery.mysqlBuild(0); - } else { - babyQuery.setParentIds(antExRecordModelparentids); - models = babyBookbuildingService.queryBabyBuildByCond(babyQuery, "created", Sort.Direction.DESC); - - } - - } - } catch (NumberFormatException e) { - e.printStackTrace(); - } - - if (CollectionUtils.isNotEmpty(models)) { - int batchSize = 50; - int end = 0; - List futures = new ArrayList<>(); - for (int i = 0; i < models.size(); i += batchSize) { - end = (end + batchSize); - if (end > models.size()) { - end = models.size(); - } - List ms = models.subList(i, end); - Callable c = new BabyListQhdTask( - basicConfigFacade, - recordService, - commonService, - basicConfigService, - organizationService, - babyCheckFacade, - ms, hospitalName); - Future f = commonThreadPool.submit(c); - futures.add(f); - } - if (CollectionUtils.isNotEmpty(futures)) { - for (Future f : futures) { - try { - list.addAll((List) f.get()); - } catch (Exception e) { - ExceptionUtils.catchException(e, "baby list error."); - } - } - } - } - - BaseListResponse objectResponse = new BaseListResponse(); - objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); - objectResponse.setData(list); - objectResponse.setPageInfo(babyQuery.getPageInfo()); - objectResponse.setErrormsg("成功"); - return objectResponse; - } public BaseListResponse queryObstetricDiagnosisQhdList(BabyManageRequest request, Integer userId) { @@ -2736,7 +2625,7 @@ public class BabyBookbuildingFacade { buildType.add(1);//儿童直接建档 buildType.add(2);//产妇分娩建档 babyQuery.setBuildTypeList(buildType); - babyQuery.setDataStatus(true);//排除自动建档数据 +// babyQuery.setDataStatus(true);//排除自动建档数据 babyQuery.setYn(YnEnums.YES.getId()); babyQuery.setMphone(request.getMphone());//母亲联系方式 if (StringUtils.isNotEmpty(request.getBirthStart()) && StringUtils.isNotEmpty(request.getBirthEnd())) {//生日 @@ -2766,6 +2655,7 @@ public class BabyBookbuildingFacade { Callable c = new BabyListQhdTask( basicConfigFacade, recordService, + patientsService, commonService, basicConfigService, organizationService, diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/BabyListQhdTask.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/BabyListQhdTask.java index 583bb48..a7dd4f6 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/BabyListQhdTask.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/BabyListQhdTask.java @@ -3,6 +3,7 @@ package com.lyms.platform.operate.web.utils; import com.lyms.platform.biz.service.AntExRecordService; import com.lyms.platform.biz.service.BasicConfigService; import com.lyms.platform.biz.service.CommonService; +import com.lyms.platform.biz.service.PatientsService; import com.lyms.platform.common.enums.ServiceStatusEnums; import com.lyms.platform.common.enums.ServiceTypeEnums; import com.lyms.platform.common.enums.SexEnum; @@ -15,8 +16,10 @@ import com.lyms.platform.permission.service.OrganizationService; import com.lyms.platform.pojo.AntExRecordModel; import com.lyms.platform.pojo.BabyModel; import com.lyms.platform.pojo.BasicConfig; +import com.lyms.platform.pojo.Patients; import com.lyms.platform.query.AntExRecordQuery; import org.apache.commons.collections.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Sort; import java.util.ArrayList; @@ -40,13 +43,14 @@ public class BabyListQhdTask implements Callable { private String hospitalName; private BasicConfigFacade basicConfigFacade; - + private PatientsService patientsService; private AntExRecordService recordService; private CommonService commonService; public BabyListQhdTask( BasicConfigFacade basicConfigFacade, AntExRecordService recordService, + PatientsService patientsService, CommonService commonService, BasicConfigService basicConfigService, OrganizationService organizationService, @@ -55,6 +59,7 @@ public class BabyListQhdTask implements Callable { String hospitalName) { this.basicConfigFacade = basicConfigFacade; this.recordService = recordService; + this.patientsService = patientsService; this.commonService = commonService; this.basicConfigService = basicConfigService; this.organizationService = organizationService; @@ -77,7 +82,7 @@ public class BabyListQhdTask implements Callable { result.setHighRisk("高危"); } if(StringUtils.isNotEmpty(model.getParentId())){ - AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); + /* AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); antExRecordQuery.setParentId(model.getParentId());//产检记录没有yn List antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery, Sort.Direction.DESC, "created"); if(CollectionUtils.isNotEmpty(antExRecordModelList)){ @@ -89,6 +94,15 @@ public class BabyListQhdTask implements Callable { result.setHighRiskInfo(ri); } } + }*/ + + Patients patients = patientsService.findOnePatientById(model.getParentId()); + if(patients!=null && CollectionUtils.isNotEmpty(patients.getRiskFactorId())){ + List list1 = patients.getRiskFactorId(); + if(CollectionUtils.isNotEmpty(list1)){ + String ri = commonService.resloveFactor(list1); + result.setHighRiskInfo(ri); + } } } result.setSex(model.getSex() == null ? "" : StringUtils.emptyDeal(SexEnum.getTextById(model.getSex()))); -- 1.8.3.1