提交 085741a0 作者: obcy

【添加绑定解绑信息源接口】

上级 8c6cc457
...@@ -14,6 +14,7 @@ import com.zzsn.event.entity.*; ...@@ -14,6 +14,7 @@ import com.zzsn.event.entity.*;
import com.zzsn.event.es.EsService; import com.zzsn.event.es.EsService;
import com.zzsn.event.feign.api.RemoteModelService; import com.zzsn.event.feign.api.RemoteModelService;
import com.zzsn.event.service.*; import com.zzsn.event.service.*;
import com.zzsn.event.service.impl.ConfigurationMessageService;
import com.zzsn.event.util.*; import com.zzsn.event.util.*;
import com.zzsn.event.util.user.UserUtil; import com.zzsn.event.util.user.UserUtil;
import com.zzsn.event.util.user.UserVo; import com.zzsn.event.util.user.UserVo;
...@@ -97,7 +98,8 @@ public class SubjectManageController { ...@@ -97,7 +98,8 @@ public class SubjectManageController {
private PythonUtil pythonUtil; private PythonUtil pythonUtil;
@Autowired(required = false) @Autowired(required = false)
private RemoteModelService remoteModelService; private RemoteModelService remoteModelService;
@Autowired
private ConfigurationMessageService configurationMessageService;
@Value("${kafka.topic.subject.run:}") @Value("${kafka.topic.subject.run:}")
private String SUBJECT_MODEL_KAFKA_CHANNEL; private String SUBJECT_MODEL_KAFKA_CHANNEL;
...@@ -435,6 +437,8 @@ public class SubjectManageController { ...@@ -435,6 +437,8 @@ public class SubjectManageController {
@GetMapping(value = "/bindKeyWordsList") @GetMapping(value = "/bindKeyWordsList")
public Result<?> bindKeyWordsList(@RequestParam(name = "id") String id,@RequestParam(name = "bindingType",required = false) String bindingType) { public Result<?> bindKeyWordsList(@RequestParam(name = "id") String id,@RequestParam(name = "bindingType",required = false) String bindingType) {
List<KeyWordsPage> bindKeyWordsList = subjectKeywordsMapService.bindKeyWordsList(id,bindingType); List<KeyWordsPage> bindKeyWordsList = subjectKeywordsMapService.bindKeyWordsList(id,bindingType);
//同步配置到采集
configurationMessageService.bindKeyWordsSend(id);
return Result.OK(bindKeyWordsList); return Result.OK(bindKeyWordsList);
} }
......
package com.zzsn.event.controller.common; package com.zzsn.event.controller.common;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
...@@ -12,6 +13,7 @@ import com.zzsn.event.entity.InfoSourceGroup; ...@@ -12,6 +13,7 @@ import com.zzsn.event.entity.InfoSourceGroup;
import com.zzsn.event.service.*; import com.zzsn.event.service.*;
import com.zzsn.event.util.tree.Node; import com.zzsn.event.util.tree.Node;
import com.zzsn.event.vo.*; import com.zzsn.event.vo.*;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -43,6 +45,8 @@ public class RelationBindController { ...@@ -43,6 +45,8 @@ public class RelationBindController {
private CommonService commonService; private CommonService commonService;
@Autowired @Autowired
private InfoSourceGroupService infoSourceGroupService; private InfoSourceGroupService infoSourceGroupService;
@Autowired
private SubjectService subjectService;
/** /**
* 项目列表 * 项目列表
...@@ -149,6 +153,18 @@ public class RelationBindController { ...@@ -149,6 +153,18 @@ public class RelationBindController {
} }
/** /**
* 专题信息源绑定新
*
* @param subjectPage
* @return
*/
@ApiOperation(value = "专题信息源绑定", notes = "专题信息源绑定")
@PostMapping(value = "/infoSourceBindNew")
public Result<?> infoSourceBindNew(@RequestBody SubjectPage subjectPage) {
return subjectService.infoSourceBindNew(subjectPage);
}
/**
* 专题/事件信息源绑定删除(专题/事件配置页) * 专题/事件信息源绑定删除(专题/事件配置页)
* *
* @param subjectPage 参数 * @param subjectPage 参数
...@@ -161,6 +177,38 @@ public class RelationBindController { ...@@ -161,6 +177,38 @@ public class RelationBindController {
} }
/** /**
* 专题信息源绑定删除
*
* @param subjectPage
* @return
*/
@ApiOperation(value = "专题信息源绑定删除", notes = "专题信息源绑定删除")
@PostMapping(value = "/deleteBindInfoSourceNew")
public Result<?> deleteBindInfoSourceNew(@RequestBody SubjectPage subjectPage) {
String subjectId = subjectPage.getId();
List<String> bindIds = subjectPage.getBindIds();
if (org.springframework.util.StringUtils.isEmpty(subjectId)) {
return Result.FAIL("专题id不能为空");
}
if (StrUtil.isBlank(subjectPage.getSourceBindType())){
return Result.FAIL("解绑类型不能为空");
}
if (StrUtil.isBlank(subjectPage.getSourceType())){
return Result.FAIL("信息源类型不能为空");
}
if(CollectionUtil.isEmpty(bindIds) && ("1".equals(subjectPage.getSourceType()) || "2".equals(subjectPage.getSourceType()))){
return Result.FAIL("解绑绑定id不能为空");
}
if(CollectionUtil.isEmpty(subjectPage.getBindLabels()) && "3".equals(subjectPage.getSourceType() )){
return Result.FAIL("解绑标签不能为空");
}
subjectService.deleteBindNew(subjectPage);
return Result.OK("删除成功!");
}
/**
* 专题/事件绑定的信息源组列表(专题/事件配置页) * 专题/事件绑定的信息源组列表(专题/事件配置页)
* *
* @param subjectId 专题/事件id * @param subjectId 专题/事件id
......
...@@ -82,4 +82,9 @@ public interface ISubjectInfoSourceMapService extends IService<SubjectInfoSource ...@@ -82,4 +82,9 @@ public interface ISubjectInfoSourceMapService extends IService<SubjectInfoSource
* @date 2024/5/6 * @date 2024/5/6
*/ */
List<SubjectStatisticsVo> subjectRealBindInfoSources(List<String> subjectIds); List<SubjectStatisticsVo> subjectRealBindInfoSources(List<String> subjectIds);
/**
* 根据批量删除
*/
void deleteInfoSourceIds(String subjectId, List<String> infoSourceIds, Integer type);
} }
...@@ -162,4 +162,8 @@ public interface SubjectService extends IService<Subject> { ...@@ -162,4 +162,8 @@ public interface SubjectService extends IService<Subject> {
void send(String subjectId, String status); void send(String subjectId, String status);
List<KeyWordsPage> bindKeyWordsListByIdsAndBindType(List<String> ids, String bindingType); List<KeyWordsPage> bindKeyWordsListByIdsAndBindType(List<String> ids, String bindingType);
Result<?> infoSourceBindNew(SubjectPage subjectPage);
void deleteBindNew(SubjectPage subjectPage);
} }
...@@ -63,6 +63,11 @@ public class SubjectInfoSourceMapServiceImpl extends ServiceImpl<SubjectInfoSour ...@@ -63,6 +63,11 @@ public class SubjectInfoSourceMapServiceImpl extends ServiceImpl<SubjectInfoSour
} }
@Override @Override
public void deleteInfoSourceIds(String subjectId, List<String> infoSourceIds, Integer type) {
baseMapper.deleteInfoSourceIds(subjectId, infoSourceIds, type);
}
@Override
public List<String> subjectRealBindInfoSourceList(List<String> subjectIds) { public List<String> subjectRealBindInfoSourceList(List<String> subjectIds) {
return baseMapper.subjectRealBindInfoSourceList(subjectIds); return baseMapper.subjectRealBindInfoSourceList(subjectIds);
} }
......
package com.zzsn.event.vo;
import lombok.Data;
import java.util.List;
@Data
public class BindLabelVo {
private String labelCode ;
private String labelItemCode ;
private List<BindLabelVo> labelItems;
}
...@@ -159,6 +159,22 @@ public class SubjectPage { ...@@ -159,6 +159,22 @@ public class SubjectPage {
/**预估状态*/ /**预估状态*/
private String estimateStatus; private String estimateStatus;
/**
* 信息源绑定-新
* */
//id(可以是信息源组id集合,可以是信息源id集合)
private List<String> bindIds;
//信息源标签
private List<BindLabelVo> bindLabels;
//绑定类型类型(1:通用 2:定向 3:屏蔽)
private String sourceBindType;
//信息源类型(1:信息源组 2:信息源 3:标签)
private String sourceType;
/**
* 信息源绑定-新end
* */
private List<ClbModelArrange> clbModelArranges; private List<ClbModelArrange> clbModelArranges;
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论