密码修改

dev
1178634255 2 years ago
parent 654d32def0
commit e735cab2e7

@ -6,10 +6,7 @@ import com.glxp.api.annotation.Log;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.auth.*;
import com.glxp.api.req.auth.AuthUserSaveRequest;
import com.glxp.api.req.auth.FilterInvLinkDataRequest;
import com.glxp.api.req.auth.FilterInvWarehouseRequest;
import com.glxp.api.req.auth.FilterNoSelectUserRequest;
import com.glxp.api.req.auth.*;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
@ -28,7 +25,8 @@ import java.util.*;
*/
@RestController
public class AuthUserController extends BaseController {
@Resource
CustomerService customerService;
@Resource
private AuthAdminService authAdminService;
@Resource
@ -126,5 +124,25 @@ public class AuthUserController extends BaseController {
List<AuthAdmin> hospitalUserList = authAdminService.getHospitalUserList();
return ResultVOUtils.success(hospitalUserList);
}
//修改用户信息
@AuthRuleAnnotation("")
@PostMapping("/admin/auth/admin/updateUser")
public BaseResponse updateUser(@RequestBody UpdateUserRequset updateUserRequset) {
AuthAdmin authAdmin=customerService.getUserBean();
System.out.println(updateUserRequset.toString());
if (!updateUserRequset.getPassWord().equals(authAdmin.getPassWord())){
return ResultVOUtils.error(500,"当前密码输入错误!请重新输入!");
}
if (updateUserRequset.getNewPassword().equals(authAdmin.getPassWord())){
return ResultVOUtils.error(500,"新密码与旧密码重复!请重新修改!");
}
if (updateUserRequset.getNewPassword().equals(updateUserRequset.getConfirmPassword())&&updateUserRequset.getPassWord().equals(authAdmin.getPassWord())){
authAdminService.updateUser(updateUserRequset);
return ResultVOUtils.success("修改成功");
}else {
return ResultVOUtils.error(500,"新密码与确认密码不相同!请重新修改!");
}
}
}

@ -68,6 +68,7 @@ public class SupManufacturerController {
return ResultVOUtils.error(500, "企业信息为空");
}
//点击配送企业跳出生产企业信息
@AuthRuleAnnotation("")
@GetMapping("/sup/manufacturer/getCompanyList")
public BaseResponse getCompanyList(FilterSupManufacturerRequest filterSupManufacturerRequest) {

@ -75,6 +75,7 @@ public class SupProductController {
return ResultVOUtils.error(500, "企业信息为空");
}
//点击生产企业跳出物资信息
@AuthRuleAnnotation("")
@GetMapping("/sup/product/getRegistrationList")
public BaseResponse getRegistrationList(FilterPoductRequest filterPoductRequest) {

@ -5,6 +5,7 @@ import com.glxp.api.dao.inout.IoCodeTempDao;
import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.entity.inout.IoCodeTempEntity;
import com.glxp.api.req.auth.FilterAuthUserRequest;
import com.glxp.api.req.auth.UpdateUserRequset;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -90,4 +91,5 @@ public interface AuthAdminDao extends BaseMapperPlus<AuthAdminDao, AuthAdmin, Au
List<AuthAdmin> findByCustomerId(@Param("CustomerId") String customerId);
boolean updateUser(UpdateUserRequset updateUserRequset);
}

@ -0,0 +1,37 @@
package com.glxp.api.req.auth;
import com.glxp.api.entity.auth.SysRole;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class UpdateUserRequset {
// 主键
private Long id;
private String userName;
// 登录密码
private String passWord;
private String newPassword;
private String confirmPassword;
// 最后登录ip
private String lastLoginIp;
// 最后登录时间
private Date lastLoginTime;
// 创建时间
private Date createTime;
// 状态
private Integer userFlag;
private Date lastModifyTime;
private String comments;
private String employeeName;
private Long CustomerId;
private String locDeptCode;
private String locInvCode;
private String deptName;
private List<SysRole> roles;
private Long[] roleIds;
}

@ -5,6 +5,7 @@ import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.entity.auth.SysUserRole;
import com.glxp.api.req.auth.FilterAuthUserRequest;
import com.glxp.api.req.auth.FilterNoSelectUserRequest;
import com.glxp.api.req.auth.UpdateUserRequset;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -30,7 +31,7 @@ public interface AuthAdminService {
boolean deleteById(Long id);
int deleteByCustomerId(String customerId);
boolean updateUser(UpdateUserRequset updateUserRequset);
/**
*
*
@ -53,4 +54,6 @@ public interface AuthAdminService {
List<AuthAdmin> findByCustomerId(String customerId);
SysUserRole selectByAuthId(Long id);
}

@ -12,6 +12,7 @@ import com.glxp.api.exception.JsonException;
import com.glxp.api.req.auth.FilterAuthUserRequest;
import com.glxp.api.req.auth.FilterNoSelectUserRequest;
import com.glxp.api.req.auth.FilterUserRoleRequest;
import com.glxp.api.req.auth.UpdateUserRequset;
import com.glxp.api.service.auth.AuthAdminService;
import com.glxp.api.common.enums.ResultEnum;
import org.springframework.stereotype.Service;
@ -135,7 +136,13 @@ public class AuthAdminServiceImpl implements AuthAdminService {
public int deleteByCustomerId(String customerId) {
return authAdminDao.delete(new QueryWrapper<AuthAdmin>().eq("CustomerId", customerId));
}
@Override
public boolean updateUser(UpdateUserRequset updateUserRequset) {
if (updateUserRequset.getId() == null) {
return false;
}
return authAdminDao.updateUser(updateUserRequset);
}
@Override
public List<AuthAdmin> getHospitalUserList() {
//查询未被禁用的医院用户

@ -244,6 +244,15 @@
</where>
</select>
<update id="updateUser" parameterType="com.glxp.api.req.auth.UpdateUserRequset">
UPDATE auth_user
<set>
<if test="passWord != null">
passWord=#{newPassword},
</if>
</set>
WHERE id = #{id}
</update>
<select id="findByCustomerId" parameterType="hashmap" resultType="com.glxp.api.entity.auth.AuthAdmin">
SELECT *
FROM auth_user

Loading…
Cancel
Save