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