public async Task DoAsync(RebuildSearchLegalPartyDto rebuildSearchLegalPartyDto)
        {
            var list = GetLegalPartyIdList(rebuildSearchLegalPartyDto).Distinct().ToList();

            _logger.LogDebug($"Found {list.Count} Legal Parties");

            _logger.LogDebug("Rebuilding LegalPartyId from list.");
            await _searchLegalPartyRepository.RebuildSearchLegalPartyIndexByLegalPartyId(list);

            _logger.LogDebug("LegalPartyId is rebuilt from list.");
        }
        private List <int> GetLegalPartyIdList(RebuildSearchLegalPartyDto rebuildSearchLegalPartyDto)
        {
            var idList = new List <int>();

            if (rebuildSearchLegalPartyDto.LegalPartyIdList != null)
            {
                idList.AddRange(rebuildSearchLegalPartyDto.LegalPartyIdList);
            }

            rebuildSearchLegalPartyDto.CommIdList?.ForEach(commId =>
            {
                idList.AddRange(_aumentumRepository.GetLegalPartyIdByCommId(commId));
            });

            rebuildSearchLegalPartyDto.RevenueObjectIdList?.ForEach(revenueObjectId =>
            {
                idList.AddRange(_aumentumRepository.GetLegalPartyIdByRevenueObjectId(revenueObjectId));
            });

            rebuildSearchLegalPartyDto.SitusAddressIdList?.ForEach(situsAddressId =>
            {
                idList.AddRange(_aumentumRepository.GetLegalPartyIdBySitusAddressId(situsAddressId));
            });

            rebuildSearchLegalPartyDto.TaxAuthorityGroupIdList?.ForEach(taxAuthorityGroupId =>
            {
                idList.AddRange(_aumentumRepository.GetLegalPartyIdByTaxAuthorityGroupId(taxAuthorityGroupId));
            });

            rebuildSearchLegalPartyDto.AppraisalSiteIdList?.ForEach(appraisalSiteId =>
            {
                idList.AddRange(_aumentumRepository.GetLegalPartyIdByAppraisalSiteId(appraisalSiteId));
            });

            return(idList);
        }
Exemplo n.º 3
0
 public async Task Do([FromBody] RebuildSearchLegalPartyDto rebuildSearchLegalPartyDto)
 {
     await _rebuildSearchLegalParty.DoAsync(rebuildSearchLegalPartyDto);
 }