Browse Source

添加印度件价格单校验,变更单据基类添加业务类型字段,修改公共校验接口

master
学 赵 1 year ago
parent
commit
0b048362cc
  1. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs
  2. 42
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs
  3. 14
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs
  4. 28
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/BaseDomainServices/BaseDomainService.cs
  5. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs

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

@ -260,6 +260,15 @@ namespace Win.Sfs.SettleAccount.Bases
{ {
errorEntitylist = await _baseDomainService.CheckPriceList(entityList, inv.Site,true).ConfigureAwait(false); errorEntitylist = await _baseDomainService.CheckPriceList(entityList, inv.Site,true).ConfigureAwait(false);
} }
if (inv.BusinessType == EnumBusinessType.YinDuJian)
{
foreach (var itm in entityList)
{
itm.BusinessType = EnumBusinessType.YinDuJian;
}
errorEntitylist = await _baseDomainService.CheckPriceList(entityList, inv.Site, true).ConfigureAwait(false);
}
else else
{ {
errorEntitylist = await _baseDomainService.CheckPriceList(entityList, inv.Site).ConfigureAwait(false); errorEntitylist = await _baseDomainService.CheckPriceList(entityList, inv.Site).ConfigureAwait(false);

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

@ -33,6 +33,9 @@ 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<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,
TaskJobService service, TaskJobService service,
BaseDomainService baseservice, BaseDomainService baseservice,
@ -40,7 +43,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
INormalEfCoreRepository<PriceListBJ, Guid> pricebjRepository, INormalEfCoreRepository<PriceListBJ, Guid> pricebjRepository,
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
) : 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 +53,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
_adjservice = adjservice; _adjservice = adjservice;
_relationRepository = relationRepository; _relationRepository = relationRepository;
_pdRepository = pdRepository; _pdRepository = pdRepository;
_priceYinDuRepository = priceYinDuRepository;
} }
/// <summary> /// <summary>
/// 提交发票 /// 提交发票
@ -146,6 +151,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1049", ContractNo = itm.ContractNo }); priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1049", ContractNo = itm.ContractNo });
} }
} }
if (inv.BusinessType == EnumBusinessType.YinDuJian)
{
var priceListYindu = _priceYinDuRepository.ToList();//价格单
foreach (var itm in priceListYindu)
{
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1041", ContractNo = itm.ContractNo });
}
}
else else
{ {
priceList = _priceRepository.Where(p => p.IsCancel == false && p.ClientCode == inv.Site).ToList();//价格单 priceList = _priceRepository.Where(p => p.IsCancel == false && p.ClientCode == inv.Site).ToList();//价格单
@ -306,6 +320,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1049", ContractNo = itm.ContractNo }); priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1049", ContractNo = itm.ContractNo });
} }
} }
if (inv.BusinessType == EnumBusinessType.YinDuJian)
{
var priceListYindu = _priceYinDuRepository.ToList();//价格单
foreach (var itm in priceListYindu)
{
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1041", ContractNo = itm.ContractNo });
}
}
else else
{ {
priceList = _priceRepository.Where(p => p.IsCancel == false && p.ClientCode == inv.Site).ToList();//价格单 priceList = _priceRepository.Where(p => p.IsCancel == false && p.ClientCode == inv.Site).ToList();//价格单
@ -622,6 +644,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1049", ContractNo = itm.ContractNo }); priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1049", ContractNo = itm.ContractNo });
} }
} }
if (inv.BusinessType == EnumBusinessType.YinDuJian)
{
var priceListYindu = _priceYinDuRepository.ToList();//价格单
foreach (var itm in priceListYindu)
{
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1041", ContractNo = itm.ContractNo });
}
}
else else
{ {
priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单 priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单
@ -822,6 +854,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1049", ContractNo = itm.ContractNo }); priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1049", ContractNo = itm.ContractNo });
} }
} }
if (inv.BusinessType == EnumBusinessType.YinDuJian)
{
var priceListYindu = _priceYinDuRepository.ToList();//价格单
foreach (var itm in priceListYindu)
{
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1041", ContractNo = itm.ContractNo });
}
}
else else
{ {
priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单 priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单

14
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs

@ -39,6 +39,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
private readonly PUB_CAN_SA_MNG _pubMng; private readonly PUB_CAN_SA_MNG _pubMng;
private readonly INormalEfCoreRepository<PriceList, Guid> _priceRepository; private readonly INormalEfCoreRepository<PriceList, Guid> _priceRepository;
private readonly INormalEfCoreRepository<PriceListYinDu, Guid> _priceYinDuRepository;
private readonly INormalEfCoreRepository<PriceListBJ, Guid> _pricebjRepository; private readonly INormalEfCoreRepository<PriceListBJ, Guid> _pricebjRepository;
private readonly INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> _notRepository; private readonly INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> _notRepository;
@ -53,7 +55,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
INormalEfCoreRepository<PriceListBJ, Guid> pricebjRepository, INormalEfCoreRepository<PriceListBJ, Guid> pricebjRepository,
PUB_CAN_SA_MNG pubMng, PUB_CAN_SA_MNG pubMng,
BaseDomainService baseservice, BaseDomainService baseservice,
INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> notRepository INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> notRepository,
INormalEfCoreRepository<PriceListYinDu, Guid> priceYinDuRepository
) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, detailRepository, invmng, baseservice) ) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, detailRepository, invmng, baseservice)
{ {
@ -61,6 +64,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
_priceRepository = priceRepository; _priceRepository = priceRepository;
_pricebjRepository = pricebjRepository; _pricebjRepository = pricebjRepository;
_notRepository = notRepository; _notRepository = notRepository;
_priceYinDuRepository= priceYinDuRepository;
} }
[HttpPost] [HttpPost]
[UnitOfWork(false)] [UnitOfWork(false)]
@ -83,6 +87,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price ,ClientCode="1049", ContractNo=itm.ContractNo}); priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price ,ClientCode="1049", ContractNo=itm.ContractNo});
} }
} }
if (main.BusinessType == EnumBusinessType.YinDuJian)
{
var priceListbj = _priceYinDuRepository.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 = "1041", ContractNo = itm.ContractNo });
}
}
else else
{ {
priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单 priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单

28
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/BaseDomainServices/BaseDomainService.cs

@ -22,6 +22,7 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices
private readonly INormalEfCoreRepository<MaterialRelationship, Guid> _relationshipRepository; private readonly INormalEfCoreRepository<MaterialRelationship, Guid> _relationshipRepository;
private readonly INormalEfCoreRepository<PriceList, Guid> _priceRepository; private readonly INormalEfCoreRepository<PriceList, Guid> _priceRepository;
private readonly INormalEfCoreRepository<PriceListBJ, Guid> _pricebjRepository; private readonly INormalEfCoreRepository<PriceListBJ, Guid> _pricebjRepository;
private readonly INormalEfCoreRepository<PriceListYinDu, Guid> _priceYinDuRepository;
private readonly INormalEfCoreRepository<Bom, Guid> _bomshipRepository; private readonly INormalEfCoreRepository<Bom, Guid> _bomshipRepository;
public BaseDomainService( public BaseDomainService(
IGuidGenerator guidGenerator, IGuidGenerator guidGenerator,
@ -30,12 +31,14 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices
INormalEfCoreRepository<MaterialRelationship, Guid> relationshipRepository, INormalEfCoreRepository<MaterialRelationship, Guid> relationshipRepository,
INormalEfCoreRepository<Bom, Guid> bomshipRepository, INormalEfCoreRepository<Bom, Guid> bomshipRepository,
INormalEfCoreRepository<PriceList, Guid> priceRepository, INormalEfCoreRepository<PriceList, Guid> priceRepository,
INormalEfCoreRepository<PriceListBJ, Guid> pricebjRepository INormalEfCoreRepository<PriceListBJ, Guid> pricebjRepository,
INormalEfCoreRepository<PriceListYinDu, Guid> priceYinDuRepository
//IExcelImportAppService excelImportService, //IExcelImportAppService excelImportService,
//ISnowflakeIdGenerator snowflakeIdGenerator, //ISnowflakeIdGenerator snowflakeIdGenerator,
//ICommonManager commonManager //ICommonManager commonManager
) )
{ {
_priceYinDuRepository = priceYinDuRepository;
_priceRepository = priceRepository; _priceRepository = priceRepository;
_pricebjRepository = pricebjRepository; _pricebjRepository = pricebjRepository;
_materialRepository = materialRepository; _materialRepository = materialRepository;
@ -257,6 +260,28 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices
select d; select d;
errorList = left.ToList(); errorList = left.ToList();
}
else
{
var first= p_list.FirstOrDefault();
if (first.BusinessType == EnumBusinessType.YinDuJian)
{
var pricelist = _priceYinDuRepository.Where(p => p.ClientCode == p_site && p.IsCancel == false).ToList();
var inner = from d in p_list
join p in pricelist on d.LU equals p.LU
where
d.SettleDate >= p.BeginDate && d.SettleDate <= p.EndDate
select d;
var left = from d in p_list
join p in inner on new { d.LU, d.PN } equals new { p.LU, p.PN }
into temp
from tm in temp.DefaultIfEmpty()//校验错误项
where tm == null
select d;
errorList = left.ToList();
} }
else else
{ {
@ -275,6 +300,7 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices
select d; select d;
errorList = left.ToList(); errorList = left.ToList();
} }
}
return errorList; return errorList;

2
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs

@ -124,6 +124,8 @@ namespace SettleAccount.Bases
/// </summary> /// </summary>
public string GroupNum { set; get; } public string GroupNum { set; get; }
public EnumBusinessType BusinessType { get; set; }
} }
public interface ISA_CAN_BASE : ISBASE public interface ISA_CAN_BASE : ISBASE

Loading…
Cancel
Save