# Business Logic — JKKKojiChgPlaceNoCC.execKktkSvcKeiPlaceUpdate() [96 LOC]

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

## 1. Role

### JKKKojiChgPlaceNoCC.execKktkSvcKeiPlaceUpdate()

This method is responsible for updating equipment-provided service contract information with a new location address (住所変更) in a telecommunications provisioning system. It operates as the confirmation-and-register entry point for address changes to equipment-provided service lines. The method retrieves the list of equipment-provided service contracts (connection equipment information) via an SC call (`EKK0341B012CBS`), then iterates through the results to apply filtering logic that excludes services with newly installed work numbers that do not match the target, services subject to double processing (where internet and telephone service numbers are identical), and services already in terminated (解約済) or cancelled (キャンセル済) status. For each eligible service contract, it fetches current service details via `getKktkSvcKei()`, and then invokes `execEKK0341C234()` to persist the new address information. The method acts as a routing/dispatch component within a larger CBS (Common Business Shared) framework, receiving a `func_code` parameter from the caller to distinguish between check-only (機能コード = "2") and confirm-register (機能コード = "1") modes — however, in this implementation, only the confirm-register branch executes the actual update via `execEKK0341C234()`. It plays the role of a shared utility within the `JKKKojiChgPlaceNoCC` class, called exclusively by `execKikitkSvcKeiPlaceUpd()` after the caller's data map has been populated with address change details.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["execKktkSvcKeiPlaceUpdate"])
    CHECK_CCMSG["Get ccMsg from param"]
    GET_FUNC_CODE["Get func_code from ccMsg"]
    CREATE_SC_CALL["Create ServiceComponentRequestInvoker scCall"]
    BUILD_IN["Build EKK0341B012CBS input array"]
    CALL_EKK0341B012["callSC EKK0341B012CBS"]
    CHECK_LIST_EMPTY["EKK0341B012CBSMsg1List
null or empty?"]
    RETURN_PARAM["Return param"]
    FOR_LOOP["For each item in EKK0341B012CBSMsg1List"]
    CHECK_SVC_KAISEN["svc_kei_kaisen_ucwk_no
matches shinsetsu?"]
    CHECK_DOUBLE_PROC["Double process check"]
    CHECK_STAT["kktkSvcStat is
cancelled or terminated?"]
    GET_KKTK_SVC_KEI["getKktkSvcKei"]
    CHECK_DATA_NULL["data null or empty?"]
    CHECK_FUNC_CODE["func_code is check
and register?"]
    EXEC_EKK0341C234["execEKK0341C234"]
    NEXT_ITEM["Next item in loop"]
    END_RETURN["Return param"]

    START --> CHECK_CCMSG --> GET_FUNC_CODE --> CREATE_SC_CALL --> BUILD_IN --> CALL_EKK0341B012 --> CHECK_LIST_EMPTY
    CHECK_LIST_EMPTY -->|Yes| RETURN_PARAM
    CHECK_LIST_EMPTY -->|No| FOR_LOOP --> CHECK_SVC_KAISEN
    CHECK_SVC_KAISEN -->|No| NEXT_ITEM
    CHECK_SVC_KAISEN -->|Yes| CHECK_DOUBLE_PROC
    CHECK_DOUBLE_PROC -->|Yes| NEXT_ITEM
    CHECK_DOUBLE_PROC -->|No| CHECK_STAT
    CHECK_STAT -->|Yes| NEXT_ITEM
    CHECK_STAT -->|No| GET_KKTK_SVC_KEI --> CHECK_DATA_NULL
    CHECK_DATA_NULL -->|Yes| NEXT_ITEM
    CHECK_DATA_NULL -->|No| CHECK_FUNC_CODE
    CHECK_FUNC_CODE -->|Yes| EXEC_EKK0341C234 --> NEXT_ITEM
    CHECK_FUNC_CODE -->|No| NEXT_ITEM
    NEXT_ITEM --> FOR_LOOP
    FOR_LOOP --> END_RETURN
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle providing the connection context for all SC (Service Component) calls and CBS invocations within this method's transaction. |
| 2 | `param` | `IRequestParameterReadWrite` | Request parameter object carrying the business data map keyed by `fixedText`. Contains the `func_code` (function code indicating operation mode), `svc_kei_no` (service contract number), `svcKeiNoTel` (telephone service number), `svcKeiNoNet` (internet service number), `svc_kei_kaisen_ucwk_no_shinsetsu` (target post-address-change work number), and all address detail fields (postcode, prefecture, city, district, block, building, etc.). |
| 3 | `fixedText` | `String` | A data map key used to retrieve the `ccMsg` (component communication message) HashMap from the `param` object. It uniquely identifies the data region within `param` that holds the contextual message for this operation. |

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

| Field | Type | Business Description |
|-------|------|---------------------|
| `KKTK_SVC_KEI_STAT_KAIYAKU` | `String = "910"` | Status code for "terminated" (解約済) equipment-provided service contracts. Used to skip contracts that are already terminated. |
| `KOJIAK_SBT_CD_NEW` | `String = "920"` | Status code for "cancelled" (キャンセル済) equipment-provided service contracts. Used to skip contracts that have been cancelled. |
| `TEMPLATE_ID_EKK0341B012` | `String = "EKK0341B012"` | CBS template ID for the equipment-provided service contract list retrieval call (connection equipment information). |
| `FUNC_CODE_1` | `String = "1"` | Function code for "check and register" mode. Only this value triggers the `execEKK0341C234()` update call. |
| `FUNC_CODE_2` | `String = "2"` | Function code for "check only" mode. In this method, the SC call uses this value to retrieve the service list. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `callSC (EKK0341B012CBS)` | EKK0341B012CBS | KK_T_KKTK_SVC_KEI (equipment-provided service contract table) | Retrieves the list of equipment-provided service contracts with connection equipment information, filtered by template ID `EKK0341B012` and service contract number (`svc_kei_no`). Returns `EKK0341B012CBSMsg1List[]` containing details like service status, work numbers, equipment model codes, and installation addresses. |
| R | `getKktkSvcKei` | EKK0341A010CBS | KK_T_KKTK_SVC_KEI (equipment-provided service contract table) | Fetches detailed current information for a specific equipment-provided service contract line item (`kktkSvcKeiNo`). Used to gather manufacturing number, model code, and status data for the address update payload. Includes subsidiary SC calls for equipment model lookup (`getTaknkikiModel`). |
| U | `execEKK0341C234` | EKK0341C234CBS | KK_T_KKTK_SVC_KEI (equipment-provided service contract table) | Executes the actual equipment-provided service contract information update with address change. Updates the installation destination address fields (postcode, prefecture, city, district, block, building, supplementary address) for the service contract line identified by `kktkSvcKeiNo`. |
| R | `callSC` | Various | Various | Internal method for making SC calls. Wraps CBS invocation with template ID, input parameters, and response mapping. |
| R | `getNullToStr` | — | — | Utility method that converts null values to empty strings, preventing NullPointerException during string comparisons. |
| R | `getKktkSvcKei` | — | — | Method that internally calls `callSC` and retrieves service contract data. |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 2 methods.
Terminal operations from this method: `execEKK0341C234` [-], `getKktkSvcKei` [R], `getNullToStr` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getNullToStr` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getNullToStr` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Method: `JKKKojiChgPlaceNoCC.execKikitkSvcKeiPlaceUpd` | `execKikitkSvcKeiPlaceUpd` prepares data map with address change fields → `execKktkSvcKeiPlaceUpdate(handle, param, fixedText)` → iterates service contracts → `getKktkSvcKei` → `execEKK0341C234` | `EKK0341B012CBS [R] KK_T_KKTK_SVC_KEI`, `EKK0341A010CBS [R] KK_T_KKTK_SVC_KEI`, `EKK0341C234CBS [U] KK_T_KKTK_SVC_KEI` |

## 6. Per-Branch Detail Blocks

**Block 1** — SET (initialization) (L2287)

> Retrieves the data map key and extracts the component communication message (ccMsg) from the param object.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMapKey = fixedText` // Map key for ccMsg |
| 2 | SET | `ccMsg = (HashMap)param.getData(dataMapKey)` // Extract ccMsg data map from param |
| 3 | SET | `func_code = (String)ccMsg.get("func_code")` // Get function code [→ "1" = check and register, "2" = check only] |
| 4 | SET | `temporaryData = new HashMap()` // Temporary work area data |
| 5 | SET | `scCall = new ServiceComponentRequestInvoker()` // Instantiate SC call invoker |

**Block 2** — SET (build SC input) (L2300)

> Constructs the input array for the EKK0341B012 CBS call (equipment-provided service contract list for connection equipment information). Uses FUNC_CODE_2 = "2" for list retrieval mode.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0341b012IN[0] = EKK0341B012CBSMsg.TEMPLATEID, TEMPLATE_ID_EKK0341B012 = "EKK0341B012"` // CBS template ID |
| 2 | SET | `ekk0341b012IN[1] = EKK0341B012CBSMsg.FUNC_CODE, FUNC_CODE_2 = "2"` // Function code for list retrieval (previously FUNC_CODE_1) |
| 3 | SET | `ekk0341b012IN[2] = EKK0341B012CBSMsg.KEY_SVC_KEI_NO, ccMsg.get("svc_kei_no")` // Service contract number |

**Block 3** — CALL (SC call) (L2311)

> Invokes the CBS to retrieve the equipment-provided service contract list with connection equipment information.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `ekk0341b012cbsMsg1list = callSC(handle, scCall, param, dataMapKey, ekk0341b012IN).getCAANMsgList(EKK0341B012CBSMsg.EKK0341B012CBSMSG1LIST)` // Returns list of service contract records |

**Block 4** — IF (empty list check) (L2313)

> If no service contract records are returned, exit early.

| # | Type | Code |
|---|------|------|
| 1 | IF | `ekk0341b012cbsMsg1list == null || ekk0341b012cbsMsg1list.length == 0` |
| 2 | RETURN | `return param` // No contracts to process |

**Block 5** — FOR (iterate service contracts) (L2320)

> Iterates through each equipment-provided service contract record to check and update eligible ones.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktkSvcStat = ""` // Equipment-provided service contract status |
| 2 | SET | `kktkSvcKeiNo = ""` // Equipment-provided service contract number |

**Block 5.1** — FOR BODY — IF (work number filter) (L2324)

> Checks if the service record's post-address-change work number matches the target installation work number. If it does not match, the record is skipped. This ensures only contracts that have a corresponding new installation work number are processed. Comment: 転居先の回線機器以外は対象外 (Non-move-location line equipment is excluded).

| # | Type | Code |
|---|------|------|
| 1 | SET | `svc_kei_kaisen_ucwk_no_shinsetsu = (String)ccMsg.get("svc_kei_kaisen_ucwk_no_shinsetsu")` // Target post-address-change work number |
| 2 | IF | `!getNullToStr(ekk0341b012cbsMsg1list[i].getString(SVC_KEI_KAISEN_UCWK_NO)).equals(svc_kei_kaisen_ucwk_no_shinsetsu)` [L2326] |
| 3 | EXEC | `continue` // Skip — work number does not match |

**Block 5.2** — FOR BODY — IF (double processing check) (L2329)

> Prevents double processing of services where the same service contract number appears for both telephone and internet services on the same line. If `svcKeiNo == svcKeiNoTel` AND the record has a post-address-change work number AND `svcKeiNoNet` is not empty, skip. Comment: 電話のサービス契約回線内に付く機器は、同一回線にネットのサービスが付いている場合、対象外とする。（2重処理しないため）(Equipment attached within a telephone service contract line — if an internet service is attached to the same line, it is excluded to avoid double processing).

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiNo = (String)ccMsg.get("svc_kei_no")` // Service contract number |
| 2 | SET | `svcKeiNoTel = (String)ccMsg.get("svcKeiNoTel")` // Service contract number (telephone) |
| 3 | SET | `svcKeiNoNet = (String)ccMsg.get("svcKeiNoNet")` // Service contract number (internet) |
| 4 | IF | `svcKeiNo.equals(svcKeiNoTel) && has SVC_KEI_KAISEN_UCWK_NO && !"".equals(svcKeiNoNet)` [L2335] |
| 5 | EXEC | `continue` // Skip — would cause double processing |

**Block 5.3** — FOR BODY — SET (retrieve status) (L2340)

> Retrieves the current status of the service contract.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktkSvcStat = getNullToStr(ekk0341b012cbsMsg1list[i].getString(KKTK_SVC_KEI_STAT))` // Service contract status |

**Block 5.4** — FOR BODY — IF (status filter) (L2344)

> Skips contracts that are already terminated or cancelled. Comment: 解約済またはキャンセル済は対象外とします (Contracts already terminated or cancelled are excluded).

| # | Type | Code |
|---|------|------|
| 1 | IF | `kktkSvcStat == KKTK_SVC_KEI_STAT_KAIYAKU = "910"` (terminated) OR `KOJIAK_SBT_CD_NEW = "920"` (cancelled) [L2344] |
| 2 | EXEC | `continue` // Skip — contract is terminated or cancelled |

**Block 5.5** — FOR BODY — SET (retrieve service number) (L2348)

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktkSvcKeiNo = getNullToStr(ekk0341b012cbsMsg1list[i].getString(KKTK_SVC_KEI_NO))` // Service contract line number |
| 2 | SET | `geneAddDtm = getNullToStr(ekk0341b012cbsMsg1list[i].getString(GENE_ADD_DTM))` // Generation registration datetime |
| 3 | CALL | `data = getKktkSvcKei(handle, scCall, param, fixedText, kktkSvcKeiNo, geneAddDtm, null)` [L2355] // Fetch service contract details |

**Block 5.6** — FOR BODY — IF (null data check) (L2356)

> If `getKktkSvcKei()` returns null or empty data, skip this record.

| # | Type | Code |
|---|------|------|
| 1 | IF | `data == null || data.size() == 0` [L2356] |
| 2 | EXEC | `continue` // Skip — no data available for this service |

**Block 5.7** — FOR BODY — IF (function code branch) (L2363)

> Only executes the address change update when `func_code` equals "1" (check and register mode). In "2" (check only) mode, the loop iterates but no update is performed. Comment: チェック登録時のみ実行 (Execute only during check registration).

| # | Type | Code |
|---|------|------|
| 1 | IF | `func_code == FUNC_CODE_1 = "1"` [L2363] |
| 2 | CALL | `execEKK0341C234(handle, scCall, param, dataMapKey, temporaryData, data, kktkSvcKeiNo)` [L2374] // Update equipment-provided service contract with new address information |

**Block 6** — RETURN (L2378)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return param` // Return the modified param object |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `kktk_svc_kei_no` | Field | Equipment-provided service contract number — the unique identifier for a service contract line item associated with equipment provided by the telecom operator |
| `kktk_svc_kei_stat` | Field | Equipment-provided service contract status — current state of the service contract (active, terminated, cancelled, etc.) |
| `kktk_svc_kei_stat_kaiyaku` | Field | Termination status code = "910" — indicates the service contract has been fully terminated (解約済) |
| `kojiak_sbt_cd_new` | Field | Cancellation status code = "920" — indicates the service contract has been cancelled (キャンセル済) |
| `svc_kei_kaisen_ucwk_no_shinsetsu` | Field | Post-address-change work number (new installation) — the work number assigned after an address change for new installation records |
| `svc_kei_no` | Field | Service contract number — unique identifier for a service contract line item |
| `svcKeiNoTel` | Field | Telephone service contract number — the service number specifically associated with telephone service lines |
| `svcKeiNoNet` | Field | Internet service contract number — the service number specifically associated with internet service lines |
| `func_code` | Field | Function code — indicates the operation mode ("1" = check and register, "2" = check only) |
| `gene_add_dtm` | Field | Generation registration datetime — timestamp when the service contract record was generated/registered |
| `kiki_stc_saki` | Field prefix | Equipment installation destination — fields prefixed with this describe the new installation address of equipment |
| `kiki_stc_saki_pcd` | Field | Equipment installation destination postcode |
| `kiki_stc_saki_state_nm` | Field | Equipment installation destination prefecture name |
| `kiki_stc_saki_city_nm` | Field | Equipment installation destination city/town/village name |
| `kiki_stc_saki_ad_cd` | Field | Equipment installation destination address code |
| `EKK0341B012CBS` | CBS | Equipment-provided service contract list retrieval (connection equipment information) — CBS that fetches the list of active service contracts with their associated equipment details |
| `EKK0341A010CBS` | CBS | Equipment information retrieval — CBS used within `getKktkSvcKei` to fetch detailed equipment contract data |
| `EKK0341C234CBS` | CBS | Equipment-provided service contract information update (address change) — CBS that persists the new address information to the service contract record |
| CC | Acronym | Common Component — shared utility class in the Fujitsu Futurity framework for business logic processing |
| SC | Acronym | Service Component — a service-layer component that encapsulates a business operation |
| CBS | Acronym | Common Business Shared — a shared business logic component in the Fujitsu Futurity framework, typically handling database operations |
| CAANMsg | Class | Common Application Abstract Network message — message wrapper class used for CBS request/response data interchange |
| SessionHandle | Class | Database session handle — provides the transactional context for database operations |
| IRequestParameterReadWrite | Interface | Request parameter interface — contract for reading/writing request data maps passed between CBS components |
| ServiceComponentRequestInvoker | Class | SC call request invoker — object that encapsulates the invocation context for SC calls |
| 住所変更 (juho henkou) | Japanese term | Address change — the business operation of updating the registered installation address for a service contract |
| 機器提供サービス契約 (kiki teikyo saabisu keiyaku) | Japanese term | Equipment-provided service contract — a service contract for telecommunications services where equipment is provided by the operator |
| 解約済 (kaiyaku-zumi) | Japanese term | Termination completed — service contract status indicating the contract has been fully cancelled/terminated |
| キャンセル済 (kyanseru-zumi) | Japanese term | Cancellation completed — service contract status indicating the contract has been cancelled |
| チェック登録 (cheiku touroku) | Japanese term | Check and register — operation mode that validates data before persisting it to the database |
| 2重処理 (nijou shori) | Japanese term | Double processing — the undesired condition where the same service contract is updated multiple times (e.g., once for telephone and once for internet on the same line) |