Merge branch 'develop' into adiDev
This commit is contained in:
commit
5b7bf01e9f
4 changed files with 43 additions and 16 deletions
|
|
@ -66,7 +66,9 @@ async function main() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const cronTime_Oct = "0 0 1 10 *";
|
// const cronTime_Oct = "0 0 1 10 *";
|
||||||
|
// Test #1892
|
||||||
|
const cronTime_Oct = "0 0 30 10 *";
|
||||||
cron.schedule(cronTime_Oct, async () => {
|
cron.schedule(cronTime_Oct, async () => {
|
||||||
try {
|
try {
|
||||||
const commandController = new CommandController();
|
const commandController = new CommandController();
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ export class ExRetirementController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get("/document/{documentId}")
|
@Get("/document/{documentId}")
|
||||||
async getDocument(@Path("documentId") officerDocumentID: string) {
|
async getDocument(@Path("documentId") officerDocumentID: string, @Request() req: any) {
|
||||||
let retryCount = 0;
|
let retryCount = 0;
|
||||||
const maxRetries = 2;
|
const maxRetries = 2;
|
||||||
while (retryCount < maxRetries) {
|
while (retryCount < maxRetries) {
|
||||||
|
|
@ -118,8 +118,18 @@ export class ExRetirementController extends Controller {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${token}`,
|
Authorization: `Bearer ${token}`,
|
||||||
},
|
},
|
||||||
|
responseType: "arraybuffer",
|
||||||
});
|
});
|
||||||
return res.data;
|
|
||||||
|
if (!req.res.headersSent && !req.res.destroyed) {
|
||||||
|
// Set response headers
|
||||||
|
req.res.setHeader("Content-Type", "application/pdf");
|
||||||
|
req.res.setHeader("Content-Disposition", `inline; filename="${officerDocumentID}.pdf"`);
|
||||||
|
req.res.setHeader("Content-Length", res.data.byteLength.toString());
|
||||||
|
|
||||||
|
req.res.end(Buffer.from(res.data));
|
||||||
|
return;
|
||||||
|
}
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
if (error.response?.status === 500 && retryCount < maxRetries - 1) {
|
if (error.response?.status === 500 && retryCount < maxRetries - 1) {
|
||||||
TokenCache.delete(`${clientId}:${clientSecret}`);
|
TokenCache.delete(`${clientId}:${clientSecret}`);
|
||||||
|
|
|
||||||
|
|
@ -7365,40 +7365,45 @@ export class ProfileController extends Controller {
|
||||||
nodeDnaId: null,
|
nodeDnaId: null,
|
||||||
type: profile.employeeClass,
|
type: profile.employeeClass,
|
||||||
salary: profile.amount,
|
salary: profile.amount,
|
||||||
posNo:
|
posNo: null
|
||||||
root?.orgRootShortName && posMaster?.posMasterNo
|
// root?.orgRootShortName && posMaster?.posMasterNo
|
||||||
? `${root?.orgRootShortName} ${posMaster?.posMasterNo}`
|
// ? `${root?.orgRootShortName} ${posMaster?.posMasterNo}`
|
||||||
: "",
|
// : "",
|
||||||
};
|
};
|
||||||
if (_profile.child4Id != null) {
|
if (_profile.child4Id != null) {
|
||||||
_profile.node = 4;
|
_profile.node = 4;
|
||||||
_profile.nodeId = _profile.child4Id;
|
_profile.nodeId = _profile.child4Id;
|
||||||
_profile.nodeDnaId = _profile.child4DnaId;
|
_profile.nodeDnaId = _profile.child4DnaId;
|
||||||
_profile.nodeShortName = _profile.child4ShortName;
|
_profile.nodeShortName = _profile.child4ShortName;
|
||||||
|
_profile.posNo = `${_profile.child4ShortName} ${_profile.posMasterNo}`;
|
||||||
} else if (_profile.child3Id != null) {
|
} else if (_profile.child3Id != null) {
|
||||||
_profile.node = 3;
|
_profile.node = 3;
|
||||||
_profile.nodeId = _profile.child3Id;
|
_profile.nodeId = _profile.child3Id;
|
||||||
_profile.nodeDnaId = _profile.child3DnaId;
|
_profile.nodeDnaId = _profile.child3DnaId;
|
||||||
_profile.nodeShortName = _profile.child3ShortName;
|
_profile.nodeShortName = _profile.child3ShortName;
|
||||||
|
_profile.posNo = `${_profile.child3ShortName} ${_profile.posMasterNo}`;
|
||||||
} else if (_profile.child2Id != null) {
|
} else if (_profile.child2Id != null) {
|
||||||
_profile.node = 2;
|
_profile.node = 2;
|
||||||
_profile.nodeId = _profile.child2Id;
|
_profile.nodeId = _profile.child2Id;
|
||||||
_profile.nodeDnaId = _profile.child2DnaId;
|
_profile.nodeDnaId = _profile.child2DnaId;
|
||||||
_profile.nodeShortName = _profile.child2ShortName;
|
_profile.nodeShortName = _profile.child2ShortName;
|
||||||
|
_profile.posNo = `${_profile.child2ShortName} ${_profile.posMasterNo}`;
|
||||||
} else if (_profile.child1Id != null) {
|
} else if (_profile.child1Id != null) {
|
||||||
_profile.node = 1;
|
_profile.node = 1;
|
||||||
_profile.nodeId = _profile.child1Id;
|
_profile.nodeId = _profile.child1Id;
|
||||||
_profile.nodeDnaId = _profile.child1DnaId;
|
_profile.nodeDnaId = _profile.child1DnaId;
|
||||||
_profile.nodeShortName = _profile.child1ShortName;
|
_profile.nodeShortName = _profile.child1ShortName;
|
||||||
|
_profile.posNo = `${_profile.child1ShortName} ${_profile.posMasterNo}`;
|
||||||
} else if (_profile.rootId != null) {
|
} else if (_profile.rootId != null) {
|
||||||
_profile.node = 0;
|
_profile.node = 0;
|
||||||
_profile.nodeId = _profile.rootId;
|
_profile.nodeId = _profile.rootId;
|
||||||
_profile.nodeDnaId = _profile.rootDnaId;
|
_profile.nodeDnaId = _profile.rootDnaId;
|
||||||
_profile.nodeShortName = _profile.rootShortName;
|
_profile.nodeShortName = _profile.rootShortName;
|
||||||
|
_profile.posNo = `${_profile.rootShortName} ${_profile.posMasterNo}`;
|
||||||
}
|
}
|
||||||
return new HttpSuccess(_profile);
|
return new HttpSuccess(_profile);
|
||||||
}
|
}
|
||||||
|
// ขรก.
|
||||||
let orgRevisionPublish: any = await this.orgRevisionRepo
|
let orgRevisionPublish: any = await this.orgRevisionRepo
|
||||||
.createQueryBuilder("orgRevision")
|
.createQueryBuilder("orgRevision")
|
||||||
.where("orgRevision.orgRevisionIsDraft = false")
|
.where("orgRevision.orgRevisionIsDraft = false")
|
||||||
|
|
@ -7529,10 +7534,10 @@ export class ProfileController extends Controller {
|
||||||
nodeDnaId: null,
|
nodeDnaId: null,
|
||||||
salary: profile ? profile.amount : null,
|
salary: profile ? profile.amount : null,
|
||||||
amountSpecial: profile ? profile.amountSpecial : null,
|
amountSpecial: profile ? profile.amountSpecial : null,
|
||||||
posNo:
|
posNo: null
|
||||||
root?.orgRootShortName && posMaster?.posMasterNo
|
// root?.orgRootShortName && posMaster?.posMasterNo
|
||||||
? `${root?.orgRootShortName} ${posMaster?.posMasterNo}`
|
// ? `${root?.orgRootShortName} ${posMaster?.posMasterNo}`
|
||||||
: "",
|
// : "",
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_profile.child4Id != null) {
|
if (_profile.child4Id != null) {
|
||||||
|
|
@ -7540,26 +7545,31 @@ export class ProfileController extends Controller {
|
||||||
_profile.nodeId = _profile.child4Id;
|
_profile.nodeId = _profile.child4Id;
|
||||||
_profile.nodeDnaId = _profile.child4DnaId;
|
_profile.nodeDnaId = _profile.child4DnaId;
|
||||||
_profile.nodeShortName = _profile.child4ShortName;
|
_profile.nodeShortName = _profile.child4ShortName;
|
||||||
|
_profile.posNo = `${_profile.child4ShortName} ${posMaster?.posMasterNo}`;
|
||||||
} else if (_profile.child3Id != null) {
|
} else if (_profile.child3Id != null) {
|
||||||
_profile.node = 3;
|
_profile.node = 3;
|
||||||
_profile.nodeId = _profile.child3Id;
|
_profile.nodeId = _profile.child3Id;
|
||||||
_profile.nodeDnaId = _profile.child3DnaId;
|
_profile.nodeDnaId = _profile.child3DnaId;
|
||||||
_profile.nodeShortName = _profile.child3ShortName;
|
_profile.nodeShortName = _profile.child3ShortName;
|
||||||
|
_profile.posNo = `${_profile.child3ShortName} ${posMaster?.posMasterNo}`;
|
||||||
} else if (_profile.child2Id != null) {
|
} else if (_profile.child2Id != null) {
|
||||||
_profile.node = 2;
|
_profile.node = 2;
|
||||||
_profile.nodeId = _profile.child2Id;
|
_profile.nodeId = _profile.child2Id;
|
||||||
_profile.nodeDnaId = _profile.child2DnaId;
|
_profile.nodeDnaId = _profile.child2DnaId;
|
||||||
_profile.nodeShortName = _profile.child2ShortName;
|
_profile.nodeShortName = _profile.child2ShortName;
|
||||||
|
_profile.posNo = `${_profile.child2ShortName} ${posMaster?.posMasterNo}`;
|
||||||
} else if (_profile.child1Id != null) {
|
} else if (_profile.child1Id != null) {
|
||||||
_profile.node = 1;
|
_profile.node = 1;
|
||||||
_profile.nodeId = _profile.child1Id;
|
_profile.nodeId = _profile.child1Id;
|
||||||
_profile.nodeDnaId = _profile.child1DnaId;
|
_profile.nodeDnaId = _profile.child1DnaId;
|
||||||
_profile.nodeShortName = _profile.child1ShortName;
|
_profile.nodeShortName = _profile.child1ShortName;
|
||||||
|
_profile.posNo = `${_profile.child1ShortName} ${posMaster?.posMasterNo}`;
|
||||||
} else if (_profile.rootId != null) {
|
} else if (_profile.rootId != null) {
|
||||||
_profile.node = 0;
|
_profile.node = 0;
|
||||||
_profile.nodeId = _profile.rootId;
|
_profile.nodeId = _profile.rootId;
|
||||||
_profile.nodeDnaId = _profile.rootDnaId;
|
_profile.nodeDnaId = _profile.rootDnaId;
|
||||||
_profile.nodeShortName = _profile.rootShortName;
|
_profile.nodeShortName = _profile.rootShortName;
|
||||||
|
_profile.posNo = `${_profile.rootShortName} ${posMaster?.posMasterNo}`;
|
||||||
}
|
}
|
||||||
return new HttpSuccess(_profile);
|
return new HttpSuccess(_profile);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3588,36 +3588,41 @@ export class ProfileEmployeeController extends Controller {
|
||||||
nodeDnaId: null,
|
nodeDnaId: null,
|
||||||
salary: profile ? profile.amount : null,
|
salary: profile ? profile.amount : null,
|
||||||
amountSpecial: profile ? profile.amountSpecial : null,
|
amountSpecial: profile ? profile.amountSpecial : null,
|
||||||
posNo:
|
posNo: null
|
||||||
root?.orgRootShortName && posMaster?.posMasterNo
|
// root?.orgRootShortName && posMaster?.posMasterNo
|
||||||
? `${root?.orgRootShortName} ${posMaster?.posMasterNo}`
|
// ? `${root?.orgRootShortName} ${posMaster?.posMasterNo}`
|
||||||
: "",
|
// : "",
|
||||||
};
|
};
|
||||||
if (_profile.child4Id != null) {
|
if (_profile.child4Id != null) {
|
||||||
_profile.node = 4;
|
_profile.node = 4;
|
||||||
_profile.nodeId = _profile.child4Id;
|
_profile.nodeId = _profile.child4Id;
|
||||||
_profile.nodeDnaId = _profile.child4DnaId;
|
_profile.nodeDnaId = _profile.child4DnaId;
|
||||||
_profile.nodeShortName = _profile.child4ShortName;
|
_profile.nodeShortName = _profile.child4ShortName;
|
||||||
|
_profile.posNo = `${_profile.child4ShortName} ${_profile.posMasterNo}`;
|
||||||
} else if (_profile.child3Id != null) {
|
} else if (_profile.child3Id != null) {
|
||||||
_profile.node = 3;
|
_profile.node = 3;
|
||||||
_profile.nodeId = _profile.child3Id;
|
_profile.nodeId = _profile.child3Id;
|
||||||
_profile.nodeDnaId = _profile.child3DnaId;
|
_profile.nodeDnaId = _profile.child3DnaId;
|
||||||
_profile.nodeShortName = _profile.child3ShortName;
|
_profile.nodeShortName = _profile.child3ShortName;
|
||||||
|
_profile.posNo = `${_profile.child3ShortName} ${_profile.posMasterNo}`;
|
||||||
} else if (_profile.child2Id != null) {
|
} else if (_profile.child2Id != null) {
|
||||||
_profile.node = 2;
|
_profile.node = 2;
|
||||||
_profile.nodeId = _profile.child2Id;
|
_profile.nodeId = _profile.child2Id;
|
||||||
_profile.nodeDnaId = _profile.child2DnaId;
|
_profile.nodeDnaId = _profile.child2DnaId;
|
||||||
_profile.nodeShortName = _profile.child2ShortName;
|
_profile.nodeShortName = _profile.child2ShortName;
|
||||||
|
_profile.posNo = `${_profile.child2ShortName} ${_profile.posMasterNo}`;
|
||||||
} else if (_profile.child1Id != null) {
|
} else if (_profile.child1Id != null) {
|
||||||
_profile.node = 1;
|
_profile.node = 1;
|
||||||
_profile.nodeId = _profile.child1Id;
|
_profile.nodeId = _profile.child1Id;
|
||||||
_profile.nodeDnaId = _profile.child1DnaId;
|
_profile.nodeDnaId = _profile.child1DnaId;
|
||||||
_profile.nodeShortName = _profile.child1ShortName;
|
_profile.nodeShortName = _profile.child1ShortName;
|
||||||
|
_profile.posNo = `${_profile.child1ShortName} ${_profile.posMasterNo}`;
|
||||||
} else if (_profile.rootId != null) {
|
} else if (_profile.rootId != null) {
|
||||||
_profile.node = 0;
|
_profile.node = 0;
|
||||||
_profile.nodeId = _profile.rootId;
|
_profile.nodeId = _profile.rootId;
|
||||||
_profile.nodeDnaId = _profile.rootDnaId;
|
_profile.nodeDnaId = _profile.rootDnaId;
|
||||||
_profile.nodeShortName = _profile.rootShortName;
|
_profile.nodeShortName = _profile.rootShortName;
|
||||||
|
_profile.posNo = `${_profile.rootShortName} ${_profile.posMasterNo}`;
|
||||||
}
|
}
|
||||||
return new HttpSuccess(_profile);
|
return new HttpSuccess(_profile);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue