api เลือกตำแหน่ง
This commit is contained in:
parent
2f49a5b87e
commit
0c56512f54
4 changed files with 106 additions and 30 deletions
|
|
@ -1,35 +1,50 @@
|
|||
namespace BMA.EHR.Domain.Shared
|
||||
{
|
||||
public class GlobalMessages
|
||||
{
|
||||
public static readonly string Success = "สำเร็จ";
|
||||
public class GlobalMessages
|
||||
{
|
||||
public static readonly string Success = "สำเร็จ";
|
||||
|
||||
public static readonly string Error = "เกิดข้อผิดพลาด";
|
||||
public static readonly string Error = "เกิดข้อผิดพลาด";
|
||||
|
||||
public static readonly string DataNotFound = "ไม่พบข้อมูลในระบบ";
|
||||
public static readonly string DataNotFound = "ไม่พบข้อมูลในระบบ";
|
||||
|
||||
public static readonly string NotAuthorized = "กรุณาเข้าสู่ระบบก่อนใช้งาน!";
|
||||
public static readonly string NotAuthorized = "กรุณาเข้าสู่ระบบก่อนใช้งาน!";
|
||||
|
||||
public static readonly string ForbiddenAccess = "คุณไม่ได้รับอนุญาติให้เข้าใช้งาน!";
|
||||
public static readonly string ForbiddenAccess = "คุณไม่ได้รับอนุญาติให้เข้าใช้งาน!";
|
||||
|
||||
public static readonly string ExceptionOccured = "เกิดข้อผิดพลาดขึ้นในระบบ กรุณาติดต่อผู้ดูแลระบบ!";
|
||||
public static readonly string ExceptionOccured = "เกิดข้อผิดพลาดขึ้นในระบบ กรุณาติดต่อผู้ดูแลระบบ!";
|
||||
|
||||
public const string FileNotFoundOnServer = "ไม่พบไฟล์ในระบบ!!";
|
||||
public static readonly string FileNotFoundOnServer = "ไม่พบไฟล์ในระบบ!!";
|
||||
|
||||
#region " Meta Data "
|
||||
|
||||
public static readonly string DataExist5 = "เนื่องจากมีการกำหนดวันหยุดในการทำงาน 5 วันอยู่";
|
||||
|
||||
public static readonly string DataExist6 = "เนื่องจากมีการกำหนดวันหยุดในการทำงาน 6 วันอยู่";
|
||||
public static readonly string DataExist6 = "เนื่องจากมีการกำหนดวันหยุดในการทำงาน 6 วันอยู่";
|
||||
|
||||
public static readonly string NameDupicate = "ชื่อวันหยุดนี้มีอยู่ในระบบอยู่แล้ว";
|
||||
public static readonly string NameDupicate = "ชื่อวันหยุดนี้มีอยู่ในระบบอยู่แล้ว";
|
||||
|
||||
public static readonly string HolidayOfYearNotFound = "ไม่พบข้อมูลวันหยุดในปีที่คุณระบุ";
|
||||
public static readonly string HolidayOfYearNotFound = "ไม่พบข้อมูลวันหยุดในปีที่คุณระบุ";
|
||||
|
||||
public static readonly string HolidayOfYearNotCopy = "ไม่สามารถคัดลอกวันหยุดย้อนหลังได้";
|
||||
public static readonly string HolidayOfYearNotCopy = "ไม่สามารถคัดลอกวันหยุดย้อนหลังได้";
|
||||
|
||||
public static readonly string DestinationHolidayIsExist = "ข้อมูลวันหยุดในปีที่ระบุมีอยู่แล้ว";
|
||||
public static readonly string DestinationHolidayIsExist = "ข้อมูลวันหยุดในปีที่ระบุมีอยู่แล้ว";
|
||||
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region " Organization "
|
||||
public static readonly string PositionPosNoNotFound = "ไม่พบข้อมูลเลขที่ตำแหน่ง";
|
||||
public static readonly string PositionPathNotFound = "ไม่พบข้อมูลตำแหน่ง";
|
||||
public static readonly string PositionLineNotFound = "ไม่พบข้อมูลสายงาน";
|
||||
public static readonly string PositionPathSideNotFound = "ไม่พบข้อมูลด้าน/สาขา";
|
||||
public static readonly string PositionTypeNotFound = "ไม่พบข้อมูลประเภทตำแหน่ง";
|
||||
public static readonly string PositionLevelNotFound = "ไม่พบข้อมูลอันดับ/ระดับ";
|
||||
public static readonly string PositionExecutiveNotFound = "ไม่พบข้อมูลตำแหน่งทางการบริหาร";
|
||||
public static readonly string PositionExecutiveSideNotFound = "ไม่พบข้อมูลด้านทางการบริหาร";
|
||||
public static readonly string PositionEmployeeGroupNotFound = "ไม่พบข้อมูลกลุ่มงาน";
|
||||
public static readonly string PositionEmployeeLevelNotFound = "ไม่พบข้อมูลระดับชั้นงาน";
|
||||
public static readonly string PositionEmployeePositionSideNotFound = "ไม่พบข้อมูลด้านของตำแหน่ง";
|
||||
public static readonly string PositionEmployeePositionNotFound = "ไม่พบข้อมูลตำแหน่ง";
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -275,12 +275,65 @@ namespace BMA.EHR.Placement.Service.Controllers
|
|||
}
|
||||
|
||||
[HttpPost("pass")]
|
||||
public async Task<ActionResult<ResponseObject>> UpdatePositionByPerson(Guid personalId)
|
||||
public async Task<ActionResult<ResponseObject>> UpdatePositionByPerson([FromBody] PersonSelectPositionRequest req)
|
||||
{
|
||||
var person = await _context.PlacementProfiles.FindAsync(personalId);
|
||||
var person = await _context.PlacementProfiles.FindAsync(req.PersonalId);
|
||||
if (person == null)
|
||||
return Error(GlobalMessages.DataNotFound, 404);
|
||||
|
||||
if (req.PosNoId != null)
|
||||
{
|
||||
var save_posNo = await _context.PositionNumbers.FindAsync(req.PosNoId);
|
||||
if (save_posNo == null)
|
||||
return Error(GlobalMessages.PositionPosNoNotFound, 404);
|
||||
person.PositionNumber = save_posNo;
|
||||
}
|
||||
|
||||
if (req.PositionId != null)
|
||||
{
|
||||
var save_position = await _context.PositionPaths.FindAsync(req.PositionId);
|
||||
if (save_position == null)
|
||||
return Error(GlobalMessages.PositionPathNotFound, 404);
|
||||
person.PositionPath = save_position;
|
||||
}
|
||||
|
||||
if (req.PositionLevelId != null)
|
||||
{
|
||||
var save_positionLevel = await _context.PositionLevels.FindAsync(req.PositionLevelId);
|
||||
if (save_positionLevel == null)
|
||||
return Error(GlobalMessages.PositionLevelNotFound, 404);
|
||||
person.PositionLevel = save_positionLevel;
|
||||
}
|
||||
|
||||
if (req.PositionLineId != null)
|
||||
{
|
||||
var save_positionLine = await _context.PositionLines.FindAsync(req.PositionLineId);
|
||||
if (save_positionLine == null)
|
||||
return Error(GlobalMessages.PositionLineNotFound, 404);
|
||||
person.PositionLine = save_positionLine;
|
||||
}
|
||||
|
||||
if (req.PositionPathSideId != null)
|
||||
{
|
||||
var save_positionPathSide = await _context.PositionPathSides.FindAsync(req.PositionPathSideId);
|
||||
if (save_positionPathSide == null)
|
||||
return Error(GlobalMessages.PositionPathSideNotFound, 404);
|
||||
person.PositionPathSide = save_positionPathSide;
|
||||
}
|
||||
|
||||
if (req.PositionTypeId != null)
|
||||
{
|
||||
var save_positionType = await _context.PositionTypes.FindAsync(req.PositionTypeId);
|
||||
if (save_positionType == null)
|
||||
return Error(GlobalMessages.PositionTypeNotFound, 404);
|
||||
person.PositionType = save_positionType;
|
||||
}
|
||||
person.Amount = req.SalaryAmount;
|
||||
person.MouthSalaryAmount = req.MouthSalaryAmount;
|
||||
person.PositionSalaryAmount = req.PositionSalaryAmount;
|
||||
person.RecruitDate = req.ContainDate;
|
||||
_context.SaveChanges();
|
||||
|
||||
return Success();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
using BMA.EHR.Domain.Models.MetaData;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Placement.Service.Requests
|
||||
{
|
||||
public class PersonDefermentRequest
|
||||
{
|
||||
public Guid PersonalId { get; set; }
|
||||
public string Note { get; set; }
|
||||
public bool UploadFile { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
using BMA.EHR.Domain.Models.MetaData;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Placement.Service.Requests
|
||||
{
|
||||
public class PersonSelectPositionRequest
|
||||
{
|
||||
public Guid? PersonalId { get; set; }
|
||||
public DateTime? ContainDate { get; set; }
|
||||
public Guid? PosNoId { get; set; }
|
||||
public Guid? PositionId { get; set; }
|
||||
public Guid? PositionLevelId { get; set; }
|
||||
public Guid? PositionLineId { get; set; }
|
||||
public Guid? PositionPathSideId { get; set; }
|
||||
public Guid? PositionTypeId { get; set; }
|
||||
public double? SalaryAmount { get; set; }
|
||||
public double? MouthSalaryAmount { get; set; }
|
||||
public double? PositionSalaryAmount { get; set; }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue