From bde3f0d3b357b8abb7cf508693310bbf2ea5c8de Mon Sep 17 00:00:00 2001 From: chen <1251790704@qq.com> Date: Sat, 8 May 2021 10:58:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=94=A8=E6=88=B7=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/msdw/tms/controller/UserInfoController.java | 2 +- src/main/java/com/msdw/tms/dao/UserInfoDao.java | 3 ++- src/main/java/com/msdw/tms/service/UserInfoService.java | 3 +-- .../com/msdw/tms/service/impl/UserInfoServiceImpl.java | 8 ++------ src/main/resources/mapper/tms/UserInfoDao.xml | 2 +- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/msdw/tms/controller/UserInfoController.java b/src/main/java/com/msdw/tms/controller/UserInfoController.java index 1ea72ce..b15eabe 100644 --- a/src/main/java/com/msdw/tms/controller/UserInfoController.java +++ b/src/main/java/com/msdw/tms/controller/UserInfoController.java @@ -184,7 +184,7 @@ public class UserInfoController implements UserInfoControllerApi { String password = userInfo.getPassword(); //验证账号是否存在 - int num = userInfoService.queryAccountExist(userInfo.getAccount()); + int num = userInfoService.queryAccountExist(userInfo.getAccount(),userInfo.getUserId()); if (num >= 1){ return R.error(500,"更新失败,账号不能重复"); } diff --git a/src/main/java/com/msdw/tms/dao/UserInfoDao.java b/src/main/java/com/msdw/tms/dao/UserInfoDao.java index ccdb1fc..ab8e947 100644 --- a/src/main/java/com/msdw/tms/dao/UserInfoDao.java +++ b/src/main/java/com/msdw/tms/dao/UserInfoDao.java @@ -5,6 +5,7 @@ import com.msdw.tms.entity.StudentEntity; import com.msdw.tms.entity.UserInfoEntity; import com.msdw.tms.entity.vo.*; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -67,5 +68,5 @@ public interface UserInfoDao extends BaseMapper { Integer getUserId(String token); - Integer queryAccountExist(String account); + Integer queryAccountExist(@Param("account") String account,@Param("userId") Integer userId); } diff --git a/src/main/java/com/msdw/tms/service/UserInfoService.java b/src/main/java/com/msdw/tms/service/UserInfoService.java index 59b44e0..fa0e25c 100644 --- a/src/main/java/com/msdw/tms/service/UserInfoService.java +++ b/src/main/java/com/msdw/tms/service/UserInfoService.java @@ -9,7 +9,6 @@ import com.msdw.tms.entity.vo.StudentVo; import com.msdw.tms.entity.vo.UserProsonalEntityVo; import java.util.HashMap; -import java.util.List; import java.util.Map; public interface UserInfoService extends IService { @@ -50,5 +49,5 @@ public interface UserInfoService extends IService { R getUserId(String token); - Integer queryAccountExist(String account); + Integer queryAccountExist(String account,Integer userId); } diff --git a/src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java index 3559522..507194e 100644 --- a/src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java @@ -11,11 +11,7 @@ import com.msdw.tms.dao.UserDao; import com.msdw.tms.dao.UserInfoDao; import com.msdw.tms.entity.StudentEntity; import com.msdw.tms.entity.UserInfoEntity; -import com.msdw.tms.entity.response.CommonCode; -import com.msdw.tms.entity.response.ResponseResult; -import com.msdw.tms.entity.response.ResultCode; import com.msdw.tms.entity.vo.CheckVo; -import com.msdw.tms.entity.vo.StaffVo; import com.msdw.tms.entity.vo.StudentVo; import com.msdw.tms.entity.vo.UserProsonalEntityVo; import com.msdw.tms.service.UserInfoService; @@ -229,7 +225,7 @@ public class UserInfoServiceImpl extends ServiceImpl \ No newline at end of file