提交 af39cd85 作者: yanxin

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

......@@ -15,6 +15,7 @@ import com.zzsn.event.es.EsService;
import com.zzsn.event.feign.api.RemoteModelService;
import com.zzsn.event.service.*;
import com.zzsn.event.util.*;
import com.zzsn.event.util.tree.Node;
import com.zzsn.event.util.user.UserUtil;
import com.zzsn.event.util.user.UserVo;
import com.zzsn.event.vo.*;
......@@ -122,7 +123,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);
}
......@@ -147,16 +148,20 @@ public class SubjectManageController {
/**
* 当前用户可见的专题列表-研究中心
*
* @param type 分类(1-个人;2-公开;3-个人+公开)
* @param subjectName 专题名称
* @param pageNo 当前页
* @param pageSize 每页返回条数
* @author lkg
* @date 2025/2/8
*/
@GetMapping("/visiblePageList")
public Result<?> visiblePageList(@RequestParam(required = false) String subjectName,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize){
public Result<?> visiblePageList(@RequestParam Integer type,
@RequestParam(required = false) String subjectName,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
UserVo loginUser = UserUtil.getLoginUser();
Page<String> pageList = subjectService.visiblePageList(loginUser.getUsername(),subjectName, pageNo, pageSize);
Page<Node> pageList = subjectService.visiblePageList(loginUser.getUsername(), type, subjectName, pageNo, pageSize);
return Result.OK(pageList);
}
......@@ -170,8 +175,8 @@ public class SubjectManageController {
*/
@GetMapping(value = "/listByTypeId")
public Result<?> pageList(SubjectCondition subjectCondition,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
IPage<SubjectPage> pageList = subjectService.pageList(subjectCondition, pageNo, pageSize);
return Result.OK(pageList);
}
......@@ -267,7 +272,7 @@ public class SubjectManageController {
* @date 2025/1/8
*/
@GetMapping("/queryInfo")
public Result<?> queryInfo(@RequestParam String subjectId){
public Result<?> queryInfo(@RequestParam String subjectId) {
SubjectDetailVO info = subjectService.queryInfo(subjectId);
return Result.OK(info);
}
......@@ -313,11 +318,11 @@ public class SubjectManageController {
* @date 2025/1/9
*/
@PostMapping("/updateStatus")
public Result<?> updateStatus(@RequestBody Subject subject){
public Result<?> updateStatus(@RequestBody Subject subject) {
subjectService.updateStatus(subject);
xxlJobInfoService.update(Wrappers.<XxlJobInfo>lambdaUpdate()
.eq(XxlJobInfo::getInfoSourceCode, subject.getSubjectCode())
.set(XxlJobInfo::getTriggerStatus,subject.getStatus()));
.set(XxlJobInfo::getTriggerStatus, subject.getStatus()));
if (subject.getStatus() == 1) {
kafkaTemplate.send(SUBJECT_MODEL_KAFKA_CHANNEL, subject.getSubjectCode());
}
......@@ -428,13 +433,13 @@ public class SubjectManageController {
/**
* 专题绑定关键词组列表-专题配置页
*
* @param id 专题id
* @param id 专题id
* @param bindingType 词组类型
* @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);
}
......@@ -593,14 +598,13 @@ public class SubjectManageController {
String subjectId = scoreModelVo.getSubjectId();
HttpHeaders headers = new HttpHeaders();
headers.set("loginUser", JSON.toJSONString(loginUser));
remoteModelService.reScoreRequest(subjectId, "1887695061047672834",headers);
log.info("专题-{},通用打分配置修改,重新打分请求发送成功",subjectId);
remoteModelService.reScoreRequest(subjectId, "1887695061047672834", headers);
log.info("专题-{},通用打分配置修改,重新打分请求发送成功", subjectId);
});
return Result.OK();
}
/**
* 专题打分模型配置信息详情
*
......@@ -769,7 +773,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);
......@@ -853,7 +857,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();
......@@ -866,7 +870,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>()
......@@ -913,9 +917,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;
......@@ -1041,7 +1045,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);
......@@ -1190,7 +1194,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);
......@@ -1214,7 +1218,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()) {
......
......@@ -19,6 +19,7 @@ import com.zzsn.event.util.user.UserUtil;
import com.zzsn.event.util.user.UserVo;
import com.zzsn.event.vo.*;
import com.zzsn.event.vo.es.DisplayInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -392,4 +393,18 @@ public class InformationController {
List<SubjectDataVo> recommendList = informationService.recommendList(subjectId, id, title, pageNo, pageSize);
return Result.OK(recommendList);
}
@PostMapping("/removeByCondition")
public Result<?> removeByCondition(@RequestBody JSONObject params){
String subjectId = params.getString("subjectId");
if (StringUtils.isEmpty(subjectId)) {
return Result.FAIL("专题id不能为空");
}
JSONArray themeIds = params.getJSONArray("themeIds");
if (CollectionUtils.isEmpty(themeIds)) {
return Result.FAIL("主题id不能为空");
}
informationService.removeByCondition(subjectId, JSONArray.parseArray(themeIds.toJSONString(), String.class));
return null;
}
}
package com.zzsn.event.controller.thirdApi;
import com.zzsn.event.constant.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
*
*
* @author lkg
* @date 2025/2/20
*/
@Slf4j
@RestController
@RequestMapping("/subject/api")
public class SubjectAPi {
public Result<?> pageList(String name,Integer type){
return null;
}
}
......@@ -770,6 +770,7 @@ public class EsService {
String queryInfo = hit.getSourceAsString();
SpecialInformation info = JSONUtil.toBean(queryInfo, SpecialInformation.class);
info.setDbIndex(hit.getIndex());
info.setIndex(hit.getIndex());
list.add(info);
}
IPage<SpecialInformation> pageData = new Page<>(pageNo, pageSize, searchResponse.getHits().getTotalHits().value);
......
......@@ -3,6 +3,7 @@ package com.zzsn.event.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zzsn.event.entity.Subject;
import com.zzsn.event.util.tree.Node;
import com.zzsn.event.vo.SubjectCondition;
import com.zzsn.event.vo.SubjectPage;
import com.zzsn.event.vo.SubjectDetailVO;
......@@ -51,12 +52,14 @@ public interface SubjectMapper extends BaseMapper<Subject> {
/**
* 当前用户可见的专题分页列表(公开和个人非公开)-研究中心
*
* @param username 用户名称
* @param page 分页参数
* @param username 用户名称
* @param type 分类(1-个人;2-公开;3-个人+公开)
* @param subjectName 专题名称
* @param page 分页参数
* @author lkg
* @date 2025/2/8
*/
Page<String> visibleList(String username,String subjectName, Page<String> page);
Page<Node> visibleList(@Param("username") String username, @Param("type") Integer type, @Param("subjectName") String subjectName, Page<String> page);
/**
* 获取专题详情(包含样例文章信息)
......
......@@ -40,7 +40,7 @@
IFNULL(r.id, false) as hasReport
from event t
inner join event_category c on t.event_type = c.id
inner join subject_type_map stm on t.id = stm.subject_id
left join subject_type_map stm on t.id = stm.subject_id
inner join project_subject_map psm on t.id = psm.subject_id
left join event_analysis_report r on t.id = r.event_id
where t.id = #{eventId}
......
......@@ -149,13 +149,6 @@
order by d.create_time desc
</select>
<select id="visibleList" resultType="String">
select subject_name from subject d where (d.face_public = 1 or d.create_by = #{username})
<if test="subjectName != null and subjectName != ''">
and d.subject_name like concat('%',#{subjectName},'%')
</if>
</select>
<resultMap id="SubjectDetailVOMap" type="com.zzsn.event.vo.SubjectDetailVO">
<result column="subject_name" property="subjectName"/>
<result column="subjectTypeId" property="subjectTypeId"/>
......@@ -195,4 +188,22 @@
left join subject_sample_file f on s.id = f.subject_id
where s.id = #{subjectId}
</select>
<select id="visibleList" resultType="com.zzsn.event.util.tree.Node">
select id,subject_name as name from subject where 1=1
<if test="subjectName != null and subjectName != ''">
and subject_name like concat('%',#{subjectName},'%')
</if>
<choose>
<when test="type = 1">
and create_by = #{username}
</when>
<when test="type = 2">
and face_public = 1
</when>
<otherwise>
and (create_by = #{username} or face_public = 1)
</otherwise>
</choose>
</select>
</mapper>
......@@ -193,4 +193,7 @@ public interface InformationService {
* @date 2025/2/5
*/
void importDataInfo(List<List<String>> lists, String subjectId);
void removeByCondition(String subjectId, List<String> themeIds);
}
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsn.event.constant.Result;
import com.zzsn.event.entity.Subject;
import com.zzsn.event.util.tree.Node;
import com.zzsn.event.vo.*;
import java.util.List;
......@@ -39,15 +40,17 @@ public interface SubjectService extends IService<Subject> {
Page<SubjectPage> researchCenterPageList(SubjectCondition subjectCondition, Integer pageNo, Integer pageSize);
/**
* 当前用户可见的专题分页列表(公开和个人非公开)-研究中心
* 当前用户可见的专题分页列表-研究中心
*
* @param username 用户名称
* @param pageNo 当前页
* @param pageSize 每页返回条数
* @param username 用户名称
* @param type 分类(1-个人;2-公开;3-个人+公开)
* @param subjectName 专题名称
* @param pageNo 当前页
* @param pageSize 每页返回条数
* @author lkg
* @date 2025/2/8
*/
Page<String> visiblePageList(String username,String subjectName, Integer pageNo, Integer pageSize);
Page<Node> visiblePageList(String username, Integer type, String subjectName, Integer pageNo, Integer pageSize);
/**
* 获取专题详情(包含样例文章信息)
......
......@@ -762,6 +762,10 @@ public class InformationServiceImpl implements InformationService {
}
}
@Override
public void removeByCondition(String subjectId, List<String> themeIds) {
}
private void formatLabel(List<LabelModelVo> labelModelVos, DisplayInfo info) {
if (CollectionUtils.isNotEmpty(labelModelVos)) {
......
......@@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzsn.clb.common.model.task.dto.titr.KeyWordsDTO;
import com.zzsn.event.constant.Constants;
import com.zzsn.event.constant.Result;
import com.zzsn.event.entity.*;
......@@ -26,6 +25,7 @@ import com.zzsn.event.util.CodeGenerateUtil;
import com.zzsn.event.util.CronUtil;
import com.zzsn.event.util.HttpUtil;
import com.zzsn.event.util.RedisUtil;
import com.zzsn.event.util.tree.Node;
import com.zzsn.event.util.user.UserUtil;
import com.zzsn.event.util.user.UserVo;
import com.zzsn.event.vo.*;
......@@ -170,9 +170,9 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
}
@Override
public Page<String> visiblePageList(String username,String subjectName, Integer pageNo, Integer pageSize) {
public Page<Node> visiblePageList(String username,Integer type, String subjectName, Integer pageNo, Integer pageSize) {
Page<String> page = new Page<>(pageNo, pageSize);
return baseMapper.visibleList(username,subjectName, page);
return baseMapper.visibleList(username,type, subjectName, page);
}
@Override
......
......@@ -122,7 +122,12 @@ public class SubjectTypeServiceImpl extends ServiceImpl<SubjectTypeMapper, Subje
@Override
public List<SubjectTreeVO> eventAndTypeTree() {
return baseMapper.eventAndTypeTree();
List<SubjectTreeVO> tree = new ArrayList<>();
List<SubjectTreeVO> subjectTreeVOS = baseMapper.eventAndTypeTree();
if (CollectionUtils.isNotEmpty(subjectTreeVOS)) {
tree = TreeUtil.tree(subjectTreeVOS, "0");
}
return tree;
}
@Override
......
......@@ -127,7 +127,7 @@ public class SpecialInformation {
*/
private Integer ismain;
//数据所在的索引名称
private Long index;
private String index;
//关键词
private List<String> keyWordsList;
//命中词
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论