แก้ไขหลายอย่าง

This commit is contained in:
Nakorn Rientrakrunchai
2020-03-12 13:03:09 +07:00
parent 740b2d54b8
commit 7171806d1c
90 changed files with 14414 additions and 7 deletions

View File

@@ -144,6 +144,7 @@ namespace TodoAPI2.Models
performance_plan_id_eva_performance_plan_fiscal_year = fk_eva_performance_planResult1.fiscal_year,
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,
supervisor1_id_external_linkage_external_name = fk_external_linkageResult6.fullname,
supervisor2_id_external_linkage_external_name = fk_external_linkageResult7.fullname,

View File

@@ -31,6 +31,8 @@ namespace TodoAPI2.Models
public int? 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; }
public string evaluation_group_id_eva_evaluation_group_name { get; set; }
public string supervisor1_id_external_linkage_external_name { get; set; }
public string supervisor2_id_external_linkage_external_name { get; set; }
@@ -42,7 +44,7 @@ namespace TodoAPI2.Models
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_code + " ปี " +y;
return evaluation_group_id_eva_evaluation_group_name + " ปี " +y;
}
}
}

View File

@@ -0,0 +1,24 @@
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 Isearch_employee_for_groupService
{
List<search_employee_for_groupViewModel> GetListByfullname(string fullname);
List<search_employee_for_groupViewModel> GetListBySearch(search_employee_for_groupSearchModel model);
search_employee_for_groupWithSelectionViewModel GetBlankItem();
}
}

View File

@@ -0,0 +1,34 @@
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 search_employee_for_groupInputModel
{
public int? id { get; set; }
public string employee_number { get; set; }
public string fullname { get; set; }
public int? position_id { get; set; }
public string level_name { get; set; }
public int? org_id { get; set; }
public string remark { 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 search_employee_for_groupReportRequestModel : search_employee_for_groupSearchModel
{
public string filetype { get; set; }
public string contentType { get { return MyHelper.GetContentType(filetype); } }
}
}

View File

@@ -0,0 +1,29 @@
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 search_employee_for_groupSearchModel
{
public int id { get; set; }
public string employee_number { get; set; }
public string fullname { get; set; }
public int? position_id { get; set; }
public int? org_id { get; set; }
}
}

View File

@@ -0,0 +1,93 @@
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 search_employee_for_groupService : Isearch_employee_for_groupService
{
private IBaseRepository2<eva_create_evaluationEntity, int> _repository;
private IMyDatabase db;
private Iexternal_linkageService ext;
private Iexternal_employeeService emp;
public search_employee_for_groupService(IBaseRepository2<eva_create_evaluationEntity, int> repository,
IMyDatabase mydb,
Iexternal_linkageService inext,
Iexternal_employeeService inemp)
{
_repository = repository;
db = mydb;
ext = inext;
emp = inemp;
}
public search_employee_for_groupWithSelectionViewModel GetBlankItem()
{
var i = new search_employee_for_groupWithSelectionViewModel();
i.item_position_id = (from x in ext.Gethrm_position_types() orderby x.external_name select x).ToList();
i.item_org_id = (from x in ext.GetDepartmentData() orderby x.external_name select x).ToList();
return i;
}
public List<search_employee_for_groupViewModel> GetListByfullname(string fullname)
{
var model = new search_employee_for_groupSearchModel();
model.fullname = fullname;
return GetListBySearch(model);
}
public List<search_employee_for_groupViewModel> GetListBySearch(search_employee_for_groupSearchModel model)
{
var allemp = emp.GetListByemployee_type(null, null);
var data = (
from m_search_employee_for_group in allemp
where 1 == 1
&& (string.IsNullOrEmpty(model.employee_number) || (!string.IsNullOrEmpty(model.employee_number) && m_search_employee_for_group.employee_no.Contains(model.employee_number)))
&& (string.IsNullOrEmpty(model.fullname) || (!string.IsNullOrEmpty(model.fullname) && m_search_employee_for_group.fullname.Contains(model.fullname)))
&& (m_search_employee_for_group.position_type_id == model.position_id || !model.position_id.HasValue)
&& (m_search_employee_for_group.department_id == model.org_id || !model.org_id.HasValue)
orderby m_search_employee_for_group.fullname
select new search_employee_for_groupViewModel()
{
id = m_search_employee_for_group.id,
employee_number = m_search_employee_for_group.employee_no,
fullname = m_search_employee_for_group.fullname,
position_id = m_search_employee_for_group.position_type_id,
level_name = m_search_employee_for_group.position_level_text,
org_id = m_search_employee_for_group.department_id,
remark = m_search_employee_for_group.user_email,
position_id_external_linkage_external_name = m_search_employee_for_group.position_name,
org_id_external_linkage_external_name = m_search_employee_for_group.department_name,
isActive = true,
Created = null,
Updated = null
}
).ToList();
return data;
}
}
}

View File

@@ -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 search_employee_for_groupViewModel : BaseViewModel2<int>
{
public string employee_number { get; set; }
public string fullname { get; set; }
public int? position_id { get; set; }
public string level_name { get; set; }
public int? org_id { get; set; }
public string remark { get; set; }
public string position_id_external_linkage_external_name { get; set; }
public string org_id_external_linkage_external_name { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace TodoAPI2.Models
{
public class search_employee_for_groupWithSelectionViewModel: search_employee_for_groupViewModel
{
public List<external_linkageViewModel> item_position_id { get; set; }
public List<external_linkageViewModel> item_org_id { get; set; }
}
}