Python打印堆栈信息

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

Python打印堆栈信息

    金蝶云星空有很多方法可以修改值,比如通过BOS里面配置值更新事件,通过实体服务规则,抑或通过表单插件DataChanged方法,有的时候实体服务规则或者值更新事件配置多了或者不清楚客户二开的情况,是比较难知道哪个地方的逻辑导致某些值的修改,通过Python打印堆栈信息可以对问题分析有一定的帮助(不一定能百分百分析出问题),本文介绍Python插件对某个特定字段的值更新逻辑打印出相关信息。

    本文以云星空版本8.1.0.20221110,销售订单明细信息中的 税额 字段为例介绍相关操作步骤,首先在BOS中扩展销售订单,在表单插件中追加个Python插件,如下图1-1所示:

image.webp

图1-1


    Python脚本如下(请使用附件中的代码,不要在论坛中直接复制下文):

# -*- coding: utf-8 -*-
# 表单插件显示方法调用堆栈演示

import clr
clr.AddReference('System')
clr.AddReference('Kingdee.BOS.Core')
clr.AddReference('Kingdee.BOS')

from System import *
from System.Diagnostics import *
from System.Text import *
from System.Reflection import * 

from Kingdee.BOS.Core import *
from Kingdee.BOS.Core.DynamicForm import *
from Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel import *
from System.Collections.Generic import *


def DataChanged(e):
    #本方法只作演示,用于显示销售订单分录税率字段修改逻辑
    if e.Field.Key.Equals("FEntryTaxAmount", StringComparison.OrdinalIgnoreCase):
        stringBuilder = StringBuilder("e.OldValue: " + str(e.OldValue) + ", e.NewValue: " + str(e.NewValue))
        stringBuilder.AppendLine()
        stack = StackTrace()
        stackFrames = stack.GetFrames()
        method = None
        declareType = None
        methodParameters = None
        declareTypeParam = None
        fullName = "__Python.NoneType__"
        fullNameParam = "__Python.NoneType__"
        for stackFrame in stackFrames:
            method = stackFrame.GetMethod()
            declareType = method.DeclaringType
            methodParameters = method.GetParameters()
            if declareType is not None:
                fullName = declareType.FullName
            else:
                fullName = "__Python.NoneType__"
            stringBuilder.Append(fullName + "." + method.Name + "(")
            if methodParameters is not None and methodParameters.Length > 0:
                index = 0
                for methodParameter in methodParameters:
                    index = index + 1
                    declareTypeParam = methodParameter.ParameterType
                    fullNameParam = "__Python.NoneType__"
                    if declareTypeParam is not None:
                        fullNameParam = declareTypeParam.FullName
                    stringBuilder.Append(str(fullNameParam))
                    stringBuilder.Append(" " + str(methodParameter.Name))
                    if index != methodParameters.Length:
                        stringBuilder.Append(", ")
                stringBuilder.AppendLine(")")
        this.View.ShowMessage(stringBuilder.ToString())


    上面的脚本首先会计算出对应税额字段的新旧值(如果想跟踪其它字段的赋值,可用对应字段替换脚本中的 FEntryTaxAmount,如果是通过WebApi的方式创建的单据,则可以通过BOS平台提供的日志功能,即在上面的from ** import** 中追加 from Kingdee.BOS.Log import *,然后在this.View.ShowMessage方法同一层中添加

Logger.Info("SAL", stringBuilder.ToString()) 即可在日志文件中记录堆栈跟踪信息),然后再追加调用堆栈信息(如果堆栈方法调用没有类,则用字符串'__Python.NoneType__'表示),当创建销售订单,输入了物料,数量,单价后,星空标准功能会自动计算税额,弹出的堆栈信息如下图1-2所示:

image.webp

图1-2


    上图中的堆栈详细信息如下所示:

e.OldValue: 0, e.NewValue: 11.50

System.RuntimeMethodHandle.InvokeMethod(System.Object target, System.Object[] arguments, System.Signature sig, System.Boolean constructor)

System.Reflection.RuntimeConstructorInfo.Invoke(System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)

Microsoft.Scripting.Interpreter.NewInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame)

Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame)

Microsoft.Scripting.Interpreter.LightLambda.Run3(None arg0, None arg1, None arg2)

System.Dynamic.UpdateDelegates.UpdateAndExecute2(System.Runtime.CompilerServices.CallSite site, None arg0, None arg1)

__Python.NoneType__.DataChanged$41(System.Runtime.CompilerServices.Closure None, IronPython.Runtime.PythonFunction None, System.Object None)

__Python.NoneType__._Scripting_(System.Object[] None, System.Object None)

Kingdee.BOS.Core.Util.PythonUtil.InvokePy(Microsoft.Scripting.Hosting.ScriptScope scope, System.String name, System.Object args)

Kingdee.BOS.Core.Bill.PlugIn.PythonBillPlugIn.InvokePluginMethod(System.String name, System.Object args)

Kingdee.BOS.Core.DynamicForm.PlugIn.AbstractDynamicFormPlugIn.DataChanged(Kingdee.BOS.Core.DynamicForm.PlugIn.Args.DataChangedEventArgs e)

Kingdee.BOS.Core.DynamicForm.PlugIn.DynamicFormModelPlugInProxy.FireDataChanged(Kingdee.BOS.Core.DynamicForm.PlugIn.Args.DataChangedEventArgs e)

Kingdee.BOS.Core.DynamicForm.AbstractDynamicFormModel.OnDataChanged(Kingdee.BOS.Core.DynamicForm.PlugIn.Args.DataChangedEventArgs arg)

Kingdee.BOS.Core.DynamicForm.AbstractDynamicFormModel.UpdateFieldValue(Kingdee.BOS.Core.Metadata.FieldElement.Field field, Kingdee.BOS.Orm.DataEntity.DynamicObject obj, System.Object value, System.Int32 row)

Kingdee.BOS.Core.DynamicForm.AbstractDynamicFormModel.UpdateField(Kingdee.BOS.Core.Metadata.FieldElement.Field field, Kingdee.BOS.Orm.DataEntity.DynamicObject activeRow, System.Object value, System.Int32 rowIndex, System.Object oldValue)

Kingdee.BOS.Core.DynamicForm.AbstractDynamicFormModel.SetValue(Kingdee.BOS.Core.Metadata.FieldElement.Field field, Kingdee.BOS.Orm.DataEntity.DynamicObject activeRow, System.Object value, System.Int32 rowIndex)

Kingdee.BOS.Core.DependencyRules.DynamicObjectValueHandler.SetValue(System.Object value)

Kingdee.BOS.Core.DependencyRules.BOSDynamicRow.TrySetMember(System.String key, System.Object value)

Kingdee.BOS.Scripting.ExpressionContext.TrySetValue(System.String key, System.Object newValue)

Kingdee.BOS.Scripting.PyDynamicMetaObject.TrySetMember(System.Dynamic.SetMemberBinder binder, System.Object value)

__Python.NoneType__.CallSite.Target(System.Runtime.CompilerServices.Closure None, System.Runtime.CompilerServices.CallSite None, System.Object None, System.Object None)

IronPython.Runtime.PythonContext.SetAttr(IronPython.Runtime.CodeContext context, System.Object o, System.String name, System.Object value)

IronPython.Runtime.Operations.PythonOps.ScopeSetMember(IronPython.Runtime.CodeContext context, Microsoft.Scripting.Runtime.Scope scope, System.String name, System.Object value)

IronPython.Runtime.Operations.PythonOps.SetLocal(IronPython.Runtime.CodeContext context, System.String name, System.Object value)

Microsoft.Scripting.Interpreter.ActionCallInstruction`3.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame)

Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame)

Microsoft.Scripting.Interpreter.LightLambda.Run2(None arg0, None arg1)

IronPython.Compiler.PythonScriptCode.RunWorker(IronPython.Runtime.CodeContext ctx)

Kingdee.BOS.Scripting.PyExpressionEvaluator.ExecuteScope(Kingdee.BOS.Scripting.Expression expression, Kingdee.BOS.Scripting.ExpressionContext context, Microsoft.Scripting.SourceCodeKind codeKind, Microsoft.Scripting.Hosting.ScriptScope& scope)

Kingdee.BOS.Scripting.PyExpressionEvaluator.Run(Kingdee.BOS.Scripting.Expression expression, Kingdee.BOS.Scripting.ExpressionContext context)

Kingdee.BOS.Business.DynamicForm.BusinessService.Calculate.DoAction(Kingdee.BOS.Core.DynamicForm.FormBusinessServiceArgs e)

Kingdee.BOS.Core.DynamicForm.FormBusinessServiceUtil.DoActionMethod(Kingdee.BOS.Core.DynamicForm.IFormBusinessSercice iBusiness, Kingdee.BOS.Core.DynamicForm.FormBusinessServiceArgs e)

Kingdee.BOS.Core.DynamicForm.FormBusinessServiceUtil.DoAction(Kingdee.BOS.Core.DynamicForm.IDynamicFormView view, Kingdee.BOS.Core.DynamicForm.FormBusinessServiceArgs e)

Kingdee.BOS.Core.DynamicForm.FormBusinessServiceUtil.InvokeService(Kingdee.BOS.Core.DynamicForm.IDynamicFormView view, Kingdee.BOS.Core.DynamicForm.FormBusinessServiceArgs e)

Kingdee.BOS.Core.DynamicForm.FormBusinessServiceUtil.InvokeService(Kingdee.BOS.Core.DynamicForm.IDynamicFormView view, System.Object source, Kingdee.BOS.Core.Metadata.FormElement.FormBusinessService service, System.String activeEntity, Kingdee.BOS.Orm.DataEntity.DynamicObject activeRow, System.Int32 rowIndex)

Kingdee.BOS.Core.DynamicForm.FormBusinessServiceUtil.InvokeServices(Kingdee.BOS.Core.DynamicForm.IDynamicFormView view, System.Object source, System.Collections.Generic.IEnumerable`1[[Kingdee.BOS.Core.Metadata.FormElement.FormBusinessService, Kingdee.BOS.Core, Version=8.1.410.13, Culture=neutral, PublicKeyToken=null]] services, System.Int32 actionType, System.String activeEntity, Kingdee.BOS.Orm.DataEntity.DynamicObject activeRow, System.Int32 rowIndex)

Kingdee.BOS.Web.DynamicForm.BusinessServiceCaller.InvokeFormBusiness(Kingdee.BOS.Core.DynamicForm.IDynamicFormView view, System.Object source, System.Collections.Generic.List`1[[Kingdee.BOS.Core.Metadata.FormElement.FormBusinessService, Kingdee.BOS.Core, Version=8.1.410.13, Culture=neutral, PublicKeyToken=null]] formBusinessServices, System.Int32 actionType, System.String entityKey, System.Int32 row)

Kingdee.BOS.Web.DynamicForm.BusinessServiceCaller.CallUpdateBusinessService(Kingdee.BOS.Core.Metadata.FieldElement.FieldAppearance fieldAppearance, System.Int32 row)

Kingdee.BOS.Web.DynamicForm.DynamicWebFormView.UpdateValue(System.String key, System.Int32 row, System.Object value)

Kingdee.BOS.Web.Bill.BillView.UpdateValue(System.String key, System.Int32 row, System.Object value)

Kingdee.BOS.Web.DynamicForm.DynamicWebFormController.UpdateValue(System.String key, System.Object value, System.Int32 row, Kingdee.BOS.JSON.JSONArray postDatas)

System.RuntimeMethodHandle.InvokeMethod(System.Object target, System.Object[] arguments, System.Signature sig, System.Boolean constructor)

System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(System.Object obj, System.Object[] parameters, System.Object[] arguments)

System.Reflection.RuntimeMethodInfo.Invoke(System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)

Kingdee.BOS.ServiceFacade.ServicesStub.DynamicForm.DynamicFormService.Call(System.String serviceName, System.String pageId, System.String layoutId, System.String methodName, System.Collections.IList pparams, System.Web.Script.Serialization.JavaScriptSerializer js, System.String dbId)

Kingdee.BOS.ServiceFacade.ServicesStub.DynamicForm.DynamicFormService.Call(System.String serviceName, System.String pageId, System.String methodName, Kingdee.BOS.JSON.JSONArray pparams)

System.RuntimeMethodHandle.InvokeMethod(System.Object target, System.Object[] arguments, System.Signature sig, System.Boolean constructor)

System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(System.Object obj, System.Object[] parameters, System.Object[] arguments)

System.Reflection.RuntimeMethodInfo.Invoke(System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)

Kingdee.BOS.ServiceFacade.KDServiceFx.ServiceExecutor.Execute(Kingdee.BOS.ServiceFacade.KDServiceFx.KDServiceContext context, Kingdee.BOS.ServiceFacade.KDServiceFx.ServiceType svcType, System.String[] paraValues, Kingdee.BOS.ServiceFacade.SerializerProxy serializeProxy, Kingdee.BOS.ServiceFacade.KDServiceFx.ServiceType beginMethod)

Kingdee.BOS.ServiceFacade.KDServiceFx.ExecuteServiceModule.OnProcess(Kingdee.BOS.ServiceFacade.KDServiceFx.KDServiceContext context)

Kingdee.BOS.ServiceFacade.KDServiceFx.ModulePipeline.ExcuteRequest(Kingdee.BOS.ServiceFacade.KDServiceFx.KDServiceContext context)

Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExcuteRuntime.BeginRquest(Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExtractor requestExtractor, Kingdee.BOS.ServiceFacade.KDServiceFx.WebContext webCtx)

Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExcuteRuntime.StartRequest(Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExtractor requestExtractor, Kingdee.BOS.ServiceFacade.KDServiceFx.WebContext context)

Kingdee.BOS.ServiceFacade.KDServiceFx.KDSVCHandler.ExecuteRequest(Kingdee.BOS.ServiceFacade.KDServiceFx.WebContext ctx, Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExtractor requestExtractor)

Kingdee.BOS.ServiceFacade.KDServiceFx.KDSVCHandler.ProcessRequestInternal(Kingdee.BOS.ServiceFacade.KDServiceFx.WebContext webCtx, Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExtractor requestExtractor)

Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExtractorQueueManager.RunExtractor(Kingdee.BOS.ServiceFacade.KDServiceFx.WebContext ctx, Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExtractor requestExtractor, System.Action`2[[Kingdee.BOS.ServiceFacade.KDServiceFx.WebContext, Kingdee.BOS.ServiceFacade.KDServiceFx, Version=8.1.410.13, Culture=neutral, PublicKeyToken=null],[Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExtractor, Kingdee.BOS.ServiceFacade.KDServiceFx, Version=8.1.410.13, Culture=neutral, PublicKeyToken=null]] callback)

System.Web.HttpApplication+CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute(System.Web.HttpApplication.ExecuteStepImpl(System.Web.HttpApplication+IExecutionStep step)

System.Web.HttpApplication.ExecuteStep(System.Web.HttpApplication+IExecutionStep step, System.Boolean& completedSynchronously)

System.Web.HttpApplication+PipelineStepManager.ResumeSteps(System.Exception error)

System.Web.HttpApplication.BeginProcessRequestNotification(System.Web.HttpContext context, System.AsyncCallback cb)

System.Web.HttpRuntime.ProcessRequestNotificationPrivate(System.Web.Hosting.IIS7WorkerRequest wr, System.Web.HttpContext context)

System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(System.IntPtr rootedObjectsPointer, System.IntPtr nativeRequestContext, System.IntPtr moduleData, System.Int32 flags)

System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(System.IntPtr rootedObjectsPointer, System.IntPtr nativeRequestContext, System.IntPtr moduleData, System.Int32 flags)

System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(System.IntPtr pHandler, System.Web.RequestNotificationStatus& notificationStatus)

System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(System.IntPtr pHandler, System.Web.RequestNotificationStatus& notificationStatus)

System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(System.IntPtr rootedObjectsPointer, System.IntPtr nativeRequestContext, System.IntPtr moduleData, System.Int32 flags)

System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(System.IntPtr rootedObjectsPointer, System.IntPtr nativeRequestContext, System.IntPtr moduleData, System.Int32 flags)

   

    上面的堆栈信息有一行 Kingdee.BOS.Scripting.PyExpressionEvaluator.ExecuteScope方法调用,有ExecuteScope方法调用的话一般是通过某个值更新或者是实体服务规则触发的(它的第一个参数是一个表达式)。

    当复制一行有税额信息时,弹出的堆栈如下图1-3所示:

image.webp

图1-3 


    上图中的堆栈详细信息如下所示:

e.OldValue: 0, e.NewValue: 11.50

System.RuntimeMethodHandle.InvokeMethod(System.Object target, System.Object[] arguments, System.Signature sig, System.Boolean constructor)

System.Reflection.RuntimeConstructorInfo.Invoke(System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)

Microsoft.Scripting.Interpreter.NewInstruction.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame)

Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame frame)

Microsoft.Scripting.Interpreter.LightLambda.Run3(None arg0, None arg1, None arg2)

__Python.NoneType__.DataChanged$41(System.Runtime.CompilerServices.Closure None, IronPython.Runtime.PythonFunction None, System.Object None)

__Python.NoneType__._Scripting_(System.Object[] None, System.Object None)

Kingdee.BOS.Core.Util.PythonUtil.InvokePy(Microsoft.Scripting.Hosting.ScriptScope scope, System.String name, System.Object args)

Kingdee.BOS.Core.Bill.PlugIn.PythonBillPlugIn.InvokePluginMethod(System.String name, System.Object args)

Kingdee.BOS.Core.DynamicForm.PlugIn.AbstractDynamicFormPlugIn.DataChanged(Kingdee.BOS.Core.DynamicForm.PlugIn.Args.DataChangedEventArgs e)

Kingdee.BOS.Core.DynamicForm.PlugIn.DynamicFormModelPlugInProxy.FireDataChanged(Kingdee.BOS.Core.DynamicForm.PlugIn.Args.DataChangedEventArgs e)

Kingdee.BOS.Core.DynamicForm.AbstractDynamicFormModel.OnDataChanged(Kingdee.BOS.Core.DynamicForm.PlugIn.Args.DataChangedEventArgs arg)

Kingdee.BOS.Core.DynamicForm.AbstractDynamicFormModel.UpdateFieldValue(Kingdee.BOS.Core.Metadata.FieldElement.Field field, Kingdee.BOS.Orm.DataEntity.DynamicObject obj, System.Object value, System.Int32 row)

Kingdee.BOS.Core.DynamicForm.AbstractDynamicFormModel.UpdateField(Kingdee.BOS.Core.Metadata.FieldElement.Field field, Kingdee.BOS.Orm.DataEntity.DynamicObject activeRow, System.Object value, System.Int32 rowIndex, System.Object oldValue)

Kingdee.BOS.Core.DynamicForm.AbstractDynamicFormModel.SetValue(Kingdee.BOS.Core.Metadata.FieldElement.Field field, Kingdee.BOS.Orm.DataEntity.DynamicObject activeRow, System.Object value, System.Int32 rowIndex)

Kingdee.BOS.Core.DynamicForm.AbstractDynamicFormModel.SetValue(Kingdee.BOS.Core.Metadata.FieldElement.Field field, System.Object value, System.Int32 row)

Kingdee.BOS.Core.DynamicForm.AbstractDynamicFormModel.SetValue(System.String key, System.Object value, System.Int32 row)

Kingdee.BOS.Core.DynamicForm.AbstractDynamicFormModel.CopyEntryRowData(Kingdee.BOS.Core.Metadata.EntityElement.Entity entity, Kingdee.BOS.Orm.DataEntity.DynamicObject oldObj, Kingdee.BOS.Orm.DataEntity.DynamicObject newObj, System.Boolean isCopyLinkEntry, System.Int32 rowIndex)

Kingdee.BOS.Core.DynamicForm.AbstractDynamicFormModel.CopyEntryRow(System.String key, System.Int32 row, System.Int32 newRow, System.Boolean isCopyLinkEntry)

Kingdee.BOS.Business.Bill.Operation.CopyEntryRow.CopyEntryRowHandle(System.Int32 copyLocationType)

Kingdee.BOS.Business.Bill.Operation.CopyEntryRow.ExecuteOperation(Kingdee.BOS.Core.DynamicForm.AbstractFormOperation.Execute(Kingdee.BOS.Core.DynamicForm.InvokeFormOperation4WfParam param, Kingdee.BOS.Core.DynamicForm.CallBackWfAfterOperation callbackwf)

Kingdee.BOS.Business.Bill.Operation.AbstractEntryOperation.Execute(Kingdee.BOS.Core.DynamicForm.InvokeFormOperation4WfParam param, Kingdee.BOS.Core.DynamicForm.CallBackWfAfterOperation callbackwf)

Kingdee.BOS.Core.DynamicForm.AbstractFormOperation.Execute(Kingdee.BOS.Web.DynamicForm.OperationCaller.InvokeFormOperation(Kingdee.BOS.Core.DynamicForm.IFormOperation op)

Kingdee.BOS.Web.DynamicForm.AbstractDynamicWebFormView.InvokeFormOperation(Kingdee.BOS.Core.DynamicForm.IFormOperation op)

Kingdee.BOS.Business.DynamicForm.BusinessService.ExcuteOperation.DoAction(Kingdee.BOS.Core.DynamicForm.FormBusinessServiceArgs e)

Kingdee.BOS.Core.DynamicForm.FormBusinessServiceUtil.DoActionMethod(Kingdee.BOS.Core.DynamicForm.IFormBusinessSercice iBusiness, Kingdee.BOS.Core.DynamicForm.FormBusinessServiceArgs e)

Kingdee.BOS.Core.DynamicForm.FormBusinessServiceUtil.DoAction(Kingdee.BOS.Core.DynamicForm.IDynamicFormView view, Kingdee.BOS.Core.DynamicForm.FormBusinessServiceArgs e)

Kingdee.BOS.Core.DynamicForm.FormBusinessServiceUtil.InvokeService(Kingdee.BOS.Core.DynamicForm.IDynamicFormView view, Kingdee.BOS.Core.DynamicForm.FormBusinessServiceArgs e)

Kingdee.BOS.Core.DynamicForm.FormBusinessServiceUtil.InvokeService(Kingdee.BOS.Core.DynamicForm.IDynamicFormView view, System.Object source, Kingdee.BOS.Core.Metadata.FormElement.FormBusinessService service, System.String activeEntity, Kingdee.BOS.Orm.DataEntity.DynamicObject activeRow, System.Int32 rowIndex)

Kingdee.BOS.Core.DynamicForm.FormBusinessServiceUtil.InvokeServices(Kingdee.BOS.Core.DynamicForm.IDynamicFormView view, System.Object source, System.Collections.Generic.IEnumerable`1[[Kingdee.BOS.Core.Metadata.FormElement.FormBusinessService, Kingdee.BOS.Core, Version=8.1.410.13, Culture=neutral, PublicKeyToken=null]] services, System.Int32 actionType, System.String activeEntity, Kingdee.BOS.Orm.DataEntity.DynamicObject activeRow, System.Int32 rowIndex)

Kingdee.BOS.Web.DynamicForm.BusinessServiceCaller.InvokeFormBusiness(Kingdee.BOS.Core.DynamicForm.IDynamicFormView view, System.Object source, System.Collections.Generic.List`1[[Kingdee.BOS.Core.Metadata.FormElement.FormBusinessService, Kingdee.BOS.Core, Version=8.1.410.13, Culture=neutral, PublicKeyToken=null]] formBusinessServices, System.Int32 actionType, System.String entityKey, System.Int32 row)

Kingdee.BOS.Web.DynamicForm.DynamicWebFormView.BarItemClick(System.String parentKey, System.String barItemKey, Kingdee.BOS.Core.Metadata.BarElement.BarDataManager bar, System.Int32 bartype)

Kingdee.BOS.Web.DynamicForm.DynamicWebFormView.EntryBarItemClick(System.String entryKey, System.String barItemKey)

Kingdee.BOS.Web.DynamicForm.DynamicWebFormController.EntryBarItemClick(System.String entryKey, System.String itemKey, Kingdee.BOS.JSON.JSONArray postDatas)

System.RuntimeMethodHandle.InvokeMethod(System.Object target, System.Object[] arguments, System.Signature sig, System.Boolean constructor)

System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(System.Object obj, System.Object[] parameters, System.Object[] arguments)

System.Reflection.RuntimeMethodInfo.Invoke(System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)

Kingdee.BOS.ServiceFacade.ServicesStub.DynamicForm.DynamicFormService.Call(System.String serviceName, System.String pageId, System.String layoutId, System.String methodName, System.Collections.IList pparams, System.Web.Script.Serialization.JavaScriptSerializer js, System.String dbId)

Kingdee.BOS.ServiceFacade.ServicesStub.DynamicForm.DynamicFormService.Call(System.String serviceName, System.String pageId, System.String methodName, Kingdee.BOS.JSON.JSONArray pparams)

System.RuntimeMethodHandle.InvokeMethod(System.Object target, System.Object[] arguments, System.Signature sig, System.Boolean constructor)

System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(System.Object obj, System.Object[] parameters, System.Object[] arguments)

System.Reflection.RuntimeMethodInfo.Invoke(System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)

Kingdee.BOS.ServiceFacade.KDServiceFx.ServiceExecutor.Execute(Kingdee.BOS.ServiceFacade.KDServiceFx.KDServiceContext context, Kingdee.BOS.ServiceFacade.KDServiceFx.ServiceType svcType, System.String[] paraValues, Kingdee.BOS.ServiceFacade.SerializerProxy serializeProxy, Kingdee.BOS.ServiceFacade.KDServiceFx.ServiceType beginMethod)

Kingdee.BOS.ServiceFacade.KDServiceFx.ExecuteServiceModule.OnProcess(Kingdee.BOS.ServiceFacade.KDServiceFx.KDServiceContext context)

Kingdee.BOS.ServiceFacade.KDServiceFx.ModulePipeline.ExcuteRequest(Kingdee.BOS.ServiceFacade.KDServiceFx.KDServiceContext context)

Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExcuteRuntime.BeginRquest(Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExtractor requestExtractor, Kingdee.BOS.ServiceFacade.KDServiceFx.WebContext webCtx)

Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExcuteRuntime.StartRequest(Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExtractor requestExtractor, Kingdee.BOS.ServiceFacade.KDServiceFx.WebContext context)

Kingdee.BOS.ServiceFacade.KDServiceFx.KDSVCHandler.ExecuteRequest(Kingdee.BOS.ServiceFacade.KDServiceFx.WebContext ctx, Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExtractor requestExtractor)

Kingdee.BOS.ServiceFacade.KDServiceFx.KDSVCHandler.ProcessRequestInternal(Kingdee.BOS.ServiceFacade.KDServiceFx.WebContext webCtx, Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExtractor requestExtractor)

Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExtractorQueueManager.RunExtractor(Kingdee.BOS.ServiceFacade.KDServiceFx.WebContext ctx, Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExtractor requestExtractor, System.Action`2[[Kingdee.BOS.ServiceFacade.KDServiceFx.WebContext, Kingdee.BOS.ServiceFacade.KDServiceFx, Version=8.1.410.13, Culture=neutral, PublicKeyToken=null],[Kingdee.BOS.ServiceFacade.KDServiceFx.RequestExtractor, Kingdee.BOS.ServiceFacade.KDServiceFx, Version=8.1.410.13, Culture=neutral, PublicKeyToken=null]] callback)

System.Web.HttpApplication+CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute(System.Web.HttpApplication.ExecuteStepImpl(System.Web.HttpApplication+IExecutionStep step)

System.Web.HttpApplication.ExecuteStep(System.Web.HttpApplication+IExecutionStep step, System.Boolean& completedSynchronously)

System.Web.HttpApplication+PipelineStepManager.ResumeSteps(System.Exception error)

System.Web.HttpApplication.BeginProcessRequestNotification(System.Web.HttpContext context, System.AsyncCallback cb)

System.Web.HttpRuntime.ProcessRequestNotificationPrivate(System.Web.Hosting.IIS7WorkerRequest wr, System.Web.HttpContext context)

System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(System.IntPtr rootedObjectsPointer, System.IntPtr nativeRequestContext, System.IntPtr moduleData, System.Int32 flags)

System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(System.IntPtr rootedObjectsPointer, System.IntPtr nativeRequestContext, System.IntPtr moduleData, System.Int32 flags)

System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(System.IntPtr pHandler, System.Web.RequestNotificationStatus& notificationStatus)

System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(System.IntPtr pHandler, System.Web.RequestNotificationStatus& notificationStatus)

System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(System.IntPtr rootedObjectsPointer, System.IntPtr nativeRequestContext, System.IntPtr moduleData, System.Int32 flags)

System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(System.IntPtr rootedObjectsPointer, System.IntPtr nativeRequestContext, System.IntPtr moduleData, System.Int32 flags)

   

    上面的堆栈信息中有一行 Kingdee.BOS.Business.Bill.Operation.CopyEntryRow.ExecuteOperation 方法调用,它表明是通过 复制行 操作给税额字段赋值的。


MethodCallStack.zip

Python打印堆栈信息

金蝶云星空有很多方法可以修改值,比如通过BOS里面配置值更新事件,通过实体服务规则,抑或通过表单插件DataChanged方法,有的时候实体...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息