| | |
| | | import com.vci.frameworkcore.compatibility.SmUserQueryServiceI; |
| | | import com.vci.constant.FrameWorkLangCodeConstant; |
| | | import com.vci.pagemodel.SmUserVO; |
| | | import com.vci.starter.web.annotation.controller.VciUnCheckRight; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.*; |
| | | import com.vci.starter.web.util.ControllerUtil; |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 使用当前用户的类型查询用户 |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | @RequestMapping(value = "/listUserByUserType",method = RequestMethod.GET) |
| | | public BaseResult<List<SmUserVO>> listUserByUserType() throws VciBaseException{ |
| | | try { |
| | | List<SmUserVO> smUserVOList = userQueryService.listUserByUserType(); |
| | | return BaseResult.dataList(smUserVOList); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "通过当前用户的类型来获取用户数据时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 使用角色获取不在某个角色下的用户参照列表 |
| | | * @param pkRole 角色的主键,不能为空 |
| | |
| | | |
| | | /** |
| | | * 修改密码 |
| | | * @param userOid 用户主键 |
| | | * @param userName 用户名 |
| | | * @param password 新密码 |
| | | * @param confirmPassword 确认密码 |
| | | */ |
| | | @RequestMapping(value = "/changePassword",method = RequestMethod.POST) |
| | | public BaseResult changePassword(String userOid,String oldPassword, String password, String confirmPassword) throws PLException { |
| | | @VciUnCheckRight |
| | | public BaseResult changePassword(String userName,String oldPassword, String password, String confirmPassword) throws PLException { |
| | | try { |
| | | return userQueryService.changePassword(userOid, oldPassword, password, confirmPassword) ? BaseResult.success("用户修改成功!"):BaseResult.fail("用户修改失败!"); |
| | | return userQueryService.changePassword(userName, oldPassword, password, confirmPassword) ? BaseResult.success(true,"用户修改成功!"):BaseResult.fail("用户修改失败!"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "修改密码时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | |
| | | //老的项目依然是添加try catch,方法里不抛出异常 |
| | | //BaseResult.fail("这里返回前端的错误信息"); |
| | | } |
| | | |
| | | |
| | | } |