From 5e6fbf40552dc0d23da6bac0d79ac4630ad794b8 Mon Sep 17 00:00:00 2001 From: yangfei Date: Fri, 27 Jul 2018 16:23:26 +0800 Subject: [PATCH] 2 --- .../lyms/platform/query/MatDeliverFollowQuery.java | 29 ++++++++++++++++++---- .../com/lyms/platform/query/MatDeliverQuery.java | 13 ++++++++++ .../operate/web/facade/MatDeliverFacade.java | 16 ++++++++++++ .../web/request/MatdeliverFollowRequest.java | 27 ++++++++++++++++++++ 4 files changed, 80 insertions(+), 5 deletions(-) diff --git a/platform-dal/src/main/java/com/lyms/platform/query/MatDeliverFollowQuery.java b/platform-dal/src/main/java/com/lyms/platform/query/MatDeliverFollowQuery.java index 4164749..5bbf72e 100644 --- a/platform-dal/src/main/java/com/lyms/platform/query/MatDeliverFollowQuery.java +++ b/platform-dal/src/main/java/com/lyms/platform/query/MatDeliverFollowQuery.java @@ -82,7 +82,11 @@ public class MatDeliverFollowQuery extends BaseQuery implements IConvertToNative /** * 访视日期 */ - private Date visitDate; + private Date visitStartDate; + /** + * 访视日期 + */ + private Date visitEndDate; /** * 访视医生 */ @@ -209,6 +213,13 @@ public class MatDeliverFollowQuery extends BaseQuery implements IConvertToNative if (StringUtils.isNotBlank(hospitalId)) { condition = condition.and("hospitalId",hospitalId , MongoOper.IS); } + + if (visitStartDate!=null) { + condition = condition.and("visitDate",visitStartDate , MongoOper.GTE); + } + if (visitEndDate!=null) { + condition = condition.and("visitDate",visitEndDate , MongoOper.LTE); + } if (StringUtils.isNotBlank(deliverId)) { condition = condition.and("deliverId",deliverId , MongoOper.IS); } @@ -381,12 +392,20 @@ public class MatDeliverFollowQuery extends BaseQuery implements IConvertToNative this.visitAffirm = visitAffirm; } - public Date getVisitDate() { - return visitDate; + public Date getVisitStartDate() { + return visitStartDate; + } + + public void setVisitStartDate(Date visitStartDate) { + this.visitStartDate = visitStartDate; + } + + public Date getVisitEndDate() { + return visitEndDate; } - public void setVisitDate(Date visitDate) { - this.visitDate = visitDate; + public void setVisitEndDate(Date visitEndDate) { + this.visitEndDate = visitEndDate; } public String getVisitDoctor() { diff --git a/platform-dal/src/main/java/com/lyms/platform/query/MatDeliverQuery.java b/platform-dal/src/main/java/com/lyms/platform/query/MatDeliverQuery.java index b28cfbf..0c44d32 100644 --- a/platform-dal/src/main/java/com/lyms/platform/query/MatDeliverQuery.java +++ b/platform-dal/src/main/java/com/lyms/platform/query/MatDeliverQuery.java @@ -18,6 +18,7 @@ import java.util.List; */ public class MatDeliverQuery extends BaseQuery implements IConvertToNativeQuery { private String id; + private List ids; private String parentId; private List parentIdList; private String deliveryMode; @@ -79,6 +80,14 @@ public class MatDeliverQuery extends BaseQuery implements IConvertToNativeQuery */ private String matFollowId; + public List getIds() { + return ids; + } + + public void setIds(List ids) { + this.ids = ids; + } + public String getFsHospital() { return fsHospital; } @@ -229,6 +238,10 @@ public class MatDeliverQuery extends BaseQuery implements IConvertToNativeQuery if (null != id) { condition = condition.and("id", id, MongoOper.IS); } + + if (CollectionUtils.isNotEmpty(ids)) { + condition = condition.and("id", ids, MongoOper.IN); + } if (null != pid) { condition = condition.and("pid", pid, MongoOper.IS); } 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 929f64e..221fce3 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 @@ -56,6 +56,8 @@ public class MatDeliverFacade { @Autowired private MatDeliverService matDeliverService; @Autowired + private MatDeliverFollowService matDeliverFollowService; + @Autowired private AntenatalExaminationFacade antenatalExaminationFacade; @Autowired private BabyService babyService; @@ -1480,6 +1482,20 @@ public class MatDeliverFacade { MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); + if(matdeliverFollowRequest.getFollowStarDate()!=null){ + MatDeliverFollowQuery matDeliverFollowQuery = new MatDeliverFollowQuery(); + matDeliverFollowQuery.setVisitStartDate(matdeliverFollowRequest.getFollowStarDate()); + matDeliverFollowQuery.setVisitEndDate(matdeliverFollowRequest.getFollowEndDate()); + List matdeliverFollowModels = matDeliverFollowService.query(matDeliverFollowQuery); + List mfIds = new ArrayList<>(); + for(MatdeliverFollowModel md:matdeliverFollowModels){ + mfIds.add(md.getDeliverId()); + } + matDeliverQuery.setIds(mfIds); + } + + + //查询号不为空,则查询孕妇id if (StringUtils.isNotEmpty(matdeliverFollowRequest.getQueryNo())//查询号不为空 || StringUtils.isNotEmpty(matdeliverFollowRequest.getProvinceId())//居住地省 diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MatdeliverFollowRequest.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MatdeliverFollowRequest.java index 749a498..a5696c8 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MatdeliverFollowRequest.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MatdeliverFollowRequest.java @@ -1,5 +1,7 @@ package com.lyms.platform.operate.web.request; +import java.util.Date; + /** * @auther yangfei * @createTime 2017年11月21日 17时58分 @@ -18,6 +20,15 @@ public class MatdeliverFollowRequest extends BasePageQueryRequest{ * 访视阶段 1-访视期内、2-超出访视期 */ private Integer followStage; + + /** + * 访视时间开始 + */ + private Date followStarDate; + /** + * 访视时间结束 + */ + private Date followEndDate; /** * @discription 是否区域 */ @@ -83,6 +94,22 @@ public class MatdeliverFollowRequest extends BasePageQueryRequest{ */ private String need; + public Date getFollowStarDate() { + return followStarDate; + } + + public void setFollowStarDate(Date followStarDate) { + this.followStarDate = followStarDate; + } + + public Date getFollowEndDate() { + return followEndDate; + } + + public void setFollowEndDate(Date followEndDate) { + this.followEndDate = followEndDate; + } + public Integer getFollowStage() { return followStage; } -- 1.8.3.1