diff --git a/BBWY.Client/ViewModels/FinancialTerminal/ProcurementAuditViewModel.cs b/BBWY.Client/ViewModels/FinancialTerminal/ProcurementAuditViewModel.cs index 91885625..0651458f 100644 --- a/BBWY.Client/ViewModels/FinancialTerminal/ProcurementAuditViewModel.cs +++ b/BBWY.Client/ViewModels/FinancialTerminal/ProcurementAuditViewModel.cs @@ -163,13 +163,14 @@ namespace BBWY.Client.ViewModels ShopList.Clear(); } + private void SearchHistory() { if (IsLoading) return; ClearAudit(); IsLoading = true; - var importShopIds = string.Join(',', ShopList.Where(s => s.IsSelected).Select(s => s.ShopId)); + var importShopIds = string.Join(',', ShopList.Where(s => s.IsSelected).Select(s => s.ShopId).OrderBy(s => s).ToList()); Task.Factory.StartNew(() => financialTerminalService.GetAuditPayBillList(importShopIds, StartDate, EndDate)).ContinueWith(t => { IsLoading = false; @@ -541,7 +542,7 @@ namespace BBWY.Client.ViewModels return; } - var importShopIds = string.Join(',', ShopList.Where(s => s.IsSelected).Select(s => s.ShopId)); + var importShopIds = string.Join(',', ShopList.Where(s => s.IsSelected).Select(s => s.ShopId).OrderBy(s => s).ToList()); var replaceResponse = financialTerminalService.IsExistAuditPayBill(importShopIds, StartDate, EndDate); if (!replaceResponse.Success) diff --git a/BBWY.Server.Business/FinancialTerminal/FinancialTerminalBusiness.cs b/BBWY.Server.Business/FinancialTerminal/FinancialTerminalBusiness.cs index ec5fefce..be68d149 100644 --- a/BBWY.Server.Business/FinancialTerminal/FinancialTerminalBusiness.cs +++ b/BBWY.Server.Business/FinancialTerminal/FinancialTerminalBusiness.cs @@ -1,6 +1,7 @@ using BBWY.Common.Models; using BBWY.Server.Model.Db; using BBWY.Server.Model.Dto; +using System; using System.Collections.Generic; using System.Linq; using Yitter.IdGenerator; @@ -39,13 +40,12 @@ namespace BBWY.Server.Business //var endTime = insertList.Max(abp => abp.PayTime).Value; var deleteIds = insertList.Select(p => p.PayBillNo).ToArray(); + foreach (var b in insertList) + b.CreateTime = DateTime.Now; fsql.Transaction(() => { fsql.Delete(deleteIds).ExecuteAffrows(); - //fsql.Delete().Where(apb => apb.ImportShopIds == importShopIds && - // apb.PayTime >= startTime && - // apb.PayTime <= endTime).ExecuteAffrows(); fsql.Insert(insertList).ExecuteAffrows(); }); }