站内信消息通知优化
This commit is contained in:
parent
12dcb9910d
commit
425f6d30a6
|
@ -13,9 +13,16 @@ import java.lang.annotation.*;
|
|||
public @interface ActivitiNoticeOperation {
|
||||
|
||||
/**
|
||||
* 流程名称
|
||||
* 节点名称
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String value() default "";
|
||||
|
||||
/**
|
||||
* 流程名称
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String process() default "";
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import io.renren.common.annotation.ActivitiNoticeOperation;
|
|||
import io.renren.modules.notice.dto.SysNoticeDTO;
|
||||
import io.renren.modules.notice.enums.NoticeStatusEnum;
|
||||
import io.renren.modules.notice.service.SysNoticeService;
|
||||
import io.renren.modules.sys.dto.SysUserDTO;
|
||||
import io.renren.modules.sys.service.SysUserService;
|
||||
import org.activiti.engine.delegate.DelegateTask;
|
||||
import org.activiti.engine.delegate.TaskListener;
|
||||
|
@ -92,42 +93,48 @@ public class ActivitiNoticeAspect {
|
|||
try {
|
||||
String finalCreator = creator;
|
||||
CompletableFuture.runAsync(() -> { // 发起人
|
||||
SysNoticeDTO dto = new SysNoticeDTO();
|
||||
dto.setType(2);
|
||||
dto.setTitle("流程流转系统通知");
|
||||
dto.setContent("您发起的流程当前审核节点为:" + activitiNoticeOperation.value() + "<br>当前审核人为" + sysUserService.get(Long.valueOf(delegateTask.getAssignee())).getRealName()); // 通知内容
|
||||
dto.setReceiverType(1);
|
||||
dto.setReceiverTypeIds(finalCreator);
|
||||
dto.setStatus(NoticeStatusEnum.SEND.value());
|
||||
dto.setSenderName("流程系统");
|
||||
dto.setSenderDate(new Date());
|
||||
dto.setCreator(sysUserService.getByUsername("admin").getId());
|
||||
dto.setCreateDate(new Date());
|
||||
sysNoticeService.save(dto);
|
||||
}).thenRunAsync(() -> { // 审批者
|
||||
SysNoticeDTO dto = new SysNoticeDTO();
|
||||
dto.setType(2);
|
||||
dto.setTitle("流程流转系统通知");
|
||||
dto.setContent(sysUserService.get(Long.valueOf(finalCreator)).getRealName() + "发起的流程当前审核节点为:" + activitiNoticeOperation.value() + "<br>当前审核人指派为您"); // 通知内容
|
||||
dto.setReceiverType(1);
|
||||
dto.setReceiverTypeIds(delegateTask.getAssignee());
|
||||
dto.setStatus(NoticeStatusEnum.SEND.value());
|
||||
dto.setSenderName("流程系统");
|
||||
dto.setSenderDate(new Date());
|
||||
dto.setCreator(sysUserService.getByUsername("admin").getId());
|
||||
dto.setCreateDate(new Date());
|
||||
sysNoticeService.save(dto);
|
||||
})
|
||||
.thenRunAsync(() -> {
|
||||
new Thread(() -> {
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
work_.remove(kv.get("id").toString());
|
||||
}).start();
|
||||
});
|
||||
SysUserDTO assignee = sysUserService.get(Long.valueOf(delegateTask.getAssignee()));
|
||||
String content = "您发起的流程<" + activitiNoticeOperation.process() + ">当前审核节点为:" +
|
||||
activitiNoticeOperation.value() +
|
||||
"<br>当前审核人为\"" +
|
||||
assignee.getDeptName() + "\"审核负责人\"" + assignee.getRealName();
|
||||
SysNoticeDTO dto = new SysNoticeDTO();
|
||||
dto.setType(2);
|
||||
dto.setTitle("流程流转系统通知");
|
||||
dto.setContent(content); // 通知内容
|
||||
dto.setReceiverType(1);
|
||||
dto.setReceiverTypeIds(finalCreator);
|
||||
dto.setStatus(NoticeStatusEnum.SEND.value());
|
||||
dto.setSenderName("流程系统");
|
||||
dto.setSenderDate(new Date());
|
||||
dto.setCreator(sysUserService.getByUsername("admin").getId());
|
||||
dto.setCreateDate(new Date());
|
||||
sysNoticeService.save(dto);
|
||||
}).thenRunAsync(() -> { // 审批者
|
||||
SysUserDTO owner = sysUserService.get(Long.valueOf(finalCreator));
|
||||
String content = owner.getRealName() + "发起的流程<" + activitiNoticeOperation.process() + ">当前审核节点为:" + activitiNoticeOperation.value() + "<br>当前审核人指派为您";
|
||||
SysNoticeDTO dto = new SysNoticeDTO();
|
||||
dto.setType(2);
|
||||
dto.setTitle("流程流转系统通知");
|
||||
dto.setContent(content); // 通知内容
|
||||
dto.setReceiverType(1);
|
||||
dto.setReceiverTypeIds(delegateTask.getAssignee());
|
||||
dto.setStatus(NoticeStatusEnum.SEND.value());
|
||||
dto.setSenderName("流程系统");
|
||||
dto.setSenderDate(new Date());
|
||||
dto.setCreator(sysUserService.getByUsername("admin").getId());
|
||||
dto.setCreateDate(new Date());
|
||||
sysNoticeService.save(dto);
|
||||
}).thenRunAsync(() -> { // 防止重放
|
||||
new Thread(() -> {
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
work_.remove(kv.get("id").toString());
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}).start();
|
||||
});
|
||||
} catch (Exception e) {
|
||||
logger.error("发送通知消息异常", e);
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ public class DemandDataListener implements TaskListener, ExecutionListener, Acti
|
|||
}
|
||||
|
||||
@Override
|
||||
@ActivitiNoticeOperation("需求部门审批")
|
||||
@ActivitiNoticeOperation(value = "需求部门审批", process = "能力需求申请")
|
||||
public void notify(DelegateTask delegateTask) {
|
||||
logger.error("----------------------进入能力需求受理者1节点---------------------------");
|
||||
logger.error("事件类型:" + delegateTask.getEventName());
|
||||
|
|
|
@ -67,7 +67,7 @@ public class CorrectionListener implements TaskListener, ExecutionListener, Acti
|
|||
private TAbilityApplicationService tAbilityApplicationService;
|
||||
|
||||
@Override
|
||||
@ActivitiNoticeOperation("资源部门负责人审批")
|
||||
@ActivitiNoticeOperation(value = "资源部门负责人审批", process = "能力申请流程")
|
||||
public void notify(DelegateTask delegateTask) {
|
||||
logger.error("-------------------------进入部门动态审批人流程-------------------------------");
|
||||
final String eventName = delegateTask.getEventName();
|
||||
|
|
|
@ -66,7 +66,7 @@ public class DataCenterListener implements TaskListener, ExecutionListener, Acti
|
|||
}
|
||||
|
||||
@Override
|
||||
@ActivitiNoticeOperation("大数据局负责人审批")
|
||||
@ActivitiNoticeOperation(value = "大数据局负责人审批", process = "能力申请流程")
|
||||
public void notify(DelegateTask delegateTask) {
|
||||
logger.error("事件类型:" + delegateTask.getEventName());
|
||||
final String eventName = delegateTask.getEventName();
|
||||
|
|
|
@ -55,7 +55,7 @@ public class ResourceUndercarriageListener implements TaskListener, ExecutionLis
|
|||
private ResourceService resourceService;
|
||||
|
||||
@Override
|
||||
@ActivitiNoticeOperation("资源下线前资源所属部门审批人审批")
|
||||
@ActivitiNoticeOperation(value = "资源下线前资源所属部门审批人审批", process = "能力资源下架")
|
||||
public void notify(DelegateTask delegateTask) {
|
||||
logger.error("----------------------进入资源所有者节点---------------------------");
|
||||
logger.error("事件类型:" + delegateTask.getEventName());
|
||||
|
|
|
@ -75,7 +75,7 @@ public class ResourceOwnerListener implements TaskListener, ExecutionListener, A
|
|||
}
|
||||
|
||||
@Override
|
||||
@ActivitiNoticeOperation("资源所属部门审批人审批")
|
||||
@ActivitiNoticeOperation(value = "资源所属部门审批人审批", process = "能力资源上架")
|
||||
public void notify(DelegateTask delegateTask) {
|
||||
logger.error("----------------------进入资源所有者节点---------------------------");
|
||||
logger.error("事件类型:" + delegateTask.getEventName());
|
||||
|
|
Loading…
Reference in New Issue