shanji 3 years ago
parent
commit
96983470fa
  1. 9
      BBWY.Client/APIServices/ShopService.cs
  2. 1
      BBWY.Client/App.xaml
  3. 1
      BBWY.Client/BBWY.Client.csproj
  4. 32
      BBWY.Client/Models/Shop/Department.cs
  5. 493
      BBWY.Client/ViewModels/FinancialTerminal/ProcurementAuditViewModel.cs
  6. 17
      BBWY.Client/Views/FinancialTerminal/ProcurementAudit.xaml
  7. 5
      BBWY.Controls/BBWY.Controls.csproj
  8. 2
      BBWY.Server.Business/PlatformSDK/LogisticsCompanyConverter.cs

9
BBWY.Client/APIServices/ShopService.cs

@ -37,5 +37,14 @@ namespace BBWY.Client.APIServices
{ {
return SendRequest<IList<OrderBelongShopResponse>>(globalContext.BBYWApiHost, "api/order/GetOrderBelongShop", orderIdList, null, HttpMethod.Post); return SendRequest<IList<OrderBelongShopResponse>>(globalContext.BBYWApiHost, "api/order/GetOrderBelongShop", orderIdList, null, HttpMethod.Post);
} }
/// <summary>
/// 获取部门及下属店铺
/// </summary>
/// <returns></returns>
public ApiResponse<IList<Department>> GetDepartmentList()
{
return SendRequest<IList<Department>>(globalContext.BBYWApiHost, "api/vender/GetDeparmentList", null, null, HttpMethod.Get);
}
} }
} }

1
BBWY.Client/App.xaml

@ -13,6 +13,7 @@
<ResourceDictionary Source="/Resources/Themes/Path.xaml"/> <ResourceDictionary Source="/Resources/Themes/Path.xaml"/>
<ResourceDictionary Source="/Resources/Themes/Generic.xaml"/> <ResourceDictionary Source="/Resources/Themes/Generic.xaml"/>
<ResourceDictionary Source="/Resources/Themes/DataTemplate.xaml"/> <ResourceDictionary Source="/Resources/Themes/DataTemplate.xaml"/>
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<vm:ViewModelLocator x:Key="Locator"/> <vm:ViewModelLocator x:Key="Locator"/>

1
BBWY.Client/BBWY.Client.csproj

@ -29,6 +29,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="CsvHelper" Version="27.2.1" /> <PackageReference Include="CsvHelper" Version="27.2.1" />
<PackageReference Include="HandyControl" Version="3.3.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="5.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />

32
BBWY.Client/Models/Shop/Department.cs

@ -0,0 +1,32 @@
using System.Collections.Generic;
namespace BBWY.Client.Models
{
public class Department
{
public string Id { get; set; }
public string Name { get; set; }
public IList<SimpleShop> ShopList { get; set; }
public Department()
{
ShopList = new List<SimpleShop>();
}
}
public class SimpleShop : NotifyObject
{
private bool isSelected;
/// <summary>
/// ShopId
/// </summary>
public string Id { get; set; }
public string Name { get; set; }
public bool IsSelected { get => isSelected; set { Set(ref isSelected, value); } }
}
}

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

@ -1,5 +1,4 @@
using BBWY.Client.APIServices; using BBWY.Client.APIServices;
using BBWY.Client.Extensions;
using BBWY.Client.Models; using BBWY.Client.Models;
using BBWY.Common.Models; using BBWY.Common.Models;
using GalaSoft.MvvmLight.Command; using GalaSoft.MvvmLight.Command;
@ -8,7 +7,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Data; using System.Data;
using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -25,24 +23,29 @@ namespace BBWY.Client.ViewModels
private bool isLoading; private bool isLoading;
private bool isAudited; private bool isAudited;
private bool isShowPayBillPanel; private bool isShowPayBillPanel;
private bool isShowPurchaseOrderPanel; //private bool isShowPurchaseOrderPanel;
private bool isShowShopOrderPanel; //private bool isShowShopOrderPanel;
private bool onlyException; private bool onlyException;
private ShopService shopService; private ShopService shopService;
private Department selectedDepartment;
public Department SelectedDepartment { get => selectedDepartment; set { Set(ref selectedDepartment, value); } }
public IList<AuditFile> AuditFileList { get; set; } public IList<AuditFile> AuditFileList { get; set; }
public IList<AuditPayBill> AuditPayBillList { get; set; } public IList<AuditPayBill> AuditPayBillList { get; set; }
public IList<AuditPurchaseOrder> AuditPurchaseOrderList { get; set; } public IList<Department> DepartmentList { get; set; }
//public IList<AuditPurchaseOrder> AuditPurchaseOrderList { get; set; }
public IList<AuditShopOrder> AuditShopOrderList { get; set; } //public IList<AuditShopOrder> AuditShopOrderList { get; set; }
public IList<AuditPayBill> ShowAuditPayBillList { get; set; } public IList<AuditPayBill> ShowAuditPayBillList { get; set; }
public IList<AuditPurchaseOrder> ShowAuditPurchaseOrderList { get; set; } //public IList<AuditPurchaseOrder> ShowAuditPurchaseOrderList { get; set; }
public IList<AuditShopOrder> ShowAuditShopOrderList { get; set; } //public IList<AuditShopOrder> ShowAuditShopOrderList { get; set; }
public AuditFile SelectAuditFile public AuditFile SelectAuditFile
{ {
@ -60,44 +63,45 @@ namespace BBWY.Client.ViewModels
{ {
get => isShowPayBillPanel; set get => isShowPayBillPanel; set
{ {
if (Set(ref isShowPayBillPanel, value)) Set(ref isShowPayBillPanel, value);
{ //if (Set(ref isShowPayBillPanel, value))
if (value) //{
{ // if (value)
IsShowPurchaseOrderPanel = false; // {
IsShowShopOrderPanel = false; // IsShowPurchaseOrderPanel = false;
} // IsShowShopOrderPanel = false;
} // }
} //}
}
public bool IsShowPurchaseOrderPanel
{
get => isShowPurchaseOrderPanel; set
{
if (Set(ref isShowPurchaseOrderPanel, value))
{
if (value)
{
IsShowPayBillPanel = false;
IsShowShopOrderPanel = false;
}
}
}
}
public bool IsShowShopOrderPanel
{
get => isShowShopOrderPanel; set
{
if (Set(ref isShowShopOrderPanel, value))
{
if (value)
{
IsShowPayBillPanel = false;
IsShowPurchaseOrderPanel = false;
}
}
} }
} }
//public bool IsShowPurchaseOrderPanel
//{
// get => isShowPurchaseOrderPanel; set
// {
// if (Set(ref isShowPurchaseOrderPanel, value))
// {
// if (value)
// {
// IsShowPayBillPanel = false;
// IsShowShopOrderPanel = false;
// }
// }
// }
//}
//public bool IsShowShopOrderPanel
//{
// get => isShowShopOrderPanel; set
// {
// if (Set(ref isShowShopOrderPanel, value))
// {
// if (value)
// {
// IsShowPayBillPanel = false;
// IsShowPurchaseOrderPanel = false;
// }
// }
// }
//}
public bool OnlyException public bool OnlyException
{ {
@ -126,33 +130,47 @@ namespace BBWY.Client.ViewModels
ImportAliPayBillCommand = new RelayCommand(ImportAliPayBill); ImportAliPayBillCommand = new RelayCommand(ImportAliPayBill);
this.shopService = shopService; this.shopService = shopService;
DepartmentList = new ObservableCollection<Department>();
Import1688PurchaseOrderCommand = new RelayCommand(Import1688PurchaseOrder);
ImportJDShopOrderCommand = new RelayCommand(ImportJDShopOrder);
AuditFileList = new ObservableCollection<AuditFile>(); AuditFileList = new ObservableCollection<AuditFile>();
AuditPayBillList = new List<AuditPayBill>(); AuditPayBillList = new List<AuditPayBill>();
AuditPurchaseOrderList = new List<AuditPurchaseOrder>(); //AuditPurchaseOrderList = new List<AuditPurchaseOrder>();
AuditShopOrderList = new List<AuditShopOrder>(); //AuditShopOrderList = new List<AuditShopOrder>();
ShowAuditPayBillList = new ObservableCollection<AuditPayBill>(); ShowAuditPayBillList = new ObservableCollection<AuditPayBill>();
ShowAuditPurchaseOrderList = new ObservableCollection<AuditPurchaseOrder>(); //ShowAuditPurchaseOrderList = new ObservableCollection<AuditPurchaseOrder>();
ShowAuditShopOrderList = new ObservableCollection<AuditShopOrder>(); //ShowAuditShopOrderList = new ObservableCollection<AuditShopOrder>();
//AuditFileList.Add(new AuditFile() { FileName = "支付宝账单20220527.csv", AuditFileType = AuditFileType.账单 }); //AuditFileList.Add(new AuditFile() { FileName = "支付宝账单20220527.csv", AuditFileType = AuditFileType.账单 });
//AuditFileList.Add(new AuditFile() { FileName = "1688采购单20220527.csv", AuditFileType = AuditFileType.采购单 }); //AuditFileList.Add(new AuditFile() { FileName = "1688采购单20220527.csv", AuditFileType = AuditFileType.采购单 });
//AuditFileList.Add(new AuditFile() { FileName = "支付宝账单20220527.csv", AuditFileType = AuditFileType.销售订单 }); //AuditFileList.Add(new AuditFile() { FileName = "支付宝账单20220527.csv", AuditFileType = AuditFileType.销售订单 });
LoadDepartment();
}
private void LoadDepartment()
{
Task.Factory.StartNew(() => shopService.GetDepartmentList()).ContinueWith(t =>
{
var response = t.Result;
if (!response.Success)
{
App.Current.Dispatcher.Invoke(() => MessageBox.Show(response.Msg, "提示"));
return;
}
App.Current.Dispatcher.Invoke(() =>
{
foreach (var d in response.Data)
DepartmentList.Add(d);
});
});
} }
private void Audit() private void Audit()
{ {
if (IsLoading) if (IsLoading)
return; return;
if (AuditPayBillList.Count() == 0 || if (AuditPayBillList.Count() == 0)
AuditPurchaseOrderList.Count() == 0 || //AuditPurchaseOrderList.Count() == 0 ||
AuditShopOrderList.Count() == 0) //AuditShopOrderList.Count() == 0)
{ {
MessageBox.Show("审核数据不全", "提示"); MessageBox.Show("审核数据不全", "提示");
return; return;
@ -167,7 +185,7 @@ namespace BBWY.Client.ViewModels
Task.Factory.StartNew(() => Task.Factory.StartNew(() =>
{ {
AuditByPayBill(waitList[0]); AuditByPayBill(waitList[0]);
AuditByPurchaseOrder(waitList[1]); //AuditByPurchaseOrder(waitList[1]);
}).ContinueWith(t => }).ContinueWith(t =>
{ {
WaitHandle.WaitAll(waitList.ToArray(), -1); WaitHandle.WaitAll(waitList.ToArray(), -1);
@ -188,51 +206,51 @@ namespace BBWY.Client.ViewModels
{ {
foreach (var payBill in AuditPayBillList) foreach (var payBill in AuditPayBillList)
{ {
#region 匹配采购单 //#region 匹配采购单
var relationPurchaseOrder = AuditPurchaseOrderList.FirstOrDefault(p => p.PurchaseOrderId == payBill.MerchantOrderNo); //var relationPurchaseOrder = AuditPurchaseOrderList.FirstOrDefault(p => p.PurchaseOrderId == payBill.MerchantOrderNo);
if (relationPurchaseOrder == null) //if (relationPurchaseOrder == null)
{ //{
//未通过商户订单号找到采购单,则通过账单金额和日期匹配 // //未通过商户订单号找到采购单,则通过账单金额和日期匹配
relationPurchaseOrder = AuditPurchaseOrderList.FirstOrDefault(p => p.PayAmount == payBill.ExpenditureAmount && // relationPurchaseOrder = AuditPurchaseOrderList.FirstOrDefault(p => p.PayAmount == payBill.ExpenditureAmount &&
p.PayTime != null && payBill.PayTime != null && // p.PayTime != null && payBill.PayTime != null &&
Math.Abs((payBill.PayTime.Value - p.PayTime.Value).TotalSeconds) <= 60); // Math.Abs((payBill.PayTime.Value - p.PayTime.Value).TotalSeconds) <= 60);
} //}
if (relationPurchaseOrder == null) //if (relationPurchaseOrder == null)
{ //{
payBill.ErrorMessage = "未匹配采购单"; // payBill.ErrorMessage = "未匹配采购单";
continue; // continue;
} //}
payBill.RelationPurchaseOrderId = relationPurchaseOrder.PurchaseOrderId; //payBill.RelationPurchaseOrderId = relationPurchaseOrder.PurchaseOrderId;
#endregion //#endregion
#region 匹配销售订单 //#region 匹配销售订单
var relationShopOrder = AuditShopOrderList.FirstOrDefault(o => (!string.IsNullOrEmpty(o.VenderRemark) && o.VenderRemark.Contains(relationPurchaseOrder.PurchaseOrderId)) || //var relationShopOrder = AuditShopOrderList.FirstOrDefault(o => (!string.IsNullOrEmpty(o.VenderRemark) && o.VenderRemark.Contains(relationPurchaseOrder.PurchaseOrderId)) ||
(o.Phone == relationPurchaseOrder.Phone && // (o.Phone == relationPurchaseOrder.Phone &&
o.ContactName == relationPurchaseOrder.ContactName && // o.ContactName == relationPurchaseOrder.ContactName &&
o.PayTime != null && relationPurchaseOrder.PayTime != null && // o.PayTime != null && relationPurchaseOrder.PayTime != null &&
(relationPurchaseOrder.PayTime.Value - o.PayTime.Value).TotalDays <= 2)); // (relationPurchaseOrder.PayTime.Value - o.PayTime.Value).TotalDays <= 2));
if (relationShopOrder == null) //if (relationShopOrder == null)
{ //{
payBill.ErrorMessage = "未匹配销售订单"; // payBill.ErrorMessage = "未匹配销售订单";
continue; // continue;
} //}
payBill.RelationShopOrderId = relationShopOrder.OrderId; //payBill.RelationShopOrderId = relationShopOrder.OrderId;
#endregion //#endregion
} }
var relationShoporderIds = AuditPayBillList.Where(p => !string.IsNullOrEmpty(p.RelationShopOrderId)).Select(p => p.RelationShopOrderId).ToList(); //var relationShoporderIds = AuditPayBillList.Where(p => !string.IsNullOrEmpty(p.RelationShopOrderId)).Select(p => p.RelationShopOrderId).ToList();
var belongResponse = shopService.GetOrderBelongShop(relationShoporderIds); //var belongResponse = shopService.GetOrderBelongShop(relationShoporderIds);
if (!belongResponse.Success || belongResponse.Data.Count() == 0) //if (!belongResponse.Success || belongResponse.Data.Count() == 0)
return; // return;
foreach (var payBill in AuditPayBillList) //foreach (var payBill in AuditPayBillList)
{ //{
if (string.IsNullOrEmpty(payBill.RelationShopOrderId)) // if (string.IsNullOrEmpty(payBill.RelationShopOrderId))
continue; // continue;
var belongShop = belongResponse.Data.FirstOrDefault(x => x.OrderIdList.Contains(payBill.RelationShopOrderId)); // var belongShop = belongResponse.Data.FirstOrDefault(x => x.OrderIdList.Contains(payBill.RelationShopOrderId));
if (belongShop != null) // if (belongShop != null)
payBill.BelongShop = belongShop.ShopName; // payBill.BelongShop = belongShop.ShopName;
} //}
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -244,85 +262,85 @@ namespace BBWY.Client.ViewModels
} }
} }
private void AuditByPurchaseOrder(EventWaitHandle ewh) //private void AuditByPurchaseOrder(EventWaitHandle ewh)
{ //{
try // try
{ // {
foreach (var purchaseOrder in AuditPurchaseOrderList) // foreach (var purchaseOrder in AuditPurchaseOrderList)
{ // {
#region 匹配账单 // #region 匹配账单
var relationPayBill = AuditPayBillList.FirstOrDefault(b => b.MerchantOrderNo == purchaseOrder.PurchaseOrderId); // var relationPayBill = AuditPayBillList.FirstOrDefault(b => b.MerchantOrderNo == purchaseOrder.PurchaseOrderId);
if (relationPayBill == null) // if (relationPayBill == null)
{ // {
//未通过商户订单号找到采购单,则通过账单金额和日期匹配 // //未通过商户订单号找到采购单,则通过账单金额和日期匹配
relationPayBill = AuditPayBillList.FirstOrDefault(b => purchaseOrder.PayAmount == b.ExpenditureAmount && // relationPayBill = AuditPayBillList.FirstOrDefault(b => purchaseOrder.PayAmount == b.ExpenditureAmount &&
purchaseOrder.PayTime != null && b.PayTime != null && // purchaseOrder.PayTime != null && b.PayTime != null &&
Math.Abs((b.PayTime.Value - purchaseOrder.PayTime.Value).TotalSeconds) <= 60); // Math.Abs((b.PayTime.Value - purchaseOrder.PayTime.Value).TotalSeconds) <= 60);
} // }
if (relationPayBill == null) // if (relationPayBill == null)
{ // {
purchaseOrder.ErrorMessage = "未匹配支付账单"; // purchaseOrder.ErrorMessage = "未匹配支付账单";
continue; // continue;
} // }
purchaseOrder.RelationPayBillNo = relationPayBill.PayBillNo; // purchaseOrder.RelationPayBillNo = relationPayBill.PayBillNo;
#endregion // #endregion
#region 匹配销售单 // #region 匹配销售单
var relationShopOrder = AuditShopOrderList.FirstOrDefault(o => (!string.IsNullOrEmpty(o.VenderRemark) && o.VenderRemark.Contains(purchaseOrder.PurchaseOrderId)) || // var relationShopOrder = AuditShopOrderList.FirstOrDefault(o => (!string.IsNullOrEmpty(o.VenderRemark) && o.VenderRemark.Contains(purchaseOrder.PurchaseOrderId)) ||
(o.Phone == purchaseOrder.Phone && // (o.Phone == purchaseOrder.Phone &&
o.ContactName == purchaseOrder.ContactName && // o.ContactName == purchaseOrder.ContactName &&
o.PayTime != null && purchaseOrder.PayTime != null && // o.PayTime != null && purchaseOrder.PayTime != null &&
(purchaseOrder.PayTime.Value - o.PayTime.Value).TotalDays <= 2)); // (purchaseOrder.PayTime.Value - o.PayTime.Value).TotalDays <= 2));
if (relationShopOrder == null) // if (relationShopOrder == null)
{ // {
purchaseOrder.ErrorMessage = "未匹配销售订单"; // purchaseOrder.ErrorMessage = "未匹配销售订单";
continue; // continue;
} // }
purchaseOrder.RelationShopOrderId = relationShopOrder.OrderId; // purchaseOrder.RelationShopOrderId = relationShopOrder.OrderId;
#endregion // #endregion
} // }
var relationShopOrderIds = AuditPurchaseOrderList.Where(p => !string.IsNullOrEmpty(p.RelationShopOrderId)).Select(p => p.RelationShopOrderId).ToList(); // var relationShopOrderIds = AuditPurchaseOrderList.Where(p => !string.IsNullOrEmpty(p.RelationShopOrderId)).Select(p => p.RelationShopOrderId).ToList();
var belongResponse = shopService.GetOrderBelongShop(relationShopOrderIds); // var belongResponse = shopService.GetOrderBelongShop(relationShopOrderIds);
if (!belongResponse.Success || belongResponse.Data.Count() == 0) // if (!belongResponse.Success || belongResponse.Data.Count() == 0)
return; // return;
foreach (var purchaseOrder in AuditPurchaseOrderList) // foreach (var purchaseOrder in AuditPurchaseOrderList)
{ // {
if (string.IsNullOrEmpty(purchaseOrder.RelationShopOrderId)) // if (string.IsNullOrEmpty(purchaseOrder.RelationShopOrderId))
continue; // continue;
var belongShop = belongResponse.Data.FirstOrDefault(x => x.OrderIdList.Contains(purchaseOrder.RelationShopOrderId)); // var belongShop = belongResponse.Data.FirstOrDefault(x => x.OrderIdList.Contains(purchaseOrder.RelationShopOrderId));
if (belongShop != null) // if (belongShop != null)
purchaseOrder.BelongShop = belongShop.ShopName; // purchaseOrder.BelongShop = belongShop.ShopName;
} // }
} // }
catch (Exception ex) // catch (Exception ex)
{ // {
App.Current.Dispatcher.Invoke(() => MessageBox.Show(ex.Message, "采购单匹配")); // App.Current.Dispatcher.Invoke(() => MessageBox.Show(ex.Message, "采购单匹配"));
} // }
finally // finally
{ // {
ewh.Set(); // ewh.Set();
} // }
} //}
private void ClearAudit() private void ClearAudit()
{ {
SelectAuditFile = null; SelectAuditFile = null;
AuditFileList.Clear(); AuditFileList.Clear();
AuditPayBillList.Clear(); AuditPayBillList.Clear();
AuditPurchaseOrderList.Clear(); //AuditPurchaseOrderList.Clear();
AuditShopOrderList.Clear(); //AuditShopOrderList.Clear();
ShowAuditPayBillList.Clear(); ShowAuditPayBillList.Clear();
ShowAuditPurchaseOrderList.Clear(); //ShowAuditPurchaseOrderList.Clear();
ShowAuditShopOrderList.Clear(); //ShowAuditShopOrderList.Clear();
IsAudited = false; IsAudited = false;
IsShowPayBillPanel = false; IsShowPayBillPanel = false;
IsShowPurchaseOrderPanel = false; //IsShowPurchaseOrderPanel = false;
IsShowShopOrderPanel = false; //IsShowShopOrderPanel = false;
OnlyException = false; OnlyException = false;
} }
private (string ErrorMessage, string FileName, DataTable DataTable) ImportAuditFile(AuditFileType auditFileType) private (string ErrorMessage, string FileName, List<string> Lines) ImportAuditFile(AuditFileType auditFileType)
{ {
var ofd = new OpenFileDialog() { Filter = "CSV Files (*.csv)|*.csv" }; var ofd = new OpenFileDialog() { Filter = "CSV Files (*.csv)|*.csv" };
if (ofd.ShowDialog() != true) if (ofd.ShowDialog() != true)
@ -333,19 +351,19 @@ namespace BBWY.Client.ViewModels
return ("文件已存在", string.Empty, null); return ("文件已存在", string.Empty, null);
try try
{ {
var dt = new DataTable(); //var dt = new DataTable();
using (var reader = File.OpenText(filePath)) //using (var reader = File.OpenText(filePath))
{ //{
using (var csv = new CsvHelper.CsvReader(reader, CultureInfo.InvariantCulture)) // using (var csv = new CsvHelper.CsvReader(reader, CultureInfo.InvariantCulture))
using (var dataReader = new CsvHelper.CsvDataReader(csv)) // using (var dataReader = new CsvHelper.CsvDataReader(csv))
{ // {
dt.Load(dataReader); // dt.Load(dataReader);
} // }
} //}
//var lines = File.ReadAllLines(filePath, Encoding.GetEncoding("GB2312")).ToList(); var lines = File.ReadAllLines(filePath, Encoding.GetEncoding("GB2312")).ToList();
AuditFileList.Add(new AuditFile() { FileName = fileName, AuditFileType = auditFileType }); AuditFileList.Add(new AuditFile() { FileName = fileName, AuditFileType = auditFileType });
return (string.Empty, fileName, dt); return (string.Empty, fileName, lines);
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -364,7 +382,7 @@ namespace BBWY.Client.ViewModels
MessageBox.Show(importResult.ErrorMessage, "导入支付宝账单"); MessageBox.Show(importResult.ErrorMessage, "导入支付宝账单");
return; return;
} }
if (importResult.DataTable == null || importResult.DataTable.Rows.Count == 0) if (importResult.Lines == null || importResult.Lines.Count == 0)
return; return;
//忽略前5行 //忽略前5行
/* /*
@ -429,109 +447,6 @@ namespace BBWY.Client.ViewModels
} }
} }
/// <summary>
/// 导入1688采购单
/// </summary>
private void Import1688PurchaseOrder()
{
var importResult = ImportAuditFile(AuditFileType.);
if (!string.IsNullOrEmpty(importResult.ErrorMessage))
{
MessageBox.Show(importResult.ErrorMessage, "导入1688采购单");
return;
}
if (importResult.DataTable == null || importResult.DataTable.Rows.Count == 0)
return;
//去掉列名
//importResult.Lines.RemoveAt(0);
var purchaseOrderId = "";
try
{
//foreach (var line in importResult.DataTable)
//{
// var array = line.CSVstrToArry();
// purchaseOrderId = array[0].FormatString();
// if (string.IsNullOrEmpty(purchaseOrderId) || AuditPurchaseOrderList.Any(p => p.PurchaseOrderId == purchaseOrderId))
// continue;
// var purchaseOrder = new AuditPurchaseOrder()
// {
// PurchaseOrderId = purchaseOrderId,
// Platform = Platform.阿里巴巴,
// BelongFileName = importResult.FileName,
// ProductAmount = decimal.Parse(array[5].FormatString()),
// Freight = decimal.Parse(array[6].FormatString()),
// PayAmount = decimal.Parse(array[8].FormatString()),
// CreateTime = DateTime.Parse(array[10].FormatString()),
// ContactName = array[13].FormatString(),
// Address = array[14].FormatString(),
// Phone = array[17].FormatString(),
// Quantity = int.Parse(array[20].FormatString())
// };
// if (!string.IsNullOrEmpty(array[11]))
// purchaseOrder.PayTime = DateTime.Parse(array[11].FormatString());
// AuditPurchaseOrderList.Add(purchaseOrder);
//}
//Console.WriteLine(AuditPurchaseOrderList.Count());
}
catch (Exception ex)
{
MessageBox.Show($"问题采购单号{purchaseOrderId} {ex.Message}", "导入1688采购单");
}
}
/// <summary>
/// 导入京东销售订单
/// </summary>
private void ImportJDShopOrder()
{
var importResult = ImportAuditFile(AuditFileType.);
if (!string.IsNullOrEmpty(importResult.ErrorMessage))
{
MessageBox.Show(importResult.ErrorMessage, "导入京东销售订单");
return;
}
//if (importResult.Lines == null || importResult.Lines.Count() == 0)
// return;
//去掉列名
//importResult.Lines.RemoveAt(0);
var orderId = "";
try
{
//foreach (var line in importResult.Lines)
//{
// var array = line.CSVstrToArry();
// orderId = array[0].FormatString();
// if (string.IsNullOrEmpty(orderId) || AuditShopOrderList.Any(p => p.OrderId == orderId))
// continue;
// var order = new AuditShopOrder()
// {
// OrderId = orderId,
// Platform = Platform.京东,
// BelongFileName = importResult.FileName,
// Quantity = int.Parse(array[3].FormatString()),
// CreateTime = DateTime.Parse(array[5].FormatString()),
// PayAmount = decimal.Parse(array[10].FormatString()),
// ContactName = array[14].FormatString(),
// Address = array[15].FormatString(),
// Phone = array[16].FormatString(),
// ProductName = array[2].FormatString(),
// VenderRemark = array[27].FormatString()
// };
// AuditShopOrderList.Add(order);
// if (!string.IsNullOrEmpty(array[30]))
// order.PayTime = DateTime.Parse(array[30].FormatString());
//}
}
catch (Exception ex)
{
MessageBox.Show($"问题销售订单号{orderId} {ex.Message}", "导入京东销售订单");
}
}
/// <summary> /// <summary>
/// 采购审计文件对象改变事件 /// 采购审计文件对象改变事件
/// </summary> /// </summary>
@ -550,21 +465,6 @@ namespace BBWY.Client.ViewModels
foreach (var b in list) foreach (var b in list)
ShowAuditPayBillList.Add(b); ShowAuditPayBillList.Add(b);
} }
else if (SelectAuditFile.AuditFileType == AuditFileType.)
{
IsShowPurchaseOrderPanel = true;
ShowAuditPurchaseOrderList.Clear();
var where = AuditPurchaseOrderList.Where(p => p.BelongFileName == SelectAuditFile.FileName);
if (OnlyException)
where = where.Where(p => !string.IsNullOrEmpty(p.ErrorMessage));
var list = where.ToList();
foreach (var p in list)
ShowAuditPurchaseOrderList.Add(p);
}
else if (SelectAuditFile.AuditFileType == AuditFileType.)
{
}
} }
private void OnOnlyExceptionChanged() private void OnOnlyExceptionChanged()
@ -574,7 +474,6 @@ namespace BBWY.Client.ViewModels
var f = SelectAuditFile; var f = SelectAuditFile;
SelectAuditFile = null; SelectAuditFile = null;
SelectAuditFile = f; SelectAuditFile = f;
//SelectAuditFile = AuditFileList.FirstOrDefault(f => f.AuditFileType == AuditFileType.账单);
} }
} }
} }

17
BBWY.Client/Views/FinancialTerminal/ProcurementAudit.xaml

@ -5,10 +5,19 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BBWY.Client.Views.FinancialTerminal" xmlns:local="clr-namespace:BBWY.Client.Views.FinancialTerminal"
mc:Ignorable="d" mc:Ignorable="d"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
d:DesignHeight="450" d:DesignWidth="800" d:DesignHeight="450" d:DesignWidth="800"
Title="ProcurementAudit" Title="ProcurementAudit"
DataContext="{Binding ProcurementAudit,Source={StaticResource Locator}}"> DataContext="{Binding ProcurementAudit,Source={StaticResource Locator}}">
<Page.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/>
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Page.Resources>
<Grid> <Grid>
<c:RoundWaitProgress Play="{Binding IsLoading}" Panel.ZIndex="999"/> <c:RoundWaitProgress Play="{Binding IsLoading}" Panel.ZIndex="999"/>
<Grid Margin="5,0"> <Grid Margin="5,0">
@ -24,7 +33,9 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Border Background="{StaticResource Border.Background}" Padding="5,0"> <Border Background="{StaticResource Border.Background}" Padding="5,0">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center"> <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<ComboBox Width="100" /> <ComboBox Width="100" ItemsSource="{Binding DepartmentList}"
DisplayMemberPath="Name"
SelectedItem="{Binding SelectedDepartment,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<ComboBox Width="100" Margin="5,0,0,0"/> <ComboBox Width="100" Margin="5,0,0,0"/>
<DatePicker Width="100" IsEnabled="false" Height="30" Margin="5,0,0,0"/> <DatePicker Width="100" IsEnabled="false" Height="30" Margin="5,0,0,0"/>
<DatePicker Width="100" IsEnabled="false" Height="30" Margin="5,0,0,0"/> <DatePicker Width="100" IsEnabled="false" Height="30" Margin="5,0,0,0"/>
@ -136,7 +147,7 @@
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
<DataGrid ItemsSource="{Binding ShowAuditPurchaseOrderList}" <!--<DataGrid ItemsSource="{Binding ShowAuditPurchaseOrderList}"
Grid.Row="7" Grid.Row="7"
Visibility="{Binding IsShowPurchaseOrderPanel,Converter={StaticResource objConverter},ConverterParameter=true:Visible:Collapsed}"> Visibility="{Binding IsShowPurchaseOrderPanel,Converter={StaticResource objConverter},ConverterParameter=true:Visible:Collapsed}">
<DataGrid.Columns> <DataGrid.Columns>
@ -162,7 +173,7 @@
Grid.Row="7" Grid.Row="7"
Visibility="{Binding IsShowShopOrderPanel,Converter={StaticResource objConverter},ConverterParameter=true:Visible:Collapsed}"> Visibility="{Binding IsShowShopOrderPanel,Converter={StaticResource objConverter},ConverterParameter=true:Visible:Collapsed}">
</DataGrid> </DataGrid>-->
</Grid> </Grid>
</Grid> </Grid>
</Page> </Page>

5
BBWY.Controls/BBWY.Controls.csproj

@ -6,7 +6,10 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Converters\" /> <Compile Remove="Converters\**" />
<EmbeddedResource Remove="Converters\**" />
<None Remove="Converters\**" />
<Page Remove="Converters\**" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

2
BBWY.Server.Business/PlatformSDK/LogisticsCompanyConverter.cs

@ -47,7 +47,7 @@ namespace BBWY.Server.Business
/// <summary> /// <summary>
/// 翻译各平台之间的物流公司 /// 翻译各平台之间的物流公司
/// </summary> /// </summary>00
/// <param name="sourceName"></param> /// <param name="sourceName"></param>
/// <param name="sourcePlatform"></param> /// <param name="sourcePlatform"></param>
/// <param name="targetPlatform"></param> /// <param name="targetPlatform"></param>

Loading…
Cancel
Save