Merge branch 'develop' into develop-Bright
This commit is contained in:
commit
f1e8a6f8de
4 changed files with 68 additions and 47 deletions
|
|
@ -1354,6 +1354,7 @@ export class EmployeePositionController extends Controller {
|
|||
"orgChild2",
|
||||
"orgChild3",
|
||||
"orgChild4",
|
||||
"current_holder",
|
||||
"positions",
|
||||
"positions.posLevel",
|
||||
"positions.posType",
|
||||
|
|
@ -1381,6 +1382,12 @@ export class EmployeePositionController extends Controller {
|
|||
position: item.positions.map((x) => x.positionName).join("/"),
|
||||
posLevel: item.positions.map((x) => x.posLevel.posLevelName).join("/"),
|
||||
posType: item.positions.map((x) => x.posType.posTypeName).join("/"),
|
||||
fullname:
|
||||
(item?.current_holder?.prefix ?? "") +
|
||||
"" +
|
||||
(item?.current_holder?.firstName ?? "") +
|
||||
" " +
|
||||
(item?.current_holder?.lastName ?? ""),
|
||||
}));
|
||||
return new HttpSuccess(_data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1605,11 +1605,11 @@ export class PositionController extends Controller {
|
|||
posLevel: item.positions.map((x) => x.posLevel.posLevelName).join("/"),
|
||||
posType: item.positions.map((x) => x.posType.posTypeName).join("/"),
|
||||
fullname:
|
||||
item.current_holder.prefix +
|
||||
(item?.current_holder?.prefix ?? "") +
|
||||
"" +
|
||||
(item?.current_holder?.firstName ?? "") +
|
||||
" " +
|
||||
item.current_holder.firstName +
|
||||
" " +
|
||||
item.current_holder.lastName,
|
||||
(item?.current_holder?.lastName ?? ""),
|
||||
}));
|
||||
return new HttpSuccess(_data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -346,9 +346,7 @@ export class ProfileController extends Controller {
|
|||
: null,
|
||||
BirthDayText:
|
||||
profiles.birthDate != null
|
||||
? Extension.ToThaiNumber(
|
||||
Extension.ToThaiFullDate2(profiles.birthDate).toString(),
|
||||
)
|
||||
? Extension.ToThaiNumber(Extension.ToThaiFullDate2(profiles.birthDate).toString())
|
||||
: "",
|
||||
BirthMonth: profiles?.birthDate
|
||||
? Extension.ToThaiNumber(new Date(profiles.birthDate).getMonth() + (1).toString())
|
||||
|
|
@ -358,9 +356,7 @@ export class ProfileController extends Controller {
|
|||
: null,
|
||||
BirthYearText:
|
||||
profiles.birthDate != null
|
||||
? Extension.ToThaiNumber(
|
||||
Extension.ToThaiFullDate2(profiles.birthDate).toString(),
|
||||
)
|
||||
? Extension.ToThaiNumber(Extension.ToThaiFullDate2(profiles.birthDate).toString())
|
||||
: "",
|
||||
Address: "",
|
||||
District: "",
|
||||
|
|
@ -446,9 +442,7 @@ export class ProfileController extends Controller {
|
|||
? ""
|
||||
: Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.startDate)),
|
||||
End:
|
||||
item.endDate == null
|
||||
? ""
|
||||
: Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.endDate)),
|
||||
item.endDate == null ? "" : Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.endDate)),
|
||||
Date:
|
||||
item.startDate && item.endDate
|
||||
? `${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.startDate))} - ${Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.endDate))}`
|
||||
|
|
@ -508,9 +502,7 @@ export class ProfileController extends Controller {
|
|||
});
|
||||
|
||||
const Salary = salarys.map((item) => ({
|
||||
SalaryDate: item.date
|
||||
? Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.date))
|
||||
: null,
|
||||
SalaryDate: item.date ? Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.date)) : null,
|
||||
Position: item.position != null ? Extension.ToThaiNumber(item.position) : null,
|
||||
PosNo: item.posNo != null ? Extension.ToThaiNumber(item.posNo) : null,
|
||||
Salary: item.amount != null ? Extension.ToThaiNumber(item.amount.toLocaleString()) : null,
|
||||
|
|
@ -3149,6 +3141,30 @@ export class ProfileController extends Controller {
|
|||
posMasterId: posMaster?.id,
|
||||
},
|
||||
});
|
||||
const shortName =
|
||||
profile.current_holders.length == 0
|
||||
? null
|
||||
: profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id) != null &&
|
||||
profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.orgChild4 !=
|
||||
null
|
||||
? `${profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.orgChild4.orgChild4ShortName}${profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.posMasterNo}`
|
||||
: profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id) != null &&
|
||||
profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.orgChild3 !=
|
||||
null
|
||||
? `${profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.orgChild3.orgChild3ShortName}${profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.posMasterNo}`
|
||||
: profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id) != null &&
|
||||
profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.orgChild2 !=
|
||||
null
|
||||
? `${profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.orgChild2.orgChild2ShortName}${profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.posMasterNo}`
|
||||
: profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id) != null &&
|
||||
profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)
|
||||
?.orgChild1 != null
|
||||
? `${profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.orgChild1.orgChild1ShortName}${profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.posMasterNo}`
|
||||
: profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id) != null &&
|
||||
profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)
|
||||
?.orgRoot != null
|
||||
? `${profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.orgRoot.orgRootShortName}${profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.posMasterNo}`
|
||||
: null;
|
||||
const _profile: any = {
|
||||
profileId: profile.id,
|
||||
prefix: profile.prefix,
|
||||
|
|
@ -3188,6 +3204,7 @@ export class ProfileController extends Controller {
|
|||
child4ShortName: child4 == null ? null : child4.orgChild4ShortName,
|
||||
node: null,
|
||||
nodeId: null,
|
||||
posNo: shortName,
|
||||
};
|
||||
|
||||
if (_profile.child4Id != null) {
|
||||
|
|
@ -4888,23 +4905,6 @@ export class ProfileController extends Controller {
|
|||
order: { createdAt: "DESC" },
|
||||
});
|
||||
|
||||
await new CallAPI().PostData(request, "org/profile/salary", {
|
||||
profileId: profile.id,
|
||||
date: requestBody.dateLeave,
|
||||
amount: profileSalary?.amount ?? null,
|
||||
positionSalaryAmount: profileSalary?.positionSalaryAmount ?? null,
|
||||
mouthSalaryAmount: profileSalary?.mouthSalaryAmount ?? null,
|
||||
posNo: profileSalary?.posNo ?? null,
|
||||
position: profileSalary?.position ?? null,
|
||||
positionLine: profileSalary?.positionLine ?? null,
|
||||
positionPathSide: profileSalary?.positionPathSide ?? null,
|
||||
positionExecutive: profileSalary?.positionExecutive ?? null,
|
||||
positionType: profileSalary?.positionType ?? null,
|
||||
positionLevel: profileSalary?.positionLevel ?? null,
|
||||
refCommandNo: null,
|
||||
templateDoc: requestBody.leaveReason,
|
||||
});
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2694,20 +2694,6 @@ export class ProfileEmployeeController extends Controller {
|
|||
order: { createdAt: "DESC" },
|
||||
});
|
||||
|
||||
await new CallAPI().PostData(request, "org/profile-employee/salary", {
|
||||
profileEmployeeId: profile.id,
|
||||
date: requestBody.dateLeave,
|
||||
amount: profileSalary?.amount ?? null,
|
||||
positionSalaryAmount: profileSalary?.positionSalaryAmount ?? null,
|
||||
mouthSalaryAmount: profileSalary?.mouthSalaryAmount ?? null,
|
||||
posNo: profileSalary?.posNo ?? null,
|
||||
position: profileSalary?.position ?? null,
|
||||
positionType: profileSalary?.positionType ?? null,
|
||||
positionLevel: profileSalary?.positionLevel ?? null,
|
||||
refCommandNo: null,
|
||||
templateDoc: requestBody.leaveReason,
|
||||
});
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
|
|
@ -3281,6 +3267,33 @@ export class ProfileEmployeeController extends Controller {
|
|||
// posMasterId: posMaster?.id,
|
||||
// },
|
||||
// });
|
||||
const shortName =
|
||||
profile.current_holders.length == 0
|
||||
? null
|
||||
: profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id) != null &&
|
||||
profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)
|
||||
?.orgChild4 != null
|
||||
? `${profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.orgChild4.orgChild4ShortName}${profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.posMasterNo}`
|
||||
: profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id) != null &&
|
||||
profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)
|
||||
?.orgChild3 != null
|
||||
? `${profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.orgChild3.orgChild3ShortName}${profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.posMasterNo}`
|
||||
: profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id) !=
|
||||
null &&
|
||||
profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)
|
||||
?.orgChild2 != null
|
||||
? `${profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.orgChild2.orgChild2ShortName}${profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.posMasterNo}`
|
||||
: profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id) !=
|
||||
null &&
|
||||
profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)
|
||||
?.orgChild1 != null
|
||||
? `${profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.orgChild1.orgChild1ShortName}${profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.posMasterNo}`
|
||||
: profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id) !=
|
||||
null &&
|
||||
profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)
|
||||
?.orgRoot != null
|
||||
? `${profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.orgRoot.orgRootShortName}${profile.current_holders.find((x) => x.orgRevisionId == orgRevisionPublish.id)?.posMasterNo}`
|
||||
: null;
|
||||
const _profile: any = {
|
||||
profileId: profile.id,
|
||||
prefix: profile.prefix,
|
||||
|
|
@ -3317,6 +3330,7 @@ export class ProfileEmployeeController extends Controller {
|
|||
child4ShortName: child4 == null ? null : child4.orgChild4ShortName,
|
||||
node: null,
|
||||
nodeId: null,
|
||||
posNo: shortName,
|
||||
};
|
||||
|
||||
if (_profile.child4Id != null) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue