diff --git a/wfc-api/wfc-api-user/src/main/java/org/wfc/user/api/RemoteUUserService.java b/wfc-api/wfc-api-user/src/main/java/org/wfc/user/api/RemoteUUserService.java index b5e1a7b..78e2d40 100644 --- a/wfc-api/wfc-api-user/src/main/java/org/wfc/user/api/RemoteUUserService.java +++ b/wfc-api/wfc-api-user/src/main/java/org/wfc/user/api/RemoteUUserService.java @@ -1,11 +1,18 @@ package org.wfc.user.api; import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; import org.wfc.common.core.constant.SecurityConstants; import org.wfc.common.core.constant.ServiceNameConstants; import org.wfc.common.core.domain.LoginUser; import org.wfc.common.core.domain.R; +import org.wfc.common.core.web.page.TableDataInfo; import org.wfc.user.api.domain.UUser; import org.wfc.user.api.factory.RemoteUUserFallbackFactory; @@ -57,6 +64,14 @@ public interface RemoteUUserService @PutMapping("/user/recordlogin") public R recordUserLogin(@RequestBody UUser user, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); + /** + * 查询用户列表 + * @param user 用户信息 + * @return 结果 + */ + @PostMapping("/user/page") + public TableDataInfo page(@RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize, @RequestBody UUser user); + /** * 添加话单信息通过OmadaApi */ diff --git a/wfc-api/wfc-api-user/src/main/java/org/wfc/user/api/factory/RemoteUUserFallbackFactory.java b/wfc-api/wfc-api-user/src/main/java/org/wfc/user/api/factory/RemoteUUserFallbackFactory.java index f7b6f3b..7a81891 100644 --- a/wfc-api/wfc-api-user/src/main/java/org/wfc/user/api/factory/RemoteUUserFallbackFactory.java +++ b/wfc-api/wfc-api-user/src/main/java/org/wfc/user/api/factory/RemoteUUserFallbackFactory.java @@ -4,11 +4,15 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.stereotype.Component; +import org.wfc.common.core.constant.HttpStatus; import org.wfc.common.core.domain.LoginUser; import org.wfc.common.core.domain.R; +import org.wfc.common.core.web.page.TableDataInfo; import org.wfc.user.api.RemoteUUserService; import org.wfc.user.api.domain.UUser; +import java.util.Collections; + /** * 用户服务降级处理 * @@ -49,6 +53,14 @@ public class RemoteUUserFallbackFactory implements FallbackFactory addCdrInfoByOmadaApi() { return R.fail("添加话单信息失败:" + throwable.getMessage()); diff --git a/wfc-common/wfc-common-core/src/main/java/org/wfc/common/core/web/controller/BaseController.java b/wfc-common/wfc-common-core/src/main/java/org/wfc/common/core/web/controller/BaseController.java index 540d1f4..c27ad02 100644 --- a/wfc-common/wfc-common-core/src/main/java/org/wfc/common/core/web/controller/BaseController.java +++ b/wfc-common/wfc-common-core/src/main/java/org/wfc/common/core/web/controller/BaseController.java @@ -1,19 +1,20 @@ package org.wfc.common.core.web.controller; -import java.beans.PropertyEditorSupport; -import java.util.Date; -import java.util.List; +import com.github.pagehelper.PageInfo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.bind.WebDataBinder; import org.springframework.web.bind.annotation.InitBinder; -import com.github.pagehelper.PageInfo; import org.wfc.common.core.constant.HttpStatus; import org.wfc.common.core.utils.DateUtils; import org.wfc.common.core.utils.PageUtils; import org.wfc.common.core.web.domain.AjaxResult; import org.wfc.common.core.web.page.TableDataInfo; +import java.beans.PropertyEditorSupport; +import java.util.Date; +import java.util.List; + /** * web层通用数据处理 * diff --git a/wfc-common/wfc-common-core/src/main/java/org/wfc/common/core/web/page/PageDataVo.java b/wfc-common/wfc-common-core/src/main/java/org/wfc/common/core/web/page/PageDataVo.java index 83a494b..82ee21c 100644 --- a/wfc-common/wfc-common-core/src/main/java/org/wfc/common/core/web/page/PageDataVo.java +++ b/wfc-common/wfc-common-core/src/main/java/org/wfc/common/core/web/page/PageDataVo.java @@ -8,6 +8,9 @@ public class PageDataVo { /** 列表数据 */ private List rows; + public PageDataVo() { + } + public PageDataVo(List list, Long total) { this.rows = list; this.total = total; diff --git a/wfc-modules/wfc-modules-user/src/main/java/org/wfc/user/controller/UUserController.java b/wfc-modules/wfc-modules-user/src/main/java/org/wfc/user/controller/UUserController.java index 039d7f6..f79af2d 100644 --- a/wfc-modules/wfc-modules-user/src/main/java/org/wfc/user/controller/UUserController.java +++ b/wfc-modules/wfc-modules-user/src/main/java/org/wfc/user/controller/UUserController.java @@ -113,6 +113,14 @@ public class UUserController extends BaseController return getDataTable(list); } + @PostMapping("/page") + public TableDataInfo page(@RequestBody UUser user) + { + startPage(); + List list = userService.selectUserList(user); + return getDataTable(list); + } + @Log(title = "用户管理", businessType = BusinessType.EXPORT) @RequiresPermissions("Utem:user:export") @PostMapping("/export") @@ -290,9 +298,9 @@ public class UUserController extends BaseController public AjaxResult edit(@Validated @RequestBody UUser user) { userService.checkUserAllowed(user); - userService.checkUserDataScope(user.getUserId()); - deptService.checkDeptDataScope(user.getDeptId()); - roleService.checkRoleDataScope(user.getRoleIds()); +// userService.checkUserDataScope(user.getUserId()); +// deptService.checkDeptDataScope(user.getDeptId()); +// roleService.checkRoleDataScope(user.getRoleIds()); if (!userService.checkUserNameUnique(user)) { return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在"); diff --git a/wfc-modules/wfc-system/src/main/java/org/wfc/system/controller/SysUserController.java b/wfc-modules/wfc-system/src/main/java/org/wfc/system/controller/SysUserController.java index 69da842..c8f60a5 100644 --- a/wfc-modules/wfc-system/src/main/java/org/wfc/system/controller/SysUserController.java +++ b/wfc-modules/wfc-system/src/main/java/org/wfc/system/controller/SysUserController.java @@ -1,5 +1,6 @@ package org.wfc.system.controller; +import com.github.pagehelper.Page; import org.apache.commons.lang3.ArrayUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -16,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import org.wfc.common.core.domain.R; import org.wfc.common.core.utils.MessageUtils; +import org.wfc.common.core.utils.PageUtils; import org.wfc.common.core.utils.StringUtils; import org.wfc.common.core.utils.poi.ExcelUtil; import org.wfc.common.core.web.controller.BaseController; @@ -38,6 +40,8 @@ import org.wfc.system.service.ISysPermissionService; import org.wfc.system.service.ISysPostService; import org.wfc.system.service.ISysRoleService; import org.wfc.system.service.ISysUserService; +import org.wfc.user.api.RemoteUUserService; +import org.wfc.user.api.domain.UUser; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @@ -80,6 +84,9 @@ public class SysUserController extends BaseController @Autowired private MessageSource messageSource; + @Autowired + private RemoteUUserService remoteUUserService; + /** * 测试国际化 */ @@ -113,6 +120,18 @@ public class SysUserController extends BaseController return getDataTable(list); } + /** + * 获取用户平台-用户列表 + */ + @GetMapping("/listUser") + public TableDataInfo listUser(UUser user) + { + startPage(); + Page localPage = PageUtils.getLocalPage(); + TableDataInfo result = remoteUUserService.page(localPage.getPageNum(), localPage.getPageSize(), user); + return result; + } + @Log(title = "用户管理", businessType = BusinessType.EXPORT) @RequiresPermissions("system:user:export") @PostMapping("/export")