สร้างแบบประเมินส่งค่า profile id
This commit is contained in:
parent
5cb9bd2372
commit
983a4e79f7
2 changed files with 34 additions and 14 deletions
|
|
@ -202,19 +202,39 @@ export class KpiUserEvaluationController extends Controller {
|
|||
}
|
||||
|
||||
const kpiUserEvaluation = Object.assign(new KpiUserEvaluation(), requestBody);
|
||||
await new CallAPI()
|
||||
.GetData(request, "org/profile/keycloak/position")
|
||||
.then((x) => {
|
||||
kpiUserEvaluation.profileId = x.profileId;
|
||||
kpiUserEvaluation.prefix = x.prefix;
|
||||
kpiUserEvaluation.firstName = x.firstName;
|
||||
kpiUserEvaluation.lastName = x.lastName;
|
||||
kpiUserEvaluation.position = x.position;
|
||||
kpiUserEvaluation.posLevelName = x.posLevelName;
|
||||
kpiUserEvaluation.posTypeName = x.posTypeName;
|
||||
kpiUserEvaluation.posExecutiveName = x.posExecutiveName;
|
||||
})
|
||||
.catch((x) => {});
|
||||
if (requestBody.profileId == undefined || requestBody.profileId == null) {
|
||||
await new CallAPI()
|
||||
.GetData(request, "org/profile/profileid/position/" + requestBody.profileId)
|
||||
.then((x) => {
|
||||
kpiUserEvaluation.profileId = x.profileId;
|
||||
kpiUserEvaluation.prefix = x.prefix;
|
||||
kpiUserEvaluation.firstName = x.firstName;
|
||||
kpiUserEvaluation.lastName = x.lastName;
|
||||
kpiUserEvaluation.position = x.position;
|
||||
kpiUserEvaluation.posLevelName = x.posLevelName;
|
||||
kpiUserEvaluation.posTypeName = x.posTypeName;
|
||||
kpiUserEvaluation.posExecutiveName = x.posExecutiveName;
|
||||
})
|
||||
.catch((x) => {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลในทะเบียนประวัติ");
|
||||
});
|
||||
} else {
|
||||
await new CallAPI()
|
||||
.GetData(request, "org/profile/keycloak/position")
|
||||
.then((x) => {
|
||||
kpiUserEvaluation.profileId = x.profileId;
|
||||
kpiUserEvaluation.prefix = x.prefix;
|
||||
kpiUserEvaluation.firstName = x.firstName;
|
||||
kpiUserEvaluation.lastName = x.lastName;
|
||||
kpiUserEvaluation.position = x.position;
|
||||
kpiUserEvaluation.posLevelName = x.posLevelName;
|
||||
kpiUserEvaluation.posTypeName = x.posTypeName;
|
||||
kpiUserEvaluation.posExecutiveName = x.posExecutiveName;
|
||||
})
|
||||
.catch((x) => {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลในทะเบียนประวัติ");
|
||||
});
|
||||
}
|
||||
kpiUserEvaluation.evaluationStatus = "NEW";
|
||||
kpiUserEvaluation.evaluationResults = "PENDING";
|
||||
kpiUserEvaluation.createdUserId = request.user.sub;
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ export class createKpiUserEvaluation {
|
|||
@Column()
|
||||
kpiPeriodId: string;
|
||||
@Column()
|
||||
profileId: string;
|
||||
profileId?: string | null;
|
||||
@Column()
|
||||
evaluatorId: string | null;
|
||||
@Column()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue