add 会员系统查询负责人接口
This commit is contained in:
+43
@@ -0,0 +1,43 @@
|
||||
package com.jero.common.util;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* Spring 上下文工具类
|
||||
* @author liJiaRao
|
||||
* @date 2021-09-16 15:05
|
||||
*/
|
||||
@Component
|
||||
public class SpringContextUtil implements ApplicationContextAware {
|
||||
private static ApplicationContext applicationContext;
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(@NotNull ApplicationContext applicationContext) throws BeansException {
|
||||
SpringContextUtil.applicationContext = applicationContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取上下文
|
||||
*/
|
||||
public static ApplicationContext getApplicationContext() {
|
||||
return applicationContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过 bena 名称获取上下文中的 bean
|
||||
*/
|
||||
public static Object getBean(String name) {
|
||||
return applicationContext.getBean(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过类型获取上下文中的bean
|
||||
*/
|
||||
public static Object getBean(Class<?> requiredType) {
|
||||
return applicationContext.getBean(requiredType);
|
||||
}
|
||||
}
|
||||
+1
@@ -96,6 +96,7 @@ public class ShiroConfig {
|
||||
filterChainDefinitionMap.put("/meeting/payMeeting/addStandards","anon");//会员系统推送会议
|
||||
filterChainDefinitionMap.put("/meeting/payMeeting/addStandardsFile","anon");//会员系统推送文件
|
||||
filterChainDefinitionMap.put("/meeting/payMeetingSituation/page2","anon");//查询参会人
|
||||
filterChainDefinitionMap.put("/sys/user/payUserList","anon");//查询负责人
|
||||
|
||||
filterChainDefinitionMap.put("/", "anon");
|
||||
filterChainDefinitionMap.put("/doc.html", "anon");
|
||||
|
||||
+40
@@ -103,6 +103,9 @@ public class SysUserController {
|
||||
@Resource
|
||||
private BaseCommonService baseCommonService;
|
||||
|
||||
@Resource
|
||||
private AuthenticationUtils authenticationUtils;
|
||||
|
||||
/**
|
||||
* 根据角色id和部门id获取用户列表数据
|
||||
*/
|
||||
@@ -246,6 +249,43 @@ public class SysUserController {
|
||||
return result;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询列表", notes = "查询列表")
|
||||
@RequestMapping(value = "/payUserList", method = RequestMethod.GET)
|
||||
public Result<?> queryList2(SysUser user, HttpServletRequest req) {
|
||||
String publicKey = req.getParameter("publicKey");
|
||||
String token = req.getParameter("token");
|
||||
authenticationUtils.check(token,publicKey);
|
||||
Result<List<SysUser>> result = new Result<>();
|
||||
QueryWrapper<SysUser> queryWrapper = QueryGenerator.initQueryWrapper(user, req.getParameterMap());
|
||||
//TODO 外部模拟登陆临时账号,列表不显示
|
||||
queryWrapper.ne("username","_reserve_user_external");
|
||||
Page<SysUser> page = new Page<>(-1, -1);
|
||||
IPage<SysUser> pageList = sysUserService.page(page, queryWrapper);
|
||||
List<SysUser> userList = new ArrayList<>();
|
||||
List<SysUser> records = pageList.getRecords();
|
||||
for (SysUser record : records) {
|
||||
//处理邮箱和手机号的加密
|
||||
UserUtil.decryptUser(record);
|
||||
userList.add(record);
|
||||
}
|
||||
pageList.setRecords(userList);
|
||||
//批量查询用户的所属部门
|
||||
//step.1 先拿到全部的 useids
|
||||
//step.2 通过 useids,一次性查询用户的所属部门名字
|
||||
List<String> userIds = records.stream().map(SysUser::getId).collect(Collectors.toList());
|
||||
if(userIds!=null && userIds.size()>0){
|
||||
Map<String,String> useDepNames = sysUserService.getDepNamesByUserIds(userIds);
|
||||
records.forEach(item->{
|
||||
item.setOrgCodeTxt(useDepNames.get(item.getId()));
|
||||
});
|
||||
}
|
||||
result.setSuccess(true);
|
||||
result.setResult(records);
|
||||
log.info(records.toString());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//@RequiresRoles({"admin"})
|
||||
@RequiresPermissions("user:add")
|
||||
|
||||
Reference in New Issue
Block a user