# Business Logic — JKKKikiIchiranIkkatsuCC.execKikiIchiranIkkatsu() [357 LOC]

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

## 1. Role

### JKKKikiIchiranIkkatsuCC.execKikiIchiranIkkatsu()

This method is the central **equipment list bulk-update controller** for the K-Opticom eo customer backbone system. It orchestrates the entire workflow for the "Equipment List Bulk Update" screen (KKSV0595), handling both **view-only check** (FUNC_CODE = "2") and **check-and-register** (FUNC_CODE = "1") modes. When in check-and-register mode, it performs a comprehensive set of service contract modifications including equipment changes, router linkages, inventory updates, delivery scheduling, and review result reflections.

The method implements a **gate-and-dispatch design pattern**: it runs through a cascade of validation checks (concurrency conflict detection, delivery eligibility, equipment data availability, server readiness, screen preconditions), and for each gate that passes, it invokes specialized processing sub-methods. If any gate fails, the method returns early with an appropriate error message.

Specifically, the method handles these service categories:
- **Service contract agreement inquiry** — fetches current contract metadata
- **Unreturned equipment cancellation** — special path for cancelled but undelivered equipment
- **Kap Haiso (discount delivery scheduling)** — hybrid contract delivery date determination
- **Multi-functional router (router VA) auto-deletion** — automatic contract cancellation when adding second routers
- **DSL router recovery** — restores previously-cancelled DSL routers during modifications
- **Equipment linkage processing** — equipment location number changes, upstream manufacturer serial number updates, and inventory reconciliation
- **Review result updates** — reflects approval/rejection outcomes for equipment changes when status is "UKEZUMI" (received/pending)

Its role in the larger system is as the **single entry point** for bulk equipment modifications from the KKSV0595 screen, consolidating all equipment-related updates under one transactional boundary and delegating to specialized component methods.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["execKikiIchiranIkkatsu(handle, param, fixedText)"])

    START --> INIT["Initialize: ccMsg, messageInfo, temporaryData"]
    INIT --> GET_WORK["Get/Set MappingWorkArea"]
    GET_WORK --> SET_TK["setTknkikiRenkeiData: Store home appliance linkage data"]
    SET_TK --> CREATE_INVOKER["Create ServiceComponentRequestInvoker"]
    CREATE_INVOKER --> CALL_EKK0081A["callSC: EKK0081A010 - Service Contract Agreement Inquiry"]
    CALL_EKK0081A --> CHECK_EXCLUSIVE1{"isExclusiveCheck
(Version mismatch?)"}

    CHECK_EXCLUSIVE1 -->|FALSE - Mismatch| ERR_EXCL1["Set error EKB0320-KW, Return param"]
    CHECK_EXCLUSIVE1 -->|TRUE - OK| CHECK_EXCLUSIVE2{"isExclusiveKaisenCheck
(Side-channel check)"}

    CHECK_EXCLUSIVE2 -->|FALSE| ERR_EXCL2["Set error EKB0320-KW, Return param"]
    CHECK_EXCLUSIVE2 -->|TRUE| SET_GYOMU["setGyomuParameter: Set business parameter data"]

    SET_GYOMU --> GET_IDO["Get work_ido_div from ccMsg"]
    GET_IDO --> CHECK_IDO{"work_ido_div = 00030?
(IDO_DIV_VALUE_00030: Unreturned Equipment Cancellation)"}

    CHECK_IDO -->|TRUE| CALL_UNDEL["execUnDeliveredKiki: Unreturned equipment cancellation"]
    CHECK_IDO -->|FALSE| CHECK_SHORI{"isExecShoriCheck
(Process target exists?)"}
    CHECK_SHORI -->|FALSE| ERR_SHORI["Set error EKB5010-KW (No undelivered equipment / delivery destination & dispatch date), Return param"]

    CALL_UNDEL --> RETURN_UNDEL["Return param"]
    ERR_SHORI --> RETURN_SHORI["Return param"]

    CHECK_SHORI -->|TRUE| GET_STAT["getSvcKeiStat: Get service contract status"]
    GET_STAT --> SET_TEMP["Set Kap Haiso temp fields to empty"]
    SET_TEMP --> GET_KAP["getKapInfoFuriwake: Discount info classification processing"]

    GET_KAP --> CHECK_KAPHAI{"isKapHaiso
(Kap Haiso determination?)"}

    CHECK_KAPHAI -->|TRUE| SET_KAPYOKU["getKapAddHaisoYokushi + setKapHaiso"]
    SET_KAPYOKU --> SET_HISSU["setKkosvkeiHissuCdList: Set service contract count codes"]

    CHECK_KAPHAI -->|FALSE| SET_HISSU
    SET_HISSU --> GET_KIKILIST["getKikiTkSvcKeiList: Get equipment service contract list"]
    GET_KIKILIST --> SET_TAKINO["setTakinoRutarShoriHantei: Multi-functional router processing check"]

    SET_TAKINO --> GET_OPTKBN["Get KIKI_OPT_SVC_KEI_SHORI_KBN"]
    GET_OPTKBN --> CHECK_OPTKBN{"KBN = 2 (DSL)?
(KIKI_OPT_SVC_KEI_SHORI_KBN_DSL)"}

    CHECK_OPTKBN -->|TRUE| DSL_RECOVER["setTakinoDslRutarKaifuku + serResetKikiTkSvcKeiData"]
    DSL_RECOVER --> SET_AUTO_DEL["setTakinoRutarAutoDel: Auto-delete old router"]

    CHECK_OPTKBN -->|FALSE| SET_AUTO_DEL
    SET_AUTO_DEL --> CHECK_SERVER{"isServerCheck
(Server check)"}

    CHECK_SERVER -->|FALSE| RETURN_SERVER["Return param"]
    CHECK_SERVER -->|TRUE| CALL_EKK0251B["callSC: EKK0251B003 - Service Contract Line Item List (Current Usage)"]

    CALL_EKK0251B --> GET_PARENT["getBuisinessParameter: Get parent service code"]
    GET_PARENT --> GET_SVCD["Get svcCd from EKK0081A010 result"]

    GET_SVCD --> CHECK_SVCTEL{"SVC_CD_TEL = 02 AND
KBN = 1 (ADD)?"}

    CHECK_SVCTEL -->|TRUE| EDIT_TEL["isTakinoRutarAddRutarDslEdit + serResetKikiTkSvcKeiData"]
    EDIT_TEL --> REFETCH_TEL["serResetKikiTkSvcKeiData: Refetch update data"]
    REFETCH_TEL --> CHECK_NET

    CHECK_SVCTEL -->|FALSE| CHECK_NET{"SVC_CD_NET = 01?
(And VA DSL configured?)"}

    CHECK_NET -->|TRUE| EDIT_NET["isTakinoRutarAddRutarDslEdit + serResetKikiTkSvcKeiData"]
    EDIT_NET --> REFETCH_NET["serResetKikiTkSvcKeiData: Refetch update data"]

    CHECK_NET -->|FALSE| CHECK_ICHRAN
    REFETCH_NET --> CHECK_ICHRAN

    CHECK_ICHRAN{"isKkTkSvcKeiIchiranData
(Ichiran data check)"}
    CHECK_ICHRAN -->|FALSE| RETURN_ICHRAN["Return param"]
    CHECK_ICHRAN -->|TRUE| SET_KAISHU["setKaishuRutarUmu: Set return router flag"]

    SET_KAISHU --> CHECK_SCRN{"isScrnCommonExec
(Screen call check)"}
    CHECK_SCRN -->|FALSE| RETURN_SCRN["Return param"]
    CHECK_SCRN -->|TRUE| CHECK_STAT2{"svcKeiStat != UKEZUMI?
(Not received status)"}

    CHECK_STAT2 -->|FALSE| CHECK_FUNCCODE
    CHECK_STAT2 -->|TRUE| CHECK_HAISO{"isExecHaiso
(Delivery processing)"}

    CHECK_HAISO -->|FALSE| RETURN_HAISO["Return param"]
    CHECK_HAISO -->|TRUE| CHECK_HAISO_CANCEL{"isExecHaisoCancel
(Delivery cancellation?)"}

    CHECK_HAISO_CANCEL -->|FALSE| RETURN_HAISO_CANCEL["Return param"]
    CHECK_HAISO_CANCEL -->|TRUE| CHECK_FUNCCODE{"FUNC_CODE = 1?
(Check and Register)"}

    CHECK_FUNCCODE -->|FALSE| RETURN_FINAL["Return param"]
    CHECK_FUNCCODE -->|TRUE| CHECK_MKM["isExecMkmScinsprtWk: Input support work"]

    CHECK_MKM -->|FALSE| RETURN_MKM["Return param"]
    CHECK_MKM -->|TRUE| GET_OTHER["Get otherSvcKeiNo"]

    GET_OTHER --> CHECK_OTHER{"otherSvcKeiNo
not empty?"}

    CHECK_OTHER -->|TRUE| CHECK_MKM2["isExecMkmScinsprtWk: Input support for other contract"]
    CHECK_OTHER -->|FALSE| CHECK_UKEZUMI2

    CHECK_MKM2 -->|FALSE| RETURN_MKM2["Return param"]
    CHECK_MKM2 -->|TRUE| CHECK_UKEZUMI2{"svcKeiStat = UKEZUMI?
(Received status)"}

    CHECK_UKEZUMI2 -->|TRUE| EXEC_UPD["execUpdateJudge: Update judge result"]
    CHECK_UKEZUMI2 -->|FALSE| CHECK_TKN

    EXEC_UPD --> CHECK_TKN{"isExecTknRenkeiUpdate
(Tkn linkage update)"}

    CHECK_TKN -->|FALSE| RETURN_TKN["Return param"]
    CHECK_TKN -->|TRUE| CHECK_TKN_STAT{"svcKeiStat != UKEZUMI?
(Not received)"}

    CHECK_TKN_STAT -->|TRUE| CHECK_ZAIKO["isExecTknZaikoUpdate: Inventory update"]
    CHECK_TKN_STAT -->|FALSE| CHECK_ZAIKO_FUMEI["isExecTknZaikoFumeiUpdate: Unknown inventory update"]

    CHECK_ZAIKO -->|FALSE| RETURN_ZAIKO["Return param"]
    CHECK_ZAIKO -->|TRUE| CHECK_ZAIKO_FUMEI

    CHECK_ZAIKO_FUMEI -->|FALSE| RETURN_ZAIKO_F["Return param"]
    CHECK_ZAIKO_FUMEI -->|TRUE| RETURN_FINAL

    RETURN_UNDEL --> END(["Return param"])
    RETURN_SHORI --> END
    RETURN_SERVER --> END
    RETURN_ICHRAN --> END
    RETURN_SCRN --> END
    RETURN_HAISO --> END
    RETURN_HAISO_CANCEL --> END
    RETURN_FINAL --> END
    RETURN_MKM --> END
    RETURN_MKM2 --> END
    RETURN_TKN --> END
    RETURN_ZAIKO --> END
    RETURN_ZAIKO_F --> END

    style START fill:#e1f5fe
    style END fill:#e1f5fe
    style ERR_EXCL1 fill:#ffebee
    style ERR_EXCL2 fill:#ffebee
    style ERR_SHORI fill:#ffebee
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `handle` | `SessionHandle` | The session handle providing database connection and transaction context for all service component calls. Represents the current user's server-side session. |
| 2 | `param` | `IRequestParameterReadWrite` | The request/response parameter object carrying business data across the processing pipeline. Contains the ccMsg map (identified by dataMapKey/fixedText) with service contract information, equipment lists, and error message accumulators. Returned with updated data and error status. |
| 3 | `fixedText` | `String` | The data map key identifier used to retrieve the ccMsg HashMap from param. Acts as a namespace for the working data area within the request parameter. |

**Instance fields / external state read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `FUNC_CODE_1` | `String` (constant = "1") | Function code for "Check and Register" mode — triggers full update processing including inventory, linkage, and review updates |
| `FUNC_CODE_2` | `String` (constant = "2") | Function code for "Check Only" mode — triggers inquiry and validation but no updates |
| `TEMPLATE_ID_EKK0081A010` | `String` | Template identifier for Service Contract Agreement Inquiry (service contract metadata) |
| `TEMPLATE_ID_EKK0251B003` | `String` | Template identifier for Service Contract Line Item List (Current Usage) — equipment service contracts |
| `LAST_UPDATE_TIME_KEY` | `String` (constant = "lastUpdateKey") | Key in temporaryData map for tracking the latest update timestamp to detect concurrent modifications |
| `LAST_UPDATE_TIME_SHOKI` | `String` (constant = "0") | Initial value for last update time stamp flag |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `callSC` (EKK0081A010) | EKK0081A010SC | KK_T_SVC_KEI (Service Contract) | Calls EKK0081A010 SC for Service Contract Agreement Inquiry — retrieves current service contract metadata including last update timestamp and service code |
| R | `callSC` (EKK0251B003) | EKK0251B003SC | KK_T_KKTK_SVC_KEI (Equipment Service Contract) | Calls EKK0251B003 SC for Service Contract Line Item List (Current Usage) — retrieves equipment service contract details including parent service code |
| R | `setTknkikiRenkeiData` | - | - | Stores home appliance (equipment) linkage data into temporaryData map |
| R | `getBuisinessParameter` | EZM0321A010SC | Business Parameter tables | Retrieves business parameters (e.g., hybrid contract discount code, parent service contract code) from EZM0321A010 SC |
| R | `getKapInfoFuriwake` | - | - | Processes discount (Kap) information classification — categorizes service types and discount eligibility |
| R | `getSvcKeiStat` | - | - | Extracts service contract status code from temporaryData (e.g., UKEZUMI = received) |
| U | `getKapAddHaisoYokushi` | EKK0081B031SC, EKK2331B001SC, EKK0341B012SC | KK_T_HYBRID_SVC, KK_T_KKTK_SVC_KEI, Delivery tables | Determines delivery suppression — queries hybrid contract list and equipment service contracts to calculate delivery dates |
| U | `setKapHaiso` | - | - | Sets Kap Haiso (discount delivery) configuration based on contract type, delivery designation date, and pricing group |
| R | `setKkosvkeiHissuCdList` | - | - | Sets service contract number count code list for current operations |
| R | `getKikiTkSvcKeiList` | EKK0341B012SC | KK_T_KKTK_SVC_KEI | Retrieves equipment service contract list (pre-modification snapshot) |
| U | `setTakinoRutarShoriHantei` | - | - | Determines multi-functional router processing — identifies if router VA (Value Added) features need auto-cancellation |
| U | `setTakinoDslRutarKaifuku` | - | - | Restores previously-cancelled DSL routers by adding them to the ichiran list for reprocessing |
| U | `serResetKikiTkSvcKeiData` | EKK0341B012SC | KK_T_KKTK_SVC_KEI | Refetches equipment service contract data after modifications to ensure consistency |
| U | `setTakinoRutarAutoDel` | - | - | Handles automatic cancellation of old multi-functional routers when a second router is added at the same location |
| R | `isServerCheck` | - | - | Validates server-side data integrity before processing |
| R | `isKkTkSvcKeiIchiranData` | - | - | Validates and retrieves the equipment list data (ichiran) for update processing |
| U | `setKaishuRutarUmu` | - | - | Distinguishes equipment add/delete operations and sets return router flag |
| R | `isScrnCommonExec` | KKW033, JKK_KIKIICHIRAN_KKCREATE_CC, JKK_KIKIICHIRAN_KKUPD_CC, JKK_KIKIICHIRAN_SHURIUK_CC, etc. | Various | Orchestrates screen-specific sub-component calls for equipment registration, modification, repair, cancellation, and emergency dispatch |
| R | `isExecHaiso` | - | Delivery tables (EDK) | Determines if delivery processing is applicable based on service status and equipment conditions |
| R | `isExecHaisoCancel` | EDK0011C090SC | EDK Delivery tables | Checks delivery cancellation eligibility and processes delivery cancellation |
| R | `isExecMkmScinsprtWk` | JKK_UPDMKMSCIN_SPRTWK_CC | MkmScinsprtWk (screen input support work area) | Validates and invokes screen input support work area CC for assisted entry |
| U | `execUpdateJudge` | - | KK_T_KKTK_SVC_KEI | Updates review/judge results for equipment changes when contract status is "UKEZUMI" (received) |
| U | `isExecTknRenkeiUpdate` | EKKA0020004SC, EKKA0020501SC | KK_T_KIKI_LOCATION, KK_T_UPSTREAM_MANUF | Updates equipment linkage: equipment location number changes and upstream manufacturer serial number updates |
| U | `isExecTknZaikoUpdate` | EKKA0020504SC | KK_T_KIKI_INVENTORY | Updates home appliance logistics inventory for delivered equipment |
| U | `isExecTknZaikoFumeiUpdate` | EKKA0020504SC | KK_T_KIKI_INVENTORY | Updates home appliance logistics inventory for unidentified/unknown equipment |
| R | `execUnDeliveredKiki` | EKK0341C230SC, EKK0341C330SC, EKK0341E010SC | KK_T_KKTK_SVC_KEI, Equipment cancellation tables | Handles unreturned equipment cancellation — processes contract cancellation and logical deletion |
| R | `isExclusiveCheck` | - | - | Internal concurrency check comparing last update timestamp from database vs. session to detect version conflicts |
| R | `isExclusiveKaisenCheck` | - | - | Internal side-channel conflict detection for concurrent contract modifications |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Screen:KKSV0595 | `KKW03301SFLogic` -> DB Mapper `KKSV0595_KKSV0595OPDBMapper.setKKSV059501CC()` -> BPM `KKSV0595Flow` -> `KKSV0595OPOperation.run()` -> `CCRequestBroker(target3)` -> `JKKKikiIchiranIkkatsuCC.execKikiIchiranIkkatsu()` | `EKK0081A010SC [R] KK_T_SVC_KEI`, `EKK0251B003SC [R] KK_T_KKTK_SVC_KEI`, `EKKA0020004SC [U] KK_T_KIKI_LOCATION`, `EKKA0020504SC [U] KK_T_KIKI_INVENTORY` |
| 2 | BPM:KKSV0595OPOperation | `KKSV0595OPOperation.run()` -> `CCRequestBroker(target3)` -> `JKKKikiIchiranIkkatsuCC.execKikiIchiranIkkatsu()` | Same as caller #1 (primary BPM entry point) |
| 3 | BPM:KKSV0595Flow | `KKSV0595Flow.run()` -> `KKSV0595OPOperation.run()` -> `CCRequestBroker(target3)` -> `execKikiIchiranIkkatsu()` | Same as caller #1 (EJB stateless session bean entry) |

**Notes on callers:**
- The `KKSV0595_KKSV0595OPBPCheck` class imports `JKKKikiIchiranIkkatsuCC` but its usage is commented out (legacy/deprecated). It handles business rule validation for the KKSV0595 BPM flow.
- `KKW03301SFLogic` (on both WebA and WebB) is the web-facing screen logic that prepares the request data and dispatches to the KKSV0595 BPM flow. The screen ID is KKW033.
- `KKSV0595Flow` is the stateless session bean (`@Stateless(mappedName="KKSV0595")`) that acts as the EJB entry point for the BPM process.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] Initialize working data (L1681)

> Initializes the message map, clears error flags, and prepares temporary data storage.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dataMapKey = fixedText` // Assign fixedText as data map key |
| 2 | SET | `ccMsg = (HashMap)param.getData(dataMapKey)` // Retrieve ccMsg working map |
| 3 | SET | `func_code = (String)ccMsg.get("func_code")` // Get function code from ccMsg |
| 4 | SET | `ccMsg.put("err_flg", "")` // Clear error flag (Error Flag: "") |
| 5 | SET | `messageInfo = new ArrayList<>()` // Initialize message info list |
| 6 | SET | `ccMsg.put("message_list", messageInfo)` // Set message list in ccMsg |
| 7 | SET | `temporaryData = new HashMap<>()` // Initialize temporary data map |
| 8 | SET | `temporaryData.put(LAST_UPDATE_TIME_KEY, "0")` // [-> LAST_UPDATE_TIME_SHOKI="0"] Set initial update timestamp flag |

**Block 2** — [IF/ELSE] Work area initialization (L1708)

> Ensures the mapping work area exists in the param object, creating it if null.

| # | Type | Code |
|---|------|------|
| 1 | SET | `workMap = param.getMappingWorkArea()` |
| 2 | IF | `workMap == null` |
| 2.1 | SET | `workMap = new HashMap()` |
| 2.2 | EXEC | `param.setMappingWorkArea(workMap)` |

**Block 3** — [EXEC] Home appliance linkage data setup (L1716)

> Stores home appliance (equipment) linkage data into the temporary data map.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setTknkikiRenkeiData(temporaryData, ccMsg)` |

**Block 4** — [EXEC] Service component request invoker creation (L1719)

> Creates the ServiceComponentRequestInvoker instance for SC dispatch. Empty string parameter suppresses log output.

| # | Type | Code |
|---|------|------|
| 1 | SET | `scCall = new ServiceComponentRequestInvoker()` |

**Block 5** — [CALL] EKK0081A010 Service Contract Agreement Inquiry (L1722-L1727)

> Calls the Service Contract Agreement Inquiry service component to retrieve current contract metadata including last update timestamp.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0081a010IN = {{TEMPLATEID, "EKK0081A010"}, {FUNC_CODE, FUNC_CODE_2}, {KEY_SVC_KEI_NO, ccMsg.get("svc_kei_no")}, {KEY_GENE_ADD_DTM, ""}, {KEY_RSV_APLY_YMD, ccMsg.get("unyo_ymd")}}` |
| 2 | CALL | `callSC(handle, scCall, param, dataMapKey, ekk0081a010IN)` |
| 3 | SET | `ekk0081a010cbsMsg = result.getCAANMsgList(EKK0081A010CBSMsg.EKK0081A010CBSMSG1LIST)[0]` |
| 4 | SET | `temporaryData.put(TEMPLATE_ID_EKK0081A010, ekk0081a010cbsMsg)` |

**Block 6** — [IF/ELSE] v5.10.13 Exclusive Check — Version Conflict Detection (L1731-L1740)

> Compares the last update timestamp from the database with the session's stored timestamp. If they differ, a concurrent modification is detected and processing aborts with error EKB0320-KW.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `isExclusiveCheck(ekk0081a010cbsMsg, ccMsg)` — compares `last_upd_dtm` from DB with `upd_dtm_svc_kei` from session |
| 2 | IF | `!isExclusiveCheck(...)` → returns false (timestamps differ = conflict) |
| 2.1 | EXEC | `setMessageInfo(ccMsg, "EKB0320-KW", "", "", ERR_FLG_ERR)` |
| 2.2 | RETURN | `return param` |

**Block 7** — [IF/ELSE] v7.00.01 Exclusive Check — Side-Channel Conflict (L1744-L1753)

> Additional concurrency check against side-channel data. Returns error EKB0320-KW on conflict.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `isExclusiveKaisenCheck(handle, scCall, param, dataMapKey, temporaryData)` |
| 2 | IF | `!isExclusiveKaisenCheck(...)` → conflict detected |
| 2.1 | EXEC | `setMessageInfo(ccMsg, "EKB0320-KW", "", "", ERR_FLG_ERR)` |
| 2.2 | RETURN | `return param` |

**Block 8** — [EXEC] v7.00.03 Business Parameter Data Set (L1760)

> Sets business parameter data (including work assignment processing target determination) into temporaryData.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setGyomuParameter(handle, scCall, param, dataMapKey, temporaryData)` |

**Block 9** — [IF/ELSE] Displacement Division Check — Unreturned Equipment Cancellation (L1763-L1774)

> If work_ido_div equals "00030" (Unreturned Equipment Cancellation), invokes special cancellation processing and returns early.

| # | Type | Code |
|---|------|------|
| 1 | SET | `work_ido_div = (String)ccMsg.get("ido_div")` |
| 2 | IF | `IDO_DIV_VALUE_00030 = "00030"`.equals(work_ido_div) |
| 2.1 | CALL | `execUnDeliveredKiki(handle, param, dataMapKey, ccMsg, temporaryData, scCall)` |
| 2.2 | RETURN | `return param` |

**Block 10** — [IF/ELSE] v4.11.00 Process Target Existence Check (L1778-L1788)

> Verifies that process target data (undelivered equipment, delivery destination, dispatch date) exists. Returns error EKB5010-KW if no targets.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!isExecShoriCheck(param, dataMapKey)` |
| 1.1 | EXEC | `setMessageInfo(ccMsg, "EKB5010-KW", "No undelivered equipment, delivery destination & dispatch date", "", ERR_FLG_ERR)` |
| 1.2 | RETURN | `return param` |

**Block 11** — [EXEC] Service Contract Status Retrieval (L1790-L1793)

> Gets the service contract status code and initializes Kap Haiso temporary fields.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiStat = getSvcKeiStat(temporaryData)` |
| 2 | SET | `temporaryData.put(KAP_HAISO_SVC_STA_HIS_JOK_SKCD, "")` |
| 3 | SET | `temporaryData.put(KAP_HAISO_HAISO_REQ_SHITEI_YMD, "")` |

**Block 12** — [EXEC] Kap Info Furiwake — Discount Info Classification (L1794)

> Processes discount (Kap) information classification and routing.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `getKapInfoFuriwake(handle, param, dataMapKey, ccMsg, temporaryData, scCall)` |

**Block 13** — [IF/ELSE] Kap Haiso Determination (L1797-L1804)

> If Kap Haiso determination returns true, executes discount delivery suppression processing and sets Kap Haiso configuration.

| # | Type | Code |
|---|------|------|
| 1 | IF | `isKapHaiso(handle, param, dataMapKey, ccMsg, temporaryData, scCall, svcKeiStat)` → Kap Haiso processing needed |
| 1.1 | CALL | `getKapAddHaisoYokushi(handle, param, dataMapKey, ccMsg, temporaryData, scCall)` |
| 1.2 | CALL | `setKapHaiso(ccMsg, temporaryData, ekk0081a010cbsMsg)` |

**Block 14** — [EXEC] v7.00.00 Service Contract Count Code List (L1817)

> Sets the service contract number count code list.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setKkosvkeiHissuCdList(handle, scCall, param, temporaryData, dataMapKey, ccMsg.get("unyo_ymd"))` |

**Block 15** — [EXEC] v7.00.01 Equipment Service Contract List Retrieval (L1820-L1822)

> Retrieves the equipment service contract list (pre-modification snapshot) and stores in temporaryData.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kikiTkList = getKikiTkSvcKeiList(handle, scCall, param, dataMapKey, temporaryData)` |
| 2 | SET | `temporaryData.put(TMP_KKTK_SVC_KEI_LIST_OLD, kikiTkList)` |

**Block 16** — [EXEC] v7.00.01 Multi-Functional Router Processing Check (L1825)

> Determines router VA (Value Added) feature auto-cancellation settings.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setTakinoRutarShoriHantei(handle, scCall, param, dataMapKey, temporaryData)` |

**Block 17** — [IF/ELSE] v7.00.03 DSL Router Recovery (L1828-L1841)

> If KIKI_OPT_SVC_KEI_SHORI_KBN equals "2" (DSL — previously cancelled DSL router recovery), restores cancelled routers and refetches data.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kikiOptSvcKeiShoriKbn = getNullToStr(temporaryData.get("KIKI_OPT_SVC_KEI_SHORI_KBN"))` |
| 2 | IF | `KIKI_OPT_SVC_KEI_SHORI_KBN_DSL = "2"`.equals(kikiOptSvcKeiShoriKbn) |
| 2.1 | CALL | `setTakinoDslRutarKaifuku(handle, scCall, param, dataMapKey, temporaryData)` |
| 2.2 | CALL | `serResetKikiTkSvcKeiData(handle, scCall, param, dataMapKey, temporaryData)` |

**Block 18** — [EXEC] v12.00.05 Auto-Delete Old Router (L1848-L1853)

> Handles automatic cancellation of old multi-functional routers when a second router is added.

| # | Type | Code |
|---|------|------|
| 1 | SET | `same_place_svc_kei_no = (String)ccMsg.get("same_place_svc_kei_no")` |
| 2 | CALL | `setTakinoRutarAutoDel(handle, scCall, param, dataMapKey, temporaryData, same_place_svc_kei_no)` |

**Block 19** — [IF/ELSE] Server Check (L1857-L1861)

> Validates server-side data integrity. Returns early if check fails.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!isServerCheck(handle, scCall, param, dataMapKey, temporaryData)` |
| 1.1 | RETURN | `return param` |

**Block 20** — [CALL] EKK0251B003 Equipment Service Contract Line Item List (L1865-L1871)

> Retrieves current equipment service contract details (equipment service contracts in current usage).

| # | Type | Code |
|---|------|------|
| 1 | SET | `ekk0251b003IN = {{TEMPLATEID, "EKK0251B003"}, {FUNC_CODE, FUNC_CODE_1}, {KEY_SVC_KEI_NO, ccMsg.get("svc_kei_no")}}` |
| 2 | CALL | `callSC(handle, scCall, param, dataMapKey, ekk0251b003IN)` |
| 3 | SET | `ekk0251b003cbsMsg = result.getCAANMsgList(EKK0251B003CBSMsg.EKK0251B003CBSMSG1LIST)[0]` |
| 4 | SET | `temporaryData.put(TEMPLATE_ID_EKK0251B003, ekk0251b003cbsMsg)` |

**Block 21** — [EXEC] Get Parent Service Contract Code (L1874-L1876)

> Retrieves the parent service contract code from business parameter processing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kaisenOyaSvcCd = getBuisinessParameter(handle, scCall, param, dataMapKey, "KK_OYA_SKBT_KSN_UCWK")` |
| 2 | SET | `temporaryData.put("KK_OYA_SKBT_KSN_UCWK", kaisenOyaSvcCd)` |

**Block 22** — [IF/ELSE] v7.00.01 Telephone Service Router Cancellation Edit (L1886-L1900)

> When service code is "02" (TEL) and processing key is "1" (ADD — addition), edits router cancellation data.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcCd = getNullToStr(ekk0081a010cbsMsg.getString(EKK0081A010CBSMsg1List.SVC_CD))` |
| 2 | IF | `SVC_CD_TEL = "02"`.equals(svcCd) AND `KIKI_OPT_SVC_KEI_SHORI_KBN_ADD = "1"`.equals(kikiOptSvcKeiShoriKbn) |
| 2.1 | IF | `!isTakinoRutarAddRutarDslEdit(handle, scCall, param, dataMapKey, temporaryData, SVC_CD_NET = "01")` |
| 2.1.1 | RETURN | `return param` |
| 2.2 | CALL | `serResetKikiTkSvcKeiData(handle, scCall, param, dataMapKey, temporaryData)` |

**Block 23** — [IF/ELSE] v7.00.13 Network Service Router Cancellation Edit (L1926-L1942)

> When service code is "01" (NET) and VA DSL is configured, edits router cancellation data for VA features.

| # | Type | Code |
|---|------|------|
| 1 | IF | `SVC_CD_NET = "01"`.equals(svcCd) |
| 1.1 | IF | `isVaDslSettei(temporaryData)` → VA DSL configured |
| 1.1.1 | IF | `!isTakinoRutarAddRutarDslEdit(handle, scCall, param, dataMapKey, temporaryData, SVC_CD_TEL = "02")` |
| 1.1.1.1 | RETURN | `return param` |
| 1.1.2 | CALL | `serResetKikiTkSvcKeiData(handle, scCall, param, dataMapKey, temporaryData)` |

**Block 24** — [IF/ELSE] Ichiran Data Check (L1950-L1954)

> Validates and retrieves the equipment list (ichiran) data for update processing. Returns early if invalid.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!isKkTkSvcKeiIchiranData(handle, scCall, param, dataMapKey, temporaryData)` |
| 1.1 | RETURN | `return param` |

**Block 25** — [EXEC] v7.00.05 Return Router Flag (L1958)

> Distinguishes equipment add/delete from work area and sets return router flag.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setKaishuRutarUmu(handle, scCall, param, dataMapKey, temporaryData)` |

**Block 26** — [IF/ELSE] Screen Common Execution Check (L1962-L1966)

> Orchestrates screen-specific sub-component calls. Returns early if check fails.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!isScrnCommonExec(handle, scCall, param, dataMapKey, temporaryData)` |
| 1.1 | RETURN | `return param` |

**Block 27** — [IF/ELSE] Delivery Processing Check (L1968-L1981)

> When service status is NOT "UKEZUMI" (received), runs delivery processing checks.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!SVC_KEI_STAT_UKEZUMI`.equals(svcKeiStat) |
| 1.1 | IF | `!isExecHaiso(handle, scCall, param, dataMapKey, temporaryData)` |
| 1.1.1 | RETURN | `return param` |
| 1.2 | IF | `!isExecHaisoCancel(handle, scCall, param, dataMapKey, temporaryData)` |
| 1.2.1 | RETURN | `return param` |

**Block 28** — [IF/ELSE] Check and Register Mode (FUNC_CODE = "1") (L1986-L2037)

> When func_code is "1" (Check and Register), executes full update processing including input support work, review result updates, and inventory/linkage processing.

| # | Type | Code |
|---|------|------|
| 1 | IF | `FUNC_CODE_1 = "1"`.equals(func_code) |
| 1.1 | IF | `!isExecMkmScinsprtWk(handle, scCall, param, dataMapKey, temporaryData, svc_kei_no)` |
| 1.1.1 | RETURN | `return param` |
| 1.2 | SET | `otherSvcKeiNo = getNullToStr(temporaryData.get(OTHER_SVC_KEI_NO))` |
| 1.3 | IF | `!"".equals(otherSvcKeiNo)` |
| 1.3.1 | IF | `!isExecMkmScinsprtWk(handle, scCall, param, dataMapKey, temporaryData, otherSvcKeiNo)` |
| 1.3.1.1 | RETURN | `return param` |
| 1.4 | IF | `SVC_KEI_STAT_UKEZUMI`.equals(svcKeiStat) |
| 1.4.1 | CALL | `execUpdateJudge(handle, param, ccMsg)` |
| 1.5 | IF | `!isExecTknRenkeiUpdate(handle, scCall, param, dataMapKey, temporaryData)` |
| 1.5.1 | RETURN | `return param` |
| 1.6 | IF | `!SVC_KEI_STAT_UKEZUMI`.equals(svcKeiStat) |
| 1.6.1 | IF | `!isExecTknZaikoUpdate(handle, scCall, param, dataMapKey, temporaryData)` |
| 1.6.1.1 | RETURN | `return param` |
| 1.6.2 | IF | `!isExecTknZaikoFumeiUpdate(handle, scCall, param, dataMapKey, temporaryData)` |
| 1.6.2.1 | RETURN | `return param` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service contract number — unique identifier for a service contract line item |
| `svc_kei_stat` | Field | Service contract status — lifecycle state (e.g., "00" = UKEZUMI/received, "110" = KYKUPDCHU/contract modification in progress, "910" = KAIYAKU/cancelled, "920" = CANCEL/cancellation completed) |
| `func_code` | Field | Function code — processing mode indicator ("1" = Check and Register, "2" = Check Only) |
| `ido_div` | Field | Displacement division — indicates the type of movement/operation (e.g., "00030" = Unreturned Equipment Cancellation) |
| `ido_div_value_00030` | Constant | "00030" — Special processing mode for unreturned equipment cancellation |
| `svc_cd` | Field | Service code — identifies service type ("01" = NET/Internet, "02" = TEL/Telephone) |
| `KIKI_OPT_SVC_KEI_SHORI_KBN` | Field | Equipment option service contract processing classification — identifies router processing type ("1" = ADD/addition, "2" = DSL/DSL router recovery, "3" = UPD/update) |
| `KIKI_OPT_SVC_KEI_SHORI_KBN_ADD` | Constant | "1" — Router addition processing mode |
| `KIKI_OPT_SVC_KEI_SHORI_KBN_DSL` | Constant | "2" — DSL router recovery mode (restores previously-cancelled DSL routers) |
| `KIKI_OPT_SVC_KEI_SHORI_KBN_UPD` | Constant | "3" — Update processing mode |
| `lastUpdateKey` | Field | Key for tracking the latest update timestamp on service contracts — used for optimistic concurrency control |
| `KAP_HAISO` | Business term | Discount delivery scheduling — determines delivery dates for equipment under hybrid/discount contracts |
| `HAISO_HANTEI_KBN` | Field | Delivery determination classification — indicates delivery scheduling type (e.g., HYBLID_OK = with hybrid delivery date, HYBLID_NO = without) |
| `HAISO_STAT_UKEDUMI` | Field | Delivery status = "Received" — indicates delivery request is pending acceptance |
| `KKTK_SVC_KEI_STAT_KYKUPDCHU` | Constant | "110" — Equipment service contract status: Contract modification in progress |
| `KKTK_SVC_KEI_STAT_KAIYAKU` | Constant | "910" — Equipment service contract status: Cancelled |
| `KKTK_SVC_KEI_STAT_CANCEL` | Constant | "920" — Equipment service contract status: Cancellation completed |
| `KKTK_SBT_CD_MOTIKOMI` | Constant | "03" — Equipment subcontractor code: Handed over (motikomi) |
| `Tkn` (Home Appliance Linkage) | Abbreviation | `Tokuonou Kiki` (Special Function Equipment) / home appliance — refers to customer-premises equipment (CPE) such as routers, set-top boxes, ONUs |
| `Takino Rutar` | Business term | Multi-functional router (additional router) — secondary broadband router added to a service contract |
| `VA` | Business term | Value Added — additional features/services layered on top of base connectivity (e.g., router VPN, parental controls) |
| `KKSV0595` | Screen | Equipment List Bulk Update Screen — the primary screen for bulk equipment modifications |
| `KKW033` | Screen | Equipment List Screen ID — internal screen identifier used for check suppression |
| EKK0081A010 | SC Code | Service Contract Agreement Inquiry — retrieves service contract metadata |
| EKK0251B003 | SC Code | Service Contract Line Item List (Current Usage) — retrieves equipment service contract details |
| EKK0081B031 | SC Code | Hybrid Contract List Inquiry — retrieves list of related hybrid contracts for delivery determination |
| EKK2331B001 | SC Code | Service-Specific Equipment Model Configuration Condition List — retrieves equipment model configuration |
| EKK0341B012 | SC Code | Equipment Service Contract List (Connection Equipment Info) — retrieves equipment service contract details |
| EKKA0020004 | SC Code | Equipment Location Number Change — updates equipment physical location |
| EKKA0020501 | SC Code | Upstream Equipment Manufacturer Serial Number Update — updates manufacturer serial number |
| EKKA0020504 | SC Code | Home Appliance Logistics Inventory Update — updates equipment inventory status |
| EDK0011C090 | SC Code | Delivery Cancellation — processes delivery cancellation |
| `isExclusiveCheck` | Method | Concurrency check comparing database last update timestamp with session timestamp — prevents overwriting concurrent modifications |
| `isExclusiveKaisenCheck` | Method | Side-channel concurrency check — additional conflict detection for contract modifications |
| `isExecShoriCheck` | Method | Process target existence check — verifies undelivered equipment and delivery data exist |
| `isExecMkmScinsprtWk` | Method | Screen input support work area check — validates and updates assisted entry work area |
| `isExecHaiso` | Method | Delivery processing eligibility check — determines if delivery scheduling is applicable |
| `isExecHaisoCancel` | Method | Delivery cancellation processing — handles delivery order cancellation |
| `execUpdateJudge` | Method | Review/judge result update — reflects approval/rejection outcomes for equipment changes in pending status |
| `isExecTknRenkeiUpdate` | Method | Home appliance linkage update — updates equipment location and manufacturer serial number |
| `isExecTknZaikoUpdate` | Method | Home appliance logistics inventory update — updates inventory for delivered equipment |
| `isExecTknZaikoFumeiUpdate` | Method | Home appliance logistics unidentified inventory update — updates inventory for unknown/unidentified equipment |
| `execUnDeliveredKiki` | Method | Unreturned equipment cancellation — handles equipment cancellation when equipment has not been returned |
| `setTakinoDslRutarKaifuku` | Method | Multi-functional DSL router recovery — restores previously-cancelled DSL routers |
| `setTakinoRutarAutoDel` | Method | Multi-functional router auto-delete — automatically cancels old router when adding a second |
| `setKapHaiso` | Method | Kap Haiso (discount delivery) configuration — sets delivery scheduling parameters |
| `getKapAddHaisoYokushi` | Method | Kap Add Haiso Yokushi (discount delivery suppression) — determines if delivery should be suppressed |
| `getKapInfoFuriwake` | Method | Kap Info Furiwake (discount info classification) — classifies discount information |
| `getKikiTkSvcKeiList` | Method | Get Kiki Tokyo Service Contract List — retrieves equipment service contract list |
| `setKkosvkeiHissuCdList` | Method | Set KKO Service Contract Count Code List — sets service contract count code list |
| `setTakinoRutarShoriHantei` | Method | Multi-functional router processing determination — determines if router VA features need auto-cancellation |
| `isServerCheck` | Method | Server-side data integrity check |
| `isKkTkSvcKeiIchiranData` | Method | Kiki Tokyo Service Contract Ichiran (list) data validation |
| `setKaishuRutarUmu` | Method | Return router existence determination — distinguishes add vs. delete operations and sets return router flag |
| `isScrnCommonExec` | Method | Screen common execution — orchestrates screen-specific sub-component calls |
| `isVaDslSettei` | Method | VA DSL configuration check — determines if VA DSL features are configured |
| `isTakinoRutarAddRutarDslEdit` | Method | Multi-functional router add/router DSL edit — edits router cancellation data |
| `serResetKikiTkSvcKeiData` | Method | Re-fetch equipment service contract data — refetches data after modifications |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service |
| ONU | Business term | Optical Network Unit — customer-premises equipment that converts optical signals for broadband services |
| STB | Business term | Set-Top Box — cable television decoding equipment |
| VA | Business term | Value Added — additional features/services layered on base connectivity |
| BPM | Abbreviation | Business Process Management — workflow execution framework |
| SC | Abbreviation | Service Component — backend service layer component for database operations |
| CBS | Abbreviation | Common Business Service — shared business service component |
| CC | Abbreviation | Common Component — shared business logic controller |
| K-Opticom | Business term | Japanese telecommunications operator providing broadband, telephone, and TV services |
| eo | Business term | K-Opticom's brand name for its broadband internet services |
| Hybrid Contract | Business term | Discount contract combining multiple services (e.g., Internet + Telephone) at reduced rates |
| UKEZUMI | Business term | Received/Pending — service contract status indicating the contract has been submitted but not yet processed |
