添加pc互联网端,区县工作,公交周边,商圈附近3个接口

This commit is contained in:
sh
2026-06-22 18:33:36 +08:00
parent f18f179f3d
commit 18ccf628fc
4 changed files with 97 additions and 8 deletions

View File

@@ -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;
}
}

View File

@@ -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);
}

View File

@@ -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,9 +1069,11 @@ 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()){
Long userId=RoleUtils.getAppUserId();
if(userId!=null){
//收藏
Set<Long> collectionIds = jobCollectionMapper.selectList(Wrappers.<JobCollection>lambdaQuery()
.eq(JobCollection::getUserId, SecurityUtils.getUserId())
.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) {
@@ -1056,6 +1082,7 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
}
}
}
}
return jobs;
}

View File

@@ -51,6 +51,9 @@ public class EncryptConstants {
"/getWwTjmHlwToken",
"/cms/appUser/getUserInfo",
"/cms/job/getAppUserYhsc",
"/cms/job/countyJob",
"/cms/job/subway",
"/cms/job/commercialArea",
"/app/idCardLogin",
"/app/phoneLogin",
"/getInfo",