แก้รายงาน และแก้บักต่างๆ
This commit is contained in:
@@ -69,7 +69,7 @@ where ha.employee_id = @emp_id and ha.workingstatus = 'สถานะปฏิ
|
||||
select he.employee_id as id, mpn.position_number,he.employee_no,he.position_no,
|
||||
CONCAT(htm.title_name,' ',he.firstname,' ',he.lastname) as fullname,opd.position_name,
|
||||
orgdata.id as department_id,orgdata.department_name,orgdata.department_code,he.salary,
|
||||
he.employee_type_id, het.employee_type_name,
|
||||
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,hpl.position_level_id
|
||||
from public.hrm_employees as he
|
||||
left join public.hrm_position_levels as hpl on he.position_level_id = hpl.id
|
||||
@@ -99,6 +99,12 @@ order by he.firstname,he.lastname;
|
||||
i.employee_type_name = dr["employee_type_name"].ToString();
|
||||
}
|
||||
i.position_type_id = null;
|
||||
|
||||
if (dr["position_id"] != DBNull.Value)
|
||||
{
|
||||
i.position_id = Convert.ToInt32(dr["position_id"]);
|
||||
}
|
||||
|
||||
if (dr["user_id"] != DBNull.Value)
|
||||
{
|
||||
i.user_email = dr["user_email"].ToString();
|
||||
@@ -116,7 +122,7 @@ order by he.firstname,he.lastname;
|
||||
}
|
||||
if (dr["position_level_id"] != DBNull.Value)
|
||||
{
|
||||
i.position_level_id = Convert.ToInt32(dr["department_id"]);
|
||||
i.position_level_id = Convert.ToInt32(dr["position_level_id"]);
|
||||
i.position_level_text = dr["position_level_name"].ToString();
|
||||
}
|
||||
i.salary = 0;
|
||||
|
||||
@@ -23,6 +23,8 @@ namespace TodoAPI2.Models
|
||||
|
||||
public int? employee_type_id { get; set; }
|
||||
|
||||
public int? position_id { get; set; }
|
||||
|
||||
public int? position_type_id { get; set; }
|
||||
|
||||
public string user_email { get; set; }
|
||||
|
||||
@@ -285,7 +285,7 @@ namespace TodoAPI2.Models
|
||||
|
||||
public List<external_linkageViewModel> GetPositionForReport()
|
||||
{
|
||||
var sql = string.Format("select {0}mpn{0}.{0}position_id{0}, CONCAT(mpn.position_number,' ',pos.position_name) as position from {0}hrm_employees{0} as {0}he{0} left join {0}hrm_title_masters{0} as {0}hrm_title{0} on {0}he{0}.{0}prefix_card_name{0} = {0}hrm_title{0}.{0}id{0} left join {0}mpp_position_numbers{0} as {0}mpn{0} on {0}he{0}.{0}position{0} = {0}mpn{0}.{0}id{0} left join {0}org_position_datas{0} as {0}pos{0} on {0}mpn{0}.{0}position_id{0} = {0}pos{0}.{0}position_id{0} where {0}he{0}.{0}deleted_at{0} is null and {0}hrm_title{0}.{0}deleted_at{0} is null and {0}pos{0}.{0}deleted_at{0} is null and {0}mpn{0}.{0}deleted_at{0} is null", '"'.ToString());
|
||||
var sql = string.Format("select * from {0}org_position_datas{0} order by position_name", '"'.ToString());
|
||||
var para = db.GetParameterListNpgsql();
|
||||
DataTable dt = db.ExecuteDataTableNpgsql(sql, para);
|
||||
var result = new List<external_linkageViewModel>();
|
||||
@@ -294,7 +294,7 @@ namespace TodoAPI2.Models
|
||||
var i = new external_linkageViewModel();
|
||||
i.external_id = Convert.ToInt32(dr["position_id"]);
|
||||
i.external_code = dr["position_id"].ToString();
|
||||
i.external_name = dr["position"].ToString();
|
||||
i.external_name = dr["position_name"].ToString();
|
||||
result.Add(i);
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace TodoAPI2.Models
|
||||
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_position_id = (from x in ext.GetPositionForReport() orderby x.external_name select x).ToList();
|
||||
i.item_org_id = (from x in ext.GetDepartmentData() orderby x.external_name select x).ToList();
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace TodoAPI2.Models
|
||||
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.position_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
|
||||
@@ -72,7 +72,7 @@ namespace TodoAPI2.Models
|
||||
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,
|
||||
position_id = m_search_employee_for_group.position_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,
|
||||
|
||||
Reference in New Issue
Block a user