public partial class Handles : BaseHandles
{
public Handles(TransmitData transmitData) : base(transmitData)
{
}
#region 此处只是示例,实际请删除
/// <summary>
/// 审批任务开始,结束,转交
/// </summary>
/// <returns></returns>
public void bpms_task_change()
{
//这里写收到回调时要执行的代码,this.transmitData.requestPara即钉钉回调发过来的参数
//log记录
Helpers.LoggerHelper.Info(this.transmitData.requestPara["title"].ToString());
}
public void bpms_instance_change()
{
//log 记录
//Helpers.LoggerHelper.Info("EventType:" + this.transmitData.requestPara["EventType"].ToString());
//Helpers.LoggerHelper.Info("processInstanceId:" + this.transmitData.requestPara["processInstanceId"].ToString());
//Helpers.LoggerHelper.Info("corpId:" + this.transmitData.requestPara["corpId"].ToString());
//Helpers.LoggerHelper.Info("createTime:" + this.transmitData.requestPara["createTime"].ToString());
//Helpers.LoggerHelper.Info("finishTime:" + this.transmitData.requestPara["finishTime"].ToString());
//Helpers.LoggerHelper.Info("title:" + this.transmitData.requestPara["title"].ToString());
//Helpers.LoggerHelper.Info("type:" + this.transmitData.requestPara["type"].ToString());
//Helpers.LoggerHelper.Info("staffId:" + this.transmitData.requestPara["staffId"].ToString());
//Helpers.LoggerHelper.Info("url:" + this.transmitData.requestPara["url"].ToString());
//Helpers.LoggerHelper.Info("result:" + this.transmitData.requestPara["result"].ToString());
//Helpers.LoggerHelper.Info("processCode:" + this.transmitData.requestPara["processCode"].ToString());
//Helpers.LoggerHelper.Info("==========================================");
//接收回调参数
string EventType = this.transmitData.requestPara["EventType"].ToString();//事件类型
string processInstanceId = this.transmitData.requestPara["processInstanceId"].ToString();//审批实例id
string corpId = this.transmitData.requestPara["corpId"].ToString();//审批实例对应的企业
string createTime = this.transmitData.requestPara["createTime"].ToString();//实例创建时间
string finishTime = this.transmitData.requestPara["finishTime"].ToString();//审批结束时间
string title = this.transmitData.requestPara["title"].ToString();//实例标题
string type = this.transmitData.requestPara["type"].ToString();//审批正常结束(同意或拒绝)的type为finish,审批终止的type为terminate
string staffId = this.transmitData.requestPara["staffId"].ToString();//发起审批实例的员工
string url = this.transmitData.requestPara["url"].ToString();//审批实例url,可在钉钉内跳转到审批页面
string result = this.transmitData.requestPara["result"].ToString();//正常结束时result
C#钉钉审批回调(一) 钉钉审批 实例代码
最新推荐文章于 2025-08-06 14:21:27 发布
本文详细介绍了如何使用C#语言来处理钉钉审批的回调操作,涵盖了回调接口的集成、请求响应处理及实际代码示例,帮助开发者理解并实现在自己的系统中对接钉钉审批回调功能。

最低0.47元/天 解锁文章
1563

被折叠的 条评论
为什么被折叠?



