This commit is contained in:
tongfei
2024-04-25 17:01:03 +08:00
parent 87836346ea
commit 9329de85d0

View File

@@ -964,32 +964,36 @@ namespace WMS.Web.Domain.Services
purchaseInStock.Details[0].Lot.Number = erpDetail.BatchBillNo;
}
_logger.LogInformation($"入库单->下推成功 开始保存 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 数据: {JsonConvert.SerializeObject(purchaseInStock)}");
var res_s = await sc_erpService.Save<ErpPurchaseInStockSaveDto>(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
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);
if (!resSubmit.IsSuccess)
{
_logger.LogInformation($"入库单->审核失败 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 错误:{resSubmit.Message}");
return (resSubmit, SyncStatus.CheckFail, o_dto.Numbers.First(), purchaseInStock.Details[0].DetailId);
}
_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);
//_logger.LogInformation($"入库单->下推成功 开始保存 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 数据: {JsonConvert.SerializeObject(purchaseInStock)}");
//var res_s = await sc_erpService.Save<ErpPurchaseInStockSaveDto>(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
//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);
//if (!resSubmit.IsSuccess)
//{
// _logger.LogInformation($"入库单->审核失败 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 错误:{resSubmit.Message}");
// return (resSubmit, SyncStatus.CheckFail, o_dto.Numbers.First(), purchaseInStock.Details[0].DetailId);
//}
//_logger.LogInformation($"入库单->同步金蝶成功->单号:{billNo} erp明细Id:{erpDetail.ErpDetailId}");
//return (Result.ReSuccess(), SyncStatus.Success, o_dto.Numbers.First(), purchaseInStock.Details[0].DetailId);
}
catch (Exception ex)
{