提交 73fa1b20 作者: obcy

Merge remote-tracking branch 'origin/event_fusion' into event_fusion

......@@ -211,6 +211,7 @@ public class InformationController {
IPage<DisplayInfo> pageList = informationService.subjectPageList(searchCondition);
return Result.OK(pageList);
}
/**
* 事件对应专题库的资讯分页列表
*
......@@ -270,6 +271,7 @@ public class InformationController {
/**
* 删除指定标签
*
* @param id
* @param relationId
* @param index
......@@ -279,9 +281,10 @@ public class InformationController {
public Result<?> delLabel(@RequestParam("id") String id,
@RequestParam("relationId") String relationId,
@RequestParam("index") String index) {
informationService.removeLabelById(index,id,relationId);
informationService.removeLabelById(index, id, relationId);
return Result.OK("删除成功");
}
/**
* 批量删除标签
*
......@@ -303,7 +306,6 @@ public class InformationController {
}
/**
* 通过id查询(专题库)
*
......@@ -394,11 +396,11 @@ public class InformationController {
*/
@PostMapping(value = "/modifyLabel")
public Result<?> modifyLabel(@RequestBody DataBindLabelFrom bindLabelFrom) {
if(bindLabelFrom.getBindList()==null || bindLabelFrom.getBindList().isEmpty()){
if (bindLabelFrom.getBindList() == null || bindLabelFrom.getBindList().isEmpty()) {
List<DictVO> boundList = subjectDictMapService.boundList(bindLabelFrom.getSubjectId());
bindLabelFrom.setBindList(boundList);
}
if(bindLabelFrom.getBindList()==null || bindLabelFrom.getBindList().isEmpty()){
if (bindLabelFrom.getBindList() == null || bindLabelFrom.getBindList().isEmpty()) {
return Result.FAIL("专题未绑定标签,不可编辑");
}
informationService.modifyLabel(bindLabelFrom);
......@@ -503,7 +505,7 @@ public class InformationController {
* @date 2025/2/20
*/
@PostMapping("/removeByCondition")
public Result<?> removeByCondition(@RequestBody JSONObject params){
public Result<?> removeByCondition(@RequestBody JSONObject params) {
String subjectId = params.getString("subjectId");
if (StringUtils.isEmpty(subjectId)) {
return Result.FAIL("专题id不能为空");
......@@ -524,7 +526,7 @@ public class InformationController {
* @date 2025/2/20
*/
@PostMapping("/supplyByCondition")
public Result<?> supplyByCondition(@RequestBody JSONObject params){
public Result<?> supplyByCondition(@RequestBody JSONObject params) {
String subjectId = params.getString("subjectId");
if (StringUtils.isEmpty(subjectId)) {
return Result.FAIL("专题id不能为空");
......@@ -550,8 +552,8 @@ public class InformationController {
if (CollectionUtils.isEmpty(keywordList)) {
return Result.FAIL("关键词不能为空");
}
CompletableFuture.runAsync(()-> informationService.removeWordLabel(searchCondition));
return Result.OK();
CompletableFuture.runAsync(() -> informationService.removeWordLabel(searchCondition));
return Result.OK("关键词删除中。。。");
}
/**
......@@ -568,8 +570,8 @@ public class InformationController {
if (StringUtils.isEmpty(subjectId) && CollectionUtils.isEmpty(ids)) {
return Result.FAIL("专题id和资讯id集合不能同时为空");
}
informationService.addToFavorites(searchCondition);
return Result.OK();
CompletableFuture.runAsync(() -> informationService.addToFavorites(searchCondition));
return Result.OK("资讯添加到精选中。。。");
}
/**
......@@ -586,8 +588,8 @@ public class InformationController {
if (StringUtils.isEmpty(subjectId) && CollectionUtils.isEmpty(ids)) {
return Result.FAIL("专题id和资讯id集合不能同时为空");
}
informationService.addToPend(searchCondition);
return Result.OK();
CompletableFuture.runAsync(() -> informationService.addToPend(searchCondition));
return Result.OK("资讯添加到待定中。。。");
}
/**
......@@ -604,8 +606,8 @@ public class InformationController {
if (StringUtils.isEmpty(subjectId) && CollectionUtils.isEmpty(ids)) {
return Result.FAIL("专题id和资讯id集合不能同时为空");
}
informationService.addToRemove(searchCondition);
return Result.OK();
CompletableFuture.runAsync(() -> informationService.addToRemove(searchCondition));
return Result.OK("资讯添加到删除中。。。");
}
/**
......@@ -621,13 +623,13 @@ public class InformationController {
if (StringUtils.isEmpty(subjectId)) {
return Result.FAIL("专题id不能为空");
}
informationService.initialData(searchCondition);
return Result.OK();
CompletableFuture.runAsync(() -> informationService.initialData(searchCondition));
return Result.OK("数据初始化中。。。");
}
//@PostMapping("/searchForReplaceList")
public Result<?> searchForReplaceList(@RequestBody InfoDataSearchCondition searchCondition){
public Result<?> searchForReplaceList(@RequestBody InfoDataSearchCondition searchCondition) {
IPage<SpecialInformation> page = informationService.searchForReplaceList(searchCondition);
return Result.OK(page);
}
......@@ -649,8 +651,8 @@ public class InformationController {
if (CollectionUtils.isEmpty(searchWordList)) {
return Result.FAIL("检索词不能为空");
}
informationService.charReplace(searchCondition);
return Result.OK();
CompletableFuture.runAsync(() ->informationService.charReplace(searchCondition));
return Result.OK("数据替换中。。。");
}
/**
......@@ -671,8 +673,8 @@ public class InformationController {
if (CollectionUtils.isEmpty(markTags)) {
return Result.FAIL("标签不能为空");
}
informationService.markTag(searchCondition);
return Result.OK();
CompletableFuture.runAsync(() -> informationService.markTag(searchCondition));
return Result.OK("批量打标中。。。");
}
/**
......@@ -693,8 +695,8 @@ public class InformationController {
if (CollectionUtils.isEmpty(markTags)) {
return Result.FAIL("标签不能为空");
}
informationService.removeTag(searchCondition);
return Result.OK();
CompletableFuture.runAsync(() -> informationService.removeTag(searchCondition));
return Result.OK("批量删除标签中。。。");
}
......
......@@ -64,6 +64,9 @@ public class StatisticalAnalysisController {
List<CountVO> countList = new ArrayList<>();
int totalCount;
List<Label> bindLabelList = bindLabelList(searchCondition.getSubjectId());
if (CollectionUtils.isEmpty(bindLabelList)) {
return Result.FAIL("该专题未绑定信息源标签,无法分析");
}
Map<String, Label> labelMap = bindLabelList.stream().collect(Collectors.toMap(label -> label.getLabelMark() + "-" + label.getRelationId(), label -> label));
if (CollectionUtils.isEmpty(searchCondition.getIds()) && searchCondition.getNum() == null) {
List<String> includeValues = new ArrayList<>();
......
......@@ -1167,6 +1167,11 @@ public class InformationServiceImpl implements InformationService {
Map<String, Object> deleteParams = new HashMap<>();
deleteParams.put("fieldType", word);
esOpUtil.batchNestedDeleteScript(indexArr, buildQuery, deleteParams, "sortField");
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
......@@ -1292,6 +1297,11 @@ public class InformationServiceImpl implements InformationService {
Map<String, String> addTag = ObjectUtil.objectToMap(markTag);
addParams.put("labels",addTag);
esOpUtil.batchNestedAddScript(indexArr, buildQuery, addParams,"labels","relationId");
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
......@@ -1317,6 +1327,11 @@ public class InformationServiceImpl implements InformationService {
Map<String, Object> deleteParams = new HashMap<>();
deleteParams.put("relationId", tagId);
esOpUtil.batchNestedDeleteScript(indexArr, buildQuery, deleteParams, "labels");
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
......
......@@ -707,8 +707,9 @@ public class EsOpUtil<T> {
request.setConflicts("proceed");
try {
BulkByScrollResponse response = client.updateByQuery(request, RequestOptions.DEFAULT);
long versionConflicts = response.getVersionConflicts();
long updated = response.getUpdated();
log.info("更新条数{}", updated);
log.info("更新条数:{},冲突条数{}", updated,versionConflicts);
} catch (IOException e) {
e.printStackTrace();
}
......@@ -738,8 +739,9 @@ public class EsOpUtil<T> {
request.setConflicts("proceed");
try {
BulkByScrollResponse response = client.updateByQuery(request, RequestOptions.DEFAULT);
long versionConflicts = response.getVersionConflicts();
long updated = response.getUpdated();
log.info("更新条数{}", updated);
log.info("更新条数:{},冲突条数{}", updated,versionConflicts);
} catch (IOException e) {
e.printStackTrace();
}
......@@ -779,8 +781,9 @@ public class EsOpUtil<T> {
request.setConflicts("proceed");
try {
BulkByScrollResponse response = client.updateByQuery(request, RequestOptions.DEFAULT);
long deleted = response.getUpdated();
log.info("更新条数{}", deleted);
long versionConflicts = response.getVersionConflicts();
long updated = response.getUpdated();
log.info("更新条数:{},冲突条数{}", updated,versionConflicts);
} catch (IOException e) {
e.printStackTrace();
}
......@@ -811,8 +814,9 @@ public class EsOpUtil<T> {
request.setConflicts("proceed");
try {
BulkByScrollResponse response = client.updateByQuery(request, RequestOptions.DEFAULT);
long deleted = response.getUpdated();
log.info("更新条数{}", deleted);
long versionConflicts = response.getVersionConflicts();
long updated = response.getUpdated();
log.info("更新条数:{},冲突条数{}", updated,versionConflicts);
} catch (IOException e) {
e.printStackTrace();
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论