| | |
| | | package com.vci.frameworkcore.controller; |
| | | |
| | | import com.vci.dto.SmUserDTO; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.frameworkcore.compatibility.SmUserQueryServiceI; |
| | | import com.vci.frameworkcore.constant.FrameWorkLangCodeConstant; |
| | | import com.vci.frameworkcore.model.dto.SmUserDTO; |
| | | import com.vci.frameworkcore.pagemodel.SmUserVO; |
| | | import com.vci.starter.web.annotation.controller.VciUnCheckRight; |
| | | import com.vci.constant.FrameWorkLangCodeConstant; |
| | | import com.vci.pagemodel.SmUserVO; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | | import com.vci.starter.web.pagemodel.*; |
| | | import com.vci.starter.web.util.ControllerUtil; |
| | |
| | | import com.vci.starter.web.util.LocalFileUtil; |
| | | import com.vci.starter.web.util.VciBaseUtil; |
| | | import com.vci.web.util.Func; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | * @param confirmPassword 确认密码 |
| | | */ |
| | | @RequestMapping(value = "/changePassword",method = RequestMethod.POST) |
| | | public BaseResult changePassword(String userOid, String password, String confirmPassword) { |
| | | userQueryService.changePassword(userOid, password, confirmPassword); |
| | | return BaseResult.success("修改密码成功"); |
| | | public BaseResult changePassword(String userOid,String oldPassword, String password, String confirmPassword) throws PLException { |
| | | try { |
| | | return userQueryService.changePassword(userOid, oldPassword, password, confirmPassword) ? BaseResult.success("用户修改成功!"):BaseResult.fail("用户修改失败!"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "修改密码时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "用户管理列表查询时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | | logger.error(exceptionMessage); |
| | | return BaseResult.fail(e.getMessage()); |
| | | return BaseResult.fail(exceptionMessage); |
| | | } |
| | | } |
| | | |
| | |
| | | @RequestMapping(value = "/updateUser",method = RequestMethod.PUT) |
| | | public BaseResult updateUser(@RequestBody SmUserDTO smUserDTO){ |
| | | try { |
| | | return BaseResult.success(userQueryService.updateUser(smUserDTO) ? "用户修改成功!":"用户修改失败!"); |
| | | return userQueryService.updateUser(smUserDTO) ? BaseResult.success("用户修改成功!"):BaseResult.fail("用户修改失败!"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | String exceptionMessage = "修改用户时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 用户权限选择树 |
| | | * @param treeQueryObject 树形数据的查询对象,包括查询条件,上级主键,是否多选等,即允许使用SmUserVO里的所有属性作为查询条件,也可以使用pkRole.xxx,pkDepartment.xxx,pkDuty.xxx这样来查询 |
| | | * @return 普通用户(不包含三员,也不包含停用的)的树形数据,已经转换过上下级关系,请获取其中的treeData属性 |
| | | * @throws VciBaseException 查询出错的时候会抛出异常,如果是老的项目里不抛出异常 |
| | | */ |
| | | @RequestMapping(value = "/refPersonOrgTree",method = RequestMethod.GET) |
| | | public BaseResult<Tree> refPersonOrgTree(TreeQueryObject treeQueryObject) throws VciBaseException{ |
| | | List<Tree> userTreeList = userQueryService.refPersonOrgTree(treeQueryObject); |
| | | return BaseResult.tree(userTreeList); |
| | | //老的项目依然是添加try catch,方法里不抛出异常 |
| | | //BaseResult.fail("这里返回前端的错误信息"); |
| | | } |
| | | |
| | | |
| | | } |