This commit is contained in:
parent
a9cfcfc6b9
commit
f66e721fa4
1 changed files with 7 additions and 3 deletions
|
|
@ -4054,7 +4054,7 @@ export class OrganizationDotnetController extends Controller {
|
||||||
if (body.node === 0) {
|
if (body.node === 0) {
|
||||||
typeCondition = {
|
typeCondition = {
|
||||||
orgRootId: body.nodeId,
|
orgRootId: body.nodeId,
|
||||||
orgChild1Id: IsNull(),
|
// orgChild1Id: IsNull(),
|
||||||
};
|
};
|
||||||
} else if (body.node === 1) {
|
} else if (body.node === 1) {
|
||||||
typeCondition = {
|
typeCondition = {
|
||||||
|
|
@ -4112,7 +4112,10 @@ export class OrganizationDotnetController extends Controller {
|
||||||
"current_holders.orgChild4",
|
"current_holders.orgChild4",
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
const startDate = new Date().getFullYear();
|
||||||
|
const endDate = new Date().getFullYear();
|
||||||
|
const startOfYear = new Date(startDate, 0, 1); // 1 ม.ค. ปีนี้
|
||||||
|
const endOfYear = new Date(endDate, 11, 31, 23, 59, 59, 999); // 31 ธ.ค. ปีนี้
|
||||||
if (body.isRetirement) {
|
if (body.isRetirement) {
|
||||||
profile = await this.profileRepo.find({
|
profile = await this.profileRepo.find({
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -4122,7 +4125,7 @@ export class OrganizationDotnetController extends Controller {
|
||||||
// isRetirement: true,
|
// isRetirement: true,
|
||||||
dateRetire: And(
|
dateRetire: And(
|
||||||
Not(IsNull()),
|
Not(IsNull()),
|
||||||
Between(body.startDate, body.endDate)
|
Between(startOfYear, endOfYear)
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
relations: [
|
relations: [
|
||||||
|
|
@ -4137,6 +4140,7 @@ export class OrganizationDotnetController extends Controller {
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
let findRevision = await this.orgRevisionRepo.findOne({
|
let findRevision = await this.orgRevisionRepo.findOne({
|
||||||
where: { orgRevisionIsCurrent: true },
|
where: { orgRevisionIsCurrent: true },
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue