feat:预览-文件列表
This commit is contained in:
@@ -23,6 +23,15 @@ public class ReportConstants {
|
|||||||
*/
|
*/
|
||||||
public static final String NO_USER_PRIVACY_INVOLVED = "不涉及用户隐私";
|
public static final String NO_USER_PRIVACY_INVOLVED = "不涉及用户隐私";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程中
|
||||||
|
*/
|
||||||
|
public static final Integer IN_PROCESS = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 不在流程中
|
||||||
|
*/
|
||||||
|
public static final Integer NOT_IN_PROCESS = 2;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,28 @@
|
|||||||
package com.adc.da.report.eo;
|
package com.adc.da.report.eo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@TableName("ts_report_file")
|
||||||
|
@Accessors(chain = true)
|
||||||
public class ReportFile {
|
public class ReportFile {
|
||||||
|
|
||||||
|
@TableId(value = "id",type = IdType.INPUT)
|
||||||
|
private String id;
|
||||||
|
|
||||||
@TableField("report_id")
|
@TableField("report_id")
|
||||||
private String reportId;
|
private String reportId;
|
||||||
|
|
||||||
@TableField("file_id")
|
@TableField("file_id")
|
||||||
private String fileId;
|
private String fileId;
|
||||||
|
|
||||||
|
@TableField("state")
|
||||||
|
private String state;
|
||||||
}
|
}
|
||||||
|
|||||||
+79
-62
@@ -6,14 +6,12 @@ import com.adc.da.login.util.UserUtils;
|
|||||||
import com.adc.da.report.constant.ReportConstants;
|
import com.adc.da.report.constant.ReportConstants;
|
||||||
import com.adc.da.report.dao.mysql.FileDao;
|
import com.adc.da.report.dao.mysql.FileDao;
|
||||||
import com.adc.da.report.dao.mysql.ReportDao;
|
import com.adc.da.report.dao.mysql.ReportDao;
|
||||||
|
import com.adc.da.report.dao.mysql.ReportFileDao;
|
||||||
import com.adc.da.report.dao.mysql.ReportLabelDao;
|
import com.adc.da.report.dao.mysql.ReportLabelDao;
|
||||||
import com.adc.da.report.eo.*;
|
import com.adc.da.report.eo.*;
|
||||||
import com.adc.da.report.service.*;
|
import com.adc.da.report.service.*;
|
||||||
import com.adc.da.report.util.*;
|
import com.adc.da.report.util.*;
|
||||||
import com.adc.da.report.vo.ChangeUploaderVo;
|
import com.adc.da.report.vo.*;
|
||||||
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.dao.mysql.RoleEODao;
|
||||||
import com.adc.da.sys.dao.mysql.UserEODao;
|
import com.adc.da.sys.dao.mysql.UserEODao;
|
||||||
import com.adc.da.sys.entity.MenuEO;
|
import com.adc.da.sys.entity.MenuEO;
|
||||||
@@ -22,6 +20,7 @@ import com.adc.da.sys.entity.RoleEO;
|
|||||||
import com.adc.da.sys.entity.UserEO;
|
import com.adc.da.sys.entity.UserEO;
|
||||||
import com.adc.da.sys.service.MenuEOService;
|
import com.adc.da.sys.service.MenuEOService;
|
||||||
import com.adc.da.sys.service.OrgEOService;
|
import com.adc.da.sys.service.OrgEOService;
|
||||||
|
import com.adc.da.sys.util.BeanCopyUtils;
|
||||||
import com.adc.da.util.http.ResponseMessage;
|
import com.adc.da.util.http.ResponseMessage;
|
||||||
import com.adc.da.util.http.Result;
|
import com.adc.da.util.http.Result;
|
||||||
import com.adc.da.util.utils.CollectionUtils;
|
import com.adc.da.util.utils.CollectionUtils;
|
||||||
@@ -128,6 +127,9 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
|||||||
@Resource
|
@Resource
|
||||||
private MenuEOService menuEOService;
|
private MenuEOService menuEOService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ReportFileDao reportFileDao;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addOrUpdate(ReportEntity reportEntity) {
|
public void addOrUpdate(ReportEntity reportEntity) {
|
||||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
@@ -529,38 +531,38 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
list.getRecords().forEach(c -> {
|
// list.getRecords().forEach(c -> {
|
||||||
FileEntity fileEntity = Optional.ofNullable(fileDao.selectById(c.getFileId())).orElse(new FileEntity());
|
// FileEntity fileEntity = Optional.ofNullable(fileDao.selectById(c.getFileId())).orElse(new FileEntity());
|
||||||
if (StringUtils.isEmpty(fileEntity.getFileType())) {
|
// if (StringUtils.isEmpty(fileEntity.getFileType())) {
|
||||||
c.setFileType(null);
|
// c.setFileType(null);
|
||||||
}
|
// }
|
||||||
//ppt文件
|
// //ppt文件
|
||||||
else if (ReportConstants.FILE_EXTENSIONS_PPT.equalsIgnoreCase(fileEntity.getFileType()) ||
|
// else if (ReportConstants.FILE_EXTENSIONS_PPT.equalsIgnoreCase(fileEntity.getFileType()) ||
|
||||||
ReportConstants.FILE_EXTENSIONS_PPTX.equalsIgnoreCase(fileEntity.getFileType())) {
|
// ReportConstants.FILE_EXTENSIONS_PPTX.equalsIgnoreCase(fileEntity.getFileType())) {
|
||||||
c.setFileType("1");
|
// c.setFileType("1");
|
||||||
}
|
// }
|
||||||
//excel文件
|
// //excel文件
|
||||||
else if (ReportConstants.FILE_EXTENSIONS_XLS.equalsIgnoreCase(fileEntity.getFileType()) ||
|
// else if (ReportConstants.FILE_EXTENSIONS_XLS.equalsIgnoreCase(fileEntity.getFileType()) ||
|
||||||
ReportConstants.FILE_EXTENSIONS_XLSX.equalsIgnoreCase(fileEntity.getFileType())) {
|
// ReportConstants.FILE_EXTENSIONS_XLSX.equalsIgnoreCase(fileEntity.getFileType())) {
|
||||||
c.setFileType("2");
|
// c.setFileType("2");
|
||||||
}
|
// }
|
||||||
//pdf文件
|
// //pdf文件
|
||||||
else if (ReportConstants.FILE_EXTENSIONS_PDF.equalsIgnoreCase(fileEntity.getFileType())) {
|
// else if (ReportConstants.FILE_EXTENSIONS_PDF.equalsIgnoreCase(fileEntity.getFileType())) {
|
||||||
c.setFileType("3");
|
// c.setFileType("3");
|
||||||
}
|
// }
|
||||||
//word文件
|
// //word文件
|
||||||
else {
|
// else {
|
||||||
c.setFileType("4");
|
// c.setFileType("4");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
//文件大小
|
// //文件大小
|
||||||
c.setFileSize(StringUtils.isNotEmpty(fileEntity.getFileSize())
|
// c.setFileSize(StringUtils.isNotEmpty(fileEntity.getFileSize())
|
||||||
? String.valueOf(Integer.parseInt(fileEntity.getFileSize()) / 1024) + "kb" : "0kb");
|
// ? String.valueOf(Integer.parseInt(fileEntity.getFileSize()) / 1024) + "kb" : "0kb");
|
||||||
c.setFileName(fileEntity.getFileName());
|
// c.setFileName(fileEntity.getFileName());
|
||||||
// List<String> userIdList = reportUserDao.selectList(
|
// List<String> userIdList = reportUserDao.selectList(
|
||||||
// new QueryWrapper<ReportUserEntity>().eq("reportId", c.getId()))
|
// new QueryWrapper<ReportUserEntity>().eq("reportId", c.getId()))
|
||||||
// .stream().map(ReportUserEntity::getUserId).collect(Collectors.toList());
|
// .stream().map(ReportUserEntity::getUserId).collect(Collectors.toList());
|
||||||
});
|
// });
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -612,38 +614,38 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
list.getRecords().forEach(c -> {
|
// list.getRecords().forEach(c -> {
|
||||||
FileEntity fileEntity = Optional.ofNullable(fileDao.selectById(c.getFileId())).orElse(new FileEntity());
|
// FileEntity fileEntity = Optional.ofNullable(fileDao.selectById(c.getFileId())).orElse(new FileEntity());
|
||||||
if (StringUtils.isEmpty(fileEntity.getFileType())) {
|
// if (StringUtils.isEmpty(fileEntity.getFileType())) {
|
||||||
c.setFileType(null);
|
// c.setFileType(null);
|
||||||
}
|
// }
|
||||||
//ppt文件
|
// //ppt文件
|
||||||
else if (ReportConstants.FILE_EXTENSIONS_PPT.equalsIgnoreCase(fileEntity.getFileType()) ||
|
// else if (ReportConstants.FILE_EXTENSIONS_PPT.equalsIgnoreCase(fileEntity.getFileType()) ||
|
||||||
ReportConstants.FILE_EXTENSIONS_PPTX.equalsIgnoreCase(fileEntity.getFileType())) {
|
// ReportConstants.FILE_EXTENSIONS_PPTX.equalsIgnoreCase(fileEntity.getFileType())) {
|
||||||
c.setFileType("1");
|
// c.setFileType("1");
|
||||||
}
|
// }
|
||||||
//excel文件
|
// //excel文件
|
||||||
else if (ReportConstants.FILE_EXTENSIONS_XLS.equalsIgnoreCase(fileEntity.getFileType()) ||
|
// else if (ReportConstants.FILE_EXTENSIONS_XLS.equalsIgnoreCase(fileEntity.getFileType()) ||
|
||||||
ReportConstants.FILE_EXTENSIONS_XLSX.equalsIgnoreCase(fileEntity.getFileType())) {
|
// ReportConstants.FILE_EXTENSIONS_XLSX.equalsIgnoreCase(fileEntity.getFileType())) {
|
||||||
c.setFileType("2");
|
// c.setFileType("2");
|
||||||
}
|
// }
|
||||||
//pdf文件
|
// //pdf文件
|
||||||
else if (ReportConstants.FILE_EXTENSIONS_PDF.equalsIgnoreCase(fileEntity.getFileType())) {
|
// else if (ReportConstants.FILE_EXTENSIONS_PDF.equalsIgnoreCase(fileEntity.getFileType())) {
|
||||||
c.setFileType("3");
|
// c.setFileType("3");
|
||||||
}
|
// }
|
||||||
//word文件
|
// //word文件
|
||||||
else {
|
// else {
|
||||||
c.setFileType("4");
|
// c.setFileType("4");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
//文件大小
|
// //文件大小
|
||||||
c.setFileSize(StringUtils.isNotEmpty(fileEntity.getFileSize())
|
// c.setFileSize(StringUtils.isNotEmpty(fileEntity.getFileSize())
|
||||||
? String.valueOf(Integer.parseInt(fileEntity.getFileSize()) / 1024) + "kb" : "0kb");
|
// ? String.valueOf(Integer.parseInt(fileEntity.getFileSize()) / 1024) + "kb" : "0kb");
|
||||||
c.setFileName(fileEntity.getFileName());
|
// c.setFileName(fileEntity.getFileName());
|
||||||
// List<String> userIdList = reportUserDao.selectList(
|
// List<String> userIdList = reportUserDao.selectList(
|
||||||
// new QueryWrapper<ReportUserEntity>().eq("reportId", c.getId()))
|
// new QueryWrapper<ReportUserEntity>().eq("reportId", c.getId()))
|
||||||
// .stream().map(ReportUserEntity::getUserId).collect(Collectors.toList());
|
// .stream().map(ReportUserEntity::getUserId).collect(Collectors.toList());
|
||||||
});
|
// });
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -716,6 +718,21 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
|||||||
@Override
|
@Override
|
||||||
public ResponseMessage reportDetail(String reportId) {
|
public ResponseMessage reportDetail(String reportId) {
|
||||||
ReportDetailVo reportDetailVo = reportDao.reportDetail(reportId);
|
ReportDetailVo reportDetailVo = reportDao.reportDetail(reportId);
|
||||||
|
//设置文件信息
|
||||||
|
LambdaQueryWrapper<ReportFile> reportFileLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
reportFileLambdaQueryWrapper.eq(ReportFile::getReportId, reportDetailVo.getId());
|
||||||
|
reportFileLambdaQueryWrapper.eq(ReportFile::getState, ReportConstants.NOT_IN_PROCESS);
|
||||||
|
List<ReportFile> reportFiles = reportFileDao.selectList(reportFileLambdaQueryWrapper);
|
||||||
|
List<String> fileIds = new ArrayList<>();
|
||||||
|
if (reportFiles != null) {
|
||||||
|
fileIds = reportFiles.stream().map(ReportFile::getFileId).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isNotEmpty(fileIds)) {
|
||||||
|
List<FileEntity> fileEntities = fileDao.selectBatchIds(fileIds);
|
||||||
|
List<FileVo> fileVos = BeanCopyUtils.copyBeanList(fileEntities, FileVo.class);
|
||||||
|
reportDetailVo.setFileList(fileVos);
|
||||||
|
}
|
||||||
|
|
||||||
//设置部门名称
|
//设置部门名称
|
||||||
String department = reportDetailVo.getDepartment();
|
String department = reportDetailVo.getDepartment();
|
||||||
if (StrUtil.isNotBlank(department)) {
|
if (StrUtil.isNotBlank(department)) {
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.adc.da.report.vo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class FileVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件主键id
|
||||||
|
*/
|
||||||
|
private String fileId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件名
|
||||||
|
*/
|
||||||
|
private String fileName;
|
||||||
|
}
|
||||||
@@ -44,6 +44,7 @@ public class ReportDetailVo {
|
|||||||
*/
|
*/
|
||||||
private String departmentId;
|
private String departmentId;
|
||||||
|
|
||||||
|
|
||||||
private String department;
|
private String department;
|
||||||
/**
|
/**
|
||||||
* 部门
|
* 部门
|
||||||
@@ -65,13 +66,6 @@ public class ReportDetailVo {
|
|||||||
*/
|
*/
|
||||||
private String privacyLevel;
|
private String privacyLevel;
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件id
|
|
||||||
*/
|
|
||||||
private String fileId;
|
|
||||||
|
|
||||||
private String fileName;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建人id
|
* 创建人id
|
||||||
*/
|
*/
|
||||||
@@ -111,4 +105,9 @@ public class ReportDetailVo {
|
|||||||
* 保密到期日期
|
* 保密到期日期
|
||||||
*/
|
*/
|
||||||
private Date secrecyLast;
|
private Date secrecyLast;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件列表
|
||||||
|
*/
|
||||||
|
private List<FileVo> fileList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,6 @@
|
|||||||
eo.maincontent AS mainContent,
|
eo.maincontent AS mainContent,
|
||||||
eo.DEPARTMENT AS department,
|
eo.DEPARTMENT AS department,
|
||||||
eo.`YEAR` AS `year`,
|
eo.`YEAR` AS `year`,
|
||||||
eo.fileid AS fileId,
|
|
||||||
eo.confidentialLevel AS confidentialLevel,
|
eo.confidentialLevel AS confidentialLevel,
|
||||||
eo.privacyLevel AS privacyLevel,
|
eo.privacyLevel AS privacyLevel,
|
||||||
eo.createUserId AS createUserId,
|
eo.createUserId AS createUserId,
|
||||||
@@ -284,15 +283,12 @@
|
|||||||
rm.maincontent AS maincontent,
|
rm.maincontent AS maincontent,
|
||||||
rm.department AS department,
|
rm.department AS department,
|
||||||
rm.`year` AS `year`,
|
rm.`year` AS `year`,
|
||||||
rm.fileId AS fileId,
|
|
||||||
f.file_name as fileName,
|
|
||||||
rm.confidentialLevel AS confidentialLevel,
|
rm.confidentialLevel AS confidentialLevel,
|
||||||
rm.privacyLevel AS privacyLevel,
|
rm.privacyLevel AS privacyLevel,
|
||||||
rm.secrecy_last AS secrecyLast
|
rm.secrecy_last AS secrecyLast
|
||||||
FROM `tt_report_manage` AS rm
|
FROM `tt_report_manage` AS rm
|
||||||
LEFT JOIN ts_user AS u ON u.USID = rm.createUserId
|
LEFT JOIN ts_user AS u ON u.USID = rm.createUserId
|
||||||
LEFT JOIN ts_org as org on org.id = rm.department
|
LEFT JOIN ts_org as org on org.id = rm.department
|
||||||
LEFT JOIN ts_file as f on rm.fileId=f.file_id
|
|
||||||
WHERE rm.id = #{reportId}
|
WHERE rm.id = #{reportId}
|
||||||
AND rm.del_flag = 0
|
AND rm.del_flag = 0
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user