Merge branch 'develop' into adiDev

This commit is contained in:
AdisakKanthawilang 2024-10-22 10:29:02 +07:00
commit 66cce71f1d
79 changed files with 673 additions and 294 deletions

View file

@ -732,6 +732,7 @@ export class OrganizationController extends Controller {
// )
.select([
"orgRoot.id",
"orgRoot.isDeputy",
"orgRoot.orgRootName",
"orgRoot.orgRootShortName",
"orgRoot.orgRootCode",
@ -906,6 +907,7 @@ export class OrganizationController extends Controller {
orgRootName: orgRoot.orgRootName,
responsibility: orgRoot.responsibility,
isOfficer: false,
isDeputy: orgRoot.isDeputy,
labelName:
orgRoot.orgRootName + " " + orgRoot.orgRootCode + "00" + " " + orgRoot.orgRootShortName,
totalPosition: await this.posMasterRepository.count({
@ -1552,6 +1554,7 @@ export class OrganizationController extends Controller {
})
.select([
"orgRoot.id",
"orgRoot.isDeputy",
"orgRoot.orgRootName",
"orgRoot.orgRootShortName",
"orgRoot.orgRootCode",
@ -1685,6 +1688,7 @@ export class OrganizationController extends Controller {
orgTreeFax: orgRoot.orgRootFax,
orgRevisionId: orgRoot.orgRevisionId,
orgRootName: orgRoot.orgRootName,
isDeputy: orgRoot.isDeputy,
responsibility: orgRoot.responsibility,
labelName:
orgRoot.orgRootName + " " + orgRoot.orgRootCode + "00" + " " + orgRoot.orgRootShortName,
@ -2322,6 +2326,7 @@ export class OrganizationController extends Controller {
)
.select([
"orgRoot.id",
"orgRoot.isDeputy",
"orgRoot.orgRootName",
"orgRoot.orgRootShortName",
"orgRoot.orgRootCode",
@ -2495,6 +2500,7 @@ export class OrganizationController extends Controller {
orgTreeFax: orgRoot.orgRootFax,
orgRevisionId: orgRoot.orgRevisionId,
orgRootName: orgRoot.orgRootName,
isDeputy:orgRoot.isDeputy,
responsibility: orgRoot.responsibility,
labelName:
orgRoot.orgRootName + " " + orgRoot.orgRootCode + "00" + " " + orgRoot.orgRootShortName,
@ -6561,6 +6567,24 @@ export class OrganizationController extends Controller {
const check = orgRevision.orgChild1s.find((x) => x.isOfficer == true);
return new HttpSuccess(check != null);
}
/**
* API org
*
* @summary - org (ADMIN)
*
*/
@Get("check/root/{id}")
async findIsDeputyRoot(@Path() id: string, @Request() request: RequestWithUser) {
const orgRevision = await this.orgRevisionRepository.findOne({
where: { id },
relations: ["orgRoots"],
});
if (!orgRevision) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
}
const check = orgRevision.orgRoots.find((x) => x.isDeputy == true);
return new HttpSuccess(check != null);
}
public async listAuthSysOrgFuncByRevisionIdN(
request: RequestWithUser,
system: string,