fixing result
This commit is contained in:
parent
e9321501bf
commit
d69872d421
1 changed files with 35 additions and 38 deletions
|
|
@ -214,26 +214,15 @@ export class EvaluateResultController extends Controller {
|
|||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลผู้ดูแล");
|
||||
}
|
||||
const director_id = director.personal_id;
|
||||
let evaluate: any = null;
|
||||
if (evaluate_no) {
|
||||
evaluate = await this.evaluateResultRepository.findOne({
|
||||
where: {
|
||||
director_id,
|
||||
assign_id,
|
||||
no: evaluate_no,
|
||||
},
|
||||
});
|
||||
// if (!evaluate) {
|
||||
// throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลแบบประเมิน");
|
||||
// }
|
||||
} else {
|
||||
evaluate = await this.evaluateResultRepository.findOne({
|
||||
where: {
|
||||
director_id,
|
||||
assign_id,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
const evaluate = await this.evaluateResultRepository.findOne({
|
||||
where: {
|
||||
director_id,
|
||||
assign_id,
|
||||
no: evaluate_no ?? "1",
|
||||
},
|
||||
});
|
||||
|
||||
if (!evaluate) {
|
||||
return new HttpSuccess(null);
|
||||
}
|
||||
|
|
@ -302,26 +291,34 @@ export class EvaluateResultController extends Controller {
|
|||
}
|
||||
}
|
||||
|
||||
const commanderData = await (directorData.find((x) => x.role == "commander") ?? null);
|
||||
// const commanderData = await (directorData.find((x) => x.role == "commander") ?? null);
|
||||
|
||||
const commander =
|
||||
commanderData != null
|
||||
? {
|
||||
personal_id: commanderData.personal_id,
|
||||
dated: commanderData.dated,
|
||||
name: commanderData.fullname,
|
||||
label:
|
||||
commanderData.fullname +
|
||||
" " +
|
||||
(commanderData.position
|
||||
? `(${commanderData.position}${commanderData.posLevel})`
|
||||
: ""),
|
||||
position: commanderData.position + commanderData.posLevel,
|
||||
posType: commanderData.posType,
|
||||
posLevel: commanderData.posLevel,
|
||||
}
|
||||
: null;
|
||||
// const commander =
|
||||
// commanderData != null
|
||||
// ? {
|
||||
// personal_id: commanderData.personal_id,
|
||||
// dated: commanderData.dated,
|
||||
// name: commanderData.fullname,
|
||||
// label:
|
||||
// commanderData.fullname +
|
||||
// " " +
|
||||
// (commanderData.position
|
||||
// ? `(${commanderData.position}${commanderData.posLevel})`
|
||||
// : ""),
|
||||
// position: commanderData.position + commanderData.posLevel,
|
||||
// posType: commanderData.posType,
|
||||
// posLevel: commanderData.posLevel,
|
||||
// }
|
||||
// : null;
|
||||
|
||||
const commander = {
|
||||
dated: evaluate.authority_dated,
|
||||
name: evaluate.authority_name,
|
||||
|
||||
position: evaluate.authority_pos + evaluate.authority_level,
|
||||
posType: evaluate.authority_type,
|
||||
posLevel: evaluate.authority_level,
|
||||
};
|
||||
const chairmanData = await (directorData.find((x) => x.role == "chairman") ?? null);
|
||||
const chairman =
|
||||
chairmanData != null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue