# Business Logic — KKW14901SFLogic.getMyHktgiInfo() [80 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKW14901SF.KKW14901SFLogic` |
| Layer | Controller (Web view logic layer) |
| Module | `KKW14901SF` (Package: `eo.web.webview.KKW14901SF`) |

## 1. Role

### KKW14901SFLogic.getMyHktgiInfo()

This method gathers and assembles all screen-level transfer information required for the **Panpo (番ポ) Number Pre-Notification List** screen (番ポなし番号事前通知一覧). The screen is a reference screen used to display a list of phone numbers for which pre-notifications have been sent to customers, along with associated service contract details and search parameters.

The method implements a **data aggregation pattern**: it extracts data from the input `X31SDataBeanAccess` parameter bean, retrieves supplementary information (such as the "Acknowledgement Receipt Number" / 加入御礼書発行番号) from the currently selected row of a list if one is selected, and then populates a `HashMap<String, Object>` with all fields needed to repopulate the screen state during cross-screen navigation.

Its role in the larger system is as a **shared screen-state serializer** — it is called by other action handlers within `KKW14901SFLogic` (specifically `actionYoksiAdd()` and `setParamAndSeniKKW14902()`) to prepare the return data map that will be passed back to the screen. It does not perform any database or service component (SC) operations; all data flows through the in-memory bean, making this a pure data-transfer/serialization method.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["getMyHktgiInfo bean"])
    START --> GET_LIST["getDataBeanArray BMPNONNOPRETCHI_LIST"]
    GET_LIST --> GET_INDEX["getTchiListSelectIndex bean"]
    GET_INDEX --> CHECK_INDEX{"selectIndex != -1"}
    CHECK_INDEX -->|True| GET_DATABEAN["datalist.getDataBean selectIndex"]
    GET_DATABEAN --> GET_KANU["sendMessageString KANUORESO_HAKKO_NO_02 -> kanuoreso_no"]
    CHECK_INDEX -->|False| SKIP_KANU["kanuoreso_no = \\\"\\\""]
    SKIP_KANU --> BUILD_MAP["dataMapMe = new HashMap"]
    GET_KANU --> BUILD_MAP
    BUILD_MAP --> PUT_SYSID["put SYSID from bean"]
    PUT_SYSID --> PUT_SVC["put SVC_KEI_NO from bean"]
    PUT_SVC --> PUT_DATE_FROM["put DATA_CHSHT_YEAR_FROM/MON_FROM/DAY_FROM from bean"]
    PUT_DATE_FROM --> PUT_DATE_TO["put DATA_CHSHT_YEAR_TO/MON_TO/DAY_TO from bean"]
    PUT_DATE_TO --> PUT_MS["put MSKMSHO_NO from bean"]
    PUT_MS --> PUT_CUST["put CUST_NM from bean"]
    PUT_CUST --> GET_SEND_LIST["getDataBeanArray SEND_JGI_INFO"]
    GET_SEND_LIST --> GET_SEND_BEAN["sendjgilist.getDataBean 0"]
    GET_SEND_BEAN --> GET_INDEX01["sendMessageString INDEX_01 -> index"]
    GET_INDEX01 --> GET_CD_DIV["sendMessageString CD_DIV_LIST_01 with index -> send_jgi_cd"]
    GET_CD_DIV --> PUT_SEND_JGI["put SEND_JGI_CD send_jgi_cd"]
    PUT_SEND_JGI --> PUT_MI_SEND["put MI_SEND sendMessageBoolean"]
    PUT_MI_SEND --> PUT_SEARCH_SYSID["put SEARCH_SYSID from bean"]
    PUT_SEARCH_SYSID --> PUT_SEARCH_SVC["put SEARCH_SVC_KEI_NO from bean"]
    PUT_SEARCH_SVC --> PUT_SEARCH_DATEF["put SEARCH_DATA_CHSHTYMD_FROM from bean"]
    PUT_SEARCH_DATEF --> PUT_SEARCH_DATET["put SEARCH_DATA_CHSHTYMD_TO from bean"]
    PUT_SEARCH_DATET --> PUT_SEARCH_MS["put SEARCH_MSKMSHO_NO from bean"]
    PUT_SEARCH_MS --> PUT_SEARCH_CUST["put SEARCH_CUST_NM from bean"]
    PUT_SEARCH_CUST --> PUT_SEARCH_SENDJGI["put SEARCH_SEND_JGI_FLG from bean"]
    PUT_SEARCH_SENDJGI --> PUT_SEARCH_MI["put SEARCH_MI_SEND from bean"]
    PUT_SEARCH_MI --> PUT_ORDER_NUM["put ORDER_NUM from bean"]
    PUT_ORDER_NUM --> PUT_ORDER_TYPE["put ORDER_TYPE from bean"]
    PUT_ORDER_TYPE --> PUT_SEARCH_FLG["put SEARCH_FLG from bean"]
    PUT_SEARCH_FLG --> PUT_KANU["put KANUORESO_HAKKO_NO kanuoreso_no"]
    PUT_KANU --> PUT_RTN["put RTN_BTN_DISP_FLG from bean"]
    PUT_RTN --> END_NODE(["return dataMapMe"])
    END_NODE --> FINAL(["End"])
```

**Processing description:**

1. **Retrieve pre-notification list**: Fetches the "Panpo Number Pre-Notification List" (`BMPNONNOPRETCHI_LIST`) data bean array from the input bean. This array holds the rows displayed in the list on the screen.

2. **Determine selected row**: Calls `getTchiListSelectIndex(bean)` to find the index of the currently selected row in the list. If no row is selected, this returns `-1`.

3. **Conditional branch — selected row**: If a row is selected (`selectIndex != -1`), extract the data bean at that index and retrieve the "Acknowledgement Receipt Number" (`KANUORESO_HAKKO_NO_02`). If no row is selected, `kanuoreso_no` remains an empty string.

4. **Build the return map**: Create a new `HashMap<String, Object>` and populate it with all 21 fields required for screen state reconstruction. These include system ID, service contract number, date range (from/to year/month/day), submission number, customer name, send exclusion info, search parameters, sort/operation metadata, and the acknowledgement receipt number.

5. **Set return button flag**: Adds the "Return button display flag" (`RTN_BTN_DISP_FLG`) — a v4.01 screen transition compatibility feature.

6. **Return**: Returns the fully populated `dataMapMe` HashMap for use by the caller during screen navigation.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `bean` | `X31SDataBeanAccess` | The data bean access object carrying the current screen state for the Panpo Number Pre-Notification List screen. It contains all form fields, list data, search parameters, and selection state that were submitted by the user or stored during prior screen processing. |

**Instance fields / external state read:**

| Source | Access | Business Description |
|--------|--------|---------------------|
| `getTchiListSelectIndex(bean)` | Method call | Retrieves the currently selected row index from the list on the Panpo Number Pre-Notification screen. Returns `-1` if no row is selected. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `OneStopDataBeanAccessArray.getDataBean` | OneStopDataBeanAccess | - | Calls `getDataBeanArray` in `OneStopDataBeanAccessArray` to retrieve the pre-notification list data |
| R | `OneStopDataBeanAccess.getDataBean` | OneStopDataBeanAccess | - | Calls `getDataBean` in `OneStopDataBeanAccess` to retrieve a specific row from the list by index |
| - | `OneStopDataBeanAccess.sendMessageString` | OneStopDataBeanAccess | - | Calls `sendMessageString` to extract the acknowledgement receipt number from the selected row |
| R | `KKW14901SFLogic.getTchiListSelectIndex` | KKW14901SFLogic | - | Calls `getTchiListSelectIndex` to determine the currently selected list row index |
| - | `OneStopDataBeanAccess.sendMessageBoolean` | OneStopDataBeanAccess | - | Calls `sendMessageBoolean` to extract the "un-sent" flag (MI_SEND) as a boolean value |
| - | `Integer.parseInt` | - | - | Parses the "添字" (suffix/index) string to an integer for send exclusion info lookup |

**Note:** This method performs **no database writes**. All operations are read (R) or data extraction from in-memory bean structures. There are no SC (Service Component) or CBS (Common Business Service) calls, and no entity/DB table interactions.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Class:KKW14901SFLogic | `KKW14901SFLogic.actionYoksiAdd` -> `getMyHktgiInfo(bean)` | `sendMessageString [-]` (no DB) |
| 2 | Class:KKW14901SFLogic | `KKW14901SFLogic.setParamAndSeniKKW14902` -> `getMyHktgiInfo(bean)` | `sendMessageString [-]` (no DB) |

**Notes:**
- No screen/batch entry points (KKSV*) are found within 8 hops of this method.
- Both callers are internal logic methods within `KKW14901SFLogic`, suggesting this method is a utility called by other action handlers during the screen's processing flow.
- Terminal operations are all `sendMessageString` calls against the in-memory data bean — no database or external service endpoints are reached.

## 6. Per-Branch Detail Blocks

**Block 1** — [GET] `datalist = bean.getDataBeanArray(BMPNONNOPRETCHI_LIST)` (L1112)

> Retrieve the Panpo Number Pre-Notification List data bean array from the input bean.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `X31SDataBeanAccessArray datalist = bean.getDataBeanArray(KKW14901SFConst.BMPNONNOPRETCHI_LIST)` |

**Block 2** — [GET] `selectIndex = getTchiListSelectIndex(bean)` (L1115)

> Obtain the currently selected row index in the pre-notification list. Returns `-1` if no row is selected.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `int selectIndex = getTchiListSelectIndex(bean)` |

**Block 3** — [SET] `kanuoreso_no = ""` (L1117)

> Initialize the acknowledgement receipt number variable to empty string (default value).

| # | Type | Code |
|---|------|------|
| 1 | SET | `String kanuoreso_no = ""` |

**Block 4** — [IF] `selectIndex != -1` (L1120) `[SELECTION CHECK]`

> Check whether a row is selected in the list. If selected, retrieve the acknowledgement receipt number from that row.

| # | Type | Code |
|---|------|------|
| 1 | SET | `X31SDataBeanAccess dataBean = datalist.getDataBean(getTchiListSelectIndex(bean))` |
| 2 | EXEC | `kanuoreso_no = dataBean.sendMessageString(KKW14901SFConst.KANUORESO_HAKKO_NO_02, X31CWebConst.DATABEAN_GET_VALUE)` |

**Block 4.1** — [ELSE] implicit (no selection)

> When no row is selected, `kanuoreso_no` remains `""` (the value set in Block 3).

**Block 5** — [SET] `dataMapMe = new HashMap<String, Object>()` (L1127)

> Create the HashMap that will hold all transfer information for screen state restoration.

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashMap<String, Object> dataMapMe = new HashMap<String, Object>()` |

**Block 6** — [SET batch] Populate `dataMapMe` with core screen fields (L1128–L1152)

> Transfer all core screen state fields from the input bean into the return map. These fields represent the primary display data and search parameters visible on the Panpo Number Pre-Notification List screen.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `dataMapMe.put(SYSID, bean.sendMessageString(SYSID, DATABEAN_GET_VALUE))` |
| 2 | EXEC | `dataMapMe.put(SVC_KEI_NO, bean.sendMessageString(SVC_KEI_NO, DATABEAN_GET_VALUE))` |
| 3 | EXEC | `dataMapMe.put(DATA_CHSHT_YEAR_FROM, bean.sendMessageString(DATA_CHSHT_YEAR_FROM, DATABEAN_GET_VALUE))` |
| 4 | EXEC | `dataMapMe.put(DATA_CHSHT_MON_FROM, bean.sendMessageString(DATA_CHSHT_MON_FROM, DATABEAN_GET_VALUE))` |
| 5 | EXEC | `dataMapMe.put(DATA_CHSHT_DAY_FROM, bean.sendMessageString(DATA_CHSHT_DAY_FROM, DATABEAN_GET_VALUE))` |
| 6 | EXEC | `dataMapMe.put(DATA_CHSHT_YEAR_TO, bean.sendMessageString(DATA_CHSHT_YEAR_TO, DATABEAN_GET_VALUE))` |
| 7 | EXEC | `dataMapMe.put(DATA_CHSHT_MON_TO, bean.sendMessageString(DATA_CHSHT_MON_TO, DATABEAN_GET_VALUE))` |
| 8 | EXEC | `dataMapMe.put(DATA_CHSHT_DAY_TO, bean.sendMessageString(DATA_CHSHT_DAY_TO, DATABEAN_GET_VALUE))` |
| 9 | EXEC | `dataMapMe.put(MSKMSHO_NO, bean.sendMessageString(MSKMSHO_NO, DATABEAN_GET_VALUE))` |
| 10 | EXEC | `dataMapMe.put(CUST_NM, bean.sendMessageString(CUST_NM, DATABEAN_GET_VALUE))` |

**Block 7** — [SET] Extract send exclusion info with index lookup (L1133–L1136)

> Retrieve the send exclusion information list, get the first item (index 0), parse its suffix/index value, and use it to look up a send exclusion flag code from a code list.

| # | Type | Code |
|---|------|------|
| 1 | SET | `X31SDataBeanAccessArray sendjgilist = bean.getDataBeanArray(KKW14901SFConst.SEND_JGI_INFO)` |
| 2 | SET | `X31SDataBeanAccess sendjgiBean = sendjgilist.getDataBean(0)` |
| 3 | SET | `int index = Integer.parseInt(sendjgiBean.sendMessageString(INDEX_01, DATABEAN_GET_VALUE))` |
| 4 | SET | `String send_jgi_cd = sendjgiBean.sendMessageString(CD_DIV_LIST_01, DATABEAN_GET_VALUE, index)` |
| 5 | EXEC | `dataMapMe.put(SEND_JGI_CD, send_jgi_cd)` |

**Block 8** — [SET] Populate `dataMapMe` with send exclusion and search fields (L1137–L1152)

> Add the send exclusion flag, and all search-related state fields to the return map.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `Boolean mi_send = bean.sendMessageBoolean(MI_SEND, DATABEAN_GET_VALUE)` |
| 2 | EXEC | `dataMapMe.put(MI_SEND, mi_send)` |
| 3 | EXEC | `dataMapMe.put(SEARCH_SYSID, bean.sendMessageString(SEARCH_SYSID, DATABEAN_GET_VALUE))` |
| 4 | EXEC | `dataMapMe.put(SEARCH_SVC_KEI_NO, bean.sendMessageString(SEARCH_SVC_KEI_NO, DATABEAN_GET_VALUE))` |
| 5 | EXEC | `dataMapMe.put(SEARCH_DATA_CHSHTYMD_FROM, bean.sendMessageString(SEARCH_DATA_CHSHTYMD_FROM, DATABEAN_GET_VALUE))` |
| 6 | EXEC | `dataMapMe.put(SEARCH_DATA_CHSHTYMD_TO, bean.sendMessageString(SEARCH_DATA_CHSHTYMD_TO, DATABEAN_GET_VALUE))` |
| 7 | EXEC | `dataMapMe.put(SEARCH_MSKMSHO_NO, bean.sendMessageString(SEARCH_MSKMSHO_NO, DATABEAN_GET_VALUE))` |
| 8 | EXEC | `dataMapMe.put(SEARCH_CUST_NM, bean.sendMessageString(SEARCH_CUST_NM, DATABEAN_GET_VALUE))` |
| 9 | EXEC | `dataMapMe.put(SEARCH_SEND_JGI_FLG, bean.sendMessageString(SEARCH_SEND_JGI_FLG, DATABEAN_GET_VALUE))` |
| 10 | EXEC | `dataMapMe.put(SEARCH_MI_SEND, bean.sendMessageString(SEARCH_MI_SEND, DATABEAN_GET_VALUE))` |
| 11 | EXEC | `dataMapMe.put(ORDER_NUM, bean.sendMessageString(ORDER_NUM, DATABEAN_GET_VALUE))` |
| 12 | EXEC | `dataMapMe.put(ORDER_TYPE, bean.sendMessageString(ORDER_TYPE, DATABEAN_GET_VALUE))` |
| 13 | EXEC | `dataMapMe.put(SEARCH_FLG, bean.sendMessageString(SEARCH_FLG, DATABEAN_GET_VALUE))` |
| 14 | EXEC | `dataMapMe.put(KANUORESO_HAKKO_NO, kanuoreso_no)` |

**Block 9** — [SET] v4.01 screen transition compatibility: return button flag (L1155–L1157)

> Set the return button display flag for v4.01 screen transition compatibility.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `dataMapMe.put(RTN_BTN_DISP_FLG, bean.sendMessageBoolean(RTN_BTN_DISP_FLG, DATABEAN_GET_VALUE))` |

**Block 10** — [RETURN] `return dataMapMe` (L1160)

> Return the fully populated HashMap containing all screen state transfer information.

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

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `kanuoreso_no` | Field | Acknowledgement Receipt Number — the receipt number issued for a written acknowledgment of service (加入御礼書発行番号), tracked per pre-notification record |
| `bmpnonnopretchi_list` | Field | Panpo Number Pre-Notification List — the list of phone numbers (番ポなし) for which pre-notification has been sent to customers |
| `sysid` | Field | System ID — identifies the system context for the screen operation |
| `svc_kei_no` | Field | Service Contract Number — the unique identifier for a customer's service contract (サービス契約番号) |
| `data_chsht_year_from/mon_from/day_from` | Field | Data extraction date range start (year/month/day) — the "from" portion of the date filter used to query records |
| `data_chsht_year_to/mon_to/day_to` | Field | Data extraction date range end (year/month/day) — the "to" portion of the date filter used to query records |
| `mskmsho_no` | Field | Submission Number — the reference number for the submission/application (申請番号) |
| `cust_nm` | Field | Customer Name (Kanji) — the customer's name in Kanji characters (お客様名（漢字）) |
| `send_jgi_info` | Field | Send Exclusion Information — data describing which communications are excluded from being sent (送信除外情報) |
| `mi_send` | Field | Un-sent Flag — indicates whether a notification has not been sent (未送信) |
| `send_jgi_cd` | Field | Send Exclusion Flag Code — the code representing the send exclusion status (送信除外フラグコード) |
| `search_*` fields | Fields | Search parameters — prefixed fields (`SEARCH_SYSID`, `SEARCH_SVC_KEI_NO`, `SEARCH_DATA_CHSHTYMD_FROM`, etc.) that hold the search criteria state for the screen's search functionality |
| `order_num` | Field | Sort Item No. — the field used as a sort criterion (ソート項目№) |
| `order_type` | Field | Sort Order — the sort direction (ascending/descending) (ソート順) |
| `search_flg` | Field | Search Flag — indicates whether a search has been executed (検索フラグ) |
| `list_disp_flg` | Field | List Display Flag — controls whether the list is displayed (一覧表示フラグ) |
| `rtn_btn_disp_flg` | Field | Return Button Display Flag — controls visibility of the "Return" button on the screen (戻るボタン表示フラグ). Added in v4.01 for screen transition compatibility. |
| `index_01` | Field | Suffix / Index — the positional index used to look up data in a code list (添字) |
| `cd_div_list_01` | Field | Code List — the list of codes used for send exclusion flag lookup (コードリスト) |
| `KKW14901SFConst` | Class | Constants class for the KKW14901SF screen module, containing all field name and display label string constants |
| `X31SDataBeanAccess` | Class | Data bean access class — the framework class providing methods to read/write field values from the screen's data model |
| `X31SDataBeanAccessArray` | Class | Array version of the data bean access class — holds a list of data beans (e.g., for list/table data) |
| Panpo (番ポ) | Business term | Abbreviation for "pan (phone number) po(st)" — refers to phone numbers associated with post-service notifications |
| Pre-notification | Business term | 事前通知 — a notification sent to a customer before an actual service change or charge takes effect |
| 加入御礼書 | Business term | Acknowledgement Receipt — a written document sent to a customer acknowledging their service enrollment, with a unique receipt number |
| OneStopDataBeanAccess | Class | Framework data bean access class used in the OneStop (統合) screen architecture |
| v4.01 screen transition | Feature | Version 4.01 screen compatibility layer that introduced the return button display flag for improved cross-screen navigation |
