From bc3b8dd9c9215d60ff0c1f5e659c6540630ce956 Mon Sep 17 00:00:00 2001 From: mzh820631607 Date: Fri, 25 Sep 2020 12:02:31 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E7=8F=AD=E7=BA=A7?= =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E5=88=97=E8=A1=A8=EF=BC=8C=E5=BC=80=E5=A7=8B?= =?UTF-8?q?=E7=BB=93=E6=9D=9F=E6=97=B6=E9=97=B4=E4=B8=8D=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/mapper/tms/ClassTeachingDao.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/resources/mapper/tms/ClassTeachingDao.xml b/src/main/resources/mapper/tms/ClassTeachingDao.xml index 6b40139..ebea109 100644 --- a/src/main/resources/mapper/tms/ClassTeachingDao.xml +++ b/src/main/resources/mapper/tms/ClassTeachingDao.xml @@ -21,6 +21,8 @@ tms_experimental_teaching WHERE is_del=0 + AND + start_time >='2020-01-01 00:00:00' and `status` = #{cla.status} and ( project_name like concat('%',#{cla.condition},'%') or experimental_class_name like concat('%',#{cla.condition},'%') ) and stop_time between #{cla.endTime} and #{cla.startTime} From 4fb4a337924c18abba36c285c138a3946a099063 Mon Sep 17 00:00:00 2001 From: mzh820631607 Date: Fri, 25 Sep 2020 16:07:19 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AB=AF=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E4=B8=AA=E4=BA=BA=E7=A7=98=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/msdw/tms/api/ClassTeachingApi.java | 2 -- .../com/msdw/tms/api/UserControllerApi.java | 4 +++ .../msdw/tms/controller/UserController.java | 29 ++++++++++++++++++- .../com/msdw/tms/entity/vo/UserEntityVo.java | 2 ++ 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/msdw/tms/api/ClassTeachingApi.java b/src/main/java/com/msdw/tms/api/ClassTeachingApi.java index 2efe0bb..d93409b 100644 --- a/src/main/java/com/msdw/tms/api/ClassTeachingApi.java +++ b/src/main/java/com/msdw/tms/api/ClassTeachingApi.java @@ -2,10 +2,8 @@ package com.msdw.tms.api; import com.msdw.tms.common.utils.R; import com.msdw.tms.entity.ExperimentalTeachingEntity; -import com.msdw.tms.entity.vo.ProjectRecordVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.springframework.web.bind.annotation.RequestParam; @Api(value = "用户端班级实验", tags = "用户端班级实验信息") public interface ClassTeachingApi { diff --git a/src/main/java/com/msdw/tms/api/UserControllerApi.java b/src/main/java/com/msdw/tms/api/UserControllerApi.java index 82a41ae..56c016a 100644 --- a/src/main/java/com/msdw/tms/api/UserControllerApi.java +++ b/src/main/java/com/msdw/tms/api/UserControllerApi.java @@ -2,6 +2,7 @@ package com.msdw.tms.api; import com.msdw.tms.common.utils.R; import com.msdw.tms.entity.UserEntity; +import com.msdw.tms.entity.vo.UserEntityVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -14,4 +15,7 @@ public interface UserControllerApi { @ApiOperation(value = "个人中心信息修改",notes = "个人中心信息修改") R update(UserEntity userEntity); + @ApiOperation(value = "更新密码",notes = "更新密码") + R examinePassword(UserEntityVo entity); + } diff --git a/src/main/java/com/msdw/tms/controller/UserController.java b/src/main/java/com/msdw/tms/controller/UserController.java index aff7cc1..7004e40 100644 --- a/src/main/java/com/msdw/tms/controller/UserController.java +++ b/src/main/java/com/msdw/tms/controller/UserController.java @@ -1,5 +1,7 @@ package com.msdw.tms.controller; +import cn.hutool.system.UserInfo; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.msdw.tms.api.UserControllerApi; import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.common.utils.R; @@ -7,6 +9,7 @@ import com.msdw.tms.entity.UserEntity; import com.msdw.tms.entity.vo.UserEntityVo; import com.msdw.tms.service.UserService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import java.util.Arrays; @@ -78,6 +81,30 @@ public class UserController implements UserControllerApi { return R.ok(); } - + /** + * 校验密码 + * @param entity 封装用户id和输入的原密码和新密码 + * @return R 响应的状态信息 + */ + @Override + @Transactional + @PostMapping("/examinePassword") + public R examinePassword(@RequestBody UserEntityVo entity){ + Integer userid = entity.getUserid();//用户id + String password = entity.getPassword();//用户输入的当前密码 + String newPassword = entity.getNewPassword();//获取用户输入的新密码 + UserEntity byId = userService.getById(userid);//获取用户个人信息 + + UserEntity user = new UserEntity();//用于封装数据 + if (password.equals(byId.getPassword())==true){ + user.setUserid(userid).setPassword(newPassword); + boolean b = userService.updateById(user); + if (b==true){ + return R.ok(); + }else{return R.error("更新密码失败,请稍后重试");} + }else{ + return R.error(403,"原密码错误,更新密码失败!!!"); + } + } } diff --git a/src/main/java/com/msdw/tms/entity/vo/UserEntityVo.java b/src/main/java/com/msdw/tms/entity/vo/UserEntityVo.java index fd3b76d..6b26c4a 100644 --- a/src/main/java/com/msdw/tms/entity/vo/UserEntityVo.java +++ b/src/main/java/com/msdw/tms/entity/vo/UserEntityVo.java @@ -35,5 +35,7 @@ public class UserEntityVo extends UserEntity implements Serializable { private String professionalName; private List user; + //新密码 + private String newPassword; } From 7e152042fcd97d67957f38a728db8868d9054d7c Mon Sep 17 00:00:00 2001 From: mzh820631607 Date: Fri, 25 Sep 2020 17:42:58 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/mapper/tms/UserDao.xml | 56 +++++++++++++---------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/src/main/resources/mapper/tms/UserDao.xml b/src/main/resources/mapper/tms/UserDao.xml index c12877f..b75108c 100644 --- a/src/main/resources/mapper/tms/UserDao.xml +++ b/src/main/resources/mapper/tms/UserDao.xml @@ -5,31 +5,41 @@