# Business Logic — DKW01302SFLogic.putServiceDKSV0105() [68 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.DKW01302SF.DKW01302SFLogic` |
| Layer | Controller (Web presentation layer logic within `eo.web.webview`) |
| Module | `DKW01302SF` (Package: `eo.web.webview.DKW01302SF`) |

## 1. Role

### DKW01302SFLogic.putServiceDKSV0105()

This method orchestrates the retrieval and display of service transfer load detail data for the DKSV0105 service screen. It performs a three-stage data preparation flow: first, it populates the service mapper with transfer basic info (段移動基本情報) and transfer load detail info (段移動入荷詳細情報) — including an all-items variant (全件) — by setting up the appropriate SC (Service Component) parameters with fixed function codes. Second, it invokes the backend service via `invokeService` to fetch the actual data. Third, upon successful retrieval, it pulls the results back into the form bean and applies pagination context for screen rendering. The method serves as the shared data-fetching engine called by multiple screen actions (`confirmCreate`, `fix`, `init`, `pagingCommon`) on the transfer load detail screen (段移動入荷詳細画面), meaning it is the single point of data acquisition for this UI module. When the `transBack` flag is true (indicating navigation back from a confirmation screen), the method includes additional logic to reassign the row number and reset pagination if the current page would be empty, ensuring the user sees a valid list view upon return.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["putServiceDKSV0105(sFormBean, screenId, transBack)"])
    STEP1["Generate paramMap with USECASE_ID = DKSV0105"]
    STEP2["Create mapper and dataMap"]
    STEP3["Call setDKSV010501SC - Transfer basic info (FUNC_CD_1 = 1)"]
    STEP4["Call setDKSV010502SC - Transfer load details (FUNC_CD_1 = 1)"]
    STEP5["Call setDKSV010503SC - Transfer load details all items (FUNC_CD_2 = 2)"]
    STEP6["upmapperPageLinkInfo - set page context for DKSV010502SC"]
    STEP7["Call invokeService(paramMap, dataMap, outputMap)"]
    STEP8["Retrieve EDK0111B028CBSMsg1List count"]
    COND1{"cnt == 0?"}
    RETURN_FALSE["Return false (no data retrieved)"]
    STEP9["Call getDKSV010501SC - read back basic info"]
    STEP10["Call getDKSV010502SC - read back load details"]
    STEP11["Call getDKSV010503SC - read back all-item details"]
    STEP12["downmapperPageLinkInfo - push page context to outputMap"]
    COND2{"transBack == true?"}
    STEP13["Retrieve display_no from outputMap"]
    COND3{"displayNo is not null?"}
    STEP14["Set ROW_NO via sendMessageString on serviceFormBean"]
    STEP15["Retrieve display_page_num from outputMap"]
    COND4{"displayPageNum = 1 AND displayNo = 0?"}
    STEP16["clearPageLinkInfo - reset pagination"]
    STEP17["upmapperPageLinkInfo with dataMap"]
    STEP18["downmapperPageLinkInfo with outputMap"]
    STEP19["Return true (success)"]

    START --> STEP1 --> STEP2 --> STEP3 --> STEP4 --> STEP5 --> STEP6 --> STEP7 --> STEP8 --> COND1
    COND1 -- "Yes" --> RETURN_FALSE
    COND1 -- "No" --> STEP9 --> STEP10 --> STEP11 --> STEP12 --> COND2
    COND2 -- "No" --> STEP19
    COND2 -- "Yes" --> STEP13 --> COND3
    COND3 -- "No" --> STEP19
    COND3 -- "Yes" --> STEP15 --> COND4
    COND4 -- "Yes" --> STEP16 --> STEP17 --> STEP18 --> STEP19
    COND4 -- "No" --> STEP19
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `sFormBean` | `X31SDataBeanAccess` | The form data bean carrying the screen's input/output state for the DKSV0105 transfer load detail screen. It is wrapped into a `paramBean` array and used both to populate the mapper (via `setDKSV0105*SC` methods) and to receive retrieved results (via `getDKSV0105*SC` methods). When `transBack` is true, it is also accessed via `super.getServiceFormBean()` to set the row number (`ROW_NO`) so the UI can highlight the correct list item upon return from a confirmation screen. |
| 2 | `screenId` | `String` | The identifier of the calling screen. Used to scope page link information (`upmapperPageLinkInfo`, `downmapperPageLinkInfo`, `clearPageLinkInfo`) so that pagination context is correctly mapped to and from this specific screen. |
| 3 | `transBack` | `boolean` | Navigation mode flag. `true` indicates the call originates from a confirmation screen return (確認画面戻るボタン押下による遷移), triggering additional row-number and pagination reassignment logic. `false` indicates a standard entry (以外), where only basic data fetch and pagination setup are performed. |

**Instance fields / external state used:**
| Source | Description |
|--------|-------------|
| `super.getServiceFormBean()` | Inherits the service-level form bean from `JCCWebBusinessLogic` parent class, used to set the display row number when `transBack` is true. |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JACBatCommon.isNull` | - | - | Utility null check (never referenced in this method's body) |
| - | `JACbatRknBusinessUtil.isNull` | - | - | Utility null check (never referenced in this method's body) |
| - | `JCCBatCommon.invokeService` | - | - | Generic service invoker (never referenced in this method's body) |
| - | `JCHbatSeikyKaknoBusinessUtil.isNull` | - | - | Utility null check (never referenced in this method's body) |
| - | `JBSbatACInsentetivePrcInfoSaksei.isNull` | - | - | Utility null check (never referenced in this method's body) |
| - | `JBSbatAKCHSeikyYsoInfMake.isNull` | - | - | Utility null check (never referenced in this method's body) |
| - | `JBSBatKKCrsChgIktAdd.invokeService` | - | - | Generic service invoker (never referenced in this method's body) |
| - | `JBSbatKKCrsChgSmtVLAdd.invokeService` | - | - | Generic service invoker (never referenced in this method's body) |
| - | `JBSbatKKCrsChgWribSette.invokeService` | - | - | Generic service invoker (never referenced in this method's body) |
| - | `JBSbatKKEponSwchKjInfSksi.invokeService` | - | - | Generic service invoker (never referenced in this method's body) |
| - | `JCCWebCommon.clearPageLinkInfo` | - | - | Clears page link pagination info for the given screen (L650) |
| - | `JCCWebCommon.downmapperPageLinkInfo` | - | - | Maps page link context from dataMap to outputMap for display (L613, L635, L652) |
| - | `JCCWebCommon.upmapperPageLinkInfo` | - | - | Maps page link context from outputMap to dataMap for setup (L613, L651) |
| - | `OneStopDataBeanAccess.sendMessageString` | - | - | Sets a field value on the form bean (L644) |
| R | `DKSV0105_DKSV0105OPDBMapper.setDKSV010501SC` | DKSV0105 | - | Prepares/sets up basic transfer info parameters for SC invocation (L607) |
| R | `DKSV0105_DKSV0105OPDBMapper.setDKSV010502SC` | DKSV0105 | - | Prepares/sets up transfer load detail parameters for SC invocation (L609) |
| R | `DKSV0105_DKSV0105OPDBMapper.setDKSV010503SC` | DKSV0105 | - | Prepares/sets up transfer load detail (all items) parameters for SC invocation (L611) |
| C | `DKSV0105_DKSV0105OPDBMapper.invokeService` | DKSV0105 | EDK0111B028CBS | Invokes the backend service to fetch transfer load data (L620) |
| R | `DKSV0105_DKSV0105OPDBMapper.getDKSV010501SC` | DKSV0105 | - | Reads back basic transfer info results into paramBean (L630) |
| R | `DKSV0105_DKSV0105OPDBMapper.getDKSV010502SC` | DKSV0105 | - | Reads back transfer load detail results into paramBean (L631) |
| R | `DKSV0105_DKSV0105OPDBMapper.getDKSV010503SC` | DKSV0105 | - | Reads back all-item transfer load detail results into paramBean (L632) |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Class: DKW01302SFLogic.confirmCreate | `confirmCreate` → `putServiceDKSV0105` | `invokeService [C] EDK0111B028CBS`, `getDKSV010501SC [R]`, `getDKSV010502SC [R]`, `getDKSV010503SC [R]` |
| 2 | Class: DKW01302SFLogic.fix | `fix` → `putServiceDKSV0105` | `invokeService [C] EDK0111B028CBS`, `getDKSV010501SC [R]`, `getDKSV010502SC [R]`, `getDKSV010503SC [R]` |
| 3 | Class: DKW01302SFLogic.init | `init` → `putServiceDKSV0105` | `invokeService [C] EDK0111B028CBS`, `getDKSV010501SC [R]`, `getDKSV010502SC [R]`, `getDKSV010503SC [R]` |
| 4 | Class: DKW01302SFLogic.pagingCommon | `pagingCommon` → `putServiceDKSV0105` | `invokeService [C] EDK0111B028CBS`, `getDKSV010501SC [R]`, `getDKSV010502SC [R]`, `getDKSV010503SC [R]` |

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] `paramBean` array initialization (L597)

> Wraps the form bean into a single-element array for passing to mapper methods.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramBean = {sFormBean}` // Form bean wrapped for mapper parameter |

**Block 2** — [SET] `paramMap` generation (L599-600)

> Creates a HashMap for use case ID tracking. TELEGRAM_INFO_USECASE_ID maps the call to the DKSV0105 use case.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramMap = new HashMap<String, String>()` // New HashMap for paramMap |
| 2 | SET | `paramMap.put(TELEGRAM_INFO_USECASE_ID, "DKSV0105")` // [-> X31CWebConst.TELEGRAM_INFO_USECASE_ID, maps to use case "DKSV0105"] |

**Block 3** — [SET] Mapper and dataMap creation (L602-604)

> Instantiates the DKSV0105 database operation mapper and a fresh dataMap for parameter passing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `mapper = new DKSV0105_DKSV0105OPDBMapper()` // Mapper instance for SC calls |
| 2 | SET | `dataMap = new HashMap<String, String>()` // Data map for SC parameters |

**Block 4** — [CALL] Data preparation — setDKSV010501SC (L607)

> Prepares basic transfer info parameters (段移動基本情報). Uses FUNC_CD_1 = "1" (fixed value).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.setDKSV010501SC(paramBean, dataMap, FUNC_CD_1)` // [-> FUNC_CD_1="1"] |

**Block 5** — [CALL] Data preparation — setDKSV010502SC (L609)

> Prepares transfer load detail parameters (段移動入荷詳細情報). Uses FUNC_CD_1 = "1" (fixed value).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.setDKSV010502SC(paramBean, dataMap, FUNC_CD_1)` // [-> FUNC_CD_1="1"] |

**Block 6** — [CALL] Data preparation — setDKSV010503SC (L611)

> Prepares transfer load detail parameters for all items (段移動入荷詳細情報（全件）). Uses FUNC_CD_2 = "2" (fixed value).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.setDKSV010503SC(paramBean, dataMap, FUNC_CD_2)` // [-> FUNC_CD_2="2"] |

**Block 7** — [CALL] Page context setup (L613-614)

> Sets up page link pagination info by mapping current context into dataMap for the DKSV010502SC component.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JCCWebCommon.upmapperPageLinkInfo(this, "DKSV010502SC", dataMap, screenId)` // Set page link context |

**Block 8** — [SET] outputMap initialization (L617)

> Creates an empty HashMap to receive service invocation results.

| # | Type | Code |
|---|------|------|
| 1 | SET | `outputMap = new HashMap()` // HashMap for SC output data |

**Block 9** — [CALL] Service invocation (L620)

> Invokes the backend service with paramMap, dataMap, and outputMap. This triggers the actual database query through the SC layer, retrieving transfer load data.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `invokeService(paramMap, dataMap, outputMap)` // Invoke backend service |

**Block 10** — [SET] Data count check (L623-624)

> Extracts the EDK0111B028CBSMsg1List from outputMap and checks if any records were returned. This list contains the basic transfer info results from the backend.

| # | Type | Code |
|---|------|------|
| 1 | SET | `map = (HashMap<String, Object>) outputMap.get("DKSV010501SC")` // Cast outputMap entry |
| 2 | SET | `cnt = ((ArrayList) map.get("EDK0111B028CBSMsg1List")).size()` // Count returned records |

**Block 11** — [IF] Empty data check (L625-628)

> If no records were returned, return false to signal that the service data could not be retrieved.

| # | Type | Code |
|---|------|------|
| 1 | IF | `cnt == 0` // Check for empty result set |

**Block 11.1** — [ELSE] Return false (L627-628)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return false` // No data retrieved |

**Block 12** — [CALL] Data retrieval — getDKSV0105*SC (L630-632)

> After confirming data exists, call the getter methods on the mapper to populate the paramBean with the retrieved results.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `mapper.getDKSV010501SC(paramBean, outputMap)` // Read back basic info |
| 2 | CALL | `mapper.getDKSV010502SC(paramBean, outputMap)` // Read back load details |
| 3 | CALL | `mapper.getDKSV010503SC(paramBean, outputMap)` // Read back all-item details |

**Block 13** — [CALL] Page context setup (L634-635)

> Pushes the pagination context from outputMap into the dataMap via downmapper, then sets page link info for the screen.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JCCWebCommon.downmapperPageLinkInfo(this, "DKSV010502SC", outputMap, screenId)` // Set page link info |

**Block 14** — [IF] transBack conditional (L638-654)

> When called from a confirmation screen return, this block reassigns the row number and handles pagination reset if needed.

| # | Type | Code |
|---|------|------|
| 1 | IF | `transBack` // [-> true: confirmation screen return navigation, false: standard entry] |

**Block 14.1** — [SET] display_no extraction (L640)

> Retrieves the display_no value from the outputMap, which represents the row number to display on the screen.

| # | Type | Code |
|---|------|------|
| 1 | SET | `displayNo = (String) ((HashMap) outputMap.get("DKSV010502SC")).get("display_no")` // Extract display row number |

**Block 14.2** — [IF] displayNo null check (L641-655)

> Only proceed with row number assignment if a display_no was actually returned.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!JDKCommonUtil.isNull(displayNo)` // displayNo is not null |

**Block 14.2.1** — [EXEC] Row number setting (L643-644)

> Gets the service-level form bean and sets the row number field (ROW_NO = "行番号") with the displayNo value. This tells the UI which row to highlight/display.

| # | Type | Code |
|---|------|------|
| 1 | SET | `serviceFormBean = super.getServiceFormBean()` // Get inherited service form bean |
| 2 | EXEC | `serviceFormBean.sendMessageString(ROW_NO, DATABEAN_SET_VALUE, displayNo)` // [-> ROW_NO="行番号", set row number for UI display] |

**Block 14.2.2** — [SET] display_page_num extraction (L646)

> Retrieves the display_page_num from outputMap to determine which page the result is on.

| # | Type | Code |
|---|------|------|
| 1 | SET | `displayPageNum = (String) ((HashMap) outputMap.get("DKSV010502SC")).get("display_page_num")` // Extract display page number |

**Block 14.2.3** — [IF] Pagination reset condition (L647-653)

> If the display is on page 1 AND the row number is 0 (display_no = "0"), it means the data has been cleared. In this case, clear the existing pagination info and rebuild it from the original dataMap.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!JDKCommonUtil.isNull(displayPageNum) && "1".equals(displayPageNum) && "0".equals(displayNo)` // displayPageNum=1 AND displayNo=0 |

**Block 14.2.3.1** — [CALL] Pagination reset (L650-652)

> Clears the stale pagination context and rebuilds it from dataMap (the original pre-invoke parameter state), then re-applies it to the outputMap.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JCCWebCommon.clearPageLinkInfo(this, screenId)` // Clear page link pagination |
| 2 | CALL | `JCCWebCommon.upmapperPageLinkInfo(this, "DKSV010502SC", dataMap, screenId)` // Map page info from dataMap |
| 3 | CALL | `JCCWebCommon.downmapperPageLinkInfo(this, "DKSV010502SC", outputMap, screenId)` // Map page info to outputMap |

**Block 15** — [RETURN] Success (L657)

> The method returns true to indicate the service data was successfully fetched and the form bean was populated.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true` // Service call successful |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `DKSV0105` | Service ID | Service code for transfer load detail screen (段移動入荷詳細画面) — the screen that displays detailed information about service transfer loads |
| `EDK0111B028CBS` | Entity/CBS | Backend entity / corporate business service for transfer load data — the data source queried by the SC layer |
| `段移動基本情報` | Business term | Transfer basic info — fundamental data about a service transfer (e.g., source/destination, transfer type) |
| `段移動入荷詳細情報` | Business term | Transfer load detail info — detailed records of loads associated with a service transfer |
| `段移動入荷詳細情報（全件）` | Business term | Transfer load detail info (all items) — full dataset of transfer load details without pagination filtering |
| `行番号` (ROW_NO) | Field | Row number — the UI row index used to highlight or select a specific record in the list display |
| `display_no` | Field | Display row number — the row number calculated by the service for UI presentation |
| `display_page_num` | Field | Display page number — the pagination page number where the result resides |
| TELEGRAM_INFO_USECASE_ID | Constant | Use case identifier key — maps a method invocation to a specific use case for tracing/logging |
| FUNC_CD_1 = "1" | Constant | Function code 1 — fixed value used for standard transfer info and load detail queries |
| FUNC_CD_2 = "2" | Constant | Function code 2 — fixed value used for all-items (全件) transfer detail queries |
| DATABEAN_SET_VALUE | Constant | Data bean set value marker — indicates a field assignment operation on the form bean |
| `confirmCreate` | Method | Confirmation creation handler — one of the callers that triggers service data fetch |
| `fix` | Method | Fix handler — one of the callers for finalizing/fixing service data |
| `init` | Method | Initialization handler — one of the callers for initial screen data load |
| `pagingCommon` | Method | Common paging handler — one of the callers for pagination-triggered data reloads |
| `transBack` | Parameter | Confirmation screen return flag — true when returning from a confirmation screen (確認画面戻るボタン押下による遷移), false otherwise |
| `invokeService` | Method | Generic service invoker — delegates to the service component layer to execute the actual business logic |
| `upmapperPageLinkInfo` | Method | Maps page link info from output context to dataMap — pushes current pagination state into the parameter map |
| `downmapperPageLinkInfo` | Method | Maps page link info from dataMap to output context — pulls pagination state into the output map for screen display |
| `clearPageLinkInfo` | Method | Clears page link info — removes pagination state for the given screen, used when data has been cleared |
| `JCCWebCommon` | Class | Common web utility class — provides shared web-layer utility methods including pagination and message handling |
| `JDKCommonUtil.isNull` | Method | Null check utility — returns true if the given value is null or empty |
| `JCCWebBusinessLogic` | Class | Parent business logic class — provides the base implementation for web screen business logic including `getServiceFormBean()` |
| `X31SDataBeanAccess` | Class | Data bean access class — the form bean interface used for passing screen data between layers |
| `DKSV0105_DKSV0105OPDBMapper` | Class | Database operation mapper for DKSV0105 — handles parameter setup and result retrieval for SC invocations |
