หา สกก1

This commit is contained in:
mamoss 2025-09-15 16:24:07 +07:00
parent 9b785cc119
commit b90e4114a8

View file

@ -7723,8 +7723,33 @@ export class OrganizationController extends Controller {
where: { where: {
orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true }, orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true },
orgRoot: { isCommission: true }, orgRoot: { isCommission: true },
orgChild1Id: IsNull(),
isDirector: true, isDirector: true,
current_holderId: Not(IsNull()), current_holderId: Not(IsNull()),
// posMasterActs: { statusReport: "DONE" },
// posMasterActChilds: { statusReport: "DONE" },
},
order: { posMasterOrder: "ASC", posMasterActChilds: { posMasterOrder: "ASC" } },
relations: [
"current_holder",
// "posMasterActChilds",
// "posMasterActChilds.posMasterChild",
// "posMasterActChilds.posMasterChild.current_holder",
],
});
if (posMaster.length <= 0) {
return new HttpSuccess({
name: "......................................................",
position: "......................................................",
});
}
if (posMaster[0].current_holder == null) {
const posMaster = await this.posMasterRepository.find({
where: {
orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true },
orgRoot: { isCommission: true },
orgChild1Id: IsNull(),
isDirector: true,
posMasterActs: { statusReport: "DONE" }, posMasterActs: { statusReport: "DONE" },
posMasterActChilds: { statusReport: "DONE" }, posMasterActChilds: { statusReport: "DONE" },
}, },
@ -7736,13 +7761,6 @@ export class OrganizationController extends Controller {
"posMasterActChilds.posMasterChild.current_holder", "posMasterActChilds.posMasterChild.current_holder",
], ],
}); });
if (posMaster.length <= 0) {
return new HttpSuccess({
name: "......................................................",
position: "......................................................",
});
}
if (posMaster[0].current_holder == null) {
if ( if (
posMaster[0].posMasterActChilds.length <= 0 || posMaster[0].posMasterActChilds.length <= 0 ||
posMaster[0].posMasterActChilds[0].posMasterChild == null || posMaster[0].posMasterActChilds[0].posMasterChild == null ||