|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.glxp.api.controller.auth;
|
|
|
|
|
|
|
|
|
|
import com.glxp.api.util.PasswordUtils;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.glxp.api.annotation.AuthRuleAnnotation;
|
|
|
|
@ -139,14 +140,14 @@ public class AuthUserController extends BaseController {
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@GetMapping("/admin/auth/companyUser/list")
|
|
|
|
|
public BaseResponse companyUser(FilterInvLinkDataRequest filterInvLinkDataRequest) {
|
|
|
|
|
List<AuthAdmin> hospitalUserList =authAdminService.companyUserList(filterInvLinkDataRequest);
|
|
|
|
|
List<AuthAdmin> hospitalUserList = authAdminService.companyUserList(filterInvLinkDataRequest);
|
|
|
|
|
return ResultVOUtils.success(hospitalUserList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//修改用户信息
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/admin/auth/admin/updateUser")
|
|
|
|
|
public BaseResponse updateUser(@RequestBody @Valid UpdateUserRequset updateUserRequset,BindingResult bindingResult) {
|
|
|
|
|
public BaseResponse updateUser(@RequestBody @Valid UpdateUserRequset updateUserRequset, BindingResult bindingResult) {
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL.getCode(),
|
|
|
|
|
bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
@ -174,4 +175,34 @@ public class AuthUserController extends BaseController {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/admin/auth/admin/force/updateUser")
|
|
|
|
|
public BaseResponse forceUpdateUser(@RequestBody @Valid UpdateUserRequset updateUserRequset, BindingResult bindingResult) {
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
|
|
|
|
}
|
|
|
|
|
AuthAdmin authAdmin = customerService.getUserBean();
|
|
|
|
|
if (StringUtils.isBlank(updateUserRequset.getNewPassword())) {
|
|
|
|
|
return ResultVOUtils.error(500, "请输入新密码!");
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isBlank(updateUserRequset.getConfirmPassword())) {
|
|
|
|
|
return ResultVOUtils.error(500, "请输入确认密码!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (updateUserRequset.getNewPassword().equals(updateUserRequset.getOldPassword())) {
|
|
|
|
|
return ResultVOUtils.error(500, "新密码与旧密码重复!请重新修改!");
|
|
|
|
|
}
|
|
|
|
|
if (updateUserRequset.getNewPassword().equals(updateUserRequset.getConfirmPassword()) && updateUserRequset.getOldPassword().equals(authAdmin.getPassWord())) {
|
|
|
|
|
String newPwd = PasswordUtils.authAdminPwd(updateUserRequset.getNewPassword());
|
|
|
|
|
authAdmin.setPassWord(newPwd);
|
|
|
|
|
authAdmin.setLastUpdatePwdTime(new Date());
|
|
|
|
|
authAdminService.updateAuthAdmin(authAdmin);
|
|
|
|
|
return ResultVOUtils.success("修改成功");
|
|
|
|
|
} else {
|
|
|
|
|
return ResultVOUtils.error(500, "新密码与确认密码不相同!请重新修改!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|