แก้ ลาออกลูกจ้าง
This commit is contained in:
parent
c18d9a392a
commit
b303d3c11b
12 changed files with 20556 additions and 68 deletions
|
|
@ -53,6 +53,7 @@ namespace BMA.EHR.Application.Responses.Profiles
|
||||||
public string? Child3 { get; set; }
|
public string? Child3 { get; set; }
|
||||||
|
|
||||||
public string? Child4 { get; set; }
|
public string? Child4 { get; set; }
|
||||||
|
public double? Amount { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -173,5 +173,11 @@ namespace BMA.EHR.Domain.Models.Leave.Requests
|
||||||
|
|
||||||
public string? Child4 { get; set; }
|
public string? Child4 { get; set; }
|
||||||
|
|
||||||
|
public Guid? ProfileId { get; set; }
|
||||||
|
public string? ProfileType { get; set; }
|
||||||
|
public double? Amount { get; set; }
|
||||||
|
public DateTime? BirthDate { get; set; } = DateTime.MinValue;
|
||||||
|
public DateTime? DateAppoint { get; set; } = DateTime.MinValue;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
19156
BMA.EHR.Infrastructure/Migrations/20241115071241_update table LeaveRequest add profileId.Designer.cs
generated
Normal file
19156
BMA.EHR.Infrastructure/Migrations/20241115071241_update table LeaveRequest add profileId.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,22 @@
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class updatetableLeaveRequestaddprofileId : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,71 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class updatetableLeaveRequestaddprofileId1 : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<double>(
|
||||||
|
name: "Amount",
|
||||||
|
table: "LeaveRequests",
|
||||||
|
type: "double",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<DateTime>(
|
||||||
|
name: "BirthDate",
|
||||||
|
table: "LeaveRequests",
|
||||||
|
type: "datetime(6)",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<DateTime>(
|
||||||
|
name: "DateAppoint",
|
||||||
|
table: "LeaveRequests",
|
||||||
|
type: "datetime(6)",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "ProfileId",
|
||||||
|
table: "LeaveRequests",
|
||||||
|
type: "char(36)",
|
||||||
|
nullable: true,
|
||||||
|
collation: "ascii_general_ci");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "ProfileType",
|
||||||
|
table: "LeaveRequests",
|
||||||
|
type: "longtext",
|
||||||
|
nullable: true)
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "Amount",
|
||||||
|
table: "LeaveRequests");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "BirthDate",
|
||||||
|
table: "LeaveRequests");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "DateAppoint",
|
||||||
|
table: "LeaveRequests");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ProfileId",
|
||||||
|
table: "LeaveRequests");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ProfileType",
|
||||||
|
table: "LeaveRequests");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -209,10 +209,16 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("longtext");
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<double?>("Amount")
|
||||||
|
.HasColumnType("double");
|
||||||
|
|
||||||
b.Property<string>("ApproveStep")
|
b.Property<string>("ApproveStep")
|
||||||
.HasColumnType("longtext")
|
.HasColumnType("longtext")
|
||||||
.HasComment("step การอนุมัติ st1 = จทน.อนุมัตื,st2 = ผู้บังคับบัญชา อนุมัติ ");
|
.HasComment("step การอนุมัติ st1 = จทน.อนุมัตื,st2 = ผู้บังคับบัญชา อนุมัติ ");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("BirthDate")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
b.Property<string>("CancelLeaveWrote")
|
b.Property<string>("CancelLeaveWrote")
|
||||||
.HasColumnType("longtext")
|
.HasColumnType("longtext")
|
||||||
.HasComment("เขียนที่ (ขอยกเลิก)");
|
.HasComment("เขียนที่ (ขอยกเลิก)");
|
||||||
|
|
@ -282,6 +288,9 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
.HasColumnOrder(101)
|
.HasColumnOrder(101)
|
||||||
.HasComment("User Id ที่สร้างข้อมูล");
|
.HasComment("User Id ที่สร้างข้อมูล");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("DateAppoint")
|
||||||
|
.HasColumnType("datetime(6)");
|
||||||
|
|
||||||
b.Property<string>("Dear")
|
b.Property<string>("Dear")
|
||||||
.HasColumnType("longtext")
|
.HasColumnType("longtext")
|
||||||
.HasComment("เรียนใคร");
|
.HasComment("เรียนใคร");
|
||||||
|
|
@ -440,6 +449,12 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
||||||
b.Property<string>("Prefix")
|
b.Property<string>("Prefix")
|
||||||
.HasColumnType("longtext");
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
|
b.Property<Guid?>("ProfileId")
|
||||||
|
.HasColumnType("char(36)");
|
||||||
|
|
||||||
|
b.Property<string>("ProfileType")
|
||||||
|
.HasColumnType("longtext");
|
||||||
|
|
||||||
b.Property<double>("RestDayCurrentTotal")
|
b.Property<double>("RestDayCurrentTotal")
|
||||||
.HasColumnType("double");
|
.HasColumnType("double");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -140,8 +140,8 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
|
return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
|
||||||
}
|
}
|
||||||
|
|
||||||
var userCalendar = await _userCalendarRepository.GetExist(profile.Id);
|
//var userCalendar = await _userCalendarRepository.GetExist(profile.Id);
|
||||||
var category = userCalendar == null ? "NORMAL" : userCalendar.Calendar;
|
//var category = userCalendar == null ? "NORMAL" : userCalendar.Calendar;
|
||||||
|
|
||||||
var leaveType = await _leaveTypeRepository.GetByIdAsync(req.Type);
|
var leaveType = await _leaveTypeRepository.GetByIdAsync(req.Type);
|
||||||
if (leaveType == null)
|
if (leaveType == null)
|
||||||
|
|
@ -149,9 +149,9 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
|
return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
|
||||||
}
|
}
|
||||||
|
|
||||||
var sumLeave = req.LeaveStartDate.DiffDay(req.LeaveEndDate);
|
//var sumLeave = req.LeaveStartDate.DiffDay(req.LeaveEndDate);
|
||||||
var sumHoliday = await _holidayRepository.GetHolidayCountAsync(req.LeaveStartDate, req.LeaveEndDate, category);
|
//var sumHoliday = await _holidayRepository.GetHolidayCountAsync(req.LeaveStartDate, req.LeaveEndDate, category);
|
||||||
var sumWeekend = _holidayRepository.GetWeekEndCount(req.LeaveStartDate, req.LeaveEndDate, category);
|
//var sumWeekend = _holidayRepository.GetWeekEndCount(req.LeaveStartDate, req.LeaveEndDate, category);
|
||||||
|
|
||||||
// var leaveTotal = 0.0;
|
// var leaveTotal = 0.0;
|
||||||
// if (req.LeaveRange != "ALL")
|
// if (req.LeaveRange != "ALL")
|
||||||
|
|
@ -195,6 +195,12 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
Child2 = profile.Child2,
|
Child2 = profile.Child2,
|
||||||
Child3 = profile.Child3,
|
Child3 = profile.Child3,
|
||||||
Child4 = profile.Child4,
|
Child4 = profile.Child4,
|
||||||
|
|
||||||
|
ProfileId = profile.Id,
|
||||||
|
ProfileType = profile.ProfileType,
|
||||||
|
Amount = profile.Amount,
|
||||||
|
BirthDate = profile.BirthDate,
|
||||||
|
DateAppoint = profile.DateAppoint,
|
||||||
};
|
};
|
||||||
|
|
||||||
// get leave last
|
// get leave last
|
||||||
|
|
@ -1543,17 +1549,35 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
}
|
}
|
||||||
var baseAPIOrg = _configuration["API"];
|
var baseAPIOrg = _configuration["API"];
|
||||||
var apiUrlOrg = $"{baseAPIOrg}/org/workflow/add-workflow";
|
var apiUrlOrg = $"{baseAPIOrg}/org/workflow/add-workflow";
|
||||||
using (var client = new HttpClient())
|
if (profile.ProfileType == "OFFICER")
|
||||||
{
|
{
|
||||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
|
using (var client = new HttpClient())
|
||||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
|
||||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
|
||||||
{
|
{
|
||||||
refId = id,
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
|
||||||
sysName = "SYS_LEAVE_LIST",
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
posLevelName = profile.PosLevel?.PosLevelName ?? "",
|
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||||
posTypeName = profile.PosType?.PosTypeName ?? "",
|
{
|
||||||
});
|
refId = id,
|
||||||
|
sysName = "SYS_LEAVE_LIST",
|
||||||
|
posLevelName = profile.PosLevel?.PosLevelName ?? "",
|
||||||
|
posTypeName = profile.PosType?.PosTypeName ?? "",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
using (var client = new HttpClient())
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", AccessToken.Replace("Bearer ", ""));
|
||||||
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||||
|
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||||
|
{
|
||||||
|
refId = id,
|
||||||
|
sysName = "SYS_LEAVE_LIST_EMP",
|
||||||
|
posLevelName = "EMP",
|
||||||
|
posTypeName = "EMP",
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Success();
|
return Success();
|
||||||
|
|
@ -1599,66 +1623,76 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
public async Task<ActionResult<ResponseObject>> GetLeaveRequestForAdminByIdAsync(Guid id)
|
public async Task<ActionResult<ResponseObject>> GetLeaveRequestForAdminByIdAsync(Guid id)
|
||||||
{
|
{
|
||||||
var getWorkflow = await _permission.GetPermissionAPIWorkflowAsync(id.ToString(), "SYS_LEAVE_LIST");
|
var rawData = await _leaveRequestRepository.GetByIdAsync(id);
|
||||||
if (getWorkflow == false)
|
if (rawData == null)
|
||||||
|
return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
|
||||||
|
|
||||||
|
if (rawData.ProfileType =="OFFICER")
|
||||||
{
|
{
|
||||||
var getPermission = await _permission.GetPermissionAPIAsync("GET", "SYS_LEAVE_LIST");
|
var getWorkflow = await _permission.GetPermissionAPIWorkflowAsync(id.ToString(), "SYS_LEAVE_LIST");
|
||||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
if (getWorkflow == false)
|
||||||
if (jsonData["status"]?.ToString() != "200")
|
|
||||||
{
|
{
|
||||||
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
var getPermission = await _permission.GetPermissionAPIAsync("GET", "SYS_LEAVE_LIST");
|
||||||
|
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||||
|
if (jsonData["status"]?.ToString() != "200")
|
||||||
|
{
|
||||||
|
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var getWorkflow = await _permission.GetPermissionAPIWorkflowAsync(id.ToString(), "SYS_LEAVE_LIST_EMP");
|
||||||
|
if (getWorkflow == false)
|
||||||
|
{
|
||||||
|
var getPermission = await _permission.GetPermissionAPIAsync("GET", "SYS_LEAVE_LIST");
|
||||||
|
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||||
|
if (jsonData["status"]?.ToString() != "200")
|
||||||
|
{
|
||||||
|
return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
|
||||||
|
|
||||||
var rawData = await _leaveRequestRepository.GetByIdAsync(id);
|
|
||||||
|
|
||||||
var thisYear = DateTime.Now.Year;
|
var thisYear = DateTime.Now.Year;
|
||||||
|
|
||||||
if (rawData == null)
|
//var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(rawData.KeycloakUserId, AccessToken);
|
||||||
{
|
|
||||||
return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(rawData.KeycloakUserId, AccessToken);
|
//if (profile == null)
|
||||||
|
//{
|
||||||
|
// return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
|
||||||
|
//}
|
||||||
|
|
||||||
if (profile == null)
|
//var userCalendar = await _userCalendarRepository.GetExist(Guid.Parse(rawData.ProfileId));
|
||||||
{
|
//var category = userCalendar == null ? "NORMAL" : userCalendar.Calendar;
|
||||||
return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
var userCalendar = await _userCalendarRepository.GetExist(profile.Id);
|
//var lastSalary = profile.ProfileSalary;
|
||||||
var category = userCalendar == null ? "NORMAL" : userCalendar.Calendar;
|
//var lastSalaryAmount = lastSalary == null ? 0 : lastSalary.Amount ?? 0;
|
||||||
|
|
||||||
var lastSalary = profile.ProfileSalary;
|
|
||||||
var lastSalaryAmount = lastSalary == null ? 0 : lastSalary.Amount ?? 0;
|
|
||||||
|
|
||||||
var lastLeaveRequest =
|
var lastLeaveRequest =
|
||||||
await _leaveRequestRepository.GetLastLeaveRequestByTypeForUserAsync(rawData.KeycloakUserId,
|
await _leaveRequestRepository.GetLastLeaveRequestByTypeForUserAsync(rawData.KeycloakUserId,
|
||||||
rawData.Type.Id);
|
rawData.Type.Id);
|
||||||
|
|
||||||
var rootOc = _userProfileRepository.GetRootOcId(profile.OcId ?? Guid.Empty, AccessToken);
|
//var rootOc = _userProfileRepository.GetRootOcId(profile.OcId ?? Guid.Empty, AccessToken);
|
||||||
var approver = string.Empty;
|
//var approver = string.Empty;
|
||||||
if (rootOc != null)
|
//if (rootOc != null)
|
||||||
{
|
//{
|
||||||
var list = await _commandRepository.GetOrgApproverAsync(rootOc ?? Guid.Empty);
|
//var list = await _commandRepository.GetOrgApproverAsync(rootOc ?? Guid.Empty);
|
||||||
if (list.Count > 0)
|
//if (list.Count > 0)
|
||||||
approver = list.First().Name;
|
//approver = list.First().Name;
|
||||||
}
|
//}
|
||||||
|
|
||||||
var leaveSummary = await _leaveRequestRepository.GetSumApproveLeaveByTypeForUserAsync(rawData.KeycloakUserId, rawData.Type.Id, thisYear);
|
var leaveSummary = await _leaveRequestRepository.GetSumApproveLeaveByTypeForUserAsync(rawData.KeycloakUserId, rawData.Type.Id, thisYear);
|
||||||
|
|
||||||
var sumLeave = rawData.LeaveStartDate.DiffDay(rawData.LeaveEndDate);
|
//var sumLeave = rawData.LeaveStartDate.DiffDay(rawData.LeaveEndDate);
|
||||||
var sumHoliday = await _holidayRepository.GetHolidayCountAsync(rawData.LeaveStartDate, rawData.LeaveEndDate, category);
|
//var sumHoliday = await _holidayRepository.GetHolidayCountAsync(rawData.LeaveStartDate, rawData.LeaveEndDate, category);
|
||||||
var sumWeekend = _holidayRepository.GetWeekEndCount(rawData.LeaveStartDate, rawData.LeaveEndDate, category);
|
//var sumWeekend = _holidayRepository.GetWeekEndCount(rawData.LeaveStartDate, rawData.LeaveEndDate, category);
|
||||||
|
|
||||||
var result = new GetLeaveRequestForAdminByIdDto
|
var result = new GetLeaveRequestForAdminByIdDto
|
||||||
{
|
{
|
||||||
Id = rawData.Id,
|
Id = rawData.Id,
|
||||||
ReasonCommander = rawData.LeaveComment ?? "",
|
ReasonCommander = rawData.LeaveComment ?? "",
|
||||||
ReasonOligarch = rawData.LeaveDirectorComment ?? "",
|
ReasonOligarch = rawData.LeaveDirectorComment ?? "",
|
||||||
|
ProfileType = rawData.ProfileType,
|
||||||
LeaveTypeName = rawData.Type.Name,
|
LeaveTypeName = rawData.Type.Name,
|
||||||
LeaveTypeId = rawData.Type.Id,
|
LeaveTypeId = rawData.Type.Id,
|
||||||
FullName = $"{rawData.Prefix}{rawData.FirstName} {rawData.LastName}",
|
FullName = $"{rawData.Prefix}{rawData.FirstName} {rawData.LastName}",
|
||||||
|
|
@ -1682,11 +1716,11 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
//LeaveTotal = rawData.LeaveStartDate.DiffDay(rawData.LeaveEndDate),
|
//LeaveTotal = rawData.LeaveStartDate.DiffDay(rawData.LeaveEndDate),
|
||||||
LeaveTotal = rawData.LeaveTotal,
|
LeaveTotal = rawData.LeaveTotal,
|
||||||
|
|
||||||
LeaveBirthDate = profile.BirthDate,
|
LeaveBirthDate = rawData.BirthDate == null ? null : rawData.BirthDate.Value,
|
||||||
LeaveGovernmentDate = profile.DateAppoint == null ? null : profile.DateAppoint.Value,
|
LeaveGovernmentDate = rawData.DateAppoint == null ? null : rawData.DateAppoint.Value,
|
||||||
|
|
||||||
LeaveSalary = lastSalary == null ? 0 : lastSalaryAmount,
|
LeaveSalary = (double)(rawData.Amount == null ? 0 : rawData.Amount),
|
||||||
LeaveSalaryText = lastSalary == null ? "" : ((int)lastSalaryAmount).ToThaiBahtText(false),
|
LeaveSalaryText = rawData.Amount == null ? "" : ((int)rawData.Amount).ToThaiBahtText(false),
|
||||||
|
|
||||||
WifeDayName = rawData.WifeDayName,
|
WifeDayName = rawData.WifeDayName,
|
||||||
WifeDayDateBorn = rawData.WifeDayDateBorn,
|
WifeDayDateBorn = rawData.WifeDayDateBorn,
|
||||||
|
|
|
||||||
|
|
@ -133,5 +133,6 @@ namespace BMA.EHR.Leave.Service.DTOs.LeaveRequest
|
||||||
public double LeaveRemain { get; set; } = 0;
|
public double LeaveRemain { get; set; } = 0;
|
||||||
|
|
||||||
public string LeaveRange { get; set; } = string.Empty;
|
public string LeaveRange { get; set; } = string.Empty;
|
||||||
|
public string? ProfileType { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
public DateTime? DateAppoint { get; set; }
|
public DateTime? DateAppoint { get; set; }
|
||||||
|
|
||||||
public int Salary { get; set; }
|
public double Salary { get; set; }
|
||||||
|
|
||||||
public string SalaryText { get; set; }
|
public string SalaryText { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -991,7 +991,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
var _res = await client.PostAsJsonAsync($"{_configuration["API"]}/org/workflow/add-workflow", new
|
var _res = await client.PostAsJsonAsync($"{_configuration["API"]}/org/workflow/add-workflow", new
|
||||||
{
|
{
|
||||||
refId = retirementResign.Id,
|
refId = retirementResign.Id,
|
||||||
sysName = "SYS_RETIREMENT",
|
sysName = "SYS_RESIGN",
|
||||||
posLevelName = retirementResign.PositionLevelOld,
|
posLevelName = retirementResign.PositionLevelOld,
|
||||||
posTypeName = retirementResign.PositionTypeOld,
|
posTypeName = retirementResign.PositionTypeOld,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
[HttpGet()]
|
[HttpGet()]
|
||||||
public async Task<ActionResult<ResponseObject>> GetListByAdmin(string type)
|
public async Task<ActionResult<ResponseObject>> GetListByAdmin(string type)
|
||||||
{
|
{
|
||||||
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_RESIGN");
|
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_RESIGN_EMP");
|
||||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||||
if (jsonData["status"]?.ToString() != "200")
|
if (jsonData["status"]?.ToString() != "200")
|
||||||
{
|
{
|
||||||
|
|
@ -215,7 +215,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
[HttpGet("cancel")]
|
[HttpGet("cancel")]
|
||||||
public async Task<ActionResult<ResponseObject>> GetListByAdminCancel(string type)
|
public async Task<ActionResult<ResponseObject>> GetListByAdminCancel(string type)
|
||||||
{
|
{
|
||||||
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_RESIGN");
|
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_RESIGN_EMP");
|
||||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||||
if (jsonData["status"]?.ToString() != "200")
|
if (jsonData["status"]?.ToString() != "200")
|
||||||
{
|
{
|
||||||
|
|
@ -279,14 +279,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
|
|
||||||
if (dataMain.IsCancel != true)
|
if (dataMain.IsCancel != true)
|
||||||
{
|
{
|
||||||
var getWorkflow = await _permission.GetPermissionAPIWorkflowAsync(id.ToString(), "SYS_RESIGN");
|
var getWorkflow = await _permission.GetPermissionAPIWorkflowAsync(id.ToString(), "SYS_RESIGN_EMP");
|
||||||
var createdUserId = await _context.RetirementResignEmployees.AsQueryable()
|
var createdUserId = await _context.RetirementResignEmployees.AsQueryable()
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.Where(x => x.CreatedUserId == UserId)
|
.Where(x => x.CreatedUserId == UserId)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (getWorkflow == false && createdUserId == null)
|
if (getWorkflow == false && createdUserId == null)
|
||||||
{
|
{
|
||||||
var getPermission = await _permission.GetPermissionAPIAsync("GET", "SYS_RESIGN");
|
var getPermission = await _permission.GetPermissionAPIAsync("GET", "SYS_RESIGN_EMP");
|
||||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||||
if (jsonData["status"]?.ToString() != "200")
|
if (jsonData["status"]?.ToString() != "200")
|
||||||
{
|
{
|
||||||
|
|
@ -457,14 +457,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var getWorkflow = await _permission.GetPermissionAPIWorkflowAsync(id.ToString(), "RETIREMENT_CANCEL");
|
var getWorkflow = await _permission.GetPermissionAPIWorkflowAsync(id.ToString(), "RETIREMENT_CANCEL_EMP");
|
||||||
var createdUserId = await _context.RetirementResignEmployeeCancels.AsQueryable()
|
var createdUserId = await _context.RetirementResignEmployeeCancels.AsQueryable()
|
||||||
.Where(x => x.CreatedUserId == UserId)
|
.Where(x => x.CreatedUserId == UserId)
|
||||||
.Where(x => x.Id == id)
|
.Where(x => x.Id == id)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (getWorkflow == false && createdUserId == null)
|
if (getWorkflow == false && createdUserId == null)
|
||||||
{
|
{
|
||||||
var getPermission = await _permission.GetPermissionAPIAsync("GET", "SYS_RESIGN");
|
var getPermission = await _permission.GetPermissionAPIAsync("GET", "SYS_RESIGN_EMP");
|
||||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||||
if (jsonData["status"]?.ToString() != "200")
|
if (jsonData["status"]?.ToString() != "200")
|
||||||
{
|
{
|
||||||
|
|
@ -634,13 +634,13 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
[HttpGet("cancel/{id:length(36)}")]
|
[HttpGet("cancel/{id:length(36)}")]
|
||||||
public async Task<ActionResult<ResponseObject>> GetDetailByUserCancel(Guid id)
|
public async Task<ActionResult<ResponseObject>> GetDetailByUserCancel(Guid id)
|
||||||
{
|
{
|
||||||
var getWorkflow = await _permission.GetPermissionAPIWorkflowAsync(id.ToString(), "RETIREMENT_CANCEL");
|
var getWorkflow = await _permission.GetPermissionAPIWorkflowAsync(id.ToString(), "RETIREMENT_CANCEL_EMP");
|
||||||
var createdUserId = await _context.RetirementResignEmployeeCancels.AsQueryable()
|
var createdUserId = await _context.RetirementResignEmployeeCancels.AsQueryable()
|
||||||
.Where(x => x.CreatedUserId == UserId)
|
.Where(x => x.CreatedUserId == UserId)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (getWorkflow == false && createdUserId == null)
|
if (getWorkflow == false && createdUserId == null)
|
||||||
{
|
{
|
||||||
var getPermission = await _permission.GetPermissionAPIAsync("GET", "SYS_RESIGN");
|
var getPermission = await _permission.GetPermissionAPIAsync("GET", "SYS_RESIGN_EMP");
|
||||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||||
if (jsonData["status"]?.ToString() != "200")
|
if (jsonData["status"]?.ToString() != "200")
|
||||||
{
|
{
|
||||||
|
|
@ -935,7 +935,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
var _res = await client.PostAsJsonAsync($"{_configuration["API"]}/org/workflow/add-workflow", new
|
var _res = await client.PostAsJsonAsync($"{_configuration["API"]}/org/workflow/add-workflow", new
|
||||||
{
|
{
|
||||||
refId = retirementResignEmployee.Id,
|
refId = retirementResignEmployee.Id,
|
||||||
sysName = "SYS_RETIREMENT",
|
sysName = "SYS_RESIGN_EMP",
|
||||||
posLevelName = retirementResignEmployee.PositionLevelOld,
|
posLevelName = retirementResignEmployee.PositionLevelOld,
|
||||||
posTypeName = retirementResignEmployee.PositionTypeOld,
|
posTypeName = retirementResignEmployee.PositionTypeOld,
|
||||||
});
|
});
|
||||||
|
|
@ -1182,7 +1182,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
var _res = await client.PostAsJsonAsync($"{_configuration["API"]}/org/workflow/add-workflow", new
|
var _res = await client.PostAsJsonAsync($"{_configuration["API"]}/org/workflow/add-workflow", new
|
||||||
{
|
{
|
||||||
refId = retirementResignEmployeeCancel.Id,
|
refId = retirementResignEmployeeCancel.Id,
|
||||||
sysName = "RETIREMENT_CANCEL",
|
sysName = "RETIREMENT_CANCEL_EMP",
|
||||||
posLevelName = retirementResignEmployeeCancel.PositionLevelOld,
|
posLevelName = retirementResignEmployeeCancel.PositionLevelOld,
|
||||||
posTypeName = retirementResignEmployeeCancel.PositionTypeOld,
|
posTypeName = retirementResignEmployeeCancel.PositionTypeOld,
|
||||||
});
|
});
|
||||||
|
|
@ -1663,7 +1663,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
||||||
[HttpPost("report")]
|
[HttpPost("report")]
|
||||||
public async Task<ActionResult<ResponseObject>> PostToReport([FromBody] RetirementProfileRequest req)
|
public async Task<ActionResult<ResponseObject>> PostToReport([FromBody] RetirementProfileRequest req)
|
||||||
{
|
{
|
||||||
var getPermission = await _permission.GetPermissionAPIAsync("CREATE", "SYS_RESIGN");
|
var getPermission = await _permission.GetPermissionAPIAsync("CREATE", "SYS_RESIGN_EMP");
|
||||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||||
if (jsonData["status"]?.ToString() != "200")
|
if (jsonData["status"]?.ToString() != "200")
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue