批号捡货二次开发插件示例
金蝶云社区-香樟树下
香樟树下
2人赞赏了该文章 898次浏览 未经作者许可,禁止转载编辑于2018年05月18日 12:37:31

批号捡货二次开发插件示例(此例为无源单批号捡货示例代码,单据转换捡货的代码需要切换派生的基类并实现新的基类方法)

工程需引用:
Kingdee.BOS.dll
Kingdee.BOS.DataEntity.dll
Kingdee.k3.SCM.App.Core


using Kingdee.K3.SCM.App.Core.ConvertBusinessService;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ClassLibrary1
{
    public class Class1 : AbstractSinglePickPlugIn
    {
        public override void AfterSinglePicking(Kingdee.K3.SCM.App.Core.ConvertBusinessService.LotPickArgs.AfterSinglePickingArgs arg)
        {
            base.AfterSinglePicking(arg);
        }
        public override bool BeforePicking(Kingdee.K3.SCM.App.Core.ConvertBusinessService.LotPickArgs.BeforePickingArgs e)
        {
            return base.BeforePicking(e);
        }
        public override bool DoPickWhenNoSysSet()
        {
            return base.DoPickWhenNoSysSet();
        }
        public override string RegexGetInvDataSql(string sql, List<Kingdee.BOS.SqlParam> paras)
        {
            return base.RegexGetInvDataSql(sql, paras);
        }
        public override System.Data.DataRow[] RegexSelectResultByCurRowData(Kingdee.K3.SCM.App.Core.ConvertBusinessService.LotPickArgs.RegexSelectResultByCurRowDataArgs e)
        {
            return base.RegexSelectResultByCurRowData(e);
        }
        public override string RegexSinglePickFilterString(Kingdee.K3.SCM.App.Core.ConvertBusinessService.LotPickArgs.RegexSinglePickFilterStringArgs e)
        {
            return base.RegexSinglePickFilterString(e);
        }
        public override string RegexSinglePickSortString(Kingdee.K3.SCM.App.Core.ConvertBusinessService.LotPickArgs.RegexCurRowPickSortStringArgs e)
        {
            return base.RegexSinglePickSortString(e);
        }
        public override void RegexUseableInvData(System.Data.DataTable invDatas)
        {
            base.RegexUseableInvData(invDatas);
        }
    }
}


代码编译后需要在批号捡货配置界面注册插件,插件注册字符串为二次开发插件的类全名,如:ClassLibrary1.Class,ClassLibrary1

编写插件可以在插件方法中对捡货过程进行干预,也可以用于监视调试捡货过程,在这些方法中打上断点,跟踪调试可以看一下捡货的流程,以及执行过程中参数值,如果捡货没有完成也可以看一下是执行到哪一步之后出现问题不再继续执行


单据转换批号捡货二次开发插件


using Kingdee.K3.SCM.App.Core.ConvertBusinessService;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ClassLibrary2
{
    public class Class2 : AbstractLotPickPlugIn
    {
        public override void AfterPicking(Kingdee.K3.SCM.App.Core.ConvertBusinessService.LotPickArgs.AfterPickingArgs e)
        {
            base.AfterPicking(e);
        }

        public override bool BeforePicking(Kingdee.K3.SCM.App.Core.ConvertBusinessService.LotPickArgs.BeforePickingArgs e)
        {
            return base.BeforePicking(e);
        }

        public override bool DoPickWhenNoSysSet()
        {
            return base.DoPickWhenNoSysSet();
        }

        public override string RegexCurRowPickFilterString(Kingdee.K3.SCM.App.Core.ConvertBusinessService.LotPickArgs.RegexCurRowPickFilterStringArgs e)
        {
            return base.RegexCurRowPickFilterString(e);
        }

        public override string RegexCurRowPickSortString(Kingdee.K3.SCM.App.Core.ConvertBusinessService.LotPickArgs.RegexCurRowPickSortStringArgs e)
        {
            return base.RegexCurRowPickSortString(e);
        }

        public override string RegexGetInvDataSql(string sql, List<Kingdee.BOS.SqlParam> paras)
        {
            return base.RegexGetInvDataSql(sql, paras);
        }

        public override void RegexInvDataByCurRowData(Kingdee.K3.SCM.App.Core.ConvertBusinessService.LotPickArgs.RegexInvDataByCurRowDataArgs e)
        {
            base.RegexInvDataByCurRowData(e);
        }

        public override System.Data.DataRow[] RegexSelectResultByCurRowData(Kingdee.K3.SCM.App.Core.ConvertBusinessService.LotPickArgs.RegexSelectResultByCurRowDataArgs e)
        {
            return base.RegexSelectResultByCurRowData(e);
        }

        public override void RegexUseableInvData(System.Data.DataTable invDatas)
        {
            base.RegexUseableInvData(invDatas);
        }
    }
}

图标赞 2
2人点赞
还没有人点赞,快来当第一个点赞的人吧!
图标打赏
0人打赏
还没有人打赏,快来当第一个打赏的人吧!