# Business Logic — JKKOrsjgsUseStpRunCC.judgeHakkoSod() [145 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKOrsjgsUseStpRunCC` |
| Layer | CC / Common Component |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKOrsjgsUseStpRunCC.judgeHakkoSod()

This method determines whether a Service Order Data (SOD) should be issued for the current service contract line item (`svc_kei_ucwk_no`). It serves as the gatekeeping decision point in the service order issuance pipeline: when the calling screen invokes `svcKei_UseStp()`, the system reaches this method to evaluate whether a new SOD is warranted. The method implements a **tiered conditional routing pattern** with three major evaluation layers. First, it checks the mobile SOD distribution key (`eMobileSodKbn`) — if mobile SOD is explicitly configured as "none", SOD is never issued; otherwise, it is always issued for mobile scenarios. Second, for non-mobile cases, it validates the service contract line item status: if the line is in a paused/suspended state (`SVC_KEI_STAT_PAUSE = "210"`) and belongs to the telecom service group (`PRC_GRP_CD_TEL = "10"`), SOD is withheld to avoid issuing orders for already-cancelled services (since a stop-order already exists). Third, when port-of-origin (Number Portability, "Ranpo Kouji") work is detected — either because the old phone is in a number change process or the current line is actively porting — it calls the ETU0011B018SC service to check the current porting work status code, then makes the final SOD issuance decision based on where the porting process sits in its lifecycle. The method is a shared utility called by `svcKei_UseStp()` and plays a central role in telecom order fulfillment logic.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["judgeHakkoSod start"])

    START --> INIT_LIST["Extract eKK0161B004HashList from resultHash"]

    INIT_LIST --> CHECK_MOBILE{"eMobileSodKbn != 0?"}

    CHECK_MOBILE -->|No| INIT_VARS["checkBmpKoji = false, checkKbn = 0"]

    INIT_VARS --> GET_SERVICE["Extract eKK0081A010Hash from resultHash"]

    GET_SERVICE --> EXTRACT_SVC["Extract svcKeiNo from eKK0081A010Hash"]

    EXTRACT_SVC --> GET_SVC_UCWK["Call getSvcKeiUcwkInfo svc_kei_ucwk_no"]

    GET_SVC_UCWK --> EXTRACT_FIELDS["Extract tmpSvcKeiUcwk, kzkAfKeiFlg, svcKeiUcwkStat"]

    EXTRACT_FIELDS --> SVC_MATCH{"svc_kei_ucwk_no equals tmpSvcKeiUcwk?"}

    SVC_MATCH -->|No| DEFAULT_TRUE(["Return true"])

    SVC_MATCH -->|Yes| PAUSE_CHECK{"SVC_KEI_STAT_PAUSE 210 equals svcKeiUcwkStat?"}

    PAUSE_CHECK -->|Yes - Paused| RET_FALSE_PAUSE(["Return false"])

    PAUSE_CHECK -->|No| TEL_CHECK{"PRC_GRP_CD_TEL 10 equals prc_grp_cd?"}

    TEL_CHECK -->|No - Non-telecom| RET_TRUE_NONTEL(["Return true"])

    TEL_CHECK -->|Yes - Telecom| KEI_FLG_CHECK{"KEIZK_AF_KEI_FLG_1 1 equals kzkAfKeiFlg?"}

    KEI_FLG_CHECK -->|No - Not porting| GET_OLD_MAP["Call getSvcKeiUcwkInfo KEIZK_MT_SVC_KEI_UCWK_NO"]

    GET_OLD_MAP --> CHECK_PORT{"checkKzkAfKeiChgFlg map?"}

    CHECK_PORT -->|Yes - Porting old| SET_KBN1["checkBmpKoji = true, checkKbn = 1, bmpSvcKeiUcwkNo = old"]

    SET_KBN1 --> TO_BMP_CHECK["To BMP check"]

    CHECK_PORT -->|No| TO_BMP_CHECK

    KEI_FLG_CHECK -->|Yes - Porting| SET_KBN2["checkBmpKoji = true, checkKbn = 2, bmpSvcKeiUcwkNo = current"]

    SET_KBN2 --> TO_BMP_CHECK

    TO_BMP_CHECK --> BMP_KOJI_CHECK{"checkBmpKoji?"}

    BMP_KOJI_CHECK -->|No| RETURN_TRUE(["Return true"])

    BMP_KOJI_CHECK -->|Yes| CALL_ETU["callETU0011B018SC with BMP_IRAI_NAIYO_CD_ITEN,BMP_IRAI_NAIYO_CD_UPD"]

    CALL_ETU --> GET_BMP_LIST["Extract eTU0011B018HashList from resultHash"]

    GET_BMP_LIST --> LIST_CHECK{"eTU0011B018HashList not null and not empty?"}

    LIST_CHECK -->|No| RETURN_TRUE

    LIST_CHECK -->|Yes| GET_BMP_INFO["Call getSvcKeiUcwkInfo bmpSvcKeiUcwkNo"]

    GET_BMP_INFO --> BMP_HASH_CHECK{"bmpHash not null?"}

    BMP_HASH_CHECK -->|No| RETURN_TRUE

    BMP_HASH_CHECK -->|Yes| GET_BMP_STAT["Extract bmpKojiStat from bmpHash"]

    GET_BMP_STAT --> KN1_CHECK{"checkKbn equals 1?"}

    KN1_CHECK -->|Yes - Old phone| KN1_COND{"BMP_KOJI_STAT_SOD_HAKKOZM 040 <= bmpKojiStat AND bmpKojiStat < BMP_KOJI_STAT_KOJICL 090?"}

    KN1_COND -->|Yes - SOD issued, not cancelled| RET_FALSE_KBN1(["Return false"])

    KN1_COND -->|No| RET_TRUE_KBN1(["Return true"])

    KN1_CHECK -->|No - checkKbn 2| KN2_CHECK{"checkKbn equals 2?"}

    KN2_CHECK -->|Yes - Porting current| KN2_COND{"BMP_KOJI_STAT_SOD_HAKKOZM 040 <= bmpKojiStat AND bmpKojiStat < BMP_KOJI_STAT_KOJICL 090?"}

    KN2_COND -->|Yes - SOD issued, not cancelled| RET_TRUE_KBN2(["Return true"])

    KN2_COND -->|No| RET_FALSE_KBN2(["Return false"])
