提交 222d55d4 authored 作者: 吕本才's avatar 吕本才

1、修改报表查询和报表分类查询接口

上级 3968c940
...@@ -39,6 +39,19 @@ public class JimuReportQueryController extends BaseController { ...@@ -39,6 +39,19 @@ public class JimuReportQueryController extends BaseController {
} }
/**
* 分页查询已授权可以编辑的list
* @param reportListVo
* @return
*/
@GetMapping("/edit/list")
@RequiresPermissions(value = {"report:jimuReport:editList"})
public R<PageInfo<JimuReportListDto>> selectEditList(JimuReportListVo reportListVo) {
PageInfo<JimuReportListDto> JimuReportListDtos = reportQueryService.selectList(reportListVo);
return R.ok(JimuReportListDtos);
}
/** /**
* 分页查询所有的报表接口 * 分页查询所有的报表接口
* *
......
...@@ -26,7 +26,8 @@ public class JimuReportCategoryQueryDaoImpl implements JimuReportCategoryQueryDa ...@@ -26,7 +26,8 @@ public class JimuReportCategoryQueryDaoImpl implements JimuReportCategoryQueryDa
@Override @Override
public List<JimuReportCategory> queryList(JimuReportCategory category) { public List<JimuReportCategory> queryList(JimuReportCategory category) {
Wrapper<JimuReportCategory> wq = new LambdaQueryWrapper<JimuReportCategory>() Wrapper<JimuReportCategory> wq = new LambdaQueryWrapper<JimuReportCategory>()
.eq(ObjectUtil.isNotEmpty(category.getId()), JimuReportCategory::getId, category.getId()); .eq(ObjectUtil.isNotEmpty(category.getId()), JimuReportCategory::getId, category.getId())
.eq(ObjectUtil.isNotEmpty(category.getSourceType()),JimuReportCategory::getSourceType,category.getSourceType());
List<JimuReportCategory> jimuReportCategories = jimuReportCategoryMapper.selectList(wq); List<JimuReportCategory> jimuReportCategories = jimuReportCategoryMapper.selectList(wq);
return jimuReportCategories; return jimuReportCategories;
} }
......
...@@ -6,8 +6,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -6,8 +6,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.link.report.domain.dao.JimuReportDao; import com.link.report.domain.dao.JimuReportDao;
import com.link.report.domain.entity.JimuReport; import com.link.report.domain.entity.JimuReport;
import com.link.report.domain.entity.JimuReportCategory; import com.link.report.domain.entity.JimuReportCategory;
import com.link.report.domain.entity.JimuReportShareBi;
import com.link.report.domain.mapper.JimuReportCategoryMapper; import com.link.report.domain.mapper.JimuReportCategoryMapper;
import com.link.report.domain.mapper.JimuReportMapper; import com.link.report.domain.mapper.JimuReportMapper;
import com.link.report.domain.mapper.JimuReportShareBiMapper;
import com.link.report.domain.wq.JimuReportListWq; import com.link.report.domain.wq.JimuReportListWq;
import com.link.report.pojo.response.JimuReportListDto; import com.link.report.pojo.response.JimuReportListDto;
import com.sfa.common.core.web.domain.PageInfo; import com.sfa.common.core.web.domain.PageInfo;
...@@ -32,6 +34,8 @@ public class JimuReportDaoImpl implements JimuReportDao { ...@@ -32,6 +34,8 @@ public class JimuReportDaoImpl implements JimuReportDao {
private JimuReportMapper jimuReportMapper; private JimuReportMapper jimuReportMapper;
@Autowired @Autowired
private JimuReportCategoryMapper jimuReportCategoryMapper; private JimuReportCategoryMapper jimuReportCategoryMapper;
@Autowired
private JimuReportShareBiMapper shareMapper;
/** /**
...@@ -75,7 +79,13 @@ public class JimuReportDaoImpl implements JimuReportDao { ...@@ -75,7 +79,13 @@ public class JimuReportDaoImpl implements JimuReportDao {
jimuReportListDto.setCategory(jimuReportCategory.getId()); jimuReportListDto.setCategory(jimuReportCategory.getId());
jimuReportListDto.setCategoryName(jimuReportCategory.getName()); jimuReportListDto.setCategoryName(jimuReportCategory.getName());
} }
LambdaQueryWrapper<JimuReportShareBi> eq = new LambdaQueryWrapper<JimuReportShareBi>()
.eq(JimuReportShareBi::getReportId, jimuReport.getId());
JimuReportShareBi jimuReportShareBi = shareMapper.selectOne(eq);
if(ObjectUtil.isNotEmpty(jimuReportShareBi)){
jimuReportListDto.setPreviewUrl(jimuReportShareBi.getPreviewUrl());
jimuReportListDto.setHasShare(true);
}
jimuReportListDtos.add(jimuReportListDto); jimuReportListDtos.add(jimuReportListDto);
} }
......
package com.link.report.domain.dao.impl; package com.link.report.domain.dao.impl;
import com.link.report.domain.dao.ReportShareDao; import com.link.report.domain.dao.ReportShareDao;
import com.link.report.domain.mapper.ReportShareBiMapper; import com.link.report.domain.mapper.JimuReportShareBiMapper;
import com.link.report.domain.wq.ReportShareListWq; import com.link.report.domain.wq.ReportShareListWq;
import com.link.report.pojo.response.ReportShareBiListDto; import com.link.report.pojo.response.ReportShareBiListDto;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -18,7 +18,7 @@ import java.util.List; ...@@ -18,7 +18,7 @@ import java.util.List;
@Component @Component
public class ReportShareDaoImpl implements ReportShareDao { public class ReportShareDaoImpl implements ReportShareDao {
@Autowired @Autowired
private ReportShareBiMapper reportShareMapper; private JimuReportShareBiMapper reportShareMapper;
@Override @Override
public List<ReportShareBiListDto> selectList(ReportShareListWq reportShareListWq) { public List<ReportShareBiListDto> selectList(ReportShareListWq reportShareListWq) {
// 查询数据 // 查询数据
......
...@@ -37,7 +37,7 @@ public class JimuReportCategory implements Serializable { ...@@ -37,7 +37,7 @@ public class JimuReportCategory implements Serializable {
/** /**
* 来源类型(report 积木报表 screen 大屏 drag 仪表盘) * 来源类型(report 积木报表 screen 大屏 drag 仪表盘)
*/ */
private String sourceType; private String sourceType = "report";
/** /**
* 创建人 * 创建人
......
...@@ -11,6 +11,6 @@ import java.util.List; ...@@ -11,6 +11,6 @@ import java.util.List;
@Mapper @Mapper
@Repository @Repository
public interface ReportShareBiMapper extends BaseMapper<JimuReportShareBi> { public interface JimuReportShareBiMapper extends BaseMapper<JimuReportShareBi> {
List<ReportShareBiListDto> selectShareList(ReportShareListWq reportShareListWq); List<ReportShareBiListDto> selectShareList(ReportShareListWq reportShareListWq);
} }
...@@ -11,4 +11,6 @@ import lombok.Data; ...@@ -11,4 +11,6 @@ import lombok.Data;
public class JimuReportCategoryVo { public class JimuReportCategoryVo {
private String id; private String id;
private String name; private String name;
private String sourceType;
} }
package com.link.report.pojo.response; package com.link.report.pojo.response;
import cn.hutool.core.util.ObjectUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import java.util.Date;
/** /**
* @author : lvbencai * @author : lvbencai
* @date : 2025年02月14日15:17:07 * @date : 2025年02月14日15:17:07
...@@ -17,8 +21,15 @@ public class JimuReportListDto { ...@@ -17,8 +21,15 @@ public class JimuReportListDto {
private String category; private String category;
private String categoryName; private String categoryName;
private String createBy; private String createBy;
private String createTime; @JsonFormat(pattern = "yyyy-MM-dd")
private Date createTime;
private String previewUrl;
private Boolean hasShare =false;
public Boolean getHasShare() {
if(ObjectUtil.isNotEmpty(previewUrl)){
return true;
}
return false;
}
} }
...@@ -38,7 +38,7 @@ public class JimuReportQueryServiceImpl implements JimuReportQueryService { ...@@ -38,7 +38,7 @@ public class JimuReportQueryServiceImpl implements JimuReportQueryService {
String username = SecurityUtils.getUsername(); String username = SecurityUtils.getUsername();
Long userId = SecurityUtils.getUserId(); Long userId = SecurityUtils.getUserId();
// admin能看到所有数据 // admin能看到所有数据
if(!SecurityUtils.isAdmin(userId)){ if(!SecurityUtils.isAdmin(userId)){
wq.setUserName(username); wq.setUserName(username);
} }
......
...@@ -59,13 +59,14 @@ ...@@ -59,13 +59,14 @@
</select> </select>
<select id="selectJimuReportList" resultType="com.link.report.pojo.response.JimuReportListDto"> <select id="selectJimuReportList" resultType="com.link.report.pojo.response.JimuReportListDto">
select distinct id, name ,code, category , categoryName, createBy,createTime select distinct id, name ,code, category , categoryName, createBy,createTime,previewUrl
from ( from (
select jr.id, jr.name ,jr.code, select jr.id, jr.name ,jr.code,
jr.type as category ,jrc.name as categoryName, jr.type as category ,jrc.name as categoryName,
jr.create_by as createBy,jr.create_time as createTime jr.create_by as createBy,jr.create_time as createTime,jrsh.preview_url as previewUrl
from jimu_report jr from jimu_report jr
left join jimu_report_share jrsh on jr.id = jrsh.report_id
left join jimu_report_category jrc on jr.type = jrc.id left join jimu_report_category jrc on jr.type = jrc.id
<where> <where>
jr.del_flag =0 jr.del_flag =0
...@@ -92,8 +93,9 @@ ...@@ -92,8 +93,9 @@
union union
select jr.id, jr.name ,jr.code, select jr.id, jr.name ,jr.code,
jr.type as category ,jrc.name as categoryName, jr.type as category ,jrc.name as categoryName,
jr.create_by as createBy,jr.create_time as createTime jr.create_by as createBy,jr.create_time as createTime,jrsh.preview_url as previewUrl
from jimu_report jr from jimu_report jr
left join jimu_report_share jrsh on jr.id = jrsh.report_id
left join jimu_report_category jrc on jr.type = jrc.id left join jimu_report_category jrc on jr.type = jrc.id
inner join jimu_report_auth jra on jr.id = jra.report_id inner join jimu_report_auth jra on jr.id = jra.report_id
<where> <where>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.link.report.domain.mapper.ReportShareBiMapper"> <mapper namespace="com.link.report.domain.mapper.JimuReportShareBiMapper">
<!-- 定义 ResultMap,将数据库表字段映射到 Java 对象属性 --> <!-- 定义 ResultMap,将数据库表字段映射到 Java 对象属性 -->
<resultMap id="ReportShareResultMap" type="com.link.report.domain.entity.JimuReportShareBi"> <resultMap id="ReportShareResultMap" type="com.link.report.domain.entity.JimuReportShareBi">
<id property="id" column="id"/> <id property="id" column="id"/>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论