Browse Source

更新版本

master
zhaoxinyu 5 months ago
parent
commit
1f19a7c648
  1. BIN
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot.rar
  2. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs
  3. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs
  4. 35
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  5. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs

BIN
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot.rar

Binary file not shown.

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs

@ -142,8 +142,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
}
}
[HttpPost]
[UnitOfWork(false)]
[HttpPost]
public virtual async Task<IActionResult> BackCanSettlement([FromBody] string selttleBilNum)
{

4
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs

@ -193,9 +193,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
}
}
[HttpPost]
[UnitOfWork(false)]
[HttpPost]
public virtual async Task<IActionResult> BackCanSettlement([FromBody] string selttleBilNum)
{
if (selttleBilNum.Substring(0, 1) == "N")

35
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs

@ -1965,6 +1965,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{
var entities = await _invMng.GetMainListAsync(p_invGroupNum).ConfigureAwait(false);
var entity = entities.FirstOrDefault();
bool state = await _invMng.Reject(p_invGroupNum).ConfigureAwait(false);
if (state == true)
{
@ -1993,7 +1996,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
return new JsonResult(new { Code = 200, Message = "退回成功" }); ;
}
[UnitOfWork(false)]
private async Task RejectionAsync<Tmain, Tdetail>(Tmain main,List<Tdetail> details)
where Tdetail: SA_CAN_BASE, new() where Tmain : SA_CAN_BASE_MAIN, new()
{
@ -2015,21 +2018,25 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
newmain.InvGroupNum = billNum;
}
newmain.CreationTime = DateTime.Now;
newmain.State = SettleBillState.退;
newmain.State = SettleBillState.;
newmain.ExtraProperties.TryAdd("ParentBillNum", main.BillNum);
newmain.ExtraProperties.TryAdd("InvBillNum", details.FirstOrDefault().InvbillNum);
newmain.ExtraProperties.TryAdd("IsReturn", "是");
var _dbcontext = await _repository.GetDbContextAsync().ConfigureAwait(false);
var list = details;
foreach (var item in list)
foreach (var item in details)
{
item.BillNum = billNum;
item.InvbillNum = string.Empty;
}
await _dbcontext.BulkInsertAsync(new List<Tmain>() { newmain }).ConfigureAwait(false);
await _dbcontext.BulkUpdateAsync(list).ConfigureAwait(false);
await _dbcontext.BulkUpdateAsync(details).ConfigureAwait(false);
}
[UnitOfWork(false)]
[HttpPost]
public virtual async Task<IActionResult> ReturnAsync(INVOICE_GRP_DTO p_dto)
{
@ -2050,17 +2057,17 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
switch(inv.BusinessType)
{
case EnumBusinessType.JisBBAC:
var bbaclist = await dbcontext.Set<BBAC_CAN_SA_DETAIL>().Where(p => p.InvbillNum == p_dto.InvbillNum).ToListAsync().ConfigureAwait(false);
var bbaclist = await dbcontext.Set<BBAC_CAN_SA_DETAIL>().Where(p => p.InvbillNum == p_dto.InvbillNum).AsNoTracking().ToListAsync().ConfigureAwait(false);
var bbacfirst = await dbcontext.Set<BBAC_CAN_SA>().FirstOrDefaultAsync(p => p.BillNum == p_dto.InvGroupNum).ConfigureAwait(false);
await RejectionAsync<BBAC_CAN_SA, BBAC_CAN_SA_DETAIL>(bbacfirst, bbaclist.ToList()).ConfigureAwait(false);
break;
case EnumBusinessType.JisHBPO:
var hbpolist = await dbcontext.Set<HBPO_CAN_SA_DETAIL>().Where(p => p.InvbillNum == p_dto.InvbillNum).ToListAsync().ConfigureAwait(false);
var hbpolist = await dbcontext.Set<HBPO_CAN_SA_DETAIL>().Where(p => p.InvbillNum == p_dto.InvbillNum).AsNoTracking().ToListAsync().ConfigureAwait(false);
var hbpofirst = await dbcontext.Set<HBPO_CAN_SA>().FirstOrDefaultAsync(p => p.BillNum == p_dto.InvGroupNum).ConfigureAwait(false);
await RejectionAsync<HBPO_CAN_SA, HBPO_CAN_SA_DETAIL>(hbpofirst, hbpolist.ToList()).ConfigureAwait(false);
break;
default:
var publist = await dbcontext.Set<PUB_CAN_SA_DETAIL>().Where(p => p.InvbillNum == p_dto.InvbillNum).ToListAsync().ConfigureAwait(false);
var publist = await dbcontext.Set<PUB_CAN_SA_DETAIL>().Where(p => p.InvbillNum == p_dto.InvbillNum).AsNoTracking().ToListAsync().ConfigureAwait(false);
var pubfirst = await dbcontext.Set<PUB_CAN_SA>().FirstOrDefaultAsync(p => p.BillNum == p_dto.InvGroupNum).ConfigureAwait(false);
await RejectionAsync<PUB_CAN_SA, PUB_CAN_SA_DETAIL>(pubfirst, publist.ToList()).ConfigureAwait(false);
break;
@ -2069,14 +2076,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var invgourp=dbcontext.Set<INVOICE_MAP_GROUP>().Where(p => p.InvbillNum == p_dto.InvbillNum).ToList();
var detial=dbcontext.Set<INVOICE_WAIT_DETAIL>().Where(p => p.InvbillNum == p_dto.InvbillNum).ToList();
var notsettle=dbcontext.Set<INVOICE_NOT_SETTLE>().Where(p => p.InvBillNum == p_dto.InvbillNum).ToList();
dbcontext.BulkDeleteAsync(invList).Wait();
dbcontext.BulkDeleteAsync(invgourp).Wait();
dbcontext.BulkDeleteAsync(detial).Wait();
dbcontext.BulkDeleteAsync(notsettle).Wait();
dbcontext.BulkDelete(invList);
dbcontext.BulkDelete(invgourp);
dbcontext.BulkDelete(detial);
dbcontext.BulkDelete(notsettle);
}
return new JsonResult(new { Code = 200, Message = "退回成功" }); ;

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

@ -200,10 +200,19 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
public virtual async Task<bool> SetNewState(string billNum)
{
var dbcontext= await _repository.GetDbContextAsync().ConfigureAwait(false);
var list= await dbcontext.Set<INVOICE_GRP>().Where(p => p.InvGroupNum == billNum).ToListAsync().ConfigureAwait(false);
string invs = string.Empty;
if (list != null && list.Count > 0)
{
invs = string.Join(",", list.Select(p => p.InvbillNum).ToArray());
}
var entity = await GetMainAsync(billNum).ConfigureAwait(false);
if (entity != null)
{
entity.ExtraProperties.TryAdd("ParentBillNum", billNum);
entity.ExtraProperties.TryAdd("InvBillNum", invs);
entity.ExtraProperties.TryAdd("IsReturn", "是");
entity.State = SettleBillState.;
await _repository.UpdateAsync(entity).ConfigureAwait(false);
return true;

Loading…
Cancel
Save