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 { ProfileSalaryHistory } from "../entities/ProfileSalaryHistory";
|
||||
import { ProfileAssistance } from "../entities/ProfileAssistance";
|
||||
|
||||
import { CommandRecive } from "../entities/CommandRecive";
|
||||
@Route("api/v1/org/profile")
|
||||
@Tags("Profile")
|
||||
@Security("bearerAuth")
|
||||
|
|
@ -136,6 +136,7 @@ export class ProfileController extends Controller {
|
|||
private profileAbilityRepo = AppDataSource.getRepository(ProfileAbility);
|
||||
private permissionProflileRepository = AppDataSource.getRepository(PermissionProfile);
|
||||
private profileAssistanceRepository = AppDataSource.getRepository(ProfileAssistance);
|
||||
private commandReciveRepository = AppDataSource.getRepository(CommandRecive);
|
||||
|
||||
/**
|
||||
* report ประวัติแบบย่อ ข้าราชการ
|
||||
|
|
@ -7806,17 +7807,39 @@ export class ProfileController extends Controller {
|
|||
const data = await Promise.all(
|
||||
profile.profileActpositions
|
||||
.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 {
|
||||
id: item.id,
|
||||
posMasterOrder: idx+1,
|
||||
profileId: item.profileId ?? null,
|
||||
citizenId: profile.citizenId ?? null,
|
||||
prefix: profile.prefix ?? null,
|
||||
firstName: profile.firstName ?? null,
|
||||
lastName: profile.lastName ?? null,
|
||||
posLevel: profile.posLevel.posLevelName ?? null,
|
||||
posType: profile.posType.posTypeName ?? null,
|
||||
posMasterOrder: posMasterActs?.posMasterOrder,
|
||||
profileId: _profileAct?.id ?? null,
|
||||
citizenId: _profileAct?.citizenId ?? null,
|
||||
prefix: _profileAct?.prefix ?? null,
|
||||
firstName: _profileAct?.firstName ?? null,
|
||||
lastName: _profileAct?.lastName ?? null,
|
||||
posLevel: _profileAct?.posLevel.posLevelName ?? null,
|
||||
posType: _profileAct?.posType.posTypeName ?? null,
|
||||
position: item.position ?? null,
|
||||
posNo: item.posNo ?? null,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue