Skip to content

Commit

Permalink
fix: 보고서 이름에 교수님성함이 포함되도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jcy0308 committed Oct 18, 2024
1 parent 9158320 commit 9818b7d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/modules/reviews/reviews.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export class ReviewsService {
const key = v1();
const createdAt = new Date();
await this.kafkaProducer.sendMessage("pdf-topic-dev", reviewId, formatHtml, {
originalName: studentName + "_" + fileName.replace("_양식.html", ".pdf"),
originalName: studentName + "_" + fileName.replace("_양식.html", "심사결과보고서.pdf"),
uuid: key,
});
// await convertHTMLToPDF(formatHtml, async (pdf) => {
Expand All @@ -291,7 +291,7 @@ export class ReviewsService {
return resolve(
await this.prismaService.file.create({
data: {
name: studentName + "_" + fileName.replace("_양식.html", ".pdf"),
name: studentName + "_" + fileName.replace("_양식.html", "심사결과보고서.pdf"),
mimeType: "application/pdf",
uuid: key,
createdAt: createdAt,
Expand All @@ -306,7 +306,7 @@ export class ReviewsService {
}
}

async buildReportPdf(reviewId, replacer, isMain, studentName: string) {
async buildReportPdf(reviewId, replacer, isMain, studentName: string, professorName: string) {
const fileName = (isMain ? "" : "예비") + "심사보고서_양식.html";
const filePath = path.join("resources", "format", fileName);
try {
Expand Down Expand Up @@ -342,14 +342,14 @@ export class ReviewsService {
// );
// });
await this.kafkaProducer.sendMessage("pdf-topic-dev", reviewId.toString(), formatHtml, {
originalName: studentName + "_" + fileName.replace("_양식.html", ".pdf"),
originalName: studentName + "_심사보고서_" + professorName + fileName.replace("_양식.html", ".pdf"),
uuid: key,
});

return resolve(
await this.prismaService.file.create({
data: {
name: studentName + "_" + fileName.replace("_양식.html", ".pdf"),
name: studentName + "_심사보고서_" + professorName + fileName.replace("_양식.html", ".pdf"),
mimeType: "application/pdf",
uuid: key,
createdAt: createdAt,
Expand Down Expand Up @@ -764,7 +764,8 @@ export class ReviewsService {
foundReview.id,
replacer,
isMain,
foundReview.thesisInfo.process.student.name
foundReview.thesisInfo.process.student.name,
foundReview.reviewer.name
);
} //내용심사 & 구두심사 중 하나라도 보류중인 경우 파일생성없이 comment와 상태만 업데이트
} else if (foundReview.thesisInfo.stage == Stage.PRELIMINARY) {
Expand All @@ -788,7 +789,8 @@ export class ReviewsService {
foundReview.id,
replacer,
isMain,
foundReview.thesisInfo.process.student.name
foundReview.thesisInfo.process.student.name,
foundReview.reviewer.name
);
}
}
Expand Down

0 comments on commit 9818b7d

Please sign in to comment.