# Business Logic — KKW14901SFLogic.setParamAndSeniKKW14902() [46 LOC]

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

## 1. Role

### KKW14901SFLogic.setParamAndSeniKKW14902()

This method performs the **pre-transfer parameter setup and screen routing** for the "Banpo-nashi (no postal code) Number Advance Notification Detail" screen — a special handling screen for subscribers whose telephone number registration does not have a postal code on file. The method is invoked from three action handlers on the KKW14901SF (list inquiry) screen when the user selects a row and triggers a transition: **re-issue (再発行, rehakko)**, **update (更新, upd)**, or **inquiry (照会, shokai)** mode.

It follows the **builder + delegation design pattern**: it constructs two inheritance information maps (one for the self-screen, one for the next screen), delegates screen metadata setup to `JCCWebCommon.setScreenInfo` and `JCCWebCommon.setScreenId`, configures the common form's next-screen ID, and finally logs both maps for audit and debugging.

The method serves as a **shared utility bridge** between the list-screen (KKW14901) and the detail-screen (KKW14902), and optionally the detail confirmation-screen (KKW14904). It does not perform any database CRUD operations — its sole responsibility is preparing and passing state to the target screen while optionally redirecting the completion screen path.

Conditional branches exist based on the `seniMode` parameter: when the mode is **re-issue** (`"1"`) or **update** (`"2"`), the completion screen ID is overridden to `KKW14904` (update completion screen) instead of the default `KKW14902` (detail inquiry/update screen). The **inquiry** mode (`"3"`) keeps the default path.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setParamAndSeniKKW14902(seniMode)"])
    START --> GET_BEAN["Get ServiceFormBean bean"]
    GET_BEAN --> GET_LIST["Get list: getDataBeanArray BMPNONNOPRETCHI_LIST"]
    GET_LIST --> GET_SELECTED["Get selected: getDataBean getTchiListSelectIndex"]
    GET_SELECTED --> GET_KANUO["Get kanuoreso_no: sendMessageString KANUORESO_HAKKO_NO_02"]
    GET_KANUO --> MAKE_SELF["Make self info: getMyHktgiInfo bean"]
    MAKE_SELF --> MAKE_NEXT["Create dataMapNext HashMap"]
    MAKE_NEXT --> PUT_MODE["Put SENI_MODE and kanuoreso_no into dataMapNext"]
    PUT_MODE --> SET_SELF["setScreenInfo KKW14901 dataMapMe"]
    SET_SELF --> SET_NEXT["setScreenInfo KKW14902 dataMapNext"]
    SET_NEXT --> SET_ID["setScreenId KKW14902 KKW14901"]
    SET_ID --> BRANCH{"seniMode is REHAKKO or UPD?"}
    BRANCH -->|Yes| OVERWRITE["Overwrite setScreenId KKW14904 KKW14901"]
    BRANCH -->|No| SKIP["Skip - keep KKW14902 as next screen"]
    OVERWRITE --> GET_COMMON["Get CommonInfoBean"]
    SKIP --> GET_COMMON
    GET_COMMON --> SET_NEXT_SCREEN["Set NEXT_SCREEN_ID to KKW14902"]
    SET_NEXT_SCREEN --> LOG_SELF["printLog dataMapMe self screen"]
    LOG_SELF --> LOG_NEXT["printLog dataMapNext next screen"]
    LOG_NEXT --> END(["Return"])
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `seniMode` | `String` | Transition mode flag passed from the caller screen indicating the user's intent: `"1"` = **Re-issue** (再発行, generate a duplicate receipt), `"2"` = **Update** (更新, modify existing notification details), `"3"` = **Inquiry** (照会, view-only detail). This determines the completion-screen destination (KKW14904 for re-issue/update, KKW14902 for inquiry). |
| - | `bean` (derived) | `X31SDataBeanAccess` | Service Form Bean obtained from the superclass. Used to access the list data, selected row index, and common information. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JCCWebCommon.setScreenInfo` | JCCWebCommon | - | Sets self-screen inheritance info (KKW14901) with `dataMapMe` |
| - | `JCCWebCommon.setScreenInfo` | JCCWebCommon | - | Sets next-screen inheritance info (KKW14902) with `dataMapNext` |
| R | `OneStopDataBeanAccessArray.getDataBean` | OneStopDataBeanAccessArray | - | Retrieves the list of banpo-nashi number advance notifications |
| R | `OneStopDataBeanAccess.getDataBeanArray` | OneStopDataBeanAccess | - | Returns a single selected row from the list by index |
| R | `OneStopDataBeanAccess.sendMessageString` | OneStopDataBeanAccess | - | Extracts the kanuoreso_hakko_no_02 (receipt issuance number) value from the selected row |
| - | `KKW01101SFLogic.setScreenId` | KKW01101SFLogic | - | Calls `setScreenId` in `KKW01101SFLogic` |
| - | `KKW05001SFLogic.setScreenId` | KKW05001SFLogic | - | Calls `setScreenId` in `KKW05001SFLogic` |
| R | `KKW14901SFLogic.getMyHktgiInfo` | KKW14901SFLogic | - | Retrieves my-hykaku info (自画面用引継情報 - self-screen inheritance info) as a HashMap |
| R | `KKW14901SFLogic.getTchiListSelectIndex` | KKW14901SFLogic | - | Gets the selected row index from the list data |
| - | `KKW14901SFLogic.printLog` | KKW14901SFLogic | - | Logs dataMapMe (self-screen) and dataMapNext (next-screen) at DEBUG level |
| R | `FUW09905SFLogic.getDataBean` | FUW09905SFLogic | - | Calls `getDataBean` in `FUW09905SFLogic` |
| R | `FUSV0277_FUSV0277OPDBMapper.getDataBean` | FUSV0277_FUSV0277OPDBMapper | - | Calls `getDataBean` in `FUSV0277_FUSV0277OPDBMapper` |
| R | `FUW00162SFLogic.getDataBean` | FUW00162SFLogic | - | Calls `getDataBean` in `FUW00162SFLogic` |
| - | `JCCWebCommon.setScreenId` | JCCWebCommon | - | Sets the previous and next screen IDs for inheritance. Default: prev=KKW14902, next=KKW14901. Overridden to prev=KKW14904 when mode is re-issue or update. |
| - | `X31SDataBeanAccess.sendMessageString` | OneStopDataBeanAccess | - | Sets NEXT_SCREEN_ID on the common info bean to KKW14902 |

**Classification notes:** This method performs **zero database CRUD operations**. All calls are screen metadata setup (SET), bean data extraction (R), and logging. The SC Codes are infrastructure/utility components (JCCWebCommon, OneStopDataBeanAccess, KKW01101SFLogic, etc.) used for screen state management, not data persistence.

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 3 methods.
Terminal operations from this method: `printLog` [-], `printLog` [-], `sendMessageString` [-], `sendMessageString` [-], `setScreenId` [-], `setScreenId` [-], `setScreenId` [-], `setScreenId` [-], `setScreenId` [-], `setScreenId` [-], `setScreenId` [-], `setScreenId` [-], `setScreenId` [-], `setScreenId` [-], `setScreenInfo` [-], `setScreenInfo` [-], `setScreenInfo` [-], `setScreenInfo` [-], `setScreenInfo` [-], `setScreenInfo` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `KKW14901SFLogic.actionReHakkoCopy` | `actionReHakkoCopy` -> `setParamAndSeniKKW14902("1")` | `setScreenInfo [-]`, `setScreenId [-]`, `printLog [-]`, `sendMessageString [-]` |
| 2 | `KKW14901SFLogic.actionShokaiDtl` | `actionShokaiDtl` -> `setParamAndSeniKKW14902("3")` | `setScreenInfo [-]`, `setScreenId [-]`, `printLog [-]`, `sendMessageString [-]` |
| 3 | `KKW14901SFLogic.actionUpdDtl` | `actionUpdDtl` -> `setParamAndSeniKKW14902("2")` | `setScreenInfo [-]`, `setScreenId [-]`, `printLog [-]`, `sendMessageString [-]` |

**Notes:** All three callers reside in the same logic class (`KKW14901SFLogic`). There are no external screen (KKSV*) or batch entry points in the call graph. This method is exclusively invoked as an internal bridge from the list-screen action methods.

## 6. Per-Branch Detail Blocks

**Block 1** — [PROCESS] Extract data from service form bean (L763)

> Obtain the service form bean and retrieve the list of banpo-nashi (no postal code) number advance notifications, then select the row matching the user's selection index, and extract the receipt issuance number from that row.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `bean = super.getServiceFormBean()` // Get ServiceFormBean |
| 2 | CALL | `datalist = bean.getDataBeanArray(KKW14901SFConst.BMPNONNOPRETCHI_LIST)` // [-> BMPNONNOPRETCHI_LIST="番ポなし番号事前通知一覧"] Get notification list |
| 3 | CALL | `dataBean = datalist.getDataBean(getTchiListSelectIndex(bean))` // Get selected row |
| 4 | CALL | `kanuoreso_no = dataBean.sendMessageString(KKW14901SFConst.KANUORESO_HAKKO_NO_02, X31CWebConst.DATABEAN_GET_VALUE)` // [-> KANUORESO_HAKKO_NO_02="加入御礼書発行番号"] Extract receipt issuance number |

**Block 2** — [PROCESS] Create self-screen inheritance info (L769)

> Build the HashMap of inheritance data for the current (self) screen by delegating to `getMyHktgiInfo`.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `dataMapMe = getMyHktgiInfo(bean)` // Self-screen inheritance info |

**Block 3** — [PROCESS] Create next-screen inheritance info (L772-L773)

> Initialize a new HashMap for the next screen and populate it with the transition mode and receipt issuance number.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMapNext = new HashMap<String, Object>()` |
| 2 | SET | `dataMapNext.put(KKW14902SFConst.SENI_MODE, seniMode)` // [-> SENI_MODE="遷移モード"] |
| 3 | SET | `dataMapNext.put(KKW14902SFConst.KANUORESO_HAKKO_NO, kanuoreso_no)` // [-> KANUORESO_HAKKO_NO="加入御礼書発行番号"] |

**Block 4** — [PROCESS] Set self-screen info (L776)

> Configure the self-screen (KKW14901) inheritance info on the business logic instance.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JCCWebCommon.setScreenInfo(this, JKKScreenConst.SCREEN_ID_KKW14901, dataMapMe)` // [-> SCREEN_ID_KKW14901="KKW14901"] |

**Block 5** — [PROCESS] Set next-screen info (L779)

> Configure the next-screen (KKW14902) inheritance info on the business logic instance.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JCCWebCommon.setScreenInfo(this, JKKScreenConst.SCREEN_ID_KKW14902, dataMapNext)` // [-> SCREEN_ID_KKW14902="KKW14902"] |

**Block 6** — [PROCESS] Set default screen IDs (L782)

> Set the default screen inheritance IDs: prev=KKW14902, current=KKW14901.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JCCWebCommon.setScreenId(this, JKKScreenConst.SCREEN_ID_KKW14902, JKKScreenConst.SCREEN_ID_KKW14901)` |

**Block 7** — [IF-ELSE-IF] Conditional screen ID override (L783-L787)

> If the transition mode is re-issue ("1") or update ("2"), override the prev screen ID from KKW14902 to KKW14904 (detail update completion screen). For inquiry mode ("3"), this block is skipped and KKW14902 remains.

| # | Type | Code |
|---|------|------|
| 1 | SET | `KKW14902SFLogic.SENI_MODE_REHAKKO.equals(seniMode)` // [-> SENI_MODE_REHAKKO="1" (再発行/Re-issue)] |
| 2 | SET | `KKW14902SFLogic.SENI_MODE_UPD.equals(seniMode)` // [-> SENI_MODE_UPD="2" (更新/Update)] |
| 3 | EXEC | (OR condition — either branch matches) |
| 4 | CALL | `JCCWebCommon.setScreenId(this, JKKScreenConst.SCREEN_ID_KKW14904, JKKScreenConst.SCREEN_ID_KKW14901)` // [-> SCREEN_ID_KKW14904="KKW14904"] Override prev screen to completion |

**Block 8** — [PROCESS] Get common form bean (L790)

> Retrieve the shared/common form bean for cross-screen communication.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `commoninfoBean = super.getCommonInfoBean()` |

**Block 9** — [PROCESS] Set next-screen ID on common form (L793-L795)

> Write the next screen ID into the common info bean so the rendering framework knows which screen to display after this transition.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `commoninfoBean.sendMessageString(CommonInfoCFConst.NEXT_SCREEN_ID, X31CWebConst.DATABEAN_SET_VALUE, JKKScreenConst.SCREEN_ID_KKW14902)` // [-> NEXT_SCREEN_ID="遷移先画面ID"] |

**Block 10** — [PROCESS] Log inheritance data (L798-L799)

> Output debug logs of both the self-screen and next-screen inheritance information for audit trail.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `printLog(JSYwebLog.DEBUG, dataMapMe, "自画面への引継情報")` // Log self-screen inheritance data |
| 2 | CALL | `printLog(JSYwebLog.DEBUG, dataMapNext, "次画面への引継情報")` // Log next-screen inheritance data |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `seniMode` | Field | Transition mode — indicates which screen transition path to take: "1"=Re-issue, "2"=Update, "3"=Inquiry |
| `kanuoreso_no` | Field | Receipt issuance number — the unique identifier for a receipt (加入御礼書) that was generated for the notification |
| `BMPNONNOPRETCHI_LIST` | Constant | Banpo-nashi Number Advance Notification List — the session key for the list data of notifications where postal codes are missing |
| `KANUORESO_HAKKO_NO_02` | Constant | Receipt Issuance Number — the data bean key used to extract the receipt number from a selected row |
| `SENIM_MODE` | Constant | Transition mode key — the map key used to store/retrieve the mode flag across screens |
| `SENI_MODE_REHAKKO` | Constant | Value `"1"` — Re-issue mode (再発行). Triggers duplication of a previously issued receipt. Completes on screen KKW14904. |
| `SENI_MODE_UPD` | Constant | Value `"2"` — Update mode (更新). Triggers modification of existing notification details. Completes on screen KKW14904. |
| `SENI_MODE_SHOKAI` | Constant | Value `"3"` — Inquiry mode (照会). Triggers read-only viewing of notification details. Completes on screen KKW14902. |
| `SCREEN_ID_KKW14901` | Constant | Banpo-nashi Number Advance Notification List Inquiry Screen — the list screen where users view and select entries |
| `SCREEN_ID_KKW14902` | Constant | Banpo-nashi Number Advance Notification Detail Update/Inquiry Screen — the detail screen for viewing and editing entries |
| `SCREEN_ID_KKW14904` | Constant | Banpo-nashi Number Advance Notification Detail Update Completion Screen — the confirmation screen shown after a re-issue or update operation completes |
| `NEXT_SCREEN_ID` | Constant | Next Screen ID — the common form key that tells the framework which screen to display next |
| `getMyHktgiInfo` | Method | Get My Inheritance Info — retrieves the HashMap of data to pass back to the self-screen (KKW14901) after returning from the detail screen |
| `getTchiListSelectIndex` | Method | Get Territory/Item List Select Index — retrieves the index of the currently selected row in the notification list |
| `dataMapMe` | Variable | Self-screen inheritance data map — contains data to restore on the calling screen (KKW14901) when control returns |
| `dataMapNext` | Variable | Next-screen inheritance data map — contains data to pass to the target screen (KKW14902 or KKW14904) |
| JCCWebCommon | Class | Web Common Utility — shared screen state management component providing setScreenInfo, setScreenId |
| X31SDataBeanAccess | Class | Service Data Bean Access — base class for accessing service form data beans |
| X31SDataBeanAccessArray | Class | Array wrapper for data bean access — provides list-level operations |
| Banpo-nashi (番ポなし) | Business term | "Banpo" = Ban-gō (番地/Block number) + "nashi" (なし/without). Refers to records where the subscriber's address lacks a proper block number (postal code). A special-handling category in Japanese telecom address data. |
| Re-issue (再発行) | Business term | Generating a duplicate receipt for a previously issued banpo-nashi notification. Used when the original receipt is lost or needs reprinting. |
| Update (更新) | Business term | Modifying the details of an existing banpo-nashi advance notification (e.g., correcting address, contact info). |
| Inquiry (照会) | Business term | Read-only view of a banpo-nashi advance notification's details. No modifications are made. |
| Receipt (加入御礼書) | Business term | A confirmation letter/receipt sent to subscribers notifying them of a service registration or change. |
