bt-yjj-system-examination-s.../src/main/java/cn/com/tenlion/service/loginappservice/LoginAppServiceImpl.java
2021-07-07 15:27:41 +08:00

35 lines
1.3 KiB
Java

package cn.com.tenlion.service.loginappservice;
import cn.com.tenlion.institutionmanagement.pojo.dtos.institution.InstitutionDTO;
import cn.com.tenlion.service.traininginstitutionuser.ITrainingInstitutionUserService;
import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.interfaces.expand.login.ILoginAppHandlerService;
import ink.wgink.pojo.bos.LoginAppUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
/**
* @author xwangs
* @create 2021-07-07 14:24
* @description
*/
@Service
@Primary
public class LoginAppServiceImpl extends DefaultBaseService implements ILoginAppHandlerService {
@Autowired
private ITrainingInstitutionUserService orgUserService;
@Override
public void handle(LoginAppUser loginAppUser) throws Exception {
// 查询当前用户是否为机构用户
// 如果是机构用户,则抛出异常
InstitutionDTO orgInfo = orgUserService.getByUserId(loginAppUser.getUserId());
if(orgInfo.getInstitutionId() != null
&& !"".equals(orgInfo.getInstitutionId())){
throw new Exception("机构用户请在首页选择机构登录进行登录");
}
}
}