Browse Source

审计

qianyi
shanji 2 years ago
parent
commit
40ee12142d
  1. 5
      BBWY.Client/ViewModels/FinancialTerminal/ProcurementAuditViewModel.cs
  2. 6
      BBWY.Server.Business/FinancialTerminal/FinancialTerminalBusiness.cs

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

@ -163,13 +163,14 @@ namespace BBWY.Client.ViewModels
ShopList.Clear(); ShopList.Clear();
} }
private void SearchHistory() private void SearchHistory()
{ {
if (IsLoading) if (IsLoading)
return; return;
ClearAudit(); ClearAudit();
IsLoading = true; 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 => Task.Factory.StartNew(() => financialTerminalService.GetAuditPayBillList(importShopIds, StartDate, EndDate)).ContinueWith(t =>
{ {
IsLoading = false; IsLoading = false;
@ -541,7 +542,7 @@ namespace BBWY.Client.ViewModels
return; 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); var replaceResponse = financialTerminalService.IsExistAuditPayBill(importShopIds, StartDate, EndDate);
if (!replaceResponse.Success) if (!replaceResponse.Success)

6
BBWY.Server.Business/FinancialTerminal/FinancialTerminalBusiness.cs

@ -1,6 +1,7 @@
using BBWY.Common.Models; using BBWY.Common.Models;
using BBWY.Server.Model.Db; using BBWY.Server.Model.Db;
using BBWY.Server.Model.Dto; using BBWY.Server.Model.Dto;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Yitter.IdGenerator; using Yitter.IdGenerator;
@ -39,13 +40,12 @@ namespace BBWY.Server.Business
//var endTime = insertList.Max(abp => abp.PayTime).Value; //var endTime = insertList.Max(abp => abp.PayTime).Value;
var deleteIds = insertList.Select(p => p.PayBillNo).ToArray(); var deleteIds = insertList.Select(p => p.PayBillNo).ToArray();
foreach (var b in insertList)
b.CreateTime = DateTime.Now;
fsql.Transaction(() => fsql.Transaction(() =>
{ {
fsql.Delete<AuditPayBill>(deleteIds).ExecuteAffrows(); fsql.Delete<AuditPayBill>(deleteIds).ExecuteAffrows();
//fsql.Delete<AuditPayBill>().Where(apb => apb.ImportShopIds == importShopIds &&
// apb.PayTime >= startTime &&
// apb.PayTime <= endTime).ExecuteAffrows();
fsql.Insert(insertList).ExecuteAffrows(); fsql.Insert(insertList).ExecuteAffrows();
}); });
} }

Loading…
Cancel
Save