提交 5be83385 作者: zhenjie 提交者: 余乾开

修改查询用户接口

上级 3a4075f6
package com.mmc.csf.release.auth.qo;
import com.mmc.csf.release.model.group.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* @author: zj
* @Date: 2023/6/6 20:41
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserAccountQO implements Serializable {
private static final long serialVersionUID = -6821428525057467450L;
@ApiModelProperty(value = "关键字", required = false, example = "lux")
private String keyword;
@ApiModelProperty(value = "电话号码", required = false)
private String phoneNum;
@ApiModelProperty(value = "用户名", required = false, hidden = true)
private String userName;
@ApiModelProperty(value = "开始时间", example = "2023-05-18 00:00:00")
private String startTime;
@ApiModelProperty(value = "结束时间", example = "2023-10-18 23:59:59")
private String endTime;
@ApiModelProperty(value = "实名认证状态(0未通过,1通过)", hidden = true)
private Integer realAuthStatus;
@ApiModelProperty(value = "企业认证状态(0未通过,1通过)", example = "1")
private Integer companyAuthStatus;
@ApiModelProperty(value = "电子签章认证状态(0未通过,1通过)", hidden = true)
private Integer entVerifyStatus;
@ApiModelProperty(value = "用户来源:0自然流,1海报,2抖音,3公众号,4社群,5招投标,默认0", hidden = true)
private Integer source;
@ApiModelProperty(value = "用户id集合")
private List<Integer> userIds;
@ApiModelProperty(value = "页码", required = true, example = "1")
@NotNull(message = "页码不能为空", groups = Page.class)
@Min(value = 1, groups = Page.class)
private Integer pageNo;
@ApiModelProperty(value = "每页显示数", required = true, example = "10")
@NotNull(message = "每页显示数不能为空", groups = Page.class)
@Min(value = 1, groups = Page.class)
private Integer pageSize;
public void buildCurrentPage() {
this.pageNo = (pageNo - 1) * pageSize;
}
}
......@@ -2,6 +2,7 @@ package com.mmc.csf.release.feign;
import com.mmc.csf.infomation.dto.UserAccountSimpleDTO;
import com.mmc.csf.release.auth.qo.BUserAccountQO;
import com.mmc.csf.release.auth.qo.UserAccountQO;
import com.mmc.csf.release.feign.hystrix.UserAppApiHystrix;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
......@@ -37,11 +38,20 @@ public interface UserAppApi {
/**
* 获取用户集合列表页面
* 获取后台用户集合列表页面
*
* @param bUserAccountQO 问:b用户帐户
* @return {@link List}<{@link UserAccountSimpleDTO}>
*/
@PostMapping("/userapp/back-user/feignListBAccountPage")
List<UserAccountSimpleDTO> feignListBAccountPage(@ApiParam(value = "账号查询QO", required = true) @RequestBody BUserAccountQO bUserAccountQO, @RequestHeader("token") String token);
/**
* 获取小程序用户集合列表页面
* @param userAccountQO
* @param token
* @return
*/
@PostMapping("/userapp/user-account/feignListAppUserAccount")
List<UserAccountSimpleDTO> feignListAppUserAccount(@ApiParam(value = "账号查询QO", required = true) @RequestBody UserAccountQO userAccountQO, @RequestHeader("token") String token);
}
......@@ -2,6 +2,7 @@ package com.mmc.csf.release.feign.hystrix;
import com.mmc.csf.infomation.dto.UserAccountSimpleDTO;
import com.mmc.csf.release.auth.qo.BUserAccountQO;
import com.mmc.csf.release.auth.qo.UserAccountQO;
import com.mmc.csf.release.feign.UserAppApi;
import lombok.extern.slf4j.Slf4j;
......@@ -30,4 +31,10 @@ public class UserAppApiHystrix implements UserAppApi {
log.error("熔断:feignListBAccountPage:{}", bUserAccountQO);
return null;
}
@Override
public List<UserAccountSimpleDTO> feignListAppUserAccount(UserAccountQO userAccountQO, String token) {
log.error("熔断:feignListAppUserAccount:{}", userAccountQO);
return null;
}
}
......@@ -3,6 +3,7 @@ package com.mmc.csf.release.service.impl;
import com.mmc.csf.common.util.page.PageResult;
import com.mmc.csf.infomation.dto.UserAccountSimpleDTO;
import com.mmc.csf.release.auth.qo.BUserAccountQO;
import com.mmc.csf.release.auth.qo.UserAccountQO;
import com.mmc.csf.release.constant.TokenConstant;
import com.mmc.csf.release.dao.BackstageForumDao;
import com.mmc.csf.release.dao.DynamicDAO;
......@@ -42,11 +43,11 @@ public class BackstageForumServiceImpl implements BackstageForumService {
public PageResult listDynamic(DynamicQO dynamic, HttpServletRequest request) {
List<Integer> userIds = null;
if (dynamic.getKeyword() != null) {
BUserAccountQO bUserAccountQO = new BUserAccountQO();
bUserAccountQO.setKeyword(dynamic.getKeyword());
UserAccountQO userAccountQO = new UserAccountQO();
userAccountQO.setKeyword(dynamic.getKeyword());
// 获取筛选的用户id
List<UserAccountSimpleDTO> userAccountSimpleDTOS =
userAppApi.feignListBAccountPage(bUserAccountQO, request.getHeader(TokenConstant.TOKEN));
userAppApi.feignListAppUserAccount(userAccountQO, request.getHeader(TokenConstant.TOKEN));
if (CollectionUtils.isNotEmpty(userAccountSimpleDTOS)) {
// 获取用户id
userIds =
......@@ -80,10 +81,10 @@ public class BackstageForumServiceImpl implements BackstageForumService {
Set<Integer> ListUserIds =
dynamicList.stream().map(ForumDynamicDO::getUserId).collect(Collectors.toSet());
List<Integer> userIdList = new ArrayList<>(ListUserIds);
BUserAccountQO accountQO = new BUserAccountQO();
UserAccountQO accountQO = new UserAccountQO();
accountQO.setUserIds(userIdList);
List<UserAccountSimpleDTO> userAccountSimpleList =
userAppApi.feignListBAccountPage(accountQO, request.getHeader(TokenConstant.TOKEN));
userAppApi.feignListAppUserAccount(accountQO, request.getHeader(TokenConstant.TOKEN));
Map<Integer, UserAccountSimpleDTO> userAccountInfoMap =
userAccountSimpleList.stream()
.collect(Collectors.toMap(UserAccountSimpleDTO::getId, Function.identity()));
......
......@@ -4,6 +4,7 @@ import com.mmc.csf.common.util.page.PageResult;
import com.mmc.csf.common.util.web.ResultBody;
import com.mmc.csf.infomation.dto.UserAccountSimpleDTO;
import com.mmc.csf.release.auth.qo.BUserAccountQO;
import com.mmc.csf.release.auth.qo.UserAccountQO;
import com.mmc.csf.release.constant.TokenConstant;
import com.mmc.csf.release.dao.CommentDAO;
import com.mmc.csf.release.dao.DynamicDAO;
......@@ -156,11 +157,12 @@ public class DynamicServiceImpl implements DynamicService {
Set<Integer> userIds =
forumDynamicList.stream().map(ForumDynamicDO::getUserId).collect(Collectors.toSet());
List<Integer> userIdList = new ArrayList<>(userIds);
BUserAccountQO bUserAccountQO = new BUserAccountQO();
bUserAccountQO.setUserIds(userIdList);
UserAccountQO userAccountQO = new UserAccountQO();
userAccountQO.setUserIds(userIdList);
// 解决bug
List<UserAccountSimpleDTO> userAccountSimpleDTOS =
userAppApi.feignListBAccountPage(bUserAccountQO, request.getHeader(TokenConstant.TOKEN));
userAppApi.feignListAppUserAccount(userAccountQO, request.getHeader(TokenConstant.TOKEN));
Map<Integer, UserAccountSimpleDTO> userAccountInfoMap =
userAccountSimpleDTOS.stream()
.collect(Collectors.toMap(UserAccountSimpleDTO::getId, Function.identity()));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论