From 887c4d05dc8d1ef69dbd659ffd654b6f925739b1 Mon Sep 17 00:00:00 2001 From: nakorn Date: Sat, 16 Oct 2021 23:14:06 +0700 Subject: [PATCH] Add flow agreement --- ...0211016161223_AddFlowAgreement.Designer.cs | 1123 +++++++++++++++++ Migrations/20211016161223_AddFlowAgreement.cs | 33 + Migrations/DataContextModelSnapshot.cs | 5 + .../eva_create_evaluation_detailEntity.cs | 4 + ...reate_evaluation_detail_firstdocService.cs | 2 + ...ate_evaluation_detail_firstdocViewModel.cs | 5 + ..._create_evaluation_detail_statusService.cs | 30 +- ...a_create_evaluation_detail_firstdoc.cshtml | 2 +- ...create_evaluation_detail_firstdoc_d.cshtml | 35 +- .../eva_create_evaluation_detail_firstdoc.js | 1 + 10 files changed, 1225 insertions(+), 15 deletions(-) create mode 100644 Migrations/20211016161223_AddFlowAgreement.Designer.cs create mode 100644 Migrations/20211016161223_AddFlowAgreement.cs diff --git a/Migrations/20211016161223_AddFlowAgreement.Designer.cs b/Migrations/20211016161223_AddFlowAgreement.Designer.cs new file mode 100644 index 0000000..46b9e3e --- /dev/null +++ b/Migrations/20211016161223_AddFlowAgreement.Designer.cs @@ -0,0 +1,1123 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using TTSW.EF; + +namespace tb320eva.Migrations +{ + [DbContext(typeof(DataContext))] + [Migration("20211016161223_AddFlowAgreement")] + partial class AddFlowAgreement + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn) + .HasAnnotation("ProductVersion", "2.2.6-servicing-10079") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + modelBuilder.Entity("TodoAPI2.Models.activity_log_evaEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("causer_id"); + + b.Property("causer_type") + .HasMaxLength(191); + + b.Property("created_at"); + + b.Property("description") + .HasMaxLength(4000); + + b.Property("ip_address") + .HasMaxLength(191); + + b.Property("log_name") + .HasMaxLength(191); + + b.Property("mac_address") + .HasMaxLength(191); + + b.Property("properties") + .HasMaxLength(8000); + + b.Property("subject_id"); + + b.Property("subject_type") + .HasMaxLength(191); + + b.Property("updated_at"); + + b.HasKey("id"); + + b.ToTable("activity_log_eva"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponementEntity", b => + { + b.Property("id"); + + b.Property("command_no") + .HasMaxLength(4000); + + b.Property("create_evaluation_id"); + + b.Property("created"); + + b.Property("fiscal_year"); + + b.Property("imported_date"); + + b.Property("imported_file") + .HasMaxLength(1000); + + b.Property("isActive"); + + b.Property("limit"); + + b.Property("limit_frame"); + + b.Property("limit_frame_quota"); + + b.Property("limit_quota"); + + b.Property("managed_by"); + + b.Property("percentage"); + + b.Property("report_type") + .HasMaxLength(1000); + + b.Property("theDate"); + + b.Property("theRound"); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("create_evaluation_id"); + + b.ToTable("eva_adjust_postponement"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponement_detailEntity", b => + { + b.Property("id"); + + b.Property("achievement_final"); + + b.Property("adjust_postponement_id"); + + b.Property("adjust_postponement_quota_id"); + + b.Property("competency_final"); + + b.Property("cost_living"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("employee_no_at_this_time") + .HasMaxLength(1000); + + b.Property("fullname_at_this_time") + .HasMaxLength(1000); + + b.Property("isActive"); + + b.Property("is_for_postponement"); + + b.Property("level_score_final") + .HasMaxLength(255); + + b.Property("level_this_time") + .HasMaxLength(1000); + + b.Property("middle"); + + b.Property("migration_eva_result") + .HasMaxLength(1000); + + b.Property("migration_total_score"); + + b.Property("new_cost_living"); + + b.Property("new_sarary"); + + b.Property("new_sarary_with_quota"); + + b.Property("order_at_this_time"); + + b.Property("org_at_this_time"); + + b.Property("other_money_at_this_time"); + + b.Property("position_allowance_at_this_time"); + + b.Property("position_this_time") + .HasMaxLength(1000); + + b.Property("promoted_percentage"); + + b.Property("receive_quota"); + + b.Property("remark") + .HasMaxLength(1000); + + b.Property("reward_new"); + + b.Property("reward_new2"); + + b.Property("reward_old"); + + b.Property("sarary"); + + b.Property("score_final"); + + b.Property("total_promote"); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("adjust_postponement_id"); + + b.HasIndex("adjust_postponement_quota_id"); + + b.ToTable("eva_adjust_postponement_detail"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluationEntity", b => + { + b.Property("id"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("evaluation_group_id"); + + b.Property("isActive"); + + b.Property("performance_plan_id"); + + b.Property("score1"); + + b.Property("score2"); + + b.Property("supervisor1_id"); + + b.Property("supervisor2_id"); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("evaluation_group_id"); + + b.HasIndex("performance_plan_id"); + + b.ToTable("eva_create_evaluation"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluation_detailEntity", b => + { + b.Property("id"); + + b.Property("Final_summary_chief"); + + b.Property("Final_summary_competency_chief"); + + b.Property("Final_summary_competency_supervisor"); + + b.Property("Final_summary_competency_supervisor1A"); + + b.Property("Final_summary_competency_supervisor2A"); + + b.Property("Final_summary_supervisor"); + + b.Property("Final_summary_supervisor1A"); + + b.Property("Final_summary_supervisor2A"); + + b.Property("achievement_chief"); + + b.Property("achievement_supervisor"); + + b.Property("achievement_supervisor1A"); + + b.Property("achievement_supervisor2A"); + + b.Property("chief"); + + b.Property("chief_a"); + + b.Property("chief_a_date"); + + b.Property("chief_a_reject_reason") + .HasMaxLength(1000); + + b.Property("chief_a_remark") + .HasMaxLength(1000); + + b.Property("chief_a_result") + .HasMaxLength(1); + + b.Property("competency_chief"); + + b.Property("competency_supervisor"); + + b.Property("competency_supervisor1A"); + + b.Property("competency_supervisor2A"); + + b.Property("create_evaluation_id"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("eva_employee_id"); + + b.Property("help_org_id"); + + b.Property("isActive"); + + b.Property("level_score_chief") + .HasMaxLength(255); + + b.Property("level_score_supervisor") + .HasMaxLength(255); + + b.Property("level_score_supervisor1A") + .HasMaxLength(255); + + b.Property("level_score_supervisor2A") + .HasMaxLength(255); + + b.Property("order_of_data"); + + b.Property("remark") + .HasMaxLength(1000); + + b.Property("score_chief"); + + b.Property("score_supervisor"); + + b.Property("score_supervisor1A"); + + b.Property("score_supervisor2A"); + + b.Property("status_chief") + .HasMaxLength(1); + + b.Property("status_chief_a") + .HasMaxLength(1); + + b.Property("status_chief_a_click_date"); + + b.Property("status_chief_click_date"); + + b.Property("status_self") + .HasMaxLength(1); + + b.Property("status_self_a") + .HasMaxLength(1); + + b.Property("status_self_a_click_date"); + + b.Property("status_self_click_date"); + + b.Property("status_supervisor") + .HasMaxLength(1); + + b.Property("status_supervisor1A") + .HasMaxLength(1); + + b.Property("status_supervisor1A_click_date"); + + b.Property("status_supervisor2A") + .HasMaxLength(1); + + b.Property("status_supervisor2A_click_date"); + + b.Property("status_supervisor_a") + .HasMaxLength(1); + + b.Property("status_supervisor_a_click_date"); + + b.Property("status_supervisor_click_date"); + + b.Property("supervisor1"); + + b.Property("supervisor1A"); + + b.Property("supervisor1A_date"); + + b.Property("supervisor1A_remark") + .HasMaxLength(1000); + + b.Property("supervisor1A_result") + .HasMaxLength(1); + + b.Property("supervisor1_date"); + + b.Property("supervisor1_id"); + + b.Property("supervisor1_remark") + .HasMaxLength(1000); + + b.Property("supervisor1_result") + .HasMaxLength(1); + + b.Property("supervisor2"); + + b.Property("supervisor2A"); + + b.Property("supervisor2A_date"); + + b.Property("supervisor2A_remark") + .HasMaxLength(1000); + + b.Property("supervisor2A_result") + .HasMaxLength(1); + + b.Property("supervisor2_date"); + + b.Property("supervisor2_id"); + + b.Property("supervisor2_remark") + .HasMaxLength(1000); + + b.Property("supervisor2_result") + .HasMaxLength(1); + + b.Property("total_summary_chief"); + + b.Property("total_summary_competency_chief"); + + b.Property("total_summary_competency_supervisor"); + + b.Property("total_summary_competency_supervisor1A"); + + b.Property("total_summary_competency_supervisor2A"); + + b.Property("total_summary_supervisor"); + + b.Property("total_summary_supervisor1A"); + + b.Property("total_summary_supervisor2A"); + + b.Property("updated"); + + b.Property("work_period"); + + b.HasKey("id"); + + b.HasIndex("create_evaluation_id"); + + b.ToTable("eva_create_evaluation_detail"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluation_detail_historyEntity", b => + { + b.Property("id"); + + b.Property("action_detail") + .HasMaxLength(4000); + + b.Property("action_dt"); + + b.Property("action_emp_id"); + + b.Property("created"); + + b.Property("evaluation_detail_id"); + + b.Property("history_group"); + + b.Property("isActive"); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("evaluation_detail_id"); + + b.ToTable("eva_create_evaluation_detail_history"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievementEntity", b => + { + b.Property("id"); + + b.Property("achievement") + .HasMaxLength(8000); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("score"); + + b.Property("score2"); + + b.Property("score3"); + + b.Property("score4"); + + b.Property("sumary"); + + b.Property("sumary2"); + + b.Property("sumary3"); + + b.Property("sumary4"); + + b.Property("target_score1") + .HasMaxLength(255); + + b.Property("target_score2") + .HasMaxLength(255); + + b.Property("target_score3") + .HasMaxLength(255); + + b.Property("target_score4") + .HasMaxLength(255); + + b.Property("target_score5") + .HasMaxLength(255); + + b.Property("thefile") + .HasMaxLength(1000); + + b.Property("updated"); + + b.Property("weight"); + + b.HasKey("id"); + + b.HasIndex("create_evaluation_detail_id"); + + b.ToTable("eva_evaluation_achievement"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievement_attachEntity", b => + { + b.Property("id"); + + b.Property("achievement_id"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("the_file") + .HasMaxLength(1000); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("achievement_id"); + + b.ToTable("eva_evaluation_achievement_attach"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b => + { + b.Property("id"); + + b.Property("behavior") + .HasMaxLength(1000); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("score"); + + b.Property("score2"); + + b.Property("score3"); + + b.Property("score4"); + + b.Property("sumary"); + + b.Property("sumary2"); + + b.Property("sumary3"); + + b.Property("sumary4"); + + b.Property("target_score1") + .HasMaxLength(255); + + b.Property("target_score2") + .HasMaxLength(255); + + b.Property("target_score3") + .HasMaxLength(255); + + b.Property("target_score4") + .HasMaxLength(255); + + b.Property("target_score5") + .HasMaxLength(255); + + b.Property("updated"); + + b.Property("weight"); + + b.HasKey("id"); + + b.HasIndex("create_evaluation_detail_id"); + + b.ToTable("eva_evaluation_behavior"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_groupEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("code") + .HasMaxLength(255); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("main_dept_id"); + + b.Property("percentage"); + + b.Property("thegroup") + .HasMaxLength(255); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_evaluation_group"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_group_detailEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("evaluation_group_id"); + + b.Property("isActive"); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("evaluation_group_id"); + + b.ToTable("eva_evaluation_group_detail"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_operating_agreementEntity", b => + { + b.Property("id"); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("indicators") + .HasMaxLength(4000); + + b.Property("isActive"); + + b.Property("mission_detail") + .HasMaxLength(4000); + + b.Property("mission_no"); + + b.Property("target") + .HasMaxLength(4000); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("create_evaluation_detail_id"); + + b.ToTable("eva_evaluation_operating_agreement"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_idp_planEntity", b => + { + b.Property("id"); + + b.Property("create_evaluation_detail_id"); + + b.Property("created"); + + b.Property("develop") + .HasMaxLength(1000); + + b.Property("development_method") + .HasMaxLength(1000); + + b.Property("end_date"); + + b.Property("isActive"); + + b.Property("period_text") + .HasMaxLength(1000); + + b.Property("start_date"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_idp_plan"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_level_scoreEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("code") + .HasMaxLength(255); + + b.Property("created"); + + b.Property("detail") + .HasMaxLength(1000); + + b.Property("isActive"); + + b.Property("max_score"); + + b.Property("min_score"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_level_score"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_employeeEntity", b => + { + b.Property("id"); + + b.Property("cost_of_living"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("frame_group_guid"); + + b.Property("help_org_id"); + + b.Property("isActive"); + + b.Property("level_text") + .HasMaxLength(1000); + + b.Property("monthly_remuneration"); + + b.Property("order_of_data"); + + b.Property("org_id"); + + b.Property("position_allowance"); + + b.Property("position_text") + .HasMaxLength(1000); + + b.Property("salary"); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("frame_group_guid"); + + b.ToTable("eva_limit_frame_employee"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_groupEntity", b => + { + b.Property("id"); + + b.Property("created"); + + b.Property("frame_plan_guid"); + + b.Property("group_guid"); + + b.Property("isActive"); + + b.Property("limit_frame_295"); + + b.Property("main_dept_id"); + + b.Property("remark") + .HasMaxLength(4000); + + b.Property("remark2") + .HasMaxLength(4000); + + b.Property("total_salary"); + + b.Property("total_salary_limit"); + + b.Property("total_salary_limit_rounded"); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("frame_plan_guid"); + + b.HasIndex("group_guid"); + + b.ToTable("eva_limit_frame_group"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_planEntity", b => + { + b.Property("id"); + + b.Property("created"); + + b.Property("executed_date"); + + b.Property("isActive"); + + b.Property("limit_frame_005"); + + b.Property("limit_frame_005_total"); + + b.Property("limit_frame_005_total_rounded"); + + b.Property("plan_guid"); + + b.Property("salary_adjustment_date"); + + b.Property("status_chief") + .HasMaxLength(1); + + b.Property("status_self") + .HasMaxLength(1); + + b.Property("supervisor1"); + + b.Property("supervisor1_date"); + + b.Property("supervisor1_remark") + .HasMaxLength(1000); + + b.Property("supervisor1_result") + .HasMaxLength(1); + + b.Property("total_salary"); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("plan_guid"); + + b.ToTable("eva_limit_frame_plan"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_performance_planEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("created"); + + b.Property("end_leave"); + + b.Property("fiscal_year"); + + b.Property("isActive"); + + b.Property("percent"); + + b.Property("remark") + .HasMaxLength(500); + + b.Property("start_leave"); + + b.Property("theTime"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_performance_plan"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_performance_plan_detailEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("created"); + + b.Property("end_date"); + + b.Property("isActive"); + + b.Property("list_no"); + + b.Property("performance_plan_id"); + + b.Property("remark") + .HasMaxLength(1000); + + b.Property("start_date"); + + b.Property("step") + .HasMaxLength(1000); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("performance_plan_id"); + + b.ToTable("eva_performance_plan_detail"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_promoted_percentageEntity", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("code") + .HasMaxLength(255); + + b.Property("created"); + + b.Property("detail") + .HasMaxLength(1000); + + b.Property("isActive"); + + b.Property("level_score_id"); + + b.Property("max_score"); + + b.Property("min_score"); + + b.Property("promoted_percentage"); + + b.Property("updated"); + + b.HasKey("id"); + + b.HasIndex("level_score_id"); + + b.ToTable("eva_promoted_percentage"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_salary_cylinderEntity", b => + { + b.Property("id"); + + b.Property("cost_living"); + + b.Property("created"); + + b.Property("isActive"); + + b.Property("middle"); + + b.Property("monthly_compensation"); + + b.Property("position_allowance"); + + b.Property("position_level"); + + b.Property("position_type"); + + b.Property("salary_max"); + + b.Property("temporary_min"); + + b.Property("themax"); + + b.Property("themin"); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_salary_cylinder"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_setup_permissionEntity", b => + { + b.Property("id"); + + b.Property("created"); + + b.Property("employee_id"); + + b.Property("isActive"); + + b.Property("remark") + .HasMaxLength(4000); + + b.Property("updated"); + + b.HasKey("id"); + + b.ToTable("eva_setup_permission"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponementEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_create_evaluationEntity", "eva_create_evaluation") + .WithMany() + .HasForeignKey("create_evaluation_id"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponement_detailEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_adjust_postponementEntity", "eva_adjust_postponement") + .WithMany() + .HasForeignKey("adjust_postponement_id"); + + b.HasOne("TodoAPI2.Models.eva_adjust_postponementEntity", "eva_adjust_postponement_quota") + .WithMany() + .HasForeignKey("adjust_postponement_quota_id") + .HasConstraintName("FK_eva_adjust_postponement_detail_eva_adjust_postponement_adj~1"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluationEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_evaluation_groupEntity", "eva_evaluation_group") + .WithMany() + .HasForeignKey("evaluation_group_id"); + + b.HasOne("TodoAPI2.Models.eva_performance_planEntity", "eva_performance_plan") + .WithMany() + .HasForeignKey("performance_plan_id"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluation_detailEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_create_evaluationEntity", "eva_create_evaluation_create_evaluation_id") + .WithMany() + .HasForeignKey("create_evaluation_id"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluation_detail_historyEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail_evaluation_detail_id") + .WithMany() + .HasForeignKey("evaluation_detail_id"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievementEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail") + .WithMany() + .HasForeignKey("create_evaluation_detail_id"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievement_attachEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_evaluation_achievementEntity", "eva_evaluation_achievement_achievement_id") + .WithMany() + .HasForeignKey("achievement_id"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail") + .WithMany() + .HasForeignKey("create_evaluation_detail_id"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_group_detailEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_evaluation_groupEntity", "eva_evaluation_group") + .WithMany() + .HasForeignKey("evaluation_group_id"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_operating_agreementEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail_create_evaluation_detail_id") + .WithMany() + .HasForeignKey("create_evaluation_detail_id"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_employeeEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_limit_frame_groupEntity", "eva_limit_frame_group_frame_group_guid") + .WithMany() + .HasForeignKey("frame_group_guid"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_groupEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_limit_frame_planEntity", "eva_limit_frame_plan_frame_plan_guid") + .WithMany() + .HasForeignKey("frame_plan_guid"); + + b.HasOne("TodoAPI2.Models.eva_evaluation_groupEntity", "eva_evaluation_group_group_guid") + .WithMany() + .HasForeignKey("group_guid"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_planEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_performance_planEntity", "eva_performance_plan_plan_guid") + .WithMany() + .HasForeignKey("plan_guid"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_performance_plan_detailEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_performance_planEntity", "eva_performance_plan") + .WithMany() + .HasForeignKey("performance_plan_id"); + }); + + modelBuilder.Entity("TodoAPI2.Models.eva_promoted_percentageEntity", b => + { + b.HasOne("TodoAPI2.Models.eva_level_scoreEntity", "eva_level_score") + .WithMany() + .HasForeignKey("level_score_id"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Migrations/20211016161223_AddFlowAgreement.cs b/Migrations/20211016161223_AddFlowAgreement.cs new file mode 100644 index 0000000..dfb6c6e --- /dev/null +++ b/Migrations/20211016161223_AddFlowAgreement.cs @@ -0,0 +1,33 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace tb320eva.Migrations +{ + public partial class AddFlowAgreement : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "status_supervisor_a", + table: "eva_create_evaluation_detail", + maxLength: 1, + nullable: true); + + migrationBuilder.AddColumn( + name: "status_supervisor_a_click_date", + table: "eva_create_evaluation_detail", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "status_supervisor_a", + table: "eva_create_evaluation_detail"); + + migrationBuilder.DropColumn( + name: "status_supervisor_a_click_date", + table: "eva_create_evaluation_detail"); + } + } +} diff --git a/Migrations/DataContextModelSnapshot.cs b/Migrations/DataContextModelSnapshot.cs index 47c7c83..93efec2 100644 --- a/Migrations/DataContextModelSnapshot.cs +++ b/Migrations/DataContextModelSnapshot.cs @@ -348,6 +348,11 @@ namespace tb320eva.Migrations b.Property("status_supervisor2A_click_date"); + b.Property("status_supervisor_a") + .HasMaxLength(1); + + b.Property("status_supervisor_a_click_date"); + b.Property("status_supervisor_click_date"); b.Property("supervisor1"); diff --git a/Models/eva_create_evaluation_detail/eva_create_evaluation_detailEntity.cs b/Models/eva_create_evaluation_detail/eva_create_evaluation_detailEntity.cs index 9212574..d8a1ce3 100644 --- a/Models/eva_create_evaluation_detail/eva_create_evaluation_detailEntity.cs +++ b/Models/eva_create_evaluation_detail/eva_create_evaluation_detailEntity.cs @@ -91,6 +91,9 @@ namespace TodoAPI2.Models [MaxLength(1)] public string status_supervisor { get; set; } + [MaxLength(1)] + public string status_supervisor_a { get; set; } + public int? supervisor1A { get; set; } [MaxLength(1)] @@ -130,6 +133,7 @@ namespace TodoAPI2.Models public DateTime? status_chief_a_click_date { get; set; } public DateTime? status_chief_click_date { get; set; } public DateTime? status_supervisor_click_date { get; set; } + public DateTime? status_supervisor_a_click_date { get; set; } public DateTime? status_supervisor1A_click_date { get; set; } public DateTime? status_supervisor2A_click_date { get; set; } diff --git a/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocService.cs b/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocService.cs index 18ff55a..366d774 100644 --- a/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocService.cs +++ b/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocService.cs @@ -128,6 +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, org_id_external_linkage_external_name = fk_external_employee.department_name, @@ -136,6 +137,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 = null, remark_hrm_work_record = fk_external_employee.remark_hrm_work_record + GetWorkTimeText(fk_external_employee.packing_date, endDate), diff --git a/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocViewModel.cs b/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocViewModel.cs index 48551e6..14ab8a4 100644 --- a/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocViewModel.cs +++ b/Models/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdocViewModel.cs @@ -52,6 +52,8 @@ namespace TodoAPI2.Models public string status_supervisor { get; set; } + public string status_supervisor_a { get; set; } + public string remark_hrm_work_record { get; set; } public string plan_round_year { get; set; } @@ -63,6 +65,7 @@ namespace TodoAPI2.Models public DateTime? status_chief_a_click_date { get; set; } public DateTime? status_chief_click_date { get; set; } public DateTime? status_supervisor_click_date { get; set; } + public DateTime? status_supervisor_a_click_date { get; set; } public decimal? score1 { get; set; } @@ -77,6 +80,8 @@ namespace TodoAPI2.Models public string txt_status_chief { get { return getStatusText(status_chief) + MyHelper.GetDateStringForReport(status_chief_click_date) + " " + MyHelper.GetTimeStringFromDate(status_chief_click_date) + getHistoryLink(status_chief); } } public string txt_status_supervisor { get { return getStatusText(status_supervisor) + MyHelper.GetDateStringForReport(status_supervisor_click_date) + " " + MyHelper.GetTimeStringFromDate(status_supervisor_click_date) + getHistoryLink(status_supervisor); } } + public string txt_status_supervisor_a { get { return getStatusText(status_supervisor_a) + MyHelper.GetDateStringForReport(status_supervisor_a_click_date) + " " + MyHelper.GetTimeStringFromDate(status_supervisor_a_click_date) + getHistoryLink(status_supervisor_a); } } + public string role_desc { get; set; } public string role_code { get; set; } diff --git a/Models/eva_create_evaluation_detail_status/eva_create_evaluation_detail_statusService.cs b/Models/eva_create_evaluation_detail_status/eva_create_evaluation_detail_statusService.cs index 344434b..26fdbc2 100644 --- a/Models/eva_create_evaluation_detail_status/eva_create_evaluation_detail_statusService.cs +++ b/Models/eva_create_evaluation_detail_status/eva_create_evaluation_detail_statusService.cs @@ -240,16 +240,26 @@ namespace TodoAPI2.Models else if (model.status_mode == "nextB") { existingEntity.status_chief_a_click_date = DateTime.Now; - if (current_eva.employee_id == existingEntity.chief) // หัวหน้าและผู้ประเมินสูงสุด เป็นคนคนเดียวกัน - { - noti_to_employee_id = current_eva.supervisor1_id; - } - else - { - noti_to_employee_id = current_eva.employee_id; - } - need_noti = false; - add_history(DateTime.Now, "อนุมัติ ข้อตกลงการประเมิน", existingEntity.chief, existingEntity.id, 1); + existingEntity.status_supervisor_a_click_date = null; + noti_to_employee_id = current_eva.employee_id; + noti_message = "กรุณาตรวจสอบ ข้อตกลงการประเมิน ของ {0}"; + noti_url = "/eva/eva_create_evaluation_detail_firstdocView/eva_create_evaluation_detail_firstdoc_d?id=" + existingEntity.id.ToString(); + add_history(DateTime.Now, "ส่งข้อตกลงการประเมิน", model.employee_id, existingEntity.id, 1); + } + else if (model.status_mode == "backC") + { + existingEntity.status_supervisor_a_click_date = DateTime.Now; + existingEntity.status_chief_a_click_date = null; + noti_to_employee_id = existingEntity.chief; + noti_message = "ข้อตกลงการประเมินของคุณ ({0}) ถูกตีกลับ"; + noti_url = "/eva/eva_create_evaluation_detail_firstdocView/eva_create_evaluation_detail_firstdoc_d?id=" + existingEntity.id.ToString(); + add_history(DateTime.Now, "ข้อตกลงการประเมิน ถูกตีกลับ", model.employee_id, existingEntity.id, 1); + } + else if (model.status_mode == "nextC") + { + existingEntity.status_supervisor_a_click_date = DateTime.Now; + noti_to_employee_id = existingEntity.employee_id; + add_history(DateTime.Now, "อนุมัติ ข้อตกลงการประเมิน", current_eva.employee_id, existingEntity.id, 1); } else if (model.status_mode == "next0") { diff --git a/Views/eva_create_evaluation_detail_firstdocView/eva_create_evaluation_detail_firstdoc.cshtml b/Views/eva_create_evaluation_detail_firstdocView/eva_create_evaluation_detail_firstdoc.cshtml index c05b1fb..1048f00 100644 --- a/Views/eva_create_evaluation_detail_firstdocView/eva_create_evaluation_detail_firstdoc.cshtml +++ b/Views/eva_create_evaluation_detail_firstdocView/eva_create_evaluation_detail_firstdoc.cshtml @@ -65,7 +65,7 @@ - + diff --git a/Views/eva_create_evaluation_detail_firstdocView/eva_create_evaluation_detail_firstdoc_d.cshtml b/Views/eva_create_evaluation_detail_firstdocView/eva_create_evaluation_detail_firstdoc_d.cshtml index 93fc4d6..f69ae04 100644 --- a/Views/eva_create_evaluation_detail_firstdocView/eva_create_evaluation_detail_firstdoc_d.cshtml +++ b/Views/eva_create_evaluation_detail_firstdocView/eva_create_evaluation_detail_firstdoc_d.cshtml @@ -256,19 +256,19 @@
- - - + + +
@@ -320,6 +320,8 @@ $(".status_self").hide(); $(".status_chief").hide(); + $(".status_supervisor").hide(); + $("#status").text(""); $(".approve_section").hide(); $("#s2_text").hide(); @@ -365,7 +367,32 @@ $("#s1_text").text("ส่วนที่ 1 ข้อตกลงการปฏิบัติงาน"); $("#s2_text").show(); - } else if (role_code === "") { // ผู้รับการประเมิน + } + else if (role_code === "2") { // ผู้ประเมินสูงสุด + $(".approve_section").show(); + $(".reject_section").show(); + + if (status_chief_a === "Y") { + $(".status_supervisor").show(); + } + if (status_supervisor_a === "Y") { + $("#status").text("ข้อตกลงการประเมิน ได้รับการอนุมัติไปแล้ว"); + $(".approve_item").prop("disabled", true); + $(".status_supervisor").hide(); + $("#eva_create_evaluation_detail_review0A_chief_a_reject_reason").prop("disabled", true); + } + else if (status_supervisor_a === "N") { + $("#status").text("คุณตีกลับข้อตกลงการประเมิน กรูณารอแก้ไขและส่งกลับ"); + $(".approve_item").prop("disabled", true); + $(".status_supervisor").hide(); + $("#eva_create_evaluation_detail_review0A_chief_a_reject_reason").prop("disabled", true); + } + + $("#s1_text").text("ส่วนที่ 1 ข้อตกลงการปฏิบัติงาน"); + $("#s2_text").show(); + + } + else if (role_code === "") { // ผู้รับการประเมิน $(".status_self").show(); if (status_self_a === "Y") { $(".status_self").hide(); diff --git a/wwwroot/js/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdoc.js b/wwwroot/js/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdoc.js index 9e2d570..18ac15a 100644 --- a/wwwroot/js/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdoc.js +++ b/wwwroot/js/eva_create_evaluation_detail_firstdoc/eva_create_evaluation_detail_firstdoc.js @@ -200,6 +200,7 @@ var eva_create_evaluation_detail_firstdoc_setupTable = function (result) { { "data": "org_id_external_linkage_external_name" }, { "data": "txt_status_self_a" }, { "data": "txt_status_chief_a" }, + { "data": "txt_status_supervisor_a" }, ], "columnDefs": [