无源单批号拣货!!
一,其他出库单物料值更新里面配置无源单批号拣货,根据角色分配的发货仓库权限,比如用户只给A仓库权限,选择其他仓库的物料就不拣货出来!,代码实现如下,代码继承AbstractSinglePickPlugIn无源单批号拣货父类,重写RegexSinglePickFilterString干预过滤拣货数据
using Kingdee.BOS.Core.Permission.Objects; using Kingdee.BOS.Orm.DataEntity; using Kingdee.BOS.ServiceHelper; using Kingdee.BOS.Util; using Kingdee.K3.SCM.App.Core.ConvertBusinessService; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Linq; namespace kingdee.caida.BusinessPlugIn { [HotUpdate] [Description("无源单批号拣货")] public class LotPickStockFilter : AbstractSinglePickPlugIn { /// <summary> /// 无源单单条捡货库存筛选过滤条件 /// </summary> public override string RegexSinglePickFilterString(Kingdee.K3.SCM.App.Core.ConvertBusinessService.LotPickArgs.RegexSinglePickFilterStringArgs e) { string formId = this.BillInfo.GetForm().Id; List<BaseDataTempTable> lstBaseTempTable = PermissionServiceHelper.GetBaseDataTempTable(this.Ctx, formId); string stockDataRuleTemp = (from p in lstBaseTempTable where p.BaseDataFormId.EqualsIgnoreCase("BD_STOCK") select p.TempTable).FirstOrDefault(); string stockid = ""; if (!stockDataRuleTemp.IsNullOrEmptyOrWhiteSpace()) { //查询设置权限的仓库id string stockSql = string.Format(@"SELECT tmp.*, ST.FNUMBER, TL.FNAME FROM {0} tmp JOIN T_BD_STOCK ST ON tmp.fstockid = ST.FSTOCKID JOIN T_BD_STOCK_L TL ON ST.FSTOCKID = TL.FSTOCKID", stockDataRuleTemp); DynamicObjectCollection data = DBServiceHelper.ExecuteDynamicObject(this.Ctx, stockSql); foreach (var dd in data) { stockid += dd["FSTOCKID"] + ","; } } string stockwher = stockid.IsNullOrEmptyOrWhiteSpace() ? "" : " and TI.FSTOCKID in(" + stockid.Remove(stockid.Length - 1, 1) + ")"; string where = base.RegexSinglePickFilterString(e) + stockwher; return where; } } }
2、注册插件
二,有源单批号拣货继承AbstractLotPickPlugIn重写对应的方法干预过滤数据即可
无源单批号拣货!!
一,其他出库单物料值更新里面配置无源单批号拣货,根据角色分配的发货仓库权限,比如用户只给A仓库权限,选择其他仓库的物料就不拣货出来...
点击下载文档
本文2024-09-16 18:32:05发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-22771.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章