Commit fbdd5dc55bf66a5a463f88ce3bab094c764c1a74
1 parent
cd69cb594b
Exists in
master
and in
6 other branches
秦皇岛-科研导出优化
Showing 3 changed files with 45 additions and 30 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
fbdd5dc
... | ... | @@ -3914,34 +3914,45 @@ |
3914 | 3914 | patientsQuery.setFmHospitalList(hospitalList); |
3915 | 3915 | patientsQuery.setDesc("fmDate"); |
3916 | 3916 | patientsQuery.setSort("fmDate"); |
3917 | - List <Patients> patientsList = patientsService.queryPatient(patientsQuery); | |
3918 | - List <String> parentIdList = new ArrayList <>(); | |
3919 | - if (CollectionUtils.isEmpty(patientsList)) { | |
3920 | - // 没有查到,直接抛出 | |
3921 | - childbirthManagerResult.setErrorcode(ErrorCodeConstants.SUCCESS); | |
3922 | - childbirthManagerResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); | |
3923 | - return childbirthManagerResult; | |
3924 | - } | |
3925 | - for (Patients patients : patientsList) { | |
3926 | - parentIdList.add(patients.getId()); | |
3927 | - } | |
3917 | + //这里查询档案信息太费时。在没有这个筛选需求的时候不去查询 | |
3918 | + List<String> parentIdList = new ArrayList<>(); | |
3919 | + Map <String, Patients> patientsMap = new HashedMap(); | |
3920 | + if(StringUtils.isNotEmpty(patientsQuery.getQueryNo())) { | |
3921 | + List<Patients> patientsList = patientsService.queryPatient(patientsQuery); | |
3928 | 3922 | |
3923 | + if (CollectionUtils.isEmpty(patientsList)) { | |
3924 | + // 没有查到,直接抛出 | |
3925 | + childbirthManagerResult.setErrorcode(ErrorCodeConstants.SUCCESS); | |
3926 | + childbirthManagerResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); | |
3927 | + return childbirthManagerResult; | |
3928 | + } | |
3929 | + for (Patients patients : patientsList) { | |
3930 | + parentIdList.add(patients.getId()); | |
3931 | + } | |
3932 | + //组装查询到的档案 | |
3933 | + for (Patients patients : patientsList) { | |
3934 | + patientsMap.put(patients.getId(), patients); | |
3935 | + } | |
3936 | + } | |
3929 | 3937 | MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); |
3938 | + if (CollectionUtils.isNotEmpty(parentIdList)) { | |
3939 | + matDeliverQuery.setParentIdList(parentIdList); | |
3940 | + }else { | |
3941 | + if(null != patientsQuery.getFmDateStart() && null != patientsQuery.getFmDateEnd() ){ | |
3942 | + matDeliverQuery.setCreatedStart(patientsQuery.getFmDateStart()); | |
3943 | + matDeliverQuery.setEndStart(patientsQuery.getFmDateEnd()); | |
3944 | + } | |
3945 | + } | |
3930 | 3946 | matDeliverQuery.setLimit(childbirthManagerRequest.getLimit()); |
3931 | - matDeliverQuery.setParentIdList(parentIdList); | |
3932 | 3947 | matDeliverQuery.setYn(YnEnums.YES.getId()); |
3933 | 3948 | matDeliverQuery.setHloseBloodType(childbirthManagerRequest.getHloseBloodType()); |
3934 | 3949 | String deliveryModeQueryJson = "fmfs\\\":\\\"" + childbirthManagerRequest.getDeliveryMode(); |
3935 | 3950 | matDeliverQuery.setDeliveryModeQueryJson(StringUtils.isEmpty(childbirthManagerRequest.getDeliveryMode()) ? null : deliveryModeQueryJson); |
3936 | 3951 | List <MaternalDeliverModel> maternalDeliverModelList = matDeliverService.pageQuery(matDeliverQuery); |
3937 | - Map <String, Patients> patientsMap = new HashedMap(); | |
3938 | 3952 | |
3939 | - for (Patients patients : patientsList) { | |
3940 | - patientsMap.put(patients.getId(), patients); | |
3941 | - } | |
3942 | 3953 | |
3943 | 3954 | List<Map> date = new LinkedList<>(); |
3944 | - int batchSize = 3; | |
3955 | + int batchSize = 20; | |
3945 | 3956 | int end = 0; |
3946 | 3957 | List <Future> futures = new ArrayList <>(); |
3947 | 3958 | for (int i = 0; i < maternalDeliverModelList.size(); i += batchSize) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ChildbirthManagerRequest.java
View file @
fbdd5dc
... | ... | @@ -803,7 +803,7 @@ |
803 | 803 | initQueryMapqhdky.put("cc", "初产"); |
804 | 804 | initQueryMapqhdky.put("jc", "经产"); |
805 | 805 | initQueryMapqhdky.put("dt", "单胎"); |
806 | - initQueryMapqhdky.put("dantai", "多胎"); | |
806 | + initQueryMapqhdky.put("duotai", "多胎"); | |
807 | 807 | initQueryMapqhdky.put("ssy", "收缩压mmHg"); |
808 | 808 | initQueryMapqhdky.put("szy", "舒张压mmHg"); |
809 | 809 | initQueryMapqhdky.put("heigh", "身高cm"); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/MaterDeliverWorker2.java
View file @
fbdd5dc
... | ... | @@ -56,9 +56,15 @@ |
56 | 56 | try { |
57 | 57 | for (MaternalDeliverModel maternalDeliverModel : maternalDeliverModelList) { |
58 | 58 | Map<String, String> initQueryMapqhdky = new LinkedHashMap<>(); |
59 | - Patients patients = patientsMap.get(maternalDeliverModel.getParentId()); | |
60 | - if (patients == null) | |
61 | - { | |
59 | + Patients patients =null; | |
60 | + if(MapUtils.isNotEmpty(patientsMap)){ | |
61 | + patients = patientsMap.get(maternalDeliverModel.getParentId()); | |
62 | + }else { | |
63 | + Criteria criteria= Criteria.where("_id").is(maternalDeliverModel.getParentId()); | |
64 | + patients = mongoTemplate.findOne(Query.query(criteria), Patients.class); | |
65 | + } | |
66 | + | |
67 | + if (null == patients) { | |
62 | 68 | continue; |
63 | 69 | } |
64 | 70 | initQueryMapqhdky.put("name", StringUtils.isNotEmpty(patients.getUsername())?patients.getUsername():""); |
... | ... | @@ -70,8 +76,6 @@ |
70 | 76 | if(null!=exChuModel){ |
71 | 77 | initQueryMapqhdky.put("cc", null!=exChuModel.getProdTime()?0<exChuModel.getProdTime()?"否":"是":""); |
72 | 78 | initQueryMapqhdky.put("jc", null!=exChuModel.getProdTime()?0<exChuModel.getProdTime()?"是":"否":""); |
73 | - initQueryMapqhdky.put("dt", StringUtils.isNotEmpty(exChuModel.getTireNumber())?1==Integer.parseInt(exChuModel.getTireNumber())?"是":"否":""); | |
74 | - initQueryMapqhdky.put("dantai", StringUtils.isNotEmpty(exChuModel.getTireNumber())?1<Integer.parseInt(exChuModel.getTireNumber())?"是":"否":""); | |
75 | 79 | if(StringUtils.isNotEmpty(exChuModel.getBp())){ |
76 | 80 | Map<String, Object> map = JSON.parseObject(exChuModel.getBp(), HashMap.class); |
77 | 81 | if(MapUtils.isNotEmpty(map)){ |
78 | 82 | |
... | ... | @@ -91,14 +95,14 @@ |
91 | 95 | }else { |
92 | 96 | initQueryMapqhdky.put("cc", ""); |
93 | 97 | initQueryMapqhdky.put("jc", ""); |
94 | - initQueryMapqhdky.put("dt", ""); | |
95 | - initQueryMapqhdky.put("dantai",""); | |
96 | 98 | initQueryMapqhdky.put("ssy", ""); |
97 | 99 | initQueryMapqhdky.put("szy", ""); |
98 | 100 | initQueryMapqhdky.put("heigh", ""); |
99 | 101 | initQueryMapqhdky.put("beforeWeight",""); |
100 | 102 | } |
101 | - | |
103 | + //单胎、多胎 | |
104 | + initQueryMapqhdky.put("dt", null != maternalDeliverModel.getTireNumber()?1 == maternalDeliverModel.getTireNumber()?"是":"否":""); | |
105 | + initQueryMapqhdky.put("duotai", null != maternalDeliverModel.getTireNumber()?1 < maternalDeliverModel.getTireNumber()?"是":"否":""); | |
102 | 106 | //体重2kg(24-28周) |
103 | 107 | AntExRecordQuery antExRecordQuery=new AntExRecordQuery(); |
104 | 108 | antExRecordQuery.setParentId(patients.getId()); |
105 | 109 | |
... | ... | @@ -252,12 +256,12 @@ |
252 | 256 | initQueryMapqhdky.put("ctpoab", ""); |
253 | 257 | } |
254 | 258 | //分娩记录 |
255 | - Criteria criteriaFm= Criteria.where("parentId").is(patients.getId()); | |
256 | - MaternalDeliverModel deliverModel = mongoTemplate.findOne(Query.query(criteriaFm), MaternalDeliverModel.class); | |
257 | - if(CollectionUtils.isNotEmpty(deliverModel.getBaby())){ | |
259 | +// Criteria criteriaFm= Criteria.where("parentId").is(patients.getId()); | |
260 | +// MaternalDeliverModel deliverModel = mongoTemplate.findOne(Query.query(criteriaFm), MaternalDeliverModel.class); | |
261 | + if(CollectionUtils.isNotEmpty(maternalDeliverModel.getBaby())){ | |
258 | 262 | String weight=""; |
259 | 263 | String apgarScore = ""; |
260 | - for (MaternalDeliverModel.Baby baby : deliverModel.getBaby()) { | |
264 | + for (MaternalDeliverModel.Baby baby : maternalDeliverModel.getBaby()) { | |
261 | 265 | if(StringUtils.isNotEmpty(baby.getBabyWeight())){ |
262 | 266 | weight+=baby.getBabyWeight()+"/"; |
263 | 267 | } |