添加pc互联网端,区县工作,公交周边,商圈附近3个接口
This commit is contained in:
@@ -34,6 +34,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.dromara.easyes.core.biz.EsPageInfo;
|
||||
import org.quickssl.api.CryptoClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -650,4 +651,56 @@ public class CmsJobController extends BaseController
|
||||
}
|
||||
return toAjax(jobService.deleteJobByJobIds(jobIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 附件工作
|
||||
*/
|
||||
@ApiOperation("区县工作")
|
||||
@PostMapping(value = "/countyJob")
|
||||
public TableDataInfo countyJob(@RequestBody ESJobSearch job)
|
||||
{
|
||||
EsPageInfo<ESJobDocument> list = jobService.sysCountyJobList(job);
|
||||
List<ESJobDocument> jobList = list.getList();
|
||||
list.setList(jobList);
|
||||
return getTableDataInfo(list);
|
||||
}
|
||||
/**
|
||||
* 地铁周边
|
||||
*/
|
||||
@ApiOperation("地铁周边")
|
||||
@PostMapping(value = "/subway")
|
||||
public TableDataInfo subway(@RequestBody ESJobSearch jobQuery)
|
||||
{
|
||||
EsPageInfo<ESJobDocument> list = jobService.sysSubway(jobQuery);
|
||||
List<ESJobDocument> jobList = list.getList();
|
||||
list.setList(jobList);
|
||||
return getTableDataInfo(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商圈周边
|
||||
*/
|
||||
@ApiOperation("商圈周边")
|
||||
@PostMapping(value = "/commercialArea")
|
||||
public TableDataInfo commercialArea(@RequestBody ESJobSearch jobQuery)
|
||||
{
|
||||
EsPageInfo<ESJobDocument> list = jobService.sysCommercialArea(jobQuery);
|
||||
List<ESJobDocument> jobList = list.getList();
|
||||
list.setList(jobList);
|
||||
return getTableDataInfo(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页
|
||||
* @param result
|
||||
* @return
|
||||
*/
|
||||
private TableDataInfo getTableDataInfo(EsPageInfo<ESJobDocument> result){
|
||||
long total = result.getTotal();
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(200);
|
||||
rspData.setRows(result.getList());
|
||||
rspData.setTotal(total > 200 ? 200 : total);
|
||||
return rspData;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,4 +121,10 @@ public interface IJobService
|
||||
void updateJobDown();
|
||||
|
||||
void selectUserRecommendJobNotic();
|
||||
|
||||
EsPageInfo<ESJobDocument> sysCountyJobList(ESJobSearch job);
|
||||
|
||||
EsPageInfo<ESJobDocument> sysSubway(ESJobSearch jobQuery);
|
||||
|
||||
EsPageInfo<ESJobDocument> sysCommercialArea(ESJobSearch jobQuery);
|
||||
}
|
||||
|
||||
@@ -579,6 +579,30 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
||||
return esJobDocumentEsPageInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EsPageInfo<ESJobDocument> sysCountyJobList(ESJobSearch job) {
|
||||
EsPageInfo<ESJobDocument> esJobDocumentEsPageInfo = iesJobSearchService.countyJobList(job);
|
||||
List<ESJobDocument> esJobDocuments = sysUserCollection(esJobDocumentEsPageInfo.getList());
|
||||
esJobDocumentEsPageInfo.setList(esJobDocuments);
|
||||
return esJobDocumentEsPageInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EsPageInfo<ESJobDocument> sysSubway(ESJobSearch jobQuery) {
|
||||
EsPageInfo<ESJobDocument> esJobDocumentEsPageInfo = iesJobSearchService.subway(jobQuery);
|
||||
List<ESJobDocument> esJobDocuments = sysUserCollection(esJobDocumentEsPageInfo.getList());
|
||||
esJobDocumentEsPageInfo.setList(esJobDocuments);
|
||||
return esJobDocumentEsPageInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EsPageInfo<ESJobDocument> sysCommercialArea(ESJobSearch jobQuery) {
|
||||
EsPageInfo<ESJobDocument> esJobDocumentEsPageInfo = iesJobSearchService.commercialArea(jobQuery);
|
||||
List<ESJobDocument> esJobDocuments = sysUserCollection(esJobDocumentEsPageInfo.getList());
|
||||
esJobDocumentEsPageInfo.setList(esJobDocuments);
|
||||
return esJobDocumentEsPageInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Job selectJobByJobIdApp(Long jobId) {
|
||||
Job job = jobMapper.selectById(jobId);
|
||||
@@ -1045,14 +1069,17 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
||||
private List<ESJobDocument> sysUserCollection(List<ESJobDocument> jobs){
|
||||
if(jobs.isEmpty()){return new ArrayList<>();}
|
||||
if(SecurityUtils.isLogin()){
|
||||
//收藏
|
||||
Set<Long> collectionIds = jobCollectionMapper.selectList(Wrappers.<JobCollection>lambdaQuery()
|
||||
.eq(JobCollection::getUserId, SecurityUtils.getUserId())
|
||||
.in(JobCollection::getJobId, jobs.stream().map(ESJobDocument::getJobId).collect(Collectors.toList())))
|
||||
.stream().map(JobCollection::getJobId).collect(Collectors.toSet());
|
||||
for (ESJobDocument j : jobs) {
|
||||
if (collectionIds.contains(j.getJobId())) {
|
||||
j.setIsCollection(1);
|
||||
Long userId=RoleUtils.getAppUserId();
|
||||
if(userId!=null){
|
||||
//收藏
|
||||
Set<Long> collectionIds = jobCollectionMapper.selectList(Wrappers.<JobCollection>lambdaQuery()
|
||||
.eq(JobCollection::getUserId, userId)
|
||||
.in(JobCollection::getJobId, jobs.stream().map(ESJobDocument::getJobId).collect(Collectors.toList())))
|
||||
.stream().map(JobCollection::getJobId).collect(Collectors.toSet());
|
||||
for (ESJobDocument j : jobs) {
|
||||
if (collectionIds.contains(j.getJobId())) {
|
||||
j.setIsCollection(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user