Commit 39c93e1d8c73e6f53144aa884cd90e98143893b0

Authored by litao
1 parent 421be1cdbe

逻辑修复

Showing 1 changed file with 17 additions and 9 deletions

platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/CouponServiceImpl.java View file @ 39c93e1
... ... @@ -10,10 +10,7 @@
10 10 import com.lyms.platform.permission.model.Organization;
11 11 import com.lyms.platform.permission.service.CouponService;
12 12 import com.lyms.platform.permission.service.OrganizationService;
13   -import com.lyms.platform.pojo.DischargeAbstractMotherModel;
14   -import com.lyms.platform.pojo.MaternalDeliverModel;
15   -import com.lyms.platform.pojo.Patients;
16   -import com.lyms.platform.pojo.PersonModel;
  13 +import com.lyms.platform.pojo.*;
17 14 import org.apache.commons.collections.CollectionUtils;
18 15 import org.apache.commons.collections.MapUtils;
19 16 import org.apache.commons.lang3.StringUtils;
20 17  
... ... @@ -254,12 +251,23 @@
254 251 public Map<String, Object> getPatientsInfo(String userId) {
255 252 Map<String, Object> restMap = new HashMap<>();
256 253 restMap.put("userId", userId);
257   - Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(userId)), Patients.class);
258   - if(patients != null) {
259   - restMap.put("vcCardNo", patients.getVcCardNo()); /** 就诊卡号 */
260   - restMap.put("cardNo", patients.getCardNo()); /** 证件号 */
261   - restMap.put("pcerteTypeId", patients.getPcerteTypeId()); /** 证件类型id */
  254 +
  255 + /** 1=孕妇 2=儿童 3=产妇 */
  256 + PersonModel person = mongoTemplate.findById(userId, PersonModel.class);
  257 + if(person != null && person.getType() == 2) {
  258 + BabyModel baby = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(userId)), BabyModel.class);
  259 + restMap.put("vcCardNo", baby.getVcCardNo()); /** 就诊卡号 */
  260 + restMap.put("cardNo", baby.getCardNo()); /** 证件号 */
  261 + restMap.put("pcerteTypeId", baby.getFcertTypeId()); /** 证件类型id */
  262 + } else {
  263 + Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(userId)), Patients.class);
  264 + if(patients != null) {
  265 + restMap.put("vcCardNo", patients.getVcCardNo()); /** 就诊卡号 */
  266 + restMap.put("cardNo", patients.getCardNo()); /** 证件号 */
  267 + restMap.put("pcerteTypeId", patients.getPcerteTypeId()); /** 证件类型id */
  268 + }
262 269 }
  270 +
263 271 return restMap;
264 272 }
265 273