From 11bce15e75c8d16e9aa9281ed252b20a3903fb94 Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Fri, 26 Feb 2021 14:47:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E7=BD=AE=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tms/controller/SysRoleController.java | 20 ------------------- .../SysRolePermissionController.java | 20 ------------------- .../tms/controller/SysUserRoleController.java | 20 ------------------- .../controller/SystemSettingController.java | 11 ++++++++++ .../tms/service/SystemSetttingService.java | 2 ++ .../impl/SystemSettingServiceImpl.java | 15 ++++++++++++++ 6 files changed, 28 insertions(+), 60 deletions(-) delete mode 100644 src/main/java/com/msdw/tms/controller/SysRoleController.java delete mode 100644 src/main/java/com/msdw/tms/controller/SysRolePermissionController.java delete mode 100644 src/main/java/com/msdw/tms/controller/SysUserRoleController.java diff --git a/src/main/java/com/msdw/tms/controller/SysRoleController.java b/src/main/java/com/msdw/tms/controller/SysRoleController.java deleted file mode 100644 index 76cef81..0000000 --- a/src/main/java/com/msdw/tms/controller/SysRoleController.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.msdw.tms.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *
- * 用户角色表 前端控制器 - *
- * - * @author Qyq - * @since 2021-02-24 - */ -@RestController -@RequestMapping("/sys-role") -public class SysRoleController { - -} diff --git a/src/main/java/com/msdw/tms/controller/SysRolePermissionController.java b/src/main/java/com/msdw/tms/controller/SysRolePermissionController.java deleted file mode 100644 index c678b79..0000000 --- a/src/main/java/com/msdw/tms/controller/SysRolePermissionController.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.msdw.tms.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *- * 角色权限中间表 前端控制器 - *
- * - * @author Qyq - * @since 2021-02-24 - */ -@RestController -@RequestMapping("/sys-role-permission") -public class SysRolePermissionController { - -} diff --git a/src/main/java/com/msdw/tms/controller/SysUserRoleController.java b/src/main/java/com/msdw/tms/controller/SysUserRoleController.java deleted file mode 100644 index fb47650..0000000 --- a/src/main/java/com/msdw/tms/controller/SysUserRoleController.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.msdw.tms.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *- * 用户角色中间表 前端控制器 - *
- * - * @author Qyq - * @since 2021-02-24 - */ -@RestController -@RequestMapping("/sys-user-role") -public class SysUserRoleController { - -} diff --git a/src/main/java/com/msdw/tms/controller/SystemSettingController.java b/src/main/java/com/msdw/tms/controller/SystemSettingController.java index 1a9989c..93331e6 100644 --- a/src/main/java/com/msdw/tms/controller/SystemSettingController.java +++ b/src/main/java/com/msdw/tms/controller/SystemSettingController.java @@ -154,4 +154,15 @@ public class SystemSettingController implements SystemSetttingApi { R result = systemSetttingService.queryAccount(account,schoolId); return result; } + + /** + * 重置密码 + * @param userId + * @return + */ + @GetMapping("/resetPwd") + public R resetPwd(@RequestParam Integer userId,String newPwd){ + R r = systemSetttingService.resetPwd(userId,newPwd); + return r; + } } diff --git a/src/main/java/com/msdw/tms/service/SystemSetttingService.java b/src/main/java/com/msdw/tms/service/SystemSetttingService.java index 6bd9838..7b0d6e6 100644 --- a/src/main/java/com/msdw/tms/service/SystemSetttingService.java +++ b/src/main/java/com/msdw/tms/service/SystemSetttingService.java @@ -34,4 +34,6 @@ public interface SystemSetttingService { void downloadFiles(HttpServletResponse response) throws IOException; R queryAccount(String account,Integer schoolId); + + R resetPwd(Integer userId,String newPwd); } diff --git a/src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java index 879d031..0c7db4e 100644 --- a/src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java @@ -2,6 +2,7 @@ package com.msdw.tms.service.impl; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.TypeReference; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -497,4 +498,18 @@ public class SystemSettingServiceImpl implements SystemSetttingService { } return R.ok(); } + + @Override + @Transactional + public R resetPwd(Integer userId,String newPwd) { + UserInfoEntity user = new UserInfoEntity(); + user.setPassword(newPwd); + int count = userInfoDao.update(user, new QueryWrapper