修改一版
parent
320b4902b2
commit
18baad014b
Binary file not shown.
|
@ -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;"
|
||||
},
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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
|
||||
|
|
|
@ -1207,17 +1207,31 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
public Stream ExportLaborPayment(List<Guid> 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<LaborPayment> 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<string>(){
|
||||
"./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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue