提交 10d9df1d 作者: 张开石

1、修改获取会议类型接口bug,系统通用会议类型中只显示已启用的系统通用的,和自己创建的

父级 37f2d9d5
...@@ -32,10 +32,11 @@ public interface MeetingRecordTemplateMapper extends BaseMapper<MeetingRecordTem ...@@ -32,10 +32,11 @@ public interface MeetingRecordTemplateMapper extends BaseMapper<MeetingRecordTem
/** /**
* 获取非授权的模板,包括系统通用的和自己创建的 * 获取非授权的模板,包括系统通用的和自己创建的
* @param userId * @param meetTypeId
* @return * @return
*/ */
List<MeetTypeDto> selectAllTmplWithoutPermission(@Param("userId") String userId); List<MeetTypeDto> selectAllTmplWithoutPermission(@Param("meetTypeId") Long meetTypeId,
@Param("userId") String userId);
/** /**
* 获取模板 * 获取模板
...@@ -60,4 +61,11 @@ public interface MeetingRecordTemplateMapper extends BaseMapper<MeetingRecordTem ...@@ -60,4 +61,11 @@ public interface MeetingRecordTemplateMapper extends BaseMapper<MeetingRecordTem
MeetingRecordTemplate selectEnabledTemplate(@Param("meetTypeId") Long meetTypeId, MeetingRecordTemplate selectEnabledTemplate(@Param("meetTypeId") Long meetTypeId,
@Param("templateType") String templateType, @Param("templateType") String templateType,
@Param("userId") String userId); @Param("userId") String userId);
/**
* 获取系统通用的启用的模板
* @return
*/
MeetTypeDto selectEnabledSystemTemplate();
} }
\ No newline at end of file
...@@ -421,9 +421,11 @@ public class MeetingRecordTemplateServiceImpl extends ServiceImpl<MeetingRecordT ...@@ -421,9 +421,11 @@ public class MeetingRecordTemplateServiceImpl extends ServiceImpl<MeetingRecordT
} }
} }
// 获取非授权的模板,包括系统通用的和自己创建的 // 获取非授权的模板,包括系统通用并启用的和自己创建的
List<MeetTypeDto> recordTemplateDtoList = baseMapper.selectAllTmplWithoutPermission(userId); MeetTypeDto enabledSystemTemplate = baseMapper.selectEnabledSystemTemplate();
permissionDeptTmplDtoList.stream().forEach(meetTypeDto -> { List<MeetTypeDto> recordTemplateDtoList = baseMapper.selectAllTmplWithoutPermission(enabledSystemTemplate.getId(), userId);
recordTemplateDtoList.add(enabledSystemTemplate);
recordTemplateDtoList.stream().forEach(meetTypeDto -> {
meetTypeDto.getRecordTemplateDTOList().removeIf(template -> ObjectUtils.isEmpty(template.getId())); meetTypeDto.getRecordTemplateDTOList().removeIf(template -> ObjectUtils.isEmpty(template.getId()));
}); });
......
...@@ -170,14 +170,17 @@ ...@@ -170,14 +170,17 @@
select select
<include refid="templateColumnSql" /> <include refid="templateColumnSql" />
from from
meet_type meet_type,
left join cmt_meeting_record_template on meet_type.id = cmt_meeting_record_template.meeting_type and cmt_meeting_record_template.is_del = 0 cmt_meeting_record_template
LEFT JOIN meet_template_enable ON cmt_meeting_record_template.id = meet_template_enable.rel_id LEFT JOIN meet_template_enable ON cmt_meeting_record_template.id = meet_template_enable.rel_id
AND meet_template_enable.user_id = #{userId} AND meet_template_enable.user_id = #{userId}
where where
meet_type.is_del = 0 meet_type.is_del = 0
and (cmt_meeting_record_template.type = 'system' or meet_type.create_user = #{userId} or cmt_meeting_record_template.create_user = #{userId}) and meet_type.id = #{meetTypeId}
and meet_type.id = cmt_meeting_record_template.meeting_type
and cmt_meeting_record_template.is_del = 0
and cmt_meeting_record_template.type = 'custom'
and cmt_meeting_record_template.create_user = #{userId}
</select> </select>
...@@ -225,4 +228,20 @@ ...@@ -225,4 +228,20 @@
and meet_template_enable.user_id = #{userId} and meet_template_enable.user_id = #{userId}
</where> </where>
</select> </select>
<select id="selectEnabledSystemTemplate" resultType="com.cmeeting.dto.MeetTypeDto">
select
<include refid="templateColumnSql" />
from
meet_type,
cmt_meeting_record_template,
meet_template_enable
where
meet_type.is_del = 0
and meet_type.id = cmt_meeting_record_template.meeting_type
and cmt_meeting_record_template.is_del = 0
and cmt_meeting_record_template.type = 'system'
and cmt_meeting_record_template.id = meet_template_enable.rel_id
</select>
</mapper> </mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论