Compare commits

...

2 commits

Author SHA1 Message Date
harid
da75287882 no message
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m22s
2026-02-19 13:36:07 +07:00
harid
f1d9831055 comment call leave service 2026-02-19 13:35:12 +07:00
2 changed files with 28 additions and 28 deletions

View file

@ -5813,10 +5813,10 @@ export class CommandController extends Controller {
.orgRootShortName ?? "";
}
}
const leaveType = await this.leaveType.findOne({
select: { id: true, limit: true, code: true },
where: { code: "LV-005" }
});
// const leaveType = await this.leaveType.findOne({
// select: { id: true, limit: true, code: true },
// where: { code: "LV-005" }
// });
await Promise.all(
body.data.map(async (item) => {
const profile = await this.profileRepository.findOne({
@ -5912,25 +5912,25 @@ export class CommandController extends Controller {
{ id: In(profileIds) },
{ isProbation: false }
);
// Task #2304 อัปเดตจำนวนสิทธิ์การลา เมื่อผ่านทดลองงานฯ
if (leaveType != null) {
await Promise.all(
body.data.map((item) =>
new CallAPI().PutData(req, `/leave-beginning/schedule`, {
profileId: item.profileId,
leaveTypeId: leaveType.id,
leaveYear: item.commandYear,
leaveDays: leaveType.limit,
leaveDaysUsed: 0,
leaveCount: 0,
beginningLeaveDays: 0,
beginningLeaveCount: 0,
})
.then(() => {})
.catch(() => {})
)
);
}
// // Task #2304 อัปเดตจำนวนสิทธิ์การลา เมื่อผ่านทดลองงานฯ
// if (leaveType != null) {
// await Promise.all(
// body.data.map((item) =>
// new CallAPI().PutData(req, `/leave-beginning/schedule`, {
// profileId: item.profileId,
// leaveTypeId: leaveType.id,
// leaveYear: item.commandYear,
// leaveDays: leaveType.limit,
// leaveDaysUsed: 0,
// leaveCount: 0,
// beginningLeaveDays: 0,
// beginningLeaveCount: 0,
// })
// .then(() => {})
// .catch(() => {})
// )
// );
// }
}
return new HttpSuccess();
}

View file

@ -2003,7 +2003,7 @@ export class PositionController extends Controller {
posMaster.orgChild3Id == null
) {
body.type = 0;
shortName = posMaster.orgRoot.orgRootShortName;
shortName = posMaster.orgRoot?.orgRootShortName;
} else if (
posMaster.orgRootId !== null &&
posMaster.orgChild1Id !== null &&
@ -2011,7 +2011,7 @@ export class PositionController extends Controller {
posMaster.orgChild3Id == null
) {
body.type = 1;
shortName = posMaster.orgChild1.orgChild1ShortName;
shortName = posMaster.orgChild1?.orgChild1ShortName;
} else if (
posMaster.orgRootId !== null &&
posMaster.orgChild1Id !== null &&
@ -2019,7 +2019,7 @@ export class PositionController extends Controller {
posMaster.orgChild3Id == null
) {
body.type = 2;
shortName = posMaster.orgChild2.orgChild2ShortName;
shortName = posMaster.orgChild2?.orgChild2ShortName;
} else if (
posMaster.orgRootId !== null &&
posMaster.orgChild1Id !== null &&
@ -2027,7 +2027,7 @@ export class PositionController extends Controller {
posMaster.orgChild3Id !== null
) {
body.type = 3;
shortName = posMaster.orgChild3.orgChild3ShortName;
shortName = posMaster.orgChild3?.orgChild3ShortName;
} else if (
posMaster.orgRootId !== null &&
posMaster.orgChild1Id !== null &&
@ -2035,7 +2035,7 @@ export class PositionController extends Controller {
posMaster.orgChild3Id !== null
) {
body.type = 4;
shortName = posMaster.orgChild4.orgChild4ShortName;
shortName = posMaster.orgChild4?.orgChild4ShortName;
}
return {