Merge branch 'develop' into adiDev
This commit is contained in:
commit
27653c18b3
1 changed files with 33 additions and 10 deletions
|
|
@ -84,7 +84,7 @@ import { OrgChild3 } from "../entities/OrgChild3";
|
||||||
import { OrgChild4 } from "../entities/OrgChild4";
|
import { OrgChild4 } from "../entities/OrgChild4";
|
||||||
import { ProfileSalaryHistory } from "../entities/ProfileSalaryHistory";
|
import { ProfileSalaryHistory } from "../entities/ProfileSalaryHistory";
|
||||||
import { ProfileAssistance } from "../entities/ProfileAssistance";
|
import { ProfileAssistance } from "../entities/ProfileAssistance";
|
||||||
|
import { CommandRecive } from "../entities/CommandRecive";
|
||||||
@Route("api/v1/org/profile")
|
@Route("api/v1/org/profile")
|
||||||
@Tags("Profile")
|
@Tags("Profile")
|
||||||
@Security("bearerAuth")
|
@Security("bearerAuth")
|
||||||
|
|
@ -136,6 +136,7 @@ export class ProfileController extends Controller {
|
||||||
private profileAbilityRepo = AppDataSource.getRepository(ProfileAbility);
|
private profileAbilityRepo = AppDataSource.getRepository(ProfileAbility);
|
||||||
private permissionProflileRepository = AppDataSource.getRepository(PermissionProfile);
|
private permissionProflileRepository = AppDataSource.getRepository(PermissionProfile);
|
||||||
private profileAssistanceRepository = AppDataSource.getRepository(ProfileAssistance);
|
private profileAssistanceRepository = AppDataSource.getRepository(ProfileAssistance);
|
||||||
|
private commandReciveRepository = AppDataSource.getRepository(CommandRecive);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* report ประวัติแบบย่อ ข้าราชการ
|
* report ประวัติแบบย่อ ข้าราชการ
|
||||||
|
|
@ -7806,17 +7807,39 @@ export class ProfileController extends Controller {
|
||||||
const data = await Promise.all(
|
const data = await Promise.all(
|
||||||
profile.profileActpositions
|
profile.profileActpositions
|
||||||
.filter(x => x.status)
|
.filter(x => x.status)
|
||||||
.map((item, idx) => {
|
.map(async (item) => {
|
||||||
|
const commandRef = await this.commandReciveRepository.findOne({
|
||||||
|
where: { commandId: item.commandId }
|
||||||
|
});
|
||||||
|
const posMasterActs = await this.posMasterActRepository.findOne({
|
||||||
|
where: {
|
||||||
|
id: commandRef?.refId,
|
||||||
|
posMaster: {
|
||||||
|
orgRevisionId: orgRevisionPublish.id,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
relations: [
|
||||||
|
"posMaster",
|
||||||
|
"posMaster.current_holder"
|
||||||
|
],
|
||||||
|
});
|
||||||
|
const _profileAct = await this.profileRepo.findOne({
|
||||||
|
where: { id: posMasterActs?.posMaster.current_holderId ?? "" },
|
||||||
|
relations: [
|
||||||
|
"posLevel",
|
||||||
|
"posType"
|
||||||
|
]
|
||||||
|
})
|
||||||
return {
|
return {
|
||||||
id: item.id,
|
id: item.id,
|
||||||
posMasterOrder: idx+1,
|
posMasterOrder: posMasterActs?.posMasterOrder,
|
||||||
profileId: item.profileId ?? null,
|
profileId: _profileAct?.id ?? null,
|
||||||
citizenId: profile.citizenId ?? null,
|
citizenId: _profileAct?.citizenId ?? null,
|
||||||
prefix: profile.prefix ?? null,
|
prefix: _profileAct?.prefix ?? null,
|
||||||
firstName: profile.firstName ?? null,
|
firstName: _profileAct?.firstName ?? null,
|
||||||
lastName: profile.lastName ?? null,
|
lastName: _profileAct?.lastName ?? null,
|
||||||
posLevel: profile.posLevel.posLevelName ?? null,
|
posLevel: _profileAct?.posLevel.posLevelName ?? null,
|
||||||
posType: profile.posType.posTypeName ?? null,
|
posType: _profileAct?.posType.posTypeName ?? null,
|
||||||
position: item.position ?? null,
|
position: item.position ?? null,
|
||||||
posNo: item.posNo ?? null,
|
posNo: item.posNo ?? null,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue