|
@@ -54,7 +54,7 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
}
|
|
}
|
|
Date now = DateUtil.now();
|
|
Date now = DateUtil.now();
|
|
// 如果是身份证,获取性别和年龄
|
|
// 如果是身份证,获取性别和年龄
|
|
- if (IdTypeEnum.IdentityCard.getKey() == saveInquiryVO.getIdType()) {
|
|
|
|
|
|
+ if (saveInquiryVO.getIdType() != null && IdTypeEnum.IdentityCard.getKey() == saveInquiryVO.getIdType()) {
|
|
String idNum = saveInquiryVO.getIdNum();
|
|
String idNum = saveInquiryVO.getIdNum();
|
|
if (StringUtil.isNotBlank(idNum)) {
|
|
if (StringUtil.isNotBlank(idNum)) {
|
|
saveInquiryVO.setPatAge(IdCard.getAgeByIdCardAddOne(idNum));
|
|
saveInquiryVO.setPatAge(IdCard.getAgeByIdCardAddOne(idNum));
|
|
@@ -63,14 +63,18 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
}
|
|
}
|
|
|
|
|
|
String dateStr = DateUtil.formatDate(now);
|
|
String dateStr = DateUtil.formatDate(now);
|
|
- InquiryInfo inquiryInfo = this.getOne(new QueryWrapper<InquiryInfo>()
|
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
- .eq("hospital_code", saveInquiryVO.getHospitalCode())
|
|
|
|
- .eq("pat_name", saveInquiryVO.getPatName())
|
|
|
|
- .eq("id_type", saveInquiryVO.getIdType())
|
|
|
|
- .eq("id_num", saveInquiryVO.getIdNum())
|
|
|
|
- .apply("date_format(gmt_modified, '%Y-%m-%d')={0}", dateStr), false
|
|
|
|
- );
|
|
|
|
|
|
+ InquiryInfo inquiryInfo = null;
|
|
|
|
+ if (saveInquiryVO.getIdType() != null && saveInquiryVO.getIdNum() != null && saveInquiryVO.getPatName()!= null) {
|
|
|
|
+ inquiryInfo = this.getOne(new QueryWrapper<InquiryInfo>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("hospital_code", saveInquiryVO.getHospitalCode())
|
|
|
|
+ .eq("pat_name", saveInquiryVO.getPatName())
|
|
|
|
+ .eq("id_type", saveInquiryVO.getIdType())
|
|
|
|
+ .eq("id_num", saveInquiryVO.getIdNum())
|
|
|
|
+ .apply("date_format(gmt_modified, '%Y-%m-%d')={0}", dateStr), false
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
if (inquiryInfo == null) {
|
|
if (inquiryInfo == null) {
|
|
inquiryInfo = new InquiryInfo();
|
|
inquiryInfo = new InquiryInfo();
|
|
BeanUtil.copyProperties(saveInquiryVO, inquiryInfo);
|
|
BeanUtil.copyProperties(saveInquiryVO, inquiryInfo);
|