Browse Source

离职人员登录BUG

chenw 6 years ago
parent
commit
4e8f956424

+ 2 - 2
bi-server/src/main/java/com/usoftchina/bi/server/dao/user/UserMapper.java

@@ -129,7 +129,7 @@ public interface UserMapper {
      */
     @Select("SELECT BU_ID as id, BU_NAME as name, BU_DEPARTMENT as department, BU_POST as post, BU_ROLE as role," +
             " USER_NAME as userName, PASS_WORD as passWord, BU_PHONE as phone, BU_CLASS as state " +
-            "FROM BI_USERS WHERE USER_NAME = #{userName}")
+            "FROM BI_USERS WHERE USER_NAME = #{userName} AND BU_CLASS <> '离职'")
     User getBIUserByName(@Param("userName") String userName);
 
     /**
@@ -139,7 +139,7 @@ public interface UserMapper {
      */
     @Select("SELECT BU_ID as id, BU_NAME as name, BU_DEPARTMENT as department, BU_POST as post, BU_ROLE as role," +
             " USER_NAME as userName, PASS_WORD as passWord, BU_PHONE as phone, BU_CLASS as state " +
-            "FROM BI_USERS WHERE BU_PHONE = #{mobile}")
+            "FROM BI_USERS WHERE BU_PHONE = #{mobile} AND BU_CLASS <> '离职'")
     User getBIUserByMobile(@Param("mobile") String mobile);
 
     /*

+ 5 - 0
bi-server/src/main/java/com/usoftchina/bi/server/service/user/UserService.java

@@ -70,6 +70,11 @@ public class UserService {
             password = user.getPassWord();
 
             user = findUserFromUAS(userName, pws);
+            if ("离职".equals(user.getState())) {
+                //更新离职状态
+                userMapper.updateUser(user);
+                throw new MyException(RepCode.NoUser);
+            }
             user.setRole(role);
             int userId = userMapper.getUserId(user.getUserName());
             user.setId(userId);