【插件开发】获取WebApi保存Json数据
private string GetNewSaveJson() { // SaveDesigner为保存操作的设计组件,其他操作请查询T_MDL_FormOperationType 表格 var designerClass = "Kingdee.BOS.Business.Bill.OperationService.SaveDesigner,Kingdee.BOS.Business.Bill"; var designType = TypesContainer.GetOrRegister(designerClass); var designer = Activator.CreateInstance(designType) as OperationWebServiceDesigner; designer.OperationId = "Save"; designer.IsWebApi = true; var meta = FormMetaDataCache.GetCachedFormMetaData(Context, "BD_MATERIAL"); var model = designer.CreateServiceModel(Context, meta, null) as FormServiceModel; // WebApiParamHelper 为内部封装WebApi帮助类,没有对外发布,需要用发射调用获取JSON var webApiHelperClass = "Kingdee.BOS.Business.PlugIn.DynamicService.WebApiParamHelper,Kingdee.BOS.Business.PlugIn"; var webApiHelperType = TypesContainer.GetOrRegister(webApiHelperClass); var webApiHelper = Activator.CreateInstance(webApiHelperType); var getJsonData = webApiHelperType.GetMethod("GetJSONData", new Type[] {typeof(DTOType), typeof(bool)}); var jsonStr = getJsonData?.Invoke(webApiHelper, new object[] {model?.RequestDTOType, true}) .GetString(); return jsonStr; }
非常感谢,
另外下面这三个呢?
OperationWebServiceDesigner
FormMetaDataCache
FormServiceModel
TypesContainer 之类的,是引用的哪里的dll?
【插件开发】获取WebApi保存Json数据
private string GetNewSaveJson(){ // SaveDesigner为保存操作的设计组件,其他操作请查询T_MDL_FormOperationType 表格 var designe...
点击下载文档
本文2024-09-16 17:24:05发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-15472.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章