| | |
| | | } |
| | | |
| | | /** |
| | | * 修改用户头像 |
| | | * @param file 文件 |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/updateUserPhoto",method = RequestMethod.POST) |
| | | public BaseResult updateUserPhoto(MultipartFile file){ |
| | | try { |
| | | return userQueryService.updateUserPhoto(file) ? BaseResult.success("用户头像修改成功!"):BaseResult.fail("用户头像修改失败!"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "修改用户头像时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取用户头像 |
| | | * @param response |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/getUserPhoto",method = RequestMethod.GET) |
| | | public void getUserPhoto(HttpServletResponse response){ |
| | | try { |
| | | ControllerUtil.writeFileToResponse(response,userQueryService.getUserPhoto()); |
| | | } catch (Exception e) { |
| | | throw new VciBaseException(e.getMessage(),new String[0],e); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除用户 |
| | | * @param ids |
| | | * @return |
| | |
| | | } |
| | | |
| | | /** |
| | | * 导出人员 |
| | | * @param response |
| | | */ |
| | | @RequestMapping(value = "/expUser",method = RequestMethod.GET) |
| | | public void expUser(HttpServletResponse response){ |
| | | try { |
| | | String excelPath = userQueryService.expUser(); |
| | | ControllerUtil.writeFileToResponse(response,excelPath); |
| | | } catch (Exception e) { |
| | | String msg = "导出用户时出现错误,原因:" + LangBaseUtil.getErrorMsg(e); |
| | | try { |
| | | e.printStackTrace(); |
| | | ControllerUtil.writeDataToResponse(response,"error_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss") + ".txt", StringUtils.isNotBlank(msg)?msg.getBytes():new byte[0],null); |
| | | } catch (IOException ioException) { |
| | | ioException.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 用户权限选择树 |
| | | * @param treeQueryObject 树形数据的查询对象,包括查询条件,上级主键,是否多选等,即允许使用SmUserVO里的所有属性作为查询条件,也可以使用pkRole.xxx,pkDepartment.xxx,pkDuty.xxx这样来查询 |
| | | * @return 普通用户(不包含三员,也不包含停用的)的树形数据,已经转换过上下级关系,请获取其中的treeData属性 |