|
@@ -7,6 +7,7 @@ import cn.com.ctop.common.module.model.SysUserSysDepartModel;
|
|
|
import cn.com.ctop.common.module.service.ISysRoleExtService;
|
|
|
import cn.com.ctop.common.module.vo.SysDepartUsersVO;
|
|
|
import cn.com.ctop.common.module.vo.SysUserRoleVO;
|
|
|
+import cn.com.ctop.common.module.vo.SysUserVo;
|
|
|
import cn.hutool.core.util.RandomUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
@@ -31,6 +32,7 @@ import org.jeecg.common.util.RedisUtil;
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
import org.jeecg.modules.ctop.service.IProjectMemberService;
|
|
|
import org.jeecg.modules.system.entity.*;
|
|
|
+import org.jeecg.modules.system.mapper.UserCompanyMapper;
|
|
|
import org.jeecg.modules.system.model.DepartIdModel;
|
|
|
import org.jeecg.modules.system.model.SysUserDepartsVO;
|
|
|
import org.jeecg.modules.system.service.*;
|
|
@@ -91,14 +93,6 @@ public class SysUserController {
|
|
|
|
|
|
@Autowired
|
|
|
private RedisUtil redisUtil;
|
|
|
- @Autowired
|
|
|
- private IUserCompanyService userCompanyService;
|
|
|
- @Autowired
|
|
|
- private ISysRoleExtService roleService;
|
|
|
- @Autowired
|
|
|
- private IProjectMemberService memberService;
|
|
|
- @Autowired
|
|
|
- private ISysDepartService departService;
|
|
|
@Value("${jeecg.path.upload}")
|
|
|
private String upLoadPath;
|
|
|
@RequestMapping(value = "/getRoleInfo", method = RequestMethod.GET)
|
|
@@ -141,6 +135,96 @@ public class SysUserController {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private UserCompanyMapper userCompanyMapper;
|
|
|
+
|
|
|
+ @RequestMapping(value = "/getAllUserListByCompany", method = RequestMethod.GET)
|
|
|
+ public Result<List<SysUserVo>> getAllUserListByCompany() {
|
|
|
+ Result<List<SysUserVo>> result = new Result<>();
|
|
|
+ try {
|
|
|
+ LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
+ QueryWrapper<UserCompany> userCompanyQueryWrapper = new QueryWrapper<>();
|
|
|
+ userCompanyQueryWrapper.eq("user_id", user.getId());
|
|
|
+ userCompanyQueryWrapper.orderByDesc("create_time");
|
|
|
+ userCompanyQueryWrapper.last("limit 1");
|
|
|
+ UserCompany userCompany = userCompanyMapper.selectOne(userCompanyQueryWrapper);
|
|
|
+ String companyId = userCompany.getCompanyId();
|
|
|
+ List<SysUserVo> userList;
|
|
|
+ if ("4b10089775c040119e139087517aed88".equals(companyId) || "6608ed13c0dd42de93c790dbdf124234".equals(companyId) || "d57fecdcf7a94d009736d9c850731582".equals(companyId)) {
|
|
|
+ userList = sysUserService.getAllUser();
|
|
|
+ } else {
|
|
|
+ userList = sysUserService.getUserListByCompany(companyId);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ result.setSuccess(true);
|
|
|
+ result.setResult(userList);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ result.setSuccess(false);
|
|
|
+ result.setMessage("请求失败");
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping(value = "/getAllUserList", method = RequestMethod.GET)
|
|
|
+ public Result<List<SysUserVo>> getAllList() {
|
|
|
+ Result<List<SysUserVo>> result = new Result<>();
|
|
|
+ try {
|
|
|
+ LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
+ QueryWrapper<UserCompany> userCompanyQueryWrapper = new QueryWrapper<>();
|
|
|
+ userCompanyQueryWrapper.eq("user_id", user.getId());
|
|
|
+ userCompanyQueryWrapper.orderByDesc("create_time");
|
|
|
+ userCompanyQueryWrapper.last("limit 1");
|
|
|
+ UserCompany userCompany = userCompanyMapper.selectOne(userCompanyQueryWrapper);
|
|
|
+ String companyId = userCompany.getCompanyId();
|
|
|
+ List<SysUserVo> userList;
|
|
|
+ if ("4b10089775c040119e139087517aed88".equals(companyId) || "6608ed13c0dd42de93c790dbdf124234".equals(companyId) || "d57fecdcf7a94d009736d9c850731582".equals(companyId)) {
|
|
|
+ userList = sysUserService.getAllUser();
|
|
|
+ } else {
|
|
|
+ userList = sysUserService.getUserListByCompany(companyId);
|
|
|
+ }
|
|
|
+ result.setSuccess(true);
|
|
|
+ result.setResult(userList);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ result.setSuccess(false);
|
|
|
+ result.setMessage("请求失败");
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping(value = "/getAllSaleList", method = RequestMethod.GET)
|
|
|
+ public Result<List<SysUserVo>> getSaleList() {
|
|
|
+ Result<List<SysUserVo>> result = new Result<>();
|
|
|
+ try {
|
|
|
+ LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
+ List<SysUserVo> userList;
|
|
|
+ QueryWrapper<UserCompany> userCompanyQueryWrapper = new QueryWrapper<>();
|
|
|
+ userCompanyQueryWrapper.eq("user_id", user.getId());
|
|
|
+ userCompanyQueryWrapper.orderByDesc("create_time");
|
|
|
+ userCompanyQueryWrapper.last("limit 1");
|
|
|
+ UserCompany userCompany = userCompanyMapper.selectOne(userCompanyQueryWrapper);
|
|
|
+ String companyId = userCompany.getCompanyId();
|
|
|
+ if ("4b10089775c040119e139087517aed88".equals(companyId) || "6608ed13c0dd42de93c790dbdf124234".equals(companyId) || "d57fecdcf7a94d009736d9c850731582".equals(companyId)) {
|
|
|
+ userList = sysUserService.getAllSales();
|
|
|
+ } else {
|
|
|
+ userList = sysUserService.getAllSalesByCompanyId(companyId);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ result.setSuccess(true);
|
|
|
+ result.setResult(userList);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ result.setSuccess(false);
|
|
|
+ result.setMessage("请求失败");
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
@RequestMapping(value = "/add", method = RequestMethod.POST)
|
|
|
//@RequiresPermissions("user:add")
|
|
|
public Result<SysUser> add(@RequestBody JSONObject jsonObject) {
|