|
@ -1,14 +1,25 @@ |
|
|
using System; |
|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
|
|
|
using System.ComponentModel.DataAnnotations; |
|
|
using System.Linq; |
|
|
using System.Linq; |
|
|
using System.LinqAsync; |
|
|
using System.LinqAsync; |
|
|
|
|
|
using System.Reflection; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
|
|
|
using DocumentFormat.OpenXml.Drawing; |
|
|
|
|
|
using DocumentFormat.OpenXml.Office2010.Excel; |
|
|
|
|
|
using DocumentFormat.OpenXml.Office2010.ExcelAc; |
|
|
|
|
|
using DocumentFormat.OpenXml.Spreadsheet; |
|
|
using EFCore.BulkExtensions; |
|
|
using EFCore.BulkExtensions; |
|
|
|
|
|
using Magicodes.ExporterAndImporter.Core; |
|
|
|
|
|
using Magicodes.ExporterAndImporter.Csv; |
|
|
|
|
|
using Magicodes.ExporterAndImporter.Excel; |
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
using Omu.ValueInjecter; |
|
|
using Omu.ValueInjecter; |
|
|
using SettleAccount.Domain.BQ; |
|
|
using SettleAccount.Domain.BQ; |
|
|
|
|
|
using Shouldly; |
|
|
using Volo.Abp; |
|
|
using Volo.Abp; |
|
|
|
|
|
using Volo.Abp.BlobStoring; |
|
|
using Volo.Abp.Uow; |
|
|
using Volo.Abp.Uow; |
|
|
using Win.Abp.Snowflakes; |
|
|
using Win.Abp.Snowflakes; |
|
|
using Win.Sfs.BaseData.ImportExcelCommon; |
|
|
using Win.Sfs.BaseData.ImportExcelCommon; |
|
@ -19,8 +30,11 @@ using Win.Sfs.SettleAccount.Constant; |
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Dtos; |
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Dtos; |
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Managers; |
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Managers; |
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Temp; |
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Temp; |
|
|
|
|
|
using Win.Sfs.SettleAccount.Entities.MaterialRelationships; |
|
|
using Win.Sfs.SettleAccount.Entities.Prices; |
|
|
using Win.Sfs.SettleAccount.Entities.Prices; |
|
|
using Win.Sfs.SettleAccount.ExportReports; |
|
|
using Win.Sfs.SettleAccount.ExportReports; |
|
|
|
|
|
using Win.Sfs.SettleAccount.MaterialRelationships; |
|
|
|
|
|
using Win.Sfs.Shared.Filter; |
|
|
using Win.Sfs.Shared.RepositoryBase; |
|
|
using Win.Sfs.Shared.RepositoryBase; |
|
|
|
|
|
|
|
|
namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
namespace Win.Sfs.SettleAccount.Entities.BQ |
|
@ -49,6 +63,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
private readonly INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> _notRepository; |
|
|
private readonly INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> _notRepository; |
|
|
|
|
|
|
|
|
private readonly INormalEfCoreRepository<PUB_SA, Guid> _saRepository; |
|
|
private readonly INormalEfCoreRepository<PUB_SA, Guid> _saRepository; |
|
|
|
|
|
private readonly IBlobContainer<MyFileContainer> _fileContainer; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public PUB_CAN_SA_SERVICE |
|
|
public PUB_CAN_SA_SERVICE |
|
@ -65,7 +80,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
BaseDomainService baseservice, |
|
|
BaseDomainService baseservice, |
|
|
INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> notRepository, |
|
|
INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> notRepository, |
|
|
INormalEfCoreRepository<PriceListYinDu, Guid> priceYinDuRepository, |
|
|
INormalEfCoreRepository<PriceListYinDu, Guid> priceYinDuRepository, |
|
|
INormalEfCoreRepository<PUB_SA, Guid> saRepository |
|
|
INormalEfCoreRepository<PUB_SA, Guid> saRepository, |
|
|
|
|
|
IBlobContainer<MyFileContainer> fileContainer |
|
|
|
|
|
|
|
|
) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, detailRepository, invmng, baseservice) |
|
|
) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, detailRepository, invmng, baseservice) |
|
|
{ |
|
|
{ |
|
@ -75,6 +91,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
_notRepository = notRepository; |
|
|
_notRepository = notRepository; |
|
|
_priceYinDuRepository= priceYinDuRepository; |
|
|
_priceYinDuRepository= priceYinDuRepository; |
|
|
_saRepository= saRepository; |
|
|
_saRepository= saRepository; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
[HttpPost] |
|
|
[HttpPost] |
|
|
[UnitOfWork(false)] |
|
|
[UnitOfWork(false)] |
|
@ -95,16 +112,22 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
case EnumBusinessType.BeiJian: |
|
|
case EnumBusinessType.BeiJian: |
|
|
var priceListbj = _pricebjRepository.ToList();//价格单
|
|
|
var priceListbj = _pricebjRepository.ToList();//价格单
|
|
|
foreach (var itm in priceListbj) |
|
|
foreach (var itm in priceListbj) |
|
|
|
|
|
{ |
|
|
|
|
|
if (itm.IsCancel == false) |
|
|
{ |
|
|
{ |
|
|
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 }); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
break; |
|
|
break; |
|
|
case EnumBusinessType.YinDuJian: |
|
|
case EnumBusinessType.YinDuJian: |
|
|
var priceListYindu = _priceYinDuRepository.ToList();//价格单
|
|
|
var priceListYindu = _priceYinDuRepository.ToList();//价格单
|
|
|
foreach (var itm in priceListYindu) |
|
|
foreach (var itm in priceListYindu) |
|
|
|
|
|
{ |
|
|
|
|
|
if (itm.IsCancel == false) |
|
|
{ |
|
|
{ |
|
|
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1041", ContractNo = itm.ContractNo }); |
|
|
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1041", ContractNo = itm.ContractNo }); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
break; |
|
|
break; |
|
|
default: |
|
|
default: |
|
@ -161,8 +184,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
var groupNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); |
|
|
var groupNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); |
|
|
entitys = entitys.OrderBy(p => p.IndexNum).ToList(); |
|
|
entitys = entitys.OrderBy(p => p.IndexNum).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 |
|
|
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == main.Site |
|
|
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == main.Site |
|
|
select new TEMP_CAN_SA_DETAIL |
|
|
select new TEMP_CAN_SA_DETAIL |
|
|
{ |
|
|
{ |
|
|