提交 4a1f6bb3 作者: 925993793@qq.com

调试修改

上级 107e2609
......@@ -102,4 +102,7 @@ public class Constants {
}
public static final String HISTORY_DATE_QUEUE = "HISTORY_DATE_QUEUE:";
//obs 文件浏览地址 前部分
public static final String OBS_FILE_PATH_URL_PREFIX = "http://obs.ciglobal.cn/";
}
......@@ -146,6 +146,10 @@ public class FileController {
@PostMapping("/importInfo")
public Result<?> importInfo(HttpServletRequest request) {
UserVo userVo = UserUtil.getLoginUser();
String subjectId = request.getParameter("subjectId");
if (StringUtils.isBlank(subjectId)) {
return Result.FAIL(500, "专题id不能为空");
}
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
if (fileMap.size() < 1) {
......@@ -158,7 +162,6 @@ public class FileController {
CompletableFuture.runAsync(()->{
//开启日志
ClbFileOperationLog clbFileOperationLog = clbFileOperationLogService.operationStart(multipartFile.getOriginalFilename(), userVo);
String subjectId = request.getParameter("subjectId");
String isTopping = request.getParameter("isTopping");
String isExamine = request.getParameter("isExamine");
try {
......@@ -302,7 +305,6 @@ public class FileController {
String fileSuffix = multipartFile.getOriginalFilename().substring(index + 1);
if ("xls".equals(fileSuffix) || "xlsx".equals(fileSuffix)) {
CompletableFuture.runAsync(() -> {
try {
byte[] fileData = multipartFile.getBytes();
//读取文件内容
......
......@@ -14,6 +14,8 @@ 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.user.UserUtil;
import com.zzsn.event.util.user.UserVo;
import com.zzsn.event.vo.*;
import com.zzsn.event.vo.es.SpecialInformation;
import com.zzsn.event.xxljob.entity.XxlJobInfo;
......@@ -91,7 +93,7 @@ public class SubjectManageController {
private KafkaTemplate<String, String> kafkaTemplate;
@Autowired
private PythonUtil pythonUtil;
@Autowired
@Autowired(required = false)
private RemoteModelService remoteModelService;
......@@ -141,6 +143,22 @@ public class SubjectManageController {
}
/**
* 当前用户可见的专题列表-研究中心
*
* @param subjectName 专题名称
* @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){
UserVo loginUser = UserUtil.getLoginUser();
Page<String> pageList = subjectService.visiblePageList(loginUser.getUsername(),subjectName, pageNo, pageSize);
return Result.OK(pageList);
}
/**
* 分页列表查询
*
* @param subjectCondition 搜索条件
......
......@@ -1732,22 +1732,31 @@ public class EsService {
}
}
Integer checkStatus = searchCondition.getCheckStatus();
Integer deleteFlag = searchCondition.getDeleteFlag();
if (checkStatus != null) {
boolQuery.must(QueryBuilders.termQuery("checkStatus", checkStatus));
}
if (StringUtils.isNotBlank(searchCondition.getVideo())) {
boolQuery.must(QueryBuilders.matchQuery("type", "video"));
} else {
boolQuery.mustNot(QueryBuilders.matchQuery("type", "video"));
if (deleteFlag == null) {
deleteFlag = 0;
}
}
//删除状态查询
if (searchCondition.getDeleteFlag() != null) {
if (searchCondition.getDeleteFlag() != 0) {
if (deleteFlag != null) {
if (deleteFlag != 0) {
boolQuery.must(QueryBuilders.termQuery("deleteFlag", "1"));
} else {
boolQuery.mustNot(QueryBuilders.termQuery("deleteFlag", "1"));
}
}
//免审核状态
if (searchCondition.getIsFreeCheck() != null) {
boolQuery.must(QueryBuilders.termQuery("isFreeCheck", 1));
}
if (StringUtils.isNotBlank(searchCondition.getVideo())) {
boolQuery.must(QueryBuilders.matchQuery("type", "video"));
} else {
boolQuery.mustNot(QueryBuilders.matchQuery("type", "video"));
}
//专题库类别筛选
if (CollectionUtils.isNotEmpty(searchCondition.getClassificationType())) {
boolQuery.must(QueryBuilders.termsQuery("classificationType", searchCondition.getClassificationType()));
......
......@@ -37,6 +37,7 @@ public interface SubjectMapper extends BaseMapper<Subject> {
* @date 2024/12/18
*/
Page<SubjectPage> researchCenterPageList(@Param("subjectCondition") SubjectCondition subjectCondition, Page<SubjectPage> page);
/**
* 专题分页列表(公开)-研究中心
*
......@@ -48,6 +49,16 @@ public interface SubjectMapper extends BaseMapper<Subject> {
Page<SubjectPage> researchCenterFacePageList(@Param("subjectCondition") SubjectCondition subjectCondition, Page<SubjectPage> page);
/**
* 当前用户可见的专题分页列表(公开和个人非公开)-研究中心
*
* @param username 用户名称
* @param page 分页参数
* @author lkg
* @date 2025/2/8
*/
Page<String> visibleList(String username,String subjectName, Page<String> page);
/**
* 获取专题详情(包含样例文章信息)
*
* @param subjectId 专题id
......@@ -55,6 +66,7 @@ public interface SubjectMapper extends BaseMapper<Subject> {
* @date 2025/1/8
*/
SubjectDetailVO queryInfo(@Param("subjectId") String subjectId);
/**
* 专题详情
*
......
......@@ -130,7 +130,7 @@
from subject d
LEFT JOIN subject_type_map b ON b.subject_id = d.id
LEFT JOIN subject_type c ON b.type_id = c.id
where face_public = 1
where d.face_public = 1
<if test="subjectCondition.id !=null and subjectCondition.id !=''">
and d.id =#{subjectCondition.id}
</if>
......@@ -149,6 +149,13 @@
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"/>
......
......@@ -39,6 +39,17 @@ public interface SubjectService extends IService<Subject> {
Page<SubjectPage> researchCenterPageList(SubjectCondition subjectCondition, Integer pageNo, Integer pageSize);
/**
* 当前用户可见的专题分页列表(公开和个人非公开)-研究中心
*
* @param username 用户名称
* @param pageNo 当前页
* @param pageSize 每页返回条数
* @author lkg
* @date 2025/2/8
*/
Page<String> visiblePageList(String username,String subjectName, Integer pageNo, Integer pageSize);
/**
* 获取专题详情(包含样例文章信息)
*
* @param subjectId 专题id
......
......@@ -2,6 +2,7 @@ package com.zzsn.event.service.impl;
import cn.hutool.core.io.FileUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzsn.event.constant.Constants;
import com.zzsn.event.entity.ClbSysAttachment;
import com.zzsn.event.mapper.ClbSysAttachmentMapper;
import com.zzsn.event.service.IClbSysAttachmentService;
......@@ -50,7 +51,7 @@ public class ClbSysAttachmentServiceImpl extends ServiceImpl<ClbSysAttachmentMap
this.save(clbSysAttachment);
AttachmentInfo attachmentInfo = new AttachmentInfo();
attachmentInfo.setAttachmentName(file.getOriginalFilename());
attachmentInfo.setAttachmentFullPath("http://obs.ciglobal.cn/" + url);
attachmentInfo.setAttachmentFullPath(Constants.OBS_FILE_PATH_URL_PREFIX + url);
attachmentInfo.setCategory(fileSuffix);
attachmentInfo.setFileSize(FileUtil.readableFileSize(file.getSize()));
attachmentInfo.setAttachmentId(clbSysAttachment.getId().toString());
......
......@@ -87,6 +87,8 @@ public class InformationServiceImpl implements InformationService {
private ICollectionMapService collectionMapService;
@Autowired
private SysDictItemService sysDictItemService;
@Autowired
private IClbSysAttachmentService csAttachmentService;
@Override
......@@ -158,6 +160,7 @@ public class InformationServiceImpl implements InformationService {
@Override
public DisplayInfo queryInfo(Integer type,String index, String id) {
DisplayInfo info = (DisplayInfo) esOpUtil.getInfoById(index, id, DisplayInfo.class);
info.setDbIndex(index);
if (StringUtils.isNotEmpty(info.getContentWithTag())) {
String contentNoTag = Utility.TransferHTML2TextWithImg(info.getContentWithTag());
String contentNoTag2 = Utility.dealImg(contentNoTag);
......@@ -165,6 +168,30 @@ public class InformationServiceImpl implements InformationService {
}
info.setPublishDate(EsDateUtil.esFieldDateMapping(info.getPublishDate()));
if (type == 2) {
//获取附件信息
if (info.getAttachmentIds() != null && info.getAttachmentIds().size() > 0) {
List<AttachmentInfo> attachmentInfoList = new ArrayList<>();
for (String attachmentId : info.getAttachmentIds()) {
QueryWrapper<ClbSysAttachment> queryWrapper = Wrappers.query();
queryWrapper.eq("id", attachmentId);
ClbSysAttachment clbSysAttachment = clbSysAttachmentService.getOne(queryWrapper);
if (clbSysAttachment != null) {
AttachmentInfo attachmentInfo = new AttachmentInfo();
attachmentInfo.setAttachmentName(clbSysAttachment.getName());
attachmentInfo.setAttachmentPath(clbSysAttachment.getPath());
attachmentInfo.setGroup(clbSysAttachment.getGroupName());
attachmentInfo.setAttachmentId(String.valueOf(clbSysAttachment.getId()));
attachmentInfo.setAttachmentFullPath(Constants.OBS_FILE_PATH_URL_PREFIX + clbSysAttachment.getObjectKey());
attachmentInfo.setPageSize(clbSysAttachment.getPageSize());
attachmentInfo.setSource(clbSysAttachment.getSource());
attachmentInfo.setFileSize(clbSysAttachment.getFileSize());
attachmentInfoList.add(attachmentInfo);
}
}
info.setAttachmentInfos(attachmentInfoList);
info.setYnArticle(false);
}
CompletableFuture.runAsync(()-> addReadNum(info, index));
}
return info;
......@@ -303,6 +330,7 @@ public class InformationServiceImpl implements InformationService {
specialInformation.setId(id);
specialInformation.setUniqueCode(id);
specialInformation.setDeleteFlag(0);
specialInformation.setCheckStatus(0);
specialInformation.setTopNum(0);
specialInformation.setFlag("1");
specialInformation.setCreateDate(EsDateUtil.esFieldDateFormat(cn.hutool.core.date.DateUtil.formatDateTime(new Date())));
......
......@@ -73,6 +73,7 @@ public class KeyWordsServiceImpl extends ServiceImpl<KeyWordsMapper, KeyWords> i
Node node = new Node();
node.setId(e.getId());
node.setPid(e.getPid());
nodeList.add(node);
});
typeIds = TreeUtil.belowList(nodeList,keyWordsTypeId,true);
}
......@@ -137,7 +138,9 @@ public class KeyWordsServiceImpl extends ServiceImpl<KeyWordsMapper, KeyWords> i
KeyWords keyWords = new KeyWords();
BeanUtils.copyProperties(keyWordsPage, keyWords);
//更细redis缓存
KeyWordsDTO keyWordsDTO = (KeyWordsDTO)redisUtil.get(Constants.KEY_WORDS_TO_REDIS_PREFIX + keyWords.getWordsCode());
Object object = redisUtil.get(Constants.KEY_WORDS_TO_REDIS_PREFIX + keyWords.getWordsCode());
if (object != null) {
KeyWordsDTO keyWordsDTO = (KeyWordsDTO) object;
keyWordsDTO.setKeyWord(keyWordsPage.getKeyWord());
keyWordsDTO.setExclusionWord(keyWordsPage.getExclusionWord());
redisUtil.set(Constants.KEY_WORDS_TO_REDIS_PREFIX + keyWords.getWordsCode(), keyWordsDTO);
......@@ -153,6 +156,7 @@ public class KeyWordsServiceImpl extends ServiceImpl<KeyWordsMapper, KeyWords> i
keyWordsCodes.add(keyWordsDTO.getWordsCode());
xxlJobInfoService.keyWordsUpdate(keyWordsCodes, keyWordsPage.getStatus());
}
}
//插入关键词表
baseMapper.updateById(keyWords);
//删除关键词-类别映射关系
......
......@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzsn.event.entity.InfoSourceGroup;
......@@ -280,13 +281,18 @@ public class SubjectInfoSourceMapServiceImpl extends ServiceImpl<SubjectInfoSour
.eq(SubjectInfoSourceMap::getSubjectId, subjectId)
.eq(SubjectInfoSourceMap::getType, sourceType));
if (CollUtil.isNotEmpty(list)){
this.update(Wrappers.<SubjectInfoSourceMap>lambdaUpdate()
.set(ObjectUtil.isNotEmpty(infoSourceGroupPage.getIsExemptKeyword()),SubjectInfoSourceMap::getIsExemptKeyword,infoSourceGroupPage.getIsExemptKeyword())
.set(ObjectUtil.isNotEmpty(infoSourceGroupPage.getIsFreeCheck()),SubjectInfoSourceMap::getIsFreeCheck,infoSourceGroupPage.getIsFreeCheck())
.set(ObjectUtil.isNotEmpty(infoSourceGroupPage.getWeight()),SubjectInfoSourceMap::getWeight,infoSourceGroupPage.getWeight())
.eq(SubjectInfoSourceMap::getSourceId,id)
.eq(SubjectInfoSourceMap::getSubjectId,subjectId)
.eq(SubjectInfoSourceMap::getType,sourceType));
LambdaUpdateWrapper<SubjectInfoSourceMap> updateWrapper = Wrappers.<SubjectInfoSourceMap>lambdaUpdate()
.set(ObjectUtil.isNotEmpty(infoSourceGroupPage.getIsExemptKeyword()), SubjectInfoSourceMap::getIsExemptKeyword, infoSourceGroupPage.getIsExemptKeyword())
.set(ObjectUtil.isNotEmpty(infoSourceGroupPage.getIsFreeCheck()), SubjectInfoSourceMap::getIsFreeCheck, infoSourceGroupPage.getIsFreeCheck())
.eq(SubjectInfoSourceMap::getSourceId, id)
.eq(SubjectInfoSourceMap::getSubjectId, subjectId)
.eq(SubjectInfoSourceMap::getType, sourceType);
if (ObjectUtil.isNotEmpty(infoSourceGroupPage.getWeight())){
updateWrapper.set(SubjectInfoSourceMap::getWeight, infoSourceGroupPage.getWeight());
} else {
updateWrapper.set(SubjectInfoSourceMap::getWeight, null);
}
this.update(updateWrapper);
}else {
SubjectInfoSourceMap subjectInfoSourceMap = new SubjectInfoSourceMap();
subjectInfoSourceMap.setSubjectId(subjectId);
......
......@@ -154,6 +154,12 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
}
@Override
public Page<String> visiblePageList(String username,String subjectName, Integer pageNo, Integer pageSize) {
Page<String> page = new Page<>(pageNo, pageSize);
return baseMapper.visibleList(username,subjectName, page);
}
@Override
public SubjectDetailVO queryInfo(String subjectId) {
return baseMapper.queryInfo(subjectId);
}
......
......@@ -12,6 +12,7 @@ import com.zzsn.event.es.EsService;
import com.zzsn.event.service.*;
import com.zzsn.event.util.CodeGenerateUtil;
import com.zzsn.event.util.EsOpUtil;
import com.zzsn.event.util.PythonUtil;
import com.zzsn.event.vo.*;
import com.zzsn.event.vo.es.SpecialInformation;
import org.apache.commons.collections4.CollectionUtils;
......@@ -20,7 +21,6 @@ import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -70,6 +70,8 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
private EsOpUtil esOpUtil;
@Autowired
private CodeGenerateUtil codeGenerateUtil;
@Autowired
private PythonUtil pythonUtil;
//关键词默认分类
private static final String KEYWORDS_TYPE_ID = "1476498704680194050";
......@@ -403,8 +405,10 @@ public class SubjectSimpleServiceImpl implements SubjectSimpleService {
.set(Subject::getFirstOpenTime, null)
.set(Subject::getEstimateStatus, null);
subjectService.update(updateWrapper);
//todo 调用python接口
CompletableFuture.runAsync(() -> {
//调用python接口
pythonUtil.clearDuplicateHistory(subjectId);
//清空专题数据
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
boolQuery.must(QueryBuilders.termQuery("subjectId.keyword", subjectId));
esOpUtil.docDeleteByQuery(Constants.SUBJECT_INDEX, boolQuery);
......
......@@ -25,6 +25,8 @@ public class PythonUtil {
private String keywordExtractUrl;
@Value("${python.judgeDuplicateUrl:}")
private String judgeDuplicateUrl;
@Value("${python.clearDuplicateHistoryUrl:}")
private String clearDuplicateHistoryUrl;
/**
* 提取关键词
......@@ -93,4 +95,21 @@ public class PythonUtil {
}
return repeat;
}
/**
* 清空去重服务历史数据
*
* @param subjectId 专题id
* @author lkg
* @date 2025/2/10
*/
public void clearDuplicateHistory(String subjectId) {
Map<String, String> params = new HashMap<>();
params.put("subjectId", subjectId);
try {
HttpUtil.doGet(clearDuplicateHistoryUrl, params, "UTF-8");
} catch (Exception e) {
e.printStackTrace();
}
}
}
package com.zzsn.event.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
......@@ -22,6 +24,8 @@ public class KeywordsTypeVo {
/**
* 创建日期
*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
* 更新人
......@@ -30,6 +34,8 @@ public class KeywordsTypeVo {
/**
* 更新日期
*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/**
* 所属部门
......
......@@ -20,6 +20,6 @@ public class AttachmentInfo {
private String category;
private String fileSize;
private String group;
private Long pageSize;
private Integer pageSize;
private String source;
}
......@@ -112,6 +112,10 @@ public class DisplayInfo {
private List<String> riskTypes;
//标签集合
private List<LabelInfo> labelInfos;
//资讯关联的附件id
private List<String> attachmentIds;
//附件集合
private List<AttachmentInfo> attachmentInfos;
//是否为资讯(true:资讯 false:附件类)
private Boolean ynArticle = true;
//法规号
......
......@@ -50,7 +50,12 @@ spring:
password: _PSuWVQ4CLpX
driver-class-name: com.mysql.cj.jdbc.Driver
multi-datasource1:
url: jdbc:mysql://1.95.14.228:3306/clb_xxl_job?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
url: jdbc:mysql://1.95.78.131:3306/clb_xxl_job?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: ciglobal
password: qwer@9988&zzsn
driver-class-name: com.mysql.cj.jdbc.Driver
multi-datasource2:
url: jdbc:mysql://1.95.14.228:3306/clb_system?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: ciglobal
password: _PSuWVQ4CLpX
driver-class-name: com.mysql.cj.jdbc.Driver
......@@ -135,6 +140,5 @@ python:
subjectProcessorUrl: http://114.116.36.231:8085/subject/subject_processor
#判重
judgeDuplicateUrl: http://114.116.36.231:8080/subject/judg_duplicate
#热词抽取地址
hotWords:
extractUrl: http://114.116.99.6:8055/task/dispose/extractKeyword
\ No newline at end of file
#抽取关键词
keyWordsExtractUrl: http://1.95.91.200:7006/get_phrase/
\ No newline at end of file
......@@ -42,7 +42,7 @@ spring:
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource:
master:
url: jdbc:mysql://114.116.44.11:3306/clb_project?useUnicode=true&characterEncoding=utf-8&AllowPublicKeyRetrieval=True&serverTimezone=Asia/Shanghai&autoReconnect=true&rewriteBatchedStatements=true
url: jdbc:mysql://1.95.14.228:3306/clb_project?useUnicode=true&characterEncoding=utf-8&AllowPublicKeyRetrieval=True&serverTimezone=Asia/Shanghai&autoReconnect=true&rewriteBatchedStatements=true
username: ciglobal
password: _PSuWVQ4CLpX
driver-class-name: com.mysql.cj.jdbc.Driver
......@@ -51,6 +51,11 @@ spring:
username: ciglobal
password: qwer@9988&zzsn
driver-class-name: com.mysql.cj.jdbc.Driver
multi-datasource2:
url: jdbc:mysql://1.95.14.228:3306/clb_system?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: ciglobal
password: _PSuWVQ4CLpX
driver-class-name: com.mysql.cj.jdbc.Driver
elasticsearch:
uris: ["192.168.0.24:9700","192.168.0.150:9200","192.168.0.81:9700"]
username: elastic
......
......@@ -144,6 +144,8 @@ python:
judgeDuplicateUrl: http://1.95.13.40:8080/subject/judg_duplicate
#抽取关键词
keyWordsExtractUrl: http://1.95.91.200:7006/get_phrase/
#清空去重服务历史数据
clearDuplicateHistoryUrl: http://1.95.13.40:8080/subject/delete_history_data
jeecg:
shiro:
excludeUrls:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论