Browse Source

更新版本

master
学 赵 1 year ago
parent
commit
e19efe6b1a
  1. 29
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/BaseDomainServices/BaseDomainService.cs
  2. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs
  3. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs

29
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/BaseDomainServices/BaseDomainService.cs

@ -1,3 +1,5 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using SettleAccount.Bases; using SettleAccount.Bases;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -52,6 +54,31 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices
} }
public static async Task DoWorkBulkWithTransaction(DbContext dbContext, Action p_dowork)
{
using (var transaction = await dbContext.Database.BeginTransactionAsync())
{
try
{
// 执行批量数据操作
p_dowork();
// 提交事务
await transaction.CommitAsync();
}
catch (Exception)
{
// 回滚事务
await transaction.RollbackAsync();
throw;
}
}
}
public async Task<List<string>> CheckBase(List<string> p_list, BASE_CONF p_config) public async Task<List<string>> CheckBase(List<string> p_list, BASE_CONF p_config)
{ {
@ -67,7 +94,6 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices
from tm in temp.DefaultIfEmpty() from tm in temp.DefaultIfEmpty()
where tm == null where tm == null
select itm; select itm;
foreach (var itm1 in query.ToList()) foreach (var itm1 in query.ToList())
{ {
errorList.Add(itm1); errorList.Add(itm1);
@ -75,7 +101,6 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices
} }
if (p_config.IsMaterial == true) if (p_config.IsMaterial == true)
{ {
var materialList = await _materialRepository.ToListAsync(); var materialList = await _materialRepository.ToListAsync();
var query = from itm in partList var query = from itm in partList
join itm1 in materialList on itm equals itm1.MaterialCode join itm1 in materialList on itm equals itm1.MaterialCode

6
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs

@ -53,12 +53,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
return true; return true;
} }
return false; return false;
} }
/// <summary> /// <summary>
///正向流程 ///正向流程
/// </summary> /// </summary>
@ -68,7 +63,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
/// <exception cref="BusinessException"></exception> /// <exception cref="BusinessException"></exception>
public virtual async Task<bool> SetForwardState(string p_billNum, SettleBillState state) public virtual async Task<bool> SetForwardState(string p_billNum, SettleBillState state)
{ {
var ls = _repository.Where(p => p.InvGroupNum == p_billNum).ToList(); var ls = _repository.Where(p => p.InvGroupNum == p_billNum).ToList();
if (ls == null && ls.Count ==0) if (ls == null && ls.Count ==0)
{ {

11
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs

@ -5,6 +5,7 @@ using Microsoft.AspNetCore.SignalR;
using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using NPOI.SS.Formula.Functions; using NPOI.SS.Formula.Functions;
using NPOI.Util;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Math; using OfficeOpenXml.FormulaParsing.Excel.Functions.Math;
using SettleAccount.Bases; using SettleAccount.Bases;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
@ -1509,11 +1510,21 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
_invls = invlist.Select(p => p.InvbillNum).ToList(); _invls = invlist.Select(p => p.InvbillNum).ToList();
} }
return _invls; return _invls;
} }
/// <summary> /// <summary>
/// hbpojis /// hbpojis
/// </summary> /// </summary>

Loading…
Cancel
Save