超时通知
This commit is contained in:
parent
220a27fd9d
commit
850748b4e1
@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.constant;
|
||||
|
||||
/**
|
||||
* 用户常量信息
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class UserConstants
|
||||
@ -53,7 +53,7 @@ public class UserConstants
|
||||
|
||||
/** Layout组件标识 */
|
||||
public final static String LAYOUT = "Layout";
|
||||
|
||||
|
||||
/** ParentView组件标识 */
|
||||
public final static String PARENT_VIEW = "ParentView";
|
||||
|
||||
@ -82,5 +82,5 @@ public class UserConstants
|
||||
public static final String RESCUE_DRIVER = "jysj";
|
||||
|
||||
/** 救援定时任务时间 */
|
||||
public static final Integer RESCUE_TIME = 3 * 60;
|
||||
public static final Integer RESCUE_TIME = 30;
|
||||
}
|
||||
|
@ -1,9 +1,13 @@
|
||||
package cn.iocoder.yudao.module.rescue.utils;
|
||||
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.module.appBase.domain.SysAnnouncement;
|
||||
import cn.iocoder.yudao.module.appBase.service.ISysAnnouncementService;
|
||||
import cn.iocoder.yudao.module.constant.UserConstants;
|
||||
import cn.iocoder.yudao.module.rescue.dto.TaskDto;
|
||||
import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
|
||||
import cn.iocoder.yudao.module.system.api.permission.RoleApi;
|
||||
import cn.iocoder.yudao.module.system.api.permission.dto.RoleReqDTO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO;
|
||||
import cn.iocoder.yudao.module.system.service.permission.PermissionService;
|
||||
@ -54,7 +58,7 @@ public class RedissonDelayQueue {
|
||||
@Resource
|
||||
private RoleService roleService;
|
||||
@Resource
|
||||
private PermissionService permissionService;
|
||||
private PermissionApi permissionService;
|
||||
|
||||
/**
|
||||
* 初始化方法,在 Spring 容器加载后自动执行。
|
||||
@ -90,11 +94,11 @@ public class RedissonDelayQueue {
|
||||
sysAnnouncement.setTitle("有救援订单超时请立即处理");
|
||||
sysAnnouncement.setContent("有救援订单超时请立即处理");
|
||||
announcementService.insertSysAnnouncements(sysAnnouncement);
|
||||
|
||||
TenantContextHolder.setIgnore(true);
|
||||
// 发送订单信息给其他人 经理 总调度 将这俩人指定 救援其他通知人 角色
|
||||
RoleDO roleDO = roleService.queryRole("rescueOtherNotify");
|
||||
if(null!=roleDO){
|
||||
List<Long> userIds = permissionService.getUserIdByRoleId(roleDO.getId());
|
||||
RoleDO roleInfo = roleService.getRoleByCodeWithoutTenant("rescueOtherNotify");
|
||||
if(null!=roleInfo){
|
||||
List<Long> userIds = permissionService.getUserIdByRoleId(roleInfo.getId());
|
||||
if(!userIds.isEmpty()){
|
||||
// 发消息
|
||||
SysAnnouncement otherAnnouncement = new SysAnnouncement();
|
||||
@ -105,7 +109,7 @@ public class RedissonDelayQueue {
|
||||
announcementService.insertSysAnnouncements(otherAnnouncement);
|
||||
}
|
||||
}
|
||||
|
||||
TenantContextHolder.setIgnore(false);
|
||||
/** 两个值虽然一样,但避免无法删除一直存在问题,干脆重新来过 */
|
||||
// 移除原来的
|
||||
removeAllTasks(taskDto.getRescueInfoId());
|
||||
|
@ -1,6 +1,8 @@
|
||||
package cn.iocoder.yudao.module.system.service.permission;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.module.system.api.permission.dto.RoleReqDTO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RolePageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO;
|
||||
@ -144,5 +146,6 @@ public interface RoleService {
|
||||
* @param ids 角色编号数组
|
||||
*/
|
||||
void validateRoleList(Collection<Long> ids);
|
||||
|
||||
@TenantIgnore
|
||||
RoleDO getRoleByCodeWithoutTenant(String rescueOtherNotify);
|
||||
}
|
||||
|
@ -11,6 +11,8 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.module.system.api.permission.dto.RoleReqDTO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RolePageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO;
|
||||
@ -312,6 +314,12 @@ public class RoleServiceImpl implements RoleService {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public RoleDO getRoleByCodeWithoutTenant(String code) {
|
||||
TenantContextHolder.setIgnore(true);
|
||||
return roleMapper.selectByCode(code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得自身的代理对象,解决 AOP 生效问题
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user