1010 lines
82 KiB
C#
1010 lines
82 KiB
C#
using BMA.EHR.Application.Common.Interfaces;
|
|
using BMA.EHR.Application.Responses;
|
|
using BMA.EHR.Application.Repositories.MessageQueue;
|
|
using BMA.EHR.Domain.Models.Probation;
|
|
using BMA.EHR.Domain.Extensions;
|
|
using Microsoft.AspNetCore.Hosting;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using System.Net.Http.Headers;
|
|
using Newtonsoft.Json;
|
|
using System.Globalization;
|
|
using Microsoft.Extensions.Configuration;
|
|
using System.Linq;
|
|
using static BMA.EHR.Application.Responses.ProbationAssignResponse;
|
|
using System.Text.RegularExpressions;
|
|
|
|
namespace BMA.EHR.Application.Repositories.Reports
|
|
{
|
|
public class ProbationReportRepository
|
|
{
|
|
#region " Fields "
|
|
|
|
private readonly IApplicationDBContext _dbContext;
|
|
private readonly IWebHostEnvironment _hostingEnvironment;
|
|
private readonly NotificationRepository _repositoryNoti;
|
|
private readonly IConfiguration _configuration;
|
|
|
|
#endregion
|
|
|
|
#region " Constructor and Destructor "
|
|
|
|
public ProbationReportRepository(IApplicationDBContext dbContext,
|
|
NotificationRepository repositoryNoti,
|
|
IWebHostEnvironment hostEnvironment,
|
|
IConfiguration configuration)
|
|
{
|
|
_dbContext = dbContext;
|
|
_hostingEnvironment = hostEnvironment;
|
|
_repositoryNoti = repositoryNoti;
|
|
_configuration = configuration;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region " Methods "
|
|
|
|
#region 13 แบบมอบหมายงาน ฯ
|
|
public async Task<object> GetProbationAssignAsync(Guid assign_id, string token)
|
|
{
|
|
var api_url = $"{_configuration["APIPROBATION"]}/assign?assign_id={assign_id}&isReport=true";
|
|
ProbationAssignResponse probation_assign;
|
|
using (var client = new HttpClient())
|
|
{
|
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
|
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
|
var req = new HttpRequestMessage(HttpMethod.Get, api_url);
|
|
var res = await client.SendAsync(req);
|
|
var result = await res.Content.ReadAsStringAsync();
|
|
probation_assign = JsonConvert.DeserializeObject<ProbationAssignResponse>(result);
|
|
|
|
if (probation_assign.result != null)
|
|
{
|
|
var jobs = probation_assign.result.jobs.Select(x => new
|
|
{
|
|
id = string.IsNullOrEmpty(x.id.ToString()) ? string.Empty : x.id.ToString().ToThaiNumber(),
|
|
activity_desc = string.IsNullOrEmpty(x.activity_desc) ? string.Empty : x.activity_desc.ToThaiNumber(),
|
|
goal_desc = string.IsNullOrEmpty(x.goal_desc) ? string.Empty : x.goal_desc.ToThaiNumber(),
|
|
}).ToList();
|
|
|
|
var knowledges = probation_assign.result.knowledges.Select(x => new
|
|
{
|
|
id = string.IsNullOrEmpty(x.id.ToString()) ? string.Empty : x.id.ToString().ToThaiNumber(),
|
|
title = string.IsNullOrEmpty(x.title) ? string.Empty : x.title.ToThaiNumber(),
|
|
description = string.IsNullOrEmpty(x.description) ? string.Empty : x.description.ToThaiNumber(),
|
|
}).ToList();
|
|
|
|
var competencys = probation_assign.result.competencys.Select(x => new
|
|
{
|
|
name = string.IsNullOrEmpty(x.name) ? string.Empty : x.name.ToThaiNumber(),
|
|
level = string.IsNullOrEmpty(x.level) ? string.Empty : x.level.ToThaiNumber(),
|
|
description = string.IsNullOrEmpty(x.description)
|
|
? string.Empty
|
|
: (Regex.Replace(x.description, "<.*?>", string.Empty)).Replace(" ", " ").ToString().ToThaiNumber(),
|
|
}).ToList();
|
|
|
|
var competencyGroups = probation_assign.result.competency_groups.Select(x => new
|
|
{
|
|
name = string.IsNullOrEmpty(x.name) ? string.Empty : x.name.ToThaiNumber(),
|
|
level = string.IsNullOrEmpty(x.level) ? string.Empty : x.level.ToThaiNumber(),
|
|
description = string.IsNullOrEmpty(x.description)
|
|
? string.Empty
|
|
: (Regex.Replace(x.description, "<.*?>", string.Empty)).Replace(" ", " ").ToString().ToThaiNumber(),
|
|
}).ToList();
|
|
|
|
var outputs = probation_assign.result.outputs.Select(x => new
|
|
{
|
|
id = string.IsNullOrEmpty(x.id.ToString()) ? string.Empty : x.id.ToString().ToThaiNumber(),
|
|
indicator_desc = string.IsNullOrEmpty(x.indicator_desc) ? string.Empty : x.indicator_desc.ToThaiNumber(),
|
|
output_desc = string.IsNullOrEmpty(x.output_desc) ? string.Empty : x.output_desc.ToThaiNumber(),
|
|
}).ToList();
|
|
|
|
var skills = probation_assign.result.skills.Select(x => new
|
|
{
|
|
name = string.IsNullOrEmpty(x.title) ? string.Empty : x.title.ToThaiNumber(),
|
|
level = string.IsNullOrEmpty(x.level) ? string.Empty : x.level.ToThaiNumber(),
|
|
description = string.IsNullOrEmpty(x.description)
|
|
? string.Empty
|
|
: (Regex.Replace(x.description, "<.*?>", string.Empty)).Replace(" ", " ").ToString().ToThaiNumber(),
|
|
}).ToList();
|
|
|
|
var laws = probation_assign.result.laws.Where(x => x.selected == true).Select((x, Index) => new
|
|
{
|
|
title = string.IsNullOrEmpty(x.description) ? string.Empty : $"{(Index + 1).ToString().ToThaiNumber()}. {x.description.ToThaiNumber()}",
|
|
}).ToList();
|
|
|
|
return new
|
|
{
|
|
Name = string.IsNullOrEmpty(probation_assign.result.profile.name) ? "-" : probation_assign.result.profile.name,
|
|
Position = string.IsNullOrEmpty(probation_assign.result.profile.Position) ? "-" : probation_assign.result.profile.Position,
|
|
PositionLevel = string.IsNullOrEmpty(probation_assign.result.profile.positionLevelName) ? "-" : probation_assign.result.profile.positionLevelName,
|
|
PositionAndLevel = string.IsNullOrEmpty(probation_assign.result.profile.PositionAndLevel) ? "-" : probation_assign.result.profile.PositionAndLevel,
|
|
Department = string.IsNullOrEmpty(probation_assign.result.profile.Department) ? "-" : probation_assign.result.profile.Department,
|
|
OrganizationOrganization = string.IsNullOrEmpty(probation_assign.result.profile.OrganizationOrganization) ? "-" : probation_assign.result.profile.OrganizationOrganization,
|
|
Oc = string.IsNullOrEmpty(probation_assign.result.profile.Oc) ? "-" : probation_assign.result.profile.Oc,
|
|
DateStart = string.IsNullOrEmpty(probation_assign.result.assign.date_start.ToString()) ? "-" : probation_assign.result.assign.date_start.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
DateFinish = string.IsNullOrEmpty(probation_assign.result.assign.date_finish.ToString()) ? "-" : probation_assign.result.assign.date_finish.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
NameMentor1 = probation_assign.result.mentors.Count > 0 ? probation_assign.result.mentors[0].name : "-",
|
|
DateMentor1 = probation_assign.result.mentors.Count > 0 ? probation_assign.result.mentors[0].dated.ToThaiFullDate().ToString().ToThaiNumber() : "-",
|
|
PositionMentor1 = probation_assign.result.mentors.Count > 0 ? probation_assign.result.mentors[0].Position : "-",
|
|
NameMentor2 = probation_assign.result.mentors.Count > 1 ? probation_assign.result.mentors[1].name : "-",
|
|
DateMentor2 = probation_assign.result.mentors.Count > 1 ? probation_assign.result.mentors[1].dated.ToThaiFullDate().ToString().ToThaiNumber() : "-",
|
|
PositionMentor2 = probation_assign.result.mentors.Count > 1 ? probation_assign.result.mentors[1].Position : "-",
|
|
NameCommander = string.IsNullOrEmpty(probation_assign.result.commander.name) ? "-" : probation_assign.result.commander.name,
|
|
DateCommander = string.IsNullOrEmpty(probation_assign.result.commander.dated.ToString()) ? "-" : probation_assign.result.commander.dated.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
PositionCommander = string.IsNullOrEmpty(probation_assign.result.commander.Position) ? "-" : probation_assign.result.commander.Position,
|
|
Jobs = jobs,
|
|
Knowledges = knowledges,
|
|
Competencys = competencys,
|
|
CompetencyGroups = competencyGroups,
|
|
Outputs = outputs,
|
|
Skills = skills,
|
|
Laws = laws,
|
|
OtherDesc = string.IsNullOrEmpty(probation_assign.result.assign.other_desc) ? "-" : probation_assign.result.assign.other_desc,
|
|
Other4Desc = string.IsNullOrEmpty(probation_assign.result.assign.other4_desc) ? "-" : probation_assign.result.assign.other4_desc,
|
|
Other5No1Desc = string.IsNullOrEmpty(probation_assign.result.assign.other5_no1_desc) ? "-" : probation_assign.result.assign.other5_no1_desc,
|
|
Other5No2Desc = string.IsNullOrEmpty(probation_assign.result.assign.other5_no2_desc) ? "-" : probation_assign.result.assign.other5_no2_desc,
|
|
};
|
|
}
|
|
else
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 14 - 15 แบบบันทึกผล (ผู้ดูแล และ ผู้บังคับบัญชา)
|
|
public async Task<object> GetEvaluateRecord14_15Async(Guid assign_id, string token)
|
|
{
|
|
var api_url = $"{_configuration["APIPROBATION"]}/report/form-record?id={assign_id}";
|
|
EvaluateRecordAssignResponse evaluate_record;
|
|
using (var client = new HttpClient())
|
|
{
|
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
|
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
|
var req = new HttpRequestMessage(HttpMethod.Get, api_url);
|
|
var res = await client.SendAsync(req);
|
|
var result = await res.Content.ReadAsStringAsync();
|
|
evaluate_record = JsonConvert.DeserializeObject<EvaluateRecordAssignResponse>(result);
|
|
|
|
if (evaluate_record.result != null)
|
|
{
|
|
var orientation = evaluate_record.result.evaluate.orientation == "1" ? "🗹 ดำเนินการแล้ว ☐ ยังไม่ได้ดำเนินการ" : "☐ ดำเนินการแล้ว 🗹 ยังไม่ได้ดำเนินการ";
|
|
var self_learning = evaluate_record.result.evaluate.self_learning == "1" ? "🗹 ดำเนินการแล้ว ☐ ยังไม่ได้ดำเนินการ" : "☐ ดำเนินการแล้ว 🗹 ยังไม่ได้ดำเนินการ";
|
|
var training_seminar = evaluate_record.result.evaluate.training_seminar == "1" ? "🗹 ดำเนินการแล้ว ☐ ยังไม่ได้ดำเนินการ" : "☐ ดำเนินการแล้ว 🗹 ยังไม่ได้ดำเนินการ";
|
|
var other_training = evaluate_record.result.evaluate.other_training == "1" ? "🗹 ดำเนินการแล้ว ☐ ยังไม่ได้ดำเนินการ" : "☐ ดำเนินการแล้ว 🗹 ยังไม่ได้ดำเนินการ";
|
|
|
|
var expects = evaluate_record?.result?.evaluate?.achievements?.evaluate_expect_level ?? null;
|
|
var outputs = evaluate_record?.result?.evaluate?.achievements?.evaluate_output_level ?? null;
|
|
var knows = evaluate_record.result.evaluate != null
|
|
? new
|
|
{
|
|
col1 = evaluate_record.result.evaluate.knowledge_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_record.result.evaluate.knowledge_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_record.result.evaluate.knowledge_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_record.result.evaluate.knowledge_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_record.result.evaluate.knowledge_level.col5 == "/" ? "✓" : string.Empty,
|
|
}
|
|
: null;
|
|
var skills = evaluate_record.result.evaluate != null
|
|
? new
|
|
{
|
|
col1 = evaluate_record.result.evaluate.skill_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_record.result.evaluate.skill_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_record.result.evaluate.skill_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_record.result.evaluate.skill_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_record.result.evaluate.skill_level.col5 == "/" ? "✓" : string.Empty,
|
|
}
|
|
: null;
|
|
var competencys = evaluate_record.result.evaluate != null
|
|
? new
|
|
{
|
|
col1 = evaluate_record.result.evaluate.competency_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_record.result.evaluate.competency_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_record.result.evaluate.competency_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_record.result.evaluate.competency_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_record.result.evaluate.competency_level.col5 == "/" ? "✓" : string.Empty,
|
|
}
|
|
: null;
|
|
var learns = evaluate_record.result.evaluate != null
|
|
? new
|
|
{
|
|
col1 = evaluate_record.result.evaluate.learn_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_record.result.evaluate.learn_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_record.result.evaluate.learn_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_record.result.evaluate.learn_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_record.result.evaluate.learn_level.col5 == "/" ? "✓" : string.Empty,
|
|
}
|
|
: null;
|
|
var applys = evaluate_record.result.evaluate != null
|
|
? new
|
|
{
|
|
col1 = evaluate_record.result.evaluate.apply_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_record.result.evaluate.apply_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_record.result.evaluate.apply_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_record.result.evaluate.apply_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_record.result.evaluate.apply_level.col5 == "/" ? "✓" : string.Empty,
|
|
}
|
|
: null;
|
|
var achievementOthers = evaluate_record.result.evaluate != null
|
|
? new
|
|
{
|
|
col1 = evaluate_record.result.evaluate.achievement_other_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_record.result.evaluate.achievement_other_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_record.result.evaluate.achievement_other_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_record.result.evaluate.achievement_other_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_record.result.evaluate.achievement_other_level.col5 == "/" ? "✓" : string.Empty,
|
|
}
|
|
: null;
|
|
var conducts1 = evaluate_record.result.evaluate != null
|
|
? new
|
|
{
|
|
col1 = evaluate_record.result.evaluate.conduct1_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_record.result.evaluate.conduct1_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_record.result.evaluate.conduct1_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_record.result.evaluate.conduct1_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_record.result.evaluate.conduct1_level.col5 == "/" ? "✓" : string.Empty,
|
|
}
|
|
: null;
|
|
var conducts2 = evaluate_record.result.evaluate != null
|
|
? new
|
|
{
|
|
col1 = evaluate_record.result.evaluate.conduct2_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_record.result.evaluate.conduct2_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_record.result.evaluate.conduct2_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_record.result.evaluate.conduct2_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_record.result.evaluate.conduct2_level.col5 == "/" ? "✓" : string.Empty,
|
|
}
|
|
: null;
|
|
var conducts3 = evaluate_record.result.evaluate != null
|
|
? new
|
|
{
|
|
col1 = evaluate_record.result.evaluate.conduct3_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_record.result.evaluate.conduct3_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_record.result.evaluate.conduct3_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_record.result.evaluate.conduct3_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_record.result.evaluate.conduct3_level.col5 == "/" ? "✓" : string.Empty,
|
|
}
|
|
: null;
|
|
var conducts4 = evaluate_record.result.evaluate != null
|
|
? new
|
|
{
|
|
col1 = evaluate_record.result.evaluate.conduct4_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_record.result.evaluate.conduct4_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_record.result.evaluate.conduct4_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_record.result.evaluate.conduct4_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_record.result.evaluate.conduct4_level.col5 == "/" ? "✓" : string.Empty,
|
|
}
|
|
: null;
|
|
var morals1 = evaluate_record.result.evaluate != null
|
|
? new
|
|
{
|
|
col1 = evaluate_record.result.evaluate.moral1_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_record.result.evaluate.moral1_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_record.result.evaluate.moral1_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_record.result.evaluate.moral1_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_record.result.evaluate.moral1_level.col5 == "/" ? "✓" : string.Empty,
|
|
}
|
|
: null;
|
|
var morals2 = evaluate_record.result.evaluate != null
|
|
? new
|
|
{
|
|
col1 = evaluate_record.result.evaluate.moral2_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_record.result.evaluate.moral2_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_record.result.evaluate.moral2_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_record.result.evaluate.moral2_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_record.result.evaluate.moral2_level.col5 == "/" ? "✓" : string.Empty,
|
|
}
|
|
: null;
|
|
var morals3 = evaluate_record.result.evaluate != null
|
|
? new
|
|
{
|
|
col1 = evaluate_record.result.evaluate.moral3_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_record.result.evaluate.moral3_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_record.result.evaluate.moral3_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_record.result.evaluate.moral3_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_record.result.evaluate.moral3_level.col5 == "/" ? "✓" : string.Empty,
|
|
}
|
|
: null;
|
|
var disciplines1 = evaluate_record.result.evaluate != null
|
|
? new
|
|
{
|
|
col1 = evaluate_record.result.evaluate.discipline1_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_record.result.evaluate.discipline1_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_record.result.evaluate.discipline1_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_record.result.evaluate.discipline1_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_record.result.evaluate.discipline1_level.col5 == "/" ? "✓" : string.Empty,
|
|
}
|
|
: null;
|
|
var disciplines2 = evaluate_record.result.evaluate != null
|
|
? new
|
|
{
|
|
col1 = evaluate_record.result.evaluate.discipline2_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_record.result.evaluate.discipline2_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_record.result.evaluate.discipline2_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_record.result.evaluate.discipline2_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_record.result.evaluate.discipline2_level.col5 == "/" ? "✓" : string.Empty,
|
|
}
|
|
: null;
|
|
var disciplines3 = evaluate_record.result.evaluate != null
|
|
? new
|
|
{
|
|
col1 = evaluate_record.result.evaluate.discipline3_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_record.result.evaluate.discipline3_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_record.result.evaluate.discipline3_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_record.result.evaluate.discipline3_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_record.result.evaluate.discipline3_level.col5 == "/" ? "✓" : string.Empty,
|
|
}
|
|
: null;
|
|
var disciplines4 = evaluate_record.result.evaluate != null
|
|
? new
|
|
{
|
|
col1 = evaluate_record.result.evaluate.discipline4_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_record.result.evaluate.discipline4_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_record.result.evaluate.discipline4_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_record.result.evaluate.discipline4_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_record.result.evaluate.discipline4_level.col5 == "/" ? "✓" : string.Empty,
|
|
}
|
|
: null;
|
|
var disciplines5 = evaluate_record.result.evaluate != null
|
|
? new
|
|
{
|
|
col1 = evaluate_record.result.evaluate.discipline5_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_record.result.evaluate.discipline5_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_record.result.evaluate.discipline5_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_record.result.evaluate.discipline5_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_record.result.evaluate.discipline5_level.col5 == "/" ? "✓" : string.Empty,
|
|
}
|
|
: null;
|
|
|
|
var behaviorOthers = evaluate_record.result.evaluate != null
|
|
? new
|
|
{
|
|
col1 = evaluate_record.result.evaluate.behavior_other_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_record.result.evaluate.behavior_other_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_record.result.evaluate.behavior_other_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_record.result.evaluate.behavior_other_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_record.result.evaluate.behavior_other_level.col5 == "/" ? "✓" : string.Empty,
|
|
}
|
|
: null;
|
|
return new
|
|
{
|
|
DirectorName = string.IsNullOrEmpty(evaluate_record.result.director.name) ? string.Empty : evaluate_record.result.director.name,
|
|
DirectorPosition = string.IsNullOrEmpty(evaluate_record.result.director.Position) ? string.Empty : evaluate_record.result.director.Position,
|
|
DirectorDated = string.IsNullOrEmpty(evaluate_record.result.evaluate.sign_dated.ToString()) ? "-" : evaluate_record.result.evaluate.sign_dated.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
Name = string.IsNullOrEmpty(evaluate_record.result.experimentee.name) ? string.Empty : evaluate_record.result.experimentee.name,
|
|
Position = string.IsNullOrEmpty(evaluate_record.result.experimentee.Position) ? string.Empty : evaluate_record.result.experimentee.Position,
|
|
PositionLevel = string.IsNullOrEmpty(evaluate_record.result.experimentee.PositionLevelName) ? "-" : evaluate_record.result.experimentee.PositionLevelName,
|
|
Department = string.IsNullOrEmpty(evaluate_record.result.experimentee.Department) ? string.Empty : evaluate_record.result.experimentee.Department,
|
|
Organization = string.IsNullOrEmpty(evaluate_record.result.experimentee.OrganizationOrganization) ? string.Empty : evaluate_record.result.experimentee.OrganizationOrganization,
|
|
Oc = string.IsNullOrEmpty(evaluate_record.result.experimentee.Oc) ? string.Empty : evaluate_record.result.experimentee.Oc,
|
|
DateStart = string.IsNullOrEmpty(evaluate_record.result.assign.date_start.ToString()) ? "-" : evaluate_record.result.assign.date_start.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
DateFinish = string.IsNullOrEmpty(evaluate_record.result.assign.date_finish.ToString()) ? "-" : evaluate_record.result.assign.date_finish.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
No = evaluate_record.result.evaluate.no = string.IsNullOrEmpty(evaluate_record.result.evaluate.no) ? string.Empty : evaluate_record.result.evaluate.no.ToThaiNumber(),
|
|
EvaluateDateStart = string.IsNullOrEmpty(evaluate_record.result.evaluate.date_start.ToString()) ? string.Empty : evaluate_record.result.evaluate.date_start.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
EvaluateDateFinish = string.IsNullOrEmpty(evaluate_record.result.evaluate.date_finish.ToString()) ? string.Empty : evaluate_record.result.evaluate.date_finish.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
Role = evaluate_record.result.evaluate.role == "mentor" ? "ผู้ดูแลการทดลองปฏิบัติหน้าที่ราชการ" : "ผู้บังคับบัญชา",
|
|
Expects = expects,
|
|
Outputs = outputs,
|
|
AchievementOtherDesc = evaluate_record.result.evaluate.achievement_other_desc,
|
|
AchievementStrengthDesc = evaluate_record.result.evaluate.achievement_strength_desc,
|
|
AchievementImproveDesc = evaluate_record.result.evaluate.achievement_improve_desc,
|
|
BehaviorOtherDesc = evaluate_record.result.evaluate.behavior_other_desc,
|
|
BehaviorStrengthDesc = evaluate_record.result.evaluate.behavior_strength_desc,
|
|
BehaviorImproveDesc = evaluate_record.result.evaluate.behavior_improve_desc,
|
|
Knows = knows,
|
|
Skills = skills,
|
|
Competencys = competencys,
|
|
Learns = learns,
|
|
Applys = applys,
|
|
AchievementOthers = achievementOthers,
|
|
Conducts1 = conducts1,
|
|
Conducts2 = conducts2,
|
|
Conducts3 = conducts3,
|
|
Conducts4 = conducts4,
|
|
Morals1 = morals1,
|
|
Morals2 = morals2,
|
|
Morals3 = morals3,
|
|
Disciplines1 = disciplines1,
|
|
Disciplines2 = disciplines2,
|
|
Disciplines3 = disciplines3,
|
|
Disciplines4 = disciplines4,
|
|
Disciplines5 = disciplines5,
|
|
BehaviorOthers = behaviorOthers,
|
|
Orientation = orientation,
|
|
SelfLearning = self_learning,
|
|
TrainingSeminar = training_seminar,
|
|
OtherTraining = other_training,
|
|
};
|
|
}
|
|
else
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 16 แบบประเมินผล (ผู้บังคับบัญชา)
|
|
public async Task<object> GetEvaluateAssignAsync(Guid id, string token)
|
|
{
|
|
var api_url = $"{_configuration["APIPROBATION"]}/report/evaluate-commander?id={id}";
|
|
EvaluateAssignResponse evaluate_assign;
|
|
using (var client = new HttpClient())
|
|
{
|
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
|
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
|
var req = new HttpRequestMessage(HttpMethod.Get, api_url);
|
|
var res = await client.SendAsync(req);
|
|
var result = await res.Content.ReadAsStringAsync();
|
|
evaluate_assign = JsonConvert.DeserializeObject<EvaluateAssignResponse>(result);
|
|
|
|
if (evaluate_assign.result != null)
|
|
{
|
|
var knows = new
|
|
{
|
|
col1 = evaluate_assign.result.evaluate.knowledge_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_assign.result.evaluate.knowledge_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_assign.result.evaluate.knowledge_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_assign.result.evaluate.knowledge_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_assign.result.evaluate.knowledge_level.col5 == "/" ? "✓" : string.Empty,
|
|
};
|
|
var skills = new
|
|
{
|
|
col1 = evaluate_assign.result.evaluate.skill_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_assign.result.evaluate.skill_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_assign.result.evaluate.skill_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_assign.result.evaluate.skill_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_assign.result.evaluate.skill_level.col5 == "/" ? "✓" : string.Empty,
|
|
};
|
|
var competencys = new
|
|
{
|
|
col1 = evaluate_assign.result.evaluate.competency_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_assign.result.evaluate.competency_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_assign.result.evaluate.competency_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_assign.result.evaluate.competency_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_assign.result.evaluate.competency_level.col5 == "/" ? "✓" : string.Empty,
|
|
};
|
|
var learns = new
|
|
{
|
|
col1 = evaluate_assign.result.evaluate.learn_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_assign.result.evaluate.learn_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_assign.result.evaluate.learn_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_assign.result.evaluate.learn_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_assign.result.evaluate.learn_level.col5 == "/" ? "✓" : string.Empty,
|
|
};
|
|
var applys = new
|
|
{
|
|
col1 = evaluate_assign.result.evaluate.apply_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_assign.result.evaluate.apply_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_assign.result.evaluate.apply_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_assign.result.evaluate.apply_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_assign.result.evaluate.apply_level.col5 == "/" ? "✓" : string.Empty,
|
|
};
|
|
var success = new
|
|
{
|
|
col1 = evaluate_assign.result.evaluate.success_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_assign.result.evaluate.success_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_assign.result.evaluate.success_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_assign.result.evaluate.success_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_assign.result.evaluate.success_level.col5 == "/" ? "✓" : string.Empty,
|
|
};
|
|
var achievementOthers = new
|
|
{
|
|
col1 = evaluate_assign.result.evaluate.achievement_other_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_assign.result.evaluate.achievement_other_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_assign.result.evaluate.achievement_other_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_assign.result.evaluate.achievement_other_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_assign.result.evaluate.achievement_other_level.col5 == "/" ? "✓" : string.Empty,
|
|
};
|
|
|
|
var conducts = new
|
|
{
|
|
col1_1 = evaluate_assign.result.evaluate.conduct1_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_1 = evaluate_assign.result.evaluate.conduct1_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_1 = evaluate_assign.result.evaluate.conduct1_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_1 = evaluate_assign.result.evaluate.conduct1_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_1 = evaluate_assign.result.evaluate.conduct1_level.col5 == "/" ? "✓" : string.Empty,
|
|
|
|
col1_2 = evaluate_assign.result.evaluate.conduct2_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_2 = evaluate_assign.result.evaluate.conduct2_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_2 = evaluate_assign.result.evaluate.conduct2_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_2 = evaluate_assign.result.evaluate.conduct2_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_2 = evaluate_assign.result.evaluate.conduct2_level.col5 == "/" ? "✓" : string.Empty,
|
|
|
|
col1_3 = evaluate_assign.result.evaluate.conduct3_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_3 = evaluate_assign.result.evaluate.conduct3_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_3 = evaluate_assign.result.evaluate.conduct3_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_3 = evaluate_assign.result.evaluate.conduct3_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_3 = evaluate_assign.result.evaluate.conduct3_level.col5 == "/" ? "✓" : string.Empty,
|
|
|
|
col1_4 = evaluate_assign.result.evaluate.conduct4_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_4 = evaluate_assign.result.evaluate.conduct4_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_4 = evaluate_assign.result.evaluate.conduct4_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_4 = evaluate_assign.result.evaluate.conduct4_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_4 = evaluate_assign.result.evaluate.conduct4_level.col5 == "/" ? "✓" : string.Empty,
|
|
};
|
|
var morals = new
|
|
{
|
|
col1_1 = evaluate_assign.result.evaluate.moral1_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_1 = evaluate_assign.result.evaluate.moral1_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_1 = evaluate_assign.result.evaluate.moral1_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_1 = evaluate_assign.result.evaluate.moral1_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_1 = evaluate_assign.result.evaluate.moral1_level.col5 == "/" ? "✓" : string.Empty,
|
|
|
|
col1_2 = evaluate_assign.result.evaluate.moral2_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_2 = evaluate_assign.result.evaluate.moral2_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_2 = evaluate_assign.result.evaluate.moral2_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_2 = evaluate_assign.result.evaluate.moral2_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_2 = evaluate_assign.result.evaluate.moral2_level.col5 == "/" ? "✓" : string.Empty,
|
|
|
|
col1_3 = evaluate_assign.result.evaluate.moral3_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_3 = evaluate_assign.result.evaluate.moral3_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_3 = evaluate_assign.result.evaluate.moral3_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_3 = evaluate_assign.result.evaluate.moral3_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_3 = evaluate_assign.result.evaluate.moral3_level.col5 == "/" ? "✓" : string.Empty,
|
|
};
|
|
var disciplines = new
|
|
{
|
|
col1_1 = evaluate_assign.result.evaluate.discipline1_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_1 = evaluate_assign.result.evaluate.discipline1_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_1 = evaluate_assign.result.evaluate.discipline1_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_1 = evaluate_assign.result.evaluate.discipline1_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_1 = evaluate_assign.result.evaluate.discipline1_level.col5 == "/" ? "✓" : string.Empty,
|
|
|
|
col1_2 = evaluate_assign.result.evaluate.discipline2_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_2 = evaluate_assign.result.evaluate.discipline2_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_2 = evaluate_assign.result.evaluate.discipline2_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_2 = evaluate_assign.result.evaluate.discipline2_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_2 = evaluate_assign.result.evaluate.discipline2_level.col5 == "/" ? "✓" : string.Empty,
|
|
|
|
col1_3 = evaluate_assign.result.evaluate.discipline3_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_3 = evaluate_assign.result.evaluate.discipline3_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_3 = evaluate_assign.result.evaluate.discipline3_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_3 = evaluate_assign.result.evaluate.discipline3_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_3 = evaluate_assign.result.evaluate.discipline3_level.col5 == "/" ? "✓" : string.Empty,
|
|
|
|
col1_4 = evaluate_assign.result.evaluate.discipline4_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_4 = evaluate_assign.result.evaluate.discipline4_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_4 = evaluate_assign.result.evaluate.discipline4_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_4 = evaluate_assign.result.evaluate.discipline4_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_4 = evaluate_assign.result.evaluate.discipline4_level.col5 == "/" ? "✓" : string.Empty,
|
|
|
|
col1_5 = evaluate_assign.result.evaluate.discipline5_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_5 = evaluate_assign.result.evaluate.discipline5_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_5 = evaluate_assign.result.evaluate.discipline5_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_5 = evaluate_assign.result.evaluate.discipline5_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_5 = evaluate_assign.result.evaluate.discipline5_level.col5 == "/" ? "✓" : string.Empty,
|
|
};
|
|
var behaviorOthers = new
|
|
{
|
|
col1 = evaluate_assign.result.evaluate.behavior_other_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_assign.result.evaluate.behavior_other_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_assign.result.evaluate.behavior_other_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_assign.result.evaluate.behavior_other_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_assign.result.evaluate.behavior_other_level.col5 == "/" ? "✓" : string.Empty,
|
|
};
|
|
|
|
var orientation = evaluate_assign.result.evaluate.orientation = evaluate_assign.result.evaluate.orientation == "1" ? "🗹 ดำเนินการแล้ว ☐ ยังไม่ได้ดำเนินการ" : "☐ ดำเนินการแล้ว 🗹 ยังไม่ได้ดำเนินการ";
|
|
var self_learning = evaluate_assign.result.evaluate.self_learning = evaluate_assign.result.evaluate.self_learning == "1" ? "🗹 ดำเนินการแล้ว ☐ ยังไม่ได้ดำเนินการ" : "☐ ดำเนินการแล้ว 🗹 ยังไม่ได้ดำเนินการ";
|
|
var training_seminar = evaluate_assign.result.evaluate.training_seminar = evaluate_assign.result.evaluate.training_seminar == "1" ? "🗹 ดำเนินการแล้ว ☐ ยังไม่ได้ดำเนินการ" : "☐ ดำเนินการแล้ว 🗹 ยังไม่ได้ดำเนินการ";
|
|
var other_training = evaluate_assign.result.evaluate.other_training = evaluate_assign.result.evaluate.other_training == "1" ? "🗹 ดำเนินการแล้ว ☐ ยังไม่ได้ดำเนินการ" : "☐ ดำเนินการแล้ว 🗹 ยังไม่ได้ดำเนินการ";
|
|
return new
|
|
{
|
|
No = string.IsNullOrEmpty(evaluate_assign.result.evaluate.no.ToString()) ? string.Empty : evaluate_assign.result.evaluate.no.ToString().ToThaiNumber(),
|
|
EvaluateDateStart = string.IsNullOrEmpty(evaluate_assign.result.evaluate.date_start.ToString()) ? "-" : evaluate_assign.result.evaluate.date_start.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
EvaluateDateFinish = string.IsNullOrEmpty(evaluate_assign.result.evaluate.date_finish.ToString()) ? "-" : evaluate_assign.result.evaluate.date_finish.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
Name = string.IsNullOrEmpty(evaluate_assign.result.experimentee.name) ? string.Empty : evaluate_assign.result.experimentee.name,
|
|
Position = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Position) ? string.Empty : evaluate_assign.result.experimentee.Position,
|
|
PositionLevel = string.IsNullOrEmpty(evaluate_assign.result.experimentee.PositionLevelName) ? "-" : evaluate_assign.result.experimentee.PositionLevelName,
|
|
Department = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Department) ? string.Empty : evaluate_assign.result.experimentee.Department,
|
|
Organization = string.IsNullOrEmpty(evaluate_assign.result.experimentee.OrganizationOrganization) ? string.Empty : evaluate_assign.result.experimentee.OrganizationOrganization,
|
|
Oc = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Oc) ? string.Empty : evaluate_assign.result.experimentee.Oc,
|
|
DateStart = string.IsNullOrEmpty(evaluate_assign.result.assign.date_start.ToString()) ? "-" : evaluate_assign.result.assign.date_start.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
DateFinish = string.IsNullOrEmpty(evaluate_assign.result.assign.date_finish.ToString()) ? "-" : evaluate_assign.result.assign.date_finish.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
CommanderName = string.IsNullOrEmpty(evaluate_assign.result.commander.name) ? string.Empty : evaluate_assign.result.commander.name,
|
|
CommanderPosition = string.IsNullOrEmpty(evaluate_assign.result.commander.Position) ? string.Empty : evaluate_assign.result.commander.Position,
|
|
CommanderDated = string.IsNullOrEmpty(evaluate_assign.result.evaluate.sign_dated.ToString()) ? "-" : evaluate_assign.result.evaluate.sign_dated.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
BehaviorStrengthDesc = evaluate_assign.result.evaluate.behavior_strength_desc,
|
|
BehaviorImproveDesc = evaluate_assign.result.evaluate.behavior_improve_desc,
|
|
Knows = knows,
|
|
Skills = skills,
|
|
Competencys = competencys,
|
|
Learns = learns,
|
|
Applys = applys,
|
|
Success = success,
|
|
AchievementOthers = achievementOthers,
|
|
AchievementOtherDesc = evaluate_assign.result.evaluate.achievement_other_desc,
|
|
Conducts = conducts,
|
|
Morals = morals,
|
|
Disciplines = disciplines,
|
|
BehaviorOthers = behaviorOthers,
|
|
BehaviorOtherDesc = evaluate_assign.result.evaluate.behavior_other_desc,
|
|
Orientation = orientation,
|
|
SelfLearning = self_learning,
|
|
TrainingSeminar = training_seminar,
|
|
OtherTraining = other_training
|
|
};
|
|
}
|
|
else
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 17 แบบประเมินผล (คณะกรรมการ)
|
|
public async Task<object> GetEvaluateChairmanAssignAsync(Guid id, string token)
|
|
{
|
|
var api_url = $"{_configuration["APIPROBATION"]}/report/evaluate-chairman?id={id}";
|
|
EvaluateChairmanAssignResponse evaluate_assign;
|
|
using (var client = new HttpClient())
|
|
{
|
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
|
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
|
var req = new HttpRequestMessage(HttpMethod.Get, api_url);
|
|
var res = await client.SendAsync(req);
|
|
var result = await res.Content.ReadAsStringAsync();
|
|
evaluate_assign = JsonConvert.DeserializeObject<EvaluateChairmanAssignResponse>(result);
|
|
|
|
if (evaluate_assign.result != null)
|
|
{
|
|
var knowledge_level = new
|
|
{
|
|
col1 = evaluate_assign.result.evaluate.knowledge_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_assign.result.evaluate.knowledge_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_assign.result.evaluate.knowledge_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_assign.result.evaluate.knowledge_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_assign.result.evaluate.knowledge_level.col5 == "/" ? "✓" : string.Empty,
|
|
};
|
|
var apply_level = new
|
|
{
|
|
col1 = evaluate_assign.result.evaluate.apply_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_assign.result.evaluate.apply_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_assign.result.evaluate.apply_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_assign.result.evaluate.apply_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_assign.result.evaluate.apply_level.col5 == "/" ? "✓" : string.Empty,
|
|
};
|
|
var success_level = new
|
|
{
|
|
col1 = evaluate_assign.result.evaluate.success_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_assign.result.evaluate.success_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_assign.result.evaluate.success_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_assign.result.evaluate.success_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_assign.result.evaluate.success_level.col5 == "/" ? "✓" : string.Empty,
|
|
};
|
|
var achievement_other_level = new
|
|
{
|
|
col1 = evaluate_assign.result.evaluate.achievement_other_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_assign.result.evaluate.achievement_other_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_assign.result.evaluate.achievement_other_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_assign.result.evaluate.achievement_other_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_assign.result.evaluate.achievement_other_level.col5 == "/" ? "✓" : string.Empty,
|
|
};
|
|
|
|
var conduct_level = new
|
|
{
|
|
col1_1 = evaluate_assign.result.evaluate.conduct1_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_1 = evaluate_assign.result.evaluate.conduct1_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_1 = evaluate_assign.result.evaluate.conduct1_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_1 = evaluate_assign.result.evaluate.conduct1_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_1 = evaluate_assign.result.evaluate.conduct1_level.col5 == "/" ? "✓" : string.Empty,
|
|
|
|
col1_2 = evaluate_assign.result.evaluate.conduct2_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_2 = evaluate_assign.result.evaluate.conduct2_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_2 = evaluate_assign.result.evaluate.conduct2_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_2 = evaluate_assign.result.evaluate.conduct2_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_2 = evaluate_assign.result.evaluate.conduct2_level.col5 == "/" ? "✓" : string.Empty,
|
|
|
|
col1_3 = evaluate_assign.result.evaluate.conduct3_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_3 = evaluate_assign.result.evaluate.conduct3_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_3 = evaluate_assign.result.evaluate.conduct3_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_3 = evaluate_assign.result.evaluate.conduct3_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_3 = evaluate_assign.result.evaluate.conduct3_level.col5 == "/" ? "✓" : string.Empty,
|
|
|
|
col1_4 = evaluate_assign.result.evaluate.conduct4_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_4 = evaluate_assign.result.evaluate.conduct4_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_4 = evaluate_assign.result.evaluate.conduct4_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_4 = evaluate_assign.result.evaluate.conduct4_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_4 = evaluate_assign.result.evaluate.conduct4_level.col5 == "/" ? "✓" : string.Empty,
|
|
};
|
|
|
|
var moral_level = new
|
|
{
|
|
col1_1 = evaluate_assign.result.evaluate.moral1_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_1 = evaluate_assign.result.evaluate.moral1_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_1 = evaluate_assign.result.evaluate.moral1_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_1 = evaluate_assign.result.evaluate.moral1_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_1 = evaluate_assign.result.evaluate.moral1_level.col5 == "/" ? "✓" : string.Empty,
|
|
|
|
col1_2 = evaluate_assign.result.evaluate.moral2_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_2 = evaluate_assign.result.evaluate.moral2_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_2 = evaluate_assign.result.evaluate.moral2_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_2 = evaluate_assign.result.evaluate.moral2_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_2 = evaluate_assign.result.evaluate.moral2_level.col5 == "/" ? "✓" : string.Empty,
|
|
|
|
col1_3 = evaluate_assign.result.evaluate.moral3_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_3 = evaluate_assign.result.evaluate.moral3_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_3 = evaluate_assign.result.evaluate.moral3_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_3 = evaluate_assign.result.evaluate.moral3_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_3 = evaluate_assign.result.evaluate.moral3_level.col5 == "/" ? "✓" : string.Empty,
|
|
};
|
|
|
|
var discipline_level = new
|
|
{
|
|
col1_1 = evaluate_assign.result.evaluate.discipline1_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_1 = evaluate_assign.result.evaluate.discipline1_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_1 = evaluate_assign.result.evaluate.discipline1_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_1 = evaluate_assign.result.evaluate.discipline1_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_1 = evaluate_assign.result.evaluate.discipline1_level.col5 == "/" ? "✓" : string.Empty,
|
|
|
|
col1_2 = evaluate_assign.result.evaluate.discipline2_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_2 = evaluate_assign.result.evaluate.discipline2_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_2 = evaluate_assign.result.evaluate.discipline2_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_2 = evaluate_assign.result.evaluate.discipline2_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_2 = evaluate_assign.result.evaluate.discipline2_level.col5 == "/" ? "✓" : string.Empty,
|
|
|
|
col1_3 = evaluate_assign.result.evaluate.discipline3_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_3 = evaluate_assign.result.evaluate.discipline3_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_3 = evaluate_assign.result.evaluate.discipline3_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_3 = evaluate_assign.result.evaluate.discipline3_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_3 = evaluate_assign.result.evaluate.discipline3_level.col5 == "/" ? "✓" : string.Empty,
|
|
|
|
col1_4 = evaluate_assign.result.evaluate.discipline4_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_4 = evaluate_assign.result.evaluate.discipline4_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_4 = evaluate_assign.result.evaluate.discipline4_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_4 = evaluate_assign.result.evaluate.discipline4_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_4 = evaluate_assign.result.evaluate.discipline4_level.col5 == "/" ? "✓" : string.Empty,
|
|
|
|
col1_5 = evaluate_assign.result.evaluate.discipline5_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2_5 = evaluate_assign.result.evaluate.discipline5_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3_5 = evaluate_assign.result.evaluate.discipline5_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4_5 = evaluate_assign.result.evaluate.discipline5_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5_5 = evaluate_assign.result.evaluate.discipline5_level.col5 == "/" ? "✓" : string.Empty,
|
|
};
|
|
var behavior_other_level = new
|
|
{
|
|
col1 = evaluate_assign.result.evaluate.behavior_other_level.col1 == "/" ? "✓" : string.Empty,
|
|
col2 = evaluate_assign.result.evaluate.behavior_other_level.col2 == "/" ? "✓" : string.Empty,
|
|
col3 = evaluate_assign.result.evaluate.behavior_other_level.col3 == "/" ? "✓" : string.Empty,
|
|
col4 = evaluate_assign.result.evaluate.behavior_other_level.col4 == "/" ? "✓" : string.Empty,
|
|
col5 = evaluate_assign.result.evaluate.behavior_other_level.col5 == "/" ? "✓" : string.Empty,
|
|
};
|
|
var achievement_score = evaluate_assign.result.evaluate.achievement_score != null
|
|
? evaluate_assign.result.evaluate.achievement_score.ToThaiNumber()
|
|
: string.Empty;
|
|
var behavior_score = evaluate_assign.result.evaluate.behavior_score != null
|
|
? evaluate_assign.result.evaluate.behavior_score.ToThaiNumber()
|
|
: string.Empty;
|
|
var sum_score = evaluate_assign.result.evaluate.sum_score != null
|
|
? evaluate_assign.result.evaluate.sum_score.ToThaiNumber()
|
|
: string.Empty;
|
|
var achievement_percent = evaluate_assign.result.evaluate.achievement_percent != null
|
|
? evaluate_assign.result.evaluate.achievement_percent.ToThaiNumber()
|
|
: string.Empty;
|
|
var behavior_percent = evaluate_assign.result.evaluate.behavior_percent != null
|
|
? evaluate_assign.result.evaluate.behavior_percent.ToThaiNumber()
|
|
: string.Empty;
|
|
var sum_percent = evaluate_assign.result.evaluate.sum_percent != null
|
|
? evaluate_assign.result.evaluate.sum_percent.ToThaiNumber()
|
|
: string.Empty;
|
|
var develop_orientation_score = evaluate_assign.result.evaluate.develop_orientation_score != null
|
|
? evaluate_assign.result.evaluate.develop_orientation_score.ToThaiNumber()
|
|
: string.Empty;
|
|
var develop_self_learning_score = evaluate_assign.result.evaluate.develop_self_learning_score != null
|
|
? evaluate_assign.result.evaluate.develop_self_learning_score.ToThaiNumber()
|
|
: string.Empty;
|
|
var develop_training_seminar_score = evaluate_assign.result.evaluate.develop_training_seminar_score != null
|
|
? evaluate_assign.result.evaluate.develop_training_seminar_score.ToThaiNumber()
|
|
: string.Empty;
|
|
var develop_other_training_score = evaluate_assign.result.evaluate.develop_other_training_score != null
|
|
? evaluate_assign.result.evaluate.develop_other_training_score.ToThaiNumber()
|
|
: string.Empty;
|
|
var develop_total_score = evaluate_assign.result.evaluate.develop_total_score != null
|
|
? evaluate_assign.result.evaluate.develop_total_score.ToThaiNumber()
|
|
: string.Empty;
|
|
var develop_orientation_percent = evaluate_assign.result.evaluate.develop_orientation_percent != null
|
|
? evaluate_assign.result.evaluate.develop_orientation_percent.ToThaiNumber()
|
|
: string.Empty;
|
|
var develop_self_learning_percent = evaluate_assign.result.evaluate.develop_self_learning_percent != null
|
|
? evaluate_assign.result.evaluate.develop_self_learning_percent.ToThaiNumber()
|
|
: string.Empty;
|
|
var develop_training_seminar_percent = evaluate_assign.result.evaluate.develop_training_seminar_percent != null
|
|
? evaluate_assign.result.evaluate.develop_training_seminar_percent.ToThaiNumber()
|
|
: string.Empty;
|
|
var develop_other_training_percent = evaluate_assign.result.evaluate.develop_other_training_percent != null
|
|
? evaluate_assign.result.evaluate.develop_other_training_percent.ToThaiNumber()
|
|
: string.Empty;
|
|
var develop_total_percent = evaluate_assign.result.evaluate.develop_total_percent != null
|
|
? evaluate_assign.result.evaluate.develop_total_percent.ToThaiNumber()
|
|
: string.Empty;
|
|
|
|
return new
|
|
{
|
|
No = string.IsNullOrEmpty(evaluate_assign.result.evaluate.no.ToString()) ? string.Empty : evaluate_assign.result.evaluate.no.ToString().ToThaiNumber(),
|
|
EvaluateDateStart = string.IsNullOrEmpty(evaluate_assign.result.evaluate.date_start.ToString()) ? "-" : evaluate_assign.result.evaluate.date_start.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
EvaluateDateFinish = string.IsNullOrEmpty(evaluate_assign.result.evaluate.date_finish.ToString()) ? "-" : evaluate_assign.result.evaluate.date_finish.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
Name = string.IsNullOrEmpty(evaluate_assign.result.experimentee.name) ? string.Empty : evaluate_assign.result.experimentee.name,
|
|
Position = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Position) ? string.Empty : evaluate_assign.result.experimentee.Position,
|
|
PositionLevel = string.IsNullOrEmpty(evaluate_assign.result.experimentee.PositionLevelName) ? "-" : evaluate_assign.result.experimentee.PositionLevelName,
|
|
Department = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Department) ? string.Empty : evaluate_assign.result.experimentee.Department,
|
|
Organization = string.IsNullOrEmpty(evaluate_assign.result.experimentee.OrganizationOrganization) ? string.Empty : evaluate_assign.result.experimentee.OrganizationOrganization,
|
|
Oc = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Oc) ? string.Empty : evaluate_assign.result.experimentee.Oc,
|
|
DateStart = string.IsNullOrEmpty(evaluate_assign.result.assign.date_start.ToString()) ? "-" : evaluate_assign.result.assign.date_start.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
DateFinish = string.IsNullOrEmpty(evaluate_assign.result.assign.date_finish.ToString()) ? "-" : evaluate_assign.result.assign.date_finish.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
Knows = knowledge_level,
|
|
Applys = apply_level,
|
|
Success = success_level,
|
|
AchievementOthers = achievement_other_level,
|
|
AchievementOtherDesc = evaluate_assign.result.evaluate.achievement_other_desc,
|
|
Conducts = conduct_level,
|
|
Morals = moral_level,
|
|
Disciplines = discipline_level,
|
|
BehaviorOthers = behavior_other_level,
|
|
BehaviorOtherDesc = evaluate_assign.result.evaluate.behavior_other_desc,
|
|
AchievementScore = achievement_score,
|
|
BehaviorScore = behavior_score,
|
|
SumScore = sum_score,
|
|
AchievementPercent = achievement_percent,
|
|
BehaviorPercent = behavior_percent,
|
|
SumPercent = sum_percent,
|
|
AchievementResult1 = evaluate_assign.result.evaluate.achievement_result == 1 ? "✓" : string.Empty,
|
|
AchievementResult2 = evaluate_assign.result.evaluate.achievement_result == 1 ? string.Empty : "✓",
|
|
BehaviorResult1 = evaluate_assign.result.evaluate.behavior_result == 1 ? "✓" : string.Empty,
|
|
BehaviorResult2 = evaluate_assign.result.evaluate.behavior_result == 1 ? string.Empty : "✓",
|
|
DevelopOrientationScore = develop_orientation_score,
|
|
DevelopSelfLearningScore = develop_self_learning_score,
|
|
DevelopTrainingSeminarScore = develop_training_seminar_score,
|
|
DevelopOtherTrainingScore = develop_other_training_score,
|
|
DevelopTotalScore = develop_total_score,
|
|
DevelopOrientationPercent = develop_orientation_percent,
|
|
DevelopSelfLearningPercent = develop_self_learning_percent,
|
|
DevelopTrainingSeminarPercent = develop_training_seminar_percent,
|
|
DevelopOtherTrainingPercent = develop_other_training_percent,
|
|
DevelopTotalPercent = develop_total_percent,
|
|
DevelopResult1 = evaluate_assign.result.evaluate.develop_result == 1 ? "✓" : string.Empty,
|
|
DevelopResult2 = evaluate_assign.result.evaluate.develop_result == 0 ? "✓" : string.Empty,
|
|
EvaluateResult1 = evaluate_assign.result.evaluate.evaluate_result == 1 ? "🗹" : "☐",
|
|
EvaluateResult2 = evaluate_assign.result.evaluate.evaluate_result == 1 ? "☐" : "🗹",
|
|
ChairmanName = string.IsNullOrEmpty(evaluate_assign.result.chairman.name) ? string.Empty : evaluate_assign.result.chairman.name,
|
|
ChairmanPosition = string.IsNullOrEmpty(evaluate_assign.result.chairman.Position) ? string.Empty : evaluate_assign.result.chairman.Position,
|
|
ChairmanDated = string.IsNullOrEmpty(evaluate_assign.result.evaluate.chairman_dated.ToString()) ? "-" : evaluate_assign.result.evaluate.chairman_dated.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
Director1Name = string.IsNullOrEmpty(evaluate_assign.result.director1.name) ? string.Empty : evaluate_assign.result.director1.name,
|
|
Director1Position = string.IsNullOrEmpty(evaluate_assign.result.director1.Position) ? string.Empty : evaluate_assign.result.director1.Position,
|
|
Director1Dated = string.IsNullOrEmpty(evaluate_assign.result.evaluate.director1_dated.ToString()) ? "-" : evaluate_assign.result.evaluate.director1_dated.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
Director2Name = string.IsNullOrEmpty(evaluate_assign.result.director2.name) ? string.Empty : evaluate_assign.result.director2.name,
|
|
Director2Position = string.IsNullOrEmpty(evaluate_assign.result.director2.Position) ? string.Empty : evaluate_assign.result.director2.Position,
|
|
Director2Dated = string.IsNullOrEmpty(evaluate_assign.result.evaluate.director2_dated.ToString()) ? "-" : evaluate_assign.result.evaluate.director2_dated.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
};
|
|
}
|
|
else
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 18 แบบรายงานการประเมินผล (สำหรับประธาน และ กรณีขยายเวลา)
|
|
public async Task<object> GetEvaluateResultAssignAsync(Guid id, int no, string token)
|
|
{
|
|
var api_url = $"{_configuration["APIPROBATION"]}/evaluate-result?assign_id={id}&evaluate_no={no}";
|
|
EvaluateResultAssignResponse evaluate_assign;
|
|
using (var client = new HttpClient())
|
|
{
|
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
|
|
client.DefaultRequestHeaders.Add("api_key", _configuration["API_KEY"]);
|
|
var req = new HttpRequestMessage(HttpMethod.Get, api_url);
|
|
var res = await client.SendAsync(req);
|
|
var result = await res.Content.ReadAsStringAsync();
|
|
evaluate_assign = JsonConvert.DeserializeObject<EvaluateResultAssignResponse>(result);
|
|
|
|
if (evaluate_assign.result != null)
|
|
{
|
|
var expandMonth = string.IsNullOrEmpty(evaluate_assign.result.evaluate.expand_month.ToString()) ? string.Empty : evaluate_assign.result.evaluate.expand_month.ToString().ToThaiNumber();
|
|
var developComplete1 = evaluate_assign.result.evaluate.develop_complete == 1
|
|
? "🗹"
|
|
: "☐";
|
|
var developComplete2 = evaluate_assign.result.evaluate.develop_complete == 0
|
|
? "🗹"
|
|
: "☐";
|
|
var passResult1 = evaluate_assign.result.evaluate.pass_result == 1
|
|
? no == 1 ? "🗹 ไม่ต่ำกว่ามาตรฐานที่กำหนดเห็นควรให้ทดลองปฏิบัติหน้าที่ราชการต่อไป" : "🗹 ไม่ต่ำกว่ามาตรฐานที่กำหนด เห็นควรให้รับราชการต่อไป"
|
|
: no == 1 ? "☐ ไม่ต่ำกว่ามาตรฐานที่กำหนดเห็นควรให้ทดลองปฏิบัติหน้าที่ราชการต่อไป" : "☐ ไม่ต่ำกว่ามาตรฐานที่กำหนด เห็นควรให้รับราชการต่อไป";
|
|
var passResult2 = evaluate_assign.result.evaluate.pass_result == 2
|
|
? no == 1 ? "🗹 ต่ำกว่ามาตรฐานที่กำหนดเห็นควรให้ออกจากราชการ" : "🗹 ต่ำกว่ามาตรฐานที่กำหนด เห็นควรให้ออกราชการ"
|
|
: no == 1 ? "☐ ต่ำกว่ามาตรฐานที่กำหนดเห็นควรให้ออกจากราชการ" : "☐ ต่ำกว่ามาตรฐานที่กำหนด เห็นควรให้ออกราชการ";
|
|
var passResult3 = evaluate_assign.result.evaluate.pass_result == 3
|
|
? $"🗹 เห็นควรให้ขยายเวลาทดลองปฏิบัติหน้าที่ราชการต่อไปอีก {expandMonth} เดือน"
|
|
: "☐ เห็นควรให้ขยายเวลาทดลองปฏิบัติหน้าที่ราชการต่อไปอีก.....เดือน";
|
|
|
|
var passResult = evaluate_assign.result.evaluate.pass_result == 1
|
|
? no == 1 ? "เห็นควรให้ทดลองปฏิบัติหน้าที่ราชการต่อไป" : "เห็นควรให้รับราชการต่อไป"
|
|
: evaluate_assign.result.evaluate.pass_result == 2
|
|
? "เห็นควรให้ออกจากราชการ"
|
|
: $"เห็นควรให้ขยายเวลาทดลองปฏิบัติหน้าที่ราชการต่อไปอีก {expandMonth} เดือน";
|
|
|
|
CultureInfo provider = new CultureInfo("en-US");
|
|
DateTime date_start = DateTime.MinValue, date_finish = DateTime.MinValue;
|
|
if (evaluate_assign.result.assign.date_start != string.Empty && evaluate_assign.result.assign.date_finish != string.Empty)
|
|
{
|
|
date_start = DateTime.Parse(evaluate_assign.result.assign.date_start, provider);
|
|
date_finish = DateTime.Parse(evaluate_assign.result.assign.date_finish, provider);
|
|
}
|
|
var dateStart_ = date_start.ToThaiFullDate().ToString().ToThaiNumber();
|
|
var dateFinish_ = date_finish.ToThaiFullDate().ToString().ToThaiNumber();
|
|
return new
|
|
{
|
|
EvaluateDateStart = string.IsNullOrEmpty(evaluate_assign.result.evaluate.date_start.ToString()) ? "-" : evaluate_assign.result.evaluate.date_start.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
EvaluateDateFinish = string.IsNullOrEmpty(evaluate_assign.result.evaluate.date_start.ToString()) ? "-" : evaluate_assign.result.evaluate.date_start.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
Position = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Position) ? string.Empty : evaluate_assign.result.experimentee.Position,
|
|
PositionLevel = string.IsNullOrEmpty(evaluate_assign.result.experimentee.PositionLevelName) ? "-" : evaluate_assign.result.experimentee.PositionLevelName,
|
|
Department = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Department) ? string.Empty : evaluate_assign.result.experimentee.Department,
|
|
Organization = string.IsNullOrEmpty(evaluate_assign.result.experimentee.OrganizationOrganization) ? string.Empty : evaluate_assign.result.experimentee.OrganizationOrganization,
|
|
Oc = string.IsNullOrEmpty(evaluate_assign.result.experimentee.Oc) ? string.Empty : evaluate_assign.result.experimentee.Oc,
|
|
Reason = string.IsNullOrEmpty(evaluate_assign.result.evaluate.reson) ? string.Empty : evaluate_assign.result.evaluate.reson,
|
|
ExpandMonth = expandMonth,
|
|
ChairmanName = string.IsNullOrEmpty(evaluate_assign.result.chairman.name) ? string.Empty : evaluate_assign.result.chairman.name,
|
|
ChairmanPosition = string.IsNullOrEmpty(evaluate_assign.result.chairman.Position) ? string.Empty : evaluate_assign.result.chairman.Position,
|
|
ChairmanDate = string.IsNullOrEmpty(evaluate_assign.result.evaluate.chairman_dated.ToString()) ? "-" : evaluate_assign.result.evaluate?.chairman_dated?.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
CommanderName = string.IsNullOrEmpty(evaluate_assign.result.commander.name) ? string.Empty : evaluate_assign.result.commander.name,
|
|
CommanderPosition = string.IsNullOrEmpty(evaluate_assign.result.commander.Position) ? string.Empty : evaluate_assign.result.commander.Position,
|
|
CommanderDate = string.IsNullOrEmpty(evaluate_assign.result.evaluate.director1_dated.ToString()) ? "-" : evaluate_assign.result.evaluate?.director1_dated?.ToThaiFullDate().ToString().ToThaiNumber(),
|
|
Name = evaluate_assign.result.experimentee.name,
|
|
RoundNo = no.ToString().ToThaiNumber(),
|
|
DateStart = evaluate_assign.result.assign.date_start != string.Empty ? dateStart_ : "-",
|
|
DateFinish = evaluate_assign.result.assign.date_finish != string.Empty ? dateFinish_ : "-",
|
|
Develop1 = developComplete1,
|
|
Develop2 = developComplete2,
|
|
PassResult1 = passResult1,
|
|
PassResult2 = passResult2,
|
|
PassResult3 = passResult3,
|
|
PassResult = passResult,
|
|
};
|
|
}
|
|
else
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region ฟังก์ชั่นแปลงวันเดือนปี
|
|
//public static string ConvertDateMonthYear(string year, string month, string date)
|
|
//{
|
|
// year = year.ToInteger().ToThaiYear().ToString().ToThaiNumber();
|
|
// month = month.ToInteger().ToThaiMonth();
|
|
// date = date.StartsWith("0") ? date.Substring(1).ToThaiNumber() : date.ToThaiNumber();
|
|
|
|
// return $"วันที่ {date} เดือน {month} พ.ศ. {year}";
|
|
//}
|
|
#endregion
|
|
|
|
#endregion
|
|
public async Task NotifyProbation()
|
|
{
|
|
var cronjobNotis = await _dbContext.Set<CronjobNotiProbation>()
|
|
.AsQueryable()
|
|
.ToListAsync();
|
|
foreach (var cronjobNoti in cronjobNotis)
|
|
{
|
|
if (cronjobNoti.ReceiveDate.Date == DateTime.Now.Date && cronjobNoti.IsSendNoti == false)
|
|
{
|
|
await _repositoryNoti.PushNotificationAsync(
|
|
cronjobNoti.ReceiverUserId,
|
|
cronjobNoti.Subject,
|
|
cronjobNoti.Body,
|
|
cronjobNoti.Payload,
|
|
"",
|
|
cronjobNoti.IsSendInbox,
|
|
cronjobNoti.IsSendMail
|
|
);
|
|
cronjobNoti.IsSendNoti = true;
|
|
}
|
|
}
|
|
await _dbContext.SaveChangesAsync();
|
|
}
|
|
}
|
|
}
|