|
|
@ -1,4 +1,5 @@ |
|
|
|
using BBWY.Client.Extensions; |
|
|
|
using BBWY.Client.APIServices; |
|
|
|
using BBWY.Client.Extensions; |
|
|
|
using BBWY.Client.Models; |
|
|
|
using BBWY.Common.Models; |
|
|
|
using GalaSoft.MvvmLight.Command; |
|
|
@ -25,6 +26,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
private bool isShowPurchaseOrderPanel; |
|
|
|
private bool isShowShopOrderPanel; |
|
|
|
private bool onlyException; |
|
|
|
private ShopService shopService; |
|
|
|
|
|
|
|
public IList<AuditFile> AuditFileList { get; set; } |
|
|
|
|
|
|
@ -114,12 +116,13 @@ namespace BBWY.Client.ViewModels |
|
|
|
|
|
|
|
public ICommand ImportJDShopOrderCommand { get; set; } |
|
|
|
|
|
|
|
public ProcurementAuditViewModel() |
|
|
|
public ProcurementAuditViewModel(ShopService shopService) |
|
|
|
{ |
|
|
|
AuditFileList = new ObservableCollection<AuditFile>(); |
|
|
|
AuditCommand = new RelayCommand(Audit); |
|
|
|
ClearAuditCommand = new RelayCommand(ClearAudit); |
|
|
|
ImportAliPayBillCommand = new RelayCommand(ImportAliPayBill); |
|
|
|
this.shopService = shopService; |
|
|
|
|
|
|
|
|
|
|
|
Import1688PurchaseOrderCommand = new RelayCommand(Import1688PurchaseOrder); |
|
|
@ -214,6 +217,20 @@ namespace BBWY.Client.ViewModels |
|
|
|
payBill.RelationShopOrderId = relationShopOrder.OrderId; |
|
|
|
#endregion
|
|
|
|
} |
|
|
|
|
|
|
|
var relationShoporderIds = AuditPayBillList.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 payBill in AuditPayBillList) |
|
|
|
{ |
|
|
|
if (string.IsNullOrEmpty(payBill.RelationShopOrderId)) |
|
|
|
continue; |
|
|
|
var belongShop = belongResponse.Data.FirstOrDefault(x => x.OrderIdList.Contains(payBill.RelationShopOrderId)); |
|
|
|
if (belongShop != null) |
|
|
|
payBill.BelongShop = belongShop.ShopName; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
@ -262,6 +279,19 @@ namespace BBWY.Client.ViewModels |
|
|
|
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) |
|
|
|
{ |
|
|
|