Browse Source

更新

master
学 赵 1 year ago
parent
commit
db435f2995
  1. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs
  2. 76
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs

4
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs

@ -51,9 +51,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
} }
/// <summary> /// <summary>
/// 向前流程 /// 向前流程
/// </summary> /// </summary>
@ -209,7 +206,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
public virtual async Task<bool> SetNewState(BBAC_CAN_SA p_entiy) public virtual async Task<bool> SetNewState(BBAC_CAN_SA p_entiy)
{ {
return await SetNewState(p_entiy.BillNum); return await SetNewState(p_entiy.BillNum);
} }

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

@ -1,6 +1,7 @@
using EFCore.BulkExtensions; using EFCore.BulkExtensions;
using Hangfire; using Hangfire;
using Microsoft.AspNetCore.SignalR; using Microsoft.AspNetCore.SignalR;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using NPOI.SS.Formula.Functions; using NPOI.SS.Formula.Functions;
using SettleAccount.Bases; using SettleAccount.Bases;
@ -39,14 +40,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
PUB_CAN_SA_MNG pubMng, PUB_CAN_SA_MNG pubMng,
BBAC_CAN_SA_MNG bbacMng, BBAC_CAN_SA_MNG bbacMng,
HBPO_CAN_SA_MNG hbpoMng, HBPO_CAN_SA_MNG hbpoMng,
INormalEfCoreRepository<INVOICE_GRP, Guid> repository,
INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> groupRepository,
INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> detailRepository,
INormalEfCoreRepository<INVOICE_GRP, Guid> repository, INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> notRepository,
INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> groupRepository, INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> adjRepository
INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> detailRepository,
INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> notRepository,
INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> adjRepository
) )
{ {
//_canRepository = canRepository; //_canRepository = canRepository;
@ -136,12 +134,18 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
/// <exception cref="BusinessException"></exception> /// <exception cref="BusinessException"></exception>
public virtual async Task<bool> SetForwardState(INVOICE_GRP p_entiy, SettleBillState p_State) public virtual async Task<bool> SetForwardState(INVOICE_GRP p_entiy, SettleBillState p_State)
{ {
if (p_entiy.InvoiceState == InvoiceBillState.)
{
throw new BusinessException("8989", "当前发票已报废不能进行操作");
}
var state = p_State; var state = p_State;
switch (p_State) switch (p_State)
{ {
case SettleBillState.: case SettleBillState.:
if (p_entiy.State == SettleBillState.) if (p_entiy.State == SettleBillState.)
{ {
p_entiy.State = state; p_entiy.State = state;
} }
else else
@ -170,8 +174,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
} }
break; break;
} }
var flag = await SetSettleState(p_entiy, p_State, true); var flag = await SetSettleState(p_entiy, p_State, true);
if (flag == true) if (flag == true)
{ {
@ -434,12 +436,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
/// <returns></returns> /// <returns></returns>
public virtual async Task<bool> Reject(string groupbillNum) public virtual async Task<bool> Reject(string groupbillNum)
{ {
var ls = await _repository.Where(p => p.InvGroupNum == groupbillNum).ToListAsync();
var _ls = await _repository.Where(p => p.InvGroupNum == groupbillNum).ToListAsync(); if (ls != null && ls.Count > 0)
if (_ls != null && _ls.Count > 0)
{ {
foreach (var p_entity in _ls) var first = ls.FirstOrDefault();
if(first.State==SettleBillState. || first.State== SettleBillState.)
{
throw new BusinessException("8989",$"发票分组{groupbillNum}客户已经是客户已收票或已扣减状态不能退回");
}
foreach (var p_entity in ls)
{ {
if (p_entity.State == SettleBillState. if (p_entity.State == SettleBillState.
|| p_entity.State == SettleBillState. || p_entity.State == SettleBillState.) || p_entity.State == SettleBillState. || p_entity.State == SettleBillState.)
@ -448,26 +453,30 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
var groupList = _groupRepository.Where(p => p.InvGroupNum == p_entity.InvGroupNum).ToList(); var groupList = _groupRepository.Where(p => p.InvGroupNum == p_entity.InvGroupNum).ToList();
var notList = _notRepository.Where(p => p.InvGroupNum == p_entity.InvGroupNum).ToList(); var notList = _notRepository.Where(p => p.InvGroupNum == p_entity.InvGroupNum).ToList();
var detailList = _detailRepository.Where(p => p.InvGroupNum == p_entity.InvGroupNum).ToList(); var detailList = _detailRepository.Where(p => p.InvGroupNum == p_entity.InvGroupNum).ToList();
//var canList = _canRepository.Where(p => p.InvGroupNum == p_entity.InvGroupNum).ToList();
//foreach (var itm in canList)
//{
// itm.State = SettleBillState.未结状态;
//}
await _repository.DbContext.BulkDeleteAsync(entList); await _repository.DbContext.BulkDeleteAsync(entList);
await _repository.DbContext.BulkDeleteAsync(groupList); await _repository.DbContext.BulkDeleteAsync(groupList);
await _repository.DbContext.BulkDeleteAsync(notList); await _repository.DbContext.BulkDeleteAsync(notList);
await _repository.DbContext.BulkDeleteAsync(detailList); await _repository.DbContext.BulkDeleteAsync(detailList);
if (first.BusinessType == EnumBusinessType.JisBBAC)
{
await _bbacMng.SetNewState(groupbillNum);
}
else if (first.BusinessType == EnumBusinessType.JisHBPO)
{
await _hbpoMng.SetNewState(groupbillNum);
}
else
{
await _pubMng.SetNewState(groupbillNum);
}
//await _repository.DbContext.BulkUpdateAsync(canList); //await _repository.DbContext.BulkUpdateAsync(canList);
} }
if (p_entity.State == SettleBillState.)
{
}
} }
} }
else else
{ {
throw new BusinessException("8989",$"查询不到发票分组号为{groupbillNum}发票分组");
} }
return true; return true;
} }
@ -892,7 +901,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
return true; return true;
} }
/// <summary>
///
/// </summary>
/// <param name="dtos"></param>
/// <param name="p_OldInvBillNum"></param>
/// <param name="p_version"></param>
/// <returns></returns>
/// <exception cref="BusinessException"></exception>
public async Task<bool> ReissueFirstInvoice(List<TEMP_CAN_SA_DETAIL> dtos, string p_OldInvBillNum, int p_version) public async Task<bool> ReissueFirstInvoice(List<TEMP_CAN_SA_DETAIL> dtos, string p_OldInvBillNum, int p_version)
{ {
if (!string.IsNullOrEmpty(p_OldInvBillNum)) if (!string.IsNullOrEmpty(p_OldInvBillNum))
@ -914,6 +930,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
} }
return false; return false;
} }
/// <summary>
///
/// </summary>
/// <param name="dtos"></param>
/// <param name="p_OldInvBillNum"></param>
/// <param name="p_version"></param>
/// <returns></returns>
/// <exception cref="BusinessException"></exception>
public async Task<bool> ReissueSecInvoice(List<TEMP_CAN_SA_DETAIL> dtos, string p_OldInvBillNum, int p_version) public async Task<bool> ReissueSecInvoice(List<TEMP_CAN_SA_DETAIL> dtos, string p_OldInvBillNum, int p_version)
{ {
if (!string.IsNullOrEmpty(p_OldInvBillNum)) if (!string.IsNullOrEmpty(p_OldInvBillNum))

Loading…
Cancel
Save