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