提交 23ecd299 作者: obcy

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

......@@ -39,7 +39,7 @@ public class LoginInterceptor implements HandlerInterceptor {
String userInfo = URLDecoder.decode(request.getHeader(LOGIN_USER_HEADER), StandardCharsets.UTF_8);
log.debug("当前登录用户信息:{}", userInfo);
if (StringUtils.isBlank(userInfo)) {
returnJson(response, JSON.toJSONString(Result.FAIL(401, "用户未登录")));
returnJson(response, JSON.toJSONString(Result.FAIL(401, "Token失效,请重新登录")));
return false;
}
UserVo userVo = JSON.parseObject(userInfo, UserVo.class);
......
......@@ -11,6 +11,9 @@ import java.util.List;
@Data
public class SearchCondition {
//资讯id集合,和下面所有查询条件互斥
private List<String> ids;
//专题id
@FieldDescription(value = "专题id")
private String subjectId;
......
......@@ -1855,20 +1855,20 @@ public class EsService {
* 专题信息数量统计
*
* @param subjectIds 专题id集合
* @param checkStatus 审核状态
* @param auditStatus 审核状态
* @param type 是否多层聚合(先按专题,再按发布时间)
* @author lkg
* @date 2025/3/25
*/
public List<StatisticVO> subjectStatisticInfo(List<String> subjectIds, Integer checkStatus, Integer type) {
public List<StatisticVO> subjectStatisticInfo(List<String> subjectIds, Integer auditStatus, Integer type) {
List<StatisticVO> list = new ArrayList<>();
SearchRequest searchRequest = new SearchRequest(Constants.SUBJECT_INDEX);
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
searchSourceBuilder.trackTotalHits(true);
searchSourceBuilder.size(0);
InfoDataSearchCondition searchCondition = new InfoDataSearchCondition();
if (checkStatus != null) {
searchCondition.setCheckStatus(checkStatus);
if (auditStatus != null) {
searchCondition.setAuditStatus(auditStatus);
}
BoolQueryBuilder boolQuery = buildQuery(searchCondition, subjectIds);
searchSourceBuilder.query(boolQuery);
......
......@@ -108,4 +108,13 @@ public interface CommonMapper {
List<SysDict> selectOldLabelTypeList();
List<SysDict> selectLeaderTypeList();
/**
* 获取报告资讯的(基础)筛选条件
*
* @param reportId 报告id
* @author lkg
* @date 2025/5/12
*/
ReportConditionVO getReportCondition(@Param("reportId") String reportId);
}
......@@ -256,4 +256,11 @@
select id,if(pid='0','2',pid) parentId,type_name dictName,has_child hasChild,if(has_child=0,'1',null) isDict
from character_category_structure where category = 2
</select>
<select id="getReportCondition" resultType="com.zzsn.event.vo.ReportConditionVO">
select r.start_time,r.end_time,t.data_base_condition from clb_report r
inner join clb_report_task t on r.task_id = t.id
where r.id = #{reportId}
</select>
</mapper>
package com.zzsn.event.service;
import com.alibaba.fastjson2.JSONObject;
import com.zzsn.event.entity.ClbLabelItem;
import com.zzsn.event.feign.entity.SysDict;
import com.zzsn.event.util.tree.Node;
import com.zzsn.event.vo.*;
......@@ -121,4 +120,14 @@ public interface CommonService {
List<SysDict> selectOldLabelTypeList();
List<SysDict> selectLeaderTypeList();
/**
* 获取报告资讯的(基础)筛选条件
*
* @param reportId 报告id
* @author lkg
* @date 2025/5/12
*/
ReportConditionVO getReportCondition(String reportId);
}
......@@ -373,6 +373,11 @@ public class CommonServiceImpl implements CommonService {
return commonMapper.selectLeaderTypeList();
}
@Override
public ReportConditionVO getReportCondition(String reportId) {
return commonMapper.getReportCondition(reportId);
}
//获取树状结构
private List<ModelVO> getTreeList(List<ModelVO> authTypeList){
List<ModelVO> topList = new ArrayList<>();
......
......@@ -127,6 +127,24 @@ public class InformationServiceImpl implements InformationService {
if (CollectionUtils.isEmpty(subjectIdList)) {
return page;
}
String reportId = searchCondition.getReportId();
if (StringUtils.isNotEmpty(reportId)) {
ReportConditionVO reportCondition = commonService.getReportCondition(reportId);
String dataBaseCondition = reportCondition.getDataBaseCondition();
if (StringUtils.isNotEmpty(dataBaseCondition)) {
dataBaseCondition = "{}";
}
JSONObject reportBaseCondition = JSONObject.parseObject(dataBaseCondition);
reportBaseCondition.put("startTime", reportCondition.getStartTime());
reportBaseCondition.put("endTime", reportCondition.getEndTime());
JSONObject searchConditionJsonObject = ObjectUtil.objectToJSONObject(searchCondition);
reportBaseCondition.forEach((key, value) -> {
if (!searchConditionJsonObject.containsKey(key)) {
searchConditionJsonObject.put(key, value);
}
});
searchCondition = JSONObject.parseObject(JSONObject.toJSONString(searchConditionJsonObject), InfoDataSearchCondition.class);
}
try {
IPage<SpecialInformation> specialInformationIPage = esService.pageListByCondition(searchCondition, subjectIdList);
long total = specialInformationIPage.getTotal();
......
......@@ -209,7 +209,7 @@ public class SubjectServiceImpl extends ServiceImpl<SubjectMapper, Subject> impl
List<StatisticVO> totalAndLatestDateList = esService.subjectStatisticInfo(subjectIds, null, 1);
Map<String,StatisticVO> totalAndLatestDateMap = totalAndLatestDateList.stream().collect(Collectors.toMap(StatisticVO::getSubjectId, e -> e));
//专题统计信息-待审核数量
List<StatisticVO> unCheckNumList = esService.subjectStatisticInfo(subjectIds, 0, null);
List<StatisticVO> unCheckNumList = esService.subjectStatisticInfo(subjectIds, 2, null);
Map<String, StatisticVO> unCheckNumMap = unCheckNumList.stream().collect(Collectors.toMap(StatisticVO::getSubjectId, e->e));
//绑定全部信息源的专题
......
......@@ -64,7 +64,7 @@ public class InfoDataSearchCondition {
//审核操作(0:未审核 1:审核通过 2:审核未通过 3:暂定 默认值为0)
private Integer checkStatus;
//删除标记(1:删除;0:未删除)
private Integer deleteFlag;
private Integer deleteFlag = 0;
//是否免审核(1-是;0-否)
private Integer isFreeCheck;
......@@ -110,6 +110,10 @@ public class InfoDataSearchCondition {
private String superQueryParams;
/*------高级查询条件---end-------------------*/
//报告id (报告任务场景,根据报告id获取资讯的查询条件)
private String reportId;
//数据集id,保存数据集时使用-研究中心
private String dataSetId;
......
package com.zzsn.event.vo;
import lombok.Data;
/**
* 报告资讯条件
*
* @author lkg
* @date 2025/5/12
*/
@Data
public class ReportConditionVO {
private String startTime;
private String endTime;
private String dataBaseCondition;
}
......@@ -19,6 +19,8 @@ public class SubjectPageVO {
/**专题id*/
private String id;
/**专题编码*/
private String subjectCode;
/**专题名称*/
private String subjectName;
/**状态(1-启用;0-禁用)*/
......@@ -41,6 +43,8 @@ public class SubjectPageVO {
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
private Date latestDataDate;
/**预估状态*/
private String estimateStatus;
/**主题绑定流程信息*/
private List<ClbModelArrange> clbModelArranges;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论