ปรับปรุงหน้าจอ migration และ เงื่อนไขการค้นหา หน้าทำแบบประเมิน

This commit is contained in:
LAPTOP-KB8JC2K2\acer
2021-04-06 11:34:25 +07:00
parent c8f4d2317c
commit 4844a0ad44
16 changed files with 1237 additions and 150 deletions

View File

@@ -74,6 +74,11 @@ namespace TodoAPI2.Models
[MaxLength(255)]
public string level_score_final { get; set; }
[MaxLength(1000)]
public string fullname_at_this_time { get; set; }
[MaxLength(1000)]
public string employee_no_at_this_time { get; set; }
}
}

View File

@@ -58,8 +58,11 @@ namespace TodoAPI2.Models
public int? order_at_this_time { get; set; }
public string active_mode { get; set; }
public string fullname_at_this_time { get; set; }
public string employee_no_at_this_time { get; set; }
public string active_mode { get; set; }
}
}

View File

@@ -158,6 +158,9 @@ namespace TodoAPI2.Models
adjust_postponement_quota_id_eva_adjust_postponement_fiscal_year = fk_eva_adjust_postponementResult2.fiscal_year,
employee_id_external_linkage_external_name = fk_external_linkageResult3.fullname,
fullname_at_this_time = m_eva_adjust_postponement_detail_migration.fullname_at_this_time,
employee_no_at_this_time = m_eva_adjust_postponement_detail_migration.employee_no_at_this_time,
isActive = m_eva_adjust_postponement_detail_migration.isActive,
Created = m_eva_adjust_postponement_detail_migration.created,
Updated = m_eva_adjust_postponement_detail_migration.updated
@@ -227,6 +230,9 @@ namespace TodoAPI2.Models
existingEntity.org_at_this_time = model.org_at_this_time;
existingEntity.order_at_this_time = model.order_at_this_time;
existingEntity.fullname_at_this_time = model.fullname_at_this_time;
existingEntity.employee_no_at_this_time = model.employee_no_at_this_time;
var updated = _repository.Update(id, existingEntity);
return Get(updated.id);
}
@@ -266,6 +272,9 @@ namespace TodoAPI2.Models
existingEntity.org_at_this_time = i.org_at_this_time;
existingEntity.order_at_this_time = i.order_at_this_time;
existingEntity.fullname_at_this_time = i.fullname_at_this_time;
existingEntity.employee_no_at_this_time = i.employee_no_at_this_time;
//existingEntity.SetAutoField(_repository.Context);
_repository.UpdateWithoutCommit(i.id.Value, existingEntity);
}
@@ -325,7 +334,6 @@ namespace TodoAPI2.Models
{
var i = new Dictionary<string, string>();
i.Add("adjust_postponement_id", "รหัสอ้างอิงตาราง eva_adjust_postponement");
i.Add("adjust_postponement_id_eva_adjust_postponement_fiscal_year", "รหัสอ้างอิงตาราง eva_adjust_postponement");
i.Add("adjust_postponement_quota_id", "รหัสอ้างอิงตาราง eva_adjust_postponement");
@@ -344,6 +352,8 @@ namespace TodoAPI2.Models
i.Add("new_sarary_with_quota", "เงินเดือนใหม่ (รวมโควต้า)");
i.Add("position_this_time", "ตำแหน่ง (ณ วันปรับเลื่อน)");
i.Add("level_this_time", "ระดับ (ณ วันปรับเลื่อน)");
i.Add("fullname_at_this_time", "ชื่อ-ชื่อสกุล (ณ วันปรับเลื่อน)");
i.Add("employee_no_at_this_time", "เลขที่พนักงาน (ณ วันปรับเลื่อน)");
return i;
}

View File

@@ -51,13 +51,19 @@ namespace TodoAPI2.Models
public decimal? migration_total_score { get; set; }
public string migration_eva_result { get; set; }
public int? org_at_this_time { get; set; }
public int? order_at_this_time { get; set; }
public string fullname_at_this_time { get; set; }
public string employee_no_at_this_time { get; set; }
public int? adjust_postponement_id_eva_adjust_postponement_fiscal_year { get; set; }
public int? adjust_postponement_quota_id_eva_adjust_postponement_fiscal_year { get; set; }
public string employee_id_external_linkage_external_name { get; set; }
public string org_at_this_time_external_linkage_external_name { get; set; }
}
}

View File

@@ -9,5 +9,6 @@ namespace TodoAPI2.Models
{
public List<external_employeeViewModel> item_employee_id { get; set; }
public List<external_linkageViewModel> item_org_at_this_time { get; set; }
}
}

View File

@@ -198,7 +198,7 @@ namespace TodoAPI2.Models
item.item_level_score = (from i in _repository.Context.eva_level_score
orderby i.min_score
select Mapper.Map<eva_level_scoreViewModel>(i)).ToList();
item.item_employee_id = (from x in emp.GetListByemployee_type(null,null) select x).ToList();
item.item_employee_id = (from x in emp.GetAllEmployee() where x.count_resigns == 0 select x).ToList();
return item;
}
@@ -206,7 +206,7 @@ namespace TodoAPI2.Models
{
var i = new eva_create_evaluation_detail_processWithSelectionViewModel();
i.item_org_id = ext.GetDepartmentData();
i.item_employee_id = (from x in emp.GetListByemployee_type(null, null) select x).ToList();
i.item_employee_id = (from x in emp.GetAllEmployee() where x.count_resigns == 0 select x).ToList();
//i.item_level_score = (from j in _repository.Context.eva_level_score
// orderby j.min_score
// select Mapper.Map<eva_level_scoreViewModel>(i)).ToList();

View File

@@ -95,7 +95,8 @@ hpt.position_type_name,he.packing_date,he.cost_of_living,
LIMIT 1) IS NOT null THEN 'ช่วยปฎิบัติหน้าที่'
ELSE null END) as remark_hrm_work_record,
org_type_depart.department_degree_id, he.timerecorder_id
org_type_depart.department_degree_id, he.timerecorder_id,
(select count(*) from hrm_resigns where hrm_resigns.employee_id = he.employee_id) as count_resigns
from public.hrm_employees as he
left join public.hrm_position_types as hpt on he.position_type_id=hpt.id
@@ -108,6 +109,30 @@ 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
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
left join (select orgdata.id,orgdata2.id as id2,
case when orgdata2.department_name is not null then
concat(orgdata2.department_name,' - ',orgdata.department_name)
else orgdata.department_name end as full_dep,
orgdata.department_name,
orgdata.department_code,detail.parent_department_id,
case
when org_type_depart.department_degree_id = 1 then orgdata.department_code::int*1000
when detail.parent_department_id is not null and detail.parent_department_id>0
then orgdata2.department_code::int*1000+orgdata.department_code::int
else orgdata.department_code::int*100000 end as sort_order,org_type_depart.department_degree_id
from public.{0}DepartmentData{0} orgdata
left join org_organization_chart_details detail on orgdata.id = detail.department_id
left join public.{0}DepartmentData{0} orgdata2 on orgdata2.id = detail.parent_department_id
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 orgdata.department_name is not null
order by case
when org_type_depart.department_degree_id = 1 then orgdata.department_code::int*1000
when detail.parent_department_id is not null and detail.parent_department_id>0
then orgdata2.department_code::int*1000+orgdata.department_code::int
else orgdata.department_code::int*100000 end) as sorting_dep
on sorting_dep.id = he.department_id
where he.deleted_at is null
and hpt.deleted_at is null
and hpl.deleted_at is null
@@ -119,7 +144,7 @@ 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
order by he.firstname, he.lastname;
order by sorting_dep.sort_order, hpt.position_type_id, hpl.position_level_id, employee_no desc;
", '"'.ToString());
var para = db.GetParameterListNpgsql();
DataTable dt = db.ExecuteDataTableNpgsql(sql, para);
@@ -210,6 +235,14 @@ order by he.firstname, he.lastname;
{
i.timerecorder_id = "";
}
if (dr["count_resigns"] != DBNull.Value)
{
i.count_resigns = Convert.ToInt32(dr["count_resigns"]);
}
else
{
i.count_resigns = 0;
}
result.Add(i);
}

View File

@@ -69,6 +69,7 @@ namespace TodoAPI2.Models
public string profile_picture { get; set; }
public string timerecorder_id { get; set; }
public int count_resigns { get; set; }
public int? worked_month // ทำงานมาแล้วกี่เดือน
{