---

# Business Logic — JFUHakkoSODCC.getSvcKeiInfo() [31 LOC]

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

## 1. Role

### JFUHakkoSODCC.getSvcKeiInfo()

This method performs a **service contract singular inquiry** (サービス契約一意照会処理). It retrieves service contract details — specifically the generation registration datetime and associated metadata — from the underlying SOD (Service Order Data) system. Rather than directly invoking the service component, it implements a **cache-then-delegate pattern** (also known as the caching interception pattern): if the same function code has already been processed, it returns the cached result; otherwise it delegates to the parent class `JKKHakkoSODCC.getSvcKeiInfo()`, which makes the actual `EKK0081A010CBS` service call and maps the response.

The method acts as a **shared utility** used across many SOD issuance and modification screens (e.g., order submission, plan change, service cancellation), ensuring that repeated lookups for the same service contract line item do not redundantly call the backend service component. It serves as the single entry point for fetching a consolidated set of service contract fields — including registration datetime, details number, pricing group code, pricing code, contract status, pause dates, and pause stop code — that are needed by virtually all SOD-related business processes in the K-Opticom customer core system.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getSvcKeiInfo handle, param"])
    STEP1["editInMsg_EKK0081A010CBS param<br/>Prepare input mapping"]
    STEP2["Create empty resultHash HashMap"]
    STEP3["inHash.get TEMPLATE_LIST_KEY<br/>Get CAANMsg[] templates"]
    STEP4["templates[0].getString FUNC_CODE<br/>Extract function code"]
    STEP5["getMapSC TEMPLATE_ID_EKK0081A010, funcCd<br/>Cache lookup"]
    COND{"map.isEmpty()"}
    STEP6["super.getSvcKeiInfo handle, param<br/>Call parent class"]
    STEP7["map.put IN_MAP, templates[0]"]
    STEP8["map.put OUT_MAP, resultHash"]
    STEP9["mapSC.put templateId + UNDER_BAR + funcCd, map<br/>Cache the map"]
    STEP10["resultHash.putAll map.get OUT_MAP<br/>Merge cached results"]
    STEP11["Return resultHash"]

    START --> STEP1
    STEP1 --> STEP2
    STEP2 --> STEP3
    STEP3 --> STEP4
    STEP4 --> STEP5
    STEP5 --> COND
    COND -- "true Cache miss" --> STEP6
    STEP6 --> STEP7
    STEP7 --> STEP8
    STEP8 --> STEP9
    COND -- "false Cache hit" --> STEP10
    STEP9 --> STEP11
    STEP10 --> STEP11
```

**CRITICAL — Constant Resolution:**
- `JKKHakkoSODConstCC.TEMPLATE_ID_EKK0081A010` = `"EKK0081A010"` [-> TEMPLATE_ID_EKK0081A010="EKK0081A010" (JKKHakkoSODConstCC.java:638)] — The template ID used as the cache key prefix for the EKK0081A010 service component, which handles service contract inquiry.
- `JFUStrConst.HALF_UNDER_BAR` = `"_"` [-> HALF_UNDER_BAR="_" (JFUStrConst.java:192)] — Used to concatenate the template ID and function code into a unique cache entry key.
- `JCMConstants.TEMPLATE_LIST_KEY` — Used to retrieve the `CAANMsg[]` template array from the input hash, containing message objects populated from the request parameter.
- `EKK0081A010CBSMsg.FUNC_CODE` — The field key used to extract the function code from the first template message, identifying which service type (e.g., FTTH, ADSL, Mail, TV, Tel) is being queried.
- `IN_MAP` — Internal map key constant representing the input map entry, where the template `CAANMsg` is stored.
- `OUT_MAP` — Internal map key constant representing the output map entry, where the result hash is stored and later retrieved.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | The session manager handle carrying the current user's session context. It provides the session-scoped state needed by the parent class's service component invocation, including connection and transaction management. |
| 2 | `param` | `IRequestParameterReadWrite` | The request parameter object containing the model group and control map. It carries the screen inputs (service contract number, function code, order details) and serves as the container for both request data and the pre-populated message templates that drive the `editInMsg_EKK0081A010CBS` preparation step. |

**Internal/External State Read:**

| No | Source | Business Description |
|----|--------|---------------------|
| 1 | `mapSC` (instance field of `JFUHakkoSODCC`) | Cache map storing previously computed service contract inquiry results, keyed by `templateId + "_" + funcCd`. This enables deduplication of identical service component calls within a session. |
| 2 | `editInMsg_EKK0081A010CBS(param)` | Inherited method that prepares the input mapping for the `EKK0081A010CBS` service call by extracting and structuring the service contract inquiry parameters. |
| 3 | `super.getSvcKeiInfo(handle, param)` | Parent class implementation (`JKKHakkoSODCC`) that invokes `ServiceComponentRequestInvoker` to call the `EKK0081A010CBS` service component, retrieves the generation registration datetime and associated fields, and maps them into the parameter's work map. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `editInMsg_EKK0081A010CBS` | EKK0081A010CBS | - | Prepares the input message mapping for service contract inquiry by extracting service contract number and function code from the request parameter. |
| R | `getMapSC` | - | - | Internal cache lookup method that checks `mapSC` for a previously computed result keyed by `templateId + "_" + funcCd`. |
| R | `super.getSvcKeiInfo` | EKK0081A010CBS | KK_T_SVKEI (Service Contract Master) | Calls the `EKK0081A010CBS` service component via `ServiceComponentRequestInvoker` to read service contract details including generation registration datetime, details number, pricing codes, contract status, pause dates, and pause stop code. |

**CRUD Classification:**

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `editInMsg_EKK0081A010CBS` | EKK0081A010CBS | - | Input message preparation — reads data from `IRequestParameterReadWrite` and structures it for the SC call. |
| R | `getMapSC(scId, funcCode)` | - | - | In-memory cache read — checks whether the service contract inquiry result for this template ID and function code is already cached. |
| R | `super.getSvcKeiInfo` (parent delegate) | EKK0081A010CBS | KK_T_SVKEI (Service Contract Master Table) | Reads service contract details: generation registration datetime (`gene_add_dtm`), details number (`mskm_dtl_no`), pricing group code (`prc_grp_cd`), pricing code (`pcrs_cd`), contract status (`svc_kei_stat`), service pause date (`svc_pause_ymd`), service pause release date (`svc_pause_rls_ymd`), pause stop code (`pause_stp_cd`), pricing plan code (`pplan_cd`), and provider formula contract number (`tk_hoshiki_kei_no`). |
| R | `mapSC.put` | - | - | Internal map put — stores the computed result in the session-level cache for subsequent deduplication. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:JKKHakkoSODCC | `doHakko` -> `getSvcKeiInfo` -> `JFUHakkoSODCC.getSvcKeiInfo` | `EKK0081A010CBS [R] KK_T_SVKEI` |
| 2 | Screen:JKKAdchgHakkoSODCC | `doHakko` -> `getSvcKeiInfo` -> `JFUHakkoSODCC.getSvcKeiInfo` | `EKK0081A010CBS [R] KK_T_SVKEI` |
| 3 | Screen:JKKAdchgCancelHakkoSODCC | `doCancelHakko` -> `getSvcKeiInfo` -> `JFUHakkoSODCC.getSvcKeiInfo` | `EKK0081A010CBS [R] KK_T_SVKEI` |
| 4 | Screen:KKSV0762OPOperation | `getInvokeCBS` -> `JKKGetSvcKeiKikiInfoCC.getSvcKeiInfo` -> `getSvcKeiInfo` | `EKK0081A010CBS [R] KK_T_SVKEI` |
| 5 | Screen:KKSV0263OPOperation | `getInvokeCBS` -> `JKKSvcKeiInquiryCC.getSvcKeiInfo` -> `getSvcKeiInfo` | `EKK0081A010CBS [R] KK_T_SVKEI` |
| 6 | Batch:JBSbatKKAutoAreaChk | `getSvcKeiInfo(inMap)` -> calls SC directly | `EKK0081A010CBS [R] KK_T_SVKEI` |
| 7 | Component:JKKSeiriNoHtbChgCC | `getSvcKeiInfo(workMap)` -> used for sorting number reissue | `EKK0081A010CBS [R] KK_T_SVKEI` |
| 8 | Component:JKKMvnoSvcUseStpUkCC | `getSvcKeiInfo(handle, param, ...)` -> MVNO service usage stop check | `EKK0081A010CBS [R] KK_T_SVKEI` |
| 9 | Component:JKKTchishoSearchCC | `getSvcKeiInfo(svcSbtCd, workMap)` -> territory search by service type | `EKK0081A010CBS [R] KK_T_SVKEI` |
| 10 | Component:JKKPrcCalcKeiIfShkOpsCC | `getSvcKeiInfo(...)` -> price calculation key interface operation | `EKK0081A010CBS [R] KK_T_SVKEI` |
| 11 | Component:JKKAdchgModifyTvCC | `getSvcKeiInfo(workMap)` -> TV plan change | `EKK0081A010CBS [R] KK_T_SVKEI` |
| 12 | Component:JKKSsnPrcCalcCC | `getSvcKeiInfo(handle, ...)` -> session price calculation | `EKK0081A010CBS [R] KK_T_SVKEI` |
| 13 | Component:JKKSsnPrcCalcScreenInitCC | `getSvcKeiInfoEKK0081B029/010` -> screen initialization for price calc | `EKK0081A010CBS [R] KK_T_SVKEI` |
| 14 | Component:JKKSvcKeiInquiryCC | `getSvcKeiInfo(handle, param, ...)` -> dedicated service contract inquiry screen | `EKK0081A010CBS [R] KK_T_SVKEI` |

**Notes on call patterns:**
- **JKKHakkoSODCC** and **JKKAdchgHakkoSODCC** extend from or delegate to `JFUHakkoSODCC`, making this method an overridden version of the parent's implementation that adds caching on top.
- The method is primarily called during **SOD issuance** (service order generation) workflows, where the system needs to verify the current state of the service contract before creating a new order.
- Batch processes (e.g., **JBSbatKKAutoAreaChk**) and screen operations (e.g., **KKSV0762**, **KKSV0263**) also route through this method to fetch service contract details.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET / EXEC] `(Input Preparation) (L195)`

> Prepares the input mapping for the EKK0081A010CBS service call and initializes the result container.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `editInMsg_EKK0081A010CBS(param)` // Prepares the input message map for the SC call [-> EKK0081A010CBS] |
| 2 | SET | `resultHash = new HashMap<String, Object>()` // Initializes empty result container |
| 3 | EXEC | `inHash.get(JCMConstants.TEMPLATE_LIST_KEY)` // Retrieves the CAANMsg[] template array from the prepared input hash |
| 4 | SET | `CAANMsg[] templates = (CAANMsg[])inHash.get(...)` // Casts the retrieved template list to CAANMsg array |
| 5 | EXEC | `templates[0].getString(EKK0081A010CBSMsg.FUNC_CODE)` // Extracts the function code from the first template, identifying the service type (FTTH, ADSL, Mail, TV, Tel, etc.) |
| 6 | SET | `String funcCd = templates[0].getString(...)` // Stores the extracted function code string |

**Block 2** — [CALL] `(Cache Lookup) (L202)`

> Looks up the internal cache to check if a result for this template ID + function code combination already exists.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `getMapSC(JKKHakkoSODConstCC.TEMPLATE_ID_EKK0081A010, funcCd)` // Checks cache map for precomputed result [-> TEMPLATE_ID_EKK0081A010="EKK0081A010" (JKKHakkoSODConstCC.java:638)] |
| 2 | SET | `HashMap<String, Object> map = getMapSC(...)` // Retrieves the cached map if present, or an empty map if not |

**Block 3** — [IF / ELSE-IF / ELSE] `(Conditional Branch: Cache Hit or Miss) (L204)`

> Determines whether the result was found in the cache. If the map is empty (cache miss), the parent class is invoked to fetch actual data. If the map is non-empty (cache hit), the cached result is returned directly.

| # | Type | Code |
|---|------|------|
| 1 | IF | `map.isEmpty()` [Conditional Branch: true = cache miss, false = cache hit] |

**Block 3.1** — [nested IF: cache miss branch] `(Delegate to Parent and Cache Result) (L206)`

> The cache returned empty, meaning this function code has not been processed yet in this session. Delegates to the parent class `JKKHakkoSODCC.getSvcKeiInfo()` which invokes `EKK0081A010CBS` to read service contract details from the database. After the parent returns, the result is stored in the cache for future deduplication.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `super.getSvcKeiInfo(handle, param)` // Calls parent class JKKHakkoSODCC.getSvcKeiInfo which invokes EKK0081A010CBS via ServiceComponentRequestInvoker |
| 2 | SET | `resultHash = super.getSvcKeiInfo(...)` // Receives the service contract details from the parent: gene_add_dtm, mskm_dtl_no, prc_grp_cd, pcrs_cd, svc_kei_stat, svc_pause_ymd, svc_pause_rls_ymd, pause_stp_cd, pplan_cd, tk_hoshiki_kei_no |
| 3 | SET | `map.put(IN_MAP, templates[0])` // Stores the input template in the cache map for traceability |
| 4 | SET | `map.put(OUT_MAP, resultHash)` // Stores the result hash in the cache map under the output key |
| 5 | SET | `mapSC.put(JKKHakkoSODConstCC.TEMPLATE_ID_EKK0081A010 + JFUStrConst.HALF_UNDER_BAR + funcCd, map)` // Puts the complete map into the session-level cache keyed by `"EKK0081A010" + "_" + funcCd` [-> TEMPLATE_ID_EKK0081A010="EKK0081A010" (JKKHakkoSODConstCC.java:638), [-> HALF_UNDER_BAR="_" (JFUStrConst.java:192)] |

**Block 3.2** — [nested ELSE: cache hit branch] `(Return Cached Result) (L212)`

> The cache contained a previously computed result. Instead of re-invoking the service component, the cached result hash is merged into the local resultHash.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `resultHash.putAll((HashMap<String, Object>)map.get(OUT_MAP))` // Merges the cached output map into the result hash |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei` | Field | Service Contract — the main contract entity representing a customer's subscribed service line in the K-Opticom system. Short for "service keiyaku" (サービス契約). |
| `gene_add_dtm` | Field | Generation Registration Datetime — the timestamp when this version/revision of the service contract was registered. Each change to a service contract creates a new "generation" (stage) with its own registration datetime. |
| `mskm_dtl_no` | Field | Details Number (Shinchi Mei-Sai Number) — the order detail identifier used to distinguish individual line items within a service contract. |
| `prc_grp_cd` | Field | Pricing Group Code — classifies the pricing category of the service contract (e.g., "eo Hikari Net Mantaisyou Type" for FTTH flat-rate plans). |
| `pcrs_cd` | Field | Pricing Code — the specific price plan code that determines the billing amount for the service contract. |
| `svc_kei_stat` | Field | Service Contract Status — indicates the current lifecycle state of the service contract (e.g., active, suspended, cancelled, terminated). |
| `svc_pause_ymd` | Field | Service Pause Date — the date when the service was suspended/paused (YYYYMMDD format). |
| `svc_pause_rls_ymd` | Field | Service Pause Release Date — the date when the service suspension was lifted/resumed. |
| `pause_stp_cd` | Field | Pause Stop Code — a classification code indicating the reason/type of service suspension (e.g., customer-requested, non-payment, maintenance). |
| `pplan_cd` | Field | Pricing Plan Code — the specific pricing plan identifier for the service, related to the pricing group but more granular. |
| `tk_hoshiki_kei_no` | Field | Provider Formula Contract Number — the contract number used in provider formula (manshou) service contracts, particularly for FTTH (eo Hikari) plans. |
| `svc_kei_no` | Field | Service Contract Number — the unique identifier for the service contract. |
| `svc_kei_ucwk_no` | Field | Service Detail Work Number — internal tracking ID for service contract line item processing. |
| `FUNC_CODE` | Field | Function Code — identifies the type of service being queried (e.g., FTTH, ADSL, Mail, TV, Telephone, Mobile). Determines which service type branch the system processes. |
| `TEMPLATE_ID_EKK0081A010` | Constant | `"EKK0081A010"` — The template/service component identifier for the service contract singular inquiry. Used as the cache key prefix. [-> JKKHakkoSODConstCC.java:638] |
| `EKK0081A010CBS` | Component | Service Contract Singular Inquiry CBS (Call Business Service) — the service component that reads service contract details from the database table KK_T_SVKEI. |
| `JKKHakkoSODCC` | Class | K-Opticom Hakko (Issuance) SOD CC — the parent class that implements the actual service contract inquiry logic, including the `ServiceComponentRequestInvoker` call. |
| `JFUHakkoSODCC` | Class | Fujitsu-optimized Hakko (Issuance) SOD CC — the subclass that adds a caching layer on top of `JKKHakkoSODCC` to avoid redundant service component calls. |
| SOD | Acronym | Service Order Data — the order data entity representing a customer's service order in the K-Opticom fulfillment system. Used for order issuance, modification, and cancellation. |
| CBS | Acronym | Call Business Service — the service component layer that encapsulates database operations. Abbreviated suffix for business logic classes. |
| CC | Acronym | Command Component / Common Component — the controller/command layer classes that implement business screen logic. |
| SC | Acronym | Service Component — the data access/business service classes that handle database CRUD operations. |
| `mapSC` | Field | Session-level Cache Map — an instance field of `JFUHakkoSODCC` that stores previously computed service contract inquiry results keyed by template ID and function code. |
| `HAKKOSODCCWORKMAP` | Constant | The work map key used in the session to store SOD issuance processing data including service contract details. |
| KK_T_SVKEI | Table | Service Contract Master Table — the database table storing service contract records including contract number, status, pricing codes, pause dates, and generation registration datetime. |
| eo Hikari | Business term | FTTH (Fiber To The Home) internet service offered by K-Opticom, a Japanese telecommunications company. |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service. One of the primary service types processed in SOD issuance. |
| `IN_MAP` | Constant | Internal map key constant representing the input map entry, where the template `CAANMsg` is stored. |
| `OUT_MAP` | Constant | Internal map key constant representing the output map entry, where the result hash is stored and later retrieved. |
