เพิ่มตำแหน่งเจ้าหน้าที่
This commit is contained in:
parent
3b0d8c24a7
commit
6f11eecb8f
15 changed files with 771 additions and 33 deletions
|
|
@ -21,6 +21,10 @@ import HttpError from "../interfaces/http-error";
|
|||
import { Command } from "../entities/Command";
|
||||
import { Brackets } from "typeorm";
|
||||
import { CommandType } from "../entities/CommandType";
|
||||
import { CommandSend } from "../entities/CommandSend";
|
||||
import { Profile } from "../entities/Profile";
|
||||
import { RequestWithUser } from "../middlewares/user";
|
||||
import { OrgRevision } from "../entities/OrgRevision";
|
||||
|
||||
@Route("api/v1/org/command")
|
||||
@Tags("Command")
|
||||
|
|
@ -33,6 +37,9 @@ import { CommandType } from "../entities/CommandType";
|
|||
export class CommandController extends Controller {
|
||||
private commandRepository = AppDataSource.getRepository(Command);
|
||||
private commandTypeRepository = AppDataSource.getRepository(CommandType);
|
||||
private commandSendRepository = AppDataSource.getRepository(CommandSend);
|
||||
private profileRepository = AppDataSource.getRepository(Profile);
|
||||
private orgRevisionRepo = AppDataSource.getRepository(OrgRevision);
|
||||
|
||||
/**
|
||||
* API list รายการคำสั่ง
|
||||
|
|
@ -74,9 +81,14 @@ export class CommandController extends Controller {
|
|||
: `${status.trim().toLocaleUpperCase()}`,
|
||||
},
|
||||
)
|
||||
.andWhere(year != null && year != undefined && year != 0 ? "command.commandYear = :commandYear" : "1=1", {
|
||||
commandYear: year == null || year == undefined || year == 0 ? null : `${year}`,
|
||||
})
|
||||
.andWhere(
|
||||
year != null && year != undefined && year != 0
|
||||
? "command.commandYear = :commandYear"
|
||||
: "1=1",
|
||||
{
|
||||
commandYear: year == null || year == undefined || year == 0 ? null : `${year}`,
|
||||
},
|
||||
)
|
||||
.andWhere(
|
||||
commandTypeId != null && commandTypeId != undefined && commandTypeId != ""
|
||||
? "command.commandTypeId = :commandTypeId"
|
||||
|
|
@ -120,7 +132,7 @@ export class CommandController extends Controller {
|
|||
commandNo: string | null;
|
||||
commandYear: number | null;
|
||||
},
|
||||
@Request() request: { user: Record<string, any> },
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
const command = Object.assign(new Command(), requestBody);
|
||||
|
||||
|
|
@ -132,6 +144,7 @@ export class CommandController extends Controller {
|
|||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบประเภทคำสั่งนี้ในระบบ");
|
||||
}
|
||||
command.status = "DRAFT";
|
||||
command.issue = commandType.name;
|
||||
command.createdUserId = request.user.sub;
|
||||
command.createdFullName = request.user.name;
|
||||
command.createdAt = new Date();
|
||||
|
|
@ -153,21 +166,25 @@ export class CommandController extends Controller {
|
|||
async GetByIdTab1(@Path() id: string) {
|
||||
const command = await this.commandRepository.findOne({
|
||||
where: { id },
|
||||
select: [
|
||||
"id",
|
||||
"status",
|
||||
"commandNo",
|
||||
"commandYear",
|
||||
"issue",
|
||||
"detailHeader",
|
||||
"detailBody",
|
||||
"detailFooter",
|
||||
],
|
||||
relations: ["commandType", "commandType.commandTypeSys"],
|
||||
});
|
||||
if (!command) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลคำสั่งนี้");
|
||||
}
|
||||
return new HttpSuccess(command);
|
||||
|
||||
const _command = {
|
||||
id: command.id,
|
||||
status: command.status,
|
||||
commandNo: command.commandNo,
|
||||
commandYear: command.commandYear,
|
||||
issue: command.issue,
|
||||
detailHeader: command.detailHeader,
|
||||
detailBody: command.detailBody,
|
||||
detailFooter: command.detailFooter,
|
||||
commandTypeName: command.commandType?.name || null,
|
||||
commandSysId: command.commandType?.commandSysId || null,
|
||||
};
|
||||
return new HttpSuccess(_command);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -189,7 +206,7 @@ export class CommandController extends Controller {
|
|||
detailBody: string | null;
|
||||
detailFooter: string | null;
|
||||
},
|
||||
@Request() request: { user: Record<string, any> },
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
const command = await this.commandRepository.findOne({ where: { id: id } });
|
||||
if (!command) {
|
||||
|
|
@ -204,6 +221,166 @@ export class CommandController extends Controller {
|
|||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* API รายละเอียดรายการคำสั่ง tab3
|
||||
*
|
||||
* @summary API รายละเอียดรายการคำสั่ง tab3
|
||||
*
|
||||
* @param {string} id Id คำสั่ง
|
||||
*/
|
||||
@Get("tab3/{id}")
|
||||
async GetByIdTab3(@Path() id: string) {
|
||||
const command = await this.commandRepository.findOne({
|
||||
where: { id },
|
||||
relations: ["commandSends"],
|
||||
});
|
||||
if (!command) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลคำสั่งนี้");
|
||||
}
|
||||
|
||||
const _command = command.commandSends.map((item) => ({
|
||||
id: item.id,
|
||||
citizenId: item.citizenId,
|
||||
prefix: item.prefix,
|
||||
fristName: item.fristName,
|
||||
lastName: item.lastName,
|
||||
position: item.position,
|
||||
org: item.org,
|
||||
sendCC: item.sendCC,
|
||||
profileId: item.profileId,
|
||||
}));
|
||||
return new HttpSuccess(_command);
|
||||
}
|
||||
|
||||
/**
|
||||
* API แก้ไขรายการ body คำสั่ง Tab3
|
||||
*
|
||||
* @summary API แก้ไขรายการ body คำสั่ง Tab3
|
||||
*
|
||||
* @param {string} id Id คำสั่ง
|
||||
*/
|
||||
@Put("tab3-add/{id}")
|
||||
async PutTab3Add(
|
||||
@Path() id: string,
|
||||
@Body()
|
||||
requestBody: {
|
||||
profileId: string[];
|
||||
},
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
const command = await this.commandRepository.findOne({ where: { id: id } });
|
||||
if (!command) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลคำสั่งนี้");
|
||||
}
|
||||
let _null: any = null;
|
||||
|
||||
await Promise.all(
|
||||
requestBody.profileId.map(async (item) => {
|
||||
const commandSendCheck = await this.commandSendRepository.findOne({
|
||||
where: { profileId: item, commandId: command.id },
|
||||
});
|
||||
if (commandSendCheck) return;
|
||||
|
||||
let profile = await this.profileRepository.findOne({
|
||||
where: { id: item },
|
||||
relations: ["current_holders", "current_holders.orgRoot"],
|
||||
});
|
||||
if (!profile) return;
|
||||
|
||||
const findRevision = await this.orgRevisionRepo.findOne({
|
||||
where: { orgRevisionIsCurrent: true },
|
||||
});
|
||||
|
||||
const commandSend = new CommandSend();
|
||||
commandSend.citizenId = profile.citizenId;
|
||||
commandSend.prefix =
|
||||
profile.rank != null && profile.rank != "" ? profile.rank : profile.prefix;
|
||||
commandSend.fristName = profile.firstName;
|
||||
commandSend.lastName = profile.lastName;
|
||||
commandSend.position = profile.position;
|
||||
commandSend.org =
|
||||
profile.current_holders?.find((x) => x.orgRevisionId == findRevision?.id)?.orgRoot
|
||||
?.orgRootName || _null;
|
||||
commandSend.profileId = profile.id;
|
||||
commandSend.commandId = command.id;
|
||||
commandSend.createdUserId = request.user.sub;
|
||||
commandSend.createdFullName = request.user.name;
|
||||
commandSend.createdAt = new Date();
|
||||
commandSend.lastUpdateUserId = request.user.sub;
|
||||
commandSend.lastUpdateFullName = request.user.name;
|
||||
commandSend.lastUpdatedAt = new Date();
|
||||
await this.commandSendRepository.save(commandSend);
|
||||
}),
|
||||
);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* API แก้ไขรายการ body คำสั่ง Tab3
|
||||
*
|
||||
* @summary API แก้ไขรายการ body คำสั่ง Tab3
|
||||
*
|
||||
* @param {string} id Id คำสั่ง
|
||||
*/
|
||||
@Put("tab3/{id}")
|
||||
async PutTab3Update(
|
||||
@Path() id: string,
|
||||
@Body()
|
||||
requestBody: {
|
||||
commandSend: {
|
||||
id: string;
|
||||
sendCC: string;
|
||||
}[];
|
||||
},
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
const command = await this.commandRepository.findOne({ where: { id: id } });
|
||||
if (!command) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลคำสั่งนี้");
|
||||
}
|
||||
|
||||
await Promise.all(
|
||||
requestBody.commandSend.map(async (item) => {
|
||||
const commandSend = await this.commandSendRepository.findOne({
|
||||
where: { id: item.id },
|
||||
});
|
||||
if (!commandSend) return;
|
||||
|
||||
commandSend.sendCC = item.sendCC;
|
||||
commandSend.lastUpdateUserId = request.user.sub;
|
||||
commandSend.lastUpdateFullName = request.user.name;
|
||||
commandSend.lastUpdatedAt = new Date();
|
||||
await this.commandSendRepository.save(commandSend);
|
||||
}),
|
||||
);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* API แก้ไขรายการ body คำสั่ง Tab3
|
||||
*
|
||||
* @summary API แก้ไขรายการ body คำสั่ง Tab3
|
||||
*
|
||||
* @param {string} id Id คำสั่ง
|
||||
*/
|
||||
@Delete("tab3/{commandSendId}")
|
||||
async DeleteTab3Update(
|
||||
@Path() commandSendId: string,
|
||||
@Body()
|
||||
requestBody: { reason?: string | null },
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
const command = await this.commandSendRepository.findOne({ where: { id: commandSendId } });
|
||||
if (!command) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลผู้ได้รับสำเนาคำสั่ง");
|
||||
}
|
||||
|
||||
await this.commandSendRepository.delete(commandSendId);
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* API คัดลอก
|
||||
*
|
||||
|
|
@ -215,8 +392,8 @@ export class CommandController extends Controller {
|
|||
async PutCopy(
|
||||
@Path() id: string,
|
||||
@Body()
|
||||
requestBody: { commandNo?: string | null; commandYear?: string | null },
|
||||
@Request() request: { user: Record<string, any> },
|
||||
requestBody: { commandNo?: string | null; commandYear?: number | null },
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
const command = await this.commandRepository.findOne({ where: { id: id } });
|
||||
if (!command) {
|
||||
|
|
@ -246,7 +423,7 @@ export class CommandController extends Controller {
|
|||
@Path() id: string,
|
||||
@Body()
|
||||
requestBody: { reason?: string | null },
|
||||
@Request() request: { user: Record<string, any> },
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
const command = await this.commandRepository.findOne({ where: { id: id } });
|
||||
if (!command) {
|
||||
|
|
@ -260,6 +437,32 @@ export class CommandController extends Controller {
|
|||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* API ทำคำสั่งใหม่
|
||||
*
|
||||
* @summary API ทำคำสั่งใหม่
|
||||
*
|
||||
* @param {string} id Id คำสั่ง
|
||||
*/
|
||||
@Put("resume/{id}")
|
||||
async PutDraft(
|
||||
@Path() id: string,
|
||||
@Body()
|
||||
requestBody: { reason?: string | null },
|
||||
@Request() request: RequestWithUser,
|
||||
) {
|
||||
const command = await this.commandRepository.findOne({ where: { id: id } });
|
||||
if (!command) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลคำสั่งนี้");
|
||||
}
|
||||
command.status = "DRAFT";
|
||||
command.lastUpdateUserId = request.user.sub;
|
||||
command.lastUpdateFullName = request.user.name;
|
||||
command.lastUpdatedAt = new Date();
|
||||
await this.commandRepository.save(command);
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* API ลบรายการคำสั่ง
|
||||
*
|
||||
|
|
|
|||
144
src/controllers/CommandSysController.ts
Normal file
144
src/controllers/CommandSysController.ts
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
import {
|
||||
Controller,
|
||||
Post,
|
||||
Put,
|
||||
Delete,
|
||||
Route,
|
||||
Security,
|
||||
Tags,
|
||||
Body,
|
||||
Path,
|
||||
Request,
|
||||
SuccessResponse,
|
||||
Response,
|
||||
Get,
|
||||
} from "tsoa";
|
||||
import { AppDataSource } from "../database/data-source";
|
||||
import HttpSuccess from "../interfaces/http-success";
|
||||
import HttpStatusCode from "../interfaces/http-status";
|
||||
import HttpError from "../interfaces/http-error";
|
||||
import { CommandSys, CreateCommandSys, UpdateCommandSys } from "../entities/CommandSys";
|
||||
|
||||
@Route("api/v1/org/commandSys")
|
||||
@Tags("CommandSys")
|
||||
@Security("bearerAuth")
|
||||
@Response(
|
||||
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||||
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||||
)
|
||||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
||||
export class CommandSysController extends Controller {
|
||||
private commandSysRepository = AppDataSource.getRepository(CommandSys);
|
||||
|
||||
/**
|
||||
* API list รายการระบบคำสั่ง
|
||||
*
|
||||
* @summary ORG_058 - CRUD ระบบคำสั่ง (ADMIN) #62
|
||||
*
|
||||
*/
|
||||
@Get("list")
|
||||
async GetResult() {
|
||||
const _commandSys = await this.commandSysRepository.find({
|
||||
select: ["id", "sysName", "sysDescription", "createdAt", "lastUpdatedAt", "createdFullName", "lastUpdateFullName"],
|
||||
order: { id: "ASC" },
|
||||
});
|
||||
return new HttpSuccess(_commandSys);
|
||||
}
|
||||
|
||||
/**
|
||||
* API รายละเอียดรายการระบบคำสั่ง
|
||||
*
|
||||
* @summary ORG_058 - CRUD ระบบคำสั่ง (ADMIN) #62
|
||||
*
|
||||
* @param {string} id Id ระบบคำสั่ง
|
||||
*/
|
||||
@Get("{id}")
|
||||
async GetById(@Path() id: string) {
|
||||
const _commandSys = await this.commandSysRepository.findOne({
|
||||
where: { id },
|
||||
select: ["id", "sysName", "sysDescription"],
|
||||
});
|
||||
if (!_commandSys) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลระบบคำสั่งนี้");
|
||||
}
|
||||
|
||||
return new HttpSuccess(_commandSys);
|
||||
}
|
||||
|
||||
/**
|
||||
* API สร้างรายการ body ระบบคำสั่ง
|
||||
*
|
||||
* @summary ORG_058 - CRUD ระบบคำสั่ง (ADMIN) #62
|
||||
*
|
||||
*/
|
||||
@Post()
|
||||
async Post(
|
||||
@Body()
|
||||
requestBody: CreateCommandSys,
|
||||
@Request() request: { user: Record<string, any> },
|
||||
) {
|
||||
const _commandSys = Object.assign(new CommandSys(), requestBody);
|
||||
const checkName = await this.commandSysRepository.findOne({
|
||||
where: { id: requestBody.id,sysName: requestBody.sysName,sysDescription: requestBody.sysDescription },
|
||||
});
|
||||
|
||||
if (checkName) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ชื่อนี้มีอยู่ในระบบแล้ว");
|
||||
}
|
||||
|
||||
_commandSys.createdUserId = request.user.sub;
|
||||
_commandSys.createdFullName = request.user.name;
|
||||
_commandSys.lastUpdateUserId = request.user.sub;
|
||||
_commandSys.lastUpdateFullName = request.user.name;
|
||||
_commandSys.createdAt = new Date();
|
||||
_commandSys.lastUpdatedAt = new Date();
|
||||
await this.commandSysRepository.save(_commandSys);
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* API แก้ไขรายการ body ระบบคำสั่ง
|
||||
*
|
||||
* @summary ORG_058 - CRUD ระบบคำสั่ง (ADMIN) #62
|
||||
*
|
||||
* @param {string} id Id ระบบคำสั่ง
|
||||
*/
|
||||
@Put("{id}")
|
||||
async Put(
|
||||
@Path() id: string,
|
||||
@Body()
|
||||
requestBody: UpdateCommandSys,
|
||||
@Request() request: { user: Record<string, any> },
|
||||
) {
|
||||
const _commandSys = await this.commandSysRepository.findOne({ where: { id: id } });
|
||||
if (!_commandSys) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลระบบคำสั่งนี้");
|
||||
}
|
||||
|
||||
_commandSys.lastUpdateUserId = request.user.sub;
|
||||
_commandSys.lastUpdateFullName = request.user.name;
|
||||
_commandSys.lastUpdatedAt = new Date();
|
||||
this.commandSysRepository.merge(_commandSys, requestBody);
|
||||
await this.commandSysRepository.save(_commandSys);
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* API ลบรายการระบบคำสั่ง
|
||||
*
|
||||
* @summary ORG_058 - CRUD ระบบคำสั่ง (ADMIN) #62
|
||||
*
|
||||
* @param {string} id Id ระบบคำสั่ง
|
||||
*/
|
||||
@Delete("{id}")
|
||||
async Delete(@Path() id: string) {
|
||||
const _delCommandSys = await this.commandSysRepository.findOne({
|
||||
where: { id: id },
|
||||
});
|
||||
if (!_delCommandSys) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลระบบคำสั่งนี้");
|
||||
}
|
||||
await this.commandSysRepository.delete(_delCommandSys.id);
|
||||
return new HttpSuccess();
|
||||
}
|
||||
}
|
||||
|
|
@ -20,6 +20,7 @@ import HttpStatusCode from "../interfaces/http-status";
|
|||
import HttpError from "../interfaces/http-error";
|
||||
import { CommandType, CreateCommandType, UpdateCommandType } from "../entities/CommandType";
|
||||
import { Not } from "typeorm";
|
||||
import { CommandSys } from "../entities/CommandSys";
|
||||
|
||||
@Route("api/v1/org/commandType")
|
||||
@Tags("CommandType")
|
||||
|
|
@ -31,6 +32,7 @@ import { Not } from "typeorm";
|
|||
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
||||
export class CommandTypeController extends Controller {
|
||||
private commandTypeRepository = AppDataSource.getRepository(CommandType);
|
||||
private commandSysRepository = AppDataSource.getRepository(CommandSys);
|
||||
|
||||
/**
|
||||
* API list รายการประเภทคำสั่ง
|
||||
|
|
@ -45,7 +47,7 @@ export class CommandTypeController extends Controller {
|
|||
select: [
|
||||
"id",
|
||||
"name",
|
||||
"type",
|
||||
"commandSysId",
|
||||
"code",
|
||||
"detailHeader",
|
||||
"detailBody",
|
||||
|
|
@ -102,7 +104,7 @@ export class CommandTypeController extends Controller {
|
|||
select: [
|
||||
"id",
|
||||
"name",
|
||||
"type",
|
||||
"commandSysId",
|
||||
"code",
|
||||
"isActive",
|
||||
"detailHeader",
|
||||
|
|
@ -141,6 +143,14 @@ export class CommandTypeController extends Controller {
|
|||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ชื่อนี้มีอยู่ในระบบแล้ว");
|
||||
}
|
||||
|
||||
const checkNameSys = await this.commandSysRepository.findOne({
|
||||
where: { id: requestBody.commandSysId },
|
||||
});
|
||||
|
||||
if (checkNameSys) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ชื่อประเภทนี้มีอยู่ในระบบ");
|
||||
}
|
||||
|
||||
_commandType.createdUserId = request.user.sub;
|
||||
_commandType.createdFullName = request.user.name;
|
||||
_commandType.lastUpdateUserId = request.user.sub;
|
||||
|
|
@ -176,6 +186,14 @@ export class CommandTypeController extends Controller {
|
|||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ชื่อนี้มีอยู่ในระบบแล้ว");
|
||||
}
|
||||
|
||||
const checkNameSys = await this.commandSysRepository.findOne({
|
||||
where: { id: requestBody.commandSysId },
|
||||
});
|
||||
|
||||
if (checkNameSys) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ชื่อประเภทนี้มีอยู่ในระบบ");
|
||||
}
|
||||
|
||||
_commandType.lastUpdateUserId = request.user.sub;
|
||||
_commandType.lastUpdateFullName = request.user.name;
|
||||
_commandType.lastUpdatedAt = new Date();
|
||||
|
|
|
|||
|
|
@ -254,7 +254,9 @@ export class EmployeePositionController extends Controller {
|
|||
posMasterNoSuffix: posMaster.posMasterNoSuffix,
|
||||
reason: posMaster.reason,
|
||||
isOfficer: posMaster.isOfficer,
|
||||
isStaff: posMaster.isStaff,
|
||||
isDirector: posMaster.isDirector,
|
||||
positionSign: posMaster.positionSign,
|
||||
positions: positions.map((position) => ({
|
||||
id: position.id,
|
||||
positionName: position.positionName,
|
||||
|
|
@ -628,8 +630,11 @@ export class EmployeePositionController extends Controller {
|
|||
if (!posMaster) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลอัตรากำลัง");
|
||||
}
|
||||
let _null:any = null;
|
||||
posMaster.posMasterNo = requestBody.posMasterNo;
|
||||
posMaster.isDirector = requestBody.isDirector;
|
||||
posMaster.isStaff = requestBody.isStaff;
|
||||
posMaster.positionSign = requestBody.positionSign == null ? _null : requestBody.positionSign;
|
||||
posMaster.isOfficer = requestBody.isOfficer;
|
||||
posMaster.posMasterNoPrefix = requestBody.posMasterNoPrefix;
|
||||
posMaster.posMasterNoSuffix = requestBody.posMasterNoSuffix;
|
||||
|
|
|
|||
|
|
@ -821,8 +821,11 @@ export class PositionController extends Controller {
|
|||
if (!posMaster) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลอัตรากำลัง");
|
||||
}
|
||||
let _null:any = null;
|
||||
posMaster.isDirector = requestBody.isDirector;
|
||||
posMaster.isStaff = requestBody.isStaff;
|
||||
posMaster.isOfficer = requestBody.isOfficer;
|
||||
posMaster.positionSign = requestBody.positionSign == null ? _null : requestBody.positionSign;
|
||||
posMaster.posMasterNo = requestBody.posMasterNo;
|
||||
posMaster.posMasterNoPrefix = requestBody.posMasterNoPrefix;
|
||||
posMaster.posMasterNoSuffix = requestBody.posMasterNoSuffix;
|
||||
|
|
@ -978,7 +981,9 @@ export class PositionController extends Controller {
|
|||
position.positionArea = x.posDictArea;
|
||||
position.isSpecial = x.isSpecial;
|
||||
position.isOfficer = x.isOfficer;
|
||||
position.isStaff = x.isStaff;
|
||||
position.isDirector = x.isDirector;
|
||||
position.positionSign = x.positionSign;
|
||||
position.positionIsSelected = x.positionIsSelected;
|
||||
position.posMasterId = posMaster.id;
|
||||
position.createdUserId = request.user.sub;
|
||||
|
|
@ -1019,7 +1024,9 @@ export class PositionController extends Controller {
|
|||
posMasterNoSuffix: posMaster.posMasterNoSuffix,
|
||||
reason: posMaster.reason,
|
||||
isOfficer: posMaster.isOfficer,
|
||||
isStaff: posMaster.isStaff,
|
||||
isDirector: posMaster.isDirector,
|
||||
positionSign: posMaster.positionSign,
|
||||
positions: positions.map((position) => ({
|
||||
id: position.id,
|
||||
positionName: position.positionName,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue