เพิ่มหน้า ui รายงาน เงินเดือน

This commit is contained in:
Nakorn Rientrakrunchai
2020-08-24 09:19:47 +07:00
parent 5309806df0
commit f4a7c9c814
17 changed files with 583 additions and 0 deletions

View File

@@ -33,6 +33,8 @@ namespace TodoAPI2.Models
List<external_linkageViewModel> GetAllChildInDep(int? dep_id);
List<external_linkageViewModel> GetChildInDep(int? dep_id);
List<external_linkageViewModel> GetSortingDep();
List<external_linkageViewModel> GetFiscalYear2();
List<external_linkageViewModel> GetThaiMonth();
}
}

View File

@@ -14,6 +14,7 @@ using System.Net;
using TTSW.Configure;
using Microsoft.Extensions.Options;
using System.Data;
using System.Globalization;
namespace TodoAPI2.Models
{
@@ -354,6 +355,26 @@ namespace TodoAPI2.Models
return result;
}
public List<external_linkageViewModel> GetFiscalYear2()
{
int start_year = DateTime.Now.Year - 10;
if (start_year < 2400) start_year += 543;
int end_year = DateTime.Now.Year + 3;
if (end_year < 2400) end_year += 543;
var result = new List<external_linkageViewModel>();
for (int x = start_year; x <= end_year; x++)
{
var i = new external_linkageViewModel();
i.external_id = x - 543;
i.external_code = x.ToString();
i.external_name = x.ToString();
result.Add(i);
}
return result;
}
//public List<external_linkageViewModel> GetEvaRound()
//{
// var sql = string.Format("select distinct eva_performance_plan.id,eva_performance_plan.{0}theTime{0} , eva_performance_plan.fiscal_year from eva_performance_plan order by eva_performance_plan.fiscal_year,eva_performance_plan.{0}theTime{0}", '"'.ToString());
@@ -426,6 +447,26 @@ where detail.parent_department_id={1} or data1.id={1};", '"'.ToString(), dep_id.
return result;
}
public List<external_linkageViewModel> GetThaiMonth()
{
var result = new List<external_linkageViewModel>();
for (int monthNo = 1; monthNo <= 12; monthNo++)
{
var bar = new DateTime(DateTime.Now.Year, monthNo, 1);
string month = bar.ToString("MMMM", new CultureInfo("th-TH"));
var i = new external_linkageViewModel();
//i.external_guid = null;
i.external_id = monthNo;
i.external_code = monthNo.ToString();
i.external_name = month;
result.Add(i);
}
return result;
}
public List<external_linkageViewModel> GetSortingDep()
{
var sql = string.Format(@"

View File

@@ -0,0 +1,20 @@
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 Irpt_payroll_summaryService
{
rpt_payroll_summaryWithSelectionViewModel GetBlankItem();
}
}

View File

@@ -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 rpt_payroll_summaryInputModel
{
public Guid? id { get; set; }
public int? rpt_year { get; set; }
public int? rpt_month { get; set; }
public int? department_id { get; set; }
public string active_mode { get; set; }
}
}

View File

@@ -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 rpt_payroll_summaryReportRequestModel : rpt_payroll_summarySearchModel
{
public string filetype { get; set; }
public string contentType { get { return MyHelper.GetContentType(filetype); } }
}
}

View File

@@ -0,0 +1,27 @@
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 rpt_payroll_summarySearchModel
{
public Guid id { get; set; }
public int? rpt_year { get; set; }
public int? rpt_month { get; set; }
public int? department_id { get; set; }
}
}

View File

@@ -0,0 +1,42 @@
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 rpt_payroll_summaryService : Irpt_payroll_summaryService
{
private IMyDatabase db;
private Iexternal_linkageService ext;
public rpt_payroll_summaryService(IMyDatabase mydb, Iexternal_linkageService inext)
{
db = mydb;
ext = inext;
}
public rpt_payroll_summaryWithSelectionViewModel GetBlankItem()
{
var i = new rpt_payroll_summaryWithSelectionViewModel();
i.item_rpt_year = (from x in ext.GetFiscalYear2() orderby x.external_id descending select x).ToList();
i.item_rpt_month = (from x in ext.GetThaiMonth() select x).ToList();
i.item_department_id = (from x in ext.GetSortingDep() select x).ToList();
return i;
}
}
}

View File

@@ -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 rpt_payroll_summaryViewModel : BaseViewModel2<Guid>
{
public int? rpt_year { get; set; }
public int? rpt_month { get; set; }
public int? department_id { get; set; }
public string rpt_year_external_linkage_external_name { get; set; }
public string rpt_month_external_linkage_external_name { get; set; }
public string department_id_external_linkage_external_name { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace TodoAPI2.Models
{
public class rpt_payroll_summaryWithSelectionViewModel: rpt_payroll_summaryViewModel
{
public List<external_linkageViewModel> item_rpt_year { get; set; }
public List<external_linkageViewModel> item_rpt_month { get; set; }
public List<external_linkageViewModel> item_department_id { get; set; }
}
}