format
This commit is contained in:
parent
7531a9c582
commit
bfae3e012d
1 changed files with 2303 additions and 2319 deletions
|
|
@ -79,7 +79,6 @@ export class OrganizationController extends Controller {
|
|||
}));
|
||||
|
||||
return new HttpSuccess(mapOrgRevisions);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -106,7 +105,6 @@ export class OrganizationController extends Controller {
|
|||
isPublic: orgRevisionDraf == null || orgRevisionDraf.orgRevisionName == null ? false : true,
|
||||
};
|
||||
return new HttpSuccess(mapData);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -511,9 +509,7 @@ export class OrganizationController extends Controller {
|
|||
delete item.id;
|
||||
const posMaster = Object.assign(new PosMaster(), item);
|
||||
posMaster.positions = [];
|
||||
if (
|
||||
requestBody.typeDraft.toUpperCase() == "ORG_POSITION_PERSON"
|
||||
) {
|
||||
if (requestBody.typeDraft.toUpperCase() == "ORG_POSITION_PERSON") {
|
||||
posMaster.next_holderId = item.current_holderId;
|
||||
} else {
|
||||
posMaster.next_holderId = null;
|
||||
|
|
@ -580,7 +576,6 @@ export class OrganizationController extends Controller {
|
|||
await this.orgRevisionRepository.remove(_orgRevisions);
|
||||
|
||||
return new HttpSuccess(revision);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1166,8 +1161,7 @@ export class OrganizationController extends Controller {
|
|||
current_holderId: Not(IsNull()) || Not(""),
|
||||
},
|
||||
}),
|
||||
totalPositionCurrentVacant:
|
||||
await this.posMasterRepository.count({
|
||||
totalPositionCurrentVacant: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgChild4Id: orgChild4.id,
|
||||
|
|
@ -1198,8 +1192,8 @@ export class OrganizationController extends Controller {
|
|||
orgChild4Id: orgChild4.id,
|
||||
},
|
||||
}),
|
||||
totalRootPositionCurrentUse:
|
||||
await this.posMasterRepository.count({
|
||||
totalRootPositionCurrentUse: await this.posMasterRepository.count(
|
||||
{
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
|
|
@ -1209,7 +1203,8 @@ export class OrganizationController extends Controller {
|
|||
orgChild4Id: orgChild4.id,
|
||||
current_holderId: Not(IsNull()) || Not(""),
|
||||
},
|
||||
}),
|
||||
},
|
||||
),
|
||||
totalRootPositionCurrentVacant:
|
||||
await this.posMasterRepository.count({
|
||||
where: {
|
||||
|
|
@ -1233,8 +1228,8 @@ export class OrganizationController extends Controller {
|
|||
next_holderId: Not(IsNull()) || Not(""),
|
||||
},
|
||||
}),
|
||||
totalRootPositionNextVacant:
|
||||
await this.posMasterRepository.count({
|
||||
totalRootPositionNextVacant: await this.posMasterRepository.count(
|
||||
{
|
||||
where: {
|
||||
orgRevisionId: orgRoot.orgRevisionId,
|
||||
orgRootId: orgRoot.id,
|
||||
|
|
@ -1244,7 +1239,8 @@ export class OrganizationController extends Controller {
|
|||
orgChild4Id: orgChild4.id,
|
||||
next_holderId: IsNull() || "",
|
||||
},
|
||||
}),
|
||||
},
|
||||
),
|
||||
})),
|
||||
),
|
||||
})),
|
||||
|
|
@ -1258,7 +1254,6 @@ export class OrganizationController extends Controller {
|
|||
);
|
||||
|
||||
return new HttpSuccess(formattedData);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1291,7 +1286,6 @@ export class OrganizationController extends Controller {
|
|||
this.orgRevisionRepository.merge(orgRevision, requestBody);
|
||||
await this.orgRevisionRepository.save(orgRevision);
|
||||
return new HttpSuccess();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1446,10 +1440,7 @@ export class OrganizationController extends Controller {
|
|||
where: { id: requestBody.id },
|
||||
});
|
||||
if (!revisionId?.id) {
|
||||
throw new HttpError(
|
||||
HttpStatusCode.NOT_FOUND,
|
||||
"not found revisionId: " + requestBody.id,
|
||||
);
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found revisionId: " + requestBody.id);
|
||||
}
|
||||
const listRootId = await this.orgRootRepository.find({
|
||||
where: { orgRevisionId: requestBody.id },
|
||||
|
|
@ -1550,7 +1541,6 @@ export class OrganizationController extends Controller {
|
|||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found type: " + requestBody.type);
|
||||
}
|
||||
return new HttpSuccess();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1919,8 +1909,7 @@ export class OrganizationController extends Controller {
|
|||
deptID: orgChild4.id,
|
||||
type: 5,
|
||||
// heads:
|
||||
totalPositionCount:
|
||||
await this.posMasterRepository.count({
|
||||
totalPositionCount: await this.posMasterRepository.count({
|
||||
where: {
|
||||
orgRevisionId: data.id,
|
||||
orgRootId: orgRoot.id,
|
||||
|
|
@ -2739,7 +2728,6 @@ export class OrganizationController extends Controller {
|
|||
default:
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found type: ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2805,7 +2793,6 @@ export class OrganizationController extends Controller {
|
|||
default:
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found type: " + requestBody.node);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2834,7 +2821,6 @@ export class OrganizationController extends Controller {
|
|||
],
|
||||
});
|
||||
return new HttpSuccess(data);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2856,7 +2842,6 @@ export class OrganizationController extends Controller {
|
|||
where: { orgRevisionId: orgRevisionActive.id },
|
||||
});
|
||||
return new HttpSuccess(data.map((x) => x.id));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2878,7 +2863,6 @@ export class OrganizationController extends Controller {
|
|||
],
|
||||
});
|
||||
return new HttpSuccess(data);
|
||||
|
||||
}
|
||||
/**
|
||||
* API หา revision ล่าสุด
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue