fix: 修复报关管理列表不显示问题

This commit is contained in:
2023-04-28 11:56:26 +08:00
parent 34195e6460
commit 35e28dbbb2
3 changed files with 66 additions and 50 deletions
@@ -24,18 +24,35 @@ public interface ReportDao extends BaseMapper<ReportEntity> {
* @param idSet
* @return
*/
IPage<ReportVo> list(IPage page, @Param("Vo") ReportQueryVo vo, @Param("idSet") Set<String> idSet);
IPage<ReportVo> list(IPage<ReportEntity> page, @Param("Vo") ReportQueryVo vo, @Param("idSet") Set<String> idSet);
/**
* 报告日期列表
*
* @param usid
* @return
*/
List<String> getReportDateList(@Param("usid")String usid);
List<String> getReportDateList(@Param("usid") String usid);
IPage<ReportVo> getAddReportPage(IPage<ReportEntity> page, @Param("pageVO") ReportQueryVo vo);
IPage<ReportVo> page(IPage<ReportEntity> page,@Param("pageVO") ReportQueryVo vo,@Param("idSet")Set<String> idSet);
/**
* 报告列表
*
* @param page
* @param vo
* @param idSet
* @return
*/
IPage<ReportVo> page(IPage<ReportEntity> page, @Param("pageVO") ReportQueryVo vo, @Param("idSet") Set<String> idSet);
IPage<ReportVo> reportManagerPage(IPage<ReportEntity> page,@Param("pageVO") ReportQueryVo vo,@Param("idSet")Set<String> idSet);
/**
* 报告列表
*
* @param page
* @param vo
* @param idSet
* @return
*/
IPage<ReportVo> reportManagerPage(IPage<ReportEntity> page, @Param("Vo") ReportQueryVo vo, @Param("idSet") Set<String> idSet);
}
@@ -225,7 +225,9 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
Set<String> idSet = new HashSet<>();
if (Objects.nonNull(vo.getLabelId()) && !vo.getLabelId().isEmpty()) {
LambdaQueryWrapper<ReportLabelEntity> reportLabelEntityWrapper = new LambdaQueryWrapper<>();
//获取标签路径中最后一个标签
reportLabelEntityWrapper.eq(ReportLabelEntity::getLabelId, vo.getLabelId().get(vo.getLabelId().size() - 1));
//根据最后一个标签查询报表
List<ReportLabelEntity> reportLabelEntities = reportLabelDao.selectList(reportLabelEntityWrapper);
reportLabelEntities.forEach(reportLabelEntity -> {
idSet.add(reportLabelEntity.getReportId());
@@ -489,11 +491,10 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
reportLabelEntities.forEach(reportLabelEntity -> {
idSet.add(reportLabelEntity.getReportId());
});
idSet.add("1");
}
IPage<ReportVo> list = reportDao.reportManagerPage(page, vo, idSet);
IPage<ReportVo> list = reportDao.reportManagerPage(page, vo,idSet);
//获取所有报告的labelId
list.getRecords().forEach((reportVo) -> {
reportVo.setLabelList(findLabelList(reportVo.getId()));
@@ -3,7 +3,7 @@
<mapper namespace="com.adc.da.report.dao.mysql.ReportDao">
<select id="list" parameterType="com.adc.da.report.vo.ReportQueryVo" resultType="com.adc.da.report.vo.ReportVo">
SELECT DISTINCT
SELECT
t.id,
t.year,
t.name,
@@ -17,10 +17,10 @@
FROM `tt_report_manage` AS t
INNER JOIN ts_report_label AS trl ON t.id = trl.report_id
WHERE t.delFlag = 0
AND t.createUserId = #{pageVO.usid}
<!--报表名称搜索-->
<if test="Vo.name != null and Vo.name != ''">
and t.name like "%"#{Vo.name}"%"
and t.name like CONCAT(CONCAT('%',#{pageVO.name}),'%')
</if>
<!--年份搜索-->
@@ -38,6 +38,7 @@
#{id}
</foreach>
</if>
<!--id搜索-->
<if test="Vo.ids !=null and Vo.ids.size() > 0">
and Vo.ids in
@@ -46,11 +47,6 @@
</foreach>
</if>
<!--用户搜索-->
<if test="Vo.usid != null and Vo.usid != ''">
and t.userId=#{Vo.usid}
</if>
ORDER BY updateDate desc
</select>
@@ -177,55 +173,57 @@
eo.updateDate DESC
</select>
<select id="reportManagerPage" 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
eo.id,
eo.NAME,
eo.keycontent,
eo.maincontent,
eo.DEPARTMENT,
eo.YEAR,
eo.fileid,
eo.confidentialLevel,
eo.privacyLevel,
pa.report_id,
pa.user_id,
pa.power
FROM
TT_REPORT_MANAGE eo
LEFT JOIN tr_report_user ru ON eo.id = ru.reportId
LEFT JOIN power_apply pa ON pa.report_id = eo.id
WHERE
eo.DEL_FLAG = 0
and eo.createUserId = #{pageVO.usid}
<if test="pageVO.name !='' and pageVO.name != null">
and name like CONCAT(CONCAT('%',#{pageVO.name}),'%')
t.id,
t.year,
t.name,
t.keycontent,
t.fileId,
t.createDate,
t.department,
t.maincontent,
t.confidentialLevel,
t.privacyLevel
FROM `tt_report_manage` AS t
INNER JOIN ts_report_label AS trl ON t.id = trl.report_id
WHERE t.del_flag = 0
<!--报表名称搜索-->
<if test="Vo.name != null and Vo.name != ''">
and t.name like CONCAT(CONCAT('%',#{Vo.name}),'%')
</if>
<!--年份搜索-->
<if test="pageVO.year != null and pageVO.year.size() > 0">
and year in
<foreach collection="pageVO.year" item="year" open="(" separator="," close=")">
<if test="Vo.year != null and Vo.year.size() > 0">
and t.year in
<foreach collection="Vo.year" item="year" open="(" separator="," close=")">
#{year}
</foreach>
</if>
<if test="pageVO.ids != null and pageVO.ids.size() > 0">
and eo.id in
<foreach collection="pageVO.ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<!--id搜索-->
<if test="idSet !=null and idSet.size() > 0">
and eo.id in
and t.id in
<foreach collection="idSet" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
GROUP BY
eo.id
ORDER BY
eo.updateDate DESC
<!--id搜索-->
<if test="Vo.ids !=null and Vo.ids.size() > 0">
and t.id in
<foreach collection="Vo.ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<!--用户搜索-->
<if test="Vo.usid != null and Vo.usid != ''">
and t.createUserId=#{Vo.usid}
</if>
ORDER BY updateDate desc
</select>
</mapper>