Commit 265076b8a581154eff7e69bb856df1399c251f6a

Authored by jiangjiazhi

Merge remote-tracking branch 'origin/master'

Showing 1 changed file

platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/CouponServiceImpl.java View file @ 265076b
... ... @@ -327,12 +327,12 @@
327 327 restMap.put("vcCardNo", baby.getVcCardNo()); /** 就诊卡号 */
328 328 // restMap.put("cardNo", baby.getCardNo()); /** 证件号 */
329 329 restMap.put("cardNo", person.getCardNo()); /** 证件号 */
330   - Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(userId)), Patients.class);
331   - if(patients != null) {
332   - restMap.put("pcerteTypeId", patients.getPcerteTypeId()); /** 证件类型id */
333   - } else {
334   - restMap.put("pcerteTypeId", "57e1dd12f0f02e7ca519d6c7"); /** 证件类型id */
335 330  
  331 + List<Patients> list = mongoTemplate.find(Query.query(Criteria.where("cardNo").is(person.getCardNo())).with(new Sort(Sort.Direction.DESC, "created")), Patients.class);
  332 + if(CollectionUtils.isNotEmpty(list)) {
  333 + restMap.put("pcerteTypeId", list.get(0).getPcerteTypeId()); /** 证件类型id */
  334 + } else {
  335 + restMap.put("pcerteTypeId", "57e1dd12f0f02e7ca519d6c7"); /** 其他*/
336 336 }
337 337 } else {
338 338 Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(userId)), Patients.class);