# Business Logic — JKKKojiChgPlaceNoCC.execute() [307 LOC]

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

## 1. Role

### JKKKojiChgPlaceNoCC.execute()

This method implements the **indoor coordination (宅内連携) process for line location change** — the central business operation that synchronizes a customer's new address across all service contract line items and their associated indoor equipment after a residential address change (住所変更). It serves as a shared common component (CC) called by the KKSV0150 screen during the residential change operation workflow, bridging the screen's high-level workflow to low-level SC (Service Component) calls.

The method implements a **delegation and orchestration pattern**: it reads address data from a work area map, queries all service contracts attached to a given line (回線), filters by service type (network/FTTH, TV, telephone), retrieves equipment registration information, determines the post-processing timing pattern (即時 or 後日) for each device, performs deferred registration for out-of-scope devices, and finally pushes all immediate indoor equipment changes to the indoor equipment management system. For telephone service contracts, it also updates the emergency notification address and handles the special case where a phone service shares a line with a network service (avoiding duplicate processing).

The method has an **early-exit guard**: if no address change flag is set or the function code is not "Check & Register" (FUNC_CODE_1 = "1"), the method returns immediately, performing no operations. This ensures the indoor coordination logic runs only when actually needed.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["execute handle param fixedText"])
    EARLY_EXIT(["Return param early"])
    INIT["Initialize scCall ccMsg kktkSvcKeiList workMap"]
    GET_ADR_FLAG["Get adChgUmFlg func_code from ccMsg"]
    COND_EARLY["adChgUmFlg false OR func_code not 1"]
    GET_BASE_DATE["Get baseYmd from JPCBPCommon"]
    BUILD_MSG1["Build inMsg EKKA0020002 address data"]
    CALL_PLACE["callSC EKKA0020002 Get Place No"]
    GET_PCD["Extract placeNo put into workMap"]
    GET_SVC_PARAMS["Get jh_init_svckeino_new juhenShori svcKeiNo"]
    COND_SVC["New install AND processing target AND svc differ"]
    OVERRIDE_SVC["svcKeiNo equals jh svc_kei_no"]
    BUILD_MSG2["Build inMsg EKK0251A010 line details query"]
    CALL_LINE_QUERY["callSC EKK0251A010 Get line details"]
    GET_MSKM["Get mskmDtlNo from ccMsg"]
    COND_UPD["workMap K_COM_SVC_UP_DTM exists"]
    USE_WORK_UPD["lastUpdDtm from workMap"]
    COND_JH["New install AND processing target"]
    USE_JH_UPD["lastUpdDtm from upd_dtm_jh"]
    USE_DEF_UPD["lastUpdDtm from upd_dtm"]
    COND_LATEST["lastUpdDtmKsn exists AND greater than lastUpdDtm"]
    USE_LATEST["lastUpdDtm equals lastUpdDtmKsn"]
    CALL_LINE_UPDATE["callSC EKK0251C030 Update line details"]
    CALL_SVC_LIST["callSC EKK0081B007 Get service contracts"]
    COND_ADCHG["adrChgDtlList not empty AND new construction match"]
    BUILD_CHILD["Loop adchgDtlList get child contracts via EKK0081A010"]
    USE_OUT["Use outLst directly as outArList"]
    GET_SVC_NUMS["Get svcKeiNoNet Tv Tel from outArList"]
    COND_PHONE["SVC_CD equals 02 phone service"]
    CALL_EMG["execSvckeiEmgUpd emergency notification address"]
    CALL_KOJIAK["getKojiak Get project case"]
    COND_ADD_K["kojiakMap valid AND not duplicate"]
    ADD_KOJIAK["kojiMapList add kojiakMap"]
    CALL_EQUIP["getKojiakTgKikiList Get indoor equipment"]
    COND_TGT["isTgtSvc network TV phone only"]
    SKIP_TGT["continue skip non-target"]
    CALL_KKTKINFO["getKktkInfExecSvcKei Get equipment reg info"]
    COND_PHONE_NET["Phone service with net on same line"]
    SKIP_DUP["continue skip duplicate"]
    GET_KIKIINFO["getKikiRecInfo Get device registration"]
    GET_STATUS["Get kikiStatus seizouUmu kojiak_no haisoFlg"]
    COND_STATUS["kikiStatus equals 00 excluded"]
    SKIP_STATUS["continue skip excluded"]
    CALC_PTN["getRnkeiPtnExecSvckei Calculate timing pattern"]
    COND_PTN_1["ptn equals 1 post process"]
    COND_PTN_2["ptn equals 2 immediate process"]
    PTN_1["addPlnoRnktgkkWkExecSvcKei post-process reg"]
    PTN_2["Set svcKeiNo add to kktkSvcKeiList"]
    CALL_PLACE_UPD["execKikitkSvcKeiPlaceUpd Update device place number"]
    COND_EQUIP["kktkSvcKeiList not empty"]
    CALL_UPDTAKN["updTaknkiki Indoor equipment integration"]
    FINAL_RETURN(["Return param"])
    START --> INIT --> GET_ADR_FLAG --> COND_EARLY
    COND_EARLY -- true --> EARLY_EXIT
    COND_EARLY -- false --> GET_BASE_DATE
    GET_BASE_DATE --> BUILD_MSG1 --> CALL_PLACE --> GET_PCD
    GET_PCD --> GET_SVC_PARAMS --> COND_SVC
    COND_SVC -- true --> OVERRIDE_SVC --> BUILD_MSG2
    COND_SVC -- false --> BUILD_MSG2
    BUILD_MSG2 --> CALL_LINE_QUERY --> GET_MSKM
    GET_MSKM --> COND_UPD
    COND_UPD -- true --> USE_WORK_UPD --> COND_LATEST
    COND_UPD -- false --> COND_JH
    COND_JH -- true --> USE_JH_UPD --> COND_LATEST
    COND_JH -- false --> USE_DEF_UPD --> COND_LATEST
    USE_WORK_UPD --> CALL_LINE_UPDATE
    USE_JH_UPD --> CALL_LINE_UPDATE
    USE_DEF_UPD --> CALL_LINE_UPDATE
    COND_LATEST -- true --> USE_LATEST --> CALL_LINE_UPDATE
    COND_LATEST -- false --> CALL_LINE_UPDATE
    CALL_LINE_UPDATE --> CALL_SVC_LIST
    CALL_SVC_LIST --> COND_ADCHG
    COND_ADCHG -- true --> BUILD_CHILD --> GET_SVC_NUMS
    COND_ADCHG -- false --> USE_OUT --> GET_SVC_NUMS
    GET_SVC_NUMS --> COND_PHONE
    COND_PHONE -- true --> CALL_EMG --> CALL_KOJIAK
    COND_PHONE -- false --> CALL_KOJIAK
    CALL_KOJIAK --> COND_ADD_K
    COND_ADD_K -- true --> ADD_KOJIAK --> CALL_EQUIP
    COND_ADD_K -- false --> CALL_EQUIP
    CALL_EQUIP --> COND_TGT
    COND_TGT -- false --> SKIP_TGT --> CALL_KKTKINFO
    COND_TGT -- true --> CALL_KKTKINFO
    SKIP_TGT --> CALL_KKTKINFO
    CALL_KKTKINFO --> COND_PHONE_NET
    COND_PHONE_NET -- true --> SKIP_DUP --> CALL_PLACE_UPD
    COND_PHONE_NET -- false --> GET_KIKIINFO
    SKIP_DUP --> GET_KIKIINFO
    GET_KIKIINFO --> GET_STATUS --> COND_STATUS
    COND_STATUS -- true --> SKIP_STATUS --> CALC_PTN
    COND_STATUS -- false --> CALC_PTN
    SKIP_STATUS --> CALC_PTN
    CALC_PTN --> COND_PTN_1
    COND_PTN_1 -- true --> PTN_1 --> CALL_PLACE_UPD
    COND_PTN_1 -- false --> COND_PTN_2
    COND_PTN_2 -- true --> PTN_2 --> CALL_PLACE_UPD
    COND_PTN_2 -- false --> CALL_PLACE_UPD
    CALL_PLACE_UPD --> COND_EQUIP
    COND_EQUIP -- true --> CALL_UPDTAKN --> FINAL_RETURN
    COND_EQUIP -- false --> FINAL_RETURN
    OVERRIDE_SVC --> BUILD_MSG2
    USE_LATEST --> CALL_LINE_UPDATE
    ADD_KOJIAK --> CALL_EQUIP
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle for executing SC (Service Component) calls. Carries the database connection context used throughout all data retrieval and update operations. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object that carries the address change work area (`jushoHenkoInfo` key) containing all address change details — flag indicators, function codes, service contract numbers, device codes, and updated timestamps. It is both read (to extract `ccMsg` data) and written (to store `place_no`, `KK_COM_SVC_UP_DTM` back into the work area map). |
| 3 | `fixedText` | `String` | Exception judgment fixed text key used to retrieve error message templates. Passed through to SC invocations and internal helper methods. Represents the exception handling context (e.g., error class name) for the calling screen. |

**Instance fields / external state read by the method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `TEMPLATE_ID_EKK0251B001` | `String` | Template ID for service contract line detail approval — unused in execute() (commented out) |
| `TEMPLATE_ID_EKK0251A010` | `String` | Template ID for service contract line detail agreement — used in line details query |
| `TEMPLATE_ID_EKK0251C030` | `String` | Template ID for service contract line detail content change — used in line details update |
| `TEMPLATE_ID_EKKA0020002` | `String` | Template ID for place number coordination — used to retrieve place number |
| `TEMPLATE_ID_EKK0081B007` | `String` | Template ID for active service contract listing — used to fetch service contracts per line |
| `TEMPLATE_ID_EKK0081A010` | `String` | Template ID for service contract agreement — used to fetch child contracts from address change details |
| `TEMPLATE_ID_EKK0191C061` | `String` | Template ID for service contract info change (address change) — used in `execSvckeiEmgUpd` for phone emergency address update |
| `TEMPLATE_ID_EKK0191C060` | `String` | Template ID for service contract info change — used in `execSvckeiEmgUpd` |
| `TEMPLATE_ID_EKK0161A010` | `String` | Template ID for service contract info change — used in `execSvckeiEmgUpd` |
| `KK_COM_SVC_UP_DTM` | `String` | Work area key for service contract update timestamp |
| `MSKM_DTL_NO_PNO` | `String` | Work area key for measurement detail number / place number |
| `FUNC_CODE_1` | `String` | Function code value "1" — Check & Register mode |
| `FUNC_CODE_2` | `String` | Function code value "2" — Check only mode |
| `JUHEN_SHORI_ST` | `String` | Processing type value "2" — Address change: new install + withdrawal |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `callSC` (EKKA0020002) | EKKA0020002 | Address master tables | Retrieves place number (place_no) from address data via callSC with EKKA0020002 template. Reads the new address components (prefecture, city, town, block, building) and resolves to a place number. |
| R | `callSC` (EKK0251A010) | EKK0251A010 | Service contract line tables | Retrieves line (回線) details for the given kaisen_ucwk_no (service contract line work number). Used to get mskm_dtl_no_pno (measurement detail number/place number). |
| U | `callSC` (EKK0251C030) | EKK0251C030 | Service contract line tables | Updates the line details with new address information, including place_no. Returns the updated timestamp (upd_dtm). |
| R | `callSC` (EKK0081B007) | EKK0081B007 | Service contract tables | Retrieves all service contracts attached to a given line (回線). Returns service contract details including service code (SVC_CD), service contract number, and status. |
| R | `callSC` (EKK0081A010) | EKK0081A010 | Service contract tables | Retrieves child service contracts for address change detail records (adrChgDtlList). Used when the address change involves new construction services. |
| U | `execSvckeiEmgUpd` | EKK0191C061 / EKK0191C060 / EKK0161A010 | Service contract info tables | Updates the emergency notification address (緊急通報用住所) for telephone service contracts (SVC_CD = "02"). Modifies address info associated with eo光電話 (eo optical telephone) service. |
| R | `getKojiak` | EKK (Project case SC) | Project case tables | Retrieves project case (工事案件) information for a service contract number. Used to get project case number and delivery/completion flags. |
| R | `getKojiakTgKikiList` | EKU (Equipment SC) | Indoor equipment tables | Retrieves indoor equipment (家電機器) targeted by project cases. Returns device registration information including device status, serial number flag, and delivery status. |
| R | `getKktkInfExecSvcKei` | EKK (Equipment info SC) | Equipment registration tables | Retrieves equipment registration information (宅内機器情報) for a service contract number. Used to determine which devices are registered under each service contract. |
| R | `getKikiRecInfo` | (Local processing) | - | Extracts device registration info (kiki_status, seizou_no_um, kojiak_no, haiso_saksei_zumi_flg) from kktkMap data structure. |
| R | `getRnkeiPtnExecSvckei` | (Local processing) | - | Calculates the post-processing execution timing pattern based on device status, serial number flag, and delivery status. Returns 1 (post-process), 2 (immediate), or other (skip). |
| R | `getSvcKeiNo` | (Local processing) | - | Extracts service contract numbers from outArList filtered by service type code (01=network, 02=phone, 03=TV). |
| R | `getInsSvckeiNo` | (Local processing) | - | Determines the insertion service contract number for indoor equipment coordination, selecting from network/TV/phone service contract numbers. |
| R | `isTgtSvc` | (Local processing) | - | Determines whether a service is a target for indoor equipment coordination (network/FTTH, TV, or telephone only). |
| R | `isAddKojiakMap` | (Local processing) | - | Checks whether a project case entry is already registered in the kojiMapList to avoid duplicates. |
| C | `addPlnoRnktgkkWkExecSvcKei` | EKK2401D010 | Equipment registration work tables | Registers equipment place number coordination work for post-processing (後日連携). Used when the device needs deferred registration (ptn == 1). |
| U | `execKikitkSvcKeiPlaceUpd` | EKK0341C234 / EKK0341C200 | Equipment contract tables | Updates the device place number for service contracts attached to the line. Modified in v14.00.01 to pass additional parameters (svc_kei_no_tel, svc_kei_no_net, svc_kei_kaisen_ucwk_no_shinsetsu) for handling new construction address changes. |
| U | `updTaknkiki` | EKKA0020003 / EKKA0020004 | Indoor equipment management tables | Pushes immediate indoor equipment changes (ptn == 2) to the indoor equipment management system. Updates device information (type agreement) and changes device place number. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0150 | `KKSV0150OPOperation.target1e.execute(handle, param, fixedText)` | `callSC EKKA0020002 [R] Address master`, `callSC EKK0251A010 [R] Service contract line`, `callSC EKK0251C030 [U] Service contract line`, `callSC EKK0081B007 [R] Service contract`, `callSC EKK0081A010 [R] Service contract`, `execSvckeiEmgUpd [U] Service contract info (eo光電話)`, `execKikitkSvcKeiPlaceUpd [U] Equipment contract`, `addPlnoRnktgkkWkExecSvcKei [C] Equipment work`, `updTaknkiki [U] Indoor equipment` |

## 6. Per-Branch Detail Blocks

**Block 1** — [INITIALIZATION] (L224)

> Initialize core objects and retrieve the address change message map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `scCall = new ServiceComponentRequestInvoker()` |
| 2 | SET | `ccMsg = (HashMap)param.getData(fixedText)` // Extract ccMsg from param using fixedText key |
| 3 | SET | `kktkSvcKeiList = new ArrayList()` // Indoor equipment service contract list |
| 4 | SET | `inMsg = null` // Input message array |
| 5 | SET | `workMap = (HashMap)param.getMappingWorkArea()` // Retrieve work area map |
| 6 | SET | `adChgUmFlg = (Boolean)ccMsg.get("adrChangeFlg")` // Address change flag (住所変更有无フラグ) |
| 7 | SET | `func_code = (String)ccMsg.get("func_code")` // Function code (機能コード) |

**Block 2** — [IF] `(adChgUmFlg == false || !FUNC_CODE_1.equals(func_code))` [FUNC_CODE_1="1"] (L237)

> Early exit guard — if no address change is pending or the function code is not "Check & Register", return immediately without processing.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return param` // Skip indoor coordination entirely |

**Block 3** — [INITIALIZATION] (L243)

> Initialize variables and retrieve the base operation date.

| # | Type | Code |
|---|------|------|
| 1 | SET | `mskmDtlNo = null` // Measurement detail number |
| 2 | SET | `lastUpdDtm = null` // Last update timestamp |
| 3 | SET | `placeNo = null` // Place number |
| 4 | CALL | `baseYmd = JPCBPCommon.getOpeDate(null)` // Base date (基準年月日) |

**Block 4** — [ASSIGN: BUILD INMSG FOR PLACE NO RETRIEVAL] (L250)

> Build the input message array for EKKA0020002 (SetPlace / 設置場所番号取得).

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMsg = new Object[][]{ {TEMPLATEID, TEMPLATE_ID_EKKA0020002}, {FUNC_CODE, "1"}, {KEY_SETPLACE_AD_CD, ccMsg.get(kaisen_place_ad_cd)}, {KEY_SETPLACE_PCD, ccMsg.get(kaisen_place_pcd)}, {KEY_SETPLACE_STATE_NM, ccMsg.get(kaisen_place_state_nm)}, {KEY_SETPLACE_CITY_NM, ccMsg.get(kaisen_place_city_nm)}, {KEY_SETPLACE_OAZTSU_NM, ccMsg.get(kaisen_place_oaztsu_nm)}, {KEY_SETPLACE_AZCHO_NM, ccMsg.get(kaisen_place_azcho_nm)}, {KEY_SETPLACE_BNCHIGO, ccMsg.get(kaisen_place_bnchigo)}, {KEY_SETPLACE_ADRTTM, ccMsg.get(kaisen_place_adrttm)}, {KEY_SETPLACE_ADRRM, ccMsg.get(kaisen_place_adrrm)} }` |

