From 60ac53e173f2b363fab5887c2d33dc696286e45d Mon Sep 17 00:00:00 2001 From: mengkuiliang <1464081137@qq.com> Date: Thu, 28 Sep 2023 13:44:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=A8=E5=86=8C=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ResidentPatientInfoServiceImpl.java | 44 +++---------------- 1 file changed, 7 insertions(+), 37 deletions(-) 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 0f6bb47..eed7748 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 @@ -99,11 +99,11 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi } /** + * @return java.lang.String * @Author mengkuiliang * @Description 获取微信手机号 * @Date 2023-09-26 026 11:42 * @Param [code] - * @return java.lang.String **/ @Override 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 - 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(); params.put("code", code); SslUtils.ignoreSsl(); @@ -135,7 +135,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi return null; } log.info("获取小程序手机号 : {}", result.toJSONString()); - if(result.getInteger("errcode") != 0) { + if (result.getInteger("errcode") != 0) { return null; } return result; @@ -166,38 +166,9 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi @Override public void register(PatientInfoBody body) { // 获取当前微信绑定的居民 -<<<<<<< HEAD:xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentPatientInfoServiceImpl.java List 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 list = patientInfoMapper.getList(body.getOpenid(), body.getCityCode()); if (ObjectUtils.isNotEmpty(body.getCardNo())) { - PatientInfo patientInfo = patientInfoMapper.isRegisterByCardNo(body.getCardNo()); + PatientInfo patientInfo = residentPatientInfoMapper.isRegisterByCardNo(body.getCardNo()); if (patientInfo == null) { PatientInfo entity = new PatientInfo(); BeanUtils.copyBeanProp(entity, body); @@ -206,7 +177,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi entity.setIsChecked((list == null || list.size() == 0) ? "1" : "0"); entity.setCreateTime(new Date()); entity.setCreateBy(body.getCardNo()); - patientInfoMapper.insertPatientInfo(entity); + residentPatientInfoMapper.insertPatientInfo(entity); } else { if (!StringUtils.isBlank(patientInfo.getOpenid())) { throw new ServiceException("该身份证号已被注册"); @@ -221,9 +192,8 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi patientInfo.setUpdateBy(body.getCardNo()); patientInfo.setHeadPictureUrl(body.getHeadPictureUrl()); 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 * @Description 获取注册信息-根据身份证号 * @Date 2023-09-27 027 15:13 * @Param [cardNo] - * @return com.xinelu.familydoctor.applet.pojo.entity.PatientInfo **/ @Override public PatientInfo getByCardNo(String cardNo) {