提交 73fa1b20 作者: obcy

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

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