From 309d1a5e165825de547cac3e49108bded9a8fd2c Mon Sep 17 00:00:00 2001 From: Nakorn Rientrakrunchai Date: Thu, 4 Mar 2021 16:53:12 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=20source=20code=20=E0=B9=81=E0=B8=AA=E0=B8=94=E0=B8=87?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=87=E0=B8=B2=E0=B8=99=20?= =?UTF-8?q?=E0=B8=81=E0=B8=A3=E0=B8=AD=E0=B8=9A=E0=B8=A7=E0=B8=87=E0=B9=80?= =?UTF-8?q?=E0=B8=87=E0=B8=B4=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rep_eva_limit_frame_planControllers.cs | 173 ++++++++++++++++++ EXCEL/eva_limit_frame_group.xlsx | Bin 10392 -> 10394 bytes ..._frame_group@rep_eva_limit_frame_plan.xlsx | Bin 0 -> 9880 bytes .../eva_limit_frame_planService.cs | 133 ++++++++++---- .../Irep_eva_limit_frame_planService.cs | 22 +++ .../rep_eva_limit_frame_planInputModel.cs | 24 +++ ..._eva_limit_frame_planReportRequestModel.cs | 21 +++ .../rep_eva_limit_frame_planSearchModel.cs | 28 +++ .../rep_eva_limit_frame_planService.cs | 49 +++++ .../rep_eva_limit_frame_planViewModel.cs | 22 +++ ..._limit_frame_planWithSelectionViewModel.cs | 13 ++ Startup.cs | 6 + ...rep_eva_limit_frame_planViewControllers.cs | 66 +++++++ .../rep_eva_limit_frame_plan_report.cshtml | 55 ++++++ appsettings.Development.json | 8 +- tb320eva.csproj | 2 + tb320eva.xml | 126 +++++++++++++ .../rep_eva_limit_frame_plan_report.js | 58 ++++++ 18 files changed, 765 insertions(+), 41 deletions(-) create mode 100644 ApiControllers/rep_eva_limit_frame_planControllers.cs create mode 100644 EXCEL/eva_limit_frame_group@rep_eva_limit_frame_plan.xlsx create mode 100644 Models/rep_eva_limit_frame_plan/Irep_eva_limit_frame_planService.cs create mode 100644 Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planInputModel.cs create mode 100644 Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planReportRequestModel.cs create mode 100644 Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planSearchModel.cs create mode 100644 Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planService.cs create mode 100644 Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planViewModel.cs create mode 100644 Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planWithSelectionViewModel.cs create mode 100644 ViewControllers/rep_eva_limit_frame_planViewControllers.cs create mode 100644 Views/rep_eva_limit_frame_planView/rep_eva_limit_frame_plan_report.cshtml create mode 100644 wwwroot/js/rep_eva_limit_frame_plan/rep_eva_limit_frame_plan_report.js diff --git a/ApiControllers/rep_eva_limit_frame_planControllers.cs b/ApiControllers/rep_eva_limit_frame_planControllers.cs new file mode 100644 index 0000000..7abfaf8 --- /dev/null +++ b/ApiControllers/rep_eva_limit_frame_planControllers.cs @@ -0,0 +1,173 @@ +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; +using iTextSharp.text; +using iTextSharp.text.pdf; + +namespace TodoAPI2.Controllers +{ + //[Authorize] + [Produces("application/json")] + [Route("api/rep_eva_limit_frame_plan")] + public class rep_eva_limit_frame_planController : BaseController + { + #region Private Variables + private ILogger _logger; + private Irep_eva_limit_frame_planService _repository; + private IConfiguration Configuration { get; set; } + #endregion + + #region Properties + + #endregion + + /// + /// Default constructure for dependency injection + /// + /// + /// + /// + public rep_eva_limit_frame_planController(ILogger logger, Irep_eva_limit_frame_planService 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_eva_limit_frame_planWithSelectionViewModel), 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_eva_limit_frame_plan_report")] + [ProducesResponseType(typeof(FileStreamResult), 200)] + [ProducesResponseType(400)] + [ProducesResponseType(500)] + //[ValidateAntiForgeryToken] + public IActionResult rep_eva_limit_frame_plan_report(rep_eva_limit_frame_planReportRequestModel model) + { + try + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); + var httpclient = new WebClient(); + string mainurl = MyHelper.GetConfig(Configuration, "JasperReportServer:MainURL"); + string reportsite = MyHelper.GetConfig(Configuration, "JasperReportServer:reportsite"); + string username = MyHelper.GetConfig(Configuration, "JasperReportServer:username"); + string password = MyHelper.GetConfig(Configuration, "JasperReportServer:password"); + + var plan = (from q in _repository.GetContext().eva_limit_frame_plan + where q.id == model.frame_plan_guid + select q).FirstOrDefault(); + var evaplan = (from r in _repository.GetContext().eva_performance_plan + where r.id == plan.plan_guid + select r).FirstOrDefault(); + var start_plan = (from s in _repository.GetContext().eva_performance_plan_detail + where s.performance_plan_id == plan.plan_guid + select s.start_date).Min(); + var end_plan = (from s in _repository.GetContext().eva_performance_plan_detail + where s.performance_plan_id == plan.plan_guid + select s.end_date).Max(); + + model.executed_date_text = MyHelper.GetDateStringForReport(plan.executed_date); + model.salary_adjustment_date_text = MyHelper.GetDateStringForReport(plan.salary_adjustment_date); + model.intro_desc = $"ปีงบประมาณ {evaplan.fiscal_year} รอบที่ {evaplan.theTime} ระหว่างวันที่ {MyHelper.GetDateStringForReport(start_plan)} ถึงวันที่ {MyHelper.GetDateStringForReport(end_plan)}"; + model.detail_desc = $"วงเงินในการพิจารณาเงินเดือน ปี {evaplan.fiscal_year} รอบที่ {evaplan.theTime} ( {MyHelper.GetDateStringForReport(start_plan)} ถึงวันที่ {MyHelper.GetDateStringForReport(end_plan)} )"; + + var stream = new MemoryStream(); + + Document document = new Document(); + PdfCopy writer = new PdfCopy(document, stream); + document.Open(); + + string url = $"{mainurl}{reportsite}/rep_frame_intro.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}"; + var data = httpclient.DownloadData(url); + PdfReader reader = new PdfReader(data); + reader.ConsolidateNamedDestinations(); + for (int i = 1; i <= reader.NumberOfPages; i++) + { + PdfImportedPage page = writer.GetImportedPage(reader, i); + writer.AddPage(page); + } + reader.Close(); + + var all_group = (from t in _repository.GetContext().eva_limit_frame_group + where t.frame_plan_guid == model.frame_plan_guid + select t); + foreach(var u in all_group) + { + model.group_guid = u.id; + string url2 = $"{mainurl}{reportsite}/rep_eva_frame_detail.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}"; + var data2 = httpclient.DownloadData(url2); + PdfReader reader2 = new PdfReader(data2); + reader2.ConsolidateNamedDestinations(); + for (int i = 1; i <= reader2.NumberOfPages; i++) + { + PdfImportedPage page = writer.GetImportedPage(reader2, i); + writer.AddPage(page); + } + reader2.Close(); + } + + writer.Close(); + document.Close(); + + var data3 = stream.ToArray(); + var stream3 = new MemoryStream(data3); + + return File(stream3, model.contentType); + } + catch (Exception ex) + { + _logger.LogCritical($"Exception while GetReport.", ex); + return StatusCode(500, $"{ex.Message}"); + } +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_group@rep_eva_limit_frame_plan.xlsx b/EXCEL/eva_limit_frame_group@rep_eva_limit_frame_plan.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..d1cc530b75c16f5009ab79a023f787432b99b045 GIT binary patch literal 9880 zcmeHtWmFv5x_09d9D)Rgrhx?4Ai>?80Kv79#w~>4?gR-EEV#S7TX2GhV1dvOf;)UY zGw0mQF!SAY|DRL6R@JIi^*+^m@Ar9itH>iD5&)0^r~m+f8X(H+KMsKd01%M?0DJ%{ zyq>r{#Kj!qVyNNiVD7BX;$de?m4gV+kOhE;z5n0iKX?X8HHIMFY&dP&yTTIfT4C8C z#l@&(&18DO9hCPT@h^e(TObgH)FdZ1%L;<81Mj+n@XEz6aTGSKKz zK~$O3;fq_DOiBOTQmv?(*a+?{V$6dBqvdrP5S; zMJc;GJVlVDUu8wYFHR`}E`=+!;6E7~shOobTkYOty&3c9IK}yRk83cmER1B_ZRR(+Pp=Vnls&g<7cm?pKc^~(L%()DH2kr1gi)p$Oldl|IQJ#XFlB66< z*Lrc?W>06&Ql#ZP8Qj`po|ZHgX3Gz)(n?JqN>t&DvuHm-!_OlNCVY|Nr`xZn^Tp(% z9Bx)jeZMTYvVk{i_uY7!&sK83xhl*fb4CYB53Zw76tPcNTns$21aD@`(- z_-Q;1&1^f5CDJp1b_z2q4*iI{t)!YO-HO;V+GZkGHoAE!lsBmFkS&Bosf$ltJ+P+XVw1 zNyx{18i|vpsbDVaF*a8YYv&2_VVKU0)NcA-1*-3r`PViyP^B_jY~44BFP$N0`g>AN z9+RNS3SxQ!CU<72pIvlGo}nJK-dHGlj@fj5yu#QbE0L!t=6>-e*o7)&P@2+*G2VGA zC#6O6V9iDBdYG|e>4<6MlxpbP zr?C-uXV%{P-Y8w7a-pGX(E4hXEfzD`oa2Cks;b zgwE4#EQqf2d48Z0CDc(njoF&T@>n9-@lsz^j*g;n1oqnb*?f-2S;6;X$w_9l5a@5P z>90oy)Y3>KCg>aK&{W6-^pQYi9vRB@lQL0nlFG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(U(AeWG<5&Gz@EmQ8!3^zEZTJc@G0TV<;WE!Y$g6kz~JDS zVHNp*-d*$W_4@bqANJa)$p01KuYLc23;uR3fRW-)y8s>v{@pzx`%BbdeAO=DEzQZ@k_Y=(eJ{4Yg#-+cvxWng&+h=Y5(>4|E=8q5b$BW`WK)G z*6)B1tJew%&)-zAua^23Bmj_3^{4;zFT1TGj|9^}000B_1Hshz742_#{}0%( B_@Dp) literal 0 HcmV?d00001 diff --git a/Models/eva_limit_frame_plan/eva_limit_frame_planService.cs b/Models/eva_limit_frame_plan/eva_limit_frame_planService.cs index 465228d..6dd48f6 100644 --- a/Models/eva_limit_frame_plan/eva_limit_frame_planService.cs +++ b/Models/eva_limit_frame_plan/eva_limit_frame_planService.cs @@ -20,14 +20,17 @@ namespace TodoAPI2.Models public class eva_limit_frame_planService : Ieva_limit_frame_planService { private IBaseRepository2 _repository; - private IMyDatabase db; - private Iexternal_linkageService ext; + private IMyDatabase db; + private Iexternal_linkageService ext; + private Iexternal_employeeService emp; - public eva_limit_frame_planService(IBaseRepository2 repository, IMyDatabase mydb, Iexternal_linkageService inext) + public eva_limit_frame_planService(IBaseRepository2 repository, IMyDatabase mydb, + Iexternal_linkageService inext, Iexternal_employeeService inemp) { _repository = repository; - db = mydb; - ext = inext; + db = mydb; + ext = inext; + emp = inemp; } #region Private Functions @@ -47,7 +50,7 @@ namespace TodoAPI2.Models { return Mapper.Map>(entities); } - + #endregion #region Public Functions @@ -94,12 +97,12 @@ namespace TodoAPI2.Models public List GetListByexecuted_date(DateTime? executed_date) { - var model = new eva_limit_frame_planSearchModel(); + var model = new eva_limit_frame_planSearchModel(); model.executed_date = executed_date; return GetListBySearch(model); } - public List GetListBySearch(eva_limit_frame_planSearchModel model) + public List GetListBySearch(eva_limit_frame_planSearchModel model) { var data = ( from m_eva_limit_frame_plan in _repository.Context.eva_limit_frame_plan @@ -113,8 +116,8 @@ namespace TodoAPI2.Models from fk_external_linkageResult7 in external_linkageResult7.DefaultIfEmpty() - where - 1 == 1 + where + 1 == 1 && (!model.executed_date.HasValue || m_eva_limit_frame_plan.executed_date == model.executed_date) @@ -158,9 +161,52 @@ namespace TodoAPI2.Models var entity = GetEntity(model); entity.id = Guid.NewGuid(); + var all_group = (from i in _repository.Context.eva_evaluation_group + select i); + foreach(var x in all_group) + { + var all_emp = (from j in _repository.Context.eva_evaluation_group_detail + join k in emp.GetAllEmployee() on j.employee_id equals k.id + join m in ext.GetSortingDep() on k.department_id equals m.external_id + where j.evaluation_group_id == x.id + orderby m.external_code, + k.hpt_position_type_id, + k.hpl_position_level_id, + k.employee_no + select k); + + var new_frame_group = new eva_limit_frame_groupEntity(); + new_frame_group.id = Guid.NewGuid(); + new_frame_group.frame_plan_guid = entity.id; + new_frame_group.group_guid = x.id; + new_frame_group.limit_frame_295 = (decimal?)2.95; + new_frame_group.total_salary = all_emp.Sum(z => z.salary); + new_frame_group.total_salary_limit = (new_frame_group.total_salary * new_frame_group.limit_frame_295 / 100); + new_frame_group.total_salary_limit_rounded = new_frame_group.total_salary_limit; + _repository.Context.Add(new_frame_group); + + int i = 1; + foreach (var y in all_emp) + { + var new_emp = new eva_limit_frame_employeeEntity(); + new_emp.id = Guid.NewGuid(); + new_emp.frame_group_guid = new_frame_group.id; + new_emp.employee_id = y.id; + new_emp.org_id = y.department_id; + new_emp.position_text = y.position_name; + new_emp.level_text = y.position_level_text; + new_emp.salary = y.salary; + new_emp.position_allowance = y.position_allowance; + new_emp.monthly_remuneration = y.other_money; + new_emp.cost_of_living = y.cost_of_living; + new_emp.order_of_data = i; + i++; + _repository.Context.Add(new_emp); + } + } + + entity.SetAutoField(_repository.Context); - entity.SetAutoField(_repository.Context); - if (is_force_save) { var inserted = _repository.Insert(entity); @@ -193,7 +239,7 @@ namespace TodoAPI2.Models existingEntity.limit_frame_005_total = model.limit_frame_005_total; existingEntity.limit_frame_005_total_rounded = model.limit_frame_005_total_rounded; - existingEntity.SetAutoField(_repository.Context); + existingEntity.SetAutoField(_repository.Context); if (is_force_save) { @@ -209,32 +255,32 @@ namespace TodoAPI2.Models } } else - throw new NotificationException("No data to update"); + throw new NotificationException("No data to update"); } - public string UpdateMultiple(List model, bool is_force_save) + public string UpdateMultiple(List model, bool is_force_save) { - foreach(var i in model) + foreach (var i in model) { if (i.active_mode == "1" && i.id.HasValue) // update - { + { var existingEntity = _repository.Get(i.id.Value); if (existingEntity != null) { - existingEntity.plan_guid = i.plan_guid; - existingEntity.executed_date = i.executed_date; - existingEntity.limit_frame_005 = i.limit_frame_005; - existingEntity.status_self = i.status_self; - existingEntity.status_chief = i.status_chief; - existingEntity.supervisor1 = i.supervisor1; - existingEntity.supervisor1_result = i.supervisor1_result; - existingEntity.supervisor1_remark = i.supervisor1_remark; - existingEntity.supervisor1_date = i.supervisor1_date; - existingEntity.salary_adjustment_date = i.salary_adjustment_date; - existingEntity.limit_frame_005_total = i.limit_frame_005_total; - existingEntity.limit_frame_005_total_rounded = i.limit_frame_005_total_rounded; + existingEntity.plan_guid = i.plan_guid; + existingEntity.executed_date = i.executed_date; + existingEntity.limit_frame_005 = i.limit_frame_005; + existingEntity.status_self = i.status_self; + existingEntity.status_chief = i.status_chief; + existingEntity.supervisor1 = i.supervisor1; + existingEntity.supervisor1_result = i.supervisor1_result; + existingEntity.supervisor1_remark = i.supervisor1_remark; + existingEntity.supervisor1_date = i.supervisor1_date; + existingEntity.salary_adjustment_date = i.salary_adjustment_date; + existingEntity.limit_frame_005_total = i.limit_frame_005_total; + existingEntity.limit_frame_005_total_rounded = i.limit_frame_005_total_rounded; - existingEntity.SetAutoField(_repository.Context); + existingEntity.SetAutoField(_repository.Context); _repository.UpdateWithoutCommit(i.id.Value, existingEntity); } } @@ -242,22 +288,22 @@ namespace TodoAPI2.Models { var entity = GetEntity(i); entity.id = Guid.NewGuid(); - entity.SetAutoField(_repository.Context); + entity.SetAutoField(_repository.Context); _repository.InsertWithoutCommit(entity); } else if (i.active_mode == "0" && i.id.HasValue) // remove - { + { _repository.DeleteWithoutCommit(i.id.Value); } else if (i.active_mode == "0" && !i.id.HasValue) { // nothing to do - } + } } if (is_force_save) { _repository.Context.SaveChanges(); - } + } return model.Count().ToString(); } @@ -276,12 +322,25 @@ namespace TodoAPI2.Models } public void Delete(Guid id) { + var all_group = (from i in _repository.Context.eva_limit_frame_group + where i.frame_plan_guid == id + select i); + foreach (var x in all_group) + { + var all_emp = from i in _repository.Context.eva_limit_frame_employee + where i.frame_group_guid == x.id + select i; + _repository.Context.RemoveRange(all_emp); + } + + _repository.Context.RemoveRange(all_group); + _repository.Delete(id); return; } - public void RefreshAutoFieldOfAllData() + public void RefreshAutoFieldOfAllData() { var all_items = from i in _repository.Context.eva_limit_frame_plan select i; @@ -292,7 +351,7 @@ namespace TodoAPI2.Models _repository.Context.SaveChanges(); } - private Dictionary GetLookupForLog() + private Dictionary GetLookupForLog() { var i = new Dictionary(); @@ -313,7 +372,7 @@ namespace TodoAPI2.Models i.Add("salary_adjustment_date", "เลื่อนเงินเดือนวันที่"); i.Add("txt_salary_adjustment_date", "เลื่อนเงินเดือนวันที่"); i.Add("limit_frame_005_total", "กันวงเงินไว้"); - i.Add("limit_frame_005_total_rounded", "กันวงเงินใช้จริง"); + i.Add("limit_frame_005_total_rounded", "กันวงเงินใช้จริง"); return i; } diff --git a/Models/rep_eva_limit_frame_plan/Irep_eva_limit_frame_planService.cs b/Models/rep_eva_limit_frame_plan/Irep_eva_limit_frame_planService.cs new file mode 100644 index 0000000..50e536c --- /dev/null +++ b/Models/rep_eva_limit_frame_plan/Irep_eva_limit_frame_planService.cs @@ -0,0 +1,22 @@ +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_eva_limit_frame_planService + { + rep_eva_limit_frame_planWithSelectionViewModel GetBlankItem(); + DataContext GetContext(); + + + + } +} + diff --git a/Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planInputModel.cs b/Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planInputModel.cs new file mode 100644 index 0000000..2c505e7 --- /dev/null +++ b/Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planInputModel.cs @@ -0,0 +1,24 @@ +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_eva_limit_frame_planInputModel + { + + public Guid? id { get; set; } + + public Guid? frame_plan_guid { get; set; } + + public string active_mode { get; set; } + } +} + diff --git a/Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planReportRequestModel.cs b/Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planReportRequestModel.cs new file mode 100644 index 0000000..5238fc6 --- /dev/null +++ b/Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planReportRequestModel.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_eva_limit_frame_planReportRequestModel : rep_eva_limit_frame_planSearchModel + { + public string filetype { get; set; } + + public string contentType { get { return MyHelper.GetContentType(filetype); } } + } +} + diff --git a/Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planSearchModel.cs b/Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planSearchModel.cs new file mode 100644 index 0000000..13d2354 --- /dev/null +++ b/Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planSearchModel.cs @@ -0,0 +1,28 @@ +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_eva_limit_frame_planSearchModel + { + + public Guid id { get; set; } + + public Guid? frame_plan_guid { get; set; } + + public string salary_adjustment_date_text { get; set; } + public string executed_date_text { get; set; } + public string intro_desc { get; set; } + public string detail_desc { get; set; } + public Guid? group_guid { get; set; } + } +} + diff --git a/Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planService.cs b/Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planService.cs new file mode 100644 index 0000000..32cafa9 --- /dev/null +++ b/Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planService.cs @@ -0,0 +1,49 @@ +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_eva_limit_frame_planService : Irep_eva_limit_frame_planService + { + private IBaseRepository2 _repository; + private IMyDatabase db; + private Iexternal_linkageService ext; + + public rep_eva_limit_frame_planService(IBaseRepository2 repository, IMyDatabase mydb, Iexternal_linkageService inext) + { + _repository = repository; + db = mydb; + ext = inext; + } + + public rep_eva_limit_frame_planWithSelectionViewModel GetBlankItem() + { + var i = new rep_eva_limit_frame_planWithSelectionViewModel(); + i.item_frame_plan_guid = (from x in _repository.Context.eva_limit_frame_plan select x).ToList(); + + + return i; + } + + public DataContext GetContext() + { + return _repository.Context; + } + + + } +} \ No newline at end of file diff --git a/Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planViewModel.cs b/Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planViewModel.cs new file mode 100644 index 0000000..3b7703d --- /dev/null +++ b/Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planViewModel.cs @@ -0,0 +1,22 @@ +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_eva_limit_frame_planViewModel : BaseViewModel2 + { + + public Guid? frame_plan_guid { get; set; } + + public DateTime? frame_plan_guid_eva_limit_frame_plan_executed_date { get; set; } + + } +} \ No newline at end of file diff --git a/Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planWithSelectionViewModel.cs b/Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planWithSelectionViewModel.cs new file mode 100644 index 0000000..16eb9ce --- /dev/null +++ b/Models/rep_eva_limit_frame_plan/rep_eva_limit_frame_planWithSelectionViewModel.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace TodoAPI2.Models +{ + public class rep_eva_limit_frame_planWithSelectionViewModel: rep_eva_limit_frame_planViewModel + { + public List item_frame_plan_guid { get; set; } + + } +} \ No newline at end of file diff --git a/Startup.cs b/Startup.cs index b82ca5a..dcc7159 100644 --- a/Startup.cs +++ b/Startup.cs @@ -321,6 +321,8 @@ namespace Test01 services.AddScoped, BaseRepository2>(); services.AddScoped(); + services.AddScoped(); + #endregion services.TryAddSingleton(); @@ -592,6 +594,10 @@ namespace Test01 cfg.CreateMap(); cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + }); #endregion diff --git a/ViewControllers/rep_eva_limit_frame_planViewControllers.cs b/ViewControllers/rep_eva_limit_frame_planViewControllers.cs new file mode 100644 index 0000000..b96a8a1 --- /dev/null +++ b/ViewControllers/rep_eva_limit_frame_planViewControllers.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_eva_limit_frame_planViewController : Controller + { + private ILogger _logger; + private Irep_eva_limit_frame_planService _repository; + private IConfiguration Configuration { get; set; } + + /// + /// Default constructure for dependency injection + /// + /// + /// + /// + public rep_eva_limit_frame_planViewController(ILogger logger, Irep_eva_limit_frame_planService repository, IConfiguration configuration) + { + _logger = logger; + _repository = repository; + Configuration = configuration; + } + + // public IActionResult rep_eva_limit_frame_plan() + // { + //if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + // return View(); + // } + + // public IActionResult rep_eva_limit_frame_plan_d() + // { + //if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + // return View(); + // } + + public IActionResult rep_eva_limit_frame_plan_report() + { + if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized(); // Or UnauthorizedView + return View(); + } + + //public IActionResult rep_eva_limit_frame_plan_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/rep_eva_limit_frame_planView/rep_eva_limit_frame_plan_report.cshtml b/Views/rep_eva_limit_frame_planView/rep_eva_limit_frame_plan_report.cshtml new file mode 100644 index 0000000..fa3264b --- /dev/null +++ b/Views/rep_eva_limit_frame_planView/rep_eva_limit_frame_plan_report.cshtml @@ -0,0 +1,55 @@ +@using Microsoft.Extensions.Configuration +@inject IConfiguration Configuration +@{ + ViewData["Title"] = "rep_eva_limit_frame_plan"; +} + +
+
+
+ @Configuration["SiteInformation:modulename"] +
+
+
+ +
+
+ +
+
รายงาน rep_eva_limit_frame_plan
+
+
+
+
+ +
+ + +
+ +
+
+
+ + +
+
+
+
+
+ + +@section FooterPlaceHolder{ + + +} + diff --git a/appsettings.Development.json b/appsettings.Development.json index a58db54..2b7e1ee 100644 --- a/appsettings.Development.json +++ b/appsettings.Development.json @@ -1,9 +1,9 @@ { "connectionStrings": { - //"mainDBConnectionString": "Server=192.168.1.34;Port=32432;Database=tb320_hr_site2;User ID=postgres;Password=ZdPr0jects;", - //"externalDBConnectionString": "Server=192.168.1.34;Port=32432;Database=tb320_hr_site2;User ID=postgres;Password=ZdPr0jects;" - "mainDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr_site2;User ID=postgres;Password=project0*;", - "externalDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr_site2;User ID=postgres;Password=project0*;" + "mainDBConnectionString": "Server=192.168.1.34;Port=32432;Database=tb320_hr_site2;User ID=postgres;Password=ZdPr0jects;", + "externalDBConnectionString": "Server=192.168.1.34;Port=32432;Database=tb320_hr_site2;User ID=postgres;Password=ZdPr0jects;" + //"mainDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr_site2;User ID=postgres;Password=project0*;", + //"externalDBConnectionString": "Server=192.168.2.233;Port=5432;Database=tb320_hr_site2;User ID=postgres;Password=project0*;" }, "IdentityServer": { "url": "", diff --git a/tb320eva.csproj b/tb320eva.csproj index 77a331d..c2eea93 100644 --- a/tb320eva.csproj +++ b/tb320eva.csproj @@ -85,6 +85,7 @@ + @@ -105,6 +106,7 @@ + diff --git a/tb320eva.xml b/tb320eva.xml index b9e68df..9288550 100644 --- a/tb320eva.xml +++ b/tb320eva.xml @@ -4321,6 +4321,124 @@ Returns the item Error Occurred + + + Default constructure for dependency injection + + + + + + + + Get specific item by id + + + + Return Get specific item by id + Returns the item + Error Occurred + + + + Get Blank Item + + + + Return a blank item + Returns the item + Error Occurred + + + + Get list items by frame_plan_guid + + + + Return list of items by specifced keyword + Returns the item + Error Occurred + + + + Get list items by search + + + + Return list of items by specifced keyword + Returns the item + Error Occurred + + + + Download Report + + + + Return list of items by specifced keyword + Returns the item + Error Occurred + + + + Create new item + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Update item + + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Delete item + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Update multiple item + + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + + + + Refresh AutoField of all items + + + + Response Result Message + Response Result Message + If the model is invalid + Error Occurred + Default constructure for dependency injection @@ -4997,6 +5115,14 @@ + + + Default constructure for dependency injection + + + + + Default constructure for dependency injection diff --git a/wwwroot/js/rep_eva_limit_frame_plan/rep_eva_limit_frame_plan_report.js b/wwwroot/js/rep_eva_limit_frame_plan/rep_eva_limit_frame_plan_report.js new file mode 100644 index 0000000..6cbd74d --- /dev/null +++ b/wwwroot/js/rep_eva_limit_frame_plan/rep_eva_limit_frame_plan_report.js @@ -0,0 +1,58 @@ +var rep_eva_limit_frame_plan_API = "/api/rep_eva_limit_frame_plan/"; + +//================= Search Customizaiton ========================================= + +function rep_eva_limit_frame_plan_GetSearchParameter(fileType) { + var rep_eva_limit_frame_planSearchObject = new Object(); +rep_eva_limit_frame_planSearchObject.frame_plan_guid = $("#s_rep_eva_limit_frame_plan_frame_plan_guid").val(); + + + rep_eva_limit_frame_planSearchObject.fileType = fileType; + + console.log(rep_eva_limit_frame_planSearchObject); + + return rep_eva_limit_frame_planSearchObject; +} + +function rep_eva_limit_frame_plan_FeedDataToSearchForm(data) { +DropDownClearFormAndFeedWithData($("#s_rep_eva_limit_frame_plan_frame_plan_guid"), data, "id", "executed_date", "item_frame_plan_guid", data.frame_plan_guid); + +} + +//================= Form Data Customizaiton ========================================= + +function rep_eva_limit_frame_plan_InitialForm(s) { + var successFunc = function (result) { + rep_eva_limit_frame_plan_FeedDataToSearchForm(result); + endLoad(); + }; + startLoad(); + AjaxGetRequest(apisite + rep_eva_limit_frame_plan_API + "GetBlankItem", successFunc, AlertDanger); +} + +//================= Data Table ========================================= + +var s_rep_eva_limit_frame_plan_customValidation = function (group) { + return ""; +}; + + +function rep_eva_limit_frame_plan_DoSearch(fileType) { + if (!ValidateForm('s_rep_eva_limit_frame_plan', s_rep_eva_limit_frame_plan_customValidation)) { + return; + } + + var p = $.param(rep_eva_limit_frame_plan_GetSearchParameter(fileType)); + + var report_url = apisite + "/api/rep_eva_limit_frame_plan/rep_eva_limit_frame_plan_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); + } +} +