优化--后台添加用户标签

上级 449be4e2
流水线 #9021 已通过 于阶段
in 2 分 30 秒
...@@ -31,4 +31,5 @@ public class LoginSuccessDTO implements Serializable { ...@@ -31,4 +31,5 @@ public class LoginSuccessDTO implements Serializable {
private CompanyInfoVO companyInfoVO; private CompanyInfoVO companyInfoVO;
private RoleInfoDTO roleInfo; private RoleInfoDTO roleInfo;
private Integer appUserAccountId; private Integer appUserAccountId;
private Integer cooperateTagId;
} }
...@@ -71,6 +71,7 @@ public class AuthHandler { ...@@ -71,6 +71,7 @@ public class AuthHandler {
public LoginSuccessDTO addPcLoginCache(BackUserAccountVO user) { public LoginSuccessDTO addPcLoginCache(BackUserAccountVO user) {
// 查询单位信息 // 查询单位信息
CompanyInfoVO companyInfoVO = companyService.getCompanyInfoByAppLoginUserId(user.getId()); CompanyInfoVO companyInfoVO = companyService.getCompanyInfoByAppLoginUserId(user.getId());
companyInfoVO.setCooperationTagId(user.getCooperationTagId());
companyInfoVO.setLeader(1); companyInfoVO.setLeader(1);
// 角色信息 // 角色信息
RoleInfoDO roleInfoDO = roleDao.getRoleInfoByUserId(user.getId()); RoleInfoDO roleInfoDO = roleDao.getRoleInfoByUserId(user.getId());
...@@ -78,9 +79,11 @@ public class AuthHandler { ...@@ -78,9 +79,11 @@ public class AuthHandler {
map.put(JwtConstant.USER_ACCOUNT_ID, user.getId()); map.put(JwtConstant.USER_ACCOUNT_ID, user.getId());
map.put(JwtConstant.TOKEN_TYPE, JwtConstant.M_TOKEN); map.put(JwtConstant.TOKEN_TYPE, JwtConstant.M_TOKEN);
String token = JwtUtil.createJwt(map); String token = JwtUtil.createJwt(map);
//获取用户的加盟标签信息
LoginSuccessDTO loginSuccessDTO = LoginSuccessDTO.builder().token(token).userAccountId(user.getId()).accountNo(user.getAccountNo()).uid(user.getId() + "") LoginSuccessDTO loginSuccessDTO = LoginSuccessDTO.builder().token(token).userAccountId(user.getId()).accountNo(user.getAccountNo()).uid(user.getId() + "")
.userName(user.getUserName()).nickName(user.getUserName()).phoneNum(user.getPhoneNum()).portType(UserTypeEnums.PC.getType()) .userName(user.getUserName()).nickName(user.getUserName()).phoneNum(user.getPhoneNum()).portType(UserTypeEnums.PC.getType())
.companyInfoVO(companyInfoVO == null ? null : companyInfoVO) .companyInfoVO(companyInfoVO == null ? null : companyInfoVO)
.cooperateTagId(user.getCooperationTagId())
.roleInfo(roleInfoDO.buildRoleInfoDTO()).build(); .roleInfo(roleInfoDO.buildRoleInfoDTO()).build();
stringRedisTemplate.setValueSerializer(RedisSerializer.json()); stringRedisTemplate.setValueSerializer(RedisSerializer.json());
stringRedisTemplate.opsForValue().set( stringRedisTemplate.opsForValue().set(
......
...@@ -164,4 +164,7 @@ public interface CooperationDao { ...@@ -164,4 +164,7 @@ public interface CooperationDao {
//查到标签绑定之前的用户 //查到标签绑定之前的用户
UserApplyTagDO selectTageByUserId(Integer fromUserAccountId); UserApplyTagDO selectTageByUserId(Integer fromUserAccountId);
//根据后台id查找当前商家加盟标签
Integer selectTagIdByBackUserId(Integer backUserId);
} }
...@@ -11,10 +11,7 @@ import com.mmc.iuav.user.client.PayClient; ...@@ -11,10 +11,7 @@ import com.mmc.iuav.user.client.PayClient;
import com.mmc.iuav.user.constant.WxConstant; import com.mmc.iuav.user.constant.WxConstant;
import com.mmc.iuav.user.controller.userpoints.config.NumberOfUserPoints; import com.mmc.iuav.user.controller.userpoints.config.NumberOfUserPoints;
import com.mmc.iuav.user.controller.userpoints.config.UserPointsEnum; import com.mmc.iuav.user.controller.userpoints.config.UserPointsEnum;
import com.mmc.iuav.user.dao.CompanyAuthDao; import com.mmc.iuav.user.dao.*;
import com.mmc.iuav.user.dao.RealNameAuthDao;
import com.mmc.iuav.user.dao.RoleDao;
import com.mmc.iuav.user.dao.UserServiceDao;
import com.mmc.iuav.user.dao.userpoints.UserPointsDao; import com.mmc.iuav.user.dao.userpoints.UserPointsDao;
import com.mmc.iuav.user.dao.userpoints.UserPointsDetailsDao; import com.mmc.iuav.user.dao.userpoints.UserPointsDetailsDao;
import com.mmc.iuav.user.entity.*; import com.mmc.iuav.user.entity.*;
...@@ -50,6 +47,8 @@ public class AuthServiceImpl implements AuthService { ...@@ -50,6 +47,8 @@ public class AuthServiceImpl implements AuthService {
@Autowired @Autowired
private UserServiceDao userServiceDao; private UserServiceDao userServiceDao;
@Autowired @Autowired
private CooperationDao cooperationDao;
@Autowired
private ActivityService activityService; private ActivityService activityService;
@Autowired @Autowired
private UserPointsDao userPointsDao; private UserPointsDao userPointsDao;
...@@ -201,7 +200,9 @@ public class AuthServiceImpl implements AuthService { ...@@ -201,7 +200,9 @@ public class AuthServiceImpl implements AuthService {
if (!loginPwd.equals(user.getPassword())) { if (!loginPwd.equals(user.getPassword())) {
return ResultBody.error(ResultEnum.LOGIN_PASSWORD_ERROR); return ResultBody.error(ResultEnum.LOGIN_PASSWORD_ERROR);
} }
Integer tagId = cooperationDao.selectTagIdByBackUserId(user.getId());
BackUserAccountVO backUserAccountVO = user.buildBackUserAccountVO(); BackUserAccountVO backUserAccountVO = user.buildBackUserAccountVO();
backUserAccountVO.setCooperationTagId(tagId);
LoginSuccessDTO loginSuccessDTO = authHandler.addPcLoginCache(backUserAccountVO); LoginSuccessDTO loginSuccessDTO = authHandler.addPcLoginCache(backUserAccountVO);
return ResultBody.success(loginSuccessDTO); return ResultBody.success(loginSuccessDTO);
} }
......
...@@ -631,6 +631,14 @@ ...@@ -631,6 +631,14 @@
from user_apply_tag from user_apply_tag
where user_account_id = #{userAccountId} where user_account_id = #{userAccountId}
</select> </select>
<select id="selectTagIdByBackUserId" resultType="java.lang.Integer">
select cooperation_tag_id from user_tag where user_account_id =
(
select user_account_id
from company_member cm inner join company_back_user cbu on cm.company_info_id = cbu.company_info_id
where cbu.back_user_account_id = 252
)
</select>
</mapper> </mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论