fix user/evaluation
This commit is contained in:
parent
02cd84a436
commit
0968f4d14e
1 changed files with 11 additions and 1 deletions
|
|
@ -737,13 +737,23 @@ export class KpiUserEvaluationController extends Controller {
|
||||||
@Query("keyword") keyword?: string,
|
@Query("keyword") keyword?: string,
|
||||||
@Query("status") status?: string,
|
@Query("status") status?: string,
|
||||||
) {
|
) {
|
||||||
|
let profileId: any = null;
|
||||||
|
await new CallAPI()
|
||||||
|
.GetData(request, "org/profile/keycloak/position")
|
||||||
|
.then((x) => {
|
||||||
|
profileId = x.profileId;
|
||||||
|
})
|
||||||
|
.catch((x) => {
|
||||||
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลในทะเบียนประวัติ");
|
||||||
|
});
|
||||||
const [kpiUserEvaluation, total] = await AppDataSource.getRepository(KpiUserEvaluation)
|
const [kpiUserEvaluation, total] = await AppDataSource.getRepository(KpiUserEvaluation)
|
||||||
.createQueryBuilder("kpiUserEvaluation")
|
.createQueryBuilder("kpiUserEvaluation")
|
||||||
.leftJoinAndSelect("kpiUserEvaluation.kpiPeriod", "kpiPeriod")
|
.leftJoinAndSelect("kpiUserEvaluation.kpiPeriod", "kpiPeriod")
|
||||||
.andWhere(kpiPeriodId ? "kpiPeriodId LIKE :kpiPeriodId" : "1=1", {
|
.andWhere(kpiPeriodId ? "kpiPeriodId LIKE :kpiPeriodId" : "1=1", {
|
||||||
kpiPeriodId: kpiPeriodId,
|
kpiPeriodId: kpiPeriodId,
|
||||||
})
|
})
|
||||||
.andWhere({ createdUserId: request.user.sub })
|
// .andWhere({ createdUserId: request.user.sub })
|
||||||
|
.andWhere({ profileId : profileId })
|
||||||
.andWhere(
|
.andWhere(
|
||||||
status == null || status == undefined ? "1=1" : "evaluationStatus LIKE :evaluationStatus",
|
status == null || status == undefined ? "1=1" : "evaluationStatus LIKE :evaluationStatus",
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue