注册返回绑定城市

This commit is contained in:
赵旭 2023-10-16 14:28:01 +08:00
parent 8b022ad013
commit 3bf848721f
3 changed files with 17 additions and 5 deletions

View File

@ -95,5 +95,5 @@ public interface ResidentPatientInfoMapper {
**/ **/
PatientInfo getByCardNo(String cardNo); PatientInfo getByCardNo(String cardNo);
int selectPatientInfoByPhone(String phone); List<PatientInfo> selectPatientInfoByPhone(String phone);
} }

View File

@ -154,7 +154,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
if(!StringUtils.isBlank(body.getPatientCode())) { if(!StringUtils.isBlank(body.getPatientCode())) {
PatientInfo patientInfo = residentPatientInfoMapper.getByCardNo(body.getCardNo()); PatientInfo patientInfo = residentPatientInfoMapper.getByCardNo(body.getCardNo());
BeanUtils.copyBeanProp(patientInfo, body); BeanUtils.copyBeanProp(patientInfo, body);
if(body.getDiseaseList() != null) { if (body.getDiseaseList() != null) {
patientInfo.setDisease(body.getDiseaseList().stream().collect(Collectors.joining(","))); patientInfo.setDisease(body.getDiseaseList().stream().collect(Collectors.joining(",")));
} }
patientInfo.setLoginFlag(Long.valueOf(1)); patientInfo.setLoginFlag(Long.valueOf(1));
@ -318,6 +318,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
@Override @Override
public HashMap<String, String> login(String loginCode,String phoneCode) throws Exception { public HashMap<String, String> login(String loginCode,String phoneCode) throws Exception {
HashMap<String, String> HashMap = new HashMap<>(); HashMap<String, String> HashMap = new HashMap<>();
//获取openId
try { try {
SslUtils.ignoreSsl(); SslUtils.ignoreSsl();
String params = "appid=" + appletChatConfig.getAppletId() + "&secret=" + appletChatConfig.getSecret() + "&js_code=" + loginCode + "&grant_type=" + appletChatConfig.getGrantType(); 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) { } catch (Exception e) {
throw new ServiceException(e.getMessage()); throw new ServiceException(e.getMessage());
} }
//获取手机号
String code; String code;
String cityCode = "";
AppletPhoneVO phone = getPhone(phoneCode); AppletPhoneVO phone = getPhone(phoneCode);
String phoneNumber = phone.getPhoneInfo().getPhoneNumber(); String phoneNumber = phone.getPhoneInfo().getPhoneNumber();
HashMap.put("phone",phoneNumber); HashMap.put("phone",phoneNumber);
code = residentPatientInfoMapper.selectPatientInfoByPhone(phoneNumber) == 0 ? "0" : "1"; //code = residentPatientInfoMapper.selectPatientInfoByPhone(phoneNumber) == 0 ? "0" : "1";
List<PatientInfo> 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("code",code);
HashMap.put("cityCode",cityCode);
return HashMap; return HashMap;
} }
} }

View File

@ -453,8 +453,8 @@
<!-- 获取注册详细信息 --> <!-- 获取注册详细信息 -->
<select id="selectPatientInfoByPhone" parameterType="String" resultType="java.lang.Integer"> <select id="selectPatientInfoByPhone" parameterType="String" resultMap="PatientInfoResult">
select count(1) from patient_info <include refid="selectPatientInfoVo"/>
where phone = #{pnone} where phone = #{pnone}
and login_flag = '1' and login_flag = '1'
</select> </select>