Compare commits
No commits in common. "dev" and "v1.0.2" have entirely different histories.
8 changed files with 389 additions and 687 deletions
|
|
@ -22,7 +22,7 @@ import {
|
||||||
listFile,
|
listFile,
|
||||||
updateFile,
|
updateFile,
|
||||||
} from "../services/edm";
|
} from "../services/edm";
|
||||||
import { s3DeleteFile, s3DownloadFile, s3ListFile, s3UploadFile, truncateFileName } from "../services/minio";
|
import { s3DeleteFile, s3DownloadFile, s3ListFile, s3UploadFile } from "../services/minio";
|
||||||
|
|
||||||
@Route("api/v1/salary/file/{name}/{group}")
|
@Route("api/v1/salary/file/{name}/{group}")
|
||||||
@Security("bearerAuth")
|
@Security("bearerAuth")
|
||||||
|
|
@ -257,7 +257,7 @@ export class FileController extends Controller {
|
||||||
|
|
||||||
const map = fileList.map(async ({ fileName, ...props }) => [
|
const map = fileList.map(async ({ fileName, ...props }) => [
|
||||||
fileName,
|
fileName,
|
||||||
await createFile(path, truncateFileName(fileName), props),
|
await createFile(path, fileName, props),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const result = await Promise.all(map).catch((e) =>
|
const result = await Promise.all(map).catch((e) =>
|
||||||
|
|
@ -607,7 +607,7 @@ export class SubFileController extends Controller {
|
||||||
|
|
||||||
const map = fileList.map(async ({ fileName, ...props }) => [
|
const map = fileList.map(async ({ fileName, ...props }) => [
|
||||||
fileName,
|
fileName,
|
||||||
await createFile(path, truncateFileName(fileName), props),
|
await createFile(path, fileName, props),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const result = await Promise.all(map).catch((e) =>
|
const result = await Promise.all(map).catch((e) =>
|
||||||
|
|
|
||||||
|
|
@ -9078,7 +9078,8 @@ export class ReportController extends Controller {
|
||||||
body: {
|
body: {
|
||||||
refIds: {
|
refIds: {
|
||||||
refId: string;
|
refId: string;
|
||||||
commandDateAffect: Date | null;
|
// commandAffectDate: Date | null;//เก่า
|
||||||
|
commandDateAffect: Date | null; //ใหม่ (ปรับตาม rabbitMQ ORG)
|
||||||
commandNo: string | null;
|
commandNo: string | null;
|
||||||
commandYear: number | null;
|
commandYear: number | null;
|
||||||
commandId: string | null;
|
commandId: string | null;
|
||||||
|
|
@ -9094,79 +9095,16 @@ export class ReportController extends Controller {
|
||||||
},
|
},
|
||||||
@Request() request: RequestWithUser,
|
@Request() request: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
// ═══════════════════════════════════════════════════════════════
|
await Promise.all(
|
||||||
// old circle flow (เก็บไว้อ้างอิง — ลบการใช้งานจริงออกแล้ว)
|
|
||||||
// ═══════════════════════════════════════════════════════════════
|
|
||||||
// await Promise.all(
|
|
||||||
// body.refIds.map(async (v) => {
|
|
||||||
// const salary = await this.salaryProfileRepository.findOne({
|
|
||||||
// where: { id: v.refId },
|
|
||||||
// });
|
|
||||||
// if (salary != null) {
|
|
||||||
// // เดิม: ยิง callback เข้า org เพื่อให้ org สร้าง salary record
|
|
||||||
// await new CallAPI()
|
|
||||||
// .PostData(request, "/org/profile/salary/update", {
|
|
||||||
// profileId: salary.profileId,
|
|
||||||
// commandDateAffect: v.commandDateAffect,
|
|
||||||
// commandDateSign: v.commandDateSign,
|
|
||||||
// amount: v.amount,
|
|
||||||
// amountSpecial: v.amountSpecial,
|
|
||||||
// positionSalaryAmount: v.positionSalaryAmount,
|
|
||||||
// mouthSalaryAmount: v.mouthSalaryAmount,
|
|
||||||
// posNo: salary.posMasterNo.toString(),
|
|
||||||
// posNoAbb: salary.orgShortName,
|
|
||||||
// positionName: salary.position,
|
|
||||||
// positionExecutive: salary.posExecutive,
|
|
||||||
// positionExecutiveField: salary.positionExecutiveField,
|
|
||||||
// positionArea: salary.positionArea,
|
|
||||||
// positionType: salary.posType,
|
|
||||||
// positionLevel: salary.posLevel,
|
|
||||||
// commandId: v.commandId,
|
|
||||||
// remark: v.remark,
|
|
||||||
// orgRoot: salary.root,
|
|
||||||
// orgChild1: salary.child1,
|
|
||||||
// orgChild2: salary.child2,
|
|
||||||
// orgChild3: salary.child3,
|
|
||||||
// orgChild4: salary.child4,
|
|
||||||
// commandCode: v.commandCode,
|
|
||||||
// commandName: v.commandName,
|
|
||||||
// commandNo: v.commandNo,
|
|
||||||
// commandYear: v.commandYear,
|
|
||||||
// })
|
|
||||||
// // เดิม: set status33 ใน .then() หลัง org ตอบกลับสำเร็จเท่านั้น
|
|
||||||
// .then(async () => {
|
|
||||||
// const before = null;
|
|
||||||
// salary.status33 = "DONE";
|
|
||||||
// salary.lastUpdateUserId = request.user.sub;
|
|
||||||
// salary.lastUpdateFullName = request.user.name;
|
|
||||||
// salary.lastUpdatedAt = new Date();
|
|
||||||
// await this.salaryProfileRepository.save(salary, { data: request });
|
|
||||||
// setLogDataDiff(request, { before, after: salary });
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }),
|
|
||||||
// );
|
|
||||||
// return new HttpSuccess();
|
|
||||||
|
|
||||||
// ═══════════════════════════════════════════════════════════════
|
|
||||||
// new linear flow
|
|
||||||
// ═══════════════════════════════════════════════════════════════
|
|
||||||
// เปลี่ยน: ไม่ยิง callback เข้า org แล้ว → ทำงานของตัวเอง (set status) แล้ว return data
|
|
||||||
// ให้ org ทำงานต่อ (org AMQ จะเรียก ExecuteSalaryReportService เองหลังได้รับ response)
|
|
||||||
const result = await Promise.all(
|
|
||||||
body.refIds.map(async (v) => {
|
body.refIds.map(async (v) => {
|
||||||
const salary = await this.salaryProfileRepository.findOne({ where: { id: v.refId } });
|
const salary = await this.salaryProfileRepository.findOne({
|
||||||
|
where: {
|
||||||
|
id: v.refId,
|
||||||
|
},
|
||||||
|
});
|
||||||
if (salary != null) {
|
if (salary != null) {
|
||||||
// 1) set status33 = DONE (ย้ายขึ้นมาทำก่อนเลย ไม่ต้องรอ org ตอบกลับ)
|
await new CallAPI()
|
||||||
salary.status33 = "DONE";
|
.PostData(request, "/org/profile/salary/update", {
|
||||||
salary.lastUpdateUserId = request.user.sub;
|
|
||||||
salary.lastUpdateFullName = request.user.name;
|
|
||||||
salary.lastUpdatedAt = new Date();
|
|
||||||
await this.salaryProfileRepository.save(salary, { data: request });
|
|
||||||
setLogDataDiff(request, { before: null, after: salary });
|
|
||||||
|
|
||||||
// 2) return ข้อมูลที่ org ต้องการสร้าง ProfileSalary (shape เดียวกับที่เคย PostData)
|
|
||||||
return {
|
|
||||||
profileId: salary.profileId,
|
profileId: salary.profileId,
|
||||||
commandDateAffect: v.commandDateAffect,
|
commandDateAffect: v.commandDateAffect,
|
||||||
commandDateSign: v.commandDateSign,
|
commandDateSign: v.commandDateSign,
|
||||||
|
|
@ -9193,12 +9131,20 @@ export class ReportController extends Controller {
|
||||||
commandName: v.commandName,
|
commandName: v.commandName,
|
||||||
commandNo: v.commandNo,
|
commandNo: v.commandNo,
|
||||||
commandYear: v.commandYear,
|
commandYear: v.commandYear,
|
||||||
};
|
})
|
||||||
|
.then(async () => {
|
||||||
|
const before = null;
|
||||||
|
salary.status33 = "DONE";
|
||||||
|
salary.lastUpdateUserId = request.user.sub;
|
||||||
|
salary.lastUpdateFullName = request.user.name;
|
||||||
|
salary.lastUpdatedAt = new Date();
|
||||||
|
await this.salaryProfileRepository.save(salary, { data: request });
|
||||||
|
setLogDataDiff(request, { before, after: salary });
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return null; // refId ที่ไม่พบ salary → กรองออก (เหมือนเดิมที่ข้ามไป)
|
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
return { result: result.filter(Boolean) }; // return array ของ salary data ให้ org ทำงานต่อ
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -9214,7 +9160,8 @@ async SalaryReportExcecute34(
|
||||||
body: {
|
body: {
|
||||||
refIds: {
|
refIds: {
|
||||||
refId: string;
|
refId: string;
|
||||||
commandDateAffect: Date | null;
|
// commandAffectDate: Date | null;//เก่า
|
||||||
|
commandDateAffect: Date | null; //ใหม่ (ปรับตาม rabbitMQ ORG)
|
||||||
commandNo: string | null;
|
commandNo: string | null;
|
||||||
commandYear: number | null;
|
commandYear: number | null;
|
||||||
commandId: string | null;
|
commandId: string | null;
|
||||||
|
|
@ -9230,75 +9177,17 @@ async SalaryReportExcecute34(
|
||||||
},
|
},
|
||||||
@Request() request: RequestWithUser,
|
@Request() request: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
// ═══════════════════════════════════════════════════════════════
|
await Promise.all(
|
||||||
// old circle flow (เก็บไว้อ้างอิง — ลบการใช้งานจริงออกแล้ว)
|
|
||||||
// ═══════════════════════════════════════════════════════════════
|
|
||||||
// await Promise.all(
|
|
||||||
// body.refIds.map(async (v) => {
|
|
||||||
// const salary = await this.salaryProfileRepository.findOne({
|
|
||||||
// where: { id: v.refId },
|
|
||||||
// });
|
|
||||||
// if (salary != null) {
|
|
||||||
// await new CallAPI()
|
|
||||||
// .PostData(request, "/org/profile/salary/update", {
|
|
||||||
// profileId: salary.profileId,
|
|
||||||
// commandDateAffect: v.commandDateAffect,
|
|
||||||
// commandDateSign: v.commandDateSign,
|
|
||||||
// amount: v.amount,
|
|
||||||
// amountSpecial: v.amountSpecial,
|
|
||||||
// positionSalaryAmount: v.positionSalaryAmount,
|
|
||||||
// mouthSalaryAmount: v.mouthSalaryAmount,
|
|
||||||
// posNo: salary.posMasterNo.toString(),
|
|
||||||
// posNoAbb: salary.orgShortName,
|
|
||||||
// positionName: salary.position,
|
|
||||||
// positionExecutive: salary.posExecutive,
|
|
||||||
// positionExecutiveField: salary.positionExecutiveField,
|
|
||||||
// positionArea: salary.positionArea,
|
|
||||||
// positionType: salary.posType,
|
|
||||||
// positionLevel: salary.posLevel,
|
|
||||||
// commandId: v.commandId,
|
|
||||||
// remark: v.remark,
|
|
||||||
// orgRoot: salary.root,
|
|
||||||
// orgChild1: salary.child1,
|
|
||||||
// orgChild2: salary.child2,
|
|
||||||
// orgChild3: salary.child3,
|
|
||||||
// orgChild4: salary.child4,
|
|
||||||
// commandCode: v.commandCode,
|
|
||||||
// commandName: v.commandName,
|
|
||||||
// commandNo: v.commandNo,
|
|
||||||
// commandYear: v.commandYear,
|
|
||||||
// })
|
|
||||||
// .then(async () => {
|
|
||||||
// const before = null;
|
|
||||||
// salary.status34 = "DONE";
|
|
||||||
// salary.lastUpdateUserId = request.user.sub;
|
|
||||||
// salary.lastUpdateFullName = request.user.name;
|
|
||||||
// salary.lastUpdatedAt = new Date();
|
|
||||||
// await this.salaryProfileRepository.save(salary, { data: request });
|
|
||||||
// setLogDataDiff(request, { before, after: salary });
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }),
|
|
||||||
// );
|
|
||||||
// return new HttpSuccess();
|
|
||||||
|
|
||||||
// ═══════════════════════════════════════════════════════════════
|
|
||||||
// new linear flow
|
|
||||||
// ═══════════════════════════════════════════════════════════════
|
|
||||||
const result = await Promise.all(
|
|
||||||
body.refIds.map(async (v) => {
|
body.refIds.map(async (v) => {
|
||||||
const salary = await this.salaryProfileRepository.findOne({ where: { id: v.refId } });
|
const salary = await this.salaryProfileRepository.findOne({
|
||||||
if (salary != null) {
|
where: {
|
||||||
// 1) set status34 = DONE (ย้ายขึ้นมาทำก่อนเลย ไม่ต้องรอ org ตอบกลับ)
|
id: v.refId,
|
||||||
salary.status34 = "DONE";
|
},
|
||||||
salary.lastUpdateUserId = request.user.sub;
|
});
|
||||||
salary.lastUpdateFullName = request.user.name;
|
|
||||||
salary.lastUpdatedAt = new Date();
|
|
||||||
await this.salaryProfileRepository.save(salary, { data: request });
|
|
||||||
setLogDataDiff(request, { before: null, after: salary });
|
|
||||||
|
|
||||||
// 2) return ข้อมูลที่ org ต้องการสร้าง ProfileSalary (shape เดียวกับที่เคย PostData)
|
if (salary != null) {
|
||||||
return {
|
await new CallAPI()
|
||||||
|
.PostData(request, "/org/profile/salary/update", {
|
||||||
profileId: salary.profileId,
|
profileId: salary.profileId,
|
||||||
commandDateAffect: v.commandDateAffect,
|
commandDateAffect: v.commandDateAffect,
|
||||||
commandDateSign: v.commandDateSign,
|
commandDateSign: v.commandDateSign,
|
||||||
|
|
@ -9325,12 +9214,20 @@ async SalaryReportExcecute34(
|
||||||
commandName: v.commandName,
|
commandName: v.commandName,
|
||||||
commandNo: v.commandNo,
|
commandNo: v.commandNo,
|
||||||
commandYear: v.commandYear,
|
commandYear: v.commandYear,
|
||||||
};
|
})
|
||||||
|
.then(async () => {
|
||||||
|
const before = null;
|
||||||
|
salary.status34 = "DONE";
|
||||||
|
salary.lastUpdateUserId = request.user.sub;
|
||||||
|
salary.lastUpdateFullName = request.user.name;
|
||||||
|
salary.lastUpdatedAt = new Date();
|
||||||
|
await this.salaryProfileRepository.save(salary, { data: request });
|
||||||
|
setLogDataDiff(request, { before, after: salary });
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
return { result: result.filter(Boolean) };
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -9346,7 +9243,8 @@ async SalaryReportExcecute34(
|
||||||
body: {
|
body: {
|
||||||
refIds: {
|
refIds: {
|
||||||
refId: string;
|
refId: string;
|
||||||
commandDateAffect: Date | null;
|
// commandAffectDate: Date | null;//เก่า
|
||||||
|
commandDateAffect: Date | null; //ใหม่ (ปรับตาม rabbitMQ ORG)
|
||||||
commandNo: string | null;
|
commandNo: string | null;
|
||||||
commandYear: number | null;
|
commandYear: number | null;
|
||||||
commandId: string | null;
|
commandId: string | null;
|
||||||
|
|
@ -9362,76 +9260,17 @@ async SalaryReportExcecute34(
|
||||||
},
|
},
|
||||||
@Request() request: RequestWithUser,
|
@Request() request: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
// ═══════════════════════════════════════════════════════════════
|
await Promise.all(
|
||||||
// old circle flow (เก็บไว้อ้างอิง — ลบการใช้งานจริงออกแล้ว)
|
|
||||||
// ═══════════════════════════════════════════════════════════════
|
|
||||||
// await Promise.all(
|
|
||||||
// body.refIds.map(async (v) => {
|
|
||||||
// const salary = await this.salaryProfileRepository.findOne({
|
|
||||||
// where: { id: v.refId },
|
|
||||||
// });
|
|
||||||
// if (salary != null) {
|
|
||||||
// await new CallAPI()
|
|
||||||
// .PostData(request, "/org/profile/salary/update", {
|
|
||||||
// profileId: salary.profileId,
|
|
||||||
// commandDateAffect: v.commandDateAffect,
|
|
||||||
// commandDateSign: v.commandDateSign,
|
|
||||||
// amount: v.amount,
|
|
||||||
// amountSpecial: v.amountSpecial,
|
|
||||||
// positionSalaryAmount: v.positionSalaryAmount,
|
|
||||||
// mouthSalaryAmount: v.mouthSalaryAmount,
|
|
||||||
// posNo: salary.posMasterNo.toString(),
|
|
||||||
// posNoAbb: salary.orgShortName,
|
|
||||||
// positionName: salary.position,
|
|
||||||
// positionExecutive: salary.posExecutive,
|
|
||||||
// positionExecutiveField: salary.positionExecutiveField,
|
|
||||||
// positionArea: salary.positionArea,
|
|
||||||
// positionType: salary.posType,
|
|
||||||
// positionLevel: salary.posLevel,
|
|
||||||
// commandId: v.commandId,
|
|
||||||
// remark: v.remark,
|
|
||||||
// orgRoot: salary.root,
|
|
||||||
// orgChild1: salary.child1,
|
|
||||||
// orgChild2: salary.child2,
|
|
||||||
// orgChild3: salary.child3,
|
|
||||||
// orgChild4: salary.child4,
|
|
||||||
// commandCode: v.commandCode,
|
|
||||||
// commandName: v.commandName,
|
|
||||||
// commandNo: v.commandNo,
|
|
||||||
// commandYear: v.commandYear,
|
|
||||||
// })
|
|
||||||
// .then(async () => {
|
|
||||||
// const before = null;
|
|
||||||
// salary.status35 = "DONE";
|
|
||||||
// salary.lastUpdateUserId = request.user.sub;
|
|
||||||
// salary.lastUpdateFullName = request.user.name;
|
|
||||||
// salary.lastUpdatedAt = new Date();
|
|
||||||
// await this.salaryProfileRepository.save(salary, { data: request });
|
|
||||||
// setLogDataDiff(request, { before, after: salary });
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }),
|
|
||||||
// );
|
|
||||||
// return new HttpSuccess();
|
|
||||||
|
|
||||||
// ═══════════════════════════════════════════════════════════════
|
|
||||||
// new linear flow
|
|
||||||
// ═══════════════════════════════════════════════════════════════
|
|
||||||
// ใช้ร่วมกับ C-PM-45 (path reuse) — ทั้ง C-PM-35/45 ยิงเข้าที่นี่ ตั้ง status35 เหมือนกัน
|
|
||||||
const result = await Promise.all(
|
|
||||||
body.refIds.map(async (v) => {
|
body.refIds.map(async (v) => {
|
||||||
const salary = await this.salaryProfileRepository.findOne({ where: { id: v.refId } });
|
const salary = await this.salaryProfileRepository.findOne({
|
||||||
if (salary != null) {
|
where: {
|
||||||
// 1) set status35 = DONE (ย้ายขึ้นมาทำก่อนเลย ไม่ต้องรอ org ตอบกลับ)
|
id: v.refId,
|
||||||
salary.status35 = "DONE";
|
},
|
||||||
salary.lastUpdateUserId = request.user.sub;
|
});
|
||||||
salary.lastUpdateFullName = request.user.name;
|
|
||||||
salary.lastUpdatedAt = new Date();
|
|
||||||
await this.salaryProfileRepository.save(salary, { data: request });
|
|
||||||
setLogDataDiff(request, { before: null, after: salary });
|
|
||||||
|
|
||||||
// 2) return ข้อมูลที่ org ต้องการสร้าง ProfileSalary (shape เดียวกับที่เคย PostData)
|
if (salary != null) {
|
||||||
return {
|
await new CallAPI()
|
||||||
|
.PostData(request, "/org/profile/salary/update", {
|
||||||
profileId: salary.profileId,
|
profileId: salary.profileId,
|
||||||
commandDateAffect: v.commandDateAffect,
|
commandDateAffect: v.commandDateAffect,
|
||||||
commandDateSign: v.commandDateSign,
|
commandDateSign: v.commandDateSign,
|
||||||
|
|
@ -9458,12 +9297,20 @@ async SalaryReportExcecute34(
|
||||||
commandName: v.commandName,
|
commandName: v.commandName,
|
||||||
commandNo: v.commandNo,
|
commandNo: v.commandNo,
|
||||||
commandYear: v.commandYear,
|
commandYear: v.commandYear,
|
||||||
};
|
})
|
||||||
|
.then(async () => {
|
||||||
|
const before = null;
|
||||||
|
salary.status35 = "DONE";
|
||||||
|
salary.lastUpdateUserId = request.user.sub;
|
||||||
|
salary.lastUpdateFullName = request.user.name;
|
||||||
|
salary.lastUpdatedAt = new Date();
|
||||||
|
await this.salaryProfileRepository.save(salary, { data: request });
|
||||||
|
setLogDataDiff(request, { before, after: salary });
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
return { result: result.filter(Boolean) };
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -9479,7 +9326,8 @@ async SalaryReportExcecute34(
|
||||||
body: {
|
body: {
|
||||||
refIds: {
|
refIds: {
|
||||||
refId: string;
|
refId: string;
|
||||||
commandDateAffect: Date | null;
|
// commandAffectDate: Date | null;//เก่า
|
||||||
|
commandDateAffect: Date | null; //ใหม่ (ปรับตาม rabbitMQ ORG)
|
||||||
commandDateSign?: Date | null;
|
commandDateSign?: Date | null;
|
||||||
commandNo: string | null;
|
commandNo: string | null;
|
||||||
commandYear: number | null;
|
commandYear: number | null;
|
||||||
|
|
@ -9499,81 +9347,17 @@ async SalaryReportExcecute34(
|
||||||
},
|
},
|
||||||
@Request() request: RequestWithUser,
|
@Request() request: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
// ═══════════════════════════════════════════════════════════════
|
await Promise.all(
|
||||||
// old circle flow (เก็บไว้อ้างอิง — ลบการใช้งานจริงออกแล้ว)
|
|
||||||
// ═══════════════════════════════════════════════════════════════
|
|
||||||
// await Promise.all(
|
|
||||||
// body.refIds.map(async (v) => {
|
|
||||||
// const salary = await this.salaryProfileEmployeeRepository.findOne({
|
|
||||||
// where: { id: v.refId },
|
|
||||||
// });
|
|
||||||
// if (salary != null) {
|
|
||||||
// await new CallAPI()
|
|
||||||
// .PostData(request, "/org/profile-employee/salary/update", {
|
|
||||||
// profileEmployeeId: salary.profileId,
|
|
||||||
// commandDateAffect: v.commandDateAffect,
|
|
||||||
// commandDateSign: v.commandDateSign,
|
|
||||||
// amount: v.amount,
|
|
||||||
// amountSpecial: v.amountSpecial,
|
|
||||||
// positionSalaryAmount: v.positionSalaryAmount,
|
|
||||||
// mouthSalaryAmount: v.mouthSalaryAmount,
|
|
||||||
// posNo: salary.posMasterNo != null ? salary.posMasterNo.toString() : null,
|
|
||||||
// posNoAbb: salary.orgShortName,
|
|
||||||
// positionName: salary.position,
|
|
||||||
// positionType: salary.posType,
|
|
||||||
// positionLevel:
|
|
||||||
// (salary.posTypeShort != null ? salary.posTypeShort + " " : "") +
|
|
||||||
// (salary.posLevel != null ? salary.posLevel.toString() : ""),
|
|
||||||
// remark: v.remark,
|
|
||||||
// orgRoot: salary.root,
|
|
||||||
// orgChild1: salary.child1,
|
|
||||||
// orgChild2: salary.child2,
|
|
||||||
// orgChild3: salary.child3,
|
|
||||||
// orgChild4: salary.child4,
|
|
||||||
// commandCode: v.commandCode,
|
|
||||||
// commandName: v.commandName,
|
|
||||||
// commandNo: v.commandNo,
|
|
||||||
// commandYear: v.commandYear,
|
|
||||||
// commandId: v.commandId,
|
|
||||||
// salaryLevel:
|
|
||||||
// salary.salaryLevel && salary.salaryLevelNew
|
|
||||||
// ? salary.salaryLevelNew
|
|
||||||
// : salary.salaryLevel,
|
|
||||||
// group: salary.groupNew ?? salary.group,
|
|
||||||
// })
|
|
||||||
// .then(async () => {
|
|
||||||
// const before = null;
|
|
||||||
// salary.status36 = "DONE";
|
|
||||||
// salary.lastUpdateUserId = request.user.sub;
|
|
||||||
// salary.lastUpdateFullName = request.user.name;
|
|
||||||
// salary.lastUpdatedAt = new Date();
|
|
||||||
// await this.salaryProfileEmployeeRepository.save(salary, { data: request });
|
|
||||||
// setLogDataDiff(request, { before, after: salary });
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }),
|
|
||||||
// );
|
|
||||||
// return new HttpSuccess();
|
|
||||||
|
|
||||||
// ═══════════════════════════════════════════════════════════════
|
|
||||||
// new linear flow
|
|
||||||
// ═══════════════════════════════════════════════════════════════
|
|
||||||
// ใช้ร่วมกับ C-PM-46 (path reuse) — ทั้ง C-PM-36/46 ยิงเข้าที่นี่ ตั้ง status36 เหมือนกัน
|
|
||||||
const result = await Promise.all(
|
|
||||||
body.refIds.map(async (v) => {
|
body.refIds.map(async (v) => {
|
||||||
const salary = await this.salaryProfileEmployeeRepository.findOne({ where: { id: v.refId } });
|
const salary = await this.salaryProfileEmployeeRepository.findOne({
|
||||||
if (salary != null) {
|
where: {
|
||||||
// 1) set status36 = DONE (ย้ายขึ้นมาทำก่อนเลย ไม่ต้องรอ org ตอบกลับ)
|
id: v.refId,
|
||||||
salary.status36 = "DONE";
|
},
|
||||||
salary.lastUpdateUserId = request.user.sub;
|
});
|
||||||
salary.lastUpdateFullName = request.user.name;
|
|
||||||
salary.lastUpdatedAt = new Date();
|
|
||||||
await this.salaryProfileEmployeeRepository.save(salary, { data: request });
|
|
||||||
setLogDataDiff(request, { before: null, after: salary });
|
|
||||||
|
|
||||||
// 2) return ข้อมูลที่ org ต้องการสร้าง ProfileSalary (shape เดียวกับที่เคย PostData)
|
if (salary != null) {
|
||||||
// สังเกต: profileEmployeeId (ไม่ใช่ profileId) + salaryLevel/group เพิ่ม
|
await new CallAPI()
|
||||||
return {
|
.PostData(request, "/org/profile-employee/salary/update", {
|
||||||
profileEmployeeId: salary.profileId,
|
profileEmployeeId: salary.profileId,
|
||||||
commandDateAffect: v.commandDateAffect,
|
commandDateAffect: v.commandDateAffect,
|
||||||
commandDateSign: v.commandDateSign,
|
commandDateSign: v.commandDateSign,
|
||||||
|
|
@ -9600,14 +9384,24 @@ async SalaryReportExcecute34(
|
||||||
commandYear: v.commandYear,
|
commandYear: v.commandYear,
|
||||||
commandId: v.commandId,
|
commandId: v.commandId,
|
||||||
salaryLevel:
|
salaryLevel:
|
||||||
salary.salaryLevel && salary.salaryLevelNew ? salary.salaryLevelNew : salary.salaryLevel,
|
salary.salaryLevel && salary.salaryLevelNew
|
||||||
|
? salary.salaryLevelNew
|
||||||
|
: salary.salaryLevel,
|
||||||
group: salary.groupNew ?? salary.group,
|
group: salary.groupNew ?? salary.group,
|
||||||
};
|
})
|
||||||
|
.then(async () => {
|
||||||
|
const before = null;
|
||||||
|
salary.status36 = "DONE";
|
||||||
|
salary.lastUpdateUserId = request.user.sub;
|
||||||
|
salary.lastUpdateFullName = request.user.name;
|
||||||
|
salary.lastUpdatedAt = new Date();
|
||||||
|
await this.salaryProfileEmployeeRepository.save(salary, { data: request });
|
||||||
|
setLogDataDiff(request, { before, after: salary });
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
return { result: result.filter(Boolean) };
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -9623,7 +9417,8 @@ async SalaryReportExcecute34(
|
||||||
body: {
|
body: {
|
||||||
refIds: {
|
refIds: {
|
||||||
refId: string;
|
refId: string;
|
||||||
commandDateAffect: Date | null;
|
// commandAffectDate: Date | null;//เก่า
|
||||||
|
commandDateAffect: Date | null; //ใหม่ (ปรับตาม rabbitMQ ORG)
|
||||||
commandDateSign?: Date | null;
|
commandDateSign?: Date | null;
|
||||||
commandNo: string | null;
|
commandNo: string | null;
|
||||||
commandYear: number | null;
|
commandYear: number | null;
|
||||||
|
|
@ -9643,79 +9438,17 @@ async SalaryReportExcecute34(
|
||||||
},
|
},
|
||||||
@Request() request: RequestWithUser,
|
@Request() request: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
// ═══════════════════════════════════════════════════════════════
|
await Promise.all(
|
||||||
// old circle flow (เก็บไว้อ้างอิง — ลบการใช้งานจริงออกแล้ว)
|
|
||||||
// ═══════════════════════════════════════════════════════════════
|
|
||||||
// await Promise.all(
|
|
||||||
// body.refIds.map(async (v) => {
|
|
||||||
// const salary = await this.salaryProfileEmployeeRepository.findOne({
|
|
||||||
// where: { id: v.refId },
|
|
||||||
// });
|
|
||||||
// if (salary != null) {
|
|
||||||
// await new CallAPI()
|
|
||||||
// .PostData(request, "/org/profile-employee/salary/update", {
|
|
||||||
// profileEmployeeId: salary.profileId,
|
|
||||||
// commandDateAffect: v.commandDateAffect,
|
|
||||||
// commandDateSign: v.commandDateSign,
|
|
||||||
// amount: v.amount,
|
|
||||||
// amountSpecial: v.amountSpecial,
|
|
||||||
// positionSalaryAmount: v.positionSalaryAmount,
|
|
||||||
// mouthSalaryAmount: v.mouthSalaryAmount,
|
|
||||||
// posNo: salary.posMasterNo != null ? salary.posMasterNo.toString() : null,
|
|
||||||
// posNoAbb: salary.orgShortName,
|
|
||||||
// positionName: salary.position,
|
|
||||||
// positionType: salary.posType,
|
|
||||||
// positionLevel:
|
|
||||||
// (salary.posTypeShort != null ? salary.posTypeShort + " " : "") +
|
|
||||||
// (salary.posLevel != null ? salary.posLevel.toString() : ""),
|
|
||||||
// remark: v.remark,
|
|
||||||
// orgRoot: salary.root,
|
|
||||||
// orgChild1: salary.child1,
|
|
||||||
// orgChild2: salary.child2,
|
|
||||||
// orgChild3: salary.child3,
|
|
||||||
// orgChild4: salary.child4,
|
|
||||||
// commandCode: v.commandCode,
|
|
||||||
// commandName: v.commandName,
|
|
||||||
// commandNo: v.commandNo,
|
|
||||||
// commandYear: v.commandYear,
|
|
||||||
// commandId: v.commandId,
|
|
||||||
// salaryLevel:
|
|
||||||
// salary.salaryLevel && salary.salaryLevelNew
|
|
||||||
// ? salary.salaryLevelNew
|
|
||||||
// : salary.salaryLevel,
|
|
||||||
// group: salary.groupNew ?? salary.group,
|
|
||||||
// })
|
|
||||||
// .then(async () => {
|
|
||||||
// const before = null;
|
|
||||||
// salary.status37 = "DONE";
|
|
||||||
// salary.lastUpdateUserId = request.user.sub;
|
|
||||||
// salary.lastUpdateFullName = request.user.name;
|
|
||||||
// salary.lastUpdatedAt = new Date();
|
|
||||||
// await this.salaryProfileEmployeeRepository.save(salary, { data: request });
|
|
||||||
// setLogDataDiff(request, { before, after: salary });
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }),
|
|
||||||
// );
|
|
||||||
// return new HttpSuccess();
|
|
||||||
|
|
||||||
// ═══════════════════════════════════════════════════════════════
|
|
||||||
// new linear flow
|
|
||||||
// ═══════════════════════════════════════════════════════════════
|
|
||||||
const result = await Promise.all(
|
|
||||||
body.refIds.map(async (v) => {
|
body.refIds.map(async (v) => {
|
||||||
const salary = await this.salaryProfileEmployeeRepository.findOne({ where: { id: v.refId } });
|
const salary = await this.salaryProfileEmployeeRepository.findOne({
|
||||||
if (salary != null) {
|
where: {
|
||||||
// 1) set status37 = DONE (ย้ายขึ้นมาทำก่อนเลย ไม่ต้องรอ org ตอบกลับ)
|
id: v.refId,
|
||||||
salary.status37 = "DONE";
|
},
|
||||||
salary.lastUpdateUserId = request.user.sub;
|
});
|
||||||
salary.lastUpdateFullName = request.user.name;
|
|
||||||
salary.lastUpdatedAt = new Date();
|
|
||||||
await this.salaryProfileEmployeeRepository.save(salary, { data: request });
|
|
||||||
setLogDataDiff(request, { before: null, after: salary });
|
|
||||||
|
|
||||||
// 2) return ข้อมูลที่ org ต้องการสร้าง ProfileSalary (shape เดียวกับที่เคย PostData)
|
if (salary != null) {
|
||||||
return {
|
await new CallAPI()
|
||||||
|
.PostData(request, "/org/profile-employee/salary/update", {
|
||||||
profileEmployeeId: salary.profileId,
|
profileEmployeeId: salary.profileId,
|
||||||
commandDateAffect: v.commandDateAffect,
|
commandDateAffect: v.commandDateAffect,
|
||||||
commandDateSign: v.commandDateSign,
|
commandDateSign: v.commandDateSign,
|
||||||
|
|
@ -9742,14 +9475,24 @@ async SalaryReportExcecute34(
|
||||||
commandYear: v.commandYear,
|
commandYear: v.commandYear,
|
||||||
commandId: v.commandId,
|
commandId: v.commandId,
|
||||||
salaryLevel:
|
salaryLevel:
|
||||||
salary.salaryLevel && salary.salaryLevelNew ? salary.salaryLevelNew : salary.salaryLevel,
|
salary.salaryLevel && salary.salaryLevelNew
|
||||||
|
? salary.salaryLevelNew
|
||||||
|
: salary.salaryLevel,
|
||||||
group: salary.groupNew ?? salary.group,
|
group: salary.groupNew ?? salary.group,
|
||||||
};
|
})
|
||||||
|
.then(async () => {
|
||||||
|
const before = null;
|
||||||
|
salary.status37 = "DONE";
|
||||||
|
salary.lastUpdateUserId = request.user.sub;
|
||||||
|
salary.lastUpdateFullName = request.user.name;
|
||||||
|
salary.lastUpdatedAt = new Date();
|
||||||
|
await this.salaryProfileEmployeeRepository.save(salary, { data: request });
|
||||||
|
setLogDataDiff(request, { before, after: salary });
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
return { result: result.filter(Boolean) };
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -470,7 +470,7 @@ export class SalaryPeriodController extends Controller {
|
||||||
const Level = await this.posLevelRepository.findOne({
|
const Level = await this.posLevelRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
posTypeId: Type.id,
|
posTypeId: Type.id,
|
||||||
posLevelName: salaryProfile.posLevel?.split("/")[0],
|
posLevelName: salaryProfile.posLevel,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (!Level) {
|
if (!Level) {
|
||||||
|
|
@ -935,7 +935,7 @@ export class SalaryPeriodController extends Controller {
|
||||||
const Level = await this.posLevelRepository.findOne({
|
const Level = await this.posLevelRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
posTypeId: Type.id,
|
posTypeId: Type.id,
|
||||||
posLevelName: salaryProfile.posLevel?.split("/")[0],
|
posLevelName: salaryProfile.posLevel,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (!Level) {
|
if (!Level) {
|
||||||
|
|
@ -1272,7 +1272,7 @@ export class SalaryPeriodController extends Controller {
|
||||||
const Level = await this.posLevelRepository.findOne({
|
const Level = await this.posLevelRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
posTypeId: Type.id,
|
posTypeId: Type.id,
|
||||||
posLevelName: salaryProfile.posLevel?.split("/")[0],
|
posLevelName: salaryProfile.posLevel,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (!Level) {
|
if (!Level) {
|
||||||
|
|
@ -1981,7 +1981,7 @@ export class SalaryPeriodController extends Controller {
|
||||||
Level = await this.posLevelRepository.findOne({
|
Level = await this.posLevelRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
posTypeId: Type.id,
|
posTypeId: Type.id,
|
||||||
posLevelName: salaryProfile.posLevel?.split("/")[0],
|
posLevelName: salaryProfile.posLevel,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (!Level) {
|
if (!Level) {
|
||||||
|
|
@ -2474,7 +2474,7 @@ export class SalaryPeriodController extends Controller {
|
||||||
const posLevel = await this.posLevelRepository.findOne({
|
const posLevel = await this.posLevelRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
posTypeId: posType.id,
|
posTypeId: posType.id,
|
||||||
posLevelName: salaryProfile.posLevel?.split("/")[0],
|
posLevelName: salaryProfile.posLevel,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (!posLevel) {
|
if (!posLevel) {
|
||||||
|
|
|
||||||
|
|
@ -430,7 +430,7 @@ export class SalaryPeriodEmployeeController extends Controller {
|
||||||
const Level = await this.posLevelRepository.findOne({
|
const Level = await this.posLevelRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
posTypeId: Type.id,
|
posTypeId: Type.id,
|
||||||
posLevelName: salaryProfile.posLevel?.split("/")[0],
|
posLevelName: salaryProfile.posLevel,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (!Level) {
|
if (!Level) {
|
||||||
|
|
@ -750,7 +750,7 @@ export class SalaryPeriodEmployeeController extends Controller {
|
||||||
const Level = await this.posLevelRepository.findOne({
|
const Level = await this.posLevelRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
posTypeId: Type.id,
|
posTypeId: Type.id,
|
||||||
posLevelName: salaryProfile.posLevel?.split("/")[0],
|
posLevelName: salaryProfile.posLevel,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (!Level) {
|
if (!Level) {
|
||||||
|
|
@ -941,7 +941,7 @@ export class SalaryPeriodEmployeeController extends Controller {
|
||||||
const Level = await this.posLevelRepository.findOne({
|
const Level = await this.posLevelRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
posTypeId: Type.id,
|
posTypeId: Type.id,
|
||||||
posLevelName: salaryProfile.posLevel?.split("/")[0],
|
posLevelName: salaryProfile.posLevel,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (!Level) {
|
if (!Level) {
|
||||||
|
|
@ -1132,7 +1132,7 @@ export class SalaryPeriodEmployeeController extends Controller {
|
||||||
const Level = await this.posLevelRepository.findOne({
|
const Level = await this.posLevelRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
posTypeId: Type.id,
|
posTypeId: Type.id,
|
||||||
posLevelName: salaryProfile.posLevel?.split("/")[0],
|
posLevelName: salaryProfile.posLevel,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (!Level) {
|
if (!Level) {
|
||||||
|
|
@ -1597,7 +1597,7 @@ export class SalaryPeriodEmployeeController extends Controller {
|
||||||
const posLevel = await this.posLevelRepository.findOne({
|
const posLevel = await this.posLevelRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
posTypeId: posType.id,
|
posTypeId: posType.id,
|
||||||
posLevelName: salaryProfile.posLevel?.split("/")[0],
|
posLevelName: salaryProfile.posLevel,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (!posLevel) {
|
if (!posLevel) {
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,9 @@ enum EmployeePosLevelAuthoritys {
|
||||||
export class EmployeePosLevel extends EntityBase {
|
export class EmployeePosLevel extends EntityBase {
|
||||||
@Column({
|
@Column({
|
||||||
comment: "ชื่อระดับชั้นงาน",
|
comment: "ชื่อระดับชั้นงาน",
|
||||||
length: 255,
|
type: "int",
|
||||||
})
|
})
|
||||||
posLevelName: string;
|
posLevelName: number;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
comment: "ระดับของระดับชั้นงาน",
|
comment: "ระดับของระดับชั้นงาน",
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ export class SalaryProfileEmployee extends EntityBase {
|
||||||
comment: "ระดับตำแหน่ง",
|
comment: "ระดับตำแหน่ง",
|
||||||
default: null,
|
default: null,
|
||||||
})
|
})
|
||||||
posLevel: string;
|
posLevel: number;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
type: "double",
|
type: "double",
|
||||||
|
|
@ -482,7 +482,7 @@ export class CreateSalaryProfileEmployee {
|
||||||
posType: string | null;
|
posType: string | null;
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
posLevel: string | null;
|
posLevel: number | null;
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
group: number | null;
|
group: number | null;
|
||||||
|
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
||||||
|
|
||||||
export class UpdateTablePosLevelToString20260407112136 implements MigrationInterface {
|
|
||||||
name = 'UpdateTablePosLevelToString20260407112136'
|
|
||||||
|
|
||||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
||||||
await queryRunner.query(`ALTER TABLE \`salaryProfileEmployee\` CHANGE \`posLevel\` \`posLevel\` varchar(255) NULL COMMENT 'ระดับตำแหน่ง'`);
|
|
||||||
await queryRunner.query(`ALTER TABLE \`employeePosLevel\` CHANGE \`posLevelName\` \`posLevelName\` varchar(255) NOT NULL COMMENT 'ชื่อระดับชั้นงาน'`);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
||||||
await queryRunner.query(`ALTER TABLE \`salaryProfileEmployee\` CHANGE \`posLevel\` \`posLevel\` double NULL COMMENT 'ระดับตำแหน่ง'`);
|
|
||||||
await queryRunner.query(`ALTER TABLE \`employeePosLevel\` CHANGE \`posLevelName\` \`posLevelName\` int NOT NULL COMMENT 'ชื่อระดับชั้นงาน'`);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -16,26 +16,6 @@ const minio = new Client({
|
||||||
|
|
||||||
export default minio;
|
export default minio;
|
||||||
|
|
||||||
/**
|
|
||||||
* ตัดชื่อไฟล์ถ้ายาวเกิน limit
|
|
||||||
* @param fileName - ชื่อไฟล์เดิม
|
|
||||||
* @param maxLength - ความยาวสูงสุดของชื่อไฟล์ (default: 50 ตัวอักษร ไม่รวมนามสกุล)
|
|
||||||
* @returns ชื่อไฟล์ที่ตัดแล้ว
|
|
||||||
*/
|
|
||||||
export function truncateFileName(fileName: string, maxLength: number = 50): string {
|
|
||||||
const dot = fileName.lastIndexOf(".");
|
|
||||||
const name = dot !== -1 && !fileName.startsWith(".") ? fileName.slice(0, dot) : fileName;
|
|
||||||
const ext = dot !== -1 && !fileName.startsWith(".") ? fileName.slice(dot) : "";
|
|
||||||
|
|
||||||
if (name.length <= maxLength) {
|
|
||||||
return fileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ตัดชื่อและเติม "..." ตามด้วย 5 ตัวสุดท้ายของชื่อเดิม
|
|
||||||
const truncated = name.slice(0, maxLength - 8) + "..." + name.slice(-5);
|
|
||||||
return truncated + ext;
|
|
||||||
}
|
|
||||||
|
|
||||||
function exception(e: any): never {
|
function exception(e: any): never {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
throw new Error("เกิดข้อผิดพลาดกับระบบจัดการไฟล์");
|
throw new Error("เกิดข้อผิดพลาดกับระบบจัดการไฟล์");
|
||||||
|
|
@ -94,11 +74,6 @@ export async function s3DeleteFolder(path: string) {
|
||||||
export async function s3UploadFile(replace: boolean, ...pathname: string[]) {
|
export async function s3UploadFile(replace: boolean, ...pathname: string[]) {
|
||||||
if (!pathname.length) return;
|
if (!pathname.length) return;
|
||||||
|
|
||||||
// ตัดชื่อไฟล์ถ้ายาวเกิน
|
|
||||||
const originalFileName = pathname.at(-1) as string;
|
|
||||||
const truncatedFileName = truncateFileName(originalFileName);
|
|
||||||
pathname = [...pathname.slice(0, -1), truncatedFileName];
|
|
||||||
|
|
||||||
if (!replace) {
|
if (!replace) {
|
||||||
const list = await s3ListFile(...pathname.slice(0, -1)).catch(exception);
|
const list = await s3ListFile(...pathname.slice(0, -1)).catch(exception);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue