修改注册接口实现
This commit is contained in:
parent
75ef1415ad
commit
60ac53e173
@ -99,11 +99,11 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @return java.lang.String
|
||||||
* @Author mengkuiliang
|
* @Author mengkuiliang
|
||||||
* @Description 获取微信手机号
|
* @Description 获取微信手机号
|
||||||
* @Date 2023-09-26 026 11:42
|
* @Date 2023-09-26 026 11:42
|
||||||
* @Param [code]
|
* @Param [code]
|
||||||
* @return java.lang.String
|
|
||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public JSONObject getPhone(String code) {
|
public JSONObject getPhone(String code) {
|
||||||
@ -126,7 +126,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
|||||||
}
|
}
|
||||||
|
|
||||||
//获取手机号 https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/user-info/phone-number/getPhoneNumber.html
|
//获取手机号 https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/user-info/phone-number/getPhoneNumber.html
|
||||||
String url = "https://api.weixin.qq.com/wxa/business/getuserphonenumber"+ "?access_token=" + accessToken;
|
String url = "https://api.weixin.qq.com/wxa/business/getuserphonenumber" + "?access_token=" + accessToken;
|
||||||
JSONObject params = new JSONObject();
|
JSONObject params = new JSONObject();
|
||||||
params.put("code", code);
|
params.put("code", code);
|
||||||
SslUtils.ignoreSsl();
|
SslUtils.ignoreSsl();
|
||||||
@ -135,7 +135,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
log.info("获取小程序手机号 : {}", result.toJSONString());
|
log.info("获取小程序手机号 : {}", result.toJSONString());
|
||||||
if(result.getInteger("errcode") != 0) {
|
if (result.getInteger("errcode") != 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -166,38 +166,9 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
|||||||
@Override
|
@Override
|
||||||
public void register(PatientInfoBody body) {
|
public void register(PatientInfoBody body) {
|
||||||
// 获取当前微信绑定的居民
|
// 获取当前微信绑定的居民
|
||||||
<<<<<<< HEAD:xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentPatientInfoServiceImpl.java
|
|
||||||
List<PatientInfo> list = residentPatientInfoMapper.getList(body.getOpenid(), body.getCityCode());
|
List<PatientInfo> list = residentPatientInfoMapper.getList(body.getOpenid(), body.getCityCode());
|
||||||
|
|
||||||
PatientInfo patientInfo = residentPatientInfoMapper.isRegisterByCardNo(body.getCardNo());
|
|
||||||
if (patientInfo == null) {
|
|
||||||
PatientInfo entity = new PatientInfo();
|
|
||||||
BeanUtils.copyBeanProp(entity, body);
|
|
||||||
entity.setPatientCode(IdUtils.fastSimpleUUID());
|
|
||||||
entity.setBindingTime(new Date());
|
|
||||||
entity.setIsChecked((list == null || list.size() == 0) ? "1" : "0");
|
|
||||||
entity.setCreateTime(new Date());
|
|
||||||
entity.setCreateBy(body.getCardNo());
|
|
||||||
residentPatientInfoMapper.insertPatientInfo(entity);
|
|
||||||
} else {
|
|
||||||
if (!StringUtils.isBlank(patientInfo.getOpenid())) {
|
|
||||||
throw new ServiceException("该身份证号已被注册");
|
|
||||||
}
|
|
||||||
patientInfo.setIsChecked((list == null || list.size() == 0) ? "1" : "0");
|
|
||||||
patientInfo.setOpenid(body.getOpenid());
|
|
||||||
patientInfo.setUnionid(body.getUnionid());
|
|
||||||
patientInfo.setPatientName(body.getPatientName());
|
|
||||||
patientInfo.setPhone(body.getPhone());
|
|
||||||
patientInfo.setAddress(body.getAddress());
|
|
||||||
patientInfo.setUpdateTime(new Date());
|
|
||||||
patientInfo.setUpdateBy(body.getCardNo());
|
|
||||||
patientInfo.setHeadPictureUrl(body.getHeadPictureUrl());
|
|
||||||
patientInfo.setDelFlag(0);
|
|
||||||
residentPatientInfoMapper.updatePatientInfo(patientInfo);
|
|
||||||
=======
|
|
||||||
List<PatientInfo> list = patientInfoMapper.getList(body.getOpenid(), body.getCityCode());
|
|
||||||
if (ObjectUtils.isNotEmpty(body.getCardNo())) {
|
if (ObjectUtils.isNotEmpty(body.getCardNo())) {
|
||||||
PatientInfo patientInfo = patientInfoMapper.isRegisterByCardNo(body.getCardNo());
|
PatientInfo patientInfo = residentPatientInfoMapper.isRegisterByCardNo(body.getCardNo());
|
||||||
if (patientInfo == null) {
|
if (patientInfo == null) {
|
||||||
PatientInfo entity = new PatientInfo();
|
PatientInfo entity = new PatientInfo();
|
||||||
BeanUtils.copyBeanProp(entity, body);
|
BeanUtils.copyBeanProp(entity, body);
|
||||||
@ -206,7 +177,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
|||||||
entity.setIsChecked((list == null || list.size() == 0) ? "1" : "0");
|
entity.setIsChecked((list == null || list.size() == 0) ? "1" : "0");
|
||||||
entity.setCreateTime(new Date());
|
entity.setCreateTime(new Date());
|
||||||
entity.setCreateBy(body.getCardNo());
|
entity.setCreateBy(body.getCardNo());
|
||||||
patientInfoMapper.insertPatientInfo(entity);
|
residentPatientInfoMapper.insertPatientInfo(entity);
|
||||||
} else {
|
} else {
|
||||||
if (!StringUtils.isBlank(patientInfo.getOpenid())) {
|
if (!StringUtils.isBlank(patientInfo.getOpenid())) {
|
||||||
throw new ServiceException("该身份证号已被注册");
|
throw new ServiceException("该身份证号已被注册");
|
||||||
@ -221,9 +192,8 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
|||||||
patientInfo.setUpdateBy(body.getCardNo());
|
patientInfo.setUpdateBy(body.getCardNo());
|
||||||
patientInfo.setHeadPictureUrl(body.getHeadPictureUrl());
|
patientInfo.setHeadPictureUrl(body.getHeadPictureUrl());
|
||||||
patientInfo.setDelFlag(0);
|
patientInfo.setDelFlag(0);
|
||||||
patientInfoMapper.updatePatientInfo(patientInfo);
|
residentPatientInfoMapper.updatePatientInfo(patientInfo);
|
||||||
}
|
}
|
||||||
>>>>>>> 34d892aa069ef8de8aee23ae0e5653a942d69476:xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/PatientInfoServiceImpl.java
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,11 +282,11 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @return com.xinelu.familydoctor.applet.pojo.entity.PatientInfo
|
||||||
* @Author mengkuiliang
|
* @Author mengkuiliang
|
||||||
* @Description 获取注册信息-根据身份证号
|
* @Description 获取注册信息-根据身份证号
|
||||||
* @Date 2023-09-27 027 15:13
|
* @Date 2023-09-27 027 15:13
|
||||||
* @Param [cardNo]
|
* @Param [cardNo]
|
||||||
* @return com.xinelu.familydoctor.applet.pojo.entity.PatientInfo
|
|
||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public PatientInfo getByCardNo(String cardNo) {
|
public PatientInfo getByCardNo(String cardNo) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user