Commit 48f93ed148ea0747fc711ce1f08e315c6ce33a62
1 parent
effaad75b8
Exists in
master
and in
6 other branches
update
Showing 3 changed files with 50 additions and 58 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MatDeliverController.java
View file @
48f93ed
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
48f93ed
... | ... | @@ -3893,31 +3893,35 @@ |
3893 | 3893 | } |
3894 | 3894 | |
3895 | 3895 | public ChildbirthManagerResult childbirthManager2(ChildbirthManagerRequest childbirthManagerRequest) { |
3896 | - ChildbirthManagerResult childbirthManagerResult = new ChildbirthManagerResult(); | |
3897 | - PatientsQuery patientsQuery = new PatientsQuery(); | |
3896 | + Date dateStart=null; | |
3897 | + Date dateEnd=null; | |
3898 | 3898 | if (StringUtils.isNotEmpty(childbirthManagerRequest.getBirthDate())) { |
3899 | 3899 | try { |
3900 | - patientsQuery.setFmDateStart(DateUtil.getSNDate(childbirthManagerRequest.getBirthDate())[0]); | |
3901 | - patientsQuery.setFmDateEnd(DateUtil.getSNDate(childbirthManagerRequest.getBirthDate())[1]); | |
3900 | + dateStart = DateUtil.getSNDate(childbirthManagerRequest.getBirthDate())[0]; | |
3901 | + dateEnd = DateUtil.getSNDate(childbirthManagerRequest.getBirthDate())[1]; | |
3902 | 3902 | } catch (Exception e) { |
3903 | 3903 | // 什么都不做,这里是数据传入错误了 |
3904 | 3904 | } |
3905 | 3905 | } |
3906 | + ChildbirthManagerResult childbirthManagerResult = new ChildbirthManagerResult(); | |
3906 | 3907 | String hid = autoMatchFacade.getHospitalId(childbirthManagerRequest.getOperatorId()); |
3907 | - patientsQuery.setYn(YnEnums.YES.getId()); | |
3908 | - patientsQuery.setIsAutoFm(YnEnums.NO.getId()); | |
3909 | - patientsQuery.setType(3); | |
3910 | - // 构造医院id集合 | |
3911 | - List <String> hospitalList = new ArrayList <>(); | |
3912 | - hospitalList.add(hid); | |
3913 | - patientsQuery.setQueryNo(StringUtils.isEmpty(childbirthManagerRequest.getQueryNo()) ? null : childbirthManagerRequest.getQueryNo()); | |
3914 | - patientsQuery.setFmHospitalList(hospitalList); | |
3915 | - patientsQuery.setDesc("fmDate"); | |
3916 | - patientsQuery.setSort("fmDate"); | |
3917 | - //这里查询档案信息太费时。在没有这个筛选需求的时候不去查询 | |
3918 | 3908 | List<String> parentIdList = new ArrayList<>(); |
3919 | - Map <String, Patients> patientsMap = new HashedMap(); | |
3920 | - if(StringUtils.isNotEmpty(patientsQuery.getQueryNo())) { | |
3909 | + //这里查询档案信息太费时。在没有这个筛选需求的时候不去查询 | |
3910 | + if(StringUtils.isNotEmpty(childbirthManagerRequest.getQueryNo())) { | |
3911 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
3912 | + patientsQuery.setFmDateStart(dateStart); | |
3913 | + patientsQuery.setFmDateEnd(dateEnd); | |
3914 | + patientsQuery.setYn(YnEnums.YES.getId()); | |
3915 | + patientsQuery.setIsAutoFm(YnEnums.NO.getId()); | |
3916 | + patientsQuery.setType(3); | |
3917 | + // 构造医院id集合 | |
3918 | + List <String> hospitalList = new ArrayList <>(); | |
3919 | + hospitalList.add(hid); | |
3920 | + patientsQuery.setQueryNo(childbirthManagerRequest.getQueryNo()); | |
3921 | + patientsQuery.setFmHospitalList(hospitalList); | |
3922 | + patientsQuery.setDesc("fmDate"); | |
3923 | + patientsQuery.setSort("fmDate"); | |
3924 | + | |
3921 | 3925 | List<Patients> patientsList = patientsService.queryPatient(patientsQuery); |
3922 | 3926 | |
3923 | 3927 | if (CollectionUtils.isEmpty(patientsList)) { |
3924 | 3928 | |
3925 | 3929 | |
3926 | 3930 | |
3927 | 3931 | |
3928 | 3932 | |
3929 | 3933 | |
... | ... | @@ -3926,32 +3930,28 @@ |
3926 | 3930 | childbirthManagerResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); |
3927 | 3931 | return childbirthManagerResult; |
3928 | 3932 | } |
3933 | + //组装查询到的档案 | |
3929 | 3934 | for (Patients patients : patientsList) { |
3930 | 3935 | parentIdList.add(patients.getId()); |
3931 | 3936 | } |
3932 | - //组装查询到的档案 | |
3933 | - for (Patients patients : patientsList) { | |
3934 | - patientsMap.put(patients.getId(), patients); | |
3935 | - } | |
3936 | 3937 | } |
3937 | 3938 | MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); |
3939 | + //没有筛选档案信息系的情况只查分娩 | |
3938 | 3940 | if (CollectionUtils.isNotEmpty(parentIdList)) { |
3939 | 3941 | matDeliverQuery.setParentIdList(parentIdList); |
3940 | 3942 | }else { |
3941 | - if(null != patientsQuery.getFmDateStart() && null != patientsQuery.getFmDateEnd() ){ | |
3942 | - matDeliverQuery.setCreatedStart(patientsQuery.getFmDateStart()); | |
3943 | - matDeliverQuery.setEndStart(patientsQuery.getFmDateEnd()); | |
3944 | - } | |
3945 | -// matDeliverQuery.setHospitalId(hid); | |
3943 | + matDeliverQuery.setCreatedStart(dateStart); | |
3944 | + matDeliverQuery.setEndStart(dateEnd); | |
3945 | + matDeliverQuery.setHospitalId(hid); | |
3946 | 3946 | } |
3947 | 3947 | matDeliverQuery.setLimit(childbirthManagerRequest.getLimit()); |
3948 | 3948 | matDeliverQuery.setYn(YnEnums.YES.getId()); |
3949 | - matDeliverQuery.setHloseBloodType(childbirthManagerRequest.getHloseBloodType()); | |
3950 | 3949 | String deliveryModeQueryJson = "fmfs\\\":\\\"" + childbirthManagerRequest.getDeliveryMode(); |
3951 | 3950 | matDeliverQuery.setDeliveryModeQueryJson(StringUtils.isEmpty(childbirthManagerRequest.getDeliveryMode()) ? null : deliveryModeQueryJson); |
3951 | + | |
3952 | 3952 | List <MaternalDeliverModel> maternalDeliverModelList = matDeliverService.pageQuery(matDeliverQuery); |
3953 | 3953 | |
3954 | - List<Map> date = new LinkedList<>(); | |
3954 | + List<Map> data = new LinkedList<>(); | |
3955 | 3955 | int batchSize = 4; |
3956 | 3956 | int end = 0; |
3957 | 3957 | List <Future> listFuture = new ArrayList <>(); |
... | ... | @@ -3962,7 +3962,7 @@ |
3962 | 3962 | } |
3963 | 3963 | List <MaternalDeliverModel> mlist = maternalDeliverModelList.subList(i, end); |
3964 | 3964 | Callable c = new MaterDeliverWorker2(recordService, babyService,antExService, |
3965 | - mlist, patientsMap,mongoTemplate); | |
3965 | + mlist,mongoTemplate); | |
3966 | 3966 | Future f = commonThreadPool.submit(c); |
3967 | 3967 | if (f != null) { |
3968 | 3968 | listFuture.add(f); |
3969 | 3969 | |
... | ... | @@ -3971,13 +3971,13 @@ |
3971 | 3971 | if (CollectionUtils.isNotEmpty(listFuture)) { |
3972 | 3972 | for (Future f : listFuture) { |
3973 | 3973 | try { |
3974 | - date.addAll((List) f.get(30, TimeUnit.SECONDS)); | |
3974 | + data.addAll((List<Map>) f.get(30, TimeUnit.SECONDS)); | |
3975 | 3975 | } catch (Exception e) { |
3976 | 3976 | ExceptionUtils.catchException(e, "fm list error."); |
3977 | 3977 | } |
3978 | 3978 | } |
3979 | 3979 | } |
3980 | - childbirthManagerResult.setData(date); | |
3980 | + childbirthManagerResult.setData(data); | |
3981 | 3981 | childbirthManagerResult.setErrorcode(ErrorCodeConstants.SUCCESS); |
3982 | 3982 | childbirthManagerResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); |
3983 | 3983 | return childbirthManagerResult; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/MaterDeliverWorker2.java
View file @
48f93ed
... | ... | @@ -36,14 +36,11 @@ |
36 | 36 | private BabyService babyService; |
37 | 37 | private AntenatalExaminationService antExService; |
38 | 38 | private List<MaternalDeliverModel> maternalDeliverModelList; |
39 | - private Map<String, Patients> patientsMap; | |
40 | 39 | private MongoTemplate mongoTemplate; |
41 | 40 | |
42 | 41 | public MaterDeliverWorker2(AntExRecordService recordService, BabyService babyService, AntenatalExaminationService antExService, |
43 | - List<MaternalDeliverModel> maternalDeliverModelList, Map<String, Patients> patientsMap, | |
44 | - MongoTemplate mongoTemplate) { | |
42 | + List<MaternalDeliverModel> maternalDeliverModelList, MongoTemplate mongoTemplate) { | |
45 | 43 | this.maternalDeliverModelList = maternalDeliverModelList; |
46 | - this.patientsMap = patientsMap; | |
47 | 44 | this.recordService=recordService; |
48 | 45 | this.babyService = babyService; |
49 | 46 | this.antExService = antExService; |
50 | 47 | |
51 | 48 | |
... | ... | @@ -52,18 +49,13 @@ |
52 | 49 | |
53 | 50 | @Override |
54 | 51 | public List<Map> call() throws Exception { |
55 | - List<Map> date = new LinkedList<>(); | |
52 | + List<Map> data = new LinkedList<>(); | |
56 | 53 | try { |
57 | 54 | for (MaternalDeliverModel maternalDeliverModel : maternalDeliverModelList) { |
58 | 55 | Map<String, String> initQueryMapqhdky = new LinkedHashMap<>(); |
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); | |
56 | + Criteria criteria1= Criteria.where("id").is(maternalDeliverModel.getParentId()); | |
57 | + Patients patients = mongoTemplate.findOne(Query.query(criteria1), Patients.class); | |
65 | 58 | // System.out.println(Query.query(criteria).toString()+"--------------1"); |
66 | - } | |
67 | 59 | |
68 | 60 | if (null == patients) { |
69 | 61 | continue; |
... | ... | @@ -72,8 +64,8 @@ |
72 | 64 | initQueryMapqhdky.put("birth", null!=patients.getBirth()?DateUtil.getyyyy_MM_dd(patients.getBirth()):""); |
73 | 65 | initQueryMapqhdky.put("lastMens", null!=patients.getLastMenses()?DateUtil.getyyyy_MM_dd(patients.getLastMenses()):""); |
74 | 66 | if(StringUtils.isNotEmpty(patients.getId())){ |
75 | - Criteria criteria= Criteria.where("parentId").is(patients.getId()); | |
76 | - AntExChuModel exChuModel = mongoTemplate.findOne(Query.query(criteria), AntExChuModel.class); | |
67 | + Criteria criteria2= Criteria.where("parentId").is(patients.getId()); | |
68 | + AntExChuModel exChuModel = mongoTemplate.findOne(Query.query(criteria2), AntExChuModel.class); | |
77 | 69 | // System.out.println(Query.query(criteria).toString()+"--------------2"); |
78 | 70 | if(null!=exChuModel){ |
79 | 71 | initQueryMapqhdky.put("cc", null!=exChuModel.getProdTime()?0 == exChuModel.getProdTime()?"是":"否":""); |
80 | 72 | |
... | ... | @@ -119,13 +111,13 @@ |
119 | 111 | AntExRecordModel antExRecordModel= antExRecordModels.get(0); |
120 | 112 | if(null!=antExRecordModel){ |
121 | 113 | if(2==antExRecordModel.getType()){ //初诊 |
122 | - Criteria criteriaf= Criteria.where("id").is(antExRecordModel.getfId()); | |
123 | - AntExChuModel AntExChu = mongoTemplate.findOne(Query.query(criteriaf), AntExChuModel.class); | |
114 | + Criteria criteria4= Criteria.where("id").is(antExRecordModel.getfId()); | |
115 | + AntExChuModel AntExChu = mongoTemplate.findOne(Query.query(criteria4), AntExChuModel.class); | |
124 | 116 | // System.out.println(Query.query(criteriaf).toString()+"--------------4"); |
125 | 117 | initQueryMapqhdky.put("mweight", null!=AntExChu.getWeight()?AntExChu.getWeight().toString():""); |
126 | 118 | }else { //复诊 |
127 | - Criteria criteriaf= Criteria.where("id").is(antExRecordModel.getfId()); | |
128 | - AntenatalExaminationModel AntExFu = mongoTemplate.findOne(Query.query(criteriaf), AntenatalExaminationModel.class); | |
119 | + Criteria criteria5= Criteria.where("id").is(antExRecordModel.getfId()); | |
120 | + AntenatalExaminationModel AntExFu = mongoTemplate.findOne(Query.query(criteria5), AntenatalExaminationModel.class); | |
129 | 121 | // System.out.println(Query.query(criteriaf).toString()+"--------------5"); |
130 | 122 | initQueryMapqhdky.put("mweight", null!=AntExFu.getWeight()?AntExFu.getWeight().toString():""); |
131 | 123 | } |
132 | 124 | |
... | ... | @@ -147,13 +139,13 @@ |
147 | 139 | AntExRecordModel antExRecordModel= antExRecordModels2.get(0); |
148 | 140 | if(null!=antExRecordModel){ |
149 | 141 | if(2==antExRecordModel.getType()){ //初诊 |
150 | - Criteria criteriaf= Criteria.where("id").is(antExRecordModel.getfId()); | |
151 | - AntExChuModel AntExChu = mongoTemplate.findOne(Query.query(criteriaf), AntExChuModel.class); | |
142 | + Criteria criteria7= Criteria.where("id").is(antExRecordModel.getfId()); | |
143 | + AntExChuModel AntExChu = mongoTemplate.findOne(Query.query(criteria7), AntExChuModel.class); | |
152 | 144 | // System.out.println(Query.query(criteriaf).toString()+"--------------7"); |
153 | 145 | initQueryMapqhdky.put("cweight", null!=AntExChu?null!=AntExChu.getWeight()?AntExChu.getWeight().toString():"":""); |
154 | 146 | }else { //复诊 |
155 | - Criteria criteriaf= Criteria.where("id").is(antExRecordModel.getfId()); | |
156 | - AntenatalExaminationModel AntExFu = mongoTemplate.findOne(Query.query(criteriaf), AntenatalExaminationModel.class); | |
147 | + Criteria criteria8= Criteria.where("id").is(antExRecordModel.getfId()); | |
148 | + AntenatalExaminationModel AntExFu = mongoTemplate.findOne(Query.query(criteria8), AntenatalExaminationModel.class); | |
157 | 149 | // System.out.println(Query.query(criteriaf).toString()+"--------------8"); |
158 | 150 | initQueryMapqhdky.put("cweight", null!=AntExFu?null!=AntExFu.getWeight()?AntExFu.getWeight().toString():"":""); |
159 | 151 | } |
... | ... | @@ -243,8 +235,8 @@ |
243 | 235 | // System.out.println(antExRecordQuery3.convertToQuery().convertToMongoQuery().toString()+"--------------9"); |
244 | 236 | if(CollectionUtils.isNotEmpty(antExRecordModels3)) { |
245 | 237 | AntExRecordModel antExRecordModel = antExRecordModels3.get(0); |
246 | - Criteria criteriaf= Criteria.where("id").is(antExRecordModel.getfId()); | |
247 | - AntenatalExaminationModel AntExFu = mongoTemplate.findOne(Query.query(criteriaf), AntenatalExaminationModel.class); | |
238 | + Criteria criteria3= Criteria.where("id").is(antExRecordModel.getfId()); | |
239 | + AntenatalExaminationModel AntExFu = mongoTemplate.findOne(Query.query(criteria3), AntenatalExaminationModel.class); | |
248 | 240 | // System.out.println(Query.query(criteriaf).toString()+"--------------10"); |
249 | 241 | if(null!=AntExFu){ |
250 | 242 | initQueryMapqhdky.put("bloodSugarKf", StringUtils.isNotEmpty(AntExFu.getBloodSugarKf())?AntExFu.getBloodSugarKf():""); |
251 | 243 | |
... | ... | @@ -344,12 +336,12 @@ |
344 | 336 | initQueryMapqhdky.put("xsext", ""); |
345 | 337 | initQueryMapqhdky.put("apgarScore", ""); |
346 | 338 | } |
347 | - date.add(initQueryMapqhdky); | |
339 | + data.add(initQueryMapqhdky); | |
348 | 340 | } |
349 | 341 | }catch (Exception e) { |
350 | 342 | e.printStackTrace(); |
351 | 343 | } |
352 | - return date; | |
344 | + return data; | |
353 | 345 | } |
354 | 346 | |
355 | 347 | } |