```

**Branch summary:**

- **Mobile SOD gate** (lines 1048–1058): If `eMobileSodKbn != 0`, short-circuit immediately. If `eMobileSodKbn == 3` (`EMOBILE_SOD_KBN_NONE`), return `false` (do not issue SOD). Otherwise (`eMobileSodKbn == 2` or `4`), return `true` (issue SOD).
- **Service line match** (lines 1082–1090): Look up the service contract line item. If the passed `svc_kei_ucwk_no` does not match the retrieved record, return `true` (issue SOD by default).
- **Paused service handling** (lines 1084–1097): If the service line status is `210` (paused/suspended), return `false` — a stop-order already exists. If not telecom (`prc_grp_cd != "10"`), return `true` (issue SOD even if paused for non-telecom services). If telecom and not paused, continue to porting checks.
- **Porting detection** (lines 1101–1131): If the contract is not in porting process (`kzkAfKeiFlg != "1"`), check the old service line (continuation source) to see if it is porting. If it is, set `checkKbn = 1` (old phone porting). If already in porting (`kzkAfKeiFlg == "1"`), set `checkKbn = 2` (current porting).
- **BMP work status decision** (lines 1134–1168): Call the Number Portability work service (`ETU0011B018SC`). Check the porting work status code (`bmpKojiStat`). For `checkKbn == 1` (old phone): SOD is **not** issued if status is between `040` (SOD issued) and `< 090` (porting cancelled). For `checkKbn == 2` (porting current): SOD **is** issued in that same range — the new number needs a fresh SOD.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | Request/response parameter object carrying the input-output contract between the calling screen and this business logic layer. Used by called methods (e.g., `callETU0011B018SC`) to pass and retrieve message data. |
| 2 | `handle` | `SessionHandle` | Session handle providing the database connection context and transaction boundary for the current request. Passed through to service component calls for data access. |
| 3 | `requestParam` | `HashMap<String, Object>` | Input request parameters from the calling screen. Passed through to called methods but not directly read by this method. |
| 4 | `resultHash` | `HashMap<String, Object>` | Shared result hash containing pre-fetched data from prior screen processing steps. Read to extract `eKK0161B004HashList` (service line list), `eKK0081A010Hash` (service contract agreement info), and written to store `eTU0011B018HashList` (porting work result) after the BMP service call. |
| 5 | `svc_kei_ucwk_no` | `String` | Service detail work number — the internal tracking ID for the specific service contract line item being evaluated for SOD issuance. Used to look up line-level details from the service line list. |
| 6 | `prc_grp_cd` | `String` | Processing group code — classifies the type of service being processed. Specifically checked against `PRC_GRP_CD_TEL = "10"` (telecom service group) to differentiate telecom services from other service types (e.g., data, mobile). |
| 7 | `eMobileSodKbn` | `int` | Mobile SOD distribution key — controls whether mobile SOD issuance applies. Values: `0` (normal/non-mobile), `2` (EM — SOD issue), `3` (NONE — no SOD), `4` (UCWK — only line detail). If non-zero, the method short-circuits without further processing. |

**Instance fields / external state read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `EMOBILE_SOD_KBN_NONE` | `int` | Mobile SOD distribution key constant meaning "no SOD issue" (value: 3) [-> `EMOBILE_SOD_KBN_NONE = 3` (JKKOrsjgsUseStpRunCC.java:244)] |
| `SVC_KEI_STAT_PAUSE` | `String` | Service contract line status code meaning "paused/suspended" (value: "210") [-> `SVC_KEI_STAT_PAUSE = "210"` (JKKOrsjgsUseStpRunCC.java:149)] |
| `TEMPLATE_ID_EKK0161B004` | `String` | Template ID for the service contract line list lookup (value: "EKK0161B004") [-> `TEMPLATE_ID_EKK0161B004 = "EKK0161B004"` (JKKHakkoSODConstCC.java:644)] |
| `TEMPLATE_ID_EKK0081A010` | `String` | Template ID for the service contract agreement info (value: "EKK0081A010") [-> `TEMPLATE_ID_EKK0081A010 = "EKK0081A010"` (JKKHakkoSODConstCC.java:638)] |
| `TEMPLATE_ID_ETU0011B018` | `String` | Template ID for the porting work status list (value: "ETU0011B018") [-> `TEMPLATE_ID_ETU0011B018 = "ETU0011B018"` (JKKOrsjgsUseStpRunCC.java:198)] |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JKKOrsjgsUseStpRunCC.getSvcKeiUcwkInfo` | - | Service contract line item data (from `EKK0161B004` template) | Retrieves service contract line item details by work number for the target line. Called to fetch `tmpSvcKeiUcwk`, `kzkAfKeiFlg`, `svcKeiUcwkStat`. |
| R | `JKKOrsjgsUseStpRunCC.getSvcKeiUcwkInfo` | - | Service contract line item data (from `EKK0161B004` template) | Retrieves the continuation source (old phone) service line details during porting check. Looked up via `KEIZK_MT_SVC_KEI_UCWK_NO` key. |
| R | `JKKOrsjgsUseStpRunCC.checkKzkAfKeiChgFlg` | - | Service contract line item map | Checks whether the old phone's service line is in a porting-in-progress state. Returns `true` if porting is detected. |
| R | `JKKOrsjgsUseStpRunCC.callETU0011B018SC` | ETU0011B018SC | Porting work records (`ETU0011B018` template) | Calls the Number Portability work service component. Passes request reasons "1,2" (ITEN=installation, UPD=update). Populates `resultHash` with porting work status list. |
| R | `JKKOrsjgsUseStpRunCC.getSvcKeiUcwkInfo` | - | Porting work data (from `ETU0011B018` template) | Retrieves the porting work record for the target line to extract `bmpKojiStat` (porting work status). |

**Pre-computed evidence:**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JKKOrsjgsUseStpRunCC.callETU0011B018SC` | ETU0011B018SC | - | Calls `callETU0011B018SC` in `JKKOrsjgsUseStpRunCC` |
| - | `JKKOrsjgsUseStpRunCC.checkKzkAfKeiChgFlg` | JKKOrsjgsUseStpRunCC | - | Calls `checkKzkAfKeiChgFlg` in `JKKOrsjgsUseStpRunCC` |
| R | `JKKOrsjgsUseStpRunCC.getSvcKeiUcwkInfo` | JKKOrsjgsUseStpRunCC | - | Calls `getSvcKeiUcwkInfo` in `JKKOrsjgsUseStpRunCC` |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | JKKOrsjgsUseStpRunCC.svcKei_UseStp() | `svcKei_UseStp()` -> `judgeHakkoSod()` | `getSvcKeiUcwkInfo [R] Service Contract Line`, `callETU0011B018SC [R] Porting Work Records` |

**Notes:** No screen/batch entry points were found within 8 hops. The method is exclusively called by `svcKei_UseStp()` within the same class, acting as an internal decision subroutine.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] (L1036–1037)
Initialize the service contract line list reference from the shared result hash.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0161B004HashList = null` |
| 2 | SET | `eKK0161B004HashList = (ArrayList<HashMap<String, Object>>) resultHash.get(TEMPLATE_ID_EKK0161B004)` // Extract service line list [-> `TEMPLATE_ID_EKK0161B004 = "EKK0161B004"` (JKKHakkoSODConstCC.java:644)] |

**Block 2** — [IF] `eMobileSodKbn != 0` (L1040–1058)
Mobile SOD distribution key gate. If mobile SOD is configured (non-zero), short-circuit with immediate decision.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (eMobileSodKbn != 0)` // Mobile SOD is configured |

**Block 2.1** — [IF-TRUE] `EMOBILE_SOD_KBN_NONE == eMobileSodKbn` (L1043–1045)
Mobile SOD explicitly set to "none" — no SOD should be issued.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (EMOBILE_SOD_KBN_NONE == eMobileSodKbn)` // [-> `EMOBILE_SOD_KBN_NONE = 3` (JKKOrsjgsUseStpRunCC.java:244)] |
| 2 | RETURN | `return false;` // Do not issue SOD |

**Block 2.2** — [IF-FALSE] `EMOBILE_SOD_KBN_NONE != eMobileSodKbn` (L1048–1057)
Mobile SOD is set to an active value (e.g., `EM = 2` or `UCWK = 4`) — always issue SOD.

| # | Type | Code |
|---|------|------|
| 1 | IF | `else` // eMobileSodKbn is 2 (EM) or 4 (UCWK) |
| 2 | RETURN | `return true;` // Issue SOD |

**Block 3** — [SET] (L1061–1067)
Initialize variables for porting/BMP work checking and retrieve service contract agreement info.

| # | Type | Code |
|---|------|------|
| 1 | SET | `checkBmpKoji = false` // Porting work check flag |
| 2 | SET | `checkKbn = 0` // Porting work check type: 0=none, 1=old phone, 2=current |
| 3 | SET | `eKK0081A010Hash = null` |
| 4 | SET | `eKK0081A010Hash = (HashMap<String, Object>) resultHash.get(TEMPLATE_ID_EKK0081A010)` // Retrieve service agreement [-> `TEMPLATE_ID_EKK0081A010 = "EKK0081A010"` (JKKHakkoSODConstCC.java:638)] |
| 5 | SET | `svcKeiNo = (String) eKK0081A010Hash.get(EKK0081A010CBSMsg1List.SVC_KEI_NO)` |
| 6 | SET | `bmpSvcKeiUcwkNo = ""` |

**Block 4** — [SET] (L1070–1080)
Retrieve the service contract line item details and extract key fields.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eKK0161B004Hash = null` |
| 2 | CALL | `eKK0161B004Hash = getSvcKeiUcwkInfo(svc_kei_ucwk_no, eKK0161B004HashList, EKK0161B004CBSMsg1List.SVC_KEI_UCWK_NO)` // Get service line by work number |
| 3 | SET | `tmpSvcKeiUcwk = (String) eKK0161B004Hash.get(EKK0161B004CBSMsg1List.SVC_KEI_UCWK_NO)` // Service line number |
| 4 | SET | `kzkAfKeiFlg = (String) eKK0161B004Hash.get(EKK0161B004CBSMsg1List.KEIZK_AF_KEI_CHGECHU_FLG)` // Post-continuation contract change-in-progress flag |

**Block 5** — [IF] `svc_kei_ucwk_no.equals(tmpSvcKeiUcwk)` (L1082–1131)
The passed service line number matches the retrieved record. Proceed with deeper analysis.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (svc_kei_ucwk_no.equals(tmpSvcKeiUcwk))` |

**Block 5.1** — [IF-IF] `SVC_KEI_STAT_PAUSE.equals(svcKeiUcwkStat)` (L1084–1092)
Service line is in paused/suspended status. If paused, SOD is not issued since a stop-order already exists.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiUcwkStat = (String) eKK0161B004Hash.get(EKK0161B004CBSMsg1List.SVC_KEI_UCWK_STAT)` // Service line status |
| 2 | IF | `if (SVC_KEI_STAT_PAUSE.equals(svcKeiUcwkStat))` // [-> `SVC_KEI_STAT_PAUSE = "210"` (JKKOrsjgsUseStpRunCC.java:149)] |
| 3 | RETURN | `return false;` // Paused/suspended: do not issue SOD (stop-order already exists) |

**Block 5.2** — [IF-ELSE-IF] `!PRC_GRP_CD_TEL.equals(prc_grp_cd)` (L1093–1097)
Service line is not paused and is NOT a telecom service. SOD is issued.

| # | Type | Code |
|---|------|------|
| 1 | ELSE_IF | `else if (!PRC_GRP_CD_TEL.equals(prc_grp_cd))` // [-> `PRC_GRP_CD_TEL = "10"` (JKKHakkoSODConstCC.java:240)] |
| 2 | RETURN | `return true;` // Non-telecom service not paused: issue SOD |

**Block 5.3** — [IF] `!JKKSvcConst.KEIZK_AF_KEI_FLG_1.equals(kzkAfKeiFlg)` (L1100–1112)
Service line is not in porting process — check the continuation source (old phone) for porting status.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (!JKKSvcConst.KEIZK_AF_KEI_FLG_1.equals(kzkAfKeiFlg))` // [-> `KEIZK_AF_KEI_FLG_1 = "1"` (JKKSvcConst.java:2023)] — Not in porting |
| 2 | CALL | `map = getSvcKeiUcwkInfo(svc_kei_ucwk_no, eKK0161B004HashList, EKK0161B004CBSMsg1List.KEIZK_MT_SVC_KEI_UCWK_NO)` // Get old phone service line |

**Block 5.3.1** — [IF] `checkKzkAfKeiChgFlg(map)` (L1106–1111)
The old phone's continuation source is in porting process.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (checkKzkAfKeiChgFlg(map))` // Old phone is in porting |
| 2 | SET | `checkBmpKoji = true` |
| 3 | SET | `checkKbn = 1` // Porting on old phone (continuation source) |
| 4 | SET | `bmpSvcKeiUcwkNo = (String) map.get(EKK0161B004CBSMsg1List.SVC_KEI_UCWK_NO)` // Old service line number |

**Block 5.4** — [ELSE-IF] `JKKSvcConst.KEIZK_AF_KEI_FLG_1.equals(kzkAfKeiFlg)` (L1115–1120)
Current service line is already in porting process.

| # | Type | Code |
|---|------|------|
| 1 | ELSE_IF | `else if (JKKSvcConst.KEIZK_AF_KEI_FLG_1.equals(kzkAfKeiFlg))` // [-> `KEIZK_AF_KEI_FLG_1 = "1"` (JKKSvcConst.java:2023)] — In porting |
| 2 | SET | `checkBmpKoji = true` |
| 3 | SET | `checkKbn = 2` // Porting on current line |
| 4 | SET | `bmpSvcKeiUcwkNo = tmpSvcKeiUcwk` // Current service line number |

**Block 6** — [IF] `checkBmpKoji` (L1124–1170)
Porting work (Ranpo Kouji) check is required. Call the porting service and evaluate status.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (checkBmpKoji)` // Porting work needs to be checked |

**Block 6.1** — [CALL] (L1127–1132)
Invoke the Number Portability work service component.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `callETU0011B018SC(param, handle, svcKeiNo, JKKSvcConst.BMP_IRAI_NAIYO_CD_ITEN + "," + JKKSvcConst.BMP_IRAI_NAIYO_CD_UPD, resultHash)` |
| 2 | SET | [-> `BMP_IRAI_NAIYO_CD_ITEN = "1"` (JKKSvcConst.java:1035) — Installation reason] |
| 3 | SET | [-> `BMP_IRAI_NAIYO_CD_UPD = "2"` (JKKSvcConst.java:1037) — Update reason] |

**Block 6.2** — [SET] (L1134–1135)
Extract the porting work list from result hash.

| # | Type | Code |
|---|------|------|
| 1 | SET | `eTU0011B018HashList = null` |
| 2 | SET | `eTU0011B018HashList = (ArrayList<HashMap<String, Object>>) resultHash.get(TEMPLATE_ID_ETU0011B018)` // [-> `TEMPLATE_ID_ETU0011B018 = "ETU0011B018"` (JKKOrsjgsUseStpRunCC.java:198)] |

**Block 6.3** — [IF] `eTU0011B018HashList != null && eTU0011B018HashList.size() > 0` (L1135–1167)
Porting work data is available. Evaluate the porting work status.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (eTU0011B018HashList != null && eTU0011B018HashList.size() > 0)` |
| 2 | CALL | `bmpHash = getSvcKeiUcwkInfo(bmpSvcKeiUcwkNo, eTU0011B018HashList, ETU0011B018CBSMsg1List.SVC_KEI_UCWK_NO)` // Get porting record |

**Block 6.3.1** — [IF] `bmpHash != null` (L1138–1167)
Porting record found.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (bmpHash != null)` |
| 2 | SET | `bmpKojiStat = (String) bmpHash.get(ETU0011B018CBSMsg1List.BMP_KOJI_STAT)` // Porting work status code |

**Block 6.3.2** — [IF] `checkKbn == 1` (L1143–1156)
Porting is on the old phone (continuation source). Check status against `BMP_KOJI_STAT_SOD_HAKKOZM` (040) and `BMP_KOJI_STAT_KOJICL` (090).

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (checkKbn == 1)` // Old phone porting |
| 2 | IF | `if (JKKSvcConst.BMP_KOJI_STAT_SOD_HAKKOZM.compareTo(bmpKojiStat) <= 0 && JKKSvcConst.BMP_KOJI_STAT_KOJICL.compareTo(bmpKojiStat) > 0)` |
| 3 | SET | [-> `BMP_KOJI_STAT_SOD_HAKKOZM = "040"` (JKKSvcConst.java:1931) — SOD issued] |
| 4 | SET | [-> `BMP_KOJI_STAT_KOJICL = "090"` (JKKSvcConst.java:1939) — Porting cancelled] |
| 5 | RETURN | `return false;` // Old phone: SOD already issued for old number, do not issue new SOD |

**Block 6.3.3** — [ELSE] `checkKbn == 1` status check failed (L1157–1160)
Old phone porting but status outside the "SOD issued, not cancelled" range.

| # | Type | Code |
|---|------|------|
| 1 | ELSE | |
| 2 | RETURN | `return true;` // Old phone: SOD not yet issued or already cancelled — issue SOD |

**Block 6.3.4** — [ELSE-IF] `checkKbn == 2` (L1162–1170)
Porting is on the current line. Same status range check but **inverted logic** — SOD IS issued.

