diff --git a/src/WMS.Web.Core/Dto/InStock/PurchaseShelfRequest.cs b/src/WMS.Web.Core/Dto/InStock/PurchaseShelfRequest.cs index 673866bc..de503fe0 100644 --- a/src/WMS.Web.Core/Dto/InStock/PurchaseShelfRequest.cs +++ b/src/WMS.Web.Core/Dto/InStock/PurchaseShelfRequest.cs @@ -1,4 +1,5 @@ -using System; +using Org.BouncyCastle.Asn1.Crmf; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Text; @@ -24,6 +25,9 @@ namespace WMS.Web.Core.Dto.InStock /// public string SubStockCode { get; set; } + + public string instockType { get; set; } + /// /// 明细 /// diff --git a/src/WMS.Web.Domain/Services/InStockService.cs b/src/WMS.Web.Domain/Services/InStockService.cs index 8bcebe15..8c5991fe 100644 --- a/src/WMS.Web.Domain/Services/InStockService.cs +++ b/src/WMS.Web.Domain/Services/InStockService.cs @@ -189,16 +189,31 @@ namespace WMS.Web.Domain.Services bool isTransaction = false; //1.添加入库单:(同步金蝶在save方法里面进行) // var save_result = await this.ShelfSave(instock, InstockType.Purchase, loginInfo, isTransaction); - var save_result = await this.ShelfSave(instock, InstockType.Purchase, loginInfo, isTransaction); - if (!save_result.IsSuccess) isRollback = true; + + InstockType t = new InstockType(); + if (instock.instockType == "ProduceStock") + { + t = InstockType.ProduceSotck; + } + else + { + t = InstockType.Purchase; + } - //实体 - var entity = save_result.Data; - //提交事务 - var isSuccess = _basicsRepositories.CommitTransaction(isRollback, _transaction); - if (!isSuccess) - return save_result; + var save_result = await this.ShelfSave(instock, t, loginInfo, isTransaction); + if (!save_result.IsSuccess) isRollback = true; + + + + //实体 + var entity = save_result.Data; + + //提交事务 + var isSuccess = _basicsRepositories.CommitTransaction(isRollback, _transaction); + if (!isSuccess) + return save_result; + //同步金蝶 if (entity.Type == InstockType.Purchase)