add api บรรจุสอบ
This commit is contained in:
parent
5207572da1
commit
ec052d8997
2 changed files with 54 additions and 1 deletions
|
|
@ -3198,7 +3198,8 @@ export class PositionController extends Controller {
|
|||
},
|
||||
) {
|
||||
let typeCondition: any = {};
|
||||
let conditionA = "positions.posTypeId LIKE :posType AND positions.posLevelId LIKE :posLevel";
|
||||
let conditionA =
|
||||
"positions.posTypeId LIKE :posType AND positions.posLevelId LIKE :posLevel AND positions.positionName LIKE :position";
|
||||
|
||||
let posType = await this.posTypeRepository.findOne({
|
||||
where: { id: String(body.posType) },
|
||||
|
|
@ -3305,6 +3306,7 @@ export class PositionController extends Controller {
|
|||
qb.andWhere(typeCondition).andWhere(conditionA == null ? "1=1" : conditionA, {
|
||||
posType: posType == null ? `%%` : `${posType.id}`,
|
||||
posLevel: posLevel == null ? `%%` : `${posLevel.id}`,
|
||||
position: body.position == null ? `%%` : `${body.position}`,
|
||||
});
|
||||
}),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -3583,6 +3583,57 @@ export class ProfileController extends Controller {
|
|||
}
|
||||
return new HttpSuccess(_profile);
|
||||
}
|
||||
/**
|
||||
* API ข้อมูลทะเบียนประวัติตาม keycloak
|
||||
*
|
||||
* @summary ORG_065 - ข้อมูลทะเบียนประวัติตาม keycloak (ADMIN) #70
|
||||
*
|
||||
*/
|
||||
@Get("keycloak/position-act")
|
||||
async getProfileByKeycloakAct(
|
||||
@Request() request: { user: Record<string, any> },
|
||||
@Query("revisionId") revisionId?: string,
|
||||
) {
|
||||
if (!revisionId) {
|
||||
let orgRevisionPublish = await this.orgRevisionRepo
|
||||
.createQueryBuilder("orgRevision")
|
||||
.where("orgRevision.orgRevisionIsDraft = false")
|
||||
.andWhere("orgRevision.orgRevisionIsCurrent = true")
|
||||
.getOne();
|
||||
if (!orgRevisionPublish) {
|
||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบแบบร่างโครงสร้าง");
|
||||
}
|
||||
revisionId = orgRevisionPublish.id;
|
||||
}
|
||||
const posMasters = await this.posMasterRepo.findOne({
|
||||
where: {
|
||||
posMasterAssigns: { assignId: "SYS_PLACEMENT_PASS" },
|
||||
current_holder: {
|
||||
keycloak: request.user.sub,
|
||||
},
|
||||
orgRevisionId: revisionId,
|
||||
},
|
||||
relations: ["orgChild1"],
|
||||
});
|
||||
if (posMasters == null || posMasters.orgChild1 == null) {
|
||||
return new HttpSuccess({
|
||||
isOfficer: null,
|
||||
rootId: null,
|
||||
child1Id: null,
|
||||
child2Id: null,
|
||||
child3Id: null,
|
||||
child4Id: null,
|
||||
});
|
||||
}
|
||||
return new HttpSuccess({
|
||||
isOfficer: posMasters?.orgChild1?.isOfficer || null,
|
||||
rootId: posMasters?.orgRootId || null,
|
||||
child1Id: posMasters?.orgChild1Id || null,
|
||||
child2Id: posMasters?.orgChild2Id || null,
|
||||
child3Id: posMasters?.orgChild3Id || null,
|
||||
child4Id: posMasters?.orgChild4Id || null,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* API เช็ค สกจ
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue