# Business Logic — FUW01403SFLogic.editDispData() [88 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.FUW01403SF.FUW01403SFLogic` |
| Layer | Controller / Screen Logic (webview layer — screen data transformation) |
| Module | `FUW01403SF` (Package: `eo.web.webview.FUW01403SF`) |

## 1. Role

### FUW01403SFLogic.editDispData()

This method performs screen-display data preparation and editing (画面表示用データの加工編集処理) for the FUW01403 screen, which handles NTT subscriber contract information display. It receives raw service contract data from an upstream search/init operation and transforms it into a format suitable for rendering on the web screen. The method carries out three distinct business transformations: (1) **Address editing** — it extracts the line location postal code, splits it into a 3-digit area code prefix and a 4-digit suffix, reformats it with a hyphen separator (`000-0000`), and consolidates individual Japanese address components (prefecture, city/town, district, block number, building name, room number) into a single human-readable address string via `JZMCommonUtil.getPtn01`. (2) **Telecom service provider combo box population** — it retrieves a display-setting-mapped list of telecom service providers (`TSJGS_ICRN`) from the external configuration, sorts them by provider code in `TreeSet` order, parses each provider's comma-delimited name data into a provider code and provider name pair, and populates a data bean combo box list. (3) **Default selection initialization** — it sets the initial selected value of the telecom service provider combo box to `"0"`, establishing the default (first record) selection. The method implements a **delegation pattern**, routing address consolidation to `JZMCommonUtil` and display-item retrieval to `JFUWebCommon`, while acting as a data transformer within the screen initialization pipeline. Its role is to bridge the gap between backend search results and frontend rendering — it does not perform CRUD operations on the database itself.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["editDispData(serviceFormBean, outputMap)"])

    START --> INFO1["Log: Start editDispData"]
    INFO1 --> GET_LIST["GetDataBeanTypeByPath - SVC_KEI_INFO_LIST"]

    GET_LIST --> GET_PCD["sendMessageString - KAISEN_PLACE_PCD_01"]
    GET_PCD --> SPLITSUB["substring(0, 3) - Area Code"]
    SPLITSUB --> SPLITSUB2["substring(3) - Remaining"]
    SPLITSUB2 --> SET_PCD_FRONT["sendMessageString - KAISEN_PLACE_PCD_1_01 = Area Code"]
    SPLITSUB --> SET_PCD_BACK["sendMessageString - KAISEN_PLACE_PCD_2_01 = Remaining"]

    SET_PCD_FRONT --> SET_FULL_ADDR["sendMessageString - KAISEN_PLACE_PCD = 'Area' + '-' + 'Remaining'"]
    SET_PCD_BACK --> SET_FULL_ADDR

    SET_FULL_ADDR --> GET_ADDR1["sendMessageString - KAISEN_PLACE_STATE_NM_01"]
    GET_ADDR1 --> GET_ADDR2["sendMessageString - KAISEN_PLACE_CITY_NM_01"]
    GET_ADDR2 --> GET_ADDR3["sendMessageString - KAISEN_PLACE_OAZTSU_NM_01"]
    GET_ADDR3 --> GET_ADDR4["sendMessageString - KAISEN_PLACE_AZCHO_NM_01"]
    GET_ADDR4 --> GET_ADDR5["sendMessageString - KAISEN_PLACE_BNCHIGO_01"]
    GET_ADDR5 --> GET_ADDR6["sendMessageString - KAISEN_PLACE_ADRTTM_01"]
    GET_ADDR6 --> GET_ADDR7["sendMessageString - KAISEN_PLACE_ADRRM_01"]

    GET_ADDR7 --> COMBINE["JZMCommonUtil.getPtn01 - Address Consolidation"]
    COMBINE --> SET_COMBINED["sendMessageString - NTT_KEISHA_ADDRESS_00 = Combined Address"]

    SET_COMBINED --> CREATE_COMBO["createAndGetDataBeanTypeByPath - TSJGS_COMBOBOX"]
    CREATE_COMBO --> GET_DISP["getDispItemsAsMap - PATH_TSJGS_ICRN"]
    GET_DISP --> SORT["TreeSet - Sort provider codes"]
    SORT --> CHECK_EMPTY["tsjgsIcrneMap != null and size > 0"]

    CHECK_EMPTY -->|true| ITER_CHECK{"itr.hasNext()"}
    CHECK_EMPTY -->|false| SET_DEFAULT["sendMessageString - TSJGS_CD_04 = '0' (Default)"]

    ITER_CHECK -->|true| GET_NEXT["itr.next() - Provider code"]
    GET_NEXT --> SPLIT["tsjgsNmStr.split(',') - Name parts"]
    SPLIT --> ADD_CD["sendMessageString - TSJGS_CD_LIST_04, ADD = Provider code"]
    ADD_CD --> ADD_NM["sendMessageString - TSJGS_NM_LIST_04, ADD = Provider name"]

    ADD_NM --> ITER_CHECK
    ITER_CHECK -->|false| SET_DEFAULT

    SET_DEFAULT --> INFO2["Log: End editDispData"]
    INFO2 --> END(["return"])
```

**Processing flow description:**
1. **Logging** — Entry log with `DEBUG_LOG.info` marker.
2. **Retrieving the service contract info list** — Access the service contract information list data bean array via `JFUWebCommon.getDataBeanTypeByPath` using the constant path `SVC_KEI_INFO_LIST`.
3. **Postal code extraction and splitting** — Get the full postal code from the first element of the list, split it at position 3 (the standard Japanese postal code boundary: 3-digit prefix + hyphen + 4-digit suffix), and write the split halves back into the bean at separate paths for granular field display.
4. **Reformatted postal code setting** — Reassemble the postal code with a hyphen (`"-"` separator) and set it to the service form bean's main postal code field.
5. **Address component extraction** — Retrieve all seven address components from the service contract info list: prefecture name, city/town/village name, district name, block/chome name, block number, building name, and room number.
6. **Address consolidation** — Delegate to `JZMCommonUtil.getPtn01` with all seven address components to produce a single consolidated, human-readable address string, then set it to the form bean under `NTT_KEISHA_ADDRESS_00`.
7. **Telecom provider combo box preparation** — Create a data bean access for the telecom service provider combo box (`TSJGS_COMBOBOX`), then retrieve the provider code-to-name mapping from the external display settings via `JFUWebCommon.getDispItemsAsMap` using `PATH_TSJGS_ICRN`.
8. **Sorted iteration and combo population** — Wrap the provider code keys in a `TreeSet` for natural ascending sort order. If the map is non-empty, iterate through each sorted provider code, split the comma-delimited provider name string, and add the code and name as a new row to the combo box data bean list.
9. **Default selection initialization** — Set the combo box's selected value to `"0"`, designating the first record as the initial selection.
10. **Logging** — Exit log with `DEBUG_LOG.info` marker, then return.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `serviceFormBean` | `final X31SDataBeanAccess` | The service form data bean that carries all screen-level data for the FUW01403 (NTT Subscriber Contract Information Display) screen. It holds service contract information lists, the line location postal code, address fields, and the telecom service provider combo box data structure. The method reads from and writes to this bean throughout processing — extracting contract data, storing the reformatted postal code, populating the consolidated address, and building the provider combo box list. |
| 2 | `outputMap` | `final HashMap<String, HashMap<String, Object>>` | The service search result map containing results from prior service component calls (e.g., init search SC calls). This method reads the `outputMap` parameter but does not modify it directly; the telecom provider data is fetched from an external display settings path rather than from this map. In this specific method, `outputMap` is effectively unused for data reading — it is retained in the signature for API consistency with other methods in the class. |

**External state / instance fields read:**
| Field | Type | Business Description |
|-------|------|---------------------|
| `DEBUG_LOG` | `java.util.logging.Logger` | Logger instance for debug-level info logging, used to mark method entry and exit. |

## 4. CRUD Operations / Called Services

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

The method performs **zero database-level CRUD operations**. All called methods are data-bean accessors, string utilities, and display-item retrieval helpers. The data consumed originates from prior screen-init SC calls (not within this method's scope).

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JFUWebCommon.getDataBeanTypeByPath` | - | `serviceFormBean` | Retrieves the service contract information list data bean array from the service form bean by the path `SVC_KEI_INFO_LIST`. Reads data populated by prior init/search operations. |
| R | `JFUWebCommon.createAndGetDataBeanTypeByPath` | - | `serviceFormBean` | Creates (if absent) and retrieves the telecom service provider combo box data bean list under the path `TSJGS_COMBOBOX` within the service form bean. |
| R | `JFUWebCommon.getDispItemsAsMap` | - | External display settings | Retrieves the telecom service provider code-to-name mapping from external display configuration (`PATH_TSJGS_ICRN`). Returns a `Map<String, String>` where keys are provider codes and values are comma-delimited provider name strings. |
| R | `JZMCommonUtil.getPtn01` | - | - | Utility method that consolidates seven Japanese address components (prefecture, city, district, block, number, building, room) into a single formatted address string. |

### Summary of all method calls and their classifications:

| Call | Classification | Business Description |
|------|---------------|---------------------|
| `serviceFormBean.sendMessageString(POSTAL, SET, val)` | SET | Sets formatted postal code fields on the service form bean |
| `svcKeiInfoList.sendMessageString(POSTAL_PCD_01, GET)` | R | Reads postal code from the first service contract info row |
| `svcKeiInfoList.sendMessageString(POSTAL_PCD_1_01, SET, val)` | SET | Sets split postal code prefix (3-digit area code) |
| `svcKeiInfoList.sendMessageString(POSTAL_PCD_2_01, SET, val)` | SET | Sets split postal code suffix (remaining digits) |
| `svcKeiInfoList.sendMessageString(<addr_field>, GET)` ×7 | R | Reads all seven address components from the first contract row |
| `JZMCommonUtil.getPtn01(state, city, ..., room)` | R | Consolidates address components into a human-readable string |
| `JFUWebCommon.getDispItemsAsMap(PATH_TSJGS_ICRN, QUERY_ATTR_NAME)` | R | Fetches telecom service provider lookup data from external config |
| `tsjgsList.sendMessageString(TSJGS_CD_LIST_04, ADD, code)` | SET | Appends a provider code row to the combo box data bean |
| `tsjgsList.sendMessageString(TSJGS_NM_LIST_04, ADD, name)` | SET | Appends a provider name row to the combo box data bean |
| `tsjgsList.sendMessageString(TSJGS_CD_04, SET, "0")` | SET | Sets the default selected value of the provider combo box |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | CBS: `FUW01403SFLogic.init()` | `init()` -> `editDispData(serviceFormBean, outputMap)` | `sendMessageString` [-] (6 calls — no SC/CRUD endpoint) |

**Call chain detail:**
- The `init()` method of `FUW01403SFLogic` (line ~387) is the sole direct caller of `editDispData`.
- `init()` first invokes `executeInitService()` to perform the upstream search/init SC operation, then calls `checkInitError()` for validation, then delegates to `editDispData()` for screen data transformation, and finally calls `editFrontKhrkInfoArea()` for fee table editing.
- The method `editDispData` does not terminate any database-facing transaction or SC call — its terminal operations are all data-bean `sendMessageString` calls and the utility call to `JZMCommonUtil.getPtn01`. No SC Code or DB table is reached from this method alone.

## 6. Per-Branch Detail Blocks

**Block 1** — [IF chain: sequential processing steps] (L1120)

> Entry block: Logging, then sequential retrieval and transformation of line location postal code and address data from the service contract info list.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | EXEC | `DEBUG_LOG.info("----- FUW01403 Start editDispData -----")` | Log method entry |
| 2 | CALL | `JFUWebCommon.getDataBeanTypeByPath(serviceFormBean, FUW01403SFConst.SVC_KEI_INFO_LIST)` | Retrieves the service contract information list data bean array. Constant: `SVC_KEI_INFO_LIST = "サービス契約情報リスト"` |
| 3 | EXEC | `svcKeiInfoList.sendMessageString(FUW01403SFConst.KAISEN_PLACE_PCD_01, GET)` | Gets the line location postal code from the first row. Constant: `KAISEN_PLACE_PCD_01 = "回線場所郵便番号(01)"` (Line Location Postal Code (01)) |
| 4 | SET | `String kaisenPlacePcd = ...` | Stores the full postal code string |
| 5 | SET | `kaisenPlacePcd.substring(0, 3)` | Splits postal code at position 3 — the first 3 digits form the area code prefix |
| 6 | SET | `kaisenPlacePcd.substring(3)` | The remaining digits form the postal code suffix |
| 7 | SET | `svcKeiInfoList.sendMessageString(FUW01403SFConst.KAISEN_PLACE_PCD_1_01, SET, prefix)` | Sets the 3-digit prefix to the bean. Constant: `KAISEN_PLACE_PCD_1_01 = "回線場所郵便番号(前)"` (Line Location Postal Code (Prefix)) |
| 8 | SET | `svcKeiInfoList.sendMessageString(FUW01403SFConst.KAISEN_PLACE_PCD_2_01, SET, suffix)` | Sets the remaining digits to the bean. Constant: `KAISEN_PLACE_PCD_2_01 = "回線場所郵便番号(後)"` (Line Location Postal Code (Suffix)) |
| 9 | SET | `serviceFormBean.sendMessageString(FUW01403SFConst.KAISEN_PLACE_PCD, SET, prefix + "-" + suffix)` | Sets the reformatted full postal code with hyphen. Constant: `KAISEN_PLACE_PCD = "回線場所郵便番号"` (Line Location Postal Code) |
| 10 | EXEC | `svcKeiInfoList.sendMessageString(FUW01403SFConst.KAISEN_PLACE_STATE_NM_01, GET)` | Gets prefecture name. Constant: `KAISEN_PLACE_STATE_NM_01 = "回線場所都道府県名"` (Line Location Prefecture Name) |
| 11 | EXEC | `svcKeiInfoList.sendMessageString(FUW01403SFConst.KAISEN_PLACE_CITY_NM_01, GET)` | Gets city/town/village name. Constant: `KAISEN_PLACE_CITY_NM_01 = "回線場所市区町村名"` |
| 12 | EXEC | `svcKeiInfoList.sendMessageString(FUW01403SFConst.KAISEN_PLACE_OAZTSU_NM_01, GET)` | Gets district name. Constant: `KAISEN_PLACE_OAZTSU_NM_01 = "回線場所大字通称名"` |
| 13 | EXEC | `svcKeiInfoList.sendMessageString(FUW01403SFConst.KAISEN_PLACE_AZCHO_NM_01, GET)` | Gets block/chome name. Constant: `KAISEN_PLACE_AZCHO_NM_01 = "回線場所字丁目名"` |
| 14 | EXEC | `svcKeiInfoList.sendMessageString(FUW01403SFConst.KAISEN_PLACE_BNCHIGO_01, GET)` | Gets block number. Constant: `KAISEN_PLACE_BNCHIGO_01 = "回線場所番地号"` |
| 15 | EXEC | `svcKeiInfoList.sendMessageString(FUW01403SFConst.KAISEN_PLACE_ADRTTM_01, GET)` | Gets building name. Constant: `KAISEN_PLACE_ADRTTM_01 = "回線場所住所補記・建物名"` |
| 16 | EXEC | `svcKeiInfoList.sendMessageString(FUW01403SFConst.KAISEN_PLACE_ADRRM_01, GET)` | Gets room number. Constant: `KAISEN_PLACE_ADRRM_01 = "回線場所住所補記・部屋番号"` |
| 17 | CALL | `JZMCommonUtil.getPtn01(state, city, oasis, azcho, bnchigo, adrttm, adrrm)` | Consolidates all seven address components into a single formatted address string |
| 18 | SET | `String ans = JZMCommonUtil.getPtn01(...)` | Stores the consolidated address |
| 19 | SET | `serviceFormBean.sendMessageString(FUW01403SFConst.NTT_KEISHA_ADDRESS_00, SET, ans)` | Sets the consolidated address on the form. Constant: `NTT_KEISHA_ADDRESS_00 = "NTT契約住所00"` (NTT Subscriber Address 00) |

**Block 2** — [Telecom service provider combo box initialization] (L1165)

> Creates the provider combo box data bean and retrieves the external display-setting map of telecom service providers.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | CALL | `JFUWebCommon.createAndGetDataBeanTypeByPath(serviceFormBean, FUW01403SFConst.TSJGS_COMBOBOX)` | Creates/retrieves the combo box data bean. Constant: `TSJGS_COMBOBOX = "現在ご利用中の電気サービス提供事業者"` (Currently Used Telephone Service Provider) |
| 2 | SET | `X31SDataBeanAccess tsjgsList = ...` | Stores the combo box data bean reference |
| 3 | SET | `Map<String, String> tsjgsIcrneMap = JFUWebCommon.getDispItemsAsMap(PATH_TSJGS_ICRN, QUERY_ATTR_NAME)` | Gets provider code-to-name map from display settings. Path: `PATH_TSJGS_ICRN = "DISPSETTING/SETTING[@screenId='#']/DISPTEXT[@groupid='TSJGS_ICRN']"` |
| 4 | SET | `Set<String> tsjgsIcrneSet = tsjgsIcrneMap.keySet()` | Extracts the set of provider codes |
| 5 | SET | `tsjgsIcrneSet = new TreeSet(tsjgsIcrneSet)` | Sorts provider codes in natural ascending order |
| 6 | SET | `Iterator<String> itr = tsjgsIcrneSet.iterator()` | Creates an iterator for sorted traversal |

**Block 3** — [IF] `(tsjgsIcrneMap != null && tsjgsIcrneMap.size() > 0)` (L1179)

> Conditional: only process provider data if the display-setting map has entries.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | COND | `tsjgsIcrneMap != null && tsjgsIcrneMap.size() > 0` | Checks if provider map is non-null and has entries. Branch true: populate combo box. Branch false: skip to default selection. |

**Block 3.1** — [WHILE] `(itr.hasNext())` (L1184)

> Iterates through each sorted provider code, splits its name data, and adds a row to the combo box.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `String tsjgsCdStr = itr.next()` | Gets the next sorted provider code |
| 2 | SET | `String tsjgsNmStr = tsjgsIcrneMap.get(tsjgsCdStr)` | Gets the comma-delimited provider name string for this code |
| 3 | SET | `String tsjgsNm[] = tsjgsNmStr.split(",")` | Splits the name at comma — `tsjgsNm[0]` = provider code, `tsjgsNm[1]` = provider name |
| 4 | SET | `tsjgsList.sendMessageString(FUW01403SFConst.TSJGS_CD_LIST_04, ADD, tsjgsNm[0])` | Appends provider code to combo box. Constant: `TSJGS_CD_LIST_04 = "通信事業者コードリスト"` (Telecom Service Provider Code List) |
| 5 | SET | `tsjgsList.sendMessageString(FUW01403SFConst.TSJGS_NM_LIST_04, ADD, tsjgsNm[1])` | Appends provider name to combo box. Constant: `TSJGS_NM_LIST_04 = "通信事業者名リスト"` (Telecom Service Provider Name List) |

**Block 4** — [ELSE-IF branch from Block 3] (skipped when map is empty) (L1179 false path)

> When the provider map is empty, the while loop is skipped entirely. Processing continues to Block 5.

**Block 5** — [SET: default selection initialization] (L1201)

> Sets the combo box's selected value to `"0"`, designating the first row as the initial selection.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `tsjgsList.sendMessageString(FUW01403SFConst.TSJGS_CD_04, SET, "0")` | Sets the default selected provider code. Constant: `TSJGS_CD_04 = "通信事業者コード"` (Telecom Service Provider Code). Value `"0"` indicates the first/default record selection. |
| 2 | EXEC | `DEBUG_LOG.info("----- FUW01403 End editDispData -----")` | Log method exit |
| 3 | RETURN | `return;` | Returns void |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_info_list` | Field / Constant Path | Service Contract Information List — the list data bean containing service contract records; each row represents one service contract with its associated line location data |
| `kaisen_place_pcd` | Field | Line Location Postal Code — the postal code at the service installation point (where the fiber line terminates) |
| `kaisen_place_state_nm` | Field | Line Location Prefecture Name — the Japanese prefecture (都道府県) of the line installation location |
| `kaisen_place_city_nm` | Field | Line Location City/Town/Village Name — the municipal-level address component |
| `kaisen_place_oaztsu_nm` | Field | Line Location District Name — the district (大字) or general street name (通称名) component |
| `kaisen_place_azcho_nm` | Field | Line Location Block/Chome Name — the block or chome (丁目) component of the address |
| `kaisen_place_bnchigo` | Field | Line Location Block Number — the parcel/lot number (番地号) component |
| `kaisen_place_adrttm` | Field | Line Location Building Name — the building name (建物名) if the address includes one |
| `kaisen_place_adrrm` | Field | Line Location Room Number — the room/unit number (部屋番号) component |
| `ntt_keisha_address_00` | Field | NTT Subscriber Address — the consolidated, human-readable address string produced by `JZMCommonUtil.getPtn01` |
| `tsjgs` | Acronym | Telephone Service Provider (電話サービス提供者) — the telecom service company offering telephone services to the subscriber |
| `tsjgs_combobox` | Field / Constant Path | Currently Used Telephone Service Provider — the combo box data bean listing telecom service providers available to the customer |
| `tsjgs_icrn` | Acronym Path | Telecom Service Provider Code — used as a display settings group ID to retrieve the provider code-to-name mapping |
| `SVC_KEI_INFO_LIST` | Constant | "サービス契約情報リスト" (Service Contract Information List) — the path key to access the service contract data bean array within the form bean |
| `KAISEN_PLACE_PCD` | Constant | "回線場所郵便番号" (Line Location Postal Code) — the main postal code field on the service form |
| `TSJGS_COMBOBOX` | Constant | "現在ご利用中の電気サービス提供事業者" (Currently Used Telephone Service Provider) — the data bean path for the telecom provider combo box |
| `PATH_TSJGS_ICRN` | Constant | External display settings path `DISPSETTING/SETTING[@screenId='#']/DISPTEXT[@groupid='TSJGS_ICRN']` — XML-based configuration key for retrieving provider code/name data |
| `QUERY_ATTR_NAME` | Constant | The query attribute identifier used to fetch data from the external display settings map |
| `FUW01403` | Screen ID | NTT Subscriber Contract Information Display screen — the web screen where this method's transformed data is rendered |
| `X31SDataBeanAccess` | Class | Screen-level data bean access wrapper — provides `sendMessageString` for typed data get/set on form beans |
| `JZMCommonUtil` | Class | Address consolidation utility — formats individual Japanese address components into a single displayable address string |
| `JFUWebCommon` | Class | Web screen common utility — provides data bean access, display item retrieval, and screen-setting helpers |
| `GET` | Constant | Parameter to `sendMessageString` indicating a read/get operation |
| `SET` | Constant | Parameter to `sendMessageString` indicating a write/set operation |
| `ADD` | Constant | Parameter to `sendMessageString` indicating an append/add-row operation on a data bean list |

---
