nation 버전 이식

This commit is contained in:
Macbook
2026-07-12 15:55:08 +09:00
parent 314a3554d3
commit 07a8114927
54 changed files with 11612 additions and 203 deletions
@@ -0,0 +1,215 @@
package com.bizcare.agent;
import java.util.*;
/**
* billing_react AppConstant 의 접수/사은품/입력처/정산 상태·전이를 BillCare 에 이식.
*/
public final class ReceptionStatuses {
private ReceptionStatuses() {}
public static final List<String> PRE_CALC_STATUSES =
List.of("f19", "f20", "f21", "f22", "f28", "f23");
public static final List<String> CENTER_PRE_CALC_STATUSES =
List.of("h01", "h05", "h06", "h07", "h08", "h11");
public static final Map<String, String> PROGRESS = map(
"f01", "접수", "f02", "재접수", "f03", "접수진행중", "f04", "접수완료",
"f05", "승인대기중", "f06", "회신요청", "f07", "접수반송", "f08", "미개통오더반송",
"f09", "TC실패반송", "f10", "접수보류", "f11", "접수취소", "f12", "개통중",
"f13", "기사완료", "f14", "개통완료", "f15", "개통보류", "f16", "개통취소",
"f17", "개통불가", "f18", "정산보류", "f19", "위면해지", "f20", "직권해지",
"f21", "유보중단환수", "f22", "해지", "f23", "정산대기", "f24", "정산완료",
"f25", "송금완료", "f26", "환수정산완료", "f27", "환수완료",
"f28", "VOC(귀책)차감", "f29", "VOC(귀책)차감완료");
public static final Map<String, String> GIFT = map(
"g01", "지급요청", "g02", "지급재요청", "g03", "반송", "g04", "처리중",
"g05", "지급보류", "g06", "지급취소", "g07", "지급완료", "g08", "회수요청",
"g09", "회수(반환)완료", "g10", "등록완료", "g11", "삭제완료", "g12", "입금증요청",
"g13", "입금증완료", "g14", "입금증첨부완료", "g15", "입금증(센터)전달완료");
public static final Map<String, String> CENTER = map(
"h01", "정산대기", "h02", "정산완료", "h03", "입금완료", "h04", "정산보류",
"h05", "위면해지", "h06", "직권해지", "h07", "유보중단환수", "h08", "해지",
"h09", "해지정산완료", "h10", "해지송금완료", "h11", "VOC(귀책)송금", "h12", "VOC(귀책)송금완료");
public static final Map<String, String> GIFT_PLACE = map(
"b02", "자체발송", "b01", "본사발송", "b03", "본사(센터)", "b04", "본사(관리자)");
public static final Map<String, String> COST_TYPE = map(
"i01", "정산", "i02", "위면해지", "i03", "직권해지", "i04", "유보중단환수", "i05", "해지", "i06", "voc차감");
public static final Map<String, String> CENTER_COST_TYPE = map(
"k01", "정산", "k02", "위면해지", "k03", "직권해지", "k04", "유보중단환수", "k05", "해지", "k06", "voc차감");
/** 구 BillCare 한글 라벨 → 코드 */
public static final Map<String, String> LEGACY_PROGRESS = Map.ofEntries(
Map.entry("1.접수완료", "f04"),
Map.entry("2.고객통화", "f03"),
Map.entry("3.서류검토", "f05"),
Map.entry("4.개통완료", "f14"),
Map.entry("5.사은품지급", "f14"),
Map.entry("6.정산완료", "f24"),
Map.entry("9.취소", "f11"),
Map.entry("접수", "f01"),
Map.entry("접수완료", "f04"),
Map.entry("개통완료", "f14"),
Map.entry("정산대기", "f23"),
Map.entry("정산완료", "f24"),
Map.entry("송금완료", "f25"),
Map.entry("접수취소", "f11")
);
public static final Map<String, String> LEGACY_GIFT = Map.of(
"미지급", "",
"지급대기", "g01",
"지급요청", "g01",
"지급완료", "g07",
"반송", "g03"
);
public static final Map<String, String> LEGACY_CENTER = Map.of(
"정산대기", "h01",
"정산완료", "h02",
"입금완료", "h03",
"회수대기", "h05",
"회수완료", "h09",
"미지정", "h01"
);
public static List<String> progressCodes() {
return new ArrayList<>(PROGRESS.keySet());
}
public static List<String> giftCodes() {
return new ArrayList<>(GIFT.keySet());
}
public static List<String> centerCodes() {
return new ArrayList<>(CENTER.keySet());
}
public static String progressLabel(String code) {
if (code == null || code.isBlank()) return "";
return PROGRESS.getOrDefault(code, code);
}
public static String giftLabel(String code) {
if (code == null || code.isBlank()) return "";
return GIFT.getOrDefault(code, code);
}
public static String centerLabel(String code) {
if (code == null || code.isBlank()) return "";
return CENTER.getOrDefault(code, code);
}
public static String normalizeProgress(String raw) {
if (raw == null || raw.isBlank()) return "";
if (PROGRESS.containsKey(raw)) return raw;
return LEGACY_PROGRESS.getOrDefault(raw, raw);
}
public static String normalizeGift(String raw) {
if (raw == null) return "";
if (raw.isBlank() || "미지급".equals(raw)) return "";
if (GIFT.containsKey(raw)) return raw;
return LEGACY_GIFT.getOrDefault(raw, raw);
}
public static String normalizeCenter(String raw) {
if (raw == null || raw.isBlank()) return "";
if (CENTER.containsKey(raw)) return raw;
return LEGACY_CENTER.getOrDefault(raw, raw);
}
public static Set<String> orderStatusTransitions(String current) {
if (current == null) return Set.of();
return switch (current) {
case "f01", "f02", "f03", "f04", "f05", "f06", "f07", "f08", "f09", "f10", "f11", "f12",
"f13", "f15", "f16", "f17" ->
set("f01", "f02", "f03", "f04", "f05", "f06", "f07", "f08", "f09",
"f10", "f11", "f12", "f13", "f14", "f15", "f16", "f17", "f18");
case "f18", "f14" ->
set("f01", "f02", "f03", "f04", "f05", "f06", "f07", "f08", "f09",
"f10", "f11", "f12", "f13", "f14", "f15", "f16", "f17", "f18",
"f19", "f20", "f21", "f22", "f23");
case "f23" -> set("f23");
case "f24" -> set("f24");
case "f25" -> set("f25", "f19", "f20", "f21", "f22", "f28");
case "f19" -> set("f19");
case "f20" -> set("f20");
case "f21" -> set("f21");
case "f22" -> set("f22");
case "f28" -> set("f28");
case "f29" -> set("f28", "f29", "f19", "f20", "f21", "f22");
case "f26" -> set("f26");
case "f27" -> set("f27");
default -> Set.of();
};
}
public static Set<String> centerStatusTransitions(String current) {
if (current == null || current.isBlank()) return set("h01");
return switch (current) {
case "h01" -> set("h01");
case "h02" -> set("h02");
case "h03" -> set("h03", "h05", "h06", "h07", "h08", "h11");
case "h04" -> set("h04", "h01");
case "h05" -> set("h05");
case "h06" -> set("h06");
case "h07" -> set("h07");
case "h08" -> set("h08");
case "h09" -> set("h09");
case "h10" -> set("h10");
case "h11" -> set("h11");
case "h12" -> set("h05", "h06", "h07", "h08", "h11");
default -> Set.of();
};
}
public static String orderCostType(String orderStatus) {
if (orderStatus == null) return "";
return switch (orderStatus) {
case "f19" -> "i02";
case "f20" -> "i03";
case "f21" -> "i04";
case "f22" -> "i05";
case "f28" -> "i06";
case "f23" -> "i01";
default -> "";
};
}
public static String centerCostType(String status) {
if (status == null) return "";
return switch (status) {
case "h05" -> "k02";
case "h06" -> "k03";
case "h07" -> "k04";
case "h08" -> "k05";
case "h11" -> "k06";
case "h01" -> "k01";
default -> "";
};
}
public static boolean isPreCalc(String status) {
return status != null && PRE_CALC_STATUSES.contains(status);
}
public static boolean isCenterPreCalc(String status) {
return status != null && CENTER_PRE_CALC_STATUSES.contains(status);
}
private static Map<String, String> map(String... kv) {
Map<String, String> m = new LinkedHashMap<>();
for (int i = 0; i < kv.length; i += 2) m.put(kv[i], kv[i + 1]);
return Collections.unmodifiableMap(m);
}
private static Set<String> set(String... v) {
return new LinkedHashSet<>(Arrays.asList(v));
}
}