提交 d020375b 作者: 925993793@qq.com

研究中心-列表默认不展示复合专题

上级 f1403add
......@@ -134,7 +134,7 @@ public class SubjectManageController {
* @date 2025/1/7
*/
@GetMapping("/dictItemList")
public Result<?> dictItemList(@RequestParam(defaultValue = "Thematic_Library")String dictCode){
public Result<?> dictItemList(@RequestParam(defaultValue = "Thematic_Library") String dictCode) {
List<SysDictItem> dictItemList = sysDictItemService.listByDictCode(dictCode);
return Result.OK(dictItemList);
}
......@@ -152,9 +152,9 @@ public class SubjectManageController {
public Result<?> researchCenterPageList(SubjectCondition subjectCondition,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
@RequestParam(required = false) String flagCode,HttpServletRequest request) {
@RequestParam(required = false) String flagCode, HttpServletRequest request) {
UserVo loginUser = UserUtil.getLoginUser();
Page<SubjectPage> pageList = subjectService.researchCenterPageList(subjectCondition, pageNo, pageSize,flagCode,request,loginUser.getUsername());
Page<SubjectPage> pageList = subjectService.researchCenterPageList(subjectCondition, pageNo, pageSize, flagCode, request, loginUser.getUsername());
return Result.OK(pageList);
}
......@@ -163,7 +163,7 @@ public class SubjectManageController {
*
* @param type 分类(1-个人;2-公开;3-个人+公开)
* @param subjectName 专题名称
* @param environment 环境 1-测试 2-正式
* @param environment 环境 1-测试 2-正式
* @param flagCode 数据权限code
* @param pageNo 当前页
* @param pageSize 每页返回条数
......@@ -173,13 +173,14 @@ public class SubjectManageController {
@GetMapping("/visiblePageList")
public Result<?> visiblePageList(@RequestParam Integer type,
@RequestParam(required = false) String subjectName,
@RequestParam(defaultValue = "1") Integer subjectType,
@RequestParam(required = false) String environment,
@RequestParam(required = false) String flagCode,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest request) {
UserVo loginUser = UserUtil.getLoginUser();
Page<Node> pageList = subjectService.visiblePageList(loginUser.getUsername(), type, subjectName, pageNo, pageSize,environment,request,flagCode);
Page<Node> pageList = subjectService.visiblePageList(loginUser.getUsername(), type, subjectName, subjectType, pageNo, pageSize, environment, request, flagCode);
return Result.OK(pageList);
}
......@@ -189,7 +190,7 @@ public class SubjectManageController {
*
* @param type 分类(1-个人;2-公开;3-个人+公开)
* @param subjectName 专题名称
* @param environment 环境 1-测试 2-正式
* @param environment 环境 1-测试 2-正式
* @param flagCode 数据权限code
* @param pageNo 当前页
* @param pageSize 每页返回条数
......@@ -198,14 +199,15 @@ public class SubjectManageController {
*/
@GetMapping("/visiblePageListNoSign")
public Result<?> visiblePageListNoSign(@RequestParam Integer type,
@RequestParam(required = false) String subjectName,
@RequestParam(required = false) String environment,
@RequestParam(required = false) String flagCode,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest request) {
@RequestParam(required = false) String subjectName,
@RequestParam(defaultValue = "1") Integer subjectType,
@RequestParam(required = false) String environment,
@RequestParam(required = false) String flagCode,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest request) {
UserVo loginUser = UserUtil.getLoginUser();
Page<Node> pageList = subjectService.visiblePageList(loginUser.getUsername(), type, subjectName, pageNo, pageSize,environment,request,flagCode);
Page<Node> pageList = subjectService.visiblePageList(loginUser.getUsername(), type, subjectName, subjectType, pageNo, pageSize, environment, request, flagCode);
return Result.OK(pageList);
}
......@@ -233,7 +235,7 @@ public class SubjectManageController {
* @date 2025/3/25
*/
@GetMapping(value = "/statisticInfo")
private Result<?> statisticInfo(@RequestParam List<String> subjectIds){
private Result<?> statisticInfo(@RequestParam List<String> subjectIds) {
List<SubjectStatisticInfo> statisticInfoList = subjectService.statisticInfo(subjectIds);
//异步更新专题统计信息表的数据
CompletableFuture.runAsync(() -> {
......@@ -409,7 +411,7 @@ public class SubjectManageController {
xxlJobInfoService.update(Wrappers.<XxlJobInfo>lambdaUpdate()
.eq(XxlJobInfo::getInfoSourceCode, byId.getSubjectCode())
.set(XxlJobInfo::getTriggerStatus, byId.getStatus()));
}else{
} else {
xxlJobInfoService.subjectInsert(byId);
}
......@@ -425,16 +427,17 @@ public class SubjectManageController {
cn.hutool.json.JSONObject entries = JSONUtil.parseObj(res);
//获取code状态码
Integer code = entries.getInt("code");
if (ObjectUtil.isEmpty(code) || code != 200) {
log.error("专题状态同步采集失败{}",res);
if (ObjectUtil.isEmpty(code) || code != 200) {
log.error("专题状态同步采集失败{}", res);
}
} catch (Exception e) {
log.error("专题状态同步采集失败{}",e.getMessage(),e);
log.error("专题状态同步采集失败{}", e.getMessage(), e);
}
return Result.OK();
}
/**
* 更新状态
*
......@@ -443,23 +446,24 @@ public class SubjectManageController {
*/
@PostMapping("/updateSubjectAllToCaiji")
public Result<?> updateSubjectAllToCaiji() {
List<Subject> list = subjectService.list(Wrappers.<Subject>lambdaQuery().eq(Subject::getSubjectType,1));
List<Subject> list = subjectService.list(Wrappers.<Subject>lambdaQuery().eq(Subject::getSubjectType, 1));
for (int i = 0; i < list.size(); i++) {
Subject subject = list.get(i);
log.info("专题状态同步采集{},index:{},total:{}",subject.getSubjectName(),i,list.size());
if (subject.getStatus()!=null && subject.getStatus() == 1) {
log.info("专题状态同步采集{},index:{},total:{}", subject.getSubjectName(), i, list.size());
if (subject.getStatus() != null && subject.getStatus() == 1) {
configurationMessageService.bindInfoSourceSend(subject.getId());
configurationMessageService.bindKeyWordsSend(subject.getId());
caiJiCenterHttpService.subjectStatusEdit(subject.getStatus(), subject.getId());
configurationMessageService.subjectEnterpriseSourceSync(subject.getId());
log.info("专题配置信息同步采集成功:{}",subject.getSubjectName());
}else{
log.info("专题配置信息同步采集成功:{}", subject.getSubjectName());
} else {
caiJiCenterHttpService.delSubject(subject.getId());
log.info("通知采集删除专题成功:{}",subject.getSubjectName());
log.info("通知采集删除专题成功:{}", subject.getSubjectName());
}
}
return Result.OK();
}
/**
* 更新状态
*
......@@ -471,14 +475,14 @@ public class SubjectManageController {
List<Event> list = eventService.list();
for (int i = 0; i < list.size(); i++) {
Event event = list.get(i);
log.info("事件状态同步采集{},index:{},total:{}",event.getEventName(),i,list.size());
if (event.getStatus()!=null && event.getStatus() == 1) {
log.info("事件状态同步采集{},index:{},total:{}", event.getEventName(), i, list.size());
if (event.getStatus() != null && event.getStatus() == 1) {
configurationMessageService.bindKeyWordsEventSend(event.getId());
caiJiCenterHttpService.subjectStatusEdit(event.getStatus(), event.getId());
log.info("事件配置信息同步采集成功:{}",event.getEventName());
}else{
log.info("事件配置信息同步采集成功:{}", event.getEventName());
} else {
caiJiCenterHttpService.delSubject(event.getId());
log.info("通知采集删除事件成功:{}",event.getEventName());
log.info("通知采集删除事件成功:{}", event.getEventName());
}
}
return Result.OK();
......@@ -505,11 +509,11 @@ public class SubjectManageController {
cn.hutool.json.JSONObject entries = JSONUtil.parseObj(res);
//获取code状态码
Integer code = entries.getInt("code");
if (ObjectUtil.isEmpty(code) || code != 200) {
log.error("专题删除同步采集失败{}",res);
if (ObjectUtil.isEmpty(code) || code != 200) {
log.error("专题删除同步采集失败{}", res);
}
} catch (Exception e) {
log.error("专题删除同步采集失败{}",e.getMessage(),e);
log.error("专题删除同步采集失败{}", e.getMessage(), e);
}
return Result.OK();
}
......@@ -539,11 +543,11 @@ public class SubjectManageController {
cn.hutool.json.JSONObject entries = JSONUtil.parseObj(res);
//获取code状态码
Integer code = entries.getInt("code");
if (ObjectUtil.isEmpty(code) || code != 200) {
log.error("专题删除同步采集失败{}",res);
if (ObjectUtil.isEmpty(code) || code != 200) {
log.error("专题删除同步采集失败{}", res);
}
} catch (Exception e) {
log.error("专题删除同步采集失败{}",e.getMessage(),e);
log.error("专题删除同步采集失败{}", e.getMessage(), e);
}
}
......@@ -618,8 +622,8 @@ public class SubjectManageController {
* @return
*/
@GetMapping(value = "/bindKeyWordsList")
public Result<?> bindKeyWordsList(@RequestParam(name = "id") String id,@RequestParam(name = "bindingType",required = false) String bindingType) {
List<KeyWordsPage> bindKeyWordsList = subjectKeywordsMapService.bindKeyWordsList(id,bindingType);
public Result<?> bindKeyWordsList(@RequestParam(name = "id") String id, @RequestParam(name = "bindingType", required = false) String bindingType) {
List<KeyWordsPage> bindKeyWordsList = subjectKeywordsMapService.bindKeyWordsList(id, bindingType);
return Result.OK(bindKeyWordsList);
}
......@@ -784,7 +788,6 @@ public class SubjectManageController {
}
/**
* 专题打分模型配置信息详情
*
......@@ -861,16 +864,18 @@ public class SubjectManageController {
List<InfoSourceLabelVO> bindList = clbLabelService.bindInfoSourceLabelInfo(subjectId);
return Result.OK(bindList);
}
/**
* 更新subject的数据范围
*
* @param subjectId 专题id
*/
@GetMapping("/subjectUpdateScope")
public Result<?> subjectUpdateScope(@RequestParam(name = "subjectId") String subjectId,
@RequestParam(name = "type") String type,
@RequestParam(name = "scop" , defaultValue = "") String scop
) {
Subject subject = subjectService.subjectUpdateScope(subjectId,type,scop);
@RequestParam(name = "type") String type,
@RequestParam(name = "scop", defaultValue = "") String scop
) {
Subject subject = subjectService.subjectUpdateScope(subjectId, type, scop);
return Result.OK(subject);
}
......@@ -967,7 +972,7 @@ public class SubjectManageController {
List<String> sourceIdList = subjectSourceVO.getSourceIdList();
if (CollectionUtils.isEmpty(sourceIdList)) {
LambdaQueryWrapper<InfoSource> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.select(InfoSource::getId,InfoSource::getSiteName,InfoSource::getSiteUri)
queryWrapper.select(InfoSource::getId, InfoSource::getSiteName, InfoSource::getSiteUri)
.in(InfoSource::getWebSiteName, subjectSourceVO.getWebSiteNameList())
.groupBy(InfoSource::getId);
List<InfoSource> infoSources = infoSourceService.list(queryWrapper);
......@@ -1055,7 +1060,7 @@ public class SubjectManageController {
* @date 2025/1/9
*/
@PostMapping("/removeDirectInfoSource")
public Result<?> removeDirectInfoSource(@RequestBody List<SubjectBindDirectSourceVO> params){
public Result<?> removeDirectInfoSource(@RequestBody List<SubjectBindDirectSourceVO> params) {
for (SubjectBindDirectSourceVO param : params) {
String subjectId = param.getSubjectId();
String webSiteName = param.getWebSiteName();
......@@ -1068,7 +1073,7 @@ public class SubjectManageController {
} else {
List<String> webSiteNameList = new ArrayList<>();
webSiteNameList.add(webSiteName);
List<InfoSource> infoSources = infoSourceService.subjectBindSourceColumnList(subjectId,webSiteNameList);
List<InfoSource> infoSources = infoSourceService.subjectBindSourceColumnList(subjectId, webSiteNameList);
sourceIdList = infoSources.stream().map(InfoSource::getId).collect(Collectors.toList());
}
subjectInfoSourceMapService.remove(new LambdaQueryWrapper<SubjectInfoSourceMap>()
......@@ -1117,9 +1122,9 @@ public class SubjectManageController {
if (originalFilename.endsWith(".xlsx") || originalFilename.endsWith(".xls")) {
List<List<String>> dataList;
if (originalFilename.endsWith(".xls")) {
dataList = ExcelExportUtil.readExcelXls(file.getInputStream(), false,1, 2);
dataList = ExcelExportUtil.readExcelXls(file.getInputStream(), false, 1, 2);
} else {
dataList = ExcelExportUtil.readExcelXlsx(file.getInputStream(), false,1, 2);
dataList = ExcelExportUtil.readExcelXlsx(file.getInputStream(), false, 1, 2);
}
if (CollectionUtils.isNotEmpty(dataList)) {
boolean emptyFlag = false;
......@@ -1245,7 +1250,7 @@ public class SubjectManageController {
sourceIdList.add(countVO.getName());
}
LambdaQueryWrapper<InfoSource> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.select(InfoSource::getId,InfoSource::getSiteName,InfoSource::getSiteUri).in(InfoSource::getId,sourceIdList);
queryWrapper.select(InfoSource::getId, InfoSource::getSiteName, InfoSource::getSiteUri).in(InfoSource::getId, sourceIdList);
infoSources = infoSourceService.list(queryWrapper);
}
return Result.OK(infoSources);
......@@ -1394,7 +1399,7 @@ public class SubjectManageController {
String originalFilename = file.getOriginalFilename();
if (originalFilename.endsWith(".txt")) {
parseTxt(text, file);
} else if (originalFilename.endsWith(".docx")){
} else if (originalFilename.endsWith(".docx")) {
parseWordDocx(text, file);
} else if (originalFilename.endsWith(".doc")) {
parseWordDoc(text, file);
......@@ -1418,7 +1423,7 @@ public class SubjectManageController {
}
private List<StatisticsKeyWordVo> formatWordInfo(String text,List<String> wordsList){
private List<StatisticsKeyWordVo> formatWordInfo(String text, List<String> wordsList) {
List<StatisticsKeyWordVo> articleWordList = new ArrayList<>();
Map<String, Integer> hitWordsAndTimes = HanlpUtil.getHitWordsAndTimes(wordsList, text);
for (Map.Entry<String, Integer> entry : hitWordsAndTimes.entrySet()) {
......
......@@ -33,14 +33,14 @@ public interface SubjectMapper extends BaseMapper<Subject> {
Page<SubjectPage> pageList(@Param("subjectCondition") SubjectCondition subjectCondition, Page<SubjectPage> page);
/**
*专题分页列表-新
* 专题分页列表-新
*
* @param subjectCondition 查询条件
* @param page 分页参数
* @param page 分页参数
* @author lkg
* @date 2025/3/25
*/
Page<SubjectPageVO> pageList_new(Page<SubjectPageVO> page,@Param("subjectCondition") SubjectCondition subjectCondition,@Param("userId") String userId);
Page<SubjectPageVO> pageList_new(Page<SubjectPageVO> page, @Param("subjectCondition") SubjectCondition subjectCondition, @Param("userId") String userId);
/**
* 专题详情(包含专题分类、专题项目)
......@@ -50,6 +50,7 @@ public interface SubjectMapper extends BaseMapper<Subject> {
* @date 2025/3/25
*/
SubjectPage getInfo(@Param("subjectId") String subjectId);
/**
* 专题分页列表(个人)-研究中心
*
......@@ -68,7 +69,7 @@ public interface SubjectMapper extends BaseMapper<Subject> {
* @author lkg
* @date 2025/1/14
*/
Page<SubjectPage> researchCenterFacePageList(@Param("subjectCondition") SubjectCondition subjectCondition, Page<SubjectPage> page,@Param("sql") String sql,@Param("username") String username);
Page<SubjectPage> researchCenterFacePageList(@Param("subjectCondition") SubjectCondition subjectCondition, Page<SubjectPage> page, @Param("sql") String sql, @Param("username") String username);
/**
* 当前用户可见的专题分页列表(公开和个人非公开)-研究中心
......@@ -76,11 +77,12 @@ public interface SubjectMapper extends BaseMapper<Subject> {
* @param username 用户名称
* @param type 分类(1-个人;2-公开;3-个人+公开)
* @param subjectName 专题名称
* @param subjectType 专题类别(1:通用专题;3:研究中心主题专题[复合专题])
* @param page 分页参数
* @author lkg
* @date 2025/2/8
*/
Page<Node> visibleList(@Param("username") String username, @Param("type") Integer type, @Param("subjectName") String subjectName, Page<String> page,@Param("environment") String environment,@Param("sql") String sql);
Page<Node> visibleList(@Param("username") String username, @Param("type") Integer type, @Param("subjectName") String subjectName, @Param("subjectType") Integer subjectType, Page<String> page, @Param("environment") String environment, @Param("sql") String sql);
/**
* 获取专题详情(包含样例文章信息)
......@@ -120,7 +122,7 @@ public interface SubjectMapper extends BaseMapper<Subject> {
*/
int ynBelowExcludeGroup(@Param("subjectId") String subjectId, @Param("sourceId") String sourceId);
List<String> getBindSubjectIds(@Param("id")String id);
List<String> getBindSubjectIds(@Param("id") String id);
String getMinCreateTime(@Param("subjectIdList") List<String> subjectIdList);
}
......@@ -193,6 +193,9 @@
<if test="subjectCondition.username!=null and subjectCondition.username != ''">
and d.create_by = #{subjectCondition.username}
</if>
<if test="subjectCondition.subjectType != null">
and d.subject_type = #{subjectCondition.subjectType}
</if>
order by d.create_time desc
</select>
<select id="researchCenterFacePageList" resultType="com.zzsn.event.vo.SubjectPage">
......@@ -236,6 +239,9 @@
<if test="subjectCondition.status!=null">
and d.status = #{subjectCondition.status}
</if>
<if test="subjectCondition.subjectType!=null">
and d.subject_type = #{subjectCondition.subjectType}
</if>
order by d.create_time desc
</select>
......@@ -286,6 +292,9 @@
<if test="subjectName != null and subjectName != ''">
and subject_name like concat('%',#{subjectName},'%')
</if>
<if test="subjectType!=null">
and subject_type = #{subjectType}
</if>
<if test="environment != null and environment != ''">
and environment = #{environment}
</if>
......
......@@ -76,12 +76,13 @@ public interface SubjectService extends IService<Subject> {
* @param username 用户名称
* @param type 分类(1-个人;2-公开;3-个人+公开)
* @param subjectName 专题名称
* @param subjectName 专题类别(1:通用专题;3:研究中心主题专题[复合专题])
* @param pageNo 当前页
* @param pageSize 每页返回条数
* @author lkg
* @date 2025/2/8
*/
Page<Node> visiblePageList(String username, Integer type, String subjectName, Integer pageNo, Integer pageSize, String environment,HttpServletRequest request,String flagCode);
Page<Node> visiblePageList(String username, Integer type, String subjectName, Integer subjectType, Integer pageNo, Integer pageSize, String environment,HttpServletRequest request,String flagCode);
/**
* 获取专题详情(包含样例文章信息)
......
......@@ -291,7 +291,7 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
}
@Override
public Page<Node> visiblePageList(String username, Integer type, String subjectName, Integer pageNo, Integer pageSize, String environment,HttpServletRequest request,String flagCode) {
public Page<Node> visiblePageList(String username, Integer type, String subjectName,Integer subjectType, Integer pageNo, Integer pageSize, String environment,HttpServletRequest request,String flagCode) {
Page<String> page = new Page<>(pageNo, pageSize);
String sql = "";
if(StringUtils.isNotBlank(flagCode)){
......@@ -309,7 +309,7 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
log.info("visiblePageList sql:{}",sql);
}
log.info("visiblePageList username:{},type:{},subjectName:{},environment:{},sql:{}",username,type,subjectName,environment,sql);
return baseMapper.visibleList(username, type, subjectName, page,environment,sql);
return baseMapper.visibleList(username, type, subjectName,subjectType, page,environment,sql);
}
@Override
......
......@@ -45,4 +45,7 @@ public class SubjectCondition {
private String column;
/**排序方式*/
private String order;
/*专题类别(1:通用专题;3:研究中心主题专题[复合专题])*/
private Integer subjectType = 1;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论