update current
This commit is contained in:
parent
b0f5ff78d8
commit
8b7de2a0ba
6 changed files with 86 additions and 54 deletions
|
|
@ -3120,7 +3120,10 @@ export class CommandController extends Controller {
|
||||||
orgRevisionId: posMaster.orgRevisionId,
|
orgRevisionId: posMaster.orgRevisionId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (posMasterOld != null) posMasterOld.current_holderId = null;
|
if (posMasterOld != null) {
|
||||||
|
posMasterOld.current_holderId = null;
|
||||||
|
posMasterOld.lastUpdatedAt = new Date();
|
||||||
|
}
|
||||||
|
|
||||||
const positionOld = await this.positionRepository.findOne({
|
const positionOld = await this.positionRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -3148,6 +3151,7 @@ export class CommandController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
posMaster.current_holderId = item.profileId;
|
posMaster.current_holderId = item.profileId;
|
||||||
|
posMaster.lastUpdatedAt = new Date();
|
||||||
posMaster.conditionReason = _null;
|
posMaster.conditionReason = _null;
|
||||||
posMaster.isCondition = false;
|
posMaster.isCondition = false;
|
||||||
if (posMasterOld != null) await this.posMasterRepository.save(posMasterOld);
|
if (posMasterOld != null) await this.posMasterRepository.save(posMasterOld);
|
||||||
|
|
@ -3304,7 +3308,10 @@ export class CommandController extends Controller {
|
||||||
orgRevisionId: posMaster.orgRevisionId,
|
orgRevisionId: posMaster.orgRevisionId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (posMasterOld != null) posMasterOld.current_holderId = null;
|
if (posMasterOld != null) {
|
||||||
|
posMasterOld.current_holderId = null;
|
||||||
|
posMasterOld.lastUpdatedAt = new Date();
|
||||||
|
}
|
||||||
// if (posMasterOld != null) posMasterOld.next_holderId = null;
|
// if (posMasterOld != null) posMasterOld.next_holderId = null;
|
||||||
|
|
||||||
const positionOld = await this.employeePositionRepository.findOne({
|
const positionOld = await this.employeePositionRepository.findOne({
|
||||||
|
|
@ -3333,6 +3340,7 @@ export class CommandController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
posMaster.current_holderId = item.profileId;
|
posMaster.current_holderId = item.profileId;
|
||||||
|
posMaster.lastUpdatedAt = new Date();
|
||||||
posMaster.next_holderId = null;
|
posMaster.next_holderId = null;
|
||||||
if (posMasterOld != null) await this.employeePosMasterRepository.save(posMasterOld);
|
if (posMasterOld != null) await this.employeePosMasterRepository.save(posMasterOld);
|
||||||
await this.employeePosMasterRepository.save(posMaster);
|
await this.employeePosMasterRepository.save(posMaster);
|
||||||
|
|
@ -3561,6 +3569,7 @@ export class CommandController extends Controller {
|
||||||
await this.positionRepository.save(clearPosition);
|
await this.positionRepository.save(clearPosition);
|
||||||
}
|
}
|
||||||
posMaster.current_holderId = profile.id;
|
posMaster.current_holderId = profile.id;
|
||||||
|
posMaster.lastUpdatedAt = new Date();
|
||||||
posMaster.conditionReason = _null;
|
posMaster.conditionReason = _null;
|
||||||
posMaster.isCondition = false;
|
posMaster.isCondition = false;
|
||||||
await this.posMasterRepository.save(posMaster);
|
await this.posMasterRepository.save(posMaster);
|
||||||
|
|
@ -5987,7 +5996,10 @@ export class CommandController extends Controller {
|
||||||
orgRevisionId: posMaster.orgRevisionId,
|
orgRevisionId: posMaster.orgRevisionId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (posMasterOld != null) posMasterOld.current_holderId = null;
|
if (posMasterOld != null) {
|
||||||
|
posMasterOld.current_holderId = null;
|
||||||
|
posMasterOld.lastUpdatedAt = new Date();
|
||||||
|
}
|
||||||
|
|
||||||
const positionOld = await this.positionRepository.findOne({
|
const positionOld = await this.positionRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -6015,6 +6027,7 @@ export class CommandController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
posMaster.current_holderId = profile.id;
|
posMaster.current_holderId = profile.id;
|
||||||
|
posMaster.lastUpdatedAt = new Date();
|
||||||
posMaster.conditionReason = _null;
|
posMaster.conditionReason = _null;
|
||||||
posMaster.isCondition = false;
|
posMaster.isCondition = false;
|
||||||
if (posMasterOld != null) await this.posMasterRepository.save(posMasterOld);
|
if (posMasterOld != null) await this.posMasterRepository.save(posMasterOld);
|
||||||
|
|
@ -6364,7 +6377,10 @@ export class CommandController extends Controller {
|
||||||
orgRevisionId: posMaster.orgRevisionId,
|
orgRevisionId: posMaster.orgRevisionId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (posMasterOld != null) posMasterOld.current_holderId = null;
|
if (posMasterOld != null) {
|
||||||
|
posMasterOld.current_holderId = null;
|
||||||
|
posMasterOld.lastUpdatedAt = new Date();
|
||||||
|
}
|
||||||
// if (posMasterOld != null) posMasterOld.next_holderId = null;
|
// if (posMasterOld != null) posMasterOld.next_holderId = null;
|
||||||
|
|
||||||
const positionOld = await this.employeePositionRepository.findOne({
|
const positionOld = await this.employeePositionRepository.findOne({
|
||||||
|
|
@ -6393,6 +6409,7 @@ export class CommandController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
posMaster.current_holderId = profile.id;
|
posMaster.current_holderId = profile.id;
|
||||||
|
posMaster.lastUpdatedAt = new Date();
|
||||||
posMaster.next_holderId = null;
|
posMaster.next_holderId = null;
|
||||||
if (posMasterOld != null) await this.employeePosMasterRepository.save(posMasterOld);
|
if (posMasterOld != null) await this.employeePosMasterRepository.save(posMasterOld);
|
||||||
await this.employeePosMasterRepository.save(posMaster);
|
await this.employeePosMasterRepository.save(posMaster);
|
||||||
|
|
|
||||||
|
|
@ -372,18 +372,22 @@ export class EmployeePositionController extends Controller {
|
||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
findData = await this.employeePosDictRepository
|
findData = await this.employeePosDictRepository
|
||||||
.createQueryBuilder("posDict")
|
.createQueryBuilder("posDict")
|
||||||
.leftJoinAndSelect("posDict.posType", "posType")
|
.leftJoinAndSelect("posDict.posType", "posType")
|
||||||
.leftJoinAndSelect("posDict.posLevel", "posLevel")
|
.leftJoinAndSelect("posDict.posLevel", "posLevel")
|
||||||
.where( keyword
|
.where(
|
||||||
? "CONCAT(posType.posTypeShortName, ' ', posLevel.posLevelName) LIKE :keyword":"1=1", {keyword: `%${keyword}%`})
|
keyword
|
||||||
.orderBy("posDict.posDictName", "ASC")
|
? "CONCAT(posType.posTypeShortName, ' ', posLevel.posLevelName) LIKE :keyword"
|
||||||
.addOrderBy("posDict.createdAt", "DESC")
|
: "1=1",
|
||||||
.addOrderBy("posType.posTypeRank", "ASC")
|
{ keyword: `%${keyword}%` },
|
||||||
.addOrderBy("posType.createdAt", "DESC")
|
)
|
||||||
.addOrderBy("posLevel.posLevelName", "ASC")
|
.orderBy("posDict.posDictName", "ASC")
|
||||||
.addOrderBy("posLevel.createdAt", "DESC")
|
.addOrderBy("posDict.createdAt", "DESC")
|
||||||
.getMany();
|
.addOrderBy("posType.posTypeRank", "ASC")
|
||||||
|
.addOrderBy("posType.createdAt", "DESC")
|
||||||
|
.addOrderBy("posLevel.posLevelName", "ASC")
|
||||||
|
.addOrderBy("posLevel.createdAt", "DESC")
|
||||||
|
.getMany();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
@ -2258,6 +2262,7 @@ export class EmployeePositionController extends Controller {
|
||||||
|
|
||||||
dataMaster.isSit = requestBody.isSit;
|
dataMaster.isSit = requestBody.isSit;
|
||||||
dataMaster.current_holderId = requestBody.profileId;
|
dataMaster.current_holderId = requestBody.profileId;
|
||||||
|
dataMaster.lastUpdatedAt = new Date();
|
||||||
// dataMaster.next_holderId = requestBody.profileId;
|
// dataMaster.next_holderId = requestBody.profileId;
|
||||||
await this.employeePosMasterRepository.save(dataMaster);
|
await this.employeePosMasterRepository.save(dataMaster);
|
||||||
|
|
||||||
|
|
@ -2394,7 +2399,10 @@ export class EmployeePositionController extends Controller {
|
||||||
orgRevisionId: posMaster.orgRevisionId,
|
orgRevisionId: posMaster.orgRevisionId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (posMasterOld != null) posMasterOld.current_holderId = null;
|
if (posMasterOld != null) {
|
||||||
|
posMasterOld.current_holderId = null;
|
||||||
|
posMasterOld.lastUpdatedAt = new Date();
|
||||||
|
}
|
||||||
// if (posMasterOld != null) posMasterOld.next_holderId = null;
|
// if (posMasterOld != null) posMasterOld.next_holderId = null;
|
||||||
|
|
||||||
const positionOld = await this.employeePositionRepository.findOne({
|
const positionOld = await this.employeePositionRepository.findOne({
|
||||||
|
|
@ -2429,6 +2437,7 @@ export class EmployeePositionController extends Controller {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลทะเบียนประวัตินี้");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลทะเบียนประวัตินี้");
|
||||||
|
|
||||||
posMaster.current_holderId = body.profileId;
|
posMaster.current_holderId = body.profileId;
|
||||||
|
posMaster.lastUpdatedAt = new Date();
|
||||||
// posMaster.next_holderId = body.profileId;
|
// posMaster.next_holderId = body.profileId;
|
||||||
if (posMasterOld != null) await this.employeePosMasterRepository.save(posMasterOld);
|
if (posMasterOld != null) await this.employeePosMasterRepository.save(posMasterOld);
|
||||||
await this.employeePosMasterRepository.save(posMaster);
|
await this.employeePosMasterRepository.save(posMaster);
|
||||||
|
|
|
||||||
|
|
@ -2001,6 +2001,7 @@ export class EmployeeTempPositionController extends Controller {
|
||||||
|
|
||||||
dataMaster.isSit = requestBody.isSit;
|
dataMaster.isSit = requestBody.isSit;
|
||||||
dataMaster.current_holderId = requestBody.profileId;
|
dataMaster.current_holderId = requestBody.profileId;
|
||||||
|
dataMaster.lastUpdatedAt = new Date();
|
||||||
// dataMaster.next_holderId = requestBody.profileId;
|
// dataMaster.next_holderId = requestBody.profileId;
|
||||||
await this.employeeTempPosMasterRepository.save(dataMaster);
|
await this.employeeTempPosMasterRepository.save(dataMaster);
|
||||||
|
|
||||||
|
|
@ -2137,7 +2138,10 @@ export class EmployeeTempPositionController extends Controller {
|
||||||
orgRevisionId: posMaster.orgRevisionId,
|
orgRevisionId: posMaster.orgRevisionId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (posMasterOld != null) posMasterOld.current_holderId = null;
|
if (posMasterOld != null) {
|
||||||
|
posMasterOld.current_holderId = null;
|
||||||
|
posMasterOld.lastUpdatedAt = new Date();
|
||||||
|
}
|
||||||
// if (posMasterOld != null) posMasterOld.next_holderId = null;
|
// if (posMasterOld != null) posMasterOld.next_holderId = null;
|
||||||
|
|
||||||
const positionOld = await this.employeePositionRepository.findOne({
|
const positionOld = await this.employeePositionRepository.findOne({
|
||||||
|
|
@ -2172,6 +2176,7 @@ export class EmployeeTempPositionController extends Controller {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลทะเบียนประวัตินี้");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลทะเบียนประวัตินี้");
|
||||||
|
|
||||||
posMaster.current_holderId = body.profileId;
|
posMaster.current_holderId = body.profileId;
|
||||||
|
posMaster.lastUpdatedAt = new Date();
|
||||||
// posMaster.next_holderId = body.profileId;
|
// posMaster.next_holderId = body.profileId;
|
||||||
if (posMasterOld != null) await this.employeeTempPosMasterRepository.save(posMasterOld);
|
if (posMasterOld != null) await this.employeeTempPosMasterRepository.save(posMasterOld);
|
||||||
await this.employeeTempPosMasterRepository.save(posMaster);
|
await this.employeeTempPosMasterRepository.save(posMaster);
|
||||||
|
|
|
||||||
|
|
@ -340,7 +340,7 @@ export class OrgRootController extends Controller {
|
||||||
const before = structuredClone(orgRoot);
|
const before = structuredClone(orgRoot);
|
||||||
orgRoot.lastUpdateUserId = request.user.sub;
|
orgRoot.lastUpdateUserId = request.user.sub;
|
||||||
orgRoot.lastUpdateFullName = request.user.name;
|
orgRoot.lastUpdateFullName = request.user.name;
|
||||||
orgRoot.lastUpdatedAt = new Date();
|
// orgRoot.lastUpdatedAt = new Date();
|
||||||
this.orgRootRepository.merge(orgRoot, {
|
this.orgRootRepository.merge(orgRoot, {
|
||||||
...requestBody,
|
...requestBody,
|
||||||
DEPARTMENT_CODE: requestBody.DEPARTMENT_CODE != null ? requestBody.DEPARTMENT_CODE : _null,
|
DEPARTMENT_CODE: requestBody.DEPARTMENT_CODE != null ? requestBody.DEPARTMENT_CODE : _null,
|
||||||
|
|
|
||||||
|
|
@ -1431,13 +1431,7 @@ export class PositionController extends Controller {
|
||||||
@Get("position/{id}")
|
@Get("position/{id}")
|
||||||
async detailPosition(@Path() id: string) {
|
async detailPosition(@Path() id: string) {
|
||||||
const posMaster = await this.posMasterRepository.findOne({
|
const posMaster = await this.posMasterRepository.findOne({
|
||||||
relations: [
|
relations: ["orgRoot", "orgChild1", "orgChild2", "orgChild3", "orgChild4"],
|
||||||
"orgRoot",
|
|
||||||
"orgChild1",
|
|
||||||
"orgChild2",
|
|
||||||
"orgChild3",
|
|
||||||
"orgChild4",
|
|
||||||
],
|
|
||||||
where: { id },
|
where: { id },
|
||||||
});
|
});
|
||||||
if (!posMaster) {
|
if (!posMaster) {
|
||||||
|
|
@ -1474,7 +1468,7 @@ export class PositionController extends Controller {
|
||||||
posMaster.orgChild3Id == null
|
posMaster.orgChild3Id == null
|
||||||
) {
|
) {
|
||||||
shortName = posMaster.orgRoot.orgRootShortName;
|
shortName = posMaster.orgRoot.orgRootShortName;
|
||||||
orgId = posMaster.orgRootId;
|
orgId = posMaster.orgRootId;
|
||||||
} else if (
|
} else if (
|
||||||
posMaster.orgRootId !== null &&
|
posMaster.orgRootId !== null &&
|
||||||
posMaster.orgChild1Id !== null &&
|
posMaster.orgChild1Id !== null &&
|
||||||
|
|
@ -1482,7 +1476,7 @@ export class PositionController extends Controller {
|
||||||
posMaster.orgChild3Id == null
|
posMaster.orgChild3Id == null
|
||||||
) {
|
) {
|
||||||
shortName = posMaster.orgChild1.orgChild1ShortName;
|
shortName = posMaster.orgChild1.orgChild1ShortName;
|
||||||
orgId = posMaster.orgChild1Id;
|
orgId = posMaster.orgChild1Id;
|
||||||
} else if (
|
} else if (
|
||||||
posMaster.orgRootId !== null &&
|
posMaster.orgRootId !== null &&
|
||||||
posMaster.orgChild1Id !== null &&
|
posMaster.orgChild1Id !== null &&
|
||||||
|
|
@ -1490,7 +1484,7 @@ export class PositionController extends Controller {
|
||||||
posMaster.orgChild3Id == null
|
posMaster.orgChild3Id == null
|
||||||
) {
|
) {
|
||||||
shortName = posMaster.orgChild2.orgChild2ShortName;
|
shortName = posMaster.orgChild2.orgChild2ShortName;
|
||||||
orgId = posMaster.orgChild2Id;
|
orgId = posMaster.orgChild2Id;
|
||||||
} else if (
|
} else if (
|
||||||
posMaster.orgRootId !== null &&
|
posMaster.orgRootId !== null &&
|
||||||
posMaster.orgChild1Id !== null &&
|
posMaster.orgChild1Id !== null &&
|
||||||
|
|
@ -1498,7 +1492,7 @@ export class PositionController extends Controller {
|
||||||
posMaster.orgChild3Id !== null
|
posMaster.orgChild3Id !== null
|
||||||
) {
|
) {
|
||||||
shortName = posMaster.orgChild3.orgChild3ShortName;
|
shortName = posMaster.orgChild3.orgChild3ShortName;
|
||||||
orgId = posMaster.orgChild3Id;
|
orgId = posMaster.orgChild3Id;
|
||||||
} else if (
|
} else if (
|
||||||
posMaster.orgRootId !== null &&
|
posMaster.orgRootId !== null &&
|
||||||
posMaster.orgChild1Id !== null &&
|
posMaster.orgChild1Id !== null &&
|
||||||
|
|
@ -1506,7 +1500,7 @@ export class PositionController extends Controller {
|
||||||
posMaster.orgChild3Id !== null
|
posMaster.orgChild3Id !== null
|
||||||
) {
|
) {
|
||||||
shortName = posMaster.orgChild4.orgChild4ShortName;
|
shortName = posMaster.orgChild4.orgChild4ShortName;
|
||||||
orgId = posMaster.orgChild4Id;
|
orgId = posMaster.orgChild4Id;
|
||||||
}
|
}
|
||||||
const positions = await this.positionRepository.find({
|
const positions = await this.positionRepository.find({
|
||||||
where: { posMasterId: posMaster.id },
|
where: { posMasterId: posMaster.id },
|
||||||
|
|
@ -3596,6 +3590,7 @@ export class PositionController extends Controller {
|
||||||
const before = null;
|
const before = null;
|
||||||
dataMaster.isSit = requestBody.isSit;
|
dataMaster.isSit = requestBody.isSit;
|
||||||
dataMaster.next_holderId = requestBody.profileId;
|
dataMaster.next_holderId = requestBody.profileId;
|
||||||
|
dataMaster.lastUpdatedAt = new Date();
|
||||||
//add on
|
//add on
|
||||||
dataMaster.conditionReason = _null;
|
dataMaster.conditionReason = _null;
|
||||||
dataMaster.isCondition = false;
|
dataMaster.isCondition = false;
|
||||||
|
|
@ -4736,7 +4731,10 @@ export class PositionController extends Controller {
|
||||||
orgRevisionId: posMaster.orgRevisionId,
|
orgRevisionId: posMaster.orgRevisionId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (posMasterOld != null) posMasterOld.current_holderId = null;
|
if (posMasterOld != null) {
|
||||||
|
posMasterOld.current_holderId = null;
|
||||||
|
posMasterOld.lastUpdatedAt = new Date();
|
||||||
|
}
|
||||||
|
|
||||||
const positionOld = await this.positionRepository.findOne({
|
const positionOld = await this.positionRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -4770,6 +4768,7 @@ export class PositionController extends Controller {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลทะเบียนประวัตินี้");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลทะเบียนประวัตินี้");
|
||||||
|
|
||||||
posMaster.current_holderId = body.profileId;
|
posMaster.current_holderId = body.profileId;
|
||||||
|
posMaster.lastUpdatedAt = new Date();
|
||||||
const _null: any = null;
|
const _null: any = null;
|
||||||
posMaster.conditionReason = _null;
|
posMaster.conditionReason = _null;
|
||||||
posMaster.isCondition = false;
|
posMaster.isCondition = false;
|
||||||
|
|
@ -5323,6 +5322,7 @@ export class PositionController extends Controller {
|
||||||
if (!profile) throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลผู้ใช้งาน");
|
if (!profile) throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลผู้ใช้งาน");
|
||||||
|
|
||||||
posMaster.next_holderId = requestBody.profileId;
|
posMaster.next_holderId = requestBody.profileId;
|
||||||
|
posMaster.lastUpdatedAt = new Date();
|
||||||
posMaster.lastUpdateUserId = request.user.sub;
|
posMaster.lastUpdateUserId = request.user.sub;
|
||||||
posMaster.lastUpdateFullName = request.user.name;
|
posMaster.lastUpdateFullName = request.user.name;
|
||||||
posMaster.lastUpdatedAt = new Date();
|
posMaster.lastUpdatedAt = new Date();
|
||||||
|
|
|
||||||
|
|
@ -1321,7 +1321,7 @@ export class ProfileController extends Controller {
|
||||||
"profileLeave.dateLeaveEnd AS dateLeaveEnd",
|
"profileLeave.dateLeaveEnd AS dateLeaveEnd",
|
||||||
"profileLeave.leaveDays AS leaveDays",
|
"profileLeave.leaveDays AS leaveDays",
|
||||||
"profileLeave.reason AS reason",
|
"profileLeave.reason AS reason",
|
||||||
"leaveType.name as name"
|
"leaveType.name as name",
|
||||||
])
|
])
|
||||||
.where("profileLeave.profileId = :profileId", { profileId: id })
|
.where("profileLeave.profileId = :profileId", { profileId: id })
|
||||||
.andWhere("leaveType.code IN (:...codes)", { codes: ["LV-008", "LV-009", "LV-010"] })
|
.andWhere("leaveType.code IN (:...codes)", { codes: ["LV-008", "LV-009", "LV-010"] })
|
||||||
|
|
@ -1331,10 +1331,12 @@ export class ProfileController extends Controller {
|
||||||
const leaves2 =
|
const leaves2 =
|
||||||
leave2_raw.length > 0
|
leave2_raw.length > 0
|
||||||
? leave2_raw.map((item) => ({
|
? leave2_raw.map((item) => ({
|
||||||
date: item.dateLeaveStart && item.dateLeaveEnd
|
date:
|
||||||
? Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.dateLeaveStart)) + " - "
|
item.dateLeaveStart && item.dateLeaveEnd
|
||||||
+ Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.dateLeaveEnd))
|
? Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.dateLeaveStart)) +
|
||||||
: "-",
|
" - " +
|
||||||
|
Extension.ToThaiNumber(Extension.ToThaiFullDate2(item.dateLeaveEnd))
|
||||||
|
: "-",
|
||||||
type: item.name || "-",
|
type: item.name || "-",
|
||||||
leaveDays: item.leaveDays ? Extension.ToThaiNumber(item.leaveDays.toString()) : "-",
|
leaveDays: item.leaveDays ? Extension.ToThaiNumber(item.leaveDays.toString()) : "-",
|
||||||
reason: item.reason || "-",
|
reason: item.reason || "-",
|
||||||
|
|
@ -1684,24 +1686,22 @@ export class ProfileController extends Controller {
|
||||||
)
|
)
|
||||||
: "";
|
: "";
|
||||||
|
|
||||||
let portfolios:any
|
let portfolios: any;
|
||||||
await new CallAPI()
|
await new CallAPI()
|
||||||
.GetData(req, `/development/portfolio/kk1/${profiles?.keycloak}`)
|
.GetData(req, `/development/portfolio/kk1/${profiles?.keycloak}`)
|
||||||
.then((x) => {
|
.then((x) => {
|
||||||
portfolios = x;
|
portfolios = x;
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
if (!portfolios) {
|
if (!portfolios) {
|
||||||
portfolios = [{ name: "-", year: "-" }]
|
portfolios = [{ name: "-", year: "-" }];
|
||||||
}
|
} else {
|
||||||
else {
|
portfolios = portfolios.map((x: any) => ({
|
||||||
portfolios = portfolios.map((x:any) => ({
|
|
||||||
name: x.name ? Extension.ToThaiNumber(x.name) : "-",
|
name: x.name ? Extension.ToThaiNumber(x.name) : "-",
|
||||||
year: x.year ? Extension.ToThaiNumber(x.year.toString()) : "-"
|
year: x.year ? Extension.ToThaiNumber(x.year.toString()) : "-",
|
||||||
}))
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
fullName: `${profiles?.prefix}${profiles?.firstName} ${profiles?.lastName}`,
|
fullName: `${profiles?.prefix}${profiles?.firstName} ${profiles?.lastName}`,
|
||||||
prefix: profiles?.prefix != null ? profiles.prefix : "",
|
prefix: profiles?.prefix != null ? profiles.prefix : "",
|
||||||
|
|
@ -1855,7 +1855,7 @@ export class ProfileController extends Controller {
|
||||||
assessments,
|
assessments,
|
||||||
profileAbility,
|
profileAbility,
|
||||||
otherIncome,
|
otherIncome,
|
||||||
portfolios
|
portfolios,
|
||||||
};
|
};
|
||||||
|
|
||||||
return new HttpSuccess({
|
return new HttpSuccess({
|
||||||
|
|
@ -2855,7 +2855,8 @@ export class ProfileController extends Controller {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (!posMaster) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลการครองตำแหน่ง");
|
if (!posMaster) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลการครองตำแหน่ง");
|
||||||
posMaster.current_holderId = "";
|
posMaster.current_holderId = null;
|
||||||
|
posMaster.lastUpdatedAt = new Date();
|
||||||
// return new HttpSuccess({ data: [], total: 0 });
|
// return new HttpSuccess({ data: [], total: 0 });
|
||||||
} else if ((posMaster?.current_holder?.posLevel?.posLevelAuthority ?? null) == "GOVERNOR") {
|
} else if ((posMaster?.current_holder?.posLevel?.posLevelAuthority ?? null) == "GOVERNOR") {
|
||||||
return new HttpSuccess({ data: [], total: 0 });
|
return new HttpSuccess({ data: [], total: 0 });
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue