diff --git a/ApiControllers/eva_adjust_postponement_detail_normalControllers.cs b/ApiControllers/eva_adjust_postponement_detail_normalControllers.cs index 54e1aea..4c0f470 100644 --- a/ApiControllers/eva_adjust_postponement_detail_normalControllers.cs +++ b/ApiControllers/eva_adjust_postponement_detail_normalControllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_adjust_postponement_detail_normal_02Controllers.cs b/ApiControllers/eva_adjust_postponement_detail_normal_02Controllers.cs index cbc6a29..c434898 100644 --- a/ApiControllers/eva_adjust_postponement_detail_normal_02Controllers.cs +++ b/ApiControllers/eva_adjust_postponement_detail_normal_02Controllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_adjust_postponement_detail_quotaControllers.cs b/ApiControllers/eva_adjust_postponement_detail_quotaControllers.cs index 83d6c9c..66e9025 100644 --- a/ApiControllers/eva_adjust_postponement_detail_quotaControllers.cs +++ b/ApiControllers/eva_adjust_postponement_detail_quotaControllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_adjust_postponement_detail_quota_02Controllers.cs b/ApiControllers/eva_adjust_postponement_detail_quota_02Controllers.cs index 77753ec..fc4662c 100644 --- a/ApiControllers/eva_adjust_postponement_detail_quota_02Controllers.cs +++ b/ApiControllers/eva_adjust_postponement_detail_quota_02Controllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_adjust_postponement_normalControllers.cs b/ApiControllers/eva_adjust_postponement_normalControllers.cs index aa7c849..e413e77 100644 --- a/ApiControllers/eva_adjust_postponement_normalControllers.cs +++ b/ApiControllers/eva_adjust_postponement_normalControllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_adjust_postponement_quotaControllers.cs b/ApiControllers/eva_adjust_postponement_quotaControllers.cs index d606f8d..7ee3702 100644 --- a/ApiControllers/eva_adjust_postponement_quotaControllers.cs +++ b/ApiControllers/eva_adjust_postponement_quotaControllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_create_evaluationControllers.cs b/ApiControllers/eva_create_evaluationControllers.cs index a386379..0203ebb 100644 --- a/ApiControllers/eva_create_evaluationControllers.cs +++ b/ApiControllers/eva_create_evaluationControllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_create_evaluation_detailControllers.cs b/ApiControllers/eva_create_evaluation_detailControllers.cs index 4a89f54..f41833c 100644 --- a/ApiControllers/eva_create_evaluation_detailControllers.cs +++ b/ApiControllers/eva_create_evaluation_detailControllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_create_evaluation_detail_review01Controllers.cs b/ApiControllers/eva_create_evaluation_detail_review01Controllers.cs index 799987e..e9170f7 100644 --- a/ApiControllers/eva_create_evaluation_detail_review01Controllers.cs +++ b/ApiControllers/eva_create_evaluation_detail_review01Controllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_create_evaluation_detail_review02Controllers.cs b/ApiControllers/eva_create_evaluation_detail_review02Controllers.cs index 136fd86..211da06 100644 --- a/ApiControllers/eva_create_evaluation_detail_review02Controllers.cs +++ b/ApiControllers/eva_create_evaluation_detail_review02Controllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_create_evaluation_detail_review03Controllers.cs b/ApiControllers/eva_create_evaluation_detail_review03Controllers.cs index 6e86f8e..3bb0404 100644 --- a/ApiControllers/eva_create_evaluation_detail_review03Controllers.cs +++ b/ApiControllers/eva_create_evaluation_detail_review03Controllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_create_evaluation_detail_review04Controllers.cs b/ApiControllers/eva_create_evaluation_detail_review04Controllers.cs index b712a7f..e6425c1 100644 --- a/ApiControllers/eva_create_evaluation_detail_review04Controllers.cs +++ b/ApiControllers/eva_create_evaluation_detail_review04Controllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_create_evaluation_detail_statusControllers.cs b/ApiControllers/eva_create_evaluation_detail_statusControllers.cs index ea4d2c7..2cb7e31 100644 --- a/ApiControllers/eva_create_evaluation_detail_statusControllers.cs +++ b/ApiControllers/eva_create_evaluation_detail_statusControllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_create_evaluation_detail_summary1Controllers.cs b/ApiControllers/eva_create_evaluation_detail_summary1Controllers.cs index f24e749..fa54f68 100644 --- a/ApiControllers/eva_create_evaluation_detail_summary1Controllers.cs +++ b/ApiControllers/eva_create_evaluation_detail_summary1Controllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_create_evaluation_detail_summary2Controllers.cs b/ApiControllers/eva_create_evaluation_detail_summary2Controllers.cs index e5ef5ba..6139d64 100644 --- a/ApiControllers/eva_create_evaluation_detail_summary2Controllers.cs +++ b/ApiControllers/eva_create_evaluation_detail_summary2Controllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_evaluation_achievementControllers.cs b/ApiControllers/eva_evaluation_achievementControllers.cs index c43a6bc..055ef5c 100644 --- a/ApiControllers/eva_evaluation_achievementControllers.cs +++ b/ApiControllers/eva_evaluation_achievementControllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_evaluation_achievement_process2Controllers.cs b/ApiControllers/eva_evaluation_achievement_process2Controllers.cs index 3361d50..a5e1968 100644 --- a/ApiControllers/eva_evaluation_achievement_process2Controllers.cs +++ b/ApiControllers/eva_evaluation_achievement_process2Controllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_evaluation_achievement_processControllers.cs b/ApiControllers/eva_evaluation_achievement_processControllers.cs index 2716ac2..b42b558 100644 --- a/ApiControllers/eva_evaluation_achievement_processControllers.cs +++ b/ApiControllers/eva_evaluation_achievement_processControllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_evaluation_behaviorControllers.cs b/ApiControllers/eva_evaluation_behaviorControllers.cs index 3e160dc..5457ff7 100644 --- a/ApiControllers/eva_evaluation_behaviorControllers.cs +++ b/ApiControllers/eva_evaluation_behaviorControllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_evaluation_behavior_process2Controllers.cs b/ApiControllers/eva_evaluation_behavior_process2Controllers.cs index e8ef137..3b555a9 100644 --- a/ApiControllers/eva_evaluation_behavior_process2Controllers.cs +++ b/ApiControllers/eva_evaluation_behavior_process2Controllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_evaluation_behavior_processControllers.cs b/ApiControllers/eva_evaluation_behavior_processControllers.cs index b6d65ae..7e15b65 100644 --- a/ApiControllers/eva_evaluation_behavior_processControllers.cs +++ b/ApiControllers/eva_evaluation_behavior_processControllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_evaluation_groupControllers.cs b/ApiControllers/eva_evaluation_groupControllers.cs index f326ea0..959ce38 100644 --- a/ApiControllers/eva_evaluation_groupControllers.cs +++ b/ApiControllers/eva_evaluation_groupControllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_evaluation_group_detailControllers.cs b/ApiControllers/eva_evaluation_group_detailControllers.cs index beb44b3..bb71407 100644 --- a/ApiControllers/eva_evaluation_group_detailControllers.cs +++ b/ApiControllers/eva_evaluation_group_detailControllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_level_scoreControllers.cs b/ApiControllers/eva_level_scoreControllers.cs index 949afd3..2ca61a8 100644 --- a/ApiControllers/eva_level_scoreControllers.cs +++ b/ApiControllers/eva_level_scoreControllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_level_score_basicControllers.cs b/ApiControllers/eva_level_score_basicControllers.cs index 133cada..fd58cf6 100644 --- a/ApiControllers/eva_level_score_basicControllers.cs +++ b/ApiControllers/eva_level_score_basicControllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_performance_planControllers.cs b/ApiControllers/eva_performance_planControllers.cs index 5550460..1308c81 100644 --- a/ApiControllers/eva_performance_planControllers.cs +++ b/ApiControllers/eva_performance_planControllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_performance_plan_detailControllers.cs b/ApiControllers/eva_performance_plan_detailControllers.cs index a66a7d0..aac6b44 100644 --- a/ApiControllers/eva_performance_plan_detailControllers.cs +++ b/ApiControllers/eva_performance_plan_detailControllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_promoted_percentageControllers.cs b/ApiControllers/eva_promoted_percentageControllers.cs index f629a39..1a74b13 100644 --- a/ApiControllers/eva_promoted_percentageControllers.cs +++ b/ApiControllers/eva_promoted_percentageControllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/eva_salary_cylinderControllers.cs b/ApiControllers/eva_salary_cylinderControllers.cs index 25d99f5..8216f88 100644 --- a/ApiControllers/eva_salary_cylinderControllers.cs +++ b/ApiControllers/eva_salary_cylinderControllers.cs @@ -304,7 +304,7 @@ namespace TodoAPI2.Controllers catch (Exception ex) { _logger.LogCritical($"Exception while delete {id.ToString()}.", ex); - return StatusCode(500, $"Exception while delete {id.ToString()}. {ex.Message}"); + return StatusCode(500, $"ไม่สามารถลบข้อมูลได้ เพราะข้อมูลถูกใช้ในส่วนงานอื่น"); } } diff --git a/ApiControllers/rep_leave_total_02Controllers.cs b/ApiControllers/rep_leave_total_02Controllers.cs new file mode 100644 index 0000000..c9c1dcf --- /dev/null +++ b/ApiControllers/rep_leave_total_02Controllers.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Authorization; +using Microsoft.Extensions.Logging; +using TTSW.Controllers; +using TTSW.EF; +using TTSW.Utils; +using TTSW.Constant; +using TTSW.Common; +using TodoAPI2.Models; +using System.Data; +using Microsoft.Extensions.Configuration; +using System.IO; +using System.Net; + +namespace TodoAPI2.Controllers +{ + //[Authorize] + [Produces("application/json")] + [Route("api/rep_leave_total_02")] + public class rep_leave_total_02Controller : BaseController + { + #region Private Variables + private ILogger _logger; + private Irep_leave_total_02Service _repository; + private IConfiguration Configuration { get; set; } + #endregion + + #region Properties + + #endregion + + /// + /// Default constructure for dependency injection + /// + /// + /// + /// + public rep_leave_total_02Controller(ILogger logger, Irep_leave_total_02Service repository, IConfiguration configuration) + { + _logger = logger; + _repository = repository; + Configuration = configuration; + } + + + /// + /// Get Blank Item + /// + /// + /// + /// Return a blank item + /// Returns the item + /// Error Occurred + [HttpGet("GetBlankItem")] + [ProducesResponseType(typeof(rep_leave_total_02WithSelectionViewModel), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult GetBlankItem() + { + try + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); + var result = _repository.GetBlankItem(); + + return Ok(result); + } + catch (Exception ex) + { + _logger.LogCritical($"Exception in IActionResult GetBlankItem.", ex); + return StatusCode(500, $"{ex.Message}"); + } + } + + /// + /// Download Report + /// + /// + /// + /// Return list of items by specifced keyword + /// Returns the item + /// Error Occurred + [HttpGet("rep_leave_total_02_report")] + [ProducesResponseType(typeof(FileStreamResult), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult rep_leave_total_02_report(rep_leave_total_02ReportRequestModel model) + { + try + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); + var httpclient = new WebClient(); + var env_mainurl = Environment.GetEnvironmentVariable("JasperReportServer_MainURL"); + var env_reportsite = Environment.GetEnvironmentVariable("JasperReportServer_reportsite"); + var env_username = Environment.GetEnvironmentVariable("JasperReportServer_username"); + var env_password = Environment.GetEnvironmentVariable("JasperReportServer_password"); + + string mainurl = !string.IsNullOrEmpty(env_mainurl) ? env_mainurl : Configuration["JasperReportServer:MainURL"]; + string reportsite = !string.IsNullOrEmpty(env_reportsite) ? env_reportsite : Configuration["JasperReportServer:reportsite"]; + string username = !string.IsNullOrEmpty(env_username) ? env_username : Configuration["JasperReportServer:username"]; + string password = !string.IsNullOrEmpty(env_password) ? env_password : Configuration["JasperReportServer:password"]; + + string url = $"{mainurl}{reportsite}/rep_leave_total_02.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}"; + + var data = httpclient.DownloadData(url); + var stream = new MemoryStream(data); + + return File(stream, model.contentType); + } + catch (Exception ex) + { + _logger.LogCritical($"Exception while GetReport.", ex); + return StatusCode(500, $"{ex.Message}"); + } + } + + } +} diff --git a/EXCEL/eva_create_evaluation_detail.xlsx b/EXCEL/eva_create_evaluation_detail.xlsx index a302de2..dd89752 100644 Binary files a/EXCEL/eva_create_evaluation_detail.xlsx and b/EXCEL/eva_create_evaluation_detail.xlsx differ diff --git a/EXCEL/eva_level_score@rep_leave_total_02.xlsx b/EXCEL/eva_level_score@rep_leave_total_02.xlsx new file mode 100644 index 0000000..d62cfa5 Binary files /dev/null and b/EXCEL/eva_level_score@rep_leave_total_02.xlsx differ diff --git a/Models/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02Service.cs b/Models/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02Service.cs index e2ce1d5..b85e249 100644 --- a/Models/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02Service.cs +++ b/Models/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02Service.cs @@ -110,7 +110,16 @@ namespace TodoAPI2.Models && (m_eva_adjust_postponement_detail_normal_02.adjust_postponement_id == model.adjust_postponement_id || !model.adjust_postponement_id.HasValue) && fk_create_detailResult.employee_id == m_eva_adjust_postponement_detail_normal_02.employee_id - orderby fk_external_linkageResult2.department_name, fk_external_linkageResult2.fullname + orderby + // 1. ให้แสดงรายชื่อพนักงานตามลำดับก่อน-หลัง ของประเภทหน่วยงานที่กำหนดให้กับหน่วยงาน (ตรวจสอบจากฟิลด์ลำดับที่ของประเภทหน่วยงาน(department_degree_id) จากน้อยไปมาก) + fk_external_linkageResult2.department_degree_id, + // กรณีที่มีรายชื่อหน่วยงานที่อยู่ระดับเดียวกันมากกว่า 1 หน่วยงาน ให้จัดเรียงข้อมูลตามลำดับประเภทหน่วยงานก่อน และตามด้วยลำดับที่ของหน่วยงาน จากตารางกำหนดหน่วยงาน ฟิลด์ ลำดับ(department_code) จากน้อยไปมาก + // 2. แสดงรายชื่อพนักงานที่อยู่ในหน่วยงานย่อยตามโครงสร้างองค์กรและจัดเรียงหน่วยงานย่อยโดยจัดเรียงตามลำดับ(department_code) จากน้อยไปมาก โดยจัดกลุ่มแสดงรายชื่อพนักงานเป็นหน่วยงาน + fk_external_linkageResult2.department_code, + // 3.การแสดงรายชื่อพนักงานในแต่ละหน่วยงาน ให้ระบบจัดเรียงรายชื่อพนักงานตามระดับตำแหน่ง โดยเรียงจากน้อยไปมาก ตรวจสอบลำดับระดับตำแหน่ง ได้จาก ฟิลด์ “ลำดับ” (position_level_id) + fk_external_linkageResult2.position_level_id, + // 4. กรณีที่ ในหน่วยนั้นๆ มีระดับตำแหน่งเหมือนกันมากกว่า 1 คน ให้ระบบจัดเรียงรายชื่อพนักงานตามรหัสพนักงานตรวจได้จากฟิลด์ “รหัสพนักงาน”( employee_no) จากน้อยไปมาก + fk_external_linkageResult2.employee_no select new eva_adjust_postponement_detail_normal_02ViewModel() { id = m_eva_adjust_postponement_detail_normal_02.id, diff --git a/Models/eva_adjust_postponement_detail_quota_02/eva_adjust_postponement_detail_quota_02Service.cs b/Models/eva_adjust_postponement_detail_quota_02/eva_adjust_postponement_detail_quota_02Service.cs index 4968bb1..ebf926e 100644 --- a/Models/eva_adjust_postponement_detail_quota_02/eva_adjust_postponement_detail_quota_02Service.cs +++ b/Models/eva_adjust_postponement_detail_quota_02/eva_adjust_postponement_detail_quota_02Service.cs @@ -114,7 +114,10 @@ namespace TodoAPI2.Models && (m_eva_adjust_postponement_detail_quota_02.adjust_postponement_quota_id == model.adjust_postponement_quota_id || !model.adjust_postponement_quota_id.HasValue) && (fk_create_detailResult.employee_id == m_eva_adjust_postponement_detail_quota_02.employee_id || fk_create_detailResult == null) - orderby fk_external_linkageResult2.department_name, fk_external_linkageResult2.fullname + orderby fk_external_linkageResult2.department_degree_id, + fk_external_linkageResult2.department_code, + fk_external_linkageResult2.position_level_id, + fk_external_linkageResult2.employee_no select new eva_adjust_postponement_detail_quota_02ViewModel() { id = m_eva_adjust_postponement_detail_quota_02.id, diff --git a/Models/eva_create_evaluation/eva_create_evaluationService.cs b/Models/eva_create_evaluation/eva_create_evaluationService.cs index 2c392ca..ea57716 100644 --- a/Models/eva_create_evaluation/eva_create_evaluationService.cs +++ b/Models/eva_create_evaluation/eva_create_evaluationService.cs @@ -144,7 +144,7 @@ namespace TodoAPI2.Models supervisor1_id = m_eva_create_evaluation.supervisor1_id, supervisor2_id = m_eva_create_evaluation.supervisor2_id, - performance_plan_id_eva_performance_plan_fiscal_year = fk_eva_performance_planResult1.fiscal_year, + performance_plan_id_eva_performance_plan_fiscal_year = fk_eva_performance_planResult1.display_text, employee_id_external_linkage_external_name = fk_external_linkageResult2.fullname, evaluation_group_id_eva_evaluation_group_code = fk_eva_evaluation_groupResult5.code, evaluation_group_id_eva_evaluation_group_name = fk_eva_evaluation_groupResult5.thegroup, diff --git a/Models/eva_create_evaluation/eva_create_evaluationViewModel.cs b/Models/eva_create_evaluation/eva_create_evaluationViewModel.cs index ceb5828..0dabdf5 100644 --- a/Models/eva_create_evaluation/eva_create_evaluationViewModel.cs +++ b/Models/eva_create_evaluation/eva_create_evaluationViewModel.cs @@ -28,7 +28,7 @@ namespace TodoAPI2.Models public int? supervisor2_id { get; set; } - public int? performance_plan_id_eva_performance_plan_fiscal_year { get; set; } + public string performance_plan_id_eva_performance_plan_fiscal_year { get; set; } public string employee_id_external_linkage_external_name { get; set; } public string evaluation_group_id_eva_evaluation_group_code { get; set; } @@ -42,9 +42,7 @@ namespace TodoAPI2.Models { string y = ""; - if (performance_plan_id_eva_performance_plan_fiscal_year.HasValue) y = performance_plan_id_eva_performance_plan_fiscal_year.ToString(); - - return evaluation_group_id_eva_evaluation_group_name + " ปี " +y; + return evaluation_group_id_eva_evaluation_group_name + " " + performance_plan_id_eva_performance_plan_fiscal_year; } } } diff --git a/Models/eva_create_evaluation_detail/eva_create_evaluation_detailService.cs b/Models/eva_create_evaluation_detail/eva_create_evaluation_detailService.cs index 6f8c89a..8c824ed 100644 --- a/Models/eva_create_evaluation_detail/eva_create_evaluation_detailService.cs +++ b/Models/eva_create_evaluation_detail/eva_create_evaluation_detailService.cs @@ -114,12 +114,11 @@ namespace TodoAPI2.Models join fk_external_linkage25 in ext.GetAgreeDisagree() on m_eva_create_evaluation_detail.supervisor2_result equals fk_external_linkage25.external_code into external_linkageResult25 from fk_external_linkageResult25 in external_linkageResult25.DefaultIfEmpty() - - + where 1 ==1 && (m_eva_create_evaluation_detail.create_evaluation_id == model.create_evaluation_id || !model.create_evaluation_id.HasValue) - orderby m_eva_create_evaluation_detail.created descending + orderby fk_external_linkageResult2.department_code, fk_external_linkageResult2.position_level_id select new eva_create_evaluation_detailViewModel() { id = m_eva_create_evaluation_detail.id, @@ -165,6 +164,13 @@ namespace TodoAPI2.Models position_level_text = fk_external_linkageResult2.position_level_text, position_type_text = fk_external_linkageResult2.position_type_name, + employee_no = fk_external_linkageResult2.employee_no, + position_number = fk_external_linkageResult2.position_number, + position_name = fk_external_linkageResult2.position_name, + remark = null, + + department_name = fk_external_linkageResult2.department_name, + isActive = m_eva_create_evaluation_detail.isActive, Created = m_eva_create_evaluation_detail.created, Updated = m_eva_create_evaluation_detail.updated diff --git a/Models/eva_create_evaluation_detail/eva_create_evaluation_detailViewModel.cs b/Models/eva_create_evaluation_detail/eva_create_evaluation_detailViewModel.cs index c7b95c1..83621fb 100644 --- a/Models/eva_create_evaluation_detail/eva_create_evaluation_detailViewModel.cs +++ b/Models/eva_create_evaluation_detail/eva_create_evaluation_detailViewModel.cs @@ -89,5 +89,13 @@ namespace TodoAPI2.Models public string position_type_text { get; set; } public string position_level_text { get; set; } + + public string employee_no { get; set; } + + public string position_number { get; set; } + + public string position_name { get; set; } + public string remark { get; set; } + public string department_name { get; set; } } } \ No newline at end of file diff --git a/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementService.cs b/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementService.cs index 84fa42f..503ec36 100644 --- a/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementService.cs +++ b/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementService.cs @@ -82,7 +82,7 @@ namespace TodoAPI2.Models select new eva_create_evaluation_detail_agreementWithSelectionViewModel() { id = m_eva_create_evaluation_detail_agreement.id, - evaluation_round = fk_eva_create_evaluationResult10.eva_performance_plan.theTime.ToString(), + evaluation_round = fk_eva_create_evaluationResult10.eva_performance_plan.display_text, employee_code = fk_external_employee.employee_no, employee_fullname = fk_external_employee.fullname, employee_position = fk_external_employee.position_name, @@ -101,6 +101,8 @@ namespace TodoAPI2.Models org_id_external_linkage_external_name = fk_external_employee.department_name, + remark_hrm_work_record = fk_external_employee.remark_hrm_work_record, + isActive = m_eva_create_evaluation_detail_agreement.isActive, Created = m_eva_create_evaluation_detail_agreement.created, Updated = m_eva_create_evaluation_detail_agreement.updated diff --git a/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementViewModel.cs b/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementViewModel.cs index 50a4835..0d9af56 100644 --- a/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementViewModel.cs +++ b/Models/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreementViewModel.cs @@ -48,5 +48,7 @@ namespace TodoAPI2.Models public string status_supervisor { get; set; } + public string remark_hrm_work_record { get; set; } + } } \ No newline at end of file diff --git a/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processService.cs b/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processService.cs index 012a825..ac9aceb 100644 --- a/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processService.cs +++ b/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processService.cs @@ -81,7 +81,7 @@ namespace TodoAPI2.Models select new eva_create_evaluation_detail_processWithSelectionViewModel() { id = m_eva_create_evaluation_detail_process.id, - evaluation_round = fk_eva_create_evaluationResult10.eva_performance_plan.theTime.ToString(), + evaluation_round = fk_eva_create_evaluationResult10.eva_performance_plan.display_text, employee_code = fk_external_employee.employee_no, employee_fullname = fk_external_employee.fullname, employee_position = fk_external_employee.position_name, @@ -120,6 +120,8 @@ namespace TodoAPI2.Models fk_eva_create_evaluationResult10.supervisor1_id, fk_eva_create_evaluationResult10.supervisor2_id), + remark_hrm_work_record = fk_external_employee.remark_hrm_work_record, + isActive = m_eva_create_evaluation_detail_process.isActive, Created = m_eva_create_evaluation_detail_process.created, Updated = m_eva_create_evaluation_detail_process.updated @@ -188,7 +190,10 @@ namespace TodoAPI2.Models || (fk_eva_create_evaluationResult10.supervisor2_id.HasValue && emp_id == fk_eva_create_evaluationResult10.supervisor2_id) ) - orderby m_eva_create_evaluation_detail_process.created descending + orderby fk_external_employee.department_degree_id, + fk_external_employee.department_code, + fk_external_employee.position_level_id, + fk_external_employee.employee_no select new eva_create_evaluation_detail_processViewModel() { id = m_eva_create_evaluation_detail_process.id, diff --git a/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processViewModel.cs b/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processViewModel.cs index 37c449c..eb146e7 100644 --- a/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processViewModel.cs +++ b/Models/eva_create_evaluation_detail_process/eva_create_evaluation_detail_processViewModel.cs @@ -58,6 +58,8 @@ namespace TodoAPI2.Models public string role_desc { get; set; } public string role_code { get; set; } + + public string remark_hrm_work_record { get; set; } } } diff --git a/Models/eva_evaluation_group_detail/eva_evaluation_group_detailService.cs b/Models/eva_evaluation_group_detail/eva_evaluation_group_detailService.cs index 7dfcbc1..2141414 100644 --- a/Models/eva_evaluation_group_detail/eva_evaluation_group_detailService.cs +++ b/Models/eva_evaluation_group_detail/eva_evaluation_group_detailService.cs @@ -92,37 +92,10 @@ namespace TodoAPI2.Models public List GetListByevaluation_group_id(Guid? evaluation_group_id) { - var data = ( - from m_eva_evaluation_group_detail in _repository.Context.eva_evaluation_group_detail + eva_evaluation_group_detailSearchModel model = new eva_evaluation_group_detailSearchModel(); + model.evaluation_group_id = evaluation_group_id; - join fk_eva_evaluation_group1 in _repository.Context.eva_evaluation_group on m_eva_evaluation_group_detail.evaluation_group_id equals fk_eva_evaluation_group1.id - into eva_evaluation_groupResult1 - from fk_eva_evaluation_groupResult1 in eva_evaluation_groupResult1.DefaultIfEmpty() - - join fk_external_employee in external_employee.GetListByemployee_type(null, null) on m_eva_evaluation_group_detail.employee_id equals fk_external_employee.id - into external_employeeResult - from fk_external_employeeResult in external_employeeResult.DefaultIfEmpty() - - where m_eva_evaluation_group_detail.evaluation_group_id == evaluation_group_id || !evaluation_group_id.HasValue - - orderby m_eva_evaluation_group_detail.created descending - select new eva_evaluation_group_detailViewModel() - { - id = m_eva_evaluation_group_detail.id, - evaluation_group_id = m_eva_evaluation_group_detail.evaluation_group_id, - employee_id = m_eva_evaluation_group_detail.employee_id, - - evaluation_group_id_eva_evaluation_group_code = fk_eva_evaluation_groupResult1.code, - - position_number = fk_external_employeeResult.position_number, - position_name = fk_external_employeeResult.position_name, - fullname = fk_external_employeeResult.fullname, - - isActive = m_eva_evaluation_group_detail.isActive, - Created = m_eva_evaluation_group_detail.created, - Updated = m_eva_evaluation_group_detail.updated - } - ).ToList(); + var data = GetListBySearch(model); return data; } @@ -143,8 +116,11 @@ namespace TodoAPI2.Models where 1==1 && (m_eva_evaluation_group_detail.evaluation_group_id == model.evaluation_group_id || !model.evaluation_group_id.HasValue) - - orderby m_eva_evaluation_group_detail.created descending + orderby + fk_external_employeeResult.department_degree_id, + fk_external_employeeResult.department_code, + fk_external_employeeResult.position_level_id, + fk_external_employeeResult.employee_no select new eva_evaluation_group_detailViewModel() { id = m_eva_evaluation_group_detail.id, @@ -157,6 +133,10 @@ namespace TodoAPI2.Models position_name = fk_external_employeeResult.position_name, fullname = fk_external_employeeResult.fullname, + department_name = fk_external_employeeResult.department_name, + position_level_text = fk_external_employeeResult.position_level_text, + employee_no = fk_external_employeeResult.employee_no, + isActive = m_eva_evaluation_group_detail.isActive, Created = m_eva_evaluation_group_detail.created, Updated = m_eva_evaluation_group_detail.updated diff --git a/Models/eva_evaluation_group_detail/eva_evaluation_group_detailViewModel.cs b/Models/eva_evaluation_group_detail/eva_evaluation_group_detailViewModel.cs index e4e5be5..62f62a6 100644 --- a/Models/eva_evaluation_group_detail/eva_evaluation_group_detailViewModel.cs +++ b/Models/eva_evaluation_group_detail/eva_evaluation_group_detailViewModel.cs @@ -26,5 +26,9 @@ namespace TodoAPI2.Models public string fullname { get; set; } + public string department_name { get; set; } + public string position_level_text { get; set; } + public string employee_no { get; set; } } -} \ No newline at end of file +} + diff --git a/Models/eva_performance_plan/eva_performance_planEntity.cs b/Models/eva_performance_plan/eva_performance_planEntity.cs index 2e00fa6..726d0e2 100644 --- a/Models/eva_performance_plan/eva_performance_planEntity.cs +++ b/Models/eva_performance_plan/eva_performance_planEntity.cs @@ -19,6 +19,20 @@ namespace TodoAPI2.Models public int? theTime { get; set; } - + [NotMapped] + public string display_text + { + get + { + if(!theTime.HasValue || !fiscal_year.HasValue) + { + return ""; + } + else + { + return theTime.ToString() + "/" + fiscal_year.ToString(); + } + } + } } } diff --git a/Models/external_employee/external_employeeService.cs b/Models/external_employee/external_employeeService.cs index 555c622..9ccaa03 100644 --- a/Models/external_employee/external_employeeService.cs +++ b/Models/external_employee/external_employeeService.cs @@ -72,7 +72,18 @@ CONCAT(he.firstname,he.lastname) as halfname, orgdata.id as department_id,orgdata.department_name,orgdata.department_code,he.salary, he.employee_type_id, het.employee_type_name,opd.position_id as position_id, u.email as user_email, u.id as user_id,hpl.position_level_name,he.position_level_id, -he.position_type_id,hpt.position_type_name,he.packing_date +he.position_type_id,hpt.position_type_name,he.packing_date, + +(CASE WHEN (SELECT hrm_work_rec.id FROM hrm_working_records as hrm_work_rec + WHERE hrm_work_rec.employee_id = he.employee_id + AND hrm_work_rec.start_date <= now() + AND hrm_work_rec.end_date >= now() + AND hrm_work_rec.deleted_at IS null + LIMIT 1) IS NOT null THEN 'ช่วยปฎิบัติหน้าที่' +ELSE null END) as remark_hrm_work_record, + +org_type_depart.department_degree_id + from public.hrm_employees as he left join public.hrm_position_types as hpt on he.position_type_id=hpt.id left join public.hrm_position_levels as hpl on he.position_level_id = hpl.id @@ -82,9 +93,21 @@ left join public.hrm_title_masters as htm on htm.id = he.prefix_card_name left join public.{0}DepartmentData{0} as orgdata on orgdata.id = he.department_id left join public.hrm_employee_types as het on het.id = he.employee_type_id left join public.users as u on u.employee_id = he.employee_id -where he.workingstatus = 'สถานะปฏิบัติงาน' and he.deleted_at is null and mpn.deleted_at is null -and opd.deleted_at is null --and htm.deleted_at is null -order by he.firstname,he.lastname; +left join public.org_type_departments as org_type_depart on orgdata.department_type_id = org_type_depart.id +left join public.org_type_department_colors as org_depart_color on org_type_depart.department_degree_id = org_depart_color.id +where he.deleted_at is null +and hpt.deleted_at is null +and hpl.deleted_at is null +and mpn.deleted_at is null +and opd.deleted_at is null +and htm.deleted_at is null +and orgdata.deleted_at is null +and het.deleted_at is null +and u.deleted_at is null +and org_type_depart.deleted_at is null +and org_depart_color.deleted_at is null +and he.workingstatus = 'สถานะปฏิบัติงาน' +order by he.firstname, he.lastname; ", '"'.ToString()); var para = db.GetParameterListNpgsql(); DataTable dt = db.ExecuteDataTableNpgsql(sql, para); @@ -143,6 +166,14 @@ order by he.firstname,he.lastname; { i.packing_date = Convert.ToDateTime(dr["packing_date"]); } + if (dr["department_degree_id"] != DBNull.Value) + { + i.department_degree_id = Convert.ToInt32(dr["department_degree_id"]); + } + if(dr["remark_hrm_work_record"] != DBNull.Value) + { + i.remark_hrm_work_record = dr["remark_hrm_work_record"].ToString(); + } result.Add(i); } diff --git a/Models/external_employee/external_employeeViewModel.cs b/Models/external_employee/external_employeeViewModel.cs index 144589f..e8fb1b7 100644 --- a/Models/external_employee/external_employeeViewModel.cs +++ b/Models/external_employee/external_employeeViewModel.cs @@ -28,37 +28,27 @@ namespace TodoAPI2.Models public class external_employeeViewModel { public int id { get; set; } - public string position_number { get; set; } - public string position_name { get; set; } - public string fullname { get; set; } - public string halfname { get; set; } - public int? employee_type_id { get; set; } - public int? position_id { get; set; } - public int? position_type_id { get; set; } public string position_type_name { get; set; } - public string user_email { get; set; } - public int? user_id { get; set; } - public int? department_id { get; set; } public string department_name { get; set; } public string department_code { get; set; } public decimal? salary { get; set; } public string employee_type_name { get; set; } public string employee_no { get; set; } - public int? position_level_id { get; set; } public string position_level_text { get; set; } - public DateTime? packing_date { get; set; } + public int? department_degree_id { get; set; } + public string remark_hrm_work_record { get; set; } public int? worked_month // ทำงานมาแล้วกี่เดือน { diff --git a/Models/rep_leave_total_02/Irep_leave_total_02Service.cs b/Models/rep_leave_total_02/Irep_leave_total_02Service.cs new file mode 100644 index 0000000..78fb247 --- /dev/null +++ b/Models/rep_leave_total_02/Irep_leave_total_02Service.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using TTSW.EF; +using TTSW.Utils; +using TTSW.Constant; +using TTSW.Common; +using TodoAPI2.Models; + +namespace TodoAPI2.Models +{ + public interface Irep_leave_total_02Service + { + rep_leave_total_02WithSelectionViewModel GetBlankItem(); + } +} + diff --git a/Models/rep_leave_total_02/rep_leave_total_02InputModel.cs b/Models/rep_leave_total_02/rep_leave_total_02InputModel.cs new file mode 100644 index 0000000..d1a5c7d --- /dev/null +++ b/Models/rep_leave_total_02/rep_leave_total_02InputModel.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Threading.Tasks; +using TTSW.EF; +using TTSW.Utils; +using TTSW.Constant; +using TTSW.Common; + +namespace TodoAPI2.Models +{ + public class rep_leave_total_02InputModel + { + + public Guid? id { get; set; } + + public string employee_id { get; set; } + + public int? org_id { get; set; } + + public DateTime? start_date { get; set; } + + public DateTime? end_date { get; set; } + + public string active_mode { get; set; } + } +} + diff --git a/Models/rep_leave_total_02/rep_leave_total_02ReportRequestModel.cs b/Models/rep_leave_total_02/rep_leave_total_02ReportRequestModel.cs new file mode 100644 index 0000000..7eac681 --- /dev/null +++ b/Models/rep_leave_total_02/rep_leave_total_02ReportRequestModel.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Threading.Tasks; +using TTSW.EF; +using TTSW.Utils; +using TTSW.Constant; +using TTSW.Common; + +namespace TodoAPI2.Models +{ + public class rep_leave_total_02ReportRequestModel : rep_leave_total_02SearchModel + { + public string filetype { get; set; } + + public string contentType { get { return MyHelper.GetContentType(filetype); } } + } +} + diff --git a/Models/rep_leave_total_02/rep_leave_total_02SearchModel.cs b/Models/rep_leave_total_02/rep_leave_total_02SearchModel.cs new file mode 100644 index 0000000..3c28098 --- /dev/null +++ b/Models/rep_leave_total_02/rep_leave_total_02SearchModel.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Threading.Tasks; +using TTSW.EF; +using TTSW.Utils; +using TTSW.Constant; +using TTSW.Common; + +namespace TodoAPI2.Models +{ + public class rep_leave_total_02SearchModel + { + + public Guid id { get; set; } + + public string employee_id { get; set; } + + public int? org_id { get; set; } + + public DateTime? start_date { get; set; } + + public string start_date_text { get { return MyHelper.GetDateStringForReport(this.start_date); } } + + public DateTime? end_date { get; set; } + + public string end_date_text { get { return MyHelper.GetDateStringForReport(this.end_date); } } + + } +} + diff --git a/Models/rep_leave_total_02/rep_leave_total_02Service.cs b/Models/rep_leave_total_02/rep_leave_total_02Service.cs new file mode 100644 index 0000000..36dd0d9 --- /dev/null +++ b/Models/rep_leave_total_02/rep_leave_total_02Service.cs @@ -0,0 +1,46 @@ +using AutoMapper; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using TTSW.EF; +using TTSW.Utils; +using TTSW.Constant; +using TTSW.Common; +using TodoAPI2.Models; +using System.IO; +using System.Web; +using System.Net; +using TTSW.Configure; +using Microsoft.Extensions.Options; +using System.Data; + +namespace TodoAPI2.Models +{ + public class rep_leave_total_02Service : Irep_leave_total_02Service + { + private IBaseRepository _repository; + private IMyDatabase db; + private Iexternal_linkageService ext; + private Iexternal_employeeService emp; + + public rep_leave_total_02Service(IBaseRepository repository, + IMyDatabase mydb, Iexternal_linkageService inext, Iexternal_employeeService inemp) + { + _repository = repository; + db = mydb; + ext = inext; + emp = inemp; + } + + public rep_leave_total_02WithSelectionViewModel GetBlankItem() + { + var i = new rep_leave_total_02WithSelectionViewModel(); + i.item_employee_id = (from x in emp.GetListByemployee_type(null, null) orderby x.fullname select x).ToList(); + i.item_org_id = (from x in ext.GetDepartmentDataForReport() orderby x.external_name select x).ToList(); + + + return i; + } + } +} \ No newline at end of file diff --git a/Models/rep_leave_total_02/rep_leave_total_02ViewModel.cs b/Models/rep_leave_total_02/rep_leave_total_02ViewModel.cs new file mode 100644 index 0000000..de3d8fe --- /dev/null +++ b/Models/rep_leave_total_02/rep_leave_total_02ViewModel.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Threading.Tasks; +using TTSW.EF; +using TTSW.Utils; +using TTSW.Constant; +using TTSW.Common; + +namespace TodoAPI2.Models +{ + public class rep_leave_total_02ViewModel : BaseViewModel2 + { + + public string employee_id { get; set; } + + public int? org_id { get; set; } + + public DateTime? start_date { get; set; } + + public string txt_start_date { get { return MyHelper.GetDateStringForReport(this.start_date); } } + + public DateTime? end_date { get; set; } + + public string txt_end_date { get { return MyHelper.GetDateStringForReport(this.end_date); } } + + public string employee_id_external_linkage_external_name { get; set; } + public string org_id_external_linkage_external_name { get; set; } + + } +} \ No newline at end of file diff --git a/Models/rep_leave_total_02/rep_leave_total_02WithSelectionViewModel.cs b/Models/rep_leave_total_02/rep_leave_total_02WithSelectionViewModel.cs new file mode 100644 index 0000000..0977174 --- /dev/null +++ b/Models/rep_leave_total_02/rep_leave_total_02WithSelectionViewModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace TodoAPI2.Models +{ + public class rep_leave_total_02WithSelectionViewModel: rep_leave_total_02ViewModel + { + public List item_employee_id { get; set; } + public List item_org_id { get; set; } + + } +} \ No newline at end of file diff --git a/Startup.cs b/Startup.cs index f5a4a3e..5505fd7 100644 --- a/Startup.cs +++ b/Startup.cs @@ -294,6 +294,8 @@ namespace Test01 services.AddScoped(); + services.AddScoped(); + #endregion services.TryAddSingleton(); @@ -505,6 +507,10 @@ namespace Test01 cfg.CreateMap(); cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + }); #endregion diff --git a/ViewControllers/rep_leave_total_02ViewControllers.cs b/ViewControllers/rep_leave_total_02ViewControllers.cs new file mode 100644 index 0000000..91cc4c2 --- /dev/null +++ b/ViewControllers/rep_leave_total_02ViewControllers.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using TodoAPI2.Models; +using STAFF_API.Models; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Configuration; +using TodoAPI2.Controllers; + +namespace TodoAPI2.Controllers +{ + public class rep_leave_total_02ViewController : Controller + { + private ILogger _logger; + private Irep_leave_total_02Service _repository; + private IConfiguration Configuration { get; set; } + + /// + /// Default constructure for dependency injection + /// + /// + /// + /// + public rep_leave_total_02ViewController(ILogger logger, Irep_leave_total_02Service repository, IConfiguration configuration) + { + _logger = logger; + _repository = repository; + Configuration = configuration; + } + + // public IActionResult rep_leave_total_02() + // { + //if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + // return View(); + // } + + // public IActionResult rep_leave_total_02_d() + // { + //if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + // return View(); + // } + + public IActionResult rep_leave_total_02_report() + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + return View(); + } + + //public IActionResult rep_leave_total_02_inline() + //{ + // if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + // return View(); + //} + + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] + public IActionResult Error() + { + return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); + } + } +} + + diff --git a/Views/eva_create_evaluationView/eva_create_evaluation_d.cshtml b/Views/eva_create_evaluationView/eva_create_evaluation_d.cshtml index 0117415..7805f20 100644 --- a/Views/eva_create_evaluationView/eva_create_evaluation_d.cshtml +++ b/Views/eva_create_evaluationView/eva_create_evaluation_d.cshtml @@ -67,7 +67,7 @@
-
กำหนดผู้รับการประเมินและผู้ประเมินเลื่อนเงินเดือน
+
สร้างแบบประเมิน
@@ -83,7 +83,7 @@
-
กำหนดผู้รับการประเมินและผู้ประเมินเลื่อนเงินเดือน
+
สร้างแบบประเมิน
diff --git a/Views/eva_create_evaluationView/eva_create_evaluation_d_summary.cshtml b/Views/eva_create_evaluationView/eva_create_evaluation_d_summary.cshtml index b87e7c2..a3874cc 100644 --- a/Views/eva_create_evaluationView/eva_create_evaluation_d_summary.cshtml +++ b/Views/eva_create_evaluationView/eva_create_evaluation_d_summary.cshtml @@ -29,7 +29,7 @@
-
กำหนดผู้รับการประเมินและผู้ประเมินเลื่อนเงินเดือน
+
สร้างแบบประเมิน
@@ -106,17 +106,27 @@
รายชื่อผู้รับการประเมิน
+
+
+
+ + +
+
+
- - - - - - - + + + + + + + + + @@ -130,6 +140,9 @@
+ + +
diff --git a/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml b/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml index cb6c16f..719413c 100644 --- a/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml +++ b/Views/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d.cshtml @@ -28,7 +28,7 @@
- +
เลือก
+ + + + + + + + + + + + + + + + + + + + + + + + +
รอบการประเมินรหัสพนักงาน
ชื่อ-ชื่อสกุลประเภทตำแหน่ง
ตำแหน่งระดับตำแหน่ง
หน่วยงานหมายเหตุ
-
- -

-

-
-
-
- -

-

-
- -

-

- -
- -

-

-
-
-
- -

-

- -
- -

-

-
@@ -293,7 +275,7 @@
- +
@@ -305,11 +287,11 @@ เครื่องมือ - - - - - + + + + + @@ -319,11 +301,11 @@    

-   -   -   -   -   +   +   +   +   +     @@ -340,6 +322,7 @@ เครื่องมือ + @@ -357,7 +340,7 @@
- +
@@ -381,7 +364,7 @@
-
ส่งข้อตกลงการประเมิน
+
ส่งข้อตกลงการประเมิน
@@ -391,8 +374,8 @@
- - + +
@@ -406,6 +389,9 @@ } diff --git a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d.cshtml b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d.cshtml index 62e159d..599f3ba 100644 --- a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d.cshtml +++ b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d.cshtml @@ -31,56 +31,37 @@ +
-
- -

-

-
-
-
- -

-

+ + + + + + + + + + + + + + + + + + + + + + + + + +
รอบการประเมินรหัสพนักงาน
ชื่อ-ชื่อสกุลประเภทตำแหน่ง
ตำแหน่งระดับตำแหน่ง
หน่วยงานหมายเหตุ
-
- -

-

-
- -

-

-
-
- -
- -

-

-
- -

-

- -
- -

-

-
-
-
- -

-

- -
- -

-

-
@@ -460,6 +441,10 @@ eva_create_evaluation_detail_review01_PutUpdate(); } + function CheckWeightBeforeSubmitStatus(){ + return true; + } + } diff --git a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml index 91a0649..0d717dc 100644 --- a/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml +++ b/Views/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d2.cshtml @@ -81,57 +81,36 @@ +
-
- -

-

-
-
-
- -

-

+ + + + + + + + + + + + + + + + + + + + + + + + + +
รอบการประเมินรหัสพนักงาน
ชื่อ-ชื่อสกุลประเภทตำแหน่ง
ตำแหน่งระดับตำแหน่ง
หน่วยงานหมายเหตุ
-
- -

-

- -
- -

-

-
-
-
- -

-

- - -
- -

-

- -
- -

-

-
-
-
- -

-

- -
- -

-

-
@@ -748,6 +727,10 @@ eva_evaluation_behavior_process2_Save(getUrlParameter('id')); eva_create_evaluation_detail_summary2_PutUpdate(); } + + function CheckWeightBeforeSubmitStatus(){ + return true; + } } diff --git a/Views/eva_evaluation_groupView/eva_evaluation_group_d.cshtml b/Views/eva_evaluation_groupView/eva_evaluation_group_d.cshtml index 9caffb5..e7da684 100644 --- a/Views/eva_evaluation_groupView/eva_evaluation_group_d.cshtml +++ b/Views/eva_evaluation_groupView/eva_evaluation_group_d.cshtml @@ -79,9 +79,11 @@ เครื่องมือ - - + + + + diff --git a/Views/rep_familyView/rep_family_report.cshtml b/Views/rep_familyView/rep_family_report.cshtml index 5e2f5ea..549b28b 100644 --- a/Views/rep_familyView/rep_family_report.cshtml +++ b/Views/rep_familyView/rep_family_report.cshtml @@ -27,17 +27,17 @@
- +
- +
- +
diff --git a/Views/rep_leave_total_02View/rep_leave_total_02_report.cshtml b/Views/rep_leave_total_02View/rep_leave_total_02_report.cshtml new file mode 100644 index 0000000..12f98f0 --- /dev/null +++ b/Views/rep_leave_total_02View/rep_leave_total_02_report.cshtml @@ -0,0 +1,72 @@ +@using Microsoft.Extensions.Configuration +@inject IConfiguration Configuration +@{ + ViewData["Title"] = "rep_leave_total_02"; +} + +
+
+
+ @Configuration["SiteInformation:modulename"] +
+
+
+ +
+
+ +
+
รายงานสรุปการลา ขาดงาน มาสาย ของพนักงานเนติบัณฑิตยสภา
+
+
+
+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+
+ + +
+
+
+
+
+ + +@section FooterPlaceHolder{ + + +} + diff --git a/tb320eva.xml b/tb320eva.xml index bfe2360..62ebfe9 100644 --- a/tb320eva.xml +++ b/tb320eva.xml @@ -3743,6 +3743,34 @@ Returns the item Error Occurred + + + Default constructure for dependency injection + + + + + + + + Get Blank Item + + + + Return a blank item + Returns the item + Error Occurred + + + + Download Report + + + + Return list of items by specifced keyword + Returns the item + Error Occurred + Default constructure for dependency injection @@ -4123,6 +4151,14 @@ + + + Default constructure for dependency injection + + + + + Default constructure for dependency injection diff --git a/wwwroot/js/coregen.js b/wwwroot/js/coregen.js index 1374c31..b1cab3c 100644 --- a/wwwroot/js/coregen.js +++ b/wwwroot/js/coregen.js @@ -263,9 +263,9 @@ function AlertSuccess(msg) { } function AlertDanger(xhr, status, error) { - var errorMessage = xhr.status + ': ' + xhr.statusText +': '+xhr.responseText; + var errorMessage = xhr.responseText; endLoad(); - alert('มีข้อผิดพลาดเกิดขึ้น ดังนี้ : ' + errorMessage); + alert(errorMessage); } function GetUnix(path) { diff --git a/wwwroot/js/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02_inline.js b/wwwroot/js/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02_inline.js index 8d13579..56cd0ae 100644 --- a/wwwroot/js/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02_inline.js +++ b/wwwroot/js/eva_adjust_postponement_detail_normal_02/eva_adjust_postponement_detail_normal_02_inline.js @@ -128,6 +128,7 @@ var tag = ""; eva_adjust_postponement_detail_normal_02_FeedDataToForm(data, (i + 1), blankItem); }); //eva_adjust_postponement_detail_normal_02_Summary(); +Oneva_adjust_postponement_detail_normal_02_promoted_percentageChanged(); endLoad(); }; startLoad(); diff --git a/wwwroot/js/eva_adjust_postponement_normal/eva_adjust_postponement_normal_d.js b/wwwroot/js/eva_adjust_postponement_normal/eva_adjust_postponement_normal_d.js index 454312f..96ea5c6 100644 --- a/wwwroot/js/eva_adjust_postponement_normal/eva_adjust_postponement_normal_d.js +++ b/wwwroot/js/eva_adjust_postponement_normal/eva_adjust_postponement_normal_d.js @@ -15,6 +15,8 @@ $("#eva_adjust_postponement_normal_limit_quota").val(data.limit_quota); $("#eva_adjust_postponement_normal_percentage").val(data.percentage); DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_normal_managed_by"), data, "id", "fullname", "item_managed_by", getCookie("emp_id")); //DropDownClearFormAndFeedWithData($("#eva_adjust_postponement_normal_org_id"), data, "id", "external_name", "item_org_id", data.org_id); +Oneva_adjust_postponement_normal_limit_frameChange(); +Oneva_adjust_postponement_normal_percentageChange(); } @@ -126,7 +128,7 @@ function Oneva_adjust_postponement_normal_limit_frameChange(){ var limit_frame = $("#eva_adjust_postponement_normal_limit_frame").val(); limit_frame = Math.round(limit_frame*100)/100; $("#eva_adjust_postponement_normal_limit_frame").val(limit_frame); - $("#eva_adjust_postponement_normal_limit_quota").val(Math.round((limit*limit_frame/100)*100)/100); + $("#eva_adjust_postponement_normal_limit_quota").val(Math.round( Math.ceil(limit*limit_frame)/1000)*10 ); } function Oneva_adjust_postponement_normal_percentageChange(){ @@ -148,26 +150,26 @@ function Oneva_adjust_postponement_detail_normal_02_promoted_percentageChanged() $('#eva_adjust_postponement_detail_normal_02Body tr').each(function () { var i = $(this).find("#rowCount").text(); - - var percentage = $("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val(); - percentage = Math.round(percentage*100)/100; - $("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val(percentage); + if(i){ + var percentage = $("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val(); + percentage = Math.round(percentage*100)/100; + $("#eva_adjust_postponement_detail_normal_02_promoted_percentage_" + i).val(percentage); - var middle = parseFloat($(this).find("#eva_adjust_postponement_detail_normal_02_middle_" + i).text()); - var old_salary = parseFloat($(this).find("#eva_adjust_postponement_detail_normal_02_sarary_" + i).text()); - var new_added = Math.ceil(((percentage * middle)/100)/10)*10; - var new_salary = parseFloat(old_salary + new_added); + var middle = parseFloat($(this).find("#eva_adjust_postponement_detail_normal_02_middle_" + i).text()); + var old_salary = parseFloat($(this).find("#eva_adjust_postponement_detail_normal_02_sarary_" + i).text()); + var new_added = Math.ceil(((percentage * middle)/100)/10)*10; + var new_salary = parseFloat(old_salary + new_added); - $("#eva_adjust_postponement_detail_normal_02_total_promote_" + i).val(new_added); - $("#eva_adjust_postponement_detail_normal_02_new_sarary_" + i).text(formatNumber(new_salary)); + $("#eva_adjust_postponement_detail_normal_02_total_promote_" + i).val(new_added); + $("#eva_adjust_postponement_detail_normal_02_new_sarary_" + i).text(new_salary); - if(new_salary < 13285){ - $("#eva_adjust_postponement_detail_normal_02_new_cost_living_" + i).text(formatNumber(1000)); - }else{ - $("#eva_adjust_postponement_detail_normal_02_new_cost_living_" + i).text(0); + if(new_salary < 13285){ + $("#eva_adjust_postponement_detail_normal_02_new_cost_living_" + i).text(1000); + }else{ + $("#eva_adjust_postponement_detail_normal_02_new_cost_living_" + i).text(0); + } + sum_postpone += new_added; } - - sum_postpone += new_added; }); $("#remain_cost").val(Math.round((current_quota - sum_postpone)*100)/100); diff --git a/wwwroot/js/eva_create_evaluation/eva_create_evaluation.js b/wwwroot/js/eva_create_evaluation/eva_create_evaluation.js index 36abda4..65ccc6d 100644 --- a/wwwroot/js/eva_create_evaluation/eva_create_evaluation.js +++ b/wwwroot/js/eva_create_evaluation/eva_create_evaluation.js @@ -12,7 +12,7 @@ eva_create_evaluationSearchObject.evaluation_group_id = $("#s_eva_create_evaluat } function eva_create_evaluation_FeedDataToSearchForm(data) { -DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_performance_plan_id"), data, "id", "fiscal_year", "item_performance_plan_id", data.performance_plan_id); +DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_performance_plan_id"), data, "id", "display_text", "item_performance_plan_id", data.performance_plan_id); DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_evaluation_group_id"), data, "id", "thegroup", "item_evaluation_group_id", data.evaluation_group_id); } @@ -21,7 +21,7 @@ DropDownClearFormAndFeedWithData($("#s_eva_create_evaluation_evaluation_group_id function eva_create_evaluation_FeedDataToForm(data) { $("#eva_create_evaluation_id").val(data.id); -DropDownClearFormAndFeedWithData($("#eva_create_evaluation_performance_plan_id"), data, "id", "fiscal_year", "item_performance_plan_id", data.performance_plan_id); +DropDownClearFormAndFeedWithData($("#eva_create_evaluation_performance_plan_id"), data, "id", "display_text", "item_performance_plan_id", data.performance_plan_id); DropDownClearFormAndFeedWithData($("#eva_create_evaluation_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id); $("#eva_create_evaluation_score1").val(data.score1); $("#eva_create_evaluation_score2").val(data.score2); diff --git a/wwwroot/js/eva_create_evaluation/eva_create_evaluation_d.js b/wwwroot/js/eva_create_evaluation/eva_create_evaluation_d.js index 70af89c..0952274 100644 --- a/wwwroot/js/eva_create_evaluation/eva_create_evaluation_d.js +++ b/wwwroot/js/eva_create_evaluation/eva_create_evaluation_d.js @@ -5,7 +5,7 @@ var eva_create_evaluation_API = "/api/eva_create_evaluation/"; function eva_create_evaluation_FeedDataToForm(data) { $("#eva_create_evaluation_id").val(data.id); -DropDownClearFormAndFeedWithData($("#eva_create_evaluation_performance_plan_id"), data, "id", "fiscal_year", "item_performance_plan_id", data.performance_plan_id); +DropDownClearFormAndFeedWithData($("#eva_create_evaluation_performance_plan_id"), data, "id", "display_text", "item_performance_plan_id", data.performance_plan_id); DropDownClearFormAndFeedWithData($("#eva_create_evaluation_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id); $("#eva_create_evaluation_score1").val(data.score1); $("#eva_create_evaluation_score2").val(data.score2); diff --git a/wwwroot/js/eva_create_evaluation_detail/eva_create_evaluation_detail_summary.js b/wwwroot/js/eva_create_evaluation_detail/eva_create_evaluation_detail_summary.js index ceca1d0..0f14f1d 100644 --- a/wwwroot/js/eva_create_evaluation_detail/eva_create_evaluation_detail_summary.js +++ b/wwwroot/js/eva_create_evaluation_detail/eva_create_evaluation_detail_summary.js @@ -152,28 +152,59 @@ var eva_create_evaluation_detailTableV; var eva_create_evaluation_detail_setupTable = function (result) { console.log(result); + var groupColumn = 8; tmp = '"'; eva_create_evaluation_detailTableV = $('#eva_create_evaluation_detailTable').DataTable({ + "processing": true, "serverSide": false, "data": result, - "select": false, + "select": { + "style": 'multi' + }, "columns": [ - { "data": "employee_id_external_linkage_external_name" }, - { "data": "chief_external_linkage_external_name" }, -{ "data": "status_self" }, -{ "data": "status_chief" }, -{ "data": "status_supervisor" }, -{ "data": "status_supervisor1A" }, -{ "data": "status_supervisor2A" } + { "data": "" }, + +{ "data": "employee_no" }, +{ "data": "employee_id_external_linkage_external_name" }, +{ "data": "position_type_text" }, +{ "data": "position_name" }, +{ "data": "position_level_text" }, +{ "data": "remark" }, +{ "data": "chief_external_linkage_external_name" }, +{ "data": "department_name" }, + ], "columnDefs": [ + { + targets: 0, + data: "", + defaultContent: '', + orderable: false, + className: 'select-checkbox' + }, +{ "visible": false, "targets": groupColumn } ], "language": { "url": appsite + "/DataTables-1.10.16/thai.json" }, "paging": true, - "searching": false + "searching": false, + "drawCallback": function ( settings ) { + var api = this.api(); + var rows = api.rows( {page:'current'} ).nodes(); + var last=null; + + api.column(groupColumn, {page:'current'} ).data().each( function ( group, i ) { + if ( last !== group ) { + $(rows).eq( i ).before( + 'หน่วยงาน : '+group+'' + ); + + last = group; + } + } ); + } }); endLoad(); }; @@ -204,6 +235,14 @@ function eva_create_evaluation_detail_GetSelect(f) { alert(eva_create_evaluation_detail_selectitem); } +function eva_create_evaluation_detail_SelectAll(){ + eva_create_evaluation_detailTableV.rows().select(); +} + +function eva_create_evaluation_detail_DeselectAll(){ + eva_create_evaluation_detailTableV.rows().deselect(); +} + //================= File Upload ========================================= diff --git a/wwwroot/js/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreement_d.js b/wwwroot/js/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreement_d.js index 052bb7b..cb6beca 100644 --- a/wwwroot/js/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreement_d.js +++ b/wwwroot/js/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreement_d.js @@ -16,6 +16,10 @@ $("#eva_create_evaluation_detail_agreement_chief_fullname").text(data.chief_full $("#eva_create_evaluation_detail_agreement_chief_position").text(data.chief_position); $("#eva_create_evaluation_detail_agreement_create_evaluation_id").val(data.create_evaluation_id); +$("#remark_hrm_work_record").val(data.remark_hrm_work_record); + + status_self = data.status_self; + CheckPermission(); } diff --git a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process.js b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process.js index c683e45..da027f5 100644 --- a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process.js +++ b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process.js @@ -176,7 +176,7 @@ function eva_create_evaluation_detail_process_GoDelete(a) { var eva_create_evaluation_detail_processTableV; var eva_create_evaluation_detail_process_setupTable = function (result) { - console.log(result); + var groupColumn = 5; tmp = '"'; eva_create_evaluation_detail_processTableV = $('#eva_create_evaluation_detail_processTable').DataTable({ @@ -206,12 +206,28 @@ var eva_create_evaluation_detail_process_setupTable = function (result) { "render": function (data, type, row, meta) { return " "; } - }], + }, + { "visible": false, "targets": groupColumn }], "language": { "url": appsite + "/DataTables-1.10.16/thai.json" }, "paging": true, - "searching": false + "searching": false, + "drawCallback": function ( settings ) { + var api = this.api(); + var rows = api.rows( {page:'current'} ).nodes(); + var last=null; + + api.column(groupColumn, {page:'current'} ).data().each( function ( group, i ) { + if ( last !== group ) { + $(rows).eq( i ).before( + ''+group+'' + ); + + last = group; + } + } ); + } }); endLoad(); }; diff --git a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d.js b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d.js index 3b20309..fde2e47 100644 --- a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d.js +++ b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d.js @@ -43,6 +43,8 @@ DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_process_org_id $("#eva_create_evaluation_detail_process_search_employee_code").val(data.search_employee_code); $("#eva_create_evaluation_detail_process_search_employee_fullname").val(data.search_employee_fullname); +$("#remark_hrm_work_record").val(data.remark_hrm_work_record); + //console.log(data); item_level_score = data.item_level_score; diff --git a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d2.js b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d2.js index 29694f9..1d658ba 100644 --- a/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d2.js +++ b/wwwroot/js/eva_create_evaluation_detail_process/eva_create_evaluation_detail_process_d2.js @@ -44,6 +44,8 @@ DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_process_org_id $("#eva_create_evaluation_detail_process_search_employee_code").val(data.search_employee_code); $("#eva_create_evaluation_detail_process_search_employee_fullname").val(data.search_employee_fullname); +$("#remark_hrm_work_record").val(data.remark_hrm_work_record); + item_level_score = data.item_level_score; $("#w1").text(data.create_evaluation_score1.toFixed(2)+"%"); @@ -151,6 +153,22 @@ function eva_create_evaluation_detail_process_GoDelete(a) { //================= Control Function ========================================= +function setViewOfComment(status_supervisor, status_supervisor1A, status_supervisor2A){ + $("#eva_create_evaluation_detail_review02_supervisor2_result").hide(); + $("#eva_create_evaluation_detail_review03_supervisor1A_result").hide(); + $("#eva_create_evaluation_detail_review04_supervisor2A_result").hide(); + + if(status_supervisor === "Y"){ + $("#eva_create_evaluation_detail_review02_supervisor2_result").show(); + } + if(status_supervisor === "Y"){ + $("#eva_create_evaluation_detail_review03_supervisor1A_result").show(); + } + if(status_supervisor === "Y"){ + $("#eva_create_evaluation_detail_review04_supervisor2A_result").show(); + } +} + function setPageByRoleAndStatus(role_code, status_self, status_chief, status_supervisor, status_supervisor1A, status_supervisor2A){ $("#btn01").hide(); @@ -177,8 +195,12 @@ function setPageByRoleAndStatus(role_code, status_self, status_chief, status_sup $("#btnd02").hide(); $("#btnd03").hide(); + setViewOfComment(status_supervisor, status_supervisor1A, status_supervisor2A); + if(role_code === "2"){ // ความเห็น ความเห็นผู้ประเมินสูงสุด + $("#eva_create_evaluation_detail_review02_supervisor2_result").show(); + if(status_chief === "Y" && status_self === "Y"){ $("#btn01").show(); $("#btn02").show(); @@ -208,6 +230,8 @@ function setPageByRoleAndStatus(role_code, status_self, status_chief, status_sup } else if(role_code === "3"){ // ความเห็น ผู้บังคับบัญชาการเหนือขึ้นไปอีกชั้นหนึ่ง + $("#eva_create_evaluation_detail_review03_supervisor1A_result").show(); + if(status_supervisor === "Y" && status_chief === "Y" && status_self === "Y"){ $("#eva_create_evaluation_detail_review03_supervisor1A_result").attr("disabled", false); $("#eva_create_evaluation_detail_review03_supervisor1A_date").attr("disabled", false); @@ -231,6 +255,9 @@ function setPageByRoleAndStatus(role_code, status_self, status_chief, status_sup } else if(role_code === "4"){ // ความเห็น ผู้บังคับบัญชาการเหนือขึ้นไปอีกชั้นหนึ่ง (สูงสุด) + + $("#eva_create_evaluation_detail_review04_supervisor2A_result").show(); + if(status_supervisor1A === "Y" && status_supervisor === "Y" && status_chief === "Y" && status_self === "Y"){ $("#eva_create_evaluation_detail_review04_supervisor2A_result").attr("disabled", false); $("#eva_create_evaluation_detail_review04_supervisor2A_date").attr("disabled", false); diff --git a/wwwroot/js/eva_create_evaluation_detail_status/eva_create_evaluation_detail_status_d.js b/wwwroot/js/eva_create_evaluation_detail_status/eva_create_evaluation_detail_status_d.js index ce94100..3742325 100644 --- a/wwwroot/js/eva_create_evaluation_detail_status/eva_create_evaluation_detail_status_d.js +++ b/wwwroot/js/eva_create_evaluation_detail_status/eva_create_evaluation_detail_status_d.js @@ -65,6 +65,12 @@ function eva_create_evaluation_detail_status_PutUpdate(a) { { return; } + + if(CheckWeightBeforeSubmitStatus() === false){ + alert("น้ำหนักแต่ละส่วน ต้องมีค่า 100 จึงจะส่งแบบประเมินได้"); + return; + } + var data = eva_create_evaluation_detail_status_GetFromForm(); if(a == "next0"){ diff --git a/wwwroot/js/eva_evaluation_achievement/eva_evaluation_achievement.js b/wwwroot/js/eva_evaluation_achievement/eva_evaluation_achievement.js index de2f872..537e963 100644 --- a/wwwroot/js/eva_evaluation_achievement/eva_evaluation_achievement.js +++ b/wwwroot/js/eva_evaluation_achievement/eva_evaluation_achievement.js @@ -190,9 +190,12 @@ var eva_evaluation_achievement_setupTable = function (result) { "targets": 0, "data": "id", "render": function (data, type, row, meta) { - return " "; + return " "; } - }], + },{ + targets: [ 3, 4, 5, 6, 7 ], + visible: false + }], "language": { "url": appsite + "/DataTables-1.10.16/thai.json" }, diff --git a/wwwroot/js/eva_evaluation_behavior/eva_evaluation_behavior.js b/wwwroot/js/eva_evaluation_behavior/eva_evaluation_behavior.js index edcb85b..abc1130 100644 --- a/wwwroot/js/eva_evaluation_behavior/eva_evaluation_behavior.js +++ b/wwwroot/js/eva_evaluation_behavior/eva_evaluation_behavior.js @@ -170,14 +170,15 @@ var eva_evaluation_behavior_setupTable = function (result) { "select": false, "columns": [ { "data": "id" }, - { "data": "behavior" } + { "data": "behavior" } , +{ "data": "weight" } ], "columnDefs": [ { "targets": 0, "data": "id", "render": function (data, type, row, meta) { - return " "; + return " "; } }], "language": { diff --git a/wwwroot/js/eva_evaluation_group_detail/eva_evaluation_group_detail.js b/wwwroot/js/eva_evaluation_group_detail/eva_evaluation_group_detail.js index 093c313..b3b8bb9 100644 --- a/wwwroot/js/eva_evaluation_group_detail/eva_evaluation_group_detail.js +++ b/wwwroot/js/eva_evaluation_group_detail/eva_evaluation_group_detail.js @@ -150,6 +150,7 @@ var eva_evaluation_group_detailTableV; var eva_evaluation_group_detail_setupTable = function (result) { tmp = '"'; + var groupColumn = 5; eva_evaluation_group_detailTableV = $('#eva_evaluation_group_detailTable').DataTable({ "processing": true, "serverSide": false, @@ -157,9 +158,14 @@ var eva_evaluation_group_detail_setupTable = function (result) { "select": false, "columns": [ { "data": "id" }, - { "data": "position_number" }, - { "data": "position_name" }, - { "data": "fullname" }, + +{ "data": "employee_no" }, +{ "data": "fullname" }, +{ "data": "position_name" }, +{ "data": "position_level_text" }, +{ "data": "department_name" }, + + ], "columnDefs": [ { @@ -168,12 +174,27 @@ var eva_evaluation_group_detail_setupTable = function (result) { "render": function (data, type, row, meta) { return " "; } - }], + },{ "visible": false, "targets": groupColumn }], "language": { "url": appsite + "/DataTables-1.10.16/thai.json" }, "paging": true, - "searching": false + "searching": false, + "drawCallback": function ( settings ) { + var api = this.api(); + var rows = api.rows( {page:'current'} ).nodes(); + var last=null; + + api.column(groupColumn, {page:'current'} ).data().each( function ( group, i ) { + if ( last !== group ) { + $(rows).eq( i ).before( + ''+group+'' + ); + + last = group; + } + } ); + } }); endLoad(); }; diff --git a/wwwroot/js/eva_idp_plan_owner/eva_idp_plan_owner.js b/wwwroot/js/eva_idp_plan_owner/eva_idp_plan_owner.js index 054099a..3f4b28c 100644 --- a/wwwroot/js/eva_idp_plan_owner/eva_idp_plan_owner.js +++ b/wwwroot/js/eva_idp_plan_owner/eva_idp_plan_owner.js @@ -170,7 +170,7 @@ var eva_idp_plan_owner_setupTable = function (result) { "targets": 0, "data": "id", "render": function (data, type, row, meta) { - return " "; + return " "; } }], "language": { diff --git a/wwwroot/js/rep_leave_total_02/rep_leave_total_02_report.js b/wwwroot/js/rep_leave_total_02/rep_leave_total_02_report.js new file mode 100644 index 0000000..6400ef1 --- /dev/null +++ b/wwwroot/js/rep_leave_total_02/rep_leave_total_02_report.js @@ -0,0 +1,64 @@ +var rep_leave_total_02_API = "/api/rep_leave_total_02/"; + +//================= Search Customizaiton ========================================= + +function rep_leave_total_02_GetSearchParameter(fileType) { + var rep_leave_total_02SearchObject = new Object(); +rep_leave_total_02SearchObject.employee_id = $("#s_rep_leave_total_02_employee_id").val(); +rep_leave_total_02SearchObject.org_id = $("#s_rep_leave_total_02_org_id").val(); +rep_leave_total_02SearchObject.start_date = formatDateForGetParameter(getDate($("#s_rep_leave_total_02_start_date").val())); +rep_leave_total_02SearchObject.end_date = formatDateForGetParameter(getDate($("#s_rep_leave_total_02_end_date").val())); + + + rep_leave_total_02SearchObject.fileType = fileType; + + console.log(rep_leave_total_02SearchObject); + + return rep_leave_total_02SearchObject; +} + +function rep_leave_total_02_FeedDataToSearchForm(data) { +DropDownClearFormAndFeedWithData($("#s_rep_leave_total_02_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id); +DropDownClearFormAndFeedWithData($("#s_rep_leave_total_02_org_id"), data, "id", "external_name", "item_org_id", data.org_id); +$("#s_rep_leave_total_02_start_date").val(formatDate(data.start_date)); +$("#s_rep_leave_total_02_end_date").val(formatDate(data.end_date)); + +} + +//================= Form Data Customizaiton ========================================= + +function rep_leave_total_02_InitialForm(s) { + var successFunc = function (result) { + rep_leave_total_02_FeedDataToSearchForm(result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + rep_leave_total_02_API + "GetBlankItem", successFunc, AlertDanger); +} + +//================= Data Table ========================================= + +var s_rep_leave_total_02_customValidation = function (group) { + return ""; +}; + + +function rep_leave_total_02_DoSearch(fileType) { + if (!ValidateForm('s_rep_leave_total_02', s_rep_leave_total_02_customValidation)) { + return; + } + + var p = $.param(rep_leave_total_02_GetSearchParameter(fileType)); + + var report_url = apisite + "/api/rep_leave_total_02/rep_leave_total_02_report?" + p; + + if (fileType === "pdf") { + $("#report_result").attr("src", report_url); + $("#report_result").show(); + //window.open(report_url); + } else { + $("#report_result").hide(); + window.open(report_url); + } +} +