|
|
@ -94,6 +94,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
private readonly INormalEfCoreRepository<VmiBalanceSum, Guid> _vmiBalanceSumRepository; |
|
|
|
private readonly INormalEfCoreRepository<BalanceSum, Guid> _balanceSumRepository; |
|
|
|
|
|
|
|
private readonly INormalEfCoreRepository<REC_SHIP_SUM, Guid> _recRepository; |
|
|
|
|
|
|
|
private readonly IBlobContainer<MyFileContainer> _fileContainer; |
|
|
|
private readonly IHubContext<PageHub> _hubContext; |
|
|
|
private readonly ICurrentUser _currentUser; |
|
|
@ -111,6 +113,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
INormalEfCoreRepository<CodeSetting, Guid> codeRepository, |
|
|
|
INormalEfCoreRepository<VmiBalanceSumDetail, Guid> vmiBalanceSumDetailRepository, |
|
|
|
INormalEfCoreRepository<BalanceSum, Guid> balanceSumRepository, |
|
|
|
INormalEfCoreRepository<REC_SHIP_SUM, Guid> recRepository, |
|
|
|
IBlobContainer<MyFileContainer> fileContainer, |
|
|
|
Volo.Abp.ObjectMapping.IObjectMapper maper, |
|
|
|
IHubContext<PageHub> hubContext, |
|
|
@ -123,6 +126,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
) |
|
|
|
|
|
|
|
{ |
|
|
|
_recRepository = recRepository; |
|
|
|
_balanceSumRepository = balanceSumRepository; |
|
|
|
_vmiBalanceSumRepository = vmiBalanceSumRepository; |
|
|
|
_vmiBalanceSumDetailRepository = vmiBalanceSumDetailRepository; |
|
|
@ -1717,6 +1721,23 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
connection.Close(); |
|
|
|
return ls; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[HttpPost] |
|
|
|
public async Task<List<REC_SHIP_SUM>> GetSHIP_REC_SUMListAsync(RequestDto input) |
|
|
|
{ |
|
|
|
return await _recRepository.ToListAsync().ConfigureAwait(false); |
|
|
|
//var entities = await _recRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false);
|
|
|
|
//var totalCount = await _recRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
|
|
|
|
////var dtos = ObjectMapper.Map<List<HBPO_SA_DETAIL>, List<HBPO_SA_DETAIL_DTO>>(entities);
|
|
|
|
//return new PagedResultDto<HBPO_SA_DETAIL_DTO>(totalCount, entities);
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// jisbbac收发汇总
|
|
|
|
/// </summary>
|
|
|
@ -1731,9 +1752,24 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
public async Task<string> GetReceiveShipSum(RequestDto input) |
|
|
|
{ |
|
|
|
|
|
|
|
ConcurrentBag<REC_SHIP_SUM> bagList = new ConcurrentBag<REC_SHIP_SUM>(); |
|
|
|
|
|
|
|
// ConcurrentBag<ShipReceiveSum> bagList = new ConcurrentBag<ShipReceiveSum>();
|
|
|
|
var sebegin= input.Filters.Any(p => p.Column == "sebegin")? input.Filters.FirstOrDefault(p => p.Column == "sebegin").Value : ""; |
|
|
|
var seend = input.Filters.Any(p => p.Column == "seend")? input.Filters.FirstOrDefault(p => p.Column == "seend").Value : ""; |
|
|
|
var sabegin = input.Filters.Any(p => p.Column == "sabegin")? input.Filters.FirstOrDefault(p => p.Column == "sabegin").Value : ""; |
|
|
|
var saend = input.Filters.Any(p => p.Column == "saend")? input.Filters.FirstOrDefault(p => p.Column == "saend").Value : ""; |
|
|
|
var parcode = input.Filters.Any(p => p.Column == "partcode")? input.Filters.FirstOrDefault(p => p.Column == "partcode").Value : ""; |
|
|
|
|
|
|
|
List<EnumBusinessType> list = new List<EnumBusinessType>(); |
|
|
|
list.Add(EnumBusinessType.JisBBAC); |
|
|
|
list.Add(EnumBusinessType.JisHBPO); |
|
|
|
list.Add(EnumBusinessType.MaiDanJianHBPO); |
|
|
|
list.Add(EnumBusinessType.MaiDanJianBBAC); |
|
|
|
list.Add(EnumBusinessType.BeiJian); |
|
|
|
list.Add(EnumBusinessType.ZhiGongJianHBPO); |
|
|
|
list.Add(EnumBusinessType.ZhiGongJianBBAC); |
|
|
|
list.Add(EnumBusinessType.YinDuJian); |
|
|
|
|
|
|
|
ConcurrentBag<REC_SHIP_SUM> bagList = new ConcurrentBag<REC_SHIP_SUM>(); |
|
|
|
|
|
|
|
Parallel.ForEach(list, async chunk => |
|
|
|
{ |
|
|
@ -1743,23 +1779,35 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
bagList.Add(itm); |
|
|
|
} |
|
|
|
}); |
|
|
|
var entities=bagList.ToList(); |
|
|
|
|
|
|
|
// IExporter _csv = new CsvExporter();
|
|
|
|
// IExporter _excel = new ExcelExporter();
|
|
|
|
// byte[] result = null;
|
|
|
|
// result = await _excel.ExportAsByteArray(entities).ConfigureAwait(false);
|
|
|
|
// result.ShouldNotBeNull();
|
|
|
|
// string _fileName = $"收发存汇总{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx";
|
|
|
|
// //保存导出文件到服务器存成二进制
|
|
|
|
// await _excelImportService.SaveBlobAsync(
|
|
|
|
// new SaveExcelImportInputDto
|
|
|
|
// {
|
|
|
|
// Name = _fileName,
|
|
|
|
// Content = result
|
|
|
|
// }
|
|
|
|
// ).ConfigureAwait(false);
|
|
|
|
// return _fileName;
|
|
|
|
|
|
|
|
var entities = bagList.ToList(); |
|
|
|
await _recRepository.BatchDeleteAsync().ConfigureAwait(false); |
|
|
|
foreach (var entity in entities) |
|
|
|
{ |
|
|
|
entity.SetId(Guid.NewGuid()); |
|
|
|
entity.CreationTime = DateTime.Now; |
|
|
|
} |
|
|
|
|
|
|
|
await _recRepository.DbContext.BulkInsertAsync(entities).ConfigureAwait(false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IExporter _csv = new CsvExporter(); |
|
|
|
IExporter _excel = new ExcelExporter(); |
|
|
|
byte[] result = null; |
|
|
|
result = await _excel.ExportAsByteArray(entities).ConfigureAwait(false); |
|
|
|
result.ShouldNotBeNull(); |
|
|
|
string _fileName = $"收发存汇总{DateTime.Now.ToString("yyyyMMddHHmmss")}.xlsx"; |
|
|
|
//保存导出文件到服务器存成二进制
|
|
|
|
await _excelImportService.SaveBlobAsync( |
|
|
|
new SaveExcelImportInputDto |
|
|
|
{ |
|
|
|
Name = _fileName, |
|
|
|
Content = result |
|
|
|
} |
|
|
|
).ConfigureAwait(false); |
|
|
|
return _fileName; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|