提交 407f047e 作者: 张开石

1、修改获取会议类型接口bug

父级 e6ca8750
package com.cmeeting.controller; package com.cmeeting.controller;
import com.cmeeting.annotation.OperLog;
import com.cmeeting.constant.MeetingTypeConstant; import com.cmeeting.constant.MeetingTypeConstant;
import com.cmeeting.dto.MeetTypeDto; import com.cmeeting.dto.MeetTypeDto;
import com.cmeeting.service.MeetTypeService; import com.cmeeting.service.MeetTypeService;
...@@ -28,6 +29,7 @@ public class MeetingTypeController { ...@@ -28,6 +29,7 @@ public class MeetingTypeController {
* 新增会议类型 * 新增会议类型
* @param meetingTypeVo 请求参数 * @param meetingTypeVo 请求参数
*/ */
@OperLog(location = "系统模板页", operation = "新增会议类型")
@PostMapping("/add") @PostMapping("/add")
public R add(@RequestBody @Validated(MeetingTypeVo.AddGroup.class) MeetingTypeVo meetingTypeVo) { public R add(@RequestBody @Validated(MeetingTypeVo.AddGroup.class) MeetingTypeVo meetingTypeVo) {
meetTypeService.add(meetingTypeVo); meetTypeService.add(meetingTypeVo);
...@@ -38,6 +40,7 @@ public class MeetingTypeController { ...@@ -38,6 +40,7 @@ public class MeetingTypeController {
* 更新会议类型 * 更新会议类型
* @param meetingTypeVo 请求参数 * @param meetingTypeVo 请求参数
*/ */
@OperLog(location = "系统模板页", operation = "更新会议类型")
@PostMapping("/update") @PostMapping("/update")
public R update(@RequestBody @Validated(MeetingTypeVo.UpdateGroup.class) MeetingTypeVo meetingTypeVo) { public R update(@RequestBody @Validated(MeetingTypeVo.UpdateGroup.class) MeetingTypeVo meetingTypeVo) {
meetTypeService.update(meetingTypeVo); meetTypeService.update(meetingTypeVo);
...@@ -48,6 +51,7 @@ public class MeetingTypeController { ...@@ -48,6 +51,7 @@ public class MeetingTypeController {
* 删除会议类型 * 删除会议类型
* @param meetingTypeVo 请求参数 * @param meetingTypeVo 请求参数
*/ */
@OperLog(location = "系统模板页", operation = "删除会议类型")
@PostMapping("/delete") @PostMapping("/delete")
public R delete(@RequestBody @Validated(MeetingTypeVo.DeleteGroup.class) MeetingTypeVo meetingTypeVo) { public R delete(@RequestBody @Validated(MeetingTypeVo.DeleteGroup.class) MeetingTypeVo meetingTypeVo) {
......
...@@ -392,16 +392,30 @@ public class MeetingRecordTemplateServiceImpl extends ServiceImpl<MeetingRecordT ...@@ -392,16 +392,30 @@ public class MeetingRecordTemplateServiceImpl extends ServiceImpl<MeetingRecordT
// 查询指定授权的模板 - 从会议类型维度查询 // 查询指定授权的模板 - 从会议类型维度查询
List<MeetTypeDto> permissionTmplInMeetTypeDtoList = baseMapper.selectPermissionTmplInMeetType(userId, parentDeptIdList); List<MeetTypeDto> permissionTmplInMeetTypeDtoList = baseMapper.selectPermissionTmplInMeetType(userId, parentDeptIdList);
permissionTmplInMeetTypeDtoList.stream().forEach(meetTypeDto -> {
meetTypeDto.getRecordTemplateDTOList().removeIf(template -> ObjectUtils.isEmpty(template.getId()));
});
resultList.addAll(permissionTmplInMeetTypeDtoList); resultList.addAll(permissionTmplInMeetTypeDtoList);
// 查询指定授权的模板 - 从纪要模板维度查询 // 查询指定授权的模板 - 从纪要模板维度查询
List<MeetTypeDto> permissionDeptTmplDtoList = baseMapper.selectPermissionTmpl(userId, parentDeptIdList); List<MeetTypeDto> permissionDeptTmplDtoList = baseMapper.selectPermissionTmpl(userId, parentDeptIdList);
permissionDeptTmplDtoList.stream().forEach(meetTypeDto -> {
meetTypeDto.getRecordTemplateDTOList().removeIf(template -> ObjectUtils.isEmpty(template.getId()));
});
resultList.addAll(permissionDeptTmplDtoList); resultList.addAll(permissionDeptTmplDtoList);
// 获取非授权的模板,包括系统通用的和自己创建的 // 获取非授权的模板,包括系统通用的和自己创建的
List<MeetTypeDto> recordTemplateDtoList = baseMapper.selectAllTmplWithoutPermission(userId); List<MeetTypeDto> recordTemplateDtoList = baseMapper.selectAllTmplWithoutPermission(userId);
permissionDeptTmplDtoList.stream().forEach(meetTypeDto -> {
meetTypeDto.getRecordTemplateDTOList().removeIf(template -> ObjectUtils.isEmpty(template.getId()));
});
resultList.addAll(recordTemplateDtoList); resultList.addAll(recordTemplateDtoList);
// 去重
TreeSet<MeetTypeDto> treeSet = new TreeSet<>(Comparator.comparingLong(MeetTypeDto::getId));
treeSet.addAll(resultList);
resultList = new ArrayList<>(treeSet);
return resultList; return resultList;
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</select> </select>
<sql id="templateColumnSql"> <sql id="templateColumnSql">
meet_type.id as template_type_id, meet_type.id as meeting_type_id,
meet_type.`name` AS meeting_type_name, meet_type.`name` AS meeting_type_name,
meet_type.personal_permission AS meeting_type_personal_permission, meet_type.personal_permission AS meeting_type_personal_permission,
meet_type.auth_type AS meeting_type_auth_type, meet_type.auth_type AS meeting_type_auth_type,
...@@ -109,13 +109,12 @@ ...@@ -109,13 +109,12 @@
left join module_permission on module_permission.target_id = cmt_meeting_record_template.id and module_permission.type = 0 left join module_permission on module_permission.target_id = cmt_meeting_record_template.id and module_permission.type = 0
and module_permission.purpose = 2 and module_permission.purpose = 2
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} and module_permission.rel_id in
<foreach collection="deptIdList" item="deptId" open="(" separator="," close=")" index="index">
#{deptId}
</foreach>
where where
meet_type.is_del = 0 meet_type.is_del = 0
and module_permission.rel_id in
<foreach collection="deptIdList" item="deptId" open="(" separator="," close=")" index="index">
#{deptId}
</foreach>
union union
...@@ -128,10 +127,10 @@ ...@@ -128,10 +127,10 @@
left join module_permission on module_permission.target_id = cmt_meeting_record_template.id and module_permission.type = 1 left join module_permission on module_permission.target_id = cmt_meeting_record_template.id and module_permission.type = 1
and module_permission.purpose = 2 and module_permission.purpose = 2
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} and module_permission.rel_id = #{userId}
where where
meet_type.is_del = 0 meet_type.is_del = 0
and module_permission.rel_id = #{userId}
union union
...@@ -144,10 +143,10 @@ ...@@ -144,10 +143,10 @@
left join module_permission on module_permission.target_id = cmt_meeting_record_template.id and module_permission.type = 1 left join module_permission on module_permission.target_id = cmt_meeting_record_template.id and module_permission.type = 1
and module_permission.purpose = 2 and module_permission.purpose = 2
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} and module_permission.rel_id = 'all'
where where
meet_type.is_del = 0 meet_type.is_del = 0
and module_permission.rel_id = 'all'
</select> </select>
<!-- 获取非授权的模板,包括系统通用的和自己创建的 --> <!-- 获取非授权的模板,包括系统通用的和自己创建的 -->
...@@ -157,10 +156,11 @@ ...@@ -157,10 +156,11 @@
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 left join cmt_meeting_record_template on meet_type.id = cmt_meeting_record_template.meeting_type and cmt_meeting_record_template.is_del = 0
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 cmt_meeting_record_template.user_id = #{userId}) and (cmt_meeting_record_template.type = 'system' or cmt_meeting_record_template.create_user = #{userId})
</select> </select>
</mapper> </mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论