diff --git a/src/WMS.Web.Domain/Services/InStockService.cs b/src/WMS.Web.Domain/Services/InStockService.cs index 353e914d..6ea2b860 100644 --- a/src/WMS.Web.Domain/Services/InStockService.cs +++ b/src/WMS.Web.Domain/Services/InStockService.cs @@ -964,17 +964,17 @@ namespace WMS.Web.Domain.Services purchaseInStock.Details[0].Lot.Number = erpDetail.BatchBillNo; } - _logger.LogInformation($"入库单->暂存成功->单号:{billNo} erp明细Id:{erpDetail.ErpDetailId}"); - return (Result.ReFailure("测试暂存失败",10004), SyncStatus.Fail,"", purchaseInStock.Details[0].DetailId); + _logger.LogInformation($"入库单->下推成功 开始保存 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 数据: {JsonConvert.SerializeObject(purchaseInStock)}"); + var res_s = await sc_erpService.Save(purchaseInStock, formId); + if (!res_s.IsSuccess) + { + _logger.LogInformation($"入库单->保存失败 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 错误:{res_s.Message}"); + return (Result.ReFailure(res_s.Message, res_s.Status), SyncStatus.SubmitFail, "", purchaseInStock.Details[0].DetailId); + } + _logger.LogInformation($"入库单->保存成功->单号:{billNo} erp明细Id:{erpDetail.ErpDetailId}"); + return (Result.ReFailure("测试暂存失败", 10004), SyncStatus.Fail, "", purchaseInStock.Details[0].DetailId); - //_logger.LogInformation($"入库单->下推成功 开始保存 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 数据: {JsonConvert.SerializeObject(purchaseInStock)}"); - //var res_s = await sc_erpService.Save(purchaseInStock, formId); - //if (!res_s.IsSuccess) - //{ - // _logger.LogInformation($"入库单->保存失败 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 错误:{res_s.Message}"); - // return (Result.ReFailure(res_s.Message, res_s.Status), SyncStatus.SubmitFail, "", purchaseInStock.Details[0].DetailId); - //} ////提交 //_logger.LogInformation($"入库单->保存成功 开始提交 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId}"); //ErpOperateDto o_dto = new ErpOperateDto(formId, res_s.Data);//res_s.Data