# Business Logic — JKKKikiIchiranIkkatsuCC.execHaisoUketsuke() [343 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JKKKikiIchiranIkkatsuCC` |
| Layer | CC/Common Component (shared business logic component) |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JKKKikiIchiranIkkatsuCC.execHaisoUketsuke()

This method performs **delivery receipt processing** (配送受付処理), which orchestrates the grouping and creation of delivery records for customer premise equipment (CPE) devices after a service contract change operation. It operates as a central dispatching component within the device listing and batch processing workflow (JKKKikiIchiranIkkatsu).

Specifically, the method executes a **three-phase routing pattern**: (1) it first iterates over pre-update delivery target items (`haisoTgBppinList`) and groups them by a computed delivery key that identifies which deliveries share the same delivery number; (2) it then iterates over post-update device records (`haisoKikiListAf`), applying a series of exclusion filters — skipping hosted equipment, applying KAP (subsidy registration) delivery rules, handling tablet cradle edge cases, filtering by indoor device migration status, and verifying work-order conditions via `isKojiInfoHaisoJyokenJaj`; (3) for each qualifying device, it builds the delivery Map data, groups it by the same delivery key, and appends it to the corresponding group. Finally, it invokes `isExecHaisoUketsuke` for each distinct delivery group, which triggers the actual delivery creation.

The method serves as a **shared utility** called by `isExecHaisoCreate`, functioning as the core grouping-and-routing logic for delivery processing. It handles multiple business scenarios: standard deliveries, KAP subsidy deliveries, cradle-only deliveries, and devices excluded from delivery due to work-order constraints or migration codes. When delivery creation fails for any group, the method returns `false` to signal an error, enabling the caller to roll back or notify the user.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["execHaisoUketsuke params"])

    START --> INIT["Initialize: haisoBunkatsuSouDataMap, haisoCreateList, haisoKikiMap, haisoBunkatsuKey"]

    INIT --> LOOP1["Loop1: iterate haisoTgBppinList"]

    LOOP1 --> L1_GET["Get edk0011b090cbsMsg from list index i"]

    L1_GET --> L1_MAP["Call getHaisoBuppinKikiMap to convert msg to Map"]

    L1_MAP --> L1_KEY["Call getHaisoBunkatsuKey to derive delivery grouping key"]

    L1_KEY --> L1_CK{"haisoBunkatsuSouDataMap contains haisoBunkatsuKey"}

    L1_CK -->|yes| L1_EXIST["Get existing haisoCreateList, append haisoKikiMap"]

    L1_CK -->|no| L1_NEW["Create new haisoBunkatsuMap and haisoCreateList, add map, store in group map"]

    L1_EXIST --> L1_NEXT["i++"]
    L1_NEW --> L1_NEXT
    L1_NEXT --> L1_END["End of Loop1"]

    L1_END --> L2_START["Loop2: iterate haisoKikiListAf"]

    L2_START --> L2_INIT["Get ekk0341a010CBSMsg_af from list index i"]

    L2_INIT --> L2_DELKEY["Call getHaisoBuppinDelKey"]

    L2_DELKEY --> L2_CONTCHK{"haisoNochkList contains haisoNoChkKey"}

    L2_CONTCHK -->|yes| L2_SKIP["Skip delivery creation check"]

    L2_CONTCHK -->|no| L2_SBT["Get kktkSbtCd from msg"]

    L2_SBT --> L2_MOCHI{"Is kktkSbtCd equal TEIKYO_SBT_MOCHIKOMI"}

    L2_MOCHI -->|yes| L2_SKIP_HOST["Continue, skip hosted equipment"]

    L2_MOCHI -->|no| L2_MODEL["Get tkModelCd, call isKapKiki"]

    L2_MODEL --> L2_KAP{"Is it KAP device"}

    L2_KAP -->|yes| L2_KAP_CHK["Get KAP_HAISO_SVC from temporaryData"]

    L2_KAP_CHK --> L2_KAP_NO_DEL{"Is code equal SVC_STAJI_HIS_JOKYO_SKCD_NO"}

    L2_KAP_NO_DEL -->|yes| L2_SKIP_KAP["Continue, no KAP delivery"]

    L2_KAP_NO_DEL -->|no| L2_TAKN

    L2_KAP -->|no| L2_TAKN

    L2_TAKN --> L2_TABLET{"Is TAKNKIKI_SBT_CD equal L1 tablet cradle"}

    L2_TABLET -->|yes| L2_CRADLE_CHK{"kapsCradleList size greater than 0"}

    L2_CRADLE_CHK -->|yes| L2_CRADLE_STATUS{"Is KAP svc status equal SVC_STAJI_HIS_JOKYO_SKCD_NO"}

    L2_CRADLE_STATUS -->|yes| L2_SKIP_CRADLE["Continue, no cradle delivery"]

    L2_CRADLE_STATUS -->|no| L2_IDO

    L2_CRADLE_CHK -->|no| L2_IDO

    L2_TABLET -->|no| L2_IDO

    L2_IDO --> L2_IDO_CHK{"Is tknKikiIdoCd NO_MOVE or PART_TEKKYO"}

    L2_IDO_CHK -->|yes| L2_SKIP_IDO["Continue, skip no-move device"]

    L2_IDO_CHK -->|no| L2_KOJI["Call isKojiInfoHaisoJyokenJaj"]

    L2_KOJI -->|false| L2_SKIP_KOJI["Continue, does not meet work condition"]

    L2_KOJI -->|true| L2_JYOGAI["Get data from jyogaiMap via getHaisoBuppinDelKey"]

    L2_JYOGAI --> L2_FULLMAP["Call getHaisoKikiMap to build delivery Map"]

    L2_FULLMAP --> L2_BK["Call getHaisoBunkatsuKey on haisoKikiMap"]

    L2_BK --> L2_GROUPEXIST{"group map contains haisoBunkatsuKey"}

    L2_GROUPEXIST -->|yes| L2_APPEND["Append haisoKikiMap to existing list"]

    L2_GROUPEXIST -->|no| L2_GROUPNEW["Create new group and store in haisoBunkatsuSouDataMap"]

    L2_APPEND --> L2_NEXT["i++"]
    L2_GROUPNEW --> L2_NEXT

    L2_SKIP --> L2_NEXT
    L2_SKIP_HOST --> L2_NEXT
    L2_SKIP_KAP --> L2_NEXT
    L2_SKIP_CRADLE --> L2_NEXT
    L2_SKIP_IDO --> L2_NEXT
    L2_SKIP_KOJI --> L2_NEXT

    L2_NEXT --> L2_END["End of Loop2"]

    L2_END --> LOOP3["Loop3: iterate haisoBunkatsuSouDataMap keySet"]

    LOOP3 --> L3_GET["Get haisoBunkatsuKey, get bunkatsuHisoMap"]

    L3_GET --> L3_EXEC["Call isExecHaisoUketsuke with bunkatsuHisoMap"]

    L3_EXEC --> L3_FAIL{"Return false"}

    L3_GET --> L3_END["End of Loop3"]

    L3_END --> RET_TRUE["Return true"]

    RET_TRUE --> END(["END"])
    L3_FAIL --> END
```

**Constant Resolution Reference:**

| Constant Name | Resolved Value | Business Meaning |
|---------------|---------------|------------------|
| `TEIKYO_SBT_MOCHIKOMI` | `"03"` | Provision sub-type: hosted equipment (excluded from delivery) |
| `SVC_STAJI_HIS_JOKYO_SKCD_NO` | `"1"` | KAP delivery service start status: no delivery |
| `SVC_STAJI_HIS_JOKYO_SKCD_OK` | `"2"` | KAP delivery service start status: delivery available |
| `TAKNKIKI_SBT_CD_TABLET_CRADLE` | `"L1"` | Indoor device sub-type: tablet cradle |
| `TAKNKIKI_IDO_CD_IDO_NASHI` | `"09"` | Indoor device migration code: no move |
| `TAKNKIKI_IDO_CD_PART_TEKKYO` | `"03"` | Indoor device migration code: partial delivery (temporary loan) |
| `KAP_HAISO_SVC_STA_HIS_JOK_SKCD` | `"svcStaJiHisJokyoSkcd"` | Key in temporaryData for KAP delivery service start status history check code |
| `KAPS_CRADLE_LIST` | `"kapsCradleList"` | Key in temporaryData for KAP cradle list |
| `HAISO_CRE_LIST_KEY` | `"haisoCreateList"` | Key in group map for delivery creation list |
| `HAISO_NO_CHK_KEY` | `"haisoNochkList"` | Key in temporaryData for delivery association check notification list |
| `KOJI_INFO_MAP_KEY` | `"ichiranKojiInfoMap"` | Key in temporaryData for list work information map |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | Database session handle for executing queries during work-order condition checks. Provides persistence context for JDBC/DAO operations invoked by called methods. |
| 2 | `scCall` | `ServiceComponentRequestInvoker` | Service Component invocation bridge. Used to call downstream SC (Service Component) methods such as EDK0011B090 (contract equipment delivery target item list consultation) for data retrieval during device Map building. |
| 3 | `param` | `IRequestParameterReadWrite` | Request parameter object carrying screen input data and temporary state. Used to read `ccMsg` (the delivery processing Map) by `dataMapKey`, and passed through to called methods for screen data propagation. |
| 4 | `dataMapKey` | `String` | Key used to retrieve the primary delivery processing data Map (`ccMsg`) from `param`. Typically identifies the screen-specific data payload for this processing step. |
| 5 | `haisoTgBppinList` | `ArrayList<CAANMsg>` | Pre-update delivery target item list — CAANMsg records representing customer premise equipment items targeted for delivery before any contract changes were applied. Each record contains device details (model code, type codes) that are converted into delivery grouping Maps. Items sharing the same delivery key (derived from device attributes) are grouped under the same delivery number. |
| 6 | `haisoKikiListAf` | `ArrayList<CAANMsg>` | Post-update device list — CAANMsg records representing customer premise equipment after a service contract change. This is the main input set for delivery creation decisions. Each device undergoes filtering (hosted equipment check, KAP subsidy check, cradle check, migration code check, work-order condition check) before being added to a delivery group. |
| 7 | `temporaryData` | `HashMap<String, Object>` | Shared temporary data store passed through the processing chain. Contains the delivery association check notification list (`haisoNochkList`), work information map (`ichiranKojiInfoMap`), KAP delivery status code (`svcStaJiHisJokyoSkcd`), and KAP cradle list (`kapsCradleList`). |
| 8 | `jyogaiMap` | `HashMap<String, Object>` | Exclusion/Skipped delivery data map — contains records of devices whose delivery data should be reused from pre-update records (because they were not modified during the screen edit). A device not present in this map means it was edited and requires fresh data construction from `haisoKikiListAf`. |

**Read instance fields / constants (from same class):**
- `HAISO_CRE_LIST_KEY` — Map key for delivery creation list
- `HAISO_NO_CHK_KEY` — Map key for delivery association check list
- `KOJI_INFO_MAP_KEY` — Map key for work info map
- `TEIKYO_SBT_MOCHIKOMI` — Hosted equipment sub-type code
- `SVC_STAJI_HIS_JOKYO_SKCD_NO` / `SVC_STAJI_HIS_JOKYO_SKCD_OK` — KAP delivery status codes
- `TAKNKIKI_SBT_CD_TABLET_CRADLE` — Tablet cradle indoor device type code
- `TAKNKIKI_IDO_CD_IDO_NASHI` — No-move migration code
- `TAKNKIKI_IDO_CD_PART_TEKKYO` — Partial delivery (temporary loan) migration code
- `KAP_HAISO_SVC_STA_HIS_JOK_SKCD` — KAP delivery service start history check key
- `KAPS_CRADLE_LIST` — KAP cradle list temporary data key

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `getHaisoBuppinKikiMap` | — | — | Reads device info from a CAANMsg record and converts it into a HashMap. Extracts device-level data needed for delivery grouping. |
| R | `getHaisoBunkatsuKey` | — | — | Derives a delivery grouping key string from the device Map. Devices with the same key share a delivery number. |
| R | `getHaisoBuppinDelKey` | — | — | Derives a lookup key for the exclusion data map. Used to find pre-update device records in `jyogaiMap`. |
| R | `getNullToStr` | — | — | Utility method: returns the string value of an object, returning empty string `""` if null. Used for safe string extraction. |
| R | `getHaisoKikiMap` | — | — | Calls EDK0011B090 (Contract Equipment Delivery Target Item List Consultation) CBS to retrieve full device delivery data. Combines pre-update data from `edk0011b090cbsMsg` with post-update data from `ekk0341a010CBSMsg_af` and work info from `ichiranKojiInfoMap`. Invokes service component calls to fetch contract equipment details. |
| R | `isKojiInfoHaisoJyokenJaj` | — | — | Work-order condition judgment: calls SC methods (via `scCall`) to verify whether a device meets the criteria for delivery creation based on work-order information. May query `EKK0341A010CBSMsg1List` related data. |
| R | `isKapKiki` | — | — | Checks whether a device is a KAP (subsidy registration) device by matching the model code against temporary data. Determines if KAP-specific delivery rules apply. |
| - | `isExecHaisoUketsuke` | — | — | Invokes actual delivery creation processing for a single delivery group. Returns `false` if any delivery group creation fails. This is a recursive/sibling call that creates delivery receipts for the grouped items. |
| R | `JESC0101B010TPMA.getString` | — | — | Reads data from JESC0101B010TPMA (screen display data). Called within `getHaisoKikiMap` chain. |
| R | `JESC0101B020TPMA.getString` | — | — | Reads data from JESC0101B020TPMA (screen display data). Called within `getHaisoKikiMap` chain. |
| R | `JBSbatDKNyukaFinAdd.getData` | — | — | Calls `getData` in `JBSbatDKNyukaFinAdd` (batch data entry finalization). Invoked during device Map construction. |
| R | `JBSbatFUCaseFileRnkData.getString` | — | — | Calls `getString` in `JBSbatFUCaseFileRnkData` (file ranking data). |
| R | `JBSbatFUMoveNaviData.getString` | — | — | Calls `getString` in `JBSbatFUMoveNaviData` (move navigation data). |
| R | `JBSbatZMAdDataSet.getString` | — | — | Calls `getString` in `JBSbatZMAdDataSet` (ZM advertising data set). |
| R | `JFUeoTelOpTransferCC.getData` | — | — | Calls `getData` in `JFUeoTelOpTransferCC` (eo telecom operation transfer). |
| R | `JFUTransferCC.getData` | — | — | Calls `getData` in `JFUTransferCC` (data transfer). |
| R | `JFUTransferListToListCC.getData` | — | — | Calls `getData` in `JFUTransferListToListCC` (list-to-list transfer). |
| R | `KKW12701SFLogic.getData` | — | — | Calls `getData` in `KKW12701SFLogic` (screen logic). |
| - | `JBSbatKKCashPostAddMail.keySet` | — | — | Calls `keySet` on `JBSbatKKCashPostAddMail` data. |
| - | `JBSbatKKCashPostChsht.keySet` | — | — | Calls `keySet` on `JBSbatKKCashPostChsht` data. |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Component: `JKKKikiIchiranIkkatsuCC` | `JKKKikiIchiranIkkatsuCC.isExecHaisoCreate` → `JKKKikiIchiranIkkatsuCC.execHaisoUketsuke` | `isExecHaisoUketsuke [-]`, `getHaisoKikiMap [R]`, `isKojiInfoHaisoJyokenJaj [-]`, `keySet [-]`, `getNullToStr [R]`, `getString [R]`, `isKapKiki [-]` |

**Explanation:** The sole direct caller is `isExecHaisoCreate` within the same class (`JKKKikiIchiranIkkatsuCC`). This method is part of the device listing and batch processing workflow — specifically triggered after a service contract change screen has been processed and the system needs to create delivery records for affected equipment. The method does not appear to be directly called by any screen (KKSV*) or batch entry point within 8 hops.

## 6. Per-Branch Detail Blocks

**Block 1** — [INITIALIZATION] (L3731)

Initialize local variables and the delivery grouping master data map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ccMsg = (HashMap) param.getData(dataMapKey)` // Retrieve delivery processing data Map from request parameter |
| 2 | SET | `haisoBunkatsuSouDataMap = new HashMap()` // Master delivery grouping data Map — key: delivery key, value: sub-group map |
| 3 | SET | `haisoBunkatsuMap = null` // Reference to current delivery sub-group Map |
| 4 | SET | `haisoCreateList = null` // List of device Maps for one delivery group |
| 5 | SET | `edk0011b090cbsMsg = null` // Pre-update device record |
| 6 | SET | `haisoKikiMap = null` // Converted device Map |
| 7 | SET | `haisoBunkatsuKey = ""` // Delivery grouping key string |

**Block 2** — [FOR LOOP: Pre-update items grouping] (L3741)

Iterate over pre-update delivery target items and group them by delivery key.

| # | Type | Code |
|---|------|------|
| 1 | SET | `i = 0` (L3741) |
| 2 | CONDITION | `i < haisoTgBppinList.size()` (L3741) |
| 3 | SET | `edk0011b090cbsMsg = haisoTgBppinList.get(i)` (L3743) |
| 4 | CALL | `haisoKikiMap = getHaisoBuppinKikiMap(edk0011b090cbsMsg)` (L3746) // Convert CAANMsg to device Map |
| 5 | CALL | `haisoBunkatsuKey = getHaisoBunkatsuKey(haisoKikiMap)` (L3748) // Derive delivery grouping key |
| 6 | CONDITION | `haisoBunkatsuSouDataMap.containsKey(haisoBunkatsuKey)` (L3750) |

**Block 2.1** — [IF: Key already exists — append to existing group] (L3752)

Delivery data with the same key already exists — append the current device Map to the existing group.

| # | Type | Code |
|---|------|------|
| 1 | SET | `haisoBunkatsuMap = (HashMap) haisoBunkatsuSouDataMap.get(haisoBunkatsuKey)` (L3752) |
| 2 | SET | `haisoCreateList = (ArrayList) haisoBunkatsuMap.get(HAISO_CRE_LIST_KEY)` (L3754) // [-> "haisoCreateList"] |
| 3 | EXEC | `haisoCreateList.add(haisoKikiMap)` (L3756) // Append current device Map |

**Block 2.2** — [ELSE: Key does not exist — create new group] (L3760)

New delivery key — create a new sub-group Map and initialize a new delivery creation list.

| # | Type | Code |
|---|------|------|
| 1 | SET | `haisoBunkatsuMap = new HashMap()` (L3762) |
| 2 | SET | `haisoCreateList = new ArrayList()` (L3764) |
| 3 | EXEC | `haisoCreateList.add(haisoKikiMap)` (L3766) // Add first device Map |
| 4 | EXEC | `haisoBunkatsuMap.put(HAISO_CRE_LIST_KEY, haisoCreateList)` (L3768) // [-> "haisoCreateList"] |
| 5 | EXEC | `haisoBunkatsuSouDataMap.put(haisoBunkatsuKey, haisoBunkatsuMap)` (L3770) // Store new group in master map |

**Block 2.M** — [FOR CONTINUATION] (L3773)

| # | Type | Code |
|---|------|------|
| 1 | SET | `i++` (L3773) |
| 2 | GOTO | Back to Block 2 CONDITION |

**Block 3** — [INITIALIZATION for Loop2: Read screen data and notification list] (L3777)

Read screen-level data needed for post-update device filtering.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kojianknNo = getNullToStr((String) ccMsg.get("kojiak_no"))` (L3781) |
| 2 | SET | `haisoSakseiZumiFlg = getNullToStr((String) ccMsg.get("haiso_saksei_zumi_flg"))` (L3782) |
| 3 | SET | `haisoNochkList = (ArrayList) temporaryData.get(HAISO_NO_CHK_KEY)` (L3784) // [-> "haisoNochkList"] — delivery association check notification list |
| 4 | SET | `ikkiranKojiInfoMap = (HashMap) temporaryData.get(KOJI_INFO_MAP_KEY)` (L3791) // [-> "ichiranKojiInfoMap"] — work info map for condition checks |

**Block 4** — [FOR LOOP: Post-update items processing] (L3793)

Iterate over post-update device records, apply exclusion filters, and group qualifying devices.

| # | Type | Code |
|---|------|------|
| 1 | SET | `i = 0` (L3793) |
| 2 | CONDITION | `i < haisoKikiListAf.size()` (L3793) |
| 3 | SET | `edk0011b090cbsMsg = null` (L3798) |
| 4 | SET | `ekk0341a010CBSMsg_af = haisoKikiListAf.get(i)` (L3800) |
| 5 | CALL | `haisoNoChkKey = getHaisoBuppinDelKey(ekk0341a010CBSMsg_af)` (L3804) |
| 6 | CONDITION | `haisoNochkList.contains(haisoNoChkKey)` (L3805) |

**Block 4.1** — [IF: Already in check list — skip delivery creation check] (L3807)

The device is in the delivery association check notification list. No delivery creation check needed because the device was already processed.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `(empty block) // Skip delivery creation check` (L3809) |

**Block 4.2** — [ELSE: Process device for delivery eligibility] (L3811)

The device is NOT in the check list. Evaluate whether it should be included in delivery processing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktkSbtCd = ekk0341a010CBSMsg_af.getString(EKK0341A010CBSMsg1List.KKTK_SBT_CD)` (L3815) |
| 2 | CONDITION | `TEIKYO_SBT_MOCHIKOMI.equals(kktkSbtCd)` — [TEIKYO_SBT_MOCHIKOMI = "03" (Hosted Equipment)] (L3817) |

**Block 4.2.1** — [IF: Hosted equipment — skip] (L3819)

The device is hosted equipment (provided by the operator). It should be excluded from delivery processing.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `continue` (L3821) |

**Block 4.2.2** — [ELSE: Check KAP (subsidy registration) device status] (L3823)

The device is not hosted. Check if it is a KAP (subsidy registration) device.

| # | Type | Code |
|---|------|------|
| 1 | SET | `tkModelCd = getNullToStr((String) ekk0341a010CBSMsg_af.getString("taknkiki_model_cd"))` (L3825) |
| 2 | CALL | `isKapKiki(temporaryData, tkModelCd)` (L3826) |
| 3 | CONDITION | `isKapKiki` returns true — [KAP device check: Is this a subsidy registration device?] |

**Block 4.2.2.1** — [IF: KAP device — check KAP delivery status] (L3828)

This is a KAP (subsidy registration) device. Check if KAP delivery should be performed.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcStaJiHisJokyoSkcd = (String) temporaryData.get(KAP_HAISO_SVC_STA_HIS_JOK_SKCD)` (L3829) // [-> "svcStaJiHisJokyoSkcd"] |
| 2 | CONDITION | `SVC_STAJI_HIS_JOKYO_SKCD_NO.equals(svcStaJiHisJokyoSkcd)` — [SVC_STAJI_HIS_JOKYO_SKCD_NO = "1" (No Delivery)] (L3831) |

**Block 4.2.2.1.1** — [IF: KAP no delivery — skip] (L3833)

The KAP delivery service start status is "no delivery". Skip this device.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `continue` (L3835) |

**Block 4.2.2.2** — [ELSE: KAP device with delivery — check device sub-type] (L3839)

KAP device that has delivery. Check if it is a tablet cradle device.

| # | Type | Code |
|---|------|------|
| 1 | SET | `takn_sbc_cd_cre = ekk0341a010CBSMsg_af.getString(EKK0341A010CBSMsg1List.TAKNKIKI_SBT_CD)` (L3842) |
| 2 | CONDITION | `TAKNKIKI_SBT_CD_TABLET_CRADLE.equals(takn_sbc_cd_cre)` — [TAKNKIKI_SBT_CD_TABLET_CRADLE = "L1" (Tablet Cradle)] (L3845) |

**Block 4.2.2.2.1** — [IF: Tablet cradle — check cradle list and delivery status] (L3848)

This is a tablet cradle device. Check if there are cradle items and whether delivery should proceed.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kapsCradleList = (ArrayList) temporaryData.get(KAPS_CRADLE_LIST)` (L3850) // [-> "kapsCradleList"] |
| 2 | CONDITION | `0 < kapsCradleList.size()` (L3852) |

**Block 4.2.2.2.1.1** — [IF: Cradle list has items — check delivery status] (L3854)

There are cradle items in the list. Check the KAP delivery status.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcStaJiHisJokyoSkcdCre = (String) temporaryData.get(KAP_HAISO_SVC_STA_HIS_JOK_SKCD)` (L3856) |
| 2 | CONDITION | `SVC_STAJI_HIS_JOKYO_SKCD_NO.equals(svcStaJiHisJokyoSkcdCre)` — [SVC_STAJI_HIS_JOKYO_SKCD_NO = "1" (No Delivery)] (L3858) |

**Block 4.2.2.2.1.1.1** — [IF: Cradle no delivery — skip] (L3860)

Cradle delivery status is "no delivery". Skip this device.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `continue` (L3862) |

**Block 4.2.3** — [ELSE: Non-KAP device — check migration code] (L3871)

This is NOT a KAP device. Check the indoor device migration code.

| # | Type | Code |
|---|------|------|
| 1 | SET | `tknKikiIdoCd = getNullToStr(ekk0341a010CBSMsg_af.getString(EKK0341A010CBSMsg1List.TAKNKIKI_IDO_CD))` (L3883) |
| 2 | CONDITION | `TAKNKIKI_IDO_CD_IDO_NASHI.equals(tknKikiIdoCd) || TAKNKIKI_IDO_CD_PART_TEKKYO.equals(tknKikiIdoCd)` — [IDO_NASHI = "09" (No Move), PART_TEKKYO = "03" (Partial Delivery/Temporary Loan)] (L3886) |

**Block 4.2.3.1** — [IF: No-move or partial delivery — skip] (L3888)

The device has migration code "no move" or "partial delivery (temporary loan)". Per the v5.02.07 change note, when STB is changed due to emergency dispatch, the STB and C-CAS are processed during pre-order but B-CAS already exists, causing an error. The migration code "09" (no move) is set in JKKKikiChgCC to prevent delivery creation for such devices. The v5.03.00 change also added "03" (partial delivery) to this check.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `continue` (L3890) |

**Block 4.2.4** — [ELSE: Check work-order delivery conditions] (L3894)

The device is not excluded by any prior check. Verify whether the work-order information warrants delivery.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `isKojiInfoHaisoJyokenJaj(ekk0341a010CBSMsg_af, ichiranKojiInfoMap, temporaryData, handle, scCall, param, dataMapKey, tkModelCd)` (L3897) |
| 2 | CONDITION | `isKojiInfoHaisoJyokenJaj` returns false — does not meet work-order delivery criteria |

**Block 4.2.4.1** — [IF: Work-order condition NOT met — skip] (L3899)

The device does not meet the work-order delivery conditions. Skip it.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `continue` (L3901) |

**Block 4.2.5** — [ELSE: Device qualifies — build delivery group] (L3931)

The device passes all exclusion filters. Build the delivery Map data and add to the appropriate group.

| # | Type | Code |
|---|------|------|
| 1 | SET | `edk0011b090cbsMsg = (CAANMsg) jyogaiMap.get(getHaisoBuppinDelKey(ekk0341a010CBSMsg_af))` (L3931) |
| 2 | CALL | `haisoKikiMap = getHaisoKikiMap(handle, scCall, param, dataMapKey, temporaryData, ccMsg, ekk0341a010CBSMsg_af, edk0011b090cbsMsg, ichiranKojiInfoMap)` (L3938) // Build full delivery Map — combines pre-update and post-update device data |
| 3 | CALL | `haisoBunkatsuKey = getHaisoBunkatsuKey(haisoKikiMap)` (L3940) // Derive new delivery grouping key |
| 4 | CONDITION | `haisoBunkatsuSouDataMap.containsKey(haisoBunkatsuKey)` (L3942) |

**Block 4.2.5.1** — [IF: Group already exists — append] (L3944)

The delivery group already exists (from pre-update items). Append this post-update device Map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `haisoCreateList = (ArrayList) haisoBunkatsuMap.get(HAISO_CRE_LIST_KEY)` (L3946) |
| 2 | EXEC | `haisoCreateList.add(haisoKikiMap)` (L3948) |

**Block 4.2.5.2** — [ELSE: Create new group] (L3950)

No existing group — create a new delivery group and store it.

| # | Type | Code |
|---|------|------|
| 1 | SET | `haisoBunkatsuMap = new HashMap()` (L3952) |
| 2 | SET | `haisoCreateList = new ArrayList()` (L3954) |
| 3 | EXEC | `haisoCreateList.add(haisoKikiMap)` (L3956) |
| 4 | EXEC | `haisoBunkatsuMap.put(HAISO_CRE_LIST_KEY, haisoCreateList)` (L3958) |
| 5 | EXEC | `haisoBunkatsuSouDataMap.put(haisoBunkatsuKey, haisoBunkatsuMap)` (L3960) |

**Block 4.M** — [FOR CONTINUATION] (L3962)

| # | Type | Code |
|---|------|------|
| 1 | SET | `i++` (L3962) |
| 2 | GOTO | Back to Block 4 CONDITION |

**Block 5** — [WHILE LOOP: Invoke delivery creation for each group] (L3966)

Iterate over all delivery groups and invoke the actual delivery creation processing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `bunkatsuHisoMap = null` (L3968) |
| 2 | SET | `it = haisoBunkatsuSouDataMap.keySet().iterator()` (L3971) |
| 3 | CONDITION | `it.hasNext()` (L3971) |
| 4 | SET | `haisoBunkatsuKey = it.next()` (L3974) |
| 5 | SET | `bunkatsuHisoMap = (HashMap) haisoBunkatsuSouDataMap.get(haisoBunkatsuKey)` (L3976) |
| 6 | CALL | `isExecHaisoUketsuke(handle, scCall, param, dataMapKey, temporaryData, bunkatsuHisoMap)` (L3980) |
| 7 | CONDITION | `isExecHaisoUketsuke` returns false — delivery creation failed |

**Block 5.1** — [IF: Delivery creation failed — abort] (L3982)

