提交 42bc01e5 作者: zhenjie

数据库删除uid字段

上级 0ca4626f
...@@ -4,7 +4,6 @@ import com.alibaba.fastjson2.JSON; ...@@ -4,7 +4,6 @@ import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.mmc.iuav.auth.JwtConstant; import com.mmc.iuav.auth.JwtConstant;
import com.mmc.iuav.auth.JwtUtil; import com.mmc.iuav.auth.JwtUtil;
import com.mmc.iuav.general.CodeUtil;
import com.mmc.iuav.response.ResultBody; import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.response.ResultEnum; import com.mmc.iuav.response.ResultEnum;
import com.mmc.iuav.user.auth.PwdUtil; import com.mmc.iuav.user.auth.PwdUtil;
...@@ -94,21 +93,17 @@ public class AuthServiceImpl implements AuthService { ...@@ -94,21 +93,17 @@ public class AuthServiceImpl implements AuthService {
} }
//数据库查询用户信息 //数据库查询用户信息
UserAccountVO userAccountVO = userAccountService.getUserAccountInfoByUnionId(unionId); UserAccountVO userAccountVO = userAccountService.getUserAccountInfoByUnionId(unionId);
String uid;
Integer companyAuthStatus = 0; Integer companyAuthStatus = 0;
if (userAccountVO == null) { if (userAccountVO == null) {
UserAccountDO userAccountDO = new UserAccountDO(); UserAccountDO userAccountDO = new UserAccountDO();
userAccountDO.setUnionId(unionId); userAccountDO.setUnionId(unionId);
userAccountDO.setOpenId(openId); userAccountDO.setOpenId(openId);
uid = CodeUtil.generateUserUID();
userAccountDO.setUid(uid);
userAccountDO.setPortType(100); userAccountDO.setPortType(100);
userAccountDO.setSource(wxLoginVO.getSource()); userAccountDO.setSource(wxLoginVO.getSource());
userAccountService.insertUserAccount(userAccountDO); userAccountService.insertUserAccount(userAccountDO);
userAccountVO = userAccountDO.buildUserAccountVO(); userAccountVO = userAccountDO.buildUserAccountVO();
payClient.createWallet(userAccountDO.getId()); payClient.createWallet(userAccountDO.getId());
} else { } else {
uid = userAccountVO.getUid();
CompanyAuthDO companyAuthDO = companyAuthDao.getCompanyAuth(userAccountVO.getId()); CompanyAuthDO companyAuthDO = companyAuthDao.getCompanyAuth(userAccountVO.getId());
if (companyAuthDO != null) { if (companyAuthDO != null) {
companyAuthStatus = companyAuthDO.getAuthStatus(); companyAuthStatus = companyAuthDO.getAuthStatus();
...@@ -120,7 +115,7 @@ public class AuthServiceImpl implements AuthService { ...@@ -120,7 +115,7 @@ public class AuthServiceImpl implements AuthService {
map.put(JwtConstant.TOKEN_TYPE, JwtConstant.IUAV_TOKEN); map.put(JwtConstant.TOKEN_TYPE, JwtConstant.IUAV_TOKEN);
String token = JwtUtil.createJwt(map); String token = JwtUtil.createJwt(map);
LoginSuccessDTO loginSuccessDTO = LoginSuccessDTO.builder().token(token).userAccountId(userAccountVO.getId()).uid(uid) LoginSuccessDTO loginSuccessDTO = LoginSuccessDTO.builder().token(token).userAccountId(userAccountVO.getId()).uid(userAccountVO.getId() + "")
.userName(userAccountVO.getUserName()).nickName(userAccountVO.getNickName()).phoneNum(userAccountVO.getPhoneNum()).portType(100).build(); .userName(userAccountVO.getUserName()).nickName(userAccountVO.getNickName()).phoneNum(userAccountVO.getPhoneNum()).portType(100).build();
stringRedisTemplate.opsForValue().set( stringRedisTemplate.opsForValue().set(
...@@ -181,7 +176,7 @@ public class AuthServiceImpl implements AuthService { ...@@ -181,7 +176,7 @@ public class AuthServiceImpl implements AuthService {
companyAuthStatus = companyAuthDO.getAuthStatus(); companyAuthStatus = companyAuthDO.getAuthStatus();
} }
String token = JwtUtil.createJwt(map); String token = JwtUtil.createJwt(map);
LoginSuccessDTO loginSuccessDTO = LoginSuccessDTO.builder().token(token).userAccountId(userAccountVO.getId()).uid(userAccountVO.getUid()) LoginSuccessDTO loginSuccessDTO = LoginSuccessDTO.builder().token(token).userAccountId(userAccountVO.getId()).uid(userAccountVO.getId() + "")
.userName(userAccountVO.getUserName()).nickName(userAccountVO.getNickName()).phoneNum(userAccountVO.getPhoneNum()).portType(100).build(); .userName(userAccountVO.getUserName()).nickName(userAccountVO.getNickName()).phoneNum(userAccountVO.getPhoneNum()).portType(100).build();
stringRedisTemplate.opsForValue().set( stringRedisTemplate.opsForValue().set(
token, JSONObject.toJSONString(loginSuccessDTO), token, JSONObject.toJSONString(loginSuccessDTO),
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
<mapper namespace="com.mmc.iuav.user.dao.UserServiceDao"> <mapper namespace="com.mmc.iuav.user.dao.UserServiceDao">
<resultMap id="userAccountResultMap" type="com.mmc.iuav.user.entity.UserAccountDO"> <resultMap id="userAccountResultMap" type="com.mmc.iuav.user.entity.UserAccountDO">
<id property="id" column="id"/> <id property="id" column="id"/>
<result property="uid" column="uid"/>
<result property="phoneNum" column="phone_num"/> <result property="phoneNum" column="phone_num"/>
<result property="userName" column="user_name"/> <result property="userName" column="user_name"/>
<result property="nickName" column="nick_name"/> <result property="nickName" column="nick_name"/>
...@@ -35,10 +34,10 @@ ...@@ -35,10 +34,10 @@
<insert id="insertUserAccount" parameterType="com.mmc.iuav.user.entity.UserAccountDO" <insert id="insertUserAccount" parameterType="com.mmc.iuav.user.entity.UserAccountDO"
useGeneratedKeys="true" keyProperty="id"> useGeneratedKeys="true" keyProperty="id">
insert into user_account(uid, phone_num, user_name, nick_name, user_img, open_id, insert into user_account(phone_num, user_name, nick_name, user_img, open_id,
union_id, user_sex, email, source, province_code, city_code, district_code, remark, union_id, user_sex, email, source, province_code, city_code, district_code, remark,
port_type, create_time) port_type, create_time)
values (#{uid}, #{phoneNum}, #{userName}, #{nickName}, #{userImg}, #{openId}, values (#{phoneNum}, #{userName}, #{nickName}, #{userImg}, #{openId},
#{unionId}, #{userSex}, #{email}, #{source}, #{provinceCode}, #{cityCode}, #{districtCode}, #{remark}, #{unionId}, #{userSex}, #{email}, #{source}, #{provinceCode}, #{cityCode}, #{districtCode}, #{remark},
#{portType}, NOW()) #{portType}, NOW())
</insert> </insert>
...@@ -102,7 +101,6 @@ ...@@ -102,7 +101,6 @@
<select id="getUserAccountInfoByUnionId" resultType="com.mmc.iuav.user.entity.UserAccountDO"> <select id="getUserAccountInfoByUnionId" resultType="com.mmc.iuav.user.entity.UserAccountDO">
select id, select id,
uid,
phone_num, phone_num,
user_name, user_name,
nick_name, nick_name,
...@@ -125,7 +123,6 @@ ...@@ -125,7 +123,6 @@
<select id="getUserAccountById" resultType="com.mmc.iuav.user.entity.UserAccountDO"> <select id="getUserAccountById" resultType="com.mmc.iuav.user.entity.UserAccountDO">
select id, select id,
uid,
phone_num, phone_num,
user_name, user_name,
nick_name, nick_name,
...@@ -161,7 +158,7 @@ ...@@ -161,7 +158,7 @@
<select id="feignListUserAccount" resultType="com.mmc.iuav.user.entity.UserAccountDO" <select id="feignListUserAccount" resultType="com.mmc.iuav.user.entity.UserAccountDO"
parameterType="com.mmc.iuav.user.model.qo.UserAccountQO"> parameterType="com.mmc.iuav.user.model.qo.UserAccountQO">
select ua.id, ua.uid, ua.phone_num, ua.user_name, ua.nick_name, ua.user_img, ua.open_id, select ua.id, ua.phone_num, ua.user_name, ua.nick_name, ua.user_img, ua.open_id,
ua.union_id, ua.user_sex, ua.email, ua.source, ua.account_status, ua.remark, ua.union_id, ua.user_sex, ua.email, ua.source, ua.account_status, ua.remark,
ua.port_type, ua.disable, ua.create_time, ua.update_time, ca.auth_status as companyAuthStatus ua.port_type, ua.disable, ua.create_time, ua.update_time, ca.auth_status as companyAuthStatus
from user_account ua left join company_auth ca on ua.id = ca.user_account_id from user_account ua left join company_auth ca on ua.id = ca.user_account_id
...@@ -176,7 +173,7 @@ ...@@ -176,7 +173,7 @@
user_name like CONCAT("%",#{keyword},"%") or user_name like CONCAT("%",#{keyword},"%") or
nick_name like CONCAT("%",#{keyword},"%") or nick_name like CONCAT("%",#{keyword},"%") or
phone_num like CONCAT("%",#{keyword},"%") or phone_num like CONCAT("%",#{keyword},"%") or
uid like CONCAT("%",#{keyword},"%")) id like CONCAT("%",#{keyword},"%"))
</if> </if>
<if test="provinceCode != null"> <if test="provinceCode != null">
and ua.province_code = #{provinceCode} and ua.province_code = #{provinceCode}
...@@ -190,7 +187,7 @@ ...@@ -190,7 +187,7 @@
</select> </select>
<select id="listUserAccountByIds" resultType="com.mmc.iuav.user.entity.UserAccountDO"> <select id="listUserAccountByIds" resultType="com.mmc.iuav.user.entity.UserAccountDO">
select ua.id, ua.uid, ua.phone_num, ua.user_name, ua.nick_name, ua.user_img, ua.open_id, select ua.id, ua.phone_num, ua.user_name, ua.nick_name, ua.user_img, ua.open_id,
ua.union_id, ua.user_sex, ua.email, ua.source, ua.account_status, ua.remark, ua.union_id, ua.user_sex, ua.email, ua.source, ua.account_status, ua.remark,
ua.port_type, ua.disable, ua.create_time, ua.update_time, ca.auth_status as companyAuthStatus, ua.port_type, ua.disable, ua.create_time, ua.update_time, ca.auth_status as companyAuthStatus,
ca.company_name ca.company_name
...@@ -204,7 +201,7 @@ ...@@ -204,7 +201,7 @@
</select> </select>
<select id="feignListRcdUserInfo" resultType="com.mmc.iuav.user.entity.UserAccountDO"> <select id="feignListRcdUserInfo" resultType="com.mmc.iuav.user.entity.UserAccountDO">
select ua.id, ua.uid, ua.phone_num, ua.user_name, ua.nick_name, ua.user_img, ua.open_id, select ua.id, ua.phone_num, ua.user_name, ua.nick_name, ua.user_img, ua.open_id,
ua.union_id, ua.user_sex, ua.email, ua.source, ua.account_status, ua.remark, ua.union_id, ua.user_sex, ua.email, ua.source, ua.account_status, ua.remark,
ua.port_type, ua.disable, ua.create_time, ua.update_time, ca.auth_status as companyAuthStatus, ua.port_type, ua.disable, ua.create_time, ua.update_time, ca.auth_status as companyAuthStatus,
ca.company_name ca.company_name
...@@ -220,7 +217,6 @@ ...@@ -220,7 +217,6 @@
<select id="getUserRcdByAccountId" resultType="com.mmc.iuav.user.entity.UserAccountDO"> <select id="getUserRcdByAccountId" resultType="com.mmc.iuav.user.entity.UserAccountDO">
select ua.id, select ua.id,
ua.uid,
ua.phone_num, ua.phone_num,
ua.user_name, ua.user_name,
ua.nick_name, ua.nick_name,
...@@ -285,7 +281,7 @@ ...@@ -285,7 +281,7 @@
<select id="listAppUser" resultMap="userAccountResultMap" <select id="listAppUser" resultMap="userAccountResultMap"
parameterType="com.mmc.iuav.user.model.qo.UserAccountQO"> parameterType="com.mmc.iuav.user.model.qo.UserAccountQO">
select ua.id, ua.uid, ua.phone_num, ua.user_name, ua.nick_name, ua.user_img, ua.open_id, select ua.id, ua.phone_num, ua.user_name, ua.nick_name, ua.user_img, ua.open_id,
ua.union_id, ua.user_sex, ua.email, ua.source, ua.account_status, ua.remark, ua.union_id, ua.user_sex, ua.email, ua.source, ua.account_status, ua.remark,
ua.port_type, ua.disable, ua.create_time, ua.update_time, IFNULL(ca.auth_status, 0) as ua.port_type, ua.disable, ua.create_time, ua.update_time, IFNULL(ca.auth_status, 0) as
companyAuthStatus, ca.company_name, rcd.id as user_rcd_id, rcd.rcd_user_id, r_user.nick_name as rcdNickname, companyAuthStatus, ca.company_name, rcd.id as user_rcd_id, rcd.rcd_user_id, r_user.nick_name as rcdNickname,
...@@ -339,7 +335,6 @@ ...@@ -339,7 +335,6 @@
ua.nick_name, ua.nick_name,
ua.user_img, ua.user_img,
ua.user_name, ua.user_name,
ua.uid,
ua.phone_num, ua.phone_num,
count(*) as invite_count count(*) as invite_count
from user_rcd urd from user_rcd urd
...@@ -354,7 +349,6 @@ ...@@ -354,7 +349,6 @@
ua.nick_name, ua.nick_name,
ua.user_img, ua.user_img,
ua.user_name, ua.user_name,
ua.uid,
ua.phone_num, ua.phone_num,
count(*) as invite_count count(*) as invite_count
from user_rcd urd from user_rcd urd
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论