fix : เครื่องราชย์ เก็บข้อมูลจากทะเบียนประวัติลง Field **** ยังไม่ได้ run migrate ****
This commit is contained in:
parent
0b13d5ccf2
commit
d858010414
5 changed files with 5878 additions and 4398 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -6,28 +6,46 @@ namespace BMA.EHR.Application.Requests
|
||||||
{
|
{
|
||||||
public Guid ProfileId { get; set; }
|
public Guid ProfileId { get; set; }
|
||||||
|
|
||||||
public string Prefix { get; set; }
|
public string CitizenId { get; set; } = String.Empty;
|
||||||
|
|
||||||
public string FullName { get; set; }
|
public string Prefix { get; set; } = String.Empty;
|
||||||
|
|
||||||
|
public string FirstName { get; set; } = String.Empty;
|
||||||
|
|
||||||
|
public string LastName { get; set; } = String.Empty;
|
||||||
|
|
||||||
|
public DateTime? BirthDate { get; set; }
|
||||||
|
|
||||||
|
public DateTime? DateAppoint { get; set; }
|
||||||
|
|
||||||
|
public string? ProfileType { get; set; }
|
||||||
|
|
||||||
|
public string? PosTypeName { get; set; }
|
||||||
|
|
||||||
|
public string? PosLevelName { get; set; }
|
||||||
|
|
||||||
public string Position { get; set; }
|
public string FullName { get; set; } = String.Empty;
|
||||||
|
|
||||||
public string Rank { get; set; }
|
public string Position { get; set; } = String.Empty;
|
||||||
|
|
||||||
public string GovAge { get; set; }
|
public string Rank { get; set; } = String.Empty;
|
||||||
|
|
||||||
|
public string GovAge { get; set; } = String.Empty;
|
||||||
|
|
||||||
public double? Salary { get; set; }
|
public double? Salary { get; set; }
|
||||||
|
|
||||||
|
public double? PositionSalary { get; set; }
|
||||||
|
|
||||||
public string LastInsignia { get; set; }
|
public string LastInsignia { get; set; } = String.Empty;
|
||||||
public Guid? LastInsigniaId { get; set; }
|
public Guid? LastInsigniaId { get; set; }
|
||||||
|
|
||||||
//public Guid PosNo { get; set; }
|
//public Guid PosNo { get; set; }
|
||||||
|
|
||||||
public string PosNo { get; set; }
|
public string PosNo { get; set; } = String.Empty;
|
||||||
|
|
||||||
public InsigniaItem RequestInsignia { get; set; }
|
public InsigniaItem RequestInsignia { get; set; } = new();
|
||||||
|
|
||||||
public string Gender { get; set; }
|
public string Gender { get; set; } = String.Empty;
|
||||||
|
|
||||||
public int Seq { get; set; }
|
public int Seq { get; set; }
|
||||||
|
|
||||||
|
|
@ -40,4 +58,4 @@ namespace BMA.EHR.Application.Requests
|
||||||
|
|
||||||
public string Result { get; set; } = "";
|
public string Result { get; set; } = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -71,5 +71,7 @@ namespace BMA.EHR.Domain.Models.Insignias
|
||||||
public string? PosNo { get; set; }
|
public string? PosNo { get; set; }
|
||||||
public double? Amount { get; set; }
|
public double? Amount { get; set; }
|
||||||
public double? PositionSalaryAmount { get; set; }
|
public double? PositionSalaryAmount { get; set; }
|
||||||
|
|
||||||
|
public string? LastInsigniaName { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,49 +1,50 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<UserSecretsId>93677512-b64b-4a19-9e7d-dd283c7ec901</UserSecretsId>
|
<UserSecretsId>93677512-b64b-4a19-9e7d-dd283c7ec901</UserSecretsId>
|
||||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||||
<DockerfileContext>.</DockerfileContext>
|
<DockerfileContext>.</DockerfileContext>
|
||||||
<RootNamespace>BMA.EHR.Insignia.Service</RootNamespace>
|
<RootNamespace>BMA.EHR.Insignia.Service</RootNamespace>
|
||||||
</PropertyGroup>
|
<AssemblyName>BMA.EHR.Insignia</AssemblyName>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Hangfire" Version="1.8.5" />
|
<PackageReference Include="Hangfire" Version="1.8.5"/>
|
||||||
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.5" />
|
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.5"/>
|
||||||
<PackageReference Include="Hangfire.MySqlStorage" Version="2.0.3" />
|
<PackageReference Include="Hangfire.MySqlStorage" Version="2.0.3"/>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.9" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.9"/>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.9" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.9"/>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="5.1.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="5.1.0"/>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="5.1.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="5.1.0"/>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.9" />
|
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.9"/>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.9">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.9">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.IdentityModel.Logging" Version="6.32.0" />
|
<PackageReference Include="Microsoft.IdentityModel.Logging" Version="6.32.0"/>
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.18.1" />
|
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.18.1"/>
|
||||||
<PackageReference Include="runtime.osx.10.10-x64.CoreCompat.System.Drawing" Version="6.0.5.128" />
|
<PackageReference Include="runtime.osx.10.10-x64.CoreCompat.System.Drawing" Version="6.0.5.128"/>
|
||||||
<PackageReference Include="Serilog.AspNetCore" Version="7.0.0" />
|
<PackageReference Include="Serilog.AspNetCore" Version="7.0.0"/>
|
||||||
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
|
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0"/>
|
||||||
<PackageReference Include="Sentry.AspNetCore" Version="3.33.1" />
|
<PackageReference Include="Sentry.AspNetCore" Version="3.33.1"/>
|
||||||
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.2.0" />
|
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.2.0"/>
|
||||||
<PackageReference Include="Serilog.Exceptions" Version="8.4.0" />
|
<PackageReference Include="Serilog.Exceptions" Version="8.4.0"/>
|
||||||
<PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" />
|
<PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0"/>
|
||||||
<PackageReference Include="Serilog.Sinks.Elasticsearch" Version="9.0.3" />
|
<PackageReference Include="Serilog.Sinks.Elasticsearch" Version="9.0.3"/>
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.5.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.5.0"/>
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\BMA.EHR.Infrastructure\BMA.EHR.Infrastructure.csproj" />
|
<ProjectReference Include="..\BMA.EHR.Infrastructure\BMA.EHR.Infrastructure.csproj"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Update="Templates/PersonInsignia.xlsx">
|
<None Update="Templates/PersonInsignia.xlsx">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,19 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
isApprove = irp.IsApprove,
|
isApprove = irp.IsApprove,
|
||||||
statusInstitute = irp.IsApprove.ToString(),
|
statusInstitute = irp.IsApprove.ToString(),
|
||||||
request_date = irp.RequestDate,
|
request_date = irp.RequestDate,
|
||||||
profile = _userProfileRepository.GetOfficerProfileById(irp.ProfileId, AccessToken),
|
|
||||||
|
profileId = irp.ProfileId,
|
||||||
|
citizenId = irp.CitizenId,
|
||||||
|
prefix = irp.Prefix,
|
||||||
|
firstname = irp.FirstName,
|
||||||
|
lastname = irp.LastName,
|
||||||
|
type = irp.ProfileType,
|
||||||
|
position = irp.Position,
|
||||||
|
posno = irp.PosNo,
|
||||||
|
rank = $"{irp.PosTypeName}/{irp.PosLevelName}",
|
||||||
|
lastInsigniaName = irp.LastInsigniaName,
|
||||||
|
|
||||||
|
//profile = _userProfileRepository.GetOfficerProfileById(irp.ProfileId, AccessToken),
|
||||||
instituteName = "",
|
instituteName = "",
|
||||||
instituteId = -1,
|
instituteId = -1,
|
||||||
requestInsigniaLevel = irp.RequestInsignia.InsigniaType.Name,
|
requestInsigniaLevel = irp.RequestInsignia.InsigniaType.Name,
|
||||||
|
|
@ -231,44 +243,45 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
requestSalary = irp.Salary,
|
requestSalary = irp.Salary,
|
||||||
matchingConditions = JsonConvert.DeserializeObject<List<MatchingCondition>>(irp.MatchingConditions)
|
matchingConditions = JsonConvert.DeserializeObject<List<MatchingCondition>>(irp.MatchingConditions)
|
||||||
})
|
})
|
||||||
|
.OrderBy(x => x.citizenId)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
var dataResult = rawData
|
// var dataResult = rawData
|
||||||
.Select(irp => new
|
// .Select(irp => new
|
||||||
{
|
// {
|
||||||
irp.request_id,
|
// irp.request_id,
|
||||||
irp.isApprove,
|
// irp.isApprove,
|
||||||
irp.statusInstitute,
|
// irp.statusInstitute,
|
||||||
irp.request_date,
|
// irp.request_date,
|
||||||
profileId = irp.profile == null ? Guid.Empty : irp.profile.Id,
|
// profileId = irp.profile == null ? Guid.Empty : irp.profile.Id,
|
||||||
citizenId = irp.profile == null ? "" : irp.profile.CitizenId,
|
// citizenId = irp.profile == null ? "" : irp.profile.CitizenId,
|
||||||
prefix = irp.profile == null ? "" : irp.profile.Prefix,
|
// prefix = irp.profile == null ? "" : irp.profile.Prefix,
|
||||||
firstname = irp.profile == null ? "" : irp.profile.FirstName,
|
// firstname = irp.profile == null ? "" : irp.profile.FirstName,
|
||||||
lastname = irp.profile == null ? "" : irp.profile.LastName,
|
// lastname = irp.profile == null ? "" : irp.profile.LastName,
|
||||||
type = irp.profile == null ? "" : irp.profile.ProfileType,
|
// type = irp.profile == null ? "" : irp.profile.ProfileType,
|
||||||
position = irp.profile == null ? "" : irp.profile.Position,
|
// position = irp.profile == null ? "" : irp.profile.Position,
|
||||||
posno = irp.profile == null ? "" :
|
// posno = irp.profile == null ? "" :
|
||||||
irp.profile.ProfileSalary == null || irp.profile.ProfileSalary.Count == 0 ? "" :
|
// irp.profile.ProfileSalary == null || irp.profile.ProfileSalary.Count == 0 ? "" :
|
||||||
irp.profile.ProfileSalary.OrderByDescending(x => x.Order).FirstOrDefault().PosNo,
|
// irp.profile.ProfileSalary.OrderByDescending(x => x.Order).FirstOrDefault().PosNo,
|
||||||
rank = irp.profile == null ? "" : $"{irp.profile.PosType.PosTypeName}/{irp.profile.PosLevel.PosLevelName}",
|
// rank = irp.profile == null ? "" : $"{irp.profile.PosType.PosTypeName}/{irp.profile.PosLevel.PosLevelName}",
|
||||||
irp.instituteName,
|
// irp.instituteName,
|
||||||
irp.instituteId,
|
// irp.instituteId,
|
||||||
lastInsigniaName = irp.profile == null ? "" :
|
// lastInsigniaName = irp.profile == null ? "" :
|
||||||
irp.profile.ProfileInsignia == null || irp.profile.ProfileInsignia.Count == 0 ? "" :
|
// irp.profile.ProfileInsignia == null || irp.profile.ProfileInsignia.Count == 0 ? "" :
|
||||||
_insigniaPeriodRepository.GetInsigniaById(irp.profile.ProfileInsignia.OrderByDescending(x => x.Year).FirstOrDefault().InsigniaId.Value) == null ? "" :
|
// _insigniaPeriodRepository.GetInsigniaById(irp.profile.ProfileInsignia.OrderByDescending(x => x.Year).FirstOrDefault().InsigniaId.Value) == null ? "" :
|
||||||
_insigniaPeriodRepository.GetInsigniaById(irp.profile.ProfileInsignia.OrderByDescending(x => x.Year).FirstOrDefault().InsigniaId.Value).Name,
|
// _insigniaPeriodRepository.GetInsigniaById(irp.profile.ProfileInsignia.OrderByDescending(x => x.Year).FirstOrDefault().InsigniaId.Value).Name,
|
||||||
irp.requestInsigniaLevel,
|
// irp.requestInsigniaLevel,
|
||||||
irp.requestInsigniaName,
|
// irp.requestInsigniaName,
|
||||||
irp.requestQua,
|
// irp.requestQua,
|
||||||
irp.requestDoc,
|
// irp.requestDoc,
|
||||||
irp.requestNote,
|
// irp.requestNote,
|
||||||
irp.requestSalary,
|
// irp.requestSalary,
|
||||||
irp.matchingConditions
|
// irp.matchingConditions
|
||||||
})
|
// })
|
||||||
.OrderBy(y => y.citizenId)
|
// .OrderBy(y => y.citizenId)
|
||||||
.ToList();
|
// .ToList();
|
||||||
|
|
||||||
return dataResult;
|
return rawData;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
@ -291,169 +304,7 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region " จัดทำรายชื่อครูที่มีสิทธิในการยืนขอเครื่องราชฯ "
|
#region " จัดทำรายชื่อครูที่มีสิทธิในการยืนขอเครื่องราชฯ "
|
||||||
|
|
||||||
// [HttpGet("old/{role}/{ocId:length(36)}")]
|
|
||||||
// public async Task<ActionResult<ResponseObject>> GetInsignaiRequest(Guid id, Guid ocId, string role)
|
|
||||||
// {
|
|
||||||
// var result = await _repository.GetInsigniaRequest(id, ocId);
|
|
||||||
// if (result != null)
|
|
||||||
// {
|
|
||||||
// Guid period = result.PeriodId;
|
|
||||||
// string periodName = result.Name;
|
|
||||||
// string requestStatus = result.RequestStatus;
|
|
||||||
// var resend = new InsigniaResults
|
|
||||||
// {
|
|
||||||
// PeriodId = period,
|
|
||||||
// Year = result.Year,
|
|
||||||
// Name = periodName,
|
|
||||||
// RequestStatus = requestStatus,
|
|
||||||
// OrganizationName = result.OrganizationName,
|
|
||||||
// Items = new List<dynamic>()
|
|
||||||
// };
|
|
||||||
// var candidate = await _repository.GetInsigniaCandidate(period, ocId);
|
|
||||||
|
|
||||||
// // ตรวจสอบว่ารายการอยู่ใน table insignia_request_new
|
|
||||||
// if (requestStatus == null)
|
|
||||||
// {
|
|
||||||
// // บันทึกรายชื่อ
|
|
||||||
// _repository.InsertCandidate(period, ocId, candidate);
|
|
||||||
// }
|
|
||||||
// if (role == "officer")
|
|
||||||
// {
|
|
||||||
// resend.Items = await _repository.InsigniaHasProfile(period, ocId);
|
|
||||||
// return Success(resend);
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// var passData = _context.InsigniaRequests.AsQueryable()
|
|
||||||
// .Include(x => x.Organization)
|
|
||||||
// .Include(x => x.RequestProfiles)
|
|
||||||
// .Where(x => x.Organization.Id == ocId)
|
|
||||||
// .Where(x => x.Period.Id == period)
|
|
||||||
// .Select(ir => new
|
|
||||||
// {
|
|
||||||
// requstID = ir.Id,
|
|
||||||
// requstStatus = ir.RequestStatus,
|
|
||||||
// requstStatusName = GetRequestlStatusText(ir.RequestStatus),
|
|
||||||
// fkInstituteId = -1,
|
|
||||||
// // fkDivisionId = ir.Organization.Id,
|
|
||||||
// // fkDivision = ir.Organization.Name,
|
|
||||||
// fkInstitute = "",
|
|
||||||
// fkPeriodId = ir.Period.Id,
|
|
||||||
// insigniaRequestHasProfile = ir.RequestProfiles.AsQueryable()
|
|
||||||
// .Include(x => x.Profile)
|
|
||||||
// .ThenInclude(x => x.Position)
|
|
||||||
// .Include(x => x.Profile)
|
|
||||||
// // .ThenInclude(x => x.PositionNumber)
|
|
||||||
// .Include(x => x.Profile)
|
|
||||||
// // .ThenInclude(x => x.AcademicStanding)
|
|
||||||
// .Include(x => x.RequestInsignia)
|
|
||||||
// .ThenInclude(x => x.InsigniaType)
|
|
||||||
// .Select(irp => new
|
|
||||||
// {
|
|
||||||
// request_id = irp.Request.Id,
|
|
||||||
// isApprove = irp.IsApprove,
|
|
||||||
// statusInstitute = irp.IsApprove.ToString(),
|
|
||||||
// request_date = irp.RequestDate,
|
|
||||||
// profileId = irp.Profile.Id,
|
|
||||||
// // prefix = irp.Profile.Prefix,
|
|
||||||
// firstname = irp.Profile.FirstName,
|
|
||||||
// lastname = irp.Profile.LastName,
|
|
||||||
// // posno = irp.Profile.PositionNumber.Id,
|
|
||||||
// type = irp.Profile.ProfileType,
|
|
||||||
// // position = irp.Profile.Position.Name,
|
|
||||||
// // rank = irp.Profile.AcademicStanding.Name,
|
|
||||||
// instituteName = "",
|
|
||||||
// instituteId = -1,
|
|
||||||
// // divisionName = irp.Profile.OrganizationOrganization.Name,
|
|
||||||
// // divisionId = irp.Profile.OrganizationOrganization.Id,
|
|
||||||
// lastInsigniaName = "",
|
|
||||||
// requestInsigniaLevel = irp.RequestInsignia.InsigniaType == null ? null : irp.RequestInsignia.InsigniaType.Name,
|
|
||||||
// requestInsigniaName = irp.RequestInsignia.Name,
|
|
||||||
// requestQua = irp.QualificationStatus,
|
|
||||||
// requestDoc = irp.DocumentStatus,
|
|
||||||
// requestNote = irp.Note,
|
|
||||||
// requestSalary = irp.Salary,
|
|
||||||
// })
|
|
||||||
// .Where(x => x.isApprove)
|
|
||||||
// .OrderBy(y => y.profileId)
|
|
||||||
// .ToList()
|
|
||||||
// })
|
|
||||||
// .ToList()
|
|
||||||
// .FirstOrDefault();
|
|
||||||
|
|
||||||
// var failData = _context.InsigniaRequests.AsQueryable()
|
|
||||||
// .Include(x => x.Organization)
|
|
||||||
// .Include(x => x.RequestProfiles)
|
|
||||||
// .Where(x => x.Organization.Id == ocId)
|
|
||||||
// .Where(x => x.Period.Id == period)
|
|
||||||
// .Select(ir => new
|
|
||||||
// {
|
|
||||||
// requstID = ir.Id,
|
|
||||||
// requstStatus = ir.RequestStatus,
|
|
||||||
// requstStatusName = GetRequestlStatusText(ir.RequestStatus),
|
|
||||||
// fkInstituteId = -1,
|
|
||||||
// // fkDivisionId = ir.Organization.Id,
|
|
||||||
// // fkDivision = ir.Organization.Name,
|
|
||||||
// fkInstitute = "",
|
|
||||||
// fkPeriodId = ir.Period.Id,
|
|
||||||
// insigniaRequestHasProfile = ir.RequestProfiles.AsQueryable()
|
|
||||||
// .Include(x => x.Profile)
|
|
||||||
// .ThenInclude(x => x.Position)
|
|
||||||
// .Include(x => x.Profile)
|
|
||||||
// // .ThenInclude(x => x.PositionNumber)
|
|
||||||
// .Include(x => x.Profile)
|
|
||||||
// // .ThenInclude(x => x.AcademicStanding)
|
|
||||||
// .Include(x => x.RequestInsignia)
|
|
||||||
// .ThenInclude(x => x.InsigniaType)
|
|
||||||
// .Select(irp => new
|
|
||||||
// {
|
|
||||||
// request_id = irp.Request.Id,
|
|
||||||
// isApprove = irp.IsApprove,
|
|
||||||
// statusInstitute = irp.IsApprove.ToString(),
|
|
||||||
// request_date = irp.RequestDate,
|
|
||||||
// profileId = irp.Profile.Id,
|
|
||||||
// // prefix = irp.Profile.Prefix,
|
|
||||||
// firstname = irp.Profile.FirstName,
|
|
||||||
// lastname = irp.Profile.LastName,
|
|
||||||
// // posno = irp.Profile.PositionNumber.Id,
|
|
||||||
// type = irp.Profile.ProfileType,
|
|
||||||
// // position = irp.Profile.Position.Name,
|
|
||||||
// // rank = irp.Profile.AcademicStanding.Name,
|
|
||||||
// instituteName = "",
|
|
||||||
// instituteId = -1,
|
|
||||||
// // divisionName = irp.Profile.OrganizationOrganization.Name,
|
|
||||||
// // divisionId = irp.Profile.OrganizationOrganization.Id,
|
|
||||||
// lastInsigniaName = "",
|
|
||||||
// requestInsigniaLevel = irp.RequestInsignia.InsigniaType == null ? null : irp.RequestInsignia.InsigniaType.Name,
|
|
||||||
// requestInsigniaName = irp.RequestInsignia.Name,
|
|
||||||
// requestQua = irp.QualificationStatus,
|
|
||||||
// requestDoc = irp.DocumentStatus,
|
|
||||||
// requestNote = irp.Note,
|
|
||||||
// requestSalary = irp.Salary,
|
|
||||||
// })
|
|
||||||
// .Where(x => !x.isApprove)
|
|
||||||
// .OrderBy(y => y.profileId)
|
|
||||||
// .ToList()
|
|
||||||
// })
|
|
||||||
// .ToList()
|
|
||||||
// .FirstOrDefault();
|
|
||||||
|
|
||||||
// var period_data = (from p in _context.InsigniaPeriods.AsQueryable()
|
|
||||||
// where p.Id == period
|
|
||||||
// select new
|
|
||||||
// {
|
|
||||||
// periodName = p.Name,
|
|
||||||
// periodYear = p.Year,
|
|
||||||
// }).FirstOrDefault();
|
|
||||||
|
|
||||||
// return Success(new { passData = passData, failData = failData, period = period_data });
|
|
||||||
// }
|
|
||||||
// // select data to display
|
|
||||||
// }
|
|
||||||
// return Success();
|
|
||||||
// }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// list รายการคำขอเครื่องราช ผู้ได้รับ,คนไม่ยื่น,คนที่ถูกลบ
|
/// list รายการคำขอเครื่องราช ผู้ได้รับ,คนไม่ยื่น,คนที่ถูกลบ
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -666,49 +517,48 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
[HttpGet("{insigniaPeriodId:length(36)}")]
|
[HttpGet("{insigniaPeriodId:length(36)}")]
|
||||||
public async Task<ActionResult<ResponseObject>> UpdateInsigniaRequestBkk(Guid insigniaPeriodId)
|
public async Task<ActionResult<ResponseObject>> UpdateInsigniaRequestBkk(Guid insigniaPeriodId)
|
||||||
{
|
{
|
||||||
// jack add เพื่อให้ทำการรันแค่เขตพระนคร
|
// // jack add เพื่อให้ทำการรันแค่เขตพระนคร
|
||||||
// TODO : ต้องมาเอาบรรทัดนี้ออกในภายหลัง
|
// // TODO : ต้องมาเอาบรรทัดนี้ออกในภายหลัง
|
||||||
var ocId = Guid.Parse("e8493cd1-d371-402e-add6-566e68d5d1b3");
|
// var ocId = Guid.Parse("e8493cd1-d371-402e-add6-566e68d5d1b3");
|
||||||
var result = await _repository.GetInsigniaRequest(insigniaPeriodId, ocId);
|
// var result = await _repository.GetInsigniaRequest(insigniaPeriodId, ocId);
|
||||||
if (result != null)
|
// if (result != null)
|
||||||
{
|
// {
|
||||||
Guid period = result.PeriodId;
|
// Guid period = result.PeriodId;
|
||||||
string requestStatus = result.RequestStatus;
|
// string requestStatus = result.RequestStatus;
|
||||||
var candidate = await _repository.GetInsigniaCandidateBKK(insigniaPeriodId, ocId);
|
// var candidate = await _repository.GetInsigniaCandidateBKK(insigniaPeriodId, ocId);
|
||||||
// ตรวจสอบว่ารายการอยู่ใน table insignia_request_new
|
// // ตรวจสอบว่ารายการอยู่ใน table insignia_request_new
|
||||||
if (requestStatus == null)
|
// if (requestStatus == null)
|
||||||
{
|
// {
|
||||||
// บันทึกรายชื่อ
|
// // บันทึกรายชื่อ
|
||||||
await _repository.InsertCandidate(period, ocId, candidate);
|
// await _repository.InsertCandidate(period, ocId, candidate);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// TODO: original code use this in production
|
// TODO: original code use this in production
|
||||||
|
|
||||||
//var organizations = await _userProfileRepository.GetActiveRootAsync(AccessToken);
|
var organizations = await _userProfileRepository.GetActiveRootAsync(AccessToken);
|
||||||
|
|
||||||
//foreach (var organization in organizations)
|
foreach (var organization in organizations)
|
||||||
//{
|
{
|
||||||
// if (organization == null)
|
if (organization == null)
|
||||||
// continue;
|
continue;
|
||||||
|
|
||||||
|
//if(organization.Id != Guid.Parse("e8493cd1-d371-402e-add6-566e68d5d1b3")) continue;
|
||||||
|
|
||||||
|
var result = await _repository.GetInsigniaRequest(insigniaPeriodId, organization.Id);
|
||||||
// if(organization.Id != Guid.Parse("e8493cd1-d371-402e-add6-566e68d5d1b3")) continue;
|
if (result != null)
|
||||||
|
{
|
||||||
// var result = await _repository.GetInsigniaRequest(insigniaPeriodId, organization.Id);
|
Guid period = result.PeriodId;
|
||||||
// if (result != null)
|
string requestStatus = result.RequestStatus;
|
||||||
// {
|
var candidate = await _repository.GetInsigniaCandidateBKK(insigniaPeriodId, organization.Id);
|
||||||
// Guid period = result.PeriodId;
|
// ตรวจสอบว่ารายการอยู่ใน table insignia_request_new
|
||||||
// string requestStatus = result.RequestStatus;
|
if (requestStatus == null)
|
||||||
// var candidate = await _repository.GetInsigniaCandidateBKK(insigniaPeriodId, organization.Id);
|
{
|
||||||
// // ตรวจสอบว่ารายการอยู่ใน table insignia_request_new
|
// บันทึกรายชื่อ
|
||||||
// if (requestStatus == null)
|
await _repository.InsertCandidate(period, organization.Id, candidate);
|
||||||
// {
|
}
|
||||||
// // บันทึกรายชื่อ
|
}
|
||||||
// await _repository.InsertCandidate(period, organization.Id, candidate);
|
}
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
return Success();
|
return Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -732,6 +582,13 @@ namespace BMA.EHR.Insignia.Service.Controllers
|
||||||
|
|
||||||
#region " บันทึกรายชื่อครูในการขอยื่นเครื่องราชฯ เเต่ยังไม่ส่งไปยัง ผอ.โรงเรียน "
|
#region " บันทึกรายชื่อครูในการขอยื่นเครื่องราชฯ เเต่ยังไม่ส่งไปยัง ผอ.โรงเรียน "
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="ocId"></param>
|
||||||
|
/// <param name="items"></param>
|
||||||
|
/// <returns></returns>
|
||||||
[HttpPut("approve/{ocId:length(36)}")]
|
[HttpPut("approve/{ocId:length(36)}")]
|
||||||
public async Task<ActionResult<ResponseObject>> SaveRequestList(Guid id, Guid ocId, InsigniaApproveRequest items)
|
public async Task<ActionResult<ResponseObject>> SaveRequestList(Guid id, Guid ocId, InsigniaApproveRequest items)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue