Browse Source

更新版本

master
zhaoxinyu 11 months ago
parent
commit
be8149b672
  1. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs
  2. 57
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs

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

@ -14,6 +14,7 @@ using Volo.Abp.Emailing;
using Volo.Abp.Uow; using Volo.Abp.Uow;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.Entities.CodeSettings; using Win.Sfs.SettleAccount.Entities.CodeSettings;
using Win.Sfs.SettleAccount.MaterialRelationships;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
{ {
@ -212,6 +213,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
foreach (var inv in invs) foreach (var inv in invs)
{ {
var pdls= p_ls.Where(p => p.BillNum == inv.InvbillNum).ToList(); var pdls= p_ls.Where(p => p.BillNum == inv.InvbillNum).ToList();
var query1 = from itm in pdls var query1 = from itm in pdls
select new VmiLog() select new VmiLog()
{ {

57
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs

@ -15,6 +15,7 @@ using Volo.Abp.Uow;
using Win.Sfs.SettleAccount.Bases; using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.Entities.BQ.Temp; using Win.Sfs.SettleAccount.Entities.BQ.Temp;
using Win.Sfs.SettleAccount.Entities.CodeSettings; using Win.Sfs.SettleAccount.Entities.CodeSettings;
using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ.Managers namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
@ -43,7 +44,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
private readonly INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> _notpubRepository; private readonly INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> _notpubRepository;
private readonly INormalEfCoreRepository<MaterialRelationship, Guid> _relationRepository;
private readonly INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> _notRepository; private readonly INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> _notRepository;
private readonly INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> _adjRepository; private readonly INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> _adjRepository;
protected readonly INormalEfCoreRepository<CodeSetting, Guid> _codesetRepository; protected readonly INormalEfCoreRepository<CodeSetting, Guid> _codesetRepository;
@ -58,6 +59,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
PUB_CAN_SA_MNG pubMng, PUB_CAN_SA_MNG pubMng,
BBAC_CAN_SA_MNG bbacMng, BBAC_CAN_SA_MNG bbacMng,
HBPO_CAN_SA_MNG hbpoMng, HBPO_CAN_SA_MNG hbpoMng,
INormalEfCoreRepository<MaterialRelationship, Guid> relationRepository,
INormalEfCoreRepository<BBAC_PD, Guid> pdbbacRepository, INormalEfCoreRepository<BBAC_PD, Guid> pdbbacRepository,
INormalEfCoreRepository<HBPO_PD, Guid> pdhbpoRepository, INormalEfCoreRepository<HBPO_PD, Guid> pdhbpoRepository,
INormalEfCoreRepository<PUB_PD, Guid> pdpubRepository, INormalEfCoreRepository<PUB_PD, Guid> pdpubRepository,
@ -87,6 +89,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
_codesetRepository = codesetRepository; _codesetRepository = codesetRepository;
_nothbpoRepository = nothbpoRepository; _nothbpoRepository = nothbpoRepository;
_notpubRepository = notpubRepository; _notpubRepository = notpubRepository;
_relationRepository= relationRepository;
} }
public INV_MNG() public INV_MNG()
@ -375,6 +378,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
/// <returns></returns> /// <returns></returns>
public virtual async Task<bool> ReceivedAsync(List<string> p_invs) public virtual async Task<bool> ReceivedAsync(List<string> p_invs)
{ {
var relationList=_relationRepository.ToList();
var invList = _repository.Where(p => p_invs.Contains(p.InvbillNum)).ToList();//所有提交发票信息 var invList = _repository.Where(p => p_invs.Contains(p.InvbillNum)).ToList();//所有提交发票信息
int count = invList.Select(p => p.InvGroupNum).Distinct().Count(); int count = invList.Select(p => p.InvGroupNum).Distinct().Count();
if (count > 1) if (count > 1)
@ -526,6 +532,19 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
detail.Extend2 = itm.ErpLoc;//ERP库位 detail.Extend2 = itm.ErpLoc;//ERP库位
bbacDetail.Add(detail); bbacDetail.Add(detail);
} }
foreach (var itm in bbacDetail)
{
if (string.IsNullOrEmpty(itm.RELU))
{
if (itm.BusinessType==EnumBusinessType.None)
{
itm.BusinessType= EnumBusinessType.JisBBAC;
}
var relist = relationList.Where(p => p.BusinessType == itm.BusinessType).ToList();
var material = relist.FirstOrDefault(p => p.SettleMaterialCode == itm.LU);
itm.RELU = material.ErpMaterialCode;
}
}
await _repository.DbContext.BulkInsertAsync(bbacmainlist).ConfigureAwait(false); await _repository.DbContext.BulkInsertAsync(bbacmainlist).ConfigureAwait(false);
await _repository.DbContext.BulkInsertAsync(bbacDetail).ConfigureAwait(false); await _repository.DbContext.BulkInsertAsync(bbacDetail).ConfigureAwait(false);
foreach (var itm in invList) foreach (var itm in invList)
@ -627,6 +646,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
entityList.AddRange(entityDetail); entityList.AddRange(entityDetail);
} }
var bbacmainlist = new List<HBPO_PD>(); var bbacmainlist = new List<HBPO_PD>();
foreach (var itm in invList) foreach (var itm in invList)
{ {
var bbac = new HBPO_PD( var bbac = new HBPO_PD(
@ -670,6 +696,22 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
bbacDetail.Add(entity bbacDetail.Add(entity
); );
} }
foreach (var itm in bbacDetail)
{
if (string.IsNullOrEmpty(itm.RELU))
{
if (itm.BusinessType == EnumBusinessType.None)
{
itm.BusinessType = EnumBusinessType.JisHBPO;
}
var relist = relationList.Where(p => p.BusinessType == itm.BusinessType).ToList();
var material = relist.FirstOrDefault(p => p.SettleMaterialCode == itm.LU);
itm.RELU = material.ErpMaterialCode;
}
}
await _repository.DbContext.BulkInsertAsync(bbacmainlist).ConfigureAwait(false); await _repository.DbContext.BulkInsertAsync(bbacmainlist).ConfigureAwait(false);
await _repository.DbContext.BulkInsertAsync(bbacDetail).ConfigureAwait(false); await _repository.DbContext.BulkInsertAsync(bbacDetail).ConfigureAwait(false);
foreach (var itm in invList) foreach (var itm in invList)
@ -784,6 +826,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
state: SettleBillState., state: SettleBillState.,
invGroupNum: itm.InvGroupNum, invGroupNum: itm.InvGroupNum,
site: string.Empty site: string.Empty
); );
bbacmainlist.Add(pub); bbacmainlist.Add(pub);
@ -818,6 +862,17 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
bbacDetail.Add(entity bbacDetail.Add(entity
); );
} }
var main= invList.FirstOrDefault();
foreach (var itm in bbacDetail)
{
if (string.IsNullOrEmpty(itm.RELU))
{
var relist = relationList.Where(p => p.BusinessType == main.BusinessType).ToList();
var material = relist.FirstOrDefault(p => p.SettleMaterialCode.Replace(" ","") == itm.LU.Replace(" ", ""));
itm.RELU = material.ErpMaterialCode;
itm.BusinessType= main.BusinessType;
}
}
await _repository.DbContext.BulkInsertAsync(bbacmainlist); await _repository.DbContext.BulkInsertAsync(bbacmainlist);
await _repository.DbContext.BulkInsertAsync(bbacDetail); await _repository.DbContext.BulkInsertAsync(bbacDetail);

Loading…
Cancel
Save