|
@@ -18,6 +18,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.shiro.SecurityUtils;
|
|
import org.apache.shiro.SecurityUtils;
|
|
@@ -180,6 +182,37 @@ public class SysUserController {
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/getAllUserList", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/getAllUserList", method = RequestMethod.GET)
|
|
|
|
+ public Result<PageInfo<SysUserVo>> getAllList(String userName, int pageNo, int pageSize) {
|
|
|
|
+ Result<PageInfo<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;
|
|
|
|
+
|
|
|
|
+ PageHelper.startPage(pageNo, pageSize);
|
|
|
|
+ if ("4b10089775c040119e139087517aed88".equals(companyId) || "6608ed13c0dd42de93c790dbdf124234".equals(companyId) || "d57fecdcf7a94d009736d9c850731582".equals(companyId)) {
|
|
|
|
+ userList = sysUserService.getAllUser(userName);
|
|
|
|
+ } else {
|
|
|
|
+ userList = sysUserService.getUserListByCompany(companyId, userName);
|
|
|
|
+ }
|
|
|
|
+ PageInfo<SysUserVo> pageInfo = new PageInfo<>(userList);
|
|
|
|
+ result.setSuccess(true);
|
|
|
|
+ result.setResult(pageInfo);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ result.setSuccess(false);
|
|
|
|
+ result.setMessage("请求失败");
|
|
|
|
+ }
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/getAllUserListV1", method = RequestMethod.GET)
|
|
public Result<List<SysUserVo>> getAllList(String userName) {
|
|
public Result<List<SysUserVo>> getAllList(String userName) {
|
|
Result<List<SysUserVo>> result = new Result<>();
|
|
Result<List<SysUserVo>> result = new Result<>();
|
|
try {
|
|
try {
|
|
@@ -206,6 +239,7 @@ public class SysUserController {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
@RequestMapping(value = "/getAllSaleList", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/getAllSaleList", method = RequestMethod.GET)
|
|
public Result<List<SysUserVo>> getSaleList() {
|
|
public Result<List<SysUserVo>> getSaleList() {
|
|
Result<List<SysUserVo>> result = new Result<>();
|
|
Result<List<SysUserVo>> result = new Result<>();
|