diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/mapper/ResidentPatientInfoMapper.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/mapper/ResidentPatientInfoMapper.java index 8eb0e0c..3a6c863 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/mapper/ResidentPatientInfoMapper.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/mapper/ResidentPatientInfoMapper.java @@ -95,5 +95,5 @@ public interface ResidentPatientInfoMapper { **/ PatientInfo getByCardNo(String cardNo); - int selectPatientInfoByPhone(String phone); + List selectPatientInfoByPhone(String phone); } diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentPatientInfoServiceImpl.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentPatientInfoServiceImpl.java index de51f3c..fee897e 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentPatientInfoServiceImpl.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentPatientInfoServiceImpl.java @@ -154,7 +154,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi if(!StringUtils.isBlank(body.getPatientCode())) { PatientInfo patientInfo = residentPatientInfoMapper.getByCardNo(body.getCardNo()); BeanUtils.copyBeanProp(patientInfo, body); - if(body.getDiseaseList() != null) { + if (body.getDiseaseList() != null) { patientInfo.setDisease(body.getDiseaseList().stream().collect(Collectors.joining(","))); } patientInfo.setLoginFlag(Long.valueOf(1)); @@ -318,6 +318,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi @Override public HashMap login(String loginCode,String phoneCode) throws Exception { HashMap HashMap = new HashMap<>(); + //获取openId try { SslUtils.ignoreSsl(); String params = "appid=" + appletChatConfig.getAppletId() + "&secret=" + appletChatConfig.getSecret() + "&js_code=" + loginCode + "&grant_type=" + appletChatConfig.getGrantType(); @@ -334,12 +335,23 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi } catch (Exception e) { throw new ServiceException(e.getMessage()); } + //获取手机号 String code; + String cityCode = ""; AppletPhoneVO phone = getPhone(phoneCode); String phoneNumber = phone.getPhoneInfo().getPhoneNumber(); HashMap.put("phone",phoneNumber); - code = residentPatientInfoMapper.selectPatientInfoByPhone(phoneNumber) == 0 ? "0" : "1"; + //code = residentPatientInfoMapper.selectPatientInfoByPhone(phoneNumber) == 0 ? "0" : "1"; + List infoList = residentPatientInfoMapper.selectPatientInfoByPhone(phoneNumber); + code = infoList.size()== 0 ? "0" : "1"; + //返回绑定城市 + if ("1".equals(code)){ + for (PatientInfo patientInfo : infoList) { + cityCode = patientInfo.getCityCode(); + } + } HashMap.put("code",code); + HashMap.put("cityCode",cityCode); return HashMap; } } diff --git a/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml b/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml index 5574d49..4b74569 100644 --- a/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml +++ b/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml @@ -453,8 +453,8 @@ - + where phone = #{pnone} and login_flag = '1'