update #805
This commit is contained in:
parent
859c61aa99
commit
542df70eb7
3 changed files with 22 additions and 4 deletions
|
|
@ -126,6 +126,7 @@ export class PermissionOrgController extends Controller {
|
||||||
const findRevision = await this.orgRevisionRepository.findOne({
|
const findRevision = await this.orgRevisionRepository.findOne({
|
||||||
where: { orgRevisionIsCurrent: true, orgRevisionIsDraft: false },
|
where: { orgRevisionIsCurrent: true, orgRevisionIsDraft: false },
|
||||||
});
|
});
|
||||||
|
const orgRevisionId = findRevision?.id;
|
||||||
if (!findRevision) {
|
if (!findRevision) {
|
||||||
throw new HttpError(HttpStatus.NOT_FOUND, "not found. OrgRevision");
|
throw new HttpError(HttpStatus.NOT_FOUND, "not found. OrgRevision");
|
||||||
}
|
}
|
||||||
|
|
@ -138,16 +139,19 @@ export class PermissionOrgController extends Controller {
|
||||||
.leftJoinAndSelect("profile.current_holders", "current_holders")
|
.leftJoinAndSelect("profile.current_holders", "current_holders")
|
||||||
.leftJoinAndSelect("current_holders.positions", "positions")
|
.leftJoinAndSelect("current_holders.positions", "positions")
|
||||||
.leftJoinAndSelect("positions.posExecutive", "posExecutive")
|
.leftJoinAndSelect("positions.posExecutive", "posExecutive")
|
||||||
|
.leftJoinAndSelect("current_holders.orgRevision", "orgRevision")
|
||||||
.leftJoinAndSelect("current_holders.orgRoot", "orgRoot")
|
.leftJoinAndSelect("current_holders.orgRoot", "orgRoot")
|
||||||
.leftJoinAndSelect("current_holders.orgChild1", "orgChild1")
|
.leftJoinAndSelect("current_holders.orgChild1", "orgChild1")
|
||||||
.leftJoinAndSelect("current_holders.orgChild2", "orgChild2")
|
.leftJoinAndSelect("current_holders.orgChild2", "orgChild2")
|
||||||
.leftJoinAndSelect("current_holders.orgChild3", "orgChild3")
|
.leftJoinAndSelect("current_holders.orgChild3", "orgChild3")
|
||||||
.leftJoinAndSelect("current_holders.orgChild4", "orgChild4")
|
.leftJoinAndSelect("current_holders.orgChild4", "orgChild4")
|
||||||
|
.where("current_holders.orgRevisionId = :orgRevisionId", {orgRevisionId})
|
||||||
.andWhere(
|
.andWhere(
|
||||||
new Brackets((qb) => {
|
new Brackets((qb) => {
|
||||||
qb.andWhere(`current_holders.orgRevisionId = :orgRevisionId`, {
|
// qb.andWhere(`current_holders.orgRevision = :orgRevisionId`, {
|
||||||
orgRevisionId: findRevision.id,
|
// orgRevisionId: findRevision.id,
|
||||||
}).andWhere(
|
// })
|
||||||
|
qb.andWhere(
|
||||||
searchKeyword != undefined && searchKeyword != null && searchKeyword != ""
|
searchKeyword != undefined && searchKeyword != null && searchKeyword != ""
|
||||||
? queryLike
|
? queryLike
|
||||||
: "1=1",
|
: "1=1",
|
||||||
|
|
|
||||||
|
|
@ -1591,6 +1591,18 @@ export class PositionController extends Controller {
|
||||||
.take(body.pageSize)
|
.take(body.pageSize)
|
||||||
.getManyAndCount();
|
.getManyAndCount();
|
||||||
|
|
||||||
|
//serch name สิทธิ์
|
||||||
|
// if(posMaster.length == 0 && body.keyword != null && body.keyword != "") {
|
||||||
|
// let _authRole:any;
|
||||||
|
// let _masterIdRole:any
|
||||||
|
// _authRole = await this.authRoleRepo.find({
|
||||||
|
// where: {
|
||||||
|
// roleName: Like(`%${body.keyword}%`),
|
||||||
|
// },
|
||||||
|
// relations: ["posMasters"]
|
||||||
|
// });
|
||||||
|
// _masterIdRole = [...new Set(_authRole.map((x: any) => x.posMasters.map((y: any) => y.id)).flat())];
|
||||||
|
// }
|
||||||
//แก้ค้นหา
|
//แก้ค้นหา
|
||||||
let _position: any[] = [];
|
let _position: any[] = [];
|
||||||
let x: any = null;
|
let x: any = null;
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,9 @@ export class ProfileGovernmentEmployeeController extends Controller {
|
||||||
const data = {
|
const data = {
|
||||||
org: org, //สังกัด
|
org: org, //สังกัด
|
||||||
position: record.position, //ตำแหน่ง
|
position: record.position, //ตำแหน่ง
|
||||||
posLevel: record.posLevel == null ? null : record.posLevel.posLevelName, //ระดับ
|
posLevel: record.posType == null && record.posLevel == null
|
||||||
|
? null
|
||||||
|
: `${record.posType.posTypeShortName}${record.posLevel.posLevelName}`, //ระดับ
|
||||||
posMasterNo: posMaster == null ? null : `${orgShortName} ${posMaster.posMasterNo}`, //เลขที่ตำแหน่ง
|
posMasterNo: posMaster == null ? null : `${orgShortName} ${posMaster.posMasterNo}`, //เลขที่ตำแหน่ง
|
||||||
posType: record.posType == null ? null : record.posType.posTypeName, //ประเภท
|
posType: record.posType == null ? null : record.posType.posTypeName, //ประเภท
|
||||||
dateLeave: record.birthDate == null ? null : calculateRetireDate(record.birthDate),
|
dateLeave: record.birthDate == null ? null : calculateRetireDate(record.birthDate),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue