Merge branch 'develop' into adiDev
This commit is contained in:
commit
1b271b4d5a
4 changed files with 27 additions and 8 deletions
|
|
@ -3121,7 +3121,7 @@ export class CommandController extends Controller {
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
const posMasters = await this.posMasterRepository.find({ where: { id: In(body.refIds) } });
|
const posMasters = await this.posMasterRepository.find({ where: { id: In(body.refIds.map(x => x.refId)) } });
|
||||||
const data = posMasters.map((_data) => ({
|
const data = posMasters.map((_data) => ({
|
||||||
..._data,
|
..._data,
|
||||||
statusReport: "PENDING",
|
statusReport: "PENDING",
|
||||||
|
|
|
||||||
|
|
@ -3199,7 +3199,7 @@ export class PositionController extends Controller {
|
||||||
) {
|
) {
|
||||||
let typeCondition: any = {};
|
let typeCondition: any = {};
|
||||||
let conditionA =
|
let conditionA =
|
||||||
"positions.posTypeId LIKE :posType AND positions.posLevelId LIKE :posLevel AND positions.positionName LIKE :position";
|
"posType.posTypeName LIKE :posType AND posLevel.posLevelName LIKE :posLevel AND positions.positionName LIKE :position";
|
||||||
|
|
||||||
let posType = await this.posTypeRepository.findOne({
|
let posType = await this.posTypeRepository.findOne({
|
||||||
where: { id: String(body.posType) },
|
where: { id: String(body.posType) },
|
||||||
|
|
|
||||||
|
|
@ -312,7 +312,7 @@ export class ProfileController extends Controller {
|
||||||
// ],
|
// ],
|
||||||
relations: ["currentSubDistrict", "currentDistrict", "currentProvince", "profileAvatars"],
|
relations: ["currentSubDistrict", "currentDistrict", "currentProvince", "profileAvatars"],
|
||||||
order: {
|
order: {
|
||||||
profileAvatars: { createdAt: "DESC" },
|
profileAvatars: { createdAt: "ASC" },
|
||||||
},
|
},
|
||||||
where: { id: id },
|
where: { id: id },
|
||||||
});
|
});
|
||||||
|
|
@ -538,7 +538,7 @@ export class ProfileController extends Controller {
|
||||||
});
|
});
|
||||||
const Cert =
|
const Cert =
|
||||||
certs.length > 0
|
certs.length > 0
|
||||||
? certs.map((item) => ({
|
? certs.slice(-3).map((item) => ({
|
||||||
CertificateType: item.certificateType ?? null,
|
CertificateType: item.certificateType ?? null,
|
||||||
Issuer: item.issuer ?? null,
|
Issuer: item.issuer ?? null,
|
||||||
CertificateNo: Extension.ToThaiNumber(item.certificateNo) ?? null,
|
CertificateNo: Extension.ToThaiNumber(item.certificateNo) ?? null,
|
||||||
|
|
@ -558,7 +558,7 @@ export class ProfileController extends Controller {
|
||||||
});
|
});
|
||||||
const Training =
|
const Training =
|
||||||
trainings.length > 0
|
trainings.length > 0
|
||||||
? trainings.map((item) => ({
|
? trainings.slice(-3).map((item) => ({
|
||||||
Institute: item.department ?? "",
|
Institute: item.department ?? "",
|
||||||
Start:
|
Start:
|
||||||
item.startDate == null
|
item.startDate == null
|
||||||
|
|
@ -594,7 +594,7 @@ export class ProfileController extends Controller {
|
||||||
});
|
});
|
||||||
const Discipline =
|
const Discipline =
|
||||||
disciplines.length > 0
|
disciplines.length > 0
|
||||||
? disciplines.map((item) => ({
|
? disciplines.slice(-3).map((item) => ({
|
||||||
DisciplineYear:
|
DisciplineYear:
|
||||||
Extension.ToThaiNumber(new Date(item.refCommandDate).getFullYear().toString()) ??
|
Extension.ToThaiNumber(new Date(item.refCommandDate).getFullYear().toString()) ??
|
||||||
null,
|
null,
|
||||||
|
|
@ -616,7 +616,7 @@ export class ProfileController extends Controller {
|
||||||
});
|
});
|
||||||
const Education =
|
const Education =
|
||||||
educations.length > 0
|
educations.length > 0
|
||||||
? educations.map((item) => ({
|
? educations.slice(-3).map((item) => ({
|
||||||
Institute: item.institute,
|
Institute: item.institute,
|
||||||
Start:
|
Start:
|
||||||
item.startDate == null
|
item.startDate == null
|
||||||
|
|
@ -3021,6 +3021,25 @@ export class ProfileController extends Controller {
|
||||||
return new HttpSuccess(profile);
|
return new HttpSuccess(profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API รายละเอียดรายการทะเบียนประวัติ
|
||||||
|
*
|
||||||
|
* @summary ORG_065 - รายละเอียดรายการทะเบียนประวัติ (ADMIN) #70
|
||||||
|
*
|
||||||
|
* @param {string} id Id ทะเบียนประวัติ
|
||||||
|
*/
|
||||||
|
@Get("keycloak")
|
||||||
|
async getProfileIdByKeycloak(@Request() request: RequestWithUser) {
|
||||||
|
const profile = await this.profileRepo.findOne({
|
||||||
|
where: { keycloak: request.user.sub },
|
||||||
|
select:["id"]
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
|
|
||||||
|
return new HttpSuccess(profile.id);
|
||||||
|
}
|
||||||
|
|
||||||
@Get("type")
|
@Get("type")
|
||||||
async checkRole(@Request() request: RequestWithUser) {
|
async checkRole(@Request() request: RequestWithUser) {
|
||||||
let role: any;
|
let role: any;
|
||||||
|
|
|
||||||
|
|
@ -305,7 +305,7 @@ export class ProfileEmployeeController extends Controller {
|
||||||
// ],
|
// ],
|
||||||
relations: ["currentSubDistrict", "currentDistrict", "currentProvince", "profileAvatars"],
|
relations: ["currentSubDistrict", "currentDistrict", "currentProvince", "profileAvatars"],
|
||||||
order: {
|
order: {
|
||||||
profileAvatars: { createdAt: "DESC" },
|
profileAvatars: { createdAt: "ASC" },
|
||||||
},
|
},
|
||||||
where: { id: id },
|
where: { id: id },
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue