Browse Source

更新版本

master
zhaoxinyu 11 months ago
parent
commit
8e659e7b8b
  1. 18
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs
  2. 15
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs
  3. 17
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  4. 13
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs

18
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs

@ -34,6 +34,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
private readonly INormalEfCoreRepository<PriceList, Guid> _priceRepository; private readonly INormalEfCoreRepository<PriceList, Guid> _priceRepository;
private readonly INormalEfCoreRepository<BBAC_PD, Guid> _pdRepository; private readonly INormalEfCoreRepository<BBAC_PD, Guid> _pdRepository;
private readonly INormalEfCoreRepository<MaterialRelationship, Guid> _relationRepository; private readonly INormalEfCoreRepository<MaterialRelationship, Guid> _relationRepository;
private readonly INormalEfCoreRepository<InvoiceSyncQad, Guid> _invSyncrepository;
private readonly ADJ_SERVICE _adjservice; private readonly ADJ_SERVICE _adjservice;
public BBAC_BA_SERVICE(IExcelImportAppService excelImportService, public BBAC_BA_SERVICE(IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator, ISnowflakeIdGenerator snowflakeIdGenerator,
@ -46,6 +47,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> adjRepository, INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> adjRepository,
INormalEfCoreRepository<BBAC_PD, Guid> pdRepository, INormalEfCoreRepository<BBAC_PD, Guid> pdRepository,
INormalEfCoreRepository<MaterialRelationship, Guid> relationRepository, INormalEfCoreRepository<MaterialRelationship, Guid> relationRepository,
INormalEfCoreRepository<InvoiceSyncQad, Guid> invSyncrepository,
BBAC_CAN_SA_MNG bbacMng, BBAC_CAN_SA_MNG bbacMng,
HBPO_CAN_SA_MNG hbpoMng, HBPO_CAN_SA_MNG hbpoMng,
@ -75,6 +77,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
_priceRepository = priceRepository; _priceRepository = priceRepository;
_adjservice = adjservice; _adjservice = adjservice;
_pdRepository = pdRepository; _pdRepository = pdRepository;
_invSyncrepository = invSyncrepository;
} }
/// <summary> /// <summary>
@ -470,6 +473,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
public virtual async Task<IActionResult> ReissueInvoiceList(List<PUB_ADJ_DETAIL_DTO> p_list) public virtual async Task<IActionResult> ReissueInvoiceList(List<PUB_ADJ_DETAIL_DTO> p_list)
{ {
var result = await _adjservice.CheckImport(p_list).ConfigureAwait(false); var result = await _adjservice.CheckImport(p_list).ConfigureAwait(false);
if (result != "OK") if (result != "OK")
{ {
@ -484,6 +490,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
} }
var first = p_list.FirstOrDefault(); var first = p_list.FirstOrDefault();
var invbillnum = first.InvBillNum; var invbillnum = first.InvBillNum;
var count = _pdRepository.Count(p => p.BillNum == invbillnum); var count = _pdRepository.Count(p => p.BillNum == invbillnum);
if (count > 0) if (count > 0)
{ {
@ -496,10 +503,21 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
//var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组 //var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组
var inv = await GetInvoiceGroupByInvBillNum(invbillnum).ConfigureAwait(false); var inv = await GetInvoiceGroupByInvBillNum(invbillnum).ConfigureAwait(false);
if (inv == null) if (inv == null)
{ {
throw new UserFriendlyException($"无原发票记录!", "400"); throw new UserFriendlyException($"无原发票记录!", "400");
} }
if (inv.State == SettleBillState.)
{
if (_invSyncrepository.Any(p => p.InvoiceNumber == inv.RealnvBillNum))
{
throw new UserFriendlyException($"红冲金税发票号{inv.RealnvBillNum}已经传过QAD,请更改金税发票号和开票日期后再进行重开!", "400");
}
}
if (inv.InvoiceState == InvoiceBillState.) if (inv.InvoiceState == InvoiceBillState.)
{ {
throw new UserFriendlyException($"已经报废发票不能再次报废!", "400"); throw new UserFriendlyException($"已经报废发票不能再次报废!", "400");

15
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs

@ -31,6 +31,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
private readonly INormalEfCoreRepository<MaterialRelationship, Guid> _relationRepository; private readonly INormalEfCoreRepository<MaterialRelationship, Guid> _relationRepository;
private readonly INormalEfCoreRepository<HBPO_PD, Guid> _pdRepository; private readonly INormalEfCoreRepository<HBPO_PD, Guid> _pdRepository;
private readonly INormalEfCoreRepository<PriceList, Guid> _priceRepository; private readonly INormalEfCoreRepository<PriceList, Guid> _priceRepository;
private readonly INormalEfCoreRepository<InvoiceSyncQad, Guid> _invSyncrepository;
private readonly ADJ_SERVICE _adjservice; private readonly ADJ_SERVICE _adjservice;
public HBPO_BA_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> pubRepository, INormalEfCoreRepository<INVOICE_GRP, Guid> repository, INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository, INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository, INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository, public HBPO_BA_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> pubRepository, INormalEfCoreRepository<INVOICE_GRP, Guid> repository, INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository, INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository, INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository,
@ -41,7 +42,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
INormalEfCoreRepository<PriceList, Guid> priceRepository, INormalEfCoreRepository<PriceList, Guid> priceRepository,
ADJ_SERVICE adjservice, ADJ_SERVICE adjservice,
INormalEfCoreRepository<MaterialRelationship, Guid> relationRepository, INormalEfCoreRepository<MaterialRelationship, Guid> relationRepository,
INormalEfCoreRepository<HBPO_PD, Guid> pdRepository INormalEfCoreRepository<HBPO_PD, Guid> pdRepository,
INormalEfCoreRepository<InvoiceSyncQad, Guid> invSyncrepository
) )
: base(excelImportService, snowflakeIdGenerator, commonManager, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service, baseservice) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service, baseservice)
{ {
@ -49,6 +51,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
_adjservice = adjservice; _adjservice = adjservice;
_relationRepository = relationRepository; _relationRepository = relationRepository;
_pdRepository = pdRepository; _pdRepository = pdRepository;
_invSyncrepository = invSyncrepository;
} }
[HttpPost] [HttpPost]
[UnitOfWork(false)] [UnitOfWork(false)]
@ -488,6 +492,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
throw new UserFriendlyException($"无原发票记录!", "400"); throw new UserFriendlyException($"无原发票记录!", "400");
} }
if (inv.State == SettleBillState.)
{
if (_invSyncrepository.Any(p => p.InvoiceNumber == inv.RealnvBillNum))
{
throw new UserFriendlyException($"红冲金税发票号{inv.RealnvBillNum}已经传过QAD,请更改金税发票号和开票日期后再进行重开!", "400");
}
}
if (inv.InvoiceState == InvoiceBillState.) if (inv.InvoiceState == InvoiceBillState.)
{ {
throw new UserFriendlyException($"已经报废发票不能再次报废!", "400"); throw new UserFriendlyException($"已经报废发票不能再次报废!", "400");

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

@ -1268,20 +1268,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
var newinv1 = result.Where(p => p.InvbillNum == inv.InvbillNum).FirstOrDefault(); var newinv1 = result.Where(p => p.InvbillNum == inv.InvbillNum).FirstOrDefault();
var newinv = ls.Where(p => p.InvbillNum == inv.InvbillNum).FirstOrDefault(); var newinv = ls.Where(p => p.InvbillNum == inv.InvbillNum).FirstOrDefault();
if (inv.State == SettleBillState. && inv.InvoiceState == InvoiceBillState.)
{
inv.RealnvBillNum = newinv.RealnvBillNum;
}
else
{
inv.Tax = 0.13m;
inv.RealnvBillNum = newinv.RealnvBillNum;
inv.TaxDiff = newinv.PreTaxDiff;
inv.CreationTime = newinv1.InvoiceDate;
inv.FileName = newinv1.FileName;
}
inv.Tax = 0.13m;
inv.RealnvBillNum = newinv.RealnvBillNum;
inv.TaxDiff = newinv.PreTaxDiff;
inv.CreationTime = newinv1.InvoiceDate;
inv.FileName = newinv1.FileName;
} }

13
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs

@ -34,7 +34,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
private readonly ADJ_SERVICE _adjservice; private readonly ADJ_SERVICE _adjservice;
private readonly INormalEfCoreRepository<MaterialRelationship, Guid> _relationRepository; private readonly INormalEfCoreRepository<MaterialRelationship, Guid> _relationRepository;
private readonly INormalEfCoreRepository<PUB_PD, Guid> _pdRepository; private readonly INormalEfCoreRepository<PUB_PD, Guid> _pdRepository;
private readonly INormalEfCoreRepository<InvoiceSyncQad, Guid> _invSyncrepository;
private readonly INormalEfCoreRepository<PriceListYinDu, Guid> _priceYinDuRepository; private readonly INormalEfCoreRepository<PriceListYinDu, Guid> _priceYinDuRepository;
public PUB_BA_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> pubRepository, INormalEfCoreRepository<INVOICE_GRP, Guid> repository, INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository, INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository, INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository, INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> adjRepository, BBAC_CAN_SA_MNG bbacMng, HBPO_CAN_SA_MNG hbpoMng, PUB_CAN_SA_MNG pubMng, INV_MNG invMng, public PUB_BA_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> pubRepository, INormalEfCoreRepository<INVOICE_GRP, Guid> repository, INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository, INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository, INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository, INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> adjRepository, BBAC_CAN_SA_MNG bbacMng, HBPO_CAN_SA_MNG hbpoMng, PUB_CAN_SA_MNG pubMng, INV_MNG invMng,
@ -45,7 +45,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
ADJ_SERVICE adjservice, ADJ_SERVICE adjservice,
INormalEfCoreRepository<MaterialRelationship, Guid> relationRepository, INormalEfCoreRepository<MaterialRelationship, Guid> relationRepository,
INormalEfCoreRepository<PUB_PD, Guid> pdRepository, INormalEfCoreRepository<PUB_PD, Guid> pdRepository,
INormalEfCoreRepository<PriceListYinDu, Guid> priceYinDuRepository INormalEfCoreRepository<PriceListYinDu, Guid> priceYinDuRepository,
INormalEfCoreRepository<InvoiceSyncQad, Guid> invSyncrepository
) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service, baseservice) ) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service, baseservice)
{ {
@ -55,6 +56,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
_relationRepository = relationRepository; _relationRepository = relationRepository;
_pdRepository = pdRepository; _pdRepository = pdRepository;
_priceYinDuRepository = priceYinDuRepository; _priceYinDuRepository = priceYinDuRepository;
_invSyncrepository = invSyncrepository;
} }
/// <summary> /// <summary>
/// 提交发票 /// 提交发票
@ -891,6 +893,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
throw new UserFriendlyException($"无原发票记录!", "400"); throw new UserFriendlyException($"无原发票记录!", "400");
} }
if (inv.State == SettleBillState.)
{
if (_invSyncrepository.Any(p => p.InvoiceNumber == inv.RealnvBillNum))
{
throw new UserFriendlyException($"红冲金税发票号{inv.RealnvBillNum}已经传过QAD,请更改金税发票号和开票日期后再进行重开!", "400");
}
}
if (inv.InvoiceState == InvoiceBillState.) if (inv.InvoiceState == InvoiceBillState.)
{ {
throw new UserFriendlyException($"已经报废发票不能再次报废!", "400"); throw new UserFriendlyException($"已经报废发票不能再次报废!", "400");

Loading…
Cancel
Save