คำสั่ง38
This commit is contained in:
parent
def2b8f7fe
commit
d7677ac2a5
5 changed files with 391 additions and 43 deletions
|
|
@ -470,6 +470,18 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
else
|
||||
return Success(new { result = "N" });
|
||||
}
|
||||
case "C-PM-38":
|
||||
{
|
||||
if (command.CommandNo != "" &&
|
||||
command.CommandYear != null &&
|
||||
command.CommandExcecuteDate != null &&
|
||||
cover != null)
|
||||
{
|
||||
return Success(new { result = "Y" });
|
||||
}
|
||||
else
|
||||
return Success(new { result = "N" });
|
||||
}
|
||||
default:
|
||||
{
|
||||
if (command.CommandNo != "" &&
|
||||
|
|
@ -4488,6 +4500,111 @@ namespace BMA.EHR.Command.Service.Controllers
|
|||
|
||||
#endregion
|
||||
|
||||
#region " C-PM-38 "
|
||||
|
||||
/// <summary>
|
||||
/// PM7-22 : สร้างข้อมูลรายละเอียดการออกคำสั่ง C-PM-38
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200">เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPost("c-pm-38/detail")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PostType38Async([FromBody] CreateCommandGroup15Request req)
|
||||
{
|
||||
try
|
||||
{
|
||||
var commandType = await _commandTypeRepository.GetByIdAsync(req.orderTypeValue);
|
||||
|
||||
var inserted = new Domain.Models.Commands.Core.Command
|
||||
{
|
||||
CommandNo = req.orderNo,
|
||||
CommandYear = req.orderYear.ToString(),
|
||||
CommandSubject = req.orderTitle,
|
||||
CommandTypeId = req.orderTypeValue,
|
||||
IssuerOrganizationId = req.orderBy,
|
||||
IssuerOrganizationName = req.orderByOrganizationName,
|
||||
AuthorizedUserFullName = req.signatoryBy,
|
||||
AuthorizedPosition = req.signatoryPosition,
|
||||
CommandAffectDate = req.orderDate,
|
||||
OwnerGovId = OcId,
|
||||
|
||||
CaseFault = req.caseFault,
|
||||
FaultLevel = req.faultLevel,
|
||||
RefRaw = req.refRaw,
|
||||
Result = req.result,
|
||||
SalaryPeriodId = req.salaryPeriodId,
|
||||
SalaryPeriod = req.salaryPeriod,
|
||||
Year = req.year,
|
||||
};
|
||||
|
||||
var result = await _repository.AddAsync(inserted);
|
||||
|
||||
return Success(result);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// PM7-23 : แก้ไขข้อมูลรายละเอียดการออกคำสั่ง C-PM-38
|
||||
/// </summary>
|
||||
/// <param name="orderId">Record Id ของคำสั่ง</param>
|
||||
/// <returns></returns>
|
||||
/// <response code="200">เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPut("c-pm-38/detail/{orderId}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> PutType38Async(Guid orderId, [FromBody] CreateCommandGroup15Request req)
|
||||
{
|
||||
try
|
||||
{
|
||||
var order = await _repository.GetByIdAsync(orderId);
|
||||
if (order == null)
|
||||
throw new Exception(GlobalMessages.CommandNotFound);
|
||||
|
||||
|
||||
var commandType = await _commandTypeRepository.GetByIdAsync(req.orderTypeValue);
|
||||
var status = await _commandStatusRepository.GetByIdAsync(order.CommandStatusId);
|
||||
|
||||
order.CommandNo = req.orderNo;
|
||||
order.CommandYear = req.orderYear.ToString();
|
||||
order.CommandSubject = req.orderTitle;
|
||||
order.CommandType = commandType!;
|
||||
order.IssuerOrganizationId = req.orderBy;
|
||||
order.IssuerOrganizationName = req.orderByOrganizationName;
|
||||
order.AuthorizedUserFullName = req.signatoryBy;
|
||||
order.AuthorizedPosition = req.signatoryPosition;
|
||||
order.CommandStatus = status!;
|
||||
order.CommandAffectDate = req.orderDate;
|
||||
order.CaseFault = req.caseFault;
|
||||
order.FaultLevel = req.faultLevel;
|
||||
order.RefRaw = req.refRaw;
|
||||
order.Result = req.result;
|
||||
order.SalaryPeriodId = req.salaryPeriodId;
|
||||
order.SalaryPeriod = req.salaryPeriod;
|
||||
order.Year = req.year;
|
||||
|
||||
var result = await _repository.UpdateAsync(order);
|
||||
|
||||
return Success(result);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@
|
|||
public int orderYear { get; set; }
|
||||
public string signatoryBy { get; set; } = string.Empty;
|
||||
public string signatoryPosition { get; set; } = string.Empty;
|
||||
public Guid salaryPeriodId { get; set; }
|
||||
public string year { get; set; }
|
||||
public string salaryPeriod { get; set; }
|
||||
public Guid? salaryPeriodId { get; set; }
|
||||
public string? year { get; set; }
|
||||
public string? salaryPeriod { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
//"DefaultConnection": "User Id=sys;Password=P@ssw0rd;DBA Privilege=SYSDBA;Data Source=localhost:1521/ORCLCDB",
|
||||
"DefaultConnection": "server=192.168.1.61;user=root;password=adminVM123;port=4061;database=bma_ehr;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||
"DefaultConnection": "server=192.168.1.80;user=root;password=adminVM123;port=3306;database=bma_ehr_demo;Convert Zero Datetime=True;Allow User Variables=true;Pooling=True;"
|
||||
},
|
||||
"Jwt": {
|
||||
"Key": "HP-FnQMUj9msHMSD3T9HtdEnphAKoCJLEl85CIqROFI",
|
||||
|
|
@ -42,5 +42,5 @@
|
|||
"MailFrom": "saraban.csc.rd@bangkok.go.th",
|
||||
"Port": "25"
|
||||
},
|
||||
"API": "https://bma-ehr.frappet.com/api/v1"
|
||||
"API": "https://bma-ehr.frappet.synology.me/api/v1"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue