|
|
@@ -17,6 +17,7 @@ import com.sqx.modules.firstLogin.service.HrService;
|
|
|
import com.sqx.modules.message.entity.MessageInfo;
|
|
|
import com.sqx.modules.message.service.MessageService;
|
|
|
import com.sqx.modules.resumes.dao.CompanyDao;
|
|
|
+import com.sqx.modules.resumes.dao.PostPushDao;
|
|
|
import com.sqx.modules.resumes.entity.Company;
|
|
|
import com.sqx.modules.resumes.entity.CompanyUser;
|
|
|
import com.sqx.modules.resumes.entity.PostPush;
|
|
|
@@ -26,6 +27,7 @@ import com.sqx.modules.resumes.service.PostPushService;
|
|
|
import com.sqx.modules.utils.SenInfoCheckUtil;
|
|
|
import com.sqx.modules.utils.excel.ExcelData;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
+import org.apache.ibatis.annotations.Param;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -52,9 +54,13 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyDao, Company> impleme
|
|
|
private HrService hrService;
|
|
|
@Autowired
|
|
|
private CompanyUserService companyUserService;
|
|
|
+ @Autowired
|
|
|
+ private CompanyService companyService;
|
|
|
+ @Autowired
|
|
|
+ private PostPushDao postPushDao;
|
|
|
|
|
|
|
|
|
-// @Override
|
|
|
+ // @Override
|
|
|
// public Result insertCompany(Company company) {
|
|
|
// Company oldCompany = selectCompanyByUserId(company.getUserId());
|
|
|
// if (oldCompany != null) {
|
|
|
@@ -185,8 +191,8 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyDao, Company> impleme
|
|
|
}
|
|
|
@Override
|
|
|
public Company selectCompanyByUserId(Long userId) {
|
|
|
-
|
|
|
- return baseMapper.selectOne(new QueryWrapper<Company>().eq("user_id", userId));
|
|
|
+ CompanyUser companyUser = companyUserService.getOne(new QueryWrapper<CompanyUser>().eq("user_id",userId).eq("is_use",1));
|
|
|
+ return companyService.getById(companyUser.getCompanyId());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -357,15 +363,30 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyDao, Company> impleme
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Result selectCompanyPostPushList(String key, PostPush postPush, Integer page, Integer limit, Double lat, Double lng) {
|
|
|
- QueryWrapper<Company> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("status",1).eq("is_use",1).like("company_all_name",key);
|
|
|
- List<Company> companies = baseMapper.selectList(queryWrapper);
|
|
|
- for (Company company :companies){
|
|
|
- postPush.setCompanyId(company.getCompanyId());
|
|
|
- company.setPostPushList( postPushService.getPostPushList(page,limit,lng,lat,null,postPush,null,null));
|
|
|
+ public IPage<Company> selectCompanyPostPushList(String key, PostPush postPush, Integer page, Integer limit, Double lat, Double lng) {
|
|
|
+
|
|
|
+ Page<Company> pages;
|
|
|
+ if (page != null && limit != null) {
|
|
|
+ pages = new Page<>(page, limit);
|
|
|
+ } else {
|
|
|
+ pages = new Page<>();
|
|
|
+ pages.setSize(-1);
|
|
|
}
|
|
|
- return Result.success().put("data",companies);
|
|
|
+ String[] industry = StringUtils.isNotBlank(postPush.getIndustry()) ? postPush.getIndustry().split(",") : null;
|
|
|
+ String[] education = StringUtils.isNotBlank(postPush.getEducation()) ? postPush.getEducation().split(",") : null;
|
|
|
+ String[] experience = StringUtils.isNotBlank(postPush.getExperience()) ? postPush.getExperience().split(",") : null;
|
|
|
+ String[] companyPeople = StringUtils.isNotBlank(postPush.getCompanyPeople()) ? postPush.getCompanyPeople().split(",") : null;
|
|
|
+ String[] salaryRange = StringUtils.isNotBlank(postPush.getSalaryRange()) ? postPush.getSalaryRange().split(",") : null;
|
|
|
+
|
|
|
+ IPage<Company> companies = companyService.getBaseMapper().selectPage(pages, new QueryWrapper<Company>().eq("is_use", 1).eq("status", 1).like(StringUtils.isNotBlank(key), "company_all_name", key));
|
|
|
+
|
|
|
+ for (Company company : companies.getRecords()){
|
|
|
+ company.setPostPushList(postPushDao.getPostPushListUser(lng, lat, postPush, industry, education, experience, companyPeople, salaryRange));
|
|
|
+ }
|
|
|
+ return companies;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// @Override
|
|
|
@@ -380,4 +401,4 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyDao, Company> impleme
|
|
|
// return Result.success().put("data",companies);
|
|
|
// }
|
|
|
|
|
|
-}
|
|
|
+
|