自定义拦截器DEMO 完成

yun-zuoyi
wei.peng 6 years ago
parent 667c334531
commit 96705b6638

@ -36,6 +36,9 @@ public interface IPersonnelService {
@ApiOperation(value = "更新用户状态") @ApiOperation(value = "更新用户状态")
void updateSysUserInfoStatus(Long userInfoId,Integer status); void updateSysUserInfoStatus(Long userInfoId,Integer status);
@ApiOperation(value = "修改用户主组织信息")
void updateSysUserOrganize(Long userId, Long organizeId);
@ApiOperation(value = "删除账号信息") @ApiOperation(value = "删除账号信息")
void deleteSysUser(Long[] userIdList,String userName); void deleteSysUser(Long[] userIdList,String userName);

@ -77,6 +77,23 @@ public class AuthController extends CoreBaseController {
} }
} }
/**
*
*
* @return
*/
@GetMapping(value = "/get-user-organize")
@ApiOperation(value = "获取会话用户组织信息", notes = "获取当前登录用户账号详细信息")
public ResultBean getUserOrganize() {
LOGGER.info("获取用户信息...lang:{}", AuthUtil.getSessionAttribute("languageCode"));
try {
return new ResultBean(true, "", AuthUtil.getOrganize());
} catch (ImppBusiException e) {
return new ResultBean(false, e.getErrorDetail() + "-[解决]" + e.getErrorSolution());
}
}
/** /**
* *
* *

@ -625,7 +625,7 @@ public class PersonnelController extends CoreBaseController {
// 会话工厂信息保存进Redis // 会话工厂信息保存进Redis
AuthUtil.setOrganize(organize); AuthUtil.setOrganize(organize);
personnelService.updateSysUserOrganize(AuthUtil.getSessionUser().getUser().getId(),organize.getId());
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultObject(organize); return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultObject(organize);
} catch (ImppBusiException busExcep) { } catch (ImppBusiException busExcep) {
return ResultBean.fail(busExcep); return ResultBean.fail(busExcep);

@ -306,7 +306,7 @@ public class SysMenuController extends CoreBaseController {
ValidatorBean.checkNotNull(menu.getParentId(), "父级功能ID不能为空"); ValidatorBean.checkNotNull(menu.getParentId(), "父级功能ID不能为空");
menu.setId(Long.parseLong(menu.getMenuCode())); menu.setId(Long.parseLong(menu.getMenuCode()));
menu.setMenuSort(Integer.parseInt(menu.getMenuCode())); menu.setMenuSort(10000);
if (!map.containsKey(menu.getMenuCode())) { if (!map.containsKey(menu.getMenuCode())) {
map.put(menu.getMenuCode(),menu); map.put(menu.getMenuCode(),menu);
} else { } else {

@ -113,6 +113,16 @@ public class PersonnelServiceService implements IPersonnelService {
} }
@Override @Override
public void updateSysUserOrganize(Long userId, Long organizeId) {
LOGGER.debug("平台账号 SysUser userId:{} organizeId",userId, organizeId);
SysUser user = userRDao.getById(userId);
if(user != null){
user.setOrganizeId(organizeId);
userRDao.save(user);
}
}
@Override
@ApiOperation(value = "删除账号信息") @ApiOperation(value = "删除账号信息")
public void deleteSysUser(Long[] userIdList,String userName) { public void deleteSysUser(Long[] userIdList,String userName) {
LOGGER.debug("平台账号 SysUser userIdList:{}", userIdList); LOGGER.debug("平台账号 SysUser userIdList:{}", userIdList);

Loading…
Cancel
Save