mirror of
				https://gitee.com/dromara/mayfly-go
				synced 2025-11-04 08:20:25 +08:00 
			
		
		
		
	refactor: 消息模块调整 & 样式优化
This commit is contained in:
		@@ -103,17 +103,24 @@ func (u *UserTaskNodeBehavior) Execute(ctx *ExecutionCtx) error {
 | 
			
		||||
 | 
			
		||||
			// 用户账号类型
 | 
			
		||||
			if !strings.Contains(candidate, ":") {
 | 
			
		||||
				params := map[string]any{
 | 
			
		||||
					"creator":        procinst.Creator,
 | 
			
		||||
					"procdefName":    procinst.ProcdefName,
 | 
			
		||||
					"bizKey":         procinst.BizKey,
 | 
			
		||||
					"taskName":       flowNode.Name,
 | 
			
		||||
					"procinstRemark": procinst.Remark,
 | 
			
		||||
				}
 | 
			
		||||
				// 发送通知消息
 | 
			
		||||
				global.EventBus.Publish(ctx, event.EventTopicBizMsgTmplSend, msgdto.BizMsgTmplSend{
 | 
			
		||||
					BizType: FlowTaskNotifyBizKey,
 | 
			
		||||
					BizId:   procinst.ProcdefId,
 | 
			
		||||
					Params: map[string]any{
 | 
			
		||||
						"creator":        procinst.Creator,
 | 
			
		||||
						"procdefName":    procinst.ProcdefName,
 | 
			
		||||
						"bizKey":         procinst.BizKey,
 | 
			
		||||
						"taskName":       flowNode.Name,
 | 
			
		||||
						"procinstRemark": procinst.Remark,
 | 
			
		||||
					},
 | 
			
		||||
				global.EventBus.Publish(context.Background(), event.EventTopicBizMsgTmplSend, &msgdto.BizMsgTmplSend{
 | 
			
		||||
					BizType:     FlowTaskNotifyBizKey,
 | 
			
		||||
					BizId:       procinst.ProcdefId,
 | 
			
		||||
					Params:      params,
 | 
			
		||||
					ReceiverIds: []uint64{cast.ToUint64(candidate)},
 | 
			
		||||
				})
 | 
			
		||||
 | 
			
		||||
				global.EventBus.Publish(context.Background(), event.EventTopicMsgTmplSend, &msgdto.MsgTmplSendEvent{
 | 
			
		||||
					TmplChannel: msgdto.MsgTmplFlowUserTaskTodo,
 | 
			
		||||
					Params:      params,
 | 
			
		||||
					ReceiverIds: []uint64{cast.ToUint64(candidate)},
 | 
			
		||||
				})
 | 
			
		||||
			}
 | 
			
		||||
 
 | 
			
		||||
@@ -72,7 +72,7 @@ func (p *procdefAppImpl) SaveProcdef(ctx context.Context, defParam *dto.SaveProc
 | 
			
		||||
		return p.Save(ctx, def)
 | 
			
		||||
	}, func(ctx context.Context) error {
 | 
			
		||||
		// 保存通知消息模板
 | 
			
		||||
		if err := p.msgTmplBizApp.SaveBizTmpl(ctx, msgdto.MsgTmplBizSave{
 | 
			
		||||
		if err := p.msgTmplBizApp.SaveBizTmpl(ctx, &msgdto.MsgTmplBizSave{
 | 
			
		||||
			TmplId:  defParam.MsgTmplId,
 | 
			
		||||
			BizType: FlowTaskNotifyBizKey,
 | 
			
		||||
			BizId:   def.Id,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user