Browse Source

变更退回逻辑,两次退回改为一次退回

master
学 赵 1 year ago
parent
commit
3beac1116b
  1. 10
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs
  2. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs
  3. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  4. 26
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs
  5. 18
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs

10
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs

@ -255,7 +255,15 @@ namespace Win.Sfs.SettleAccount.Bases
errorList.Add( errorList.Add(
new ERR_EXP_DTO() { ItemCode = $"{itm}", Message = $"[客户零件关系表]不存在客户零件号{itm}" }); new ERR_EXP_DTO() { ItemCode = $"{itm}", Message = $"[客户零件关系表]不存在客户零件号{itm}" });
} }
var errorEntitylist = await _baseDomainService.CheckPriceList(entityList, inv.Site).ConfigureAwait(false); var errorEntitylist = new List<PUB_ADJ_DETAIL>();
if (inv.BusinessType == EnumBusinessType.BeiJian)
{
errorEntitylist = await _baseDomainService.CheckPriceList(entityList, inv.Site,true).ConfigureAwait(false);
}
else
{
errorEntitylist = await _baseDomainService.CheckPriceList(entityList, inv.Site).ConfigureAwait(false);
}
if (errorEntitylist.Count > 0) if (errorEntitylist.Count > 0)
{ {
foreach (var itm in errorEntitylist) foreach (var itm in errorEntitylist)

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

@ -371,7 +371,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var settle = await _bbacMng.GetMainAsync(inv.InvGroupNum).ConfigureAwait(false); var settle = await _bbacMng.GetMainAsync(inv.InvGroupNum).ConfigureAwait(false);
if (settle == null) if (settle == null)
{ {
throw new UserFriendlyException($"选择发票:{invbillnum}对应的可结算单不粗拿在在请检查!", "400"); throw new UserFriendlyException($"选择发票:{invbillnum}对应的可结算单不在请检查!", "400");
} }
version = settle.Version; version = settle.Version;
if (inv != null) if (inv != null)

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

@ -645,10 +645,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
} }
[HttpPost] [HttpPost]
public virtual async Task<string> ExportAsync(INVOICE_GRP_REQ_DTO input) public virtual async Task<string> ExportAsync(INVOICE_GRP_REQ_DTO input)
{ {

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

@ -606,12 +606,26 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
} }
var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据 var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据
var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList();
var priceList = _priceRepository.ToList();//价格单
//var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType);
//if (errorList.Count() > 0)
//{
// return await ExportErrorReportAsync(errorList);
//}
List<PriceList> priceList = new List<PriceList>();
if (inv.BusinessType == EnumBusinessType.BeiJian)
{
var priceListbj = _pricebjRepository.Where(p => p.IsCancel == false).ToList(); //价格单
foreach (var itm in priceListbj)
{
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1049", ContractNo = itm.ContractNo });
}
}
else
{
priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单
}
var dto1s = ObjectMapper.Map<List<PUB_CAN_SA_DETAIL>, List<PUB_CAN_SA_DETAIL_DTO>>(entitys); var dto1s = ObjectMapper.Map<List<PUB_CAN_SA_DETAIL>, List<PUB_CAN_SA_DETAIL_DTO>>(entitys);
var q = from d in dto1s var q = from d in dto1s
join p in priceList on d.LU equals p.LU join p in priceList on d.LU equals p.LU

18
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs

@ -2,6 +2,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using EFCore.BulkExtensions; using EFCore.BulkExtensions;
using NPOI.OpenXmlFormats.Spreadsheet;
using SettleAccount.Bases; using SettleAccount.Bases;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using TaskJob.EventArgs; using TaskJob.EventArgs;
@ -232,6 +233,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
var billList = p_ls.Select(p => p.BillNum).Distinct().ToList();//同步数据的发票号 var billList = p_ls.Select(p => p.BillNum).Distinct().ToList();//同步数据的发票号
var pdList = _dbcontext.Set<PUB_PD>().Where(p => billList.Contains(p.BillNum)).ToList();//扣减单内容 var pdList = _dbcontext.Set<PUB_PD>().Where(p => billList.Contains(p.BillNum)).ToList();//扣减单内容
var pdinvList = _dbcontext.Set<INVOICE_GRP>().Where(p => billList.Contains(p.InvbillNum)).ToList(); var pdinvList = _dbcontext.Set<INVOICE_GRP>().Where(p => billList.Contains(p.InvbillNum)).ToList();
var pddetail = _dbcontext.Set<PUB_PD_DETAIL>().Where(p => billList.Contains(p.BillNum)).ToList();
if (pdList.Count > 0) if (pdList.Count > 0)
{ {
if (flag == true) if (flag == true)
@ -255,7 +259,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
} }
foreach (var item in pdinvList) foreach (var item in pdinvList)
{ {
if (item.State == SettleBillState.QAD) if (item.State == SettleBillState.QAD)
{ {
item.State = SettleBillState.; item.State = SettleBillState.;
@ -265,12 +268,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
item.State = SettleBillState.; item.State = SettleBillState.;
} }
} }
_dbcontext.BulkUpdate(pdList); _dbcontext.BulkDelete(pdList);
_dbcontext.BulkDelete(pddetail);
_dbcontext.BulkUpdate(pdinvList); _dbcontext.BulkUpdate(pdinvList);
} }
} }
var bbacList = _dbcontext.Set<BBAC_PD>().Where(p => billList.Contains(p.BillNum)).ToList(); var bbacList = _dbcontext.Set<BBAC_PD>().Where(p => billList.Contains(p.BillNum)).ToList();
var bbacinvList = _dbcontext.Set<INVOICE_GRP>().Where(p => billList.Contains(p.InvbillNum)).ToList(); var bbacinvList = _dbcontext.Set<INVOICE_GRP>().Where(p => billList.Contains(p.InvbillNum)).ToList();
var bbacDetail = _dbcontext.Set<BBAC_PD_DETAIL>().Where(p => billList.Contains(p.BillNum)).ToList();
if (bbacList.Count > 0) if (bbacList.Count > 0)
{ {
if (flag == true) if (flag == true)
@ -304,12 +309,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
item.State = SettleBillState.; item.State = SettleBillState.;
} }
} }
_dbcontext.BulkUpdate(bbacList); _dbcontext.BulkDelete(bbacDetail);
_dbcontext.BulkDelete(bbacList);
_dbcontext.BulkUpdate(bbacinvList); _dbcontext.BulkUpdate(bbacinvList);
} }
} }
var hbpoList = _dbcontext.Set<HBPO_PD>().Where(p => billList.Contains(p.BillNum)).ToList(); var hbpoList = _dbcontext.Set<HBPO_PD>().Where(p => billList.Contains(p.BillNum)).ToList();
var hbpoinvList = _dbcontext.Set<INVOICE_GRP>().Where(p => billList.Contains(p.InvbillNum)).ToList();//发票 var hbpoinvList = _dbcontext.Set<INVOICE_GRP>().Where(p => billList.Contains(p.InvbillNum)).ToList();//发票
var hbpoDetail = _dbcontext.Set<HBPO_PD_DETAIL>().Where(p => billList.Contains(p.BillNum)).ToList();
if (hbpoList.Count > 0) if (hbpoList.Count > 0)
{ {
if (flag == true) if (flag == true)
@ -333,7 +340,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
} }
foreach (var item in hbpoinvList) foreach (var item in hbpoinvList)
{ {
if (item.State == SettleBillState.QAD) if (item.State == SettleBillState.QAD)
{ {
item.State = SettleBillState.; item.State = SettleBillState.;
@ -343,8 +349,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
item.State = SettleBillState.; item.State = SettleBillState.;
} }
} }
_dbcontext.BulkUpdate(hbpoList); _dbcontext.BulkDelete(hbpoList);
_dbcontext.BulkDelete(hbpoDetail);
_dbcontext.BulkUpdate(hbpoinvList); _dbcontext.BulkUpdate(hbpoinvList);
} }
} }
} }

Loading…
Cancel
Save