优化
This commit is contained in:
@@ -854,8 +854,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
erpDetails.Add(item);
|
erpDetails.Add(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (erpDetails.Count != 0)
|
|
||||||
{
|
|
||||||
foreach (var det in erpDetails)
|
foreach (var det in erpDetails)
|
||||||
{
|
{
|
||||||
var erp_details = entity.ErpDetails
|
var erp_details = entity.ErpDetails
|
||||||
@@ -878,7 +877,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
var currentDet = details.Where(x => x.Qty == det.Qty).FirstOrDefault();
|
var currentDet = details.Where(x => x.Qty == det.Qty).FirstOrDefault();
|
||||||
if (currentDet != null)
|
if (currentDet != null)
|
||||||
{
|
{
|
||||||
var res= await this.QueryFirst(currentDet, erpDto.FormId, entity.BillNo, det, sc_erpService);
|
var res = await this.QueryFirst(currentDet, erpDto.FormId, entity.BillNo, det, sc_erpService);
|
||||||
if (res.result.IsSuccess)
|
if (res.result.IsSuccess)
|
||||||
entity.SyncSuccess(det.ErpDetailId, loginInfo?.UserInfo?.StaffId ?? 0, res.erpBillNo);
|
entity.SyncSuccess(det.ErpDetailId, loginInfo?.UserInfo?.StaffId ?? 0, res.erpBillNo);
|
||||||
else
|
else
|
||||||
@@ -895,12 +894,12 @@ namespace WMS.Web.Domain.Services
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
//else
|
||||||
{
|
//{
|
||||||
erpDetails_tags.ForEach(x => { x.SuccessSync = SyncStatus.Fail; });
|
// erpDetails_tags.ForEach(x => { x.SuccessSync = SyncStatus.Fail; });
|
||||||
entity.SyncFailAll("同步金蝶失败,该采购单已存在采购入库单", loginInfo?.UserInfo?.StaffId ?? 0);
|
// entity.SyncFailAll("同步金蝶失败,该采购单已存在采购入库单", loginInfo?.UserInfo?.StaffId ?? 0);
|
||||||
}
|
//}
|
||||||
//最好一条一条执行,否则执行失败 但是金蝶那边又同步成功 就会造成数据比价乱
|
//最好一条一条执行,否则执行失败 但是金蝶那边又同步成功 就会造成数据比价乱
|
||||||
var isSuccess = await sc_InStockRepositories.Update(entity, true);
|
var isSuccess = await sc_InStockRepositories.Update(entity, true);
|
||||||
if (!isSuccess) return Result.ReFailure(ResultCodes.DateWriteError);
|
if (!isSuccess) return Result.ReFailure(ResultCodes.DateWriteError);
|
||||||
|
|||||||
Reference in New Issue
Block a user