| | |
| | | import org.springblade.core.log.annotation.ApiLog; |
| | | import org.springblade.core.log.logger.BladeLogger; |
| | | import org.springblade.core.tool.jackson.JsonUtil; |
| | | import org.springblade.core.tool.utils.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.sxkj.common.cache.CacheNames; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springblade.core.tool.constant.RoleConstant; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringPool; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.sxkj.common.model.ResponseResult; |
| | | import org.sxkj.system.entity.Dept; |
| | | import org.sxkj.system.entity.User; |
| | | import org.sxkj.system.entity.UserInfo; |
| | | import org.sxkj.system.excel.UserExcel; |
| | | import org.sxkj.system.excel.UserImporter; |
| | | import org.sxkj.system.mapper.DeptMapper; |
| | |
| | | private final BladeLogger bladeLogger; |
| | | @Autowired |
| | | private DeptMapper deptMapper; |
| | | |
| | | /** |
| | | * 查询单条 |
| | | */ |
| | |
| | | @ApiOperation(value = "查看详情", notes = "传入id") |
| | | @GetMapping("/info") |
| | | public R<UserVO> info(BladeUser user) { |
| | | if(Objects.isNull(user)){ |
| | | if (Objects.isNull(user)) { |
| | | return R.fail(401, "token失效了!"); |
| | | } |
| | | User detail = userService.getById(user.getUserId()); |
| | | if(Objects.isNull(detail)){ |
| | | if (Objects.isNull(detail)) { |
| | | return R.data(null); |
| | | } |
| | | return R.data(UserWrapper.build().entityVO(detail)); |
| | |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "列表", notes = "传入account和realName") |
| | | // @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public R<IPage<UserVO>> page(@ApiIgnore User user, Query query, Long deptId, BladeUser bladeUser) { |
| | | public R<IPage<UserVO>> page(User user, Query query, Long deptId, BladeUser bladeUser) { |
| | | IPage<User> pages = userService.selectUserPage(Condition.getPage(query), user, deptId, (bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? StringPool.EMPTY : bladeUser.getTenantId())); |
| | | return R.data(UserWrapper.build().pageVO(pages)); |
| | | } |
| | |
| | | @ApiLog("用户信息新增或者修改") |
| | | public R submit(@Valid @RequestBody User user) { |
| | | CacheUtil.clear(USER_CACHE); |
| | | Dept dept=deptMapper.selectById(user.getDeptId()); |
| | | Dept dept = deptMapper.selectById(user.getDeptId()); |
| | | user.setAreaCode(dept.getAreaCode()); |
| | | bladeLogger.info("用户信息新增或者修改", user.toString()); |
| | | return R.status(userService.submit(user)); |