**Block 5** — [CALL] `callSC(handle, scCall, param, fixedText, inMsg, placeNo)` (L263)

> Call SC EKKA0020002 to retrieve the place number (場所番号) from the new address data.

| # | Type | Code |
|---|------|------|
| 1 | SET | `placeMsg = callSC(...)` |
| 2 | SET | `placeMsgLst = placeMsg.getCAANMsgList(EKKA0020002CBSMsg2List)` // Extract place message list |

**Block 6** — [IF] `(placeMsgLst != null && placeMsgLst.length > 0)` (L266)

> Extract place number from the first element of the response and store it in the work map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `placeNo = placeMsgLst[0].getString(SETPLACE_NO)` |
| 2 | SET | `workMap.put("place_no", placeNo)` |

**Block 7** — [BLOCK: v5.00.00 Fix — Service contract number handling for new install + withdrawal] (L275)

> When processing new install + withdrawal (住所変更: 新設+撤去), the service contract number from the joint (jh) process may be preferred.

| # | Type | Code |
|---|------|------|
| 1 | SET | `jh_init_svckeino_new = (String)ccMsg.get("jh_init_svckeino_new")` // New install-side service contract number |
| 2 | SET | `juhenShori = (String)ccMsg.get("juhen_shori")` // Processing flag (処理) |
| 3 | SET | `svcKeiNo = (String)ccMsg.get("svc_kei_no")` // Service contract number (サービス契約番号) |

**Block 7.1** — [IF] `jh_init_svckeino_new == "0" && JUHEN_SHORI_ST == "2" && svcKeiNo != ccMsg.get("svc_kei_no_jh")` (L279)

> If this is a new install (jh_init_svckeino_new = "0"), the processing type is new install + withdrawal (JUHEN_SHORI_ST = "2"), and the service contract numbers differ, override with the joint process number.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiNo = (String)ccMsg.get("svc_kei_no_jh")` // Use joint process service contract number |

**Block 8** — [ASSIGN: BUILD INMSG FOR LINE DETAILS QUERY] (L288)

> Build the input message array for EKK0251A010 (Service contract line detail agreement / サービス契約回線内容合意).

| # | Type | Code |
|---|------|------|
| 1 | SET | `kaisenUcwkNo = (String)ccMsg.get("svc_kei_kaisen_ucwk_no")` // Service contract line work number |
| 2 | SET | `inMsg = new Object[][]{ {TEMPLATEID, TEMPLATE_ID_EKK0251A010}, {FUNC_CODE, FUNC_CODE_2}, {KEY_SVC_KEI_KAISEN_UCWK_NO, kaisenUcwkNo}, {KEY_GENE_ADD_DTM, ""} }` |

**Block 9** — [CALL] `callSC(handle, scCall, param, fixedText, inMsg)` (L293)

> Retrieve line details (回線内訳情報) — the service contracts attached to a specific line.

| # | Type | Code |
|---|------|------|
| 1 | SET | `msg = callSC(...)` |
| 2 | SET | `mskmDtlNo = (String)ccMsg.get(MSKM_DTL_NO_PNO)` // Extract measurement detail number |

**Block 10** — [IF] `workMap.get(KK_COM_SVC_UP_DTM) != null && !"".equals(workMap.get(KK_COM_SVC_UP_DTM))` (L297)

> Determine the last update timestamp — prefer the work area stored timestamp if available.

| # | Type | Code |
|---|------|------|
| 1 | SET | `lastUpdDtm = (String)workMap.get(KK_COM_SVC_UP_DTM)` |

**Block 10.1** — [ELSE] (L302)

> If no work area timestamp, check for joint process timestamp or use default.

| # | Type | Code |
|---|------|------|
| 1 | IF | `jh_init_svckeino_new == "0" && JUHEN_SHORI_ST == "2"` |
| 2 | SET (true) | `lastUpdDtm = (String)ccMsg.get("upd_dtm_jh")` // Joint process update timestamp |
| 3 | SET (false) | `lastUpdDtm = (String)ccMsg.get("upd_dtm")` // Default update timestamp |

**Block 11** — [BLOCK: v5.00.03 Addition — Use maximum update timestamp] (L314)

> Retrieve the maximum update timestamp from the line (回線の最大の更新日時) and use it if greater than the current lastUpdDtm.

| # | Type | Code |
|---|------|------|
| 1 | SET | `lastUpdDtmKsn = (String)ccMsg.get("adchg_ksn_upd_dtm")` // Line max update timestamp |
| 2 | IF | `lastUpdDtmKsn != null && !"".equals(lastUpdDtmKsn) && lastUpdDtmKsn.compareTo(lastUpdDtm) > 0` |
| 3 | SET (true) | `lastUpdDtm = lastUpdDtmKsn` // Use line max timestamp |

**Block 12** — [CALL] `editInMsgEKK0251C030(kaisenUcwkNo, mskmDtlNo, lastUpdDtm, msg, ccMsg, placeNo)` (L325)

> Edit the input message array for EKK0251C030 (Service contract line detail content change / サービス契約回線内容変更).

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMsg = editInMsgEKK0251C030(...)` |

**Block 13** — [CALL] `callSC(handle, scCall, param, fixedText, inMsg)` (L328)

> Update the line details with the new address. This performs the core update operation for the service contract line.

| # | Type | Code |
|---|------|------|
| 1 | SET | `msg = callSC(...)` |
| 2 | SET | `lastUpdDtm = msg.getString(EKK0251C030CBSMsg.UPD_DTM)` // Updated timestamp |
| 3 | SET | `workMap.put(KK_COM_SVC_UP_DTM, lastUpdDtm)` // Store back to work area |

**Block 14** — [ASSIGN: BUILD INMSG FOR SERVICE CONTRACT LIST] (L332)

> Build the input message array for EKK0081B007 (Active service contract listing / 回線利用中サービス契約一覧照会).

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMsg = new Object[][]{ {TEMPLATEID, TEMPLATE_ID_EKK0081B007}, {FUNC_CODE, "1"}, {KEY_SVC_KEI_KAISEN_UCWK_NO, kaisenUcwkNo}, {KEY_OPE_YMD, baseYmd} }` |

**Block 15** — [CALL] `callSC(handle, scCall, param, fixedText, inMsg)` (L338)

> Retrieve all service contracts attached to this line (回線に付くサービス契約を取得).

| # | Type | Code |
|---|------|------|
| 1 | SET | `msg = callSC(...)` |
| 2 | SET | `outLst = msg.getCAANMsgList(EKK0081B007CBSMsg1List)` // Extract service contract list |

**Block 16** — [BLOCK: v7.00.00 Fix — Address change detail child contract handling] (L343)

> Build outArList from either address change detail records (new construction) or directly from the line's service contracts.

| # | Type | Code |
|---|------|------|
| 1 | SET | `outArList = new ArrayList<CAANMsg>()` |
| 2 | SET | `adchgDtlList = (ArrayList)ccMsg.get("adrChgDtlList")` // Address change detail list |

**Block 16.1** — [IF] `adchgDtlList.size() > 0 && kaisenUcwkNo.equals(ccMsg.get("svc_kei_kaisen_ucwk_no_shinsetsu"))` (L348)

> If there are address change detail records AND the current line's work number matches the new construction service contract work number, retrieve child contracts from the address change details.

| # | Type | Code |
|---|------|------|
| 1 | SET | `childadrMap = null` |
| 2 | FOR | `j = 0; j < adchgDtlList.size(); j++` |
| 3 | SET | `childadrMap = (HashMap)adchgDtlList.get(j)` |
| 4 | SET | `adchg_dtl_sbt_cd = (String)childadrMap.get("adchg_dtl_sbt_cd")` // Address change detail type code |
| 5 | IF | `!ADCHG_DTL_SBT_CD_01.equals(adchg_dtl_sbt_cd)` [ADCHG_DTL_SBT_CD_01="01"] |
| 6 | SET (continue) | `continue` // Skip non-service-contract-number detail types |
| 7 | SET | `chaf_skbt_no = (String)childadrMap.get("chaf_skbt_no")` // Child service contract number |
| 8 | IF | `chaf_skbt_no != null && !"".equals(chaf_skbt_no)` |
| 9 | SET | Build inMsg for EKK0081A010 with chaf_skbt_no and baseYmd |
| 10 | SET | `msg = callSC(handle, scCall, param, fixedText, inMsg)` |
| 11 | SET | `o81Lst = msg.getCAANMsgList(EKK0081A010CBSMsg1List)` |
| 12 | IF | `o81Lst != null && o81Lst.length > 0` |
| 13 | SET (true) | `outArList.add(o81Lst[0])` |

**Block 16.2** — [ELSE] (L373)

> If no address change detail records, use the original outLst from the line's service contract listing.

| # | Type | Code |
|---|------|------|
| 1 | FOR | `i = 0; i < outLst.length; i++` |
| 2 | SET | `outArList.add(outLst[i])` |

**Block 17** — [ASSIGN] (L380)

> Extract service contract numbers by service type.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kojiMapList = new ArrayList<HashMap<String, String>>()` |
| 2 | SET | `svcKeiNoNet = getSvcKeiNo(outArList, "01")` // Network (ネット) service contract number |
| 3 | SET | `svcKeiNoTv = getSvcKeiNo(outArList, "03")` // TV (TV) service contract number |
| 4 | SET | `svcKeiNoTel = getSvcKeiNo(outArList, "02")` // Telephone (電話) service contract number |
| 5 | SET | `kojiakMap = null` |

**Block 18** — [BLOCK: v5.00.04 Addition — Emergency notification address update for phone services] (L395)

> For telephone service contracts (SVC_CD = "02"), update the emergency notification address (緊急通報用住所) for eo光電話.

| # | Type | Code |
|---|------|------|
| 1 | FOR | `i = 0; i < outArList.size(); i++` |
| 2 | IF | `"02".equals(outArList.get(i).getString(EKK0081B007CBSMsg1List.SVC_CD))` [SVC_CD_02="02"] |
| 3 | SET | `lastUpdDtm = execSvckeiEmgUpd(handle, scCall, param, fixedText, outArList.get(i), lastUpdDtm, baseYmd)` |
| 4 | SET | `workMap.put(KK_COM_SVC_UP_DTM, lastUpdDtm)` |

**Block 19** — [FOR: PROJECT CASE RETRIEVAL] (L415)

> For each service contract in outArList, retrieve the associated project case (工事案件) information.

| # | Type | Code |
|---|------|------|
| 1 | FOR | `i = 0; i < outArList.size(); i++` |
| 2 | SET | `kojiakMap = getKojiak(handle, scCall, param, fixedText, outArList.get(i).getString(EKK0081B007CBSMsg1List.SVC_KEI_NO))` // Get project case |
| 3 | IF | `kojiakMap != null && isAddKojiakMap(kojiMapList, kojiakMap.get("kojiak_no"))` |
| 4 | SET (true) | `kojiMapList.add(kojiakMap)` // Add non-duplicate project case |

**Block 20** — [BLOCK: INDOOR EQUIPMENT RETRIEVAL] (L427)

> For all collected project cases, retrieve the targeted indoor equipment (家電機器).

| # | Type | Code |
|---|------|------|
| 1 | SET | `kojiakTgKikiList = new ArrayList<HashMap<String, String>>()` |
| 2 | FOR | `mp : kojiMapList` |
| 3 | SET | `kojiakTgKikiList = getKojiakTgKikiList(handle, scCall, param, fixedText, mp, kojiakTgKikiList)` |

**Block 21** — [FOR: MAIN EQUIPMENT COORDINATION LOOP] (L435)

> Core loop — process each service contract in outArList for indoor equipment coordination (連携).

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiNo = null` |
| 2 | FOR | `i = 0; i < outArList.size(); i++` |
| 3 | SET | `svcKeiNo = outArList.get(i).getString(EKK0081B007CBSMsg1List.SVC_KEI_NO)` |

**Block 21.1** — [IF] `!isTgtSvc(outArList.get(i))` (L442)

> Skip non-target services (only network/FTTH, TV, and telephone are processed).

| # | Type | Code |
|---|------|------|
| 1 | SET (continue) | `continue` |

**Block 21.2** — [CALL] `getKktkInfExecSvcKei(handle, scCall, param, fixedText, svcKeiNo, baseYmd)` (L448)

> Retrieve equipment registration information for the service contract (回線に付く対象機器検索).

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktkMap = getKktkInfExecSvcKei(...)` |

**Block 21.3** — [FOR: INNER LOOP over kktkMap entries] (L450)

> Iterate over each device registration entry within a service contract.

| # | Type | Code |
|---|------|------|
| 1 | FOR | `j = 0; j < kktkMap.size(); j++` |
| 2 | SET | `map = kktkMap.get(String.valueOf(j))` |

**Block 21.3.1** — [IF] `svcKeiNo.equals(svcKeiNoTel) && map.get("svc_kei_kaisen_ucwk_no") != null && !"".equals(svcKeiNoNet)` (L456)

> Skip duplicate processing: if this is a telephone service that shares a line with a network service, skip to avoid double processing (2度処理しないため).

| # | Type | Code |
|---|------|------|
| 1 | SET (continue) | `continue` |

**Block 21.3.2** — [CALL] `getKikiRecInfo(map, kojiakTgKikiList)` (L463)

> Get device registration info (機器の状態取得).

| # | Type | Code |
|---|------|------|
| 1 | SET | `kikiRecInfo = getKikiRecInfo(map, kojiakTgKikiList)` |

**Block 21.3.3** — [SET: Extract device fields] (L467)

| # | Type | Code |
|---|------|------|
| 1 | SET | `kikiStatus = kikiRecInfo.get("kiki_status")` // Device status (01=under construction, 02=serial pending, 03=in use, 00=excluded) |
| 2 | SET | `seizouUmu = kikiRecInfo.get("seizou_no_um")` // Has serial number flag (製造番号有無) |
| 3 | SET | `kojiak_no = kikiRecInfo.get("kojiak_no")` // Project case number (工事案件番号) |
| 4 | SET | `haisoSakseiZumiFlg = kikiRecInfo.get("haiso_saksei_zumi_flg")` // Delivery completion flag (配送済みフラグ) |

**Block 21.3.4** — [IF] `"00".equals(kikiStatus)` (L475)

> Skip excluded devices (対象外).

| # | Type | Code |
|---|------|------|
| 1 | SET (continue) | `continue` |

**Block 21.3.5** — [CALL] `getRnkeiPtnExecSvckei(haisoSakseiZumiFlg, kikiStatus, seizouUmu)` (L478)

> Calculate the post-processing execution timing pattern (連携タイミングチェック). Returns: 1 = post-process (後日連携), 2 = immediate process (即時連携), other = skip.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ptn = getRnkeiPtnExecSvckei(haisoSakseiZumiFlg, kikiStatus, seizouUmu)` |
| 2 | SET | `insSvcKei = getInsSvckeiNo(map, svcKeiNo, svcKeiNoNet, svcKeiNoTv, svcKeiNoTel)` |

**Block 21.3.6** — [IF] `1 == ptn` (L484)

> Post-process (後日連携) — register equipment place number coordination work for deferred processing (場所番号連携対象機器ワーク登録).

| # | Type | Code |
|---|------|------|
| 1 | SET | `addPlnoRnktgkkWkExecSvcKei(handle, scCall, param, fixedText, map, insSvcKei, kikiStatus, kojiak_no, placeNo)` |

**Block 21.3.7** — [ELSE IF] `2 == ptn` (L488)

> Immediate process (即時連携) — set the service contract number and add to the indoor equipment coordination list (設定場所番号連携保持領域).

| # | Type | Code |
|---|------|------|
| 1 | SET | `map.put("svc_kei_no", insSvcKei)` |
| 2 | SET | `kktkSvcKeiList.add(map)` |

**Block 21.4** — [CALL] `execKikitkSvcKeiPlaceUpd(handle, param, fixedText, svcKeiNo, placeNo, mskmDtlNo, svcKeiNoTel, svcKeiNoNet, svc_kei_kaisen_ucwk_no_shinsetsu)` (L497)

> Update the device place number for the service contract (機器場所番号CC実行 — 回線に付くサービス契約分処理). Modified in v14.00.01 to pass additional parameters for handling new construction address changes.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svc_kei_kaisen_ucwk_no_shinsetsu = (String)ccMsg.get("svc_kei_kaisen_ucwk_no_shinsetsu")` // New construction service contract work number |
| 2 | SET | `execKikitkSvcKeiPlaceUpd(handle, param, fixedText, svcKeiNo, placeNo, mskmDtlNo, svcKeiNoTel, svcKeiNoNet, svc_kei_kaisen_ucwk_no_shinsetsu)` |

**Block 22** — [IF] `kktkSvcKeiList.size() > 0` (L507)

> If there are immediate process devices, push them to the indoor equipment management system (家電機器管理システム連携).

| # | Type | Code |
|---|------|------|
| 1 | SET | `updTaknkiki(handle, scCall, param, fixedText, kktkSvcKeiList, placeNo)` |

**Block 23** — [RETURN] (L511)

> Return the processed parameter object.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return param` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `adChgUmFlg` | Field | Address change flag (住所変更有无フラグ) — indicates whether an address change is pending |
| `adchg_dtl_sbt_cd` | Field | Address change detail type code (住所変更明細種別コード) — classifies address change sub-types (01 = service contract number, 02 = service contract line number) |
| `adrChgDtlList` | Field | Address change detail list (住所変更明細リスト) — list of address change detail records for new construction scenarios |
| `kaisen_place_ad_cd` | Field | Implemented place address code (改善場所アドレスコード) — address code from the new address |
| `kaisen_place_pcd` | Field | Implemented place postal code (改善場所郵便番号) — postal code from the new address |
| `kaisen_place_state_nm` | Field | Implemented place state name (改善場所都道府県名) — prefecture from the new address |
| `kaisen_place_city_nm` | Field | Implemented place city name (改善場所市区名) — city from the new address |
| `kaisen_place_oaztsu_nm` | Field | Implemented place oaztsu name (改善場所大字名) — large district from the new address |
| `kaisen_place_azcho_nm` | Field | Implemented place azcho name (改善場所町名) — town name from the new address |
| `kaisen_place_bnchigo` | Field | Implemented place branch number (改善場所枝番) — branch number from the new address |
| `kaisen_place_adrttm` | Field | Implemented place address building (改善場所建物名) — building name from the new address |
| `kaisen_place_adrrm` | Field | Implemented place address room (改善場所部屋番号) — room number from the new address |
| `kaisenUcwkNo` | Field | Service contract line work number (サービス契約回線作業番号) — internal work tracking ID for a service contract line |
| `svc_kei_kaisen_ucwk_no_shinsetsu` | Field | New construction service contract line work number (新設サービス契約回線作業番号) — work number specific to new construction |
| `svc_kei_no` | Field | Service contract number (サービス契約番号) — unique identifier for a service contract |
| `svc_kei_no_jh` | Field | Joint process service contract number (Joint処理サービス契約番号) — service contract number from joint processing |
| `jh_init_svckeino_new` | Field | New install-side initial service contract number (新設側初期サービス契約番号) — indicates if this is a new install scenario |
| `juhen_shori` | Field | Joint processing type (Joint処理) — processing type indicator (2 = new install + withdrawal) |
| `placeNo` | Field | Place number (場所番号) — unique address-derived location identifier |
| `mskmDtlNo` | Field | Measurement detail number / place number (測定明細番号/場所番号) — measurement detail identifier |
| `kojiak_no` | Field | Project case number (工事案件番号) — construction project identifier |
| `kojiMapList` | Field | Project case map list (工事案件マップリスト) — list of project case data for all service contracts |
| `kojiakTgKikiList` | Field | Project case target equipment list (工事案件対象機器リスト) — indoor equipment associated with project cases |
| `kktkMap` | Field | Indoor equipment registration map (宅内機器登録マップ) — equipment registration data keyed by service contract |
| `kktkSvcKeiList` | Field | Indoor equipment service contract list (宅内機器サービス契約リスト) — list of devices for immediate indoor coordination push |
| `outArList` | Field | Service contract output array list (サービス契約出力リスト) — aggregated list of service contracts for processing |
| `kiki_status` | Field | Device status (機器状態) — 01 = under construction (工事中), 02 = serial pending (製造番号未決定), 03 = in use (利用中), 00 = excluded (対象外) |
| `seizou_no_um` | Field | Has serial number flag (製造番号有無) — indicates whether the device has a decided serial number |
| `haiso_saksei_zumi_flg` | Field | Delivery completion flag (配送済みフラグ) — indicates whether the device has been delivered |
| `lastUpdDtm` | Field | Last update timestamp (最終更新日時) — most recent timestamp for service contract updates |
| `lastUpdDtmKsn` | Field | Line max update timestamp (回線最大更新日時) — maximum update timestamp across all line items |
| `ptn` | Field | Post-processing timing pattern (連携パターン) — 1 = post-process (後日連携), 2 = immediate process (即時連携) |
| `insSvcKei` | Field | Insertion service contract number (挿入サービス契約番号) — service contract number for equipment coordination |
| `adchg_ksn_upd_dtm` | Field | Address change KSN update timestamp (住所変更KSN更新日時) — line-level maximum update timestamp |
| KKSV0150 | Screen | Residential change operation screen (住所変更操作画面) — the main screen for processing residential address changes |
| CC | Acronym | Common Component (共通コンポーネント) — shared business logic component called by screens |
| SC | Acronym | Service Component (サービスコンポーネント) — low-level data access and business logic component |
| CBS | Acronym | Component Business System (コンポーネントビジネスシステム) — CBS-level message structures |
| EKK / EKU / EKKA / EZM | Prefix | EJB CBS module prefix — EKK = service contract, EKU = utility, EKKA = place number, EZM = indoor equipment management |
| v5.00.00 | Version tag | Service contract address change support (サービス契約住所変更対応) — added new install + withdrawal handling |
| v5.00.02 | Version tag | Added duplicate processing prevention for phone + net on same line |
| v5.00.03 | Version tag | Added maximum update timestamp comparison for address change KSN |
| v5.00.04 | Version tag | Added emergency notification address update for telephone services |
| v7.00.00 | Version tag | Added address change detail child contract handling |
| v14.00.01 | Version tag | Modified execKikitkSvcKeiPlaceUpd call with additional parameters for new construction handling |
| 住所変更 | Business term | Address change — customer residential address change process |
| 宅内連携 | Business term | Indoor coordination — synchronization of address changes to indoor equipment and service contracts |
| 回線 | Business term | Line — the physical/digital connection line that carries multiple service contracts |
| サービス契約 | Business term | Service contract — a contractual agreement for a specific service (internet, TV, phone) |
| 工事案件 | Business term | Project case — a construction/installation work order associated with a service contract |
| 家電機器 | Business term | Indoor equipment — customer-premises devices (set-top box, modem, etc.) managed by the indoor equipment management system |
| 場所番号 | Business term | Place number — address-derived location identifier used for equipment registration |
| 緊急通報用住所 | Business term | Emergency notification address — the address used for emergency services (emergency response) for telephone contracts |
| eo光電話 | Business term | eo optical telephone — FTTH-based telephone service offered by K-Opticom |
| NET / TV / 電話 | Business terms | Service type codes — 01 = Network (FTTH), 02 = Telephone, 03 = TV |
| 即時連携 | Business term | Immediate coordination — real-time push of device info to indoor equipment management system |
| 後日連携 | Business term | Post-processing coordination — deferred registration of device info for later batch processing |
| 新設 | Business term | New install — adding a new service during address change |
| 撤去 | Business term | Withdrawal/removal — removing existing services during address change |
| 新設+撤去 | Business term | New install + withdrawal — combined process of adding new services and removing old ones during address change |