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

单据转换自定义排序

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

单据转换自定义排序

说明:

        通过转换插件事件实现自定义排序,比如子单据体,目前没有任何默认排序,可能源单数据会错乱。

案例:

       实现每行分录下的子单据体按序号排序,前提条件单据体和子单据体都有序号。

实现:

       1.在构建参数事件中加入子单据体序号作为需要取的来源数据

       2.在取到源单据数据后事件中先按单据体序号排序后按子单据体序号排序


插件代码:   

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.ComponentModel;


using Kingdee.BOS;

using Kingdee.BOS.Util;

using Kingdee.BOS.Core.Metadata;

using Kingdee.BOS.Core.Metadata.ConvertElement.PlugIn;

using Kingdee.BOS.Core.Metadata.ConvertElement.PlugIn.Args;

using Kingdee.BOS.Core.Metadata.EntityElement;


 namespace Kingdee.BOS.TestPlugIn.Demo

{

    [HotUpdate]

    [Description("按子单据内码或序号进行排序")]

    public class ConvertSortDemoPlugIn : AbstractConvertPlugIn

    {

        //子单据体序号

        private string _subEntrySeqPropertyName;

//单据体序号

        private string _entrySeqPropertyName;


        /// <summary>

        /// 得到相关属性和加入序号字段

        /// </summary>

        /// <param name="e"></param>

        public override void OnQueryBuilderParemeter(QueryBuilderParemeterEventArgs e)

        {

            base.OnQueryBuilderParemeter(e);

            //前提得存在子单据体的携带,假设子单据的key为FSubEntityKey

            //子单据体默认内码已加入需要查询的字段

            var subEntryEntity = e.SourceBusinessInfo.GetEntryEntity("FSubEntityKey") as SubEntryEntity;

            if(String.IsNullOrWhiteSpace(subEntryEntity.ParentEntity.SeqFieldKey)) return;

            this._entrySeqPropertyName = string.Concat(subEntryEntity.ParentEntity.Key, "_", subEntryEntity.ParentEntity.SeqFieldKey);

            if (!string.IsNullOrWhiteSpace(subEntryEntity.SeqFieldKey))

            {

                //加入子单据提序号查询字段

                string seq = string.Concat(subEntryEntity.

单据转换自定义排序

说明: 通过转换插件事件实现自定义排序,比如子单据体,目前没有任何默认排序,可能源单数据会错乱。案例: 实现每行...
点击下载文档文档为doc格式

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

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