260914_01_ENH: 중간 커밋

This commit is contained in:
2026-09-14 14:48:03 +09:00
parent e2192d8e23
commit d415ca4621
14 changed files with 64 additions and 56 deletions

View File

@@ -23,18 +23,10 @@ public enum SystemEventType implements CodeEnum<Short> {
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);

View File

@@ -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<PerformanceReviewSlotDto> 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,

View File

@@ -8,5 +8,7 @@ public interface UserUploadBaseDto {
String getUserName();
String getUserCmpn();
String getMemo();
}

View File

@@ -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())

View File

@@ -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())

View File

@@ -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())

View File

@@ -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();
}
}

View File

@@ -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)

View File

@@ -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();
}

View File

@@ -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<TPerformanceReviewSlotEntity, Integer> {
List<TPerformanceReviewSlotEntity> findAllByOrderByReviewSlotAsc();
}

View File

@@ -132,7 +132,6 @@ public class PerformanceService {
}
List<CodeDto> businessTypeList = codeService.findByCodeGroup("business_type");
List<CodeDto> genreList = codeService.findByCodeGroup("genre");
List<CodeDto> areaList = codeService.findByCodeGroup("area");
List<CodeDto> 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<CodeDto> businessTypeList = codeService.findByCodeGroup("business_type");
List<CodeDto> genreList = codeService.findByCodeGroup("genre");
List<CodeDto> areaList = codeService.findByCodeGroup("area");
List<CodeDto> ticketReservationStatusList =
codeService.findByCodeGroup("ticket_reservation_status");
List<CodeDto> 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<CodeDto> businessTypeList = codeService.findByCodeGroup("business_type");
List<CodeDto> genreList = codeService.findByCodeGroup("genre");
List<CodeDto> areaList = codeService.findByCodeGroup("area");
List<CodeDto> 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<CodeDto> businessTypeList,
List<CodeDto> genreList,
List<CodeDto> areaList,
List<CodeDto> ticketReservationStatusList,
Set<String> existingPerformanceIds

View File

@@ -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<PerformanceReviewSlotDto> findReviewSlots() {
return performanceReviewSlotRepository.findAllByOrderByReviewSlotAsc().stream()
.map(PerformanceReviewSlotDto::from)
.toList();
}
public Map<Integer, PerformanceReviewDto> 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", "업로드할 파일이 없습니다.");
}

View File

@@ -193,11 +193,6 @@ public class UserService {
.with("fileName", fileName);
}
List<CodeDto> genreList = codeService.findByCodeGroup("genre");
List<CodeDto> areaList = codeService.findByCodeGroup("area");
List<CodeDto> genderList = codeService.findByCodeGroup("gender");
List<CodeDto> hasCarList = codeService.findByCodeGroup("has_car");
int totalCount = rows.size();
int successCount = 0;
List<ExcelErrorDto> errorList = new ArrayList<>();
@@ -209,11 +204,7 @@ public class UserService {
List<ExcelErrorDto> 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<ExcelErrorDto> validateUserDtoForExcel(
UserFullDto dto,
int rowNumber,
Integer userRole,
List<CodeDto> genreList,
List<CodeDto> areaList,
List<CodeDto> genderList,
List<CodeDto> hasCarList
Integer userRole
) {
List<ExcelErrorDto> errors = new ArrayList<>();
List<DataVerificationDto> validateUserList = validateUserDto(
dto,
userRole,
genreList,
areaList,
genderList,
hasCarList
userRole
);
validateUserList.forEach(validateResult -> {
@@ -349,11 +332,7 @@ public class UserService {
private List<DataVerificationDto> validateUserDto(
UserFullDto dto,
Integer userRole,
List<CodeDto> genreList,
List<CodeDto> areaList,
List<CodeDto> genderList,
List<CodeDto> hasCarList
Integer userRole
) {
List<DataVerificationDto> 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);

View File

@@ -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') != ''