260416_04_ENH: 결과 나오는 것 까지는 확인함, 매칭이 너무 적어서 조정 심히 필요
This commit is contained in:
@@ -18,6 +18,10 @@ tasks.withType(JavaCompile).configureEach {
|
||||
options.encoding = 'UTF-8'
|
||||
}
|
||||
|
||||
tasks.named('processResources') {
|
||||
exclude '**/~$*'
|
||||
}
|
||||
|
||||
configurations {
|
||||
compileOnly {
|
||||
extendsFrom annotationProcessor
|
||||
@@ -64,4 +68,5 @@ dependencies {
|
||||
|
||||
tasks.named('test') {
|
||||
useJUnitPlatform()
|
||||
maxHeapSize = '4g'
|
||||
}
|
||||
|
||||
@@ -3,15 +3,21 @@ 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.time.DayOfWeek;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.Generated;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class DatagoHolidayCache extends AbstractListCache<HolidayDto> {
|
||||
|
||||
private static final DateTimeFormatter DATAGO_DATE_FORMAT = DateTimeFormatter.ofPattern(
|
||||
"yyyyMMdd");
|
||||
private final DatagoExtentionApiClient datagoExtentionApiClient;
|
||||
|
||||
public synchronized List<HolidayDto> getHolidays(Set<String> years) {
|
||||
@@ -22,7 +28,10 @@ public class DatagoHolidayCache extends AbstractListCache<HolidayDto> {
|
||||
years.stream()
|
||||
.filter(year -> !cachedYears.contains(year))
|
||||
.sorted()
|
||||
.forEach(year -> addAll(datagoExtentionApiClient.getHoliDayList(year)));
|
||||
.forEach(year -> {
|
||||
addAll(datagoExtentionApiClient.getHoliDayList(year));
|
||||
addAll(getWeekend(year));
|
||||
});
|
||||
|
||||
return getList().stream()
|
||||
.filter(holiday -> years.contains(extractYear(holiday)))
|
||||
@@ -33,14 +42,33 @@ public class DatagoHolidayCache extends AbstractListCache<HolidayDto> {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
public List<HolidayDto> getWeekend(String year) {
|
||||
int parsedYear = Integer.parseInt(year);
|
||||
LocalDate startDate = LocalDate.of(parsedYear, 1, 1);
|
||||
LocalDate endDate = LocalDate.of(parsedYear, 12, 31);
|
||||
LocalDate firstSaturday = startDate.plusDays(
|
||||
(DayOfWeek.SATURDAY.getValue() - startDate.getDayOfWeek().getValue() + 7) % 7);
|
||||
|
||||
return firstSaturday.datesUntil(endDate.plusDays(1), java.time.Period.ofWeeks(1))
|
||||
.flatMap(saturday -> {
|
||||
LocalDate sunday = saturday.plusDays(1);
|
||||
if (sunday.isAfter(endDate)) {
|
||||
return java.util.stream.Stream.of(toWeekendHoliday(saturday, "토요일"));
|
||||
}
|
||||
return java.util.stream.Stream.of(
|
||||
toWeekendHoliday(saturday, "토요일"),
|
||||
toWeekendHoliday(sunday, "일요일")
|
||||
);
|
||||
})
|
||||
.toList();
|
||||
}
|
||||
|
||||
private HolidayDto toWeekendHoliday(LocalDate date, String name) {
|
||||
return HolidayDto.of(date.format(DATAGO_DATE_FORMAT), name);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ public final class PairingConstant {
|
||||
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 = "미사용위원";
|
||||
|
||||
@@ -5,212 +5,74 @@ import com.fasterxml.jackson.annotation.JsonFormat.Feature;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.util.List;
|
||||
import lombok.Generated;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@JsonIgnoreProperties(
|
||||
ignoreUnknown = true
|
||||
)
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@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
|
||||
)
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@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
|
||||
)
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@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
|
||||
)
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@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
|
||||
)
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public static class Items {
|
||||
|
||||
@JsonProperty("item")
|
||||
@JsonFormat(
|
||||
with = {Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY}
|
||||
)
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,14 @@
|
||||
package com.kri.p6.ncrc.pairing.common.external.datago;
|
||||
|
||||
import lombok.Generated;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class HolidayDto {
|
||||
|
||||
private String holidayDate;
|
||||
@@ -10,65 +17,4 @@ public class HolidayDto {
|
||||
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 + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package com.kri.p6.ncrc.pairing.config;
|
||||
|
||||
import lombok.Generated;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
@ConfigurationProperties(
|
||||
prefix = "pairing"
|
||||
)
|
||||
@Getter
|
||||
@Setter
|
||||
@ConfigurationProperties(prefix = "pairing")
|
||||
public class PairingProperties {
|
||||
|
||||
private Excel excel = new Excel();
|
||||
@@ -13,254 +14,59 @@ public class PairingProperties {
|
||||
private Rule rule = new Rule();
|
||||
private Preference preference = new Preference();
|
||||
private Objective objective = new Objective();
|
||||
private Candidate candidate = new Candidate();
|
||||
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;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public static class Objective {
|
||||
|
||||
private long assignmentWeight = 1000000L;
|
||||
private long preferenceBaseWeight = 10000L;
|
||||
private long assignmentWeight = 1_000_000L;
|
||||
private long preferenceBaseWeight = 10_000L;
|
||||
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;
|
||||
}
|
||||
private long residenceMatchWeight = 1_000L;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public static class Candidate {
|
||||
private int maxDispatchRegionsPerPair = 5;
|
||||
private int maxAssignmentsPerCenter = 30;
|
||||
private int maxAssignmentsPerMember = 80;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public static class Solver {
|
||||
|
||||
private double maxTimeSeconds = (double) 30.0F;
|
||||
private double maxTimeSeconds = 30.0;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,17 +7,20 @@ 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 lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
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.RequestParam;
|
||||
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"})
|
||||
@RequiredArgsConstructor
|
||||
@Tag(
|
||||
name = "Pairing",
|
||||
description = "위원/센터 매칭 API"
|
||||
@@ -27,31 +30,25 @@ public class PairingController {
|
||||
private final PairingService pairingService;
|
||||
private final PairingExcelService pairingExcelService;
|
||||
|
||||
@PostMapping({"/run"})
|
||||
@PostMapping(value = "/run", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
@Operation(
|
||||
summary = "업로드된 파일로 위원과 센터를 매칭"
|
||||
)
|
||||
public ResponseEntity<byte[]> pairingMemberByCenter(
|
||||
@Parameter(description = "업로드 파일", required = true) @RequestPart("file") MultipartFile file) {
|
||||
@RequestParam("file") MultipartFile file
|
||||
) {
|
||||
String fileName = file.getOriginalFilename() == null ? "pairing" : file.getOriginalFilename();
|
||||
|
||||
try {
|
||||
byte[] bytes = this.pairingService.pairingMemberByCenter(file);
|
||||
byte[] bytes = 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());
|
||||
byte[] bytes = 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,100 +1,16 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.input;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class CenterAdjacentRegionExcelDto {
|
||||
|
||||
@ExcelColumn(
|
||||
header = "권역",
|
||||
order = 0,
|
||||
width = 12
|
||||
)
|
||||
@ExcelColumn(header = "권역", order = 0, width = 12)
|
||||
private String dispatchRegion;
|
||||
@ExcelColumn(
|
||||
header = "인접지역 분류",
|
||||
order = 1,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@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() + ")";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,243 +1,31 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.input;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class CenterExcelDto {
|
||||
|
||||
@ExcelColumn(
|
||||
header = "id",
|
||||
order = 0,
|
||||
width = 15
|
||||
)
|
||||
@ExcelColumn(header = "센터 id", order = 0, width = 15)
|
||||
private String id;
|
||||
@ExcelColumn(
|
||||
header = "지자체 id",
|
||||
order = 1,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "지자체 id", order = 1, width = 15)
|
||||
private String municipalityId;
|
||||
@ExcelColumn(
|
||||
header = "여성 위원만",
|
||||
order = 2,
|
||||
width = 12
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "여성 위원만", order = 2, width = 12)
|
||||
private String womenOnly;
|
||||
@ExcelColumn(
|
||||
header = "인접지역 분류",
|
||||
order = 3,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "인접지역 분류", order = 3, width = 15)
|
||||
private String adjacentRegionClassification;
|
||||
@ExcelColumn(
|
||||
header = "진행 시작일",
|
||||
order = 4,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "진행 시작일", order = 4, width = 15)
|
||||
private String availableStartDate;
|
||||
@ExcelColumn(
|
||||
header = "진행 종료일",
|
||||
order = 5,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "진행 종료일", order = 5, width = 15)
|
||||
private String availableEndDate;
|
||||
@ExcelColumn(
|
||||
header = "진행 불가 일자",
|
||||
order = 6,
|
||||
width = 35
|
||||
)
|
||||
|
||||
@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() + ")";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,442 +1,52 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.input;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class MemberExcelDto {
|
||||
|
||||
@ExcelColumn(
|
||||
header = "id",
|
||||
order = 0,
|
||||
width = 15
|
||||
)
|
||||
@ExcelColumn(header = "id", order = 0, width = 15)
|
||||
private String id;
|
||||
@ExcelColumn(
|
||||
header = "성별",
|
||||
order = 1,
|
||||
width = 10
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "성별", order = 1, width = 10)
|
||||
private String gender;
|
||||
@ExcelColumn(
|
||||
header = "경력여부",
|
||||
order = 2,
|
||||
width = 12
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "경력여부", order = 2, width = 12)
|
||||
private String experience;
|
||||
@ExcelColumn(
|
||||
header = "현장/외부 구분",
|
||||
order = 3,
|
||||
width = 18
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "현장/외부 구분", order = 3, width = 18)
|
||||
private String role;
|
||||
@ExcelColumn(
|
||||
header = "진행 시작일",
|
||||
order = 4,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "진행 시작일", order = 4, width = 15)
|
||||
private String availableStartDate;
|
||||
@ExcelColumn(
|
||||
header = "진행 종료일",
|
||||
order = 5,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "진행 종료일", order = 5, width = 15)
|
||||
private String availableEndDate;
|
||||
@ExcelColumn(
|
||||
header = "진행 불가 일자",
|
||||
order = 6,
|
||||
width = 35
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "진행 불가 일자", order = 6, width = 35)
|
||||
private String unavailableDates;
|
||||
@ExcelColumn(
|
||||
header = "활동지역",
|
||||
order = 7,
|
||||
width = 12
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "활동지역", order = 7, width = 12)
|
||||
private String activityRegion;
|
||||
@ExcelColumn(
|
||||
header = "23년 진행 센터",
|
||||
order = 8,
|
||||
width = 25
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "23년 진행 센터", order = 8, width = 25)
|
||||
private String historyCenters;
|
||||
@ExcelColumn(
|
||||
header = "거주지",
|
||||
order = 9,
|
||||
width = 12
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "거주지", order = 9, width = 12)
|
||||
private String residenceCode;
|
||||
@ExcelColumn(
|
||||
header = "선호 지역1",
|
||||
order = 10,
|
||||
width = 12
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "선호 지역1", order = 10, width = 12)
|
||||
private String preferenceRegion1;
|
||||
@ExcelColumn(
|
||||
header = "선호 지역2",
|
||||
order = 11,
|
||||
width = 12
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "선호 지역2", order = 11, width = 12)
|
||||
private String preferenceRegion2;
|
||||
@ExcelColumn(
|
||||
header = "선호 지역3",
|
||||
order = 12,
|
||||
width = 12
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "선호 지역3", order = 12, width = 12)
|
||||
private String preferenceRegion3;
|
||||
@ExcelColumn(
|
||||
header = "선호 지역4",
|
||||
order = 13,
|
||||
width = 12
|
||||
)
|
||||
|
||||
@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() + ")";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,213 +1,28 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.input;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class MemberRegionCodeExcelDto {
|
||||
|
||||
@ExcelColumn(
|
||||
header = "시도",
|
||||
order = 0,
|
||||
width = 15
|
||||
)
|
||||
@ExcelColumn(header = "시도", order = 0, width = 15)
|
||||
private String sido;
|
||||
@ExcelColumn(
|
||||
header = "시군구",
|
||||
order = 1,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "시군구", order = 1, width = 15)
|
||||
private String sigungu;
|
||||
@ExcelColumn(
|
||||
header = "권역코드",
|
||||
order = 2,
|
||||
width = 12
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "권역코드", order = 2, width = 12)
|
||||
private String regionCode;
|
||||
@ExcelColumn(
|
||||
header = "세부권역코드(중간 1자리)",
|
||||
order = 3,
|
||||
width = 25
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "세부권역코드(중간 1자리)", order = 3, width = 25)
|
||||
private String detailRegionCode;
|
||||
@ExcelColumn(
|
||||
header = "세부지역코드(마지막2자리)",
|
||||
order = 4,
|
||||
width = 25
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "세부지역코드(마지막2자리)", order = 4, width = 25)
|
||||
private String detailAreaCode;
|
||||
@ExcelColumn(
|
||||
header = "지역 코드",
|
||||
order = 5,
|
||||
width = 12
|
||||
)
|
||||
|
||||
@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() + ")";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,156 +1,22 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.input;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class MunicipalityExcelDto {
|
||||
|
||||
@ExcelColumn(
|
||||
header = "지자체 id",
|
||||
order = 0,
|
||||
width = 15
|
||||
)
|
||||
@ExcelColumn(header = "지자체 id", order = 0, width = 15)
|
||||
private String id;
|
||||
@ExcelColumn(
|
||||
header = "진행 시작일",
|
||||
order = 1,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "진행 시작일", order = 1, width = 15)
|
||||
private String availableStartDate;
|
||||
@ExcelColumn(
|
||||
header = "진행 종료일",
|
||||
order = 2,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "진행 종료일", order = 2, width = 15)
|
||||
private String availableEndDate;
|
||||
@ExcelColumn(
|
||||
header = "진행 불가 일자",
|
||||
order = 3,
|
||||
width = 35
|
||||
)
|
||||
|
||||
@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() + ")";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.input;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Generated;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class PairingWorkbookData {
|
||||
|
||||
private final List<MemberExcelDto> members;
|
||||
@@ -11,131 +14,4 @@ public class PairingWorkbookData {
|
||||
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) + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,130 +1,19 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.input;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class PreferenceMatchExcelDto {
|
||||
|
||||
@ExcelColumn(
|
||||
header = "매칭 순위",
|
||||
order = 0,
|
||||
width = 12
|
||||
)
|
||||
@ExcelColumn(header = "매칭 순위", order = 0, width = 12)
|
||||
private String priority;
|
||||
@ExcelColumn(
|
||||
header = "현장위원",
|
||||
order = 1,
|
||||
width = 12
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "현장위원", order = 1, width = 12)
|
||||
private String fieldMemberPreferenceRank;
|
||||
@ExcelColumn(
|
||||
header = "외부위원",
|
||||
order = 2,
|
||||
width = 12
|
||||
)
|
||||
|
||||
@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() + ")";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,352 +1,42 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.output;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ABPairExcelDto {
|
||||
|
||||
@ExcelColumn(
|
||||
header = "AB 그룹",
|
||||
order = 0,
|
||||
width = 12
|
||||
)
|
||||
@ExcelColumn(header = "AB 그룹", order = 0, width = 12)
|
||||
private String groupId;
|
||||
@ExcelColumn(
|
||||
header = "A 현장위원 id",
|
||||
order = 1,
|
||||
width = 18
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "A 현장위원 id", order = 1, width = 18)
|
||||
private String aFieldMemberId;
|
||||
@ExcelColumn(
|
||||
header = "A 외부위원 id",
|
||||
order = 2,
|
||||
width = 18
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "A 외부위원 id", order = 2, width = 18)
|
||||
private String aExternalMemberId;
|
||||
@ExcelColumn(
|
||||
header = "B 현장위원 id",
|
||||
order = 3,
|
||||
width = 18
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "B 현장위원 id", order = 3, width = 18)
|
||||
private String bFieldMemberId;
|
||||
@ExcelColumn(
|
||||
header = "B 외부위원 id",
|
||||
order = 4,
|
||||
width = 18
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "B 외부위원 id", order = 4, width = 18)
|
||||
private String bExternalMemberId;
|
||||
@ExcelColumn(
|
||||
header = "공유 파견 권역",
|
||||
order = 5,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "공유 파견 권역", order = 5, width = 15)
|
||||
private String sharedDispatchRegion;
|
||||
@ExcelColumn(
|
||||
header = "공유 인접지역 분류",
|
||||
order = 6,
|
||||
width = 18
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "공유 인접지역 분류", order = 6, width = 18)
|
||||
private String sharedAdjacentRegionClassification;
|
||||
@ExcelColumn(
|
||||
header = "A 배정일",
|
||||
order = 7,
|
||||
width = 25
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "A 배정일", order = 7, width = 25)
|
||||
private String aAssignmentDates;
|
||||
@ExcelColumn(
|
||||
header = "B 배정일",
|
||||
order = 8,
|
||||
width = 25
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "B 배정일", order = 8, width = 25)
|
||||
private String bAssignmentDates;
|
||||
@ExcelColumn(
|
||||
header = "날짜 겹침 여부",
|
||||
order = 9,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,724 +1,78 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.output;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AssignmentResultExcelDto {
|
||||
|
||||
@ExcelColumn(
|
||||
header = "일자",
|
||||
order = 0,
|
||||
width = 15
|
||||
)
|
||||
@ExcelColumn(header = "일자", order = 0, width = 15)
|
||||
private String date;
|
||||
@ExcelColumn(
|
||||
header = "현장위원 id",
|
||||
order = 1,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "현장위원 id", order = 1, width = 15)
|
||||
private String fieldMemberId;
|
||||
@ExcelColumn(
|
||||
header = "현장위원 성별",
|
||||
order = 2,
|
||||
width = 12
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "현장위원 성별", order = 2, width = 12)
|
||||
private String fieldMemberGender;
|
||||
@ExcelColumn(
|
||||
header = "현장위원 경력",
|
||||
order = 3,
|
||||
width = 12
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "현장위원 경력", order = 3, width = 12)
|
||||
private String fieldMemberExperience;
|
||||
@ExcelColumn(
|
||||
header = "현장위원 거주지",
|
||||
order = 4,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "현장위원 거주지", order = 4, width = 15)
|
||||
private String fieldMemberResidenceCode;
|
||||
@ExcelColumn(
|
||||
header = "현장위원 활동지역",
|
||||
order = 5,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "현장위원 활동지역", order = 5, width = 15)
|
||||
private String fieldMemberActivityRegion;
|
||||
@ExcelColumn(
|
||||
header = "현장위원 희망지역 순위",
|
||||
order = 6,
|
||||
width = 18
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "현장위원 희망지역 순위", order = 6, width = 18)
|
||||
private String fieldMemberPreferenceRank;
|
||||
@ExcelColumn(
|
||||
header = "외부위원 id",
|
||||
order = 7,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "외부위원 id", order = 7, width = 15)
|
||||
private String externalMemberId;
|
||||
@ExcelColumn(
|
||||
header = "외부위원 성별",
|
||||
order = 8,
|
||||
width = 12
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "외부위원 성별", order = 8, width = 12)
|
||||
private String externalMemberGender;
|
||||
@ExcelColumn(
|
||||
header = "외부위원 경력",
|
||||
order = 9,
|
||||
width = 12
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "외부위원 경력", order = 9, width = 12)
|
||||
private String externalMemberExperience;
|
||||
@ExcelColumn(
|
||||
header = "외부위원 거주지",
|
||||
order = 10,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "외부위원 거주지", order = 10, width = 15)
|
||||
private String externalMemberResidenceCode;
|
||||
@ExcelColumn(
|
||||
header = "외부위원 활동지역",
|
||||
order = 11,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "외부위원 활동지역", order = 11, width = 15)
|
||||
private String externalMemberActivityRegion;
|
||||
@ExcelColumn(
|
||||
header = "외부위원 희망지역 순위",
|
||||
order = 12,
|
||||
width = 18
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "외부위원 희망지역 순위", order = 12, width = 18)
|
||||
private String externalMemberPreferenceRank;
|
||||
@ExcelColumn(
|
||||
header = "센터 id",
|
||||
order = 13,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "센터 id", order = 13, width = 15)
|
||||
private String centerId;
|
||||
@ExcelColumn(
|
||||
header = "지자체 id",
|
||||
order = 14,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "지자체 id", order = 14, width = 15)
|
||||
private String municipalityId;
|
||||
@ExcelColumn(
|
||||
header = "센터 여성 전용 여부",
|
||||
order = 15,
|
||||
width = 18
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "여성 위원만", order = 15, width = 12)
|
||||
private String centerWomenOnly;
|
||||
@ExcelColumn(
|
||||
header = "파견 권역",
|
||||
order = 16,
|
||||
width = 12
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "파견 권역", order = 16, width = 12)
|
||||
private String dispatchRegion;
|
||||
@ExcelColumn(
|
||||
header = "인접지역 분류",
|
||||
order = 17,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "인접지역 분류", order = 17, width = 15)
|
||||
private String adjacentRegionClassification;
|
||||
@ExcelColumn(
|
||||
header = "매칭 순위",
|
||||
order = 18,
|
||||
width = 12
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "희망지역 매칭 순위", order = 18, width = 18)
|
||||
private String preferencePriority;
|
||||
@ExcelColumn(
|
||||
header = "AB 그룹",
|
||||
order = 19,
|
||||
width = 12
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "AB 그룹", order = 19, width = 12)
|
||||
private String abGroup;
|
||||
@ExcelColumn(
|
||||
header = "보완 현장위원 id",
|
||||
order = 20,
|
||||
width = 18
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "대체 현장위원 id", order = 20, width = 18)
|
||||
private String backupFieldMemberId;
|
||||
@ExcelColumn(
|
||||
header = "보완 외부위원 id",
|
||||
order = 21,
|
||||
width = 18
|
||||
)
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,138 +1,21 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.output;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CandidateSummaryExcelDto {
|
||||
|
||||
@ExcelColumn(
|
||||
header = "항목",
|
||||
order = 0,
|
||||
width = 30
|
||||
)
|
||||
@ExcelColumn(header = "항목", order = 0, width = 30)
|
||||
private String name;
|
||||
@ExcelColumn(
|
||||
header = "값",
|
||||
order = 1,
|
||||
width = 20
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "값", order = 1, width = 20)
|
||||
private String value;
|
||||
@ExcelColumn(
|
||||
header = "설명",
|
||||
order = 2,
|
||||
width = 50
|
||||
)
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,108 +1,18 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.output;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PairingSummaryExcelDto {
|
||||
|
||||
@ExcelColumn(
|
||||
header = "항목",
|
||||
order = 0,
|
||||
width = 25
|
||||
)
|
||||
@ExcelColumn(header = "항목", order = 0, width = 25)
|
||||
private String name;
|
||||
@ExcelColumn(
|
||||
header = "값",
|
||||
order = 1,
|
||||
width = 20
|
||||
)
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,138 +1,21 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.output;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RuleViolationExcelDto {
|
||||
|
||||
@ExcelColumn(
|
||||
header = "검사 항목",
|
||||
order = 0,
|
||||
width = 35
|
||||
)
|
||||
@ExcelColumn(header = "검사 항목", order = 0, width = 35)
|
||||
private String ruleName;
|
||||
@ExcelColumn(
|
||||
header = "결과",
|
||||
order = 1,
|
||||
width = 12
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "결과", order = 1, width = 12)
|
||||
private String result;
|
||||
@ExcelColumn(
|
||||
header = "상세",
|
||||
order = 2,
|
||||
width = 80
|
||||
)
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,139 +1,21 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.output;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UnassignedCenterExcelDto {
|
||||
|
||||
@ExcelColumn(
|
||||
header = "센터 id",
|
||||
order = 0,
|
||||
width = 15
|
||||
)
|
||||
@ExcelColumn(header = "센터 id", order = 0, width = 15)
|
||||
private String centerId;
|
||||
@ExcelColumn(
|
||||
header = "지자체 id",
|
||||
order = 1,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "지자체 id", order = 1, width = 15)
|
||||
private String municipalityId;
|
||||
@ExcelColumn(
|
||||
header = "사유",
|
||||
order = 2,
|
||||
width = 40
|
||||
)
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,138 +1,21 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.output;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UnusedMemberExcelDto {
|
||||
|
||||
@ExcelColumn(
|
||||
header = "위원 id",
|
||||
order = 0,
|
||||
width = 15
|
||||
)
|
||||
@ExcelColumn(header = "위원 id", order = 0, width = 15)
|
||||
private String memberId;
|
||||
@ExcelColumn(
|
||||
header = "현장/외부 구분",
|
||||
order = 1,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "현장/외부 구분", order = 1, width = 15)
|
||||
private String role;
|
||||
@ExcelColumn(
|
||||
header = "사유",
|
||||
order = 2,
|
||||
width = 40
|
||||
)
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,138 +1,21 @@
|
||||
package com.kri.p6.ncrc.pairing.dto.excel.output;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Generated;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ValidationErrorExcelDto {
|
||||
|
||||
@ExcelColumn(
|
||||
header = "오류 코드",
|
||||
order = 0,
|
||||
width = 25
|
||||
)
|
||||
@ExcelColumn(header = "오류 코드", order = 0, width = 25)
|
||||
private String code;
|
||||
@ExcelColumn(
|
||||
header = "오류 메시지",
|
||||
order = 1,
|
||||
width = 80
|
||||
)
|
||||
|
||||
@ExcelColumn(header = "오류 메시지", order = 1, width = 80)
|
||||
private String message;
|
||||
@ExcelColumn(
|
||||
header = "구분",
|
||||
order = 2,
|
||||
width = 15
|
||||
)
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.kri.p6.ncrc.pairing.model;
|
||||
|
||||
import lombok.Generated;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class ABPairMatch {
|
||||
|
||||
private final String groupId;
|
||||
@@ -10,107 +13,4 @@ public class ABPairMatch {
|
||||
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 + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.kri.p6.ncrc.pairing.model;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import lombok.Generated;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class AssignmentCandidate {
|
||||
|
||||
private final String fieldMemberId;
|
||||
@@ -17,203 +20,4 @@ public class AssignmentCandidate {
|
||||
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 + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,11 @@ package com.kri.p6.ncrc.pairing.model;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Set;
|
||||
import lombok.Generated;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class Center {
|
||||
|
||||
private final String id;
|
||||
@@ -14,138 +17,4 @@ public class Center {
|
||||
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) + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,68 +1,13 @@
|
||||
package com.kri.p6.ncrc.pairing.model;
|
||||
|
||||
import lombok.Generated;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
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 + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.kri.p6.ncrc.pairing.model;
|
||||
|
||||
import lombok.Generated;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class DispatchRegionCandidate {
|
||||
|
||||
private final String fieldMemberId;
|
||||
@@ -11,125 +14,4 @@ public class DispatchRegionCandidate {
|
||||
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 + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,11 @@ import com.kri.p6.ncrc.pairing.common.enums.MemberRole;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import lombok.Generated;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class Member {
|
||||
|
||||
private final String id;
|
||||
@@ -22,199 +25,4 @@ public class Member {
|
||||
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)
|
||||
+ ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.kri.p6.ncrc.pairing.model;
|
||||
|
||||
import lombok.Generated;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class MemberRegionCode {
|
||||
|
||||
private final String sido;
|
||||
@@ -11,120 +14,4 @@ public class MemberRegionCode {
|
||||
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 + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,11 @@ package com.kri.p6.ncrc.pairing.model;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Set;
|
||||
import lombok.Generated;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class Municipality {
|
||||
|
||||
private final String id;
|
||||
@@ -11,93 +14,4 @@ public class Municipality {
|
||||
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)
|
||||
+ ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,83 +1,14 @@
|
||||
package com.kri.p6.ncrc.pairing.model;
|
||||
|
||||
import lombok.Generated;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
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 + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,11 @@ package com.kri.p6.ncrc.pairing.model;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import lombok.Generated;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class PairingCandidates {
|
||||
|
||||
private final List<PairCandidate> pairCandidates;
|
||||
@@ -12,98 +15,4 @@ public class PairingCandidates {
|
||||
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) + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,11 @@ package com.kri.p6.ncrc.pairing.model;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import lombok.Generated;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class PairingData {
|
||||
|
||||
private final List<Member> members;
|
||||
@@ -15,143 +18,4 @@ public class PairingData {
|
||||
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) + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,11 @@ 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;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class PairingResult {
|
||||
|
||||
private final List<AssignmentResultExcelDto> assignments;
|
||||
@@ -22,159 +25,4 @@ public class PairingResult {
|
||||
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) + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,86 +1,14 @@
|
||||
package com.kri.p6.ncrc.pairing.model;
|
||||
|
||||
import lombok.Generated;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
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 + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -25,21 +26,24 @@ import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.Generated;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
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);
|
||||
List<PairCandidate> pairCandidates = createPairCandidates(data.getMembers());
|
||||
List<DispatchRegionCandidate> dispatchRegionCandidates = trimDispatchRegionCandidates(
|
||||
createDispatchRegionCandidates(data, pairCandidates));
|
||||
Map<String, Set<String>> unassignedCenterReasons = createInitialCenterReasonMap(data);
|
||||
List<AssignmentCandidate> assignmentCandidates = trimAssignmentCandidates(
|
||||
createAssignmentCandidates(data, pairCandidates, dispatchRegionCandidates,
|
||||
unassignedCenterReasons),
|
||||
data.getCenters(), unassignedCenterReasons);
|
||||
return PairingCandidates.builder().pairCandidates(pairCandidates)
|
||||
.dispatchRegionCandidates(dispatchRegionCandidates)
|
||||
.assignmentCandidates(assignmentCandidates).unassignedCenterReasons(unassignedCenterReasons)
|
||||
@@ -55,11 +59,11 @@ public class PairingCandidateService {
|
||||
|
||||
for (Member fieldMember : fieldMembers) {
|
||||
for (Member externalMember : externalMembers) {
|
||||
if (!this.isNewNewPair(fieldMember, externalMember) && this.hasDateOverlap(fieldMember,
|
||||
if (!isNewNewPair(fieldMember, externalMember) && hasDateOverlap(fieldMember,
|
||||
externalMember)) {
|
||||
candidates.add(PairCandidate.builder().fieldMemberId(fieldMember.getId())
|
||||
.externalMemberId(externalMember.getId())
|
||||
.residenceMatchScore(this.calculateResidenceMatchScore(fieldMember, externalMember))
|
||||
.residenceMatchScore(calculateResidenceMatchScore(fieldMember, externalMember))
|
||||
.build());
|
||||
}
|
||||
}
|
||||
@@ -70,7 +74,7 @@ public class PairingCandidateService {
|
||||
|
||||
private List<DispatchRegionCandidate> createDispatchRegionCandidates(PairingData data,
|
||||
List<PairCandidate> pairCandidates) {
|
||||
Map<String, Member> memberMap = this.toMemberMap(data.getMembers());
|
||||
Map<String, Member> memberMap = toMemberMap(data.getMembers());
|
||||
Set<String> dispatchRegions = (Set) data.getCenterAdjacentRegions().stream()
|
||||
.map(CenterAdjacentRegion::getDispatchRegion).collect(Collectors.toSet());
|
||||
List<DispatchRegionCandidate> candidates = new ArrayList();
|
||||
@@ -80,10 +84,10 @@ public class PairingCandidateService {
|
||||
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(
|
||||
if (!isConflictRegion(fieldMember, externalMember, dispatchRegion)) {
|
||||
int fieldRank = findPreferenceRank(fieldMember, dispatchRegion);
|
||||
int externalRank = findPreferenceRank(externalMember, dispatchRegion);
|
||||
Optional<PreferenceMatchRule> matchRule = findPreferenceMatchRule(
|
||||
data.getPreferenceMatchRules(), fieldRank, externalRank);
|
||||
if (!matchRule.isEmpty()) {
|
||||
candidates.add(DispatchRegionCandidate.builder().fieldMemberId(fieldMember.getId())
|
||||
@@ -102,7 +106,7 @@ public class PairingCandidateService {
|
||||
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, Member> memberMap = 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()
|
||||
@@ -117,27 +121,27 @@ public class PairingCandidateService {
|
||||
Member fieldMember = (Member) memberMap.get(dispatchCandidate.getFieldMemberId());
|
||||
Member externalMember = (Member) memberMap.get(dispatchCandidate.getExternalMemberId());
|
||||
PairCandidate pairCandidate = (PairCandidate) pairMap.get(
|
||||
this.pairKey(dispatchCandidate.getFieldMemberId(),
|
||||
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(), "파견 권역과 센터 인접지역 분류 불일치");
|
||||
addReason(unassignedCenterReasons, center.getId(), "파견 권역과 센터 인접지역 분류 불일치");
|
||||
} else {
|
||||
Municipality municipality = (Municipality) municipalityMap.get(
|
||||
center.getMunicipalityId());
|
||||
List<String> centerReasons = this.findCenterHardRuleReasons(fieldMember, externalMember,
|
||||
List<String> centerReasons = findCenterHardRuleReasons(fieldMember, externalMember,
|
||||
center);
|
||||
if (!centerReasons.isEmpty()) {
|
||||
centerReasons.forEach(
|
||||
(reason) -> this.addReason(unassignedCenterReasons, center.getId(), reason));
|
||||
(reason) -> addReason(unassignedCenterReasons, center.getId(), reason));
|
||||
} else {
|
||||
LocalDate firstAssignableDate = this.findFirstAssignableDate(fieldMember,
|
||||
externalMember, municipality, center, this.commonUnavailableDates(data));
|
||||
LocalDate firstAssignableDate = findFirstAssignableDate(fieldMember,
|
||||
externalMember, municipality, center, commonUnavailableDates(data));
|
||||
if (firstAssignableDate == null) {
|
||||
this.addReason(unassignedCenterReasons, center.getId(),
|
||||
addReason(unassignedCenterReasons, center.getId(),
|
||||
"위원/지자체/센터 일정 또는 국공휴일 조건 불일치");
|
||||
} else {
|
||||
candidates.add(AssignmentCandidate.builder().fieldMemberId(fieldMember.getId())
|
||||
@@ -159,29 +163,119 @@ public class PairingCandidateService {
|
||||
return candidates;
|
||||
}
|
||||
|
||||
private List<DispatchRegionCandidate> trimDispatchRegionCandidates(
|
||||
List<DispatchRegionCandidate> candidates) {
|
||||
int limit = maxDispatchRegionsPerPair();
|
||||
if (limit <= 0) {
|
||||
return candidates;
|
||||
}
|
||||
|
||||
return candidates.stream()
|
||||
.collect(Collectors.groupingBy(this::pairKey, LinkedHashMap::new, Collectors.toList()))
|
||||
.values()
|
||||
.stream()
|
||||
.flatMap(group -> group.stream()
|
||||
.sorted(dispatchRegionCandidateComparator())
|
||||
.limit(limit))
|
||||
.toList();
|
||||
}
|
||||
|
||||
private List<AssignmentCandidate> trimAssignmentCandidates(List<AssignmentCandidate> candidates,
|
||||
List<Center> centers, Map<String, Set<String>> unassignedCenterReasons) {
|
||||
List<AssignmentCandidate> trimmedByCenter = trimAssignmentsPerCenter(candidates);
|
||||
List<AssignmentCandidate> trimmedByMember = trimAssignmentsPerMember(trimmedByCenter);
|
||||
addTrimmedCenterReasons(candidates, trimmedByMember, centers, unassignedCenterReasons);
|
||||
return trimmedByMember;
|
||||
}
|
||||
|
||||
private List<AssignmentCandidate> trimAssignmentsPerCenter(List<AssignmentCandidate> candidates) {
|
||||
int limit = maxAssignmentsPerCenter();
|
||||
if (limit <= 0) {
|
||||
return candidates;
|
||||
}
|
||||
|
||||
return candidates.stream()
|
||||
.collect(Collectors.groupingBy(AssignmentCandidate::getCenterId, LinkedHashMap::new,
|
||||
Collectors.toList()))
|
||||
.values()
|
||||
.stream()
|
||||
.flatMap(group -> group.stream()
|
||||
.sorted(assignmentCandidateComparator())
|
||||
.limit(limit))
|
||||
.toList();
|
||||
}
|
||||
|
||||
private List<AssignmentCandidate> trimAssignmentsPerMember(List<AssignmentCandidate> candidates) {
|
||||
int limit = maxAssignmentsPerMember();
|
||||
if (limit <= 0) {
|
||||
return candidates;
|
||||
}
|
||||
|
||||
Map<String, Integer> memberUsage = new HashMap();
|
||||
List<AssignmentCandidate> selected = new ArrayList();
|
||||
|
||||
for (AssignmentCandidate candidate : candidates.stream()
|
||||
.sorted(assignmentCandidateComparator())
|
||||
.toList()) {
|
||||
int fieldCount = memberUsage.getOrDefault(candidate.getFieldMemberId(), 0);
|
||||
int externalCount = memberUsage.getOrDefault(candidate.getExternalMemberId(), 0);
|
||||
if (fieldCount < limit && externalCount < limit) {
|
||||
selected.add(candidate);
|
||||
memberUsage.put(candidate.getFieldMemberId(), fieldCount + 1);
|
||||
memberUsage.put(candidate.getExternalMemberId(), externalCount + 1);
|
||||
}
|
||||
}
|
||||
|
||||
return selected;
|
||||
}
|
||||
|
||||
private void addTrimmedCenterReasons(List<AssignmentCandidate> originalCandidates,
|
||||
List<AssignmentCandidate> trimmedCandidates, List<Center> centers,
|
||||
Map<String, Set<String>> unassignedCenterReasons) {
|
||||
Set<String> originalCenterIds = originalCandidates.stream()
|
||||
.map(AssignmentCandidate::getCenterId)
|
||||
.collect(Collectors.toSet());
|
||||
Set<String> trimmedCenterIds = trimmedCandidates.stream()
|
||||
.map(AssignmentCandidate::getCenterId)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
for (Center center : centers) {
|
||||
if (originalCenterIds.contains(center.getId()) && !trimmedCenterIds.contains(center.getId())) {
|
||||
addReason(unassignedCenterReasons, center.getId(),
|
||||
"후보 축소 과정에서 상위 후보에 들지 못함");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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(),
|
||||
LocalDate latestStart = max(fieldMember.getAvailableStartDate(),
|
||||
externalMember.getAvailableStartDate());
|
||||
LocalDate earliestEnd = this.min(fieldMember.getAvailableEndDate(),
|
||||
LocalDate earliestEnd = 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;
|
||||
String fieldPrefix = prefix(fieldMember.getResidenceCode());
|
||||
String externalPrefix = prefix(externalMember.getResidenceCode());
|
||||
return !fieldPrefix.isBlank() && fieldPrefix.equals(externalPrefix) ? 1 : 0;
|
||||
}
|
||||
|
||||
private boolean isConflictRegion(Member fieldMember, Member externalMember,
|
||||
String dispatchRegion) {
|
||||
return dispatchRegion.equals(fieldMember.getActivityRegion()) || dispatchRegion.equals(
|
||||
externalMember.getActivityRegion());
|
||||
return hasActivityRegion(fieldMember, dispatchRegion) || hasActivityRegion(externalMember,
|
||||
dispatchRegion);
|
||||
}
|
||||
|
||||
private boolean hasActivityRegion(Member member, String dispatchRegion) {
|
||||
return java.util.Arrays.stream(member.getActivityRegion().split(","))
|
||||
.map(String::trim)
|
||||
.anyMatch(dispatchRegion::equals);
|
||||
}
|
||||
|
||||
private int findPreferenceRank(Member member, String dispatchRegion) {
|
||||
@@ -193,8 +287,8 @@ public class PairingCandidateService {
|
||||
return i + 1;
|
||||
}
|
||||
|
||||
if (this.anyRegionCode().equals(preference)) {
|
||||
return this.anywherePreferenceRank();
|
||||
if (anyRegionCode().equals(preference)) {
|
||||
return anywherePreferenceRank();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,15 +298,15 @@ public class PairingCandidateService {
|
||||
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) -> matchesPreferenceRank(rule.getFieldMemberPreferenceRank(), fieldRank))
|
||||
.filter((rule) -> matchesPreferenceRank(
|
||||
rule.getExternalMemberPreferenceRank(),
|
||||
externalRank)).min(
|
||||
Comparator.comparingInt(PreferenceMatchRule::getPriority)) : Optional.empty();
|
||||
}
|
||||
|
||||
private boolean matchesPreferenceRank(int ruleRank, int memberRank) {
|
||||
return ruleRank == this.ignoredPreferenceRank() || ruleRank == memberRank;
|
||||
return ruleRank == ignoredPreferenceRank() || ruleRank == memberRank;
|
||||
}
|
||||
|
||||
private List<String> findCenterHardRuleReasons(Member fieldMember, Member externalMember,
|
||||
@@ -233,17 +327,17 @@ public class PairingCandidateService {
|
||||
|
||||
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()));
|
||||
LocalDate start = max(
|
||||
max(fieldMember.getAvailableStartDate(), externalMember.getAvailableStartDate()),
|
||||
max(municipality.getAvailableStartDate(), center.getAvailableStartDate()));
|
||||
LocalDate end = min(
|
||||
min(fieldMember.getAvailableEndDate(), externalMember.getAvailableEndDate()),
|
||||
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,
|
||||
if (isAvailableOn(date, fieldMember, externalMember, municipality, center,
|
||||
commonUnavailableDates)) {
|
||||
return date;
|
||||
}
|
||||
@@ -281,7 +375,12 @@ public class PairingCandidateService {
|
||||
}
|
||||
|
||||
private String pairKey(PairCandidate pairCandidate) {
|
||||
return this.pairKey(pairCandidate.getFieldMemberId(), pairCandidate.getExternalMemberId());
|
||||
return pairKey(pairCandidate.getFieldMemberId(), pairCandidate.getExternalMemberId());
|
||||
}
|
||||
|
||||
private String pairKey(DispatchRegionCandidate dispatchRegionCandidate) {
|
||||
return pairKey(dispatchRegionCandidate.getFieldMemberId(),
|
||||
dispatchRegionCandidate.getExternalMemberId());
|
||||
}
|
||||
|
||||
private String pairKey(String fieldMemberId, String externalMemberId) {
|
||||
@@ -289,23 +388,79 @@ public class PairingCandidateService {
|
||||
}
|
||||
|
||||
private String prefix(String value) {
|
||||
return value.substring(0, Math.min(this.residenceMatchPrefixLength(), value.length()));
|
||||
return value.substring(0, Math.min(residenceMatchPrefixLength(), value.length()));
|
||||
}
|
||||
|
||||
private String anyRegionCode() {
|
||||
return this.pairingProperties.getCode().getAnyRegionCode();
|
||||
return pairingProperties.getCode().getAnyRegionCode();
|
||||
}
|
||||
|
||||
private int anywherePreferenceRank() {
|
||||
return this.pairingProperties.getPreference().getAnywhereRank();
|
||||
return pairingProperties.getPreference().getAnywhereRank();
|
||||
}
|
||||
|
||||
private int ignoredPreferenceRank() {
|
||||
return this.pairingProperties.getPreference().getIgnoredRank();
|
||||
return pairingProperties.getPreference().getIgnoredRank();
|
||||
}
|
||||
|
||||
private int residenceMatchPrefixLength() {
|
||||
return this.pairingProperties.getCode().getResidenceMatchPrefixLength();
|
||||
return pairingProperties.getCode().getResidenceMatchPrefixLength();
|
||||
}
|
||||
|
||||
private int maxDispatchRegionsPerPair() {
|
||||
return pairingProperties.getCandidate().getMaxDispatchRegionsPerPair();
|
||||
}
|
||||
|
||||
private int maxAssignmentsPerCenter() {
|
||||
return pairingProperties.getCandidate().getMaxAssignmentsPerCenter();
|
||||
}
|
||||
|
||||
private int maxAssignmentsPerMember() {
|
||||
return pairingProperties.getCandidate().getMaxAssignmentsPerMember();
|
||||
}
|
||||
|
||||
private Comparator<DispatchRegionCandidate> dispatchRegionCandidateComparator() {
|
||||
return Comparator.comparingInt(this::dispatchRegionCandidateScore).reversed()
|
||||
.thenComparing(DispatchRegionCandidate::getDispatchRegion);
|
||||
}
|
||||
|
||||
private Comparator<AssignmentCandidate> assignmentCandidateComparator() {
|
||||
return Comparator.comparingInt(this::assignmentCandidateScore).reversed()
|
||||
.thenComparing(AssignmentCandidate::getDate)
|
||||
.thenComparing(AssignmentCandidate::getCenterId)
|
||||
.thenComparing(AssignmentCandidate::getFieldMemberId)
|
||||
.thenComparing(AssignmentCandidate::getExternalMemberId);
|
||||
}
|
||||
|
||||
private int dispatchRegionCandidateScore(DispatchRegionCandidate candidate) {
|
||||
return preferenceScore(candidate.getPreferencePriority())
|
||||
+ preferenceRankBonus(candidate.getFieldMemberPreferenceRank())
|
||||
+ preferenceRankBonus(candidate.getExternalMemberPreferenceRank());
|
||||
}
|
||||
|
||||
private int assignmentCandidateScore(AssignmentCandidate candidate) {
|
||||
return preferenceScore(candidate.getPreferencePriority())
|
||||
+ preferenceRankBonus(candidate.getFieldMemberPreferenceRank())
|
||||
+ preferenceRankBonus(candidate.getExternalMemberPreferenceRank())
|
||||
+ candidate.getResidenceMatchScore() * (int) pairingProperties.getObjective()
|
||||
.getResidenceMatchWeight();
|
||||
}
|
||||
|
||||
private int preferenceScore(int priority) {
|
||||
return (int) Math.max(0L, pairingProperties.getObjective().getPreferenceBaseWeight()
|
||||
- (long) priority * pairingProperties.getObjective().getPreferenceRankPenalty());
|
||||
}
|
||||
|
||||
private int preferenceRankBonus(int rank) {
|
||||
if (rank == anywherePreferenceRank()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (rank <= 0 || rank == ignoredPreferenceRank()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return Math.max(0, 10 - rank);
|
||||
}
|
||||
|
||||
private LocalDate max(LocalDate left, LocalDate right) {
|
||||
@@ -315,9 +470,4 @@ public class PairingCandidateService {
|
||||
private LocalDate min(LocalDate left, LocalDate right) {
|
||||
return left.isBefore(right) ? left : right;
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingCandidateService(final PairingProperties pairingProperties) {
|
||||
this.pairingProperties = pairingProperties;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,20 @@
|
||||
package com.kri.p6.ncrc.pairing.service;
|
||||
|
||||
import static com.kri.p6.ncrc.pairing.common.consts.PairingConstant.RESULT_SHEET_AB_PAIR;
|
||||
import static com.kri.p6.ncrc.pairing.common.consts.PairingConstant.RESULT_SHEET_ASSIGNMENT;
|
||||
import static com.kri.p6.ncrc.pairing.common.consts.PairingConstant.RESULT_SHEET_CANDIDATE_SUMMARY;
|
||||
import static com.kri.p6.ncrc.pairing.common.consts.PairingConstant.RESULT_SHEET_RULE_CHECK;
|
||||
import static com.kri.p6.ncrc.pairing.common.consts.PairingConstant.RESULT_SHEET_SUMMARY;
|
||||
import static com.kri.p6.ncrc.pairing.common.consts.PairingConstant.RESULT_SHEET_UNASSIGNED_CENTER;
|
||||
import static com.kri.p6.ncrc.pairing.common.consts.PairingConstant.RESULT_SHEET_UNUSED_MEMBER;
|
||||
import static com.kri.p6.ncrc.pairing.common.consts.PairingConstant.RESULT_SHEET_VALIDATION_ERROR;
|
||||
import static com.kri.p6.ncrc.pairing.common.consts.PairingConstant.SHEET_CENTER;
|
||||
import static com.kri.p6.ncrc.pairing.common.consts.PairingConstant.SHEET_CENTER_ADJACENT_REGION;
|
||||
import static com.kri.p6.ncrc.pairing.common.consts.PairingConstant.SHEET_MEMBER;
|
||||
import static com.kri.p6.ncrc.pairing.common.consts.PairingConstant.SHEET_MEMBER_REGION_CODE;
|
||||
import static com.kri.p6.ncrc.pairing.common.consts.PairingConstant.SHEET_MUNICIPALITY;
|
||||
import static com.kri.p6.ncrc.pairing.common.consts.PairingConstant.SHEET_PREFERENCE_MATCH;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelMapper;
|
||||
import com.kri.common.feature.web.BusinessException;
|
||||
import com.kri.p6.ncrc.pairing.config.PairingProperties;
|
||||
@@ -25,133 +40,66 @@ import java.io.InputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import lombok.Generated;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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
|
||||
@RequiredArgsConstructor
|
||||
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 {
|
||||
if (file == null || file.isEmpty()) {
|
||||
throw BusinessException.badRequest("PAIRING_EMPTY_FILE", "업로드된 엑셀 파일이 없습니다.");
|
||||
}
|
||||
|
||||
try (InputStream inputStream = file.getInputStream();
|
||||
Workbook workbook = WorkbookFactory.create(inputStream)) {
|
||||
return PairingWorkbookData.builder()
|
||||
.members(readSheet(workbook, MemberExcelDto.class, SHEET_MEMBER))
|
||||
.municipalities(readSheet(workbook, MunicipalityExcelDto.class, SHEET_MUNICIPALITY))
|
||||
.centers(readSheet(workbook, CenterExcelDto.class, SHEET_CENTER))
|
||||
.memberRegionCodes(readSheet(workbook, MemberRegionCodeExcelDto.class,
|
||||
SHEET_MEMBER_REGION_CODE))
|
||||
.centerAdjacentRegions(readSheet(workbook, CenterAdjacentRegionExcelDto.class,
|
||||
SHEET_CENTER_ADJACENT_REGION))
|
||||
.preferenceMatchRules(readSheet(workbook, PreferenceMatchExcelDto.class,
|
||||
SHEET_PREFERENCE_MATCH))
|
||||
.build();
|
||||
} catch (BusinessException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
throw BusinessException.badRequest("PAIRING_EXCEL_READ_FAILED",
|
||||
"엑셀 파일을 읽는 중 오류가 발생했습니다: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] write(PairingResult result) {
|
||||
try {
|
||||
Workbook workbook = ExcelMapper.writeToWorkbook(result.getAssignments(),
|
||||
AssignmentResultExcelDto.class, "배정결과");
|
||||
try (Workbook workbook = ExcelMapper.writeToWorkbook(result.getAssignments(),
|
||||
AssignmentResultExcelDto.class, RESULT_SHEET_ASSIGNMENT);
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
|
||||
|
||||
byte[] var4;
|
||||
try {
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
ExcelMapper.appendSheetToWorkbook(workbook, result.getUnassignedCenters(),
|
||||
UnassignedCenterExcelDto.class, RESULT_SHEET_UNASSIGNED_CENTER, headerRowIndex());
|
||||
ExcelMapper.appendSheetToWorkbook(workbook, result.getUnusedMembers(),
|
||||
UnusedMemberExcelDto.class, RESULT_SHEET_UNUSED_MEMBER, headerRowIndex());
|
||||
ExcelMapper.appendSheetToWorkbook(workbook, result.getSummaries(),
|
||||
PairingSummaryExcelDto.class, RESULT_SHEET_SUMMARY, headerRowIndex());
|
||||
ExcelMapper.appendSheetToWorkbook(workbook, result.getAbPairs(), ABPairExcelDto.class,
|
||||
RESULT_SHEET_AB_PAIR, headerRowIndex());
|
||||
ExcelMapper.appendSheetToWorkbook(workbook, result.getCandidateSummaries(),
|
||||
CandidateSummaryExcelDto.class, RESULT_SHEET_CANDIDATE_SUMMARY, headerRowIndex());
|
||||
ExcelMapper.appendSheetToWorkbook(workbook, result.getValidationErrors(),
|
||||
ValidationErrorExcelDto.class, RESULT_SHEET_VALIDATION_ERROR, headerRowIndex());
|
||||
ExcelMapper.appendSheetToWorkbook(workbook, result.getRuleViolations(),
|
||||
RuleViolationExcelDto.class, RESULT_SHEET_RULE_CHECK, headerRowIndex());
|
||||
|
||||
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;
|
||||
workbook.write(outputStream);
|
||||
return outputStream.toByteArray();
|
||||
} catch (IOException e) {
|
||||
throw BusinessException.badRequest("PAIRING_EXCEL_WRITE_FAILED",
|
||||
"결과 엑셀 파일을 생성하는 중 오류가 발생했습니다: " + e.getMessage());
|
||||
@@ -159,32 +107,37 @@ public class PairingExcelService {
|
||||
}
|
||||
|
||||
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())
|
||||
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);
|
||||
.ruleViolations(List.of())
|
||||
.build();
|
||||
return 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();
|
||||
}
|
||||
|
||||
return ExcelMapper.readFromWorkbook(workbook, type, sheetName, headerRowIndex()).stream()
|
||||
.filter(row -> !isBlankRow(row))
|
||||
.toList();
|
||||
}
|
||||
|
||||
private int headerRowIndex() {
|
||||
return this.pairingProperties.getExcel().getHeaderRowIndex();
|
||||
return pairingProperties.getExcel().getHeaderRowIndex();
|
||||
}
|
||||
|
||||
private boolean isBlankRow(Object row) {
|
||||
return Arrays.stream(row.getClass().getDeclaredFields())
|
||||
.allMatch((field) -> this.isBlankField(row, field));
|
||||
.allMatch(field -> isBlankField(row, field));
|
||||
}
|
||||
|
||||
private boolean isBlankField(Object row, Field field) {
|
||||
@@ -197,9 +150,4 @@ public class PairingExcelService {
|
||||
"엑셀 행을 확인하는 중 오류가 발생했습니다: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingExcelService(final PairingProperties pairingProperties) {
|
||||
this.pairingProperties = pairingProperties;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,10 +8,11 @@ import java.time.format.DateTimeFormatter;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.Generated;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class PairingHolidayService {
|
||||
|
||||
private static final DateTimeFormatter DATAGO_DATE_FORMAT = DateTimeFormatter.ofPattern(
|
||||
@@ -19,8 +20,8 @@ public class PairingHolidayService {
|
||||
private final DatagoHolidayCache datagoHolidayCache;
|
||||
|
||||
public PairingData applyHolidayUnavailableDates(PairingData data) {
|
||||
Set<String> years = this.collectYears(data);
|
||||
Set<LocalDate> holidays = this.datagoHolidayCache.getHolidays(years).stream()
|
||||
Set<String> years = collectYears(data);
|
||||
Set<LocalDate> holidays = 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())
|
||||
@@ -31,12 +32,12 @@ public class PairingHolidayService {
|
||||
|
||||
private Set<String> collectYears(PairingData data) {
|
||||
Set<String> years = new HashSet();
|
||||
data.getMembers().forEach((member) -> this.addYears(years, member.getAvailableStartDate(),
|
||||
data.getMembers().forEach((member) -> addYears(years, member.getAvailableStartDate(),
|
||||
member.getAvailableEndDate()));
|
||||
data.getMunicipalities().forEach(
|
||||
(municipality) -> this.addYears(years, municipality.getAvailableStartDate(),
|
||||
(municipality) -> addYears(years, municipality.getAvailableStartDate(),
|
||||
municipality.getAvailableEndDate()));
|
||||
data.getCenters().forEach((center) -> this.addYears(years, center.getAvailableStartDate(),
|
||||
data.getCenters().forEach((center) -> addYears(years, center.getAvailableStartDate(),
|
||||
center.getAvailableEndDate()));
|
||||
return years;
|
||||
}
|
||||
@@ -51,9 +52,4 @@ public class PairingHolidayService {
|
||||
private LocalDate toHolidayDate(HolidayDto holidayDto) {
|
||||
return LocalDate.parse(holidayDto.getHolidayDate(), DATAGO_DATE_FORMAT);
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingHolidayService(final DatagoHolidayCache datagoHolidayCache) {
|
||||
this.datagoHolidayCache = datagoHolidayCache;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,17 +20,21 @@ 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.ZonedDateTime;
|
||||
import java.time.format.DateTimeParseException;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.Generated;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class PairingNormalizeService {
|
||||
|
||||
private final PairingProperties pairingProperties;
|
||||
@@ -49,75 +53,74 @@ public class PairingNormalizeService {
|
||||
}
|
||||
|
||||
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();
|
||||
return Member.builder().id(required(row.getId(), "위원 id"))
|
||||
.gender(parseGender(row.getGender()))
|
||||
.experienceType(parseExperienceType(row.getExperience()))
|
||||
.role(parseMemberRole(row.getRole()))
|
||||
.availableStartDate(parseDate(row.getAvailableStartDate(), "위원 진행 시작일"))
|
||||
.availableEndDate(parseDate(row.getAvailableEndDate(), "위원 진행 종료일"))
|
||||
.unavailableDates(parseDateSet(row.getUnavailableDates(), "위원 진행 불가 일자"))
|
||||
.activityRegion(normalizeCsvCodes(row.getActivityRegion(), regionCodeLength(), "위원 활동지역"))
|
||||
.historyCenterIds(parseCsv(row.getHistoryCenters())).residenceCode(
|
||||
normalizeOptionalCode(row.getResidenceCode(), residenceCodeLength(), "위원 거주지"))
|
||||
.preferenceRegions(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();
|
||||
return Municipality.builder().id(required(row.getId(), "지자체 id"))
|
||||
.availableStartDate(parseDate(row.getAvailableStartDate(), "지자체 진행 시작일"))
|
||||
.availableEndDate(parseDate(row.getAvailableEndDate(), "지자체 진행 종료일"))
|
||||
.unavailableDates(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(), "센터 여성 위원만"))
|
||||
return Center.builder().id(required(row.getId(), "센터 id"))
|
||||
.municipalityId(required(row.getMunicipalityId(), "센터 지자체 id"))
|
||||
.womenOnly(parseBooleanFlag(row.getWomenOnly(), "센터 여성 위원만"))
|
||||
.adjacentRegionClassification(
|
||||
this.required(row.getAdjacentRegionClassification(), "센터 인접지역 분류"))
|
||||
.availableStartDate(this.parseDate(row.getAvailableStartDate(), "센터 진행 시작일"))
|
||||
.availableEndDate(this.parseDate(row.getAvailableEndDate(), "센터 진행 종료일"))
|
||||
.unavailableDates(this.parseDateSet(row.getUnavailableDates(), "센터 진행 불가 일자")).build();
|
||||
required(row.getAdjacentRegionClassification(), "센터 인접지역 분류"))
|
||||
.availableStartDate(parseDate(row.getAvailableStartDate(), "센터 진행 시작일"))
|
||||
.availableEndDate(parseDate(row.getAvailableEndDate(), "센터 진행 종료일"))
|
||||
.unavailableDates(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)
|
||||
String regionCode = normalizeCode(row.getRegionCode(), regionCodeLength(), "권역코드");
|
||||
String detailRegionCode = normalizeCode(row.getDetailRegionCode(), 1, "세부권역코드");
|
||||
String detailAreaCode = normalizeCode(row.getDetailAreaCode(), 2, "세부지역코드");
|
||||
return MemberRegionCode.builder().sido(clean(row.getSido()))
|
||||
.sigungu(clean(row.getSigungu())).regionCode(regionCode)
|
||||
.detailRegionCode(detailRegionCode).detailAreaCode(detailAreaCode).fullRegionCode(
|
||||
this.normalizeFullRegionCode(row.getFullRegionCode(), regionCode, detailRegionCode,
|
||||
normalizeFullRegionCode(row.getFullRegionCode(), regionCode, detailRegionCode,
|
||||
detailAreaCode)).build();
|
||||
}
|
||||
|
||||
private CenterAdjacentRegion toCenterAdjacentRegion(CenterAdjacentRegionExcelDto row) {
|
||||
return CenterAdjacentRegion.builder().dispatchRegion(
|
||||
this.normalizeCode(row.getDispatchRegion(), this.regionCodeLength(), "센터 인접지역표 권역"))
|
||||
normalizeCode(row.getDispatchRegion(), regionCodeLength(), "센터 인접지역표 권역"))
|
||||
.adjacentRegionClassification(
|
||||
this.required(row.getAdjacentRegionClassification(), "인접지역 분류")).build();
|
||||
required(row.getAdjacentRegionClassification(), "인접지역 분류")).build();
|
||||
}
|
||||
|
||||
private PreferenceMatchRule toPreferenceMatchRule(PreferenceMatchExcelDto row) {
|
||||
return PreferenceMatchRule.builder().priority(this.parseInt(row.getPriority(), "매칭 순위"))
|
||||
.fieldMemberPreferenceRank(this.parseInt(row.getFieldMemberPreferenceRank(), "현장위원 선호 순위"))
|
||||
return PreferenceMatchRule.builder().priority(parseInt(row.getPriority(), "매칭 순위"))
|
||||
.fieldMemberPreferenceRank(parseInt(row.getFieldMemberPreferenceRank(), "현장위원 선호 순위"))
|
||||
.externalMemberPreferenceRank(
|
||||
this.parseInt(row.getExternalMemberPreferenceRank(), "외부위원 선호 순위")).build();
|
||||
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")));
|
||||
normalizeCode(row.getPreferenceRegion1(), regionCodeLength(), "선호 지역1"),
|
||||
normalizeCode(row.getPreferenceRegion2(), regionCodeLength(), "선호 지역2"),
|
||||
normalizeCode(row.getPreferenceRegion3(), regionCodeLength(), "선호 지역3"),
|
||||
normalizeCode(row.getPreferenceRegion4(), 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))) {
|
||||
preferences.set(i, anyRegionCode());
|
||||
} else if (anyRegionCode().equals(preferences.get(i))) {
|
||||
anyRegionAppeared = true;
|
||||
}
|
||||
}
|
||||
@@ -126,70 +129,79 @@ public class PairingNormalizeService {
|
||||
}
|
||||
|
||||
private Gender parseGender(String value) {
|
||||
String cleaned = this.required(value, "성별");
|
||||
if ("여".equals(cleaned)) {
|
||||
String cleaned = required(value, "성별");
|
||||
if ("여성".equals(cleaned) || "여".equals(cleaned) || "F".equalsIgnoreCase(cleaned)
|
||||
|| "FEMALE".equalsIgnoreCase(cleaned)) {
|
||||
return Gender.FEMALE;
|
||||
} else if ("남".equals(cleaned)) {
|
||||
} else if ("남성".equals(cleaned) || "남".equals(cleaned) || "M".equalsIgnoreCase(cleaned)
|
||||
|| "MALE".equalsIgnoreCase(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)) {
|
||||
String cleaned = required(value, "경력여부");
|
||||
if ("경력".equals(cleaned) || "경력자".equals(cleaned)
|
||||
|| "EXPERIENCED".equalsIgnoreCase(cleaned)) {
|
||||
return ExperienceType.EXPERIENCED;
|
||||
} else if ("신규".equals(cleaned)) {
|
||||
} else if ("신규".equals(cleaned) || "NEW".equalsIgnoreCase(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)) {
|
||||
String cleaned = required(value, "현장/외부 구분");
|
||||
if ("현장".equals(cleaned) || "FIELD".equalsIgnoreCase(cleaned)) {
|
||||
return MemberRole.FIELD;
|
||||
} else if ("외부".equals(cleaned)) {
|
||||
} else if ("외부".equals(cleaned) || "EXTERNAL".equalsIgnoreCase(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);
|
||||
}
|
||||
String cleaned = required(value, fieldName);
|
||||
return "1".equals(cleaned);
|
||||
}
|
||||
|
||||
private LocalDate parseDate(String value, String fieldName) {
|
||||
String cleaned = this.required(value, fieldName);
|
||||
String cleaned = required(value, fieldName);
|
||||
|
||||
try {
|
||||
return LocalDate.parse(cleaned);
|
||||
} catch (DateTimeParseException var5) {
|
||||
throw BusinessException.badRequest("PAIRING_INVALID_DATE",
|
||||
fieldName + " 날짜 형식이 올바르지 않습니다: " + value);
|
||||
} catch (DateTimeParseException ignored) {
|
||||
try {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("EEE MMM dd HH:mm:ss z yyyy",
|
||||
Locale.ENGLISH);
|
||||
return ZonedDateTime.parse(cleaned, formatter).toLocalDate();
|
||||
} catch (DateTimeParseException e) {
|
||||
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))
|
||||
if (isFormulaText(value)) {
|
||||
return new LinkedHashSet<>();
|
||||
}
|
||||
|
||||
return (Set) parseCsv(value).stream()
|
||||
.filter(date -> !isFormulaText(date))
|
||||
.map((date) -> parseDate(date, fieldName))
|
||||
.collect(Collectors.toCollection(LinkedHashSet::new));
|
||||
}
|
||||
|
||||
private boolean isFormulaText(String value) {
|
||||
String cleaned = clean(value);
|
||||
return cleaned.startsWith("=") || cleaned.matches("[A-Za-z]+\\(.*");
|
||||
}
|
||||
|
||||
private Set<String> parseCsv(String value) {
|
||||
String cleaned = this.clean(value);
|
||||
String cleaned = clean(value);
|
||||
return (Set<String>) (cleaned.isBlank() ? new LinkedHashSet()
|
||||
: (Set) Arrays.stream(cleaned.split(",")).map(String::trim)
|
||||
.filter((token) -> !token.isBlank())
|
||||
@@ -197,7 +209,7 @@ public class PairingNormalizeService {
|
||||
}
|
||||
|
||||
private int parseInt(String value, String fieldName) {
|
||||
String cleaned = this.required(value, fieldName);
|
||||
String cleaned = required(value, fieldName);
|
||||
|
||||
try {
|
||||
return Integer.parseInt(cleaned);
|
||||
@@ -208,7 +220,7 @@ public class PairingNormalizeService {
|
||||
}
|
||||
|
||||
private String normalizeCode(String value, int length, String fieldName) {
|
||||
String cleaned = this.required(value, fieldName);
|
||||
String cleaned = required(value, fieldName);
|
||||
if (cleaned.endsWith(".0")) {
|
||||
cleaned = cleaned.substring(0, cleaned.length() - 2);
|
||||
}
|
||||
@@ -224,15 +236,26 @@ public class PairingNormalizeService {
|
||||
}
|
||||
}
|
||||
|
||||
private String normalizeOptionalCode(String value, int length, String fieldName) {
|
||||
String cleaned = clean(value);
|
||||
return cleaned.isBlank() ? "" : normalizeCode(cleaned, length, fieldName);
|
||||
}
|
||||
|
||||
private String normalizeCsvCodes(String value, int length, String fieldName) {
|
||||
return parseCsv(value).stream()
|
||||
.map(code -> normalizeCode(code, length, fieldName))
|
||||
.collect(Collectors.joining(","));
|
||||
}
|
||||
|
||||
private String normalizeFullRegionCode(String value, String regionCode, String detailRegionCode,
|
||||
String detailAreaCode) {
|
||||
String cleaned = this.clean(value);
|
||||
return cleaned.matches("\\d+") ? this.normalizeCode(cleaned, 5, "지역 코드")
|
||||
String cleaned = clean(value);
|
||||
return cleaned.matches("\\d+") ? normalizeCode(cleaned, 5, "지역 코드")
|
||||
: regionCode + detailRegionCode + detailAreaCode;
|
||||
}
|
||||
|
||||
private String required(String value, String fieldName) {
|
||||
String cleaned = this.clean(value);
|
||||
String cleaned = clean(value);
|
||||
if (cleaned.isBlank()) {
|
||||
throw BusinessException.badRequest("PAIRING_REQUIRED_VALUE_MISSING",
|
||||
"필수 값이 없습니다: " + fieldName);
|
||||
@@ -246,19 +269,15 @@ public class PairingNormalizeService {
|
||||
}
|
||||
|
||||
private int regionCodeLength() {
|
||||
return this.pairingProperties.getCode().getRegionCodeLength();
|
||||
return pairingProperties.getCode().getRegionCodeLength();
|
||||
}
|
||||
|
||||
private int residenceCodeLength() {
|
||||
return this.pairingProperties.getCode().getResidenceCodeLength();
|
||||
return pairingProperties.getCode().getResidenceCodeLength();
|
||||
}
|
||||
|
||||
private String anyRegionCode() {
|
||||
return this.pairingProperties.getCode().getAnyRegionCode();
|
||||
return pairingProperties.getCode().getAnyRegionCode();
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingNormalizeService(final PairingProperties pairingProperties) {
|
||||
this.pairingProperties = pairingProperties;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,12 @@ 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 lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class PairingService {
|
||||
|
||||
private final PairingExcelService pairingExcelService;
|
||||
@@ -19,27 +20,12 @@ public class PairingService {
|
||||
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;
|
||||
PairingWorkbookData workbookData = pairingExcelService.read(file);
|
||||
PairingData pairingData = pairingNormalizeService.normalize(workbookData);
|
||||
pairingData = pairingHolidayService.applyHolidayUnavailableDates(pairingData);
|
||||
pairingValidationService.validate(pairingData);
|
||||
PairingCandidates candidates = pairingCandidateService.generate(pairingData);
|
||||
PairingResult result = pairingSolverService.solve(pairingData, candidates);
|
||||
return pairingExcelService.write(result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,46 +39,47 @@ import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import lombok.Generated;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class PairingSolverService {
|
||||
|
||||
private final PairingProperties pairingProperties;
|
||||
|
||||
public PairingResult solve(PairingData data, PairingCandidates candidates) {
|
||||
if (candidates.getAssignmentCandidates().isEmpty()) {
|
||||
return this.emptyResult(data, candidates, "배정 가능한 후보가 없습니다.");
|
||||
return 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,
|
||||
BoolVar[] assignmentVars = createAssignmentVars(model, assignmentCandidates);
|
||||
Map<String, BoolVar> pairUsedVars = createPairUsedVars(model, assignmentCandidates);
|
||||
Map<String, BoolVar> pairDayVars = createPairDayVars(model, assignmentCandidates);
|
||||
Map<String, BoolVar> pairDayAdjacentVars = createPairDayAdjacentVars(model,
|
||||
assignmentCandidates);
|
||||
this.linkHelperVars(model, assignmentCandidates, assignmentVars, pairUsedVars, pairDayVars,
|
||||
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));
|
||||
addCenterAssignedAtMostOnce(model, assignmentCandidates, assignmentVars);
|
||||
addPairDailyCapacity(model, assignmentCandidates, assignmentVars);
|
||||
addMemberDailyOnePair(model, assignmentCandidates, pairDayVars);
|
||||
addPairDailyOneAdjacentClassification(model, assignmentCandidates, pairDayAdjacentVars);
|
||||
addBuddyLimit(model, assignmentCandidates, pairUsedVars);
|
||||
model.maximize(createObjective(assignmentCandidates, assignmentVars));
|
||||
CpSolver solver = new CpSolver();
|
||||
solver.getParameters()
|
||||
.setMaxTimeInSeconds(this.pairingProperties.getSolver().getMaxTimeSeconds());
|
||||
.setMaxTimeInSeconds(pairingProperties.getSolver().getMaxTimeSeconds());
|
||||
solver.getParameters()
|
||||
.setNumSearchWorkers(this.pairingProperties.getSolver().getNumSearchWorkers());
|
||||
.setNumSearchWorkers(pairingProperties.getSolver().getNumSearchWorkers());
|
||||
CpSolverStatus status = solver.solve(model);
|
||||
if (status != CpSolverStatus.OPTIMAL && status != CpSolverStatus.FEASIBLE) {
|
||||
return this.emptyResult(data, candidates,
|
||||
return emptyResult(data, candidates,
|
||||
"solver가 feasible 해를 찾지 못했습니다: " + String.valueOf(status));
|
||||
} else {
|
||||
List<AssignmentCandidate> selectedAssignments = this.collectSelectedAssignments(
|
||||
List<AssignmentCandidate> selectedAssignments = collectSelectedAssignments(
|
||||
assignmentCandidates, assignmentVars, solver);
|
||||
return this.toResult(data, candidates, selectedAssignments, status);
|
||||
return toResult(data, candidates, selectedAssignments, status);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -119,29 +120,29 @@ public class PairingSolverService {
|
||||
for (int i = 0; i < candidates.size(); ++i) {
|
||||
AssignmentCandidate candidate = (AssignmentCandidate) candidates.get(i);
|
||||
model.addLessOrEqual(assignmentVars[i],
|
||||
(LinearArgument) pairUsedVars.get(this.pairKey(candidate)));
|
||||
(LinearArgument) pairUsedVars.get(pairKey(candidate)));
|
||||
model.addLessOrEqual(assignmentVars[i],
|
||||
(LinearArgument) pairDayVars.get(this.pairDayKey(candidate)));
|
||||
(LinearArgument) pairDayVars.get(pairDayKey(candidate)));
|
||||
model.addLessOrEqual(assignmentVars[i],
|
||||
(LinearArgument) pairDayAdjacentVars.get(this.pairDayAdjacentKey(candidate)));
|
||||
(LinearArgument) pairDayAdjacentVars.get(pairDayAdjacentKey(candidate)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void addCenterAssignedAtMostOnce(CpModel model, List<AssignmentCandidate> candidates,
|
||||
BoolVar[] assignmentVars) {
|
||||
Map<String, List<Integer>> indexesByCenter = this.groupIndexes(candidates,
|
||||
Map<String, List<Integer>> indexesByCenter = groupIndexes(candidates,
|
||||
AssignmentCandidate::getCenterId);
|
||||
indexesByCenter.values()
|
||||
.forEach((indexes) -> model.addAtMostOne(this.toLiteralArray(indexes, assignmentVars)));
|
||||
.forEach((indexes) -> model.addAtMostOne(toLiteralArray(indexes, assignmentVars)));
|
||||
}
|
||||
|
||||
private void addPairDailyCapacity(CpModel model, List<AssignmentCandidate> candidates,
|
||||
BoolVar[] assignmentVars) {
|
||||
Map<String, List<Integer>> indexesByPairDay = this.groupIndexes(candidates, this::pairDayKey);
|
||||
Map<String, List<Integer>> indexesByPairDay = groupIndexes(candidates, this::pairDayKey);
|
||||
indexesByPairDay.values().forEach((indexes) -> model.addLessOrEqual(
|
||||
LinearExpr.sum(this.toLinearArgumentArray(indexes, assignmentVars)),
|
||||
(long) this.pairingProperties.getRule().getMaxCentersPerPairPerDay()));
|
||||
LinearExpr.sum(toLinearArgumentArray(indexes, assignmentVars)),
|
||||
(long) pairingProperties.getRule().getMaxCentersPerPairPerDay()));
|
||||
}
|
||||
|
||||
private void addMemberDailyOnePair(CpModel model, List<AssignmentCandidate> candidates,
|
||||
@@ -200,7 +201,7 @@ public class PairingSolverService {
|
||||
Objects.requireNonNull(pairUsedVars);
|
||||
model.addLessOrEqual(LinearExpr.sum((LinearArgument[]) var10001.map(pairUsedVars::get)
|
||||
.toArray((x$0) -> new LinearArgument[x$0])),
|
||||
(long) this.pairingProperties.getRule().getMaxCounterpartsPerMember());
|
||||
(long) pairingProperties.getRule().getMaxCounterpartsPerMember());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -212,11 +213,11 @@ public class PairingSolverService {
|
||||
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()
|
||||
weights[i] = pairingProperties.getObjective().getAssignmentWeight() + Math.max(0L,
|
||||
pairingProperties.getObjective().getPreferenceBaseWeight()
|
||||
- (long) candidate.getPreferencePriority() * pairingProperties.getObjective()
|
||||
.getPreferenceRankPenalty())
|
||||
+ (long) candidate.getResidenceMatchScore() * this.pairingProperties.getObjective()
|
||||
+ (long) candidate.getResidenceMatchScore() * pairingProperties.getObjective()
|
||||
.getResidenceMatchWeight();
|
||||
}
|
||||
|
||||
@@ -250,14 +251,14 @@ public class PairingSolverService {
|
||||
.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);
|
||||
ABPairBuildResult abPairBuildResult = createABPairMatches(selectedAssignments);
|
||||
Map<String, ABPairMatch> abPairMatches = abPairBuildResult.matches();
|
||||
List<AssignmentResultExcelDto> assignments = selectedAssignments.stream()
|
||||
.map((candidate) -> this.toAssignmentResult(candidate, memberMap, centerMap, abPairMatches))
|
||||
.map((candidate) -> 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()))
|
||||
.map((center) -> toUnassignedCenter(center, candidates.getUnassignedCenterReasons()))
|
||||
.toList();
|
||||
List<UnusedMemberExcelDto> unusedMembers = data.getMembers().stream()
|
||||
.filter((member) -> !usedMemberIds.contains(member.getId())).map(
|
||||
@@ -265,13 +266,13 @@ public class PairingSolverService {
|
||||
"선택된 최적해에 포함되지 않았습니다. 후보 부족 또는 제약 충돌 가능")).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()))
|
||||
createSummaries(data, candidates, assignments.size(), unassignedCenters.size(),
|
||||
unusedMembers.size(), countABGroups(abPairMatches), status.name()))
|
||||
.abPairs(abPairBuildResult.rows()).candidateSummaries(
|
||||
this.createCandidateSummaries(data, candidates, assignments.size(),
|
||||
unassignedCenters.size(), unusedMembers.size(), this.countABGroups(abPairMatches)))
|
||||
createCandidateSummaries(data, candidates, assignments.size(),
|
||||
unassignedCenters.size(), unusedMembers.size(), countABGroups(abPairMatches)))
|
||||
.validationErrors(List.of())
|
||||
.ruleViolations(this.createRuleChecks(data, selectedAssignments, abPairMatches)).build();
|
||||
.ruleViolations(createRuleChecks(data, selectedAssignments, abPairMatches)).build();
|
||||
}
|
||||
|
||||
private PairingResult emptyResult(PairingData data, PairingCandidates candidates, String reason) {
|
||||
@@ -280,9 +281,9 @@ public class PairingSolverService {
|
||||
(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(),
|
||||
.toList()).summaries(createSummaries(data, candidates, 0, data.getCenters().size(),
|
||||
data.getMembers().size(), 0, reason)).abPairs(List.of()).candidateSummaries(
|
||||
this.createCandidateSummaries(data, candidates, 0, data.getCenters().size(),
|
||||
createCandidateSummaries(data, candidates, 0, data.getCenters().size(),
|
||||
data.getMembers().size(), 0)).validationErrors(List.of())
|
||||
.ruleViolations(List.of(new RuleViolationExcelDto("solver feasible 해", "FAIL", reason)))
|
||||
.build();
|
||||
@@ -294,16 +295,16 @@ public class PairingSolverService {
|
||||
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));
|
||||
ABPairMatch abPairMatch = (ABPairMatch) abPairMatches.get(pairKey(candidate));
|
||||
return new AssignmentResultExcelDto(candidate.getDate().toString(),
|
||||
candidate.getFieldMemberId(), this.formatGender(fieldMember.getGender()),
|
||||
this.formatExperience(fieldMember.getExperienceType()), fieldMember.getResidenceCode(),
|
||||
candidate.getFieldMemberId(), formatGender(fieldMember.getGender()),
|
||||
formatExperience(fieldMember.getExperienceType()), fieldMember.getResidenceCode(),
|
||||
fieldMember.getActivityRegion(),
|
||||
this.formatPreferenceRank(candidate.getFieldMemberPreferenceRank()),
|
||||
candidate.getExternalMemberId(), this.formatGender(externalMember.getGender()),
|
||||
this.formatExperience(externalMember.getExperienceType()),
|
||||
formatPreferenceRank(candidate.getFieldMemberPreferenceRank()),
|
||||
candidate.getExternalMemberId(), formatGender(externalMember.getGender()),
|
||||
formatExperience(externalMember.getExperienceType()),
|
||||
externalMember.getResidenceCode(), externalMember.getActivityRegion(),
|
||||
this.formatPreferenceRank(candidate.getExternalMemberPreferenceRank()),
|
||||
formatPreferenceRank(candidate.getExternalMemberPreferenceRank()),
|
||||
candidate.getCenterId(), candidate.getMunicipalityId(), center.isWomenOnly() ? "1" : "0",
|
||||
candidate.getDispatchRegion(), candidate.getAdjacentRegionClassification(),
|
||||
String.valueOf(candidate.getPreferencePriority()),
|
||||
@@ -378,9 +379,9 @@ public class PairingSolverService {
|
||||
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));
|
||||
matches.put(pair.pairKey(), toABPairMatch(groupId, pair, counterpart));
|
||||
matches.put(counterpart.pairKey(), toABPairMatch(groupId, counterpart, pair));
|
||||
rows.add(toABPairRow(groupId, pair, counterpart));
|
||||
alreadyMatched.add(pair.pairKey());
|
||||
alreadyMatched.add(counterpart.pairKey());
|
||||
}
|
||||
@@ -415,7 +416,7 @@ public class PairingSolverService {
|
||||
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()),
|
||||
formatDates(pair.dates()), formatDates(counterpart.dates()),
|
||||
dateOverlapped ? "Y" : "N");
|
||||
}
|
||||
|
||||
@@ -437,7 +438,7 @@ public class PairingSolverService {
|
||||
new CandidateSummaryExcelDto("센터 수", String.valueOf(data.getCenters().size()), "입력 센터 수"),
|
||||
new CandidateSummaryExcelDto("여성 전용 센터 수", String.valueOf(womenOnlyCenterCount),
|
||||
"여성 위원만 가능한 센터 수"), new CandidateSummaryExcelDto("공휴일 수",
|
||||
String.valueOf(this.commonUnavailableDates(data).size()), "배정 제외 공통 불가일자 수"),
|
||||
String.valueOf(commonUnavailableDates(data).size()), "배정 제외 공통 불가일자 수"),
|
||||
new CandidateSummaryExcelDto("페어 후보 수",
|
||||
String.valueOf(candidates.getPairCandidates().size()), "현장+외부 조합 후보 수"),
|
||||
new CandidateSummaryExcelDto("파견 권역 후보 수",
|
||||
@@ -461,18 +462,18 @@ public class PairingSolverService {
|
||||
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(
|
||||
checks.add(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));
|
||||
checks.add(checkMaxGroupCount(selectedAssignments, this::pairDayKey,
|
||||
pairingProperties.getRule().getMaxCentersPerPairPerDay(), "한 페어 하루 최대 센터 수"));
|
||||
checks.add(checkMemberDateDuplicate(selectedAssignments));
|
||||
checks.add(checkPairDayAdjacentClassification(selectedAssignments));
|
||||
checks.add(checkWomenOnly(selectedAssignments, memberMap, centerMap));
|
||||
checks.add(checkActivityRegion(selectedAssignments, memberMap));
|
||||
checks.add(checkHistoryCenter(selectedAssignments, memberMap));
|
||||
checks.add(checkHoliday(selectedAssignments, commonUnavailableDates(data)));
|
||||
checks.add(checkABDateOverlap(abPairMatches));
|
||||
return checks;
|
||||
}
|
||||
|
||||
@@ -502,10 +503,10 @@ public class PairingSolverService {
|
||||
assignments.forEach((candidate) -> {
|
||||
((Set) pairKeysByMemberDate.computeIfAbsent(
|
||||
candidate.getFieldMemberId() + "|" + String.valueOf(candidate.getDate()),
|
||||
(key) -> new HashSet())).add(this.pairKey(candidate));
|
||||
(key) -> new HashSet())).add(pairKey(candidate));
|
||||
((Set) pairKeysByMemberDate.computeIfAbsent(
|
||||
candidate.getExternalMemberId() + "|" + String.valueOf(candidate.getDate()),
|
||||
(key) -> new HashSet())).add(this.pairKey(candidate));
|
||||
(key) -> new HashSet())).add(pairKey(candidate));
|
||||
});
|
||||
List<String> violations = pairKeysByMemberDate.entrySet().stream()
|
||||
.filter((entry) -> ((Set) entry.getValue()).size() > 1).map((entry) -> {
|
||||
@@ -546,10 +547,10 @@ public class PairingSolverService {
|
||||
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()))
|
||||
hasActivityRegion(memberMap.get(candidate.getFieldMemberId()),
|
||||
candidate.getDispatchRegion())
|
||||
|| hasActivityRegion(memberMap.get(candidate.getExternalMemberId()),
|
||||
candidate.getDispatchRegion()))
|
||||
.map((candidate) -> {
|
||||
String var10000 = candidate.getCenterId();
|
||||
return var10000 + ":" + candidate.getDispatchRegion();
|
||||
@@ -558,6 +559,12 @@ public class PairingSolverService {
|
||||
violations.isEmpty() ? "위반 없음" : String.join(", ", violations));
|
||||
}
|
||||
|
||||
private boolean hasActivityRegion(Member member, String dispatchRegion) {
|
||||
return java.util.Arrays.stream(member.getActivityRegion().split(","))
|
||||
.map(String::trim)
|
||||
.anyMatch(dispatchRegion::equals);
|
||||
}
|
||||
|
||||
private RuleViolationExcelDto checkHistoryCenter(List<AssignmentCandidate> assignments,
|
||||
Map<String, Member> memberMap) {
|
||||
List<String> violations = assignments.stream().filter((candidate) ->
|
||||
@@ -623,20 +630,15 @@ public class PairingSolverService {
|
||||
}
|
||||
|
||||
private String pairDayKey(AssignmentCandidate candidate) {
|
||||
String var10000 = this.pairKey(candidate);
|
||||
String var10000 = pairKey(candidate);
|
||||
return var10000 + "|" + String.valueOf(candidate.getDate());
|
||||
}
|
||||
|
||||
private String pairDayAdjacentKey(AssignmentCandidate candidate) {
|
||||
String var10000 = this.pairDayKey(candidate);
|
||||
String var10000 = pairDayKey(candidate);
|
||||
return var10000 + "|" + candidate.getAdjacentRegionClassification();
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingSolverService(final PairingProperties pairingProperties) {
|
||||
this.pairingProperties = pairingProperties;
|
||||
}
|
||||
|
||||
static {
|
||||
Loader.loadNativeLibraries();
|
||||
}
|
||||
@@ -660,18 +662,18 @@ public class PairingSolverService {
|
||||
}
|
||||
|
||||
private boolean canBeABWith(UsedPair other) {
|
||||
Stream var10000 = this.dates.stream();
|
||||
Stream var10000 = dates.stream();
|
||||
Set var10001 = other.dates;
|
||||
Objects.requireNonNull(var10001);
|
||||
boolean var3;
|
||||
if (var10000.noneMatch(var10001::contains)) {
|
||||
Stream var2 = this.dispatchAdjacentKeys.stream();
|
||||
Stream var2 = 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)) {
|
||||
if (var2.anyMatch(var10001::contains) && !Objects.equals(fieldMemberId,
|
||||
other.fieldMemberId) && !Objects.equals(fieldMemberId, other.externalMemberId)
|
||||
&& !Objects.equals(externalMemberId, other.fieldMemberId) && !Objects.equals(
|
||||
externalMemberId, other.externalMemberId)) {
|
||||
var3 = true;
|
||||
return var3;
|
||||
}
|
||||
|
||||
@@ -12,20 +12,21 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.Generated;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
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);
|
||||
validateNotEmpty(data);
|
||||
validateDateRanges(data);
|
||||
validateMunicipalityReferences(data);
|
||||
validatePreferenceRules(data);
|
||||
validatePreferenceAnyRegionOrder(data);
|
||||
}
|
||||
|
||||
private void validateNotEmpty(PairingData data) {
|
||||
@@ -102,12 +103,12 @@ public class PairingValidationService {
|
||||
boolean anyRegionAppeared = false;
|
||||
|
||||
for (String preferenceRegion : member.getPreferenceRegions()) {
|
||||
if (anyRegionAppeared && !this.anyRegionCode().equals(preferenceRegion)) {
|
||||
if (anyRegionAppeared && !anyRegionCode().equals(preferenceRegion)) {
|
||||
throw BusinessException.badRequest("PAIRING_INVALID_PREFERENCE_ORDER",
|
||||
"선호지역 00 이후에는 다른 지역이 올 수 없습니다. memberId=" + member.getId());
|
||||
}
|
||||
|
||||
if (this.anyRegionCode().equals(preferenceRegion)) {
|
||||
if (anyRegionCode().equals(preferenceRegion)) {
|
||||
anyRegionAppeared = true;
|
||||
}
|
||||
}
|
||||
@@ -116,11 +117,6 @@ public class PairingValidationService {
|
||||
}
|
||||
|
||||
private String anyRegionCode() {
|
||||
return this.pairingProperties.getCode().getAnyRegionCode();
|
||||
}
|
||||
|
||||
@Generated
|
||||
public PairingValidationService(final PairingProperties pairingProperties) {
|
||||
this.pairingProperties = pairingProperties;
|
||||
return pairingProperties.getCode().getAnyRegionCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,6 +76,13 @@ pairing:
|
||||
preference-rank-penalty: 10
|
||||
# 거주지 prefix가 일치하는 페어에 부여하는 점수입니다. 값이 클수록 거주지 유사도를 더 중요하게 봅니다.
|
||||
residence-match-weight: 10000
|
||||
candidate:
|
||||
# 현장+외부 페어 1개가 solver에 넘기기 전에 유지할 최대 파견 권역 후보 수입니다.
|
||||
max-dispatch-regions-per-pair: 5
|
||||
# 센터 1개마다 solver에 넘기기 전에 유지할 최대 배정 후보 수입니다.
|
||||
max-assignments-per-center: 30
|
||||
# 위원 1명(현장/외부 모두 포함)이 solver 후보에 등장할 수 있는 최대 횟수입니다.
|
||||
max-assignments-per-member: 80
|
||||
solver:
|
||||
# OR-Tools CP-SAT solver가 한 요청에서 탐색할 최대 시간(초)입니다.
|
||||
max-time-seconds: 30.0
|
||||
|
||||
@@ -4,6 +4,7 @@ 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.config.PairingProperties;
|
||||
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;
|
||||
@@ -22,14 +23,22 @@ class PairingCandidateServiceTest {
|
||||
|
||||
@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)));
|
||||
PairingCandidates candidates = service.generate(baseData(member("field", MemberRole.FIELD, Gender.FEMALE, ExperienceType.NEW, "02", Set.of()), member("external", MemberRole.EXTERNAL, Gender.FEMALE, ExperienceType.NEW, "03", Set.of()), 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)));
|
||||
PairingCandidates candidates = service.generate(baseData(member("field", MemberRole.FIELD, Gender.FEMALE, ExperienceType.EXPERIENCED, "01", Set.of()), member("external", MemberRole.EXTERNAL, Gender.FEMALE, ExperienceType.EXPERIENCED, "03", Set.of()), center("center", false)));
|
||||
Assertions.assertThat(candidates.getPairCandidates()).hasSize(1);
|
||||
Assertions.assertThat(candidates.getDispatchRegionCandidates()).isEmpty();
|
||||
Assertions.assertThat(candidates.getAssignmentCandidates()).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
void generateExcludesConflictWhenActivityRegionHasMultipleCodes() {
|
||||
PairingCandidates candidates = service.generate(baseData(member("field", MemberRole.FIELD, Gender.FEMALE, ExperienceType.EXPERIENCED, "02,01", Set.of()), member("external", MemberRole.EXTERNAL, Gender.FEMALE, ExperienceType.EXPERIENCED, "03", Set.of()), center("center", false)));
|
||||
Assertions.assertThat(candidates.getPairCandidates()).hasSize(1);
|
||||
Assertions.assertThat(candidates.getDispatchRegionCandidates()).isEmpty();
|
||||
Assertions.assertThat(candidates.getAssignmentCandidates()).isEmpty();
|
||||
@@ -37,35 +46,75 @@ class PairingCandidateServiceTest {
|
||||
|
||||
@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)));
|
||||
PairingCandidates maleIncluded = service.generate(baseData(member("field", MemberRole.FIELD, Gender.FEMALE, ExperienceType.EXPERIENCED, "02", Set.of()), member("external", MemberRole.EXTERNAL, Gender.MALE, ExperienceType.EXPERIENCED, "03", Set.of()), center("center", true)));
|
||||
PairingCandidates femaleOnly = service.generate(baseData(member("field", MemberRole.FIELD, Gender.FEMALE, ExperienceType.EXPERIENCED, "02", Set.of()), member("external", MemberRole.EXTERNAL, Gender.FEMALE, ExperienceType.EXPERIENCED, "03", Set.of()), 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)));
|
||||
PairingCandidates candidates = service.generate(baseData(member("field", MemberRole.FIELD, Gender.FEMALE, ExperienceType.EXPERIENCED, "02", Set.of("center")), member("external", MemberRole.EXTERNAL, Gender.FEMALE, ExperienceType.EXPERIENCED, "03", Set.of()), 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);
|
||||
PairingData data = PairingData.builder().members(List.of(member("field", MemberRole.FIELD, Gender.FEMALE, ExperienceType.EXPERIENCED, "02", Set.of()), 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(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 = 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());
|
||||
PairingData data = baseData(member("field", MemberRole.FIELD, Gender.FEMALE, ExperienceType.EXPERIENCED, "02", Set.of()), 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);
|
||||
PairingCandidates candidates = service.generate(data);
|
||||
Assertions.assertThat(candidates.getAssignmentCandidates()).isEmpty();
|
||||
Assertions.assertThat((Collection)candidates.getUnassignedCenterReasons().get("center")).contains(new String[]{"위원/지자체/센터 일정 또는 국공휴일 조건 불일치"});
|
||||
}
|
||||
|
||||
@Test
|
||||
void generateTrimsCandidatesByConfiguredLimits() {
|
||||
PairingProperties properties = PairingTestSupport.pairingProperties();
|
||||
properties.getCandidate().setMaxDispatchRegionsPerPair(1);
|
||||
properties.getCandidate().setMaxAssignmentsPerCenter(1);
|
||||
properties.getCandidate().setMaxAssignmentsPerMember(1);
|
||||
PairingCandidateService limitedService = new PairingCandidateService(properties);
|
||||
PairingData data = PairingData.builder()
|
||||
.members(List.of(
|
||||
member("field1", MemberRole.FIELD, Gender.FEMALE, ExperienceType.EXPERIENCED, "09", Set.of()),
|
||||
member("field2", MemberRole.FIELD, Gender.FEMALE, ExperienceType.EXPERIENCED, "09", Set.of()),
|
||||
member("external1", MemberRole.EXTERNAL, Gender.FEMALE, ExperienceType.EXPERIENCED, "09", Set.of()),
|
||||
member("external2", MemberRole.EXTERNAL, Gender.FEMALE, ExperienceType.EXPERIENCED, "09", 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(center("center1", false), center("center2", false)))
|
||||
.memberRegionCodes(List.of())
|
||||
.centerAdjacentRegions(List.of(
|
||||
CenterAdjacentRegion.builder().dispatchRegion("01").adjacentRegionClassification("A").build(),
|
||||
CenterAdjacentRegion.builder().dispatchRegion("02").adjacentRegionClassification("A").build()
|
||||
))
|
||||
.preferenceMatchRules(List.of(
|
||||
PreferenceMatchRule.builder().priority(1).fieldMemberPreferenceRank(1).externalMemberPreferenceRank(1).build(),
|
||||
PreferenceMatchRule.builder().priority(2).fieldMemberPreferenceRank(2).externalMemberPreferenceRank(2).build()
|
||||
))
|
||||
.commonUnavailableDates(Set.of())
|
||||
.build();
|
||||
|
||||
PairingCandidates candidates = limitedService.generate(data);
|
||||
|
||||
Assertions.assertThat(candidates.getDispatchRegionCandidates()).hasSize(4);
|
||||
Assertions.assertThat(candidates.getAssignmentCandidates()).hasSizeLessThanOrEqualTo(2);
|
||||
Assertions.assertThat(candidates.getAssignmentCandidates())
|
||||
.extracting(candidate -> candidate.getFieldMemberId())
|
||||
.doesNotHaveDuplicates();
|
||||
Assertions.assertThat(candidates.getAssignmentCandidates())
|
||||
.extracting(candidate -> candidate.getExternalMemberId())
|
||||
.doesNotHaveDuplicates();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -8,36 +8,24 @@ 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");
|
||||
private final PairingExcelService pairingExcelService = new PairingExcelService(
|
||||
PairingTestSupport.pairingProperties());
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@Test
|
||||
void readSampleWorkbook() throws IOException {
|
||||
try (InputStream inputStream = getClass().getResourceAsStream("/sample/기초 data TEST.xlsx")) {
|
||||
MockMultipartFile file = new MockMultipartFile("file", "기초 data TEST.xlsx",
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", inputStream);
|
||||
|
||||
throw var5;
|
||||
}
|
||||
PairingWorkbookData data = pairingExcelService.read(file);
|
||||
|
||||
if (inputStream != null) {
|
||||
inputStream.close();
|
||||
}
|
||||
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,14 +40,31 @@ class PairingHolidayServiceTest {
|
||||
.commonUnavailableDates(Set.of())
|
||||
.build();
|
||||
PairingData result = service.applyHolidayUnavailableDates(data);
|
||||
Assertions.assertThat(result.getCommonUnavailableDates()).contains(new LocalDate[]{LocalDate.of(2026, 5, 5)});
|
||||
Assertions.assertThat(result.getCommonUnavailableDates()).contains(
|
||||
LocalDate.of(2026, 5, 2),
|
||||
LocalDate.of(2026, 5, 3),
|
||||
LocalDate.of(2026, 5, 5)
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
void getWeekendReturnsSaturdayAndSundayForYear() {
|
||||
DatagoHolidayCache cache = new DatagoHolidayCache(new StubDatagoExtentionApiClient());
|
||||
|
||||
List<String> weekendDates = cache.getWeekend("2026").stream()
|
||||
.map(HolidayDto::getHolidayDate)
|
||||
.toList();
|
||||
|
||||
Assertions.assertThat(weekendDates)
|
||||
.contains("20260103", "20260104", "20261226", "20261227")
|
||||
.doesNotContain("20260102");
|
||||
}
|
||||
|
||||
@Test
|
||||
void applyHolidayUnavailableDatesUsesCacheForSameYear() {
|
||||
CountingDatagoExtentionApiClient client = new CountingDatagoExtentionApiClient();
|
||||
PairingHolidayService service = new PairingHolidayService(new DatagoHolidayCache(client));
|
||||
PairingData data = this.baseData();
|
||||
PairingData data = baseData();
|
||||
service.applyHolidayUnavailableDates(data);
|
||||
service.applyHolidayUnavailableDates(data);
|
||||
Assertions.assertThat(client.callCount).isEqualTo(1);
|
||||
@@ -67,7 +84,7 @@ class PairingHolidayServiceTest {
|
||||
private int callCount;
|
||||
|
||||
public List<HolidayDto> getHoliDayList(String year) {
|
||||
++this.callCount;
|
||||
++callCount;
|
||||
return List.of(HolidayDto.of(year + "0505", "어린이날"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,24 @@
|
||||
package com.kri.p6.ncrc.pairing.service;
|
||||
|
||||
import static com.kri.p6.ncrc.pairing.common.consts.PairingConstant.RESULT_SHEET_AB_PAIR;
|
||||
import static com.kri.p6.ncrc.pairing.common.consts.PairingConstant.RESULT_SHEET_ASSIGNMENT;
|
||||
import static com.kri.p6.ncrc.pairing.common.consts.PairingConstant.RESULT_SHEET_CANDIDATE_SUMMARY;
|
||||
import static com.kri.p6.ncrc.pairing.common.consts.PairingConstant.RESULT_SHEET_RULE_CHECK;
|
||||
import static com.kri.p6.ncrc.pairing.common.consts.PairingConstant.RESULT_SHEET_SUMMARY;
|
||||
import static com.kri.p6.ncrc.pairing.common.consts.PairingConstant.RESULT_SHEET_UNASSIGNED_CENTER;
|
||||
import static com.kri.p6.ncrc.pairing.common.consts.PairingConstant.RESULT_SHEET_UNUSED_MEMBER;
|
||||
import static com.kri.p6.ncrc.pairing.common.consts.PairingConstant.RESULT_SHEET_VALIDATION_ERROR;
|
||||
|
||||
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.DatagoExtentionApiClient;
|
||||
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.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.ss.usermodel.WorkbookFactory;
|
||||
@@ -16,65 +27,51 @@ 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");
|
||||
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())
|
||||
);
|
||||
|
||||
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));
|
||||
@Test
|
||||
void pairingMemberByCenterCreatesResultWorkbook() throws IOException {
|
||||
try (InputStream inputStream = getClass().getResourceAsStream("/sample/기초 data TEST.xlsx")) {
|
||||
MockMultipartFile file = new MockMultipartFile("file", "기초 data TEST.xlsx",
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", inputStream);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
byte[] result = pairingService.pairingMemberByCenter(file);
|
||||
|
||||
throw var9;
|
||||
}
|
||||
Assertions.assertThat(result).isNotEmpty();
|
||||
Files.createDirectories(Path.of("build"));
|
||||
Files.write(Files.createTempFile(Path.of("build"), "pairing-result", ".xlsx"), result);
|
||||
try (Workbook workbook = WorkbookFactory.create(new ByteArrayInputStream(result))) {
|
||||
Assertions.assertThat(workbook.getSheet(RESULT_SHEET_ASSIGNMENT)).isNotNull();
|
||||
Assertions.assertThat(workbook.getSheet(RESULT_SHEET_UNASSIGNED_CENTER)).isNotNull();
|
||||
Assertions.assertThat(workbook.getSheet(RESULT_SHEET_UNUSED_MEMBER)).isNotNull();
|
||||
Assertions.assertThat(workbook.getSheet(RESULT_SHEET_SUMMARY)).isNotNull();
|
||||
Assertions.assertThat(workbook.getSheet(RESULT_SHEET_AB_PAIR)).isNotNull();
|
||||
Assertions.assertThat(workbook.getSheet(RESULT_SHEET_CANDIDATE_SUMMARY)).isNotNull();
|
||||
Assertions.assertThat(workbook.getSheet(RESULT_SHEET_VALIDATION_ERROR)).isNotNull();
|
||||
Assertions.assertThat(workbook.getSheet(RESULT_SHEET_RULE_CHECK)).isNotNull();
|
||||
|
||||
if (workbook != null) {
|
||||
workbook.close();
|
||||
}
|
||||
} catch (Throwable var10) {
|
||||
if (inputStream != null) {
|
||||
try {
|
||||
inputStream.close();
|
||||
} catch (Throwable var7) {
|
||||
var10.addSuppressed(var7);
|
||||
}
|
||||
}
|
||||
|
||||
throw var10;
|
||||
List<RuleViolationExcelDto> ruleChecks = ExcelMapper.readFromWorkbook(workbook,
|
||||
RuleViolationExcelDto.class, RESULT_SHEET_RULE_CHECK, 1);
|
||||
Assertions.assertThat(ruleChecks)
|
||||
.extracting(RuleViolationExcelDto::getResult)
|
||||
.doesNotContain("FAIL");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (inputStream != null) {
|
||||
inputStream.close();
|
||||
}
|
||||
private static class StubDatagoExtentionApiClient extends DatagoExtentionApiClient {
|
||||
|
||||
}
|
||||
|
||||
private static class StubDatagoExtentionApiClient extends DatagoExtentionApiClient {
|
||||
public List<HolidayDto> getHoliDayList(String year) {
|
||||
return List.of();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public List<HolidayDto> getHoliDayList(String year) {
|
||||
return List.of();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,34 +25,34 @@ class PairingSolverServiceTest {
|
||||
|
||||
@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);
|
||||
PairingData data = 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(assignment("field", "external", "c1", "A"), assignment("field", "external", "c2", "A"), assignment("field", "external", "c3", "A"), assignment("field", "external", "c4", "A"))).build();
|
||||
PairingResult result = 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);
|
||||
PairingData data = dataWithMembersAndCenters(List.of(member("field", MemberRole.FIELD), member("external1", MemberRole.EXTERNAL), member("external2", MemberRole.EXTERNAL)), List.of(center("c1"), 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(assignment("field", "external1", "c1", "A"), assignment("field", "external2", "c2", "A"))).build();
|
||||
PairingResult result = 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);
|
||||
PairingData data = dataWithCenters("c1", "c2");
|
||||
PairingCandidates candidates = PairingCandidates.builder().pairCandidates(List.of(PairCandidate.builder().fieldMemberId("field").externalMemberId("external").build())).dispatchRegionCandidates(List.of()).assignmentCandidates(List.of(assignment("field", "external", "c1", "A"), assignment("field", "external", "c2", "B"))).build();
|
||||
PairingResult result = 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);
|
||||
PairingData data = dataWithMembersAndCenters(List.of(member("field", MemberRole.FIELD), member("external1", MemberRole.EXTERNAL), member("external2", MemberRole.EXTERNAL), member("external3", MemberRole.EXTERNAL)), List.of(center("c1"), center("c2"), 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(assignment("field", "external1", "c1", "A", LocalDate.of(2026, 5, 1)), assignment("field", "external2", "c2", "A", LocalDate.of(2026, 5, 2)), assignment("field", "external3", "c3", "A", LocalDate.of(2026, 5, 3)))).build();
|
||||
PairingResult result = 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);
|
||||
@@ -60,16 +60,16 @@ class PairingSolverServiceTest {
|
||||
|
||||
@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);
|
||||
PairingData data = dataWithMembersAndCenters(List.of(member("field1", MemberRole.FIELD), member("external1", MemberRole.EXTERNAL), member("field2", MemberRole.FIELD), member("external2", MemberRole.EXTERNAL)), List.of(center("c1"), 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(assignment("field1", "external1", "c1", "A", LocalDate.of(2026, 5, 1)), assignment("field2", "external2", "c2", "A", LocalDate.of(2026, 5, 2)))).build();
|
||||
PairingResult result = 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());
|
||||
return dataWithMembersAndCenters(List.of(member("field", MemberRole.FIELD), member("external", MemberRole.EXTERNAL)), Arrays.stream(centerIds).map(this::center).toList());
|
||||
}
|
||||
|
||||
private PairingData dataWithMembersAndCenters(List<Member> members, List<Center> centers) {
|
||||
@@ -77,7 +77,7 @@ class PairingSolverServiceTest {
|
||||
}
|
||||
|
||||
private AssignmentCandidate assignment(String fieldMemberId, String externalMemberId, String centerId, String adjacentRegionClassification) {
|
||||
return this.assignment(fieldMemberId, externalMemberId, centerId, adjacentRegionClassification, LocalDate.of(2026, 5, 1));
|
||||
return assignment(fieldMemberId, externalMemberId, centerId, adjacentRegionClassification, LocalDate.of(2026, 5, 1));
|
||||
}
|
||||
|
||||
private AssignmentCandidate assignment(String fieldMemberId, String externalMemberId, String centerId, String adjacentRegionClassification, LocalDate date) {
|
||||
|
||||
Reference in New Issue
Block a user