查询企业联系人

This commit is contained in:
chenshaohua
2026-05-27 00:11:54 +08:00
parent 7a46ba3bcb
commit e8268aa300

View File

@@ -61,8 +61,22 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
public Company selectCompanyByCompanyId(Long companyId) public Company selectCompanyByCompanyId(Long companyId)
{ {
Company company = companyMapper.selectById(companyId); Company company = companyMapper.selectById(companyId);
if(SiteSecurityUtils.isLogin()){ Long userId=null;
Long l = companyCollectionMapper.selectCount(Wrappers.<CompanyCollection>lambdaQuery().eq(CompanyCollection::getCompanyId, companyId).eq(CompanyCollection::getUserId, SiteSecurityUtils.getUserId())); try {
LoginUser loginUser = SecurityUtils.getLoginUser();
userId = loginUser.getUserId();
}catch (Exception ignored){
try {
LoginSiteUser siteUser = SiteSecurityUtils.getLoginSiteUser();
userId = siteUser.getUserId();
} catch (Exception ignored2) {
}
}
if (userId == null) {
company.setIsCollection(0);
} else {
Long l = companyCollectionMapper.selectCount(Wrappers.<CompanyCollection>lambdaQuery().eq(CompanyCollection::getCompanyId, companyId).eq(CompanyCollection::getUserId, userId));
company.setIsCollection(l>0?1:0); company.setIsCollection(l>0?1:0);
} }