提交 10d9df1d 作者: 张开石

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

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