59 lines
2.1 KiB
Python
59 lines
2.1 KiB
Python
|
|
#引入clr运行库
|
|||
|
|
import clr
|
|||
|
|
#添加对cloud插件开发的常用组件引用
|
|||
|
|
clr.AddReference('System')
|
|||
|
|
clr.AddReference('System.Data')
|
|||
|
|
clr.AddReference('Kingdee.BOS')
|
|||
|
|
clr.AddReference('Kingdee.BOS.Core')
|
|||
|
|
clr.AddReference('Kingdee.BOS.App')
|
|||
|
|
clr.AddReference('Kingdee.BOS.App.Core')
|
|||
|
|
clr.AddReference('Kingdee.BOS.Contracts')
|
|||
|
|
clr.AddReference('Kingdee.BOS.DataEntity')
|
|||
|
|
clr.AddReference('Kingdee.BOS.ServiceHelper')
|
|||
|
|
#dairycloud基础库中的常用实体对象(分命名空间导入,不会递归导入)
|
|||
|
|
from Kingdee.BOS.Core import *
|
|||
|
|
from Kingdee.BOS.Util import *
|
|||
|
|
from Kingdee.BOS.Core.Bill import *
|
|||
|
|
from Kingdee.BOS.Core.List import *
|
|||
|
|
from Kingdee.BOS.Core.Bill.PlugIn import *
|
|||
|
|
from Kingdee.BOS.Orm.DataEntity import *
|
|||
|
|
from Kingdee.BOS.Core.DynamicForm.PlugIn import *
|
|||
|
|
from Kingdee.BOS.Core.DynamicForm.PlugIn.Args import *
|
|||
|
|
from Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel import *
|
|||
|
|
from Kingdee.BOS.Core.Metadata.ConvertElement.ServiceArgs import *
|
|||
|
|
from System import *
|
|||
|
|
from System.Data import *
|
|||
|
|
from Kingdee.BOS.App.Data import *
|
|||
|
|
from Kingdee.BOS.App import *
|
|||
|
|
from Kingdee.BOS.Orm import *
|
|||
|
|
from Kingdee.BOS.Contracts import *
|
|||
|
|
from System.Collections.Generic import List
|
|||
|
|
from Kingdee.BOS.ServiceHelper import *
|
|||
|
|
from Kingdee.BOS.App.Core import *
|
|||
|
|
|
|||
|
|
def OnPreparePropertys(e):
|
|||
|
|
# e.FieldKeys.Add("FPMoBillTypeId_Id")
|
|||
|
|
e.FieldKeys.Add("FShowEntryID")
|
|||
|
|
|
|||
|
|
|
|||
|
|
def EndOperationTransaction(e):
|
|||
|
|
# * 保存8提交9审核1反审核26删除3
|
|||
|
|
if this.FormOperation.OperationId == 8:
|
|||
|
|
WriteBackFShowEntryID(e.DataEntitys);
|
|||
|
|
|
|||
|
|
def WriteBackFShowEntryID(dataEntitys):
|
|||
|
|
|
|||
|
|
entryIds = List[str]()
|
|||
|
|
for item in dataEntitys:
|
|||
|
|
# raise Exception(JsonUtil.Serialize(item))
|
|||
|
|
for entity in item.PUR_ReceiveEntry:
|
|||
|
|
FShowEntryID = entity["FShowEntryID"]
|
|||
|
|
if FShowEntryID == 0:
|
|||
|
|
entryIds.Add(str(entity["Id"]))
|
|||
|
|
|
|||
|
|
if entryIds.Count > 0:
|
|||
|
|
sqlL = """/*dialect*/
|
|||
|
|
UPDATE T_PUR_RECEIVEENTRY SET FShowEntryID = FENTRYID WHERE FENTRYID IN ({0})
|
|||
|
|
""".format(",".join(entryIds))
|
|||
|
|
|
|||
|
|
DBUtils.Execute(this.Context, sqlL);
|