From e735cab2e7c87205106738c7c34913d5f7de0b29 Mon Sep 17 00:00:00 2001 From: 1178634255 <1178634255@qq.com> Date: Fri, 7 Jul 2023 15:32:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=86=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/auth/AuthUserController.java | 28 +++++++++++--- .../purchase/SupManufacturerController.java | 1 + .../purchase/SupProductController.java | 1 + .../com/glxp/api/dao/auth/AuthAdminDao.java | 2 + .../glxp/api/req/auth/UpdateUserRequset.java | 37 +++++++++++++++++++ .../api/service/auth/AuthAdminService.java | 5 ++- .../auth/impl/AuthAdminServiceImpl.java | 9 ++++- .../mybatis/mapper/auth/AuthAdminDao.xml | 9 +++++ 8 files changed, 85 insertions(+), 7 deletions(-) create mode 100644 src/main/java/com/glxp/api/req/auth/UpdateUserRequset.java diff --git a/src/main/java/com/glxp/api/controller/auth/AuthUserController.java b/src/main/java/com/glxp/api/controller/auth/AuthUserController.java index f015ee61..87d725e2 100644 --- a/src/main/java/com/glxp/api/controller/auth/AuthUserController.java +++ b/src/main/java/com/glxp/api/controller/auth/AuthUserController.java @@ -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 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,"新密码与确认密码不相同!请重新修改!"); + } + + } } diff --git a/src/main/java/com/glxp/api/controller/purchase/SupManufacturerController.java b/src/main/java/com/glxp/api/controller/purchase/SupManufacturerController.java index d31a427d..300927b1 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupManufacturerController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupManufacturerController.java @@ -68,6 +68,7 @@ public class SupManufacturerController { return ResultVOUtils.error(500, "企业信息为空"); } + //点击配送企业跳出生产企业信息 @AuthRuleAnnotation("") @GetMapping("/sup/manufacturer/getCompanyList") public BaseResponse getCompanyList(FilterSupManufacturerRequest filterSupManufacturerRequest) { diff --git a/src/main/java/com/glxp/api/controller/purchase/SupProductController.java b/src/main/java/com/glxp/api/controller/purchase/SupProductController.java index 0e062fb5..f590d5eb 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupProductController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupProductController.java @@ -75,6 +75,7 @@ public class SupProductController { return ResultVOUtils.error(500, "企业信息为空"); } + //点击生产企业跳出物资信息 @AuthRuleAnnotation("") @GetMapping("/sup/product/getRegistrationList") public BaseResponse getRegistrationList(FilterPoductRequest filterPoductRequest) { diff --git a/src/main/java/com/glxp/api/dao/auth/AuthAdminDao.java b/src/main/java/com/glxp/api/dao/auth/AuthAdminDao.java index a2384776..7b5d7dd8 100644 --- a/src/main/java/com/glxp/api/dao/auth/AuthAdminDao.java +++ b/src/main/java/com/glxp/api/dao/auth/AuthAdminDao.java @@ -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 findByCustomerId(@Param("CustomerId") String customerId); + boolean updateUser(UpdateUserRequset updateUserRequset); } diff --git a/src/main/java/com/glxp/api/req/auth/UpdateUserRequset.java b/src/main/java/com/glxp/api/req/auth/UpdateUserRequset.java new file mode 100644 index 00000000..2fe54c36 --- /dev/null +++ b/src/main/java/com/glxp/api/req/auth/UpdateUserRequset.java @@ -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 roles; + private Long[] roleIds; + + +} diff --git a/src/main/java/com/glxp/api/service/auth/AuthAdminService.java b/src/main/java/com/glxp/api/service/auth/AuthAdminService.java index ee75cac4..8a0f3093 100644 --- a/src/main/java/com/glxp/api/service/auth/AuthAdminService.java +++ b/src/main/java/com/glxp/api/service/auth/AuthAdminService.java @@ -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 findByCustomerId(String customerId); SysUserRole selectByAuthId(Long id); + + } diff --git a/src/main/java/com/glxp/api/service/auth/impl/AuthAdminServiceImpl.java b/src/main/java/com/glxp/api/service/auth/impl/AuthAdminServiceImpl.java index 22ea3c3f..98905ca8 100644 --- a/src/main/java/com/glxp/api/service/auth/impl/AuthAdminServiceImpl.java +++ b/src/main/java/com/glxp/api/service/auth/impl/AuthAdminServiceImpl.java @@ -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().eq("CustomerId", customerId)); } - + @Override + public boolean updateUser(UpdateUserRequset updateUserRequset) { + if (updateUserRequset.getId() == null) { + return false; + } + return authAdminDao.updateUser(updateUserRequset); + } @Override public List getHospitalUserList() { //查询未被禁用的医院用户 diff --git a/src/main/resources/mybatis/mapper/auth/AuthAdminDao.xml b/src/main/resources/mybatis/mapper/auth/AuthAdminDao.xml index ca9ebd5b..cb73d38b 100644 --- a/src/main/resources/mybatis/mapper/auth/AuthAdminDao.xml +++ b/src/main/resources/mybatis/mapper/auth/AuthAdminDao.xml @@ -244,6 +244,15 @@ + + UPDATE auth_user + + + passWord=#{newPassword}, + + + WHERE id = #{id} +