Merge remote-tracking branch 'origin/lixuetao' into lixuetao
This commit is contained in:
@@ -14,9 +14,9 @@ public class ReportConstants {
|
|||||||
public static final String FILE_EXTENSIONS_PDF = "pdf";
|
public static final String FILE_EXTENSIONS_PDF = "pdf";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公开报告(内部公开)
|
* 公开(内部公开)
|
||||||
*/
|
*/
|
||||||
public static final String PUBLIC_REPORT = "公开";
|
public static final String PUBLIC_REPORT = "公开(内部公开)";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 不涉及用户隐私
|
* 不涉及用户隐私
|
||||||
|
|||||||
+22
-81
@@ -382,78 +382,6 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
|
||||||
// public IPage<ReportVo> page(ReportQueryVo vo) {
|
|
||||||
// IPage<ReportEntity> page = new Page<>();
|
|
||||||
// page.setCurrent(vo.getPageNo());
|
|
||||||
// page.setSize(vo.getPageSize());
|
|
||||||
// //判断是不是管理员
|
|
||||||
// boolean admin = false;
|
|
||||||
// List<RoleEO> roleEOList = roleEODao.selectByuserId(UserUtils.getUserId());
|
|
||||||
// for (RoleEO roleEO : roleEOList) {
|
|
||||||
// if ("管理员".equals(roleEO.getName())){
|
|
||||||
// admin= !admin;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (admin) {
|
|
||||||
// vo.setUsid(null);
|
|
||||||
// } else {
|
|
||||||
// vo.setUsid(UserUtils.getUserId());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// //按照labelId筛选
|
|
||||||
// Set<String> idSet = new HashSet<>();
|
|
||||||
// if (Objects.nonNull(vo.getLabelId()) && !vo.getLabelId().isEmpty()) {
|
|
||||||
// LambdaQueryWrapper<ReportLabelEntity> reportLabelEntityWrapper = new LambdaQueryWrapper<>();
|
|
||||||
// reportLabelEntityWrapper.in(ReportLabelEntity::getLabelId, vo.getLabelId());
|
|
||||||
// List<ReportLabelEntity> reportLabelEntities = reportLabelDao.selectList(reportLabelEntityWrapper);
|
|
||||||
// reportLabelEntities.forEach(reportLabelEntity -> {
|
|
||||||
// idSet.add(reportLabelEntity.getReportId());
|
|
||||||
// });
|
|
||||||
// idSet.add("1");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// IPage<ReportVo> list = reportDao.page(page, vo,idSet);
|
|
||||||
// //获取所有报告的labelId
|
|
||||||
// list.getRecords().forEach((reportVo) -> {
|
|
||||||
// reportVo.setLabelList(findLabelList(reportVo.getId()));
|
|
||||||
// });
|
|
||||||
// list.getRecords().forEach(c -> {
|
|
||||||
// FileEntity fileEntity = Optional.ofNullable(fileDao.selectById(c.getFileId())).orElse(new FileEntity());
|
|
||||||
// if (StringUtils.isEmpty(fileEntity.getFileType())) {
|
|
||||||
// c.setFileType(null);
|
|
||||||
// }
|
|
||||||
// //ppt文件
|
|
||||||
// else if (ReportConstants.FILE_EXTENSIONS_PPT.equalsIgnoreCase(fileEntity.getFileType()) ||
|
|
||||||
// ReportConstants.FILE_EXTENSIONS_PPTX.equalsIgnoreCase(fileEntity.getFileType())) {
|
|
||||||
// c.setFileType("1");
|
|
||||||
// }
|
|
||||||
// //excel文件
|
|
||||||
// else if (ReportConstants.FILE_EXTENSIONS_XLS.equalsIgnoreCase(fileEntity.getFileType()) ||
|
|
||||||
// ReportConstants.FILE_EXTENSIONS_XLSX.equalsIgnoreCase(fileEntity.getFileType())) {
|
|
||||||
// c.setFileType("2");
|
|
||||||
// }
|
|
||||||
// //pdf文件
|
|
||||||
// else if (ReportConstants.FILE_EXTENSIONS_PDF.equalsIgnoreCase(fileEntity.getFileType())) {
|
|
||||||
// c.setFileType("3");
|
|
||||||
// }
|
|
||||||
// //word文件
|
|
||||||
// else {
|
|
||||||
// c.setFileType("4");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// //文件大小
|
|
||||||
// c.setFileSize(StringUtils.isNotEmpty(fileEntity.getFileSize())
|
|
||||||
// ? String.valueOf(Integer.parseInt(fileEntity.getFileSize()) / 1024) + "kb" : "0kb");
|
|
||||||
// c.setFileName(fileEntity.getFileName());
|
|
||||||
// List<String> userIdList = reportUserDao.selectList(
|
|
||||||
// new QueryWrapper<ReportUserEntity>().eq("reportId", c.getId()))
|
|
||||||
// .stream().map(ReportUserEntity::getUserId).collect(Collectors.toList());
|
|
||||||
// });
|
|
||||||
// return list;
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<ReportVo> page(ReportQueryVo vo) {
|
public IPage<ReportVo> page(ReportQueryVo vo) {
|
||||||
IPage<ReportEntity> page = new Page<>();
|
IPage<ReportEntity> page = new Page<>();
|
||||||
@@ -462,14 +390,16 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
|||||||
|
|
||||||
//按照labelId筛选
|
//按照labelId筛选
|
||||||
Set<String> idSet = new HashSet<>();
|
Set<String> idSet = new HashSet<>();
|
||||||
if (Objects.nonNull(vo.getLabelId()) && !vo.getLabelId().isEmpty()) {
|
if (CollectionUtils.isNotEmpty(vo.getLabelId())) {
|
||||||
LambdaQueryWrapper<ReportLabelEntity> reportLabelEntityWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ReportLabelEntity> reportLabelEntityWrapper = new LambdaQueryWrapper<>();
|
||||||
reportLabelEntityWrapper.in(ReportLabelEntity::getLabelId, vo.getLabelId());
|
reportLabelEntityWrapper.in(ReportLabelEntity::getLastLabel, vo.getLabelId());
|
||||||
List<ReportLabelEntity> reportLabelEntities = reportLabelDao.selectList(reportLabelEntityWrapper);
|
List<ReportLabelEntity> reportLabelEntities = reportLabelDao.selectList(reportLabelEntityWrapper);
|
||||||
reportLabelEntities.forEach(reportLabelEntity -> {
|
reportLabelEntities.forEach(reportLabelEntity -> {
|
||||||
idSet.add(reportLabelEntity.getReportId());
|
idSet.add(reportLabelEntity.getReportId());
|
||||||
});
|
});
|
||||||
idSet.add("1");
|
if (CollectionUtils.isEmpty(idSet)) {
|
||||||
|
idSet.add("默认搜索条件");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IPage<ReportVo> list = reportDao.page(page, vo, idSet);
|
IPage<ReportVo> list = reportDao.page(page, vo, idSet);
|
||||||
@@ -555,22 +485,33 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
|||||||
|
|
||||||
//按照labelId筛选
|
//按照labelId筛选
|
||||||
Set<String> idSet = new HashSet<>();
|
Set<String> idSet = new HashSet<>();
|
||||||
if (Objects.nonNull(vo.getLabelId()) && !vo.getLabelId().isEmpty()) {
|
if (CollectionUtils.isNotEmpty(vo.getLabelId())) {
|
||||||
LambdaQueryWrapper<ReportLabelEntity> reportLabelEntityWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ReportLabelEntity> reportLabelEntityWrapper = new LambdaQueryWrapper<>();
|
||||||
reportLabelEntityWrapper.in(ReportLabelEntity::getLabelId, vo.getLabelId());
|
reportLabelEntityWrapper.in(ReportLabelEntity::getLastLabel, vo.getLabelId());
|
||||||
List<ReportLabelEntity> reportLabelEntities = reportLabelDao.selectList(reportLabelEntityWrapper);
|
List<ReportLabelEntity> reportLabelEntities = reportLabelDao.selectList(reportLabelEntityWrapper);
|
||||||
reportLabelEntities.forEach(reportLabelEntity -> {
|
reportLabelEntities.forEach(reportLabelEntity -> {
|
||||||
idSet.add(reportLabelEntity.getReportId());
|
idSet.add(reportLabelEntity.getReportId());
|
||||||
});
|
});
|
||||||
idSet.add("1");
|
if (CollectionUtils.isEmpty(idSet)) {
|
||||||
|
idSet.add("默认搜索条件");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IPage<ReportVo> list = reportDao.reportManagerPage(page, vo, idSet);
|
IPage<ReportVo> list = reportDao.reportManagerPage(page, vo, idSet);
|
||||||
|
|
||||||
//获取所有报告的labelId
|
//设置标签路径
|
||||||
list.getRecords().forEach((reportVo) -> {
|
list.getRecords().forEach(c -> {
|
||||||
reportVo.setLabelList(findLabelList(reportVo.getId()));
|
LambdaQueryWrapper<ReportLabelEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(ReportLabelEntity::getReportId, c.getId());
|
||||||
|
List<ReportLabelEntity> reportLabelEntities = reportLabelDao.selectList(wrapper);
|
||||||
|
if (CollectionUtils.isNotEmpty(reportLabelEntities)) {
|
||||||
|
reportLabelEntities.forEach(reportLabelEntity -> {
|
||||||
|
c.setLabelList(new ArrayList<>());
|
||||||
|
c.getLabelList().add(reportLabelEntity.getLabelId());
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
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())) {
|
||||||
|
|||||||
@@ -116,7 +116,6 @@
|
|||||||
AVG( trur.user_rating ) AS reportRating
|
AVG( trur.user_rating ) AS reportRating
|
||||||
FROM
|
FROM
|
||||||
TT_REPORT_MANAGE eo
|
TT_REPORT_MANAGE eo
|
||||||
INNER JOIN ts_report_label AS trl ON eo.id = trl.report_id
|
|
||||||
LEFT JOIN ts_user tu ON tu.USID = eo.createUserId
|
LEFT JOIN ts_user tu ON tu.USID = eo.createUserId
|
||||||
LEFT JOIN tr_report_user ru ON eo.id = ru.reportId
|
LEFT JOIN tr_report_user ru ON eo.id = ru.reportId
|
||||||
LEFT JOIN power_apply pa ON pa.report_id = eo.id
|
LEFT JOIN power_apply pa ON pa.report_id = eo.id
|
||||||
@@ -171,8 +170,8 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="reportManagerPage" parameterType="com.adc.da.report.vo.ReportQueryVo" resultType="com.adc.da.report.vo.ReportVo">
|
<select id="reportManagerPage" parameterType="com.adc.da.report.vo.ReportQueryVo" resultType="com.adc.da.report.vo.ReportVo">
|
||||||
SELECT DISTINCT
|
SELECT
|
||||||
trl.report_id AS id,
|
t.id,
|
||||||
t.year,
|
t.year,
|
||||||
t.name,
|
t.name,
|
||||||
t.keycontent,
|
t.keycontent,
|
||||||
@@ -183,7 +182,6 @@
|
|||||||
t.confidentialLevel,
|
t.confidentialLevel,
|
||||||
t.privacyLevel
|
t.privacyLevel
|
||||||
FROM `tt_report_manage` AS t
|
FROM `tt_report_manage` AS t
|
||||||
INNER JOIN ts_report_label AS trl ON t.id = trl.report_id
|
|
||||||
WHERE t.del_flag = 0
|
WHERE t.del_flag = 0
|
||||||
<!--报表名称搜索-->
|
<!--报表名称搜索-->
|
||||||
<if test="Vo.name != null and Vo.name != ''">
|
<if test="Vo.name != null and Vo.name != ''">
|
||||||
|
|||||||
Reference in New Issue
Block a user