业务流程.案例.流程激活

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

业务流程.案例.流程激活

【场景】常见的下游单据存在上游但是看全流程图时提示没有关联的数据;又或者下游单据没有反写的问题,大部分是由于流程图不完整导致无法查看/反写 针对这类问题,目前产品端没有很好控制,以下通关变通方案处理 【案例】将归档到文件的流程还原到当前表 <0>查看对象的业务流程表定义 ![Image_20221109144738.webp](/download/010043780ac4d3e94110a69d1162f2e89d04.webp) <1>根据业务对象内码、分录数据和表定义,查询对应单据哪些分录被归档到文件 ![Image_20221109145011.webp](/download/01008f345c3bb4dc4924a1b5bdbe95f49205.webp) <2>根据业务对象表定义,和分录内码,将归档到文件的流程还原 修改一下代码中的tableName和entityIds ```csharp using Kingdee.BOS; using Kingdee.BOS.Core.DynamicForm.PlugIn.Args; using Kingdee.BOS.Core.List.PlugIn; using System; using System.Collections.Generic; namespace DynamicFormPlugIn.Convert { [Kingdee.BOS.Util.HotUpdate] [System.ComponentModel.Description("将业务流文件还原到当前表的插件")] public class BfMoveFileToInstPlugIn : AbstractListPlugIn { public override void BarItemClick(BarItemClickEventArgs e) { if (!string.Equals(e.BarItemKey, "tb_bfAlive", StringComparison.OrdinalIgnoreCase)) return; string tableName = "T_PRD_PPBOMCHANGEENTRY"; List<long> entityIds = new List<long>() { 416461 }; var type = TypesContainer.GetOrRegister("Kingdee.BOS.App.Core.BusinessFlow.Repositories.BFHisDataRepository,Kingdee.BOS.App.Core"); var bfService = Activator.CreateInstance(type,this.Context); var method = bfService.GetType().GetMethod("MoveInstToCurrTable"); try { method.Invoke(bfService, new object[] { tableName, entityIds }); this.View.ShowMessage("激活成功"); } catch(Exception ex) { this.View.ShowErrMessage("激活失败", string.Format("Msg:{0}\r\nStack:{1}", ex.Message, ex.StackTrace)); } } } } ``` ```python #引入clr运行库 import clr #添加对cloud插件开发的常用组件的引用 clr.AddReference("mscorlib") clr.AddReference("Kingdee.BOS") clr.AddReference("Kingdee.BOS.DataEntity") clr.AddReference("Kingdee.BOS.ServiceHelper") clr.AddReference("Kingdee.BOS.Core") #导入cloud基础库中的常用实体对象(分命名空间导入,不会递归导入) from System import * from System.Collections.Generic import * from Kingdee.BOS import * from Kingdee.BOS.DataEntity import * def BarItemClick(e): ##激活指定对象的数据 if (not e.BarItemKey.Equals("tb_bfAlive", StringComparison.OrdinalIgnoreCase)): return; tableName = "T_PRD_PPBOMCHANGEENTRY"; entityIds = List[Int64](); entityIds.Add(416461); bfServiceType = TypesContainer.GetOrRegister("Kingdee.BOS.App.Core.BusinessFlow.Repositories.BFHisDataRepository,Kingdee.BOS.App.Core"); bfService = Activator.CreateInstance(bfServiceType,this.Context); method = bfService.GetType().GetMethod("MoveInstToCurrTable"); paramArray = Array.CreateInstance(object, 2); paramArray[0] = tableName; paramArray[1] = entityIds; method.Invoke(bfService, paramArray); this.View.ShowMessage('激活成功'); ``` 【效果】恢复后对应流程还原到当前表,对应单据能够全流程,没有反写的单据通过重新保存能够反写

业务流程.案例.流程激活

【场景】常见的下游单据存在上游但是看全流程图时提示没有关联的数据;又或者下游单据没有反写的问题,大部分是由于流程图不完整导致无法查...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息