无源单批号拣货!!原创
36人赞赏了该文章
776次浏览
编辑于2024年05月25日 10:25:02
一,其他出库单物料值更新里面配置无源单批号拣货,根据角色分配的发货仓库权限,比如用户只给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重写对应的方法干预过滤数据即可
赞 36
36人点赞
还没有人点赞,快来当第一个点赞的人吧!
打赏
0人打赏
还没有人打赏,快来当第一个打赏的人吧!