ปรับปรุง การอนุมัติแบบข้อตกลง ของ ผอ
This commit is contained in:
@@ -280,6 +280,10 @@ namespace TodoAPI2.Controllers
|
||||
if (p1.chief_fullname == p1.supervisor2_fullname)
|
||||
{
|
||||
url = $"{mainurl}{reportsite}/rep_eva_x{k}A.{model.filetype}?{MyHelper.GetParameterForJasperReport(p1)}&j_username={username}&j_password={password}";
|
||||
if (!string.IsNullOrEmpty(p1.supervisor3A_fullname))
|
||||
{
|
||||
url = $"{mainurl}{reportsite}/rep_eva_x{k}AC.{model.filetype}?{MyHelper.GetParameterForJasperReport(p1)}&j_username={username}&j_password={password}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -401,8 +405,8 @@ namespace TodoAPI2.Controllers
|
||||
where n.performance_plan_id == x2.id
|
||||
select n.start_date).Min();
|
||||
var end = (from n in context.eva_performance_plan_detail
|
||||
where n.performance_plan_id == x2.id
|
||||
select n.end_date).Min();
|
||||
where n.performance_plan_id == x2.id
|
||||
select n.end_date).Max();
|
||||
var text = MyHelper.GetDateStringForReport(start) + " ถึง " + MyHelper.GetDateStringForReport(end);
|
||||
if(x2.theTime == 1)
|
||||
{
|
||||
@@ -414,6 +418,11 @@ namespace TodoAPI2.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(i.round2_text))
|
||||
{
|
||||
i.round2_text = $"1 เมษายน {p.fiscal_year} ถึง 30 กันยายน {p.fiscal_year}";
|
||||
}
|
||||
|
||||
var detail = (from x in context.eva_create_evaluation_detail
|
||||
where x.id == detail_id
|
||||
select x).FirstOrDefault();
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace TodoAPI2.Models
|
||||
status_chief = m_eva_create_evaluation_detail_agreement.status_chief,
|
||||
status_chief_a = m_eva_create_evaluation_detail_agreement.status_chief_a,
|
||||
status_supervisor = m_eva_create_evaluation_detail_agreement.status_supervisor,
|
||||
status_supervisor_a = null,
|
||||
status_supervisor_a = m_eva_create_evaluation_detail_agreement.status_supervisor_a,
|
||||
|
||||
org_id_external_linkage_external_name = fk_external_employee.department_name,
|
||||
|
||||
@@ -445,6 +445,7 @@ namespace TodoAPI2.Models
|
||||
status_chief = m_eva_create_evaluation_detail_agreement.status_chief,
|
||||
status_chief_a = m_eva_create_evaluation_detail_agreement.status_chief_a,
|
||||
status_supervisor = m_eva_create_evaluation_detail_agreement.status_supervisor,
|
||||
status_supervisor_a = m_eva_create_evaluation_detail_agreement.status_supervisor_a,
|
||||
|
||||
org_id_external_linkage_external_name = !string.IsNullOrEmpty(fk_external_linkageResult11.external_name) ? fk_external_linkageResult11.external_name : fk_external_linkageResult12.external_name,
|
||||
|
||||
@@ -453,6 +454,7 @@ namespace TodoAPI2.Models
|
||||
status_self_a_click_date = m_eva_create_evaluation_detail_agreement.status_self_a_click_date,
|
||||
status_chief_a_click_date = m_eva_create_evaluation_detail_agreement.status_chief_a_click_date,
|
||||
status_supervisor_click_date = m_eva_create_evaluation_detail_agreement.status_supervisor_click_date,
|
||||
status_supervisor_a_click_date = m_eva_create_evaluation_detail_agreement.status_supervisor_a_click_date,
|
||||
|
||||
plan_round_year = checkNull(fk_planResult.theTime) + "/" + checkNull(fk_planResult.fiscal_year),
|
||||
|
||||
|
||||
@@ -187,10 +187,10 @@ namespace TodoAPI2.Models
|
||||
where k.id == model.id
|
||||
select k).FirstOrDefault();
|
||||
|
||||
if (current_detail.status_chief_a == "Y")
|
||||
{
|
||||
throw new Exception("ผู้ประเมิน อนุมัติข้อตกลงไปแล้ว บันทึกไม่ได้");
|
||||
}
|
||||
//if (current_detail.status_chief_a == "Y")
|
||||
//{
|
||||
// throw new Exception("ผู้ประเมิน อนุมัติข้อตกลงไปแล้ว บันทึกไม่ได้");
|
||||
//}
|
||||
|
||||
existingEntity.create_evaluation_id = model.create_evaluation_id;
|
||||
existingEntity.chief_a = model.chief_a;
|
||||
|
||||
@@ -26,6 +26,8 @@ namespace TodoAPI2.Models
|
||||
|
||||
public string status_chief_a { get; set; }
|
||||
|
||||
public string status_supervisor_a { get; set; }
|
||||
|
||||
public string status_supervisor { get; set; }
|
||||
|
||||
public string status_supervisor1A { get; set; }
|
||||
|
||||
@@ -200,6 +200,7 @@ namespace TodoAPI2.Models
|
||||
existingEntity.status_chief = model.status_chief;
|
||||
existingEntity.status_self_a = model.status_self_a;
|
||||
existingEntity.status_chief_a = model.status_chief_a;
|
||||
existingEntity.status_supervisor_a = model.status_supervisor_a;
|
||||
existingEntity.status_supervisor = model.status_supervisor;
|
||||
existingEntity.status_supervisor1A = model.status_supervisor1A;
|
||||
existingEntity.status_supervisor2A = model.status_supervisor2A;
|
||||
|
||||
@@ -183,15 +183,23 @@ namespace TodoAPI2.Models
|
||||
{
|
||||
var existingEntity = _repository.Get(id);
|
||||
|
||||
var plan = (from i in _repository.Context.eva_limit_frame_plan where i.plan_guid == existingEntity.frame_plan_guid select i).FirstOrDefault();
|
||||
var plan = (from i in _repository.Context.eva_limit_frame_plan
|
||||
where i.id == existingEntity.frame_plan_guid
|
||||
select i).FirstOrDefault();
|
||||
|
||||
var start = (from n in _repository.Context.eva_performance_plan_detail
|
||||
where n.performance_plan_id == plan.plan_guid
|
||||
select n.start_date).Min();
|
||||
var end = (from n in _repository.Context.eva_performance_plan_detail
|
||||
where n.performance_plan_id == plan.plan_guid
|
||||
select n.end_date).Max();
|
||||
|
||||
var all_all_emp = emp.GetAllEmployee();
|
||||
var mapping_dept = emp.GetDeptMapping();
|
||||
var working_record = from i in emp.GetWorkingRecord()
|
||||
// where
|
||||
//plan.executed_date.HasValue
|
||||
//&& i.start_date <= plan.executed_date
|
||||
//&& i.end_date >= plan.executed_date
|
||||
where
|
||||
i.start_date >= start
|
||||
&& i.end_date <= end
|
||||
select i;
|
||||
|
||||
if (existingEntity != null)
|
||||
@@ -212,13 +220,16 @@ namespace TodoAPI2.Models
|
||||
{
|
||||
var theemp = (from q in all_all_emp where q.id == y.employee_id select q).FirstOrDefault();
|
||||
var thedetail = (from r in working_record where r.employee_id == y.employee_id select r).FirstOrDefault();
|
||||
var help_at = (from s in mapping_dept where s.id == thedetail.place select s).FirstOrDefault();
|
||||
if (theemp != null && thedetail != null && help_at != null)
|
||||
if(thedetail != null)
|
||||
{
|
||||
if (existingEntity.remark != "") existingEntity.remark += "\n";
|
||||
existingEntity.remark += $"{j}.ในลำดับที่ {y.order_of_data} {theemp.fullname} ตำแหน่ง{theemp.position_name} {theemp.department_name} \nมาช่วยปฏิบัติงานที่{help_at.department_name} ตั้งแต่วันที่ {MyHelper.GetDateStringForReport(thedetail.start_date)} - {MyHelper.GetDateStringForReport(thedetail.end_date)} \nตาม{thedetail.subject}";
|
||||
}
|
||||
j++;
|
||||
var help_at = (from s in mapping_dept where s.id == thedetail.place select s).FirstOrDefault();
|
||||
if (theemp != null && help_at != null)
|
||||
{
|
||||
if (existingEntity.remark != "") existingEntity.remark += "\n";
|
||||
existingEntity.remark += $"{j}.ในลำดับที่ {y.order_of_data} {theemp.fullname} ตำแหน่ง{theemp.position_name} {theemp.department_name} \nมาช่วยปฏิบัติงานที่{help_at.department_name} ตั้งแต่วันที่ {MyHelper.GetDateStringForReport(thedetail.start_date)} - {MyHelper.GetDateStringForReport(thedetail.end_date)} \nตาม{thedetail.subject}";
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -150,12 +150,19 @@ namespace TodoAPI2.Models
|
||||
entity.id = Guid.NewGuid();
|
||||
entity.limit_frame_005 = (decimal?)0.05;
|
||||
|
||||
var start = (from n in _repository.Context.eva_performance_plan_detail
|
||||
where n.performance_plan_id == model.plan_guid
|
||||
select n.start_date).Min();
|
||||
var end = (from n in _repository.Context.eva_performance_plan_detail
|
||||
where n.performance_plan_id == model.plan_guid
|
||||
select n.end_date).Max();
|
||||
|
||||
var all_all_emp = emp.GetAllEmployee();
|
||||
var mapping_dept = emp.GetDeptMapping();
|
||||
var working_record = from i in emp.GetWorkingRecord() where
|
||||
model.executed_date.HasValue
|
||||
&& i.start_date <= model.executed_date
|
||||
&& i.end_date >= model.executed_date
|
||||
var working_record = from i in emp.GetWorkingRecord()
|
||||
where
|
||||
i.start_date >= start
|
||||
&& i.end_date <= end
|
||||
select i;
|
||||
var result_frame_group = new List<eva_limit_frame_groupEntity>();
|
||||
var result_frame_employee = new List<eva_limit_frame_employeeEntity>();
|
||||
@@ -242,13 +249,16 @@ namespace TodoAPI2.Models
|
||||
{
|
||||
var theemp = (from q in all_all_emp where q.id == y.employee_id select q).FirstOrDefault();
|
||||
var thedetail = (from r in working_record where r.employee_id == y.employee_id select r).FirstOrDefault();
|
||||
var help_at = (from s in mapping_dept where s.id == thedetail.place select s).FirstOrDefault();
|
||||
if(theemp != null && thedetail != null && help_at != null)
|
||||
if(thedetail != null)
|
||||
{
|
||||
if (x.remark != "") x.remark += "\n";
|
||||
x.remark += $"{j}.ในลำดับที่ {y.order_of_data} {theemp.fullname} ตำแหน่ง{theemp.position_name} {theemp.department_name} \nมาช่วยปฏิบัติงานที่{help_at.department_name} ตั้งแต่วันที่ {MyHelper.GetDateStringForReport(thedetail.start_date)} - {MyHelper.GetDateStringForReport(thedetail.end_date)} \nตาม{thedetail.subject}";
|
||||
}
|
||||
j++;
|
||||
var help_at = (from s in mapping_dept where s.id == thedetail.place select s).FirstOrDefault();
|
||||
if (theemp != null && help_at != null)
|
||||
{
|
||||
if (x.remark != "") x.remark += "\n";
|
||||
x.remark += $"{j}.ในลำดับที่ {y.order_of_data} {theemp.fullname} ตำแหน่ง{theemp.position_name} {theemp.department_name} \nมาช่วยปฏิบัติงานที่{help_at.department_name} ตั้งแต่วันที่ {MyHelper.GetDateStringForReport(thedetail.start_date)} - {MyHelper.GetDateStringForReport(thedetail.end_date)} \nตาม{thedetail.subject}";
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,6 +319,8 @@
|
||||
|
||||
function CheckPermission() {
|
||||
|
||||
console.log("status_supervisor_a =" + status_supervisor_a);
|
||||
|
||||
$(".status_self").hide();
|
||||
$(".status_chief").hide();
|
||||
$(".status_supervisor").hide();
|
||||
|
||||
@@ -70,12 +70,13 @@ function eva_create_evaluation_detail_firstdoc_InitialForm() {
|
||||
|
||||
function eva_create_evaluation_detail_firstdoc_SetEditForm(a) {
|
||||
var successFunc = function (result) {
|
||||
console.log(result)
|
||||
//console.log(result)
|
||||
eva_create_evaluation_detail_firstdoc_editMode = "UPDATE";
|
||||
eva_create_evaluation_detail_firstdoc_FeedDataToForm(result);
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
console.log(apisite + eva_create_evaluation_detail_firstdoc_API + a);
|
||||
AjaxGetRequest(apisite + eva_create_evaluation_detail_firstdoc_API + a, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
|
||||
@@ -88,6 +88,9 @@ function eva_create_evaluation_detail_status_PutUpdate(a) {
|
||||
else if (a === "nextB") {
|
||||
data.status_chief_a = "Y";
|
||||
}
|
||||
else if (a === "nextC") {
|
||||
data.status_supervisor_a = "Y";
|
||||
}
|
||||
else if (a === "next0") {
|
||||
data.status_self = "Y";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user