From 39c93e1d8c73e6f53144aa884cd90e98143893b0 Mon Sep 17 00:00:00 2001 From: litao Date: Sat, 6 May 2017 11:39:26 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../permission/service/impl/CouponServiceImpl.java | 26 ++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/CouponServiceImpl.java b/platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/CouponServiceImpl.java index f8e80f8..a7cec1e 100644 --- a/platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/CouponServiceImpl.java +++ b/platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/CouponServiceImpl.java @@ -10,10 +10,7 @@ import com.lyms.platform.permission.model.CouponInfo; import com.lyms.platform.permission.model.Organization; import com.lyms.platform.permission.service.CouponService; import com.lyms.platform.permission.service.OrganizationService; -import com.lyms.platform.pojo.DischargeAbstractMotherModel; -import com.lyms.platform.pojo.MaternalDeliverModel; -import com.lyms.platform.pojo.Patients; -import com.lyms.platform.pojo.PersonModel; +import com.lyms.platform.pojo.*; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; @@ -254,12 +251,23 @@ public class CouponServiceImpl implements CouponService { public Map getPatientsInfo(String userId) { Map restMap = new HashMap<>(); restMap.put("userId", userId); - Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(userId)), Patients.class); - if(patients != null) { - restMap.put("vcCardNo", patients.getVcCardNo()); /** 就诊卡号 */ - restMap.put("cardNo", patients.getCardNo()); /** 证件号 */ - restMap.put("pcerteTypeId", patients.getPcerteTypeId()); /** 证件类型id */ + + /** 1=孕妇 2=儿童 3=产妇 */ + PersonModel person = mongoTemplate.findById(userId, PersonModel.class); + if(person != null && person.getType() == 2) { + BabyModel baby = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(userId)), BabyModel.class); + restMap.put("vcCardNo", baby.getVcCardNo()); /** 就诊卡号 */ + restMap.put("cardNo", baby.getCardNo()); /** 证件号 */ + restMap.put("pcerteTypeId", baby.getFcertTypeId()); /** 证件类型id */ + } else { + Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(userId)), Patients.class); + if(patients != null) { + restMap.put("vcCardNo", patients.getVcCardNo()); /** 就诊卡号 */ + restMap.put("cardNo", patients.getCardNo()); /** 证件号 */ + restMap.put("pcerteTypeId", patients.getPcerteTypeId()); /** 证件类型id */ + } } + return restMap; } -- 1.8.3.1