添加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.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.dromara.easyes.core.biz.EsPageInfo;
|
||||||
import org.quickssl.api.CryptoClient;
|
import org.quickssl.api.CryptoClient;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
@@ -650,4 +651,56 @@ public class CmsJobController extends BaseController
|
|||||||
}
|
}
|
||||||
return toAjax(jobService.deleteJobByJobIds(jobIds));
|
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 updateJobDown();
|
||||||
|
|
||||||
void selectUserRecommendJobNotic();
|
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;
|
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
|
@Override
|
||||||
public Job selectJobByJobIdApp(Long jobId) {
|
public Job selectJobByJobIdApp(Long jobId) {
|
||||||
Job job = jobMapper.selectById(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){
|
private List<ESJobDocument> sysUserCollection(List<ESJobDocument> jobs){
|
||||||
if(jobs.isEmpty()){return new ArrayList<>();}
|
if(jobs.isEmpty()){return new ArrayList<>();}
|
||||||
if(SecurityUtils.isLogin()){
|
if(SecurityUtils.isLogin()){
|
||||||
//收藏
|
Long userId=RoleUtils.getAppUserId();
|
||||||
Set<Long> collectionIds = jobCollectionMapper.selectList(Wrappers.<JobCollection>lambdaQuery()
|
if(userId!=null){
|
||||||
.eq(JobCollection::getUserId, SecurityUtils.getUserId())
|
//收藏
|
||||||
.in(JobCollection::getJobId, jobs.stream().map(ESJobDocument::getJobId).collect(Collectors.toList())))
|
Set<Long> collectionIds = jobCollectionMapper.selectList(Wrappers.<JobCollection>lambdaQuery()
|
||||||
.stream().map(JobCollection::getJobId).collect(Collectors.toSet());
|
.eq(JobCollection::getUserId, userId)
|
||||||
for (ESJobDocument j : jobs) {
|
.in(JobCollection::getJobId, jobs.stream().map(ESJobDocument::getJobId).collect(Collectors.toList())))
|
||||||
if (collectionIds.contains(j.getJobId())) {
|
.stream().map(JobCollection::getJobId).collect(Collectors.toSet());
|
||||||
j.setIsCollection(1);
|
for (ESJobDocument j : jobs) {
|
||||||
|
if (collectionIds.contains(j.getJobId())) {
|
||||||
|
j.setIsCollection(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,9 @@ public class EncryptConstants {
|
|||||||
"/getWwTjmHlwToken",
|
"/getWwTjmHlwToken",
|
||||||
"/cms/appUser/getUserInfo",
|
"/cms/appUser/getUserInfo",
|
||||||
"/cms/job/getAppUserYhsc",
|
"/cms/job/getAppUserYhsc",
|
||||||
|
"/cms/job/countyJob",
|
||||||
|
"/cms/job/subway",
|
||||||
|
"/cms/job/commercialArea",
|
||||||
"/app/idCardLogin",
|
"/app/idCardLogin",
|
||||||
"/app/phoneLogin",
|
"/app/phoneLogin",
|
||||||
"/getInfo",
|
"/getInfo",
|
||||||
|
|||||||
Reference in New Issue
Block a user