Browse Source

更新版本

master
zhaoxinyu 5 months ago
parent
commit
3496e04d9d
  1. 44
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  2. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PDMakeService.cs
  3. 61
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_GRP_EXTEND.cs
  4. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs

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

@ -144,21 +144,48 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var invoiceGrps = _settleAccountDbContext.Set<INVOICE_GRP>()
.Where(t => invbillNums.Contains(t.InvbillNum));
var invoiceBBACGrps = invoiceGrps.Where(p => p.BusinessType == EnumBusinessType.JisBBAC).Where(t => t.State == SettleBillState.).Select(p=>p.InvbillNum);
var invoiceBBACGrps = invoiceGrps.Where(p => p.BusinessType == EnumBusinessType.JisBBAC).Where(t => t.State == SettleBillState.);
var invoicePubGrps = invoiceGrps.Where(p => p.BusinessType != EnumBusinessType.JisBBAC && p.BusinessType != EnumBusinessType.JisHBPO)
.Where(t => t.State == SettleBillState.).Select(p=>p.InvbillNum);
var invoiceHbpoGrps = invoiceGrps.Where(p => p.BusinessType == EnumBusinessType.JisHBPO).Where(t => t.State == SettleBillState.).Select(p=>p.InvbillNum);
.Where(t => t.State == SettleBillState.);
var invoiceHbpoGrps = invoiceGrps.Where(p => p.BusinessType == EnumBusinessType.JisHBPO).Where(t => t.State == SettleBillState.);
if (invoiceBBACGrps.Any())
{
await CreateBBACTaskAsync(invoiceBBACGrps.ToList()).ConfigureAwait(false);
var invlist = await invoiceBBACGrps.ToListAsync().ConfigureAwait(false);
foreach (var itm in invlist)
{
itm.State = SettleBillState.;
}
await _settleAccountDbContext.BulkUpdateAsync(invlist).ConfigureAwait(false);
var billinvs=invlist.Select(p => p.InvbillNum).ToList();
await CreateBBACTaskAsync(billinvs).ConfigureAwait(false);
}
if (invoicePubGrps.Any())
{
await CreatePubTaskAsync(invoicePubGrps.ToList()).ConfigureAwait(false);
var invlist = await invoicePubGrps.ToListAsync().ConfigureAwait(false);
foreach (var itm in invlist)
{
itm.State = SettleBillState.;
}
await _settleAccountDbContext.BulkUpdateAsync(invlist).ConfigureAwait(false);
var billinvs = invlist.Select(p => p.InvbillNum).ToList();
await CreatePubTaskAsync(billinvs).ConfigureAwait(false);
}
if (invoiceHbpoGrps.Any())
{
await CreateHBPOTaskAsync(invoiceHbpoGrps.ToList()).ConfigureAwait(false);
var invlist = await invoiceHbpoGrps.ToListAsync().ConfigureAwait(false);
foreach (var itm in invlist)
{
itm.State = SettleBillState.;
}
await _settleAccountDbContext.BulkUpdateAsync(invlist).ConfigureAwait(false);
var billinvs = invlist.Select(p => p.InvbillNum).ToList();
await CreateHBPOTaskAsync(billinvs).ConfigureAwait(false);
}
return new OkResult();
@ -819,6 +846,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
private async Task CreateBBACTaskAsync(List<string> invoiceGrps)
{
var invDetails = await _settleAccountDbContext.Set<BBAC_CAN_SA_DETAIL>().Where(p => invoiceGrps.Contains(p.InvbillNum)).AsNoTracking().ToListAsync().ConfigureAwait(false);
foreach (var itm in invoiceGrps)
{
@ -924,9 +953,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
private async Task CreateHBPOTaskAsync(List<string> invoiceGrps)
{
var invDetails=await _settleAccountDbContext.Set<HBPO_CAN_SA_DETAIL>().Where(p =>invoiceGrps.Contains(p.InvbillNum)).AsNoTracking().ToListAsync().ConfigureAwait(false);
foreach (var itm in invoiceGrps)
{
var ls = invDetails.Where(p => p.InvbillNum == itm).ToList();

11
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PDMakeService.cs

@ -109,6 +109,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
{
var entitys = invList.Where(p => newlist.Contains(p.InvbillNum)).ToList();
var entityDetail = _dbcontext.Set<BBAC_CAN_SA_DETAIL>().Where(p => newlist.Contains(p.InvbillNum)).ToList();//结算明细
var adjlist = _dbcontext.Set<PUB_ADJ_DETAIL>().Where(p => newlist.Contains(p.InvBillNum)).ToList();//发票关联调整表明细
if (adjlist != null && adjlist.Count > 0)
{
@ -185,6 +191,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
bbacDetail.Add(detail);
}
_dbcontext.BulkInsert(bbacmainlist);
_dbcontext.BulkInsert(bbacDetail);
foreach (var itm in invList)

61
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_GRP_EXTEND.cs

@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;
namespace Win.Sfs.SettleAccount.Entities.BQ
{
public class INVOICE_GRP_EXTEND:Entity<Guid>
{
public string invoiceNumber { get; set; }
public string sasInvoiceNumber { get; set; }
public string Customer { get; set; }
public string BillTo { get; set; }
public DateTime InvoiceDate { get; set; }
public string Site { get; set; }
public string TYPE { get; set; }
public string PartNumber { get; set; }
public decimal InvoiceQuatity { get; set; }
public decimal Price { get; set; }
public string Supplier { get; set; }
public string Remark { get; set; }
public decimal InvoiceNetAmount { get; set; }
public decimal InvoiceTaxAmount { get; set; }
public decimal TaxRate { get; set; }
public string Location { get; set; }
public decimal InvoiceNet { get; set; }
public decimal InvoiceTax { get; set; }
public string commandtype { get; set; }
public string domain { get; set; }
public string LINE { get; set; }
public INVOICE_GRP_EXTEND(string invoiceNumber, string sasInvoiceNumber, string customer, string billTo, DateTime invoiceDate, string site, string tYPE, string partNumber, decimal invoiceQuatity, decimal price, string supplier, string remark, decimal invoiceNetAmount, decimal invoiceTaxAmount, decimal taxRate, string location, decimal invoiceNet, decimal invoiceTax, string commandtype, string domain, string lINE)
{
this.invoiceNumber = invoiceNumber;
this.sasInvoiceNumber = sasInvoiceNumber;
Customer = customer;
BillTo = billTo;
InvoiceDate = invoiceDate;
Site = site;
TYPE = tYPE;
PartNumber = partNumber;
InvoiceQuatity = invoiceQuatity;
Price = price;
Supplier = supplier;
Remark = remark;
InvoiceNetAmount = invoiceNetAmount;
InvoiceTaxAmount = invoiceTaxAmount;
TaxRate = taxRate;
Location = location;
InvoiceNet = invoiceNet;
InvoiceTax = invoiceTax;
this.commandtype = commandtype;
this.domain = domain;
LINE = lINE;
}
}
}

3
code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs

@ -37,7 +37,8 @@ namespace Win.Sfs.SettleAccount
= 10,
[Description("扣减单生成中")]
= 11,
[Description("发票同步中")]
= 12,
}

Loading…
Cancel
Save