shanji 3 years ago
parent
commit
9fbbcce5e1
  1. 2
      BBWY.Client/Models/APIModel/Response/FinancialTerminal/AuditPayBillResponse.cs
  2. 2
      BBWY.Client/Models/Enums.cs
  3. 2
      BBWY.Client/Models/FinancialTerminal/ProcurementAudit/AuditPayBill.cs
  4. 80
      BBWY.Client/ViewModels/FinancialTerminal/ProcurementAuditViewModel.cs
  5. 3
      BBWY.Server.Model/Db/FinancialTerminal/AuditPayBill.cs
  6. 27
      BBWY.Server.Model/Enums.cs

2
BBWY.Client/Models/APIModel/Response/FinancialTerminal/AuditPayBillResponse.cs

@ -94,5 +94,7 @@ namespace BBWY.Client.Models
public string ImportShopIds { get; set; } public string ImportShopIds { get; set; }
public string ErrorMessage { get; set; } public string ErrorMessage { get; set; }
public AuditCapitalType? AuditCapitalType { get; set; }
} }
} }

2
BBWY.Client/Models/Enums.cs

@ -126,7 +126,7 @@
} }
/// <summary> /// <summary>
/// 账单类型 /// 资金类型
/// </summary> /// </summary>
public enum AuditCapitalType public enum AuditCapitalType
{ {

2
BBWY.Client/Models/FinancialTerminal/ProcurementAudit/AuditPayBill.cs

@ -19,7 +19,7 @@ namespace BBWY.Client.Models
/// <summary> /// <summary>
/// 账单类型 /// 账单类型
/// </summary> /// </summary>
public PayBillType PayBillType { get; set; } public PayBillType? PayBillType { get; set; }
/// <summary> /// <summary>
/// 商家订单号 /// 商家订单号

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

@ -15,6 +15,7 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Input; using System.Windows.Input;
using BBWY.Common.Extensions;
namespace BBWY.Client.ViewModels namespace BBWY.Client.ViewModels
{ {
@ -119,7 +120,7 @@ namespace BBWY.Client.ViewModels
ImportAliPayBillCommand = new RelayCommand(ImportAliPayBill); ImportAliPayBillCommand = new RelayCommand(ImportAliPayBill);
SearchHistoryCommand = new RelayCommand(SearchHistory); SearchHistoryCommand = new RelayCommand(SearchHistory);
SearchLocalCommand = new RelayCommand(SearchLocal); SearchLocalCommand = new RelayCommand(SearchLocal);
ClearLocalConditionCommand = new RelayCommand(ClearLocalCondition); ClearLocalConditionCommand = new RelayCommand(() => ClearLocalCondition());
SaveCommand = new RelayCommand(Save); SaveCommand = new RelayCommand(Save);
this.purchaseOrderService = purchaseOrderService; this.purchaseOrderService = purchaseOrderService;
this.financialTerminalService = financialTerminalService; this.financialTerminalService = financialTerminalService;
@ -144,6 +145,27 @@ namespace BBWY.Client.ViewModels
{ {
if (IsLoading) if (IsLoading)
return; return;
ClearAudit();
IsLoading = true;
var importShopIds = string.Join(',', SelectedDepartment.ShopList.Where(s => s.IsSelected).Select(s => s.ShopId));
Task.Factory.StartNew(() => financialTerminalService.GetAuditPayBillList(importShopIds, StartDate, EndDate)).ContinueWith(t =>
{
IsLoading = false;
var response = t.Result;
if (!response.Success)
{
MessageBox.Show(response.Msg, "查询账单");
return;
}
var list = response.Data.Map<IList<AuditPayBill>>();
App.Current.Dispatcher.Invoke(() =>
{
foreach (var b in list)
AuditPayBillList.Add(b);
SearchLocal();
});
});
} }
@ -289,6 +311,7 @@ namespace BBWY.Client.ViewModels
NoChooseFundType = false; NoChooseFundType = false;
NoMatchPurchaseOrder = false; NoMatchPurchaseOrder = false;
SearchResultPurchaseOrder = string.Empty; SearchResultPurchaseOrder = string.Empty;
SelectPurchasePlatform = null;
} }
private (string ErrorMessage, string FileName, List<string> Lines) ImportAuditFile(AuditFileType auditFileType) private (string ErrorMessage, string FileName, List<string> Lines) ImportAuditFile(AuditFileType auditFileType)
@ -402,14 +425,16 @@ namespace BBWY.Client.ViewModels
} }
} }
private void ClearLocalCondition() private void ClearLocalCondition(bool isSearch = true)
{ {
OnlyException = false; OnlyException = false;
NoMatchPurchaseOrder = false; NoMatchPurchaseOrder = false;
NoChooseFundType = false; NoChooseFundType = false;
SelectResultShop = null; SelectResultShop = null;
SelectPurchasePlatform = null; SelectPurchasePlatform = null;
SearchLocal(); SearchResultPurchaseOrder = string.Empty;
if (isSearch)
SearchLocal();
} }
/// <summary> /// <summary>
@ -417,29 +442,31 @@ namespace BBWY.Client.ViewModels
/// </summary> /// </summary>
private void SearchLocal() private void SearchLocal()
{ {
if (SelectAuditFile == null) //if (SelectAuditFile == null)
return; // return;
if (SelectAuditFile.AuditFileType == AuditFileType.) //if (SelectAuditFile.AuditFileType == AuditFileType.账单)
{ //{
IsShowPayBillPanel = true; IsShowPayBillPanel = true;
ShowAuditPayBillList.Clear(); ShowAuditPayBillList.Clear();
var where = AuditPayBillList.Where(b => b.BelongFileName == SelectAuditFile.FileName); var where = AuditPayBillList.Where(b => true);
if (OnlyException) if (SelectAuditFile != null)
where = where.Where(b => !string.IsNullOrEmpty(b.ErrorMessage)); where = where.Where(b => b.BelongFileName == SelectAuditFile.FileName);
if (NoMatchPurchaseOrder) if (OnlyException)
where = where.Where(b => !string.IsNullOrEmpty(b.ErrorMessage) && b.ErrorMessage == "未匹配采购单"); where = where.Where(b => !string.IsNullOrEmpty(b.ErrorMessage));
if (NoChooseFundType) if (NoMatchPurchaseOrder)
where = where.Where(b => !string.IsNullOrEmpty(b.ErrorMessage) && b.ErrorMessage == "未选资金类型"); where = where.Where(b => !string.IsNullOrEmpty(b.ErrorMessage) && b.ErrorMessage == "未匹配采购单");
if (SelectResultShop != null) if (NoChooseFundType)
where = where.Where(b => b.BelongShopId != null && b.BelongShopId.Value == SelectResultShop.ShopId); where = where.Where(b => !string.IsNullOrEmpty(b.ErrorMessage) && b.ErrorMessage == "未选资金类型");
if (!string.IsNullOrEmpty(SearchResultPurchaseOrder)) if (SelectResultShop != null)
where = where.Where(b => !string.IsNullOrEmpty(b.RelationPurchaseOrderId) && b.RelationPurchaseOrderId.Contains(SearchResultPurchaseOrder)); where = where.Where(b => b.BelongShopId != null && b.BelongShopId.Value == SelectResultShop.ShopId);
if (SelectPurchasePlatform != null) if (!string.IsNullOrEmpty(SearchResultPurchaseOrder))
where = where.Where(b => b.PurchasePlatform == SelectPurchasePlatform); where = where.Where(b => !string.IsNullOrEmpty(b.RelationPurchaseOrderId) && b.RelationPurchaseOrderId.Contains(SearchResultPurchaseOrder));
var list = where.ToList(); if (SelectPurchasePlatform != null)
foreach (var b in list) where = where.Where(b => b.PurchasePlatform == SelectPurchasePlatform);
ShowAuditPayBillList.Add(b); var list = where.ToList();
} foreach (var b in list)
ShowAuditPayBillList.Add(b);
//}
} }
private void Save() private void Save()
@ -469,6 +496,7 @@ namespace BBWY.Client.ViewModels
Task.Factory.StartNew(() => financialTerminalService.BatchInsertAuditPayBill(ShowAuditPayBillList)).ContinueWith(t => Task.Factory.StartNew(() => financialTerminalService.BatchInsertAuditPayBill(ShowAuditPayBillList)).ContinueWith(t =>
{ {
IsLoading = false;
var insertResponse = t.Result; var insertResponse = t.Result;
App.Current.Dispatcher.Invoke(() => App.Current.Dispatcher.Invoke(() =>
{ {

3
BBWY.Server.Model/Db/FinancialTerminal/AuditPayBill.cs

@ -106,6 +106,9 @@ namespace BBWY.Server.Model.Db
public string ImportShopIds { get; set; } public string ImportShopIds { get; set; }
public string ErrorMessage { get; set; } public string ErrorMessage { get; set; }
[Column(DbType = "int(1)", MapType = typeof(int?))]
public Enums.AuditCapitalType? AuditCapitalType { get; set;}
} }
} }

27
BBWY.Server.Model/Enums.cs

@ -167,5 +167,32 @@
= 1, = 1,
= 2 = 2
} }
/// <summary>
/// 资金类型
/// </summary>
public enum AuditCapitalType
{
= 0,
退 = 1,
= 2,
退 = 3,
= 4,
= 5,
= 6,
= 7,
= 8,
= 9,
e赊还款 = 10,
= 11,
= 12,
= 13,
= 14,
= 15,
= 16,
= 17,
= 18
}
} }
} }

Loading…
Cancel
Save