# Business Logic — JKKAdchgCheckerCC.kojiStatusCheck() [444 LOC]

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

## 1. Role

### JKKAdchgCheckerCC.kojiStatusCheck()

The `kojiStatusCheck` method (Japanese: 工事案件情報取得処理, "Work Order Information Retrieval Processing") is a validation gate within the address-change registration workflow of the eo Customer Core System. Its business purpose is to determine whether any active work orders — either **new construction work** (Japanese: 新設工事) or **removal/disconnection work** (Japanese: 撤去工事) — are associated with the service contract numbers being processed during a customer address change. The method evaluates the before-and-after state of service contracts across three service types (network/Internet, telephone, and TV) and cross-references them against the work order master to identify pending construction tasks.

The method implements a **routing/dispatch pattern**: it branches by service type (network/telephone vs. TV) and by timing context (new construction after move-in vs. pre-change removal work). For each branch, it delegates to `isAftSvcAri` (Japanese: 変更後サービス有, "Service Exists After Change") to check whether a service will still exist at the destination address. The `isAftSvcAri` helper in turn queries the service contract agreement table (via EKK0081A010) to determine the current status of each service line.

The method plays a critical role in **blocking invalid address-change confirmations**. If a customer has both a before-service and after-service contract number, and work orders exist that would create a conflict (e.g., new construction at a destination where a removal is also planned), the method returns `false` to prevent the address change from being finalized. When the check passes, it sets the `nskj_um` (Japanese: 新設工事有無, "New Construction Presence/Absence") flag in the parameter map to `NSKJ_UM_1` ("1", "present") for downstream processing.

If no address-change-related services are detected (all service contract numbers are empty), the method returns `true` to allow the process to continue unblocked.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["kojiStatusCheck param, fixedText"])
    
    START --> INIT["Prepare: reqMap, condMap, resMap, paramMap"]
    INIT --> GET_MAP["Get paramMap = param.getData fixedText"]
    GET_MAP --> GET_MAPPERS["Get mapper = JKKAdchgMapperCC.getInstance"]
    GET_MAPPERS --> GET_INVOKER["Get scCall = new ServiceComponentRequestInvoker"]
    GET_INVOKER --> EXTRACT["Extract service numbers and change divisions for network, telephone, TV"]
    EXTRACT --> NEW_COND["New Construction Check: Does net or tel after-change number exist?"]
    
    NEW_COND -->|No| NETTEL_PRE["Pre-Change Check: Does net or tel before-change number exist?"]
    NEW_COND -->|Yes| MANSION_CHECK{"Mansion AND Not Optical Line?"}
    
    MANSION_CHECK -->|Yes| NO_WORK_NET["No work needed, skip"]
    MANSION_CHECK -->|No| PRIORITIZE_NET["Prioritize: net if present, else tel"]
    PRIORITIZE_NET --> SET_SVCKEINO1["svcKeiNo = prioritized value"]
    SET_SVCKEINO1 --> NETTEL_FLG1{"Both net and tel in retained/cancelled/no-contract?"}
    
    NETTEL_FLG1 -->|Yes| SET_NETTEL1["kojiari_flg = true"]
    NETTEL_FLG1 -->|No| IS_AFT_NET["isAftSvcAri: net existence check"]
    IS_AFT_NET --> IS_AFT_TEL["isAftSvcAri: tel existence check"]
    IS_AFT_TEL --> NO_SVC_AF{"Both absent at destination?"}
    
    NO_SVC_AF -->|Yes| SET_NETTEL2["kojiari_flg = true"]
    NO_SVC_AF -->|No| QUERY_NETTEL["Query EKU0011B050 work list by svcKeiNo"]
    SET_NETTEL1 --> QUERY_NETTEL
    SET_NETTEL2 --> QUERY_NETTEL
    
    QUERY_NETTEL --> ITER_NETTEL["Iterate ku0011_b050 list"]
    ITER_NETTEL --> GET_DETAIL["Query EKU0011A010 work detail by kojiak_no"]
    GET_DETAIL --> GET_CD["Get kojiSbtCd, koji_opIdoCd"]
    GET_CD --> TRANSFER_CHECK{"koji_opIdoCd = 00019 (transfer item)?"}
    
    TRANSFER_CHECK -->|No| SKIP_NETTEL["Skip to next item"]
    TRANSFER_CHECK -->|Yes| NEW_WORK_CHECK{"New work exists (001 or 003)?"}
    
    NEW_WORK_CHECK -->|Yes| SET_NEW["kojiari_flg = true, nskj_um = 1"]
    NEW_WORK_CHECK -->|No| NEXT_NETTEL["Next iteration"]
    SET_NEW --> NEXT_NETTEL
    SKIP_NETTEL --> NEXT_NETTEL
    NEXT_NETTEL --> END_ITER_NETTEL{"More items?"}
    END_ITER_NETTEL -->|Yes| GET_DETAIL
    END_ITER_NETTEL -->|No| CHECK_NEW_FLG{"kojiari_flg true?"}
    
    CHECK_NEW_FLG -->|No| RETURN_FALSE["Return false"]
    CHECK_NEW_FLG -->|Yes| TEL_FLG{"TV after-change exists?"}
    
    TEL_FLG -->|No| NETTEL_PRE
    TEL_FLG -->|Yes| SET_SVC_TV["svcKeiNo = tv_svc_kei_no_af"]
    SET_SVC_TV --> TV_FLG1{"TV flags in 2, 4, or 5?"}
    
    TV_FLG1 -->|Yes| SET_TV1["kojiari_flg = true"]
    TV_FLG1 -->|No| IS_AFT_TV["isAftTvAri = isAftSvcAri"]
    IS_AFT_TV --> NO_TV_AFT{"TV absent at destination?"}
    
    NO_TV_AFT -->|Yes| SET_TV2["kojiari_flg = true"]
    NO_TV_AFT -->|No| QUERY_TV["Query EKU0011B050 then EKU0011A010"]
    SET_TV1 --> QUERY_TV
    SET_TV2 --> QUERY_TV
    
    QUERY_TV --> ITER_TV["Iterate ku0011_b050 list"]
    ITER_TV --> GET_DETAIL_TV["Query EKU0011A010 detail"]
    GET_DETAIL_TV --> GET_CD_TV["Get kojiSbtCd, koji_opIdoCd"]
    GET_CD_TV --> TRANSFER_TV{"koji_opIdoCd = 00019?"}
    
    TRANSFER_TV -->|No| SKIP_TV["Skip"]
    TRANSFER_TV -->|Yes| NEW_WORK_TV{"kojiSbtCd = 001 OR 003?"}
    
    NEW_WORK_TV -->|Yes| SET_NEW_TV["kojiari_flg = true, nskj_um = 1"]
    NEW_WORK_TV -->|No| NEXT_TV["Next"]
    SET_NEW_TV --> NEXT_TV
    SKIP_TV --> NEXT_TV
    NEXT_TV --> END_ITER_TV2{"More?"}
    END_ITER_TV2 -->|Yes| GET_DETAIL_TV
    END_ITER_TV2 -->|No| CHECK_TV_FLG{"kojiari_flg?"}
    
    CHECK_TV_FLG -->|No| RETURN_FALSE
    CHECK_TV_FLG -->|Yes| PRE_CHANGE_INIT["kojiari_flg = false; Pre-Change Check"]
    
    PRE_CHANGE_INIT --> PRE_NETTEL_COND{"net or tel before-change exists?"}
    PRE_NETTEL_COND -->|No| PRE_TV_COND{"tv before-change exists?"}
    PRE_NETTEL_COND -->|Yes| PRE_MANSION{"Mansion AND Not Optical Line?"}
    
    PRE_MANSION -->|Yes| NO_WORK_PRE["No work"]
    PRE_MANSION -->|No| PRE_PRIORITIZE{"net before-change present?"}
    PRE_PRIORITIZE -->|Yes| PRE_SET_NET["svcKeiNo = net_svc_kei_no"]
    PRE_PRIORITIZE -->|No| PRE_SET_TEL["svcKeiNo = tel_svc_kei_no"]
    PRE_SET_NET --> NETTEL_PRE_FLG{"Either net OR tel retained?"}
    PRE_SET_TEL --> NETTEL_PRE_FLG
    
    NETTEL_PRE_FLG -->|Yes| PRE_SET1["kojiari_flg = true"]
    NETTEL_PRE_FLG -->|No| PRE_BOTH_FLG{"Both absent OR no-add?"}
    
    PRE_BOTH_FLG -->|Yes| PRE_SET2["kojiari_flg = true"]
    PRE_BOTH_FLG -->|No| PRE_QUERY["Query EKU0011B050 then EKU0011A010"]
    PRE_SET1 --> PRE_QUERY
    PRE_SET2 --> PRE_QUERY
    
    PRE_QUERY --> PRE_ITER["Iterate ku0011_b050"]
    PRE_ITER --> PRE_DETAIL["Query EKU0011A010"]
    PRE_DETAIL --> PRE_CD["Get kojiSbtCd, koji_opIdoCd"]
    PRE_CD --> PRE_TRANS{"koji_opIdoCd = 00019?"}
    
    PRE_TRANS -->|No| PRE_SKIP["Skip"]
    PRE_TRANS -->|Yes| PRE_NEW_CHK{"Removal work (002 or 004)?"}
    
    PRE_NEW_CHK -->|Yes| PRE_SET3["kojiari_flg = true"]
    PRE_NEW_CHK -->|No| PRE_NEXT["Next"]
    PRE_SET3 --> PRE_NEXT
    PRE_SKIP --> PRE_NEXT
    PRE_NEXT --> PRE_END_ITER{"More?"}
    PRE_END_ITER -->|Yes| PRE_DETAIL
    PRE_END_ITER -->|No| PRE_CHECK_FLG{"kojiari_flg?"}
    
    PRE_CHECK_FLG -->|No| RETURN_FALSE
    PRE_CHECK_FLG -->|Yes| PRE_TV_CHECK{"tv before-change exists?"}
    
    PRE_TV_CHECK -->|No| PRE_TV_SKIP["Skip TV"]
    PRE_TV_CHECK -->|Yes| PRE_SET_TV["svcKeiNo = tv_svc_kei_no"]
    PRE_SET_TV --> PRE_TV_FLG{"TV flags 2, 3, or 5?"}
    
    PRE_TV_FLG -->|Yes| PRE_TV_SET["kojiari_flg = true"]
    PRE_TV_FLG -->|No| PRE_TV_QUERY["Query EKU0011B050 then EKU0011A010"]
    PRE_TV_SET --> PRE_TV_QUERY
    
    PRE_TV_QUERY --> PRE_TV_ITER["Iterate"]
    PRE_TV_ITER --> PRE_TV_DET["Query EKU0011A010"]
    PRE_TV_DET --> PRE_TV_CD["Get kojiSbtCd, koji_opIdoCd"]
    PRE_TV_CD --> PRE_TV_TRANS{"koji_opIdoCd = 00019?"}
    
    PRE_TV_TRANS -->|No| PRE_TV_SKIP2["Skip"]
    PRE_TV_TRANS -->|Yes| PRE_TV_NEW{"kojiSbtCd = 002 OR 004?"}
    
    PRE_TV_NEW -->|Yes| PRE_TV_SET2["kojiari_flg = true"]
    PRE_TV_NEW -->|No| PRE_TV_NEXT["Next"]
    PRE_TV_SET2 --> PRE_TV_NEXT
    PRE_TV_SKIP2 --> PRE_TV_NEXT
    PRE_TV_NEXT --> PRE_TV_END{"More?"}
    PRE_TV_END -->|Yes| PRE_TV_DET
    PRE_TV_END -->|No| PRE_TV_FLG_CHK{"kojiari_flg?"}
    
    PRE_TV_FLG_CHK -->|No| RETURN_FALSE
    PRE_TV_FLG_CHK -->|Yes| PRE_TV_SKIP
    PRE_TV_SKIP --> RETURN_TRUE["Return true"]
    
    RETURN_FALSE --> END_NODE(["Continue"])
    RETURN_TRUE --> END_NODE(["Continue"])
    
    style START fill:#e1f5e1
    style END_NODE fill:#e1f5e1
    style RETURN_FALSE fill:#fde2e2
    style RETURN_TRUE fill:#e1f5e1
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | The request parameter object containing the address-change context. Its `getData(fixedText)` method returns a `HashMap` carrying service contract numbers (before and after) for network, telephone, and TV services, along with change division codes and transfer item codes. |
| 2 | `fixedText` | `String` | A user-specified arbitrary string used as a key to retrieve the relevant data map from the `param` object. Typically serves as an identifier for the specific data group within a multi-record request. |

**Instance fields / external state accessed:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `keepSesHandle` | `ThreadLocal<SessionHandle>` | Thread-local session handle storage used to pass the DB session through the SC call chain. Set by the caller (`maChecker`) before invocation. |

## 4. CRUD Operations / Called Services

### Pre-computed evidence from code analysis graph:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JKKAdchgMapperCC.setEKU0011B050` | EKU0011B050 | KU0011B050 (Work Order List) | Sets query conditions for work order list retrieval by service contract number |
| R | `ServiceComponentRequestInvoker.run` | EKU0011B050 | KU0011B050 (Work Order List) | Invokes the SC to retrieve the list of work orders linked to the service contract |
| R | `JKKAdchgMapperCC.getEKU0011B050` | EKU0011B050 | KU0011B050 (Work Order List) | Extracts the work order list result (ArrayList of HashMaps) from the SC response |
| - | `JKKAdchgMapperCC.scResultCheck` | - | - | Checks SC execution result for errors; throws if error detected |
| R | `JKKAdchgMapperCC.setEKU0011A010` | EKU0011A010 | KU0011A010 (Work Order Detail) | Sets query conditions for work order detail retrieval by work order number |
| R | `ServiceComponentRequestInvoker.run` | EKU0011A010 | KU0011A010 (Work Order Detail) | Invokes the SC to retrieve work order detail (type, transfer classification) |
| R | `JKKAdchgMapperCC.getEKU0011A010` | EKU0011A010 | KU0011A010 (Work Order Detail) | Extracts the work order detail result (HashMap) from the SC response |
| R | `JKKAdchgCheckerCC.isAftSvcAri` | EKK0081A010 | KK_T_SVC_KEI (Service Contract) | Checks whether a service still exists at the destination address after address change |
| R | `JKKAdchgCmnLogicCC.getEKK0081A010` | EKK0081A010 | KK_T_SVC_KEI (Service Contract Agreement) | Internal helper called by `isAftSvcAri` to query service contract status |

**CRUD analysis summary:**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `setEKU0011B050` | EKU0011B050 | KU0011B050 (Work Order List) | Query work order list by service contract number to find associated construction tasks |
| R | `run` (EKU0011B050) | EKU0011B050 | KU0011B050 (Work Order List) | Execute SC call to retrieve the work order list |
| R | `getEKU0011B050` | EKU0011B050 | KU0011B050 (Work Order List) | Parse SC response into ArrayList of work order records |
| - | `scResultCheck` | - | - | Validate SC execution succeeded; raise error on failure |
| R | `setEKU0011A010` | EKU0011A010 | KU0011A010 (Work Order Detail) | Query work order detail by work order number to get type (new/removal) and transfer classification |
| R | `run` (EKU0011A010) | EKU0011A010 | KU0011A010 (Work Order Detail) | Execute SC call to retrieve work order detail |
| R | `getEKU0011A010` | EKU0011A010 | KU0011A010 (Work Order Detail) | Parse SC response into HashMap with work order type code and transfer classification code |
| R | `isAftSvcAri` | EKK0081A010 | KK_T_SVC_KEI (Service Contract) | Determine if a service still exists after address change by checking service status (not 910/920 = still active) |

**How SC Codes were inferred:** The `setEKU0011B050` / `getEKU0011B050` and `setEKU0011A010` / `getEKU0011A010` method pairs map directly to CBS messages `EKU0011B050` and `EKU0011A010` (imported from `eo.ejb.cbs.cbsmsg`). The `isAftSvcAri` helper calls `getEKK0081A010` which maps to CBS `EKK0081A010` (Service Contract Agreement Lookup).

## 5. Dependency Trace

### Callers of kojiStatusCheck:

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0325 | `maChecker(handle, param, fixedText)` -> `kojiStatusCheck(param, fixedText)` | `setEKU0011B050 [R] KU0011B050`, `setEKU0011A010 [R] KU0011A010`, `getEKK0081A010 [R] KK_T_SVC_KEI` |

**Notes on caller:** The method is called from `maChecker` (Japanese: MAチェック処理, "MA Check Processing" — Maintenance Agreement Check), which is a validation screen component invoked during address-change registration. The call chain flows from a screen (likely KKSV0325, the address-change confirmation screen) -> `maChecker` (public method in the same class) -> `kojiStatusCheck` (private method). No other callers were found in the codebase.

### Terminal operations reached FROM this method:

| Terminal | Type | SC / Entity | Description |
|----------|------|-------------|-------------|
| `setEKU0011B050` + `getEKU0011B050` | R | KU0011B050 (Work Order List) | Retrieves work orders by service contract number |
| `setEKU0011A010` + `getEKU0011A010` | R | KU0011A010 (Work Order Detail) | Retrieves work order detail (type, transfer classification) |
| `getEKK0081A010` | R | KK_T_SVC_KEI (Service Contract Agreement) | Checks if service still exists at destination address |
| `scResultCheck` | - | - | Validates SC execution results; throws on error |

## 6. Per-Branch Detail Blocks

### Block 1 — Setup / Preparation (L903)

> Initialize local variables, obtain mapper and SC invoker instances, and extract service contract numbers and change division codes from the request parameter map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `reqMap` (local variable declaration) |
| 2 | SET | `condMap = new HashMap<String, String>()` |
| 3 | SET | `resMap` (local variable declaration) |
| 4 | SET | `paramMap = param.getData(fixedText)` // Cast to HashMap [-> FIXED_TEXT_KEY] |
| 5 | SET | `svcKeiNo = null` // Working service contract number holder |
| 6 | SET | `mapper = JKKAdchgMapperCC.getInstance()` // Get mapper instance |
| 7 | SET | `scCall = new ServiceComponentRequestInvoker()` // Get SC request invoker |
| 8 | SET | `net_svc_kei_no = (String)paramMap.get("net_svc_kei_no")` // Before-change network service contract number |
| 9 | SET | `tel_svc_kei_no = (String)paramMap.get("tel_svc_kei_no")` // Before-change telephone service contract number |
| 10 | SET | `tv_svc_kei_no = (String)paramMap.get("tv_svc_kei_no")` // Before-change TV service contract number |
| 11 | SET | `eohnt_use_svc_chg_div = (String)paramMap.get("eohnt_use_svc_chg_div")` // EO network service change division |
| 12 | SET | `eohtl_use_svc_chg_div = (String)paramMap.get("eohtl_use_svc_chg_div")` // EO telephone service change division |
| 13 | SET | `eohtv_use_svc_chg_div = (String)paramMap.get("eohtv_use_svc_chg_div")` // EO TV service change division |
| 14 | SET | `net_svc_kei_no_af = (String)paramMap.get("net_svc_kei_no_af")` // After-change network service contract number |
| 15 | SET | `tel_svc_kei_no_af = (String)paramMap.get("tel_svc_kei_no_af")` // After-change telephone service contract number |
| 16 | SET | `tv_svc_kei_no_af = (String)paramMap.get("tv_svc_kei_no_af")` // After-change TV service contract number |
| 17 | SET | `itenmMansionBukkenCd = (String)paramMap.get("itenmMansionBukkenCd")` // Before-transfer mansion property code |
| 18 | SET | `itensMansionBukkenCd = (String)paramMap.get("itensMansionBukkenCd")` // After-transfer mansion property code |
| 19 | SET | `itenmKaisenCd = (String)paramMap.get("itenmKaisenCd")` // Before-transfer line code |
| 20 | SET | `itensKaisenCd = (String)paramMap.get("itensKaisenCd")` // After-transfer line code |
| 21 | SET | `kojiari_flg = false` // Work order existence flag |

---

### Block 2 — New Construction Check: Network/Telephone Branch (L922)

> Japanese comment: 新設工事の確認 (Check for new construction work). Determine if any new construction work (kojiSbtCd = 001 or 003) exists for the after-change network or telephone service contracts.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!StringUtils.isEmpty(net_svc_kei_no_af) || !StringUtils.isEmpty(tel_svc_kei_no_af)` [L922] |

#### Block 2.1 — Mansion + Light Line Exclusion (L925)

> Japanese comment: マンションかつ光回線以外 (Mansion AND not optical line). Skip processing if the destination is a mansion property with an optical line (not excluded type).

| # | Type | Code |
|---|------|------|
| 1 | IF | `"001".equals(itensMansionBukkenCd) && !"1004".equals(itensKaisenCd)` [L925] |
| 1.1 | EXEC | `// No work needed (工事無し)` // Early return path — do nothing for this branch |
| 2 | ELSE | [L927] |

##### Block 2.1.1 — Prioritize service contract number (L929)

> Japanese comment: ネットのサービス契約番号があれば優先して使用 (Use network service contract number preferentially if present)

| # | Type | Code |
|---|------|------|
| 1 | IF | `!StringUtils.isEmpty(net_svc_kei_no_af)` [L929] |
| 1.1 | SET | `svcKeiNo = net_svc_kei_no_af` |
| 2 | ELSE | [L931] |
| 2.1 | SET | `svcKeiNo = tel_svc_kei_no_af` |

##### Block 2.1.2 — Check if both network and telephone are retained/cancelled/no-contract (L936)

> Japanese comment: ネットと電話の変更区分が保留、解約、または契約なしの場合は工事無し (If both network and telephone change divisions are pending, cancelled, or no contract, then no work)

| # | Type | Code |
|---|------|------|
| 1 | IF | `("2".equals(eohnt_use_svc_chg_div) || "4".equals(eohnt_use_svc_chg_div) || "5".equals(eohnt_use_svc_chg_div)) && ("2".equals(eohtl_use_svc_chg_div) || "4".equals(eohtl_use_svc_chg_div) || "5".equals(eohtl_use_svc_chg_div))` [L936] |
| 1.1 | SET | `kojiari_flg = true` // Both services are in a no-work state |

##### Block 2.1.3 — Check if services exist after move (L942)

> Japanese comment: 引越し先にネット・電話がない場合（住変中解約対応）(If network/telephone do not exist at destination — address-change mid-term cancellation support)

| # | Type | Code |
|---|------|------|
| 1 | SET | `isAftNetAri = isAftSvcAri(param, fixedText, eohnt_use_svc_chg_div, net_svc_kei_no_af)` [L942] // Check network existence at destination |
| 2 | SET | `isAftTelAri = isAftSvcAri(param, fixedText, eohtl_use_svc_chg_div, tel_svc_kei_no_af)` [L943] // Check telephone existence at destination |
| 3 | IF | `!isAftNetAri && !isAftTelAri` [L945] |
| 3.1 | SET | `kojiari_flg = true` // Check OK — no services at destination |

##### Block 2.1.4 — Query work order list and check for new construction (L951)

> Japanese comment: EKU0011B050 工事案件一覧照会 (EKU0011B050 Work Order List Inquiry). Query the work order list and iterate through results to find new construction work.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `condMap.clear()` [L951] |
| 2 | EXEC | `condMap.put(JKKAdchgMapperCC.COND_KEY_KOJIAK_NO_SVC_KEI_NO, svcKeiNo)` [L952] |
| 3 | CALL | `reqMap = mapper.setEKU0011B050(param, fixedText, condMap)` [L953] // Set query conditions |
| 4 | CALL | `resMap = scCall.run(reqMap, keepSesHandle.get())` [L954] // Execute SC call |
| 5 | CALL | `ku0011_b050 = mapper.getEKU0011B050(param, fixedText, resMap)` [L955] // Get result list |
| 6 | CALL | `mapper.scResultCheck(param)` [L956] // Check SC result |
| 7 | SET | `ku0011_b050Ite = ku0011_b050.iterator()` [L957] |
| 8 | WHILE | `ku0011_b050Ite.hasNext()` [L958] |

###### Block 2.1.4.1 — Query work order detail per item (L962)

> Japanese comment: カレントの工事案件情報を取得 (Get current work order information) / 工事案件情報の取得 (Get work order information)

| # | Type | Code |
|---|------|------|
| 1 | SET | `curKu0011_b050 = ku0011_b050Ite.next()` [L963] |
| 2 | EXEC | `condMap.clear()` [L966] |
| 3 | EXEC | `condMap.put(JKKAdchgMapperCC.COND_KEY_KOJIAK_NO, curKu0011_b050.get(EKU0011B050CBSMsg1List.KOJIAK_NO))` [L967] // Query by work order number |
| 4 | CALL | `reqMap = mapper.setEKU0011A010(param, fixedText, condMap)` [L968] |
| 5 | CALL | `resMap = scCall.run(reqMap, keepSesHandle.get())` [L969] |
| 6 | CALL | `ku0011_a010 = mapper.getEKU0011A010(param, fixedText, resMap)` [L970] |
| 7 | CALL | `mapper.scResultCheck(param)` [L971] |
| 8 | SET | `kojiSbtCd = (String)ku0011_a010.get(EKU0011A010CBSMsg1List.KOJIAK_SBT_CD)` [L973] // Work order sub-type code |
| 9 | SET | `koji_opIdoCd = (String)ku0011_a010.get(EKU0011A010CBSMsg1List.KOJI_UK_OPTNTY_IDO_DIV)` [L974] // Work transfer classification code |

###### Block 2.1.4.2 — Filter by transfer item (L976)

> Only process transfer-related work orders (koji_opIdoCd = "00019"). Skip all others.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!"00019".equals(koji_opIdoCd)` [L976] |
| 1.1 | EXEC | `continue` // Skip to next work order item |

###### Block 2.1.4.3 — Check for new construction (L981)

> Japanese comment: 新設工事が存在するかのチェック (Check whether new construction work exists)

| # | Type | Code |
|---|------|------|
| 1 | IF | `"001".equals(kojiSbtCd) || "003".equals(kojiSbtCd)` [L981] |
| 1.1 | SET | `kojiari_flg = true` // New construction work found |
| 1.2 | SET | `paramMap.put("nskj_um", NSKJ_UM_1)` // New construction present [-> NSKJ_UM_1 = "1" (JKKAdchgCheckerCC.java:95)] |

###### Block 2.1.4.4 — End of while (L985)

| # | Type | Code |
|---|------|------|
| 1 | CLOSE | while loop end |

###### Block 2.1.4.5 — Fail if no new construction found (L986)

> If no new construction work was found after iterating all items, return false.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!kojiari_flg` [L986] |
| 1.1 | RETURN | `false` |

---

### Block 3 — New Construction Check: TV Branch (L992)

> Japanese comment: テレビ (TV). Same logic as Block 2 but for TV service. Checked only if network/telephone new construction check passed.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!StringUtils.isEmpty(tv_svc_kei_no_af)` [L992] |

#### Block 3.1 — Set service contract number (L995)

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiNo = tv_svc_kei_no_af` |

#### Block 3.2 — Check if TV is retained/cancelled/no-contract (L998)

> Japanese comment: テレビの変更区分が保留、解約、または契約なしの場合は工事無し (If TV change division is pending, cancelled, or no contract, then no work)

| # | Type | Code |
|---|------|------|
| 1 | IF | `"2".equals(eohtv_use_svc_chg_div) || "4".equals(eohtv_use_svc_chg_div) || "5".equals(eohtv_use_svc_chg_div)` [L998] |
| 1.1 | SET | `kojiari_flg = true` |

#### Block 3.3 — Check if TV exists after move (L1003)

> Japanese comment: 引越し先にテレビがない場合（住変中解約対応）(If TV does not exist at destination — address-change mid-term cancellation support)

| # | Type | Code |
|---|------|------|
| 1 | SET | `isAftTvAri = isAftSvcAri(param, fixedText, eohtv_use_svc_chg_div, tv_svc_kei_no_af)` [L1003] |
| 2 | IF | `!isAftTvAri` [L1005] |
| 2.1 | SET | `kojiari_flg = true` // Check OK — no TV at destination |

#### Block 3.4 — Query work order list and check for new construction (L1011)

> Japanese comment: EKU0011B050 工事案件一覧照会 (EKU0011B050 Work Order List Inquiry). Same query pattern as Block 2.1.4.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `condMap.clear()` [L1011] |
| 2 | EXEC | `condMap.put(JKKAdchgMapperCC.COND_KEY_KOJIAK_NO_SVC_KEI_NO, svcKeiNo)` [L1012] |
| 3 | CALL | `reqMap = mapper.setEKU0011B050(param, fixedText, condMap)` [L1013] |
| 4 | CALL | `resMap = scCall.run(reqMap, keepSesHandle.get())` [L1014] |
| 5 | CALL | `ku0011_b050 = mapper.getEKU0011B050(param, fixedText, resMap)` [L1015] |
| 6 | CALL | `mapper.scResultCheck(param)` [L1016] |
| 7 | SET | `ku0011_b050Ite = ku0011_b050.iterator()` [L1017] |
| 8 | WHILE | `ku0011_b050Ite.hasNext()` [L1018] |

###### Block 3.4.1 — Query work order detail per item (L1022)

> Same pattern as Block 2.1.4.1.

| # | Type | Code |
|---|------|------|
| 1 | SET | `curKu0011_b050 = ku0011_b050Ite.next()` [L1023] |
| 2 | EXEC | `condMap.clear()` [L1026] |
| 3 | EXEC | `condMap.put(JKKAdchgMapperCC.COND_KEY_KOJIAK_NO, curKu0011_b050.get(EKU0011B050CBSMsg1List.KOJIAK_NO))` [L1027] |
| 4 | CALL | `reqMap = mapper.setEKU0011A010(param, fixedText, condMap)` [L1028] |
| 5 | CALL | `resMap = scCall.run(reqMap, keepSesHandle.get())` [L1029] |
| 6 | CALL | `ku0011_a010 = mapper.getEKU0011A010(param, fixedText, resMap)` [L1030] |
| 7 | CALL | `mapper.scResultCheck(param)` [L1031] |
| 8 | SET | `kojiSbtCd = (String)ku0011_a010.get(EKU0011A010CBSMsg1List.KOJIAK_SBT_CD)` [L1033] |
| 9 | SET | `koji_opIdoCd = (String)ku0011_a010.get(EKU0011A010CBSMsg1List.KOJI_UK_OPTNTY_IDO_DIV)` [L1034] |

###### Block 3.4.2 — Filter by transfer item (L1036)

| # | Type | Code |
|---|------|------|
| 1 | IF | `!"00019".equals(koji_opIdoCd)` [L1036] |
| 1.1 | EXEC | `continue` |

###### Block 3.4.3 — Check for new construction (L1041)

> Japanese comment: 新設工事が存在するかのチェック (Check whether new construction work exists)

| # | Type | Code |
|---|------|------|
| 1 | IF | `"001".equals(kojiSbtCd) || "003".equals(kojiSbtCd)` [L1041] |
| 1.1 | SET | `kojiari_flg = true` |
| 1.2 | SET | `paramMap.put("nskj_um", NSKJ_UM_1)` [-> NSKJ_UM_1 = "1" (JKKAdchgCheckerCC.java:95)] |

###### Block 3.4.4 — End of while and fail check (L1047-L1049)

| # | Type | Code |
|---|------|------|
| 1 | CLOSE | while loop |
| 2 | IF | `!kojiari_flg` [L1048] |
| 2.1 | RETURN | `false` |

---

### Block 4 — Pre-Change Check: Network/Telephone Branch (L1057)

> Japanese comment: 撤去工事の確認 (Check for removal work). Determine if any removal work (kojiSbtCd = 002 or 004) exists for the before-change network or telephone service contracts.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kojiari_flg = false` [L1057] // Reset flag |
| 2 | IF | `!StringUtils.isEmpty(net_svc_kei_no) || !StringUtils.isEmpty(tel_svc_kei_no)` [L1059] |

#### Block 4.1 — Mansion + Light Line Exclusion (L1062)

> Same logic as Block 2.1.

| # | Type | Code |
|---|------|------|
| 1 | IF | `"001".equals(itenmMansionBukkenCd) && !"1004".equals(itenmKaisenCd)` [L1062] |
| 1.1 | EXEC | `// No work needed (工事無し)` |
| 2 | ELSE | [L1064] |

##### Block 4.1.1 — Prioritize service contract number (L1066)

| # | Type | Code |
|---|------|------|
| 1 | IF | `!StringUtils.isEmpty(net_svc_kei_no)` [L1066] |
| 1.1 | SET | `svcKeiNo = net_svc_kei_no` |
| 2 | ELSE | [L1068] |
| 2.1 | SET | `svcKeiNo = tel_svc_kei_no` |

##### Block 4.1.2 — Check if either network or telephone is retained (L1071)

> Japanese comment: ネットと電話のどちらかの変更区分が保留 (Either network or telephone change division is pending)

| # | Type | Code |
|---|------|------|
| 1 | IF | `"2".equals(eohnt_use_svc_chg_div) || "2".equals(eohtl_use_svc_chg_div)` [L1071] |
| 1.1 | SET | `kojiari_flg = true` |

##### Block 4.1.3 — Check if both are no-contract or no-add (L1074)

> Japanese comment: または両方契約なし追加の場合工事無し (Or if both no-contract no-add, then no work)

| # | Type | Code |
|---|------|------|
| 1 | IF | `("5".equals(eohnt_use_svc_chg_div) || "3".equals(eohnt_use_svc_chg_div)) && ("5".equals(eohtl_use_svc_chg_div) || "3".equals(eohtl_use_svc_chg_div))` [L1074] |
| 1.1 | SET | `kojiari_flg = true` |

##### Block 4.1.4 — Query work order list and check for removal work (L1080)

> Japanese comment: EKU0011B050 工事案件一覧照会 (EKU0011B050 Work Order List Inquiry). Same query pattern, but looking for removal work.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `condMap.clear()` [L1080] |
| 2 | EXEC | `condMap.put(JKKAdchgMapperCC.COND_KEY_KOJIAK_NO_SVC_KEI_NO, svcKeiNo)` [L1081] |
| 3 | CALL | `reqMap = mapper.setEKU0011B050(param, fixedText, condMap)` [L1082] |
| 4 | CALL | `resMap = scCall.run(reqMap, keepSesHandle.get())` [L1083] |
| 5 | CALL | `ku0011_b050 = mapper.getEKU0011B050(param, fixedText, resMap)` [L1084] |
| 6 | CALL | `mapper.scResultCheck(param)` [L1085] |
| 7 | SET | `ku0011_b050Ite = ku0011_b050.iterator()` [L1086] |
| 8 | WHILE | `ku0011_b050Ite.hasNext()` [L1087] |

###### Block 4.1.4.1 — Query work order detail (L1091)

> Same pattern as Block 2.1.4.1.

| # | Type | Code |
|---|------|------|
| 1 | SET | `curKu0011_b050 = ku0011_b050Ite.next()` [L1092] |
| 2 | EXEC | `condMap.clear()` [L1095] |
| 3 | EXEC | `condMap.put(JKKAdchgMapperCC.COND_KEY_KOJIAK_NO, curKu0011_b050.get(EKU0011B050CBSMsg1List.KOJIAK_NO))` [L1096] |
| 4 | CALL | `reqMap = mapper.setEKU0011A010(param, fixedText, condMap)` [L1097] |
| 5 | CALL | `resMap = scCall.run(reqMap, keepSesHandle.get())` [L1098] |
| 6 | CALL | `ku0011_a010 = mapper.getEKU0011A010(param, fixedText, resMap)` [L1099] |
| 7 | CALL | `mapper.scResultCheck(param)` [L1100] |
| 8 | SET | `kojiSbtCd = (String)ku0011_a010.get(EKU0011A010CBSMsg1List.KOJIAK_SBT_CD)` [L1102] |
| 9 | SET | `koji_opIdoCd = (String)ku0011_a010.get(EKU0011A010CBSMsg1List.KOJI_UK_OPTNTY_IDO_DIV)` [L1103] |

###### Block 4.1.4.2 — Filter by transfer item (L1105)

| # | Type | Code |
|---|------|------|
| 1 | IF | `!"00019".equals(koji_opIdoCd)` [L1105] |
| 1.1 | EXEC | `continue` |

###### Block 4.1.4.3 — Check for removal work (L1110)

> Japanese comment: 撤去工事が存在するかのチェック (Check whether removal work exists)

| # | Type | Code |
|---|------|------|
| 1 | IF | `"002".equals(kojiSbtCd) || "004".equals(kojiSbtCd)` [L1110] |
| 1.1 | SET | `kojiari_flg = true` |

###### Block 4.1.4.4 — End of while and fail check (L1114-L1116)

| # | Type | Code |
|---|------|------|
| 1 | CLOSE | while loop |
| 2 | IF | `!kojiari_flg` [L1115] |
| 2.1 | RETURN | `false` |

---

### Block 5 — Pre-Change Check: TV Branch (L1122)

> Japanese comment: テレビ (TV). Same logic as Block 4 but for TV service.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kojiari_flg = false` [L1122] // Reset flag |
| 2 | IF | `!StringUtils.isEmpty(tv_svc_kei_no)` [L1124] |

#### Block 5.1 — Set service contract number (L1127)

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiNo = tv_svc_kei_no` |

#### Block 5.2 — Check if TV is retained/added/no-contract (L1130)

> Japanese comment: テレビの変更区分が保留、追加、または契約なしの場合は工事無し (If TV change division is pending, added, or no contract, then no work)

| # | Type | Code |
|---|------|------|
| 1 | IF | `"2".equals(eohtv_use_svc_chg_div) || "3".equals(eohtv_use_svc_chg_div) || "5".equals(eohtv_use_svc_chg_div)` [L1130] |
| 1.1 | SET | `kojiari_flg = true` |

#### Block 5.3 — Query work order list and check for removal work (L1136)

> Same query pattern as Block 4.1.4, checking for removal work codes.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `condMap.clear()` [L1136] |
| 2 | EXEC | `condMap.put(JKKAdchgMapperCC.COND_KEY_KOJIAK_NO_SVC_KEI_NO, svcKeiNo)` [L1137] |
| 3 | CALL | `reqMap = mapper.setEKU0011B050(param, fixedText, condMap)` [L1138] |
| 4 | CALL | `resMap = scCall.run(reqMap, keepSesHandle.get())` [L1139] |
| 5 | CALL | `ku0011_b050 = mapper.getEKU0011B050(param, fixedText, resMap)` [L1140] |
| 6 | CALL | `mapper.scResultCheck(param)` [L1141] |
| 7 | SET | `ku0011_b050Ite = ku0011_b050.iterator()` [L1142] |
| 8 | WHILE | `ku0011_b050Ite.hasNext()` [L1143] |

###### Block 5.3.1 — Query work order detail (L1147)

> Same pattern as Block 4.1.4.1.

| # | Type | Code |
|---|------|------|
| 1 | SET | `curKu0011_b050 = ku0011_b050Ite.next()` [L1148] |
| 2 | EXEC | `condMap.clear()` [L1151] |
| 3 | EXEC | `condMap.put(JKKAdchgMapperCC.COND_KEY_KOJIAK_NO, curKu0011_b050.get(EKU0011B050CBSMsg1List.KOJIAK_NO))` [L1152] |
| 4 | CALL | `reqMap = mapper.setEKU0011A010(param, fixedText, condMap)` [L1153] |
| 5 | CALL | `resMap = scCall.run(reqMap, keepSesHandle.get())` [L1154] |
| 6 | CALL | `ku0011_a010 = mapper.getEKU0011A010(param, fixedText, resMap)` [L1155] |
| 7 | CALL | `mapper.scResultCheck(param)` [L1156] |
| 8 | SET | `kojiSbtCd = (String)ku0011_a010.get(EKU0011A010CBSMsg1List.KOJIAK_SBT_CD)` [L1158] |
| 9 | SET | `koji_opIdoCd = (String)ku0011_a010.get(EKU0011A010CBSMsg1List.KOJI_UK_OPTNTY_IDO_DIV)` [L1159] |

