Merge branch 'develop' into working

This commit is contained in:
Suphonchai Phoonsawat 2023-10-05 05:12:37 +07:00
commit f55530be3c
17 changed files with 49 additions and 32 deletions

View file

@ -202,6 +202,23 @@ namespace BMA.EHR.Application.Repositories.Reports
if (evaluate_assign.data != null)
{
evaluate_assign.data.evaluate.achievement_score = evaluate_assign.data.evaluate.achievement_score.ToThaiNumber();
evaluate_assign.data.evaluate.behavior_score = evaluate_assign.data.evaluate.behavior_score.ToThaiNumber();
evaluate_assign.data.evaluate.sum_score = evaluate_assign.data.evaluate.sum_score.ToThaiNumber();
evaluate_assign.data.evaluate.achievement_percent = evaluate_assign.data.evaluate.achievement_percent.ToThaiNumber();
evaluate_assign.data.evaluate.behavior_percent = evaluate_assign.data.evaluate.behavior_percent.ToThaiNumber();
evaluate_assign.data.evaluate.sum_percent = evaluate_assign.data.evaluate.sum_percent.ToThaiNumber();
evaluate_assign.data.evaluate.develop_orientation_score = evaluate_assign.data.evaluate.develop_orientation_score.ToThaiNumber();
evaluate_assign.data.evaluate.develop_self_learning_score = evaluate_assign.data.evaluate.develop_self_learning_score.ToThaiNumber();
evaluate_assign.data.evaluate.develop_training_seminar_score = evaluate_assign.data.evaluate.develop_training_seminar_score.ToThaiNumber();
evaluate_assign.data.evaluate.develop_other_training_score = evaluate_assign.data.evaluate.develop_other_training_score.ToThaiNumber();
evaluate_assign.data.evaluate.develop_total_score = evaluate_assign.data.evaluate.develop_total_score.ToThaiNumber();
evaluate_assign.data.evaluate.develop_orientation_percent = evaluate_assign.data.evaluate.develop_orientation_percent.ToThaiNumber();
evaluate_assign.data.evaluate.develop_self_learning_percent = evaluate_assign.data.evaluate.develop_self_learning_percent.ToThaiNumber();
evaluate_assign.data.evaluate.develop_training_seminar_percent = evaluate_assign.data.evaluate.develop_training_seminar_percent.ToThaiNumber();
evaluate_assign.data.evaluate.develop_other_training_percent = evaluate_assign.data.evaluate.develop_other_training_percent.ToThaiNumber();
evaluate_assign.data.evaluate.develop_total_percent = evaluate_assign.data.evaluate.develop_total_percent.ToThaiNumber();
return new
{
No = string.IsNullOrEmpty(evaluate_assign.data.evaluate.no.ToString()) ? string.Empty : evaluate_assign.data.evaluate.no.ToString().ToThaiNumber(),

View file

@ -105,26 +105,26 @@ namespace BMA.EHR.Application.Responses
public DisciplineLevel discipline5_level { get; set; }
public BehaviorLevel behavior_other_level { get; set; }
public string behavior_other_desc { get; set; }
public int achievement_score { get; set; }
public string achievement_score { get; set; }
public int achievement_score_total { get; set; }
public double achievement_percent { get; set; }
public string achievement_percent { get; set; }
public int achievement_result { get; set; }
public int behavior_score { get; set; }
public string behavior_score { get; set; }
public int behavior_score_total { get; set; }
public double behavior_percent { get; set; }
public string behavior_percent { get; set; }
public int behavior_result { get; set; }
public int sum_score { get; set; }
public double sum_percent { get; set; }
public int develop_orientation_score { get; set; }
public int develop_self_learning_score { get; set; }
public int develop_training_seminar_score { get; set; }
public int develop_other_training_score { get; set; }
public int develop_total_score { get; set; }
public int develop_orientation_percent { get; set; }
public int develop_self_learning_percent { get; set; }
public int develop_training_seminar_percent { get; set; }
public int develop_other_training_percent { get; set; }
public int develop_total_percent { get; set; }
public string sum_score { get; set; }
public string sum_percent { get; set; }
public string develop_orientation_score { get; set; }
public string develop_self_learning_score { get; set; }
public string develop_training_seminar_score { get; set; }
public string develop_other_training_score { get; set; }
public string develop_total_score { get; set; }
public string develop_orientation_percent { get; set; }
public string develop_self_learning_percent { get; set; }
public string develop_training_seminar_percent { get; set; }
public string develop_other_training_percent { get; set; }
public string develop_total_percent { get; set; }
public int develop_result { get; set; }
public int evaluate_result { get; set; }
public DateTime createdAt { get; set; }

View file

@ -63,7 +63,7 @@ namespace BMA.EHR.Placement.Service.Controllers
{
var placementAppointments = await _context.PlacementAppointments.AsQueryable()
.Where(x => (x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeClass == "PREM") || (x.Profile.ProfileType == "OFFICER"))
.Where(x => (x.Profile.ProfileType == "employee" && x.Profile.EmployeeClass == "perm") || (x.Profile.ProfileType == "officer"))
.OrderByDescending(x => x.CreatedAt)
.Select(p => new
{
@ -124,7 +124,7 @@ namespace BMA.EHR.Placement.Service.Controllers
public async Task<ActionResult<ResponseObject>> GetDetailByUser(Guid id)
{
var data = await _context.PlacementAppointments.AsQueryable()
.Where(x => (x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeClass == "PREM") || (x.Profile.ProfileType == "OFFICER"))
.Where(x => (x.Profile.ProfileType == "employee" && x.Profile.EmployeeClass == "perm") || (x.Profile.ProfileType == "officer"))
.Where(x => x.Id == id)
.Select(p => new
{
@ -244,7 +244,7 @@ namespace BMA.EHR.Placement.Service.Controllers
.Include(x => x.Position)
.Include(x => x.Gender)
.Include(x => x.Prefix)
.Where(x => (x.ProfileType == "EMPLOYEE" && x.EmployeeClass == "PREM") || (x.ProfileType == "OFFICER"))
.Where(x => (x.ProfileType == "employee" && x.EmployeeClass == "perm") || (x.ProfileType == "officer"))
.FirstOrDefaultAsync(x => x.Id == req.Id);
if (profile == null)
return Error(GlobalMessages.DataNotFound, 404);
@ -326,7 +326,7 @@ namespace BMA.EHR.Placement.Service.Controllers
public async Task<ActionResult<ResponseObject>> UpdatePositionPlacementAppointment([FromBody] PersonSelectPositionAppointmentRequest req, Guid id)
{
var uppdated = await _context.PlacementAppointments
.Where(x => (x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeClass == "PREM") || (x.Profile.ProfileType == "OFFICER"))
.Where(x => (x.Profile.ProfileType == "employee" && x.Profile.EmployeeClass == "perm") || (x.Profile.ProfileType == "officer"))
.FirstOrDefaultAsync(x => x.Id == id);
if (uppdated == null)
return Error(GlobalMessages.PlacementAppointmentNotFound, 404);
@ -406,7 +406,7 @@ namespace BMA.EHR.Placement.Service.Controllers
public async Task<ActionResult<ResponseObject>> Put([FromBody] PlacementAppointmentEditRequest req, Guid id)
{
var uppdated = await _context.PlacementAppointments
.Where(x => (x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeClass == "PREM") || (x.Profile.ProfileType == "OFFICER"))
.Where(x => (x.Profile.ProfileType == "employee" && x.Profile.EmployeeClass == "perm") || (x.Profile.ProfileType == "officer"))
.FirstOrDefaultAsync(x => x.Id == id);
if (uppdated == null)
return Error(GlobalMessages.PlacementAppointmentNotFound, 404);
@ -489,7 +489,7 @@ namespace BMA.EHR.Placement.Service.Controllers
var deleted = await _context.PlacementAppointments.AsQueryable()
.Include(x => x.PlacementAppointmentDocs)
.ThenInclude(x => x.Document)
.Where(x => (x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeClass == "PREM") || (x.Profile.ProfileType == "OFFICER"))
.Where(x => (x.Profile.ProfileType == "employee" && x.Profile.EmployeeClass == "perm") || (x.Profile.ProfileType == "officer"))
.FirstOrDefaultAsync(x => x.Id == id);
if (deleted == null)
return NotFound();
@ -526,7 +526,7 @@ namespace BMA.EHR.Placement.Service.Controllers
foreach (var item in req.Id)
{
var uppdated = await _context.PlacementAppointments
.Where(x => (x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeClass == "PREM") || (x.Profile.ProfileType == "OFFICER"))
.Where(x => (x.Profile.ProfileType == "employee" && x.Profile.EmployeeClass == "perm") || (x.Profile.ProfileType == "officer"))
.FirstOrDefaultAsync(x => x.Id == item);
if (uppdated == null)
continue;
@ -556,7 +556,7 @@ namespace BMA.EHR.Placement.Service.Controllers
{
var appointments = await _context.PlacementAppointments
.Where(x => x.PositionNumber != null)
.Where(x => (x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeClass == "PREM") || (x.Profile.ProfileType == "OFFICER"))
.Where(x => (x.Profile.ProfileType == "employee" && x.Profile.EmployeeClass == "perm") || (x.Profile.ProfileType == "officer"))
.Select(x => x.PositionNumber.Id)
.ToListAsync();

View file

@ -64,7 +64,7 @@ namespace BMA.EHR.Placement.Service.Controllers
var placementAppointments = await _context.PlacementAppointments.AsQueryable()
.OrderByDescending(x => x.CreatedAt)
.Where(x => x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeClass == "TEMP")
.Where(x => x.Profile.ProfileType == "employee" && x.Profile.EmployeeClass == "perm")
.Select(p => new
{
p.Id,
@ -127,7 +127,7 @@ namespace BMA.EHR.Placement.Service.Controllers
{
var data = await _context.PlacementAppointments.AsQueryable()
.Where(x => x.Id == id)
.Where(x => x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeClass == "TEMP")
.Where(x => x.Profile.ProfileType == "employee" && x.Profile.EmployeeClass == "perm")
.Select(p => new
{
p.Id,
@ -246,7 +246,7 @@ namespace BMA.EHR.Placement.Service.Controllers
.Include(x => x.Position)
.Include(x => x.Gender)
.Include(x => x.Prefix)
.Where(x => x.ProfileType == "EMPLOYEE" && x.EmployeeClass == "TEMP")
.Where(x => x.ProfileType == "employee" && x.EmployeeClass == "perm")
.FirstOrDefaultAsync(x => x.Id == req.Id);
if (profile == null)
return Error(GlobalMessages.DataNotFound, 404);
@ -328,7 +328,7 @@ namespace BMA.EHR.Placement.Service.Controllers
public async Task<ActionResult<ResponseObject>> UpdatePositionPlacementAppointment([FromBody] PersonSelectPositionAppointmentRequest req, Guid id)
{
var uppdated = await _context.PlacementAppointments
.Where(x => x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeClass == "TEMP")
.Where(x => x.Profile.ProfileType == "employee" && x.Profile.EmployeeClass == "perm")
.FirstOrDefaultAsync(x => x.Id == id);
if (uppdated == null)
return Error(GlobalMessages.PlacementAppointmentNotFound, 404);
@ -408,7 +408,7 @@ namespace BMA.EHR.Placement.Service.Controllers
public async Task<ActionResult<ResponseObject>> Put([FromBody] PlacementAppointmentEditRequest req, Guid id)
{
var uppdated = await _context.PlacementAppointments
.Where(x => x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeClass == "TEMP")
.Where(x => x.Profile.ProfileType == "employee" && x.Profile.EmployeeClass == "perm")
.FirstOrDefaultAsync(x => x.Id == id);
if (uppdated == null)
return Error(GlobalMessages.PlacementAppointmentNotFound, 404);
@ -491,7 +491,7 @@ namespace BMA.EHR.Placement.Service.Controllers
var deleted = await _context.PlacementAppointments.AsQueryable()
.Include(x => x.PlacementAppointmentDocs)
.ThenInclude(x => x.Document)
.Where(x => x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeClass == "TEMP")
.Where(x => x.Profile.ProfileType == "employee" && x.Profile.EmployeeClass == "perm")
.FirstOrDefaultAsync(x => x.Id == id);
if (deleted == null)
return NotFound();
@ -528,7 +528,7 @@ namespace BMA.EHR.Placement.Service.Controllers
foreach (var item in req.Id)
{
var uppdated = await _context.PlacementAppointments
.Where(x => x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeClass == "TEMP")
.Where(x => x.Profile.ProfileType == "employee" && x.Profile.EmployeeClass == "perm")
.FirstOrDefaultAsync(x => x.Id == item);
if (uppdated == null)
continue;
@ -558,7 +558,7 @@ namespace BMA.EHR.Placement.Service.Controllers
{
var appointments = await _context.PlacementAppointments
.Where(x => x.PositionNumber != null)
.Where(x => x.Profile.ProfileType == "EMPLOYEE" && x.Profile.EmployeeClass == "TEMP")
.Where(x => x.Profile.ProfileType == "employee" && x.Profile.EmployeeClass == "perm")
.Select(x => x.PositionNumber.Id)
.ToListAsync();