医生微信登录接口

master
heminjian502 2 years ago
parent 6ea3c06d1d
commit 0363bcabef

@ -14,6 +14,8 @@ public interface TWechatUserMapper extends Mapper<TWechatUser> {
TWechatUser selectWechatUserByUnionid(String unionid); TWechatUser selectWechatUserByUnionid(String unionid);
TWechatUser selectWechatUserByUserId(Long userId);
int updateByPrimaryKeySelective(TWechatUser record); int updateByPrimaryKeySelective(TWechatUser record);
int updateByPrimaryKey(TWechatUser record); int updateByPrimaryKey(TWechatUser record);

@ -152,6 +152,10 @@ public class WechatServiceImpl implements IWechatService {
BeanUtils.copyProperties(req, currentDoctor); BeanUtils.copyProperties(req, currentDoctor);
currentDoctor.setDelFlag("0"); currentDoctor.setDelFlag("0");
tDoctorMapper.updateTDoctor(currentDoctor); tDoctorMapper.updateTDoctor(currentDoctor);
TWechatUser queryUser = tWechatUserMapper.selectWechatUserByUserId(currentDoctor.getId());
if (Objects.nonNull(queryUser)) {
throw new ServiceException("该手机号已绑定其他微信账号!");
}
wechatUser.setUserId(currentDoctor.getId()); wechatUser.setUserId(currentDoctor.getId());
tDoctor.setId(currentDoctor.getId()); tDoctor.setId(currentDoctor.getId());
} else { } else {

@ -185,6 +185,13 @@
where unionid = #{unionid,jdbcType=VARCHAR} where unionid = #{unionid,jdbcType=VARCHAR}
</select> </select>
<select id="selectWechatUserByUserId" resultMap="BaseResultMap" parameterType="java.lang.Long" >
select
<include refid="Base_Column_List" />
from t_wechat_user
where user_id = #{userId}
</select>
<update id="updateWechatUserByOpenId" parameterType="com.ruoyi.system.domain.TWechatUser"> <update id="updateWechatUserByOpenId" parameterType="com.ruoyi.system.domain.TWechatUser">
update t_wechat_user update t_wechat_user
set user_id = #{userId,jdbcType=BIGINT} set user_id = #{userId,jdbcType=BIGINT}

Loading…
Cancel
Save