Merge branch 'develop' into adiDev
This commit is contained in:
commit
ebcd94a701
20 changed files with 134 additions and 42 deletions
|
|
@ -78,6 +78,7 @@ async function main() {
|
||||||
const profileSalaryController = new ProfileSalaryController();
|
const profileSalaryController = new ProfileSalaryController();
|
||||||
await profileSalaryController.cronjobTenurePositionOfficer();
|
await profileSalaryController.cronjobTenurePositionOfficer();
|
||||||
await profileSalaryController.cronjobTenureLevelOfficer();
|
await profileSalaryController.cronjobTenureLevelOfficer();
|
||||||
|
await profileSalaryController.cronjobTenureExecutivePositionOfficer();
|
||||||
await profileSalaryController.cronjobTenurePositionEmployee();
|
await profileSalaryController.cronjobTenurePositionEmployee();
|
||||||
await profileSalaryController.cronjobTenureLevelEmployee();
|
await profileSalaryController.cronjobTenureLevelEmployee();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
||||||
|
|
@ -2213,7 +2213,6 @@ export class CommandController extends Controller {
|
||||||
commandRecive.remarkVertical = item.remarkVertical == null ? _null : item.remarkVertical;
|
commandRecive.remarkVertical = item.remarkVertical == null ? _null : item.remarkVertical;
|
||||||
commandRecive.remarkHorizontal =
|
commandRecive.remarkHorizontal =
|
||||||
item.remarkHorizontal == null ? _null : item.remarkHorizontal;
|
item.remarkHorizontal == null ? _null : item.remarkHorizontal;
|
||||||
commandRecive.order = order;
|
|
||||||
commandRecive.commandId = command.id;
|
commandRecive.commandId = command.id;
|
||||||
commandRecive.createdUserId = request.user.sub;
|
commandRecive.createdUserId = request.user.sub;
|
||||||
commandRecive.createdFullName = request.user.name;
|
commandRecive.createdFullName = request.user.name;
|
||||||
|
|
@ -2659,7 +2658,7 @@ export class CommandController extends Controller {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (["C-PM-10"].includes(commandCode)) {
|
if (["C-PM-10", "C-PM-40"].includes(commandCode)) {
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
requestBody.persons.map(async (item: any) => {
|
requestBody.persons.map(async (item: any) => {
|
||||||
const _posMasterDirector = await this.posMasterRepository.findOne({
|
const _posMasterDirector = await this.posMasterRepository.findOne({
|
||||||
|
|
@ -6358,8 +6357,8 @@ export class CommandController extends Controller {
|
||||||
? Extension.ToThaiShortDate(item.CommandExcecuteDate)
|
? Extension.ToThaiShortDate(item.CommandExcecuteDate)
|
||||||
: "-",
|
: "-",
|
||||||
dateEnd: "-",
|
dateEnd: "-",
|
||||||
RemarkVertical: item.RemarkVertical,
|
RemarkVertical: item.RemarkVertical ? Extension.ToThaiNumber(item.RemarkVertical) : "-",
|
||||||
RemarkHorizontal: item.RemarkHorizontal,
|
RemarkHorizontal: item.RemarkHorizontal ? Extension.ToThaiNumber(item.RemarkHorizontal) : "-",
|
||||||
order:
|
order:
|
||||||
posMasterAct.posMasterOrder == null
|
posMasterAct.posMasterOrder == null
|
||||||
? "-"
|
? "-"
|
||||||
|
|
|
||||||
|
|
@ -408,13 +408,13 @@ export class PosMasterActController extends Controller {
|
||||||
let conditionGroup = "";
|
let conditionGroup = "";
|
||||||
if (body.type.trim().toUpperCase() == "GROUP1.1") {
|
if (body.type.trim().toUpperCase() == "GROUP1.1") {
|
||||||
conditionGroup =
|
conditionGroup =
|
||||||
"(posType.posTypeName = 'ทั่วไป' AND posLevel.posLevelName = 'ชำนาญงาน') OR (posType.posTypeName = 'ทั่วไป' AND posLevel.posLevelName = 'ปฏิบัติงาน') OR (posType.posTypeName = 'วิชาการ' AND posLevel.posLevelName = 'ปฏิบัติการ') OR (posType.posTypeName = 'วิชาการ' AND posLevel.posLevelName = 'ชำนาญการ')";
|
"(posTypeAct.posTypeName = 'ทั่วไป' AND posLevelAct.posLevelName = 'ชำนาญงาน') OR (posTypeAct.posTypeName = 'ทั่วไป' AND posLevelAct.posLevelName = 'ปฏิบัติงาน') OR (posTypeAct.posTypeName = 'วิชาการ' AND posLevelAct.posLevelName = 'ปฏิบัติการ') OR (posTypeAct.posTypeName = 'วิชาการ' AND posLevelAct.posLevelName = 'ชำนาญการ')";
|
||||||
} else if (body.type.trim().toUpperCase() == "GROUP1.2") {
|
} else if (body.type.trim().toUpperCase() == "GROUP1.2") {
|
||||||
conditionGroup =
|
conditionGroup =
|
||||||
"(posType.posTypeName = 'ทั่วไป' AND posLevel.posLevelName = 'อาวุโส') OR (posType.posTypeName = 'วิชาการ' AND posLevel.posLevelName = 'ชำนาญการพิเศษ') OR (posType.posTypeName = 'อำนวยการ' AND posLevel.posLevelName = 'ต้น')";
|
"(posTypeAct.posTypeName = 'ทั่วไป' AND posLevelAct.posLevelName = 'อาวุโส') OR (posTypeAct.posTypeName = 'วิชาการ' AND posLevelAct.posLevelName = 'ชำนาญการพิเศษ') OR (posTypeAct.posTypeName = 'อำนวยการ' AND posLevelAct.posLevelName = 'ต้น')";
|
||||||
} else if (body.type.trim().toUpperCase() == "GROUP2") {
|
} else if (body.type.trim().toUpperCase() == "GROUP2") {
|
||||||
conditionGroup =
|
conditionGroup =
|
||||||
"(posType.posTypeName = 'ทั่วไป' AND posLevel.posLevelName = 'ทักษะพิเศษ') OR (posType.posTypeName = 'วิชาการ' AND posLevel.posLevelName = 'เชี่ยวชาญ') OR (posType.posTypeName = 'วิชาการ' AND posLevel.posLevelName = 'ทรงคุณวุฒิ') OR (posType.posTypeName = 'อำนวยการ' AND posLevel.posLevelName = 'สูง') OR (posType.posTypeName = 'บริหาร' AND posLevel.posLevelName = 'ต้น') OR (posType.posTypeName = 'บริหาร' AND posLevel.posLevelName = 'สูง')";
|
"(posTypeAct.posTypeName = 'ทั่วไป' AND posLevelAct.posLevelName = 'ทักษะพิเศษ') OR (posTypeAct.posTypeName = 'วิชาการ' AND posLevelAct.posLevelName = 'เชี่ยวชาญ') OR (posTypeAct.posTypeName = 'วิชาการ' AND posLevelAct.posLevelName = 'ทรงคุณวุฒิ') OR (posTypeAct.posTypeName = 'อำนวยการ' AND posLevelAct.posLevelName = 'สูง') OR (posTypeAct.posTypeName = 'บริหาร' AND posLevelAct.posLevelName = 'ต้น') OR (posTypeAct.posTypeName = 'บริหาร' AND posLevelAct.posLevelName = 'สูง')";
|
||||||
} else {
|
} else {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "กลุ่มเป้าหมายไม่ถูกต้อง");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "กลุ่มเป้าหมายไม่ถูกต้อง");
|
||||||
}
|
}
|
||||||
|
|
@ -431,6 +431,10 @@ export class PosMasterActController extends Controller {
|
||||||
.leftJoinAndSelect("posMasterChild.positions", "positions")
|
.leftJoinAndSelect("posMasterChild.positions", "positions")
|
||||||
.leftJoinAndSelect("positions.posType", "posType")
|
.leftJoinAndSelect("positions.posType", "posType")
|
||||||
.leftJoinAndSelect("positions.posLevel", "posLevel")
|
.leftJoinAndSelect("positions.posLevel", "posLevel")
|
||||||
|
.leftJoinAndSelect("posMasterAct.posMaster", "posMaster")
|
||||||
|
.leftJoinAndSelect("posMaster.positions", "positionActs")
|
||||||
|
.leftJoinAndSelect("positionActs.posType", "posTypeAct")
|
||||||
|
.leftJoinAndSelect("positionActs.posLevel", "posLevelAct")
|
||||||
.leftJoinAndSelect("posMasterChild.orgRevision", "orgRevision")
|
.leftJoinAndSelect("posMasterChild.orgRevision", "orgRevision")
|
||||||
.andWhere("posMasterChild.orgRootId LIKE :orgRootId", {
|
.andWhere("posMasterChild.orgRootId LIKE :orgRootId", {
|
||||||
orgRootId: body.type.trim().toUpperCase() == "GROUP1.1" ? body.rootId : `%%`,
|
orgRootId: body.type.trim().toUpperCase() == "GROUP1.1" ? body.rootId : `%%`,
|
||||||
|
|
@ -444,12 +448,13 @@ export class PosMasterActController extends Controller {
|
||||||
orgRevisionIsDraft: false,
|
orgRevisionIsDraft: false,
|
||||||
})
|
})
|
||||||
.andWhere("positions.positionIsSelected = :isSelected", { isSelected: true })
|
.andWhere("positions.positionIsSelected = :isSelected", { isSelected: true })
|
||||||
|
.andWhere("positionActs.positionIsSelected = :isSelected", { isSelected: true })
|
||||||
.andWhere(
|
.andWhere(
|
||||||
new Brackets((qb) => {
|
new Brackets((qb) => {
|
||||||
qb.andWhere(conditionGroup);
|
qb.andWhere(conditionGroup);
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.orderBy("posMasterChild.posMasterOrder", "ASC")
|
.orderBy("posMasterAct.posMasterOrder", "ASC")
|
||||||
.select([
|
.select([
|
||||||
"posMasterAct.id",
|
"posMasterAct.id",
|
||||||
"posMasterChild.posMasterNo",
|
"posMasterChild.posMasterNo",
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,11 @@ import { TenurePositionOfficer } from "../entities/TenurePositionOfficer";
|
||||||
import { TenureLevelOfficer } from "../entities/TenureLevelOfficer";
|
import { TenureLevelOfficer } from "../entities/TenureLevelOfficer";
|
||||||
import { TenurePositionEmployee } from "../entities/TenurePositionEmployee";
|
import { TenurePositionEmployee } from "../entities/TenurePositionEmployee";
|
||||||
import { TenureLevelEmployee } from "../entities/TenureLevelEmployee";
|
import { TenureLevelEmployee } from "../entities/TenureLevelEmployee";
|
||||||
|
import { TenurePositionExecutiveOfficer } from "../entities/TenurePositionExecutiveOfficer";
|
||||||
import { Command } from "../entities/Command";
|
import { Command } from "../entities/Command";
|
||||||
import { OrgRoot } from "../entities/OrgRoot";
|
import { OrgRoot } from "../entities/OrgRoot";
|
||||||
|
import { OrgRevision } from "../entities/OrgRevision";
|
||||||
|
import { Position } from "../entities/Position";
|
||||||
@Route("api/v1/org/profile/salary")
|
@Route("api/v1/org/profile/salary")
|
||||||
@Tags("ProfileSalary")
|
@Tags("ProfileSalary")
|
||||||
@Security("bearerAuth")
|
@Security("bearerAuth")
|
||||||
|
|
@ -41,8 +44,11 @@ export class ProfileSalaryController extends Controller {
|
||||||
private positionEmployeeRepo = AppDataSource.getRepository(TenurePositionEmployee);
|
private positionEmployeeRepo = AppDataSource.getRepository(TenurePositionEmployee);
|
||||||
private levelOfficerRepo = AppDataSource.getRepository(TenureLevelOfficer);
|
private levelOfficerRepo = AppDataSource.getRepository(TenureLevelOfficer);
|
||||||
private levelEmployeeRepo = AppDataSource.getRepository(TenureLevelEmployee);
|
private levelEmployeeRepo = AppDataSource.getRepository(TenureLevelEmployee);
|
||||||
|
private positionExecutiveOfficerRepo = AppDataSource.getRepository(TenurePositionExecutiveOfficer);
|
||||||
private commandRepository = AppDataSource.getRepository(Command);
|
private commandRepository = AppDataSource.getRepository(Command);
|
||||||
private orgRootRepository = AppDataSource.getRepository(OrgRoot);
|
private orgRootRepository = AppDataSource.getRepository(OrgRoot);
|
||||||
|
private orgRevisionRepository = AppDataSource.getRepository(OrgRevision);
|
||||||
|
private positionRepo = AppDataSource.getRepository(Position);
|
||||||
|
|
||||||
@Get("TenurePositionOfficer")
|
@Get("TenurePositionOfficer")
|
||||||
public async cronjobTenurePositionOfficer() {
|
public async cronjobTenurePositionOfficer() {
|
||||||
|
|
@ -229,6 +235,64 @@ export class ProfileSalaryController extends Controller {
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get("TenurePositionExecutiveOfficer")
|
||||||
|
public async cronjobTenureExecutivePositionOfficer() {
|
||||||
|
await this.positionExecutiveOfficerRepo.clear();
|
||||||
|
const profile = await this.profileRepo.find();
|
||||||
|
const orgRevision = await this.orgRevisionRepository.findOne({
|
||||||
|
select: ["id"],
|
||||||
|
where: {
|
||||||
|
orgRevisionIsDraft: false,
|
||||||
|
orgRevisionIsCurrent: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
for await (const x of profile) {
|
||||||
|
const position = await this.positionRepo.findOne({
|
||||||
|
where: {
|
||||||
|
positionIsSelected: true,
|
||||||
|
posMaster: {
|
||||||
|
orgRevisionId: orgRevision?.id,
|
||||||
|
current_holderId: x.id,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
order: { createdAt: "DESC" },
|
||||||
|
relations: {
|
||||||
|
posExecutive: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const positionExecutive = await AppDataSource.query("CALL GetProfileSalaryExecutive(?)", [x.id]);
|
||||||
|
const _position = positionExecutive.length > 0 ? positionExecutive[0] : [];
|
||||||
|
const mapPosition =
|
||||||
|
_position.length > 1
|
||||||
|
? _position.slice(1).map((curr: any, index: number) => ({
|
||||||
|
days_diff: curr.days_diff,
|
||||||
|
positionExecutive: _position[index]?.positionExecutive,
|
||||||
|
}))
|
||||||
|
: [];
|
||||||
|
const _posExecutiveName = position?.posExecutive?.posExecutiveName;
|
||||||
|
const calDayDiff = mapPosition
|
||||||
|
.filter((curr: any) => _posExecutiveName && curr.positionExecutive == _posExecutiveName)
|
||||||
|
.reduce(
|
||||||
|
(acc: any, curr: any) => {
|
||||||
|
acc.days_diff += Number(curr.days_diff) || 0;
|
||||||
|
acc.positionExecutive = curr.positionExecutive;
|
||||||
|
return acc;
|
||||||
|
},
|
||||||
|
{ days_diff: 0, positionExecutive: null },
|
||||||
|
);
|
||||||
|
const mapData: any = {
|
||||||
|
profileId: x.id,
|
||||||
|
positionExecutiveName: calDayDiff.positionExecutive,
|
||||||
|
days_diff: calDayDiff.days_diff,
|
||||||
|
Years: (calDayDiff.days_diff / 365.2524).toFixed(4),
|
||||||
|
Months: ((calDayDiff.days_diff / 30.4375) % 12).toFixed(4),
|
||||||
|
Days: (calDayDiff.days_diff % 30.4375).toFixed(4),
|
||||||
|
};
|
||||||
|
await this.positionExecutiveOfficerRepo.save(mapData);
|
||||||
|
}
|
||||||
|
return new HttpSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
@Get("user")
|
@Get("user")
|
||||||
public async getSalaryUser(@Request() request: { user: Record<string, any> }) {
|
public async getSalaryUser(@Request() request: { user: Record<string, any> }) {
|
||||||
const profile = await this.profileRepo.findOneBy({ keycloak: request.user.sub });
|
const profile = await this.profileRepo.findOneBy({ keycloak: request.user.sub });
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@ export class ReportController extends Controller {
|
||||||
} else if (tenureType != "" && tenureType == "level") {
|
} else if (tenureType != "" && tenureType == "level") {
|
||||||
tenureTypeCondition = "registryOfficer.levelYears BETWEEN :tenureMin AND :tenureMax";
|
tenureTypeCondition = "registryOfficer.levelYears BETWEEN :tenureMin AND :tenureMax";
|
||||||
} else if (tenureType != "" && tenureType == "posExecutive") {
|
} else if (tenureType != "" && tenureType == "posExecutive") {
|
||||||
tenureTypeCondition = "registryOfficer.levelYears BETWEEN :tenureMin AND :tenureMax";
|
tenureTypeCondition = "registryOfficer.posExecutiveYears BETWEEN :tenureMin AND :tenureMax";
|
||||||
}
|
}
|
||||||
|
|
||||||
const [lists, total] = await AppDataSource.getRepository(viewRegistryOfficer)
|
const [lists, total] = await AppDataSource.getRepository(viewRegistryOfficer)
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ import { PosMasterAct } from "../entities/PosMasterAct";
|
||||||
import { viewDirectorActing } from "../entities/view/viewDirectorActing";
|
import { viewDirectorActing } from "../entities/view/viewDirectorActing";
|
||||||
import { viewDirector } from "../entities/view/viewDirector";
|
import { viewDirector } from "../entities/view/viewDirector";
|
||||||
import { ProfileEmployee } from "../entities/ProfileEmployee";
|
import { ProfileEmployee } from "../entities/ProfileEmployee";
|
||||||
|
import { EmployeePosMaster } from "../entities/EmployeePosMaster";
|
||||||
|
|
||||||
@Route("api/v1/org/workflow")
|
@Route("api/v1/org/workflow")
|
||||||
@Tags("Workflow")
|
@Tags("Workflow")
|
||||||
|
|
@ -38,6 +39,7 @@ export class WorkflowController extends Controller {
|
||||||
private metaStateRepo = AppDataSource.getRepository(MetaState);
|
private metaStateRepo = AppDataSource.getRepository(MetaState);
|
||||||
private metaStateOperatorRepo = AppDataSource.getRepository(MetaStateOperator);
|
private metaStateOperatorRepo = AppDataSource.getRepository(MetaStateOperator);
|
||||||
private posMasterRepo = AppDataSource.getRepository(PosMaster);
|
private posMasterRepo = AppDataSource.getRepository(PosMaster);
|
||||||
|
private posMasterEmpRepo = AppDataSource.getRepository(EmployeePosMaster);
|
||||||
private posMasterActRepo = AppDataSource.getRepository(PosMasterAct);
|
private posMasterActRepo = AppDataSource.getRepository(PosMasterAct);
|
||||||
private assignRepo = AppDataSource.getRepository(Assign);
|
private assignRepo = AppDataSource.getRepository(Assign);
|
||||||
|
|
||||||
|
|
@ -806,29 +808,51 @@ export class WorkflowController extends Controller {
|
||||||
page: number;
|
page: number;
|
||||||
pageSize: number;
|
pageSize: number;
|
||||||
keycloakId?: string | null;
|
keycloakId?: string | null;
|
||||||
|
type?: string | null;
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
let posMasterUser: PosMaster = new PosMaster();
|
let posMasterUser = null;
|
||||||
if (body.keycloakId) {
|
if (body.keycloakId) {
|
||||||
posMasterUser = (await this.posMasterRepo.findOne({
|
if (body.type == "employee") {
|
||||||
where: {
|
posMasterUser = await this.posMasterEmpRepo.findOne({
|
||||||
orgRevision: { orgRevisionIsCurrent: true, orgRevisionIsDraft: false },
|
where: {
|
||||||
current_holder: { keycloak: body.keycloakId },
|
orgRevision: { orgRevisionIsCurrent: true, orgRevisionIsDraft: false },
|
||||||
},
|
current_holder: { keycloak: body.keycloakId },
|
||||||
relations: ["current_holder", "current_holder.posType", "current_holder.posLevel"],
|
},
|
||||||
})) as PosMaster;
|
relations: ["current_holder", "current_holder.posType", "current_holder.posLevel"],
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
posMasterUser = await this.posMasterRepo.findOne({
|
||||||
|
where: {
|
||||||
|
orgRevision: { orgRevisionIsCurrent: true, orgRevisionIsDraft: false },
|
||||||
|
current_holder: { keycloak: body.keycloakId },
|
||||||
|
},
|
||||||
|
relations: ["current_holder", "current_holder.posType", "current_holder.posLevel"],
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
posMasterUser = (await this.posMasterRepo.findOne({
|
if (body.type == "employee") {
|
||||||
where: {
|
posMasterUser = await this.posMasterEmpRepo.findOne({
|
||||||
orgRevision: { orgRevisionIsCurrent: true, orgRevisionIsDraft: false },
|
where: {
|
||||||
current_holder: { keycloak: request.user.sub },
|
orgRevision: { orgRevisionIsCurrent: true, orgRevisionIsDraft: false },
|
||||||
},
|
current_holder: { keycloak: request.user.sub },
|
||||||
relations: ["current_holder", "current_holder.posType", "current_holder.posLevel"],
|
},
|
||||||
})) as PosMaster;
|
relations: ["current_holder", "current_holder.posType", "current_holder.posLevel"],
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
posMasterUser = await this.posMasterRepo.findOne({
|
||||||
|
where: {
|
||||||
|
orgRevision: { orgRevisionIsCurrent: true, orgRevisionIsDraft: false },
|
||||||
|
current_holder: { keycloak: request.user.sub },
|
||||||
|
},
|
||||||
|
relations: ["current_holder", "current_holder.posType", "current_holder.posLevel"],
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!posMasterUser || !posMasterUser.orgRootId)
|
if (!posMasterUser || !posMasterUser.orgRootId) {
|
||||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบตำแหน่งผู้ใช้งาน");
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบตำแหน่งผู้ใช้งาน");
|
||||||
|
}
|
||||||
|
|
||||||
let condition: any = [];
|
let condition: any = [];
|
||||||
|
|
||||||
|
|
@ -839,7 +863,7 @@ export class WorkflowController extends Controller {
|
||||||
orgChild1Id: IsNull(),
|
orgChild1Id: IsNull(),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (type.trim().toUpperCase() == "OPERATE") {
|
if (type.trim().toUpperCase() == "OPERATE" || body.type == "employee") {
|
||||||
condition.push({
|
condition.push({
|
||||||
isDirector: true,
|
isDirector: true,
|
||||||
orgRootId: posMasterUser.orgRootId,
|
orgRootId: posMasterUser.orgRootId,
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,6 @@ export class ProfileCertificate extends EntityBase {
|
||||||
isUpload: boolean;
|
isUpload: boolean;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
|
||||||
comment: "ข้อมูลจาก Entry",
|
comment: "ข้อมูลจาก Entry",
|
||||||
default: false,
|
default: false,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,6 @@ export class ProfileChangeName extends EntityBase {
|
||||||
profileEmployeeId: string;
|
profileEmployeeId: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
|
||||||
comment: "ข้อมูลจาก Entry",
|
comment: "ข้อมูลจาก Entry",
|
||||||
default: false,
|
default: false,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,6 @@ export class ProfileChildren extends EntityBase {
|
||||||
profileEmployeeId: string;
|
profileEmployeeId: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
|
||||||
comment: "ข้อมูลจาก Entry",
|
comment: "ข้อมูลจาก Entry",
|
||||||
default: false,
|
default: false,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,6 @@ export class ProfileDiscipline extends EntityBase {
|
||||||
isUpload: boolean;
|
isUpload: boolean;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
|
||||||
comment: "ข้อมูลจาก Entry",
|
comment: "ข้อมูลจาก Entry",
|
||||||
default: false,
|
default: false,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,6 @@ export class ProfileDuty extends EntityBase {
|
||||||
isUpload: boolean;
|
isUpload: boolean;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
|
||||||
comment: "ข้อมูลจาก Entry",
|
comment: "ข้อมูลจาก Entry",
|
||||||
default: false,
|
default: false,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,6 @@ export class ProfileEducation extends EntityBase {
|
||||||
level: number;
|
level: number;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
|
||||||
comment: "ข้อมูลจาก Entry",
|
comment: "ข้อมูลจาก Entry",
|
||||||
default: false,
|
default: false,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,6 @@ export class ProfileHonor extends EntityBase {
|
||||||
isUpload: boolean;
|
isUpload: boolean;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
|
||||||
comment: "ข้อมูลจาก Entry",
|
comment: "ข้อมูลจาก Entry",
|
||||||
default: false,
|
default: false,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,6 @@ export class ProfileInsignia extends EntityBase {
|
||||||
insigniaId: string;
|
insigniaId: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
|
||||||
comment: "ข้อมูลจาก Entry",
|
comment: "ข้อมูลจาก Entry",
|
||||||
default: false,
|
default: false,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,6 @@ export class ProfileLeave extends EntityBase {
|
||||||
leaveId: string;
|
leaveId: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
|
||||||
comment: "ข้อมูลจาก Entry",
|
comment: "ข้อมูลจาก Entry",
|
||||||
default: false,
|
default: false,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,6 @@ export class ProfileNopaid extends EntityBase {
|
||||||
isUpload: boolean;
|
isUpload: boolean;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
|
||||||
comment: "ข้อมูลจาก Entry",
|
comment: "ข้อมูลจาก Entry",
|
||||||
default: false,
|
default: false,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@ export class ProfileOther extends EntityBase {
|
||||||
date: Date;
|
date: Date;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
|
||||||
comment: "ข้อมูลจาก Entry",
|
comment: "ข้อมูลจาก Entry",
|
||||||
default: false,
|
default: false,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -226,9 +226,8 @@ export class ProfileSalary extends EntityBase {
|
||||||
isGovernment: boolean;
|
isGovernment: boolean;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: false,
|
|
||||||
comment: "ข้อมูลจาก Entry",
|
comment: "ข้อมูลจาก Entry",
|
||||||
default: null,
|
default: false,
|
||||||
})
|
})
|
||||||
isEntry: boolean;
|
isEntry: boolean;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -239,9 +239,8 @@ export class ProfileSalaryTemp extends EntityBase {
|
||||||
isGovernment: boolean;
|
isGovernment: boolean;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
|
||||||
comment: "ข้อมูลจาก Entry",
|
comment: "ข้อมูลจาก Entry",
|
||||||
default: null,
|
default: false,
|
||||||
})
|
})
|
||||||
isEntry: boolean;
|
isEntry: boolean;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,14 @@ import { ViewColumn, ViewEntity } from "typeorm";
|
||||||
vctlo.Days,
|
vctlo.Days,
|
||||||
vctlo.profileId
|
vctlo.profileId
|
||||||
FROM tenureLevelOfficer vctlo
|
FROM tenureLevelOfficer vctlo
|
||||||
|
),
|
||||||
|
PositionExecutiveDate AS (
|
||||||
|
SELECT
|
||||||
|
vcteo.Years,
|
||||||
|
vcteo.Months,
|
||||||
|
vcteo.Days,
|
||||||
|
vcteo.profileId
|
||||||
|
FROM tenurePositionExecutiveOfficer vcteo
|
||||||
)
|
)
|
||||||
SELECT
|
SELECT
|
||||||
p.id as profileId,
|
p.id as profileId,
|
||||||
|
|
@ -168,7 +176,10 @@ import { ViewColumn, ViewEntity } from "typeorm";
|
||||||
vcto.Days,
|
vcto.Days,
|
||||||
vctlo.Years AS levelYears,
|
vctlo.Years AS levelYears,
|
||||||
vctlo.Months AS levelMonths,
|
vctlo.Months AS levelMonths,
|
||||||
vctlo.Days AS levelDays
|
vctlo.Days AS levelDays,
|
||||||
|
vcteo.Years AS posExecutiveYears,
|
||||||
|
vcteo.Months AS posExecutiveMonths,
|
||||||
|
vcteo.Days AS posExecutiveDays
|
||||||
FROM profile p
|
FROM profile p
|
||||||
LEFT JOIN posLevel ON p.posLevelId = posLevel.id
|
LEFT JOIN posLevel ON p.posLevelId = posLevel.id
|
||||||
LEFT JOIN posType ON p.posTypeId = posType.id
|
LEFT JOIN posType ON p.posTypeId = posType.id
|
||||||
|
|
@ -179,6 +190,7 @@ import { ViewColumn, ViewEntity } from "typeorm";
|
||||||
LEFT JOIN Fields fies ON p.id = fies.profileId
|
LEFT JOIN Fields fies ON p.id = fies.profileId
|
||||||
LEFT JOIN PositionDate vcto ON p.id = vcto.profileId
|
LEFT JOIN PositionDate vcto ON p.id = vcto.profileId
|
||||||
LEFT JOIN PositionLevelDate vctlo ON p.id = vctlo.profileId
|
LEFT JOIN PositionLevelDate vctlo ON p.id = vctlo.profileId
|
||||||
|
LEFT JOIN PositionExecutiveDate vcteo ON p.id = vcteo.profileId
|
||||||
`,
|
`,
|
||||||
})
|
})
|
||||||
export class viewRegistryOfficer {
|
export class viewRegistryOfficer {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue