# Business Logic — DKW01302SFLogic.showCountDetail() [52 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.DKW01302SF.DKW01302SFLogic` |
| Layer | Web (Controller/Logic — under `eo.web.webview` package) |
| Module | `DKW01302SF` (Package: `eo.web.webview.DKW01302SF`) |

## 1. Role

### DKW01302SFLogic.showCountDetail()

This method implements the **Quantity Detail Display** business operation within the shelf move (stock transfer) workflow. Its purpose is to allow an operator to select a specific row from the **Shelf Move Load Detail Inquiry** list (the `shosai_list` data table) and navigate to a **Quantity Specification Detail** screen (`DKW01406`) where they can specify or confirm quantities for that particular line item.

The method follows the **Screen Navigation / Routing Pattern** used throughout the K-Opticom web framework. It extracts the selected row index from the current page's data bean (via `ROW_NO` — "行番号" / Row Number), fetches the corresponding data bean from the `SHOSAI_LIST` (「移動読込詳細一覧照会明細リスト」/ Move Load Detail List Inquiry Detail List), and populates a navigation parameter map with two key pieces of information: (1) the **Spare Equipment Delivery Number** (`YBKIKI_HAISO_NO_01` — "予備機器配送番号") from the selected row, which serves as the key to correlate data across screens, and (2) the **Move Type Classification** (`MV_SBT`) set to `"2"`, which identifies this move as a **Prepared Equipment Delivery** (「予備機器配送」) branch.

The method then configures screen information for both the target screen (`DKW01406`) and the current screen (`DKW01302`), establishing the navigation breadcrumb so the user can return to the original list. Finally, it dispatches to `setNextScreen()` to perform the actual screen transition.

No conditional business branching occurs — this is a **linear entry-point method** that always proceeds through the same path regardless of input values (except for row number parsing, which defaults gracefully to 0 if the value is missing). It acts as the bridge between the shelf move detail list screen and the quantity specification sub-screen.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["showCountDetail()"])
    START --> GET_BEAN["getServiceFormBean()"]
    GET_BEAN --> INIT_MAP["dataMap = new HashMap()"]
    INIT_MAP --> SEND_ROW_NO["sendMessageString(ROW_NO, DATABEAN_GET_VALUE)"]
    SEND_ROW_NO --> CHECK_ROW_NO{rowNo is null ?}
    CHECK_ROW_NO -->|false| PARSE_ROW["intRowNo = Integer.parseInt(rowNo)"]
    CHECK_ROW_NO -->|true| DEFAULT_ROW["intRowNo = 0"]
    PARSE_ROW --> GET_LIST["getDataBeanArray(SHOSAI_LIST)"]
    DEFAULT_ROW --> GET_LIST
    GET_LIST --> GET_DATA_BEAN["shosaiList.getDataBean(intRowNo)"]
    GET_DATA_BEAN --> PUT_SHELF_MV_NO["dataMap.put(KEY_SHELF_MV_NO, YBKIKI_HAISO_NO_01)"]
    PUT_SHELF_MV_NO --> PUT_MV_SBT["dataMap.put(MV_SBT, '2')"]
    PUT_MV_SBT --> SET_SCREEN_INFO_DKW01406["JCCWebCommon.setScreenInfo(this, DKW01406, dataMap)"]
    SET_SCREEN_INFO_DKW01406 --> DEBUG_LOG["X31SWebLog.DEBUG_LOG(dataMap)"]
    DEBUG_LOG --> INIT_RETURN["returnMap = new HashMap()"]
    INIT_RETURN --> PUT_KEY_SHELF["returnMap.put(KEY_SHELF_MOVE_LOT_NO, value)"]
    PUT_KEY_SHELF --> PUT_DISP_SHELF["returnMap.put(DISP_SHELF_MOVE_LOT_NO, value)"]
    PUT_DISP_SHELF --> PUT_ROW_NO_RETURN["returnMap.put(ROW_NO, rowNo)"]
    PUT_ROW_NO_RETURN --> PUT_PAGING_KEY["returnMap.put(PAGING_KEY, YBKIKI_HAISO_NO_01)"]
    PUT_PAGING_KEY --> SET_SCREEN_INFO_DKW01302["JCCWebCommon.setScreenInfo(this, DKW01302, returnMap)"]
    SET_SCREEN_INFO_DKW01302 --> SET_SCREEN_ID["JCCWebCommon.setScreenId(this, DKW01406, DKW01302)"]
    SET_SCREEN_ID --> SET_NEXT["setNextScreen(DKW01406, SCREEN_NAME_DKW01406)"]
    SET_NEXT --> RETURN_TRUE["return true"]
    RETURN_TRUE --> END_NODE(["End"])
```

**CRITICAL — Constant Resolution:**
- `MV_SBT` = "移動種別区分" (Move Type Classification). Value `"2"` is hardcoded, indicating **Prepared Equipment Delivery** (予備機器配送) as the move type.
- `KEY_SHELF_MV_NO` = "KEY_移動番号" (Key Shelf Move Number). Used as the data map key to pass the spare equipment delivery number to the target screen.
- `ROW_NO` = "行番号" (Row Number). The selected row index from the data table UI.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none) | - | This method takes no explicit parameters. All input data is retrieved from the session's service form data bean (`X31SDataBeanAccess`), which holds the current screen's state including the selected row index and the displayed list of shelf move detail records. |

**Instance fields / external state read:**

| Source | Type | Business Description |
|--------|------|---------------------|
| `super.getServiceFormBean()` | `X31SDataBeanAccess` | The service form data bean containing the current screen's session state — including the selected row number (`ROW_NO`), the detail list (`SHOSAI_LIST`), and the shelf move lot number (`KEY_SHELF_MOVE_LOT_NO`). |
| `this` (logical context) | `DKW01302SFLogic` | The business logic class instance, passed to `JCCWebCommon.setScreenInfo()` and `setNextScreen()` to establish screen navigation breadcrumbs. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JDKCommonUtil.isNull` | JDKCommonUtil | - | Null-check utility — validates whether `rowNo` string is empty or null. |
| - | `JCCWebCommon.setScreenInfo` | JCCWebCommon | - | Sets screen navigation metadata (data map, screen IDs) into the business logic context for the target and current screens. |
| - | `JCCWebCommon.setScreenId` | JCCWebCommon | - | Sets the screen ID transition chain (prevScreen → currentScreen) for back-navigation support. |
| R | `X31SDataBeanAccess.sendMessageString` | (Frame) | - | Retrieves a string value from the data bean by field key — used to get `ROW_NO`, `KEY_SHELF_MOVE_LOT_NO`, and `YBKIKI_HAISO_NO_01`. |
| R | `X31SDataBeanAccessArray.getDataBeanArray` | (Frame) | - | Retrieves the full array of data beans from the `SHOSAI_LIST` field (the detail list currently displayed on screen). |
| R | `X31SDataBeanAccessArray.getDataBean` | (Frame) | - | Retrieves a single data bean at a given index from the detail list array — the row the operator selected. |
| - | `DKW01302SFLogic.setNextScreen` | DKW01302SFLogic | - | Internal navigation dispatcher — triggers the screen transition to the target screen (`DKW01406`). |
| - | `X31SWebLog.DEBUG_LOG.debug` | X31SWebLog | - | Debug logging — dumps the navigation data map contents for troubleshooting. |

**CRUD Classification:**
- **Read (R)**: The method only reads from the data bean layer. It does not perform any database CRUD operations (no SC/CBS calls). All data is pulled from the current page's session state.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:DKW01302 (数量読込詳細) | `DKW01302SFLogic.showCountDetail` (direct invocation — e.g., from action handler or button click on the list screen) | `setNextScreen -> DKW01406` (Screen transition, no DB CRUD) |

**Notes on callers:**
- `showCountDetail()` is defined on three similar classes in the codebase (`DKW01102SFLogic`, `DKW01402SFLogic`, `DKW01302SFLogic`), suggesting a shared screen action pattern.
- The method is likely invoked from the **DKW01302 screen** (「移動読込詳細」/ Move Load Detail) when the user clicks a "Quantity Detail" button on a row of the detail list.
- No external caller (CBS, batch, or other screen class) was found referencing `DKW01302SFLogic.showCountDetail` directly — it appears to be invoked solely from the same-screen action dispatcher, consistent with the web framework's screen-action-to-logic method routing.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `(Acquire service form bean)` (L233)

> Retrieves the session-based service form data bean that holds the current page's state.

| # | Type | Code |
|---|------|------|
| 1 | SET | `serviceFormBean = super.getServiceFormBean()` // Get the service form data bean from session |

**Block 2** — [SET] `(Initialize data map for target screen)` (L236)

> Creates a new HashMap to hold the navigation parameters that will be passed to the target screen (`DKW01406`).

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap = new HashMap()` // Navigation parameter container for DKW01406 |

**Block 3** — [IF] `(rowNo is not null — parse row index)` (L239–L241) `[ROW_NO="行番号"]`

> The row number is fetched from the data bean. If it is not null, it is parsed as an integer to identify which row the operator selected. If null, the default `intRowNo = 0` applies (from L235).

| # | Type | Code |
|---|------|------|
| 1 | SET | `rowNo = serviceFormBean.sendMessageString(ROW_NO, DATABEAN_GET_VALUE)` // Get selected row number string [-> ROW_NO="行番号"] |
| 2 | SET | `intRowNo = 0` // Default index |
| 3 | IF | `!JDKCommonUtil.isNull(rowNo)` → parse |
| 4 | SET | `intRowNo = Integer.parseInt(rowNo)` // Convert row number string to int |

**Block 4** — [CALL] `(Fetch detail list and selected row data bean)` (L244–L245)

> Retrieves the full list of detail data beans from the `SHOSAI_LIST` field, then gets the specific row selected by the operator.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `shosaiList = serviceFormBean.getDataBeanArray(SHOSAI_LIST)` // Get detail list array [-> SHOSAI_LIST="移動読込詳細一覧照会明細リスト"] |
| 2 | CALL | `subbean = shosaiList.getDataBean(intRowNo)` // Get selected row data bean |

**Block 5** — [SET] `(Populate target screen dataMap — Spare Equipment Delivery Number)` (L246–L247)

> Puts the spare equipment delivery number from the selected row into the navigation data map. This is the primary key that the target screen (`DKW01406`) will use to load its detail data.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put(KEY_SHELF_MV_NO, subbean.sendMessageString(L_YBKIKI_HAISO_NO_01, DATABEAN_GET_VALUE))` // Map key: KEY_SHELF_MV_NO [-> "KEY_移動番号"], Value: YBKIKI_HAISO_NO_01 [-> "予備機器配送番号"] |

**Block 6** — [SET] `(Populate target screen dataMap — Move Type Classification)` (L250)

> Hardcodes the move type as `"2"`, which identifies this as a **Prepared Equipment Delivery** (予備機器配送) move. The target screen will use this to determine its behavior.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMap.put(MV_SBT, "2")` // Move Type Classification = "2" (Prepared Equipment Delivery) [-> MV_SBT="移動種別区分"] |

**Block 7** — [CALL] `(Set screen info for target screen)` (L253)

> Registers the navigation parameters in the screen context for screen `DKW01406` (Quantity Specification Detail).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JCCWebCommon.setScreenInfo(this, SCREEN_ID_DKW01406, dataMap)` // Register dataMap for DKW01406 [-> SCREEN_ID_DKW01406="DKW01406"] |

**Block 8** — [EXEC] `(Debug log navigation data map)` (L256–L257)

> Logs the navigation data map contents for debugging purposes.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `X31SWebLog.DEBUG_LOG.debug("引継ぎ情報Mapの内容：")` // Log "Contents of continuation info Map:" |
| 2 | EXEC | `X31SWebLog.DEBUG_LOG.debug(dataMap)` // Log the map contents |

**Block 9** — [SET] `(Initialize return map for current screen)` (L260)

> Creates a HashMap to hold information needed when the user returns from the target screen back to the current screen (`DKW01302`).

| # | Type | Code |
|---|------|------|
| 1 | SET | `returnMap = new HashMap()` // Return state map for DKW01302 |

**Block 10** — [SET] `(Populate return map — Shelf Move Lot Number)` (L262–L263)

> Stores the shelf move lot number (both internal key and display key).

| # | Type | Code |
|---|------|------|
| 1 | SET | `returnMap.put(KEY_SHELF_MOVE_LOT_NO, serviceFormBean.sendMessageString(KEY_SHELF_MOVE_LOT_NO, DATABEAN_GET_VALUE))` // Internal key: KEY_SHELF_MOVE_LOT_NO [-> "KEY_移動ロット番号"] |
| 2 | SET | `returnMap.put(DISP_SHELF_MOVE_LOT_NO, serviceFormBean.sendMessageString(KEY_SHELF_MOVE_LOT_NO, DATABEAN_GET_VALUE))` // Display key: DISP_SHELF_MOVE_LOT_NO [-> "移動ロット番号"] |

**Block 11** — [SET] `(Populate return map — Row Number)` (L265–L266)

> Saves the original row number so it can be restored when returning.

| # | Type | Code |
|---|------|------|
| 1 | SET | `returnMap.put(ROW_NO, rowNo)` // Original row number [-> ROW_NO="行番号"] |

**Block 12** — [SET] `(Populate return map — Paging Key)` (L268–L269)

> Uses the spare equipment delivery number as the paging key, enabling the list screen to correctly paginate back to the same position.

| # | Type | Code |
|---|------|------|
| 1 | SET | `returnMap.put(PAGING_KEY, subbean.sendMessageString(L_YBKIKI_HAISO_NO_01, DATABEAN_GET_VALUE))` // Paging key from YBKIKI_HAISO_NO_01 [-> PAGING_KEY="ページングキー"] |

**Block 13** — [CALL] `(Set screen info for current screen)` (L272)

> Registers the return map in the screen context for the current screen (`DKW01302`).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JCCWebCommon.setScreenInfo(this, SCREEN_ID_DKW01302, returnMap)` // Register returnMap for DKW01302 [-> SCREEN_ID_DKW01302="DKW01302"] |

**Block 14** — [CALL] `(Set screen ID transition chain)` (L273)

> Establishes the back-navigation breadcrumb: `DKW01406` (child) -> `DKW01302` (parent).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JCCWebCommon.setScreenId(this, SCREEN_ID_DKW01406, SCREEN_ID_DKW01302)` // Back nav: DKW01406 -> DKW01302 |

**Block 15** — [CALL] `(Dispatch screen transition)` (L276)

> Triggers the actual screen transition to the target screen.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setNextScreen(SCREEN_ID_DKW01406, SCREEN_NAME_DKW01406)` // Navigate to "Quantity Specification Detail" [-> SCREEN_NAME_DKW01406="数量指定詳細"] |

**Block 16** — [RETURN] `(Success)` (L278)

> Returns `true` to indicate successful processing.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true` // Processing complete |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `ROW_NO` | Field | Row Number — the selected row index from the data table UI on the source screen. Used to identify which record the operator clicked. |
| `SHOSAI_LIST` | Field | Move Load Detail List Inquiry Detail List — the data bean array containing the detail records displayed on the shelf move list screen. |
| `MV_SBT` | Field | Move Type Classification — a code that identifies the type of shelf move. Value `"2"` corresponds to Prepared Equipment Delivery (予備機器配送). |
| `KEY_SHELF_MV_NO` | Field | Key Shelf Move Number — the internal data map key used to pass the spare equipment delivery number to the target screen. |
| `KEY_SHELF_MOVE_LOT_NO` | Field | Key Shelf Move Lot Number — internal key for the shelf move lot number, used to correlate data across screens. |
| `DISP_SHELF_MOVE_LOT_NO` | Field | Shelf Move Lot Number (Display) — display-only key for the shelf move lot number. |
| `PAGING_KEY` | Field | Paging Key — used to maintain pagination position when the user returns from a sub-screen. |
| `YBKIKI_HAISO_NO_01` | Field | Spare Equipment Delivery Number — the delivery/tracking number for prepared spare equipment. Used as a correlation key between the list screen and the quantity specification screen. |
| `DKW01302` | Screen ID | 「移動読込詳細」/ Move Load Detail screen — the main shelf move detail list screen. |
| `DKW01406` | Screen ID | 「数量指定詳細」/ Quantity Specification Detail screen — the sub-screen where the operator specifies/confirm quantities for a selected detail line item. |
| `SCREEN_NAME_DKW01406` | Constant | "数量指定詳細" — the display name of the target screen. |
| `SCREEN_NAME_DKW01302` | Constant | "移動読込詳細" — the display name of the current screen. |
| `SERVICE_FORM_BEAN` | Concept | Service Form Data Bean — the session-held data bean (`X31SDataBeanAccess`) that carries the current screen's state between method calls. |
| `DATA_BEAN_ARRAY` | Concept | Data Bean Array — a list of data bean objects (`X31SDataBeanAccessArray`) representing the rows of a data table on the screen. |
| `DATABEAN_GET_VALUE` | Constant | `X31CWebConst.DATABEAN_GET_VALUE` — the operation code used to retrieve a value from a data bean field. |
| Prepared Equipment Delivery (予備機器配送) | Business term | A category of shelf move where spare/prepared equipment is delivered. Identified by move type classification code `"2"`. |
| Shelf Move (移動) | Business term | Stock transfer or shelf relocation operation — the overall business process this module supports. |
| `JDKCommonUtil.isNull` | Utility | Null-check utility method that determines whether a string is null or empty. |
| `JCCWebCommon.setScreenInfo` | Utility | Sets navigation metadata (data maps, screen IDs) into the business logic context. Part of the screen transition framework. |
| `JCCWebCommon.setScreenId` | Utility | Sets the screen ID transition chain for back-navigation breadcrumbs. |
| `setNextScreen` | Internal Method | Internal navigation dispatcher that triggers the actual screen transition to the specified target screen. |
| `X31SWebLog` | Framework | Web framework debug logging infrastructure used for tracing screen transitions and data map contents. |
