From 6ce2e55507e8379f84967197411c6212adfe4b77 Mon Sep 17 00:00:00 2001 From: tongfei <244188119@qq.com> Date: Wed, 24 Apr 2024 14:06:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=90=8C=E6=AD=A5=E9=87=91?= =?UTF-8?q?=E8=9D=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/WMS.Web.Domain/Entitys/InStock.cs | 2 +- src/WMS.Web.Domain/Services/InStockService.cs | 28 ++++++++++++++----- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/WMS.Web.Domain/Entitys/InStock.cs b/src/WMS.Web.Domain/Entitys/InStock.cs index 1bc6c4ea..7ae7f374 100644 --- a/src/WMS.Web.Domain/Entitys/InStock.cs +++ b/src/WMS.Web.Domain/Entitys/InStock.cs @@ -212,7 +212,7 @@ namespace WMS.Web.Domain.Entitys if (this.SuccessSync != SyncStatus.Fail) return; this.SuccessSync = SyncStatus.SyncIng; var erpDetails = this.ErpDetails - .Where(w => w.SuccessSync == SyncStatus.Fail) + .Where(w => w.SuccessSync == SyncStatus.Fail || w.SuccessSync==SyncStatus.SubmitFail || w.SuccessSync == SyncStatus.CheckFail) .ToList(); foreach (var e in erpDetails) { diff --git a/src/WMS.Web.Domain/Services/InStockService.cs b/src/WMS.Web.Domain/Services/InStockService.cs index 3c6f308d..7fa16bfa 100644 --- a/src/WMS.Web.Domain/Services/InStockService.cs +++ b/src/WMS.Web.Domain/Services/InStockService.cs @@ -877,7 +877,7 @@ namespace WMS.Web.Domain.Services var currentDet = details.Where(x => x.Qty == det.Qty).FirstOrDefault(); if (currentDet != null) { - var res = await this.QueryFirst(currentDet, erpDto.FormId, entity.BillNo, det, sc_erpService); + var res = await this.QueryFirst(currentDet, erpDto.TargetFormId, entity.BillNo, det, sc_erpService); if (res.result.IsSuccess) entity.SyncSuccess(det.ErpDetailId, loginInfo?.UserInfo?.StaffId ?? 0, res.erpBillNo); else @@ -894,12 +894,6 @@ namespace WMS.Web.Domain.Services } } - - //else - //{ - // erpDetails_tags.ForEach(x => { x.SuccessSync = SyncStatus.Fail; }); - // entity.SyncFailAll("同步金蝶失败,该采购单已存在采购入库单", loginInfo?.UserInfo?.StaffId ?? 0); - //} //最好一条一条执行,否则执行失败 但是金蝶那边又同步成功 就会造成数据比价乱 var isSuccess = await sc_InStockRepositories.Update(entity, true); if (!isSuccess) return Result.ReFailure(ResultCodes.DateWriteError); @@ -1072,6 +1066,26 @@ namespace WMS.Web.Domain.Services _logger.LogInformation($"入库单->审核失败 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 错误:{resSubmit.Message}"); return (resSubmit, SyncStatus.CheckFail, o_dto.Numbers.First()); } + } + else if (currentDet.DocumentStatus == ErpOrderStatus.D.ToString()) + { + //提交 + _logger.LogInformation($"入库单->查询到已有重新审核的入库单 开始提交 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId}"); + 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()); + } + + //审核 + _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()); + } } else if (currentDet.DocumentStatus == ErpOrderStatus.C.ToString()) {