提交 60e3f872 编写于 作者: xinxu.wang's avatar xinxu.wang

根据openid 获取医生id

上级 d90305eb
流水线 #38210 已失败 于阶段
......@@ -126,4 +126,6 @@ public interface DoctorMapper {
List<Integer> selectIdByParams(@Param("fromId") Integer fromId,
@Param("toId") Integer toId,
@Param("loginTime") Date loginTime);
String selectIdByOpenId(String openId);
}
\ No newline at end of file
......@@ -102,11 +102,16 @@ public class WechatServiceImpl implements WechatService {
@Override
public Integer getDoctorByOpenid(String openId) {
AccountWeChatInfoEntity entity = weChatInfoMapper.selectByOpenId(openId);
String unionId = "";
if (StringUtil.isNotNull(entity)) {
DoctorUnionResp doctorUnionfoModel = getDoctorByUnionid(entity.getUnionid());
if (StringUtil.isNotNull(doctorUnionfoModel)) {
return doctorUnionfoModel.getDoctorId();
}
unionId = entity.getUnionid();
} else {
unionId = doctorMapper.selectIdByOpenId(openId);
}
DoctorUnionResp doctorUnionfoModel = getDoctorByUnionid(unionId);
if (StringUtil.isNotNull(doctorUnionfoModel)) {
return doctorUnionfoModel.getDoctorId();
}
return null;
}
......
......@@ -1099,4 +1099,10 @@
and id &lt;= #{toId}
and last_login_time &lt;= #{loginTime}
</select>
<select id="selectIdByOpenId" parameterType="java.lang.String" resultType="java.lang.String">
select unionid from p_wechat_doctor
where openid = #{openId} and delete_flag = 1
limit 1
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册