|
|
@ -1,14 +1,25 @@ |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.ComponentModel.DataAnnotations; |
|
|
|
using System.Linq; |
|
|
|
using System.LinqAsync; |
|
|
|
using System.Reflection; |
|
|
|
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 Magicodes.ExporterAndImporter.Core; |
|
|
|
using Magicodes.ExporterAndImporter.Csv; |
|
|
|
using Magicodes.ExporterAndImporter.Excel; |
|
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using Omu.ValueInjecter; |
|
|
|
using SettleAccount.Domain.BQ; |
|
|
|
using Shouldly; |
|
|
|
using Volo.Abp; |
|
|
|
using Volo.Abp.BlobStoring; |
|
|
|
using Volo.Abp.Uow; |
|
|
|
using Win.Abp.Snowflakes; |
|
|
|
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.Managers; |
|
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Temp; |
|
|
|
using Win.Sfs.SettleAccount.Entities.MaterialRelationships; |
|
|
|
using Win.Sfs.SettleAccount.Entities.Prices; |
|
|
|
using Win.Sfs.SettleAccount.ExportReports; |
|
|
|
using Win.Sfs.SettleAccount.MaterialRelationships; |
|
|
|
using Win.Sfs.Shared.Filter; |
|
|
|
using Win.Sfs.Shared.RepositoryBase; |
|
|
|
|
|
|
|
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_SA, Guid> _saRepository; |
|
|
|
private readonly IBlobContainer<MyFileContainer> _fileContainer; |
|
|
|
|
|
|
|
|
|
|
|
public PUB_CAN_SA_SERVICE |
|
|
@ -65,7 +80,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
BaseDomainService baseservice, |
|
|
|
INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> notRepository, |
|
|
|
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) |
|
|
|
{ |
|
|
@ -75,6 +91,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
_notRepository = notRepository; |
|
|
|
_priceYinDuRepository= priceYinDuRepository; |
|
|
|
_saRepository= saRepository; |
|
|
|
|
|
|
|
} |
|
|
|
[HttpPost] |
|
|
|
[UnitOfWork(false)] |
|
|
@ -96,14 +113,20 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
var priceListbj = _pricebjRepository.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 }); |
|
|
|
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 }); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
case 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 }); |
|
|
|
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 }); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
@ -161,8 +184,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
var groupNumList = entitys.Select(p => p.GroupNum).Distinct().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 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 |
|
|
|
select new TEMP_CAN_SA_DETAIL |
|
|
|
{ |
|
|
|