feat:报告详情接口
This commit is contained in:
@@ -113,6 +113,17 @@ public class ReportManageConroller {
|
||||
return Result.success(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 报告详情接口
|
||||
* @param reportId
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("报告详情接口")
|
||||
@GetMapping("/detail/{reportId}")
|
||||
public ResponseMessage reportDetail(@PathVariable String reportId) {
|
||||
return reportService.reportDetail(reportId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 报告管理列表
|
||||
* @param vo
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.adc.da.report.dao.mysql;
|
||||
|
||||
import com.adc.da.report.eo.ReportEntity;
|
||||
import com.adc.da.report.eo.TtReportManageAct;
|
||||
import com.adc.da.report.vo.ReportDetailVo;
|
||||
import com.adc.da.report.vo.ReportQueryVo;
|
||||
import com.adc.da.report.vo.ReportVo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
@@ -62,4 +63,6 @@ public interface ReportDao extends BaseMapper<ReportEntity> {
|
||||
long selectByidAndName(@Param("Vo")ReportEntity entity);
|
||||
|
||||
void saveReportAct(@Param("Vo") TtReportManageAct ttReportManageAct);
|
||||
|
||||
ReportDetailVo reportDetail(@Param("reportId") String reportId);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.adc.da.report.service;
|
||||
import com.adc.da.report.eo.ReportEntity;
|
||||
import com.adc.da.report.vo.ReportQueryVo;
|
||||
import com.adc.da.report.vo.ReportVo;
|
||||
import com.adc.da.util.http.ResponseMessage;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -59,4 +60,12 @@ public interface IReportService {
|
||||
* @return
|
||||
*/
|
||||
boolean isReportValid(String reportId);
|
||||
|
||||
/**
|
||||
* 报告详情页
|
||||
*
|
||||
* @param reportId
|
||||
* @return
|
||||
*/
|
||||
ResponseMessage reportDetail(String reportId);
|
||||
}
|
||||
|
||||
@@ -10,10 +10,13 @@ import com.adc.da.report.dao.mysql.ReportUserDao;
|
||||
import com.adc.da.report.eo.*;
|
||||
import com.adc.da.report.service.*;
|
||||
import com.adc.da.report.util.*;
|
||||
import com.adc.da.report.vo.ReportDetailVo;
|
||||
import com.adc.da.report.vo.ReportQueryVo;
|
||||
import com.adc.da.report.vo.ReportVo;
|
||||
import com.adc.da.sys.dao.mysql.RoleEODao;
|
||||
import com.adc.da.sys.entity.RoleEO;
|
||||
import com.adc.da.util.http.ResponseMessage;
|
||||
import com.adc.da.util.http.Result;
|
||||
import com.adc.da.util.utils.CollectionUtils;
|
||||
import com.adc.da.util.utils.FileUtil;
|
||||
import com.adc.da.util.utils.StringUtils;
|
||||
@@ -22,6 +25,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.api.R;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -532,6 +536,29 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
||||
return report != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseMessage reportDetail(String reportId) {
|
||||
ReportDetailVo reportDetailVo = reportDao.reportDetail(reportId);
|
||||
//设置标签列表
|
||||
LambdaQueryWrapper<ReportLabelEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ReportLabelEntity::getReportId, reportId);
|
||||
List<ReportLabelEntity> reportLabelEntities = reportLabelDao.selectList(wrapper);
|
||||
if (CollectionUtils.isNotEmpty(reportLabelEntities)) {
|
||||
List<String> reportLabelIds = reportLabelEntities.stream().map(ReportLabelEntity::getLabelId).collect(Collectors.toList());
|
||||
reportDetailVo.setLabelIds(reportLabelIds);
|
||||
List<TreeLabelEntity> labelEntities = iTreeLabelService.query().in("id", reportLabelIds).list();
|
||||
List<String> labels = labelEntities.stream().map(TreeLabelEntity::getLabel).collect(Collectors.toList());
|
||||
reportDetailVo.setLabelList(labels);
|
||||
}
|
||||
//设置当前用户受否有下载权限
|
||||
if (reportDetailVo.getCreateUserId().equals(UserUtils.getUserId())) {
|
||||
reportDetailVo.setDownPower(1);
|
||||
} else {
|
||||
//TODO 写对应的查询权限逻辑
|
||||
}
|
||||
return Result.success(reportDetailVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建htmlstring
|
||||
*
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.adc.da.report.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: CaiHaohan
|
||||
* @Date: 2023/5/8 16:41
|
||||
* @Description:
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class ReportDetailVo {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 报告名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
private String keyContent;
|
||||
|
||||
/**
|
||||
* 内容摘要
|
||||
*/
|
||||
private String mainContent;
|
||||
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
private String departmentId;
|
||||
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
private String departmentName;
|
||||
|
||||
/**
|
||||
* 年
|
||||
*/
|
||||
private String year;
|
||||
|
||||
/**
|
||||
* 报告涉密等级
|
||||
*/
|
||||
private String confidentialLevel;
|
||||
|
||||
/**
|
||||
* 隐私等级
|
||||
*/
|
||||
private String privacyLevel;
|
||||
|
||||
/**
|
||||
* 文件id
|
||||
*/
|
||||
private String fileId;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
private String createUserId;
|
||||
|
||||
/**
|
||||
* 上传人姓名
|
||||
*/
|
||||
private String uploaderName;
|
||||
|
||||
/**
|
||||
* 标签列表id
|
||||
*/
|
||||
private List<String> labelIds;
|
||||
|
||||
/**
|
||||
* 标签列表名
|
||||
*/
|
||||
private List<String> labelList;
|
||||
|
||||
/**
|
||||
* 下载权限(0没有1有)
|
||||
*/
|
||||
private Integer downPower;
|
||||
}
|
||||
@@ -224,4 +224,22 @@
|
||||
</select>
|
||||
|
||||
|
||||
<select id="reportDetail" resultType="com.adc.da.report.vo.ReportDetailVo">
|
||||
SELECT
|
||||
rm.id AS id,
|
||||
rm.name AS `name`,
|
||||
rm.createUserId AS createUserId,
|
||||
u.USNAME AS uploaderName,
|
||||
rm.keycontent AS keycontent,
|
||||
rm.maincontent AS maincontent,
|
||||
rm.department AS departmentName,
|
||||
rm.`year` AS `year`,
|
||||
rm.fileId AS fileId,
|
||||
rm.confidentialLevel AS confidentialLevel,
|
||||
rm.privacyLevel AS privacyLevel
|
||||
FROM `tt_report_manage` AS rm
|
||||
INNER JOIN ts_user AS u ON u.USID = rm.createUserId
|
||||
WHERE rm.id = #{reportId}
|
||||
AND rm.del_flag = 0
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user