| | |
| | | import javax.validation.Validator; |
| | | |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.model.SysUserImport; |
| | | import com.ruoyi.common.core.service.BaseService; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | |
| | | return UserConstants.UNIQUE; |
| | | } |
| | | |
| | | @Override |
| | | public boolean checkDriverUnique(SysUser user) { |
| | | Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); |
| | | SysUser info = userMapper.checkDriverUnique(user.getDriverId()); |
| | | if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) |
| | | { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | | return UserConstants.UNIQUE; |
| | | } |
| | | |
| | | @Override |
| | | public Integer getDeviceId(long userId) { |
| | | SysUser sysUser = selectUserById(userId); |
| | | if (sysUser.getIsDriver() == 1){ |
| | | return null; |
| | | } |
| | | return sysUser.getDriverId(); |
| | | } |
| | | |
| | | /** |
| | | * 校验用户是否允许操作 |
| | | * |