[解锁库存插件]锁库、解锁二开代码
“库存锁库是动态表单,要想实现锁库、解锁可以调用服务端方法实现:
Kingdee.K3.SCM.App.Core.StockLockService.SaveLockInfo
Kingdee.K3.SCM.App.Core.StockLockService.SaveUnLockInfo。
其中SaveLockInfo(this.Context, argsList); argsList 锁库参数可以反编译锁库客户端插件参考构建:
Kingdee.K3.SCM.Stock.Business.PlugIn.LockOperate
Kingdee.K3.SCM.Stock.Business.PlugIn.LockStockOperate
Kingdee.K3.SCM.Stock.Business.PlugIn.UnLockStockOperate。”
【订单类解锁库存】直接调用平台方法
using Kingdee.K3.SCM.ServiceHelper; List<LockStockArgs> lockStockArgs = StockServiceHelper.GetLockInfoByID(this.Context, string.Join(",", entryIds), "SaleOrder", false); lockStockArgs.ForEach(i => { i.UnLockQty = i.LockQty; //数量 i.UnLockBaseQty = i.LockBaseQty; //基本单位数量 i.UnLockSecQty = i.LockSecQty; //辅数量 i.UnLockNote = "xxx添加解锁"; }); StockServiceHelper.SaveUnLockInfo(this.Context, lockStockArgs, "SaleOrder");//会自动写锁库日志
【解锁库存】:根据维度信息找到即时库存ID,再根据即时库存ID查询锁库信息后解锁
StockLockService service = StockLockService.GetInstance(); //根据库存维度等信息查找即时库存 DynamicObject invStock = service.getInvStockID(this.Context, stockId, stockLocID, lotID, ownerTypeID, ownerID, materialID。。。。).FirstOrDefault(); if ( invStock!=null) { //根据即时库存ID查找锁库信息 List<LockStockArgs> lockStockArgs = service.GetLockInfoByID(this.Context , string.Format("'{0}'", Convert.ToString(invStock["FID"])), "Inv", true); //解锁数量 foreach (LockStockArgs arg in lockStockArgs) { arg.UnLockQty = Qty; arg.UnLockNote = "xxx解锁"; } StockServiceHelper.SaveUnLockInfo(this.Context, stockArgs, "Inv");//会自动写锁库日志 }
StockLockService里面好像没有GetInstance这个参数啊
[解锁库存插件]锁库、解锁二开代码
“库存锁库是动态表单,要想实现锁库、解锁可以调用服务端方法实现:Kingdee.K3.SCM.App.Core.StockLockService.SaveLockInfoKingdee.K3.SC...
点击下载文档
本文2024-09-16 17:18:50发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-14898.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章