|
@@ -82,10 +82,12 @@ public class CmsUserController{
|
|
|
|
|
|
|
|
private final CmsUserMapper cmsUserMapper;
|
|
private final CmsUserMapper cmsUserMapper;
|
|
|
|
|
|
|
|
|
|
+ private final UserCertRecordMapper userCertRecordMapper;
|
|
|
|
|
+
|
|
|
private final UserDoubleVerifyCodeChangeRecordMapper userDoubleVerifyCodeChangeRecordMapper;
|
|
private final UserDoubleVerifyCodeChangeRecordMapper userDoubleVerifyCodeChangeRecordMapper;
|
|
|
|
|
|
|
|
@GetMapping("/get")
|
|
@GetMapping("/get")
|
|
|
- public Result<SearchResult<UserView>> get(Long id, String otherPhone, Long sharedId, String userid, Long businessId, String sort, String order) {
|
|
|
|
|
|
|
+ public Result<SearchResult<UserView>> get(Long id, String otherPhone, Long sharedId, String userid, Long businessId, String sort, String order, Boolean isCert) {
|
|
|
MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
|
|
MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
String otherSql = StrUtil.EMPTY;
|
|
String otherSql = StrUtil.EMPTY;
|
|
|
if (StrUtil.isNotBlank(otherPhone)) {
|
|
if (StrUtil.isNotBlank(otherPhone)) {
|
|
@@ -103,24 +105,33 @@ public class CmsUserController{
|
|
|
builder.field(UserView::getId, relationUserIdList).op(Operator.InList);
|
|
builder.field(UserView::getId, relationUserIdList).op(Operator.InList);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ if (isCert != null) {
|
|
|
|
|
+ if (StrUtil.isNotBlank(otherSql)) {
|
|
|
|
|
+ otherSql += " and ";
|
|
|
|
|
+ }
|
|
|
|
|
+ otherSql += "exists (select 1 from user_cert_record where user_id = u.id)";
|
|
|
|
|
+ }
|
|
|
if (StrUtil.isNotBlank(otherSql)) {
|
|
if (StrUtil.isNotBlank(otherSql)) {
|
|
|
builder.put("otherConditionSql", otherSql);
|
|
builder.put("otherConditionSql", otherSql);
|
|
|
}
|
|
}
|
|
|
SearchResult<UserView> search = beanSearcher.search(UserView.class, builder.build());
|
|
SearchResult<UserView> search = beanSearcher.search(UserView.class, builder.build());
|
|
|
- search.getDataList().forEach(data->{
|
|
|
|
|
|
|
+ search.getDataList().forEach(data -> {
|
|
|
Long userId = data.getId();
|
|
Long userId = data.getId();
|
|
|
UserBindDetail userBindDetail = beanSearcher.searchFirst(UserBindDetail.class, MapUtils.builder().field(UserBindDetail::getUserId, userId).onlySelect(UserBindDetail::getPhone, UserBindDetail::getEmail).build());
|
|
UserBindDetail userBindDetail = beanSearcher.searchFirst(UserBindDetail.class, MapUtils.builder().field(UserBindDetail::getUserId, userId).onlySelect(UserBindDetail::getPhone, UserBindDetail::getEmail).build());
|
|
|
- Optional.ofNullable(userBindDetail).ifPresent(bind->{
|
|
|
|
|
|
|
+ Optional.ofNullable(userBindDetail).ifPresent(bind -> {
|
|
|
data.setBindEmail(bind.getEmail());
|
|
data.setBindEmail(bind.getEmail());
|
|
|
data.setBindPhone(bind.getPhone());
|
|
data.setBindPhone(bind.getPhone());
|
|
|
});
|
|
});
|
|
|
if (data.getSharedId() != null) {
|
|
if (data.getSharedId() != null) {
|
|
|
UserDistributeBusinessInfoView userDistributeBusinessInfoView = beanSearcher.searchFirst(UserDistributeBusinessInfoView.class, MapUtils.builder().field(UserDistributeBusinessInfoView::getUserId, data.getSharedId()).build());
|
|
UserDistributeBusinessInfoView userDistributeBusinessInfoView = beanSearcher.searchFirst(UserDistributeBusinessInfoView.class, MapUtils.builder().field(UserDistributeBusinessInfoView::getUserId, data.getSharedId()).build());
|
|
|
- Optional.ofNullable(userDistributeBusinessInfoView).ifPresent(info->{
|
|
|
|
|
|
|
+ Optional.ofNullable(userDistributeBusinessInfoView).ifPresent(info -> {
|
|
|
data.setDistributeName(info.getDistributeName());
|
|
data.setDistributeName(info.getDistributeName());
|
|
|
data.setBusinessName(info.getBusinessName());
|
|
data.setBusinessName(info.getBusinessName());
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ Integer selectCount = userCertRecordMapper.selectCount(Wrappers.lambdaQuery(UserCertRecord.class)
|
|
|
|
|
+ .eq(UserCertRecord::getUserId, userId));
|
|
|
|
|
+ data.setIsCert(selectCount > 0 ? true : false);
|
|
|
});
|
|
});
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
}
|
|
}
|