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 ErrorMessage { get; set; }
public AuditCapitalType? AuditCapitalType { get; set; }
}
}

2
BBWY.Client/Models/Enums.cs

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

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

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

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

@ -15,6 +15,7 @@ using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using BBWY.Common.Extensions;
namespace BBWY.Client.ViewModels
{
@ -119,7 +120,7 @@ namespace BBWY.Client.ViewModels
ImportAliPayBillCommand = new RelayCommand(ImportAliPayBill);
SearchHistoryCommand = new RelayCommand(SearchHistory);
SearchLocalCommand = new RelayCommand(SearchLocal);
ClearLocalConditionCommand = new RelayCommand(ClearLocalCondition);
ClearLocalConditionCommand = new RelayCommand(() => ClearLocalCondition());
SaveCommand = new RelayCommand(Save);
this.purchaseOrderService = purchaseOrderService;
this.financialTerminalService = financialTerminalService;
@ -144,6 +145,27 @@ namespace BBWY.Client.ViewModels
{
if (IsLoading)
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;
NoMatchPurchaseOrder = false;
SearchResultPurchaseOrder = string.Empty;
SelectPurchasePlatform = null;
}
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;
NoMatchPurchaseOrder = false;
NoChooseFundType = false;
SelectResultShop = null;
SelectPurchasePlatform = null;
SearchLocal();
SearchResultPurchaseOrder = string.Empty;
if (isSearch)
SearchLocal();
}
/// <summary>
@ -417,29 +442,31 @@ namespace BBWY.Client.ViewModels
/// </summary>
private void SearchLocal()
{
if (SelectAuditFile == null)
return;
if (SelectAuditFile.AuditFileType == AuditFileType.)
{
IsShowPayBillPanel = true;
ShowAuditPayBillList.Clear();
var where = AuditPayBillList.Where(b => b.BelongFileName == SelectAuditFile.FileName);
if (OnlyException)
where = where.Where(b => !string.IsNullOrEmpty(b.ErrorMessage));
if (NoMatchPurchaseOrder)
where = where.Where(b => !string.IsNullOrEmpty(b.ErrorMessage) && b.ErrorMessage == "未匹配采购单");
if (NoChooseFundType)
where = where.Where(b => !string.IsNullOrEmpty(b.ErrorMessage) && b.ErrorMessage == "未选资金类型");
if (SelectResultShop != null)
where = where.Where(b => b.BelongShopId != null && b.BelongShopId.Value == SelectResultShop.ShopId);
if (!string.IsNullOrEmpty(SearchResultPurchaseOrder))
where = where.Where(b => !string.IsNullOrEmpty(b.RelationPurchaseOrderId) && b.RelationPurchaseOrderId.Contains(SearchResultPurchaseOrder));
if (SelectPurchasePlatform != null)
where = where.Where(b => b.PurchasePlatform == SelectPurchasePlatform);
var list = where.ToList();
foreach (var b in list)
ShowAuditPayBillList.Add(b);
}
//if (SelectAuditFile == null)
// return;
//if (SelectAuditFile.AuditFileType == AuditFileType.账单)
//{
IsShowPayBillPanel = true;
ShowAuditPayBillList.Clear();
var where = AuditPayBillList.Where(b => true);
if (SelectAuditFile != null)
where = where.Where(b => b.BelongFileName == SelectAuditFile.FileName);
if (OnlyException)
where = where.Where(b => !string.IsNullOrEmpty(b.ErrorMessage));
if (NoMatchPurchaseOrder)
where = where.Where(b => !string.IsNullOrEmpty(b.ErrorMessage) && b.ErrorMessage == "未匹配采购单");
if (NoChooseFundType)
where = where.Where(b => !string.IsNullOrEmpty(b.ErrorMessage) && b.ErrorMessage == "未选资金类型");
if (SelectResultShop != null)
where = where.Where(b => b.BelongShopId != null && b.BelongShopId.Value == SelectResultShop.ShopId);
if (!string.IsNullOrEmpty(SearchResultPurchaseOrder))
where = where.Where(b => !string.IsNullOrEmpty(b.RelationPurchaseOrderId) && b.RelationPurchaseOrderId.Contains(SearchResultPurchaseOrder));
if (SelectPurchasePlatform != null)
where = where.Where(b => b.PurchasePlatform == SelectPurchasePlatform);
var list = where.ToList();
foreach (var b in list)
ShowAuditPayBillList.Add(b);
//}
}
private void Save()
@ -469,6 +496,7 @@ namespace BBWY.Client.ViewModels
Task.Factory.StartNew(() => financialTerminalService.BatchInsertAuditPayBill(ShowAuditPayBillList)).ContinueWith(t =>
{
IsLoading = false;
var insertResponse = t.Result;
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 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,
= 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