操作服务插件(Python)

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

操作服务插件(Python)

源码来自敏蝶老李头


做个笔记,方便查询

import clr
clr.AddReference("System")
clr.AddReference("System.Core")
clr.AddReference("Kingdee.BOS") 
clr.AddReference("Kingdee.BOS.Core") 
clr.AddReference("Kingdee.BOS.DataEntity") 
clr.AddReference('Kingdee.BOS.ServiceHelper')
clr.AddReference('Kingdee.BOS.App')
clr.AddReference("Newtonsoft.Json") 

from Kingdee.BOS import *
from Kingdee.BOS.Core import *
from Kingdee.BOS.App import *
from Kingdee.BOS.App.Data import * 
from Kingdee.BOS.Util import *
from Kingdee.BOS.Core.DynamicForm import *
from Kingdee.BOS.Core.DynamicForm.PlugIn import *
from Kingdee.BOS.Core.DynamicForm.PlugIn.Args import *
from Kingdee.BOS.Core.Metadata.FormElement import * 
from Kingdee.BOS.ServiceHelper import *

from System import *
from System.Net import *
from System.IO import *
from System.Linq import *
from System.Text import *
from Newtonsoft.Json import *
from Newtonsoft.Json.Linq import *

def AfterExecuteOperationTransaction(e):
    #this.OperationResult.IsShowMessage = True
    #保存之后 Operation_Save
    #提交之后 Operation_Submit
    #审核之后 Operation_Audit
    billid = ""
    billno=""
    if this.FormOperation.OperationId == FormOperation.Operation_Save:
        obj = e.DataEntitys;
        for  item in obj:
            billid = item["Id"].ToString()
            billno = item["BillNo"].ToString()
        if billid is not None and billid!="":
            sql="exec u_gx_somu {0}".format(billid)
            DBUtils.Execute(this.Context,sql)
            #result=OperateResult()
            #result.SuccessStatus = True
            #result.PKValue = billid
            #result.Number = billno
            #result.Message = "{0}".format(billid+"\r\n"+sql)
            #this.OperationResult.OperateResult.Add(result)


操作服务插件(Python)

源码来自敏蝶老李头做个笔记,方便查询import clrclr.AddReference("System")clr.AddReference("System.Core")clr.AddReference("Kingdee.B...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息