แนบท้ายคำสั่ง (5,6, 7, 8, 9,13, 14, 15)

This commit is contained in:
Bright 2024-06-27 18:02:07 +07:00
parent 92e298c745
commit 417c7b0071
2 changed files with 214 additions and 65 deletions

View file

@ -599,14 +599,33 @@ namespace BMA.EHR.Report.Service.Controllers
{
try
{
var command = await _repository.GetByIdAsync(commandId);
if (command == null)
//var command = await _repository.GetByIdAsync(commandId);
//if (command == null)
//{
// throw new Exception(GlobalMessages.CommandNotFound);
//}
var raw_data = await _repository.GetByIdAsync(commandId);
if (raw_data == null)
{
throw new Exception(GlobalMessages.CommandNotFound);
}
var command = new
{
CommandNo = raw_data.CommandNo.ToThaiNumber(),
CommandYear = raw_data.CommandYear.ToInteger().ToThaiYear().ToString().ToThaiNumber(),
IssuerOrganizationName = raw_data.IssuerOrganizationName,
CommandExcecuteDate = raw_data.CommandExcecuteDate != null ? raw_data.CommandExcecuteDate.Value.ToThaiFullDate3().ToThaiNumber() : "-",
};
var data = await _commandReportRepository.GetCommandType05_06AttachmentAsync(commandId);
return data;
return new
{
CommandNo = command.CommandNo,
CommandYear = command.CommandYear,
IssuerOrganizationName = command.IssuerOrganizationName,
CommandExcecuteDate = command.CommandExcecuteDate,
data = data,
};
//var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Reports", $"05-06-แนบท้ายคำสั่งแต่งตั้ง-คำสั่งเลื่อน.trdp");
//ReportPackager reportPackager = new ReportPackager();
@ -720,14 +739,34 @@ namespace BMA.EHR.Report.Service.Controllers
{
try
{
var command = await _repository.GetByIdAsync(commandId);
if (command == null)
//var command = await _repository.GetByIdAsync(commandId);
//if (command == null)
//{
// throw new Exception(GlobalMessages.CommandNotFound);
//}
var raw_data = await _repository.GetByIdAsync(commandId);
if (raw_data == null)
{
throw new Exception(GlobalMessages.CommandNotFound);
}
var command = new
{
CommandNo = raw_data.CommandNo.ToThaiNumber(),
CommandYear = raw_data.CommandYear.ToInteger().ToThaiYear().ToString().ToThaiNumber(),
IssuerOrganizationName = raw_data.IssuerOrganizationName,
CommandExcecuteDate = raw_data.CommandExcecuteDate != null ? raw_data.CommandExcecuteDate.Value.ToThaiFullDate3().ToThaiNumber() : "-",
};
var data = await _commandReportRepository.GetCommandType05_06AttachmentAsync(commandId);
return data;
return new
{
CommandNo = command.CommandNo,
CommandYear = command.CommandYear,
IssuerOrganizationName = command.IssuerOrganizationName,
CommandExcecuteDate = command.CommandExcecuteDate,
data = data,
};
//var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Reports", $"05-06-แนบท้ายคำสั่งแต่งตั้ง-คำสั่งเลื่อน.trdp");
//ReportPackager reportPackager = new ReportPackager();
@ -839,14 +878,33 @@ namespace BMA.EHR.Report.Service.Controllers
{
try
{
var command = await _repository.GetByIdAsync(commandId);
if (command == null)
//var command = await _repository.GetByIdAsync(commandId);
//if (command == null)
//{
// throw new Exception(GlobalMessages.CommandNotFound);
//}
var raw_data = await _repository.GetByIdAsync(commandId);
if (raw_data == null)
{
throw new Exception(GlobalMessages.CommandNotFound);
}
var command = new
{
CommandNo = raw_data.CommandNo.ToThaiNumber(),
CommandYear = raw_data.CommandYear.ToInteger().ToThaiYear().ToString().ToThaiNumber(),
IssuerOrganizationName = raw_data.IssuerOrganizationName,
CommandExcecuteDate = raw_data.CommandExcecuteDate != null ? raw_data.CommandExcecuteDate.Value.ToThaiFullDate3().ToThaiNumber() : "-",
};
var data = await _commandReportRepository.GetCommandType07AttachmentAsync(commandId);
return data;
return new
{
CommandNo = command.CommandNo,
CommandYear = command.CommandYear,
IssuerOrganizationName = command.IssuerOrganizationName,
CommandExcecuteDate = command.CommandExcecuteDate,
data = data,
};
//var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Reports", $"07-แนบท้ายคำสั่งย้าย.trdp");
//ReportPackager reportPackager = new ReportPackager();
@ -908,7 +966,6 @@ namespace BMA.EHR.Report.Service.Controllers
CommandNo = raw_data.CommandNo.ToThaiNumber(),
CommandYear = raw_data.CommandYear.ToInteger().ToThaiYear().ToString().ToThaiNumber(),
IssuerOrganizationName = raw_data.IssuerOrganizationName,
ConclusionRegisterNo = raw_data.ConclusionRegisterNo == null ? "" : raw_data.ConclusionRegisterNo.ToThaiNumber(),
ConclusionRegisterDate = raw_data.ConclusionRegisterDate == null ? "" : raw_data.ConclusionRegisterDate.Value.ToThaiFullDate3().ToThaiNumber(),
ConclusionResultNo = raw_data.ConclusionResultNo == null ? "" : raw_data.ConclusionResultNo.ToThaiNumber(),
ConclusionResultDate = raw_data.ConclusionResultDate == null ? "" : raw_data.ConclusionResultDate.Value.ToThaiFullDate3().ToThaiNumber(),
@ -960,14 +1017,31 @@ namespace BMA.EHR.Report.Service.Controllers
{
try
{
var command = await _repository.GetByIdAsync(commandId);
if (command == null)
//var command = await _repository.GetByIdAsync(commandId);
//if (command == null)
//{
// throw new Exception(GlobalMessages.CommandNotFound);
//}
var raw_data = await _repository.GetByIdAsync(commandId);
if (raw_data == null)
{
throw new Exception(GlobalMessages.CommandNotFound);
}
var command = new
{
CommandNo = raw_data.CommandNo.ToThaiNumber(),
CommandYear = raw_data.CommandYear.ToInteger().ToThaiYear().ToString().ToThaiNumber(),
IssuerOrganizationName = raw_data.IssuerOrganizationName,
CommandExcecuteDate = raw_data.CommandExcecuteDate != null ? raw_data.CommandExcecuteDate.Value.ToThaiFullDate3().ToThaiNumber() : "-",
};
var data = await _commandReportRepository.GetCommandType08AttachmentAsync(commandId);
return data;
return new {
CommandNo = command.CommandNo,
CommandYear = command.CommandYear,
IssuerOrganizationName = command.IssuerOrganizationName,
CommandExcecuteDate = command.CommandExcecuteDate,
data = data,
};
//var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Reports", $"08-คำสั่งบรรจุและแต่งตั้งข้าราชการฯกลับเข้ารับราชการ-6.trdp");
//ReportPackager reportPackager = new ReportPackager();
@ -1084,14 +1158,32 @@ namespace BMA.EHR.Report.Service.Controllers
{
try
{
var command = await _repository.GetByIdAsync(commandId);
if (command == null)
//var command = await _repository.GetByIdAsync(commandId);
//if (command == null)
//{
// throw new Exception(GlobalMessages.CommandNotFound);
//}
var raw_data = await _repository.GetByIdAsync(commandId);
if (raw_data == null)
{
throw new Exception(GlobalMessages.CommandNotFound);
}
var command = new
{
CommandNo = raw_data.CommandNo.ToThaiNumber(),
CommandYear = raw_data.CommandYear.ToInteger().ToThaiYear().ToString().ToThaiNumber(),
IssuerOrganizationName = raw_data.IssuerOrganizationName,
CommandExcecuteDate = raw_data.CommandExcecuteDate != null ? raw_data.CommandExcecuteDate.Value.ToThaiFullDate3().ToThaiNumber() : "-",
};
var data = await _commandReportRepository.GetCommandType09AttachmentAsync(commandId);
return data;
return new
{
CommandNo = command.CommandNo,
CommandYear = command.CommandYear,
IssuerOrganizationName = command.IssuerOrganizationName,
CommandExcecuteDate = command.CommandExcecuteDate,
data = data,
};
//var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Reports", $"09-คำสั่งบรรจุและแต่งตั้งผู้ออกไปรับราชการทหารกลับเข้ารับราชการ-8.trdp");
//ReportPackager reportPackager = new ReportPackager();
@ -1378,14 +1470,32 @@ namespace BMA.EHR.Report.Service.Controllers
{
try
{
var command = await _repository.GetByIdAsync(commandId);
if (command == null)
//var command = await _repository.GetByIdAsync(commandId);
//if (command == null)
//{
// throw new Exception(GlobalMessages.CommandNotFound);
//}
var raw_data = await _repository.GetByIdAsync(commandId);
if (raw_data == null)
{
throw new Exception(GlobalMessages.CommandNotFound);
}
var command = new
{
CommandNo = raw_data.CommandNo.ToThaiNumber(),
CommandYear = raw_data.CommandYear.ToInteger().ToThaiYear().ToString().ToThaiNumber(),
IssuerOrganizationName = raw_data.IssuerOrganizationName,
CommandExcecuteDate = raw_data.CommandExcecuteDate != null ? raw_data.CommandExcecuteDate.Value.ToThaiFullDate3().ToThaiNumber() : "-",
};
var data = await _commandReportRepository.GetCommandType13AttachmentAsync(commandId);
return data;
return new
{
CommandNo = command.CommandNo,
CommandYear = command.CommandYear,
IssuerOrganizationName = command.IssuerOrganizationName,
CommandExcecuteDate = command.CommandExcecuteDate,
data = data,
};
//var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Reports", $"27-คำสั่งให้โอนข้าราชการกรุงเทพมหานครสามัญ-2.trdp");
//ReportPackager reportPackager = new ReportPackager();
@ -1500,14 +1610,33 @@ namespace BMA.EHR.Report.Service.Controllers
{
try
{
var command = await _repository.GetByIdAsync(commandId);
if (command == null)
//var command = await _repository.GetByIdAsync(commandId);
//if (command == null)
//{
// throw new Exception(GlobalMessages.CommandNotFound);
//}
var raw_data = await _repository.GetByIdAsync(commandId);
if (raw_data == null)
{
throw new Exception(GlobalMessages.CommandNotFound);
}
var command = new
{
CommandNo = raw_data.CommandNo.ToThaiNumber(),
CommandYear = raw_data.CommandYear.ToInteger().ToThaiYear().ToString().ToThaiNumber(),
IssuerOrganizationName = raw_data.IssuerOrganizationName,
CommandExcecuteDate = raw_data.CommandExcecuteDate != null ? raw_data.CommandExcecuteDate.Value.ToThaiFullDate3().ToThaiNumber() : "-",
};
var data = await _commandReportRepository.GetCommandType14AttachmentAsync(commandId);
return data;
return new
{
CommandNo = command.CommandNo,
CommandYear = command.CommandYear,
IssuerOrganizationName = command.IssuerOrganizationName,
CommandExcecuteDate = command.CommandExcecuteDate,
data = data,
};
//var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Reports", $"28-คำสั่งรับโอนข้าราชการกรุงเทพมหานครสามัญ5-10.trdp");
//ReportPackager reportPackager = new ReportPackager();
@ -1619,14 +1748,34 @@ namespace BMA.EHR.Report.Service.Controllers
{
try
{
var command = await _repository.GetByIdAsync(commandId);
if (command == null)
//var command = await _repository.GetByIdAsync(commandId);
//if (command == null)
//{
// throw new Exception(GlobalMessages.CommandNotFound);
//}
var raw_data = await _repository.GetByIdAsync(commandId);
if (raw_data == null)
{
throw new Exception(GlobalMessages.CommandNotFound);
}
var command = new
{
CommandNo = raw_data.CommandNo.ToThaiNumber(),
CommandYear = raw_data.CommandYear.ToInteger().ToThaiYear().ToString().ToThaiNumber(),
IssuerOrganizationName = raw_data.IssuerOrganizationName,
CommandExcecuteDate = raw_data.CommandExcecuteDate != null ? raw_data.CommandExcecuteDate.Value.ToThaiFullDate3().ToThaiNumber() : "-",
};
var data = await _commandReportRepository.GetCommandType15AttachmentAsync(commandId);
return data;
return new
{
CommandNo = command.CommandNo,
CommandYear = command.CommandYear,
IssuerOrganizationName = command.IssuerOrganizationName,
CommandExcecuteDate = command.CommandExcecuteDate,
data = data,
};
//var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Reports", $"29-คำสั่งให้ช่วยราชการ-2.trdp");
//ReportPackager reportPackager = new ReportPackager();
@ -3079,7 +3228,7 @@ namespace BMA.EHR.Report.Service.Controllers
//return File(contentData, mimeType, $"command-attachment-{cmd.CommandNo}-{cmd.CommandYear.ToInteger().ToThaiYear()}.{exportType.Trim().ToLower()}");
var data = new
{
template = "C-PM-05",
template = "C-PM-05-attachment",
reportName = "docx-report",
data = contentData
};
@ -3175,7 +3324,7 @@ namespace BMA.EHR.Report.Service.Controllers
//return File(contentData, mimeType, $"command-attachment-{cmd.CommandNo}-{cmd.CommandYear.ToInteger().ToThaiYear()}.{exportType.Trim().ToLower()}");
var data = new
{
template = "C-PM-06",
template = "C-PM-06-attachment",
reportName = "docx-report",
data = contentData
};
@ -3271,7 +3420,7 @@ namespace BMA.EHR.Report.Service.Controllers
//return File(contentData, mimeType, $"command-attachment-{cmd.CommandNo}-{cmd.CommandYear.ToInteger().ToThaiYear()}.{exportType.Trim().ToLower()}");
var data = new
{
template = "C-PM-07",
template = "C-PM-07-attachment",
reportName = "docx-report",
data = contentData
};
@ -3367,7 +3516,7 @@ namespace BMA.EHR.Report.Service.Controllers
//return File(contentData, mimeType, $"command-attachment-{cmd.CommandNo}-{cmd.CommandYear.ToInteger().ToThaiYear()}.{exportType.Trim().ToLower()}");
var data = new
{
template = "C-PM-08",
template = "C-PM-08-attachment",
reportName = "docx-report",
data = contentData
};
@ -3463,7 +3612,7 @@ namespace BMA.EHR.Report.Service.Controllers
//return File(contentData, mimeType, $"command-attachment-{cmd.CommandNo}-{cmd.CommandYear.ToInteger().ToThaiYear()}.{exportType.Trim().ToLower()}");
var data = new
{
//template = "DP6_006",
template = "C-PM-09-attachment",
reportName = "docx-report",
data = contentData
};
@ -3715,7 +3864,7 @@ namespace BMA.EHR.Report.Service.Controllers
//return File(contentData, mimeType, $"command-attachment-{cmd.CommandNo}-{cmd.CommandYear.ToInteger().ToThaiYear()}.{exportType.Trim().ToLower()}");
var data = new
{
template = "C-PM-13",
template = "C-PM-13-attachment",
reportName = "docx-report",
data = contentData
};
@ -3811,7 +3960,7 @@ namespace BMA.EHR.Report.Service.Controllers
//return File(contentData, mimeType, $"command-attachment-{cmd.CommandNo}-{cmd.CommandYear.ToInteger().ToThaiYear()}.{exportType.Trim().ToLower()}");
var data = new
{
template = "C-PM-14",
template = "C-PM-14-attachment",
reportName = "docx-report",
data = contentData
};
@ -3907,7 +4056,7 @@ namespace BMA.EHR.Report.Service.Controllers
//return File(contentData, mimeType, $"command-attachment-{cmd.CommandNo}-{cmd.CommandYear.ToInteger().ToThaiYear()}.{exportType.Trim().ToLower()}");
var data = new
{
template = "C-PM-15",
template = "C-PM-15-attachment",
reportName = "docx-report",
data = contentData
};