diff --git a/Controllers/RoThree.Controller.cs b/Controllers/RoThree.Controller.cs index bee3862..b77ac62 100644 --- a/Controllers/RoThree.Controller.cs +++ b/Controllers/RoThree.Controller.cs @@ -826,6 +826,202 @@ namespace rmutr_report.Controllers break; } + return Ok(); + } + [HttpPost, Route("reports/material_agricultural/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetMaterial9Report([FromRoute] string type, [FromBody] material_ro_three three) + { + if (three.data != null) + { + var s = three.data.Sum(f => f.material_amount); + + three.total_amount = s; + } + + var threes = new List() { three }; + + Report report = new Report(); + report.Load(_setting.report_path + "material_agricultural.frx"); + report.RegisterData(threes, "material_ro_three"); + report.Prepare(); + + MemoryStream stream = new MemoryStream(); + switch (type) + { + case "pdf": + PDFExport pdf = new PDFExport(); + report.Export(pdf, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "application/pdf"); + case "xls": + case "xlsx": + Excel2007Export excel = new Excel2007Export(); + report.Export(excel, stream); + stream.Seek(0, SeekOrigin.Begin); + //return File(stream, "application/vnd.ms-excel"); + string date = DateTime.Now.ToString("yyyyMMddHHmmss"); + return File( + stream, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + date + ".xlsx"); + break; + case "doc": + case "docx": + Word2007Export word = new Word2007Export(); + report.Export(word, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "appllication/vnd.ms-word"); + break; + } + + return Ok(); + } + [HttpPost, Route("reports/material_housework/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetMaterial10Report([FromRoute] string type, [FromBody] material_ro_three three) + { + if (three.data != null) + { + var s = three.data.Sum(f => f.material_amount); + + three.total_amount = s; + } + + var threes = new List() { three }; + + Report report = new Report(); + report.Load(_setting.report_path + "material_housework.frx"); + report.RegisterData(threes, "material_ro_three"); + report.Prepare(); + + MemoryStream stream = new MemoryStream(); + switch (type) + { + case "pdf": + PDFExport pdf = new PDFExport(); + report.Export(pdf, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "application/pdf"); + case "xls": + case "xlsx": + Excel2007Export excel = new Excel2007Export(); + report.Export(excel, stream); + stream.Seek(0, SeekOrigin.Begin); + //return File(stream, "application/vnd.ms-excel"); + string date = DateTime.Now.ToString("yyyyMMddHHmmss"); + return File( + stream, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + date + ".xlsx"); + break; + case "doc": + case "docx": + Word2007Export word = new Word2007Export(); + report.Export(word, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "appllication/vnd.ms-word"); + break; + } + + return Ok(); + } + [HttpPost, Route("reports/material_science_medical/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetMaterial11Report([FromRoute] string type, [FromBody] material_ro_three three) + { + if (three.data != null) + { + var s = three.data.Sum(f => f.material_amount); + + three.total_amount = s; + } + + var threes = new List() { three }; + + Report report = new Report(); + report.Load(_setting.report_path + "material_science_medical.frx"); + report.RegisterData(threes, "material_ro_three"); + report.Prepare(); + + MemoryStream stream = new MemoryStream(); + switch (type) + { + case "pdf": + PDFExport pdf = new PDFExport(); + report.Export(pdf, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "application/pdf"); + case "xls": + case "xlsx": + Excel2007Export excel = new Excel2007Export(); + report.Export(excel, stream); + stream.Seek(0, SeekOrigin.Begin); + //return File(stream, "application/vnd.ms-excel"); + string date = DateTime.Now.ToString("yyyyMMddHHmmss"); + return File( + stream, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + date + ".xlsx"); + break; + case "doc": + case "docx": + Word2007Export word = new Word2007Export(); + report.Export(word, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "appllication/vnd.ms-word"); + break; + } + + return Ok(); + } + [HttpPost, Route("reports/material_sport/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetMaterial12Report([FromRoute] string type, [FromBody] material_ro_three three) + { + if (three.data != null) + { + var s = three.data.Sum(f => f.material_amount); + + three.total_amount = s; + } + + var threes = new List() { three }; + + Report report = new Report(); + report.Load(_setting.report_path + "material_sport.frx"); + report.RegisterData(threes, "material_ro_three"); + report.Prepare(); + + MemoryStream stream = new MemoryStream(); + switch (type) + { + case "pdf": + PDFExport pdf = new PDFExport(); + report.Export(pdf, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "application/pdf"); + case "xls": + case "xlsx": + Excel2007Export excel = new Excel2007Export(); + report.Export(excel, stream); + stream.Seek(0, SeekOrigin.Begin); + //return File(stream, "application/vnd.ms-excel"); + string date = DateTime.Now.ToString("yyyyMMddHHmmss"); + return File( + stream, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + date + ".xlsx"); + break; + case "doc": + case "docx": + Word2007Export word = new Word2007Export(); + report.Export(word, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "appllication/vnd.ms-word"); + break; + } + return Ok(); } } diff --git a/Models/Personnel/personnel_salary_government_employee.cs b/Models/Personnel/personnel_salary_government_employee.cs index 1ef57ea..03be286 100644 --- a/Models/Personnel/personnel_salary_government_employee.cs +++ b/Models/Personnel/personnel_salary_government_employee.cs @@ -10,22 +10,22 @@ namespace rmutr_report.Models.Personnel public Guid? personnel_salary_government_employee_root_uid { get; set; } public Guid? log_report_uid { get; set; } public string year { get; set; } - public int? total_salary { get; set; } - public int? total_estimate_salary { get; set; } - public int? total_promote { get; set; } - public int? total { get; set; } - public int? total_salary_12 { get; set; } - public int? total_social_security { get; set; } - public int? total_social_security_12 { get; set; } - public int? total_social_compensation { get; set; } - public int? total_social_compensation_12 { get; set; } - public int? total_another2 { get; set; } - public int? total_quantity_money { get; set; } - public int? total2 { get; set; } + public double? total_salary { get; set; } + public double? total_estimate_salary { get; set; } + public double? total_promote { get; set; } + public double? total { get; set; } + public double? total_salary_12 { get; set; } + public double? total_social_security { get; set; } + public double? total_social_security_12 { get; set; } + public double? total_social_compensation { get; set; } + public double? total_social_compensation_12 { get; set; } + public double? total_another2 { get; set; } + public double? total_quantity_money { get; set; } + public double? total2 { get; set; } - public int? including_salary_and_fittings { get; set; } - public int? including_salary_and_fittings_12 { get; set; } + public double? including_salary_and_fittings { get; set; } + public double? including_salary_and_fittings_12 { get; set; } public List personnel_salary_government_employee { get; set; } } @@ -37,20 +37,20 @@ namespace rmutr_report.Models.Personnel public Guid? personnel_salary_government_employee_root_uid { get; set; } public string agency_category_name { get; set; } - public int? total_salary { get; set; } - public int? total_estimate_salary { get; set; } - public int? total_promote { get; set; } - public int? total { get; set; } - public int? total_salary_12 { get; set; } - public int? total_social_security { get; set; } - public int? total_social_security_12 { get; set; } - public int? total_social_compensation { get; set; } - public int? total_social_compensation_12 { get; set; } - public int? total_another2 { get; set; } - public int? total_quantity_money { get; set; } - public int? total2 { get; set; } - public int? including_salary_and_fittings { get; set; } - public int? including_salary_and_fittings_12 { get; set; } + public double? total_salary { get; set; } + public double? total_estimate_salary { get; set; } + public double? total_promote { get; set; } + public double? total { get; set; } + public double? total_salary_12 { get; set; } + public double? total_social_security { get; set; } + public double? total_social_security_12 { get; set; } + public double? total_social_compensation { get; set; } + public double? total_social_compensation_12 { get; set; } + public double? total_another2 { get; set; } + public double? total_quantity_money { get; set; } + public double? total2 { get; set; } + public double? including_salary_and_fittings { get; set; } + public double? including_salary_and_fittings_12 { get; set; } public List personnel_salary_government_employee_deltail { get; set; } public bool? is_footer { get; set; } @@ -68,19 +68,19 @@ namespace rmutr_report.Models.Personnel public string position { get; set; } public string parent_agency_name { get; set; } public string area { get; set; } - public int? salary { get; set; } - public int? estimate_salary { get; set; } - public int? promote { get; set; } - public int? total { get; set; } - public int? salary_12 { get; set; } - public int? social_security { get; set; } - public int? social_security_12 { get; set; } - public int? social_compensation { get; set; } - public int? social_compensation_12 { get; set; } - public int? another2 { get; set; } - public int? quantity_money { get; set; } - public int? total2 { get; set; } - public int? including_salary_and_fittings { get; set; } - public int? including_salary_and_fittings_12 { get; set; } + public double? salary { get; set; } + public double? estimate_salary { get; set; } + public double? promote { get; set; } + public double? total { get; set; } + public double? salary_12 { get; set; } + public double? social_security { get; set; } + public double? social_security_12 { get; set; } + public double? social_compensation { get; set; } + public double? social_compensation_12 { get; set; } + public double? another2 { get; set; } + public double? quantity_money { get; set; } + public double? total2 { get; set; } + public double? including_salary_and_fittings { get; set; } + public double? including_salary_and_fittings_12 { get; set; } } } \ No newline at end of file diff --git a/bin/Debug/netcoreapp3.1/rmutr_report.dll b/bin/Debug/netcoreapp3.1/rmutr_report.dll index 6560bb4..d1e934c 100644 Binary files a/bin/Debug/netcoreapp3.1/rmutr_report.dll and b/bin/Debug/netcoreapp3.1/rmutr_report.dll differ diff --git a/bin/Debug/netcoreapp3.1/rmutr_report.pdb b/bin/Debug/netcoreapp3.1/rmutr_report.pdb index c311ff9..6e3c32f 100644 Binary files a/bin/Debug/netcoreapp3.1/rmutr_report.pdb and b/bin/Debug/netcoreapp3.1/rmutr_report.pdb differ diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.dll b/obj/Debug/netcoreapp3.1/rmutr_report.dll index 6560bb4..d1e934c 100644 Binary files a/obj/Debug/netcoreapp3.1/rmutr_report.dll and b/obj/Debug/netcoreapp3.1/rmutr_report.dll differ diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.pdb b/obj/Debug/netcoreapp3.1/rmutr_report.pdb index c311ff9..6e3c32f 100644 Binary files a/obj/Debug/netcoreapp3.1/rmutr_report.pdb and b/obj/Debug/netcoreapp3.1/rmutr_report.pdb differ diff --git a/wwwroot/reports/material_agricultural.frx b/wwwroot/reports/material_agricultural.frx new file mode 100644 index 0000000..3f767cf --- /dev/null +++ b/wwwroot/reports/material_agricultural.frx @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/material_housework.frx b/wwwroot/reports/material_housework.frx new file mode 100644 index 0000000..74ddf84 --- /dev/null +++ b/wwwroot/reports/material_housework.frx @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/material_science_medical.frx b/wwwroot/reports/material_science_medical.frx new file mode 100644 index 0000000..04cf04c --- /dev/null +++ b/wwwroot/reports/material_science_medical.frx @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/material_sport.frx b/wwwroot/reports/material_sport.frx new file mode 100644 index 0000000..0ed3d38 --- /dev/null +++ b/wwwroot/reports/material_sport.frx @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +