Merge branch 'adiDev' into develop
This commit is contained in:
commit
fe8f3584f0
1 changed files with 79 additions and 71 deletions
|
|
@ -1084,20 +1084,25 @@ export class ReportController extends Controller {
|
|||
},
|
||||
});
|
||||
|
||||
if (salaryOrg_Group1 && salaryPeriod.period === "APR") {
|
||||
const salaryProfileGroup1 = await this.salaryProfileRepository.find({
|
||||
where: {
|
||||
salaryOrgId: salaryOrg_Group1?.id,
|
||||
type: "FULL", //หนึ่งขั้น
|
||||
if (salaryPeriod.period === "APR") {
|
||||
let salaryProfileGroup1: any;
|
||||
let salaryProfileGroup2: any;
|
||||
if (salaryOrg_Group1) {
|
||||
salaryProfileGroup1 = await this.salaryProfileRepository.find({
|
||||
where: {
|
||||
salaryOrgId: salaryOrg_Group1?.id,
|
||||
type: "FULL", //หนึ่งขั้น
|
||||
},
|
||||
});
|
||||
const salaryProfileGroup2 = await this.salaryProfileRepository.find({
|
||||
where: {
|
||||
salaryOrgId: salaryOrg_Group2?.id,
|
||||
type: "FULL", //หนึ่งขั้น
|
||||
},
|
||||
});
|
||||
|
||||
}
|
||||
if (salaryOrg_Group2) {
|
||||
salaryProfileGroup2 = await this.salaryProfileRepository.find({
|
||||
where: {
|
||||
salaryOrgId: salaryOrg_Group2?.id,
|
||||
type: "FULL", //หนึ่งขั้น
|
||||
},
|
||||
});
|
||||
}
|
||||
//รอบปีก่อนๆ
|
||||
const salaryPeriodIncrease1_APR = await this.salaryPeriodRepository.findOne({
|
||||
where: {
|
||||
|
|
@ -1252,59 +1257,61 @@ export class ReportController extends Controller {
|
|||
point: fifteenPercent_Group1 + fifteenPoint_Group1,
|
||||
pointGroup2: fifteenPercent_Group2 + fifteenPoint_Group2,
|
||||
root: salaryOrg_Group1?.root,
|
||||
profile: salaryProfileGroup1.map((item, index) => ({
|
||||
no: Extension.ToThaiNumber(String(index + 1)),
|
||||
fullname:
|
||||
(item.child4 == undefined && item.child4 == null ? "" : item.child4 + "/") +
|
||||
(item.child3 == undefined && item.child3 == null ? "" : item.child3 + "/") +
|
||||
(item.child2 == undefined && item.child2 == null ? "" : item.child2 + "/") +
|
||||
(item.child1 == undefined && item.child1 == null ? "" : item.child1 + "/") +
|
||||
(item.root == undefined && item.root == null ? "" : item.root) +
|
||||
"/" +
|
||||
item.prefix +
|
||||
item.firstName +
|
||||
" " +
|
||||
item.lastName, // สังกัด/ชื่อ-นามสกุล
|
||||
posLevel: item.posLevel,
|
||||
posMasterNo:
|
||||
Extension.ToThaiNumber(item.orgShortName) +
|
||||
Extension.ToThaiNumber(String(item.posMasterNo.toLocaleString())),
|
||||
amount:
|
||||
item.amount == undefined || item.amount == null
|
||||
? "๐"
|
||||
: Extension.ToThaiNumber(String(item.amount.toLocaleString())),
|
||||
salaryIncrease1:
|
||||
salaryProfile1_Group1.length > 0
|
||||
? (() => {
|
||||
const filteredType = salaryProfile1_Group1
|
||||
.filter((profile) => profile.citizenId === item.citizenId)
|
||||
.map((profile) => profile.type);
|
||||
const Type = filteredType[0];
|
||||
return Type === "HAFT"
|
||||
? "ครึ่งขั้น"
|
||||
: Type === "FULL"
|
||||
? "หนึ่งขั้น"
|
||||
: "ไม่ได้เลื่อนขั้น";
|
||||
})()
|
||||
: null, //การเลื่อนเงินเดือนปีก่อนๆหน้า
|
||||
salaryIncrease2:
|
||||
salaryProfile2_Group1.length > 0
|
||||
? (() => {
|
||||
const filteredType = salaryProfile2_Group1
|
||||
.filter((profile) => profile.citizenId === item.citizenId)
|
||||
.map((profile) => profile.type);
|
||||
const Type = filteredType[0];
|
||||
return Type === "HAFT"
|
||||
? "ครึ่งขั้น"
|
||||
: Type === "FULL"
|
||||
? "หนึ่งขั้น"
|
||||
: "ไม่ได้เลื่อนขั้น";
|
||||
})()
|
||||
: null, //การเลื่อนเงินเดือนปีก่อนหน้า
|
||||
score: null, //ผลการประเมินฯ
|
||||
remark: null, //หมายเหตุ
|
||||
})),
|
||||
profileGroup2: salaryProfileGroup2.map((item, index) => ({
|
||||
profile: salaryProfileGroup1
|
||||
? salaryProfileGroup1.map((item: any, index: any) => ({
|
||||
no: Extension.ToThaiNumber(String(index + 1)),
|
||||
fullname:
|
||||
(item.child4 == undefined && item.child4 == null ? "" : item.child4 + "/") +
|
||||
(item.child3 == undefined && item.child3 == null ? "" : item.child3 + "/") +
|
||||
(item.child2 == undefined && item.child2 == null ? "" : item.child2 + "/") +
|
||||
(item.child1 == undefined && item.child1 == null ? "" : item.child1 + "/") +
|
||||
(item.root == undefined && item.root == null ? "" : item.root) +
|
||||
"/" +
|
||||
item.prefix +
|
||||
item.firstName +
|
||||
" " +
|
||||
item.lastName, // สังกัด/ชื่อ-นามสกุล
|
||||
posLevel: item.posLevel,
|
||||
posMasterNo:
|
||||
Extension.ToThaiNumber(item.orgShortName) +
|
||||
Extension.ToThaiNumber(String(item.posMasterNo.toLocaleString())),
|
||||
amount:
|
||||
item.amount == undefined || item.amount == null
|
||||
? "๐"
|
||||
: Extension.ToThaiNumber(String(item.amount.toLocaleString())),
|
||||
salaryIncrease1:
|
||||
salaryProfile1_Group1.length > 0
|
||||
? (() => {
|
||||
const filteredType = salaryProfile1_Group1
|
||||
.filter((profile) => profile.citizenId === item.citizenId)
|
||||
.map((profile) => profile.type);
|
||||
const Type = filteredType[0];
|
||||
return Type === "HAFT"
|
||||
? "ครึ่งขั้น"
|
||||
: Type === "FULL"
|
||||
? "หนึ่งขั้น"
|
||||
: "ไม่ได้เลื่อนขั้น";
|
||||
})()
|
||||
: null, //การเลื่อนเงินเดือนปีก่อนๆหน้า
|
||||
salaryIncrease2:
|
||||
salaryProfile2_Group1.length > 0
|
||||
? (() => {
|
||||
const filteredType = salaryProfile2_Group1
|
||||
.filter((profile) => profile.citizenId === item.citizenId)
|
||||
.map((profile) => profile.type);
|
||||
const Type = filteredType[0];
|
||||
return Type === "HAFT"
|
||||
? "ครึ่งขั้น"
|
||||
: Type === "FULL"
|
||||
? "หนึ่งขั้น"
|
||||
: "ไม่ได้เลื่อนขั้น";
|
||||
})()
|
||||
: null, //การเลื่อนเงินเดือนปีก่อนหน้า
|
||||
score: null, //ผลการประเมินฯ
|
||||
remark: null, //หมายเหตุ
|
||||
}))
|
||||
: null,
|
||||
profileGroup2: salaryProfileGroup2?salaryProfileGroup2.map((item: any, index: any) => ({
|
||||
no: Extension.ToThaiNumber(String(index + 1)),
|
||||
fullname:
|
||||
(item.child4 == undefined && item.child4 == null ? "" : item.child4 + "/") +
|
||||
|
|
@ -1355,8 +1362,8 @@ export class ReportController extends Controller {
|
|||
: null, //การเลื่อนเงินเดือนปีก่อนหน้า
|
||||
score: null, //ผลการประเมินฯ
|
||||
remark: null, //หมายเหตุ
|
||||
})),
|
||||
}||{},
|
||||
})) :null,
|
||||
},
|
||||
});
|
||||
} else if (salaryOrg_Group1 &&salaryPeriod.period === "OCT") {
|
||||
// find period APR
|
||||
|
|
@ -1564,7 +1571,8 @@ export class ReportController extends Controller {
|
|||
point: fifteenPercent + fifteenPoint,
|
||||
pointGroup2: fifteenPercent_Group2 + fifteenPoint_Group2,
|
||||
root: salaryOrg_Group1?.root,
|
||||
profile: salaryProfileGroup1.map((item, index) => ({
|
||||
profile: salaryProfileGroup1
|
||||
? salaryProfileGroup1.map((item: any, index: any) => ({
|
||||
no: Extension.ToThaiNumber(String(index + 1)),
|
||||
fullname:
|
||||
(item.child4 == undefined && item.child4 == null ? "" : item.child4 + "/") +
|
||||
|
|
@ -1641,8 +1649,8 @@ export class ReportController extends Controller {
|
|||
: null,
|
||||
score1: null, //ผลการประเมินฯ ครั้งที่ 1
|
||||
score2: null, //ผลการประเมินฯ ครั้งที่ 2
|
||||
})),
|
||||
profileGroup2: salaryProfileGroup2.map((item, index) => ({
|
||||
})):null,
|
||||
profileGroup2: salaryProfileGroup2?salaryProfileGroup2.map((item, index) => ({
|
||||
no: Extension.ToThaiNumber(String(index + 1)),
|
||||
fullname:
|
||||
(item.child4 == undefined && item.child4 == null ? "" : item.child4 + "/") +
|
||||
|
|
@ -1719,7 +1727,7 @@ export class ReportController extends Controller {
|
|||
: null,
|
||||
score1: null, //ผลการประเมินฯ ครั้งที่ 1
|
||||
score2: null, //ผลการประเมินฯ ครั้งที่ 2
|
||||
})),
|
||||
})):null,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue