Merge branch 'develop' of github.com:Frappet/hrms-api-org into develop

This commit is contained in:
kittapath 2025-02-17 22:35:12 +07:00
commit d6b4d8bdba
2 changed files with 21 additions and 10 deletions

View file

@ -17,6 +17,7 @@ import { log } from "console";
import { format } from "path";
import { viewProfileEvaluation } from "../entities/view/viewProfileEvaluation";
import { viewProfileEmployeeEvaluation } from "../entities/view/viewProfileEmployeeEvaluation";
import Extension from "../interfaces/extension";
@Route("api/v1/org/unauthorize")
@Tags("OrganizationUnauthorize")
@ -1247,34 +1248,34 @@ export class OrganizationUnauthorizeController extends Controller {
profileId: x.profileId,
yearAPR1: x.yearAPR1,
periodAPR1: x.periodAPR1,
resultAPR1: x.resultAPR1,
resultAPR1: x.resultAPR1?Extension.textPoint(x.resultAPR1):"-",
yearOCT1: x.yearOCT1,
periodOCT1: x.periodOCT1,
resultOCT1: x.resultOCT1,
resultOCT1: x.resultOCT1?Extension.textPoint(x.resultOCT1):"-",
yearAPR2: x.yearAPR2,
periodAPR2: x.periodAPR2,
resultAPR2: x.resultAPR2,
resultAPR2: x.resultAPR2?Extension.textPoint(x.resultAPR2):"-",
yearOCT2: x.yearOCT2,
periodOCT2: x.periodOCT2,
resultOCT2: x.resultOCT2,
resultOCT2: x.resultOCT2?Extension.textPoint(x.resultOCT2):"-",
yearAPR3: x.yearAPR3,
periodAPR3: x.periodAPR3,
resultAPR3: x.resultAPR3,
resultAPR3: x.resultAPR3?Extension.textPoint(x.resultAPR3):"-",
yearOCT3: x.yearOCT3,
periodOCT3: x.periodOCT3,
resultOCT3: x.resultOCT3,
resultOCT3: x.resultOCT3?Extension.textPoint(x.resultOCT3):"-",
yearAPR4: x.yearAPR4,
periodAPR4: x.periodAPR4,
resultAPR4: x.resultAPR4,
resultAPR4: x.resultAPR4?Extension.textPoint(x.resultAPR4):"-",
yearOCT4: x.yearOCT4,
periodOCT4: x.periodOCT4,
resultOCT4: x.resultOCT4,
resultOCT4: x.resultOCT4?Extension.textPoint(x.resultOCT4):"-",
yearAPR5: x.yearAPR5,
periodAPR5: x.periodAPR5,
resultAPR5: x.resultAPR5,
resultAPR5: x.resultAPR5?Extension.textPoint(x.resultAPR5):"-",
yearOCT5: x.yearOCT5,
periodOCT5: x.periodOCT5,
resultOCT5: x.resultOCT5,
resultOCT5: x.resultOCT5?Extension.textPoint(x.resultOCT5):"-",
}));
return new HttpSuccess(formattedResults);

View file

@ -367,6 +367,16 @@ class Extension {
const deleteKey = delAsync(type + id);
return;
}
public static textPoint(val: number | undefined) {
if (val == undefined) val = -1;
if (val >= 0 && val <= 60) return "ต้องปรับปรุง";
if (val >= 60 && val <= 69) return "พอใช้";
if (val >= 70 && val <= 79) return "ดี";
if (val >= 80 && val <= 89) return "ดีมาก";
if (val >= 90 && val <= 100) return "ดีเด่น";
else return "-";
}
}
export default Extension;