From ab5afff6e039ab0ae8047828665ba3e87ec8a214 Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Fri, 25 Aug 2023 12:27:12 +0700 Subject: [PATCH] Add API Create command For C-PM-10 to C-PM-17 --- .../Controllers/OrderController.cs | 788 ++++++++++++++++++ .../Requests/CreateCommandGroup0Request.cs | 23 + .../Requests/CreateCommandGroup10Request.cs | 27 + .../Requests/CreateCommandGroup6Request.cs | 43 + .../Requests/CreateCommandGroup7Request.cs | 29 + .../Requests/CreateCommandGroup8Request.cs | 25 + .../Requests/CreateCommandGroup9Request.cs | 31 + .../Models/Commands/Core/Command.cs | 66 ++ ...8-คำสั่งรับโอนข้าราชการกรุงเทพมหานครสามัญ-5.trdp | Bin 28996 -> 29003 bytes 9 files changed, 1032 insertions(+) create mode 100644 BMA.EHR.Command.Service/Requests/CreateCommandGroup0Request.cs create mode 100644 BMA.EHR.Command.Service/Requests/CreateCommandGroup10Request.cs create mode 100644 BMA.EHR.Command.Service/Requests/CreateCommandGroup6Request.cs create mode 100644 BMA.EHR.Command.Service/Requests/CreateCommandGroup7Request.cs create mode 100644 BMA.EHR.Command.Service/Requests/CreateCommandGroup8Request.cs create mode 100644 BMA.EHR.Command.Service/Requests/CreateCommandGroup9Request.cs diff --git a/BMA.EHR.Command.Service/Controllers/OrderController.cs b/BMA.EHR.Command.Service/Controllers/OrderController.cs index 75b6f527..e77d2419 100644 --- a/BMA.EHR.Command.Service/Controllers/OrderController.cs +++ b/BMA.EHR.Command.Service/Controllers/OrderController.cs @@ -1295,6 +1295,794 @@ namespace BMA.EHR.Command.Service.Controllers #endregion + #region " C-PM-10 " + + /// + /// PM7-22 : สร้างข้อมูลรายละเอียดการออกคำสั่ง C-PM-10 + /// + /// + /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPost("c-pm-10/detail")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task> PostType10Async([FromBody] CreateCommandGroup6Request 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, + + PlacementCommandIssuer = req.placementCommandIssuer, + PlacementCommandNo = req.placementCommandNo, + PlacementCommandDate = req.placementCommandDate, + PlacementPositionName = req.placementPositionName, + PlacementOrganizationName = req.placementOrganizationName, + ProbationStartDate = req.probationStartDate, + ProbationEndDate = req.probationEndDate, + ChairManFullName = req.chairManFullName, + Member1FullName = req.member1FullName, + Member2FullName = req.member2FullName, + }; + + var result = await _repository.AddAsync(inserted); + + return Success(result); + } + catch + { + throw; + } + } + + /// + /// PM7-23 : แก้ไขข้อมูลรายละเอียดการออกคำสั่ง C-PM-10 + /// + /// Record Id ของคำสั่ง + /// + /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPut("c-pm-10/detail/{orderId}")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task> PutType10Async(Guid orderId, [FromBody] CreateCommandGroup6Request 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.PlacementCommandIssuer = req.placementCommandIssuer; + order.PlacementCommandNo = req.placementCommandNo; + order.PlacementCommandDate = req.placementCommandDate; + order.PlacementPositionName = req.placementPositionName; + order.PlacementOrganizationName = req.placementOrganizationName; + order.ProbationStartDate = req.probationStartDate; + order.ProbationEndDate = req.probationEndDate; + order.ChairManFullName = req.chairManFullName; + order.Member1FullName = req.member1FullName; + order.Member2FullName = req.member2FullName; + + var result = await _repository.UpdateAsync(order); + + return Success(result); + } + catch + { + throw; + } + } + + #endregion + + #region " C-PM-11 " + + /// + /// PM7-22 : สร้างข้อมูลรายละเอียดการออกคำสั่ง C-PM-11 + /// + /// + /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPost("c-pm-11/detail")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task> PostType11Async([FromBody] CreateCommandGroup7Request 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, + + PlacementCommandIssuer = req.placementCommandIssuer, + PlacementCommandNo = req.placementCommandNo, + PlacementCommandDate = req.placementCommandDate, + + }; + + var result = await _repository.AddAsync(inserted); + + return Success(result); + } + catch + { + throw; + } + } + + /// + /// PM7-23 : แก้ไขข้อมูลรายละเอียดการออกคำสั่ง C-PM-11 + /// + /// Record Id ของคำสั่ง + /// + /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPut("c-pm-11/detail/{orderId}")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task> PutType11Async(Guid orderId, [FromBody] CreateCommandGroup7Request 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.PlacementCommandIssuer = req.placementCommandIssuer; + order.PlacementCommandNo = req.placementCommandNo; + order.PlacementCommandDate = req.placementCommandDate; + + var result = await _repository.UpdateAsync(order); + + return Success(result); + } + catch + { + throw; + } + } + + #endregion + + #region " C-PM-12 " + + /// + /// PM7-22 : สร้างข้อมูลรายละเอียดการออกคำสั่ง C-PM-12 + /// + /// + /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPost("c-pm-12/detail")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task> PostType12Async([FromBody] CreateCommandGroup7Request 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, + + PlacementCommandIssuer = req.placementCommandIssuer, + PlacementCommandNo = req.placementCommandNo, + PlacementCommandDate = req.placementCommandDate, + + }; + + var result = await _repository.AddAsync(inserted); + + return Success(result); + } + catch + { + throw; + } + } + + /// + /// PM7-23 : แก้ไขข้อมูลรายละเอียดการออกคำสั่ง C-PM-12 + /// + /// Record Id ของคำสั่ง + /// + /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPut("c-pm-12/detail/{orderId}")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task> PutType12Async(Guid orderId, [FromBody] CreateCommandGroup7Request 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.PlacementCommandIssuer = req.placementCommandIssuer; + order.PlacementCommandNo = req.placementCommandNo; + order.PlacementCommandDate = req.placementCommandDate; + + var result = await _repository.UpdateAsync(order); + + return Success(result); + } + catch + { + throw; + } + } + + #endregion + + #region " C-PM-13 " + + /// + /// PM7-22 : สร้างข้อมูลรายละเอียดการออกคำสั่ง C-PM-13 + /// + /// + /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPost("c-pm-13/detail")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task> PostType13Async([FromBody] CreateCommandGroup8Request 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, + + ReceiveOrganizationName = req.receiveOrganizationName, + + }; + + var result = await _repository.AddAsync(inserted); + + return Success(result); + } + catch + { + throw; + } + } + + /// + /// PM7-23 : แก้ไขข้อมูลรายละเอียดการออกคำสั่ง C-PM-13 + /// + /// Record Id ของคำสั่ง + /// + /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPut("c-pm-13/detail/{orderId}")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task> PutType13Async(Guid orderId, [FromBody] CreateCommandGroup8Request 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.ReceiveOrganizationName = req.receiveOrganizationName; + + var result = await _repository.UpdateAsync(order); + + return Success(result); + } + catch + { + throw; + } + } + + #endregion + + #region " C-PM-14 " + + /// + /// PM7-22 : สร้างข้อมูลรายละเอียดการออกคำสั่ง C-PM-14 + /// + /// + /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPost("c-pm-14/detail")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task> PostType14Async([FromBody] CreateCommandGroup9Request 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, + + TransferOrganizationName = req.transferOrganizationName, + ConclusionReceiveNo = req.conclusionReceiveNo, + ConclusionReceiveDate = req.conclusionReceiveDate, + + }; + + var result = await _repository.AddAsync(inserted); + + return Success(result); + } + catch + { + throw; + } + } + + /// + /// PM7-23 : แก้ไขข้อมูลรายละเอียดการออกคำสั่ง C-PM-14 + /// + /// Record Id ของคำสั่ง + /// + /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPut("c-pm-14/detail/{orderId}")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task> PutType14Async(Guid orderId, [FromBody] CreateCommandGroup9Request 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.TransferOrganizationName = req.transferOrganizationName; + order.ConclusionReceiveNo = req.conclusionReceiveNo; + order.ConclusionReceiveDate = req.conclusionReceiveDate; + + var result = await _repository.UpdateAsync(order); + + return Success(result); + } + catch + { + throw; + } + } + + #endregion + + #region " C-PM-15 " + + /// + /// PM7-22 : สร้างข้อมูลรายละเอียดการออกคำสั่ง C-PM-15 + /// + /// + /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPost("c-pm-15/detail")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task> PostType15Async([FromBody] CreateCommandGroup0Request 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, + }; + + var result = await _repository.AddAsync(inserted); + + return Success(result); + } + catch + { + throw; + } + } + + /// + /// PM7-23 : แก้ไขข้อมูลรายละเอียดการออกคำสั่ง C-PM-15 + /// + /// Record Id ของคำสั่ง + /// + /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPut("c-pm-15/detail/{orderId}")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task> PutType15Async(Guid orderId, [FromBody] CreateCommandGroup0Request 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; + + var result = await _repository.UpdateAsync(order); + + return Success(result); + } + catch + { + throw; + } + } + + #endregion + + #region " C-PM-16 " + + /// + /// PM7-22 : สร้างข้อมูลรายละเอียดการออกคำสั่ง C-PM-16 + /// + /// + /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPost("c-pm-16/detail")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task> PostType16Async([FromBody] CreateCommandGroup10Request 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, + + GovAidCommandNo = req.govAidCommandNo, + GovAidCommandDate = req.govAidCommandDate, + }; + + var result = await _repository.AddAsync(inserted); + + return Success(result); + } + catch + { + throw; + } + } + + /// + /// PM7-23 : แก้ไขข้อมูลรายละเอียดการออกคำสั่ง C-PM-16 + /// + /// Record Id ของคำสั่ง + /// + /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPut("c-pm-16/detail/{orderId}")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task> PutType16Async(Guid orderId, [FromBody] CreateCommandGroup10Request 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.GovAidCommandNo = req.govAidCommandNo; + order.GovAidCommandDate = req.govAidCommandDate; + + var result = await _repository.UpdateAsync(order); + + return Success(result); + } + catch + { + throw; + } + } + + #endregion + + #region " C-PM-17 " + + /// + /// PM7-22 : สร้างข้อมูลรายละเอียดการออกคำสั่ง C-PM-17 + /// + /// + /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPost("c-pm-17/detail")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task> PostType17Async([FromBody] CreateCommandGroup0Request 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, + }; + + var result = await _repository.AddAsync(inserted); + + return Success(result); + } + catch + { + throw; + } + } + + /// + /// PM7-23 : แก้ไขข้อมูลรายละเอียดการออกคำสั่ง C-PM-17 + /// + /// Record Id ของคำสั่ง + /// + /// เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ + /// ไม่ได้ Login เข้าระบบ + /// เมื่อเกิดข้อผิดพลาดในการทำงาน + [HttpPut("c-pm-17/detail/{orderId}")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status500InternalServerError)] + public async Task> PutType17Async(Guid orderId, [FromBody] CreateCommandGroup0Request 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; + + var result = await _repository.UpdateAsync(order); + + return Success(result); + } + catch + { + throw; + } + } + + #endregion + #endregion /// diff --git a/BMA.EHR.Command.Service/Requests/CreateCommandGroup0Request.cs b/BMA.EHR.Command.Service/Requests/CreateCommandGroup0Request.cs new file mode 100644 index 00000000..17b9817b --- /dev/null +++ b/BMA.EHR.Command.Service/Requests/CreateCommandGroup0Request.cs @@ -0,0 +1,23 @@ +namespace BMA.EHR.Command.Service.Requests +{ + public class CreateCommandGroup0Request + { + public Guid orderTypeValue { get; set; } + + public string orderTitle { get; set; } = string.Empty; + + public string orderNo { get; set; } = string.Empty; + + public int orderYear { get; set; } + + public DateTime orderDate { get; set; } + + public Guid orderBy { get; set; } + + public string orderByOrganizationName { get; set; } = string.Empty; + + public string signatoryBy { get; set; } = string.Empty; + + public string signatoryPosition { get; set; } = string.Empty; + } +} diff --git a/BMA.EHR.Command.Service/Requests/CreateCommandGroup10Request.cs b/BMA.EHR.Command.Service/Requests/CreateCommandGroup10Request.cs new file mode 100644 index 00000000..91df5ac8 --- /dev/null +++ b/BMA.EHR.Command.Service/Requests/CreateCommandGroup10Request.cs @@ -0,0 +1,27 @@ +namespace BMA.EHR.Command.Service.Requests +{ + public class CreateCommandGroup10Request + { + public Guid orderTypeValue { get; set; } + + public string orderTitle { get; set; } = string.Empty; + + public string orderNo { get; set; } = string.Empty; + + public int orderYear { get; set; } + + public DateTime orderDate { get; set; } + + public Guid orderBy { get; set; } + + public string orderByOrganizationName { get; set; } = string.Empty; + + public string signatoryBy { get; set; } = string.Empty; + + public string signatoryPosition { get; set; } = string.Empty; + + public string govAidCommandNo { get; set; } + + public DateTime govAidCommandDate { get; set; } + } +} diff --git a/BMA.EHR.Command.Service/Requests/CreateCommandGroup6Request.cs b/BMA.EHR.Command.Service/Requests/CreateCommandGroup6Request.cs new file mode 100644 index 00000000..084a1818 --- /dev/null +++ b/BMA.EHR.Command.Service/Requests/CreateCommandGroup6Request.cs @@ -0,0 +1,43 @@ +namespace BMA.EHR.Command.Service.Requests +{ + public class CreateCommandGroup6Request + { + public Guid orderTypeValue { get; set; } + + public string orderTitle { get; set; } = string.Empty; + + public string orderNo { get; set; } = string.Empty; + + public int orderYear { get; set; } + + public DateTime orderDate { get; set; } + + public Guid orderBy { get; set; } + + public string orderByOrganizationName { get; set; } = string.Empty; + + public string signatoryBy { get; set; } = string.Empty; + + public string signatoryPosition { get; set; } = string.Empty; + + public string placementCommandIssuer { get; set; } + + public string placementCommandNo { get; set; } + + public DateTime placementCommandDate { get; set; } + + public string placementPositionName { get; set; } + + public string placementOrganizationName { get; set; } + + public DateTime probationStartDate { get; set; } + + public DateTime probationEndDate { get; set; } + + public string chairManFullName { get; set; } + + public string member1FullName { get; set; } + + public string member2FullName { get; set; } + } +} diff --git a/BMA.EHR.Command.Service/Requests/CreateCommandGroup7Request.cs b/BMA.EHR.Command.Service/Requests/CreateCommandGroup7Request.cs new file mode 100644 index 00000000..c6bcb8b5 --- /dev/null +++ b/BMA.EHR.Command.Service/Requests/CreateCommandGroup7Request.cs @@ -0,0 +1,29 @@ +namespace BMA.EHR.Command.Service.Requests +{ + public class CreateCommandGroup7Request + { + public Guid orderTypeValue { get; set; } + + public string orderTitle { get; set; } = string.Empty; + + public string orderNo { get; set; } = string.Empty; + + public int orderYear { get; set; } + + public DateTime orderDate { get; set; } + + public Guid orderBy { get; set; } + + public string orderByOrganizationName { get; set; } = string.Empty; + + public string signatoryBy { get; set; } = string.Empty; + + public string signatoryPosition { get; set; } = string.Empty; + + public string placementCommandIssuer { get; set; } + + public string placementCommandNo { get; set; } + + public DateTime placementCommandDate { get; set; } + } +} diff --git a/BMA.EHR.Command.Service/Requests/CreateCommandGroup8Request.cs b/BMA.EHR.Command.Service/Requests/CreateCommandGroup8Request.cs new file mode 100644 index 00000000..88e8c5de --- /dev/null +++ b/BMA.EHR.Command.Service/Requests/CreateCommandGroup8Request.cs @@ -0,0 +1,25 @@ +namespace BMA.EHR.Command.Service.Requests +{ + public class CreateCommandGroup8Request + { + public Guid orderTypeValue { get; set; } + + public string orderTitle { get; set; } = string.Empty; + + public string orderNo { get; set; } = string.Empty; + + public int orderYear { get; set; } + + public DateTime orderDate { get; set; } + + public Guid orderBy { get; set; } + + public string orderByOrganizationName { get; set; } = string.Empty; + + public string signatoryBy { get; set; } = string.Empty; + + public string signatoryPosition { get; set; } = string.Empty; + + public string receiveOrganizationName { get; set; } + } +} diff --git a/BMA.EHR.Command.Service/Requests/CreateCommandGroup9Request.cs b/BMA.EHR.Command.Service/Requests/CreateCommandGroup9Request.cs new file mode 100644 index 00000000..52889232 --- /dev/null +++ b/BMA.EHR.Command.Service/Requests/CreateCommandGroup9Request.cs @@ -0,0 +1,31 @@ +using Microsoft.EntityFrameworkCore; + +namespace BMA.EHR.Command.Service.Requests +{ + public class CreateCommandGroup9Request + { + public Guid orderTypeValue { get; set; } + + public string orderTitle { get; set; } = string.Empty; + + public string orderNo { get; set; } = string.Empty; + + public int orderYear { get; set; } + + public DateTime orderDate { get; set; } + + public Guid orderBy { get; set; } + + public string orderByOrganizationName { get; set; } = string.Empty; + + public string signatoryBy { get; set; } = string.Empty; + + public string signatoryPosition { get; set; } = string.Empty; + + public string transferOrganizationName { get; set; } + + public string? conclusionReceiveNo { get; set; } + + public DateTime? conclusionReceiveDate { get; set; } + } +} diff --git a/BMA.EHR.Domain/Models/Commands/Core/Command.cs b/BMA.EHR.Domain/Models/Commands/Core/Command.cs index 0f991980..173e77b1 100644 --- a/BMA.EHR.Domain/Models/Commands/Core/Command.cs +++ b/BMA.EHR.Domain/Models/Commands/Core/Command.cs @@ -103,6 +103,72 @@ namespace BMA.EHR.Domain.Models.Commands.Core #endregion + #region " C-PM-10,C-PM-11,C-PM-12 " + + [Comment("หน่วยงานที่ออกคำสั่งบรรจุ")] + public string? PlacementCommandIssuer { get; set; } + + [Comment("เลขที่คำสั่งบรรจุ")] + public string? PlacementCommandNo { get; set; } + + [Comment("คำสั่งบรรจุลงวันที่")] + public DateTime? PlacementCommandDate { get; set; } + + #endregion + + #region " C-PM-10 " + + [Comment("ตำแหน่งที่บรรจุ")] + public string? PlacementPositionName { get; set; } + + [Comment("สังกัดที่บรรจุ")] + public string? PlacementOrganizationName { get; set; } + + [Comment("วันที่เริ่มทดลองปฏิบัติราชการ")] + public DateTime? ProbationStartDate { get; set; } + + [Comment("วันที่สิ้นสุดการทดลองปฏิบัติราชการ")] + public DateTime? ProbationEndDate { get; set; } + + [Comment("ประธานคณะกรรมการ")] + public string? ChairManFullName { get; set; } + + [Comment("กรรมการคนที่ 1")] + public string? Member1FullName { get; set; } + + [Comment("กรรมการคนที่ 2")] + public string? Member2FullName { get; set; } + + #endregion + + #region " C-PM-13 " + + [Comment("ส่วนราชการที่รับโอน")] + public string? ReceiveOrganizationName { get; set; } + + #endregion + + #region " C-PM-14 " + + [Comment("ส่วนราชการที่ให้โอน")] + public string? TransferOrganizationName { get; set; } + + [Comment("มติ กก. ครั้งที่ (การรับโอน)")] + public string? ConclusionReceiveNo { get; set; } + + [Comment("ลงวันที่ (การรับโอน)")] + public DateTime? ConclusionReceiveDate { get; set; } + + #endregion + + #region " C-PM-16 " + + public string? GovAidCommandNo { get; set; } + + public DateTime? GovAidCommandDate { get; set; } + + #endregion + public virtual List Documents { get; set; } = new(); public virtual List Receivers { get; set; } diff --git a/BMA.EHR.Report.Service/Reports/28-คำสั่งรับโอนข้าราชการกรุงเทพมหานครสามัญ-5.trdp b/BMA.EHR.Report.Service/Reports/28-คำสั่งรับโอนข้าราชการกรุงเทพมหานครสามัญ-5.trdp index 07383996ba960c00ea9215c2a3d90c9e4d9a047e..bc4f20d5075477cb444330a9cf79858acc9bf4a6 100644 GIT binary patch delta 1815 zcmV+y2k7|3;sMLz0S!<~0|XQR000O8!(bV)4U=dM!(bU#6o|IEp#}f|Ig_nuGk;%i z+cpq?AF%I0=qY)qWZ7|?40emAU7N0LV8q!9>`k*-TbL~wvb?r?s=EMb3KZDdWP#IR zXdHAM8U$$4b(6l0uun4bNJ^AqTkfAUUf?(sbtLb8cRb!5Q@n7u)kHsFr(@byNzv7e zg0NM!Yo=8%DP8yWxdr9I`OiNqu7BdT?YQWcS#ukNZeGn-TMAk+TDYVH-t)ja4!rfi z`z`SLf%h`-db#{LT|wX4cB`ah)Oq+RD5%n~?^G*Tmgd0fgeNVV$>ua&)fK`NLd9z?ZgrqZ9xh|oFn^mBTy=>s zXc?RJhFemynTXSxOu^@Xp%wRD6QebJ*S**@>ja4#__iCpClps~%jL7IEu)Iz7~gd* zw1V#tnam$C#iZ>jNQ>swVAAMW<`p{1X4UOFc*(wtuCStbf^U0y%9F#z2pis?o${#|98>%V;X-rrE-4_u6DllP;;X zt-1h7T3kjzpcLyG1x&eeUB+S<9<(PyK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