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:
2026-06-25 23:13:35 +08:00
parent c24f5e6621
commit 82d3264c72
18 changed files with 781 additions and 4 deletions

View File

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

View File

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