1.添加多个企业查询功能-用户移动端企业比对

This commit is contained in:
sh
2025-10-21 18:14:12 +08:00
parent 4c28d07bc3
commit 65487c073f
3 changed files with 21 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.ArrayUtils;
import org.dromara.easyes.core.biz.EsPageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -195,4 +196,16 @@ public class AppJobController extends BaseController
jobService.publishJob(job);
return success();
}
@GetMapping("/jobCompare")
@ApiOperation("获取")
public AjaxResult jobCompare(@ApiParam("岗位ID数组") @RequestParam("jobIds") Long[] jobIds) {
if (ArrayUtils.isEmpty(jobIds)) {
return AjaxResult.error("请传递岗位ID参数jobIds多个ID用&分隔");
}
if (jobIds.length > 5) {
return AjaxResult.error("最多支持对比5个岗位请减少参数数量");
}
return success(esJobSearchService.selectByIds(jobIds));
}
}

View File

@@ -67,4 +67,6 @@ public interface IESJobSearchService
void updateJob(Long jobId);
void deleteJob(Long jobId);
List<ESJobDocument> selectByIds(Long[] jobIds);
}

View File

@@ -553,4 +553,10 @@ public class ESJobSearchImpl implements IESJobSearchService
esJobDocumentMapper.delete(lambdaEsQueryWrapper);
esJobDocumentMapper.insert(esJobDocument);
}
public List<ESJobDocument> selectByIds(Long[] jobIds) {
LambdaEsQueryWrapper<ESJobDocument> wrapper = new LambdaEsQueryWrapper<>();
wrapper.in(ESJobDocument::getJobId,jobIds);
return esJobDocumentMapper.selectList(wrapper);
}
}