电脑桌面
添加蚂蚁七词文库到电脑桌面
安装后可以在桌面快捷访问

附件.常见问题.单据下推携带附件重复问题

来源:金蝶云社区作者:金蝶2024-09-236

附件.常见问题.单据下推携带附件重复问题

【场景】单据下推携带附件重复问题 【功能】支持版本2303及之后的补丁 ![image.webp](/download/010047345401b6424842a7166b4921abef07.webp) 【方案】历史版本的二开方案 在附件表单BOS_Attachment的保存操作服务插件进行过滤处理,针对同一个文件id进行过滤 ![image.webp](/download/0100309d4f8da1be43d58f43e7645574d218.webp) ```python from System import * def BeginOperationTransaction(e): if e.DataEntitys == None or e.DataEntitys.Length <=0: return; firstBillType = e.DataEntitys[0]['BillType']; handleBillType = ['PUR_PurchaseOrder']; if firstBillType not in handleBillType: return; attachList = []; attachDict= {}; for index in range(e.DataEntitys.Length): attachObj = e.DataEntitys[index]; srcAttId = attachObj['SourceId']; fileId = attachObj['FileId']; if srcAttId != 0 and (fileId != None and len(fileId.strip()) >0): billType = attachObj['BillType']; interId = attachObj['InterID']; key = billType+'_'+interId+'_'+fileId; if attachDict.has_key(key): continue; attachDict[key] = key; attachList.append(attachObj); if(len(attachList) == e.DataEntitys.Length): return; attachArray = Array.CreateInstance(e.DataEntitys[0].GetType(), len(attachList)); for idx in range(len(attachList)): attachArray[idx] = attachList[idx]; e.DataEntitys = attachArray; ``` ```csharp using Kingdee.BOS.Core.DynamicForm.PlugIn; using Kingdee.BOS.Core.DynamicForm.PlugIn.Args; using Kingdee.BOS.Orm.DataEntity; using System.Collections.Generic; namespace DynamicFormPlugIn.Attachment { [System.ComponentModel.Description("携带附件去重")] [Kingdee.BOS.Util.HotUpdate] public class AttSaveValidateOpPlugIn : AbstractOperationServicePlugIn { /// <summary> /// 处理的业务对象标识 /// </summary> HashSet<string> handleBillType = new HashSet<string>() { "PUR_PurchaseOrder" }; public override void BeginOperationTransaction(BeginOperationTransactionArgs e) { if (e.DataEntitys == null || e.DataEntitys.Length <= 0) return; string firstBillType = System.Convert.ToString(e.DataEntitys[0]["BillType"]); if (!handleBillType.Contains(firstBillType)) return; List<DynamicObject> newObjs = new List<DynamicObject>(); Dictionar

附件.常见问题.单据下推携带附件重复问题

【场景】单据下推携带附件重复问题【功能】支持版本2303及之后的补丁![image.webp](/download/010047345401b6424842a7166b4921abef07.webp)...
点击下载文档文档为doc格式

声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

已经是第一篇
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息
QQ群
  • 答案:my7c点击这里加入QQ群
支持邮箱
微信
  • 微信