# Business Logic — JKKIdPwdShkkaSaifurHakkoCC.makeIdSokhoSho() [6 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKIdPwdShkkaSaifurHakkoCC` |
| Layer | CC/Common Component — a thin facade/wrapper in the custom common layer |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`)

## 1. Role

### JKKIdPwdShkkaSaifurHakkoCC.makeIdSokhoSho()

This method generates ID notification document data files (ID速報書データファイル生成), which are structured byte arrays containing item values extracted from an account map and serialized into a delimited text format. The Javadoc states "ID notification document data file generation" — in the K-Opticom customer foundation system, this is used to produce identification-registration-certificate data for customers who subscribe to FTTH (Fiber To The Home) broadband services. The method acts as a delegation wrapper that directly forwards all four parameters to `JKKPrintDataUtil.makeListData()`, implementing a **delegation design pattern** where the common component class (`JKKIdPwdShkkaSaifurHakkoCC`) exposes a convenience API for the calling CBS (`JKKIdPwdShkkaSaifurChohyoCC`). It is a shared utility used during the certificate issuance flow, specifically when generating the data payload that will later be printed or transmitted as part of the ID registration process. The method handles two branches within the delegate: early null-guard for `paramHash`, and conditional iteration over defined display items based on `chohyoId`.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["makeIdSokhoSho params"])
    DELEGATE["Delegate to JKKPrintDataUtil.makeListData"]
    CHECK_NULL{paramHash == null?}
    RETURN_NULL(["Return null"])
    GET_KEYS["getKeyArray(chohyoId)"]
    CHECK_TEIGI{teigi != null?}
    RETURN_EMPTY(["Return retItem.toString().getBytes(UTF-8)"])
    LOOP["for i = 0 to teigi.length-1"]
    SET_SB["setStringBuilder(retItem, paramHash, teigi[i])"]
    APPEND["Append value + DELIMITER_STR to retItem"]
    LOOP_END(i++)
    LOOP --> SET_SB
    SET_SB --> APPEND
    APPEND --> LOOP_END
    LOOP_END --> CHECK_TEIGI

    START --> DELEGATE
    DELEGATE --> CHECK_NULL
    CHECK_NULL -->|true| RETURN_NULL
    CHECK_NULL -->|false| GET_KEYS
    GET_KEYS --> CHECK_TEIGI
    CHECK_TEIGI -->|false| RETURN_EMPTY
    CHECK_TEIGI -->|true| LOOP
```

### Constant Resolution (from `JKKPrintDataUtil`)

| Constant | Resolved Value | Business Meaning |
|----------|---------------|------------------|
| `DELIMITER_STR` | `","` | Comma delimiter used to separate item values in the output |
| `UTF_8` | `"UTF-8"` | Character encoding for the returned byte array |
| `DBL_QUOT_STR` | `'"'` | Double-quote character (used elsewhere in the class) |
| `BLANK` | `""` | Empty string constant for null-equivalent checks |

The method has no conditional branches at its own level — it is a pure delegation. The branching logic resides in `JKKPrintDataUtil.makeListData()`:

1. **Null guard branch**: If `paramHash` is null, return null immediately.
2. **Defined-item iteration branch**: If `teigi` (key array from `chohyoId`) is not null, iterate over each defined key, appending its value from `paramHash` to the result.
3. **Item-value presence check** (inside `setStringBuilder`): If the value for a key is null or empty string, append nothing for that item.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadOnly` | The read-only request parameter object carrying business context for the operation. In this context, it is passed through to `makeListData` but not directly consumed by `makeIdSokhoSho` itself. |
| 2 | `paramHash` | `HashMap<String, Object>` | The account map (帳票マップ) containing item key-value pairs to be serialized into the ID notification document. Keys correspond to defined display item IDs (e.g., `pcd` for postal code, `tchisho_sohus_pcd` for notification delivery address postal code). Values are the actual data strings to include in the output. |
| 3 | `fixedText` | `String` | Fixed text passed through for potential label or header insertion into the output document data. |
| 4 | `chohyoId` | `String` | The defined-display ID (定義体ID) that specifies which items should be included in the output and their order. This ID maps to a key array that determines which entries from `paramHash` are extracted. |

**External state read by this method:** None directly. All processing is delegated to the static method `JKKPrintDataUtil.makeListData()`.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JKKPrintDataUtil.makeListData` | JKKPrintData | - | Delegates to `makeListData` in `JKKPrintDataUtil` — no database access, only in-memory data transformation of the `paramHash` account map into a delimited byte array |

This method performs no direct CRUD operations. It is a pure data-transformer that converts an in-memory map into a serialized string format. The terminal operation `makeListData` also performs no database access — it reads from the `paramHash` object (in-memory), calls `getKeyArray()` for key resolution, and uses `setStringBuilder()` for value extraction, all operating on data already loaded into memory by the caller.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 method.
Terminal operations from this method: `makeListData` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS: JKKIdPwdShkkaSaifurChohyoCC | `JKKIdPwdShkkaSaifurChohyoCC.makeAllTchishoData()` → `JKKIdPwdShkkaSaifurHakkoCC.makeIdSokhoSho()` | `makeListData` [R] in-memory account map |

The sole known direct caller is `JKKIdPwdShkkaSaifurChohyoCC.makeAllTchishoData()`, which is a CBS (Common Business Service) responsible for generating all notification address data. This CBS invokes `makeIdSokhoSho()` as part of the ID registration certificate issuance workflow, requesting the method to produce the delimited data payload for the ID notification document. The terminal operation is `makeListData`, which performs no CRUD against the database — it only reads from the in-memory `paramHash` and returns a UTF-8 encoded byte array.

## 6. Per-Branch Detail Blocks

**Block 1** — [DELEGATION] `(no condition, direct static call)` (L137)

> Delegates all parameters to `JKKPrintDataUtil.makeListData()` for processing.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return JKKPrintDataUtil.makeListData(param, paramHash, fixedText, chohyoId);` // Delegates to the print data utility for data file generation |

**Block 2** — [NESTED: inside `JKKPrintDataUtil.makeListData`] `[null guard]` (L824)

> If the account map is null, return null to prevent NullPointerException downstream.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (paramHash == null)` [NULL_CHECK] |
| 2 | RETURN | `return null;` // Early return — no data available for serialization |

**Block 3** — [NESTED: inside `JKKPrintDataUtil.makeListData`] `[key extraction]` (L829)

> Retrieves the key array for the given display ID (chohyoId). The keys determine which items from the account map will be included in the output.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String[] teigi = getKeyArray(chohyoId);` // teigi = 定義体 (defined display keys) |

**Block 4** — [NESTED: inside `JKKPrintDataUtil.makeListData`] `[conditional iteration]` (L831)

> If keys were defined for this display ID, iterate over each key and extract its value from the account map.

| # | Type | Code |
|---|------|------|
| 1 | IF | `if (teigi != null)` [DEFINED_KEYS_EXISTS] |
| 2 | FOR | `for (int i = 0; i < teigi.length; i++)` |
| 3 | EXEC | `setStringBuilder(retItem, paramHash, teigi[i]);` // Extract value for teigi[i] and append to result |

**Block 5** — [NESTED: inside `setStringBuilder`] `[per-item value extraction]` (L846)

> For each key, retrieve the value from the account map. If the value is null or empty, append nothing. Always append a delimiter after each item.

| # | Type | Code |
|---|------|------|
| 1 | SET | `String appendItem = "";` // Local buffer for the item's value |
| 2 | IF | `if (inMap.get(teigiKey) != null && !"".equals((String)inMap.get(teigiKey)))` [HAS_VALID_VALUE] |
| 3 | SET | `appendItem = (String)inMap.get(teigiKey);` // Extract the actual value string |
| 4 | EXEC | `retItem.append(appendItem).append(DELIMITER_STR);` [-> DELIMITER_STR=","] // Append value + comma delimiter |

**Block 6** — [NESTED: inside `JKKPrintDataUtil.makeListData`] `[return]` (L836)

> Convert the accumulated string to a UTF-8 encoded byte array and return.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return retItem.toString().getBytes(UTF_8);` [-> UTF_8="UTF-8"] // Return serialized byte data |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `makeIdSokhoSho` | Method | ID notification document data file generation — generates a delimited data file for the ID registration certificate |
| 速報書 (Sokoshosho) | Japanese term | Notification document — an official document sent to customers notifying them of service registration details |
| `chohyoId` | Field | Defined-display ID — an identifier that specifies which items to include in the output and their order |
| 帳票 (Chohyo) | Japanese term | Account document / form — a structured output document containing business data |
| 定義体 (Teigi) | Japanese term | Defined body — a set of predefined display items/fields for a document layout |
| `paramHash` | Field | Account map — a HashMap holding item key-value pairs to be serialized into the output document |
| `JKKPrintDataUtil` | Class | Print data utility — a service-layer utility class for constructing print/output data files |
| `IRequestParameterReadOnly` | Interface | Read-only request parameter interface — carries business context from the caller into processing methods |
| `DELIMITER_STR` | Constant | Comma delimiter (`","`) used to separate item values in the output byte array |
| UTF-8 | Encoding | Unicode Transformation Format, 8-bit — the character encoding used for the returned byte array |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service offered by K-Opticom |
| K-Opticom | Business term | Japanese telecom operator providing fiber-optic broadband services |
| ID registration certificate | Business document | An official document issued to FTTH customers confirming their broadband service registration details |
| 帳票マップ (Chohyo Map) | Japanese term | Account map — the in-memory data structure holding all item values for a print form |
| `getKeyArray` | Method | Retrieves the array of item keys defined for a given display ID |
| `setStringBuilder` | Method | Extracts a single item's value from the account map and appends it (plus a delimiter) to the result StringBuilder |
| CBS | Acronym | Common Business Service — a service-layer component that implements business logic |
| `tchisho_sohus_pcd` | Field | Notification delivery address postal code — the postal code for the notification document delivery address |
| `tchisho_sohus_state_nm` | Field | Notification delivery address prefecture name |
| `tchisho_sohus_city_nm` | Field | Notification delivery address city/town/village name |
