From 6e761f452504c52a2ffb2d685a6b3f8abd242887 Mon Sep 17 00:00:00 2001 From: tongfei <244188119@qq.com> Date: Thu, 25 Apr 2024 17:22:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/WMS.Web.Domain/Services/InStockService.cs | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/WMS.Web.Domain/Services/InStockService.cs b/src/WMS.Web.Domain/Services/InStockService.cs index 6ea2b860..805844f7 100644 --- a/src/WMS.Web.Domain/Services/InStockService.cs +++ b/src/WMS.Web.Domain/Services/InStockService.cs @@ -963,7 +963,7 @@ namespace WMS.Web.Domain.Services purchaseInStock.Details[0].Lot = new ErpLotSaveDto(); purchaseInStock.Details[0].Lot.Number = erpDetail.BatchBillNo; } - + //保存 _logger.LogInformation($"入库单->下推成功 开始保存 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 数据: {JsonConvert.SerializeObject(purchaseInStock)}"); var res_s = await sc_erpService.Save(purchaseInStock, formId); if (!res_s.IsSuccess) @@ -972,18 +972,15 @@ namespace WMS.Web.Domain.Services 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}"); - //ErpOperateDto o_dto = new ErpOperateDto(formId, res_s.Data);//res_s.Data - //var resSubmit = await sc_erpService.Submit(o_dto, formId); - //if (!resSubmit.IsSuccess) - //{ - // _logger.LogInformation($"入库单->提交失败 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 错误:{resSubmit.Message}"); - // return (resSubmit, SyncStatus.SubmitFail, o_dto.Numbers.First(), purchaseInStock.Details[0].DetailId); - //} + //提交 + _logger.LogInformation($"入库单->保存成功 开始提交 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId}"); + ErpOperateDto o_dto = new ErpOperateDto(formId, res_s.Data);//res_s.Data + var resSubmit = await sc_erpService.Submit(o_dto, formId); + if (!resSubmit.IsSuccess) + { + _logger.LogInformation($"入库单->提交失败 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 错误:{resSubmit.Message}"); + return (resSubmit, SyncStatus.SubmitFail, o_dto.Numbers.First(), purchaseInStock.Details[0].DetailId); + } ////审核 //_logger.LogInformation($"入库单->提交成功 开始审核 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId}"); //resSubmit = await sc_erpService.Audit(o_dto, formId); @@ -994,6 +991,10 @@ namespace WMS.Web.Domain.Services //} //_logger.LogInformation($"入库单->同步金蝶成功->单号:{billNo} erp明细Id:{erpDetail.ErpDetailId}"); //return (Result.ReSuccess(), SyncStatus.Success, o_dto.Numbers.First(), purchaseInStock.Details[0].DetailId); + + _logger.LogInformation($"入库单->测试提交成功->单号:{billNo} erp明细Id:{erpDetail.ErpDetailId}"); + return (Result.ReFailure("测试暂存失败", 10004), SyncStatus.Fail, "", purchaseInStock.Details[0].DetailId); + } catch (Exception ex) {