|
|
|
@ -153,16 +153,19 @@ public class PmsController extends BaseController { |
|
|
|
if (StrUtil.isEmpty(patientDto.getIdcard())) { |
|
|
|
throw new BaseException(ErrorConstant.ID_CARD_NULL); |
|
|
|
} |
|
|
|
if (!IdcardUtil.isValidCard(patientDto.getIdcard())) { |
|
|
|
if ("1".equals(patientDto.getIdCardType()) && !IdcardUtil.isValidCard(patientDto.getIdcard())) { |
|
|
|
throw new BaseException(ErrorConstant.ID_CARD_ERROR); |
|
|
|
} |
|
|
|
|
|
|
|
//通过身份证获取出生年份
|
|
|
|
patientDto.setBirthYear(IdcardUtil.getYearByIdCard(patientDto.getIdcard()).intValue()); |
|
|
|
//计算年龄
|
|
|
|
patientDto.setAge(IdcardUtil.getAgeByIdCard(patientDto.getIdcard())); |
|
|
|
if ("1".equals(patientDto.getIdCardType())) { |
|
|
|
patientDto.setBirthYear(IdcardUtil.getYearByIdCard(patientDto.getIdcard()).intValue()); |
|
|
|
//计算年龄
|
|
|
|
patientDto.setAge(IdcardUtil.getAgeByIdCard(patientDto.getIdcard())); |
|
|
|
} |
|
|
|
|
|
|
|
//使用md5加密手机号
|
|
|
|
if (flag) { |
|
|
|
if ("1".equals(patientDto.getIdCardType()) && flag) { |
|
|
|
// patientDto.setMobile(Md5Utils.hash(patientDto.getMobile()));
|
|
|
|
//使用md5加密处理身份证
|
|
|
|
String hash = Md5Utils.hash(patientDto.getIdcard().substring(2, 14)); |
|
|
|
@ -181,7 +184,7 @@ public class PmsController extends BaseController { |
|
|
|
} |
|
|
|
} |
|
|
|
//校验身份证格式
|
|
|
|
if (StrUtil.isNotEmpty(patientDto.getIdcard())) { |
|
|
|
if (StrUtil.isNotEmpty(patientDto.getIdcard()) && "1".equals(patientDto.getIdCardType())) { |
|
|
|
if (!IdcardUtil.isValidCard(patientDto.getIdcard())) { |
|
|
|
throw new BaseException(ErrorConstant.ID_CARD_ERROR); |
|
|
|
} |
|
|
|
@ -237,14 +240,17 @@ public class PmsController extends BaseController { |
|
|
|
if (StrUtil.isEmpty(patientDto.getIdcard())) { |
|
|
|
throw new BaseException(ErrorConstant.ID_CARD_NULL); |
|
|
|
} |
|
|
|
if (!IdcardUtil.isValidCard(patientDto.getIdcard())) { |
|
|
|
//只有身份证才校验格式
|
|
|
|
if (patientDto.getIdCardType() == 1 && !IdcardUtil.isValidCard(patientDto.getIdcard())) { |
|
|
|
throw new BaseException(ErrorConstant.ID_CARD_ERROR); |
|
|
|
} |
|
|
|
|
|
|
|
//通过身份证获取出生年份
|
|
|
|
patientDto.setBirthYear(IdcardUtil.getYearByIdCard(patientDto.getIdcard()).intValue()); |
|
|
|
if (patientDto.getIdCardType() == 1) { |
|
|
|
patientDto.setBirthYear(IdcardUtil.getYearByIdCard(patientDto.getIdcard()).intValue()); |
|
|
|
} |
|
|
|
|
|
|
|
if (flag) { |
|
|
|
if (flag && patientDto.getIdCardType() == 1) { |
|
|
|
try { |
|
|
|
//计算年龄
|
|
|
|
patientDto.setAge(IdcardUtil.getAgeByIdCard(patientDto.getIdcard())); |
|
|
|
@ -270,7 +276,7 @@ public class PmsController extends BaseController { |
|
|
|
} |
|
|
|
} |
|
|
|
//校验身份证格式
|
|
|
|
if (StrUtil.isNotEmpty(patientDto.getIdcard())) { |
|
|
|
if (StrUtil.isNotEmpty(patientDto.getIdcard()) && patientDto.getIdCardType() == 1) { |
|
|
|
if (!IdcardUtil.isValidCard(patientDto.getIdcard())) { |
|
|
|
throw new BaseException(ErrorConstant.ID_CARD_ERROR); |
|
|
|
} |
|
|
|
|