แก้ ลาออกลูกจ้าง
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? 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 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()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<double?>("Amount")
|
||||
.HasColumnType("double");
|
||||
|
||||
b.Property<string>("ApproveStep")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("step การอนุมัติ st1 = จทน.อนุมัตื,st2 = ผู้บังคับบัญชา อนุมัติ ");
|
||||
|
||||
b.Property<DateTime?>("BirthDate")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("CancelLeaveWrote")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("เขียนที่ (ขอยกเลิก)");
|
||||
|
|
@ -282,6 +288,9 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
|||
.HasColumnOrder(101)
|
||||
.HasComment("User Id ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<DateTime?>("DateAppoint")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("Dear")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("เรียนใคร");
|
||||
|
|
@ -440,6 +449,12 @@ namespace BMA.EHR.Infrastructure.Migrations.LeaveDb
|
|||
b.Property<string>("Prefix")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<Guid?>("ProfileId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("ProfileType")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<double>("RestDayCurrentTotal")
|
||||
.HasColumnType("double");
|
||||
|
||||
|
|
|
|||
|
|
@ -140,8 +140,8 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
|
||||
}
|
||||
|
||||
var userCalendar = await _userCalendarRepository.GetExist(profile.Id);
|
||||
var category = userCalendar == null ? "NORMAL" : userCalendar.Calendar;
|
||||
//var userCalendar = await _userCalendarRepository.GetExist(profile.Id);
|
||||
//var category = userCalendar == null ? "NORMAL" : userCalendar.Calendar;
|
||||
|
||||
var leaveType = await _leaveTypeRepository.GetByIdAsync(req.Type);
|
||||
if (leaveType == null)
|
||||
|
|
@ -149,9 +149,9 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
|
||||
}
|
||||
|
||||
var sumLeave = req.LeaveStartDate.DiffDay(req.LeaveEndDate);
|
||||
var sumHoliday = await _holidayRepository.GetHolidayCountAsync(req.LeaveStartDate, req.LeaveEndDate, category);
|
||||
var sumWeekend = _holidayRepository.GetWeekEndCount(req.LeaveStartDate, req.LeaveEndDate, category);
|
||||
//var sumLeave = req.LeaveStartDate.DiffDay(req.LeaveEndDate);
|
||||
//var sumHoliday = await _holidayRepository.GetHolidayCountAsync(req.LeaveStartDate, req.LeaveEndDate, category);
|
||||
//var sumWeekend = _holidayRepository.GetWeekEndCount(req.LeaveStartDate, req.LeaveEndDate, category);
|
||||
|
||||
// var leaveTotal = 0.0;
|
||||
// if (req.LeaveRange != "ALL")
|
||||
|
|
@ -195,6 +195,12 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
Child2 = profile.Child2,
|
||||
Child3 = profile.Child3,
|
||||
Child4 = profile.Child4,
|
||||
|
||||
ProfileId = profile.Id,
|
||||
ProfileType = profile.ProfileType,
|
||||
Amount = profile.Amount,
|
||||
BirthDate = profile.BirthDate,
|
||||
DateAppoint = profile.DateAppoint,
|
||||
};
|
||||
|
||||
// get leave last
|
||||
|
|
@ -1543,17 +1549,35 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
}
|
||||
var baseAPIOrg = _configuration["API"];
|
||||
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 ", ""));
|
||||
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
||||
var _res = await client.PostAsJsonAsync(apiUrlOrg, new
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
refId = id,
|
||||
sysName = "SYS_LEAVE_LIST",
|
||||
posLevelName = profile.PosLevel?.PosLevelName ?? "",
|
||||
posTypeName = profile.PosType?.PosTypeName ?? "",
|
||||
});
|
||||
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",
|
||||
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();
|
||||
|
|
@ -1599,66 +1623,76 @@ namespace BMA.EHR.Leave.Service.Controllers
|
|||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> GetLeaveRequestForAdminByIdAsync(Guid id)
|
||||
{
|
||||
var getWorkflow = await _permission.GetPermissionAPIWorkflowAsync(id.ToString(), "SYS_LEAVE_LIST");
|
||||
if (getWorkflow == false)
|
||||
var rawData = await _leaveRequestRepository.GetByIdAsync(id);
|
||||
if (rawData == null)
|
||||
return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
|
||||
|
||||
if (rawData.ProfileType =="OFFICER")
|
||||
{
|
||||
var getPermission = await _permission.GetPermissionAPIAsync("GET", "SYS_LEAVE_LIST");
|
||||
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
|
||||
if (jsonData["status"]?.ToString() != "200")
|
||||
var getWorkflow = await _permission.GetPermissionAPIWorkflowAsync(id.ToString(), "SYS_LEAVE_LIST");
|
||||
if (getWorkflow == false)
|
||||
{
|
||||
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;
|
||||
|
||||
if (rawData == null)
|
||||
{
|
||||
return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
|
||||
}
|
||||
//var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(rawData.KeycloakUserId, AccessToken);
|
||||
|
||||
var profile = await _userProfileRepository.GetProfileByKeycloakIdAsync(rawData.KeycloakUserId, AccessToken);
|
||||
//if (profile == null)
|
||||
//{
|
||||
// return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
|
||||
//}
|
||||
|
||||
if (profile == null)
|
||||
{
|
||||
return Error(GlobalMessages.DataNotFound, StatusCodes.Status404NotFound);
|
||||
}
|
||||
//var userCalendar = await _userCalendarRepository.GetExist(Guid.Parse(rawData.ProfileId));
|
||||
//var category = userCalendar == null ? "NORMAL" : userCalendar.Calendar;
|
||||
|
||||
var userCalendar = await _userCalendarRepository.GetExist(profile.Id);
|
||||
var category = userCalendar == null ? "NORMAL" : userCalendar.Calendar;
|
||||
|
||||
var lastSalary = profile.ProfileSalary;
|
||||
var lastSalaryAmount = lastSalary == null ? 0 : lastSalary.Amount ?? 0;
|
||||
//var lastSalary = profile.ProfileSalary;
|
||||
//var lastSalaryAmount = lastSalary == null ? 0 : lastSalary.Amount ?? 0;
|
||||
|
||||
var lastLeaveRequest =
|
||||
await _leaveRequestRepository.GetLastLeaveRequestByTypeForUserAsync(rawData.KeycloakUserId,
|
||||
rawData.Type.Id);
|
||||
|
||||
var rootOc = _userProfileRepository.GetRootOcId(profile.OcId ?? Guid.Empty, AccessToken);
|
||||
var approver = string.Empty;
|
||||
if (rootOc != null)
|
||||
{
|
||||
var list = await _commandRepository.GetOrgApproverAsync(rootOc ?? Guid.Empty);
|
||||
if (list.Count > 0)
|
||||
approver = list.First().Name;
|
||||
}
|
||||
//var rootOc = _userProfileRepository.GetRootOcId(profile.OcId ?? Guid.Empty, AccessToken);
|
||||
//var approver = string.Empty;
|
||||
//if (rootOc != null)
|
||||
//{
|
||||
//var list = await _commandRepository.GetOrgApproverAsync(rootOc ?? Guid.Empty);
|
||||
//if (list.Count > 0)
|
||||
//approver = list.First().Name;
|
||||
//}
|
||||
|
||||
var leaveSummary = await _leaveRequestRepository.GetSumApproveLeaveByTypeForUserAsync(rawData.KeycloakUserId, rawData.Type.Id, thisYear);
|
||||
|
||||
var sumLeave = rawData.LeaveStartDate.DiffDay(rawData.LeaveEndDate);
|
||||
var sumHoliday = await _holidayRepository.GetHolidayCountAsync(rawData.LeaveStartDate, rawData.LeaveEndDate, category);
|
||||
var sumWeekend = _holidayRepository.GetWeekEndCount(rawData.LeaveStartDate, rawData.LeaveEndDate, category);
|
||||
//var sumLeave = rawData.LeaveStartDate.DiffDay(rawData.LeaveEndDate);
|
||||
//var sumHoliday = await _holidayRepository.GetHolidayCountAsync(rawData.LeaveStartDate, rawData.LeaveEndDate, category);
|
||||
//var sumWeekend = _holidayRepository.GetWeekEndCount(rawData.LeaveStartDate, rawData.LeaveEndDate, category);
|
||||
|
||||
var result = new GetLeaveRequestForAdminByIdDto
|
||||
{
|
||||
Id = rawData.Id,
|
||||
ReasonCommander = rawData.LeaveComment ?? "",
|
||||
ReasonOligarch = rawData.LeaveDirectorComment ?? "",
|
||||
|
||||
ProfileType = rawData.ProfileType,
|
||||
LeaveTypeName = rawData.Type.Name,
|
||||
LeaveTypeId = rawData.Type.Id,
|
||||
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.LeaveTotal,
|
||||
|
||||
LeaveBirthDate = profile.BirthDate,
|
||||
LeaveGovernmentDate = profile.DateAppoint == null ? null : profile.DateAppoint.Value,
|
||||
LeaveBirthDate = rawData.BirthDate == null ? null : rawData.BirthDate.Value,
|
||||
LeaveGovernmentDate = rawData.DateAppoint == null ? null : rawData.DateAppoint.Value,
|
||||
|
||||
LeaveSalary = lastSalary == null ? 0 : lastSalaryAmount,
|
||||
LeaveSalaryText = lastSalary == null ? "" : ((int)lastSalaryAmount).ToThaiBahtText(false),
|
||||
LeaveSalary = (double)(rawData.Amount == null ? 0 : rawData.Amount),
|
||||
LeaveSalaryText = rawData.Amount == null ? "" : ((int)rawData.Amount).ToThaiBahtText(false),
|
||||
|
||||
WifeDayName = rawData.WifeDayName,
|
||||
WifeDayDateBorn = rawData.WifeDayDateBorn,
|
||||
|
|
|
|||
|
|
@ -133,5 +133,6 @@ namespace BMA.EHR.Leave.Service.DTOs.LeaveRequest
|
|||
public double LeaveRemain { get; set; } = 0;
|
||||
|
||||
public string LeaveRange { get; set; } = string.Empty;
|
||||
public string? ProfileType { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
public DateTime? DateAppoint { get; set; }
|
||||
|
||||
public int Salary { get; set; }
|
||||
public double Salary { 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
|
||||
{
|
||||
refId = retirementResign.Id,
|
||||
sysName = "SYS_RETIREMENT",
|
||||
sysName = "SYS_RESIGN",
|
||||
posLevelName = retirementResign.PositionLevelOld,
|
||||
posTypeName = retirementResign.PositionTypeOld,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
[HttpGet()]
|
||||
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);
|
||||
if (jsonData["status"]?.ToString() != "200")
|
||||
{
|
||||
|
|
@ -215,7 +215,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
[HttpGet("cancel")]
|
||||
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);
|
||||
if (jsonData["status"]?.ToString() != "200")
|
||||
{
|
||||
|
|
@ -279,14 +279,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
|
||||
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()
|
||||
.Where(x => x.Id == id)
|
||||
.Where(x => x.CreatedUserId == UserId)
|
||||
.FirstOrDefaultAsync();
|
||||
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);
|
||||
if (jsonData["status"]?.ToString() != "200")
|
||||
{
|
||||
|
|
@ -457,14 +457,14 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
}
|
||||
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()
|
||||
.Where(x => x.CreatedUserId == UserId)
|
||||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
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);
|
||||
if (jsonData["status"]?.ToString() != "200")
|
||||
{
|
||||
|
|
@ -634,13 +634,13 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
[HttpGet("cancel/{id:length(36)}")]
|
||||
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()
|
||||
.Where(x => x.CreatedUserId == UserId)
|
||||
.FirstOrDefaultAsync();
|
||||
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);
|
||||
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
|
||||
{
|
||||
refId = retirementResignEmployee.Id,
|
||||
sysName = "SYS_RETIREMENT",
|
||||
sysName = "SYS_RESIGN_EMP",
|
||||
posLevelName = retirementResignEmployee.PositionLevelOld,
|
||||
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
|
||||
{
|
||||
refId = retirementResignEmployeeCancel.Id,
|
||||
sysName = "RETIREMENT_CANCEL",
|
||||
sysName = "RETIREMENT_CANCEL_EMP",
|
||||
posLevelName = retirementResignEmployeeCancel.PositionLevelOld,
|
||||
posTypeName = retirementResignEmployeeCancel.PositionTypeOld,
|
||||
});
|
||||
|
|
@ -1663,7 +1663,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
|
|||
[HttpPost("report")]
|
||||
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);
|
||||
if (jsonData["status"]?.ToString() != "200")
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue