Browse Source

修改EXCEL生成方式

master
zhouhongjun 11 months ago
parent
commit
f1a163f5a6
  1. 17
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs
  2. 19
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CurdBaseAppService.cs
  3. 18
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs

17
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs

@ -389,15 +389,16 @@ namespace Win.Sfs.SettleAccount.Bases
string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx"; string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx";
byte[] result = null; byte[] result = null;
switch (input.FileType) //switch (input.FileType)
{ //{
case 0: // case 0:
result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false); // result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false);
break; // break;
case 1: // case 1:
// result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false);
// break;
//}
result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false); result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false);
break;
}
result.ShouldNotBeNull(); result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制 //保存导出文件到服务器存成二进制

19
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CurdBaseAppService.cs

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Reflection; using System.Reflection;
@ -73,15 +73,16 @@ namespace Win.Sfs.SettleAccount.Bases
string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx"; string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx";
byte[] result = null; byte[] result = null;
switch (input.FileType) //switch (input.FileType)
{ //{
case 0: // case 0:
result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false); // result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false);
break; // break;
case 1: // case 1:
// result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false);
// break;
//}
result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false); result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false);
break;
}
result.ShouldNotBeNull(); result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制 //保存导出文件到服务器存成二进制

18
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs

@ -114,15 +114,17 @@ namespace Win.Sfs.SettleAccount.Bases
string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx"; string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx";
byte[] result = null; byte[] result = null;
switch (input.FileType) //switch (input.FileType)
{ //{
case 0: // case 0:
result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false); // result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false);
break; // break;
case 1: // case 1:
// result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false);
// break;
//}
result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false); result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false);
break;
}
result.ShouldNotBeNull(); result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制 //保存导出文件到服务器存成二进制

Loading…
Cancel
Save