diff --git a/IRaCIS.Core.API/Zip/Payroll.zip b/IRaCIS.Core.API/Zip/Payroll.zip new file mode 100644 index 0000000..fdc674f Binary files /dev/null and b/IRaCIS.Core.API/Zip/Payroll.zip differ diff --git a/IRaCIS.Core.API/appsettings.json b/IRaCIS.Core.API/appsettings.json index 439e104..67d9544 100644 --- a/IRaCIS.Core.API/appsettings.json +++ b/IRaCIS.Core.API/appsettings.json @@ -1,6 +1,6 @@ { "ConnectionStrings": { - "RemoteNew": "Server=123.56.181.144,14333\\MSSQLExpress14;Database=IRaCIS_B;User ID=sa;Password=dev123456DEV;", + "RemoteNew": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_B;User ID=sa;Password=dev123456DEV;", "hang": "Server=ZHOU;Database=IRaCIS;User ID=sa;Password=sa123456;" //"RemoteTest": "Server=123.56.181.144,14333\\MSSQLExpress14;Database=IRaCIS_B;User ID=sa;Password=dev123456DEV;" }, diff --git a/IRaCIS.Core.API/wwwroot/Template/Payroll Summary_(报酬).xlsx b/IRaCIS.Core.API/wwwroot/Template/Payroll Summary_(劳务费).xlsx similarity index 100% rename from IRaCIS.Core.API/wwwroot/Template/Payroll Summary_(报酬).xlsx rename to IRaCIS.Core.API/wwwroot/Template/Payroll Summary_(劳务费).xlsx diff --git a/IRaCIS.Core.API/wwwroot/Template/Payroll Summary_(云支付).xlsx b/IRaCIS.Core.API/wwwroot/Template/Payroll Summary_(第三方).xlsx similarity index 67% rename from IRaCIS.Core.API/wwwroot/Template/Payroll Summary_(云支付).xlsx rename to IRaCIS.Core.API/wwwroot/Template/Payroll Summary_(第三方).xlsx index 2e2a364..50c0104 100644 Binary files a/IRaCIS.Core.API/wwwroot/Template/Payroll Summary_(云支付).xlsx and b/IRaCIS.Core.API/wwwroot/Template/Payroll Summary_(第三方).xlsx differ diff --git a/IRaCIS.Core.API/wwwroot/Template/paystub(报酬).xlsx b/IRaCIS.Core.API/wwwroot/Template/paystub(劳务费).xlsx similarity index 64% rename from IRaCIS.Core.API/wwwroot/Template/paystub(报酬).xlsx rename to IRaCIS.Core.API/wwwroot/Template/paystub(劳务费).xlsx index 8a051a8..9e56ebf 100644 Binary files a/IRaCIS.Core.API/wwwroot/Template/paystub(报酬).xlsx and b/IRaCIS.Core.API/wwwroot/Template/paystub(劳务费).xlsx differ diff --git a/IRaCIS.Core.API/wwwroot/Template/paystub(云支付).xlsx b/IRaCIS.Core.API/wwwroot/Template/paystub(第三方).xlsx similarity index 67% rename from IRaCIS.Core.API/wwwroot/Template/paystub(云支付).xlsx rename to IRaCIS.Core.API/wwwroot/Template/paystub(第三方).xlsx index 849361c..2c194d4 100644 Binary files a/IRaCIS.Core.API/wwwroot/Template/paystub(云支付).xlsx and b/IRaCIS.Core.API/wwwroot/Template/paystub(第三方).xlsx differ diff --git a/IRaCIS.Core.Application.Contracts/Financial/DTO/PaymentViewModel.cs b/IRaCIS.Core.Application.Contracts/Financial/DTO/PaymentViewModel.cs index ac03b33..dbcf2fc 100644 --- a/IRaCIS.Core.Application.Contracts/Financial/DTO/PaymentViewModel.cs +++ b/IRaCIS.Core.Application.Contracts/Financial/DTO/PaymentViewModel.cs @@ -153,6 +153,23 @@ namespace IRaCIS.Application.ViewModels return Rows.Sum(x => x.PlatformFeeSum); } } + + public decimal SumPaymentCNY + { + get + { + return Rows.Sum(x => x.PaymentCNY); + } + } + + public decimal SumTaxCNY + { + get + { + return Rows.Sum(x => x.TaxCNY); + } + } + } public class Remuneration diff --git a/IRaCIS.Core.Application/Financial/FinancialService.cs b/IRaCIS.Core.Application/Financial/FinancialService.cs index 62d4933..28bbb5f 100644 --- a/IRaCIS.Core.Application/Financial/FinancialService.cs +++ b/IRaCIS.Core.Application/Financial/FinancialService.cs @@ -1207,17 +1207,31 @@ namespace IRaCIS.Application.Services public Stream ExportLaborPayment(List paymentIds) { - + #region 创建文件夹 if (!System.IO.Directory.Exists("./file")) { System.IO.Directory.CreateDirectory("./file"); } + if (!System.IO.Directory.Exists("./file/第三方")) + { + System.IO.Directory.CreateDirectory("./file/第三方"); + } + + if (!System.IO.Directory.Exists("./file/劳务费")) + { + System.IO.Directory.CreateDirectory("./file/劳务费"); + } + if (!System.IO.Directory.Exists("./Zip")) { System.IO.Directory.CreateDirectory("./Zip"); } + + #endregion + + List laborPaymentList = GetLaborPaymentList(paymentIds); //报酬 @@ -1227,13 +1241,25 @@ namespace IRaCIS.Application.Services var cloudPaymentList = laborPaymentList.Where(x => x.PaymentMethod == PaymentMethod.CloudPayment).ToList(); - DirectoryInfo folder = new DirectoryInfo("./file"); - foreach (FileInfo file in folder.GetFiles()) + var deletepaths =new List(){ + "./file/劳务费","./file/第三方" ,"./file" + + + }; + + foreach (var item in deletepaths) { - file.Delete(); + DirectoryInfo folder = new DirectoryInfo(item); + + foreach (FileInfo file in folder.GetFiles()) + { + file.Delete(); + } } + + FileInfo fi2 = new FileInfo("./Zip/Payroll.zip"); fi2.Delete(); @@ -1269,10 +1295,10 @@ namespace IRaCIS.Application.Services }; remunerationInfo.Rows.Add(remunerationSingle); - var path = Path.Combine(Directory.GetCurrentDirectory(), @"wwwroot\Template\paystub(报酬).xlsx"); + var path = Path.Combine(Directory.GetCurrentDirectory(), @"wwwroot\Template\paystub(劳务费).xlsx"); // 导入excel - MiniExcel.SaveAsByTemplate($"./file/{item.ChineseName}_paystub_{item.YearMonth}(报酬).xlsx", path, remunerationSingle); + MiniExcel.SaveAsByTemplate($"./file/劳务费/{item.ChineseName}_paystub_{item.YearMonth}(劳务费).xlsx", path, remunerationSingle); } @@ -1295,30 +1321,35 @@ namespace IRaCIS.Application.Services }; cloudPaymentInfo.Rows.Add(cloudPaymentSingle); - var path = Path.Combine(Directory.GetCurrentDirectory(), @"wwwroot\Template\paystub(云支付).xlsx"); - MiniExcel.SaveAsByTemplate($"./file/{item.ChineseName}_paystub_{item.YearMonth}(云支付).xlsx", path, cloudPaymentSingle); + var path = Path.Combine(Directory.GetCurrentDirectory(), @"wwwroot\Template\paystub(第三方).xlsx"); + MiniExcel.SaveAsByTemplate($"./file/第三方/{item.ChineseName}_paystub_{item.YearMonth}(第三方).xlsx", path, cloudPaymentSingle); } - var remunerationPath = Path.Combine(Directory.GetCurrentDirectory(), @"wwwroot\Template\Payroll Summary_(报酬).xlsx"); - MiniExcel.SaveAsByTemplate($"./file/Payroll Summary_{remunerationInfo.YearMonth}(报酬).xlsx", remunerationPath, remunerationInfo); + var remunerationPath = Path.Combine(Directory.GetCurrentDirectory(), @"wwwroot\Template\Payroll Summary_(劳务费).xlsx"); + MiniExcel.SaveAsByTemplate($"./file/劳务费/Payroll Summary_{remunerationInfo.YearMonth}(劳务费).xlsx", remunerationPath, remunerationInfo); - var cloudPaymentPath = Path.Combine(Directory.GetCurrentDirectory(), @"wwwroot\Template\Payroll Summary_(云支付).xlsx"); - MiniExcel.SaveAsByTemplate($"./file/Payroll Summary_{cloudPaymentInfo.YearMonth}(云支付).xlsx", cloudPaymentPath, cloudPaymentInfo); + var cloudPaymentPath = Path.Combine(Directory.GetCurrentDirectory(), @"wwwroot\Template\Payroll Summary_(第三方).xlsx"); + MiniExcel.SaveAsByTemplate($"./file/第三方/Payroll Summary_{cloudPaymentInfo.YearMonth}(第三方).xlsx", cloudPaymentPath, cloudPaymentInfo); ZipFile.CreateFromDirectory("./file", "Zip/Payroll.zip"); Stream stream = new System.IO.FileStream("./Zip/Payroll.zip", FileMode.Open, FileAccess.Read); - - foreach (FileInfo file in folder.GetFiles()) + + foreach (var item in deletepaths) { - file.Delete(); + DirectoryInfo folder = new DirectoryInfo(item); + + foreach (FileInfo file in folder.GetFiles()) + { + file.Delete(); + } } - + return stream;