二开案例.python插件.打调用堆栈

栏目:云星空知识作者:金蝶来源:金蝶云社区发布:2024-09-16浏览:1

二开案例.python插件.打调用堆栈

【场景】打调用堆栈 【代码】 ![image.webp](/download/0100fce2cebb3a244cacaca0c54a24a47d69.webp) ```python import clr clr.AddReference("mscorlib") clr.AddReference("System.Data") #本次引用 clr.AddReference("Kingdee.BOS.Core") clr.AddReference("Kingdee.BOS.Log") from System import * from System.Collections.Generic import * from System.Data import * ##本次引用 from Kingdee.BOS.Core.DynamicForm.PlugIn import * from Kingdee.BOS.Core.DynamicForm.PlugIn.Args import * from Kingdee.BOS.Log import * from System.Diagnostics import * def BeginOperationTransaction(e): billNoProp = this.BusinessInfo.GetBillNoField().PropertyName; billInfos = ''; for idx in range(len(e.DataEntitys)): dataEntity = e.DataEntitys[idx]; pk = dataEntity[0]; billNo = dataEntity[billNoProp]; billInfos += str(pk) +'('+ str(billNo) +'),'; logMsgList = List[str](); logMsgList.Add(billInfos); stackFrames = StackTrace().GetFrames(); for idx in range(len(stackFrames)): curStack = stackFrames[idx]; method = curStack.GetMethod(); fullName = '' if method.DeclaringType == None else method.DeclaringType.FullName; msg = str(method.Module)+'=> ' + (fullName) +' , ' +str(method); logMsgList.Add(msg); totalMsg = '\r\n'.join(logMsgList); Logger.Error("SHOW STACKTRACE", totalMsg, None); ``` 【效果】 ![image.webp](/download/0100fda32ec334e043a8af11738499414db9.webp)

二开案例.python插件.打调用堆栈

【场景】打调用堆栈【代码】![image.webp](/download/0100fce2cebb3a244cacaca0c54a24a47d69.webp)```pythonimport clrclr.AddReference("...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息