|
|
@@ -31,9 +31,7 @@ import com.fs.config.saas.ProjectConfig;
|
|
|
import com.fs.course.config.CourseConfig;
|
|
|
import com.fs.framework.datasource.DynamicDataSourceContextHolder;
|
|
|
import com.fs.framework.datasource.TenantDataSourceManager;
|
|
|
-import com.fs.framework.security.LoginUser;
|
|
|
-import com.fs.framework.security.SecurityUtils;
|
|
|
-import com.fs.framework.service.TokenService;
|
|
|
+import com.fs.framework.web.service.TokenService;
|
|
|
import com.fs.his.utils.qrcode.QRCodeUtils;
|
|
|
import com.fs.his.vo.OptionsVO;
|
|
|
import com.fs.hisStore.domain.FsUserScrm;
|
|
|
@@ -140,11 +138,12 @@ public class CompanyUserController extends BaseController {
|
|
|
@GetMapping("/list")
|
|
|
public TableDataInfo list(CompanyUser user)
|
|
|
{
|
|
|
- com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
- if (user.getCompanyId() == null && loginUser.getCompany() != null) { user.setCompanyId(loginUser.getCompany().getCompanyId()); };
|
|
|
- startPage();
|
|
|
- List<CompanyUser> list = companyUserService.selectCompanyUserList(user);
|
|
|
- return getDataTable(list);
|
|
|
+// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// if (user.getCompanyId() == null && loginUser.getCompany() != null) { user.setCompanyId(loginUser.getCompany().getCompanyId()); };
|
|
|
+// startPage();
|
|
|
+// List<CompanyUser> list = companyUserService.selectCompanyUserList(user);
|
|
|
+// return getDataTable(list);
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -155,117 +154,122 @@ public class CompanyUserController extends BaseController {
|
|
|
@GetMapping("/deptList")
|
|
|
public TableDataInfo deptList(CompanyUser user)
|
|
|
{
|
|
|
- com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
- if (user.getCompanyId() == null && loginUser.getCompany() != null) { user.setCompanyId(loginUser.getCompany().getCompanyId()); }
|
|
|
-
|
|
|
- List<Long> combinedDpetList = new ArrayList<>();
|
|
|
- //本部门
|
|
|
- Long deptId = loginUser.getCompanyUser().getDeptId();
|
|
|
- if (deptId!=null){
|
|
|
- combinedDpetList.add(deptId);
|
|
|
- }
|
|
|
- //本部门的下级部门
|
|
|
- List<Long> deptList = companyDeptService.selectCompanyDeptByParentId(deptId);
|
|
|
- if (!deptList.isEmpty()){
|
|
|
- combinedDpetList.addAll(deptList);
|
|
|
- }
|
|
|
-
|
|
|
- user.setDeptList(combinedDpetList);
|
|
|
-
|
|
|
- startPage();
|
|
|
- List<CompanyUser> list = companyUserService.selectCompanyUserList(user);
|
|
|
- return getDataTable(list);
|
|
|
+// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// if (user.getCompanyId() == null && loginUser.getCompany() != null) { user.setCompanyId(loginUser.getCompany().getCompanyId()); }
|
|
|
+//
|
|
|
+// List<Long> combinedDpetList = new ArrayList<>();
|
|
|
+// //本部门
|
|
|
+// Long deptId = loginUser.getCompanyUser().getDeptId();
|
|
|
+// if (deptId!=null){
|
|
|
+// combinedDpetList.add(deptId);
|
|
|
+// }
|
|
|
+// //本部门的下级部门
|
|
|
+// List<Long> deptList = companyDeptService.selectCompanyDeptByParentId(deptId);
|
|
|
+// if (!deptList.isEmpty()){
|
|
|
+// combinedDpetList.addAll(deptList);
|
|
|
+// }
|
|
|
+//
|
|
|
+// user.setDeptList(combinedDpetList);
|
|
|
+//
|
|
|
+// startPage();
|
|
|
+// List<CompanyUser> list = companyUserService.selectCompanyUserList(user);
|
|
|
+// return getDataTable(list);
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
|
|
|
@GetMapping("/getUserList")
|
|
|
public R getUserList()
|
|
|
{
|
|
|
- com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
- CompanyUser map=new CompanyUser();
|
|
|
- if (map.getCompanyId() == null && loginUser.getCompany() != null) { map.setCompanyId(loginUser.getCompany().getCompanyId()); };
|
|
|
- List<CompanyUser> list = companyUserService.selectCompanyUserList(map);
|
|
|
- return R.ok().put("data",list);
|
|
|
+// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// CompanyUser map=new CompanyUser();
|
|
|
+// if (map.getCompanyId() == null && loginUser.getCompany() != null) { map.setCompanyId(loginUser.getCompany().getCompanyId()); };
|
|
|
+// List<CompanyUser> list = companyUserService.selectCompanyUserList(map);
|
|
|
+// return R.ok().put("data",list);
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
@GetMapping("/getList")
|
|
|
public TableDataInfo getList(CompanyUser user)
|
|
|
{
|
|
|
- com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
- if (user.getCompanyId() == null && loginUser.getCompany() != null) { user.setCompanyId(loginUser.getCompany().getCompanyId()); }
|
|
|
- startPage();
|
|
|
- List<CompanyUser> list = companyUserService.selectCompanyUserList(user);
|
|
|
- return getDataTable(list);
|
|
|
+// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// if (user.getCompanyId() == null && loginUser.getCompany() != null) { user.setCompanyId(loginUser.getCompany().getCompanyId()); }
|
|
|
+// startPage();
|
|
|
+// List<CompanyUser> list = companyUserService.selectCompanyUserList(user);
|
|
|
+// return getDataTable(list);
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
@GetMapping("/qwList")
|
|
|
public TableDataInfo qwList(CompanyUserQwParam user) {
|
|
|
- com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
- if (user.getCompanyId() == null && loginUser.getCompany() != null) { user.setCompanyId(loginUser.getCompany().getCompanyId()); }
|
|
|
- List<CompanyUserQwListVO> list = companyUserService.selectCompanyUserQwListVO(user);
|
|
|
- if (!list.isEmpty()){
|
|
|
- String json = configService.selectConfigByKey("course.config");
|
|
|
- CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
|
- Long sendDelayTime = config.getSendDelayTime();
|
|
|
- List<CompletableFuture<Void>> futures = new ArrayList<>();
|
|
|
- for (CompanyUserQwListVO companyUserQwListVO : list) {
|
|
|
- CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
|
|
|
- CompanyUserDelayTime companyUserDelayTime = companyUserDelayTimeService.selectCompanyUserDelayTimeByCompanyUser(companyUserQwListVO.getCompanyId(), companyUserQwListVO.getUserId());
|
|
|
- if (ObjectUtil.isEmpty(companyUserDelayTime)) {
|
|
|
- companyUserQwListVO.setSendDelayTime(sendDelayTime);
|
|
|
- } else {
|
|
|
- companyUserQwListVO.setSendDelayTime(companyUserDelayTime.getSendDelayTime());
|
|
|
- }
|
|
|
- //是否绑定
|
|
|
- if(QwStatusEnum.BOUND.getCode() == companyUserQwListVO.getQwStatus()){
|
|
|
- if(!StringUtil.strIsNullOrEmpty(companyUserQwListVO.getQwUserId())){
|
|
|
- Long[] ids = Arrays.stream(companyUserQwListVO.getQwUserId().split(","))
|
|
|
- .map(Long::parseLong)
|
|
|
- .toArray(Long[]::new);
|
|
|
- List<QwUserVO> qwUserVOS = qwUserService.selectQwUserVOByIds(ids);
|
|
|
- companyUserQwListVO.setQwUsers(qwUserVOS);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- futures.add(future);
|
|
|
- }
|
|
|
- CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join();
|
|
|
- }
|
|
|
- return getDataTable(list);
|
|
|
+// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// if (user.getCompanyId() == null && loginUser.getCompany() != null) { user.setCompanyId(loginUser.getCompany().getCompanyId()); }
|
|
|
+// List<CompanyUserQwListVO> list = companyUserService.selectCompanyUserQwListVO(user);
|
|
|
+// if (!list.isEmpty()){
|
|
|
+// String json = configService.selectConfigByKey("course.config");
|
|
|
+// CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
|
+// Long sendDelayTime = config.getSendDelayTime();
|
|
|
+// List<CompletableFuture<Void>> futures = new ArrayList<>();
|
|
|
+// for (CompanyUserQwListVO companyUserQwListVO : list) {
|
|
|
+// CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
|
|
|
+// CompanyUserDelayTime companyUserDelayTime = companyUserDelayTimeService.selectCompanyUserDelayTimeByCompanyUser(companyUserQwListVO.getCompanyId(), companyUserQwListVO.getUserId());
|
|
|
+// if (ObjectUtil.isEmpty(companyUserDelayTime)) {
|
|
|
+// companyUserQwListVO.setSendDelayTime(sendDelayTime);
|
|
|
+// } else {
|
|
|
+// companyUserQwListVO.setSendDelayTime(companyUserDelayTime.getSendDelayTime());
|
|
|
+// }
|
|
|
+// //是否绑定
|
|
|
+// if(QwStatusEnum.BOUND.getCode() == companyUserQwListVO.getQwStatus()){
|
|
|
+// if(!StringUtil.strIsNullOrEmpty(companyUserQwListVO.getQwUserId())){
|
|
|
+// Long[] ids = Arrays.stream(companyUserQwListVO.getQwUserId().split(","))
|
|
|
+// .map(Long::parseLong)
|
|
|
+// .toArray(Long[]::new);
|
|
|
+// List<QwUserVO> qwUserVOS = qwUserService.selectQwUserVOByIds(ids);
|
|
|
+// companyUserQwListVO.setQwUsers(qwUserVOS);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// });
|
|
|
+// futures.add(future);
|
|
|
+// }
|
|
|
+// CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join();
|
|
|
+// }
|
|
|
+// return getDataTable(list);
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
|
|
|
@GetMapping("/myQwList")
|
|
|
public TableDataInfo myQwList(CompanyUserQwParam user) {
|
|
|
- com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
-// user.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
- user.setUserId(loginUser.getCompanyUser().getUserId());
|
|
|
- List<CompanyUserQwListVO> list = companyUserService.selectCompanyUserQwListVO(user);
|
|
|
- if (!list.isEmpty()){
|
|
|
- String json = configService.selectConfigByKey("course.config");
|
|
|
- CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
|
- Long sendDelayTime = config.getSendDelayTime();
|
|
|
- List<CompletableFuture<Void>> futures = new ArrayList<>();
|
|
|
- for (CompanyUserQwListVO companyUserQwListVO : list) {
|
|
|
- CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
|
|
|
- CompanyUserDelayTime companyUserDelayTime = companyUserDelayTimeService.selectCompanyUserDelayTimeByCompanyUser(companyUserQwListVO.getCompanyId(), companyUserQwListVO.getUserId());
|
|
|
- if (ObjectUtil.isEmpty(companyUserDelayTime)) {
|
|
|
- companyUserQwListVO.setSendDelayTime(sendDelayTime);
|
|
|
- } else {
|
|
|
- companyUserQwListVO.setSendDelayTime(companyUserDelayTime.getSendDelayTime());
|
|
|
- }
|
|
|
- //是否绑定
|
|
|
- if(QwStatusEnum.BOUND.getCode() == companyUserQwListVO.getQwStatus()){
|
|
|
- if(!StringUtil.strIsNullOrEmpty(companyUserQwListVO.getQwUserId())){
|
|
|
- Long[] ids = Arrays.stream(companyUserQwListVO.getQwUserId().split(","))
|
|
|
- .map(Long::parseLong)
|
|
|
- .toArray(Long[]::new);
|
|
|
- List<QwUserVO> qwUserVOS = qwUserService.selectQwUserVOByIds(ids);
|
|
|
- companyUserQwListVO.setQwUsers(qwUserVOS);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- futures.add(future);
|
|
|
- }
|
|
|
- CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join();
|
|
|
- }
|
|
|
- return getDataTable(list);
|
|
|
+// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+//// user.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
+// user.setUserId(loginUser.getCompanyUser().getUserId());
|
|
|
+// List<CompanyUserQwListVO> list = companyUserService.selectCompanyUserQwListVO(user);
|
|
|
+// if (!list.isEmpty()){
|
|
|
+// String json = configService.selectConfigByKey("course.config");
|
|
|
+// CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
|
+// Long sendDelayTime = config.getSendDelayTime();
|
|
|
+// List<CompletableFuture<Void>> futures = new ArrayList<>();
|
|
|
+// for (CompanyUserQwListVO companyUserQwListVO : list) {
|
|
|
+// CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
|
|
|
+// CompanyUserDelayTime companyUserDelayTime = companyUserDelayTimeService.selectCompanyUserDelayTimeByCompanyUser(companyUserQwListVO.getCompanyId(), companyUserQwListVO.getUserId());
|
|
|
+// if (ObjectUtil.isEmpty(companyUserDelayTime)) {
|
|
|
+// companyUserQwListVO.setSendDelayTime(sendDelayTime);
|
|
|
+// } else {
|
|
|
+// companyUserQwListVO.setSendDelayTime(companyUserDelayTime.getSendDelayTime());
|
|
|
+// }
|
|
|
+// //是否绑定
|
|
|
+// if(QwStatusEnum.BOUND.getCode() == companyUserQwListVO.getQwStatus()){
|
|
|
+// if(!StringUtil.strIsNullOrEmpty(companyUserQwListVO.getQwUserId())){
|
|
|
+// Long[] ids = Arrays.stream(companyUserQwListVO.getQwUserId().split(","))
|
|
|
+// .map(Long::parseLong)
|
|
|
+// .toArray(Long[]::new);
|
|
|
+// List<QwUserVO> qwUserVOS = qwUserService.selectQwUserVOByIds(ids);
|
|
|
+// companyUserQwListVO.setQwUsers(qwUserVOS);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// });
|
|
|
+// futures.add(future);
|
|
|
+// }
|
|
|
+// CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join();
|
|
|
+// }
|
|
|
+// return getDataTable(list);
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
|
|
|
@Log(title = "用户管理导出", businessType = BusinessType.EXPORT)
|
|
|
@@ -273,11 +277,12 @@ public class CompanyUserController extends BaseController {
|
|
|
@GetMapping("/export")
|
|
|
public AjaxResult export(CompanyUser user)
|
|
|
{
|
|
|
- com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
- if (user.getCompanyId() == null && loginUser.getCompany() != null) { user.setCompanyId(loginUser.getCompany().getCompanyId()); }
|
|
|
- List<CompanyUser> list = companyUserService.selectCompanyUserList(user);
|
|
|
- ExcelUtil<CompanyUser> util = new ExcelUtil<CompanyUser>(CompanyUser.class);
|
|
|
- return util.exportExcel(list, "用户数据");
|
|
|
+// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// if (user.getCompanyId() == null && loginUser.getCompany() != null) { user.setCompanyId(loginUser.getCompany().getCompanyId()); }
|
|
|
+// List<CompanyUser> list = companyUserService.selectCompanyUserList(user);
|
|
|
+// ExcelUtil<CompanyUser> util = new ExcelUtil<CompanyUser>(CompanyUser.class);
|
|
|
+// return util.exportExcel(list, "用户数据");
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -327,27 +332,28 @@ public class CompanyUserController extends BaseController {
|
|
|
@GetMapping(value = { "/", "/{userId}" })
|
|
|
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
|
|
|
{
|
|
|
- AjaxResult ajax = AjaxResult.success();
|
|
|
- CompanyRole companyRoleMap=new CompanyRole();
|
|
|
- com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
- if (companyRoleMap.getCompanyId() == null && loginUser.getCompany() != null) { companyRoleMap.setCompanyId(loginUser.getCompany().getCompanyId()); };
|
|
|
- List<CompanyRole> roles = roleService.selectCompanyRoleList(companyRoleMap);
|
|
|
-
|
|
|
- ajax.put("roles", CompanyUser.isAdmin(loginUser.getCompanyUser().getUserType()) ? roles : roles.stream().filter(r -> r.getRoleKey()!="admin").collect(Collectors.toList()));
|
|
|
-
|
|
|
- CompanyPost postMap=new CompanyPost();
|
|
|
- if (postMap.getCompanyId() == null && loginUser.getCompany() != null) { postMap.setCompanyId(loginUser.getCompany().getCompanyId()); };
|
|
|
- ajax.put("posts", postService.selectCompanyPostList(postMap));
|
|
|
- if (StringUtils.isNotNull(userId))
|
|
|
- {
|
|
|
- CompanyUser companyUser=companyUserService.selectCompanyUserById(userId);
|
|
|
- ajax.put(AjaxResult.DATA_TAG, companyUser);
|
|
|
- ajax.put("postIds", postService.selectPostListByUserId(userId));
|
|
|
- ajax.put("roleIds", roleService.selectRoleListByUserId(userId));
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- return ajax;
|
|
|
+// AjaxResult ajax = AjaxResult.success();
|
|
|
+// CompanyRole companyRoleMap=new CompanyRole();
|
|
|
+// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// if (companyRoleMap.getCompanyId() == null && loginUser.getCompany() != null) { companyRoleMap.setCompanyId(loginUser.getCompany().getCompanyId()); };
|
|
|
+// List<CompanyRole> roles = roleService.selectCompanyRoleList(companyRoleMap);
|
|
|
+//
|
|
|
+// ajax.put("roles", CompanyUser.isAdmin(loginUser.getCompanyUser().getUserType()) ? roles : roles.stream().filter(r -> r.getRoleKey()!="admin").collect(Collectors.toList()));
|
|
|
+//
|
|
|
+// CompanyPost postMap=new CompanyPost();
|
|
|
+// if (postMap.getCompanyId() == null && loginUser.getCompany() != null) { postMap.setCompanyId(loginUser.getCompany().getCompanyId()); };
|
|
|
+// ajax.put("posts", postService.selectCompanyPostList(postMap));
|
|
|
+// if (StringUtils.isNotNull(userId))
|
|
|
+// {
|
|
|
+// CompanyUser companyUser=companyUserService.selectCompanyUserById(userId);
|
|
|
+// ajax.put(AjaxResult.DATA_TAG, companyUser);
|
|
|
+// ajax.put("postIds", postService.selectPostListByUserId(userId));
|
|
|
+// ajax.put("roleIds", roleService.selectRoleListByUserId(userId));
|
|
|
+//
|
|
|
+//
|
|
|
+// }
|
|
|
+// return ajax;
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -358,56 +364,57 @@ public class CompanyUserController extends BaseController {
|
|
|
@PostMapping
|
|
|
public AjaxResult add(@Validated @RequestBody CompanyUser user)
|
|
|
{
|
|
|
- if (!PatternUtils.checkPassword(user.getPassword())) {
|
|
|
- return AjaxResult.error("密码格式不正确,需包含字母、数字和特殊字符,长度为 8-20 位");
|
|
|
- }
|
|
|
-
|
|
|
- //判断用户数量是否已达到上线
|
|
|
- com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
- Integer count=companyUserService.selectCompanyUserCountByCompanyId(loginUser.getCompany() != null ? loginUser.getCompany().getCompanyId() : null);
|
|
|
- Company company=companyService.selectCompanyById(loginUser.getCompany() != null ? loginUser.getCompany().getCompanyId() : null);
|
|
|
-
|
|
|
- if(count>company.getLimitUserCount()){
|
|
|
- return AjaxResult.error("用户数量已达到上限");
|
|
|
- }
|
|
|
- if (user.getCompanyId() == null && loginUser.getCompany() != null) { user.setCompanyId(loginUser.getCompany().getCompanyId()); }
|
|
|
- if (UserConstants.NOT_UNIQUE.equals(String.valueOf(companyUserService.checkUserName(user.getUserName()))))
|
|
|
- {
|
|
|
- return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
|
|
- }
|
|
|
- if (!StringUtil.strIsNullOrEmpty(user.getDomain())){
|
|
|
- user.setDomain(user.getDomain().replaceAll("^[\\s\\u2005]+", ""));
|
|
|
- }
|
|
|
-
|
|
|
- user.setCreateBy(SecurityUtils.getUsername());
|
|
|
- user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
|
|
- user.setCreateTime(new Date());
|
|
|
- user.setUserType("01");//一般用户
|
|
|
- user.setIsAudit(1);
|
|
|
- if (isQuantityExceeded(loginUser)){
|
|
|
- return AjaxResult.error("账号数量已达上限");
|
|
|
- }
|
|
|
- return toAjax(companyUserService.insertUser(user));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- *
|
|
|
- * 判断公司数量是否超出租户配置的数量
|
|
|
- */
|
|
|
- private boolean isQuantityExceeded(LoginUser loginUser){
|
|
|
- DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name());
|
|
|
- TenantInfo tenantInfo = tenantInfoMapper.selectTenantInfoById(loginUser.getTenantId().toString());
|
|
|
- if (tenantInfo == null) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- tenantDataSourceManager.switchTenant(tenantInfo);
|
|
|
- Integer count = companyUserService.getUserCount();
|
|
|
- Integer accountNum = tenantInfo.getAccountNum();
|
|
|
- if (accountNum == null || count == null) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- return count >= accountNum;
|
|
|
- }
|
|
|
+// if (!PatternUtils.checkPassword(user.getPassword())) {
|
|
|
+// return AjaxResult.error("密码格式不正确,需包含字母、数字和特殊字符,长度为 8-20 位");
|
|
|
+// }
|
|
|
+//
|
|
|
+// //判断用户数量是否已达到上线
|
|
|
+// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// Integer count=companyUserService.selectCompanyUserCountByCompanyId(loginUser.getCompany() != null ? loginUser.getCompany().getCompanyId() : null);
|
|
|
+// Company company=companyService.selectCompanyById(loginUser.getCompany() != null ? loginUser.getCompany().getCompanyId() : null);
|
|
|
+//
|
|
|
+// if(count>company.getLimitUserCount()){
|
|
|
+// return AjaxResult.error("用户数量已达到上限");
|
|
|
+// }
|
|
|
+// if (user.getCompanyId() == null && loginUser.getCompany() != null) { user.setCompanyId(loginUser.getCompany().getCompanyId()); }
|
|
|
+// if (UserConstants.NOT_UNIQUE.equals(String.valueOf(companyUserService.checkUserName(user.getUserName()))))
|
|
|
+// {
|
|
|
+// return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
|
|
+// }
|
|
|
+// if (!StringUtil.strIsNullOrEmpty(user.getDomain())){
|
|
|
+// user.setDomain(user.getDomain().replaceAll("^[\\s\\u2005]+", ""));
|
|
|
+// }
|
|
|
+//
|
|
|
+// user.setCreateBy(SecurityUtils.getUsername());
|
|
|
+// user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
|
|
+// user.setCreateTime(new Date());
|
|
|
+// user.setUserType("01");//一般用户
|
|
|
+// user.setIsAudit(1);
|
|
|
+// if (isQuantityExceeded(loginUser)){
|
|
|
+// return AjaxResult.error("账号数量已达上限");
|
|
|
+// }
|
|
|
+// return toAjax(companyUserService.insertUser(user));
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
+ }
|
|
|
+
|
|
|
+// /**
|
|
|
+// *
|
|
|
+// * 判断公司数量是否超出租户配置的数量
|
|
|
+// */
|
|
|
+// private boolean isQuantityExceeded(LoginUser loginUser){
|
|
|
+// DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name());
|
|
|
+// TenantInfo tenantInfo = tenantInfoMapper.selectTenantInfoById(loginUser.getTenantId().toString());
|
|
|
+// if (tenantInfo == null) {
|
|
|
+// return false;
|
|
|
+// }
|
|
|
+// tenantDataSourceManager.switchTenant(tenantInfo);
|
|
|
+// Integer count = companyUserService.getUserCount();
|
|
|
+// Integer accountNum = tenantInfo.getAccountNum();
|
|
|
+// if (accountNum == null || count == null) {
|
|
|
+// return false;
|
|
|
+// }
|
|
|
+// return count >= accountNum;
|
|
|
+// }
|
|
|
|
|
|
/**
|
|
|
* 生成创建销售的二维码
|
|
|
@@ -418,43 +425,44 @@ public class CompanyUserController extends BaseController {
|
|
|
@PostMapping("/addCodeUrl")
|
|
|
public R addCodeUrl( @RequestBody CompanyUserCodeParam user) throws Exception {
|
|
|
|
|
|
- com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
- Long companyId = loginUser.getCompany() != null ? loginUser.getCompany().getCompanyId() : null;
|
|
|
-
|
|
|
- QwCompany qwCompany = iQwCompanyService.getQwCompanyByRedis(user.getCorpId());
|
|
|
- if (qwCompany == null || qwCompany.getCorpId() == null){
|
|
|
- return R.error("企业信息不存在");
|
|
|
- }
|
|
|
-
|
|
|
- //部门
|
|
|
- Long deptId = user.getDeptId();
|
|
|
-
|
|
|
- //角色组
|
|
|
- Long[] roleIds = user.getRoleIds();
|
|
|
-
|
|
|
- //区域
|
|
|
- String addressId = user.getAddressId();
|
|
|
-
|
|
|
-
|
|
|
- Map<String, Object> stateMap = new HashMap<>();
|
|
|
- stateMap.put("companyId", companyId);
|
|
|
- stateMap.put("deptId", deptId);
|
|
|
- stateMap.put("roleIds", roleIds); // 数组可以直接存放
|
|
|
- stateMap.put("addressId", addressId);
|
|
|
-
|
|
|
- // 使用JSON库将Map转换为字符串
|
|
|
- ObjectMapper objectMapper = new ObjectMapper();
|
|
|
- String status = objectMapper.writeValueAsString(stateMap);
|
|
|
-
|
|
|
- // 如果要将status作为URL参数传递,记得进行URL编码!
|
|
|
- String encodedStatus = URLEncoder.encode(status, StandardCharsets.UTF_8.toString());
|
|
|
-
|
|
|
- String url="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+user.getCorpId()+"&redirect_uri=" +
|
|
|
- "http://"+qwCompany.getRealmNameUrl()+"/loginqw/pages/companyLogin/index?corpId="+user.getCorpId() +
|
|
|
- "&response_type=code&scope=snsapi_base&state="+encodedStatus+"&agentid="+qwCompany.getServerAgentId()+"#wechat_redirect";
|
|
|
-
|
|
|
- R andUpload = QRCodeUtils.createAndUpload(url);
|
|
|
- return R.ok().put("data",andUpload);
|
|
|
+// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// Long companyId = loginUser.getCompany() != null ? loginUser.getCompany().getCompanyId() : null;
|
|
|
+//
|
|
|
+// QwCompany qwCompany = iQwCompanyService.getQwCompanyByRedis(user.getCorpId());
|
|
|
+// if (qwCompany == null || qwCompany.getCorpId() == null){
|
|
|
+// return R.error("企业信息不存在");
|
|
|
+// }
|
|
|
+//
|
|
|
+// //部门
|
|
|
+// Long deptId = user.getDeptId();
|
|
|
+//
|
|
|
+// //角色组
|
|
|
+// Long[] roleIds = user.getRoleIds();
|
|
|
+//
|
|
|
+// //区域
|
|
|
+// String addressId = user.getAddressId();
|
|
|
+//
|
|
|
+//
|
|
|
+// Map<String, Object> stateMap = new HashMap<>();
|
|
|
+// stateMap.put("companyId", companyId);
|
|
|
+// stateMap.put("deptId", deptId);
|
|
|
+// stateMap.put("roleIds", roleIds); // 数组可以直接存放
|
|
|
+// stateMap.put("addressId", addressId);
|
|
|
+//
|
|
|
+// // 使用JSON库将Map转换为字符串
|
|
|
+// ObjectMapper objectMapper = new ObjectMapper();
|
|
|
+// String status = objectMapper.writeValueAsString(stateMap);
|
|
|
+//
|
|
|
+// // 如果要将status作为URL参数传递,记得进行URL编码!
|
|
|
+// String encodedStatus = URLEncoder.encode(status, StandardCharsets.UTF_8.toString());
|
|
|
+//
|
|
|
+// String url="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+user.getCorpId()+"&redirect_uri=" +
|
|
|
+// "http://"+qwCompany.getRealmNameUrl()+"/loginqw/pages/companyLogin/index?corpId="+user.getCorpId() +
|
|
|
+// "&response_type=code&scope=snsapi_base&state="+encodedStatus+"&agentid="+qwCompany.getServerAgentId()+"#wechat_redirect";
|
|
|
+//
|
|
|
+// R andUpload = QRCodeUtils.createAndUpload(url);
|
|
|
+// return R.ok().put("data",andUpload);
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
/**
|
|
|
* 修改用户
|
|
|
@@ -465,25 +473,26 @@ public class CompanyUserController extends BaseController {
|
|
|
public AjaxResult edit(@Validated @RequestBody CompanyUser user)
|
|
|
{
|
|
|
|
|
|
- com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
- user.setUpdateBy(SecurityUtils.getUsername());
|
|
|
-
|
|
|
- if (!StringUtil.strIsNullOrEmpty(user.getDomain())){
|
|
|
- user.setDomain(user.getDomain().replaceAll("^[\\s\\u2005]+", ""));
|
|
|
- }
|
|
|
-
|
|
|
- CompanyUser companyUser = companyUserService.selectCompanyUserById(user.getUserId());
|
|
|
-
|
|
|
- if (!companyUser.getUserName().equals(user.getUserName())){
|
|
|
- if (UserConstants.NOT_UNIQUE.equals(String.valueOf(companyUserService.checkUserName(user.getUserName()))))
|
|
|
- {
|
|
|
- return AjaxResult.error("修改员工账号'" + user.getUserName() + "'失败,员工账号已存在");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- logger.info("用户管理-修改用户:"+user.getUserName()+"/登陆人:"+loginUser.getCompanyUser().getUserId()+"/名字:"+loginUser.getCompanyUser().getUserName()+"/修改的角色:"+ Arrays.toString(user.getRoleIds()));
|
|
|
- return toAjax(companyUserService.updateUser(user));
|
|
|
+// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// user.setUpdateBy(SecurityUtils.getUsername());
|
|
|
+//
|
|
|
+// if (!StringUtil.strIsNullOrEmpty(user.getDomain())){
|
|
|
+// user.setDomain(user.getDomain().replaceAll("^[\\s\\u2005]+", ""));
|
|
|
+// }
|
|
|
+//
|
|
|
+// CompanyUser companyUser = companyUserService.selectCompanyUserById(user.getUserId());
|
|
|
+//
|
|
|
+// if (!companyUser.getUserName().equals(user.getUserName())){
|
|
|
+// if (UserConstants.NOT_UNIQUE.equals(String.valueOf(companyUserService.checkUserName(user.getUserName()))))
|
|
|
+// {
|
|
|
+// return AjaxResult.error("修改员工账号'" + user.getUserName() + "'失败,员工账号已存在");
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// logger.info("用户管理-修改用户:"+user.getUserName()+"/登陆人:"+loginUser.getCompanyUser().getUserId()+"/名字:"+loginUser.getCompanyUser().getUserName()+"/修改的角色:"+ Arrays.toString(user.getRoleIds()));
|
|
|
+// return toAjax(companyUserService.updateUser(user));
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -494,14 +503,15 @@ public class CompanyUserController extends BaseController {
|
|
|
@DeleteMapping("/{userIds}")
|
|
|
public AjaxResult remove(@PathVariable Long[] userIds)
|
|
|
{
|
|
|
- com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
- for (Long userId : userIds) {
|
|
|
- CompanyUserDelayTime companyUserDelayTime = companyUserDelayTimeService.selectCompanyUserDelayTimeByCompanyUser(loginUser.getCompanyUser().getCompanyId(),userId);
|
|
|
- if (ObjectUtil.isNotEmpty(companyUserDelayTime)){
|
|
|
- companyUserDelayTimeService.deleteCompanyUserDelayTimeById(companyUserDelayTime.getId());
|
|
|
- }
|
|
|
- }
|
|
|
- return toAjax(companyUserService.deleteCompanyUserByIds(userIds));
|
|
|
+// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// for (Long userId : userIds) {
|
|
|
+// CompanyUserDelayTime companyUserDelayTime = companyUserDelayTimeService.selectCompanyUserDelayTimeByCompanyUser(loginUser.getCompanyUser().getCompanyId(),userId);
|
|
|
+// if (ObjectUtil.isNotEmpty(companyUserDelayTime)){
|
|
|
+// companyUserDelayTimeService.deleteCompanyUserDelayTimeById(companyUserDelayTime.getId());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// return toAjax(companyUserService.deleteCompanyUserByIds(userIds));
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -512,32 +522,33 @@ public class CompanyUserController extends BaseController {
|
|
|
@PutMapping("/resetPwd")
|
|
|
public AjaxResult resetPwd(@RequestBody CompanyUser user)
|
|
|
{
|
|
|
- if (!PatternUtils.checkPassword(user.getPassword())) {
|
|
|
- return AjaxResult.error("密码格式不正确,需包含字母、数字和特殊字符,长度为 8-20 位");
|
|
|
- }
|
|
|
-
|
|
|
- com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
-
|
|
|
- String newPassword = SecurityUtils.encryptPassword(user.getPassword());
|
|
|
- int i = companyUserService.resetUserPwdByUserId(user.getUserId(), newPassword);
|
|
|
-
|
|
|
- if (i > 0) {
|
|
|
- // 更新缓存用户密码
|
|
|
- loginUser.getCompanyUser().setPassword(SecurityUtils.encryptPassword(newPassword));
|
|
|
- tokenService.setLoginUser(loginUser);
|
|
|
- cleanFirstLogin(loginUser);
|
|
|
- }
|
|
|
-
|
|
|
- return toAjax(i);
|
|
|
+// if (!PatternUtils.checkPassword(user.getPassword())) {
|
|
|
+// return AjaxResult.error("密码格式不正确,需包含字母、数字和特殊字符,长度为 8-20 位");
|
|
|
+// }
|
|
|
+//
|
|
|
+// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+//
|
|
|
+// String newPassword = SecurityUtils.encryptPassword(user.getPassword());
|
|
|
+// int i = companyUserService.resetUserPwdByUserId(user.getUserId(), newPassword);
|
|
|
+//
|
|
|
+// if (i > 0) {
|
|
|
+// // 更新缓存用户密码
|
|
|
+// loginUser.getCompanyUser().setPassword(SecurityUtils.encryptPassword(newPassword));
|
|
|
+// tokenService.setLoginUser(loginUser);
|
|
|
+// cleanFirstLogin(loginUser);
|
|
|
+// }
|
|
|
+//
|
|
|
+// return toAjax(i);
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 去除首次登录的标志
|
|
|
- * @param loginUser
|
|
|
- */
|
|
|
- private void cleanFirstLogin(LoginUser loginUser) {
|
|
|
- redisCache.deleteObject("newCompanyUser:" + loginUser.getCompanyUser().getCompanyId() + ":" + loginUser.getCompanyUser().getUserName());
|
|
|
- }
|
|
|
+// /**
|
|
|
+// * 去除首次登录的标志
|
|
|
+// * @param loginUser
|
|
|
+// */
|
|
|
+// private void cleanFirstLogin(LoginUser loginUser) {
|
|
|
+// redisCache.deleteObject("newCompanyUser:" + loginUser.getCompanyUser().getCompanyId() + ":" + loginUser.getCompanyUser().getUserName());
|
|
|
+// }
|
|
|
/**
|
|
|
* 状态修改
|
|
|
*/
|
|
|
@@ -546,13 +557,14 @@ public class CompanyUserController extends BaseController {
|
|
|
@PutMapping("/changeStatus")
|
|
|
public AjaxResult changeStatus(@RequestBody CompanyUser user)
|
|
|
{
|
|
|
- //管理员的状态不能修改
|
|
|
- CompanyUser companyUser=companyUserService.selectCompanyUserById(user.getUserId());
|
|
|
- if(companyUser.isAdmin()){
|
|
|
- return AjaxResult.error("不能修改管理员状态");
|
|
|
- }
|
|
|
- user.setUpdateBy(SecurityUtils.getUsername());
|
|
|
- return toAjax(companyUserService.updateCompanyUser(user));
|
|
|
+// //管理员的状态不能修改
|
|
|
+// CompanyUser companyUser=companyUserService.selectCompanyUserById(user.getUserId());
|
|
|
+// if(companyUser.isAdmin()){
|
|
|
+// return AjaxResult.error("不能修改管理员状态");
|
|
|
+// }
|
|
|
+// user.setUpdateBy(SecurityUtils.getUsername());
|
|
|
+// return toAjax(companyUserService.updateCompanyUser(user));
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -564,11 +576,12 @@ public class CompanyUserController extends BaseController {
|
|
|
@GetMapping("/getAddressBookList")
|
|
|
public TableDataInfo getAddressBookList(CompanyUser user)
|
|
|
{
|
|
|
- startPage();
|
|
|
- com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
- if (user.getCompanyId() == null && loginUser.getCompany() != null) { user.setCompanyId(loginUser.getCompany().getCompanyId()); }
|
|
|
- List<CompanyUserVO> list = companyUserService.selectMyUserList(user);
|
|
|
- return getDataTable(list);
|
|
|
+// startPage();
|
|
|
+// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// if (user.getCompanyId() == null && loginUser.getCompany() != null) { user.setCompanyId(loginUser.getCompany().getCompanyId()); }
|
|
|
+// List<CompanyUserVO> list = companyUserService.selectMyUserList(user);
|
|
|
+// return getDataTable(list);
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -586,60 +599,65 @@ public class CompanyUserController extends BaseController {
|
|
|
@GetMapping("/getUserListByDeptId")
|
|
|
public R getUserListByDeptId(CompanyUser user)
|
|
|
{
|
|
|
- com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
- if (user.getCompanyId() == null && loginUser.getCompany() != null) { user.setCompanyId(loginUser.getCompany().getCompanyId()); }
|
|
|
-
|
|
|
- List<CompanyUser> list = companyUserService.getUserListByDeptId(user);
|
|
|
- return R.ok().put("data",list);
|
|
|
+// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// if (user.getCompanyId() == null && loginUser.getCompany() != null) { user.setCompanyId(loginUser.getCompany().getCompanyId()); }
|
|
|
+//
|
|
|
+// List<CompanyUser> list = companyUserService.getUserListByDeptId(user);
|
|
|
+// return R.ok().put("data",list);
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
|
|
|
@GetMapping("/getSelectUserList")
|
|
|
public TableDataInfo getSelectUserList(CompanyUser map)
|
|
|
{
|
|
|
- com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
- if (map.getCompanyId() == null && loginUser.getCompany() != null) { map.setCompanyId(loginUser.getCompany().getCompanyId()); }
|
|
|
- startPage();
|
|
|
- List<CompanyUserVO> list = companyUserService.selecCompanyAllUsersList(map);
|
|
|
- return getDataTable(list);
|
|
|
+// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// if (map.getCompanyId() == null && loginUser.getCompany() != null) { map.setCompanyId(loginUser.getCompany().getCompanyId()); }
|
|
|
+// startPage();
|
|
|
+// List<CompanyUserVO> list = companyUserService.selecCompanyAllUsersList(map);
|
|
|
+// return getDataTable(list);
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
|
|
|
@GetMapping("/getQwAllUserList/{id}")
|
|
|
public R getQwAllUserList(@PathVariable("id") String corpId)
|
|
|
{
|
|
|
- com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
-
|
|
|
- List<QwUserVO> list = companyUserService.selectCompanyQwUserList(corpId,loginUser.getCompany() != null ? loginUser.getCompany().getCompanyId() : null);
|
|
|
- return R.ok().put("data",list);
|
|
|
+// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+//
|
|
|
+// List<QwUserVO> list = companyUserService.selectCompanyQwUserList(corpId,loginUser.getCompany() != null ? loginUser.getCompany().getCompanyId() : null);
|
|
|
+// return R.ok().put("data",list);
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
|
|
|
@GetMapping("/getQwMyUserList/{id}")
|
|
|
public R getQwMyUserList(@PathVariable("id") String corpId)
|
|
|
{
|
|
|
- com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
- List<QwUserVO> list = companyUserService.selectCompanyQwUserListByMy(corpId,loginUser.getCompany() != null ? loginUser.getCompany().getCompanyId() : null,loginUser.getCompanyUser().getUserId());
|
|
|
- return R.ok().put("data",list);
|
|
|
+// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// List<QwUserVO> list = companyUserService.selectCompanyQwUserListByMy(corpId,loginUser.getCompany() != null ? loginUser.getCompany().getCompanyId() : null,loginUser.getCompanyUser().getUserId());
|
|
|
+// return R.ok().put("data",list);
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
|
|
|
@GetMapping("/getQwDeptUserList/{id}")
|
|
|
public R getQwDeptUserList(@PathVariable("id") String corpId)
|
|
|
{
|
|
|
- com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
-
|
|
|
- List<Long> combinedList = new ArrayList<>();
|
|
|
- //本部门
|
|
|
- Long deptId = loginUser.getCompanyUser().getDeptId();
|
|
|
- if (deptId!=null){
|
|
|
- combinedList.add(deptId);
|
|
|
- }
|
|
|
- //本部门的下级部门
|
|
|
- List<Long> deptList = companyDeptService.selectCompanyDeptByParentId(deptId);
|
|
|
- if (!deptList.isEmpty()){
|
|
|
- combinedList.addAll(deptList);
|
|
|
- }
|
|
|
- String userType = loginUser.getCompanyUser().getUserType();
|
|
|
-
|
|
|
- List<QwUserVO> list = companyUserService.selectCompanyQwUserListByDept(corpId,loginUser.getCompany() != null ? loginUser.getCompany().getCompanyId() : null,combinedList,userType);
|
|
|
- return R.ok().put("data",list);
|
|
|
+// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+//
|
|
|
+// List<Long> combinedList = new ArrayList<>();
|
|
|
+// //本部门
|
|
|
+// Long deptId = loginUser.getCompanyUser().getDeptId();
|
|
|
+// if (deptId!=null){
|
|
|
+// combinedList.add(deptId);
|
|
|
+// }
|
|
|
+// //本部门的下级部门
|
|
|
+// List<Long> deptList = companyDeptService.selectCompanyDeptByParentId(deptId);
|
|
|
+// if (!deptList.isEmpty()){
|
|
|
+// combinedList.addAll(deptList);
|
|
|
+// }
|
|
|
+// String userType = loginUser.getCompanyUser().getUserType();
|
|
|
+//
|
|
|
+// List<QwUserVO> list = companyUserService.selectCompanyQwUserListByDept(corpId,loginUser.getCompany() != null ? loginUser.getCompany().getCompanyId() : null,combinedList,userType);
|
|
|
+// return R.ok().put("data",list);
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -650,11 +668,12 @@ public class CompanyUserController extends BaseController {
|
|
|
@GetMapping("/getUserListByDeptIdToQwId")
|
|
|
public R getUserListByDeptIdToQwId(CompanyUser user)
|
|
|
{
|
|
|
- com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
- if (user.getCompanyId() == null && loginUser.getCompany() != null) { user.setCompanyId(loginUser.getCompany().getCompanyId()); }
|
|
|
-
|
|
|
- List<CompanyUserQwVO> list = companyUserService.getUserListByDeptIdToQwUserid(user);
|
|
|
- return R.ok().put("data",list);
|
|
|
+// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// if (user.getCompanyId() == null && loginUser.getCompany() != null) { user.setCompanyId(loginUser.getCompany().getCompanyId()); }
|
|
|
+//
|
|
|
+// List<CompanyUserQwVO> list = companyUserService.getUserListByDeptIdToQwUserid(user);
|
|
|
+// return R.ok().put("data",list);
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -683,16 +702,17 @@ public class CompanyUserController extends BaseController {
|
|
|
public R getCompanyUserListLikeName(@RequestParam(required = false) String name,
|
|
|
@RequestParam(required = false, defaultValue = "1") Integer pageNum,
|
|
|
@RequestParam(required = false, defaultValue = "10") Integer pageSize) {
|
|
|
- Map<String,Object> params = new HashMap<>();
|
|
|
- params.put("nickName", name);
|
|
|
- //查询多条数据传入公司
|
|
|
-// if (pageSize>=200){
|
|
|
- com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
- params.put("companyId", loginUser.getCompany() != null ? loginUser.getCompany().getCompanyId() : null);
|
|
|
-// }
|
|
|
- PageHelper.startPage(pageNum, pageSize);
|
|
|
- List<OptionsVO> companyUserList = companyUserService.selectCompanyUserListByMap(params);
|
|
|
- return R.ok().put("data", new PageInfo<>(companyUserList));
|
|
|
+// Map<String,Object> params = new HashMap<>();
|
|
|
+// params.put("nickName", name);
|
|
|
+// //查询多条数据传入公司
|
|
|
+//// if (pageSize>=200){
|
|
|
+// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// params.put("companyId", loginUser.getCompany() != null ? loginUser.getCompany().getCompanyId() : null);
|
|
|
+//// }
|
|
|
+// PageHelper.startPage(pageNum, pageSize);
|
|
|
+// List<OptionsVO> companyUserList = companyUserService.selectCompanyUserListByMap(params);
|
|
|
+// return R.ok().put("data", new PageInfo<>(companyUserList));
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -704,41 +724,42 @@ public class CompanyUserController extends BaseController {
|
|
|
public R getCompanyUserListLikeNameDept(@RequestParam(required = false) String name,
|
|
|
@RequestParam(required = false, defaultValue = "1") Integer pageNum,
|
|
|
@RequestParam(required = false, defaultValue = "10") Integer pageSize) {
|
|
|
- Map<String,Object> params = new HashMap<>();
|
|
|
- params.put("nickName", name);
|
|
|
-
|
|
|
- com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
-
|
|
|
- //查询多条数据传入公司
|
|
|
-// if (pageSize>=200){
|
|
|
-
|
|
|
- params.put("companyId", loginUser.getCompany() != null ? loginUser.getCompany().getCompanyId() : null);
|
|
|
+// Map<String,Object> params = new HashMap<>();
|
|
|
+// params.put("nickName", name);
|
|
|
+//
|
|
|
+// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+//
|
|
|
+// //查询多条数据传入公司
|
|
|
+//// if (pageSize>=200){
|
|
|
+//
|
|
|
+// params.put("companyId", loginUser.getCompany() != null ? loginUser.getCompany().getCompanyId() : null);
|
|
|
+//// }
|
|
|
+// List<Long> combinedDeptList = new ArrayList<>();
|
|
|
+// //本部门
|
|
|
+// Long deptId = loginUser.getCompanyUser().getDeptId();
|
|
|
+// if (deptId!=null){
|
|
|
+// combinedDeptList.add(deptId);
|
|
|
+//
|
|
|
+// //本部门的上级部门
|
|
|
+// List<Long> deptList = companyDeptService.selectCompanyDeptByDeptId(deptId);
|
|
|
+// if (!deptList.isEmpty()){
|
|
|
+// combinedDeptList.addAll(deptList);
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// //本部门的下级部门
|
|
|
+// List<Long> deptList = companyDeptService.selectCompanyDeptByParentId(deptId);
|
|
|
+// if (!deptList.isEmpty()){
|
|
|
+// combinedDeptList.addAll(deptList);
|
|
|
// }
|
|
|
- List<Long> combinedDeptList = new ArrayList<>();
|
|
|
- //本部门
|
|
|
- Long deptId = loginUser.getCompanyUser().getDeptId();
|
|
|
- if (deptId!=null){
|
|
|
- combinedDeptList.add(deptId);
|
|
|
-
|
|
|
- //本部门的上级部门
|
|
|
- List<Long> deptList = companyDeptService.selectCompanyDeptByDeptId(deptId);
|
|
|
- if (!deptList.isEmpty()){
|
|
|
- combinedDeptList.addAll(deptList);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //本部门的下级部门
|
|
|
- List<Long> deptList = companyDeptService.selectCompanyDeptByParentId(deptId);
|
|
|
- if (!deptList.isEmpty()){
|
|
|
- combinedDeptList.addAll(deptList);
|
|
|
- }
|
|
|
-
|
|
|
- params.put("combinedDeptList",combinedDeptList);
|
|
|
-
|
|
|
-
|
|
|
- PageHelper.startPage(pageNum, pageSize);
|
|
|
- List<OptionsVO> companyUserList = companyUserService.selectCompanyUserListByMap(params);
|
|
|
- return R.ok().put("data", new PageInfo<>(companyUserList));
|
|
|
+//
|
|
|
+// params.put("combinedDeptList",combinedDeptList);
|
|
|
+//
|
|
|
+//
|
|
|
+// PageHelper.startPage(pageNum, pageSize);
|
|
|
+// List<OptionsVO> companyUserList = companyUserService.selectCompanyUserListByMap(params);
|
|
|
+// return R.ok().put("data", new PageInfo<>(companyUserList));
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -748,21 +769,23 @@ public class CompanyUserController extends BaseController {
|
|
|
@GetMapping("/getCompanyUserList")
|
|
|
public TableDataInfo getCompanyUserList(CompanyUser user)
|
|
|
{
|
|
|
- com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
- if (user.getCompanyId() == null && loginUser.getCompany() != null) { user.setCompanyId(loginUser.getCompany().getCompanyId()); }
|
|
|
- startPage();
|
|
|
- List<CompanyUser> list = companyUserService.getCompanyUserList(user);
|
|
|
- return getDataTable(list);
|
|
|
+// com.fs.framework.security.LoginUser loginUser = (com.fs.framework.security.LoginUser) tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// if (user.getCompanyId() == null && loginUser.getCompany() != null) { user.setCompanyId(loginUser.getCompany().getCompanyId()); }
|
|
|
+// startPage();
|
|
|
+// List<CompanyUser> list = companyUserService.getCompanyUserList(user);
|
|
|
+// return getDataTable(list);
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
|
|
|
@GetMapping("/generateSubDomain")
|
|
|
public R generateSubDomain(CompanyUser user){
|
|
|
- //获取后台配置
|
|
|
- String json= configService.selectConfigByKey("course.config");
|
|
|
- CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
|
- // 生成二级域名
|
|
|
- String subDomain = "http://" + DomainUtil.generateSubDomain(config.getCourseDomainName(), 6, String.valueOf(SecurityUtils.getLoginUser().getCompanyUser().getUserId()));
|
|
|
- return R.ok().put("data",subDomain);
|
|
|
+// //获取后台配置
|
|
|
+// String json= configService.selectConfigByKey("course.config");
|
|
|
+// CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
|
+// // 生成二级域名
|
|
|
+// String subDomain = "http://" + DomainUtil.generateSubDomain(config.getCourseDomainName(), 6, String.valueOf(SecurityUtils.getLoginUser().getCompanyUser().getUserId()));
|
|
|
+// return R.ok().put("data",subDomain);
|
|
|
+ throw new RuntimeException("not implemented");
|
|
|
}
|
|
|
|
|
|
@Log(title = "设置是否需要单独注册会员", businessType = BusinessType.UPDATE)
|