diff --git a/src/main/java/ussum/homepage/domain/csv_user/service/StudentCsvReader.java b/src/main/java/ussum/homepage/domain/csv_user/service/StudentCsvReader.java index 1b549aa..d083113 100644 --- a/src/main/java/ussum/homepage/domain/csv_user/service/StudentCsvReader.java +++ b/src/main/java/ussum/homepage/domain/csv_user/service/StudentCsvReader.java @@ -29,7 +29,7 @@ private void checkStudentRight(OnBoardingRequest request, StudentCsv studentCsv) boolean name = request.getName().equals(studentCsv.getStudentName()); boolean studentId = request.getStudentId().equals(studentCsv.getStudentId().toString()); boolean groupName = request.getMemberCode().equals(MemberCode.getEnumMemberCodeFromStringMemberCode(studentCsv.getGroupName()).getStringMemberCode()); - boolean major = request.getMajorCode().equals(MajorCode.getEnumMajorCodeFromStringMajorCode(studentCsv.getMajor()).getStringMajorCode()); + boolean major = request.getMajorCode().equals(MajorCode.getEnumMajorCodeFromStringMajorCode(studentCsv.getProgram()).getStringMajorCode()); if(!(name && studentId && groupName && major)){ throw new GeneralException(ErrorStatus.INVALID_ONBOARDING_REQUEST); diff --git a/src/main/java/ussum/homepage/infra/csvBatch/config/FileItemReaderJobConfig.java b/src/main/java/ussum/homepage/infra/csvBatch/config/FileItemReaderJobConfig.java index 1c4d72a..bea7ca7 100644 --- a/src/main/java/ussum/homepage/infra/csvBatch/config/FileItemReaderJobConfig.java +++ b/src/main/java/ussum/homepage/infra/csvBatch/config/FileItemReaderJobConfig.java @@ -7,6 +7,7 @@ import org.springframework.batch.core.job.builder.JobBuilder; import org.springframework.batch.core.repository.JobRepository; import org.springframework.batch.core.step.builder.StepBuilder; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.transaction.PlatformTransactionManager; @@ -16,13 +17,16 @@ @RequiredArgsConstructor @Configuration +//@ConditionalOnProperty(name = "spring.batch.job.name", havingValue = "studentDataLoadJob") public class FileItemReaderJobConfig { private final CSVReader csvReader; private final CSVWriter csvWriter; - @Bean + private static final String JOB_NAME = "studentDataLoadJob"; + + @Bean(JOB_NAME) public Job studentDataLoadJob(JobRepository jobRepository, Step studentDataLoadStep) { - return new JobBuilder("studetnDataLoadJob", jobRepository) + return new JobBuilder(JOB_NAME, jobRepository) .flow(studentDataLoadStep) .end() .build();