From 51137c6ac62af1ed9481876b7d76f2b7f86825eb Mon Sep 17 00:00:00 2001 From: 18923810322 <1666941798@qq.com> Date: Sat, 5 Jul 2025 16:25:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E4=B8=8A=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dto/InStock/PurchaseShelfRequest.cs | 6 +++- src/WMS.Web.Domain/Services/InStockService.cs | 31 ++++++++++++++----- 2 files changed, 28 insertions(+), 9 deletions(-) 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)