@ -304,22 +304,22 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var dtos = _ maper . Map < List < VmiBalanceSumDetail > , List < VmiBalanceSumDetailDto > > ( entities ) ;
dtos = dtos . OrderByDescending ( p = > p . BillTime ) . ToList ( ) ;
var fileName = $"库存余额_{DateTime.Now.ToString(" yyyy - MM - dd_HH - mm - ss ")}.xlsx" ;
ExportImporter _ exportImporter = new ExportImporter ( ) ;
var result = await _ exportImporter . ExcelExporter ( dtos ) . ConfigureAwait ( false ) ;
result . ShouldNotBeNull ( ) ;
await _ excelImportService . SaveBlobAsync ( new SaveExcelImportInputDto { Name = fileName , Content = result } ) . ConfigureAwait ( false ) ;
//ExportImporter _exportImporter = new ExportImporter();
//var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false);
//result.ShouldNotBeNull();
//await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false);
//ExtendExcel<VmiBalanceSumDetailDto>.BucketName = _cfg.GetValue("MinIO:BucketName", "default");
ExtendExcel < VmiBalanceSumDetailDto > . BucketName = _ cfg . GetValue ( "MinIO:BucketName" , "default" ) ;
//ExtendExcel<VmiBalanceSumDetailDto>.AccessKey = _cfg.GetValue("MinIO:AccessKey", "g0GKnhRGEQHI0uiGBYre");
ExtendExcel < VmiBalanceSumDetailDto > . AccessKey = _ cfg . GetValue ( "MinIO:AccessKey" , "g0GKnhRGEQHI0uiGBYre" ) ;
//ExtendExcel<VmiBalanceSumDetailDto>.SecretKey = _cfg.GetValue("MinIO:SecretKey", "iKGlLz6UBzci3xrERw5Zz1gI77enT5u9agFemHPv");
ExtendExcel < VmiBalanceSumDetailDto > . SecretKey = _ cfg . GetValue ( "MinIO:SecretKey" , "iKGlLz6UBzci3xrERw5Zz1gI77enT5u9agFemHPv" ) ;
//ExtendExcel<VmiBalanceSumDetailDto>.EndPoint = _cfg.GetValue("MinIO:EndPoint", "localhost:10684/host");
ExtendExcel < VmiBalanceSumDetailDto > . EndPoint = _ cfg . GetValue ( "MinIO:EndPoint" , "localhost:10684/host" ) ;
//return await ExtendExcel<VmiBalanceSumDetailDto>.WriteDataToExcelInParallel("库存余额", dtos, 500000).ConfigureAwait(false);
return await ExtendExcel < VmiBalanceSumDetailDto > . WriteDataToExcelInParallel ( "库存余额" , dtos , 5 0 0 0 0 0 ) . ConfigureAwait ( false ) ;
return fileName ;
//return fileName;
}
/// <summary>
@ -1665,9 +1665,22 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
"SUM(qty)\n" +
"FOR Type IN ([10],[20],[100],[150],[200],[800])\n" +
") AS piv\n" +
$") temp1 left join (select LU,PN,InvbillNum,Qty from {satablename} where BusinessType={(int)p_businessType}) temp2 on temp1.PN=temp2.PN and temp1.LU=temp2.LU\n" +
") tempsum group by LU\n" ;
$") temp1 left join (select LU,PN,InvbillNum,Qty from {satablename} WITH(NOLOCK) where BusinessType={(int)p_businessType}" ;
if ( ! string . IsNullOrEmpty ( sabegin ) )
{
sql + = $" AND SettleDate >='{sabegin}'\n" ;
}
if ( ! string . IsNullOrEmpty ( saend ) )
{
sql + = $" AND SettleDate <='{saend}'\n" ;
}
sql + = ") temp2 on temp1.PN=temp2.PN and temp1.LU=temp2.LU\n" +
") tempsum group by LU\n" ;
command . CommandText = sql ;
command . CommandTimeout = 1 2 0 0 ;