Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m2s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m2s
This commit is contained in:
commit
161d5a904c
3 changed files with 51 additions and 2 deletions
|
|
@ -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 ลบรายการผู้ได้รับคำสั่ง
|
||||
*
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ export class CommandTypeController extends Controller {
|
|||
"detailBody",
|
||||
"detailFooter",
|
||||
"subtitle",
|
||||
"isSalary",
|
||||
"isAttachment",
|
||||
"isUploadAttachment",
|
||||
"createdAt",
|
||||
|
|
|
|||
|
|
@ -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 ?? ""),
|
||||
}));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue