采购入库同步金蝶-一直同步中的问题解决

This commit is contained in:
tongfei
2024-04-10 14:28:12 +08:00
parent a03fff91a9
commit e24ce0a3ef
3 changed files with 53 additions and 25 deletions

View File

@@ -788,6 +788,13 @@
<param name="operateId"></param>
<param name="syncStatus"></param>
</member>
<member name="M:WMS.Web.Domain.Entitys.InStock.SyncFailAll(System.String,System.Int32)">
<summary>
全部失败
</summary>
<param name="remark"></param>
<param name="operateId"></param>
</member>
<member name="M:WMS.Web.Domain.Entitys.InStock.RepeatSync">
<summary>
重传

View File

@@ -190,6 +190,19 @@ namespace WMS.Web.Domain.Entitys
this.SyncTime = DateTime.Now;
}
/// <summary>
/// 全部失败
/// </summary>
/// <param name="remark"></param>
/// <param name="operateId"></param>
public void SyncFailAll(string remark, int operateId)
{
this.SuccessSync = SyncStatus.Fail;
this.Remark = remark;
this.OperateId = operateId;
this.SyncTime = DateTime.Now;
}
/// <summary>
/// 重传
/// </summary>

View File

@@ -748,6 +748,8 @@ namespace WMS.Web.Domain.Services
erpDetails.Add(item);
}
if (erpDetails.Count != 0)
{
foreach (var s in erpDetails)
{
var erp_details = entity.ErpDetails
@@ -767,6 +769,12 @@ namespace WMS.Web.Domain.Services
else
entity.SyncFail(res.result.Message, s.ErpDetailId, loginInfo?.UserInfo?.StaffId ?? 0, res.syncStatus);
}
}
else
{
erpDetails_tags.ForEach(x => { x.SuccessSync = SyncStatus.Fail; });
entity.SyncFailAll("同步金蝶失败,金蝶存在已审核的采购入库单", loginInfo?.UserInfo?.StaffId ?? 0);
}
//最好一条一条执行,否则执行失败 但是金蝶那边又同步成功 就会造成数据比价乱
var isSuccess = await sc_InStockRepositories.Update(entity, true);
if (entity == null) return Result.ReFailure(ResultCodes.DateWriteError);