去掉注释

This commit is contained in:
tongfei
2024-04-25 16:12:03 +08:00
parent 81bd764a72
commit 87836346ea
5 changed files with 7 additions and 86 deletions

View File

@@ -103,28 +103,7 @@ namespace WMS.Web.Domain.Services
{
foreach (var entity in list)
{
var res = await this.PurchaseInStock(entity, loginInfo, 0);
if (!res.IsSuccess)
_logger.LogError($"入库单同步失败:{res.Message}");
}
});
return Task.FromResult(Result.ReSuccess());
}
public Task<Result> Sync(OperateRequest dto, LoginInDto loginInfo, int errorType)
{
var list = _inStockRepositories.GetList(dto.Ids).GetAwaiter().GetResult();
var isSuccess = true;
list = list.Where(w => w.SuccessSync == SyncStatus.Fail).ToList();
list.ForEach(f => f.RepeatSync());
isSuccess = _inStockRepositories.UpdateRange(list, true).GetAwaiter().GetResult();
Task.Run(async () =>
{
foreach (var entity in list)
{
var res = await this.PurchaseInStock(entity, loginInfo, errorType);
var res = await this.PurchaseInStock(entity, loginInfo);
if (!res.IsSuccess)
_logger.LogError($"入库单同步失败:{res.Message}");
}
@@ -848,7 +827,7 @@ namespace WMS.Web.Domain.Services
/// <param name="entity"></param>
/// <param name="loginInfo"></param>
/// <returns></returns>
private async Task<Result> PurchaseInStock(InStock entity, LoginInDto loginInfo, int errorType)
private async Task<Result> PurchaseInStock(InStock entity, LoginInDto loginInfo)
{
_logger.LogInformation($"采购下推-同步:{JsonConvert.SerializeObject(entity)} 操作人:{loginInfo.UserInfo.StaffId}");
var scope = _serviceScopeFactory.CreateScope();
@@ -913,7 +892,7 @@ namespace WMS.Web.Domain.Services
else
{
//下推金蝶
var res = await this.Push(erpDto, det, entity.BillNo, sc_erpService, sc_inStockRepositories, errorType);
var res = await this.Push(erpDto, det, entity.BillNo, sc_erpService, sc_inStockRepositories);
if (res.result.IsSuccess)
entity.SyncSuccess(det.ErpDetailId, loginInfo?.UserInfo?.StaffId ?? 0, res.erpBillNo);
else
@@ -937,7 +916,7 @@ namespace WMS.Web.Domain.Services
/// <param name="erpDetail"></param>
/// <param name="billNo"></param>
/// <returns></returns>
private async Task<(Result result, SyncStatus syncStatus, string erpBillNo, string instockDetailId)> Push(ErpPushDto dto, InStockErpDetails erpDetail, string billNo, IErpService sc_erpService, IInStockRepositories sc_inStockRepositories, int errorType)
private async Task<(Result result, SyncStatus syncStatus, string erpBillNo, string instockDetailId)> Push(ErpPushDto dto, InStockErpDetails erpDetail, string billNo, IErpService sc_erpService, IInStockRepositories sc_inStockRepositories)
{
var erp_instock_detId = string.Empty;
try
@@ -956,10 +935,7 @@ namespace WMS.Web.Domain.Services
purchaseInStock.Details[0].Qty = erpDetail.Qty;
string formId = dto.TargetFormId.ToString();
erp_instock_detId = purchaseInStock.Details[0].DetailId;
if (errorType == 1)
{
int tt = Convert.ToInt32("abc");
}
//批号生成和同步
if (string.IsNullOrEmpty(erpDetail.BatchBillNo))
{
@@ -995,10 +971,6 @@ namespace WMS.Web.Domain.Services
_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);
}
if (errorType == 2)
{
int tt = Convert.ToInt32("abc");
}
//提交
_logger.LogInformation($"入库单->保存成功 开始提交 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId}");
ErpOperateDto o_dto = new ErpOperateDto(formId, res_s.Data);//res_s.Data
@@ -1008,11 +980,6 @@ namespace WMS.Web.Domain.Services
_logger.LogInformation($"入库单->提交失败 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 错误:{resSubmit.Message}");
return (resSubmit, SyncStatus.SubmitFail, o_dto.Numbers.First(), purchaseInStock.Details[0].DetailId);
}
if (errorType == 3)
{
int tt = Convert.ToInt32("abc");
}
//审核
_logger.LogInformation($"入库单->提交成功 开始审核 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId}");
resSubmit = await sc_erpService.Audit(o_dto, formId);