后台自定义生成序列号

场景:客户想按照自定义的编码规则生成序列号

实现:序列号比较庞大,不能用WebApi直接生成,得利用产品的内部代码进行生成

示例代码如下:

Dictionary<string, object> dicsn = new Dictionary<string, object>();
List<long> orgids = new List<long>();
orgids.Add(long.Parse(OrgID));
List<string> LstSerNO = new List<string>();
for (int xl = SerCount; xl < SerCount + Qty; xl++)
{
     LstSerNO.Add(MatNO + FOldNo + F_DEV_LOTS + xl.ToString().PadLeft(4, '0'));
}
Kingdee.K3.SCM.App.Core.SCMServiceForBD SN = new Kingdee.K3.SCM.App.Core.SCMServiceForBD();
dicsn = SN.SaveSerialMain(this.Context, long.Parse(MatID), orgids, LstSerNO);

posted @ 2019-12-27 20:09  放放的Blog  阅读(555)  评论(0编辑  收藏  举报