金蝶云星空【C#】如何二开调用获取最高BOM版本服务?

tlsoft 11月前 172


【应用场景】

客户需要自定义单据录入物料实现和标准产品一样携带默认最高BOM版本的逻辑,类似生产订单、物料清单正查录入物料默认携带最高BOM版本


【注意事项】

该实现方案涉及二开,需要一定的对星空的开发基础,熟悉C#语言


【服务接口说明】

/// <summary>       
/// 获取最高版本BOM,支持辅助属性        
/// </summary>        
/// <param name="ctx"></param>        
/// <param name="lstMasterOrgId">物料MasterId,使用组织,辅助属性的三值集合</param>        
/// <returns></returns>                
IEnumerable<DynamicObject> GetHightVersionBom(Context ctx, List<Tuple<long, long, long>> lstMasterOrgId);

参数说明:

ctx:上下文;

lstMasterOrgId:分别是物料MasterId,使用组织Id,辅助属性Id的三值集合;(若无辅助属性,可以直接给0,另外两个必录)



【调用方式】

<1>客户端调用:例如表单插件、账表插件(需要引用组件Kingdee.K3.MFG.ServiceHelper.dll

List<Tuple<long, long, long>> dicMasterOrgIds = new List<Tuple<long, long, long>>();
dicMasterOrgIds.Add(new Tuple<long, long, long>(msterId, useOrgId, auxPropId));
List<DynamicObject> highVersionBomDatas = BOMServiceHelper.GetHightVersionBom(this.Context, dicMasterOrgIds).ToList();


<2>服务端调用:例如操作插件(需要引用组件Kingdee.K3.MFG.App.dll

List<Tuple<long, long, long>> dicMasterOrgIds = new List<Tuple<long, long, long>>();
dicMasterOrgIds.Add(new Tuple<long, long, long>(msterId, useOrgId, auxPropId));
List<DynamicObject> highVersionBomDatas=AppServiceContext.GetService<IBOMService>().GetHightVersionBom(ctx, dicMasterOrgIds ).ToList();



【接口验证】

手工在【物料清单正查】录入物料是否自动带出最高BOM版本,与接口返回内码保持一致。

【最高BOM介绍】

一个物料存在多个BOM的情况下,BOM版本携带的优先级判断规则:

按BOM版本从左到右一个字符一个字符进行比较,汉字>字母>数字,字母A-Z,Z最高;数字0-9 , 9最高;汉字拼音a-z , z最高。




最新回复 (0)
返回
发新帖