Delivery creation failed for this group. Return `false` to propagate the error to the caller.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return false` (L3984) |

**Block 5.M** — [WHILE CONTINUATION] (L3987)

| # | Type | Code |
|---|------|------|
| 1 | GOTO | Back to Block 5 CONDITION |

**Block 6** — [RETURN SUCCESS] (L4069)

All delivery groups have been successfully processed. Return `true`.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true` (L4069) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `haiso` | Field (Japanese) | Delivery — refers to the physical delivery of customer premise equipment to the customer |
| `Uketsuke` | Field (Japanese) | Receipt/acceptance — the process of accepting and confirming delivery records |
| `haisoTgBppinList` | Field | Delivery target item list (pre-update) — list of equipment items before contract changes |
| `haisoKikiListAf` | Field | Device list after update — list of equipment records after service contract changes |
| `haisoBunkatsuSouDataMap` | Field | Master delivery grouping data Map — the top-level map grouping devices by delivery key |
| `haisoBunkatsuKey` | Field | Delivery grouping key — derived from device attributes to group items into the same delivery number |
| `haisoCreateList` | Field | Delivery creation list — a list of device Maps belonging to the same delivery number |
| `haisoKikiMap` | Field | Delivery item device Map — converted representation of a single device record for delivery processing |
| `jyogaiMap` | Field | Exclusion/skipped delivery data map — contains pre-update device records to be reused for unmodified items |
| `kojianknNo` | Field | Work order project number — the project number associated with the delivery, used for work-order linkage |
| `haisoSakseiZumiFlg` | Field | Delivery creation completion flag — indicates whether delivery has already been created |
| `haisoNochkList` | Field | Delivery association check notification list —list of device keys that have already been checked for delivery association |
| `TEIKYO_SBT_MOCHIKOMI` | Constant | Provision sub-type: "03" = Hosted Equipment (operator-provided, excluded from customer delivery) |
| `SVC_STAJI_HIS_JOKYO_SKCD_NO` | Constant | Service start history check code: "1" = No delivery (KAP subsidy registration delivery not to be created) |
| `SVC_STAJI_HIS_JOKYO_SKCD_OK` | Constant | Service start history check code: "2" = Delivery available |
| `KAP` | Acronym | KAKUTEI (subsidy registration) — refers to equipment obtained through subscription/subsidy programs |
| `KAP_HAISO_SVC` | Field | KAP delivery service start status history check code storage key |
| `TAKNKIKI_SBT_CD` | Field | Indoor device sub-type code — classifies equipment type (tablet, cradle, etc.) |
| `TAKNKIKI_IDO_CD` | Field | Indoor device migration code — indicates whether device has moved (used for emergency dispatch scenarios) |
| `IDO_NASHI` | Constant | No move — migration code "09" for devices that have not been moved |
| `PART_TEKKYO` | Constant | Partial delivery (temporary loan) — migration code "03" for devices temporarily loaned during equipment changes |
| `isKojiInfoHaisoJyokenJaj` | Method | Work-order delivery condition judgment — verifies whether a device meets the criteria for delivery creation based on work-order information |
| `isKapKiki` | Method | KAP device check — determines whether a device is a subsidy registration (KAP) device |
| `isExecHaisoUketsuke` | Method | Delivery creation execution — actually creates delivery receipts for a group of devices. This method is called once per delivery group. |
| `getHaisoBuppinKikiMap` | Method | Converts a CAANMsg device record into a HashMap for delivery grouping |
| `getHaisoBunkatsuKey` | Method | Derives a string key from a device Map for grouping devices by delivery number |
| `getHaisoBuppinDelKey` | Method | Derives a lookup key from a device record for querying the exclusion/skipped delivery map |
| `getHaisoKikiMap` | Method | Builds a complete delivery Map by calling the EDK0011B090 CBS (Contract Equipment Delivery Target Item List Consultation) service |
| `EDK0011B090` | SC/CBS | Contract Equipment Delivery Target Item List Consultation — retrieves pre-update delivery target equipment data |
| `EKK0341A010CBS` | SC/CBS | Post-update device data — source CBS for the `haisoKikiListAf` records |
| `CAANMsg` | Type | Message/data transfer object carrying field-level data for a business entity |
| `SessionHandle` | Type | Database session handle for transaction and persistence management |
| `ServiceComponentRequestInvoker` | Type | Invoker bridge for calling Service Component (SC) methods remotely |
| `IRequestParameterReadWrite` | Type | Interface for reading/writing request parameters and screen data |
| `kapsCradleList` | Field | KAP cradle list — list of cradle-related KAP items in temporaryData |
| `KAPS_CRADLE_LIST` | Constant | Temporary data key: "kapsCradleList" — holds cradle items for KAP subsidy devices |
| `KOJI_INFO_MAP_KEY` | Constant | Temporary data key: "ichiranKojiInfoMap" — holds work information map for condition checks |
| `kojiak_no` | Field | Work project number (screen data) — the work order project number from screen input |
| `taknkiki_model_cd` | Field | Indoor equipment model code — model identifier used for KAP device type checking |
| `KKTK_SBT_CD` | Field | Provision equipment sub-type code — field in EKK0341A010CBSMsg1List identifying equipment type |
| `KIKI` | Field (Japanese abbreviation) | Equipment/device — short for 機器 (kiki) |
| `Buppin` | Field (Japanese) | Item/product — refers to individual equipment items within a delivery |
| `Edokiri` | — | (Not directly referenced in this method; related to EDK0011B090 CBS name: 契約機器配送対象物品一覧照会 = Contract Equipment Delivery Target Item List Consultation) |