###### Block 5.3.2 — Filter by transfer item (L1161)

| # | Type | Code |
|---|------|------|
| 1 | IF | `!"00019".equals(koji_opIdoCd)` [L1161] |
| 1.1 | EXEC | `continue` |

###### Block 5.3.3 — Check for removal work (L1166)

> Japanese comment: 撤去工事が存在するかのチェック (Check whether removal work exists)

| # | Type | Code |
|---|------|------|
| 1 | IF | `"002".equals(kojiSbtCd) || "004".equals(kojiSbtCd)` [L1166] |
| 1.1 | SET | `kojiari_flg = true` |

###### Block 5.3.4 — End of while and fail check (L1170-L1172)

| # | Type | Code |
|---|------|------|
| 1 | CLOSE | while loop |
| 2 | IF | `!kojiari_flg` [L1171] |
| 2.1 | RETURN | `false` |

---

### Block 6 — Return Success (L1183)

> If all applicable checks passed (or no checks were needed because no service contract numbers were present), return true to allow the address change to proceed.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `true` [L1183] |

---

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `kojiStatusCheck` | Method | Work order status check — validates whether active construction work orders exist that would conflict with an address change |
| `kojiari_flg` | Field | Work order existence flag — set to `true` when a relevant work order is found (new construction or removal), `false` otherwise |
| `svcKeiNo` | Field | Service contract number — internal tracking ID for a service contract line item |
| `net_svc_kei_no` | Field | Before-change network (Internet) service contract number |
| `tel_svc_kei_no` | Field | Before-change telephone service contract number |
| `tv_svc_kei_no` | Field | Before-change TV (cable/satellite) service contract number |
| `net_svc_kei_no_af` | Field | After-change network service contract number — the network service number assigned at the destination address |
| `tel_svc_kei_no_af` | Field | After-change telephone service contract number |
| `tv_svc_kei_no_af` | Field | After-change TV service contract number |
| `eohnt_use_svc_chg_div` | Field | EO network service change division code — indicates what type of change is happening to the network service |
| `eohtl_use_svc_chg_div` | Field | EO telephone service change division code |
| `eohtv_use_svc_chg_div` | Field | EO TV service change division code |
| `itenmMansionBukkenCd` | Field | Before-transfer mansion property code — identifies the source address property type |
| `itensMansionBukkenCd` | Field | After-transfer mansion property code — identifies the destination address property type |
| `itenmKaisenCd` | Field | Before-transfer line code — identifies the source address line type (e.g., optical fiber vs. other) |
| `itensKaisenCd` | Field | After-transfer line code |
| `nskj_um` | Field | New construction presence/absence flag — set to "1" (present) or "0" (absent) by the calling method |
| `kojiSbtCd` | Local | Work order sub-type code — classifies the type of work: 001 = new construction, 002 = removal, 003 = new construction (additional), 004 = removal (additional) |
| `koji_opIdoCd` | Local | Work transfer classification code — "00019" indicates a transfer-related work order (address change context) |
| `EKU0011B050` | SC Code | Work order list inquiry SC — retrieves the list of work orders associated with a service contract number |
| `EKU0011A010` | SC Code | Work order detail inquiry SC — retrieves detailed information about a specific work order (type, transfer classification) |
| `EKK0081A010` | SC Code | Service contract agreement inquiry SC — checks the status of a service contract to determine if it still exists |
| KU0011B050 | Entity/DB | Work order list table — stores the master list of work orders linked to service contracts |
| KU0011A010 | Entity/DB | Work order detail table — stores detailed information about individual work orders |
| KK_T_SVC_KEI | Entity/DB | Service contract table — stores service contract agreements and their status (active/cancelled) |
| `isAftSvcAri` | Method | Service existence after change check — determines if a service still exists at the destination address |
| Service Change Division 2 | Constant | Retained (保留) — the service continues at the new address without change |
| Service Change Division 3 | Constant | Added (追加) — a new service is being added |
| Service Change Division 4 | Constant | Cancelled (解約) — the service is being cancelled |
| Service Change Division 5 | Constant | No contract (契約なし) — no service contract exists |
| 工事無し | Japanese term | No work — indicates no construction work is needed (e.g., when both services are in a retained/cancelled/no-contract state) |
| 新設工事 | Japanese term | New construction work — installing new infrastructure at a location |
| 撤去工事 | Japanese term | Removal/disconnection work — dismantling or disconnecting existing infrastructure |
| 住変中解約 | Japanese term | Address-change mid-term cancellation — handling the case where a service is cancelled during an address change |
| マンション | Japanese term | Apartment building / mansion property type — triggers special handling logic |
| 光回線 | Japanese term | Optical fiber line — "1004" is the code for non-excluded optical line types |
| CHECK_OK | Constant | "1" — check passed indicator |
| CHECK_ERR | Constant | "0" — check error indicator |
| NSKJ_UM_1 | Constant | "1" — new construction work present |
| NSKJ_UM_0 | Constant | "0" — no new construction work |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service |
| EO | Business term | e-Opticom (eo customers) — the service provider brand |
| SC | Acronym | Service Component — a backend service layer that executes business logic against the database |
| CBS | Acronym | Business Support System — the suite of business components in the eo system architecture |
| MA | Acronym | Maintenance Agreement — the broader address-change validation process that calls `kojiStatusCheck` |
| COND_KEY_KOJIAK_NO_SVC_KEI_NO | Constant | Query condition key — "cond_key_kojiak_no_svc_kei_no", used to pass service contract number to work order queries |
| COND_KEY_KOJIAK_NO | Constant | Query condition key — "cond_key_kojiak_no", used to pass work order number to detail queries |
