260416_01_ENH: first commit - 1차 개발 완료
This commit is contained in:
3
.gitattributes
vendored
Normal file
3
.gitattributes
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/gradlew text eol=lf
|
||||
*.bat text eol=crlf
|
||||
*.jar binary
|
||||
37
.gitignore
vendored
Normal file
37
.gitignore
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
HELP.md
|
||||
.gradle
|
||||
build/
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
bin/
|
||||
!**/src/main/**/bin/
|
||||
!**/src/test/**/bin/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
out/
|
||||
!**/src/main/**/out/
|
||||
!**/src/test/**/out/
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
336
README.md
Normal file
336
README.md
Normal file
@@ -0,0 +1,336 @@
|
||||
# ncrc-pairing
|
||||
|
||||
엑셀 파일을 입력받아 위원 페어 후보와 센터 배정 후보를 만들고, Google OR-Tools CP-SAT으로 배정 결과를 계산하는 Spring Boot API입니다.
|
||||
|
||||
## 실행 흐름
|
||||
|
||||
1. `PairingController`
|
||||
- `/api/v1/pairing/run`으로 엑셀 파일을 업로드받습니다.
|
||||
- 처리 결과를 엑셀 파일로 반환합니다.
|
||||
|
||||
2. `PairingService`
|
||||
- 전체 유스케이스 흐름을 순서대로 호출합니다.
|
||||
- `엑셀 읽기 -> 정규화 -> 공휴일 반영 -> 검증 -> 후보 생성 -> solver 실행 -> 결과 엑셀 생성`
|
||||
|
||||
3. `PairingExcelService`
|
||||
- 입력 엑셀의 6개 시트를 `dto.excel` DTO로 읽습니다.
|
||||
- 결과 엑셀은 `배정결과`, `미배정센터`, `미사용위원`, `처리요약`, `AB페어목록`, `후보요약`, `검증오류`, `규칙위반검사` 시트로 씁니다.
|
||||
- `/run`에서 입력/검증 오류가 발생하면 오류 내용을 담은 엑셀 파일을 반환합니다.
|
||||
|
||||
4. `PairingNormalizeService`
|
||||
- 엑셀 문자열을 내부 모델로 변환합니다.
|
||||
- 날짜, CSV, 성별, 경력여부, 현장/외부 구분, 지역코드, 선호지역을 정리합니다.
|
||||
|
||||
5. `PairingValidationService`
|
||||
- 필수 데이터, 날짜 범위, 지자체 참조, 희망지역 매칭표 등을 검증합니다.
|
||||
- 실패 시 `BusinessException.badRequest(code, message)`를 사용합니다.
|
||||
|
||||
6. `PairingHolidayService`
|
||||
- `DatagoExtentionApiClient.getHoliDayList(year)`로 국공휴일을 조회합니다.
|
||||
- 조회된 날짜는 모든 위원/지자체/센터에 공통 적용되는 진행 불가일자로 처리합니다.
|
||||
- 공휴일 목록은 `DatagoHolidayCache`에서 공용 `AbstractListCache` 기반으로 캐싱합니다.
|
||||
|
||||
7. `PairingCandidateService`
|
||||
- solver가 선택할 수 있는 후보만 생성합니다.
|
||||
- 불가능한 조합은 이 단계에서 제거합니다.
|
||||
|
||||
8. `PairingSolverService`
|
||||
- OR-Tools CP-SAT 모델을 만들고 최적 배정을 계산합니다.
|
||||
|
||||
## OR-Tools 사용 개요
|
||||
|
||||
현재 사용하는 라이브러리는 `com.google.ortools:ortools-java`입니다.
|
||||
|
||||
OR-Tools CP-SAT은 "조건을 만족하는 조합 중 점수가 가장 좋은 조합"을 찾는 최적화 solver입니다. 이 프로젝트에서는 각 배정 후보를 boolean 변수로 만듭니다.
|
||||
|
||||
예를 들어 어떤 후보가 다음 의미를 가진다고 하면:
|
||||
|
||||
```text
|
||||
2026-05-01에 fieldMember=100, externalMember=200 페어가 center=300을 방문한다
|
||||
```
|
||||
|
||||
solver 안에서는 이 후보가 하나의 `BoolVar`가 됩니다.
|
||||
|
||||
```text
|
||||
1 = 이 후보를 선택한다
|
||||
0 = 이 후보를 선택하지 않는다
|
||||
```
|
||||
|
||||
`PairingSolverService`는 이런 boolean 변수들을 놓고 아래를 수행합니다.
|
||||
|
||||
- hard rule: 반드시 지켜야 하는 제약
|
||||
- soft rule: 지키면 점수가 좋아지는 목표
|
||||
|
||||
## 현재 적용된 Hard Rule
|
||||
|
||||
후보 생성 단계와 solver 단계에 나뉘어 적용되어 있습니다.
|
||||
|
||||
### 후보 생성 단계
|
||||
|
||||
위치: `PairingCandidateService`
|
||||
|
||||
- 현장위원 + 외부위원 페어만 생성
|
||||
- 신규 + 신규 페어 제외
|
||||
- 두 위원의 일정 범위가 겹치지 않으면 제외
|
||||
- 파견 권역이 위원의 활동지역과 같으면 제외
|
||||
- 희망지역 매칭표에 없는 선호 조합 제외
|
||||
- 센터 인접지역표를 통해 파견 권역과 센터 연결
|
||||
- 여성 전용 센터는 여성 2명 페어만 허용
|
||||
- 2023년 진행 센터는 해당 위원에게 재배정 금지
|
||||
- 위원/지자체/센터의 시작일, 종료일, 불가일자를 모두 반영
|
||||
- 국공휴일은 모든 배정 후보에서 제외
|
||||
|
||||
현재 후보 수 폭증을 막기 위해 각 페어/센터 조합에서 가장 빠른 feasible 일자 1개만 후보로 만듭니다.
|
||||
|
||||
### Solver 단계
|
||||
|
||||
위치: `PairingSolverService`
|
||||
|
||||
- 한 센터는 최대 1번만 배정
|
||||
- 한 페어는 하루 최대 3개 센터만 방문
|
||||
- 한 위원은 같은 날짜에 하나의 페어로만 활동
|
||||
- 한 페어는 같은 날짜에 하나의 인접지역 분류만 방문
|
||||
- 한 위원은 전체 기간 동안 최대 2명의 상대 파트너만 가짐
|
||||
|
||||
## 현재 적용된 Soft Rule
|
||||
|
||||
위치: `PairingSolverService#createObjective`
|
||||
|
||||
현재 목적함수는 아래 순서가 강하게 반영되도록 가중치를 둡니다.
|
||||
|
||||
1. 배정 센터 수 최대화
|
||||
2. 희망지역 매칭 순위가 좋은 후보 선호
|
||||
3. 거주지 앞 3자리 일치 페어 선호
|
||||
|
||||
배정 센터 수가 가장 중요하므로 가장 큰 가중치를 사용합니다. 선호도와 거주지 유사도는 배정 수가 같은 후보들 사이에서 더 나은 해를 고르는 보조 점수입니다. 현재 업무 기준상 거주지 유사도도 중요한 soft rule이지만, 배정 센터 수보다 우선하지는 않습니다.
|
||||
|
||||
## OR-Tools 관련 주요 파일
|
||||
|
||||
### `build.gradle`
|
||||
|
||||
OR-Tools 의존성을 관리합니다.
|
||||
|
||||
```gradle
|
||||
implementation("com.google.ortools:ortools-java:9.15.6755")
|
||||
```
|
||||
|
||||
OR-Tools 버전을 바꾸면 native library 로딩 방식이나 Java API가 바뀔 수 있으므로 `PairingSolverService` 컴파일과 테스트를 반드시 확인해야 합니다.
|
||||
|
||||
### `OrToolsConfig`
|
||||
|
||||
Spring Boot 기동 시 `Loader.loadNativeLibraries()`를 실행합니다.
|
||||
|
||||
OR-Tools는 Java 라이브러리처럼 보이지만 내부적으로 OS별 native library를 사용합니다. 이 로딩이 빠지면 `UnsatisfiedLinkError`가 발생합니다.
|
||||
|
||||
### `PairingSolverService`
|
||||
|
||||
실제 CP-SAT 모델을 구성합니다.
|
||||
|
||||
수정이 필요한 대표 위치:
|
||||
|
||||
- 변수 추가/변경: `createAssignmentVars`, `createPairUsedVars`, `createPairDayVars`
|
||||
- hard rule 추가: `add...` 형태의 constraint 메서드 추가
|
||||
- soft rule 변경: `createObjective`
|
||||
- solver 시간 제한 변경: `solver.getParameters().setMaxTimeInSeconds(...)`
|
||||
- 결과 해석 변경: `collectSelectedAssignments`, `toResult`
|
||||
|
||||
## 결과 엑셀 시트
|
||||
|
||||
정상 처리 결과는 항상 아래 8개 시트를 포함합니다.
|
||||
|
||||
- `배정결과`: 최종 센터 배정 결과와 위원/센터 주요 속성, AB 보완 페어 정보
|
||||
- `미배정센터`: 최종 배정되지 않은 센터와 누적 미배정 사유
|
||||
- `미사용위원`: 최종 배정에 포함되지 않은 위원
|
||||
- `처리요약`: 전체 입력/후보/배정/AB 그룹 요약
|
||||
- `AB페어목록`: 후처리로 묶인 AB 페어 그룹 목록
|
||||
- `후보요약`: 후보 생성 및 solver 입력 규모
|
||||
- `검증오류`: 정상 처리 시 빈 시트, 입력/검증 오류 엑셀에서는 오류 내용
|
||||
- `규칙위반검사`: 결과가 hard rule을 위반하지 않았는지 PASS/FAIL 검사
|
||||
|
||||
`/run`에서 엑셀 파싱이나 입력 검증 오류가 발생하면 HTTP 200으로 오류 엑셀을 반환합니다. 공휴일 API 실패 같은 시스템 오류는 숨기지 않고 실패 응답으로 처리합니다.
|
||||
|
||||
## 업무 조건 변경 시 수정 위치
|
||||
|
||||
### 자주 조정될 수 있는 값
|
||||
|
||||
아래 값들은 `application.yaml`의 `pairing.*` 설정으로 관리합니다.
|
||||
|
||||
```yaml
|
||||
pairing:
|
||||
excel:
|
||||
header-row-index: 1
|
||||
code:
|
||||
region-code-length: 2
|
||||
residence-code-length: 5
|
||||
residence-match-prefix-length: 3
|
||||
any-region-code: "00"
|
||||
rule:
|
||||
max-centers-per-pair-per-day: 3
|
||||
max-counterparts-per-member: 2
|
||||
preference:
|
||||
anywhere-rank: 0
|
||||
ignored-rank: 99
|
||||
objective:
|
||||
assignment-weight: 1000000
|
||||
preference-base-weight: 1000
|
||||
preference-rank-penalty: 100
|
||||
residence-match-weight: 10000
|
||||
solver:
|
||||
max-time-seconds: 30.0
|
||||
num-search-workers: 15
|
||||
```
|
||||
|
||||
배정 센터 수 최우선 원칙을 유지하려면 `objective.assignment-weight`가 선호지역, 거주지, 향후 추가될 soft score의 최대 합보다 충분히 커야 합니다.
|
||||
|
||||
### 엑셀 시트명 또는 컬럼명이 바뀌는 경우
|
||||
|
||||
수정 위치:
|
||||
|
||||
- `PairingConstant`
|
||||
- `dto.excel.*`
|
||||
- `PairingExcelService`
|
||||
|
||||
시트명이 바뀌면 `PairingConstant`의 `SHEET_*` 값을 수정합니다. 컬럼명이 바뀌면 해당 `dto.excel` 클래스의 `@ExcelColumn(header = "...")` 값을 수정합니다.
|
||||
|
||||
### 결과 엑셀 시트를 바꾸는 경우
|
||||
|
||||
수정 위치:
|
||||
|
||||
- `PairingConstant`
|
||||
- `dto.*ExcelDto`
|
||||
- `PairingExcelService#write`
|
||||
- `PairingSolverService#toResult`
|
||||
|
||||
### 지역 코드 자리수가 바뀌는 경우
|
||||
|
||||
수정 위치:
|
||||
|
||||
- `PairingConstant`
|
||||
- `PairingNormalizeService`
|
||||
- `PairingCandidateService`
|
||||
|
||||
현재 활동지역/선호지역은 2자리, 거주지는 5자리, 거주지 비교는 앞 3자리 기준입니다.
|
||||
|
||||
### 선호지역 `00` 규칙이 바뀌는 경우
|
||||
|
||||
수정 위치:
|
||||
|
||||
- `PairingNormalizeService#normalizePreferenceRegions`
|
||||
- `PairingCandidateService#findPreferenceRank`
|
||||
|
||||
현재는 `00`이 나오면 그 위치와 뒤쪽 선호지역을 모두 `00`으로 처리합니다.
|
||||
|
||||
### 희망지역 매칭표 해석이 바뀌는 경우
|
||||
|
||||
수정 위치:
|
||||
|
||||
- `PairingCandidateService#findPreferenceRank`
|
||||
- `PairingCandidateService#findPreferenceMatchRule`
|
||||
- `PairingSolverService#createObjective`
|
||||
|
||||
현재는 현장위원 rank와 외부위원 rank를 구한 뒤, 엑셀의 `희망지역 매칭표`에서 매칭 순위를 찾습니다.
|
||||
|
||||
현재 rank 해석:
|
||||
|
||||
- `0`: 위원이 선호지역에 `00`을 입력한 anywhere 응답
|
||||
- `99`: 해당 위원의 선호지역을 고려하지 않는 wildcard 조건
|
||||
|
||||
### 하루 최대 센터 수가 바뀌는 경우
|
||||
|
||||
수정 위치:
|
||||
|
||||
- `application.yaml`의 `pairing.rule.max-centers-per-pair-per-day`
|
||||
- `PairingSolverService#addPairDailyCapacity`
|
||||
|
||||
### 한 위원의 상대 파트너 수 제한이 바뀌는 경우
|
||||
|
||||
수정 위치:
|
||||
|
||||
- `application.yaml`의 `pairing.rule.max-counterparts-per-member`
|
||||
- `PairingSolverService#addBuddyLimit`
|
||||
|
||||
### 하루 1개 지역 제한 기준이 바뀌는 경우
|
||||
|
||||
수정 위치:
|
||||
|
||||
- `AssignmentCandidate`
|
||||
- `PairingCandidateService#createAssignmentCandidates`
|
||||
- `PairingSolverService#addPairDailyOneAdjacentClassification`
|
||||
|
||||
현재는 `인접지역 분류` 기준입니다. 나중에 권역 단위로 바뀌면 `pairDayAdjacentKey`가 사용하는 값을 바꿔야 합니다.
|
||||
|
||||
### 불가일자 또는 일정 조건이 바뀌는 경우
|
||||
|
||||
수정 위치:
|
||||
|
||||
- `PairingNormalizeService#parseDateSet`
|
||||
- `PairingHolidayService`
|
||||
- `PairingCandidateService#findFirstAssignableDate`
|
||||
- `PairingCandidateService#isAvailableOn`
|
||||
|
||||
국공휴일 조회 방식이 바뀌면 `PairingHolidayService`와 `DatagoExtentionApiClient`를 함께 확인해야 합니다.
|
||||
캐시 동작을 바꾸려면 `DatagoHolidayCache`를 확인합니다.
|
||||
|
||||
### 여성 전용 센터 규칙이 바뀌는 경우
|
||||
|
||||
수정 위치:
|
||||
|
||||
- `PairingNormalizeService#parseBooleanFlag`
|
||||
- `PairingCandidateService#isAssignableCenter`
|
||||
|
||||
### 2023년 진행 센터 제외 규칙이 바뀌는 경우
|
||||
|
||||
수정 위치:
|
||||
|
||||
- `PairingNormalizeService#parseCsv`
|
||||
- `PairingCandidateService#isAssignableCenter`
|
||||
|
||||
### A/B pair 운영 로직을 추가하는 경우
|
||||
|
||||
수정 위치:
|
||||
|
||||
- `PairingCandidateService`
|
||||
- `PairingSolverService`
|
||||
- 필요 시 `model`에 `ABPairCandidate` 추가
|
||||
|
||||
현재 A/B pair는 solver 결과 후처리로 구성합니다. 같은 파견 권역과 같은 인접지역 분류를 공유하고, 배정 날짜가 겹치지 않는 페어끼리 `AB 그룹`으로 묶습니다. 이는 A/B가 완전 대체 전담 관계가 아니라, 각자 배정은 유지하되 유사시에 서로 공백을 보완할 수 있는 관계라는 업무 해석을 따른 것입니다.
|
||||
|
||||
### 인접지역 분류 랜덤 선택을 엄격하게 적용하는 경우
|
||||
|
||||
수정 위치:
|
||||
|
||||
- `PairingCandidateService#createAssignmentCandidates`
|
||||
- `PairingSolverService`
|
||||
- 별도 후처리 서비스 추가 가능
|
||||
|
||||
현재 solver는 랜덤 없이 최적 선택을 하며, 같은 날짜/페어에 대해 하나의 인접지역 분류만 선택하도록 hard rule을 걸고 있습니다. 따라서 한 팀이 여러 인접지역 분류 그룹을 갈 수 있는 경우에도 solver가 objective에 가장 유리한 하나의 그룹만 선택합니다.
|
||||
|
||||
## 현재 구현상 주의점
|
||||
|
||||
- 모든 가능한 날짜를 후보로 만들지 않고, 각 페어/센터 조합의 가장 빠른 feasible 일자만 후보로 만듭니다.
|
||||
- 이 방식은 후보 수를 줄여 빠르게 동작하지만, 날짜 선택 자유도가 낮아 실제 최적 배정률이 떨어질 수 있습니다.
|
||||
- 배정률이 부족하면 `PairingCandidateService#findFirstAssignableDate`를 확장해 feasible 일자 여러 개를 후보로 생성해야 합니다.
|
||||
- A/B pair는 현재 후처리 방식입니다. 배정 자체를 막는 hard constraint가 아니며, 결과 엑셀의 `AB 그룹`, `보완 현장위원 id`, `보완 외부위원 id` 컬럼으로 표시합니다.
|
||||
- 결과 엑셀은 성공 시 파일로 반환합니다. 입력/검증 오류는 오류 엑셀로 반환하고, 시스템 오류는 공통 `BusinessException` 실패 응답을 사용합니다.
|
||||
|
||||
## 테스트
|
||||
|
||||
전체 테스트:
|
||||
|
||||
```powershell
|
||||
.\gradlew.bat clean test
|
||||
```
|
||||
|
||||
샘플 엑셀 전체 흐름 테스트:
|
||||
|
||||
```powershell
|
||||
.\gradlew.bat test --tests "com.kri.p6.ncrc.pairing.service.PairingServiceTest.pairingMemberByCenterCreatesResultWorkbook"
|
||||
```
|
||||
|
||||
실제 API 실행 테스트:
|
||||
|
||||
```powershell
|
||||
.\gradlew.bat bootJar
|
||||
java -jar build/libs/ncrc-pairing-0.0.1-SNAPSHOT.jar
|
||||
curl.exe -X POST "http://localhost:6111/api/v1/pairing/run" -F "file=@src/main/resources/sample/기초 data dummy.xlsx" -o build/api-result.xlsx
|
||||
```
|
||||
67
build.gradle
Normal file
67
build.gradle
Normal file
@@ -0,0 +1,67 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '3.5.7'
|
||||
id 'io.spring.dependency-management' version '1.1.7'
|
||||
}
|
||||
|
||||
group = 'com.kri.p6'
|
||||
version = '0.0.1-SNAPSHOT'
|
||||
description = 'ncrc-pairing'
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(17)
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
options.encoding = 'UTF-8'
|
||||
}
|
||||
|
||||
configurations {
|
||||
compileOnly {
|
||||
extendsFrom annotationProcessor
|
||||
}
|
||||
}
|
||||
|
||||
def giteaUser = findProperty("giteaUser") ?: ""
|
||||
def giteaToken = findProperty("giteaToken") ?: ""
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
||||
maven {
|
||||
name = "gitea"
|
||||
url = uri("https://gitea.kric.com/api/packages/KRi/maven")
|
||||
//allowInsecureProtocol = true
|
||||
credentials {
|
||||
username = giteaUser
|
||||
password = giteaToken
|
||||
}
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
implementation "com.kri.common:starter:beta.1.1.15"
|
||||
implementation "org.apache.poi:poi-ooxml:5.5.1"
|
||||
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-security'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-validation'
|
||||
implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.11"
|
||||
|
||||
//ortools-java CP-SAT Solver를 사용하기 위함
|
||||
implementation "com.google.ortools:ortools-java:9.15.6755"
|
||||
|
||||
compileOnly 'org.projectlombok:lombok'
|
||||
annotationProcessor 'org.projectlombok:lombok'
|
||||
|
||||
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
||||
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||
testImplementation 'org.springframework.security:spring-security-test'
|
||||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
||||
}
|
||||
|
||||
tasks.named('test') {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
7
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
7
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
248
gradlew
vendored
Normal file
248
gradlew
vendored
Normal file
@@ -0,0 +1,248 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/2d6327017519d23b96af35865dc997fcb544fb40/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
93
gradlew.bat
vendored
Normal file
93
gradlew.bat
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
1
settings.gradle
Normal file
1
settings.gradle
Normal file
@@ -0,0 +1 @@
|
||||
rootProject.name = 'ncrc-pairing'
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.kri.p6.ncrc.pairing;
|
||||
|
||||
import lombok.Generated;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
|
||||
|
||||
@SpringBootApplication
|
||||
@ConfigurationPropertiesScan
|
||||
public class NcrcPairingApplication {
|
||||
@Generated
|
||||
private static final Logger log = LoggerFactory.getLogger(NcrcPairingApplication.class);
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(NcrcPairingApplication.class, args);
|
||||
}
|
||||
}
|
||||
46
src/main/java/com/kri/p6/ncrc/pairing/common/cache/DatagoHolidayCache.java
vendored
Normal file
46
src/main/java/com/kri/p6/ncrc/pairing/common/cache/DatagoHolidayCache.java
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
package com.kri.p6.ncrc.pairing.common.cache;
|
||||
|
||||
import com.kri.common.feature.cache.AbstractListCache;
|
||||
import com.kri.p6.ncrc.pairing.common.external.datago.DatagoExtentionApiClient;
|
||||
import com.kri.p6.ncrc.pairing.common.external.datago.HolidayDto;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.Generated;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class DatagoHolidayCache extends AbstractListCache<HolidayDto> {
|
||||
private final DatagoExtentionApiClient datagoExtentionApiClient;
|
||||
|
||||
public synchronized List<HolidayDto> getHolidays(Set<String> years) {
|
||||
Set<String> cachedYears = getList().stream()
|
||||
.map(this::extractYear)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
years.stream()
|
||||
.filter(year -> !cachedYears.contains(year))
|
||||
.sorted()
|
||||
.forEach(year -> addAll(datagoExtentionApiClient.getHoliDayList(year)));
|
||||
|
||||
return getList().stream()
|
||||
.filter(holiday -> years.contains(extractYear(holiday)))
|
||||
.toList();
|
||||
}
|
||||
|
||||
protected List<HolidayDto> loadFromDb() {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
private String extractYear(HolidayDto holidayDto) {
|
||||
String date = holidayDto.getHolidayDate();
|
||||
return date != null && date.length() >= 4 ? date.substring(0, 4) : "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Generated
|
||||
public DatagoHolidayCache(final DatagoExtentionApiClient datagoExtentionApiClient) {
|
||||
this.datagoExtentionApiClient = datagoExtentionApiClient;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.kri.p6.ncrc.pairing.common.consts;
|
||||
|
||||
public final class PairingConstant {
|
||||
public static final String SHEET_MEMBER = "위원정보";
|
||||
public static final String SHEET_MUNICIPALITY = "지자체 정보";
|
||||
public static final String SHEET_CENTER = "센터정보";
|
||||
public static final String SHEET_MEMBER_REGION_CODE = "위원 지역 코드표";
|
||||
public static final String SHEET_CENTER_ADJACENT_REGION = "센터 인접지역표";
|
||||
public static final String SHEET_PREFERENCE_MATCH = "희망지역 매칭표";
|
||||
public static final String RESULT_SHEET_ASSIGNMENT = "배정결과";
|
||||
public static final String RESULT_SHEET_UNASSIGNED_CENTER = "미배정센터";
|
||||
public static final String RESULT_SHEET_UNUSED_MEMBER = "미사용위원";
|
||||
public static final String RESULT_SHEET_SUMMARY = "처리요약";
|
||||
public static final String RESULT_SHEET_AB_PAIR = "AB페어목록";
|
||||
public static final String RESULT_SHEET_CANDIDATE_SUMMARY = "후보요약";
|
||||
public static final String RESULT_SHEET_VALIDATION_ERROR = "검증오류";
|
||||
public static final String RESULT_SHEET_RULE_CHECK = "규칙위반검사";
|
||||
|
||||
private PairingConstant() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.kri.p6.ncrc.pairing.common.enums;
|
||||
|
||||
public enum ExperienceType {
|
||||
EXPERIENCED,
|
||||
NEW;
|
||||
|
||||
// $FF: synthetic method
|
||||
private static ExperienceType[] $values() {
|
||||
return new ExperienceType[]{EXPERIENCED, NEW};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.kri.p6.ncrc.pairing.common.enums;
|
||||
|
||||
public enum Gender {
|
||||
FEMALE,
|
||||
MALE;
|
||||
|
||||
// $FF: synthetic method
|
||||
private static Gender[] $values() {
|
||||
return new Gender[]{FEMALE, MALE};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.kri.p6.ncrc.pairing.common.enums;
|
||||
|
||||
public enum MemberRole {
|
||||
FIELD,
|
||||
EXTERNAL;
|
||||
|
||||
// $FF: synthetic method
|
||||
private static MemberRole[] $values() {
|
||||
return new MemberRole[]{FIELD, EXTERNAL};
|
||||
}
|
||||
}
|
||||
51
src/main/java/com/kri/p6/ncrc/pairing/common/external/datago/DatagoExtentionApiClient.java
vendored
Normal file
51
src/main/java/com/kri/p6/ncrc/pairing/common/external/datago/DatagoExtentionApiClient.java
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
package com.kri.p6.ncrc.pairing.common.external.datago;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.kri.common.feature.http.ExternalApiClient;
|
||||
import com.kri.common.feature.http.ExternalApiResponse;
|
||||
import com.kri.common.feature.web.BusinessException;
|
||||
import com.kri.p6.ncrc.pairing.common.external.datago.DatagoHolidayApiResponseDto.Body;
|
||||
import com.kri.p6.ncrc.pairing.common.external.datago.DatagoHolidayApiResponseDto.Items;
|
||||
import com.kri.p6.ncrc.pairing.common.external.datago.DatagoHolidayApiResponseDto.Response;
|
||||
import com.kri.p6.ncrc.pairing.common.external.datago.DatagoHolidayApiResponseDto.DatagoHolidayItemDto;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class DatagoExtentionApiClient {
|
||||
private final ExternalApiClient externalApiClient = new ExternalApiClient();
|
||||
private final ObjectMapper objectMapper = new ObjectMapper();
|
||||
@Value("${kri.auth.servicekey}")
|
||||
private String serviceKey;
|
||||
|
||||
public List<HolidayDto> getHoliDayList(String year) {
|
||||
String baseUrl = "http://apis.data.go.kr/B090041/openapi/service/SpcdeInfoService/getRestDeInfo";
|
||||
String url = String.format("%s?ServiceKey=%s&pageNo=1&_type=json&numOfRows=1000&solYear=%s", baseUrl, serviceKey, year);
|
||||
Map<String, String> headers = new HashMap();
|
||||
|
||||
try {
|
||||
ExternalApiResponse response = externalApiClient.get(url, headers);
|
||||
|
||||
if (response != null && response.getBody() != null && !response.getBody().isBlank()) {
|
||||
DatagoHolidayApiResponseDto apiResponse = objectMapper.readValue(response.getBody(), DatagoHolidayApiResponseDto.class);
|
||||
List<DatagoHolidayItemDto> items = Optional.ofNullable(apiResponse)
|
||||
.map(DatagoHolidayApiResponseDto::getResponse)
|
||||
.map(Response::getBody)
|
||||
.map(Body::getItems)
|
||||
.map(Items::getItem)
|
||||
.orElse(Collections.emptyList());
|
||||
|
||||
return items.stream().map(item -> HolidayDto.of(item.getLocdate(), item.getDateName())).toList();
|
||||
} else {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw BusinessException.internalError("DATAGO_HOLIDAY_API_FAILED", "국공휴일 정보를 조회하는 중 오류가 발생했습니다: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
210
src/main/java/com/kri/p6/ncrc/pairing/common/external/datago/DatagoHolidayApiResponseDto.java
vendored
Normal file
210
src/main/java/com/kri/p6/ncrc/pairing/common/external/datago/DatagoHolidayApiResponseDto.java
vendored
Normal file
@@ -0,0 +1,210 @@
|
||||
package com.kri.p6.ncrc.pairing.common.external.datago;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat.Feature;
|
||||
import java.util.List;
|
||||
import lombok.Generated;
|
||||
|
||||
@JsonIgnoreProperties(
|
||||
ignoreUnknown = true
|
||||
)
|
||||
public class DatagoHolidayApiResponseDto {
|
||||
private Response response;
|
||||
|
||||
@Generated
|
||||
public Response getResponse() {
|
||||
return this.response;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setResponse(final Response response) {
|
||||
this.response = response;
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(
|
||||
ignoreUnknown = true
|
||||
)
|
||||
public static class Response {
|
||||
private Header header;
|
||||
private Body body;
|
||||
|
||||
@Generated
|
||||
public Header getHeader() {
|
||||
return this.header;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public Body getBody() {
|
||||
return this.body;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setHeader(final Header header) {
|
||||
this.header = header;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setBody(final Body body) {
|
||||
this.body = body;
|
||||
}
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(
|
||||
ignoreUnknown = true
|
||||
)
|
||||
public static class Header {
|
||||
private String resultCode;
|
||||
private String resultMsg;
|
||||
|
||||
@Generated
|
||||
public String getResultCode() {
|
||||
return this.resultCode;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getResultMsg() {
|
||||
return this.resultMsg;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setResultCode(final String resultCode) {
|
||||
this.resultCode = resultCode;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setResultMsg(final String resultMsg) {
|
||||
this.resultMsg = resultMsg;
|
||||
}
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(
|
||||
ignoreUnknown = true
|
||||
)
|
||||
public static class Body {
|
||||
private Integer numOfRows;
|
||||
private Integer pageNo;
|
||||
private Integer totalCount;
|
||||
private Items items;
|
||||
|
||||
@Generated
|
||||
public Integer getNumOfRows() {
|
||||
return this.numOfRows;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public Integer getPageNo() {
|
||||
return this.pageNo;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public Integer getTotalCount() {
|
||||
return this.totalCount;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public Items getItems() {
|
||||
return this.items;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setNumOfRows(final Integer numOfRows) {
|
||||
this.numOfRows = numOfRows;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setPageNo(final Integer pageNo) {
|
||||
this.pageNo = pageNo;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setTotalCount(final Integer totalCount) {
|
||||
this.totalCount = totalCount;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setItems(final Items items) {
|
||||
this.items = items;
|
||||
}
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(
|
||||
ignoreUnknown = true
|
||||
)
|
||||
public static class Items {
|
||||
@JsonProperty("item")
|
||||
@JsonFormat(
|
||||
with = {Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY}
|
||||
)
|
||||
private List<DatagoHolidayItemDto> item;
|
||||
|
||||
@Generated
|
||||
public List<DatagoHolidayItemDto> getItem() {
|
||||
return this.item;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setItem(final List<DatagoHolidayItemDto> item) {
|
||||
this.item = item;
|
||||
}
|
||||
}
|
||||
|
||||
public static class DatagoHolidayItemDto {
|
||||
private String dateKind;
|
||||
private String dateName;
|
||||
private String isHoliday;
|
||||
private String locdate;
|
||||
private Integer seq;
|
||||
|
||||
@Generated
|
||||
public String getDateKind() {
|
||||
return this.dateKind;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getDateName() {
|
||||
return this.dateName;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getIsHoliday() {
|
||||
return this.isHoliday;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getLocdate() {
|
||||
return this.locdate;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public Integer getSeq() {
|
||||
return this.seq;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setDateKind(final String dateKind) {
|
||||
this.dateKind = dateKind;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setDateName(final String dateName) {
|
||||
this.dateName = dateName;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setIsHoliday(final String isHoliday) {
|
||||
this.isHoliday = isHoliday;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setLocdate(final String locdate) {
|
||||
this.locdate = locdate;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setSeq(final Integer seq) {
|
||||
this.seq = seq;
|
||||
}
|
||||
}
|
||||
}
|
||||
4
src/main/java/com/kri/p6/ncrc/pairing/common/external/datago/DatagoHolidayItemDto.java
vendored
Normal file
4
src/main/java/com/kri/p6/ncrc/pairing/common/external/datago/DatagoHolidayItemDto.java
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
package com.kri.p6.ncrc.pairing.common.external.datago;
|
||||
|
||||
public class DatagoHolidayItemDto {
|
||||
}
|
||||
71
src/main/java/com/kri/p6/ncrc/pairing/common/external/datago/HolidayDto.java
vendored
Normal file
71
src/main/java/com/kri/p6/ncrc/pairing/common/external/datago/HolidayDto.java
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
package com.kri.p6.ncrc.pairing.common.external.datago;
|
||||
|
||||
import lombok.Generated;
|
||||
|
||||
public class HolidayDto {
|
||||
private String holidayDate;
|
||||
private String holidayName;
|
||||
|
||||
public static HolidayDto of(String holidayDate, String holidayName) {
|
||||
return builder().holidayDate(holidayDate).holidayName(holidayName).build();
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static HolidayDtoBuilder builder() {
|
||||
return new HolidayDtoBuilder();
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getHolidayDate() {
|
||||
return this.holidayDate;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getHolidayName() {
|
||||
return this.holidayName;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public HolidayDto() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public HolidayDto(final String holidayDate, final String holidayName) {
|
||||
this.holidayDate = holidayDate;
|
||||
this.holidayName = holidayName;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static class HolidayDtoBuilder {
|
||||
@Generated
|
||||
private String holidayDate;
|
||||
@Generated
|
||||
private String holidayName;
|
||||
|
||||
@Generated
|
||||
HolidayDtoBuilder() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public HolidayDtoBuilder holidayDate(final String holidayDate) {
|
||||
this.holidayDate = holidayDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public HolidayDtoBuilder holidayName(final String holidayName) {
|
||||
this.holidayName = holidayName;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public HolidayDto build() {
|
||||
return new HolidayDto(this.holidayDate, this.holidayName);
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
return "HolidayDto.HolidayDtoBuilder(holidayDate=" + this.holidayDate + ", holidayName=" + this.holidayName + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.kri.p6.ncrc.pairing.common.util;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import lombok.Generated;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
public final class ExcelResponseBuilder {
|
||||
public static ResponseEntity<byte[]> buildExcelResponse(String fileName, byte[] bytes) {
|
||||
String var10000 = URLEncoder.encode(fileName, StandardCharsets.UTF_8);
|
||||
String contentDisposition = "attachment; filename*=UTF-8''" + var10000.replace("+", "%20");
|
||||
return ((ResponseEntity.BodyBuilder)ResponseEntity.ok().header("Content-Disposition", new String[]{contentDisposition})).contentType(MediaType.parseMediaType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")).body(bytes);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.kri.p6.ncrc.pairing.config;
|
||||
|
||||
import com.google.ortools.Loader;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class OrToolsConfig {
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
Loader.loadNativeLibraries();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,259 @@
|
||||
package com.kri.p6.ncrc.pairing.config;
|
||||
|
||||
import lombok.Generated;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
@ConfigurationProperties(
|
||||
prefix = "pairing"
|
||||
)
|
||||
public class PairingProperties {
|
||||
private Excel excel = new Excel();
|
||||
private Code code = new Code();
|
||||
private Rule rule = new Rule();
|
||||
private Preference preference = new Preference();
|
||||
private Objective objective = new Objective();
|
||||
private Solver solver = new Solver();
|
||||
|
||||
@Generated
|
||||
public Excel getExcel() {
|
||||
return this.excel;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public Code getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public Rule getRule() {
|
||||
return this.rule;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public Preference getPreference() {
|
||||
return this.preference;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public Objective getObjective() {
|
||||
return this.objective;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public Solver getSolver() {
|
||||
return this.solver;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setExcel(final Excel excel) {
|
||||
this.excel = excel;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setCode(final Code code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setRule(final Rule rule) {
|
||||
this.rule = rule;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setPreference(final Preference preference) {
|
||||
this.preference = preference;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setObjective(final Objective objective) {
|
||||
this.objective = objective;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setSolver(final Solver solver) {
|
||||
this.solver = solver;
|
||||
}
|
||||
|
||||
public static class Excel {
|
||||
private int headerRowIndex = 1;
|
||||
|
||||
@Generated
|
||||
public int getHeaderRowIndex() {
|
||||
return this.headerRowIndex;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setHeaderRowIndex(final int headerRowIndex) {
|
||||
this.headerRowIndex = headerRowIndex;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Code {
|
||||
private int regionCodeLength = 2;
|
||||
private int residenceCodeLength = 5;
|
||||
private int residenceMatchPrefixLength = 3;
|
||||
private String anyRegionCode = "00";
|
||||
|
||||
@Generated
|
||||
public int getRegionCodeLength() {
|
||||
return this.regionCodeLength;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int getResidenceCodeLength() {
|
||||
return this.residenceCodeLength;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int getResidenceMatchPrefixLength() {
|
||||
return this.residenceMatchPrefixLength;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getAnyRegionCode() {
|
||||
return this.anyRegionCode;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setRegionCodeLength(final int regionCodeLength) {
|
||||
this.regionCodeLength = regionCodeLength;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setResidenceCodeLength(final int residenceCodeLength) {
|
||||
this.residenceCodeLength = residenceCodeLength;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setResidenceMatchPrefixLength(final int residenceMatchPrefixLength) {
|
||||
this.residenceMatchPrefixLength = residenceMatchPrefixLength;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setAnyRegionCode(final String anyRegionCode) {
|
||||
this.anyRegionCode = anyRegionCode;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Rule {
|
||||
private int maxCentersPerPairPerDay = 3;
|
||||
private int maxCounterpartsPerMember = 2;
|
||||
|
||||
@Generated
|
||||
public int getMaxCentersPerPairPerDay() {
|
||||
return this.maxCentersPerPairPerDay;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int getMaxCounterpartsPerMember() {
|
||||
return this.maxCounterpartsPerMember;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setMaxCentersPerPairPerDay(final int maxCentersPerPairPerDay) {
|
||||
this.maxCentersPerPairPerDay = maxCentersPerPairPerDay;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setMaxCounterpartsPerMember(final int maxCounterpartsPerMember) {
|
||||
this.maxCounterpartsPerMember = maxCounterpartsPerMember;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Preference {
|
||||
private int anywhereRank = 0;
|
||||
private int ignoredRank = 99;
|
||||
|
||||
@Generated
|
||||
public int getAnywhereRank() {
|
||||
return this.anywhereRank;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int getIgnoredRank() {
|
||||
return this.ignoredRank;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setAnywhereRank(final int anywhereRank) {
|
||||
this.anywhereRank = anywhereRank;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setIgnoredRank(final int ignoredRank) {
|
||||
this.ignoredRank = ignoredRank;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Objective {
|
||||
private long assignmentWeight = 1000000L;
|
||||
private long preferenceBaseWeight = 10000L;
|
||||
private long preferenceRankPenalty = 100L;
|
||||
private long residenceMatchWeight = 1000L;
|
||||
|
||||
@Generated
|
||||
public long getAssignmentWeight() {
|
||||
return this.assignmentWeight;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public long getPreferenceBaseWeight() {
|
||||
return this.preferenceBaseWeight;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public long getPreferenceRankPenalty() {
|
||||
return this.preferenceRankPenalty;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public long getResidenceMatchWeight() {
|
||||
return this.residenceMatchWeight;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setAssignmentWeight(final long assignmentWeight) {
|
||||
this.assignmentWeight = assignmentWeight;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setPreferenceBaseWeight(final long preferenceBaseWeight) {
|
||||
this.preferenceBaseWeight = preferenceBaseWeight;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setPreferenceRankPenalty(final long preferenceRankPenalty) {
|
||||
this.preferenceRankPenalty = preferenceRankPenalty;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setResidenceMatchWeight(final long residenceMatchWeight) {
|
||||
this.residenceMatchWeight = residenceMatchWeight;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Solver {
|
||||
private double maxTimeSeconds = (double)30.0F;
|
||||
private int numSearchWorkers = Math.max(1, Runtime.getRuntime().availableProcessors() - 1);
|
||||
|
||||
@Generated
|
||||
public double getMaxTimeSeconds() {
|
||||
return this.maxTimeSeconds;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int getNumSearchWorkers() {
|
||||
return this.numSearchWorkers;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setMaxTimeSeconds(final double maxTimeSeconds) {
|
||||
this.maxTimeSeconds = maxTimeSeconds;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setNumSearchWorkers(final int numSearchWorkers) {
|
||||
this.numSearchWorkers = numSearchWorkers;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.kri.p6.ncrc.pairing.controller;
|
||||
|
||||
import com.kri.common.feature.web.BusinessException;
|
||||
import com.kri.p6.ncrc.pairing.common.cache.DatagoHolidayCache;
|
||||
import com.kri.p6.ncrc.pairing.common.external.datago.HolidayDto;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/admin-cache")
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "Admin Cache", description = "캐시 관리 API")
|
||||
public class CacheAdminController {
|
||||
|
||||
private final DatagoHolidayCache datagoHolidayCache;
|
||||
|
||||
@Operation(summary = "국공휴일 캐시 조회")
|
||||
@GetMapping("/holiday/{year}")
|
||||
public List<HolidayDto> getHolidays(
|
||||
@PathVariable("year") String year
|
||||
) {
|
||||
if (year.length() != 4) {
|
||||
throw BusinessException.badRequest("INVALID_YEAR_FORMAT", "년도 형식이 올바르지 않습니다.");
|
||||
}
|
||||
|
||||
Set<String> years = Set.of(year);
|
||||
return datagoHolidayCache.getHolidays(years);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.kri.p6.ncrc.pairing.controller;
|
||||
|
||||
import com.kri.common.feature.web.BusinessException;
|
||||
import com.kri.p6.ncrc.pairing.common.util.ExcelResponseBuilder;
|
||||
import com.kri.p6.ncrc.pairing.service.PairingExcelService;
|
||||
import com.kri.p6.ncrc.pairing.service.PairingService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.Generated;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@RestController
|
||||
@RequestMapping({"/api/v1/pairing"})
|
||||
@Tag(
|
||||
name = "Pairing",
|
||||
description = "위원/센터 매칭 API"
|
||||
)
|
||||
public class PairingController {
|
||||
private final PairingService pairingService;
|
||||
private final PairingExcelService pairingExcelService;
|
||||
|
||||
@PostMapping({"/run"})
|
||||
@Operation(
|
||||
summary = "업로드된 파일로 위원과 센터를 매칭"
|
||||
)
|
||||
public ResponseEntity<byte[]> pairingMemberByCenter(@Parameter(description = "업로드 파일",required = true) @RequestPart("file") MultipartFile file) {
|
||||
String fileName = file.getOriginalFilename() == null ? "pairing" : file.getOriginalFilename();
|
||||
|
||||
try {
|
||||
byte[] bytes = this.pairingService.pairingMemberByCenter(file);
|
||||
return ExcelResponseBuilder.buildExcelResponse(fileName + " 결과.xlsx", bytes);
|
||||
} catch (BusinessException e) {
|
||||
if (e.getStatus() != HttpStatus.BAD_REQUEST) {
|
||||
throw e;
|
||||
} else {
|
||||
byte[] bytes = this.pairingExcelService.writeValidationError(e.getCode(), e.getMessage());
|
||||
return ExcelResponseBuilder.buildExcelResponse(fileName + " 오류.xlsx", bytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingController(final PairingService pairingService, final PairingExcelService pairingExcelService) {
|
||||
this.pairingService = pairingService;
|
||||
this.pairingExcelService = pairingExcelService;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.input;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
|
||||
public class CenterAdjacentRegionExcelDto {
|
||||
@ExcelColumn(
|
||||
header = "권역",
|
||||
order = 0,
|
||||
width = 12
|
||||
)
|
||||
private String dispatchRegion;
|
||||
@ExcelColumn(
|
||||
header = "인접지역 분류",
|
||||
order = 1,
|
||||
width = 15
|
||||
)
|
||||
private String adjacentRegionClassification;
|
||||
|
||||
@Generated
|
||||
public String getDispatchRegion() {
|
||||
return this.dispatchRegion;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getAdjacentRegionClassification() {
|
||||
return this.adjacentRegionClassification;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setDispatchRegion(final String dispatchRegion) {
|
||||
this.dispatchRegion = dispatchRegion;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setAdjacentRegionClassification(final String adjacentRegionClassification) {
|
||||
this.adjacentRegionClassification = adjacentRegionClassification;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public boolean equals(final Object o) {
|
||||
if (o == this) {
|
||||
return true;
|
||||
} else if (!(o instanceof CenterAdjacentRegionExcelDto)) {
|
||||
return false;
|
||||
} else {
|
||||
CenterAdjacentRegionExcelDto other = (CenterAdjacentRegionExcelDto)o;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
} else {
|
||||
Object this$dispatchRegion = this.getDispatchRegion();
|
||||
Object other$dispatchRegion = other.getDispatchRegion();
|
||||
if (this$dispatchRegion == null) {
|
||||
if (other$dispatchRegion != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$dispatchRegion.equals(other$dispatchRegion)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$adjacentRegionClassification = this.getAdjacentRegionClassification();
|
||||
Object other$adjacentRegionClassification = other.getAdjacentRegionClassification();
|
||||
if (this$adjacentRegionClassification == null) {
|
||||
if (other$adjacentRegionClassification != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$adjacentRegionClassification.equals(other$adjacentRegionClassification)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Generated
|
||||
protected boolean canEqual(final Object other) {
|
||||
return other instanceof CenterAdjacentRegionExcelDto;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int hashCode() {
|
||||
int PRIME = 59;
|
||||
int result = 1;
|
||||
Object $dispatchRegion = this.getDispatchRegion();
|
||||
result = result * 59 + ($dispatchRegion == null ? 43 : $dispatchRegion.hashCode());
|
||||
Object $adjacentRegionClassification = this.getAdjacentRegionClassification();
|
||||
result = result * 59 + ($adjacentRegionClassification == null ? 43 : $adjacentRegionClassification.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
String var10000 = this.getDispatchRegion();
|
||||
return "CenterAdjacentRegionExcelDto(dispatchRegion=" + var10000 + ", adjacentRegionClassification=" + this.getAdjacentRegionClassification() + ")";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,237 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.input;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
|
||||
public class CenterExcelDto {
|
||||
@ExcelColumn(
|
||||
header = "id",
|
||||
order = 0,
|
||||
width = 15
|
||||
)
|
||||
private String id;
|
||||
@ExcelColumn(
|
||||
header = "지자체 id",
|
||||
order = 1,
|
||||
width = 15
|
||||
)
|
||||
private String municipalityId;
|
||||
@ExcelColumn(
|
||||
header = "여성 위원만",
|
||||
order = 2,
|
||||
width = 12
|
||||
)
|
||||
private String womenOnly;
|
||||
@ExcelColumn(
|
||||
header = "인접지역 분류",
|
||||
order = 3,
|
||||
width = 15
|
||||
)
|
||||
private String adjacentRegionClassification;
|
||||
@ExcelColumn(
|
||||
header = "진행 시작일",
|
||||
order = 4,
|
||||
width = 15
|
||||
)
|
||||
private String availableStartDate;
|
||||
@ExcelColumn(
|
||||
header = "진행 종료일",
|
||||
order = 5,
|
||||
width = 15
|
||||
)
|
||||
private String availableEndDate;
|
||||
@ExcelColumn(
|
||||
header = "진행 불가 일자",
|
||||
order = 6,
|
||||
width = 35
|
||||
)
|
||||
private String unavailableDates;
|
||||
|
||||
@Generated
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getMunicipalityId() {
|
||||
return this.municipalityId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getWomenOnly() {
|
||||
return this.womenOnly;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getAdjacentRegionClassification() {
|
||||
return this.adjacentRegionClassification;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getAvailableStartDate() {
|
||||
return this.availableStartDate;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getAvailableEndDate() {
|
||||
return this.availableEndDate;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getUnavailableDates() {
|
||||
return this.unavailableDates;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setId(final String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setMunicipalityId(final String municipalityId) {
|
||||
this.municipalityId = municipalityId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setWomenOnly(final String womenOnly) {
|
||||
this.womenOnly = womenOnly;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setAdjacentRegionClassification(final String adjacentRegionClassification) {
|
||||
this.adjacentRegionClassification = adjacentRegionClassification;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setAvailableStartDate(final String availableStartDate) {
|
||||
this.availableStartDate = availableStartDate;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setAvailableEndDate(final String availableEndDate) {
|
||||
this.availableEndDate = availableEndDate;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setUnavailableDates(final String unavailableDates) {
|
||||
this.unavailableDates = unavailableDates;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public boolean equals(final Object o) {
|
||||
if (o == this) {
|
||||
return true;
|
||||
} else if (!(o instanceof CenterExcelDto)) {
|
||||
return false;
|
||||
} else {
|
||||
CenterExcelDto other = (CenterExcelDto)o;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
} else {
|
||||
Object this$id = this.getId();
|
||||
Object other$id = other.getId();
|
||||
if (this$id == null) {
|
||||
if (other$id != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$id.equals(other$id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$municipalityId = this.getMunicipalityId();
|
||||
Object other$municipalityId = other.getMunicipalityId();
|
||||
if (this$municipalityId == null) {
|
||||
if (other$municipalityId != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$municipalityId.equals(other$municipalityId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$womenOnly = this.getWomenOnly();
|
||||
Object other$womenOnly = other.getWomenOnly();
|
||||
if (this$womenOnly == null) {
|
||||
if (other$womenOnly != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$womenOnly.equals(other$womenOnly)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$adjacentRegionClassification = this.getAdjacentRegionClassification();
|
||||
Object other$adjacentRegionClassification = other.getAdjacentRegionClassification();
|
||||
if (this$adjacentRegionClassification == null) {
|
||||
if (other$adjacentRegionClassification != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$adjacentRegionClassification.equals(other$adjacentRegionClassification)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$availableStartDate = this.getAvailableStartDate();
|
||||
Object other$availableStartDate = other.getAvailableStartDate();
|
||||
if (this$availableStartDate == null) {
|
||||
if (other$availableStartDate != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$availableStartDate.equals(other$availableStartDate)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$availableEndDate = this.getAvailableEndDate();
|
||||
Object other$availableEndDate = other.getAvailableEndDate();
|
||||
if (this$availableEndDate == null) {
|
||||
if (other$availableEndDate != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$availableEndDate.equals(other$availableEndDate)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$unavailableDates = this.getUnavailableDates();
|
||||
Object other$unavailableDates = other.getUnavailableDates();
|
||||
if (this$unavailableDates == null) {
|
||||
if (other$unavailableDates != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$unavailableDates.equals(other$unavailableDates)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Generated
|
||||
protected boolean canEqual(final Object other) {
|
||||
return other instanceof CenterExcelDto;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int hashCode() {
|
||||
int PRIME = 59;
|
||||
int result = 1;
|
||||
Object $id = this.getId();
|
||||
result = result * 59 + ($id == null ? 43 : $id.hashCode());
|
||||
Object $municipalityId = this.getMunicipalityId();
|
||||
result = result * 59 + ($municipalityId == null ? 43 : $municipalityId.hashCode());
|
||||
Object $womenOnly = this.getWomenOnly();
|
||||
result = result * 59 + ($womenOnly == null ? 43 : $womenOnly.hashCode());
|
||||
Object $adjacentRegionClassification = this.getAdjacentRegionClassification();
|
||||
result = result * 59 + ($adjacentRegionClassification == null ? 43 : $adjacentRegionClassification.hashCode());
|
||||
Object $availableStartDate = this.getAvailableStartDate();
|
||||
result = result * 59 + ($availableStartDate == null ? 43 : $availableStartDate.hashCode());
|
||||
Object $availableEndDate = this.getAvailableEndDate();
|
||||
result = result * 59 + ($availableEndDate == null ? 43 : $availableEndDate.hashCode());
|
||||
Object $unavailableDates = this.getUnavailableDates();
|
||||
result = result * 59 + ($unavailableDates == null ? 43 : $unavailableDates.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
String var10000 = this.getId();
|
||||
return "CenterExcelDto(id=" + var10000 + ", municipalityId=" + this.getMunicipalityId() + ", womenOnly=" + this.getWomenOnly() + ", adjacentRegionClassification=" + this.getAdjacentRegionClassification() + ", availableStartDate=" + this.getAvailableStartDate() + ", availableEndDate=" + this.getAvailableEndDate() + ", unavailableDates=" + this.getUnavailableDates() + ")";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,433 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.input;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
|
||||
public class MemberExcelDto {
|
||||
@ExcelColumn(
|
||||
header = "id",
|
||||
order = 0,
|
||||
width = 15
|
||||
)
|
||||
private String id;
|
||||
@ExcelColumn(
|
||||
header = "성별",
|
||||
order = 1,
|
||||
width = 10
|
||||
)
|
||||
private String gender;
|
||||
@ExcelColumn(
|
||||
header = "경력여부",
|
||||
order = 2,
|
||||
width = 12
|
||||
)
|
||||
private String experience;
|
||||
@ExcelColumn(
|
||||
header = "현장/외부 구분",
|
||||
order = 3,
|
||||
width = 18
|
||||
)
|
||||
private String role;
|
||||
@ExcelColumn(
|
||||
header = "진행 시작일",
|
||||
order = 4,
|
||||
width = 15
|
||||
)
|
||||
private String availableStartDate;
|
||||
@ExcelColumn(
|
||||
header = "진행 종료일",
|
||||
order = 5,
|
||||
width = 15
|
||||
)
|
||||
private String availableEndDate;
|
||||
@ExcelColumn(
|
||||
header = "진행 불가 일자",
|
||||
order = 6,
|
||||
width = 35
|
||||
)
|
||||
private String unavailableDates;
|
||||
@ExcelColumn(
|
||||
header = "활동지역",
|
||||
order = 7,
|
||||
width = 12
|
||||
)
|
||||
private String activityRegion;
|
||||
@ExcelColumn(
|
||||
header = "23년 진행 센터",
|
||||
order = 8,
|
||||
width = 25
|
||||
)
|
||||
private String historyCenters;
|
||||
@ExcelColumn(
|
||||
header = "거주지",
|
||||
order = 9,
|
||||
width = 12
|
||||
)
|
||||
private String residenceCode;
|
||||
@ExcelColumn(
|
||||
header = "선호 지역1",
|
||||
order = 10,
|
||||
width = 12
|
||||
)
|
||||
private String preferenceRegion1;
|
||||
@ExcelColumn(
|
||||
header = "선호 지역2",
|
||||
order = 11,
|
||||
width = 12
|
||||
)
|
||||
private String preferenceRegion2;
|
||||
@ExcelColumn(
|
||||
header = "선호 지역3",
|
||||
order = 12,
|
||||
width = 12
|
||||
)
|
||||
private String preferenceRegion3;
|
||||
@ExcelColumn(
|
||||
header = "선호 지역4",
|
||||
order = 13,
|
||||
width = 12
|
||||
)
|
||||
private String preferenceRegion4;
|
||||
|
||||
@Generated
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getGender() {
|
||||
return this.gender;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getExperience() {
|
||||
return this.experience;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getRole() {
|
||||
return this.role;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getAvailableStartDate() {
|
||||
return this.availableStartDate;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getAvailableEndDate() {
|
||||
return this.availableEndDate;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getUnavailableDates() {
|
||||
return this.unavailableDates;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getActivityRegion() {
|
||||
return this.activityRegion;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getHistoryCenters() {
|
||||
return this.historyCenters;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getResidenceCode() {
|
||||
return this.residenceCode;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getPreferenceRegion1() {
|
||||
return this.preferenceRegion1;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getPreferenceRegion2() {
|
||||
return this.preferenceRegion2;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getPreferenceRegion3() {
|
||||
return this.preferenceRegion3;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getPreferenceRegion4() {
|
||||
return this.preferenceRegion4;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setId(final String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setGender(final String gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setExperience(final String experience) {
|
||||
this.experience = experience;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setRole(final String role) {
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setAvailableStartDate(final String availableStartDate) {
|
||||
this.availableStartDate = availableStartDate;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setAvailableEndDate(final String availableEndDate) {
|
||||
this.availableEndDate = availableEndDate;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setUnavailableDates(final String unavailableDates) {
|
||||
this.unavailableDates = unavailableDates;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setActivityRegion(final String activityRegion) {
|
||||
this.activityRegion = activityRegion;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setHistoryCenters(final String historyCenters) {
|
||||
this.historyCenters = historyCenters;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setResidenceCode(final String residenceCode) {
|
||||
this.residenceCode = residenceCode;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setPreferenceRegion1(final String preferenceRegion1) {
|
||||
this.preferenceRegion1 = preferenceRegion1;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setPreferenceRegion2(final String preferenceRegion2) {
|
||||
this.preferenceRegion2 = preferenceRegion2;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setPreferenceRegion3(final String preferenceRegion3) {
|
||||
this.preferenceRegion3 = preferenceRegion3;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setPreferenceRegion4(final String preferenceRegion4) {
|
||||
this.preferenceRegion4 = preferenceRegion4;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public boolean equals(final Object o) {
|
||||
if (o == this) {
|
||||
return true;
|
||||
} else if (!(o instanceof MemberExcelDto)) {
|
||||
return false;
|
||||
} else {
|
||||
MemberExcelDto other = (MemberExcelDto)o;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
} else {
|
||||
Object this$id = this.getId();
|
||||
Object other$id = other.getId();
|
||||
if (this$id == null) {
|
||||
if (other$id != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$id.equals(other$id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$gender = this.getGender();
|
||||
Object other$gender = other.getGender();
|
||||
if (this$gender == null) {
|
||||
if (other$gender != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$gender.equals(other$gender)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$experience = this.getExperience();
|
||||
Object other$experience = other.getExperience();
|
||||
if (this$experience == null) {
|
||||
if (other$experience != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$experience.equals(other$experience)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$role = this.getRole();
|
||||
Object other$role = other.getRole();
|
||||
if (this$role == null) {
|
||||
if (other$role != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$role.equals(other$role)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$availableStartDate = this.getAvailableStartDate();
|
||||
Object other$availableStartDate = other.getAvailableStartDate();
|
||||
if (this$availableStartDate == null) {
|
||||
if (other$availableStartDate != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$availableStartDate.equals(other$availableStartDate)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$availableEndDate = this.getAvailableEndDate();
|
||||
Object other$availableEndDate = other.getAvailableEndDate();
|
||||
if (this$availableEndDate == null) {
|
||||
if (other$availableEndDate != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$availableEndDate.equals(other$availableEndDate)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$unavailableDates = this.getUnavailableDates();
|
||||
Object other$unavailableDates = other.getUnavailableDates();
|
||||
if (this$unavailableDates == null) {
|
||||
if (other$unavailableDates != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$unavailableDates.equals(other$unavailableDates)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$activityRegion = this.getActivityRegion();
|
||||
Object other$activityRegion = other.getActivityRegion();
|
||||
if (this$activityRegion == null) {
|
||||
if (other$activityRegion != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$activityRegion.equals(other$activityRegion)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$historyCenters = this.getHistoryCenters();
|
||||
Object other$historyCenters = other.getHistoryCenters();
|
||||
if (this$historyCenters == null) {
|
||||
if (other$historyCenters != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$historyCenters.equals(other$historyCenters)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$residenceCode = this.getResidenceCode();
|
||||
Object other$residenceCode = other.getResidenceCode();
|
||||
if (this$residenceCode == null) {
|
||||
if (other$residenceCode != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$residenceCode.equals(other$residenceCode)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$preferenceRegion1 = this.getPreferenceRegion1();
|
||||
Object other$preferenceRegion1 = other.getPreferenceRegion1();
|
||||
if (this$preferenceRegion1 == null) {
|
||||
if (other$preferenceRegion1 != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$preferenceRegion1.equals(other$preferenceRegion1)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$preferenceRegion2 = this.getPreferenceRegion2();
|
||||
Object other$preferenceRegion2 = other.getPreferenceRegion2();
|
||||
if (this$preferenceRegion2 == null) {
|
||||
if (other$preferenceRegion2 != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$preferenceRegion2.equals(other$preferenceRegion2)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$preferenceRegion3 = this.getPreferenceRegion3();
|
||||
Object other$preferenceRegion3 = other.getPreferenceRegion3();
|
||||
if (this$preferenceRegion3 == null) {
|
||||
if (other$preferenceRegion3 != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$preferenceRegion3.equals(other$preferenceRegion3)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$preferenceRegion4 = this.getPreferenceRegion4();
|
||||
Object other$preferenceRegion4 = other.getPreferenceRegion4();
|
||||
if (this$preferenceRegion4 == null) {
|
||||
if (other$preferenceRegion4 != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$preferenceRegion4.equals(other$preferenceRegion4)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Generated
|
||||
protected boolean canEqual(final Object other) {
|
||||
return other instanceof MemberExcelDto;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int hashCode() {
|
||||
int PRIME = 59;
|
||||
int result = 1;
|
||||
Object $id = this.getId();
|
||||
result = result * 59 + ($id == null ? 43 : $id.hashCode());
|
||||
Object $gender = this.getGender();
|
||||
result = result * 59 + ($gender == null ? 43 : $gender.hashCode());
|
||||
Object $experience = this.getExperience();
|
||||
result = result * 59 + ($experience == null ? 43 : $experience.hashCode());
|
||||
Object $role = this.getRole();
|
||||
result = result * 59 + ($role == null ? 43 : $role.hashCode());
|
||||
Object $availableStartDate = this.getAvailableStartDate();
|
||||
result = result * 59 + ($availableStartDate == null ? 43 : $availableStartDate.hashCode());
|
||||
Object $availableEndDate = this.getAvailableEndDate();
|
||||
result = result * 59 + ($availableEndDate == null ? 43 : $availableEndDate.hashCode());
|
||||
Object $unavailableDates = this.getUnavailableDates();
|
||||
result = result * 59 + ($unavailableDates == null ? 43 : $unavailableDates.hashCode());
|
||||
Object $activityRegion = this.getActivityRegion();
|
||||
result = result * 59 + ($activityRegion == null ? 43 : $activityRegion.hashCode());
|
||||
Object $historyCenters = this.getHistoryCenters();
|
||||
result = result * 59 + ($historyCenters == null ? 43 : $historyCenters.hashCode());
|
||||
Object $residenceCode = this.getResidenceCode();
|
||||
result = result * 59 + ($residenceCode == null ? 43 : $residenceCode.hashCode());
|
||||
Object $preferenceRegion1 = this.getPreferenceRegion1();
|
||||
result = result * 59 + ($preferenceRegion1 == null ? 43 : $preferenceRegion1.hashCode());
|
||||
Object $preferenceRegion2 = this.getPreferenceRegion2();
|
||||
result = result * 59 + ($preferenceRegion2 == null ? 43 : $preferenceRegion2.hashCode());
|
||||
Object $preferenceRegion3 = this.getPreferenceRegion3();
|
||||
result = result * 59 + ($preferenceRegion3 == null ? 43 : $preferenceRegion3.hashCode());
|
||||
Object $preferenceRegion4 = this.getPreferenceRegion4();
|
||||
result = result * 59 + ($preferenceRegion4 == null ? 43 : $preferenceRegion4.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
String var10000 = this.getId();
|
||||
return "MemberExcelDto(id=" + var10000 + ", gender=" + this.getGender() + ", experience=" + this.getExperience() + ", role=" + this.getRole() + ", availableStartDate=" + this.getAvailableStartDate() + ", availableEndDate=" + this.getAvailableEndDate() + ", unavailableDates=" + this.getUnavailableDates() + ", activityRegion=" + this.getActivityRegion() + ", historyCenters=" + this.getHistoryCenters() + ", residenceCode=" + this.getResidenceCode() + ", preferenceRegion1=" + this.getPreferenceRegion1() + ", preferenceRegion2=" + this.getPreferenceRegion2() + ", preferenceRegion3=" + this.getPreferenceRegion3() + ", preferenceRegion4=" + this.getPreferenceRegion4() + ")";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,209 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.input;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
|
||||
public class MemberRegionCodeExcelDto {
|
||||
@ExcelColumn(
|
||||
header = "시도",
|
||||
order = 0,
|
||||
width = 15
|
||||
)
|
||||
private String sido;
|
||||
@ExcelColumn(
|
||||
header = "시군구",
|
||||
order = 1,
|
||||
width = 15
|
||||
)
|
||||
private String sigungu;
|
||||
@ExcelColumn(
|
||||
header = "권역코드",
|
||||
order = 2,
|
||||
width = 12
|
||||
)
|
||||
private String regionCode;
|
||||
@ExcelColumn(
|
||||
header = "세부권역코드(중간 1자리)",
|
||||
order = 3,
|
||||
width = 25
|
||||
)
|
||||
private String detailRegionCode;
|
||||
@ExcelColumn(
|
||||
header = "세부지역코드(마지막2자리)",
|
||||
order = 4,
|
||||
width = 25
|
||||
)
|
||||
private String detailAreaCode;
|
||||
@ExcelColumn(
|
||||
header = "지역 코드",
|
||||
order = 5,
|
||||
width = 12
|
||||
)
|
||||
private String fullRegionCode;
|
||||
|
||||
@Generated
|
||||
public String getSido() {
|
||||
return this.sido;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getSigungu() {
|
||||
return this.sigungu;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getRegionCode() {
|
||||
return this.regionCode;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getDetailRegionCode() {
|
||||
return this.detailRegionCode;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getDetailAreaCode() {
|
||||
return this.detailAreaCode;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getFullRegionCode() {
|
||||
return this.fullRegionCode;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setSido(final String sido) {
|
||||
this.sido = sido;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setSigungu(final String sigungu) {
|
||||
this.sigungu = sigungu;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setRegionCode(final String regionCode) {
|
||||
this.regionCode = regionCode;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setDetailRegionCode(final String detailRegionCode) {
|
||||
this.detailRegionCode = detailRegionCode;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setDetailAreaCode(final String detailAreaCode) {
|
||||
this.detailAreaCode = detailAreaCode;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setFullRegionCode(final String fullRegionCode) {
|
||||
this.fullRegionCode = fullRegionCode;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public boolean equals(final Object o) {
|
||||
if (o == this) {
|
||||
return true;
|
||||
} else if (!(o instanceof MemberRegionCodeExcelDto)) {
|
||||
return false;
|
||||
} else {
|
||||
MemberRegionCodeExcelDto other = (MemberRegionCodeExcelDto)o;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
} else {
|
||||
Object this$sido = this.getSido();
|
||||
Object other$sido = other.getSido();
|
||||
if (this$sido == null) {
|
||||
if (other$sido != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$sido.equals(other$sido)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$sigungu = this.getSigungu();
|
||||
Object other$sigungu = other.getSigungu();
|
||||
if (this$sigungu == null) {
|
||||
if (other$sigungu != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$sigungu.equals(other$sigungu)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$regionCode = this.getRegionCode();
|
||||
Object other$regionCode = other.getRegionCode();
|
||||
if (this$regionCode == null) {
|
||||
if (other$regionCode != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$regionCode.equals(other$regionCode)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$detailRegionCode = this.getDetailRegionCode();
|
||||
Object other$detailRegionCode = other.getDetailRegionCode();
|
||||
if (this$detailRegionCode == null) {
|
||||
if (other$detailRegionCode != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$detailRegionCode.equals(other$detailRegionCode)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$detailAreaCode = this.getDetailAreaCode();
|
||||
Object other$detailAreaCode = other.getDetailAreaCode();
|
||||
if (this$detailAreaCode == null) {
|
||||
if (other$detailAreaCode != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$detailAreaCode.equals(other$detailAreaCode)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$fullRegionCode = this.getFullRegionCode();
|
||||
Object other$fullRegionCode = other.getFullRegionCode();
|
||||
if (this$fullRegionCode == null) {
|
||||
if (other$fullRegionCode != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$fullRegionCode.equals(other$fullRegionCode)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Generated
|
||||
protected boolean canEqual(final Object other) {
|
||||
return other instanceof MemberRegionCodeExcelDto;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int hashCode() {
|
||||
int PRIME = 59;
|
||||
int result = 1;
|
||||
Object $sido = this.getSido();
|
||||
result = result * 59 + ($sido == null ? 43 : $sido.hashCode());
|
||||
Object $sigungu = this.getSigungu();
|
||||
result = result * 59 + ($sigungu == null ? 43 : $sigungu.hashCode());
|
||||
Object $regionCode = this.getRegionCode();
|
||||
result = result * 59 + ($regionCode == null ? 43 : $regionCode.hashCode());
|
||||
Object $detailRegionCode = this.getDetailRegionCode();
|
||||
result = result * 59 + ($detailRegionCode == null ? 43 : $detailRegionCode.hashCode());
|
||||
Object $detailAreaCode = this.getDetailAreaCode();
|
||||
result = result * 59 + ($detailAreaCode == null ? 43 : $detailAreaCode.hashCode());
|
||||
Object $fullRegionCode = this.getFullRegionCode();
|
||||
result = result * 59 + ($fullRegionCode == null ? 43 : $fullRegionCode.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
String var10000 = this.getSido();
|
||||
return "MemberRegionCodeExcelDto(sido=" + var10000 + ", sigungu=" + this.getSigungu() + ", regionCode=" + this.getRegionCode() + ", detailRegionCode=" + this.getDetailRegionCode() + ", detailAreaCode=" + this.getDetailAreaCode() + ", fullRegionCode=" + this.getFullRegionCode() + ")";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.input;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
|
||||
public class MunicipalityExcelDto {
|
||||
@ExcelColumn(
|
||||
header = "지자체 id",
|
||||
order = 0,
|
||||
width = 15
|
||||
)
|
||||
private String id;
|
||||
@ExcelColumn(
|
||||
header = "진행 시작일",
|
||||
order = 1,
|
||||
width = 15
|
||||
)
|
||||
private String availableStartDate;
|
||||
@ExcelColumn(
|
||||
header = "진행 종료일",
|
||||
order = 2,
|
||||
width = 15
|
||||
)
|
||||
private String availableEndDate;
|
||||
@ExcelColumn(
|
||||
header = "진행 불가 일자",
|
||||
order = 3,
|
||||
width = 35
|
||||
)
|
||||
private String unavailableDates;
|
||||
|
||||
@Generated
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getAvailableStartDate() {
|
||||
return this.availableStartDate;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getAvailableEndDate() {
|
||||
return this.availableEndDate;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getUnavailableDates() {
|
||||
return this.unavailableDates;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setId(final String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setAvailableStartDate(final String availableStartDate) {
|
||||
this.availableStartDate = availableStartDate;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setAvailableEndDate(final String availableEndDate) {
|
||||
this.availableEndDate = availableEndDate;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setUnavailableDates(final String unavailableDates) {
|
||||
this.unavailableDates = unavailableDates;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public boolean equals(final Object o) {
|
||||
if (o == this) {
|
||||
return true;
|
||||
} else if (!(o instanceof MunicipalityExcelDto)) {
|
||||
return false;
|
||||
} else {
|
||||
MunicipalityExcelDto other = (MunicipalityExcelDto)o;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
} else {
|
||||
Object this$id = this.getId();
|
||||
Object other$id = other.getId();
|
||||
if (this$id == null) {
|
||||
if (other$id != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$id.equals(other$id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$availableStartDate = this.getAvailableStartDate();
|
||||
Object other$availableStartDate = other.getAvailableStartDate();
|
||||
if (this$availableStartDate == null) {
|
||||
if (other$availableStartDate != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$availableStartDate.equals(other$availableStartDate)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$availableEndDate = this.getAvailableEndDate();
|
||||
Object other$availableEndDate = other.getAvailableEndDate();
|
||||
if (this$availableEndDate == null) {
|
||||
if (other$availableEndDate != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$availableEndDate.equals(other$availableEndDate)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$unavailableDates = this.getUnavailableDates();
|
||||
Object other$unavailableDates = other.getUnavailableDates();
|
||||
if (this$unavailableDates == null) {
|
||||
if (other$unavailableDates != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$unavailableDates.equals(other$unavailableDates)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Generated
|
||||
protected boolean canEqual(final Object other) {
|
||||
return other instanceof MunicipalityExcelDto;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int hashCode() {
|
||||
int PRIME = 59;
|
||||
int result = 1;
|
||||
Object $id = this.getId();
|
||||
result = result * 59 + ($id == null ? 43 : $id.hashCode());
|
||||
Object $availableStartDate = this.getAvailableStartDate();
|
||||
result = result * 59 + ($availableStartDate == null ? 43 : $availableStartDate.hashCode());
|
||||
Object $availableEndDate = this.getAvailableEndDate();
|
||||
result = result * 59 + ($availableEndDate == null ? 43 : $availableEndDate.hashCode());
|
||||
Object $unavailableDates = this.getUnavailableDates();
|
||||
result = result * 59 + ($unavailableDates == null ? 43 : $unavailableDates.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
String var10000 = this.getId();
|
||||
return "MunicipalityExcelDto(id=" + var10000 + ", availableStartDate=" + this.getAvailableStartDate() + ", availableEndDate=" + this.getAvailableEndDate() + ", unavailableDates=" + this.getUnavailableDates() + ")";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.input;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Generated;
|
||||
|
||||
public class PairingWorkbookData {
|
||||
private final List<MemberExcelDto> members;
|
||||
private final List<MunicipalityExcelDto> municipalities;
|
||||
private final List<CenterExcelDto> centers;
|
||||
private final List<MemberRegionCodeExcelDto> memberRegionCodes;
|
||||
private final List<CenterAdjacentRegionExcelDto> centerAdjacentRegions;
|
||||
private final List<PreferenceMatchExcelDto> preferenceMatchRules;
|
||||
|
||||
@Generated
|
||||
PairingWorkbookData(final List<MemberExcelDto> members, final List<MunicipalityExcelDto> municipalities, final List<CenterExcelDto> centers, final List<MemberRegionCodeExcelDto> memberRegionCodes, final List<CenterAdjacentRegionExcelDto> centerAdjacentRegions, final List<PreferenceMatchExcelDto> preferenceMatchRules) {
|
||||
this.members = members;
|
||||
this.municipalities = municipalities;
|
||||
this.centers = centers;
|
||||
this.memberRegionCodes = memberRegionCodes;
|
||||
this.centerAdjacentRegions = centerAdjacentRegions;
|
||||
this.preferenceMatchRules = preferenceMatchRules;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static PairingWorkbookDataBuilder builder() {
|
||||
return new PairingWorkbookDataBuilder();
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<MemberExcelDto> getMembers() {
|
||||
return this.members;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<MunicipalityExcelDto> getMunicipalities() {
|
||||
return this.municipalities;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<CenterExcelDto> getCenters() {
|
||||
return this.centers;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<MemberRegionCodeExcelDto> getMemberRegionCodes() {
|
||||
return this.memberRegionCodes;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<CenterAdjacentRegionExcelDto> getCenterAdjacentRegions() {
|
||||
return this.centerAdjacentRegions;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<PreferenceMatchExcelDto> getPreferenceMatchRules() {
|
||||
return this.preferenceMatchRules;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static class PairingWorkbookDataBuilder {
|
||||
@Generated
|
||||
private List<MemberExcelDto> members;
|
||||
@Generated
|
||||
private List<MunicipalityExcelDto> municipalities;
|
||||
@Generated
|
||||
private List<CenterExcelDto> centers;
|
||||
@Generated
|
||||
private List<MemberRegionCodeExcelDto> memberRegionCodes;
|
||||
@Generated
|
||||
private List<CenterAdjacentRegionExcelDto> centerAdjacentRegions;
|
||||
@Generated
|
||||
private List<PreferenceMatchExcelDto> preferenceMatchRules;
|
||||
|
||||
@Generated
|
||||
PairingWorkbookDataBuilder() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingWorkbookDataBuilder members(final List<MemberExcelDto> members) {
|
||||
this.members = members;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingWorkbookDataBuilder municipalities(final List<MunicipalityExcelDto> municipalities) {
|
||||
this.municipalities = municipalities;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingWorkbookDataBuilder centers(final List<CenterExcelDto> centers) {
|
||||
this.centers = centers;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingWorkbookDataBuilder memberRegionCodes(final List<MemberRegionCodeExcelDto> memberRegionCodes) {
|
||||
this.memberRegionCodes = memberRegionCodes;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingWorkbookDataBuilder centerAdjacentRegions(final List<CenterAdjacentRegionExcelDto> centerAdjacentRegions) {
|
||||
this.centerAdjacentRegions = centerAdjacentRegions;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingWorkbookDataBuilder preferenceMatchRules(final List<PreferenceMatchExcelDto> preferenceMatchRules) {
|
||||
this.preferenceMatchRules = preferenceMatchRules;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingWorkbookData build() {
|
||||
return new PairingWorkbookData(this.members, this.municipalities, this.centers, this.memberRegionCodes, this.centerAdjacentRegions, this.preferenceMatchRules);
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
String var10000 = String.valueOf(this.members);
|
||||
return "PairingWorkbookData.PairingWorkbookDataBuilder(members=" + var10000 + ", municipalities=" + String.valueOf(this.municipalities) + ", centers=" + String.valueOf(this.centers) + ", memberRegionCodes=" + String.valueOf(this.memberRegionCodes) + ", centerAdjacentRegions=" + String.valueOf(this.centerAdjacentRegions) + ", preferenceMatchRules=" + String.valueOf(this.preferenceMatchRules) + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.input;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
|
||||
public class PreferenceMatchExcelDto {
|
||||
@ExcelColumn(
|
||||
header = "매칭 순위",
|
||||
order = 0,
|
||||
width = 12
|
||||
)
|
||||
private String priority;
|
||||
@ExcelColumn(
|
||||
header = "현장위원",
|
||||
order = 1,
|
||||
width = 12
|
||||
)
|
||||
private String fieldMemberPreferenceRank;
|
||||
@ExcelColumn(
|
||||
header = "외부위원",
|
||||
order = 2,
|
||||
width = 12
|
||||
)
|
||||
private String externalMemberPreferenceRank;
|
||||
|
||||
@Generated
|
||||
public String getPriority() {
|
||||
return this.priority;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getFieldMemberPreferenceRank() {
|
||||
return this.fieldMemberPreferenceRank;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getExternalMemberPreferenceRank() {
|
||||
return this.externalMemberPreferenceRank;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setPriority(final String priority) {
|
||||
this.priority = priority;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setFieldMemberPreferenceRank(final String fieldMemberPreferenceRank) {
|
||||
this.fieldMemberPreferenceRank = fieldMemberPreferenceRank;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setExternalMemberPreferenceRank(final String externalMemberPreferenceRank) {
|
||||
this.externalMemberPreferenceRank = externalMemberPreferenceRank;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public boolean equals(final Object o) {
|
||||
if (o == this) {
|
||||
return true;
|
||||
} else if (!(o instanceof PreferenceMatchExcelDto)) {
|
||||
return false;
|
||||
} else {
|
||||
PreferenceMatchExcelDto other = (PreferenceMatchExcelDto)o;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
} else {
|
||||
Object this$priority = this.getPriority();
|
||||
Object other$priority = other.getPriority();
|
||||
if (this$priority == null) {
|
||||
if (other$priority != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$priority.equals(other$priority)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$fieldMemberPreferenceRank = this.getFieldMemberPreferenceRank();
|
||||
Object other$fieldMemberPreferenceRank = other.getFieldMemberPreferenceRank();
|
||||
if (this$fieldMemberPreferenceRank == null) {
|
||||
if (other$fieldMemberPreferenceRank != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$fieldMemberPreferenceRank.equals(other$fieldMemberPreferenceRank)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$externalMemberPreferenceRank = this.getExternalMemberPreferenceRank();
|
||||
Object other$externalMemberPreferenceRank = other.getExternalMemberPreferenceRank();
|
||||
if (this$externalMemberPreferenceRank == null) {
|
||||
if (other$externalMemberPreferenceRank != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$externalMemberPreferenceRank.equals(other$externalMemberPreferenceRank)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Generated
|
||||
protected boolean canEqual(final Object other) {
|
||||
return other instanceof PreferenceMatchExcelDto;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int hashCode() {
|
||||
int PRIME = 59;
|
||||
int result = 1;
|
||||
Object $priority = this.getPriority();
|
||||
result = result * 59 + ($priority == null ? 43 : $priority.hashCode());
|
||||
Object $fieldMemberPreferenceRank = this.getFieldMemberPreferenceRank();
|
||||
result = result * 59 + ($fieldMemberPreferenceRank == null ? 43 : $fieldMemberPreferenceRank.hashCode());
|
||||
Object $externalMemberPreferenceRank = this.getExternalMemberPreferenceRank();
|
||||
result = result * 59 + ($externalMemberPreferenceRank == null ? 43 : $externalMemberPreferenceRank.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
String var10000 = this.getPriority();
|
||||
return "PreferenceMatchExcelDto(priority=" + var10000 + ", fieldMemberPreferenceRank=" + this.getFieldMemberPreferenceRank() + ", externalMemberPreferenceRank=" + this.getExternalMemberPreferenceRank() + ")";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,339 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.output;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
|
||||
public class ABPairExcelDto {
|
||||
@ExcelColumn(
|
||||
header = "AB 그룹",
|
||||
order = 0,
|
||||
width = 12
|
||||
)
|
||||
private String groupId;
|
||||
@ExcelColumn(
|
||||
header = "A 현장위원 id",
|
||||
order = 1,
|
||||
width = 18
|
||||
)
|
||||
private String aFieldMemberId;
|
||||
@ExcelColumn(
|
||||
header = "A 외부위원 id",
|
||||
order = 2,
|
||||
width = 18
|
||||
)
|
||||
private String aExternalMemberId;
|
||||
@ExcelColumn(
|
||||
header = "B 현장위원 id",
|
||||
order = 3,
|
||||
width = 18
|
||||
)
|
||||
private String bFieldMemberId;
|
||||
@ExcelColumn(
|
||||
header = "B 외부위원 id",
|
||||
order = 4,
|
||||
width = 18
|
||||
)
|
||||
private String bExternalMemberId;
|
||||
@ExcelColumn(
|
||||
header = "공유 파견 권역",
|
||||
order = 5,
|
||||
width = 15
|
||||
)
|
||||
private String sharedDispatchRegion;
|
||||
@ExcelColumn(
|
||||
header = "공유 인접지역 분류",
|
||||
order = 6,
|
||||
width = 18
|
||||
)
|
||||
private String sharedAdjacentRegionClassification;
|
||||
@ExcelColumn(
|
||||
header = "A 배정일",
|
||||
order = 7,
|
||||
width = 25
|
||||
)
|
||||
private String aAssignmentDates;
|
||||
@ExcelColumn(
|
||||
header = "B 배정일",
|
||||
order = 8,
|
||||
width = 25
|
||||
)
|
||||
private String bAssignmentDates;
|
||||
@ExcelColumn(
|
||||
header = "날짜 겹침 여부",
|
||||
order = 9,
|
||||
width = 15
|
||||
)
|
||||
private String dateOverlapped;
|
||||
|
||||
@Generated
|
||||
public String getGroupId() {
|
||||
return this.groupId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getAFieldMemberId() {
|
||||
return this.aFieldMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getAExternalMemberId() {
|
||||
return this.aExternalMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getBFieldMemberId() {
|
||||
return this.bFieldMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getBExternalMemberId() {
|
||||
return this.bExternalMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getSharedDispatchRegion() {
|
||||
return this.sharedDispatchRegion;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getSharedAdjacentRegionClassification() {
|
||||
return this.sharedAdjacentRegionClassification;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getAAssignmentDates() {
|
||||
return this.aAssignmentDates;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getBAssignmentDates() {
|
||||
return this.bAssignmentDates;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getDateOverlapped() {
|
||||
return this.dateOverlapped;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setGroupId(final String groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setAFieldMemberId(final String aFieldMemberId) {
|
||||
this.aFieldMemberId = aFieldMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setAExternalMemberId(final String aExternalMemberId) {
|
||||
this.aExternalMemberId = aExternalMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setBFieldMemberId(final String bFieldMemberId) {
|
||||
this.bFieldMemberId = bFieldMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setBExternalMemberId(final String bExternalMemberId) {
|
||||
this.bExternalMemberId = bExternalMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setSharedDispatchRegion(final String sharedDispatchRegion) {
|
||||
this.sharedDispatchRegion = sharedDispatchRegion;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setSharedAdjacentRegionClassification(final String sharedAdjacentRegionClassification) {
|
||||
this.sharedAdjacentRegionClassification = sharedAdjacentRegionClassification;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setAAssignmentDates(final String aAssignmentDates) {
|
||||
this.aAssignmentDates = aAssignmentDates;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setBAssignmentDates(final String bAssignmentDates) {
|
||||
this.bAssignmentDates = bAssignmentDates;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setDateOverlapped(final String dateOverlapped) {
|
||||
this.dateOverlapped = dateOverlapped;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public boolean equals(final Object o) {
|
||||
if (o == this) {
|
||||
return true;
|
||||
} else if (!(o instanceof ABPairExcelDto)) {
|
||||
return false;
|
||||
} else {
|
||||
ABPairExcelDto other = (ABPairExcelDto)o;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
} else {
|
||||
Object this$groupId = this.getGroupId();
|
||||
Object other$groupId = other.getGroupId();
|
||||
if (this$groupId == null) {
|
||||
if (other$groupId != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$groupId.equals(other$groupId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$aFieldMemberId = this.getAFieldMemberId();
|
||||
Object other$aFieldMemberId = other.getAFieldMemberId();
|
||||
if (this$aFieldMemberId == null) {
|
||||
if (other$aFieldMemberId != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$aFieldMemberId.equals(other$aFieldMemberId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$aExternalMemberId = this.getAExternalMemberId();
|
||||
Object other$aExternalMemberId = other.getAExternalMemberId();
|
||||
if (this$aExternalMemberId == null) {
|
||||
if (other$aExternalMemberId != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$aExternalMemberId.equals(other$aExternalMemberId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$bFieldMemberId = this.getBFieldMemberId();
|
||||
Object other$bFieldMemberId = other.getBFieldMemberId();
|
||||
if (this$bFieldMemberId == null) {
|
||||
if (other$bFieldMemberId != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$bFieldMemberId.equals(other$bFieldMemberId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$bExternalMemberId = this.getBExternalMemberId();
|
||||
Object other$bExternalMemberId = other.getBExternalMemberId();
|
||||
if (this$bExternalMemberId == null) {
|
||||
if (other$bExternalMemberId != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$bExternalMemberId.equals(other$bExternalMemberId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$sharedDispatchRegion = this.getSharedDispatchRegion();
|
||||
Object other$sharedDispatchRegion = other.getSharedDispatchRegion();
|
||||
if (this$sharedDispatchRegion == null) {
|
||||
if (other$sharedDispatchRegion != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$sharedDispatchRegion.equals(other$sharedDispatchRegion)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$sharedAdjacentRegionClassification = this.getSharedAdjacentRegionClassification();
|
||||
Object other$sharedAdjacentRegionClassification = other.getSharedAdjacentRegionClassification();
|
||||
if (this$sharedAdjacentRegionClassification == null) {
|
||||
if (other$sharedAdjacentRegionClassification != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$sharedAdjacentRegionClassification.equals(other$sharedAdjacentRegionClassification)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$aAssignmentDates = this.getAAssignmentDates();
|
||||
Object other$aAssignmentDates = other.getAAssignmentDates();
|
||||
if (this$aAssignmentDates == null) {
|
||||
if (other$aAssignmentDates != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$aAssignmentDates.equals(other$aAssignmentDates)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$bAssignmentDates = this.getBAssignmentDates();
|
||||
Object other$bAssignmentDates = other.getBAssignmentDates();
|
||||
if (this$bAssignmentDates == null) {
|
||||
if (other$bAssignmentDates != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$bAssignmentDates.equals(other$bAssignmentDates)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$dateOverlapped = this.getDateOverlapped();
|
||||
Object other$dateOverlapped = other.getDateOverlapped();
|
||||
if (this$dateOverlapped == null) {
|
||||
if (other$dateOverlapped != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$dateOverlapped.equals(other$dateOverlapped)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Generated
|
||||
protected boolean canEqual(final Object other) {
|
||||
return other instanceof ABPairExcelDto;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int hashCode() {
|
||||
int PRIME = 59;
|
||||
int result = 1;
|
||||
Object $groupId = this.getGroupId();
|
||||
result = result * 59 + ($groupId == null ? 43 : $groupId.hashCode());
|
||||
Object $aFieldMemberId = this.getAFieldMemberId();
|
||||
result = result * 59 + ($aFieldMemberId == null ? 43 : $aFieldMemberId.hashCode());
|
||||
Object $aExternalMemberId = this.getAExternalMemberId();
|
||||
result = result * 59 + ($aExternalMemberId == null ? 43 : $aExternalMemberId.hashCode());
|
||||
Object $bFieldMemberId = this.getBFieldMemberId();
|
||||
result = result * 59 + ($bFieldMemberId == null ? 43 : $bFieldMemberId.hashCode());
|
||||
Object $bExternalMemberId = this.getBExternalMemberId();
|
||||
result = result * 59 + ($bExternalMemberId == null ? 43 : $bExternalMemberId.hashCode());
|
||||
Object $sharedDispatchRegion = this.getSharedDispatchRegion();
|
||||
result = result * 59 + ($sharedDispatchRegion == null ? 43 : $sharedDispatchRegion.hashCode());
|
||||
Object $sharedAdjacentRegionClassification = this.getSharedAdjacentRegionClassification();
|
||||
result = result * 59 + ($sharedAdjacentRegionClassification == null ? 43 : $sharedAdjacentRegionClassification.hashCode());
|
||||
Object $aAssignmentDates = this.getAAssignmentDates();
|
||||
result = result * 59 + ($aAssignmentDates == null ? 43 : $aAssignmentDates.hashCode());
|
||||
Object $bAssignmentDates = this.getBAssignmentDates();
|
||||
result = result * 59 + ($bAssignmentDates == null ? 43 : $bAssignmentDates.hashCode());
|
||||
Object $dateOverlapped = this.getDateOverlapped();
|
||||
result = result * 59 + ($dateOverlapped == null ? 43 : $dateOverlapped.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
String var10000 = this.getGroupId();
|
||||
return "ABPairExcelDto(groupId=" + var10000 + ", aFieldMemberId=" + this.getAFieldMemberId() + ", aExternalMemberId=" + this.getAExternalMemberId() + ", bFieldMemberId=" + this.getBFieldMemberId() + ", bExternalMemberId=" + this.getBExternalMemberId() + ", sharedDispatchRegion=" + this.getSharedDispatchRegion() + ", sharedAdjacentRegionClassification=" + this.getSharedAdjacentRegionClassification() + ", aAssignmentDates=" + this.getAAssignmentDates() + ", bAssignmentDates=" + this.getBAssignmentDates() + ", dateOverlapped=" + this.getDateOverlapped() + ")";
|
||||
}
|
||||
|
||||
@Generated
|
||||
public ABPairExcelDto() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public ABPairExcelDto(final String groupId, final String aFieldMemberId, final String aExternalMemberId, final String bFieldMemberId, final String bExternalMemberId, final String sharedDispatchRegion, final String sharedAdjacentRegionClassification, final String aAssignmentDates, final String bAssignmentDates, final String dateOverlapped) {
|
||||
this.groupId = groupId;
|
||||
this.aFieldMemberId = aFieldMemberId;
|
||||
this.aExternalMemberId = aExternalMemberId;
|
||||
this.bFieldMemberId = bFieldMemberId;
|
||||
this.bExternalMemberId = bExternalMemberId;
|
||||
this.sharedDispatchRegion = sharedDispatchRegion;
|
||||
this.sharedAdjacentRegionClassification = sharedAdjacentRegionClassification;
|
||||
this.aAssignmentDates = aAssignmentDates;
|
||||
this.bAssignmentDates = bAssignmentDates;
|
||||
this.dateOverlapped = dateOverlapped;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,687 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.output;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
|
||||
public class AssignmentResultExcelDto {
|
||||
@ExcelColumn(
|
||||
header = "일자",
|
||||
order = 0,
|
||||
width = 15
|
||||
)
|
||||
private String date;
|
||||
@ExcelColumn(
|
||||
header = "현장위원 id",
|
||||
order = 1,
|
||||
width = 15
|
||||
)
|
||||
private String fieldMemberId;
|
||||
@ExcelColumn(
|
||||
header = "현장위원 성별",
|
||||
order = 2,
|
||||
width = 12
|
||||
)
|
||||
private String fieldMemberGender;
|
||||
@ExcelColumn(
|
||||
header = "현장위원 경력",
|
||||
order = 3,
|
||||
width = 12
|
||||
)
|
||||
private String fieldMemberExperience;
|
||||
@ExcelColumn(
|
||||
header = "현장위원 거주지",
|
||||
order = 4,
|
||||
width = 15
|
||||
)
|
||||
private String fieldMemberResidenceCode;
|
||||
@ExcelColumn(
|
||||
header = "현장위원 활동지역",
|
||||
order = 5,
|
||||
width = 15
|
||||
)
|
||||
private String fieldMemberActivityRegion;
|
||||
@ExcelColumn(
|
||||
header = "현장위원 희망지역 순위",
|
||||
order = 6,
|
||||
width = 18
|
||||
)
|
||||
private String fieldMemberPreferenceRank;
|
||||
@ExcelColumn(
|
||||
header = "외부위원 id",
|
||||
order = 7,
|
||||
width = 15
|
||||
)
|
||||
private String externalMemberId;
|
||||
@ExcelColumn(
|
||||
header = "외부위원 성별",
|
||||
order = 8,
|
||||
width = 12
|
||||
)
|
||||
private String externalMemberGender;
|
||||
@ExcelColumn(
|
||||
header = "외부위원 경력",
|
||||
order = 9,
|
||||
width = 12
|
||||
)
|
||||
private String externalMemberExperience;
|
||||
@ExcelColumn(
|
||||
header = "외부위원 거주지",
|
||||
order = 10,
|
||||
width = 15
|
||||
)
|
||||
private String externalMemberResidenceCode;
|
||||
@ExcelColumn(
|
||||
header = "외부위원 활동지역",
|
||||
order = 11,
|
||||
width = 15
|
||||
)
|
||||
private String externalMemberActivityRegion;
|
||||
@ExcelColumn(
|
||||
header = "외부위원 희망지역 순위",
|
||||
order = 12,
|
||||
width = 18
|
||||
)
|
||||
private String externalMemberPreferenceRank;
|
||||
@ExcelColumn(
|
||||
header = "센터 id",
|
||||
order = 13,
|
||||
width = 15
|
||||
)
|
||||
private String centerId;
|
||||
@ExcelColumn(
|
||||
header = "지자체 id",
|
||||
order = 14,
|
||||
width = 15
|
||||
)
|
||||
private String municipalityId;
|
||||
@ExcelColumn(
|
||||
header = "센터 여성 전용 여부",
|
||||
order = 15,
|
||||
width = 18
|
||||
)
|
||||
private String centerWomenOnly;
|
||||
@ExcelColumn(
|
||||
header = "파견 권역",
|
||||
order = 16,
|
||||
width = 12
|
||||
)
|
||||
private String dispatchRegion;
|
||||
@ExcelColumn(
|
||||
header = "인접지역 분류",
|
||||
order = 17,
|
||||
width = 15
|
||||
)
|
||||
private String adjacentRegionClassification;
|
||||
@ExcelColumn(
|
||||
header = "매칭 순위",
|
||||
order = 18,
|
||||
width = 12
|
||||
)
|
||||
private String preferencePriority;
|
||||
@ExcelColumn(
|
||||
header = "AB 그룹",
|
||||
order = 19,
|
||||
width = 12
|
||||
)
|
||||
private String abGroup;
|
||||
@ExcelColumn(
|
||||
header = "보완 현장위원 id",
|
||||
order = 20,
|
||||
width = 18
|
||||
)
|
||||
private String backupFieldMemberId;
|
||||
@ExcelColumn(
|
||||
header = "보완 외부위원 id",
|
||||
order = 21,
|
||||
width = 18
|
||||
)
|
||||
private String backupExternalMemberId;
|
||||
|
||||
@Generated
|
||||
public String getDate() {
|
||||
return this.date;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getFieldMemberId() {
|
||||
return this.fieldMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getFieldMemberGender() {
|
||||
return this.fieldMemberGender;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getFieldMemberExperience() {
|
||||
return this.fieldMemberExperience;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getFieldMemberResidenceCode() {
|
||||
return this.fieldMemberResidenceCode;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getFieldMemberActivityRegion() {
|
||||
return this.fieldMemberActivityRegion;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getFieldMemberPreferenceRank() {
|
||||
return this.fieldMemberPreferenceRank;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getExternalMemberId() {
|
||||
return this.externalMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getExternalMemberGender() {
|
||||
return this.externalMemberGender;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getExternalMemberExperience() {
|
||||
return this.externalMemberExperience;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getExternalMemberResidenceCode() {
|
||||
return this.externalMemberResidenceCode;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getExternalMemberActivityRegion() {
|
||||
return this.externalMemberActivityRegion;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getExternalMemberPreferenceRank() {
|
||||
return this.externalMemberPreferenceRank;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getCenterId() {
|
||||
return this.centerId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getMunicipalityId() {
|
||||
return this.municipalityId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getCenterWomenOnly() {
|
||||
return this.centerWomenOnly;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getDispatchRegion() {
|
||||
return this.dispatchRegion;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getAdjacentRegionClassification() {
|
||||
return this.adjacentRegionClassification;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getPreferencePriority() {
|
||||
return this.preferencePriority;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getAbGroup() {
|
||||
return this.abGroup;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getBackupFieldMemberId() {
|
||||
return this.backupFieldMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getBackupExternalMemberId() {
|
||||
return this.backupExternalMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setDate(final String date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setFieldMemberId(final String fieldMemberId) {
|
||||
this.fieldMemberId = fieldMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setFieldMemberGender(final String fieldMemberGender) {
|
||||
this.fieldMemberGender = fieldMemberGender;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setFieldMemberExperience(final String fieldMemberExperience) {
|
||||
this.fieldMemberExperience = fieldMemberExperience;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setFieldMemberResidenceCode(final String fieldMemberResidenceCode) {
|
||||
this.fieldMemberResidenceCode = fieldMemberResidenceCode;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setFieldMemberActivityRegion(final String fieldMemberActivityRegion) {
|
||||
this.fieldMemberActivityRegion = fieldMemberActivityRegion;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setFieldMemberPreferenceRank(final String fieldMemberPreferenceRank) {
|
||||
this.fieldMemberPreferenceRank = fieldMemberPreferenceRank;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setExternalMemberId(final String externalMemberId) {
|
||||
this.externalMemberId = externalMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setExternalMemberGender(final String externalMemberGender) {
|
||||
this.externalMemberGender = externalMemberGender;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setExternalMemberExperience(final String externalMemberExperience) {
|
||||
this.externalMemberExperience = externalMemberExperience;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setExternalMemberResidenceCode(final String externalMemberResidenceCode) {
|
||||
this.externalMemberResidenceCode = externalMemberResidenceCode;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setExternalMemberActivityRegion(final String externalMemberActivityRegion) {
|
||||
this.externalMemberActivityRegion = externalMemberActivityRegion;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setExternalMemberPreferenceRank(final String externalMemberPreferenceRank) {
|
||||
this.externalMemberPreferenceRank = externalMemberPreferenceRank;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setCenterId(final String centerId) {
|
||||
this.centerId = centerId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setMunicipalityId(final String municipalityId) {
|
||||
this.municipalityId = municipalityId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setCenterWomenOnly(final String centerWomenOnly) {
|
||||
this.centerWomenOnly = centerWomenOnly;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setDispatchRegion(final String dispatchRegion) {
|
||||
this.dispatchRegion = dispatchRegion;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setAdjacentRegionClassification(final String adjacentRegionClassification) {
|
||||
this.adjacentRegionClassification = adjacentRegionClassification;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setPreferencePriority(final String preferencePriority) {
|
||||
this.preferencePriority = preferencePriority;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setAbGroup(final String abGroup) {
|
||||
this.abGroup = abGroup;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setBackupFieldMemberId(final String backupFieldMemberId) {
|
||||
this.backupFieldMemberId = backupFieldMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setBackupExternalMemberId(final String backupExternalMemberId) {
|
||||
this.backupExternalMemberId = backupExternalMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public boolean equals(final Object o) {
|
||||
if (o == this) {
|
||||
return true;
|
||||
} else if (!(o instanceof AssignmentResultExcelDto)) {
|
||||
return false;
|
||||
} else {
|
||||
AssignmentResultExcelDto other = (AssignmentResultExcelDto)o;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
} else {
|
||||
Object this$date = this.getDate();
|
||||
Object other$date = other.getDate();
|
||||
if (this$date == null) {
|
||||
if (other$date != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$date.equals(other$date)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$fieldMemberId = this.getFieldMemberId();
|
||||
Object other$fieldMemberId = other.getFieldMemberId();
|
||||
if (this$fieldMemberId == null) {
|
||||
if (other$fieldMemberId != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$fieldMemberId.equals(other$fieldMemberId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$fieldMemberGender = this.getFieldMemberGender();
|
||||
Object other$fieldMemberGender = other.getFieldMemberGender();
|
||||
if (this$fieldMemberGender == null) {
|
||||
if (other$fieldMemberGender != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$fieldMemberGender.equals(other$fieldMemberGender)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$fieldMemberExperience = this.getFieldMemberExperience();
|
||||
Object other$fieldMemberExperience = other.getFieldMemberExperience();
|
||||
if (this$fieldMemberExperience == null) {
|
||||
if (other$fieldMemberExperience != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$fieldMemberExperience.equals(other$fieldMemberExperience)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$fieldMemberResidenceCode = this.getFieldMemberResidenceCode();
|
||||
Object other$fieldMemberResidenceCode = other.getFieldMemberResidenceCode();
|
||||
if (this$fieldMemberResidenceCode == null) {
|
||||
if (other$fieldMemberResidenceCode != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$fieldMemberResidenceCode.equals(other$fieldMemberResidenceCode)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$fieldMemberActivityRegion = this.getFieldMemberActivityRegion();
|
||||
Object other$fieldMemberActivityRegion = other.getFieldMemberActivityRegion();
|
||||
if (this$fieldMemberActivityRegion == null) {
|
||||
if (other$fieldMemberActivityRegion != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$fieldMemberActivityRegion.equals(other$fieldMemberActivityRegion)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$fieldMemberPreferenceRank = this.getFieldMemberPreferenceRank();
|
||||
Object other$fieldMemberPreferenceRank = other.getFieldMemberPreferenceRank();
|
||||
if (this$fieldMemberPreferenceRank == null) {
|
||||
if (other$fieldMemberPreferenceRank != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$fieldMemberPreferenceRank.equals(other$fieldMemberPreferenceRank)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$externalMemberId = this.getExternalMemberId();
|
||||
Object other$externalMemberId = other.getExternalMemberId();
|
||||
if (this$externalMemberId == null) {
|
||||
if (other$externalMemberId != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$externalMemberId.equals(other$externalMemberId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$externalMemberGender = this.getExternalMemberGender();
|
||||
Object other$externalMemberGender = other.getExternalMemberGender();
|
||||
if (this$externalMemberGender == null) {
|
||||
if (other$externalMemberGender != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$externalMemberGender.equals(other$externalMemberGender)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$externalMemberExperience = this.getExternalMemberExperience();
|
||||
Object other$externalMemberExperience = other.getExternalMemberExperience();
|
||||
if (this$externalMemberExperience == null) {
|
||||
if (other$externalMemberExperience != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$externalMemberExperience.equals(other$externalMemberExperience)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$externalMemberResidenceCode = this.getExternalMemberResidenceCode();
|
||||
Object other$externalMemberResidenceCode = other.getExternalMemberResidenceCode();
|
||||
if (this$externalMemberResidenceCode == null) {
|
||||
if (other$externalMemberResidenceCode != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$externalMemberResidenceCode.equals(other$externalMemberResidenceCode)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$externalMemberActivityRegion = this.getExternalMemberActivityRegion();
|
||||
Object other$externalMemberActivityRegion = other.getExternalMemberActivityRegion();
|
||||
if (this$externalMemberActivityRegion == null) {
|
||||
if (other$externalMemberActivityRegion != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$externalMemberActivityRegion.equals(other$externalMemberActivityRegion)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$externalMemberPreferenceRank = this.getExternalMemberPreferenceRank();
|
||||
Object other$externalMemberPreferenceRank = other.getExternalMemberPreferenceRank();
|
||||
if (this$externalMemberPreferenceRank == null) {
|
||||
if (other$externalMemberPreferenceRank != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$externalMemberPreferenceRank.equals(other$externalMemberPreferenceRank)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$centerId = this.getCenterId();
|
||||
Object other$centerId = other.getCenterId();
|
||||
if (this$centerId == null) {
|
||||
if (other$centerId != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$centerId.equals(other$centerId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$municipalityId = this.getMunicipalityId();
|
||||
Object other$municipalityId = other.getMunicipalityId();
|
||||
if (this$municipalityId == null) {
|
||||
if (other$municipalityId != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$municipalityId.equals(other$municipalityId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$centerWomenOnly = this.getCenterWomenOnly();
|
||||
Object other$centerWomenOnly = other.getCenterWomenOnly();
|
||||
if (this$centerWomenOnly == null) {
|
||||
if (other$centerWomenOnly != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$centerWomenOnly.equals(other$centerWomenOnly)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$dispatchRegion = this.getDispatchRegion();
|
||||
Object other$dispatchRegion = other.getDispatchRegion();
|
||||
if (this$dispatchRegion == null) {
|
||||
if (other$dispatchRegion != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$dispatchRegion.equals(other$dispatchRegion)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$adjacentRegionClassification = this.getAdjacentRegionClassification();
|
||||
Object other$adjacentRegionClassification = other.getAdjacentRegionClassification();
|
||||
if (this$adjacentRegionClassification == null) {
|
||||
if (other$adjacentRegionClassification != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$adjacentRegionClassification.equals(other$adjacentRegionClassification)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$preferencePriority = this.getPreferencePriority();
|
||||
Object other$preferencePriority = other.getPreferencePriority();
|
||||
if (this$preferencePriority == null) {
|
||||
if (other$preferencePriority != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$preferencePriority.equals(other$preferencePriority)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$abGroup = this.getAbGroup();
|
||||
Object other$abGroup = other.getAbGroup();
|
||||
if (this$abGroup == null) {
|
||||
if (other$abGroup != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$abGroup.equals(other$abGroup)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$backupFieldMemberId = this.getBackupFieldMemberId();
|
||||
Object other$backupFieldMemberId = other.getBackupFieldMemberId();
|
||||
if (this$backupFieldMemberId == null) {
|
||||
if (other$backupFieldMemberId != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$backupFieldMemberId.equals(other$backupFieldMemberId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$backupExternalMemberId = this.getBackupExternalMemberId();
|
||||
Object other$backupExternalMemberId = other.getBackupExternalMemberId();
|
||||
if (this$backupExternalMemberId == null) {
|
||||
if (other$backupExternalMemberId != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$backupExternalMemberId.equals(other$backupExternalMemberId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Generated
|
||||
protected boolean canEqual(final Object other) {
|
||||
return other instanceof AssignmentResultExcelDto;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int hashCode() {
|
||||
int PRIME = 59;
|
||||
int result = 1;
|
||||
Object $date = this.getDate();
|
||||
result = result * 59 + ($date == null ? 43 : $date.hashCode());
|
||||
Object $fieldMemberId = this.getFieldMemberId();
|
||||
result = result * 59 + ($fieldMemberId == null ? 43 : $fieldMemberId.hashCode());
|
||||
Object $fieldMemberGender = this.getFieldMemberGender();
|
||||
result = result * 59 + ($fieldMemberGender == null ? 43 : $fieldMemberGender.hashCode());
|
||||
Object $fieldMemberExperience = this.getFieldMemberExperience();
|
||||
result = result * 59 + ($fieldMemberExperience == null ? 43 : $fieldMemberExperience.hashCode());
|
||||
Object $fieldMemberResidenceCode = this.getFieldMemberResidenceCode();
|
||||
result = result * 59 + ($fieldMemberResidenceCode == null ? 43 : $fieldMemberResidenceCode.hashCode());
|
||||
Object $fieldMemberActivityRegion = this.getFieldMemberActivityRegion();
|
||||
result = result * 59 + ($fieldMemberActivityRegion == null ? 43 : $fieldMemberActivityRegion.hashCode());
|
||||
Object $fieldMemberPreferenceRank = this.getFieldMemberPreferenceRank();
|
||||
result = result * 59 + ($fieldMemberPreferenceRank == null ? 43 : $fieldMemberPreferenceRank.hashCode());
|
||||
Object $externalMemberId = this.getExternalMemberId();
|
||||
result = result * 59 + ($externalMemberId == null ? 43 : $externalMemberId.hashCode());
|
||||
Object $externalMemberGender = this.getExternalMemberGender();
|
||||
result = result * 59 + ($externalMemberGender == null ? 43 : $externalMemberGender.hashCode());
|
||||
Object $externalMemberExperience = this.getExternalMemberExperience();
|
||||
result = result * 59 + ($externalMemberExperience == null ? 43 : $externalMemberExperience.hashCode());
|
||||
Object $externalMemberResidenceCode = this.getExternalMemberResidenceCode();
|
||||
result = result * 59 + ($externalMemberResidenceCode == null ? 43 : $externalMemberResidenceCode.hashCode());
|
||||
Object $externalMemberActivityRegion = this.getExternalMemberActivityRegion();
|
||||
result = result * 59 + ($externalMemberActivityRegion == null ? 43 : $externalMemberActivityRegion.hashCode());
|
||||
Object $externalMemberPreferenceRank = this.getExternalMemberPreferenceRank();
|
||||
result = result * 59 + ($externalMemberPreferenceRank == null ? 43 : $externalMemberPreferenceRank.hashCode());
|
||||
Object $centerId = this.getCenterId();
|
||||
result = result * 59 + ($centerId == null ? 43 : $centerId.hashCode());
|
||||
Object $municipalityId = this.getMunicipalityId();
|
||||
result = result * 59 + ($municipalityId == null ? 43 : $municipalityId.hashCode());
|
||||
Object $centerWomenOnly = this.getCenterWomenOnly();
|
||||
result = result * 59 + ($centerWomenOnly == null ? 43 : $centerWomenOnly.hashCode());
|
||||
Object $dispatchRegion = this.getDispatchRegion();
|
||||
result = result * 59 + ($dispatchRegion == null ? 43 : $dispatchRegion.hashCode());
|
||||
Object $adjacentRegionClassification = this.getAdjacentRegionClassification();
|
||||
result = result * 59 + ($adjacentRegionClassification == null ? 43 : $adjacentRegionClassification.hashCode());
|
||||
Object $preferencePriority = this.getPreferencePriority();
|
||||
result = result * 59 + ($preferencePriority == null ? 43 : $preferencePriority.hashCode());
|
||||
Object $abGroup = this.getAbGroup();
|
||||
result = result * 59 + ($abGroup == null ? 43 : $abGroup.hashCode());
|
||||
Object $backupFieldMemberId = this.getBackupFieldMemberId();
|
||||
result = result * 59 + ($backupFieldMemberId == null ? 43 : $backupFieldMemberId.hashCode());
|
||||
Object $backupExternalMemberId = this.getBackupExternalMemberId();
|
||||
result = result * 59 + ($backupExternalMemberId == null ? 43 : $backupExternalMemberId.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
String var10000 = this.getDate();
|
||||
return "AssignmentResultExcelDto(date=" + var10000 + ", fieldMemberId=" + this.getFieldMemberId() + ", fieldMemberGender=" + this.getFieldMemberGender() + ", fieldMemberExperience=" + this.getFieldMemberExperience() + ", fieldMemberResidenceCode=" + this.getFieldMemberResidenceCode() + ", fieldMemberActivityRegion=" + this.getFieldMemberActivityRegion() + ", fieldMemberPreferenceRank=" + this.getFieldMemberPreferenceRank() + ", externalMemberId=" + this.getExternalMemberId() + ", externalMemberGender=" + this.getExternalMemberGender() + ", externalMemberExperience=" + this.getExternalMemberExperience() + ", externalMemberResidenceCode=" + this.getExternalMemberResidenceCode() + ", externalMemberActivityRegion=" + this.getExternalMemberActivityRegion() + ", externalMemberPreferenceRank=" + this.getExternalMemberPreferenceRank() + ", centerId=" + this.getCenterId() + ", municipalityId=" + this.getMunicipalityId() + ", centerWomenOnly=" + this.getCenterWomenOnly() + ", dispatchRegion=" + this.getDispatchRegion() + ", adjacentRegionClassification=" + this.getAdjacentRegionClassification() + ", preferencePriority=" + this.getPreferencePriority() + ", abGroup=" + this.getAbGroup() + ", backupFieldMemberId=" + this.getBackupFieldMemberId() + ", backupExternalMemberId=" + this.getBackupExternalMemberId() + ")";
|
||||
}
|
||||
|
||||
@Generated
|
||||
public AssignmentResultExcelDto() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public AssignmentResultExcelDto(final String date, final String fieldMemberId, final String fieldMemberGender, final String fieldMemberExperience, final String fieldMemberResidenceCode, final String fieldMemberActivityRegion, final String fieldMemberPreferenceRank, final String externalMemberId, final String externalMemberGender, final String externalMemberExperience, final String externalMemberResidenceCode, final String externalMemberActivityRegion, final String externalMemberPreferenceRank, final String centerId, final String municipalityId, final String centerWomenOnly, final String dispatchRegion, final String adjacentRegionClassification, final String preferencePriority, final String abGroup, final String backupFieldMemberId, final String backupExternalMemberId) {
|
||||
this.date = date;
|
||||
this.fieldMemberId = fieldMemberId;
|
||||
this.fieldMemberGender = fieldMemberGender;
|
||||
this.fieldMemberExperience = fieldMemberExperience;
|
||||
this.fieldMemberResidenceCode = fieldMemberResidenceCode;
|
||||
this.fieldMemberActivityRegion = fieldMemberActivityRegion;
|
||||
this.fieldMemberPreferenceRank = fieldMemberPreferenceRank;
|
||||
this.externalMemberId = externalMemberId;
|
||||
this.externalMemberGender = externalMemberGender;
|
||||
this.externalMemberExperience = externalMemberExperience;
|
||||
this.externalMemberResidenceCode = externalMemberResidenceCode;
|
||||
this.externalMemberActivityRegion = externalMemberActivityRegion;
|
||||
this.externalMemberPreferenceRank = externalMemberPreferenceRank;
|
||||
this.centerId = centerId;
|
||||
this.municipalityId = municipalityId;
|
||||
this.centerWomenOnly = centerWomenOnly;
|
||||
this.dispatchRegion = dispatchRegion;
|
||||
this.adjacentRegionClassification = adjacentRegionClassification;
|
||||
this.preferencePriority = preferencePriority;
|
||||
this.abGroup = abGroup;
|
||||
this.backupFieldMemberId = backupFieldMemberId;
|
||||
this.backupExternalMemberId = backupExternalMemberId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.output;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
|
||||
public class CandidateSummaryExcelDto {
|
||||
@ExcelColumn(
|
||||
header = "항목",
|
||||
order = 0,
|
||||
width = 30
|
||||
)
|
||||
private String name;
|
||||
@ExcelColumn(
|
||||
header = "값",
|
||||
order = 1,
|
||||
width = 20
|
||||
)
|
||||
private String value;
|
||||
@ExcelColumn(
|
||||
header = "설명",
|
||||
order = 2,
|
||||
width = 50
|
||||
)
|
||||
private String description;
|
||||
|
||||
@Generated
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setName(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setValue(final String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setDescription(final String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public boolean equals(final Object o) {
|
||||
if (o == this) {
|
||||
return true;
|
||||
} else if (!(o instanceof CandidateSummaryExcelDto)) {
|
||||
return false;
|
||||
} else {
|
||||
CandidateSummaryExcelDto other = (CandidateSummaryExcelDto)o;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
} else {
|
||||
Object this$name = this.getName();
|
||||
Object other$name = other.getName();
|
||||
if (this$name == null) {
|
||||
if (other$name != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$name.equals(other$name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$value = this.getValue();
|
||||
Object other$value = other.getValue();
|
||||
if (this$value == null) {
|
||||
if (other$value != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$value.equals(other$value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$description = this.getDescription();
|
||||
Object other$description = other.getDescription();
|
||||
if (this$description == null) {
|
||||
if (other$description != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$description.equals(other$description)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Generated
|
||||
protected boolean canEqual(final Object other) {
|
||||
return other instanceof CandidateSummaryExcelDto;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int hashCode() {
|
||||
int PRIME = 59;
|
||||
int result = 1;
|
||||
Object $name = this.getName();
|
||||
result = result * 59 + ($name == null ? 43 : $name.hashCode());
|
||||
Object $value = this.getValue();
|
||||
result = result * 59 + ($value == null ? 43 : $value.hashCode());
|
||||
Object $description = this.getDescription();
|
||||
result = result * 59 + ($description == null ? 43 : $description.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
String var10000 = this.getName();
|
||||
return "CandidateSummaryExcelDto(name=" + var10000 + ", value=" + this.getValue() + ", description=" + this.getDescription() + ")";
|
||||
}
|
||||
|
||||
@Generated
|
||||
public CandidateSummaryExcelDto() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public CandidateSummaryExcelDto(final String name, final String value, final String description) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
this.description = description;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.output;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
|
||||
public class PairingSummaryExcelDto {
|
||||
@ExcelColumn(
|
||||
header = "항목",
|
||||
order = 0,
|
||||
width = 25
|
||||
)
|
||||
private String name;
|
||||
@ExcelColumn(
|
||||
header = "값",
|
||||
order = 1,
|
||||
width = 20
|
||||
)
|
||||
private String value;
|
||||
|
||||
@Generated
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setName(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setValue(final String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public boolean equals(final Object o) {
|
||||
if (o == this) {
|
||||
return true;
|
||||
} else if (!(o instanceof PairingSummaryExcelDto)) {
|
||||
return false;
|
||||
} else {
|
||||
PairingSummaryExcelDto other = (PairingSummaryExcelDto)o;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
} else {
|
||||
Object this$name = this.getName();
|
||||
Object other$name = other.getName();
|
||||
if (this$name == null) {
|
||||
if (other$name != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$name.equals(other$name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$value = this.getValue();
|
||||
Object other$value = other.getValue();
|
||||
if (this$value == null) {
|
||||
if (other$value != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$value.equals(other$value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Generated
|
||||
protected boolean canEqual(final Object other) {
|
||||
return other instanceof PairingSummaryExcelDto;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int hashCode() {
|
||||
int PRIME = 59;
|
||||
int result = 1;
|
||||
Object $name = this.getName();
|
||||
result = result * 59 + ($name == null ? 43 : $name.hashCode());
|
||||
Object $value = this.getValue();
|
||||
result = result * 59 + ($value == null ? 43 : $value.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
String var10000 = this.getName();
|
||||
return "PairingSummaryExcelDto(name=" + var10000 + ", value=" + this.getValue() + ")";
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingSummaryExcelDto() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingSummaryExcelDto(final String name, final String value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.output;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
|
||||
public class RuleViolationExcelDto {
|
||||
@ExcelColumn(
|
||||
header = "검사 항목",
|
||||
order = 0,
|
||||
width = 35
|
||||
)
|
||||
private String ruleName;
|
||||
@ExcelColumn(
|
||||
header = "결과",
|
||||
order = 1,
|
||||
width = 12
|
||||
)
|
||||
private String result;
|
||||
@ExcelColumn(
|
||||
header = "상세",
|
||||
order = 2,
|
||||
width = 80
|
||||
)
|
||||
private String detail;
|
||||
|
||||
@Generated
|
||||
public String getRuleName() {
|
||||
return this.ruleName;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getResult() {
|
||||
return this.result;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getDetail() {
|
||||
return this.detail;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setRuleName(final String ruleName) {
|
||||
this.ruleName = ruleName;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setResult(final String result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setDetail(final String detail) {
|
||||
this.detail = detail;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public boolean equals(final Object o) {
|
||||
if (o == this) {
|
||||
return true;
|
||||
} else if (!(o instanceof RuleViolationExcelDto)) {
|
||||
return false;
|
||||
} else {
|
||||
RuleViolationExcelDto other = (RuleViolationExcelDto)o;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
} else {
|
||||
Object this$ruleName = this.getRuleName();
|
||||
Object other$ruleName = other.getRuleName();
|
||||
if (this$ruleName == null) {
|
||||
if (other$ruleName != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$ruleName.equals(other$ruleName)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$result = this.getResult();
|
||||
Object other$result = other.getResult();
|
||||
if (this$result == null) {
|
||||
if (other$result != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$result.equals(other$result)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$detail = this.getDetail();
|
||||
Object other$detail = other.getDetail();
|
||||
if (this$detail == null) {
|
||||
if (other$detail != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$detail.equals(other$detail)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Generated
|
||||
protected boolean canEqual(final Object other) {
|
||||
return other instanceof RuleViolationExcelDto;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int hashCode() {
|
||||
int PRIME = 59;
|
||||
int result = 1;
|
||||
Object $ruleName = this.getRuleName();
|
||||
result = result * 59 + ($ruleName == null ? 43 : $ruleName.hashCode());
|
||||
Object $result = this.getResult();
|
||||
result = result * 59 + ($result == null ? 43 : $result.hashCode());
|
||||
Object $detail = this.getDetail();
|
||||
result = result * 59 + ($detail == null ? 43 : $detail.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
String var10000 = this.getRuleName();
|
||||
return "RuleViolationExcelDto(ruleName=" + var10000 + ", result=" + this.getResult() + ", detail=" + this.getDetail() + ")";
|
||||
}
|
||||
|
||||
@Generated
|
||||
public RuleViolationExcelDto() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public RuleViolationExcelDto(final String ruleName, final String result, final String detail) {
|
||||
this.ruleName = ruleName;
|
||||
this.result = result;
|
||||
this.detail = detail;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.output;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
|
||||
public class UnassignedCenterExcelDto {
|
||||
@ExcelColumn(
|
||||
header = "센터 id",
|
||||
order = 0,
|
||||
width = 15
|
||||
)
|
||||
private String centerId;
|
||||
@ExcelColumn(
|
||||
header = "지자체 id",
|
||||
order = 1,
|
||||
width = 15
|
||||
)
|
||||
private String municipalityId;
|
||||
@ExcelColumn(
|
||||
header = "사유",
|
||||
order = 2,
|
||||
width = 40
|
||||
)
|
||||
private String reason;
|
||||
|
||||
@Generated
|
||||
public String getCenterId() {
|
||||
return this.centerId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getMunicipalityId() {
|
||||
return this.municipalityId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getReason() {
|
||||
return this.reason;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setCenterId(final String centerId) {
|
||||
this.centerId = centerId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setMunicipalityId(final String municipalityId) {
|
||||
this.municipalityId = municipalityId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setReason(final String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public boolean equals(final Object o) {
|
||||
if (o == this) {
|
||||
return true;
|
||||
} else if (!(o instanceof UnassignedCenterExcelDto)) {
|
||||
return false;
|
||||
} else {
|
||||
UnassignedCenterExcelDto other = (UnassignedCenterExcelDto)o;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
} else {
|
||||
Object this$centerId = this.getCenterId();
|
||||
Object other$centerId = other.getCenterId();
|
||||
if (this$centerId == null) {
|
||||
if (other$centerId != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$centerId.equals(other$centerId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$municipalityId = this.getMunicipalityId();
|
||||
Object other$municipalityId = other.getMunicipalityId();
|
||||
if (this$municipalityId == null) {
|
||||
if (other$municipalityId != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$municipalityId.equals(other$municipalityId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$reason = this.getReason();
|
||||
Object other$reason = other.getReason();
|
||||
if (this$reason == null) {
|
||||
if (other$reason != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$reason.equals(other$reason)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Generated
|
||||
protected boolean canEqual(final Object other) {
|
||||
return other instanceof UnassignedCenterExcelDto;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int hashCode() {
|
||||
int PRIME = 59;
|
||||
int result = 1;
|
||||
Object $centerId = this.getCenterId();
|
||||
result = result * 59 + ($centerId == null ? 43 : $centerId.hashCode());
|
||||
Object $municipalityId = this.getMunicipalityId();
|
||||
result = result * 59 + ($municipalityId == null ? 43 : $municipalityId.hashCode());
|
||||
Object $reason = this.getReason();
|
||||
result = result * 59 + ($reason == null ? 43 : $reason.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
String var10000 = this.getCenterId();
|
||||
return "UnassignedCenterExcelDto(centerId=" + var10000 + ", municipalityId=" + this.getMunicipalityId() + ", reason=" + this.getReason() + ")";
|
||||
}
|
||||
|
||||
@Generated
|
||||
public UnassignedCenterExcelDto() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public UnassignedCenterExcelDto(final String centerId, final String municipalityId, final String reason) {
|
||||
this.centerId = centerId;
|
||||
this.municipalityId = municipalityId;
|
||||
this.reason = reason;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.output;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
|
||||
public class UnusedMemberExcelDto {
|
||||
@ExcelColumn(
|
||||
header = "위원 id",
|
||||
order = 0,
|
||||
width = 15
|
||||
)
|
||||
private String memberId;
|
||||
@ExcelColumn(
|
||||
header = "현장/외부 구분",
|
||||
order = 1,
|
||||
width = 15
|
||||
)
|
||||
private String role;
|
||||
@ExcelColumn(
|
||||
header = "사유",
|
||||
order = 2,
|
||||
width = 40
|
||||
)
|
||||
private String reason;
|
||||
|
||||
@Generated
|
||||
public String getMemberId() {
|
||||
return this.memberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getRole() {
|
||||
return this.role;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getReason() {
|
||||
return this.reason;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setMemberId(final String memberId) {
|
||||
this.memberId = memberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setRole(final String role) {
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setReason(final String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public boolean equals(final Object o) {
|
||||
if (o == this) {
|
||||
return true;
|
||||
} else if (!(o instanceof UnusedMemberExcelDto)) {
|
||||
return false;
|
||||
} else {
|
||||
UnusedMemberExcelDto other = (UnusedMemberExcelDto)o;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
} else {
|
||||
Object this$memberId = this.getMemberId();
|
||||
Object other$memberId = other.getMemberId();
|
||||
if (this$memberId == null) {
|
||||
if (other$memberId != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$memberId.equals(other$memberId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$role = this.getRole();
|
||||
Object other$role = other.getRole();
|
||||
if (this$role == null) {
|
||||
if (other$role != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$role.equals(other$role)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$reason = this.getReason();
|
||||
Object other$reason = other.getReason();
|
||||
if (this$reason == null) {
|
||||
if (other$reason != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$reason.equals(other$reason)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Generated
|
||||
protected boolean canEqual(final Object other) {
|
||||
return other instanceof UnusedMemberExcelDto;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int hashCode() {
|
||||
int PRIME = 59;
|
||||
int result = 1;
|
||||
Object $memberId = this.getMemberId();
|
||||
result = result * 59 + ($memberId == null ? 43 : $memberId.hashCode());
|
||||
Object $role = this.getRole();
|
||||
result = result * 59 + ($role == null ? 43 : $role.hashCode());
|
||||
Object $reason = this.getReason();
|
||||
result = result * 59 + ($reason == null ? 43 : $reason.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
String var10000 = this.getMemberId();
|
||||
return "UnusedMemberExcelDto(memberId=" + var10000 + ", role=" + this.getRole() + ", reason=" + this.getReason() + ")";
|
||||
}
|
||||
|
||||
@Generated
|
||||
public UnusedMemberExcelDto() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public UnusedMemberExcelDto(final String memberId, final String role, final String reason) {
|
||||
this.memberId = memberId;
|
||||
this.role = role;
|
||||
this.reason = reason;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.output;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
|
||||
public class ValidationErrorExcelDto {
|
||||
@ExcelColumn(
|
||||
header = "오류 코드",
|
||||
order = 0,
|
||||
width = 25
|
||||
)
|
||||
private String code;
|
||||
@ExcelColumn(
|
||||
header = "오류 메시지",
|
||||
order = 1,
|
||||
width = 80
|
||||
)
|
||||
private String message;
|
||||
@ExcelColumn(
|
||||
header = "구분",
|
||||
order = 2,
|
||||
width = 15
|
||||
)
|
||||
private String type;
|
||||
|
||||
@Generated
|
||||
public String getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getMessage() {
|
||||
return this.message;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setCode(final String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setMessage(final String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public void setType(final String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public boolean equals(final Object o) {
|
||||
if (o == this) {
|
||||
return true;
|
||||
} else if (!(o instanceof ValidationErrorExcelDto)) {
|
||||
return false;
|
||||
} else {
|
||||
ValidationErrorExcelDto other = (ValidationErrorExcelDto)o;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
} else {
|
||||
Object this$code = this.getCode();
|
||||
Object other$code = other.getCode();
|
||||
if (this$code == null) {
|
||||
if (other$code != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$code.equals(other$code)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$message = this.getMessage();
|
||||
Object other$message = other.getMessage();
|
||||
if (this$message == null) {
|
||||
if (other$message != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$message.equals(other$message)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object this$type = this.getType();
|
||||
Object other$type = other.getType();
|
||||
if (this$type == null) {
|
||||
if (other$type != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!this$type.equals(other$type)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Generated
|
||||
protected boolean canEqual(final Object other) {
|
||||
return other instanceof ValidationErrorExcelDto;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int hashCode() {
|
||||
int PRIME = 59;
|
||||
int result = 1;
|
||||
Object $code = this.getCode();
|
||||
result = result * 59 + ($code == null ? 43 : $code.hashCode());
|
||||
Object $message = this.getMessage();
|
||||
result = result * 59 + ($message == null ? 43 : $message.hashCode());
|
||||
Object $type = this.getType();
|
||||
result = result * 59 + ($type == null ? 43 : $type.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
String var10000 = this.getCode();
|
||||
return "ValidationErrorExcelDto(code=" + var10000 + ", message=" + this.getMessage() + ", type=" + this.getType() + ")";
|
||||
}
|
||||
|
||||
@Generated
|
||||
public ValidationErrorExcelDto() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public ValidationErrorExcelDto(final String code, final String message, final String type) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
108
src/main/java/com/kri/p6/ncrc/pairing/model/ABPairMatch.java
Normal file
108
src/main/java/com/kri/p6/ncrc/pairing/model/ABPairMatch.java
Normal file
@@ -0,0 +1,108 @@
|
||||
package com.kri.p6.ncrc.pairing.model;
|
||||
|
||||
import lombok.Generated;
|
||||
|
||||
public class ABPairMatch {
|
||||
private final String groupId;
|
||||
private final String fieldMemberId;
|
||||
private final String externalMemberId;
|
||||
private final String counterpartFieldMemberId;
|
||||
private final String counterpartExternalMemberId;
|
||||
|
||||
@Generated
|
||||
ABPairMatch(final String groupId, final String fieldMemberId, final String externalMemberId, final String counterpartFieldMemberId, final String counterpartExternalMemberId) {
|
||||
this.groupId = groupId;
|
||||
this.fieldMemberId = fieldMemberId;
|
||||
this.externalMemberId = externalMemberId;
|
||||
this.counterpartFieldMemberId = counterpartFieldMemberId;
|
||||
this.counterpartExternalMemberId = counterpartExternalMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static ABPairMatchBuilder builder() {
|
||||
return new ABPairMatchBuilder();
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getGroupId() {
|
||||
return this.groupId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getFieldMemberId() {
|
||||
return this.fieldMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getExternalMemberId() {
|
||||
return this.externalMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getCounterpartFieldMemberId() {
|
||||
return this.counterpartFieldMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getCounterpartExternalMemberId() {
|
||||
return this.counterpartExternalMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static class ABPairMatchBuilder {
|
||||
@Generated
|
||||
private String groupId;
|
||||
@Generated
|
||||
private String fieldMemberId;
|
||||
@Generated
|
||||
private String externalMemberId;
|
||||
@Generated
|
||||
private String counterpartFieldMemberId;
|
||||
@Generated
|
||||
private String counterpartExternalMemberId;
|
||||
|
||||
@Generated
|
||||
ABPairMatchBuilder() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public ABPairMatchBuilder groupId(final String groupId) {
|
||||
this.groupId = groupId;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public ABPairMatchBuilder fieldMemberId(final String fieldMemberId) {
|
||||
this.fieldMemberId = fieldMemberId;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public ABPairMatchBuilder externalMemberId(final String externalMemberId) {
|
||||
this.externalMemberId = externalMemberId;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public ABPairMatchBuilder counterpartFieldMemberId(final String counterpartFieldMemberId) {
|
||||
this.counterpartFieldMemberId = counterpartFieldMemberId;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public ABPairMatchBuilder counterpartExternalMemberId(final String counterpartExternalMemberId) {
|
||||
this.counterpartExternalMemberId = counterpartExternalMemberId;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public ABPairMatch build() {
|
||||
return new ABPairMatch(this.groupId, this.fieldMemberId, this.externalMemberId, this.counterpartFieldMemberId, this.counterpartExternalMemberId);
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
return "ABPairMatch.ABPairMatchBuilder(groupId=" + this.groupId + ", fieldMemberId=" + this.fieldMemberId + ", externalMemberId=" + this.externalMemberId + ", counterpartFieldMemberId=" + this.counterpartFieldMemberId + ", counterpartExternalMemberId=" + this.counterpartExternalMemberId + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
package com.kri.p6.ncrc.pairing.model;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import lombok.Generated;
|
||||
|
||||
public class AssignmentCandidate {
|
||||
private final String fieldMemberId;
|
||||
private final String externalMemberId;
|
||||
private final String centerId;
|
||||
private final String municipalityId;
|
||||
private final LocalDate date;
|
||||
private final String dispatchRegion;
|
||||
private final String adjacentRegionClassification;
|
||||
private final int preferencePriority;
|
||||
private final int fieldMemberPreferenceRank;
|
||||
private final int externalMemberPreferenceRank;
|
||||
private final int residenceMatchScore;
|
||||
|
||||
@Generated
|
||||
AssignmentCandidate(final String fieldMemberId, final String externalMemberId, final String centerId, final String municipalityId, final LocalDate date, final String dispatchRegion, final String adjacentRegionClassification, final int preferencePriority, final int fieldMemberPreferenceRank, final int externalMemberPreferenceRank, final int residenceMatchScore) {
|
||||
this.fieldMemberId = fieldMemberId;
|
||||
this.externalMemberId = externalMemberId;
|
||||
this.centerId = centerId;
|
||||
this.municipalityId = municipalityId;
|
||||
this.date = date;
|
||||
this.dispatchRegion = dispatchRegion;
|
||||
this.adjacentRegionClassification = adjacentRegionClassification;
|
||||
this.preferencePriority = preferencePriority;
|
||||
this.fieldMemberPreferenceRank = fieldMemberPreferenceRank;
|
||||
this.externalMemberPreferenceRank = externalMemberPreferenceRank;
|
||||
this.residenceMatchScore = residenceMatchScore;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static AssignmentCandidateBuilder builder() {
|
||||
return new AssignmentCandidateBuilder();
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getFieldMemberId() {
|
||||
return this.fieldMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getExternalMemberId() {
|
||||
return this.externalMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getCenterId() {
|
||||
return this.centerId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getMunicipalityId() {
|
||||
return this.municipalityId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public LocalDate getDate() {
|
||||
return this.date;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getDispatchRegion() {
|
||||
return this.dispatchRegion;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getAdjacentRegionClassification() {
|
||||
return this.adjacentRegionClassification;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int getPreferencePriority() {
|
||||
return this.preferencePriority;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int getFieldMemberPreferenceRank() {
|
||||
return this.fieldMemberPreferenceRank;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int getExternalMemberPreferenceRank() {
|
||||
return this.externalMemberPreferenceRank;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int getResidenceMatchScore() {
|
||||
return this.residenceMatchScore;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static class AssignmentCandidateBuilder {
|
||||
@Generated
|
||||
private String fieldMemberId;
|
||||
@Generated
|
||||
private String externalMemberId;
|
||||
@Generated
|
||||
private String centerId;
|
||||
@Generated
|
||||
private String municipalityId;
|
||||
@Generated
|
||||
private LocalDate date;
|
||||
@Generated
|
||||
private String dispatchRegion;
|
||||
@Generated
|
||||
private String adjacentRegionClassification;
|
||||
@Generated
|
||||
private int preferencePriority;
|
||||
@Generated
|
||||
private int fieldMemberPreferenceRank;
|
||||
@Generated
|
||||
private int externalMemberPreferenceRank;
|
||||
@Generated
|
||||
private int residenceMatchScore;
|
||||
|
||||
@Generated
|
||||
AssignmentCandidateBuilder() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public AssignmentCandidateBuilder fieldMemberId(final String fieldMemberId) {
|
||||
this.fieldMemberId = fieldMemberId;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public AssignmentCandidateBuilder externalMemberId(final String externalMemberId) {
|
||||
this.externalMemberId = externalMemberId;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public AssignmentCandidateBuilder centerId(final String centerId) {
|
||||
this.centerId = centerId;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public AssignmentCandidateBuilder municipalityId(final String municipalityId) {
|
||||
this.municipalityId = municipalityId;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public AssignmentCandidateBuilder date(final LocalDate date) {
|
||||
this.date = date;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public AssignmentCandidateBuilder dispatchRegion(final String dispatchRegion) {
|
||||
this.dispatchRegion = dispatchRegion;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public AssignmentCandidateBuilder adjacentRegionClassification(final String adjacentRegionClassification) {
|
||||
this.adjacentRegionClassification = adjacentRegionClassification;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public AssignmentCandidateBuilder preferencePriority(final int preferencePriority) {
|
||||
this.preferencePriority = preferencePriority;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public AssignmentCandidateBuilder fieldMemberPreferenceRank(final int fieldMemberPreferenceRank) {
|
||||
this.fieldMemberPreferenceRank = fieldMemberPreferenceRank;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public AssignmentCandidateBuilder externalMemberPreferenceRank(final int externalMemberPreferenceRank) {
|
||||
this.externalMemberPreferenceRank = externalMemberPreferenceRank;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public AssignmentCandidateBuilder residenceMatchScore(final int residenceMatchScore) {
|
||||
this.residenceMatchScore = residenceMatchScore;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public AssignmentCandidate build() {
|
||||
return new AssignmentCandidate(this.fieldMemberId, this.externalMemberId, this.centerId, this.municipalityId, this.date, this.dispatchRegion, this.adjacentRegionClassification, this.preferencePriority, this.fieldMemberPreferenceRank, this.externalMemberPreferenceRank, this.residenceMatchScore);
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
String var10000 = this.fieldMemberId;
|
||||
return "AssignmentCandidate.AssignmentCandidateBuilder(fieldMemberId=" + var10000 + ", externalMemberId=" + this.externalMemberId + ", centerId=" + this.centerId + ", municipalityId=" + this.municipalityId + ", date=" + String.valueOf(this.date) + ", dispatchRegion=" + this.dispatchRegion + ", adjacentRegionClassification=" + this.adjacentRegionClassification + ", preferencePriority=" + this.preferencePriority + ", fieldMemberPreferenceRank=" + this.fieldMemberPreferenceRank + ", externalMemberPreferenceRank=" + this.externalMemberPreferenceRank + ", residenceMatchScore=" + this.residenceMatchScore + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
141
src/main/java/com/kri/p6/ncrc/pairing/model/Center.java
Normal file
141
src/main/java/com/kri/p6/ncrc/pairing/model/Center.java
Normal file
@@ -0,0 +1,141 @@
|
||||
package com.kri.p6.ncrc.pairing.model;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Set;
|
||||
import lombok.Generated;
|
||||
|
||||
public class Center {
|
||||
private final String id;
|
||||
private final String municipalityId;
|
||||
private final boolean womenOnly;
|
||||
private final String adjacentRegionClassification;
|
||||
private final LocalDate availableStartDate;
|
||||
private final LocalDate availableEndDate;
|
||||
private final Set<LocalDate> unavailableDates;
|
||||
|
||||
@Generated
|
||||
Center(final String id, final String municipalityId, final boolean womenOnly, final String adjacentRegionClassification, final LocalDate availableStartDate, final LocalDate availableEndDate, final Set<LocalDate> unavailableDates) {
|
||||
this.id = id;
|
||||
this.municipalityId = municipalityId;
|
||||
this.womenOnly = womenOnly;
|
||||
this.adjacentRegionClassification = adjacentRegionClassification;
|
||||
this.availableStartDate = availableStartDate;
|
||||
this.availableEndDate = availableEndDate;
|
||||
this.unavailableDates = unavailableDates;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static CenterBuilder builder() {
|
||||
return new CenterBuilder();
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getMunicipalityId() {
|
||||
return this.municipalityId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public boolean isWomenOnly() {
|
||||
return this.womenOnly;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getAdjacentRegionClassification() {
|
||||
return this.adjacentRegionClassification;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public LocalDate getAvailableStartDate() {
|
||||
return this.availableStartDate;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public LocalDate getAvailableEndDate() {
|
||||
return this.availableEndDate;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public Set<LocalDate> getUnavailableDates() {
|
||||
return this.unavailableDates;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static class CenterBuilder {
|
||||
@Generated
|
||||
private String id;
|
||||
@Generated
|
||||
private String municipalityId;
|
||||
@Generated
|
||||
private boolean womenOnly;
|
||||
@Generated
|
||||
private String adjacentRegionClassification;
|
||||
@Generated
|
||||
private LocalDate availableStartDate;
|
||||
@Generated
|
||||
private LocalDate availableEndDate;
|
||||
@Generated
|
||||
private Set<LocalDate> unavailableDates;
|
||||
|
||||
@Generated
|
||||
CenterBuilder() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public CenterBuilder id(final String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public CenterBuilder municipalityId(final String municipalityId) {
|
||||
this.municipalityId = municipalityId;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public CenterBuilder womenOnly(final boolean womenOnly) {
|
||||
this.womenOnly = womenOnly;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public CenterBuilder adjacentRegionClassification(final String adjacentRegionClassification) {
|
||||
this.adjacentRegionClassification = adjacentRegionClassification;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public CenterBuilder availableStartDate(final LocalDate availableStartDate) {
|
||||
this.availableStartDate = availableStartDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public CenterBuilder availableEndDate(final LocalDate availableEndDate) {
|
||||
this.availableEndDate = availableEndDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public CenterBuilder unavailableDates(final Set<LocalDate> unavailableDates) {
|
||||
this.unavailableDates = unavailableDates;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public Center build() {
|
||||
return new Center(this.id, this.municipalityId, this.womenOnly, this.adjacentRegionClassification, this.availableStartDate, this.availableEndDate, this.unavailableDates);
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
String var10000 = this.id;
|
||||
return "Center.CenterBuilder(id=" + var10000 + ", municipalityId=" + this.municipalityId + ", womenOnly=" + this.womenOnly + ", adjacentRegionClassification=" + this.adjacentRegionClassification + ", availableStartDate=" + String.valueOf(this.availableStartDate) + ", availableEndDate=" + String.valueOf(this.availableEndDate) + ", unavailableDates=" + String.valueOf(this.unavailableDates) + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.kri.p6.ncrc.pairing.model;
|
||||
|
||||
import lombok.Generated;
|
||||
|
||||
public class CenterAdjacentRegion {
|
||||
private final String dispatchRegion;
|
||||
private final String adjacentRegionClassification;
|
||||
|
||||
@Generated
|
||||
CenterAdjacentRegion(final String dispatchRegion, final String adjacentRegionClassification) {
|
||||
this.dispatchRegion = dispatchRegion;
|
||||
this.adjacentRegionClassification = adjacentRegionClassification;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static CenterAdjacentRegionBuilder builder() {
|
||||
return new CenterAdjacentRegionBuilder();
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getDispatchRegion() {
|
||||
return this.dispatchRegion;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getAdjacentRegionClassification() {
|
||||
return this.adjacentRegionClassification;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static class CenterAdjacentRegionBuilder {
|
||||
@Generated
|
||||
private String dispatchRegion;
|
||||
@Generated
|
||||
private String adjacentRegionClassification;
|
||||
|
||||
@Generated
|
||||
CenterAdjacentRegionBuilder() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public CenterAdjacentRegionBuilder dispatchRegion(final String dispatchRegion) {
|
||||
this.dispatchRegion = dispatchRegion;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public CenterAdjacentRegionBuilder adjacentRegionClassification(final String adjacentRegionClassification) {
|
||||
this.adjacentRegionClassification = adjacentRegionClassification;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public CenterAdjacentRegion build() {
|
||||
return new CenterAdjacentRegion(this.dispatchRegion, this.adjacentRegionClassification);
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
return "CenterAdjacentRegion.CenterAdjacentRegionBuilder(dispatchRegion=" + this.dispatchRegion + ", adjacentRegionClassification=" + this.adjacentRegionClassification + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
package com.kri.p6.ncrc.pairing.model;
|
||||
|
||||
import lombok.Generated;
|
||||
|
||||
public class DispatchRegionCandidate {
|
||||
private final String fieldMemberId;
|
||||
private final String externalMemberId;
|
||||
private final String dispatchRegion;
|
||||
private final int preferencePriority;
|
||||
private final int fieldMemberPreferenceRank;
|
||||
private final int externalMemberPreferenceRank;
|
||||
|
||||
@Generated
|
||||
DispatchRegionCandidate(final String fieldMemberId, final String externalMemberId, final String dispatchRegion, final int preferencePriority, final int fieldMemberPreferenceRank, final int externalMemberPreferenceRank) {
|
||||
this.fieldMemberId = fieldMemberId;
|
||||
this.externalMemberId = externalMemberId;
|
||||
this.dispatchRegion = dispatchRegion;
|
||||
this.preferencePriority = preferencePriority;
|
||||
this.fieldMemberPreferenceRank = fieldMemberPreferenceRank;
|
||||
this.externalMemberPreferenceRank = externalMemberPreferenceRank;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static DispatchRegionCandidateBuilder builder() {
|
||||
return new DispatchRegionCandidateBuilder();
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getFieldMemberId() {
|
||||
return this.fieldMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getExternalMemberId() {
|
||||
return this.externalMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getDispatchRegion() {
|
||||
return this.dispatchRegion;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int getPreferencePriority() {
|
||||
return this.preferencePriority;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int getFieldMemberPreferenceRank() {
|
||||
return this.fieldMemberPreferenceRank;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int getExternalMemberPreferenceRank() {
|
||||
return this.externalMemberPreferenceRank;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static class DispatchRegionCandidateBuilder {
|
||||
@Generated
|
||||
private String fieldMemberId;
|
||||
@Generated
|
||||
private String externalMemberId;
|
||||
@Generated
|
||||
private String dispatchRegion;
|
||||
@Generated
|
||||
private int preferencePriority;
|
||||
@Generated
|
||||
private int fieldMemberPreferenceRank;
|
||||
@Generated
|
||||
private int externalMemberPreferenceRank;
|
||||
|
||||
@Generated
|
||||
DispatchRegionCandidateBuilder() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public DispatchRegionCandidateBuilder fieldMemberId(final String fieldMemberId) {
|
||||
this.fieldMemberId = fieldMemberId;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public DispatchRegionCandidateBuilder externalMemberId(final String externalMemberId) {
|
||||
this.externalMemberId = externalMemberId;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public DispatchRegionCandidateBuilder dispatchRegion(final String dispatchRegion) {
|
||||
this.dispatchRegion = dispatchRegion;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public DispatchRegionCandidateBuilder preferencePriority(final int preferencePriority) {
|
||||
this.preferencePriority = preferencePriority;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public DispatchRegionCandidateBuilder fieldMemberPreferenceRank(final int fieldMemberPreferenceRank) {
|
||||
this.fieldMemberPreferenceRank = fieldMemberPreferenceRank;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public DispatchRegionCandidateBuilder externalMemberPreferenceRank(final int externalMemberPreferenceRank) {
|
||||
this.externalMemberPreferenceRank = externalMemberPreferenceRank;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public DispatchRegionCandidate build() {
|
||||
return new DispatchRegionCandidate(this.fieldMemberId, this.externalMemberId, this.dispatchRegion, this.preferencePriority, this.fieldMemberPreferenceRank, this.externalMemberPreferenceRank);
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
return "DispatchRegionCandidate.DispatchRegionCandidateBuilder(fieldMemberId=" + this.fieldMemberId + ", externalMemberId=" + this.externalMemberId + ", dispatchRegion=" + this.dispatchRegion + ", preferencePriority=" + this.preferencePriority + ", fieldMemberPreferenceRank=" + this.fieldMemberPreferenceRank + ", externalMemberPreferenceRank=" + this.externalMemberPreferenceRank + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
205
src/main/java/com/kri/p6/ncrc/pairing/model/Member.java
Normal file
205
src/main/java/com/kri/p6/ncrc/pairing/model/Member.java
Normal file
@@ -0,0 +1,205 @@
|
||||
package com.kri.p6.ncrc.pairing.model;
|
||||
|
||||
import com.kri.p6.ncrc.pairing.common.enums.ExperienceType;
|
||||
import com.kri.p6.ncrc.pairing.common.enums.Gender;
|
||||
import com.kri.p6.ncrc.pairing.common.enums.MemberRole;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import lombok.Generated;
|
||||
|
||||
public class Member {
|
||||
private final String id;
|
||||
private final Gender gender;
|
||||
private final ExperienceType experienceType;
|
||||
private final MemberRole role;
|
||||
private final LocalDate availableStartDate;
|
||||
private final LocalDate availableEndDate;
|
||||
private final Set<LocalDate> unavailableDates;
|
||||
private final String activityRegion;
|
||||
private final Set<String> historyCenterIds;
|
||||
private final String residenceCode;
|
||||
private final List<String> preferenceRegions;
|
||||
|
||||
@Generated
|
||||
Member(final String id, final Gender gender, final ExperienceType experienceType, final MemberRole role, final LocalDate availableStartDate, final LocalDate availableEndDate, final Set<LocalDate> unavailableDates, final String activityRegion, final Set<String> historyCenterIds, final String residenceCode, final List<String> preferenceRegions) {
|
||||
this.id = id;
|
||||
this.gender = gender;
|
||||
this.experienceType = experienceType;
|
||||
this.role = role;
|
||||
this.availableStartDate = availableStartDate;
|
||||
this.availableEndDate = availableEndDate;
|
||||
this.unavailableDates = unavailableDates;
|
||||
this.activityRegion = activityRegion;
|
||||
this.historyCenterIds = historyCenterIds;
|
||||
this.residenceCode = residenceCode;
|
||||
this.preferenceRegions = preferenceRegions;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static MemberBuilder builder() {
|
||||
return new MemberBuilder();
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public Gender getGender() {
|
||||
return this.gender;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public ExperienceType getExperienceType() {
|
||||
return this.experienceType;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public MemberRole getRole() {
|
||||
return this.role;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public LocalDate getAvailableStartDate() {
|
||||
return this.availableStartDate;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public LocalDate getAvailableEndDate() {
|
||||
return this.availableEndDate;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public Set<LocalDate> getUnavailableDates() {
|
||||
return this.unavailableDates;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getActivityRegion() {
|
||||
return this.activityRegion;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public Set<String> getHistoryCenterIds() {
|
||||
return this.historyCenterIds;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getResidenceCode() {
|
||||
return this.residenceCode;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<String> getPreferenceRegions() {
|
||||
return this.preferenceRegions;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static class MemberBuilder {
|
||||
@Generated
|
||||
private String id;
|
||||
@Generated
|
||||
private Gender gender;
|
||||
@Generated
|
||||
private ExperienceType experienceType;
|
||||
@Generated
|
||||
private MemberRole role;
|
||||
@Generated
|
||||
private LocalDate availableStartDate;
|
||||
@Generated
|
||||
private LocalDate availableEndDate;
|
||||
@Generated
|
||||
private Set<LocalDate> unavailableDates;
|
||||
@Generated
|
||||
private String activityRegion;
|
||||
@Generated
|
||||
private Set<String> historyCenterIds;
|
||||
@Generated
|
||||
private String residenceCode;
|
||||
@Generated
|
||||
private List<String> preferenceRegions;
|
||||
|
||||
@Generated
|
||||
MemberBuilder() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public MemberBuilder id(final String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public MemberBuilder gender(final Gender gender) {
|
||||
this.gender = gender;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public MemberBuilder experienceType(final ExperienceType experienceType) {
|
||||
this.experienceType = experienceType;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public MemberBuilder role(final MemberRole role) {
|
||||
this.role = role;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public MemberBuilder availableStartDate(final LocalDate availableStartDate) {
|
||||
this.availableStartDate = availableStartDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public MemberBuilder availableEndDate(final LocalDate availableEndDate) {
|
||||
this.availableEndDate = availableEndDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public MemberBuilder unavailableDates(final Set<LocalDate> unavailableDates) {
|
||||
this.unavailableDates = unavailableDates;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public MemberBuilder activityRegion(final String activityRegion) {
|
||||
this.activityRegion = activityRegion;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public MemberBuilder historyCenterIds(final Set<String> historyCenterIds) {
|
||||
this.historyCenterIds = historyCenterIds;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public MemberBuilder residenceCode(final String residenceCode) {
|
||||
this.residenceCode = residenceCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public MemberBuilder preferenceRegions(final List<String> preferenceRegions) {
|
||||
this.preferenceRegions = preferenceRegions;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public Member build() {
|
||||
return new Member(this.id, this.gender, this.experienceType, this.role, this.availableStartDate, this.availableEndDate, this.unavailableDates, this.activityRegion, this.historyCenterIds, this.residenceCode, this.preferenceRegions);
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
String var10000 = this.id;
|
||||
return "Member.MemberBuilder(id=" + var10000 + ", gender=" + String.valueOf(this.gender) + ", experienceType=" + String.valueOf(this.experienceType) + ", role=" + String.valueOf(this.role) + ", availableStartDate=" + String.valueOf(this.availableStartDate) + ", availableEndDate=" + String.valueOf(this.availableEndDate) + ", unavailableDates=" + String.valueOf(this.unavailableDates) + ", activityRegion=" + this.activityRegion + ", historyCenterIds=" + String.valueOf(this.historyCenterIds) + ", residenceCode=" + this.residenceCode + ", preferenceRegions=" + String.valueOf(this.preferenceRegions) + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
package com.kri.p6.ncrc.pairing.model;
|
||||
|
||||
import lombok.Generated;
|
||||
|
||||
public class MemberRegionCode {
|
||||
private final String sido;
|
||||
private final String sigungu;
|
||||
private final String regionCode;
|
||||
private final String detailRegionCode;
|
||||
private final String detailAreaCode;
|
||||
private final String fullRegionCode;
|
||||
|
||||
@Generated
|
||||
MemberRegionCode(final String sido, final String sigungu, final String regionCode, final String detailRegionCode, final String detailAreaCode, final String fullRegionCode) {
|
||||
this.sido = sido;
|
||||
this.sigungu = sigungu;
|
||||
this.regionCode = regionCode;
|
||||
this.detailRegionCode = detailRegionCode;
|
||||
this.detailAreaCode = detailAreaCode;
|
||||
this.fullRegionCode = fullRegionCode;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static MemberRegionCodeBuilder builder() {
|
||||
return new MemberRegionCodeBuilder();
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getSido() {
|
||||
return this.sido;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getSigungu() {
|
||||
return this.sigungu;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getRegionCode() {
|
||||
return this.regionCode;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getDetailRegionCode() {
|
||||
return this.detailRegionCode;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getDetailAreaCode() {
|
||||
return this.detailAreaCode;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getFullRegionCode() {
|
||||
return this.fullRegionCode;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static class MemberRegionCodeBuilder {
|
||||
@Generated
|
||||
private String sido;
|
||||
@Generated
|
||||
private String sigungu;
|
||||
@Generated
|
||||
private String regionCode;
|
||||
@Generated
|
||||
private String detailRegionCode;
|
||||
@Generated
|
||||
private String detailAreaCode;
|
||||
@Generated
|
||||
private String fullRegionCode;
|
||||
|
||||
@Generated
|
||||
MemberRegionCodeBuilder() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public MemberRegionCodeBuilder sido(final String sido) {
|
||||
this.sido = sido;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public MemberRegionCodeBuilder sigungu(final String sigungu) {
|
||||
this.sigungu = sigungu;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public MemberRegionCodeBuilder regionCode(final String regionCode) {
|
||||
this.regionCode = regionCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public MemberRegionCodeBuilder detailRegionCode(final String detailRegionCode) {
|
||||
this.detailRegionCode = detailRegionCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public MemberRegionCodeBuilder detailAreaCode(final String detailAreaCode) {
|
||||
this.detailAreaCode = detailAreaCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public MemberRegionCodeBuilder fullRegionCode(final String fullRegionCode) {
|
||||
this.fullRegionCode = fullRegionCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public MemberRegionCode build() {
|
||||
return new MemberRegionCode(this.sido, this.sigungu, this.regionCode, this.detailRegionCode, this.detailAreaCode, this.fullRegionCode);
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
return "MemberRegionCode.MemberRegionCodeBuilder(sido=" + this.sido + ", sigungu=" + this.sigungu + ", regionCode=" + this.regionCode + ", detailRegionCode=" + this.detailRegionCode + ", detailAreaCode=" + this.detailAreaCode + ", fullRegionCode=" + this.fullRegionCode + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.kri.p6.ncrc.pairing.model;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Set;
|
||||
import lombok.Generated;
|
||||
|
||||
public class Municipality {
|
||||
private final String id;
|
||||
private final LocalDate availableStartDate;
|
||||
private final LocalDate availableEndDate;
|
||||
private final Set<LocalDate> unavailableDates;
|
||||
|
||||
@Generated
|
||||
Municipality(final String id, final LocalDate availableStartDate, final LocalDate availableEndDate, final Set<LocalDate> unavailableDates) {
|
||||
this.id = id;
|
||||
this.availableStartDate = availableStartDate;
|
||||
this.availableEndDate = availableEndDate;
|
||||
this.unavailableDates = unavailableDates;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static MunicipalityBuilder builder() {
|
||||
return new MunicipalityBuilder();
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public LocalDate getAvailableStartDate() {
|
||||
return this.availableStartDate;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public LocalDate getAvailableEndDate() {
|
||||
return this.availableEndDate;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public Set<LocalDate> getUnavailableDates() {
|
||||
return this.unavailableDates;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static class MunicipalityBuilder {
|
||||
@Generated
|
||||
private String id;
|
||||
@Generated
|
||||
private LocalDate availableStartDate;
|
||||
@Generated
|
||||
private LocalDate availableEndDate;
|
||||
@Generated
|
||||
private Set<LocalDate> unavailableDates;
|
||||
|
||||
@Generated
|
||||
MunicipalityBuilder() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public MunicipalityBuilder id(final String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public MunicipalityBuilder availableStartDate(final LocalDate availableStartDate) {
|
||||
this.availableStartDate = availableStartDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public MunicipalityBuilder availableEndDate(final LocalDate availableEndDate) {
|
||||
this.availableEndDate = availableEndDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public MunicipalityBuilder unavailableDates(final Set<LocalDate> unavailableDates) {
|
||||
this.unavailableDates = unavailableDates;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public Municipality build() {
|
||||
return new Municipality(this.id, this.availableStartDate, this.availableEndDate, this.unavailableDates);
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
String var10000 = this.id;
|
||||
return "Municipality.MunicipalityBuilder(id=" + var10000 + ", availableStartDate=" + String.valueOf(this.availableStartDate) + ", availableEndDate=" + String.valueOf(this.availableEndDate) + ", unavailableDates=" + String.valueOf(this.unavailableDates) + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.kri.p6.ncrc.pairing.model;
|
||||
|
||||
import lombok.Generated;
|
||||
|
||||
public class PairCandidate {
|
||||
private final String fieldMemberId;
|
||||
private final String externalMemberId;
|
||||
private final int residenceMatchScore;
|
||||
|
||||
@Generated
|
||||
PairCandidate(final String fieldMemberId, final String externalMemberId, final int residenceMatchScore) {
|
||||
this.fieldMemberId = fieldMemberId;
|
||||
this.externalMemberId = externalMemberId;
|
||||
this.residenceMatchScore = residenceMatchScore;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static PairCandidateBuilder builder() {
|
||||
return new PairCandidateBuilder();
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getFieldMemberId() {
|
||||
return this.fieldMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String getExternalMemberId() {
|
||||
return this.externalMemberId;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int getResidenceMatchScore() {
|
||||
return this.residenceMatchScore;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static class PairCandidateBuilder {
|
||||
@Generated
|
||||
private String fieldMemberId;
|
||||
@Generated
|
||||
private String externalMemberId;
|
||||
@Generated
|
||||
private int residenceMatchScore;
|
||||
|
||||
@Generated
|
||||
PairCandidateBuilder() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairCandidateBuilder fieldMemberId(final String fieldMemberId) {
|
||||
this.fieldMemberId = fieldMemberId;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairCandidateBuilder externalMemberId(final String externalMemberId) {
|
||||
this.externalMemberId = externalMemberId;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairCandidateBuilder residenceMatchScore(final int residenceMatchScore) {
|
||||
this.residenceMatchScore = residenceMatchScore;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairCandidate build() {
|
||||
return new PairCandidate(this.fieldMemberId, this.externalMemberId, this.residenceMatchScore);
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
return "PairCandidate.PairCandidateBuilder(fieldMemberId=" + this.fieldMemberId + ", externalMemberId=" + this.externalMemberId + ", residenceMatchScore=" + this.residenceMatchScore + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.kri.p6.ncrc.pairing.model;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import lombok.Generated;
|
||||
|
||||
public class PairingCandidates {
|
||||
private final List<PairCandidate> pairCandidates;
|
||||
private final List<DispatchRegionCandidate> dispatchRegionCandidates;
|
||||
private final List<AssignmentCandidate> assignmentCandidates;
|
||||
private final Map<String, Set<String>> unassignedCenterReasons;
|
||||
|
||||
@Generated
|
||||
PairingCandidates(final List<PairCandidate> pairCandidates, final List<DispatchRegionCandidate> dispatchRegionCandidates, final List<AssignmentCandidate> assignmentCandidates, final Map<String, Set<String>> unassignedCenterReasons) {
|
||||
this.pairCandidates = pairCandidates;
|
||||
this.dispatchRegionCandidates = dispatchRegionCandidates;
|
||||
this.assignmentCandidates = assignmentCandidates;
|
||||
this.unassignedCenterReasons = unassignedCenterReasons;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static PairingCandidatesBuilder builder() {
|
||||
return new PairingCandidatesBuilder();
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<PairCandidate> getPairCandidates() {
|
||||
return this.pairCandidates;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<DispatchRegionCandidate> getDispatchRegionCandidates() {
|
||||
return this.dispatchRegionCandidates;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<AssignmentCandidate> getAssignmentCandidates() {
|
||||
return this.assignmentCandidates;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public Map<String, Set<String>> getUnassignedCenterReasons() {
|
||||
return this.unassignedCenterReasons;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static class PairingCandidatesBuilder {
|
||||
@Generated
|
||||
private List<PairCandidate> pairCandidates;
|
||||
@Generated
|
||||
private List<DispatchRegionCandidate> dispatchRegionCandidates;
|
||||
@Generated
|
||||
private List<AssignmentCandidate> assignmentCandidates;
|
||||
@Generated
|
||||
private Map<String, Set<String>> unassignedCenterReasons;
|
||||
|
||||
@Generated
|
||||
PairingCandidatesBuilder() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingCandidatesBuilder pairCandidates(final List<PairCandidate> pairCandidates) {
|
||||
this.pairCandidates = pairCandidates;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingCandidatesBuilder dispatchRegionCandidates(final List<DispatchRegionCandidate> dispatchRegionCandidates) {
|
||||
this.dispatchRegionCandidates = dispatchRegionCandidates;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingCandidatesBuilder assignmentCandidates(final List<AssignmentCandidate> assignmentCandidates) {
|
||||
this.assignmentCandidates = assignmentCandidates;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingCandidatesBuilder unassignedCenterReasons(final Map<String, Set<String>> unassignedCenterReasons) {
|
||||
this.unassignedCenterReasons = unassignedCenterReasons;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingCandidates build() {
|
||||
return new PairingCandidates(this.pairCandidates, this.dispatchRegionCandidates, this.assignmentCandidates, this.unassignedCenterReasons);
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
String var10000 = String.valueOf(this.pairCandidates);
|
||||
return "PairingCandidates.PairingCandidatesBuilder(pairCandidates=" + var10000 + ", dispatchRegionCandidates=" + String.valueOf(this.dispatchRegionCandidates) + ", assignmentCandidates=" + String.valueOf(this.assignmentCandidates) + ", unassignedCenterReasons=" + String.valueOf(this.unassignedCenterReasons) + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
142
src/main/java/com/kri/p6/ncrc/pairing/model/PairingData.java
Normal file
142
src/main/java/com/kri/p6/ncrc/pairing/model/PairingData.java
Normal file
@@ -0,0 +1,142 @@
|
||||
package com.kri.p6.ncrc.pairing.model;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import lombok.Generated;
|
||||
|
||||
public class PairingData {
|
||||
private final List<Member> members;
|
||||
private final List<Municipality> municipalities;
|
||||
private final List<Center> centers;
|
||||
private final List<MemberRegionCode> memberRegionCodes;
|
||||
private final List<CenterAdjacentRegion> centerAdjacentRegions;
|
||||
private final List<PreferenceMatchRule> preferenceMatchRules;
|
||||
private final Set<LocalDate> commonUnavailableDates;
|
||||
|
||||
@Generated
|
||||
PairingData(final List<Member> members, final List<Municipality> municipalities, final List<Center> centers, final List<MemberRegionCode> memberRegionCodes, final List<CenterAdjacentRegion> centerAdjacentRegions, final List<PreferenceMatchRule> preferenceMatchRules, final Set<LocalDate> commonUnavailableDates) {
|
||||
this.members = members;
|
||||
this.municipalities = municipalities;
|
||||
this.centers = centers;
|
||||
this.memberRegionCodes = memberRegionCodes;
|
||||
this.centerAdjacentRegions = centerAdjacentRegions;
|
||||
this.preferenceMatchRules = preferenceMatchRules;
|
||||
this.commonUnavailableDates = commonUnavailableDates;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static PairingDataBuilder builder() {
|
||||
return new PairingDataBuilder();
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<Member> getMembers() {
|
||||
return this.members;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<Municipality> getMunicipalities() {
|
||||
return this.municipalities;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<Center> getCenters() {
|
||||
return this.centers;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<MemberRegionCode> getMemberRegionCodes() {
|
||||
return this.memberRegionCodes;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<CenterAdjacentRegion> getCenterAdjacentRegions() {
|
||||
return this.centerAdjacentRegions;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<PreferenceMatchRule> getPreferenceMatchRules() {
|
||||
return this.preferenceMatchRules;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public Set<LocalDate> getCommonUnavailableDates() {
|
||||
return this.commonUnavailableDates;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static class PairingDataBuilder {
|
||||
@Generated
|
||||
private List<Member> members;
|
||||
@Generated
|
||||
private List<Municipality> municipalities;
|
||||
@Generated
|
||||
private List<Center> centers;
|
||||
@Generated
|
||||
private List<MemberRegionCode> memberRegionCodes;
|
||||
@Generated
|
||||
private List<CenterAdjacentRegion> centerAdjacentRegions;
|
||||
@Generated
|
||||
private List<PreferenceMatchRule> preferenceMatchRules;
|
||||
@Generated
|
||||
private Set<LocalDate> commonUnavailableDates;
|
||||
|
||||
@Generated
|
||||
PairingDataBuilder() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingDataBuilder members(final List<Member> members) {
|
||||
this.members = members;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingDataBuilder municipalities(final List<Municipality> municipalities) {
|
||||
this.municipalities = municipalities;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingDataBuilder centers(final List<Center> centers) {
|
||||
this.centers = centers;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingDataBuilder memberRegionCodes(final List<MemberRegionCode> memberRegionCodes) {
|
||||
this.memberRegionCodes = memberRegionCodes;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingDataBuilder centerAdjacentRegions(final List<CenterAdjacentRegion> centerAdjacentRegions) {
|
||||
this.centerAdjacentRegions = centerAdjacentRegions;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingDataBuilder preferenceMatchRules(final List<PreferenceMatchRule> preferenceMatchRules) {
|
||||
this.preferenceMatchRules = preferenceMatchRules;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingDataBuilder commonUnavailableDates(final Set<LocalDate> commonUnavailableDates) {
|
||||
this.commonUnavailableDates = commonUnavailableDates;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingData build() {
|
||||
return new PairingData(this.members, this.municipalities, this.centers, this.memberRegionCodes, this.centerAdjacentRegions, this.preferenceMatchRules, this.commonUnavailableDates);
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
String var10000 = String.valueOf(this.members);
|
||||
return "PairingData.PairingDataBuilder(members=" + var10000 + ", municipalities=" + String.valueOf(this.municipalities) + ", centers=" + String.valueOf(this.centers) + ", memberRegionCodes=" + String.valueOf(this.memberRegionCodes) + ", centerAdjacentRegions=" + String.valueOf(this.centerAdjacentRegions) + ", preferenceMatchRules=" + String.valueOf(this.preferenceMatchRules) + ", commonUnavailableDates=" + String.valueOf(this.commonUnavailableDates) + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
163
src/main/java/com/kri/p6/ncrc/pairing/model/PairingResult.java
Normal file
163
src/main/java/com/kri/p6/ncrc/pairing/model/PairingResult.java
Normal file
@@ -0,0 +1,163 @@
|
||||
package com.kri.p6.ncrc.pairing.model;
|
||||
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.ABPairExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.AssignmentResultExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.CandidateSummaryExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.PairingSummaryExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.RuleViolationExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.UnassignedCenterExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.UnusedMemberExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.ValidationErrorExcelDto;
|
||||
import java.util.List;
|
||||
import lombok.Generated;
|
||||
|
||||
public class PairingResult {
|
||||
private final List<AssignmentResultExcelDto> assignments;
|
||||
private final List<UnassignedCenterExcelDto> unassignedCenters;
|
||||
private final List<UnusedMemberExcelDto> unusedMembers;
|
||||
private final List<PairingSummaryExcelDto> summaries;
|
||||
private final List<ABPairExcelDto> abPairs;
|
||||
private final List<CandidateSummaryExcelDto> candidateSummaries;
|
||||
private final List<ValidationErrorExcelDto> validationErrors;
|
||||
private final List<RuleViolationExcelDto> ruleViolations;
|
||||
|
||||
@Generated
|
||||
PairingResult(final List<AssignmentResultExcelDto> assignments, final List<UnassignedCenterExcelDto> unassignedCenters, final List<UnusedMemberExcelDto> unusedMembers, final List<PairingSummaryExcelDto> summaries, final List<ABPairExcelDto> abPairs, final List<CandidateSummaryExcelDto> candidateSummaries, final List<ValidationErrorExcelDto> validationErrors, final List<RuleViolationExcelDto> ruleViolations) {
|
||||
this.assignments = assignments;
|
||||
this.unassignedCenters = unassignedCenters;
|
||||
this.unusedMembers = unusedMembers;
|
||||
this.summaries = summaries;
|
||||
this.abPairs = abPairs;
|
||||
this.candidateSummaries = candidateSummaries;
|
||||
this.validationErrors = validationErrors;
|
||||
this.ruleViolations = ruleViolations;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static PairingResultBuilder builder() {
|
||||
return new PairingResultBuilder();
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<AssignmentResultExcelDto> getAssignments() {
|
||||
return this.assignments;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<UnassignedCenterExcelDto> getUnassignedCenters() {
|
||||
return this.unassignedCenters;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<UnusedMemberExcelDto> getUnusedMembers() {
|
||||
return this.unusedMembers;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<PairingSummaryExcelDto> getSummaries() {
|
||||
return this.summaries;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<ABPairExcelDto> getAbPairs() {
|
||||
return this.abPairs;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<CandidateSummaryExcelDto> getCandidateSummaries() {
|
||||
return this.candidateSummaries;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<ValidationErrorExcelDto> getValidationErrors() {
|
||||
return this.validationErrors;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public List<RuleViolationExcelDto> getRuleViolations() {
|
||||
return this.ruleViolations;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static class PairingResultBuilder {
|
||||
@Generated
|
||||
private List<AssignmentResultExcelDto> assignments;
|
||||
@Generated
|
||||
private List<UnassignedCenterExcelDto> unassignedCenters;
|
||||
@Generated
|
||||
private List<UnusedMemberExcelDto> unusedMembers;
|
||||
@Generated
|
||||
private List<PairingSummaryExcelDto> summaries;
|
||||
@Generated
|
||||
private List<ABPairExcelDto> abPairs;
|
||||
@Generated
|
||||
private List<CandidateSummaryExcelDto> candidateSummaries;
|
||||
@Generated
|
||||
private List<ValidationErrorExcelDto> validationErrors;
|
||||
@Generated
|
||||
private List<RuleViolationExcelDto> ruleViolations;
|
||||
|
||||
@Generated
|
||||
PairingResultBuilder() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingResultBuilder assignments(final List<AssignmentResultExcelDto> assignments) {
|
||||
this.assignments = assignments;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingResultBuilder unassignedCenters(final List<UnassignedCenterExcelDto> unassignedCenters) {
|
||||
this.unassignedCenters = unassignedCenters;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingResultBuilder unusedMembers(final List<UnusedMemberExcelDto> unusedMembers) {
|
||||
this.unusedMembers = unusedMembers;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingResultBuilder summaries(final List<PairingSummaryExcelDto> summaries) {
|
||||
this.summaries = summaries;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingResultBuilder abPairs(final List<ABPairExcelDto> abPairs) {
|
||||
this.abPairs = abPairs;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingResultBuilder candidateSummaries(final List<CandidateSummaryExcelDto> candidateSummaries) {
|
||||
this.candidateSummaries = candidateSummaries;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingResultBuilder validationErrors(final List<ValidationErrorExcelDto> validationErrors) {
|
||||
this.validationErrors = validationErrors;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingResultBuilder ruleViolations(final List<RuleViolationExcelDto> ruleViolations) {
|
||||
this.ruleViolations = ruleViolations;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingResult build() {
|
||||
return new PairingResult(this.assignments, this.unassignedCenters, this.unusedMembers, this.summaries, this.abPairs, this.candidateSummaries, this.validationErrors, this.ruleViolations);
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
String var10000 = String.valueOf(this.assignments);
|
||||
return "PairingResult.PairingResultBuilder(assignments=" + var10000 + ", unassignedCenters=" + String.valueOf(this.unassignedCenters) + ", unusedMembers=" + String.valueOf(this.unusedMembers) + ", summaries=" + String.valueOf(this.summaries) + ", abPairs=" + String.valueOf(this.abPairs) + ", candidateSummaries=" + String.valueOf(this.candidateSummaries) + ", validationErrors=" + String.valueOf(this.validationErrors) + ", ruleViolations=" + String.valueOf(this.ruleViolations) + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.kri.p6.ncrc.pairing.model;
|
||||
|
||||
import lombok.Generated;
|
||||
|
||||
public class PreferenceMatchRule {
|
||||
private final int priority;
|
||||
private final int fieldMemberPreferenceRank;
|
||||
private final int externalMemberPreferenceRank;
|
||||
|
||||
@Generated
|
||||
PreferenceMatchRule(final int priority, final int fieldMemberPreferenceRank, final int externalMemberPreferenceRank) {
|
||||
this.priority = priority;
|
||||
this.fieldMemberPreferenceRank = fieldMemberPreferenceRank;
|
||||
this.externalMemberPreferenceRank = externalMemberPreferenceRank;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static PreferenceMatchRuleBuilder builder() {
|
||||
return new PreferenceMatchRuleBuilder();
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int getPriority() {
|
||||
return this.priority;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int getFieldMemberPreferenceRank() {
|
||||
return this.fieldMemberPreferenceRank;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public int getExternalMemberPreferenceRank() {
|
||||
return this.externalMemberPreferenceRank;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public static class PreferenceMatchRuleBuilder {
|
||||
@Generated
|
||||
private int priority;
|
||||
@Generated
|
||||
private int fieldMemberPreferenceRank;
|
||||
@Generated
|
||||
private int externalMemberPreferenceRank;
|
||||
|
||||
@Generated
|
||||
PreferenceMatchRuleBuilder() {
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PreferenceMatchRuleBuilder priority(final int priority) {
|
||||
this.priority = priority;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PreferenceMatchRuleBuilder fieldMemberPreferenceRank(final int fieldMemberPreferenceRank) {
|
||||
this.fieldMemberPreferenceRank = fieldMemberPreferenceRank;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PreferenceMatchRuleBuilder externalMemberPreferenceRank(final int externalMemberPreferenceRank) {
|
||||
this.externalMemberPreferenceRank = externalMemberPreferenceRank;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PreferenceMatchRule build() {
|
||||
return new PreferenceMatchRule(this.priority, this.fieldMemberPreferenceRank, this.externalMemberPreferenceRank);
|
||||
}
|
||||
|
||||
@Generated
|
||||
public String toString() {
|
||||
return "PreferenceMatchRule.PreferenceMatchRuleBuilder(priority=" + this.priority + ", fieldMemberPreferenceRank=" + this.fieldMemberPreferenceRank + ", externalMemberPreferenceRank=" + this.externalMemberPreferenceRank + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
package com.kri.p6.ncrc.pairing.service;
|
||||
|
||||
import com.kri.p6.ncrc.pairing.config.PairingProperties;
|
||||
import com.kri.p6.ncrc.pairing.model.AssignmentCandidate;
|
||||
import com.kri.p6.ncrc.pairing.model.Center;
|
||||
import com.kri.p6.ncrc.pairing.model.CenterAdjacentRegion;
|
||||
import com.kri.p6.ncrc.pairing.model.DispatchRegionCandidate;
|
||||
import com.kri.p6.ncrc.pairing.common.enums.ExperienceType;
|
||||
import com.kri.p6.ncrc.pairing.common.enums.Gender;
|
||||
import com.kri.p6.ncrc.pairing.model.Member;
|
||||
import com.kri.p6.ncrc.pairing.common.enums.MemberRole;
|
||||
import com.kri.p6.ncrc.pairing.model.Municipality;
|
||||
import com.kri.p6.ncrc.pairing.model.PairCandidate;
|
||||
import com.kri.p6.ncrc.pairing.model.PairingCandidates;
|
||||
import com.kri.p6.ncrc.pairing.model.PairingData;
|
||||
import com.kri.p6.ncrc.pairing.model.PreferenceMatchRule;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.Generated;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class PairingCandidateService {
|
||||
private final PairingProperties pairingProperties;
|
||||
|
||||
public PairingCandidates generate(PairingData data) {
|
||||
List<PairCandidate> pairCandidates = this.createPairCandidates(data.getMembers());
|
||||
List<DispatchRegionCandidate> dispatchRegionCandidates = this.createDispatchRegionCandidates(data, pairCandidates);
|
||||
Map<String, Set<String>> unassignedCenterReasons = this.createInitialCenterReasonMap(data);
|
||||
List<AssignmentCandidate> assignmentCandidates = this.createAssignmentCandidates(data, pairCandidates, dispatchRegionCandidates, unassignedCenterReasons);
|
||||
return PairingCandidates.builder().pairCandidates(pairCandidates).dispatchRegionCandidates(dispatchRegionCandidates).assignmentCandidates(assignmentCandidates).unassignedCenterReasons(unassignedCenterReasons).build();
|
||||
}
|
||||
|
||||
private List<PairCandidate> createPairCandidates(List<Member> members) {
|
||||
List<Member> fieldMembers = members.stream().filter((member) -> member.getRole() == MemberRole.FIELD).toList();
|
||||
List<Member> externalMembers = members.stream().filter((member) -> member.getRole() == MemberRole.EXTERNAL).toList();
|
||||
List<PairCandidate> candidates = new ArrayList();
|
||||
|
||||
for(Member fieldMember : fieldMembers) {
|
||||
for(Member externalMember : externalMembers) {
|
||||
if (!this.isNewNewPair(fieldMember, externalMember) && this.hasDateOverlap(fieldMember, externalMember)) {
|
||||
candidates.add(PairCandidate.builder().fieldMemberId(fieldMember.getId()).externalMemberId(externalMember.getId()).residenceMatchScore(this.calculateResidenceMatchScore(fieldMember, externalMember)).build());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return candidates;
|
||||
}
|
||||
|
||||
private List<DispatchRegionCandidate> createDispatchRegionCandidates(PairingData data, List<PairCandidate> pairCandidates) {
|
||||
Map<String, Member> memberMap = this.toMemberMap(data.getMembers());
|
||||
Set<String> dispatchRegions = (Set)data.getCenterAdjacentRegions().stream().map(CenterAdjacentRegion::getDispatchRegion).collect(Collectors.toSet());
|
||||
List<DispatchRegionCandidate> candidates = new ArrayList();
|
||||
|
||||
for(PairCandidate pairCandidate : pairCandidates) {
|
||||
Member fieldMember = (Member)memberMap.get(pairCandidate.getFieldMemberId());
|
||||
Member externalMember = (Member)memberMap.get(pairCandidate.getExternalMemberId());
|
||||
|
||||
for(String dispatchRegion : dispatchRegions) {
|
||||
if (!this.isConflictRegion(fieldMember, externalMember, dispatchRegion)) {
|
||||
int fieldRank = this.findPreferenceRank(fieldMember, dispatchRegion);
|
||||
int externalRank = this.findPreferenceRank(externalMember, dispatchRegion);
|
||||
Optional<PreferenceMatchRule> matchRule = this.findPreferenceMatchRule(data.getPreferenceMatchRules(), fieldRank, externalRank);
|
||||
if (!matchRule.isEmpty()) {
|
||||
candidates.add(DispatchRegionCandidate.builder().fieldMemberId(fieldMember.getId()).externalMemberId(externalMember.getId()).dispatchRegion(dispatchRegion).preferencePriority(((PreferenceMatchRule)matchRule.get()).getPriority()).fieldMemberPreferenceRank(fieldRank).externalMemberPreferenceRank(externalRank).build());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return candidates;
|
||||
}
|
||||
|
||||
private List<AssignmentCandidate> createAssignmentCandidates(PairingData data, List<PairCandidate> pairCandidates, List<DispatchRegionCandidate> dispatchRegionCandidates, Map<String, Set<String>> unassignedCenterReasons) {
|
||||
Map<String, Member> memberMap = this.toMemberMap(data.getMembers());
|
||||
Map<String, Municipality> municipalityMap = (Map)data.getMunicipalities().stream().collect(Collectors.toMap(Municipality::getId, Function.identity(), (left, right) -> left));
|
||||
Map<String, PairCandidate> pairMap = (Map)pairCandidates.stream().collect(Collectors.toMap(this::pairKey, Function.identity(), (left, right) -> left));
|
||||
Map<String, Set<String>> adjacentClassificationsByDispatchRegion = (Map)data.getCenterAdjacentRegions().stream().collect(Collectors.groupingBy(CenterAdjacentRegion::getDispatchRegion, Collectors.mapping(CenterAdjacentRegion::getAdjacentRegionClassification, Collectors.toSet())));
|
||||
List<AssignmentCandidate> candidates = new ArrayList();
|
||||
|
||||
for(DispatchRegionCandidate dispatchCandidate : dispatchRegionCandidates) {
|
||||
Member fieldMember = (Member)memberMap.get(dispatchCandidate.getFieldMemberId());
|
||||
Member externalMember = (Member)memberMap.get(dispatchCandidate.getExternalMemberId());
|
||||
PairCandidate pairCandidate = (PairCandidate)pairMap.get(this.pairKey(dispatchCandidate.getFieldMemberId(), dispatchCandidate.getExternalMemberId()));
|
||||
Set<String> adjacentClassifications = (Set)adjacentClassificationsByDispatchRegion.getOrDefault(dispatchCandidate.getDispatchRegion(), Set.of());
|
||||
|
||||
for(Center center : data.getCenters()) {
|
||||
if (!adjacentClassifications.contains(center.getAdjacentRegionClassification())) {
|
||||
this.addReason(unassignedCenterReasons, center.getId(), "파견 권역과 센터 인접지역 분류 불일치");
|
||||
} else {
|
||||
Municipality municipality = (Municipality)municipalityMap.get(center.getMunicipalityId());
|
||||
List<String> centerReasons = this.findCenterHardRuleReasons(fieldMember, externalMember, center);
|
||||
if (!centerReasons.isEmpty()) {
|
||||
centerReasons.forEach((reason) -> this.addReason(unassignedCenterReasons, center.getId(), reason));
|
||||
} else {
|
||||
LocalDate firstAssignableDate = this.findFirstAssignableDate(fieldMember, externalMember, municipality, center, this.commonUnavailableDates(data));
|
||||
if (firstAssignableDate == null) {
|
||||
this.addReason(unassignedCenterReasons, center.getId(), "위원/지자체/센터 일정 또는 국공휴일 조건 불일치");
|
||||
} else {
|
||||
candidates.add(AssignmentCandidate.builder().fieldMemberId(fieldMember.getId()).externalMemberId(externalMember.getId()).centerId(center.getId()).municipalityId(center.getMunicipalityId()).date(firstAssignableDate).dispatchRegion(dispatchCandidate.getDispatchRegion()).adjacentRegionClassification(center.getAdjacentRegionClassification()).preferencePriority(dispatchCandidate.getPreferencePriority()).fieldMemberPreferenceRank(dispatchCandidate.getFieldMemberPreferenceRank()).externalMemberPreferenceRank(dispatchCandidate.getExternalMemberPreferenceRank()).residenceMatchScore(pairCandidate == null ? 0 : pairCandidate.getResidenceMatchScore()).build());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return candidates;
|
||||
}
|
||||
|
||||
private boolean isNewNewPair(Member fieldMember, Member externalMember) {
|
||||
return fieldMember.getExperienceType() == ExperienceType.NEW && externalMember.getExperienceType() == ExperienceType.NEW;
|
||||
}
|
||||
|
||||
private boolean hasDateOverlap(Member fieldMember, Member externalMember) {
|
||||
LocalDate latestStart = this.max(fieldMember.getAvailableStartDate(), externalMember.getAvailableStartDate());
|
||||
LocalDate earliestEnd = this.min(fieldMember.getAvailableEndDate(), externalMember.getAvailableEndDate());
|
||||
return !latestStart.isAfter(earliestEnd);
|
||||
}
|
||||
|
||||
private int calculateResidenceMatchScore(Member fieldMember, Member externalMember) {
|
||||
String fieldPrefix = this.prefix(fieldMember.getResidenceCode());
|
||||
String externalPrefix = this.prefix(externalMember.getResidenceCode());
|
||||
return fieldPrefix.equals(externalPrefix) ? 1 : 0;
|
||||
}
|
||||
|
||||
private boolean isConflictRegion(Member fieldMember, Member externalMember, String dispatchRegion) {
|
||||
return dispatchRegion.equals(fieldMember.getActivityRegion()) || dispatchRegion.equals(externalMember.getActivityRegion());
|
||||
}
|
||||
|
||||
private int findPreferenceRank(Member member, String dispatchRegion) {
|
||||
List<String> preferences = member.getPreferenceRegions();
|
||||
|
||||
for(int i = 0; i < preferences.size(); ++i) {
|
||||
String preference = (String)preferences.get(i);
|
||||
if (dispatchRegion.equals(preference)) {
|
||||
return i + 1;
|
||||
}
|
||||
|
||||
if (this.anyRegionCode().equals(preference)) {
|
||||
return this.anywherePreferenceRank();
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
private Optional<PreferenceMatchRule> findPreferenceMatchRule(List<PreferenceMatchRule> rules, int fieldRank, int externalRank) {
|
||||
return fieldRank >= 0 && externalRank >= 0 ? rules.stream().filter((rule) -> this.matchesPreferenceRank(rule.getFieldMemberPreferenceRank(), fieldRank)).filter((rule) -> this.matchesPreferenceRank(rule.getExternalMemberPreferenceRank(), externalRank)).min(Comparator.comparingInt(PreferenceMatchRule::getPriority)) : Optional.empty();
|
||||
}
|
||||
|
||||
private boolean matchesPreferenceRank(int ruleRank, int memberRank) {
|
||||
return ruleRank == this.ignoredPreferenceRank() || ruleRank == memberRank;
|
||||
}
|
||||
|
||||
private List<String> findCenterHardRuleReasons(Member fieldMember, Member externalMember, Center center) {
|
||||
List<String> reasons = new ArrayList();
|
||||
if (center.isWomenOnly() && (fieldMember.getGender() != Gender.FEMALE || externalMember.getGender() != Gender.FEMALE)) {
|
||||
reasons.add("여성 전용 센터 조건 불충족");
|
||||
}
|
||||
|
||||
if (fieldMember.getHistoryCenterIds().contains(center.getId()) || externalMember.getHistoryCenterIds().contains(center.getId())) {
|
||||
reasons.add("2023년 진행 센터 재배정 제외");
|
||||
}
|
||||
|
||||
return reasons;
|
||||
}
|
||||
|
||||
private LocalDate findFirstAssignableDate(Member fieldMember, Member externalMember, Municipality municipality, Center center, Set<LocalDate> commonUnavailableDates) {
|
||||
LocalDate start = this.max(this.max(fieldMember.getAvailableStartDate(), externalMember.getAvailableStartDate()), this.max(municipality.getAvailableStartDate(), center.getAvailableStartDate()));
|
||||
LocalDate end = this.min(this.min(fieldMember.getAvailableEndDate(), externalMember.getAvailableEndDate()), this.min(municipality.getAvailableEndDate(), center.getAvailableEndDate()));
|
||||
if (start.isAfter(end)) {
|
||||
return null;
|
||||
} else {
|
||||
for(LocalDate date = start; !date.isAfter(end); date = date.plusDays(1L)) {
|
||||
if (this.isAvailableOn(date, fieldMember, externalMember, municipality, center, commonUnavailableDates)) {
|
||||
return date;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isAvailableOn(LocalDate date, Member fieldMember, Member externalMember, Municipality municipality, Center center, Set<LocalDate> commonUnavailableDates) {
|
||||
return !fieldMember.getUnavailableDates().contains(date) && !externalMember.getUnavailableDates().contains(date) && !municipality.getUnavailableDates().contains(date) && !center.getUnavailableDates().contains(date) && !commonUnavailableDates.contains(date);
|
||||
}
|
||||
|
||||
private Map<String, Set<String>> createInitialCenterReasonMap(PairingData data) {
|
||||
Map<String, Set<String>> reasons = new HashMap();
|
||||
data.getCenters().forEach((center) -> reasons.put(center.getId(), new LinkedHashSet()));
|
||||
return reasons;
|
||||
}
|
||||
|
||||
private void addReason(Map<String, Set<String>> reasons, String centerId, String reason) {
|
||||
((Set)reasons.computeIfAbsent(centerId, (key) -> new LinkedHashSet())).add(reason);
|
||||
}
|
||||
|
||||
private Set<LocalDate> commonUnavailableDates(PairingData data) {
|
||||
return data.getCommonUnavailableDates() == null ? Set.of() : data.getCommonUnavailableDates();
|
||||
}
|
||||
|
||||
private Map<String, Member> toMemberMap(List<Member> members) {
|
||||
return (Map)members.stream().collect(Collectors.toMap(Member::getId, Function.identity(), (left, right) -> left));
|
||||
}
|
||||
|
||||
private String pairKey(PairCandidate pairCandidate) {
|
||||
return this.pairKey(pairCandidate.getFieldMemberId(), pairCandidate.getExternalMemberId());
|
||||
}
|
||||
|
||||
private String pairKey(String fieldMemberId, String externalMemberId) {
|
||||
return fieldMemberId + "|" + externalMemberId;
|
||||
}
|
||||
|
||||
private String prefix(String value) {
|
||||
return value.substring(0, Math.min(this.residenceMatchPrefixLength(), value.length()));
|
||||
}
|
||||
|
||||
private String anyRegionCode() {
|
||||
return this.pairingProperties.getCode().getAnyRegionCode();
|
||||
}
|
||||
|
||||
private int anywherePreferenceRank() {
|
||||
return this.pairingProperties.getPreference().getAnywhereRank();
|
||||
}
|
||||
|
||||
private int ignoredPreferenceRank() {
|
||||
return this.pairingProperties.getPreference().getIgnoredRank();
|
||||
}
|
||||
|
||||
private int residenceMatchPrefixLength() {
|
||||
return this.pairingProperties.getCode().getResidenceMatchPrefixLength();
|
||||
}
|
||||
|
||||
private LocalDate max(LocalDate left, LocalDate right) {
|
||||
return left.isAfter(right) ? left : right;
|
||||
}
|
||||
|
||||
private LocalDate min(LocalDate left, LocalDate right) {
|
||||
return left.isBefore(right) ? left : right;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingCandidateService(final PairingProperties pairingProperties) {
|
||||
this.pairingProperties = pairingProperties;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
package com.kri.p6.ncrc.pairing.service;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelMapper;
|
||||
import com.kri.common.feature.web.BusinessException;
|
||||
import com.kri.p6.ncrc.pairing.config.PairingProperties;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.ABPairExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.AssignmentResultExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.CandidateSummaryExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.PairingSummaryExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.input.PairingWorkbookData;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.RuleViolationExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.UnassignedCenterExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.UnusedMemberExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.ValidationErrorExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.input.CenterAdjacentRegionExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.input.CenterExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.input.MemberExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.input.MemberRegionCodeExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.input.MunicipalityExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.input.PreferenceMatchExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.model.PairingResult;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import lombok.Generated;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.ss.usermodel.WorkbookFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@Service
|
||||
public class PairingExcelService {
|
||||
private final PairingProperties pairingProperties;
|
||||
|
||||
public PairingWorkbookData read(MultipartFile file) {
|
||||
if (file != null && !file.isEmpty()) {
|
||||
try {
|
||||
InputStream inputStream = file.getInputStream();
|
||||
|
||||
PairingWorkbookData var4;
|
||||
try {
|
||||
Workbook workbook = WorkbookFactory.create(inputStream);
|
||||
|
||||
try {
|
||||
var4 = PairingWorkbookData.builder().members(this.readSheet(workbook, MemberExcelDto.class, "위원정보")).municipalities(this.readSheet(workbook, MunicipalityExcelDto.class, "지자체 정보")).centers(this.readSheet(workbook, CenterExcelDto.class, "센터정보")).memberRegionCodes(this.readSheet(workbook, MemberRegionCodeExcelDto.class, "위원 지역 코드표")).centerAdjacentRegions(this.readSheet(workbook, CenterAdjacentRegionExcelDto.class, "센터 인접지역표")).preferenceMatchRules(this.readSheet(workbook, PreferenceMatchExcelDto.class, "희망지역 매칭표")).build();
|
||||
} catch (Throwable var8) {
|
||||
if (workbook != null) {
|
||||
try {
|
||||
workbook.close();
|
||||
} catch (Throwable var7) {
|
||||
var8.addSuppressed(var7);
|
||||
}
|
||||
}
|
||||
|
||||
throw var8;
|
||||
}
|
||||
|
||||
if (workbook != null) {
|
||||
workbook.close();
|
||||
}
|
||||
} catch (Throwable var9) {
|
||||
if (inputStream != null) {
|
||||
try {
|
||||
inputStream.close();
|
||||
} catch (Throwable var6) {
|
||||
var9.addSuppressed(var6);
|
||||
}
|
||||
}
|
||||
|
||||
throw var9;
|
||||
}
|
||||
|
||||
if (inputStream != null) {
|
||||
inputStream.close();
|
||||
}
|
||||
|
||||
return var4;
|
||||
} catch (BusinessException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
throw BusinessException.badRequest("PAIRING_EXCEL_READ_FAILED", "엑셀 파일을 읽는 중 오류가 발생했습니다: " + e.getMessage());
|
||||
}
|
||||
} else {
|
||||
throw BusinessException.badRequest("PAIRING_EMPTY_FILE", "업로드된 엑셀 파일이 없습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] write(PairingResult result) {
|
||||
try {
|
||||
Workbook workbook = ExcelMapper.writeToWorkbook(result.getAssignments(), AssignmentResultExcelDto.class, "배정결과");
|
||||
|
||||
byte[] var4;
|
||||
try {
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
|
||||
try {
|
||||
ExcelMapper.appendSheetToWorkbook(workbook, result.getUnassignedCenters(), UnassignedCenterExcelDto.class, "미배정센터", this.headerRowIndex());
|
||||
ExcelMapper.appendSheetToWorkbook(workbook, result.getUnusedMembers(), UnusedMemberExcelDto.class, "미사용위원", this.headerRowIndex());
|
||||
ExcelMapper.appendSheetToWorkbook(workbook, result.getSummaries(), PairingSummaryExcelDto.class, "처리요약", this.headerRowIndex());
|
||||
ExcelMapper.appendSheetToWorkbook(workbook, result.getAbPairs(), ABPairExcelDto.class, "AB페어목록", this.headerRowIndex());
|
||||
ExcelMapper.appendSheetToWorkbook(workbook, result.getCandidateSummaries(), CandidateSummaryExcelDto.class, "후보요약", this.headerRowIndex());
|
||||
ExcelMapper.appendSheetToWorkbook(workbook, result.getValidationErrors(), ValidationErrorExcelDto.class, "검증오류", this.headerRowIndex());
|
||||
ExcelMapper.appendSheetToWorkbook(workbook, result.getRuleViolations(), RuleViolationExcelDto.class, "규칙위반검사", this.headerRowIndex());
|
||||
workbook.write(outputStream);
|
||||
var4 = outputStream.toByteArray();
|
||||
} catch (Throwable var8) {
|
||||
try {
|
||||
outputStream.close();
|
||||
} catch (Throwable var7) {
|
||||
var8.addSuppressed(var7);
|
||||
}
|
||||
|
||||
throw var8;
|
||||
}
|
||||
|
||||
outputStream.close();
|
||||
} catch (Throwable var9) {
|
||||
if (workbook != null) {
|
||||
try {
|
||||
workbook.close();
|
||||
} catch (Throwable var6) {
|
||||
var9.addSuppressed(var6);
|
||||
}
|
||||
}
|
||||
|
||||
throw var9;
|
||||
}
|
||||
|
||||
if (workbook != null) {
|
||||
workbook.close();
|
||||
}
|
||||
|
||||
return var4;
|
||||
} catch (IOException e) {
|
||||
throw BusinessException.badRequest("PAIRING_EXCEL_WRITE_FAILED", "결과 엑셀 파일을 생성하는 중 오류가 발생했습니다: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] writeValidationError(String code, String message) {
|
||||
PairingResult result = PairingResult.builder().assignments(List.of()).unassignedCenters(List.of()).unusedMembers(List.of()).summaries(List.of(new PairingSummaryExcelDto("처리 상태", "검증 실패"))).abPairs(List.of()).candidateSummaries(List.of()).validationErrors(List.of(new ValidationErrorExcelDto(code, message, "ERROR"))).ruleViolations(List.of()).build();
|
||||
return this.write(result);
|
||||
}
|
||||
|
||||
private <T> List<T> readSheet(Workbook workbook, Class<T> type, String sheetName) {
|
||||
if (workbook.getSheet(sheetName) == null) {
|
||||
throw BusinessException.badRequest("PAIRING_REQUIRED_SHEET_MISSING", "필수 시트가 없습니다: " + sheetName);
|
||||
} else {
|
||||
return ExcelMapper.readFromWorkbook(workbook, type, sheetName, this.headerRowIndex()).stream().filter((row) -> !this.isBlankRow(row)).toList();
|
||||
}
|
||||
}
|
||||
|
||||
private int headerRowIndex() {
|
||||
return this.pairingProperties.getExcel().getHeaderRowIndex();
|
||||
}
|
||||
|
||||
private boolean isBlankRow(Object row) {
|
||||
return Arrays.stream(row.getClass().getDeclaredFields()).allMatch((field) -> this.isBlankField(row, field));
|
||||
}
|
||||
|
||||
private boolean isBlankField(Object row, Field field) {
|
||||
try {
|
||||
field.setAccessible(true);
|
||||
Object value = field.get(row);
|
||||
return value == null || value.toString().trim().isBlank();
|
||||
} catch (IllegalAccessException e) {
|
||||
throw BusinessException.badRequest("PAIRING_EXCEL_READ_FAILED", "엑셀 행을 확인하는 중 오류가 발생했습니다: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingExcelService(final PairingProperties pairingProperties) {
|
||||
this.pairingProperties = pairingProperties;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.kri.p6.ncrc.pairing.service;
|
||||
|
||||
import com.kri.p6.ncrc.pairing.common.cache.DatagoHolidayCache;
|
||||
import com.kri.p6.ncrc.pairing.common.external.datago.HolidayDto;
|
||||
import com.kri.p6.ncrc.pairing.model.PairingData;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.Generated;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class PairingHolidayService {
|
||||
private static final DateTimeFormatter DATAGO_DATE_FORMAT = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||
private final DatagoHolidayCache datagoHolidayCache;
|
||||
|
||||
public PairingData applyHolidayUnavailableDates(PairingData data) {
|
||||
Set<String> years = this.collectYears(data);
|
||||
Set<LocalDate> holidays = this.datagoHolidayCache.getHolidays(years).stream().map(this::toHolidayDate).collect(Collectors.toSet());
|
||||
return PairingData.builder().members(data.getMembers()).municipalities(data.getMunicipalities()).centers(data.getCenters()).memberRegionCodes(data.getMemberRegionCodes()).centerAdjacentRegions(data.getCenterAdjacentRegions()).preferenceMatchRules(data.getPreferenceMatchRules()).commonUnavailableDates(holidays).build();
|
||||
}
|
||||
|
||||
private Set<String> collectYears(PairingData data) {
|
||||
Set<String> years = new HashSet();
|
||||
data.getMembers().forEach((member) -> this.addYears(years, member.getAvailableStartDate(), member.getAvailableEndDate()));
|
||||
data.getMunicipalities().forEach((municipality) -> this.addYears(years, municipality.getAvailableStartDate(), municipality.getAvailableEndDate()));
|
||||
data.getCenters().forEach((center) -> this.addYears(years, center.getAvailableStartDate(), center.getAvailableEndDate()));
|
||||
return years;
|
||||
}
|
||||
|
||||
private void addYears(Set<String> years, LocalDate startDate, LocalDate endDate) {
|
||||
for(int year = startDate.getYear(); year <= endDate.getYear(); ++year) {
|
||||
years.add(String.valueOf(year));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private LocalDate toHolidayDate(HolidayDto holidayDto) {
|
||||
return LocalDate.parse(holidayDto.getHolidayDate(), DATAGO_DATE_FORMAT);
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingHolidayService(final DatagoHolidayCache datagoHolidayCache) {
|
||||
this.datagoHolidayCache = datagoHolidayCache;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
package com.kri.p6.ncrc.pairing.service;
|
||||
|
||||
import com.kri.common.feature.web.BusinessException;
|
||||
import com.kri.p6.ncrc.pairing.config.PairingProperties;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.input.PairingWorkbookData;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.input.CenterAdjacentRegionExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.input.CenterExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.input.MemberExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.input.MemberRegionCodeExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.input.MunicipalityExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.input.PreferenceMatchExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.model.Center;
|
||||
import com.kri.p6.ncrc.pairing.model.CenterAdjacentRegion;
|
||||
import com.kri.p6.ncrc.pairing.common.enums.ExperienceType;
|
||||
import com.kri.p6.ncrc.pairing.common.enums.Gender;
|
||||
import com.kri.p6.ncrc.pairing.model.Member;
|
||||
import com.kri.p6.ncrc.pairing.model.MemberRegionCode;
|
||||
import com.kri.p6.ncrc.pairing.common.enums.MemberRole;
|
||||
import com.kri.p6.ncrc.pairing.model.Municipality;
|
||||
import com.kri.p6.ncrc.pairing.model.PairingData;
|
||||
import com.kri.p6.ncrc.pairing.model.PreferenceMatchRule;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.Generated;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class PairingNormalizeService {
|
||||
private final PairingProperties pairingProperties;
|
||||
|
||||
public PairingData normalize(PairingWorkbookData workbookData) {
|
||||
return PairingData.builder().members(workbookData.getMembers().stream().map(this::toMember).toList()).municipalities(workbookData.getMunicipalities().stream().map(this::toMunicipality).toList()).centers(workbookData.getCenters().stream().map(this::toCenter).toList()).memberRegionCodes(workbookData.getMemberRegionCodes().stream().map(this::toMemberRegionCode).toList()).centerAdjacentRegions(workbookData.getCenterAdjacentRegions().stream().map(this::toCenterAdjacentRegion).toList()).preferenceMatchRules(workbookData.getPreferenceMatchRules().stream().map(this::toPreferenceMatchRule).toList()).commonUnavailableDates(Set.of()).build();
|
||||
}
|
||||
|
||||
private Member toMember(MemberExcelDto row) {
|
||||
return Member.builder().id(this.required(row.getId(), "위원 id")).gender(this.parseGender(row.getGender())).experienceType(this.parseExperienceType(row.getExperience())).role(this.parseMemberRole(row.getRole())).availableStartDate(this.parseDate(row.getAvailableStartDate(), "위원 진행 시작일")).availableEndDate(this.parseDate(row.getAvailableEndDate(), "위원 진행 종료일")).unavailableDates(this.parseDateSet(row.getUnavailableDates(), "위원 진행 불가 일자")).activityRegion(this.normalizeCode(row.getActivityRegion(), this.regionCodeLength(), "위원 활동지역")).historyCenterIds(this.parseCsv(row.getHistoryCenters())).residenceCode(this.normalizeCode(row.getResidenceCode(), this.residenceCodeLength(), "위원 거주지")).preferenceRegions(this.normalizePreferenceRegions(row)).build();
|
||||
}
|
||||
|
||||
private Municipality toMunicipality(MunicipalityExcelDto row) {
|
||||
return Municipality.builder().id(this.required(row.getId(), "지자체 id")).availableStartDate(this.parseDate(row.getAvailableStartDate(), "지자체 진행 시작일")).availableEndDate(this.parseDate(row.getAvailableEndDate(), "지자체 진행 종료일")).unavailableDates(this.parseDateSet(row.getUnavailableDates(), "지자체 진행 불가 일자")).build();
|
||||
}
|
||||
|
||||
private Center toCenter(CenterExcelDto row) {
|
||||
return Center.builder().id(this.required(row.getId(), "센터 id")).municipalityId(this.required(row.getMunicipalityId(), "센터 지자체 id")).womenOnly(this.parseBooleanFlag(row.getWomenOnly(), "센터 여성 위원만")).adjacentRegionClassification(this.required(row.getAdjacentRegionClassification(), "센터 인접지역 분류")).availableStartDate(this.parseDate(row.getAvailableStartDate(), "센터 진행 시작일")).availableEndDate(this.parseDate(row.getAvailableEndDate(), "센터 진행 종료일")).unavailableDates(this.parseDateSet(row.getUnavailableDates(), "센터 진행 불가 일자")).build();
|
||||
}
|
||||
|
||||
private MemberRegionCode toMemberRegionCode(MemberRegionCodeExcelDto row) {
|
||||
String regionCode = this.normalizeCode(row.getRegionCode(), this.regionCodeLength(), "권역코드");
|
||||
String detailRegionCode = this.normalizeCode(row.getDetailRegionCode(), 1, "세부권역코드");
|
||||
String detailAreaCode = this.normalizeCode(row.getDetailAreaCode(), 2, "세부지역코드");
|
||||
return MemberRegionCode.builder().sido(this.clean(row.getSido())).sigungu(this.clean(row.getSigungu())).regionCode(regionCode).detailRegionCode(detailRegionCode).detailAreaCode(detailAreaCode).fullRegionCode(this.normalizeFullRegionCode(row.getFullRegionCode(), regionCode, detailRegionCode, detailAreaCode)).build();
|
||||
}
|
||||
|
||||
private CenterAdjacentRegion toCenterAdjacentRegion(CenterAdjacentRegionExcelDto row) {
|
||||
return CenterAdjacentRegion.builder().dispatchRegion(this.normalizeCode(row.getDispatchRegion(), this.regionCodeLength(), "센터 인접지역표 권역")).adjacentRegionClassification(this.required(row.getAdjacentRegionClassification(), "인접지역 분류")).build();
|
||||
}
|
||||
|
||||
private PreferenceMatchRule toPreferenceMatchRule(PreferenceMatchExcelDto row) {
|
||||
return PreferenceMatchRule.builder().priority(this.parseInt(row.getPriority(), "매칭 순위")).fieldMemberPreferenceRank(this.parseInt(row.getFieldMemberPreferenceRank(), "현장위원 선호 순위")).externalMemberPreferenceRank(this.parseInt(row.getExternalMemberPreferenceRank(), "외부위원 선호 순위")).build();
|
||||
}
|
||||
|
||||
private List<String> normalizePreferenceRegions(MemberExcelDto row) {
|
||||
List<String> preferences = new ArrayList(Arrays.asList(this.normalizeCode(row.getPreferenceRegion1(), this.regionCodeLength(), "선호 지역1"), this.normalizeCode(row.getPreferenceRegion2(), this.regionCodeLength(), "선호 지역2"), this.normalizeCode(row.getPreferenceRegion3(), this.regionCodeLength(), "선호 지역3"), this.normalizeCode(row.getPreferenceRegion4(), this.regionCodeLength(), "선호 지역4")));
|
||||
boolean anyRegionAppeared = false;
|
||||
|
||||
for(int i = 0; i < preferences.size(); ++i) {
|
||||
if (anyRegionAppeared) {
|
||||
preferences.set(i, this.anyRegionCode());
|
||||
} else if (this.anyRegionCode().equals(preferences.get(i))) {
|
||||
anyRegionAppeared = true;
|
||||
}
|
||||
}
|
||||
|
||||
return preferences;
|
||||
}
|
||||
|
||||
private Gender parseGender(String value) {
|
||||
String cleaned = this.required(value, "성별");
|
||||
if ("여".equals(cleaned)) {
|
||||
return Gender.FEMALE;
|
||||
} else if ("남".equals(cleaned)) {
|
||||
return Gender.MALE;
|
||||
} else {
|
||||
throw BusinessException.badRequest("PAIRING_INVALID_GENDER", "성별 값이 올바르지 않습니다: " + value);
|
||||
}
|
||||
}
|
||||
|
||||
private ExperienceType parseExperienceType(String value) {
|
||||
String cleaned = this.required(value, "경력여부");
|
||||
if ("경력".equals(cleaned)) {
|
||||
return ExperienceType.EXPERIENCED;
|
||||
} else if ("신규".equals(cleaned)) {
|
||||
return ExperienceType.NEW;
|
||||
} else {
|
||||
throw BusinessException.badRequest("PAIRING_INVALID_EXPERIENCE", "경력여부 값이 올바르지 않습니다: " + value);
|
||||
}
|
||||
}
|
||||
|
||||
private MemberRole parseMemberRole(String value) {
|
||||
String cleaned = this.required(value, "현장/외부 구분");
|
||||
if ("현장".equals(cleaned)) {
|
||||
return MemberRole.FIELD;
|
||||
} else if ("외부".equals(cleaned)) {
|
||||
return MemberRole.EXTERNAL;
|
||||
} else {
|
||||
throw BusinessException.badRequest("PAIRING_INVALID_MEMBER_ROLE", "현장/외부 구분 값이 올바르지 않습니다: " + value);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean parseBooleanFlag(String value, String fieldName) {
|
||||
String cleaned = this.required(value, fieldName);
|
||||
if ("1".equals(cleaned)) {
|
||||
return true;
|
||||
} else if ("0".equals(cleaned)) {
|
||||
return false;
|
||||
} else {
|
||||
throw BusinessException.badRequest("PAIRING_INVALID_BOOLEAN_FLAG", fieldName + " 값은 0 또는 1이어야 합니다: " + value);
|
||||
}
|
||||
}
|
||||
|
||||
private LocalDate parseDate(String value, String fieldName) {
|
||||
String cleaned = this.required(value, fieldName);
|
||||
|
||||
try {
|
||||
return LocalDate.parse(cleaned);
|
||||
} catch (DateTimeParseException var5) {
|
||||
throw BusinessException.badRequest("PAIRING_INVALID_DATE", fieldName + " 날짜 형식이 올바르지 않습니다: " + value);
|
||||
}
|
||||
}
|
||||
|
||||
private Set<LocalDate> parseDateSet(String value, String fieldName) {
|
||||
return (Set)this.parseCsv(value).stream().map((date) -> this.parseDate(date, fieldName)).collect(Collectors.toCollection(LinkedHashSet::new));
|
||||
}
|
||||
|
||||
private Set<String> parseCsv(String value) {
|
||||
String cleaned = this.clean(value);
|
||||
return (Set<String>)(cleaned.isBlank() ? new LinkedHashSet() : (Set)Arrays.stream(cleaned.split(",")).map(String::trim).filter((token) -> !token.isBlank()).collect(Collectors.toCollection(LinkedHashSet::new)));
|
||||
}
|
||||
|
||||
private int parseInt(String value, String fieldName) {
|
||||
String cleaned = this.required(value, fieldName);
|
||||
|
||||
try {
|
||||
return Integer.parseInt(cleaned);
|
||||
} catch (NumberFormatException var5) {
|
||||
throw BusinessException.badRequest("PAIRING_INVALID_NUMBER", fieldName + " 숫자 형식이 올바르지 않습니다: " + value);
|
||||
}
|
||||
}
|
||||
|
||||
private String normalizeCode(String value, int length, String fieldName) {
|
||||
String cleaned = this.required(value, fieldName);
|
||||
if (cleaned.endsWith(".0")) {
|
||||
cleaned = cleaned.substring(0, cleaned.length() - 2);
|
||||
}
|
||||
|
||||
if (!cleaned.matches("\\d+")) {
|
||||
throw BusinessException.badRequest("PAIRING_INVALID_CODE", fieldName + " 코드는 숫자만 허용됩니다: " + value);
|
||||
} else if (cleaned.length() > length) {
|
||||
throw BusinessException.badRequest("PAIRING_INVALID_CODE", fieldName + " 코드 길이가 올바르지 않습니다: " + value);
|
||||
} else {
|
||||
return cleaned.length() == length ? cleaned : "0".repeat(length - cleaned.length()) + cleaned;
|
||||
}
|
||||
}
|
||||
|
||||
private String normalizeFullRegionCode(String value, String regionCode, String detailRegionCode, String detailAreaCode) {
|
||||
String cleaned = this.clean(value);
|
||||
return cleaned.matches("\\d+") ? this.normalizeCode(cleaned, 5, "지역 코드") : regionCode + detailRegionCode + detailAreaCode;
|
||||
}
|
||||
|
||||
private String required(String value, String fieldName) {
|
||||
String cleaned = this.clean(value);
|
||||
if (cleaned.isBlank()) {
|
||||
throw BusinessException.badRequest("PAIRING_REQUIRED_VALUE_MISSING", "필수 값이 없습니다: " + fieldName);
|
||||
} else {
|
||||
return cleaned;
|
||||
}
|
||||
}
|
||||
|
||||
private String clean(String value) {
|
||||
return value == null ? "" : value.trim();
|
||||
}
|
||||
|
||||
private int regionCodeLength() {
|
||||
return this.pairingProperties.getCode().getRegionCodeLength();
|
||||
}
|
||||
|
||||
private int residenceCodeLength() {
|
||||
return this.pairingProperties.getCode().getResidenceCodeLength();
|
||||
}
|
||||
|
||||
private String anyRegionCode() {
|
||||
return this.pairingProperties.getCode().getAnyRegionCode();
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingNormalizeService(final PairingProperties pairingProperties) {
|
||||
this.pairingProperties = pairingProperties;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.kri.p6.ncrc.pairing.service;
|
||||
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.input.PairingWorkbookData;
|
||||
import com.kri.p6.ncrc.pairing.model.PairingCandidates;
|
||||
import com.kri.p6.ncrc.pairing.model.PairingData;
|
||||
import com.kri.p6.ncrc.pairing.model.PairingResult;
|
||||
import lombok.Generated;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@Service
|
||||
public class PairingService {
|
||||
private final PairingExcelService pairingExcelService;
|
||||
private final PairingNormalizeService pairingNormalizeService;
|
||||
private final PairingHolidayService pairingHolidayService;
|
||||
private final PairingValidationService pairingValidationService;
|
||||
private final PairingCandidateService pairingCandidateService;
|
||||
private final PairingSolverService pairingSolverService;
|
||||
|
||||
public byte[] pairingMemberByCenter(MultipartFile file) {
|
||||
PairingWorkbookData workbookData = this.pairingExcelService.read(file);
|
||||
PairingData pairingData = this.pairingNormalizeService.normalize(workbookData);
|
||||
pairingData = this.pairingHolidayService.applyHolidayUnavailableDates(pairingData);
|
||||
this.pairingValidationService.validate(pairingData);
|
||||
PairingCandidates candidates = this.pairingCandidateService.generate(pairingData);
|
||||
PairingResult result = this.pairingSolverService.solve(pairingData, candidates);
|
||||
return this.pairingExcelService.write(result);
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingService(final PairingExcelService pairingExcelService, final PairingNormalizeService pairingNormalizeService, final PairingHolidayService pairingHolidayService, final PairingValidationService pairingValidationService, final PairingCandidateService pairingCandidateService, final PairingSolverService pairingSolverService) {
|
||||
this.pairingExcelService = pairingExcelService;
|
||||
this.pairingNormalizeService = pairingNormalizeService;
|
||||
this.pairingHolidayService = pairingHolidayService;
|
||||
this.pairingValidationService = pairingValidationService;
|
||||
this.pairingCandidateService = pairingCandidateService;
|
||||
this.pairingSolverService = pairingSolverService;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,466 @@
|
||||
package com.kri.p6.ncrc.pairing.service;
|
||||
|
||||
import com.google.ortools.Loader;
|
||||
import com.google.ortools.sat.BoolVar;
|
||||
import com.google.ortools.sat.CpModel;
|
||||
import com.google.ortools.sat.CpSolver;
|
||||
import com.google.ortools.sat.CpSolverStatus;
|
||||
import com.google.ortools.sat.LinearArgument;
|
||||
import com.google.ortools.sat.LinearExpr;
|
||||
import com.google.ortools.sat.Literal;
|
||||
import com.kri.p6.ncrc.pairing.config.PairingProperties;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.ABPairExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.AssignmentResultExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.CandidateSummaryExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.PairingSummaryExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.RuleViolationExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.UnassignedCenterExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.UnusedMemberExcelDto;
|
||||
import com.kri.p6.ncrc.pairing.model.ABPairMatch;
|
||||
import com.kri.p6.ncrc.pairing.model.AssignmentCandidate;
|
||||
import com.kri.p6.ncrc.pairing.model.Center;
|
||||
import com.kri.p6.ncrc.pairing.common.enums.ExperienceType;
|
||||
import com.kri.p6.ncrc.pairing.common.enums.Gender;
|
||||
import com.kri.p6.ncrc.pairing.model.Member;
|
||||
import com.kri.p6.ncrc.pairing.model.PairingCandidates;
|
||||
import com.kri.p6.ncrc.pairing.model.PairingData;
|
||||
import com.kri.p6.ncrc.pairing.model.PairingResult;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import lombok.Generated;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class PairingSolverService {
|
||||
private final PairingProperties pairingProperties;
|
||||
|
||||
public PairingResult solve(PairingData data, PairingCandidates candidates) {
|
||||
if (candidates.getAssignmentCandidates().isEmpty()) {
|
||||
return this.emptyResult(data, candidates, "배정 가능한 후보가 없습니다.");
|
||||
} else {
|
||||
CpModel model = new CpModel();
|
||||
List<AssignmentCandidate> assignmentCandidates = candidates.getAssignmentCandidates();
|
||||
BoolVar[] assignmentVars = this.createAssignmentVars(model, assignmentCandidates);
|
||||
Map<String, BoolVar> pairUsedVars = this.createPairUsedVars(model, assignmentCandidates);
|
||||
Map<String, BoolVar> pairDayVars = this.createPairDayVars(model, assignmentCandidates);
|
||||
Map<String, BoolVar> pairDayAdjacentVars = this.createPairDayAdjacentVars(model, assignmentCandidates);
|
||||
this.linkHelperVars(model, assignmentCandidates, assignmentVars, pairUsedVars, pairDayVars, pairDayAdjacentVars);
|
||||
this.addCenterAssignedAtMostOnce(model, assignmentCandidates, assignmentVars);
|
||||
this.addPairDailyCapacity(model, assignmentCandidates, assignmentVars);
|
||||
this.addMemberDailyOnePair(model, assignmentCandidates, pairDayVars);
|
||||
this.addPairDailyOneAdjacentClassification(model, assignmentCandidates, pairDayAdjacentVars);
|
||||
this.addBuddyLimit(model, assignmentCandidates, pairUsedVars);
|
||||
model.maximize(this.createObjective(assignmentCandidates, assignmentVars));
|
||||
CpSolver solver = new CpSolver();
|
||||
solver.getParameters().setMaxTimeInSeconds(this.pairingProperties.getSolver().getMaxTimeSeconds());
|
||||
solver.getParameters().setNumSearchWorkers(this.pairingProperties.getSolver().getNumSearchWorkers());
|
||||
CpSolverStatus status = solver.solve(model);
|
||||
if (status != CpSolverStatus.OPTIMAL && status != CpSolverStatus.FEASIBLE) {
|
||||
return this.emptyResult(data, candidates, "solver가 feasible 해를 찾지 못했습니다: " + String.valueOf(status));
|
||||
} else {
|
||||
List<AssignmentCandidate> selectedAssignments = this.collectSelectedAssignments(assignmentCandidates, assignmentVars, solver);
|
||||
return this.toResult(data, candidates, selectedAssignments, status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private BoolVar[] createAssignmentVars(CpModel model, List<AssignmentCandidate> candidates) {
|
||||
BoolVar[] vars = new BoolVar[candidates.size()];
|
||||
|
||||
for(int i = 0; i < candidates.size(); ++i) {
|
||||
AssignmentCandidate candidate = (AssignmentCandidate)candidates.get(i);
|
||||
vars[i] = model.newBoolVar("assign_" + i + "_" + candidate.getCenterId());
|
||||
}
|
||||
|
||||
return vars;
|
||||
}
|
||||
|
||||
private Map<String, BoolVar> createPairUsedVars(CpModel model, List<AssignmentCandidate> candidates) {
|
||||
return (Map)candidates.stream().map(this::pairKey).distinct().collect(Collectors.toMap(Function.identity(), (key) -> model.newBoolVar("pair_used_" + key)));
|
||||
}
|
||||
|
||||
private Map<String, BoolVar> createPairDayVars(CpModel model, List<AssignmentCandidate> candidates) {
|
||||
return (Map)candidates.stream().map(this::pairDayKey).distinct().collect(Collectors.toMap(Function.identity(), (key) -> model.newBoolVar("pair_day_" + key)));
|
||||
}
|
||||
|
||||
private Map<String, BoolVar> createPairDayAdjacentVars(CpModel model, List<AssignmentCandidate> candidates) {
|
||||
return (Map)candidates.stream().map(this::pairDayAdjacentKey).distinct().collect(Collectors.toMap(Function.identity(), (key) -> model.newBoolVar("pair_day_adjacent_" + key)));
|
||||
}
|
||||
|
||||
private void linkHelperVars(CpModel model, List<AssignmentCandidate> candidates, BoolVar[] assignmentVars, Map<String, BoolVar> pairUsedVars, Map<String, BoolVar> pairDayVars, Map<String, BoolVar> pairDayAdjacentVars) {
|
||||
for(int i = 0; i < candidates.size(); ++i) {
|
||||
AssignmentCandidate candidate = (AssignmentCandidate)candidates.get(i);
|
||||
model.addLessOrEqual(assignmentVars[i], (LinearArgument)pairUsedVars.get(this.pairKey(candidate)));
|
||||
model.addLessOrEqual(assignmentVars[i], (LinearArgument)pairDayVars.get(this.pairDayKey(candidate)));
|
||||
model.addLessOrEqual(assignmentVars[i], (LinearArgument)pairDayAdjacentVars.get(this.pairDayAdjacentKey(candidate)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void addCenterAssignedAtMostOnce(CpModel model, List<AssignmentCandidate> candidates, BoolVar[] assignmentVars) {
|
||||
Map<String, List<Integer>> indexesByCenter = this.groupIndexes(candidates, AssignmentCandidate::getCenterId);
|
||||
indexesByCenter.values().forEach((indexes) -> model.addAtMostOne(this.toLiteralArray(indexes, assignmentVars)));
|
||||
}
|
||||
|
||||
private void addPairDailyCapacity(CpModel model, List<AssignmentCandidate> candidates, BoolVar[] assignmentVars) {
|
||||
Map<String, List<Integer>> indexesByPairDay = this.groupIndexes(candidates, this::pairDayKey);
|
||||
indexesByPairDay.values().forEach((indexes) -> model.addLessOrEqual(LinearExpr.sum(this.toLinearArgumentArray(indexes, assignmentVars)), (long)this.pairingProperties.getRule().getMaxCentersPerPairPerDay()));
|
||||
}
|
||||
|
||||
private void addMemberDailyOnePair(CpModel model, List<AssignmentCandidate> candidates, Map<String, BoolVar> pairDayVars) {
|
||||
Map<String, Set<String>> pairDayKeysByMemberDay = (Map)candidates.stream().collect(Collectors.groupingBy((candidate) -> {
|
||||
String var10000 = candidate.getFieldMemberId();
|
||||
return var10000 + "|" + String.valueOf(candidate.getDate());
|
||||
}, Collectors.mapping(this::pairDayKey, Collectors.toSet())));
|
||||
Map<String, Set<String>> externalPairDayKeysByMemberDay = candidates.stream().collect(Collectors.groupingBy((candidate) -> {
|
||||
String var10000 = candidate.getExternalMemberId();
|
||||
return var10000 + "|" + String.valueOf(candidate.getDate());
|
||||
}, Collectors.mapping(this::pairDayKey, Collectors.toSet())));
|
||||
externalPairDayKeysByMemberDay.forEach((key, value) -> pairDayKeysByMemberDay.merge(key, value, (left, right) -> {
|
||||
left.addAll(right);
|
||||
return left;
|
||||
}));
|
||||
pairDayKeysByMemberDay.values().forEach((pairDayKeys) -> {
|
||||
Stream var10001 = pairDayKeys.stream();
|
||||
Objects.requireNonNull(pairDayVars);
|
||||
model.addAtMostOne((Literal[])var10001.map(pairDayVars::get).toArray((x$0) -> new BoolVar[x$0]));
|
||||
});
|
||||
}
|
||||
|
||||
private void addPairDailyOneAdjacentClassification(CpModel model, List<AssignmentCandidate> candidates, Map<String, BoolVar> pairDayAdjacentVars) {
|
||||
Map<String, Set<String>> adjacentKeysByPairDay = (Map)candidates.stream().collect(Collectors.groupingBy(this::pairDayKey, Collectors.mapping(this::pairDayAdjacentKey, Collectors.toSet())));
|
||||
adjacentKeysByPairDay.values().forEach((adjacentKeys) -> {
|
||||
Stream var10001 = adjacentKeys.stream();
|
||||
Objects.requireNonNull(pairDayAdjacentVars);
|
||||
model.addAtMostOne((Literal[])var10001.map(pairDayAdjacentVars::get).toArray((x$0) -> new BoolVar[x$0]));
|
||||
});
|
||||
}
|
||||
|
||||
private void addBuddyLimit(CpModel model, List<AssignmentCandidate> candidates, Map<String, BoolVar> pairUsedVars) {
|
||||
Map<String, Set<String>> pairKeysByMember = (Map)candidates.stream().collect(Collectors.groupingBy(AssignmentCandidate::getFieldMemberId, Collectors.mapping(this::pairKey, Collectors.toSet())));
|
||||
Map<String, Set<String>> externalPairKeysByMember = candidates.stream().collect(Collectors.groupingBy(AssignmentCandidate::getExternalMemberId, Collectors.mapping(this::pairKey, Collectors.toSet())));
|
||||
externalPairKeysByMember.forEach((key, value) -> pairKeysByMember.merge(key, value, (left, right) -> {
|
||||
left.addAll(right);
|
||||
return left;
|
||||
}));
|
||||
pairKeysByMember.values().forEach((pairKeys) -> {
|
||||
Stream var10001 = pairKeys.stream();
|
||||
Objects.requireNonNull(pairUsedVars);
|
||||
model.addLessOrEqual(LinearExpr.sum((LinearArgument[])var10001.map(pairUsedVars::get).toArray((x$0) -> new LinearArgument[x$0])), (long)this.pairingProperties.getRule().getMaxCounterpartsPerMember());
|
||||
});
|
||||
}
|
||||
|
||||
private LinearExpr createObjective(List<AssignmentCandidate> candidates, BoolVar[] assignmentVars) {
|
||||
LinearArgument[] vars = new LinearArgument[assignmentVars.length];
|
||||
long[] weights = new long[assignmentVars.length];
|
||||
|
||||
for(int i = 0; i < assignmentVars.length; ++i) {
|
||||
AssignmentCandidate candidate = (AssignmentCandidate)candidates.get(i);
|
||||
vars[i] = assignmentVars[i];
|
||||
weights[i] = this.pairingProperties.getObjective().getAssignmentWeight() + Math.max(0L, this.pairingProperties.getObjective().getPreferenceBaseWeight() - (long)candidate.getPreferencePriority() * this.pairingProperties.getObjective().getPreferenceRankPenalty()) + (long)candidate.getResidenceMatchScore() * this.pairingProperties.getObjective().getResidenceMatchWeight();
|
||||
}
|
||||
|
||||
return LinearExpr.weightedSum(vars, weights);
|
||||
}
|
||||
|
||||
private List<AssignmentCandidate> collectSelectedAssignments(List<AssignmentCandidate> candidates, BoolVar[] assignmentVars, CpSolver solver) {
|
||||
List<AssignmentCandidate> selected = new ArrayList();
|
||||
|
||||
for(int i = 0; i < candidates.size(); ++i) {
|
||||
if (Boolean.TRUE.equals(solver.booleanValue(assignmentVars[i]))) {
|
||||
selected.add((AssignmentCandidate)candidates.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
selected.sort(Comparator.comparing(AssignmentCandidate::getDate).thenComparing(AssignmentCandidate::getFieldMemberId).thenComparing(AssignmentCandidate::getCenterId));
|
||||
return selected;
|
||||
}
|
||||
|
||||
private PairingResult toResult(PairingData data, PairingCandidates candidates, List<AssignmentCandidate> selectedAssignments, CpSolverStatus status) {
|
||||
Set<String> assignedCenterIds = (Set)selectedAssignments.stream().map(AssignmentCandidate::getCenterId).collect(Collectors.toSet());
|
||||
Set<String> usedMemberIds = (Set)selectedAssignments.stream().flatMap((candidate) -> List.of(candidate.getFieldMemberId(), candidate.getExternalMemberId()).stream()).collect(Collectors.toSet());
|
||||
Map<String, Member> memberMap = (Map)data.getMembers().stream().collect(Collectors.toMap(Member::getId, Function.identity(), (left, right) -> left));
|
||||
Map<String, Center> centerMap = (Map)data.getCenters().stream().collect(Collectors.toMap(Center::getId, Function.identity(), (left, right) -> left));
|
||||
ABPairBuildResult abPairBuildResult = this.createABPairMatches(selectedAssignments);
|
||||
Map<String, ABPairMatch> abPairMatches = abPairBuildResult.matches();
|
||||
List<AssignmentResultExcelDto> assignments = selectedAssignments.stream().map((candidate) -> this.toAssignmentResult(candidate, memberMap, centerMap, abPairMatches)).toList();
|
||||
List<UnassignedCenterExcelDto> unassignedCenters = data.getCenters().stream().filter((center) -> !assignedCenterIds.contains(center.getId())).map((center) -> this.toUnassignedCenter(center, candidates.getUnassignedCenterReasons())).toList();
|
||||
List<UnusedMemberExcelDto> unusedMembers = data.getMembers().stream().filter((member) -> !usedMemberIds.contains(member.getId())).map((member) -> new UnusedMemberExcelDto(member.getId(), member.getRole().name(), "선택된 최적해에 포함되지 않았습니다. 후보 부족 또는 제약 충돌 가능")).toList();
|
||||
return PairingResult.builder().assignments(assignments).unassignedCenters(unassignedCenters).unusedMembers(unusedMembers).summaries(this.createSummaries(data, candidates, assignments.size(), unassignedCenters.size(), unusedMembers.size(), this.countABGroups(abPairMatches), status.name())).abPairs(abPairBuildResult.rows()).candidateSummaries(this.createCandidateSummaries(data, candidates, assignments.size(), unassignedCenters.size(), unusedMembers.size(), this.countABGroups(abPairMatches))).validationErrors(List.of()).ruleViolations(this.createRuleChecks(data, selectedAssignments, abPairMatches)).build();
|
||||
}
|
||||
|
||||
private PairingResult emptyResult(PairingData data, PairingCandidates candidates, String reason) {
|
||||
return PairingResult.builder().assignments(List.of()).unassignedCenters(data.getCenters().stream().map((center) -> new UnassignedCenterExcelDto(center.getId(), center.getMunicipalityId(), reason)).toList()).unusedMembers(data.getMembers().stream().map((member) -> new UnusedMemberExcelDto(member.getId(), member.getRole().name(), reason)).toList()).summaries(this.createSummaries(data, candidates, 0, data.getCenters().size(), data.getMembers().size(), 0, reason)).abPairs(List.of()).candidateSummaries(this.createCandidateSummaries(data, candidates, 0, data.getCenters().size(), data.getMembers().size(), 0)).validationErrors(List.of()).ruleViolations(List.of(new RuleViolationExcelDto("solver feasible 해", "FAIL", reason))).build();
|
||||
}
|
||||
|
||||
private AssignmentResultExcelDto toAssignmentResult(AssignmentCandidate candidate, Map<String, Member> memberMap, Map<String, Center> centerMap, Map<String, ABPairMatch> abPairMatches) {
|
||||
Member fieldMember = (Member)memberMap.get(candidate.getFieldMemberId());
|
||||
Member externalMember = (Member)memberMap.get(candidate.getExternalMemberId());
|
||||
Center center = (Center)centerMap.get(candidate.getCenterId());
|
||||
ABPairMatch abPairMatch = (ABPairMatch)abPairMatches.get(this.pairKey(candidate));
|
||||
return new AssignmentResultExcelDto(candidate.getDate().toString(), candidate.getFieldMemberId(), this.formatGender(fieldMember.getGender()), this.formatExperience(fieldMember.getExperienceType()), fieldMember.getResidenceCode(), fieldMember.getActivityRegion(), this.formatPreferenceRank(candidate.getFieldMemberPreferenceRank()), candidate.getExternalMemberId(), this.formatGender(externalMember.getGender()), this.formatExperience(externalMember.getExperienceType()), externalMember.getResidenceCode(), externalMember.getActivityRegion(), this.formatPreferenceRank(candidate.getExternalMemberPreferenceRank()), candidate.getCenterId(), candidate.getMunicipalityId(), center.isWomenOnly() ? "1" : "0", candidate.getDispatchRegion(), candidate.getAdjacentRegionClassification(), String.valueOf(candidate.getPreferencePriority()), abPairMatch == null ? "" : abPairMatch.getGroupId(), abPairMatch == null ? "" : abPairMatch.getCounterpartFieldMemberId(), abPairMatch == null ? "" : abPairMatch.getCounterpartExternalMemberId());
|
||||
}
|
||||
|
||||
private UnassignedCenterExcelDto toUnassignedCenter(Center center, Map<String, Set<String>> reasonMap) {
|
||||
Set<String> reasons = new LinkedHashSet((Collection)(reasonMap == null ? Set.of() : (Collection)reasonMap.getOrDefault(center.getId(), Set.of())));
|
||||
reasons.add("solver 최적해에서 선택되지 않음");
|
||||
return new UnassignedCenterExcelDto(center.getId(), center.getMunicipalityId(), String.join(", ", reasons));
|
||||
}
|
||||
|
||||
private String formatGender(Gender gender) {
|
||||
return gender == Gender.FEMALE ? "여" : "남";
|
||||
}
|
||||
|
||||
private String formatExperience(ExperienceType experienceType) {
|
||||
return experienceType == ExperienceType.EXPERIENCED ? "경력" : "신규";
|
||||
}
|
||||
|
||||
private String formatPreferenceRank(int rank) {
|
||||
if (rank == 0) {
|
||||
return "00";
|
||||
} else {
|
||||
return rank == 99 ? "99" : String.valueOf(rank);
|
||||
}
|
||||
}
|
||||
|
||||
private List<PairingSummaryExcelDto> createSummaries(PairingData data, PairingCandidates candidates, int assignmentCount, int unassignedCenterCount, int unusedMemberCount, int abGroupCount, String status) {
|
||||
return List.of(new PairingSummaryExcelDto("위원 수", String.valueOf(data.getMembers().size())), new PairingSummaryExcelDto("지자체 수", String.valueOf(data.getMunicipalities().size())), new PairingSummaryExcelDto("센터 수", String.valueOf(data.getCenters().size())), new PairingSummaryExcelDto("페어 후보 수", String.valueOf(candidates.getPairCandidates().size())), new PairingSummaryExcelDto("파견 권역 후보 수", String.valueOf(candidates.getDispatchRegionCandidates().size())), new PairingSummaryExcelDto("배정 후보 수", String.valueOf(candidates.getAssignmentCandidates().size())), new PairingSummaryExcelDto("배정 센터 수", String.valueOf(assignmentCount)), new PairingSummaryExcelDto("미배정 센터 수", String.valueOf(unassignedCenterCount)), new PairingSummaryExcelDto("미사용 위원 수", String.valueOf(unusedMemberCount)), new PairingSummaryExcelDto("AB 그룹 수", String.valueOf(abGroupCount)), new PairingSummaryExcelDto("처리 상태", status));
|
||||
}
|
||||
|
||||
private ABPairBuildResult createABPairMatches(List<AssignmentCandidate> selectedAssignments) {
|
||||
Map<String, List<AssignmentCandidate>> assignmentsByPair = selectedAssignments.stream().collect(Collectors.groupingBy(this::pairKey));
|
||||
List<UsedPair> usedPairs = assignmentsByPair.entrySet().stream().map((entry) -> PairingSolverService.UsedPair.of(entry.getKey(), entry.getValue())).sorted(Comparator.comparing(UsedPair::pairKey)).toList();
|
||||
Map<String, ABPairMatch> matches = new HashMap();
|
||||
List<ABPairExcelDto> rows = new ArrayList();
|
||||
Set<String> alreadyMatched = new HashSet();
|
||||
int groupSequence = 1;
|
||||
|
||||
for(UsedPair pair : usedPairs) {
|
||||
if (!alreadyMatched.contains(pair.pairKey())) {
|
||||
UsedPair counterpart = usedPairs.stream()
|
||||
.filter((candidate) -> !alreadyMatched.contains(candidate.pairKey()))
|
||||
.filter((candidate) -> !candidate.pairKey().equals(pair.pairKey()))
|
||||
.filter(pair::canBeABWith)
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
if (counterpart != null) {
|
||||
Object[] var10001 = new Object[]{groupSequence++};
|
||||
String groupId = "AB-" + String.format("%03d", var10001);
|
||||
matches.put(pair.pairKey(), this.toABPairMatch(groupId, pair, counterpart));
|
||||
matches.put(counterpart.pairKey(), this.toABPairMatch(groupId, counterpart, pair));
|
||||
rows.add(this.toABPairRow(groupId, pair, counterpart));
|
||||
alreadyMatched.add(pair.pairKey());
|
||||
alreadyMatched.add(counterpart.pairKey());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new ABPairBuildResult(matches, rows);
|
||||
}
|
||||
|
||||
private ABPairMatch toABPairMatch(String groupId, UsedPair pair, UsedPair counterpart) {
|
||||
return ABPairMatch.builder().groupId(groupId).fieldMemberId(pair.fieldMemberId()).externalMemberId(pair.externalMemberId()).counterpartFieldMemberId(counterpart.fieldMemberId()).counterpartExternalMemberId(counterpart.externalMemberId()).build();
|
||||
}
|
||||
|
||||
private int countABGroups(Map<String, ABPairMatch> matches) {
|
||||
return (int)matches.values().stream().map(ABPairMatch::getGroupId).distinct().count();
|
||||
}
|
||||
|
||||
private ABPairExcelDto toABPairRow(String groupId, UsedPair pair, UsedPair counterpart) {
|
||||
Stream var10000 = pair.dispatchAdjacentKeys().stream();
|
||||
Set var10001 = counterpart.dispatchAdjacentKeys();
|
||||
Objects.requireNonNull(var10001);
|
||||
String sharedKey = (String)var10000.filter(var10001::contains).sorted().findFirst().orElse("|");
|
||||
String[] parts = sharedKey.split("\\|", -1);
|
||||
var10000 = pair.dates().stream();
|
||||
var10001 = counterpart.dates();
|
||||
Objects.requireNonNull(var10001);
|
||||
boolean dateOverlapped = var10000.anyMatch(var10001::contains);
|
||||
return new ABPairExcelDto(groupId, pair.fieldMemberId(), pair.externalMemberId(), counterpart.fieldMemberId(), counterpart.externalMemberId(), parts.length > 0 ? parts[0] : "", parts.length > 1 ? parts[1] : "", this.formatDates(pair.dates()), this.formatDates(counterpart.dates()), dateOverlapped ? "Y" : "N");
|
||||
}
|
||||
|
||||
private List<CandidateSummaryExcelDto> createCandidateSummaries(PairingData data, PairingCandidates candidates, int assignmentCount, int unassignedCenterCount, int unusedMemberCount, int abGroupCount) {
|
||||
long fieldMemberCount = data.getMembers().stream().filter((member) -> member.getRole().name().equals("FIELD")).count();
|
||||
long externalMemberCount = data.getMembers().stream().filter((member) -> member.getRole().name().equals("EXTERNAL")).count();
|
||||
long womenOnlyCenterCount = data.getCenters().stream().filter(Center::isWomenOnly).count();
|
||||
long noCandidateCenterCount = data.getCenters().stream().filter((center) -> candidates.getAssignmentCandidates().stream().noneMatch((candidate) -> candidate.getCenterId().equals(center.getId()))).count();
|
||||
return List.of(new CandidateSummaryExcelDto("전체 위원 수", String.valueOf(data.getMembers().size()), "입력 위원 수"), new CandidateSummaryExcelDto("현장위원 수", String.valueOf(fieldMemberCount), "현장위원 입력 수"), new CandidateSummaryExcelDto("외부위원 수", String.valueOf(externalMemberCount), "외부위원 입력 수"), new CandidateSummaryExcelDto("센터 수", String.valueOf(data.getCenters().size()), "입력 센터 수"), new CandidateSummaryExcelDto("여성 전용 센터 수", String.valueOf(womenOnlyCenterCount), "여성 위원만 가능한 센터 수"), new CandidateSummaryExcelDto("공휴일 수", String.valueOf(this.commonUnavailableDates(data).size()), "배정 제외 공통 불가일자 수"), new CandidateSummaryExcelDto("페어 후보 수", String.valueOf(candidates.getPairCandidates().size()), "현장+외부 조합 후보 수"), new CandidateSummaryExcelDto("파견 권역 후보 수", String.valueOf(candidates.getDispatchRegionCandidates().size()), "페어별 파견 권역 후보 수"), new CandidateSummaryExcelDto("배정 후보 수", String.valueOf(candidates.getAssignmentCandidates().size()), "solver 입력 배정 후보 수"), new CandidateSummaryExcelDto("후보 없는 센터 수", String.valueOf(noCandidateCenterCount), "배정 후보가 하나도 없는 센터 수"), new CandidateSummaryExcelDto("배정 센터 수", String.valueOf(assignmentCount), "최종 배정된 센터 수"), new CandidateSummaryExcelDto("미배정 센터 수", String.valueOf(unassignedCenterCount), "최종 미배정 센터 수"), new CandidateSummaryExcelDto("미사용 위원 수", String.valueOf(unusedMemberCount), "최종 배정에 포함되지 않은 위원 수"), new CandidateSummaryExcelDto("AB 그룹 수", String.valueOf(abGroupCount), "후처리로 구성된 AB 그룹 수"));
|
||||
}
|
||||
|
||||
private List<RuleViolationExcelDto> createRuleChecks(PairingData data, List<AssignmentCandidate> selectedAssignments, Map<String, ABPairMatch> abPairMatches) {
|
||||
Map<String, Member> memberMap = (Map)data.getMembers().stream().collect(Collectors.toMap(Member::getId, Function.identity(), (left, right) -> left));
|
||||
Map<String, Center> centerMap = (Map)data.getCenters().stream().collect(Collectors.toMap(Center::getId, Function.identity(), (left, right) -> left));
|
||||
List<RuleViolationExcelDto> checks = new ArrayList();
|
||||
checks.add(this.checkDuplicate(selectedAssignments.stream().map(AssignmentCandidate::getCenterId).toList(), "한 센터 1회 초과 배정"));
|
||||
checks.add(this.checkMaxGroupCount(selectedAssignments, this::pairDayKey, this.pairingProperties.getRule().getMaxCentersPerPairPerDay(), "한 페어 하루 최대 센터 수"));
|
||||
checks.add(this.checkMemberDateDuplicate(selectedAssignments));
|
||||
checks.add(this.checkPairDayAdjacentClassification(selectedAssignments));
|
||||
checks.add(this.checkWomenOnly(selectedAssignments, memberMap, centerMap));
|
||||
checks.add(this.checkActivityRegion(selectedAssignments, memberMap));
|
||||
checks.add(this.checkHistoryCenter(selectedAssignments, memberMap));
|
||||
checks.add(this.checkHoliday(selectedAssignments, this.commonUnavailableDates(data)));
|
||||
checks.add(this.checkABDateOverlap(abPairMatches));
|
||||
return checks;
|
||||
}
|
||||
|
||||
private RuleViolationExcelDto checkDuplicate(List<String> values, String ruleName) {
|
||||
Set<String> seen = new HashSet();
|
||||
Set<String> duplicates = (Set)values.stream().filter((value) -> !seen.add(value)).collect(Collectors.toCollection(LinkedHashSet::new));
|
||||
return new RuleViolationExcelDto(ruleName, duplicates.isEmpty() ? "PASS" : "FAIL", duplicates.isEmpty() ? "위반 없음" : String.join(", ", duplicates));
|
||||
}
|
||||
|
||||
private RuleViolationExcelDto checkMaxGroupCount(List<AssignmentCandidate> assignments, Function<AssignmentCandidate, String> classifier, int max, String ruleName) {
|
||||
Map<String, Long> countsByKey = assignments.stream().collect(Collectors.groupingBy(classifier, Collectors.counting()));
|
||||
List<String> violations = countsByKey.entrySet().stream().filter((entry) -> entry.getValue() > (long)max).map((entry) -> {
|
||||
String var10000 = entry.getKey();
|
||||
return var10000 + "=" + String.valueOf(entry.getValue());
|
||||
}).toList();
|
||||
return new RuleViolationExcelDto(ruleName, violations.isEmpty() ? "PASS" : "FAIL", violations.isEmpty() ? "위반 없음" : String.join(", ", violations));
|
||||
}
|
||||
|
||||
private RuleViolationExcelDto checkMemberDateDuplicate(List<AssignmentCandidate> assignments) {
|
||||
Map<String, Set<String>> pairKeysByMemberDate = new HashMap();
|
||||
assignments.forEach((candidate) -> {
|
||||
((Set)pairKeysByMemberDate.computeIfAbsent(candidate.getFieldMemberId() + "|" + String.valueOf(candidate.getDate()), (key) -> new HashSet())).add(this.pairKey(candidate));
|
||||
((Set)pairKeysByMemberDate.computeIfAbsent(candidate.getExternalMemberId() + "|" + String.valueOf(candidate.getDate()), (key) -> new HashSet())).add(this.pairKey(candidate));
|
||||
});
|
||||
List<String> violations = pairKeysByMemberDate.entrySet().stream().filter((entry) -> ((Set)entry.getValue()).size() > 1).map((entry) -> {
|
||||
String var10000 = (String)entry.getKey();
|
||||
return var10000 + "=" + String.join("/", (Iterable)entry.getValue());
|
||||
}).toList();
|
||||
return new RuleViolationExcelDto("같은 위원 같은 날짜 중복", violations.isEmpty() ? "PASS" : "FAIL", violations.isEmpty() ? "위반 없음" : String.join(", ", violations));
|
||||
}
|
||||
|
||||
private RuleViolationExcelDto checkPairDayAdjacentClassification(List<AssignmentCandidate> assignments) {
|
||||
Map<String, Set<String>> adjacentClassificationsByPairDay = assignments.stream().collect(Collectors.groupingBy(this::pairDayKey, Collectors.mapping(AssignmentCandidate::getAdjacentRegionClassification, Collectors.toSet())));
|
||||
List<String> violations = adjacentClassificationsByPairDay.entrySet().stream().filter((entry) -> entry.getValue().size() > 1).map((entry) -> {
|
||||
String var10000 = entry.getKey();
|
||||
return var10000 + "=" + String.join("/", entry.getValue());
|
||||
}).toList();
|
||||
return new RuleViolationExcelDto("한 페어 하루 1개 인접지역 분류", violations.isEmpty() ? "PASS" : "FAIL", violations.isEmpty() ? "위반 없음" : String.join(", ", violations));
|
||||
}
|
||||
|
||||
private RuleViolationExcelDto checkWomenOnly(List<AssignmentCandidate> assignments, Map<String, Member> memberMap, Map<String, Center> centerMap) {
|
||||
List<String> violations = assignments.stream().filter((candidate) -> ((Center)centerMap.get(candidate.getCenterId())).isWomenOnly()).filter((candidate) -> ((Member)memberMap.get(candidate.getFieldMemberId())).getGender() != Gender.FEMALE || ((Member)memberMap.get(candidate.getExternalMemberId())).getGender() != Gender.FEMALE).map(AssignmentCandidate::getCenterId).toList();
|
||||
return new RuleViolationExcelDto("여성 전용 센터 조건", violations.isEmpty() ? "PASS" : "FAIL", violations.isEmpty() ? "위반 없음" : String.join(", ", violations));
|
||||
}
|
||||
|
||||
private RuleViolationExcelDto checkActivityRegion(List<AssignmentCandidate> assignments, Map<String, Member> memberMap) {
|
||||
List<String> violations = assignments.stream().filter((candidate) -> candidate.getDispatchRegion().equals(((Member)memberMap.get(candidate.getFieldMemberId())).getActivityRegion()) || candidate.getDispatchRegion().equals(((Member)memberMap.get(candidate.getExternalMemberId())).getActivityRegion())).map((candidate) -> {
|
||||
String var10000 = candidate.getCenterId();
|
||||
return var10000 + ":" + candidate.getDispatchRegion();
|
||||
}).toList();
|
||||
return new RuleViolationExcelDto("활동지역 상피제", violations.isEmpty() ? "PASS" : "FAIL", violations.isEmpty() ? "위반 없음" : String.join(", ", violations));
|
||||
}
|
||||
|
||||
private RuleViolationExcelDto checkHistoryCenter(List<AssignmentCandidate> assignments, Map<String, Member> memberMap) {
|
||||
List<String> violations = assignments.stream().filter((candidate) -> ((Member)memberMap.get(candidate.getFieldMemberId())).getHistoryCenterIds().contains(candidate.getCenterId()) || ((Member)memberMap.get(candidate.getExternalMemberId())).getHistoryCenterIds().contains(candidate.getCenterId())).map(AssignmentCandidate::getCenterId).toList();
|
||||
return new RuleViolationExcelDto("2023년 진행 센터 재배정", violations.isEmpty() ? "PASS" : "FAIL", violations.isEmpty() ? "위반 없음" : String.join(", ", violations));
|
||||
}
|
||||
|
||||
private RuleViolationExcelDto checkHoliday(List<AssignmentCandidate> assignments, Set<LocalDate> holidays) {
|
||||
List<String> violations = assignments.stream().filter((candidate) -> holidays.contains(candidate.getDate())).map((candidate) -> {
|
||||
String var10000 = candidate.getCenterId();
|
||||
return var10000 + ":" + String.valueOf(candidate.getDate());
|
||||
}).toList();
|
||||
return new RuleViolationExcelDto("공휴일 배정", violations.isEmpty() ? "PASS" : "FAIL", violations.isEmpty() ? "위반 없음" : String.join(", ", violations));
|
||||
}
|
||||
|
||||
private RuleViolationExcelDto checkABDateOverlap(Map<String, ABPairMatch> abPairMatches) {
|
||||
return new RuleViolationExcelDto("A/B 페어 날짜 겹침", "PASS", "A/B 그룹은 날짜가 겹치지 않는 페어끼리만 후처리로 생성됩니다.");
|
||||
}
|
||||
|
||||
private String formatDates(Set<LocalDate> dates) {
|
||||
return (String)dates.stream().sorted().map(LocalDate::toString).collect(Collectors.joining(", "));
|
||||
}
|
||||
|
||||
private Set<LocalDate> commonUnavailableDates(PairingData data) {
|
||||
return data.getCommonUnavailableDates() == null ? Set.of() : data.getCommonUnavailableDates();
|
||||
}
|
||||
|
||||
private Map<String, List<Integer>> groupIndexes(List<AssignmentCandidate> candidates, Function<AssignmentCandidate, String> classifier) {
|
||||
Map<String, List<Integer>> grouped = new HashMap();
|
||||
|
||||
for(int i = 0; i < candidates.size(); ++i) {
|
||||
((List)grouped.computeIfAbsent((String)classifier.apply((AssignmentCandidate)candidates.get(i)), (key) -> new ArrayList())).add(i);
|
||||
}
|
||||
|
||||
return grouped;
|
||||
}
|
||||
|
||||
private BoolVar[] toLiteralArray(List<Integer> indexes, BoolVar[] assignmentVars) {
|
||||
return (BoolVar[])indexes.stream().map((index) -> assignmentVars[index]).toArray((x$0) -> new BoolVar[x$0]);
|
||||
}
|
||||
|
||||
private LinearArgument[] toLinearArgumentArray(List<Integer> indexes, BoolVar[] assignmentVars) {
|
||||
return (LinearArgument[])indexes.stream().map((index) -> assignmentVars[index]).toArray((x$0) -> new LinearArgument[x$0]);
|
||||
}
|
||||
|
||||
private String pairKey(AssignmentCandidate candidate) {
|
||||
String var10000 = candidate.getFieldMemberId();
|
||||
return var10000 + "|" + candidate.getExternalMemberId();
|
||||
}
|
||||
|
||||
private String pairDayKey(AssignmentCandidate candidate) {
|
||||
String var10000 = this.pairKey(candidate);
|
||||
return var10000 + "|" + String.valueOf(candidate.getDate());
|
||||
}
|
||||
|
||||
private String pairDayAdjacentKey(AssignmentCandidate candidate) {
|
||||
String var10000 = this.pairDayKey(candidate);
|
||||
return var10000 + "|" + candidate.getAdjacentRegionClassification();
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingSolverService(final PairingProperties pairingProperties) {
|
||||
this.pairingProperties = pairingProperties;
|
||||
}
|
||||
|
||||
static {
|
||||
Loader.loadNativeLibraries();
|
||||
}
|
||||
|
||||
private static record ABPairBuildResult(Map<String, ABPairMatch> matches, List<ABPairExcelDto> rows) {
|
||||
}
|
||||
|
||||
private static record UsedPair(String pairKey, String fieldMemberId, String externalMemberId, Set<LocalDate> dates, Set<String> dispatchAdjacentKeys) {
|
||||
private static UsedPair of(String pairKey, List<AssignmentCandidate> assignments) {
|
||||
AssignmentCandidate first = (AssignmentCandidate)assignments.get(0);
|
||||
return new UsedPair(pairKey, first.getFieldMemberId(), first.getExternalMemberId(), (Set)assignments.stream().map(AssignmentCandidate::getDate).collect(Collectors.toSet()), (Set)assignments.stream().map((candidate) -> {
|
||||
String var10000 = candidate.getDispatchRegion();
|
||||
return var10000 + "|" + candidate.getAdjacentRegionClassification();
|
||||
}).collect(Collectors.toSet()));
|
||||
}
|
||||
|
||||
private boolean canBeABWith(UsedPair other) {
|
||||
Stream var10000 = this.dates.stream();
|
||||
Set var10001 = other.dates;
|
||||
Objects.requireNonNull(var10001);
|
||||
boolean var3;
|
||||
if (var10000.noneMatch(var10001::contains)) {
|
||||
Stream var2 = this.dispatchAdjacentKeys.stream();
|
||||
var10001 = other.dispatchAdjacentKeys;
|
||||
Objects.requireNonNull(var10001);
|
||||
if (var2.anyMatch(var10001::contains) && !Objects.equals(this.fieldMemberId, other.fieldMemberId) && !Objects.equals(this.fieldMemberId, other.externalMemberId) && !Objects.equals(this.externalMemberId, other.fieldMemberId) && !Objects.equals(this.externalMemberId, other.externalMemberId)) {
|
||||
var3 = true;
|
||||
return var3;
|
||||
}
|
||||
}
|
||||
|
||||
var3 = false;
|
||||
return var3;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.kri.p6.ncrc.pairing.service;
|
||||
|
||||
import com.kri.common.feature.web.BusinessException;
|
||||
import com.kri.p6.ncrc.pairing.config.PairingProperties;
|
||||
import com.kri.p6.ncrc.pairing.model.Center;
|
||||
import com.kri.p6.ncrc.pairing.model.Member;
|
||||
import com.kri.p6.ncrc.pairing.model.Municipality;
|
||||
import com.kri.p6.ncrc.pairing.model.PairingData;
|
||||
import com.kri.p6.ncrc.pairing.model.PreferenceMatchRule;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.Generated;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class PairingValidationService {
|
||||
private final PairingProperties pairingProperties;
|
||||
|
||||
public void validate(PairingData data) {
|
||||
this.validateNotEmpty(data);
|
||||
this.validateDateRanges(data);
|
||||
this.validateMunicipalityReferences(data);
|
||||
this.validatePreferenceRules(data);
|
||||
this.validatePreferenceAnyRegionOrder(data);
|
||||
}
|
||||
|
||||
private void validateNotEmpty(PairingData data) {
|
||||
if (data.getMembers().isEmpty()) {
|
||||
throw BusinessException.badRequest("PAIRING_EMPTY_MEMBER", "위원정보 시트에 데이터가 없습니다.");
|
||||
} else if (data.getMunicipalities().isEmpty()) {
|
||||
throw BusinessException.badRequest("PAIRING_EMPTY_MUNICIPALITY", "지자체 정보 시트에 데이터가 없습니다.");
|
||||
} else if (data.getCenters().isEmpty()) {
|
||||
throw BusinessException.badRequest("PAIRING_EMPTY_CENTER", "센터정보 시트에 데이터가 없습니다.");
|
||||
} else if (data.getCenterAdjacentRegions().isEmpty()) {
|
||||
throw BusinessException.badRequest("PAIRING_EMPTY_CENTER_ADJACENT_REGION", "센터 인접지역표 시트에 데이터가 없습니다.");
|
||||
} else if (data.getPreferenceMatchRules().isEmpty()) {
|
||||
throw BusinessException.badRequest("PAIRING_EMPTY_PREFERENCE_MATCH", "희망지역 매칭표 시트에 데이터가 없습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
private void validateDateRanges(PairingData data) {
|
||||
data.getMembers().forEach((member) -> {
|
||||
if (member.getAvailableEndDate().isBefore(member.getAvailableStartDate())) {
|
||||
throw BusinessException.badRequest("PAIRING_INVALID_DATE_RANGE", "위원 종료일이 시작일보다 빠릅니다: " + member.getId());
|
||||
}
|
||||
});
|
||||
data.getMunicipalities().forEach((municipality) -> {
|
||||
if (municipality.getAvailableEndDate().isBefore(municipality.getAvailableStartDate())) {
|
||||
throw BusinessException.badRequest("PAIRING_INVALID_DATE_RANGE", "지자체 종료일이 시작일보다 빠릅니다: " + municipality.getId());
|
||||
}
|
||||
});
|
||||
data.getCenters().forEach((center) -> {
|
||||
if (center.getAvailableEndDate().isBefore(center.getAvailableStartDate())) {
|
||||
throw BusinessException.badRequest("PAIRING_INVALID_DATE_RANGE", "센터 종료일이 시작일보다 빠릅니다: " + center.getId());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void validateMunicipalityReferences(PairingData data) {
|
||||
Map<String, Municipality> municipalities = (Map)data.getMunicipalities().stream().collect(Collectors.toMap(Municipality::getId, Function.identity(), (left, right) -> left));
|
||||
|
||||
for(Center center : data.getCenters()) {
|
||||
if (!municipalities.containsKey(center.getMunicipalityId())) {
|
||||
String var10001 = center.getId();
|
||||
throw BusinessException.badRequest("PAIRING_BROKEN_MUNICIPALITY_REFERENCE", "센터가 존재하지 않는 지자체를 참조합니다. centerId=" + var10001 + ", municipalityId=" + center.getMunicipalityId());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void validatePreferenceRules(PairingData data) {
|
||||
Set<Integer> priorities = new HashSet();
|
||||
|
||||
for(PreferenceMatchRule rule : data.getPreferenceMatchRules()) {
|
||||
if (!priorities.add(rule.getPriority())) {
|
||||
throw BusinessException.badRequest("PAIRING_DUPLICATE_PREFERENCE_PRIORITY", "희망지역 매칭표의 매칭 순위가 중복됩니다: " + rule.getPriority());
|
||||
}
|
||||
|
||||
if (rule.getFieldMemberPreferenceRank() < 0 || rule.getExternalMemberPreferenceRank() < 0) {
|
||||
throw BusinessException.badRequest("PAIRING_INVALID_PREFERENCE_RANK", "희망지역 매칭표의 선호 순위는 0 이상이어야 합니다.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void validatePreferenceAnyRegionOrder(PairingData data) {
|
||||
for(Member member : data.getMembers()) {
|
||||
boolean anyRegionAppeared = false;
|
||||
|
||||
for(String preferenceRegion : member.getPreferenceRegions()) {
|
||||
if (anyRegionAppeared && !this.anyRegionCode().equals(preferenceRegion)) {
|
||||
throw BusinessException.badRequest("PAIRING_INVALID_PREFERENCE_ORDER", "선호지역 00 이후에는 다른 지역이 올 수 없습니다. memberId=" + member.getId());
|
||||
}
|
||||
|
||||
if (this.anyRegionCode().equals(preferenceRegion)) {
|
||||
anyRegionAppeared = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private String anyRegionCode() {
|
||||
return this.pairingProperties.getCode().getAnyRegionCode();
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingValidationService(final PairingProperties pairingProperties) {
|
||||
this.pairingProperties = pairingProperties;
|
||||
}
|
||||
}
|
||||
83
src/main/resources/application.yaml
Normal file
83
src/main/resources/application.yaml
Normal file
@@ -0,0 +1,83 @@
|
||||
server:
|
||||
port: 6111
|
||||
forward-headers-strategy: framework
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: narc-pairing
|
||||
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 50MB
|
||||
max-request-size: 50MB
|
||||
|
||||
logging:
|
||||
file:
|
||||
path: ./logs
|
||||
|
||||
kri:
|
||||
auth:
|
||||
servicekey: "87b95a3967864e032956912cf16b3abfdb548e63d818101600651550f6c5c6c0"
|
||||
|
||||
security:
|
||||
enabled: true
|
||||
public-paths: # 인증 없이 열어둘 URL
|
||||
- /v3/api-docs/**
|
||||
- /swagger-ui.html
|
||||
- /swagger-ui/**
|
||||
- /ping
|
||||
- /api/v1/**
|
||||
|
||||
swagger:
|
||||
enabled: true
|
||||
title: "KRI P6 NCRC Pairing API"
|
||||
description: "KRI P6 아동관리 보장원 조편성 API"
|
||||
version: "v1.0.0"
|
||||
base-package: "com.kri.p6.ncrc.pairing"
|
||||
|
||||
web:
|
||||
enabled: true # 공통 Web 구성 사용 여부 (기본 true)
|
||||
webmvc:
|
||||
enabled: true # 공통 Webmvc 구성 사용 여부 (기본 true)
|
||||
redis:
|
||||
enabled: false # RedisQueueHelper 사용 시 true
|
||||
scheduling:
|
||||
enabled: false # @Scheduled 사용 시 true
|
||||
|
||||
pairing:
|
||||
excel:
|
||||
# ExcelMapper에서 헤더가 위치한 행 번호입니다. 공통 라이브러리 기준 1부터 시작합니다.
|
||||
header-row-index: 1
|
||||
code:
|
||||
# 활동지역, 선호지역, 파견 권역처럼 권역 비교에 사용하는 코드 길이입니다.
|
||||
region-code-length: 2
|
||||
# 위원 거주지 입력 코드 길이입니다.
|
||||
residence-code-length: 5
|
||||
# 거주지 유사도 비교 시 앞에서 몇 자리까지 비교할지 정합니다.
|
||||
residence-match-prefix-length: 3
|
||||
# 선호지역에서 "어디든 가능"을 의미하는 코드입니다.
|
||||
any-region-code: "00"
|
||||
rule:
|
||||
# 한 페어가 하루에 방문할 수 있는 최대 센터 수입니다.
|
||||
max-centers-per-pair-per-day: 3
|
||||
# 한 위원이 전체 기간 동안 가질 수 있는 최대 상대 파트너 수입니다.
|
||||
max-counterparts-per-member: 2
|
||||
preference:
|
||||
# 선호지역 00(anywhere)을 희망지역 매칭표에서 표현하는 rank 값입니다.
|
||||
anywhere-rank: 0
|
||||
# 희망지역 매칭표에서 해당 위원의 선호지역을 고려하지 않는 wildcard rank 값입니다.
|
||||
ignored-rank: 99
|
||||
objective:
|
||||
# 센터 1개를 배정했을 때 부여하는 최우선 점수입니다. 다른 soft score 총합보다 충분히 커야 합니다.
|
||||
assignment-weight: 1000000
|
||||
# 희망지역 매칭 순위 점수의 기준값입니다. 값이 클수록 선호지역 품질 영향이 커집니다.
|
||||
preference-base-weight: 1000
|
||||
# 매칭 순위가 1 내려갈 때마다 차감하는 점수입니다. 값이 클수록 낮은 순위를 더 강하게 불리하게 봅니다.
|
||||
preference-rank-penalty: 10
|
||||
# 거주지 prefix가 일치하는 페어에 부여하는 점수입니다. 값이 클수록 거주지 유사도를 더 중요하게 봅니다.
|
||||
residence-match-weight: 10000
|
||||
solver:
|
||||
# OR-Tools CP-SAT solver가 한 요청에서 탐색할 최대 시간(초)입니다.
|
||||
max-time-seconds: 30.0
|
||||
# OR-Tools CP-SAT 병렬 탐색 worker 수입니다. 서버 CPU 상황에 맞춰 조정합니다.
|
||||
num-search-workers: 15
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.kri.p6.ncrc.pairing;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest
|
||||
class NcrcPairingApplicationTests {
|
||||
@Test
|
||||
void contextLoads() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.kri.p6.ncrc.pairing.service;
|
||||
|
||||
import com.kri.p6.ncrc.pairing.model.Center;
|
||||
import com.kri.p6.ncrc.pairing.model.CenterAdjacentRegion;
|
||||
import com.kri.p6.ncrc.pairing.common.enums.ExperienceType;
|
||||
import com.kri.p6.ncrc.pairing.common.enums.Gender;
|
||||
import com.kri.p6.ncrc.pairing.model.Member;
|
||||
import com.kri.p6.ncrc.pairing.common.enums.MemberRole;
|
||||
import com.kri.p6.ncrc.pairing.model.Municipality;
|
||||
import com.kri.p6.ncrc.pairing.model.PairingCandidates;
|
||||
import com.kri.p6.ncrc.pairing.model.PairingData;
|
||||
import com.kri.p6.ncrc.pairing.model.PreferenceMatchRule;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class PairingCandidateServiceTest {
|
||||
private final PairingCandidateService service = new PairingCandidateService(PairingTestSupport.pairingProperties());
|
||||
|
||||
@Test
|
||||
void generateExcludesNewNewPair() {
|
||||
PairingCandidates candidates = this.service.generate(this.baseData(this.member("field", MemberRole.FIELD, Gender.FEMALE, ExperienceType.NEW, "02", Set.of()), this.member("external", MemberRole.EXTERNAL, Gender.FEMALE, ExperienceType.NEW, "03", Set.of()), this.center("center", false)));
|
||||
Assertions.assertThat(candidates.getPairCandidates()).isEmpty();
|
||||
Assertions.assertThat(candidates.getAssignmentCandidates()).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
void generateExcludesConflictDispatchRegion() {
|
||||
PairingCandidates candidates = this.service.generate(this.baseData(this.member("field", MemberRole.FIELD, Gender.FEMALE, ExperienceType.EXPERIENCED, "01", Set.of()), this.member("external", MemberRole.EXTERNAL, Gender.FEMALE, ExperienceType.EXPERIENCED, "03", Set.of()), this.center("center", false)));
|
||||
Assertions.assertThat(candidates.getPairCandidates()).hasSize(1);
|
||||
Assertions.assertThat(candidates.getDispatchRegionCandidates()).isEmpty();
|
||||
Assertions.assertThat(candidates.getAssignmentCandidates()).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
void generateAllowsWomenOnlyCenterOnlyForFemalePair() {
|
||||
PairingCandidates maleIncluded = this.service.generate(this.baseData(this.member("field", MemberRole.FIELD, Gender.FEMALE, ExperienceType.EXPERIENCED, "02", Set.of()), this.member("external", MemberRole.EXTERNAL, Gender.MALE, ExperienceType.EXPERIENCED, "03", Set.of()), this.center("center", true)));
|
||||
PairingCandidates femaleOnly = this.service.generate(this.baseData(this.member("field", MemberRole.FIELD, Gender.FEMALE, ExperienceType.EXPERIENCED, "02", Set.of()), this.member("external", MemberRole.EXTERNAL, Gender.FEMALE, ExperienceType.EXPERIENCED, "03", Set.of()), this.center("center", true)));
|
||||
Assertions.assertThat(maleIncluded.getAssignmentCandidates()).isEmpty();
|
||||
Assertions.assertThat(femaleOnly.getAssignmentCandidates()).hasSize(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
void generateExcludesHistoryCenter() {
|
||||
PairingCandidates candidates = this.service.generate(this.baseData(this.member("field", MemberRole.FIELD, Gender.FEMALE, ExperienceType.EXPERIENCED, "02", Set.of("center")), this.member("external", MemberRole.EXTERNAL, Gender.FEMALE, ExperienceType.EXPERIENCED, "03", Set.of()), this.center("center", false)));
|
||||
Assertions.assertThat(candidates.getAssignmentCandidates()).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
void generateTreatsPreferenceRank99AsIgnored() {
|
||||
PairingData data = PairingData.builder().members(List.of(this.member("field", MemberRole.FIELD, Gender.FEMALE, ExperienceType.EXPERIENCED, "02", Set.of()), this.member("external", MemberRole.EXTERNAL, Gender.FEMALE, ExperienceType.EXPERIENCED, "03", Set.of()))).municipalities(List.of(Municipality.builder().id("municipality").availableStartDate(LocalDate.of(2026, 5, 1)).availableEndDate(LocalDate.of(2026, 5, 3)).unavailableDates(Set.of()).build())).centers(List.of(this.center("center", false))).memberRegionCodes(List.of()).centerAdjacentRegions(List.of(CenterAdjacentRegion.builder().dispatchRegion("01").adjacentRegionClassification("A").build())).preferenceMatchRules(List.of(PreferenceMatchRule.builder().priority(1).fieldMemberPreferenceRank(1).externalMemberPreferenceRank(99).build())).commonUnavailableDates(Set.of()).build();
|
||||
PairingCandidates candidates = this.service.generate(data);
|
||||
Assertions.assertThat(candidates.getDispatchRegionCandidates()).hasSize(1);
|
||||
Assertions.assertThat(candidates.getAssignmentCandidates()).hasSize(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
void generateExcludesCommonHolidayDates() {
|
||||
PairingData data = this.baseData(this.member("field", MemberRole.FIELD, Gender.FEMALE, ExperienceType.EXPERIENCED, "02", Set.of()), this.member("external", MemberRole.EXTERNAL, Gender.FEMALE, ExperienceType.EXPERIENCED, "03", Set.of()), Center.builder().id("center").municipalityId("municipality").womenOnly(false).adjacentRegionClassification("A").availableStartDate(LocalDate.of(2026, 5, 1)).availableEndDate(LocalDate.of(2026, 5, 1)).unavailableDates(Set.of()).build());
|
||||
data = PairingData.builder().members(data.getMembers()).municipalities(data.getMunicipalities()).centers(data.getCenters()).memberRegionCodes(data.getMemberRegionCodes()).centerAdjacentRegions(data.getCenterAdjacentRegions()).preferenceMatchRules(data.getPreferenceMatchRules()).commonUnavailableDates(Set.of(LocalDate.of(2026, 5, 1))).build();
|
||||
PairingCandidates candidates = this.service.generate(data);
|
||||
Assertions.assertThat(candidates.getAssignmentCandidates()).isEmpty();
|
||||
Assertions.assertThat((Collection)candidates.getUnassignedCenterReasons().get("center")).contains(new String[]{"위원/지자체/센터 일정 또는 국공휴일 조건 불일치"});
|
||||
}
|
||||
|
||||
private PairingData baseData(Member fieldMember, Member externalMember, Center center) {
|
||||
return PairingData.builder().members(List.of(fieldMember, externalMember)).municipalities(List.of(Municipality.builder().id("municipality").availableStartDate(LocalDate.of(2026, 5, 1)).availableEndDate(LocalDate.of(2026, 5, 3)).unavailableDates(Set.of()).build())).centers(List.of(center)).memberRegionCodes(List.of()).centerAdjacentRegions(List.of(CenterAdjacentRegion.builder().dispatchRegion("01").adjacentRegionClassification("A").build())).preferenceMatchRules(List.of(PreferenceMatchRule.builder().priority(1).fieldMemberPreferenceRank(1).externalMemberPreferenceRank(1).build())).commonUnavailableDates(Set.of()).build();
|
||||
}
|
||||
|
||||
private Member member(String id, MemberRole role, Gender gender, ExperienceType experienceType, String activityRegion, Set<String> historyCenterIds) {
|
||||
return Member.builder().id(id).gender(gender).experienceType(experienceType).role(role).availableStartDate(LocalDate.of(2026, 5, 1)).availableEndDate(LocalDate.of(2026, 5, 3)).unavailableDates(Set.of()).activityRegion(activityRegion).historyCenterIds(historyCenterIds).residenceCode("01101").preferenceRegions(List.of("01", "00", "00", "00")).build();
|
||||
}
|
||||
|
||||
private Center center(String id, boolean womenOnly) {
|
||||
return Center.builder().id(id).municipalityId("municipality").womenOnly(womenOnly).adjacentRegionClassification("A").availableStartDate(LocalDate.of(2026, 5, 1)).availableEndDate(LocalDate.of(2026, 5, 3)).unavailableDates(Set.of()).build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.kri.p6.ncrc.pairing.service;
|
||||
|
||||
import com.kri.p6.ncrc.pairing.dto.PairingWorkbookData;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
|
||||
class PairingExcelServiceTest {
|
||||
private final PairingExcelService pairingExcelService = new PairingExcelService(PairingTestSupport.pairingProperties());
|
||||
|
||||
@Test
|
||||
void readSampleWorkbook() throws IOException {
|
||||
InputStream inputStream = this.getClass().getResourceAsStream("/sample/기초 data dummy.xlsx");
|
||||
|
||||
try {
|
||||
MockMultipartFile file = new MockMultipartFile("file", "기초 data dummy.xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", inputStream);
|
||||
PairingWorkbookData data = this.pairingExcelService.read(file);
|
||||
Assertions.assertThat(data.getMembers()).isNotEmpty();
|
||||
Assertions.assertThat(data.getMunicipalities()).isNotEmpty();
|
||||
Assertions.assertThat(data.getCenters()).isNotEmpty();
|
||||
Assertions.assertThat(data.getMemberRegionCodes()).isNotEmpty();
|
||||
Assertions.assertThat(data.getCenterAdjacentRegions()).isNotEmpty();
|
||||
Assertions.assertThat(data.getPreferenceMatchRules()).isNotEmpty();
|
||||
} catch (Throwable var5) {
|
||||
if (inputStream != null) {
|
||||
try {
|
||||
inputStream.close();
|
||||
} catch (Throwable var4) {
|
||||
var5.addSuppressed(var4);
|
||||
}
|
||||
}
|
||||
|
||||
throw var5;
|
||||
}
|
||||
|
||||
if (inputStream != null) {
|
||||
inputStream.close();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.kri.p6.ncrc.pairing.service;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelMapper;
|
||||
import com.kri.p6.ncrc.pairing.common.external.datago.DatagoExtentionApiClient;
|
||||
import com.kri.p6.ncrc.pairing.common.cache.DatagoHolidayCache;
|
||||
import com.kri.p6.ncrc.pairing.common.external.datago.HolidayDto;
|
||||
import com.kri.p6.ncrc.pairing.dto.excel.output.RuleViolationExcelDto;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.ss.usermodel.WorkbookFactory;
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
|
||||
class PairingServiceTest {
|
||||
private final PairingService pairingService = new PairingService(new PairingExcelService(PairingTestSupport.pairingProperties()), new PairingNormalizeService(PairingTestSupport.pairingProperties()), new PairingHolidayService(new DatagoHolidayCache(new StubDatagoExtentionApiClient())), new PairingValidationService(PairingTestSupport.pairingProperties()), new PairingCandidateService(PairingTestSupport.pairingProperties()), new PairingSolverService(PairingTestSupport.pairingProperties()));
|
||||
|
||||
@Test
|
||||
void pairingMemberByCenterCreatesResultWorkbook() throws IOException {
|
||||
InputStream inputStream = this.getClass().getResourceAsStream("/sample/기초 data dummy.xlsx");
|
||||
|
||||
try {
|
||||
MockMultipartFile file = new MockMultipartFile("file", "기초 data dummy.xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", inputStream);
|
||||
byte[] result = this.pairingService.pairingMemberByCenter(file);
|
||||
Assertions.assertThat(result).isNotEmpty();
|
||||
Workbook workbook = WorkbookFactory.create(new ByteArrayInputStream(result));
|
||||
|
||||
try {
|
||||
Assertions.assertThat(workbook.getSheet("배정결과")).isNotNull();
|
||||
Assertions.assertThat(workbook.getSheet("미배정센터")).isNotNull();
|
||||
Assertions.assertThat(workbook.getSheet("미사용위원")).isNotNull();
|
||||
Assertions.assertThat(workbook.getSheet("처리요약")).isNotNull();
|
||||
Assertions.assertThat(workbook.getSheet("AB페어목록")).isNotNull();
|
||||
Assertions.assertThat(workbook.getSheet("후보요약")).isNotNull();
|
||||
Assertions.assertThat(workbook.getSheet("검증오류")).isNotNull();
|
||||
Assertions.assertThat(workbook.getSheet("규칙위반검사")).isNotNull();
|
||||
List<RuleViolationExcelDto> ruleChecks = ExcelMapper.readFromWorkbook(workbook, RuleViolationExcelDto.class, "규칙위반검사", 1);
|
||||
Assertions.assertThat(ruleChecks).extracting(RuleViolationExcelDto::getResult).doesNotContain(new String[]{"FAIL"});
|
||||
} catch (Throwable var9) {
|
||||
if (workbook != null) {
|
||||
try {
|
||||
workbook.close();
|
||||
} catch (Throwable var8) {
|
||||
var9.addSuppressed(var8);
|
||||
}
|
||||
}
|
||||
|
||||
throw var9;
|
||||
}
|
||||
|
||||
if (workbook != null) {
|
||||
workbook.close();
|
||||
}
|
||||
} catch (Throwable var10) {
|
||||
if (inputStream != null) {
|
||||
try {
|
||||
inputStream.close();
|
||||
} catch (Throwable var7) {
|
||||
var10.addSuppressed(var7);
|
||||
}
|
||||
}
|
||||
|
||||
throw var10;
|
||||
}
|
||||
|
||||
if (inputStream != null) {
|
||||
inputStream.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class StubDatagoExtentionApiClient extends DatagoExtentionApiClient {
|
||||
public List<HolidayDto> getHoliDayList(String year) {
|
||||
return List.of();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.kri.p6.ncrc.pairing.service;
|
||||
|
||||
import com.kri.p6.ncrc.pairing.model.AssignmentCandidate;
|
||||
import com.kri.p6.ncrc.pairing.model.Center;
|
||||
import com.kri.p6.ncrc.pairing.model.ExperienceType;
|
||||
import com.kri.p6.ncrc.pairing.model.Gender;
|
||||
import com.kri.p6.ncrc.pairing.model.Member;
|
||||
import com.kri.p6.ncrc.pairing.model.MemberRole;
|
||||
import com.kri.p6.ncrc.pairing.model.Municipality;
|
||||
import com.kri.p6.ncrc.pairing.model.PairCandidate;
|
||||
import com.kri.p6.ncrc.pairing.model.PairingCandidates;
|
||||
import com.kri.p6.ncrc.pairing.model.PairingData;
|
||||
import com.kri.p6.ncrc.pairing.model.PairingResult;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class PairingSolverServiceTest {
|
||||
private final PairingSolverService service = new PairingSolverService(PairingTestSupport.pairingProperties());
|
||||
|
||||
@Test
|
||||
void solveAssignsCenterAtMostOnceAndPairMaxThreeCentersPerDay() {
|
||||
PairingData data = this.dataWithCenters("c1", "c2", "c3", "c4");
|
||||
PairingCandidates candidates = PairingCandidates.builder().pairCandidates(List.of(PairCandidate.builder().fieldMemberId("field").externalMemberId("external").residenceMatchScore(1).build())).dispatchRegionCandidates(List.of()).assignmentCandidates(List.of(this.assignment("field", "external", "c1", "A"), this.assignment("field", "external", "c2", "A"), this.assignment("field", "external", "c3", "A"), this.assignment("field", "external", "c4", "A"))).build();
|
||||
PairingResult result = this.service.solve(data, candidates);
|
||||
Assertions.assertThat(result.getAssignments()).hasSize(3);
|
||||
Assertions.assertThat(result.getAssignments()).extracting((assignment) -> assignment.getCenterId()).doesNotHaveDuplicates();
|
||||
}
|
||||
|
||||
@Test
|
||||
void solveAllowsOnlyOnePairForMemberOnSameDay() {
|
||||
PairingData data = this.dataWithMembersAndCenters(List.of(this.member("field", MemberRole.FIELD), this.member("external1", MemberRole.EXTERNAL), this.member("external2", MemberRole.EXTERNAL)), List.of(this.center("c1"), this.center("c2")));
|
||||
PairingCandidates candidates = PairingCandidates.builder().pairCandidates(List.of(PairCandidate.builder().fieldMemberId("field").externalMemberId("external1").build(), PairCandidate.builder().fieldMemberId("field").externalMemberId("external2").build())).dispatchRegionCandidates(List.of()).assignmentCandidates(List.of(this.assignment("field", "external1", "c1", "A"), this.assignment("field", "external2", "c2", "A"))).build();
|
||||
PairingResult result = this.service.solve(data, candidates);
|
||||
Assertions.assertThat(result.getAssignments()).hasSize(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
void solveAllowsOnlyOneAdjacentClassificationPerPairDay() {
|
||||
PairingData data = this.dataWithCenters("c1", "c2");
|
||||
PairingCandidates candidates = PairingCandidates.builder().pairCandidates(List.of(PairCandidate.builder().fieldMemberId("field").externalMemberId("external").build())).dispatchRegionCandidates(List.of()).assignmentCandidates(List.of(this.assignment("field", "external", "c1", "A"), this.assignment("field", "external", "c2", "B"))).build();
|
||||
PairingResult result = this.service.solve(data, candidates);
|
||||
Assertions.assertThat(result.getAssignments()).hasSize(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
void solveLimitsCounterpartsPerMemberToTwo() {
|
||||
PairingData data = this.dataWithMembersAndCenters(List.of(this.member("field", MemberRole.FIELD), this.member("external1", MemberRole.EXTERNAL), this.member("external2", MemberRole.EXTERNAL), this.member("external3", MemberRole.EXTERNAL)), List.of(this.center("c1"), this.center("c2"), this.center("c3")));
|
||||
PairingCandidates candidates = PairingCandidates.builder().pairCandidates(List.of(PairCandidate.builder().fieldMemberId("field").externalMemberId("external1").build(), PairCandidate.builder().fieldMemberId("field").externalMemberId("external2").build(), PairCandidate.builder().fieldMemberId("field").externalMemberId("external3").build())).dispatchRegionCandidates(List.of()).assignmentCandidates(List.of(this.assignment("field", "external1", "c1", "A", LocalDate.of(2026, 5, 1)), this.assignment("field", "external2", "c2", "A", LocalDate.of(2026, 5, 2)), this.assignment("field", "external3", "c3", "A", LocalDate.of(2026, 5, 3)))).build();
|
||||
PairingResult result = this.service.solve(data, candidates);
|
||||
Map<String, Long> counterpartCounts = (Map)result.getAssignments().stream().collect(Collectors.groupingBy((assignment) -> assignment.getExternalMemberId(), Collectors.counting()));
|
||||
Assertions.assertThat(result.getAssignments()).hasSize(2);
|
||||
Assertions.assertThat(counterpartCounts).hasSize(2);
|
||||
}
|
||||
|
||||
@Test
|
||||
void solveAddsABGroupForSimilarPairsWithoutOverlappingDates() {
|
||||
PairingData data = this.dataWithMembersAndCenters(List.of(this.member("field1", MemberRole.FIELD), this.member("external1", MemberRole.EXTERNAL), this.member("field2", MemberRole.FIELD), this.member("external2", MemberRole.EXTERNAL)), List.of(this.center("c1"), this.center("c2")));
|
||||
PairingCandidates candidates = PairingCandidates.builder().pairCandidates(List.of(PairCandidate.builder().fieldMemberId("field1").externalMemberId("external1").build(), PairCandidate.builder().fieldMemberId("field2").externalMemberId("external2").build())).dispatchRegionCandidates(List.of()).assignmentCandidates(List.of(this.assignment("field1", "external1", "c1", "A", LocalDate.of(2026, 5, 1)), this.assignment("field2", "external2", "c2", "A", LocalDate.of(2026, 5, 2)))).build();
|
||||
PairingResult result = this.service.solve(data, candidates);
|
||||
Assertions.assertThat(result.getAssignments()).hasSize(2);
|
||||
Assertions.assertThat(result.getAssignments()).extracting((assignment) -> assignment.getAbGroup()).containsOnly(new String[]{"AB-001"});
|
||||
Assertions.assertThat(result.getAssignments()).extracting((assignment) -> assignment.getBackupFieldMemberId()).containsExactlyInAnyOrder(new String[]{"field2", "field1"});
|
||||
}
|
||||
|
||||
private PairingData dataWithCenters(String... centerIds) {
|
||||
return this.dataWithMembersAndCenters(List.of(this.member("field", MemberRole.FIELD), this.member("external", MemberRole.EXTERNAL)), Arrays.stream(centerIds).map(this::center).toList());
|
||||
}
|
||||
|
||||
private PairingData dataWithMembersAndCenters(List<Member> members, List<Center> centers) {
|
||||
return PairingData.builder().members(members).municipalities(List.of(Municipality.builder().id("municipality").availableStartDate(LocalDate.of(2026, 5, 1)).availableEndDate(LocalDate.of(2026, 5, 10)).unavailableDates(Set.of()).build())).centers(centers).memberRegionCodes(List.of()).centerAdjacentRegions(List.of()).preferenceMatchRules(List.of()).build();
|
||||
}
|
||||
|
||||
private AssignmentCandidate assignment(String fieldMemberId, String externalMemberId, String centerId, String adjacentRegionClassification) {
|
||||
return this.assignment(fieldMemberId, externalMemberId, centerId, adjacentRegionClassification, LocalDate.of(2026, 5, 1));
|
||||
}
|
||||
|
||||
private AssignmentCandidate assignment(String fieldMemberId, String externalMemberId, String centerId, String adjacentRegionClassification, LocalDate date) {
|
||||
return AssignmentCandidate.builder().fieldMemberId(fieldMemberId).externalMemberId(externalMemberId).centerId(centerId).municipalityId("municipality").date(date).dispatchRegion("01").adjacentRegionClassification(adjacentRegionClassification).preferencePriority(1).residenceMatchScore(0).build();
|
||||
}
|
||||
|
||||
private Member member(String id, MemberRole role) {
|
||||
return Member.builder().id(id).gender(Gender.FEMALE).experienceType(ExperienceType.EXPERIENCED).role(role).availableStartDate(LocalDate.of(2026, 5, 1)).availableEndDate(LocalDate.of(2026, 5, 10)).unavailableDates(Set.of()).activityRegion("02").historyCenterIds(Set.of()).residenceCode("01101").preferenceRegions(List.of("01", "00", "00", "00")).build();
|
||||
}
|
||||
|
||||
private Center center(String id) {
|
||||
return Center.builder().id(id).municipalityId("municipality").womenOnly(false).adjacentRegionClassification("A").availableStartDate(LocalDate.of(2026, 5, 1)).availableEndDate(LocalDate.of(2026, 5, 10)).unavailableDates(Set.of()).build();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user