用户列表,用户列表详情

main
cheney 11 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
spring.cloud.nacos.config.server-addr=127.0.0.1:8848
spring.cloud.nacos.discovery.username=nacos
spring.cloud.nacos.discovery.password=huorantech
#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.baomidou.mybatisplus.core.metadata.IPage;
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.utils.HttpClientUtils;
import com.huoran.common.utils.JwtUtils;
@ -94,6 +96,9 @@ public class PlatformTeamAccountServiceImpl extends ServiceImpl<PlatformTeamAcco
UserAccount userAccount = baseMapper.selectAccountByOpenId(openid,platformId);
// 有平台存在返回登录信息
if (userAccount!= null){
if (!userAccount.getIsEnable()){
throw new CustomException(ExceptionEnum.ACCOUNT_DISABLED);
}
data.put("state", "login");
data.put("platformId", platformId);
data.put("token", JwtUtils.getJwtToken(userAccount.getId().toString()));

@ -282,6 +282,13 @@ public class HrUserAccountController {
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 = "中台一键启用前——用户判断是否能够一键启用(判断当前用户是否有数据平台的账号绑定,需要判断院校可用账号数量)")
@PostMapping("/oneClickEnableVerification")
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.huoran.common.entity.resp.PhoneBindingrResp;
import com.huoran.users.entity.HrPersonalFile;
import com.huoran.users.entity.HrUserAccount;
import com.huoran.users.entity.HrUserInfo;
import com.huoran.users.entity.SysPlatform;
import com.huoran.users.entity.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
@ -63,4 +60,7 @@ public class UserInfoDetailsRes implements Serializable {
@ApiModelProperty("已绑定平台和用户信息")
private List<PhoneBindingrResp> bindingPlatformAndUserList;
@ApiModelProperty("组织认证信息")
private List<EnterpriseCertification> enterpriseCertificationList;
}

@ -22,9 +22,6 @@ public class UserInfoListRes implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 用户id
*/
@ApiModelProperty("用户id")
@TableId(value = "userId", type = IdType.AUTO)
private Integer userId;
@ -32,48 +29,24 @@ public class UserInfoListRes implements Serializable {
@ApiModelProperty("账号id")
private Integer accountId;
/**
* 用户账号
*/
@ApiModelProperty("用户账号")
private String account;
/**
* 用户姓名
*/
@ApiModelProperty("用户姓名")
private String userName;
/**
* 学校名称
*/
@ApiModelProperty("学校名称")
private String schoolName;
/**
* 平台来源
*/
@ApiModelProperty("平台来源")
private String platformName;
/**
* 手机号
*/
@ApiModelProperty("手机号")
private String phone;
/**
* 创建时间
*/
@ApiModelProperty("创建时间")
private String createTime;
@ApiModelProperty("最近登录时间")
private String lastLoginTime;
/**
* 登录次数
*/
@ApiModelProperty("登录次数")
private Integer logInNumber;
@ -86,4 +59,7 @@ public class UserInfoListRes implements Serializable {
@ApiModelProperty("城市")
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.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huoran.users.entity.req.EnterpriseCertificationLIstReq;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
@ -14,6 +15,7 @@ import org.apache.ibatis.annotations.Param;
* @author chen
* @since 2023-12-18
*/
@Mapper
public interface EnterpriseCertificationMapper extends BaseMapper<EnterpriseCertification> {
IPage<EnterpriseCertification> selectEnterpriseCertificationList(IPage<EnterpriseCertification> page, @Param("req")EnterpriseCertificationLIstReq req);

@ -836,46 +836,28 @@
u.user_id,
a.id AS accountId,
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,
u.last_login_time,
u.login_number,
u.user_name,
a.work_number
CASE
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
nakadai.hr_user_info u
INNER JOIN nakadai.hr_user_account a ON u.user_id = a.user_id
AND a.is_del = 0
INNER JOIN nakadai.school s ON s.school_id = a.school_id
AND s.is_del = 0
INNER JOIN nakadai.hr_user_account a ON u.user_id = a.user_id AND a.is_del = 0
inner join sys_platform s on a.platform_id = s.platform_id
left join hr_user_authentication_information ai on a.id = ai.account_id
WHERE
u.is_del = 0
AND a.customer_id IS NULL
AND a.platform_id != 3
AND a.platform_id != 4
AND a.platform_id not in (1,2,3,4)
<if test='userInfoReq.creationTime!=null
and userInfoReq.endTime!=null and userInfoReq.endTime!="" and userInfoReq.creationTime!="" '>
AND u.create_time between #{userInfoReq.creationTime} and #{userInfoReq.endTime}
@ -893,26 +875,13 @@
<if test='userInfoReq.cityId !=null and userInfoReq.cityId !=""'>
and u.city_id =#{userInfoReq.cityId}
</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 !=""'>
AND ( a.phone LIKE CONCAT('%',#{userInfoReq.searchContent},'%')
OR u.user_name LIKE CONCAT('%',#{userInfoReq.searchContent},'%'))
</if>
ORDER BY
create_time DESC LIMIT
#{userInfoReq.pageNum}
,
#{userInfoReq.pageSize}
#{userInfoReq.pageNum},#{userInfoReq.pageSize}
</select>
<select id="selectUserSysBindById" resultType="com.huoran.users.entity.res.UserAccountListRes">

@ -84,4 +84,6 @@ public interface IHrUserAccountService extends IService<HrUserAccount> {
Integer querySchoolIdByAccountId(String id);
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.DateUtil;
import com.huoran.common.utils.MD5;
import com.huoran.users.entity.HrPersonalFile;
import com.huoran.users.entity.HrUserAccount;
import com.huoran.users.entity.HrUserInfo;
import com.huoran.users.entity.SysPlatform;
import com.huoran.users.entity.*;
import com.huoran.users.entity.req.*;
import com.huoran.users.entity.res.*;
import com.huoran.users.entity.vo.CheckVo;
import com.huoran.users.mapper.EnterpriseCertificationMapper;
import com.huoran.users.mapper.HrPersonalFileMapper;
import com.huoran.users.mapper.HrUserAccountMapper;
import com.huoran.users.mapper.HrUserInfoMapper;
@ -63,7 +61,7 @@ public class HrUserAccountServiceImpl extends ServiceImpl<HrUserAccountMapper, H
private HrUserInfoMapper hrUserInfoMapper;
@Autowired
private HrUserInfoServiceImpl hrUserInfoService;
private EnterpriseCertificationMapper enterpriseCertificationMapper;
@Autowired
private HrPersonalFileMapper hrPersonalFileMapper;
@Autowired
@ -405,6 +403,33 @@ public class HrUserAccountServiceImpl extends ServiceImpl<HrUserAccountMapper, H
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
public R oneClickEnableVerification(Integer accountId) {

Loading…
Cancel
Save