From ca193885228f470233e78417929027c8a7c12c3d Mon Sep 17 00:00:00 2001 From: shiyang <316555390@qq.com> Date: Fri, 29 Apr 2022 11:49:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=A6=E7=9A=87=E5=B2=9B-=E7=A7=91=E7=A0=94?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operate/web/facade/MatDeliverFacade.java | 17 +++++------- .../web/request/ChildbirthManagerRequest.java | 2 +- .../operate/web/worker/MaterDeliverWorker2.java | 31 +++++++++++++++++----- 3 files changed, 33 insertions(+), 17 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java index 75e92cb..3b137bf 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java @@ -3942,7 +3942,7 @@ public class MatDeliverFacade { matDeliverQuery.setCreatedStart(patientsQuery.getFmDateStart()); matDeliverQuery.setEndStart(patientsQuery.getFmDateEnd()); } - matDeliverQuery.setHospitalId(hid); +// matDeliverQuery.setHospitalId(hid); } matDeliverQuery.setLimit(childbirthManagerRequest.getLimit()); matDeliverQuery.setYn(YnEnums.YES.getId()); @@ -3951,11 +3951,10 @@ public class MatDeliverFacade { matDeliverQuery.setDeliveryModeQueryJson(StringUtils.isEmpty(childbirthManagerRequest.getDeliveryMode()) ? null : deliveryModeQueryJson); List maternalDeliverModelList = matDeliverService.pageQuery(matDeliverQuery); - List date = new LinkedList<>(); - int batchSize = 20; + int batchSize = 4; int end = 0; - List futures = new ArrayList <>(); + List listFuture = new ArrayList <>(); for (int i = 0; i < maternalDeliverModelList.size(); i += batchSize) { end = (end + batchSize); if (end > maternalDeliverModelList.size()) { @@ -3966,20 +3965,18 @@ public class MatDeliverFacade { mlist, patientsMap,mongoTemplate); Future f = commonThreadPool.submit(c); if (f != null) { - futures.add(f); + listFuture.add(f); } } - - if (CollectionUtils.isNotEmpty(futures)) { - for (Future f : futures) { + if (CollectionUtils.isNotEmpty(listFuture)) { + for (Future f : listFuture) { try { - date.addAll((List ) f.get()); + date.addAll((List) f.get(30, TimeUnit.SECONDS)); } catch (Exception e) { ExceptionUtils.catchException(e, "fm list error."); } } } - childbirthManagerResult.setData(date); childbirthManagerResult.setErrorcode(ErrorCodeConstants.SUCCESS); childbirthManagerResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ChildbirthManagerRequest.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ChildbirthManagerRequest.java index 7995275..174398e 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ChildbirthManagerRequest.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ChildbirthManagerRequest.java @@ -837,7 +837,7 @@ public class ChildbirthManagerRequest extends BasePageQueryRequest { initQueryMapqhdky.put("ctgab", "TGAb甲状腺球蛋白"); initQueryMapqhdky.put("ctpoab", "TPOAb抗甲状腺过氧化物抗体"); initQueryMapqhdky.put("babyWeight", "新生儿体重"); - initQueryMapqhdky.put("", "新生儿血糖"); + initQueryMapqhdky.put("xsext", "新生儿血糖"); initQueryMapqhdky.put("apgarScore", "新生儿评分"); diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/MaterDeliverWorker2.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/MaterDeliverWorker2.java index 288dd60..ce91775 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/MaterDeliverWorker2.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/MaterDeliverWorker2.java @@ -60,8 +60,9 @@ public class MaterDeliverWorker2 implements Callable> { if(MapUtils.isNotEmpty(patientsMap)){ patients = patientsMap.get(maternalDeliverModel.getParentId()); }else { - Criteria criteria= Criteria.where("_id").is(maternalDeliverModel.getParentId()); + Criteria criteria= Criteria.where("id").is(maternalDeliverModel.getParentId()); patients = mongoTemplate.findOne(Query.query(criteria), Patients.class); +// System.out.println(Query.query(criteria).toString()+"--------------1"); } if (null == patients) { @@ -73,6 +74,7 @@ public class MaterDeliverWorker2 implements Callable> { if(StringUtils.isNotEmpty(patients.getId())){ Criteria criteria= Criteria.where("parentId").is(patients.getId()); AntExChuModel exChuModel = mongoTemplate.findOne(Query.query(criteria), AntExChuModel.class); +// System.out.println(Query.query(criteria).toString()+"--------------2"); if(null!=exChuModel){ initQueryMapqhdky.put("cc", null!=exChuModel.getProdTime()?0 == exChuModel.getProdTime()?"是":"否":""); initQueryMapqhdky.put("jc", null!=exChuModel.getProdTime()?0> { antExRecordQuery.setParentId(patients.getId()); antExRecordQuery.setcDueWeekStart(168); antExRecordQuery.setcDueWeekEnd(196); - List antExRecordModels = recordService.queryAntExRecords(antExRecordQuery); + antExRecordQuery.setNeed("yse"); + antExRecordQuery.setPage(1); + antExRecordQuery.setLimit(1); + List antExRecordModels = recordService.queryAntExRecords(antExRecordQuery,Sort.Direction.DESC, "checkTime"); +// System.out.println(antExRecordQuery.convertToQuery().convertToMongoQuery().toString()+"--------------3"); if(CollectionUtils.isNotEmpty(antExRecordModels)){ AntExRecordModel antExRecordModel= antExRecordModels.get(0); if(null!=antExRecordModel){ if(2==antExRecordModel.getType()){ //初诊 Criteria criteriaf= Criteria.where("id").is(antExRecordModel.getfId()); AntExChuModel AntExChu = mongoTemplate.findOne(Query.query(criteriaf), AntExChuModel.class); +// System.out.println(Query.query(criteriaf).toString()+"--------------4"); initQueryMapqhdky.put("mweight", null!=AntExChu.getWeight()?AntExChu.getWeight().toString():""); }else { //复诊 Criteria criteriaf= Criteria.where("id").is(antExRecordModel.getfId()); AntenatalExaminationModel AntExFu = mongoTemplate.findOne(Query.query(criteriaf), AntenatalExaminationModel.class); +// System.out.println(Query.query(criteriaf).toString()+"--------------5"); initQueryMapqhdky.put("mweight", null!=AntExFu.getWeight()?AntExFu.getWeight().toString():""); } }else { @@ -130,17 +138,23 @@ public class MaterDeliverWorker2 implements Callable> { //体重3kg(最后一次检查) AntExRecordQuery antExRecordQuery2=new AntExRecordQuery(); antExRecordQuery2.setParentId(patients.getId()); - List antExRecordModels2 = recordService.queryAntExRecords(antExRecordQuery2); + antExRecordQuery2.setNeed("yes"); + antExRecordQuery2.setPage(1); + antExRecordQuery2.setLimit(1); + List antExRecordModels2 = recordService.queryAntExRecords(antExRecordQuery2,Sort.Direction.DESC, "checkTime"); +// System.out.println(antExRecordQuery2.convertToQuery().convertToMongoQuery().toString()+"--------------6"); if(CollectionUtils.isNotEmpty(antExRecordModels2)){ AntExRecordModel antExRecordModel= antExRecordModels2.get(0); if(null!=antExRecordModel){ if(2==antExRecordModel.getType()){ //初诊 Criteria criteriaf= Criteria.where("id").is(antExRecordModel.getfId()); AntExChuModel AntExChu = mongoTemplate.findOne(Query.query(criteriaf), AntExChuModel.class); +// System.out.println(Query.query(criteriaf).toString()+"--------------7"); initQueryMapqhdky.put("cweight", null!=AntExChu?null!=AntExChu.getWeight()?AntExChu.getWeight().toString():"":""); }else { //复诊 Criteria criteriaf= Criteria.where("id").is(antExRecordModel.getfId()); AntenatalExaminationModel AntExFu = mongoTemplate.findOne(Query.query(criteriaf), AntenatalExaminationModel.class); +// System.out.println(Query.query(criteriaf).toString()+"--------------8"); initQueryMapqhdky.put("cweight", null!=AntExFu?null!=AntExFu.getWeight()?AntExFu.getWeight().toString():"":""); } }else { @@ -222,11 +236,16 @@ public class MaterDeliverWorker2 implements Callable> { antExRecordQuery3.setcDueWeekStart(168); antExRecordQuery3.setcDueWeekEnd(196); antExRecordQuery3.setType(1);//复诊 + antExRecordQuery3.setNeed("yse"); + antExRecordQuery3.setPage(1); + antExRecordQuery3.setLimit(1); List antExRecordModels3 = recordService.queryAntExRecords(antExRecordQuery3, Sort.Direction.ASC,"checkTime"); +// System.out.println(antExRecordQuery3.convertToQuery().convertToMongoQuery().toString()+"--------------9"); if(CollectionUtils.isNotEmpty(antExRecordModels3)) { AntExRecordModel antExRecordModel = antExRecordModels3.get(0); Criteria criteriaf= Criteria.where("id").is(antExRecordModel.getfId()); AntenatalExaminationModel AntExFu = mongoTemplate.findOne(Query.query(criteriaf), AntenatalExaminationModel.class); +// System.out.println(Query.query(criteriaf).toString()+"--------------10"); if(null!=AntExFu){ initQueryMapqhdky.put("bloodSugarKf", StringUtils.isNotEmpty(AntExFu.getBloodSugarKf())?AntExFu.getBloodSugarKf():""); initQueryMapqhdky.put("bloodSugar1h", StringUtils.isNotEmpty(AntExFu.getBloodSugar1h())?AntExFu.getBloodSugar1h():""); @@ -276,11 +295,11 @@ public class MaterDeliverWorker2 implements Callable> { } } initQueryMapqhdky.put("babyWeight", StringUtils.isNotEmpty(weight)?weight.substring(0,weight.length()-1):weight); - initQueryMapqhdky.put("", ""); + initQueryMapqhdky.put("xsext", "");//新生儿血糖 initQueryMapqhdky.put("apgarScore", StringUtils.isNotEmpty(apgarScore)?apgarScore.substring(0,apgarScore.length()-1):apgarScore); }else { initQueryMapqhdky.put("babyWeight", ""); - initQueryMapqhdky.put("", ""); + initQueryMapqhdky.put("xsext", "");//新生儿血糖 initQueryMapqhdky.put("apgarScore", ""); } @@ -322,7 +341,7 @@ public class MaterDeliverWorker2 implements Callable> { initQueryMapqhdky.put("ctgab", ""); initQueryMapqhdky.put("ctpoab", ""); initQueryMapqhdky.put("babyWeight", ""); - initQueryMapqhdky.put("", ""); + initQueryMapqhdky.put("xsext", ""); initQueryMapqhdky.put("apgarScore", ""); } date.add(initQueryMapqhdky); -- 1.8.3.1