แก้apiข้อมูลหลัก
This commit is contained in:
parent
73e07dfed6
commit
6b78a365fa
26 changed files with 1816 additions and 988 deletions
|
|
@ -179,9 +179,6 @@ export class ProfileController extends Controller {
|
|||
relations: {
|
||||
posLevel: true,
|
||||
posType: true,
|
||||
gender: true,
|
||||
relationship: true,
|
||||
bloodGroup: true,
|
||||
},
|
||||
where: { id },
|
||||
});
|
||||
|
|
@ -197,9 +194,6 @@ export class ProfileController extends Controller {
|
|||
relations: {
|
||||
posLevel: true,
|
||||
posType: true,
|
||||
gender: true,
|
||||
relationship: true,
|
||||
bloodGroup: true,
|
||||
},
|
||||
where: { profileId: id },
|
||||
});
|
||||
|
|
@ -229,6 +223,7 @@ export class ProfileController extends Controller {
|
|||
lastUpdateUserId: "00000000-0000-0000-0000-000000000000",
|
||||
createdFullName: "string",
|
||||
lastUpdateFullName: "string",
|
||||
rank: null,
|
||||
prefix: null,
|
||||
firstName: "Methapon",
|
||||
lastName: "Metanipat",
|
||||
|
|
@ -244,21 +239,8 @@ export class ProfileController extends Controller {
|
|||
birthDate: null,
|
||||
ethnicity: null,
|
||||
telephoneNumber: null,
|
||||
genderId: "22041841-3149-4b40-ab0e-0d4e98ffd2e1",
|
||||
gender: {
|
||||
id: "22041841-3149-4b40-ab0e-0d4e98ffd2e1",
|
||||
createdAt: "2024-03-24T12:35:45.693Z",
|
||||
createdUserId: "00000000-0000-0000-0000-000000000000",
|
||||
lastUpdatedAt: "2024-03-24T12:35:45.693Z",
|
||||
lastUpdateUserId: "00000000-0000-0000-0000-000000000000",
|
||||
createdFullName: "string",
|
||||
lastUpdateFullName: "string",
|
||||
name: "Male",
|
||||
},
|
||||
relationshipId: null,
|
||||
gender: null,
|
||||
relationship: null,
|
||||
religionId: null,
|
||||
bloodGroupId: null,
|
||||
bloodGroup: null,
|
||||
posLevel: null,
|
||||
posType: null,
|
||||
|
|
@ -289,9 +271,6 @@ export class ProfileController extends Controller {
|
|||
.createQueryBuilder("profile")
|
||||
.leftJoinAndSelect("profile.posLevel", "posLevel")
|
||||
.leftJoinAndSelect("profile.posType", "posType")
|
||||
.leftJoinAndSelect("profile.gender", "gender")
|
||||
.leftJoinAndSelect("profile.relationship", "relationship")
|
||||
.leftJoinAndSelect("profile.bloodGroup", "bloodGroup")
|
||||
.leftJoinAndSelect("profile.current_holders", "current_holders")
|
||||
.leftJoinAndSelect("current_holders.orgRoot", "orgRoot")
|
||||
.leftJoinAndSelect("current_holders.orgChild1", "orgChild1")
|
||||
|
|
@ -300,6 +279,7 @@ export class ProfileController extends Controller {
|
|||
.leftJoinAndSelect("current_holders.orgChild4", "orgChild4")
|
||||
.select([
|
||||
"profile.id",
|
||||
"profile.rank",
|
||||
"profile.prefix",
|
||||
"profile.firstName",
|
||||
"profile.lastName",
|
||||
|
|
@ -455,9 +435,14 @@ export class ProfileController extends Controller {
|
|||
.andWhere(
|
||||
new Brackets((qb) => {
|
||||
qb.where("profile.id NOT IN (:...ids)", {
|
||||
ids: orgRevision.posMasters
|
||||
.filter((x) => x.next_holderId != null)
|
||||
.map((x) => x.next_holderId),
|
||||
ids:
|
||||
orgRevision.posMasters
|
||||
.filter((x) => x.next_holderId != null)
|
||||
.map((x) => x.next_holderId).length == 0
|
||||
? ["zxc"]
|
||||
: orgRevision.posMasters
|
||||
.filter((x) => x.next_holderId != null)
|
||||
.map((x) => x.next_holderId),
|
||||
});
|
||||
}),
|
||||
)
|
||||
|
|
@ -468,6 +453,7 @@ export class ProfileController extends Controller {
|
|||
const data = profiles.map((_data) => ({
|
||||
id: _data.id,
|
||||
prefix: _data.prefix,
|
||||
rank: _data.rank,
|
||||
firstName: _data.firstName,
|
||||
lastName: _data.lastName,
|
||||
citizenId: _data.citizenId,
|
||||
|
|
@ -507,6 +493,7 @@ export class ProfileController extends Controller {
|
|||
const _profile = {
|
||||
profileId: profile.id,
|
||||
prefix: profile.prefix,
|
||||
rank: profile.rank,
|
||||
firstName: profile.firstName,
|
||||
lastName: profile.lastName,
|
||||
citizenId: profile.citizenId,
|
||||
|
|
@ -640,6 +627,7 @@ export class ProfileController extends Controller {
|
|||
return {
|
||||
id: item.id,
|
||||
prefix: item.prefix,
|
||||
rank: item.rank,
|
||||
firstName: item.firstName,
|
||||
lastName: item.lastName,
|
||||
position: item.position,
|
||||
|
|
@ -906,6 +894,7 @@ export class ProfileController extends Controller {
|
|||
return {
|
||||
id: item.id,
|
||||
prefix: item.prefix,
|
||||
rank: item.rank,
|
||||
firstName: item.firstName,
|
||||
lastName: item.lastName,
|
||||
position: item.position,
|
||||
|
|
@ -1137,6 +1126,7 @@ export class ProfileController extends Controller {
|
|||
|
||||
return {
|
||||
prefix: item.current_holder.prefix,
|
||||
rank: item.current_holder.rank,
|
||||
firstName: item.current_holder.firstName,
|
||||
lastName: item.current_holder.lastName,
|
||||
citizenId: item.current_holder.citizenId,
|
||||
|
|
@ -1212,6 +1202,7 @@ export class ProfileController extends Controller {
|
|||
const _profile = {
|
||||
profileId: profile.id,
|
||||
prefix: profile.prefix,
|
||||
rank: profile.rank,
|
||||
firstName: profile.firstName,
|
||||
lastName: profile.lastName,
|
||||
citizenId: profile.citizenId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue