feat: Add SHZ log inspection and HighGo database querying capabilities
- Introduced `inspect-shz-logs` skill for inspecting local and production logs with bounded read-only commands. - Added `view.sh` script for log viewing with options for following logs and filtering by keywords. - Created `query-shz-highgo` skill for querying the SHZ HighGo database through an SSH gateway. - Implemented read-only SQL execution with strict controls on allowed statements and query structure. - Added new domain and mapper classes for managing outdoor fair job associations. - Enhanced `OutdoorFairController` to support job listing and management for outdoor fairs. - Created SQL scripts for initializing outdoor fair job data and managing menu visibility.
This commit is contained in:
@@ -806,6 +806,7 @@ public class ESJobSearchImpl implements IESJobSearchService
|
||||
|
||||
@Override
|
||||
public void deleteJob(Long jobId) {
|
||||
ensureJobDocumentIndexExists();
|
||||
LambdaEsQueryWrapper<ESJobDocument> lambdaEsQueryWrapper = new LambdaEsQueryWrapper();
|
||||
lambdaEsQueryWrapper.eq(ESJobDocument::getJobId,jobId);
|
||||
esJobDocumentMapper.delete(lambdaEsQueryWrapper);
|
||||
@@ -847,12 +848,31 @@ public class ESJobSearchImpl implements IESJobSearchService
|
||||
if(StringUtil.isEmptyOrNull(job.getCompanyNature())){
|
||||
esJobDocument.setCompanyNature("6");
|
||||
}
|
||||
ensureJobDocumentIndexExists();
|
||||
|
||||
LambdaEsQueryWrapper<ESJobDocument> lambdaEsQueryWrapper = new LambdaEsQueryWrapper();
|
||||
lambdaEsQueryWrapper.eq(ESJobDocument::getJobId,job.getJobId());
|
||||
esJobDocumentMapper.delete(lambdaEsQueryWrapper);
|
||||
esJobDocumentMapper.insert(esJobDocument);
|
||||
}
|
||||
|
||||
/**
|
||||
* 确保job_document索引存在;缺失时懒创建(仅建空索引与映射,不重建全量数据)。
|
||||
* process-index-mode: manual 下easy-es不会自动建索引,缺失时delete/update等写操作
|
||||
* 会抛 index_not_found_exception 导致业务接口500并回滚事务,故在写操作前调用以自愈。
|
||||
*/
|
||||
private void ensureJobDocumentIndexExists() {
|
||||
try {
|
||||
if (!esJobDocumentMapper.existsIndex("job_document")) {
|
||||
esJobDocumentMapper.createIndex();
|
||||
logger.info("job_document索引不存在,已自动创建");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 并发场景下其他请求可能已创建索引,忽略“索引已存在”类异常
|
||||
logger.warn("自动创建job_document索引异常(可能已被其他请求创建,忽略)", e);
|
||||
}
|
||||
}
|
||||
|
||||
public List<ESJobDocument> selectByIds(Long[] jobIds) {
|
||||
LambdaEsQueryWrapper<ESJobDocument> wrapper = new LambdaEsQueryWrapper<>();
|
||||
wrapper.in(ESJobDocument::getJobId,jobIds);
|
||||
|
||||
@@ -40,6 +40,7 @@ public class OutdoorFairServiceImpl extends ServiceImpl<OutdoorFairMapper, Outdo
|
||||
queryWrapper.eq(StringUtils.isNotBlank(outdoorFair.getFairType()), OutdoorFair::getFairType, outdoorFair.getFairType());
|
||||
queryWrapper.eq(StringUtils.isNotBlank(outdoorFair.getRegion()), OutdoorFair::getRegion, outdoorFair.getRegion());
|
||||
queryWrapper.eq(outdoorFair.getVenueId() != null, OutdoorFair::getVenueId, outdoorFair.getVenueId());
|
||||
queryWrapper.eq(outdoorFair.getOnlineApply() != null, OutdoorFair::getOnlineApply, outdoorFair.getOnlineApply());
|
||||
queryWrapper.orderByDesc(OutdoorFair::getHoldTime);
|
||||
queryWrapper.orderByDesc(OutdoorFair::getCreateTime);
|
||||
return list(queryWrapper);
|
||||
|
||||
Reference in New Issue
Block a user