shanji 3 years ago
parent
commit
28df443a9d
  1. 65
      BBWY.Client/ViewModels/FinancialTerminal/ProcurementAuditViewModel.cs

65
BBWY.Client/ViewModels/FinancialTerminal/ProcurementAuditViewModel.cs

@ -246,67 +246,6 @@ namespace BBWY.Client.ViewModels
} }
} }
//private void AuditByPurchaseOrder(EventWaitHandle ewh)
//{
// try
// {
// foreach (var purchaseOrder in AuditPurchaseOrderList)
// {
// #region 匹配账单
// var relationPayBill = AuditPayBillList.FirstOrDefault(b => b.MerchantOrderNo == purchaseOrder.PurchaseOrderId);
// if (relationPayBill == null)
// {
// //未通过商户订单号找到采购单,则通过账单金额和日期匹配
// relationPayBill = AuditPayBillList.FirstOrDefault(b => purchaseOrder.PayAmount == b.ExpenditureAmount &&
// purchaseOrder.PayTime != null && b.PayTime != null &&
// Math.Abs((b.PayTime.Value - purchaseOrder.PayTime.Value).TotalSeconds) <= 60);
// }
// if (relationPayBill == null)
// {
// purchaseOrder.ErrorMessage = "未匹配支付账单";
// continue;
// }
// purchaseOrder.RelationPayBillNo = relationPayBill.PayBillNo;
// #endregion
// #region 匹配销售单
// var relationShopOrder = AuditShopOrderList.FirstOrDefault(o => (!string.IsNullOrEmpty(o.VenderRemark) && o.VenderRemark.Contains(purchaseOrder.PurchaseOrderId)) ||
// (o.Phone == purchaseOrder.Phone &&
// o.ContactName == purchaseOrder.ContactName &&
// o.PayTime != null && purchaseOrder.PayTime != null &&
// (purchaseOrder.PayTime.Value - o.PayTime.Value).TotalDays <= 2));
// if (relationShopOrder == null)
// {
// purchaseOrder.ErrorMessage = "未匹配销售订单";
// continue;
// }
// purchaseOrder.RelationShopOrderId = relationShopOrder.OrderId;
// #endregion
// }
// var relationShopOrderIds = AuditPurchaseOrderList.Where(p => !string.IsNullOrEmpty(p.RelationShopOrderId)).Select(p => p.RelationShopOrderId).ToList();
// var belongResponse = shopService.GetOrderBelongShop(relationShopOrderIds);
// if (!belongResponse.Success || belongResponse.Data.Count() == 0)
// return;
// foreach (var purchaseOrder in AuditPurchaseOrderList)
// {
// if (string.IsNullOrEmpty(purchaseOrder.RelationShopOrderId))
// continue;
// var belongShop = belongResponse.Data.FirstOrDefault(x => x.OrderIdList.Contains(purchaseOrder.RelationShopOrderId));
// if (belongShop != null)
// purchaseOrder.BelongShop = belongShop.ShopName;
// }
// }
// catch (Exception ex)
// {
// App.Current.Dispatcher.Invoke(() => MessageBox.Show(ex.Message, "采购单匹配"));
// }
// finally
// {
// ewh.Set();
// }
//}
private void ClearAudit() private void ClearAudit()
{ {
SelectAuditFile = null; SelectAuditFile = null;
@ -420,9 +359,13 @@ namespace BBWY.Client.ViewModels
Remark = array[11] Remark = array[11]
}; };
payBill.MerchantOrderNo = payBill.SourceMerchantOrderNo; payBill.MerchantOrderNo = payBill.SourceMerchantOrderNo;
if (payBill.SourceMerchantOrderNo.StartsWith("T50060NP")) if (payBill.SourceMerchantOrderNo.StartsWith("T50060NP"))
payBill.MerchantOrderNo = payBill.SourceMerchantOrderNo.Substring(8); payBill.MerchantOrderNo = payBill.SourceMerchantOrderNo.Substring(8);
if(payBill.SourceMerchantOrderNo.StartsWith("T200P"))
payBill.MerchantOrderNo = payBill.SourceMerchantOrderNo.Substring(5);
AuditPayBillList.Add(payBill); AuditPayBillList.Add(payBill);
} }
} }

Loading…
Cancel
Save