|
@@ -13,9 +13,7 @@ import thyyxxk.wxservice_server.entity.patientcards.BindPatientIdParam;
|
|
|
import thyyxxk.wxservice_server.entity.patientcards.ChangeCardParam;
|
|
|
import thyyxxk.wxservice_server.entity.patientcards.ModifyBindParam;
|
|
|
import thyyxxk.wxservice_server.entity.wxapi.PushMessageParam;
|
|
|
-import thyyxxk.wxservice_server.utils.DateUtil;
|
|
|
-import thyyxxk.wxservice_server.utils.PropertiesUtil;
|
|
|
-import thyyxxk.wxservice_server.utils.ResultVoUtil;
|
|
|
+import thyyxxk.wxservice_server.utils.*;
|
|
|
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
@@ -56,6 +54,22 @@ public class PatientCardsService {
|
|
|
return ResultVoUtil.success(dao.getBindPatientCard(openId));
|
|
|
}
|
|
|
|
|
|
+ public ResultVo<String> hasValidIdCard(BindPatientIdParam card) {
|
|
|
+ String tColumn = (card.getCardType() == 1) ? "patient_id" : "ic_card_no";
|
|
|
+ if (IdCardUtil.isValidatedIdCard(card.getSocialNo())) {
|
|
|
+ dao.updateSocialNo(tColumn, card.getCardNo(), card.getSocialNo());
|
|
|
+ return ResultVoUtil.success();
|
|
|
+ }
|
|
|
+ if (StringUtil.notBlank(card.getSocialNo())) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, "您输入的身份证不合法,请修改。");
|
|
|
+ }
|
|
|
+ String socialNo = dao.selectSocialNo(tColumn, card.getCardNo());
|
|
|
+ if (IdCardUtil.isValidatedIdCard(socialNo)) {
|
|
|
+ return ResultVoUtil.success();
|
|
|
+ }
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, "您在我院存留的身份证不合法,请完善。");
|
|
|
+ }
|
|
|
+
|
|
|
public ResultVo<HashMap<String, Object>> bindPatientId(BindPatientIdParam param) {
|
|
|
log.info("绑定就诊卡:{}", param);
|
|
|
final List<BindPatientIdParam> list;
|