| # | Type | Code |
|---|------|------|
| 1 | ELSE_IF | `else if (checkKbn == 2)` // Porting on current line |
| 2 | IF | `if (JKKSvcConst.BMP_KOJI_STAT_SOD_HAKKOZM.compareTo(bmpKojiStat) <= 0 && JKKSvcConst.BMP_KOJI_STAT_KOJICL.compareTo(bmpKojiStat) > 0)` |
| 3 | RETURN | `return true;` // Current porting: SOD not yet issued or already cancelled — issue new SOD for new number |

**Block 6.3.5** — [ELSE] `checkKbn == 2` status check failed (L1167–1170)
Current porting but status already past "SOD issued" — SOD already exists.

| # | Type | Code |
|---|------|------|
| 1 | ELSE | |
| 2 | RETURN | `return false;` // Current porting: SOD already issued — do not duplicate |

**Block 7** — [RETURN] (L1173)
Default return when no conditions require SOD withholding.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true;` // Default: issue SOD |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `judgeHakkoSod` | Method | Judge whether to issue a Service Order Data |
| `svc_kei_ucwk_no` | Field | Service detail work number — internal tracking ID for a specific service contract line item |
| `svc_kei_no` | Field | Service contract number — the parent-level identifier for a service contract |
| `svc_kei_ucwk_stat` | Field | Service contract line status — indicates the current operational state of a service line |
| `prc_grp_cd` | Field | Processing group code — classifies the type of service (telecom, data, etc.) |
| `eMobileSodKbn` | Field | Mobile SOD distribution key — controls whether and how mobile SOD issuance is handled |
| `checkBmpKoji` | Field | Porting work execution flag — indicates whether Number Portability work status needs to be checked |
| `checkKbn` | Field | Porting work check type — 0=none, 1=old phone porting, 2=current porting |
| `bmpSvcKeiUcwkNo` | Field | Service line work number for BMP (port-of-origin / Ranpo Kouji) check target |
| `kzkAfKeiFlg` | Field | Post-continuation contract change-in-progress flag — "1" means the service line is in a number change (porting) process |
| `kzkmtSvcKeiUcwkNo` | Field | Continuation source service contract line number — the old phone's service line during porting |
| SOD | Acronym | Service Order Data — the telecom order fulfillment document that authorizes service changes |
| Ranpo Kouji | Business term | Number Portability — the process of porting a phone number from one carrier to another in Japan |
| `ETU0011B018SC` | SC Code | Porting work service component — service component handling porting work status queries |
| `EKK0161B004` | Template ID | Service contract line list template — returns service line details including status and porting flags |
| `EKK0081A010` | Template ID | Service contract agreement info template — returns top-level service contract details |
| `BMP_IRAI_NAIYO_CD_ITEN` | Constant | Porting request reason: installation (value: "1") |
| `BMP_IRAI_NAIYO_CD_UPD` | Constant | Porting request reason: update (value: "2") |
| `BMP_KOJI_STAT_SOD_HAKKOZM` | Constant | Porting work status: SOD issued (value: "040") |
| `BMP_KOJI_STAT_KOJICL` | Constant | Porting work status: porting cancelled (value: "090") |
| `BMP_KOJI_STAT_KOJIFIN` | Constant | Porting work status: porting completed (value: "050") |
| `SVC_KEI_STAT_PAUSE` | Constant | Service contract line status: paused/suspended (value: "210") |
| `PRC_GRP_CD_TEL` | Constant | Processing group code: telecom service (value: "10") |
| `KEIZK_AF_KEI_FLG_1` | Constant | Post-continuation change-in-progress flag value: "1" |
| `EMOBILE_SOD_KBN_NONE` | Constant | Mobile SOD distribution key: no SOD (value: 3) |
| `EMOBILE_SOD_KBN_EM` | Constant | Mobile SOD distribution key: EM mode (value: 2) |
| `EMOBILE_SOD_KBN_UCWK` | Constant | Mobile SOD distribution key: line detail only (value: 4) |
| ITEN | Business term | Installation — porting request reason for new installations |
| UPD | Business term | Update — porting request reason for existing contract modifications |
