用户列表,用户列表详情

main
cheney 12 months ago
parent 856e41fd35
commit efe8dc90cc
  1. 3
      gateway/src/main/resources/bootstrap.properties
  2. 5
      nakadai/src/main/java/com/huoran/nakadai/service/impl/PlatformTeamAccountServiceImpl.java
  3. 7
      users/src/main/java/com/huoran/users/controller/HrUserAccountController.java
  4. 8
      users/src/main/java/com/huoran/users/entity/res/UserInfoDetailsRes.java
  5. 30
      users/src/main/java/com/huoran/users/entity/res/UserInfoListRes.java
  6. 2
      users/src/main/java/com/huoran/users/mapper/EnterpriseCertificationMapper.java
  7. 61
      users/src/main/java/com/huoran/users/mapper/xml/HrUserAccountMapper.xml
  8. 2
      users/src/main/java/com/huoran/users/service/IHrUserAccountService.java
  9. 35
      users/src/main/java/com/huoran/users/service/impl/HrUserAccountServiceImpl.java

@ -3,6 +3,9 @@ spring.application.name=gateway
#addr #addr
spring.cloud.nacos.config.server-addr=127.0.0.1:8848 spring.cloud.nacos.config.server-addr=127.0.0.1:8848
spring.cloud.nacos.discovery.username=nacos
spring.cloud.nacos.discovery.password=huorantech
#namespace #namespace
spring.cloud.nacos.config.namespace=kindergarten-microservice-configuration-namespace spring.cloud.nacos.config.namespace=kindergarten-microservice-configuration-namespace

@ -6,6 +6,8 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.huoran.common.exception.CustomException;
import com.huoran.common.exception.ExceptionEnum;
import com.huoran.common.response.R; import com.huoran.common.response.R;
import com.huoran.common.utils.HttpClientUtils; import com.huoran.common.utils.HttpClientUtils;
import com.huoran.common.utils.JwtUtils; import com.huoran.common.utils.JwtUtils;
@ -94,6 +96,9 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco
UserAccount userAccount = baseMapper.selectAccountByOpenId(openid,platformId); UserAccount userAccount = baseMapper.selectAccountByOpenId(openid,platformId);
// 有平台存在返回登录信息 // 有平台存在返回登录信息
if (userAccount!= null){ if (userAccount!= null){
if (!userAccount.getIsEnable()){
throw new CustomException(ExceptionEnum.ACCOUNT_DISABLED);
}
data.put("state", "login"); data.put("state", "login");
data.put("platformId", platformId); data.put("platformId", platformId);
data.put("token", JwtUtils.getJwtToken(userAccount.getId().toString())); data.put("token", JwtUtils.getJwtToken(userAccount.getId().toString()));

@ -282,6 +282,13 @@ public class HrUserAccountController {
return R.ok().put("result", result); return R.ok().put("result", result);
} }
@ApiOperation(value = "查看用户详情", response = UserInfoDetailsRes.class)
@GetMapping("/viewUserDetails")
public R viewUserDetails(@RequestParam @NotNull(message = "用户id为空查询错误") @Param("userId") Integer userId) {
UserInfoDetailsRes result = iHrUserAccountService.viewUserDetails(userId);
return R.ok().put("result", result);
}
@ApiOperation(value = "中台一键启用前——用户判断是否能够一键启用(判断当前用户是否有数据平台的账号绑定,需要判断院校可用账号数量)") @ApiOperation(value = "中台一键启用前——用户判断是否能够一键启用(判断当前用户是否有数据平台的账号绑定,需要判断院校可用账号数量)")
@PostMapping("/oneClickEnableVerification") @PostMapping("/oneClickEnableVerification")
public R oneClickEnableVerification(@RequestParam("accountId") @ApiParam(value = "账号id") Integer accountId) { public R oneClickEnableVerification(@RequestParam("accountId") @ApiParam(value = "账号id") Integer accountId) {

@ -4,10 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.huoran.common.entity.resp.PhoneBindingrResp; import com.huoran.common.entity.resp.PhoneBindingrResp;
import com.huoran.users.entity.HrPersonalFile; import com.huoran.users.entity.*;
import com.huoran.users.entity.HrUserAccount;
import com.huoran.users.entity.HrUserInfo;
import com.huoran.users.entity.SysPlatform;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.ToString; import lombok.ToString;
@ -63,4 +60,7 @@ public class UserInfoDetailsRes implements Serializable {
@ApiModelProperty("已绑定平台和用户信息") @ApiModelProperty("已绑定平台和用户信息")
private List<PhoneBindingrResp> bindingPlatformAndUserList; private List<PhoneBindingrResp> bindingPlatformAndUserList;
@ApiModelProperty("组织认证信息")
private List<EnterpriseCertification> enterpriseCertificationList;
} }

@ -22,9 +22,6 @@ public class UserInfoListRes implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* 用户id
*/
@ApiModelProperty("用户id") @ApiModelProperty("用户id")
@TableId(value = "userId", type = IdType.AUTO) @TableId(value = "userId", type = IdType.AUTO)
private Integer userId; private Integer userId;
@ -32,48 +29,24 @@ public class UserInfoListRes implements Serializable {
@ApiModelProperty("账号id") @ApiModelProperty("账号id")
private Integer accountId; private Integer accountId;
/**
* 用户账号
*/
@ApiModelProperty("用户账号") @ApiModelProperty("用户账号")
private String account; private String account;
/**
* 用户姓名
*/
@ApiModelProperty("用户姓名") @ApiModelProperty("用户姓名")
private String userName; private String userName;
/**
* 学校名称
*/
@ApiModelProperty("学校名称")
private String schoolName;
/**
* 平台来源
*/
@ApiModelProperty("平台来源") @ApiModelProperty("平台来源")
private String platformName; private String platformName;
/**
* 手机号
*/
@ApiModelProperty("手机号") @ApiModelProperty("手机号")
private String phone; private String phone;
/**
* 创建时间
*/
@ApiModelProperty("创建时间") @ApiModelProperty("创建时间")
private String createTime; private String createTime;
@ApiModelProperty("最近登录时间") @ApiModelProperty("最近登录时间")
private String lastLoginTime; private String lastLoginTime;
/**
* 登录次数
*/
@ApiModelProperty("登录次数") @ApiModelProperty("登录次数")
private Integer logInNumber; private Integer logInNumber;
@ -86,4 +59,7 @@ public class UserInfoListRes implements Serializable {
@ApiModelProperty("城市") @ApiModelProperty("城市")
private String cityName; private String cityName;
@ApiModelProperty("实名认证")
private String authentication;
} }

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.huoran.users.entity.EnterpriseCertification; import com.huoran.users.entity.EnterpriseCertification;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huoran.users.entity.req.EnterpriseCertificationLIstReq; import com.huoran.users.entity.req.EnterpriseCertificationLIstReq;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/** /**
@ -14,6 +15,7 @@ import org.apache.ibatis.annotations.Param;
* @author chen * @author chen
* @since 2023-12-18 * @since 2023-12-18
*/ */
@Mapper
public interface EnterpriseCertificationMapper extends BaseMapper<EnterpriseCertification> { public interface EnterpriseCertificationMapper extends BaseMapper<EnterpriseCertification> {
IPage<EnterpriseCertification> selectEnterpriseCertificationList(IPage<EnterpriseCertification> page, @Param("req")EnterpriseCertificationLIstReq req); IPage<EnterpriseCertification> selectEnterpriseCertificationList(IPage<EnterpriseCertification> page, @Param("req")EnterpriseCertificationLIstReq req);

@ -836,46 +836,28 @@
u.user_id, u.user_id,
a.id AS accountId, a.id AS accountId,
a.phone, a.phone,
s.school_name,
IFNULL(
(
SELECT
GROUP_CONCAT( s.platform_name )
FROM
sys_platform s
WHERE
FIND_IN_SET(
s.platform_id,
(
SELECT
GROUP_CONCAT( DISTINCT phone.platform_id ) AS platform_id
FROM
hr_user_account phone
WHERE
phone.phone = a.phone
AND phone.is_del = 0
)
)
),
( SELECT platform_name FROM sys_platform sp WHERE sp.platform_id = a.platform_id )
) AS platformName,
a.create_time, a.create_time,
u.last_login_time, u.last_login_time,
u.login_number, u.login_number,
u.user_name, CASE
a.work_number WHEN count(ai.id) > 0 THEN ai.real_name
ELSE u.user_name
END as user_name,
a.work_number,
s.platform_name,
CASE
WHEN count(ai.id) > 0 THEN '已认证'
ELSE '未认证'
END as authentication
FROM FROM
nakadai.hr_user_info u nakadai.hr_user_info u
INNER JOIN nakadai.hr_user_account a ON u.user_id = a.user_id INNER JOIN nakadai.hr_user_account a ON u.user_id = a.user_id AND a.is_del = 0
AND a.is_del = 0 inner join sys_platform s on a.platform_id = s.platform_id
INNER JOIN nakadai.school s ON s.school_id = a.school_id left join hr_user_authentication_information ai on a.id = ai.account_id
AND s.is_del = 0
WHERE WHERE
u.is_del = 0 u.is_del = 0
AND a.customer_id IS NULL AND a.customer_id IS NULL
AND a.platform_id != 3 AND a.platform_id not in (1,2,3,4)
AND a.platform_id != 4
<if test='userInfoReq.creationTime!=null <if test='userInfoReq.creationTime!=null
and userInfoReq.endTime!=null and userInfoReq.endTime!="" and userInfoReq.creationTime!="" '> and userInfoReq.endTime!=null and userInfoReq.endTime!="" and userInfoReq.creationTime!="" '>
AND u.create_time between #{userInfoReq.creationTime} and #{userInfoReq.endTime} AND u.create_time between #{userInfoReq.creationTime} and #{userInfoReq.endTime}
@ -893,26 +875,13 @@
<if test='userInfoReq.cityId !=null and userInfoReq.cityId !=""'> <if test='userInfoReq.cityId !=null and userInfoReq.cityId !=""'>
and u.city_id =#{userInfoReq.cityId} and u.city_id =#{userInfoReq.cityId}
</if> </if>
<if test='userInfoReq.schoolId !=null and userInfoReq.schoolId !="" '>
AND FIND_IN_SET( #{userInfoReq.schoolId}, a.school_id )
</if>
<if test='userInfoReq.searchContent !=null and userInfoReq.searchContent !=""'> <if test='userInfoReq.searchContent !=null and userInfoReq.searchContent !=""'>
AND ( a.phone LIKE CONCAT('%',#{userInfoReq.searchContent},'%') AND ( a.phone LIKE CONCAT('%',#{userInfoReq.searchContent},'%')
OR u.user_name LIKE CONCAT('%',#{userInfoReq.searchContent},'%')) OR u.user_name LIKE CONCAT('%',#{userInfoReq.searchContent},'%'))
</if> </if>
ORDER BY ORDER BY
create_time DESC LIMIT create_time DESC LIMIT
#{userInfoReq.pageNum} #{userInfoReq.pageNum},#{userInfoReq.pageSize}
,
#{userInfoReq.pageSize}
</select> </select>
<select id="selectUserSysBindById" resultType="com.huoran.users.entity.res.UserAccountListRes"> <select id="selectUserSysBindById" resultType="com.huoran.users.entity.res.UserAccountListRes">

@ -84,4 +84,6 @@ public interface IHrUserAccountService extends IService<HrUserAccount> {
Integer querySchoolIdByAccountId(String id); Integer querySchoolIdByAccountId(String id);
R studentAccountApplication(RegisterReq registerReq); R studentAccountApplication(RegisterReq registerReq);
UserInfoDetailsRes viewUserDetails(Integer userId);
} }

@ -19,13 +19,11 @@ import com.huoran.common.response.R;
import com.huoran.common.utils.AliyunOssUtil; import com.huoran.common.utils.AliyunOssUtil;
import com.huoran.common.utils.DateUtil; import com.huoran.common.utils.DateUtil;
import com.huoran.common.utils.MD5; import com.huoran.common.utils.MD5;
import com.huoran.users.entity.HrPersonalFile; import com.huoran.users.entity.*;
import com.huoran.users.entity.HrUserAccount;
import com.huoran.users.entity.HrUserInfo;
import com.huoran.users.entity.SysPlatform;
import com.huoran.users.entity.req.*; import com.huoran.users.entity.req.*;
import com.huoran.users.entity.res.*; import com.huoran.users.entity.res.*;
import com.huoran.users.entity.vo.CheckVo; import com.huoran.users.entity.vo.CheckVo;
import com.huoran.users.mapper.EnterpriseCertificationMapper;
import com.huoran.users.mapper.HrPersonalFileMapper; import com.huoran.users.mapper.HrPersonalFileMapper;
import com.huoran.users.mapper.HrUserAccountMapper; import com.huoran.users.mapper.HrUserAccountMapper;
import com.huoran.users.mapper.HrUserInfoMapper; import com.huoran.users.mapper.HrUserInfoMapper;
@ -63,7 +61,7 @@ public class HrUserAccountServiceImpl extends ServiceImpl<HrUserAccountMapper, H
private HrUserInfoMapper hrUserInfoMapper; private HrUserInfoMapper hrUserInfoMapper;
@Autowired @Autowired
private HrUserInfoServiceImpl hrUserInfoService; private EnterpriseCertificationMapper enterpriseCertificationMapper;
@Autowired @Autowired
private HrPersonalFileMapper hrPersonalFileMapper; private HrPersonalFileMapper hrPersonalFileMapper;
@Autowired @Autowired
@ -405,6 +403,33 @@ public class HrUserAccountServiceImpl extends ServiceImpl<HrUserAccountMapper, H
return res; return res;
} }
@Override
public UserInfoDetailsRes viewUserDetails(Integer userId) {
UserInfoDetailsRes res = new UserInfoDetailsRes();
//查询用户信息
HrUserInfo hrUserInfo = hrUserInfoMapper.selectByUserId(userId);
//查询账号详情List
HrUserAccount userAccount = hrUserAccountMapper.selectOne(new QueryWrapper<HrUserAccount>()
.eq("user_id", userId));
HrUserAccount parameter = new HrUserAccount();
if (userAccount.getPhone() == null || userAccount.getPhone().equals("")) {
parameter.setUserId(hrUserInfo.getUserId());
} else {
parameter.setPhone(userAccount.getPhone());
}
List<EnterpriseCertification> enterpriseCertificationList = enterpriseCertificationMapper.selectList(
new QueryWrapper<EnterpriseCertification>().eq("account_id", userAccount.getId()));
res.setHrUserInfo(hrUserInfo);
res.setEnterpriseCertificationList(enterpriseCertificationList);
res.setUserAccount(userAccount);
return res;
}
@Override @Override
public R oneClickEnableVerification(Integer accountId) { public R oneClickEnableVerification(Integer accountId) {

Loading…
Cancel
Save