Merge branch 'develop' into adiDev
This commit is contained in:
commit
9646659f4c
8 changed files with 411 additions and 99 deletions
102
.onedev-buildspec.yml
Normal file
102
.onedev-buildspec.yml
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
version: 37
|
||||
jobs:
|
||||
- name: CI for UAT
|
||||
steps:
|
||||
- !CheckoutStep
|
||||
name: checkout code
|
||||
cloneCredential: !DefaultCredential {}
|
||||
withLfs: false
|
||||
withSubmodules: false
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
- !GenerateChecksumStep
|
||||
name: generate package checksum
|
||||
files: package-lock.json yarn.lock
|
||||
targetFile: checksum
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
- !SetupCacheStep
|
||||
name: set up npm cache
|
||||
key: node_modules_@file:checksum@
|
||||
loadKeys:
|
||||
- node_modules
|
||||
paths:
|
||||
- node_modules
|
||||
uploadStrategy: UPLOAD_IF_NOT_HIT
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
- !SetBuildVersionStep
|
||||
name: set build version
|
||||
buildVersion: '@tag@'
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
- !CommandStep
|
||||
name: build & test
|
||||
runInContainer: true
|
||||
image: node
|
||||
interpreter: !DefaultInterpreter
|
||||
commands: |
|
||||
npm install
|
||||
npm run build
|
||||
useTTY: true
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
- !BuildImageStep
|
||||
name: build docker image
|
||||
dockerfile: ./docker/Dockerfile
|
||||
output: !RegistryOutput
|
||||
tags: hrms-git.chin.in.th/bma-hrms/hrms-api-kpi:@build_version@ hrms-git.chin.in.th/bma-hrms/hrms-api-kpi:latest
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
triggers:
|
||||
- !TagCreateTrigger
|
||||
tags: uat-*
|
||||
branches: main
|
||||
retryCondition: never
|
||||
maxRetries: 3
|
||||
retryDelay: 30
|
||||
timeout: 14400
|
||||
- name: CI for PROD
|
||||
steps:
|
||||
- !CheckoutStep
|
||||
name: checkout code
|
||||
cloneCredential: !DefaultCredential {}
|
||||
withLfs: false
|
||||
withSubmodules: false
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
- !GenerateChecksumStep
|
||||
name: generate package checksum
|
||||
files: package-lock.json yarn.lock
|
||||
targetFile: checksum
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
- !SetupCacheStep
|
||||
name: set up npm cache
|
||||
key: node_modules_@file:checksum@
|
||||
loadKeys:
|
||||
- node_modules
|
||||
paths:
|
||||
- node_modules
|
||||
uploadStrategy: UPLOAD_IF_NOT_HIT
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
- !SetBuildVersionStep
|
||||
name: set build version
|
||||
buildVersion: '@tag@'
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
- !CommandStep
|
||||
name: build & test
|
||||
runInContainer: true
|
||||
image: node
|
||||
interpreter: !DefaultInterpreter
|
||||
commands: |
|
||||
npm install
|
||||
npm run build
|
||||
useTTY: true
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
- !BuildImageStep
|
||||
name: build docker image
|
||||
dockerfile: ./docker/Dockerfile
|
||||
output: !RegistryOutput
|
||||
tags: hrms-git.bangkok.go.th/bma-hrms/hrms-api-kpi:@build_version@ hrms-git.bangkok.go.th/bma-hrms/hrms-api-kpi:latest
|
||||
condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
|
||||
triggers:
|
||||
- !TagCreateTrigger
|
||||
tags: prod-*
|
||||
branches: main
|
||||
retryCondition: never
|
||||
maxRetries: 3
|
||||
retryDelay: 30
|
||||
timeout: 14400
|
||||
|
|
@ -211,6 +211,7 @@ export class kpiCapacityController extends Controller {
|
|||
},
|
||||
select: ["id", "name"],
|
||||
relations: ["kpiCapacityDetails"],
|
||||
order: { createdAt: "ASC" },
|
||||
});
|
||||
|
||||
const mapData = kpiCapacity.map((x) => ({
|
||||
|
|
|
|||
|
|
@ -59,7 +59,10 @@ export class kpiPlanController extends Controller {
|
|||
.where("kpiPeriod.year = :year", { year: requestBody.year })
|
||||
.andWhere("kpiPeriod.durationKPI = :durationKPI", { durationKPI: requestBody.period })
|
||||
.getOne();
|
||||
const year = requestBody.year && parseInt(requestBody.year) > 0?parseInt(requestBody.year) + 543:"ดังกล่าว";
|
||||
const year =
|
||||
requestBody.year && parseInt(requestBody.year) > 0
|
||||
? parseInt(requestBody.year) + 543
|
||||
: "ดังกล่าว";
|
||||
if (!kpiPeriod) {
|
||||
// throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตัวชี้วัดตามตำแหน่งนี้");
|
||||
throw new HttpError(
|
||||
|
|
@ -453,6 +456,7 @@ export class kpiPlanController extends Controller {
|
|||
if (kpiPlan.strategyChild5Id != null) {
|
||||
strategy = 5;
|
||||
strategyId = kpiPlan.strategyChild5Id;
|
||||
strategyName = kpiPlan.strategyChild5;
|
||||
} else if (kpiPlan.strategyChild4Id != null) {
|
||||
strategy = 4;
|
||||
strategyId = kpiPlan.strategyChild4Id;
|
||||
|
|
@ -870,11 +874,11 @@ export class kpiPlanController extends Controller {
|
|||
type = 4;
|
||||
}
|
||||
|
||||
const _null:any = null;
|
||||
const _null: any = null;
|
||||
await this.kpiPlanHistoryRepository.delete({ kpiPlanId: id });
|
||||
await this.kpiUserPlanRepository.update({ kpiPlanId: id },{ kpiPlanId: _null });
|
||||
await this.kpiUserPlanRepository.update({ kpiPlanId: id }, { kpiPlanId: _null });
|
||||
await this.kpiPlanRepository.remove(kpiPlan, { data: request });
|
||||
|
||||
|
||||
if (kpiPlan) {
|
||||
let remainingKpiPlans: any;
|
||||
if (type == 0) {
|
||||
|
|
|
|||
|
|
@ -526,6 +526,7 @@ export class KpiUserEvaluationController extends Controller {
|
|||
kpiUserEvaluation.posLevelName = x.posLevelName;
|
||||
kpiUserEvaluation.posTypeName = x.posTypeName;
|
||||
kpiUserEvaluation.posExecutiveName = x.posExecutiveName;
|
||||
kpiUserEvaluation.isProbation = x.isProbation;
|
||||
kpiUserEvaluation.org = x.root;
|
||||
kpiUserEvaluation.orgId = x.rootId;
|
||||
kpiUserEvaluation.child1 = x.child1;
|
||||
|
|
@ -553,6 +554,7 @@ export class KpiUserEvaluationController extends Controller {
|
|||
kpiUserEvaluation.posLevelName = x.posLevelName;
|
||||
kpiUserEvaluation.posTypeName = x.posTypeName;
|
||||
kpiUserEvaluation.posExecutiveName = x.posExecutiveName;
|
||||
kpiUserEvaluation.isProbation = x.isProbation;
|
||||
kpiUserEvaluation.org = x.root;
|
||||
kpiUserEvaluation.orgId = x.rootId;
|
||||
kpiUserEvaluation.child1 = x.child1;
|
||||
|
|
@ -569,17 +571,39 @@ export class KpiUserEvaluationController extends Controller {
|
|||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลในทะเบียนประวัติ");
|
||||
});
|
||||
}
|
||||
await new CallAPI()
|
||||
.GetData(request, "/org/profile/profileid/position/" + requestBody.evaluatorId)
|
||||
.then((x) => {
|
||||
kpiUserEvaluation.prefixEvaluator = x.prefix;
|
||||
kpiUserEvaluation.firstNameEvaluator = x.firstName;
|
||||
kpiUserEvaluation.lastNameEvaluator = x.lastName;
|
||||
kpiUserEvaluation.positionEvaluator = x.position;
|
||||
kpiUserEvaluation.posLevelNameEvaluator = x.posLevelName;
|
||||
kpiUserEvaluation.posTypeNameEvaluator = x.posTypeName;
|
||||
kpiUserEvaluation.orgEvaluator = x.root;
|
||||
});
|
||||
if (requestBody.evaluatorId) {
|
||||
await new CallAPI()
|
||||
.GetData(request, "/org/profile/profileid/position/" + requestBody.evaluatorId)
|
||||
.then((x) => {
|
||||
kpiUserEvaluation.prefixEvaluator = x.prefix;
|
||||
kpiUserEvaluation.firstNameEvaluator = x.firstName;
|
||||
kpiUserEvaluation.lastNameEvaluator = x.lastName;
|
||||
kpiUserEvaluation.positionEvaluator = x.position;
|
||||
kpiUserEvaluation.posLevelNameEvaluator = x.posLevelName;
|
||||
kpiUserEvaluation.posTypeNameEvaluator = x.posTypeName;
|
||||
kpiUserEvaluation.orgEvaluator = x.root;
|
||||
});
|
||||
}
|
||||
if (requestBody.commanderId) {
|
||||
await new CallAPI()
|
||||
.GetData(request, "/org/profile/profileid/position/" + requestBody.commanderId)
|
||||
.then((x) => {
|
||||
kpiUserEvaluation.prefixCommander = x.prefix;
|
||||
kpiUserEvaluation.firstNameCommander = x.firstName;
|
||||
kpiUserEvaluation.lastNameCommander = x.lastName;
|
||||
kpiUserEvaluation.positionCommander = x.position;
|
||||
});
|
||||
}
|
||||
if (requestBody.commanderHighId) {
|
||||
await new CallAPI()
|
||||
.GetData(request, "/org/profile/profileid/position/" + requestBody.commanderHighId)
|
||||
.then((x) => {
|
||||
kpiUserEvaluation.prefixCommanderHigh = x.prefix;
|
||||
kpiUserEvaluation.firstNameCommanderHigh = x.firstName;
|
||||
kpiUserEvaluation.lastNameCommanderHigh = x.lastName;
|
||||
kpiUserEvaluation.positionCommanderHigh = x.position;
|
||||
});
|
||||
}
|
||||
const before = null;
|
||||
kpiUserEvaluation.evaluationStatus = "NEW";
|
||||
kpiUserEvaluation.evaluationResults = "PENDING";
|
||||
|
|
@ -747,6 +771,40 @@ export class KpiUserEvaluationController extends Controller {
|
|||
}
|
||||
const before = structuredClone(kpiUserEvaluation);
|
||||
|
||||
if (requestBody.evaluatorId) {
|
||||
await new CallAPI()
|
||||
.GetData(request, "/org/profile/profileid/position/" + requestBody.evaluatorId)
|
||||
.then((x) => {
|
||||
kpiUserEvaluation.prefixEvaluator = x.prefix;
|
||||
kpiUserEvaluation.firstNameEvaluator = x.firstName;
|
||||
kpiUserEvaluation.lastNameEvaluator = x.lastName;
|
||||
kpiUserEvaluation.positionEvaluator = x.position;
|
||||
kpiUserEvaluation.posLevelNameEvaluator = x.posLevelName;
|
||||
kpiUserEvaluation.posTypeNameEvaluator = x.posTypeName;
|
||||
kpiUserEvaluation.orgEvaluator = x.root;
|
||||
});
|
||||
}
|
||||
if (requestBody.commanderId) {
|
||||
await new CallAPI()
|
||||
.GetData(request, "/org/profile/profileid/position/" + requestBody.commanderId)
|
||||
.then((x) => {
|
||||
kpiUserEvaluation.prefixCommander = x.prefix;
|
||||
kpiUserEvaluation.firstNameCommander = x.firstName;
|
||||
kpiUserEvaluation.lastNameCommander = x.lastName;
|
||||
kpiUserEvaluation.positionCommander = x.position;
|
||||
});
|
||||
}
|
||||
if (requestBody.commanderHighId) {
|
||||
await new CallAPI()
|
||||
.GetData(request, "/org/profile/profileid/position/" + requestBody.commanderHighId)
|
||||
.then((x) => {
|
||||
kpiUserEvaluation.prefixCommanderHigh = x.prefix;
|
||||
kpiUserEvaluation.firstNameCommanderHigh = x.firstName;
|
||||
kpiUserEvaluation.lastNameCommanderHigh = x.lastName;
|
||||
kpiUserEvaluation.positionCommanderHigh = x.position;
|
||||
});
|
||||
}
|
||||
|
||||
kpiUserEvaluation.lastUpdateUserId = request.user.sub;
|
||||
kpiUserEvaluation.lastUpdateFullName = request.user.name;
|
||||
kpiUserEvaluation.lastUpdatedAt = new Date();
|
||||
|
|
@ -1002,6 +1060,7 @@ export class KpiUserEvaluationController extends Controller {
|
|||
evaluationStatus: kpiUserEvaluation.evaluationStatus,
|
||||
evaluationResults: kpiUserEvaluation.evaluationResults,
|
||||
evaluationReqEdit: kpiUserEvaluation.evaluationReqEdit,
|
||||
isProbation: kpiUserEvaluation.isProbation,
|
||||
createdAt: kpiUserEvaluation.createdAt,
|
||||
evaluatorId: kpiUserEvaluation.evaluatorId,
|
||||
commanderId: kpiUserEvaluation.commanderId,
|
||||
|
|
@ -1017,6 +1076,11 @@ export class KpiUserEvaluationController extends Controller {
|
|||
summaryPoint: kpiUserEvaluation.summaryPoint,
|
||||
isOpen: kpiUserEvaluation.isOpen,
|
||||
openDate: kpiUserEvaluation.openDate,
|
||||
root: kpiUserEvaluation.org,
|
||||
child1: kpiUserEvaluation.child1,
|
||||
child2: kpiUserEvaluation.child2,
|
||||
child3: kpiUserEvaluation.child3,
|
||||
child4: kpiUserEvaluation.child4,
|
||||
year: kpiUserEvaluation.kpiPeriod == null ? null : kpiUserEvaluation.kpiPeriod.year,
|
||||
durationKPI:
|
||||
kpiUserEvaluation.kpiPeriod == null ? null : kpiUserEvaluation.kpiPeriod.durationKPI,
|
||||
|
|
@ -1426,6 +1490,7 @@ export class KpiUserEvaluationController extends Controller {
|
|||
evaluationStatus: kpiUserEvaluation.evaluationStatus,
|
||||
evaluationResults: kpiUserEvaluation.evaluationResults,
|
||||
evaluationReqEdit: kpiUserEvaluation.evaluationReqEdit,
|
||||
isProbation: kpiUserEvaluation.isProbation,
|
||||
createdAt: kpiUserEvaluation.createdAt,
|
||||
evaluatorId: kpiUserEvaluation.evaluatorId,
|
||||
commanderId: kpiUserEvaluation.commanderId,
|
||||
|
|
@ -1437,6 +1502,11 @@ export class KpiUserEvaluationController extends Controller {
|
|||
summaryPoint: kpiUserEvaluation.summaryPoint,
|
||||
isOpen: kpiUserEvaluation.isOpen,
|
||||
openDate: kpiUserEvaluation.openDate,
|
||||
root: kpiUserEvaluation.org,
|
||||
child1: kpiUserEvaluation.child1,
|
||||
child2: kpiUserEvaluation.child2,
|
||||
child3: kpiUserEvaluation.child3,
|
||||
child4: kpiUserEvaluation.child4,
|
||||
year: kpiUserEvaluation.kpiPeriod == null ? null : kpiUserEvaluation.kpiPeriod.year,
|
||||
durationKPI:
|
||||
kpiUserEvaluation.kpiPeriod == null ? null : kpiUserEvaluation.kpiPeriod.durationKPI,
|
||||
|
|
|
|||
|
|
@ -198,12 +198,38 @@ export class KpiUserPlannedController extends Controller {
|
|||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลงานตามแผนปฏิบัติราชการประจำปีนี้");
|
||||
}
|
||||
|
||||
let nodeName = null;
|
||||
if (getKpiUserPlanned.kpiPlan.child4Id != null) {
|
||||
nodeName = getKpiUserPlanned.kpiPlan.child4;
|
||||
} else if (getKpiUserPlanned.kpiPlan.child3Id != null) {
|
||||
nodeName = getKpiUserPlanned.kpiPlan.child3;
|
||||
} else if (getKpiUserPlanned.kpiPlan.child2Id != null) {
|
||||
nodeName = getKpiUserPlanned.kpiPlan.child2;
|
||||
} else if (getKpiUserPlanned.kpiPlan.child1Id != null) {
|
||||
nodeName = getKpiUserPlanned.kpiPlan.child1;
|
||||
} else if (getKpiUserPlanned.kpiPlan.rootId != null) {
|
||||
nodeName = getKpiUserPlanned.kpiPlan.root;
|
||||
}
|
||||
let strategyName = null;
|
||||
if (getKpiUserPlanned.kpiPlan.strategyChild5Id != null) {
|
||||
strategyName = getKpiUserPlanned.kpiPlan.strategyChild5;
|
||||
} else if (getKpiUserPlanned.kpiPlan.strategyChild4Id != null) {
|
||||
strategyName = getKpiUserPlanned.kpiPlan.strategyChild4;
|
||||
} else if (getKpiUserPlanned.kpiPlan.strategyChild3Id != null) {
|
||||
strategyName = getKpiUserPlanned.kpiPlan.strategyChild3;
|
||||
} else if (getKpiUserPlanned.kpiPlan.strategyChild2Id != null) {
|
||||
strategyName = getKpiUserPlanned.kpiPlan.strategyChild2;
|
||||
} else if (getKpiUserPlanned.kpiPlan.strategyChild1Id != null) {
|
||||
strategyName = getKpiUserPlanned.kpiPlan.strategyChild1;
|
||||
}
|
||||
const mapGetKpiUserPlanned = {
|
||||
id: getKpiUserPlanned.id,
|
||||
evaluationId: getKpiUserPlanned.kpiUserEvaluation.id,
|
||||
kpiPlanId: getKpiUserPlanned.kpiPlan.id,
|
||||
including: getKpiUserPlanned.kpiPlan.including, //รหัสตัวชี้วัด
|
||||
includingName: getKpiUserPlanned.kpiPlan.includingName, //ชื่อตัวชี้วัด
|
||||
nodeName: nodeName,
|
||||
strategyName: strategyName,
|
||||
target: getKpiUserPlanned.target,
|
||||
weight: getKpiUserPlanned.weight,
|
||||
unit: getKpiUserPlanned.unit,
|
||||
|
|
@ -254,21 +280,21 @@ export class KpiUserPlannedController extends Controller {
|
|||
point: item.point,
|
||||
achievement:
|
||||
item.point === 1
|
||||
? item.kpiPlan.achievement1
|
||||
? item.achievement1
|
||||
: item.point === 2
|
||||
? item.kpiPlan.achievement2
|
||||
? item.achievement2
|
||||
: item.point === 3
|
||||
? item.kpiPlan.achievement3
|
||||
? item.achievement3
|
||||
: item.point === 4
|
||||
? item.kpiPlan.achievement4
|
||||
? item.achievement4
|
||||
: item.point === 5
|
||||
? item.kpiPlan.achievement5
|
||||
? item.achievement5
|
||||
: null,
|
||||
achievement1: item.kpiPlan.achievement1,
|
||||
achievement2: item.kpiPlan.achievement2,
|
||||
achievement3: item.kpiPlan.achievement3,
|
||||
achievement4: item.kpiPlan.achievement4,
|
||||
achievement5: item.kpiPlan.achievement5,
|
||||
achievement1: item.achievement1,
|
||||
achievement2: item.achievement2,
|
||||
achievement3: item.achievement3,
|
||||
achievement4: item.achievement4,
|
||||
achievement5: item.achievement5,
|
||||
}));
|
||||
return new HttpSuccess(mapKpiUserPlanned);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -202,12 +202,25 @@ export class KpiUserRoleController extends Controller {
|
|||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลงานตามหน้าที่ความรับผิดชอบหลักนี้");
|
||||
}
|
||||
|
||||
let nodeName = null;
|
||||
if (getKpiUserRole.kpiRole.child4Id != null) {
|
||||
nodeName = getKpiUserRole.kpiRole.child4;
|
||||
} else if (getKpiUserRole.kpiRole.child3Id != null) {
|
||||
nodeName = getKpiUserRole.kpiRole.child3;
|
||||
} else if (getKpiUserRole.kpiRole.child2Id != null) {
|
||||
nodeName = getKpiUserRole.kpiRole.child2;
|
||||
} else if (getKpiUserRole.kpiRole.child1Id != null) {
|
||||
nodeName = getKpiUserRole.kpiRole.child1;
|
||||
} else if (getKpiUserRole.kpiRole.rootId != null) {
|
||||
nodeName = getKpiUserRole.kpiRole.root;
|
||||
}
|
||||
const mapKpiUserRole = {
|
||||
id: getKpiUserRole.id,
|
||||
evaluationId: getKpiUserRole.kpiUserEvaluation.id,
|
||||
kpiRoleId: getKpiUserRole.kpiRole.id,
|
||||
including: getKpiUserRole.kpiRole.including,
|
||||
includingName: getKpiUserRole.kpiRole.includingName,
|
||||
nodeName: nodeName,
|
||||
target: getKpiUserRole.target,
|
||||
weight: getKpiUserRole.weight,
|
||||
unit: getKpiUserRole.unit,
|
||||
|
|
@ -259,21 +272,21 @@ export class KpiUserRoleController extends Controller {
|
|||
point: item.point,
|
||||
achievement:
|
||||
item.point === 1
|
||||
? item.kpiRole.achievement1
|
||||
? item.achievement1
|
||||
: item.point === 2
|
||||
? item.kpiRole.achievement2
|
||||
? item.achievement2
|
||||
: item.point === 3
|
||||
? item.kpiRole.achievement3
|
||||
? item.achievement3
|
||||
: item.point === 4
|
||||
? item.kpiRole.achievement4
|
||||
? item.achievement4
|
||||
: item.point === 5
|
||||
? item.kpiRole.achievement5
|
||||
? item.achievement5
|
||||
: null,
|
||||
achievement1: item.kpiRole.achievement1,
|
||||
achievement2: item.kpiRole.achievement2,
|
||||
achievement3: item.kpiRole.achievement3,
|
||||
achievement4: item.kpiRole.achievement4,
|
||||
achievement5: item.kpiRole.achievement5,
|
||||
achievement1: item.achievement1,
|
||||
achievement2: item.achievement2,
|
||||
achievement3: item.achievement3,
|
||||
achievement4: item.achievement4,
|
||||
achievement5: item.achievement5,
|
||||
}));
|
||||
return new HttpSuccess(mapKpiUserRole);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -788,10 +788,10 @@ export class ReportController extends Controller {
|
|||
? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString())
|
||||
: null;
|
||||
} else {
|
||||
acc.summaryPointAPR1 = "-"
|
||||
acc.textPointAPR1 = "-"
|
||||
acc.periodAPR1 = "-"
|
||||
acc.yearAPR1 = "-"
|
||||
acc.summaryPointAPR1 = "-";
|
||||
acc.textPointAPR1 = "-";
|
||||
acc.periodAPR1 = "-";
|
||||
acc.yearAPR1 = "-";
|
||||
}
|
||||
|
||||
if (x.kpiPeriod.year === yearNow - 4 && x.kpiPeriod.durationKPI === "OCT") {
|
||||
|
|
@ -804,10 +804,10 @@ export class ReportController extends Controller {
|
|||
? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString())
|
||||
: null;
|
||||
} else {
|
||||
acc.summaryPointOCT1 = "-"
|
||||
acc.textPointOCT1 = "-"
|
||||
acc.periodOCT1 = "-"
|
||||
acc.yearOCT1 = "-"
|
||||
acc.summaryPointOCT1 = "-";
|
||||
acc.textPointOCT1 = "-";
|
||||
acc.periodOCT1 = "-";
|
||||
acc.yearOCT1 = "-";
|
||||
}
|
||||
|
||||
if (x.kpiPeriod.year === yearNow - 3 && x.kpiPeriod.durationKPI === "APR") {
|
||||
|
|
@ -820,10 +820,10 @@ export class ReportController extends Controller {
|
|||
? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString())
|
||||
: null;
|
||||
} else {
|
||||
acc.summaryPointAPR2 = "-"
|
||||
acc.textPointAPR2 = "-"
|
||||
acc.periodAPR2 = "-"
|
||||
acc.yearAPR2 = "-"
|
||||
acc.summaryPointAPR2 = "-";
|
||||
acc.textPointAPR2 = "-";
|
||||
acc.periodAPR2 = "-";
|
||||
acc.yearAPR2 = "-";
|
||||
}
|
||||
|
||||
if (x.kpiPeriod.year === yearNow - 3 && x.kpiPeriod.durationKPI === "OCT") {
|
||||
|
|
@ -836,10 +836,10 @@ export class ReportController extends Controller {
|
|||
? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString())
|
||||
: null;
|
||||
} else {
|
||||
acc.summaryPointOCT2 = "-"
|
||||
acc.textPointOCT2 = "-"
|
||||
acc.periodOCT2 = "-"
|
||||
acc.yearOCT2 = "-"
|
||||
acc.summaryPointOCT2 = "-";
|
||||
acc.textPointOCT2 = "-";
|
||||
acc.periodOCT2 = "-";
|
||||
acc.yearOCT2 = "-";
|
||||
}
|
||||
|
||||
if (x.kpiPeriod.year === yearNow - 2 && x.kpiPeriod.durationKPI === "APR") {
|
||||
|
|
@ -852,10 +852,10 @@ export class ReportController extends Controller {
|
|||
? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString())
|
||||
: null;
|
||||
} else {
|
||||
acc.summaryPointAPR3 = "-"
|
||||
acc.textPointAPR3 = "-"
|
||||
acc.periodAPR3 = "-"
|
||||
acc.yearAPR3 = "-"
|
||||
acc.summaryPointAPR3 = "-";
|
||||
acc.textPointAPR3 = "-";
|
||||
acc.periodAPR3 = "-";
|
||||
acc.yearAPR3 = "-";
|
||||
}
|
||||
|
||||
if (x.kpiPeriod.year === yearNow - 2 && x.kpiPeriod.durationKPI === "OCT") {
|
||||
|
|
@ -868,10 +868,10 @@ export class ReportController extends Controller {
|
|||
? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString())
|
||||
: null;
|
||||
} else {
|
||||
acc.summaryPointOCT3 = "-"
|
||||
acc.textPointOCT3 = "-"
|
||||
acc.periodOCT3 = "-"
|
||||
acc.yearOCT3 = "-"
|
||||
acc.summaryPointOCT3 = "-";
|
||||
acc.textPointOCT3 = "-";
|
||||
acc.periodOCT3 = "-";
|
||||
acc.yearOCT3 = "-";
|
||||
}
|
||||
|
||||
if (x.kpiPeriod.year === yearNow - 1 && x.kpiPeriod.durationKPI === "APR") {
|
||||
|
|
@ -884,10 +884,10 @@ export class ReportController extends Controller {
|
|||
? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString())
|
||||
: null;
|
||||
} else {
|
||||
acc.summaryPointAPR4 = "-"
|
||||
acc.textPointAPR4 = "-"
|
||||
acc.periodAPR4 = "-"
|
||||
acc.yearAPR4 = "-"
|
||||
acc.summaryPointAPR4 = "-";
|
||||
acc.textPointAPR4 = "-";
|
||||
acc.periodAPR4 = "-";
|
||||
acc.yearAPR4 = "-";
|
||||
}
|
||||
|
||||
if (x.kpiPeriod.year === yearNow - 1 && x.kpiPeriod.durationKPI === "OCT") {
|
||||
|
|
@ -900,10 +900,10 @@ export class ReportController extends Controller {
|
|||
? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString())
|
||||
: null;
|
||||
} else {
|
||||
acc.summaryPointOCT4 = "-"
|
||||
acc.textPointOCT4 = "-"
|
||||
acc.periodOCT4 = "-"
|
||||
acc.yearOCT4 = "-"
|
||||
acc.summaryPointOCT4 = "-";
|
||||
acc.textPointOCT4 = "-";
|
||||
acc.periodOCT4 = "-";
|
||||
acc.yearOCT4 = "-";
|
||||
}
|
||||
|
||||
if (x.kpiPeriod.year === yearNow && x.kpiPeriod.durationKPI === "APR") {
|
||||
|
|
@ -916,10 +916,10 @@ export class ReportController extends Controller {
|
|||
? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString())
|
||||
: null;
|
||||
} else {
|
||||
acc.summaryPointAPR5 = "-"
|
||||
acc.textPointAPR5 = "-"
|
||||
acc.periodAPR5 = "-"
|
||||
acc.yearAPR5 = "-"
|
||||
acc.summaryPointAPR5 = "-";
|
||||
acc.textPointAPR5 = "-";
|
||||
acc.periodAPR5 = "-";
|
||||
acc.yearAPR5 = "-";
|
||||
}
|
||||
|
||||
if (x.kpiPeriod.year === yearNow && x.kpiPeriod.durationKPI === "OCT") {
|
||||
|
|
@ -932,10 +932,10 @@ export class ReportController extends Controller {
|
|||
? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString())
|
||||
: null;
|
||||
} else {
|
||||
acc.summaryPointOCT5 = "-"
|
||||
acc.textPointOCT5 = "-"
|
||||
acc.periodOCT5 = "-"
|
||||
acc.yearOCT5 = "-"
|
||||
acc.summaryPointOCT5 = "-";
|
||||
acc.textPointOCT5 = "-";
|
||||
acc.periodOCT5 = "-";
|
||||
acc.yearOCT5 = "-";
|
||||
}
|
||||
|
||||
return acc;
|
||||
|
|
@ -1143,10 +1143,10 @@ export class ReportController extends Controller {
|
|||
? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString())
|
||||
: null;
|
||||
} else {
|
||||
acc.summaryPointAPR1 = "-"
|
||||
acc.textPointAPR1 = "-"
|
||||
acc.periodAPR1 = "-"
|
||||
acc.yearAPR1 = "-"
|
||||
acc.summaryPointAPR1 = "-";
|
||||
acc.textPointAPR1 = "-";
|
||||
acc.periodAPR1 = "-";
|
||||
acc.yearAPR1 = "-";
|
||||
}
|
||||
|
||||
if (x.kpiPeriod.year === yearNow - 2 && x.kpiPeriod.durationKPI === "OCT") {
|
||||
|
|
@ -1159,10 +1159,10 @@ export class ReportController extends Controller {
|
|||
? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString())
|
||||
: null;
|
||||
} else {
|
||||
acc.summaryPointOCT1 = "-"
|
||||
acc.textPointOCT1 = "-"
|
||||
acc.periodOCT1 = "-"
|
||||
acc.yearOCT1 = "-"
|
||||
acc.summaryPointOCT1 = "-";
|
||||
acc.textPointOCT1 = "-";
|
||||
acc.periodOCT1 = "-";
|
||||
acc.yearOCT1 = "-";
|
||||
}
|
||||
|
||||
if (x.kpiPeriod.year === yearNow - 1 && x.kpiPeriod.durationKPI === "APR") {
|
||||
|
|
@ -1175,10 +1175,10 @@ export class ReportController extends Controller {
|
|||
? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString())
|
||||
: null;
|
||||
} else {
|
||||
acc.summaryPointAPR2 = "-"
|
||||
acc.textPointAPR2 = "-"
|
||||
acc.periodAPR2 = "-"
|
||||
acc.yearAPR2 = "-"
|
||||
acc.summaryPointAPR2 = "-";
|
||||
acc.textPointAPR2 = "-";
|
||||
acc.periodAPR2 = "-";
|
||||
acc.yearAPR2 = "-";
|
||||
}
|
||||
|
||||
if (x.kpiPeriod.year === yearNow - 1 && x.kpiPeriod.durationKPI === "OCT") {
|
||||
|
|
@ -1191,10 +1191,10 @@ export class ReportController extends Controller {
|
|||
? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString())
|
||||
: null;
|
||||
} else {
|
||||
acc.summaryPointOCT2 = "-"
|
||||
acc.textPointOCT2 = "-"
|
||||
acc.periodOCT2 = "-"
|
||||
acc.yearOCT2 = "-"
|
||||
acc.summaryPointOCT2 = "-";
|
||||
acc.textPointOCT2 = "-";
|
||||
acc.periodOCT2 = "-";
|
||||
acc.yearOCT2 = "-";
|
||||
}
|
||||
|
||||
if (x.kpiPeriod.year === yearNow && x.kpiPeriod.durationKPI === "APR") {
|
||||
|
|
@ -1207,10 +1207,10 @@ export class ReportController extends Controller {
|
|||
? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString())
|
||||
: null;
|
||||
} else {
|
||||
acc.summaryPointAPR3 = "-"
|
||||
acc.textPointAPR3 = "-"
|
||||
acc.periodAPR3 = "-"
|
||||
acc.yearAPR3 = "-"
|
||||
acc.summaryPointAPR3 = "-";
|
||||
acc.textPointAPR3 = "-";
|
||||
acc.periodAPR3 = "-";
|
||||
acc.yearAPR3 = "-";
|
||||
}
|
||||
|
||||
if (x.kpiPeriod.year === yearNow && x.kpiPeriod.durationKPI === "OCT") {
|
||||
|
|
@ -1223,10 +1223,10 @@ export class ReportController extends Controller {
|
|||
? Extension.ToThaiNumber(Extension.ToThaiYear(x.kpiPeriod.year).toString())
|
||||
: null;
|
||||
} else {
|
||||
acc.summaryPointOCT3 = "-"
|
||||
acc.textPointOCT3 = "-"
|
||||
acc.periodOCT3 = "-"
|
||||
acc.yearOCT3 = "-"
|
||||
acc.summaryPointOCT3 = "-";
|
||||
acc.textPointOCT3 = "-";
|
||||
acc.periodOCT3 = "-";
|
||||
acc.yearOCT3 = "-";
|
||||
}
|
||||
|
||||
return acc;
|
||||
|
|
@ -1639,12 +1639,37 @@ export class ReportController extends Controller {
|
|||
(kpiUserEvaluation.firstNameEvaluator == null ? "" : kpiUserEvaluation.firstNameEvaluator) +
|
||||
" " +
|
||||
(kpiUserEvaluation.lastNameEvaluator == null ? "" : kpiUserEvaluation.lastNameEvaluator),
|
||||
|
||||
fullnameCommander:
|
||||
(kpiUserEvaluation.prefixCommander == null ? "" : kpiUserEvaluation.prefixCommander) +
|
||||
"" +
|
||||
(kpiUserEvaluation.firstNameCommander == null ? "" : kpiUserEvaluation.firstNameCommander) +
|
||||
" " +
|
||||
(kpiUserEvaluation.lastNameCommander == null ? "" : kpiUserEvaluation.lastNameCommander),
|
||||
|
||||
fullnameCommanderHigh:
|
||||
(kpiUserEvaluation.prefixCommanderHigh == null
|
||||
? ""
|
||||
: kpiUserEvaluation.prefixCommanderHigh) +
|
||||
"" +
|
||||
(kpiUserEvaluation.firstNameCommanderHigh == null
|
||||
? ""
|
||||
: kpiUserEvaluation.firstNameCommanderHigh) +
|
||||
" " +
|
||||
(kpiUserEvaluation.lastNameCommanderHigh == null
|
||||
? ""
|
||||
: kpiUserEvaluation.lastNameCommanderHigh),
|
||||
positionEvaluator: kpiUserEvaluation.positionEvaluator,
|
||||
positionCommander: kpiUserEvaluation.positionCommander,
|
||||
positionCommanderHigh: kpiUserEvaluation.positionCommanderHigh,
|
||||
posTypeNameEvaluator: kpiUserEvaluation.posTypeNameEvaluator,
|
||||
posLevelNameEvaluator: kpiUserEvaluation.posLevelNameEvaluator,
|
||||
orgEvaluator: kpiUserEvaluation.orgEvaluator,
|
||||
|
||||
year: Extension.ToThaiNumber(String(Extension.ToThaiYear(kpiUserEvaluation.kpiPeriod.year))),
|
||||
yearOld: Extension.ToThaiNumber(
|
||||
String(Extension.ToThaiYear(kpiUserEvaluation.kpiPeriod.year + 1)),
|
||||
),
|
||||
|
||||
startDateApr:
|
||||
kpiUserEvaluation.kpiPeriod == null ||
|
||||
|
|
|
|||
|
|
@ -200,6 +200,70 @@ export class KpiUserEvaluation extends EntityBase {
|
|||
})
|
||||
orgEvaluator: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "คำนำหน้าผู้บังคับบัญชาเหนือขึ้นไป",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
prefixCommander: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ชื่อผู้บังคับบัญชาเหนือขึ้นไป",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
firstNameCommander: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "สกุลผู้บังคับบัญชาเหนือขึ้นไป",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
lastNameCommander: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ตำแหน่งผู้บังคับบัญชาเหนือขึ้นไป",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
positionCommander: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "คำนำหน้าผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
prefixCommanderHigh: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ชื่อผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
firstNameCommanderHigh: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "สกุลผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
lastNameCommanderHigh: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ตำแหน่งผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
positionCommanderHigh: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
|
|
@ -417,6 +481,13 @@ export class KpiUserEvaluation extends EntityBase {
|
|||
})
|
||||
isOpen: boolean;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "สถานะทดลองงาน",
|
||||
default: false,
|
||||
})
|
||||
isProbation: boolean;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "datetime",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue