From d415ca46212f034b0bfe0f13277b3a13ace53bf2 Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Mon, 14 Sep 2026 14:48:03 +0900 Subject: [PATCH] =?UTF-8?q?260914=5F01=5FENH:=20=EC=A4=91=EA=B0=84=20?= =?UTF-8?q?=EC=BB=A4=EB=B0=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../back/common/enums/SystemEventType.java | 12 ++----- .../back/controller/ReviewController.java | 12 ++++++- .../dto/excel/user/UserUploadBaseDto.java | 2 ++ .../dto/performance/PerformanceBaseDto.java | 7 ++-- .../performance/PerformanceCompactDto.java | 2 +- .../dto/performance/PerformanceFullDto.java | 2 +- .../performance/PerformanceReviewSlotDto.java | 6 ++-- .../manage/back/dto/user/UserFullDto.java | 4 +-- .../entity/TPerformanceReviewSlotEntity.java | 7 ++++ .../PerformanceReviewSlotRepository.java | 2 ++ .../back/service/PerformanceService.java | 10 ++---- .../manage/back/service/ReviewService.java | 19 ++++++++++- .../manage/back/service/UserService.java | 33 ++++--------------- .../mybatis/mapper/kon/KonMapper.xml | 2 +- 14 files changed, 64 insertions(+), 56 deletions(-) diff --git a/src/main/java/com/kri/kmusical/manage/back/common/enums/SystemEventType.java b/src/main/java/com/kri/kmusical/manage/back/common/enums/SystemEventType.java index d9f251f..c6ca589 100644 --- a/src/main/java/com/kri/kmusical/manage/back/common/enums/SystemEventType.java +++ b/src/main/java/com/kri/kmusical/manage/back/common/enums/SystemEventType.java @@ -23,18 +23,10 @@ public enum SystemEventType implements CodeEnum { DELETE_PERFORMANCE((short) 1023), //공연 삭제 UPLOAD_PERFORMANCE((short) 1024), //공연 업로드 - ASSIGN_PERFORMANCE_REQUEST((short) 1031), //공연 배정 요청 - ASSIGN_PERFORMANCE_CONFIRM((short) 1032), //공연 배정 승인 - ASSIGN_PERFORMANCE_CANCEL((short) 1033), //공연 배정 거절 - ASSIGN_PERFORMANCE_FORCE((short) 1034), //강제 공연 배정 - ASSIGN_PERFORMANCE_REJECT((short) 1039), //공연 배정 거절 - - VISIT_START((short) 2011), //모니터링 출발 - VISIT_END((short) 2012), //모니터링 도착 - VISIT_RESET((short) 2099), //모니터링 출발.도착 초기화 + ASSIGN_PERFORMANCE_CONFIRM((short) 1032), //공연 배정 + ASSIGN_PERFORMANCE_CANCEL((short) 1033), //공연 배정 취소 UPLOAD_REVIEW((short) 2041), //평가 결과 파일 업로드 - START_REVIEW((short) 2044), //평가 시작 DUMMY((short) 9999); diff --git a/src/main/java/com/kri/kmusical/manage/back/controller/ReviewController.java b/src/main/java/com/kri/kmusical/manage/back/controller/ReviewController.java index 0a34af9..244a9d9 100644 --- a/src/main/java/com/kri/kmusical/manage/back/controller/ReviewController.java +++ b/src/main/java/com/kri/kmusical/manage/back/controller/ReviewController.java @@ -5,6 +5,7 @@ import static com.kri.kmusical.manage.back.common.util.DownloadHeaderUtil.attach import com.kri.common.feature.datetime.DateTimeUtil; import com.kri.common.feature.web.RequestUserContext; import com.kri.kmusical.manage.back.dto.performance.PerformanceReviewDto; +import com.kri.kmusical.manage.back.dto.performance.PerformanceReviewSlotDto; import com.kri.kmusical.manage.back.dto.systemlog.UploadContentDto; import com.kri.kmusical.manage.back.service.ReviewService; import com.kri.kmusical.manage.back.service.ReviewTemplateService; @@ -12,6 +13,7 @@ import com.kri.kmusical.manage.back.service.common.SystemEventLogService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import java.time.LocalDateTime; +import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.core.io.Resource; import org.springframework.http.HttpHeaders; @@ -35,6 +37,12 @@ public class ReviewController { private final ReviewTemplateService reviewTemplateService; private final SystemEventLogService systemEventLogService; + @Operation(summary = "평가 슬롯 목록 조회") + @GetMapping("/slots") + public List findReviewSlots() { + return reviewService.findReviewSlots(); + } + @Operation(summary = "평가 파일 업로드") @PostMapping(value = "/{performanceId}/{reviewSlot}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) public PerformanceReviewDto uploadReviewFile( @@ -46,8 +54,10 @@ public class ReviewController { ) { LocalDateTime now = DateTimeUtil.nowKstLocalDateTime(); String userId = paramUserId != null ? paramUserId : ctx.getUserId(); + Integer userRole = ctx.getUserRole(); + + PerformanceReviewDto result = reviewService.uploadReviewFile(performanceId, reviewSlot, file, userId, userRole, now); - PerformanceReviewDto result = reviewService.uploadReviewFile(performanceId, reviewSlot, file, userId, now); systemEventLogService.writeUploadReviewFileLog( ctx.getUserId(), now, diff --git a/src/main/java/com/kri/kmusical/manage/back/dto/excel/user/UserUploadBaseDto.java b/src/main/java/com/kri/kmusical/manage/back/dto/excel/user/UserUploadBaseDto.java index c3145ee..743697b 100644 --- a/src/main/java/com/kri/kmusical/manage/back/dto/excel/user/UserUploadBaseDto.java +++ b/src/main/java/com/kri/kmusical/manage/back/dto/excel/user/UserUploadBaseDto.java @@ -8,5 +8,7 @@ public interface UserUploadBaseDto { String getUserName(); + String getUserCmpn(); + String getMemo(); } diff --git a/src/main/java/com/kri/kmusical/manage/back/dto/performance/PerformanceBaseDto.java b/src/main/java/com/kri/kmusical/manage/back/dto/performance/PerformanceBaseDto.java index 5477a50..013ab39 100644 --- a/src/main/java/com/kri/kmusical/manage/back/dto/performance/PerformanceBaseDto.java +++ b/src/main/java/com/kri/kmusical/manage/back/dto/performance/PerformanceBaseDto.java @@ -15,15 +15,15 @@ import lombok.experimental.SuperBuilder; @AllArgsConstructor public class PerformanceBaseDto { + @Schema(description = "No") + private Integer performanceNo; + @Schema(description = "사업고유id") private String performanceId; @Schema(description = "사업유형") private Integer businessType; - @Schema(description = "분야(장르)") - private Integer performanceGenre; - @Schema(description = "시도") private Integer performanceArea; @@ -57,6 +57,7 @@ public class PerformanceBaseDto { } return PerformanceBaseDto.builder() + .performanceNo(entity.getPerformanceNo()) .performanceId(entity.getPerformanceId()) .businessType(entity.getBusinessType()) .performanceArea(entity.getPerformanceArea()) diff --git a/src/main/java/com/kri/kmusical/manage/back/dto/performance/PerformanceCompactDto.java b/src/main/java/com/kri/kmusical/manage/back/dto/performance/PerformanceCompactDto.java index 769ba96..e4d9073 100644 --- a/src/main/java/com/kri/kmusical/manage/back/dto/performance/PerformanceCompactDto.java +++ b/src/main/java/com/kri/kmusical/manage/back/dto/performance/PerformanceCompactDto.java @@ -51,9 +51,9 @@ public class PerformanceCompactDto extends PerformanceBaseDto { } return PerformanceCompactDto.builder() + .performanceNo(performance.getPerformanceNo()) .performanceId(performance.getPerformanceId()) .businessType(performance.getBusinessType()) - .performanceGenre(performance.getPerformanceGenre()) .performanceArea(performance.getPerformanceArea()) .artistName(performance.getArtistName()) .performanceName(performance.getPerformanceName()) diff --git a/src/main/java/com/kri/kmusical/manage/back/dto/performance/PerformanceFullDto.java b/src/main/java/com/kri/kmusical/manage/back/dto/performance/PerformanceFullDto.java index 033a934..a35fb1f 100644 --- a/src/main/java/com/kri/kmusical/manage/back/dto/performance/PerformanceFullDto.java +++ b/src/main/java/com/kri/kmusical/manage/back/dto/performance/PerformanceFullDto.java @@ -63,9 +63,9 @@ public class PerformanceFullDto extends PerformanceBaseDto { } return PerformanceFullDto.builder() + .performanceNo(performance.getPerformanceNo()) .performanceId(performance.getPerformanceId()) .businessType(performance.getBusinessType()) - .performanceGenre(performance.getPerformanceGenre()) .performanceArea(performance.getPerformanceArea()) .artistName(performance.getArtistName()) .performanceName(performance.getPerformanceName()) diff --git a/src/main/java/com/kri/kmusical/manage/back/dto/performance/PerformanceReviewSlotDto.java b/src/main/java/com/kri/kmusical/manage/back/dto/performance/PerformanceReviewSlotDto.java index b72be52..8a77eba 100644 --- a/src/main/java/com/kri/kmusical/manage/back/dto/performance/PerformanceReviewSlotDto.java +++ b/src/main/java/com/kri/kmusical/manage/back/dto/performance/PerformanceReviewSlotDto.java @@ -2,8 +2,6 @@ package com.kri.kmusical.manage.back.dto.performance; import com.kri.kmusical.manage.back.persistence.entity.TPerformanceReviewSlotEntity; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.persistence.Column; -import jakarta.validation.constraints.NotNull; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; @@ -23,10 +21,14 @@ public class PerformanceReviewSlotDto { @Schema(description = "평가 타입") private Integer reviewType; + @Schema(description = "평가 라벨") + private String reviewLabel; + public static PerformanceReviewSlotDto from(TPerformanceReviewSlotEntity entity) { return PerformanceReviewSlotDto.builder() .reviewSlot(entity.getReviewSlot()) .reviewType(entity.getReviewType()) + .reviewLabel(entity.getReviewLabel()) .build(); } } diff --git a/src/main/java/com/kri/kmusical/manage/back/dto/user/UserFullDto.java b/src/main/java/com/kri/kmusical/manage/back/dto/user/UserFullDto.java index cf3156c..169e620 100644 --- a/src/main/java/com/kri/kmusical/manage/back/dto/user/UserFullDto.java +++ b/src/main/java/com/kri/kmusical/manage/back/dto/user/UserFullDto.java @@ -73,8 +73,8 @@ public class UserFullDto { .userId(dto.getUserId()) .userPw(dto.getUserPw()) .userName(dto.getUserName()) - .userCmpn("") - .userTeam("") + .userCmpn(dto.getUserCmpn()) + .userTeam(dto.getUserCmpn()) .userRole(userRole) .memo(dto.getMemo()) .userDetail(userDetail) diff --git a/src/main/java/com/kri/kmusical/manage/back/persistence/entity/TPerformanceReviewSlotEntity.java b/src/main/java/com/kri/kmusical/manage/back/persistence/entity/TPerformanceReviewSlotEntity.java index 9a7dc30..0ac08ab 100644 --- a/src/main/java/com/kri/kmusical/manage/back/persistence/entity/TPerformanceReviewSlotEntity.java +++ b/src/main/java/com/kri/kmusical/manage/back/persistence/entity/TPerformanceReviewSlotEntity.java @@ -6,6 +6,7 @@ import jakarta.persistence.Entity; import jakarta.persistence.Id; import jakarta.persistence.Table; import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; @@ -27,11 +28,17 @@ public class TPerformanceReviewSlotEntity { @Column(name = "review_type", nullable = false) private Integer reviewType; + @Size(max = 32) + @NotNull + @Column(name = "review_label", nullable = false, length = 32) + private String reviewLabel; + public static TPerformanceReviewSlotEntity from(PerformanceReviewSlotDto dto) { return TPerformanceReviewSlotEntity.builder() .reviewSlot(dto.getReviewSlot()) .reviewType(dto.getReviewType()) + .reviewLabel(dto.getReviewLabel()) .build(); } diff --git a/src/main/java/com/kri/kmusical/manage/back/persistence/repository/PerformanceReviewSlotRepository.java b/src/main/java/com/kri/kmusical/manage/back/persistence/repository/PerformanceReviewSlotRepository.java index 173c072..99ca012 100644 --- a/src/main/java/com/kri/kmusical/manage/back/persistence/repository/PerformanceReviewSlotRepository.java +++ b/src/main/java/com/kri/kmusical/manage/back/persistence/repository/PerformanceReviewSlotRepository.java @@ -1,8 +1,10 @@ package com.kri.kmusical.manage.back.persistence.repository; import com.kri.kmusical.manage.back.persistence.entity.TPerformanceReviewSlotEntity; +import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; public interface PerformanceReviewSlotRepository extends JpaRepository { + List findAllByOrderByReviewSlotAsc(); } diff --git a/src/main/java/com/kri/kmusical/manage/back/service/PerformanceService.java b/src/main/java/com/kri/kmusical/manage/back/service/PerformanceService.java index 59c75e8..51df437 100644 --- a/src/main/java/com/kri/kmusical/manage/back/service/PerformanceService.java +++ b/src/main/java/com/kri/kmusical/manage/back/service/PerformanceService.java @@ -132,7 +132,6 @@ public class PerformanceService { } List businessTypeList = codeService.findByCodeGroup("business_type"); - List genreList = codeService.findByCodeGroup("genre"); List areaList = codeService.findByCodeGroup("area"); List ticketReservationStatusList = codeService.findByCodeGroup("ticket_reservation_status"); @@ -152,7 +151,6 @@ public class PerformanceService { row, rowNumber, businessTypeList, - genreList, areaList, ticketReservationStatusList, existingPerformanceIds @@ -220,19 +218,20 @@ public class PerformanceService { public byte[] exportPerformanceTemplate() { List businessTypeList = codeService.findByCodeGroup("business_type"); - List genreList = codeService.findByCodeGroup("genre"); List areaList = codeService.findByCodeGroup("area"); List ticketReservationStatusList = codeService.findByCodeGroup("ticket_reservation_status"); + List reviewStatusList = + codeService.findByCodeGroup("review_status"); try (Workbook workbook = ExcelMapper.writeToWorkbook(Collections.emptyList(), PerformanceUploadDto.class); ByteArrayOutputStream out = new ByteArrayOutputStream()) { appendCodeSheet(workbook, businessTypeList, "사업유형"); - appendCodeSheet(workbook, genreList, "장르"); appendCodeSheet(workbook, areaList, "지역"); appendCodeSheet(workbook, ticketReservationStatusList, "티켓 예약"); + appendCodeSheet(workbook, reviewStatusList, "평가 상태"); workbook.write(out); return out.toByteArray(); @@ -251,7 +250,6 @@ public class PerformanceService { .toList(); List businessTypeList = codeService.findByCodeGroup("business_type"); - List genreList = codeService.findByCodeGroup("genre"); List areaList = codeService.findByCodeGroup("area"); List ticketReservationStatusList = codeService.findByCodeGroup("ticket_reservation_status"); @@ -262,7 +260,6 @@ public class PerformanceService { ByteArrayOutputStream out = new ByteArrayOutputStream()) { appendCodeSheet(workbook, businessTypeList, "사업유형"); - appendCodeSheet(workbook, genreList, "장르"); appendCodeSheet(workbook, areaList, "지역"); appendCodeSheet(workbook, ticketReservationStatusList, "티켓 예약"); appendCodeSheet(workbook, reviewStatusList, "평가 상태"); @@ -527,7 +524,6 @@ public class PerformanceService { PerformanceUploadDto row, int rowNumber, List businessTypeList, - List genreList, List areaList, List ticketReservationStatusList, Set existingPerformanceIds diff --git a/src/main/java/com/kri/kmusical/manage/back/service/ReviewService.java b/src/main/java/com/kri/kmusical/manage/back/service/ReviewService.java index 7322b91..f6751ae 100644 --- a/src/main/java/com/kri/kmusical/manage/back/service/ReviewService.java +++ b/src/main/java/com/kri/kmusical/manage/back/service/ReviewService.java @@ -1,15 +1,18 @@ package com.kri.kmusical.manage.back.service; import static com.kri.kmusical.manage.back.common.consts.KmusicalConstant.COMPLETE_STATUS; +import static com.kri.kmusical.manage.back.common.consts.KmusicalConstant.MONITORING_USER_ROLE; import com.kri.common.feature.util.StringUtil; import com.kri.common.feature.web.BusinessException; import com.kri.kmusical.manage.back.config.FileStorageProperties; import com.kri.kmusical.manage.back.dto.performance.PerformanceReviewDto; +import com.kri.kmusical.manage.back.dto.performance.PerformanceReviewSlotDto; import com.kri.kmusical.manage.back.persistence.entity.TPerformanceReviewEntity; import com.kri.kmusical.manage.back.persistence.entity.id.TPerformanceReviewEntityId; import com.kri.kmusical.manage.back.persistence.repository.PerformanceReviewRepository; import com.kri.kmusical.manage.back.persistence.repository.PerformanceAssignRepository; +import com.kri.kmusical.manage.back.persistence.repository.PerformanceReviewSlotRepository; import com.kri.kmusical.manage.back.service.file.AbstractFileService; import java.io.IOException; import java.nio.file.Files; @@ -18,6 +21,7 @@ import java.time.LocalDateTime; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.concurrent.Executor; import java.util.stream.Collectors; @@ -40,6 +44,7 @@ public class ReviewService extends AbstractFileService { private final PerformanceReviewRepository performanceReviewRepository; private final PerformanceAssignRepository performanceAssignRepository; + private final PerformanceReviewSlotRepository performanceReviewSlotRepository; private final FileStorageProperties fileStorageProperties; private final ReviewPdfConvertService reviewPdfConvertService; private final Executor pdfConvertTaskExecutor; @@ -47,12 +52,14 @@ public class ReviewService extends AbstractFileService { public ReviewService( PerformanceReviewRepository performanceReviewRepository, PerformanceAssignRepository performanceAssignRepository, + PerformanceReviewSlotRepository performanceReviewSlotRepository, FileStorageProperties fileStorageProperties, ReviewPdfConvertService reviewPdfConvertService, @Qualifier("pdfConvertTaskExecutor") Executor pdfConvertTaskExecutor ) { this.performanceReviewRepository = performanceReviewRepository; this.performanceAssignRepository = performanceAssignRepository; + this.performanceReviewSlotRepository = performanceReviewSlotRepository; this.fileStorageProperties = fileStorageProperties; this.reviewPdfConvertService = reviewPdfConvertService; this.pdfConvertTaskExecutor = pdfConvertTaskExecutor; @@ -73,6 +80,12 @@ public class ReviewService extends AbstractFileService { return performanceReviewRepository.existsByIdPerformanceId(performanceId); } + public List findReviewSlots() { + return performanceReviewSlotRepository.findAllByOrderByReviewSlotAsc().stream() + .map(PerformanceReviewSlotDto::from) + .toList(); + } + public Map findMapByPerformanceId(String performanceId) { return performanceReviewRepository.findByIdPerformanceId(performanceId).stream() .collect(Collectors.toMap( @@ -87,9 +100,13 @@ public class ReviewService extends AbstractFileService { Integer reviewSlot, MultipartFile file, String userId, + Integer userRole, LocalDateTime now ) { - validateAssignedUser(performanceId, reviewSlot, userId); + if(Objects.equals(userRole, MONITORING_USER_ROLE)) { + validateAssignedUser(performanceId, reviewSlot, userId); + } + if (file == null || file.isEmpty()) { throw BusinessException.badRequest("EMPTY_FILE", "업로드할 파일이 없습니다."); } diff --git a/src/main/java/com/kri/kmusical/manage/back/service/UserService.java b/src/main/java/com/kri/kmusical/manage/back/service/UserService.java index f3679ad..bf39aea 100644 --- a/src/main/java/com/kri/kmusical/manage/back/service/UserService.java +++ b/src/main/java/com/kri/kmusical/manage/back/service/UserService.java @@ -193,11 +193,6 @@ public class UserService { .with("fileName", fileName); } - List genreList = codeService.findByCodeGroup("genre"); - List areaList = codeService.findByCodeGroup("area"); - List genderList = codeService.findByCodeGroup("gender"); - List hasCarList = codeService.findByCodeGroup("has_car"); - int totalCount = rows.size(); int successCount = 0; List errorList = new ArrayList<>(); @@ -209,11 +204,7 @@ public class UserService { List rowErrors = validateUserDtoForExcel( dto, rowNumber, - userRole, - genreList, - areaList, - genderList, - hasCarList + userRole ); if (!rowErrors.isEmpty()) { errorList.addAll(rowErrors); @@ -317,21 +308,13 @@ public class UserService { private List validateUserDtoForExcel( UserFullDto dto, int rowNumber, - Integer userRole, - List genreList, - List areaList, - List genderList, - List hasCarList + Integer userRole ) { List errors = new ArrayList<>(); List validateUserList = validateUserDto( dto, - userRole, - genreList, - areaList, - genderList, - hasCarList + userRole ); validateUserList.forEach(validateResult -> { @@ -349,11 +332,7 @@ public class UserService { private List validateUserDto( UserFullDto dto, - Integer userRole, - List genreList, - List areaList, - List genderList, - List hasCarList + Integer userRole ) { List result = new ArrayList<>(); @@ -497,8 +476,8 @@ public class UserService { private void createUserInternal(UserFullDto userInfo, String regUser, LocalDateTime regDt) { userInfo.setUserId(userInfo.getUserId().toLowerCase()); - userInfo.setUserCmpn(""); - userInfo.setUserTeam(""); + userInfo.setUserCmpn(userInfo.getUserCmpn()); + userInfo.setUserTeam(userInfo.getUserCmpn()); userInfo.setMemo(Objects.toString(userInfo.getMemo(), "")); TUserEntity entity = TUserEntity.from(userInfo, regUser, regDt); diff --git a/src/main/resources/mybatis/mapper/kon/KonMapper.xml b/src/main/resources/mybatis/mapper/kon/KonMapper.xml index 88c1c08..22065db 100644 --- a/src/main/resources/mybatis/mapper/kon/KonMapper.xml +++ b/src/main/resources/mybatis/mapper/kon/KonMapper.xml @@ -11,7 +11,7 @@ FROM [DATA] DA WITH(NOLOCK) CROSS APPLY OPENJSON([DATJSON]) DJ CROSS APPLY OPENJSON(DJ.[value]) DV - WHERE PKEY = '2605013_B' + WHERE PKEY = '2607027_C' AND [Status] = 10 AND JSON_VALUE(DJ.[VALUE], '$.SC') IS NOT NULL AND JSON_VALUE(DJ.[VALUE], '$.SC') != ''