Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m2s

This commit is contained in:
harid 2025-12-12 18:32:22 +07:00
commit 161d5a904c
3 changed files with 51 additions and 2 deletions

View file

@ -649,6 +649,54 @@ export class CommandController extends Controller {
return new HttpSuccess();
}
/**
* API
*
* @summary API
*
* @param {string} id Id
*/
@Post("tab2/edit-salary")
async EditSalary(
@Body()
requestBody: {
id: string;
mouthSalaryAmount?: Double | null;
positionSalaryAmount?: Double | null;
amount?: Double | null;
amountSpecial?: Double | null;
remarkVertical?: string | null;
remarkHorizontal?: string | null;
}[],
@Request() request: RequestWithUser,
) {
await new permission().PermissionUpdate(request, "COMMAND");
if (!Array.isArray(requestBody)) {
throw new HttpError(HttpStatusCode.BAD_REQUEST, "รูปแบบข้อมูลไม่ถูกต้อง");
}
for (const item of requestBody) {
if (!item.id) continue;
const rec = await this.commandReciveRepository.findOne({
where: { id: item.id },
});
if (!rec) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลผู้ได้รับคำสั่ง");
}
const updated = Object.assign(rec, item);
updated.lastUpdateUserId = request.user.sub;
updated.lastUpdateFullName = request.user.name;
updated.lastUpdatedAt = new Date();
await this.commandReciveRepository.save(updated);
}
return new HttpSuccess();
}
/**
* API
*

View file

@ -53,6 +53,7 @@ export class CommandTypeController extends Controller {
"detailBody",
"detailFooter",
"subtitle",
"isSalary",
"isAttachment",
"isUploadAttachment",
"createdAt",

View file

@ -1030,7 +1030,7 @@ export class WorkflowController extends Controller {
: data.map((x: any) => ({
...x,
posExecutiveNameOrg:
x.posExecutiveName +
x.posExecutiveName ?? "" +
(x.orgChild4 ?? x.orgChild3 ?? x.orgChild2 ?? x.orgChild1 ?? x.orgRoot ?? ""),
}));
@ -1227,7 +1227,7 @@ export class WorkflowController extends Controller {
const processedData = data.map((x: any) => ({
...x,
posExecutiveNameOrg:
x.posExecutiveName +
x.posExecutiveName ?? "" +
(x.orgChild4 ?? x.orgChild3 ?? x.orgChild2 ?? x.orgChild1 ?? x.orgRoot ?? ""),
}));