diff --git "a/resources/format/\354\213\254\354\202\254\352\262\260\352\263\274\353\263\264\352\263\240\354\204\234_\354\226\221\354\213\235.html" "b/resources/format/\354\213\254\354\202\254\352\262\260\352\263\274\353\263\264\352\263\240\354\204\234_\354\226\221\354\213\235.html" index b346d87..8114870 100644 --- "a/resources/format/\354\213\254\354\202\254\352\262\260\352\263\274\353\263\264\352\263\240\354\204\234_\354\226\221\354\213\235.html" +++ "b/resources/format/\354\213\254\354\202\254\352\262\260\352\263\274\353\263\264\352\263\240\354\204\234_\354\226\221\354\213\235.html" @@ -191,7 +191,7 @@
논문제출자 - Dissertion + Thesis Submitter |
diff --git a/src/modules/reviews/dtos/review.dto.ts b/src/modules/reviews/dtos/review.dto.ts index 1dbf40e..11e0ecc 100644 --- a/src/modules/reviews/dtos/review.dto.ts +++ b/src/modules/reviews/dtos/review.dto.ts @@ -71,6 +71,7 @@ export class OtherReviewDto { this.name = otherReview.reviewer.name; this.presentationResult = otherReview.presentationStatus; this.contentResult = otherReview.contentStatus; + this.comment = otherReview.comment; if (otherReview.file) this.file = otherReview.file; else this.file = null; } @@ -84,6 +85,9 @@ export class OtherReviewDto { @ApiProperty({ description: "구두 심사결과", enum: Summary }) contentResult: Summary; + @ApiProperty({ description: "심사 의견" }) + comment: string; + @ApiProperty({ description: "심사 의견 파일" }) file: File; } diff --git a/src/modules/reviews/reviews.service.ts b/src/modules/reviews/reviews.service.ts index 4b8c34c..61e5aa7 100644 --- a/src/modules/reviews/reviews.service.ts +++ b/src/modules/reviews/reviews.service.ts @@ -697,7 +697,7 @@ export class ReviewsService { return file.fileId == null; }); if (submitted.length != 0) { - throw new BadRequestException("논문 제출이 완료되지 않은 학생은 심사할 수 없습니다."); + throw new BadRequestException("미제출파일이 있는 학생은 심사할 수 없습니다."); } if (!foundReview) throw new NotFoundException("존재하지 않는 심사정보입니다"); if (userType == UserType.PROFESSOR && foundReview.reviewerId != userId) { @@ -1080,6 +1080,7 @@ export class ReviewsService { const otherReviews = await this.prismaService.review.findMany({ where: { thesisInfoId: foundReview.thesisInfoId, + isFinal: false, }, }); const notSubmitted = otherReviews.filter((review) => { @@ -1544,7 +1545,7 @@ export class ReviewsService { }, ...(searchQuery.stage && { stage: searchQuery.stage }), ...(searchQuery.title && { title: { contains: searchQuery.title } }), - summary: { in: [Summary.PENDING, Summary.UNEXAMINED] }, + // summary: { in: [Summary.PENDING, Summary.UNEXAMINED] }, }, include: { process: { diff --git a/src/modules/students/students.service.ts b/src/modules/students/students.service.ts index 27c63e6..94b5757 100644 --- a/src/modules/students/students.service.ts +++ b/src/modules/students/students.service.ts @@ -433,10 +433,12 @@ export class StudentsService { where: { id: mainThesisInfo.id }, data: { title: thesisTitle }, }); - await tx.thesisInfo.update({ - where: { id: revisionThesisInfo.id }, - data: { title: thesisTitle }, - }); + if (revisionThesisInfo) { + await tx.thesisInfo.update({ + where: { id: revisionThesisInfo.id }, + data: { title: thesisTitle }, + }); + } } // 지도 정보 수정 (reviewer, review) @@ -1028,7 +1030,7 @@ export class StudentsService { return students; }, { - timeout: 10000, + timeout: 40000, } ); } @@ -1572,9 +1574,9 @@ export class StudentsService { (thesisFile) => thesisFile.type === ThesisFileType.PRESENTATION )[0]; - const [thesisInfo] = await this.prismaService.$transaction([ + const thesisInfo = await this.prismaService.$transaction(async (tx) => { // 본심 논문 정보 업데이트 - this.prismaService.thesisInfo.update({ + const thesisData = await tx.thesisInfo.update({ where: { id: mainThesisInfo.id }, data: { title, @@ -1600,17 +1602,21 @@ export class StudentsService { include: { file: true }, }, }, - }), - // 수정지시사항 논문 정보 업데이트 - this.prismaService.thesisInfo.update({ - where: { id: revisionThesisInfo.id }, - data: { - title, - abstract, - }, - }), - ]); + }); + if (revisionThesisInfo) { + // 수정지시사항 논문 정보 업데이트 : 수정 지시시항 포함 학과만!! + await tx.thesisInfo.update({ + where: { id: revisionThesisInfo.id }, + data: { + title, + abstract, + }, + }); + } + + return thesisData; + }); return thesisInfo; } // 수정 지시사항 반영 단계일 경우 else if (currentStage === Stage.REVISION) { @@ -1723,15 +1729,6 @@ export class StudentsService { }); if (foundReviewer) throw new BadRequestException("이미 해당 학생에 배정된 교수입니다."); - // 인원수 초과 확인 - const currentReviewers = await this.prismaService.reviewer.findMany({ - where: { - processId: process.id, - role, - }, - }); - if (currentReviewers.length === 2) throw new BadRequestException(`${role}가 이미 2명이므로 추가할 수 없습니다.`); - try { await this.prismaService.$transaction(async (tx) => { // reviewer 생성 @@ -1837,16 +1834,6 @@ export class StudentsService { // 심사위원장인지 확인 if (process.headReviewerId === reviewerId) throw new BadRequestException("심사위원장은 배정 취소할 수 없습니다."); - // 해당 역할의 교수가 2명인지 확인 - const reviewerList = await this.prismaService.reviewer.findMany({ - where: { - processId: process.id, - role: foundReviewer.role, - }, - }); - if (reviewerList.length < 2) - throw new BadRequestException(`${foundReviewer.role}이 2명일 때만 배정 취소가 가능합니다.`); - // 배정 취소 (review, reviewer 삭제) try { await this.prismaService.$transaction(async (tx) => { diff --git a/src/modules/theses/theses.service.ts b/src/modules/theses/theses.service.ts index 2c133a8..7bb9472 100644 --- a/src/modules/theses/theses.service.ts +++ b/src/modules/theses/theses.service.ts @@ -78,9 +78,9 @@ export class ThesesService { (thesisInfo) => thesisInfo.stage === Stage.REVISION )[0]; - const [thesisInfo] = await this.prismaService.$transaction([ + const thesisInfo = await this.prismaService.$transaction(async (tx) => { // 본심 논문 정보 업데이트 - this.prismaService.thesisInfo.update({ + const thesisData = tx.thesisInfo.update({ where: { id }, data: { title, @@ -106,16 +106,22 @@ export class ThesesService { include: { file: true }, }, }, - }), - // 수정지시사항 논문 정보 업데이트 - this.prismaService.thesisInfo.update({ - where: { id: revisionThesisInfo.id }, - data: { - title, - abstract, - }, - }), - ]); + }); + + if (revisionThesisInfo) { + // 수정지시사항 논문 정보 업데이트 : 수정 지시시항 포함 학과만!! + await tx.thesisInfo.update({ + where: { id: revisionThesisInfo.id }, + // where: { id: revisionThesisInfo.id }, + data: { + title, + abstract, + }, + }); + } + + return thesisData; + }); return thesisInfo; } // 수정 지시사항 반영 단계일 경우 |