管理员账号限制删除
This commit is contained in:
parent
2898fda58f
commit
d52acbc776
|
|
@ -8,6 +8,7 @@ import com.electromagnetic.industry.software.data.manage.domain.boardservice.use
|
|||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.params.UserDeleteKeyWords;
|
||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.repository.UserRepository;
|
||||
import com.electromagnetic.industry.software.data.manage.domain.boardservice.user.service.UserService;
|
||||
import electromagnetic.data.framework.share.constants.UserConstants;
|
||||
import electromagnetic.data.framework.share.exception.LoggerConstant;
|
||||
import electromagnetic.data.framework.share.util.SignUtils;
|
||||
import org.slf4j.Logger;
|
||||
|
|
@ -112,6 +113,11 @@ public class UserServiceImpl implements UserService {
|
|||
*/
|
||||
@Override
|
||||
public Boolean deleteUser(UserDeleteKeyWords userDeleteKeyWords) {
|
||||
|
||||
String workNumber = userRepository.getSingleUser(userDeleteKeyWords.getUserId()).getWorkNumber();
|
||||
if (UserConstants.ADMIN_WORK_NUMBER.equals(workNumber)) {
|
||||
throw new RuntimeException("管理员用户无法删除");
|
||||
}
|
||||
return userRepository.deleteUser(userDeleteKeyWords)>0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,4 +28,9 @@ public class UserConstants {
|
|||
public static final String LOGIN_USER_NAME = "userName";
|
||||
public static final String LOGIN_WORK_NUMBER = "workNumber";
|
||||
public static final String LOGIN_USER_ID = "userId";
|
||||
|
||||
/**
|
||||
* 管理员账号
|
||||
*/
|
||||
public static final String ADMIN_WORK_NUMBER = "100000";
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue