Merge branch 'dev'

This commit is contained in:
wangliwen 2022-10-10 13:53:45 +08:00
commit 21ac7f2991
5 changed files with 183 additions and 159 deletions

View File

@ -16,6 +16,7 @@ import io.renren.modules.notice.dto.SysNoticeDTO;
import io.renren.modules.notice.enums.NoticeStatusEnum; import io.renren.modules.notice.enums.NoticeStatusEnum;
import io.renren.modules.notice.service.SysNoticeService; import io.renren.modules.notice.service.SysNoticeService;
import io.renren.modules.security.user.SecurityUser; import io.renren.modules.security.user.SecurityUser;
import io.renren.modules.sys.service.SysRoleUserService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
@ -46,6 +47,8 @@ public class BookMeetingRoomController {
private TMeetingroomService tMeetingroomService; private TMeetingroomService tMeetingroomService;
@Resource @Resource
private SysNoticeService sysNoticeService; private SysNoticeService sysNoticeService;
@Resource
private SysRoleUserService sysRoleUserService;
@GetMapping("list") @GetMapping("list")
@ApiOperation("搜索可以预约的会议室") @ApiOperation("搜索可以预约的会议室")
@ -104,8 +107,15 @@ public class BookMeetingRoomController {
sysNoticeDTO.setTitle("会议室申请审核通知"); sysNoticeDTO.setTitle("会议室申请审核通知");
sysNoticeDTO.setContent(content); // 通知内容 sysNoticeDTO.setContent(content); // 通知内容
sysNoticeDTO.setReceiverType(1); sysNoticeDTO.setReceiverType(1);
// 根据roleId查询userId
sysNoticeDTO.setReceiverTypeIds(defaultAssigneeRoleId); List<Long> useIds = sysRoleUserService.getUserIdListByRoleId(Long.parseLong(defaultAssigneeRoleId));
if (useIds != null && useIds.size() > 0){
String userId = "";
for (Long use : useIds){
userId += use.toString()+",";
}
sysNoticeDTO.setReceiverTypeIds(userId.substring(0,userId.length() -1));
}
sysNoticeDTO.setStatus(NoticeStatusEnum.SEND.value()); sysNoticeDTO.setStatus(NoticeStatusEnum.SEND.value());
sysNoticeDTO.setSenderName("流程系统"); sysNoticeDTO.setSenderName("流程系统");
sysNoticeDTO.setSenderDate(new Date()); sysNoticeDTO.setSenderDate(new Date());

View File

@ -35,4 +35,7 @@ public interface SysRoleUserDao extends BaseDao<SysRoleUserEntity> {
* @return * @return
*/ */
List<Long> getRoleIdList(Long userId); List<Long> getRoleIdList(Long userId);
// 根据roleId查询所有userId
List<Long> getUserIdsByRoleId(Long roleId);
} }

View File

@ -40,4 +40,6 @@ public interface SysRoleUserService extends BaseService<SysRoleUserEntity> {
* @param userId 用户ID * @param userId 用户ID
*/ */
List<Long> getRoleIdList(Long userId); List<Long> getRoleIdList(Long userId);
List<Long> getUserIdListByRoleId(Long roleId);
} }

View File

@ -53,4 +53,9 @@ public class SysRoleUserServiceImpl extends BaseServiceImpl<SysRoleUserDao, SysR
return baseDao.getRoleIdList(userId); return baseDao.getRoleIdList(userId);
} }
@Override
public List<Long> getUserIdListByRoleId(Long roleId) {
return baseDao.getUserIdsByRoleId(roleId);
}
} }

View File

@ -21,4 +21,8 @@
select role_id from sys_role_user where user_id = #{value} select role_id from sys_role_user where user_id = #{value}
</select> </select>
<select id="getUserIdsByRoleId" resultType="java.lang.Long">
select user_id from sys_role_user where role_id = #{roleId}
</select>
</mapper> </mapper>