批号拣货插件
背景:很多客户对系统的批号拣货有个性化需求,在标准系统无法配置实现时,需要通过二开批号拣货插件满足。 场景:涉及录单时无源单批号拣货服务,以及上下游单据下推时(有源单)批号拣货服务。 步骤:1.编写插件继承批号拣货插件基类;2.根据业务需要重载对应事件实现逻辑;3.注册插件至对应服务配置界面。 |
场景一:无源单批号拣货插件
工程需引用:
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 { /// <summary> /// 捡货之前(插件可取消捡货) /// </summary> public override bool BeforePicking(Kingdee.K3.SCM.App.Core.ConvertBusinessService.LotPickArgs.BeforePickingArgs e) { return base.BeforePicking(e); } /// <summary> /// 系统参数设置为不检霍是否需要执行捡货 /// </summary> public override bool DoPickWhenNoSysSet() { return base.DoPickWhenNoSysSet(); } /// <summary> /// 修正解释库存取数脚本 /// </summary> /// <param name="sql">即时库存取数脚本(获得物料范围的即时库存数据信息)</param> /// <param name="paras">即时库存取数参数</param> public override string RegexGetInvDataSql(string sql, List paras) { return base.RegexGetInvDataSql(sql, paras); } /// <summary> /// 处理当前行的捡货库存捡货结果 /// </summary> public override System.Data.DataRow[] RegexSelectResultByCurRowData(Kingdee.K3.SCM.App.Core.ConvertBusinessService.LotPickArgs.RegexSelectResultByCurRowDataArgs e) { return base.RegexSelectResultByCurRowData(e); } /// <summary> /// 无源单单条捡货库存筛选过滤条件 /// </summary> public override string RegexSinglePickFilterString(Kingdee.K3.SCM.App.Core.ConvertBusinessService.LotPickArgs.RegexSinglePickFilterStringArgs e) { return base.RegexSinglePickFilterString(e); } /// <summary> /// 根据当前行数据整理捡货库存筛选排序字符串 /// </summary> public override string RegexSinglePickSortString(Kingdee.K3.SCM.App.Core.ConvertBusinessService.LotPickArgs.RegexCurRowPickSortStringArgs e) { return base.RegexSinglePickSortString(e); } /// <summary> /// 捡货前重整即时库存数据 /// </summary> public override void RegexUseableInvData(System.Data.DataTable invDatas) { base.RegexUseableInvData(invDatas); } /// <summary> /// 完成无源单单条捡货 /// </summary> public override void AfterSinglePicking(Kingdee.K3.SCM.App.Core.ConvertBusinessService.LotPickArgs.AfterSinglePickingArgs arg) { base.AfterSinglePicking(arg); } } }
场景二:有源单批号拣货插件
工程需引用:
Kingdee.BOS.dll
Kingdee.BOS.DataEntity.dll
Kingdee.K3.SCM.App.Core
namespace ClassLibrary2{ public class Class2 : AbstractLotPickPlugIn { 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 paras) { return base.RegexGetInvDataSql(sql, paras); } 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 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); } public override void AfterPicking(Kingdee.K3.SCM.App.Core.ConvertBusinessService.LotPickArgs.AfterPickingArgs e) { base.AfterPicking(e); } /// <summary> /// 获取二开指定的预计出单据取数设置 /// </summary> /// <returns>KeyValue集合,key:单据FormID,Value:包含回溯天数和取数插件类全名,使用冒号隔开,不能有空格,如: 3:test.estbillplugin,test</returns> public override List<KeyValue> GetExtEstoutBillSet() { return base.GetExtEstoutBillSet(); } } }
说明:
1. 代码编译后需要在批号捡货配置界面注册插件,插件注册字符串为二次开发插件的类全名,如:ClassLibrary1.Class,ClassLibrary1
2. 编写插件可以在插件方法中对捡货过程进行干预,也可以用于监视调试捡货过程,在这些方法中打上断点,跟踪调试可以看一下捡货的流程,以及执行过程中参数值,如果捡货没有完成也可以看一下是执行到哪一步之后出现问题不再继续执行
批号拣货插件
背景:很多客户对系统的批号拣货有个性化需求,在标准系统无法配置实现时,需要通过二开批号拣货插件满足。场景:涉及录单时无源单批号拣货...
点击下载文档
本文2024-09-23 02:56:10发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-155646.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章