## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | JACBatCommon.isNull | JACBatCommon | - | Calls isNull in JACBatCommon utility |
| - | JACBatCommon.printDebugLog | JACBatCommon | - | Calls printDebugLog in JACBatCommon |
| - | JACbatDebugLogUtil.printDebugLog | JACbatDebugLog | - | Calls printDebugLog in JACbatDebugLogUtil |
| - | JACbatRknBusinessUtil.isNull | JACbatRknBusiness | - | Calls isNull in JACbatRknBusinessUtil |
| - | JCHbatSeikyKaknoBusinessUtil.isNull | JCHbatSeikyKaknoBusiness | - | Calls isNull in JCHbatSeikyKaknoBusinessUtil |
| - | JCKLcsRenkeiUtil.printDebugLog | JCKLcsRenkei | - | Calls printDebugLog in JCKLcsRenkeiUtil |
| - | JKKHttpCommunicator.printDebugLog | JKKHttpCommunicator | - | Calls printDebugLog in JKKHttpCommunicator |
| - | JBSbatACInsentetivePrcInfoSaksei.isNull | JBSbatACInsentetivePrcInfoSaksei | - | Calls isNull in JBSbatACInsentetivePrcInfoSaksei |
| - | JBSbatAKCHSeikyYsoInfMake.isNull | JBSbatAKCHSeikyYsoInfMake | - | Calls isNull in JBSbatAKCHSeikyYsoInfMake |
| - | JBSbatKKCashPostAddMail.printDebugLog | JBSbatKKCashPostAddMail | - | Calls printDebugLog in JBSbatKKCashPostAddMail |
| - | JBSbatKKOpsvkeiDelTrgtChsht.initData | JBSbatKKOpsvkeiDelTrgtChsht | - | Calls initData in JBSbatKKOpsvkeiDelTrgtChsht |
| R | JCCBPCommon.getOpeDate | JCCBPCommon | - | Calls getOpeDate to retrieve the operational date |
| - | JFUBaseCC.executeSC | JFUBaseCC | - | Calls executeSC in JFUBaseCC (base class) |
| - | JFUBaseCC.ignoreSearchError | JFUBaseCC | - | Calls ignoreSearchError in JFUBaseCC |
| - | JFUBaseCC.initData | JFUBaseCC | - | Calls initData in JFUBaseCC (base class) |
| - | JFUBaseUtil.executeSC | JFUBaseUtil | - | Calls executeSC in JFUBaseUtil |
| - | JFUBaseUtil.ignoreSearchError | JFUBaseUtil | - | Calls ignoreSearchError in JFUBaseUtil |
| - | JFUBaseUtil.initData | JFUBaseUtil | - | Calls initData in JFUBaseUtil |
| - | JFUBPCommon.executeSC | JFUBPCommon | - | Calls executeSC in JFUBPCommon |
| R | JFUBaseCC.getMaxTempTempleteKey | JFUBaseCC | - | Calls getMaxTempTempleteKey for template retrieval |
| R | JFUBaseCC.getTemplateList | JFUBaseCC | - | Calls getTemplateList for template list retrieval |
| R | JFUBaseCC.getTemplateListValue | JFUBaseCC | - | Calls getTemplateListValue for template list value retrieval |
| R | JFUBaseCC.getTemplateValue | JFUBaseCC | - | Calls getTemplateValue for template value retrieval |
| R | JFUBaseUtil.getMaxTempTempleteKey | JFUBaseUtil | - | Calls getMaxTempTempleteKey |
| R | JFUBaseUtil.getTemplateList | JFUBaseUtil | - | Calls getTemplateList |
| R | JFUBaseUtil.getTemplateListValue | JFUBaseUtil | - | Calls getTemplateListValue |
| R | JFUBaseUtil.getTemplateValue | JFUBaseUtil | - | Calls getTemplateValue |
| - | JACBatCommon.isNull (used in method) | JACBatCommon | - | Used for null checks on input fields |

### Business-Critical Service Component Calls (SC Code Inferred from Template IDs)

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| C | setInMapKkOpSvcKeiToroku / executeSC (Template ID 35) | EKK2811D010SC | EKK2811D010CBSMsg | Equipment option service contract registration (router): inserts new equipment option service contract record |
| R | setInMapKkOpSvcKeiListShokai / executeSC (Template ID KKOP_SVKEI_LIST_SHOKAI) | EKK2811B503SC | EKK2811B503CBSMsg | Equipment option service contract list inquiry (front): queries existing equipment option service contracts |
| R | setInMapKkOpSvcKeiShosa / executeSC (Template ID 36) | EKK2811C030SC | EKK2811C030CBSMsg | Equipment option service contract inquiry (router): queries specific router equipment option service contract |
| U | setInMapKkOpSvcKeiShosa / executeSC (Template ID EKK2811C050) | EKK2811C050SC | EKK2811C050CBSMsg | Equipment option service contract inquiry/contract completion (router): updates contract status for in-service contracts |
| R | setInMapKktkSvcKeiUqSearch / executeSC (Template ID 27) | EKK0341A010SC | EKK0341A010CBSMsg | Equipment provision service contract unique inquiry: queries equipment provision service contract for unique lookup |
| C | setEKK2811C070 / executeSC (Template ID EKK2811C070) | EKK2811C070SC | EKK2811C070CBSMsg | Equipment option service contract start (router): registers service start date and activates the equipment option service contract |
| C | setInMapKkOpSvcKeiToroku / executeSC (VA path) | EKK2811D010SC | EKK2811D010CBSMsg | Equipment option service contract registration (VA): registers VA equipment option service contract |
| R | setInMapKkOpSvcKeiShosa / executeSC (VA path) | EKK2811C030SC | EKK2811C030CBSMsg | Equipment option service contract inquiry (VA): queries VA equipment option service contract |
| U | setInMapKkOpSvcKeiPcrsHenko / executeSC (Template ID 38) | EKK2811C250SC | EKK2811C250CBSMsg | Equipment option service contract price plan change: updates pricing plan for in-service multifunc router |
| U | setInMapKkOpSvcKeiPcrsHenkoKakutei / executeSC (Template ID 39) | EKK2811C260SC | EKK2811C260CBSMsg | Equipment option service contract price plan change confirmation: confirms and finalizes the pricing plan change |
| U | setEKK2811C240 / executeSC (Template ID EKK2811C240) | EKK2811C240SC | EKK2811C240CBSMsg | Equipment option service contract processing-in-progress price plan change: changes pricing plan for contracts being processed |
| C | hakkoSOD (SOD code 402) | - | SOD | Service order data registration (multifunc router setup/change, router function/registration) |
| C | hakkoSOD (SOD code 418) | - | SOD | Service order data registration (multifunc router setup/change, wireless/wired change) |
| R | setNewRtPcrs | - | - | Sets new route pricing course code in tempData |

### Template ID to SC Code Mapping

| Template ID | Inferred SC Code | SC Business Meaning |
|-------------|-----------------|---------------------|
| EKK2811D010 | EKK2811D010SC | Equipment option service contract registration |
| EKK2811C030 | EKK2811C030SC | Equipment option service contract inquiry |
| EKK2811C050 | EKK2811C050SC | Equipment option service contract contract completion |
| EKK2811C070 | EKK2811C070SC | Equipment option service contract start |
| EKK2811C240 | EKK2811C240SC | Equipment option service contract processing-in-progress price plan change |
| EKK2811C250 | EKK2811C250SC | Equipment option service contract price plan change |
| EKK2811C260 | EKK2811C260SC | Equipment option service contract price plan change confirmation |
| EKK2811B503 | EKK2811B503SC | Equipment option service contract list inquiry (front) |
| EKK0341A010 | EKK0341A010SC | Equipment provision service contract unique inquiry |

### Entity/DB Table References

Based on the EKK2811* SC code pattern and CBS message class naming conventions:
- Primary entity: **KK_T_OPSVKEI** (Equipment Option Service Contract table) - referenced via EKK2811* CBS messages
- Primary entity: **KK_T_KKTK_SVC_KEI** (Equipment Provision Service Contract table) - referenced via EKK0341* CBS messages
- Service Order Data: **SOD table** - referenced via hakkoSOD method calls

## 5. Dependency Trace

### Caller Analysis

The method is called from three locations within JFUSetVariTsushinKikiMskmCC:

| # | Caller | Call Chain |
|---|--------|-----------|
| 1 | JFUSetVariTsushinKikiMskmCC (line 1183) | setKkOpSvcKeiToroku called from main processing method during low-speed multifunc router ONU exchange work |
| 2 | JFUSetVariTsushinKikiMskmCC (line 1334) | setKkOpSvcKeiToroku called from equipment provision service contract loop iteration |
| 3 | JFUSetVariTsushinKikiMskmCC (line 1456) | setKkOpSvcKeiToroku called from multifunc router application processing |

All three callers are internal methods within the same class JFUSetVariTsushinKikiMskmCC. The method acts as a shared sub-component for equipment option service contract registration.

### Terminal Operations (All SC / CRUD / Entity Endpoints)

| # | Terminal Operation | Type | Details |
|---|-------------------|------|---------|
| 1 | executeSC (EKK2811D010SC) | C | Equipment option service contract registration (router/VA) |
| 2 | executeSC (EKK2811B503SC) | R | Equipment option service contract list inquiry (front) |
| 3 | executeSC (EKK2811C030SC) | R | Equipment option service contract inquiry (router/VA) |
| 4 | executeSC (EKK2811C050SC) | U | Equipment option service contract contract completion |
| 5 | executeSC (EKK0341A010SC) | R | Equipment provision service contract unique inquiry |
| 6 | executeSC (EKK2811C070SC) | C | Equipment option service contract start |
| 7 | executeSC (EKK2811C250SC) | U | Equipment option service contract price plan change |
| 8 | executeSC (EKK2811C260SC) | U | Equipment option service contract price plan change confirmation |
| 9 | executeSC (EKK2811C240SC) | U | Equipment option service contract processing-in-progress price plan change |
| 10 | hakkoSOD (SOD 402/418) | C | Service order data registration |
| 11 | getTemplateValue | R | Template value retrieval from inMap |
| 12 | getMaxTempTempleteKey | R | Template key retrieval from inMap |
| 13 | getTemplateList | R | Template list retrieval from inMap |
| 14 | setNewRtPcrs | - | Route pricing course code setup |
| 15 | printDebugLog | - | Debug logging (multiple call sites) |
| 16 | isShukkaZumi | - | Shipped status check |
| 17 | JCCBPCommon.getOpeDate | R | Operational date retrieval |

### Data Flow Summary

The method follows this call chain: Screen/Workflow (JFUSetVariTsushinKikiMskmCC) -> setKkOpSvcKeiToroku -> executeSC (various EKK2811*/EKK0341A010 SCs) -> Database (KK_T_OPSVKEI, KK_T_KKTK_SVC_KEI) -> SOD registration.

## 6. Per-Branch Detail Blocks

**Block 1** — [INITIALIZATION] (L2412-2430)

> Extract input parameters from the request map and determine the router pricing course code based on whether a wired router function is specified.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `inMap = param.getData(fixedText)` // Retrieve input map from request parameter |
| 2 | SET | `workLst = (ArrayList<Object>)inMap.get(KKTK_SVKEI_ADD_LIST)` // Get registered equipment list |
| 3 | SET | `inParamMap = (HashMap)workLst.get(I_ZERO)` // Get first element as input parameter map |
| 4 | SET | `inParamSysId = (String)inParamMap.get(IN_PARAM_SYSID)` // Extract SYSID [-> IN_PARAM_SYSID="kk0341_sysid"] |
| 5 | SET | `inParamIdoDiv = (String)inParamMap.get(IN_PARAM_IDO_DIV)` // Extract displacement type [-> IN_PARAM_IDO_DIV="ido_div"] |
| 6 | SET | `inParamSvkeiKaisenUwNo = (String)inMap.get("svc_kei_kaisen_ucwk_no")` // Service contract migration work number |
| 7 | SET | `inParamOwnTknRouterKind = (String)inMap.get("own_tkn_router_kind")` // Retained multifunc router type |
| 8 | SET | `inParamhmpinKktkSvcKeiNoVa = (String)inMap.get("hmpin_kktk_svc_kei_no_va")` // Returned equipment provision service contract number (VA) |
| 9 | SET | `inParamRouterkinoNm = (String)inMap.get("router_kino_nm")` // Router function name |
| 10 | SET | `pcrsCd = ""` // Initialize pricing course code |
| 11 | SET | `pplanCd = ""` // Initialize pricing plan code |

**Block 1.1** — [IF] `ROUTER_KINO_YUSEN.equals(inParamRouterkinoNm)` (L2432-2444)

> Determine the pricing course code and pricing plan code based on whether a wired router function is specified.

| # | Type | Code |
|---|------|------|
| 1 | IF | `ROUTER_KINO_YUSEN.equals(inParamRouterkinoNm)` [ROUTER_KINO_YUSEN="無線ルーター機能"] |
| 2 | SET | `pcrsCd = CD00134_G01` // [-> "G01"] Wired router function code |
| 3 | SET | `pplanCd = CD00565_PG0101` // [-> "PG0101"] Wired router function pricing plan |
| 4 | ELSE | |
| 5 | SET | `pcrsCd = CD00134_G02` // [-> "G02"] Wireless router function code |
| 6 | SET | `pplanCd = CD00565_PG0201` // [-> "PG0201"] Wireless router function pricing plan |
| 7 | CALL | `setNewRtPcrs(tempData, pcrsCd)` // Store pricing course code in tempData |

**Block 2** — [IF] `isNull(inParamOwnTknRouterKind) || OWN_TKN_RT_KIND_0.equals(inParamOwnTknRouterKind)` (L2448-2639)

> Branch for non-multifunc or low-speed multifunc router. This is the primary registration path where new equipment option service contracts are created from scratch.

| # | Type | Code |
|---|------|------|
| 1 | IF | `isNull(inParamOwnTknRouterKind) || OWN_TKN_RT_KIND_0.equals(inParamOwnTknRouterKind)` [OWN_TKN_RT_KIND_0="0"] |

**Block 2.1** — [NON-MULTIFUNC / LOW-SPEED MULTIFUNC ROUTER BRANCH] (L2453-2641)

> Register router equipment option service contract, search for existing multifunc phone contracts, and conditionally activate.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `initData(param, fixedText, IN_COLUMN_LIST_35)` // Reset user data for router contract registration |
| 2 | CALL | `setInMapKkOpSvcKeiToroku(param, fixedText, KK2801_KKOP_SVC_CD_G01, pcrsCd, pplanCd, kktkSvcKeiNo, inParamSysId, mskmDtlNo, inParamIdoDiv, seikyKeiNoNet, KK2811_KIKI_RNTAI_KEI_CHGECHU_FLG_0, lastUpdDtm)` // Set up router equipment registration |
| 3 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_35, TEMPLATE_ID_35_DETAIL, IN_COLUMN_LIST_35, ERROR_COLUMN_35)` // Execute registration SC |
| 4 | SET | `lastUpdDtm = getTemplateValue(inMap, getMaxTempTempleteKey(inMap, TEMP_TEMPLATE_KEY_35), EKK2811D010CBSMsg.UPD_DTM)` // Retrieve update timestamp |
| 5 | SET | `kkopSvcKeiNoRT = getTemplateValue(inMap, getMaxTempTempleteKey(inMap, TEMP_TEMPLATE_KEY_35), EKK2811D010CBSMsg.KKOP_SVC_KEI_NO)` // Retrieve new contract number |
| 6 | CALL | `initData(param, fixedText, IN_COLUMN_LIST_KKOP_SVKEI_LIST_SHOKAI)` // Reset for multifunc phone search |
| 7 | CALL | `setInMapKkOpSvcKeiListShokai(param, fixedText, inParamSysId, inParamSvkeiKaisenUwNo)` // Set up search parameters |
| 8 | CALL | `ignoreSearchError(param, fixedText)` // Disable search error |
| 9 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_KKOP_SVKEI_LIST_SHOKAI, TEMPLATE_ID_DETAIL_KKOP_SVKEI_LIST_SHOKAI, IN_COLUMN_LIST_KKOP_SVKEI_LIST_SHOKAI, BLANK)` // Execute search SC |
| 10 | SET | `kkOpSvcKeiNoTEL = null` // Initialize multifunc phone contract number |
| 11 | SET | `taknkikiModelCd = null` // Initialize home equipment model code |
| 12 | SET | `kikiSeizoNo = null` // Initialize equipment serial number |
| 13 | SET | `kktkSvcKeiStat = null` // Initialize equipment provision service contract status |

**Block 2.2** — [FOR LOOP] Iterate through template list to extract existing multifunc router data (L2490-2515)

> Loop through the returned equipment option service contract list and extract data for the matching equipment provision service contract number.

| # | Type | Code |
|---|------|------|
| 1 | FOR | `for (HashMap dataMap : getTemplateList(inMap, getMaxTempTempleteKey(inMap, TEMP_TEMPLATE_KEY_KKOP_SVKEI_LIST_SHOKAI), TEMPLATE_ID_DETAIL_KKOP_SVKEI_LIST_SHOKAI))` |
| 2 | SET | `kkopSvcKeiStat = (String)dataMap.get(EKK2811B503CBSMsg1List.KKOP_SVC_KEI_STAT)` |
| 3 | IF | `KKOP_SVC_KEI_STAT_MUKO.contains(kkopSvcKeiStat)` [CD01616_910, CD01616_920] -> continue |
| 4 | SET | `kkopSvcCd = (String)dataMap.get(EKK2811B503CBSMsg1List.KKOP_SVC_CD)` |
| 5 | SET | `kktkSvcKeiNoKkop = (String)dataMap.get(EKK2811B503CBSMsg1List.KKTK_SVC_KEI_NO)` |
| 6 | IF | `!kktkSvcKeiNoKkop.equals(kktkSvcKeiNo)` -> set `inParamhmpinKktkSvcKeiNoVa = kktkSvcKeiNo`, continue |
| 7 | IF | `KK2801_KKOP_SVC_CD_G02.equals(kkopSvcCd)` -> Extract kkOpSvcKeiNoTEL, taknkikiModelCd, kikiSeizoNo, kktkSvcKeiStat |

**Block 2.3** — [IF] `isNull(kkOpSvcKeiNoTEL)` (L2519-2540)

> If no multifunc phone exists, perform router inquiry to set up the router contract.

| # | Type | Code |
|---|------|------|
| 1 | IF | `isNull(kkOpSvcKeiNoTEL)` // Multifunc phone does not exist |
| 2 | CALL | `initData(param, fixedText, IN_COLUMN_LIST_36)` // Reset user data for router inquiry |
| 3 | CALL | `setInMapKkOpSvcKeiShosa(param, fixedText, kkopSvcKeiNoRT, inParamIdoDiv, lastUpdDtm)` // Set up router inquiry parameters |
| 4 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_36, TEMPLATE_ID_36_DETAIL, IN_COLUMN_LIST_36, ERROR_COLUMN_36)` // Execute inquiry SC |
| 5 | SET | `lastUpdDtm = getTemplateValue(inMap, getMaxTempTempleteKey(inMap, TEMP_TEMPLATE_KEY_36), EKK2811C030CBSMsg.UPD_DTM)` |
| 6 | SET | `kkOpSvcKeiNoRT = getTemplateValue(inMap, getMaxTempTempleteKey(inMap, TEMP_TEMPLATE_KEY_36), EKK2811C030CBSMsg.KKOP_SVC_KEI_NO)` |

**Block 2.4** — [ELSE] Multifunc phone exists — Branch on contract status (L2541-2617)

> When multifunc phone exists, check the service contract status and take appropriate action based on whether the service is in inquiry, in-service, or contract-ended state.

| # | Type | Code |
|---|------|------|
| 1 | ELSE | // kkOpSvcKeiNoTEL is not null - multifunc phone exists |
| 2 | SET | `geneAddDtmAft = null` |
| 3 | IF | `CD00037_020.equals(svcKeiStatNet) || CD00056_020.equals(kktkSvcKeiStat)` [020: Inquiry completed] |
| 4 | THEN | Same router inquiry as Block 2.3, plus retrieve GENE_ADD_DTM |
| 5 | ELSE_IF | `CD00056_030.equals(kktkSvcKeiStat) || CD00056_100.equals(kktkSvcKeiStat)` [030: Contract ended, 100: In service] |
| 6 | THEN | `initData, setInMapKkOpSvcKeiShosa, executeSC(EKK2811C050), getTemplateValue` // Contract completion path |
| 7 | END_IF | |

**Block 2.4.1** — [IF] `CD00056_100.equals(kktkSvcKeiStat) && CD00037_100.equals(svcKeiStatNet)` (L2596-2617)

> When equipment provision service contract is in service (100) AND net service contract is in service (100), execute service agreement inquiry and contract start processing.

| # | Type | Code |
|---|------|------|
| 1 | IF | `CD00056_100.equals(kktkSvcKeiStat) && CD00037_100.equals(svcKeiStatNet)` |
| 2 | CALL | `initData(param, fixedText, IN_COLUMN_LIST_27)` // Reset for equipment provision contract inquiry |
| 3 | CALL | `setInMapKktkSvcKeiUqSearch(param, fixedText, kktkSvcKeiNo)` // Set up unique inquiry |
| 4 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_27, TEMPLATE_ID_27_DETAIL, IN_COLUMN_LIST_27, ERROR_COLUMN_27)` // Execute SC |
| 5 | SET | `svcStaYmd = getTemplateListValue(inMap, getMaxTempTempleteKey(inMap, TEMP_TEMPLATE_KEY_27), TEMPLATE_ID_27_DETAIL, EKK0341A010CBSMsg1List.SVC_STA_YMD, 0)` // Get service start date |
| 6 | SET | `dojiStaUm = CD00002_0` // Default: same day |
| 7 | IF | `JCCBPCommon.getOpeDate(null).compareTo(svcStaYmd) < 0` |
| 8 | THEN | `dojiStaUm = CD00002_1` // [-> "1"] Future date (service start is in the future) |
| 9 | CALL | `initData(param, fixedText, IN_COLUMN_LIST_EKK2811C070)` // Reset for contract start |
| 10 | CALL | `setEKK2811C070(param, fixedText, kkOpSvcKeiNoRT, inParamIdoDiv, lastUpdDtm, dojiStaUm)` // Set up contract start |
| 11 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_EKK2811C070, TEMPLATE_ID_EKK2811C070_DETAIL, IN_COLUMN_LIST_EKK2811C070, ERROR_COLUMN_EKK2811C070)` // Execute start SC |
| 12 | SET | `lastUpdDtm = getTemplateValue(inMap, getMaxTempTempleteKey(inMap, TEMP_TEMPLATE_KEY_EKK2811C070), EKK2811C030CBSMsg.UPD_DTM)` |
| 13 | SET | `geneAddDtmAft = getTemplateValue(inMap, getMaxTempTempleteKey(inMap, TEMP_TEMPLATE_KEY_EKK2811C070), EKK2811C260CBSMsg.GENE_ADD_DTM)` |

**Block 2.5** — [IF] `isShukkaZumi(kikiSeizoNo)` (L2618-2624)

> If the equipment has been shipped, register service order data (SOD) for multifunc router setup/change.

| # | Type | Code |
|---|------|------|
| 1 | IF | `isShukkaZumi(kikiSeizoNo)` |
| 2 | CALL | `printDebugLog("...サービスオーダー登録(多機能ルーター設定・変更(ルーター機能・登録))..." + kikiSeizoNo)` |
| 3 | CALL | `hakkoSOD(handle, param, fixedText, kktkSvcKeiNo, taknkikiModelCd, kikiSeizoNo, kkOpSvcKeiNoRT, null, geneAddDtmAft, CD01105_402)` |

**Block 2.6** — [IF] `!isNull(inParamhmpinKktkSvcKeiNoVa)` (L2628-2685)

> VA (Virtual Access) equipment retention branch. When VA equipment is retained but multifunc is not, register VA equipment option service contract.

| # | Type | Code |
|---|------|------|
| 1 | IF | `!isNull(inParamhmpinKktkSvcKeiNoVa)` // VA equipment is retained |
| 2 | SET | `pcrsCdVa = EMPTY` |
| 3 | SET | `pplanCdVa = EMPTY` |
| 4 | IF | `CD00134_A31.equals(pcrsCdTel)` [A31: Phone adapter No. 1] |
| 5 | THEN | `pcrsCdVa = CD00134_G03` [G03], `pplanCdVa = CD00565_PG0301` [PG0301] |
| 6 | ELSE_IF | `CD00134_A32.equals(pcrsCdTel)` [A32: Phone adapter No. 2] |
| 7 | THEN | `pcrsCdVa = CD00134_G04` [G04], `pplanCdVa = CD00565_PG0401` [PG0401] |
| 8 | CALL | `initData(param, fixedText, IN_COLUMN_LIST_35)` // Reset for VA registration |
| 9 | CALL | `setInMapKkOpSvcKeiToroku(param, fixedText, KK2801_KKOP_SVC_CD_G02, pcrsCdVa, pplanCdVa, kktkSvcKeiNo, inParamSysId, mskmDtlNo, inParamIdoDiv, seikyKeiNoTel, KK2811_KIKI_RNTAI_KEI_CHGECHU_FLG_1, lastUpdDtm)` |
| 10 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_35, TEMPLATE_ID_35_DETAIL, IN_COLUMN_LIST_35, ERROR_COLUMN_35)` // Execute VA registration SC |
| 11 | SET | `lastUpdDtm = getTemplateValue(inMap, getMaxTempTempleteKey(inMap, TEMP_TEMPLATE_KEY_35), EKK2811D010CBSMsg.UPD_DTM)` |
| 12 | SET | `kkopSvcKeiNo = getTemplateValue(inMap, getMaxTempTempleteKey(inMap, TEMP_TEMPLATE_KEY_35), EKK2811D010CBSMsg.KKOP_SVC_KEI_NO)` |
| 13 | CALL | `initData(param, fixedText, IN_COLUMN_LIST_36)` // Reset for VA inquiry |
| 14 | CALL | `setInMapKkOpSvcKeiShosa(param, fixedText, kkopSvcKeiNo, inParamIdoDiv, lastUpdDtm)` // Set up VA inquiry |
| 15 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_36, TEMPLATE_ID_36_DETAIL, IN_COLUMN_LIST_36, ERROR_COLUMN_36)` // Execute VA inquiry SC |
| 16 | SET | `lastUpdDtm = getTemplateValue(inMap, getMaxTempTempleteKey(inMap, TEMP_TEMPLATE_KEY_36), EKK2811C030CBSMsg.UPD_DTM)` |
| 17 | NOTE | Cancel/termination processing for VA is explicitly skipped (VA equipment is in inquiry or contract-end state, so it is excluded) |

**Block 3** — [ELSE] Dedicated multifunc router branch (L2688-2807)

> Branch for dedicated multifunc router. Queries existing contracts and performs price plan changes or contract processing based on the current status.

| # | Type | Code |
|---|------|------|
| 1 | ELSE | // inParamOwnTknRouterKind is not null and not "0" - dedicated multifunc router |
| 2 | CALL | `initData(param, fixedText, IN_COLUMN_LIST_KKOP_SVKEI_LIST_SHOKAI)` // Reset for existing contract search |
| 3 | CALL | `setInMapKkOpSvcKeiListShokai(param, fixedText, inParamSysId, inParamSvkeiKaisenUwNo)` // Set up search parameters |
| 4 | CALL | `ignoreSearchError(param, fixedText)` // Disable search error |
| 5 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_KKOP_SVKEI_LIST_SHOKAI, TEMPLATE_ID_DETAIL_KKOP_SVKEI_LIST_SHOKAI, IN_COLUMN_LIST_KKOP_SVKEI_LIST_SHOKAI, BLANK)` // Execute search SC |
| 6 | SET | `kkOpSvcKeiNoRT = null` |
| 7 | SET | `geneAddDtmBef = null` |
| 8 | SET | `taknkikiModelCd = null` |
| 9 | SET | `kikiSeizoNo = null` |
| 10 | SET | `kktkSvcKeiStat = null` |
| 11 | SET | `rtKkopSvcKeiStat = EMPTY` |

**Block 3.1** — [FOR LOOP] Extract multifunc router data from search results (L2700-2730)

> Loop through the search results and extract the multifunc router data.

| # | Type | Code |
|---|------|------|
| 1 | FOR | `for (HashMap dataMap : getTemplateList(inMap, getMaxTempTempleteKey(inMap, TEMP_TEMPLATE_KEY_KKOP_SVKEI_LIST_SHOKAI), TEMPLATE_ID_DETAIL_KKOP_SVKEI_LIST_SHOKAI))` |
| 2 | SET | `kkopSvcKeiStat = (String)dataMap.get(EKK2811B503CBSMsg1List.KKOP_SVC_KEI_STAT)` |
| 3 | IF | `KKOP_SVC_KEI_STAT_MUKO.contains(kkopSvcKeiStat)` -> continue |
| 4 | SET | `kkopSvcCd = (String)dataMap.get(EKK2811B503CBSMsg1List.KKOP_SVC_CD)` |
| 5 | IF | `KK2801_KKOP_SVC_CD_G01.equals(kkopSvcCd)` |
| 6 | THEN | Extract: kkOpSvcKeiNoRT, geneAddDtmBef, taknkikiModelCd, kikiSeizoNo, kktkSvcKeiStat, rtKkopSvcKeiStat |

**Block 3.2** — [IF] `CD01616_100.equals(rtKkopSvcKeiStat)` (L2733-2762)

> When the multifunc router status is 100 (in service), execute price plan change (EKK2811C250) and confirmation (EKK2811C260).

| # | Type | Code |
|---|------|------|
| 1 | IF | `CD01616_100.equals(rtKkopSvcKeiStat)` // Service is in progress |
| 2 | CALL | `initData(param, fixedText, IN_COLUMN_LIST_38)` // Reset for price plan change |
| 3 | CALL | `setInMapKkOpSvcKeiPcrsHenko(param, fixedText, kkOpSvcKeiNoRT, inParamIdoDiv, mskmDtlNo, pcrsCd, pplanCd, lastUpdDtm)` // Set up price plan change parameters |
| 4 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_38, TEMPLATE_ID_38_DETAIL, IN_COLUMN_LIST_38, ERROR_COLUMN_38)` // Execute price plan change SC |
| 5 | SET | `lastUpdDtm = getTemplateValue(inMap, getMaxTempTempleteKey(inMap, TEMP_TEMPLATE_KEY_38), EKK2811D010CBSMsg.UPD_DTM)` |
| 6 | CALL | `initData(param, fixedText, IN_COLUMN_LIST_39)` // Reset for price plan change confirmation |
| 7 | CALL | `setInMapKkOpSvcKeiPcrsHenkoKakutei(param, fixedText, kkOpSvcKeiNoRT, lastUpdDtm)` // Set up confirmation parameters |
| 8 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_39, TEMPLATE_ID_39_DETAIL, IN_COLUMN_LIST_39, ERROR_COLUMN_39)` // Execute confirmation SC |
| 9 | SET | `lastUpdDtm = getTemplateValue(inMap, getMaxTempTempleteKey(inMap, TEMP_TEMPLATE_KEY_39), EKK2811D010CBSMsg.UPD_DTM)` |
| 10 | SET | `geneAddDtmAft = getTemplateValue(inMap, getMaxTempTempleteKey(inMap, TEMP_TEMPLATE_KEY_39), EKK2811C260CBSMsg.GENE_ADD_DTM)` |

**Block 3.3** — [ELSE] Contract being processed — Execute EKK2811C240 (L2764-2786)

> When the multifunc router is NOT in service (received, inquiry done, or contract ended), execute the processing-in-progress price plan change.

| # | Type | Code |
|---|------|------|
| 1 | ELSE | // Not in service (received, inquiry, or contract ended) |
| 2 | CALL | `initData(param, fixedText, IN_COLUMN_LIST_EKK2811C240)` // Reset for processing-in-progress price plan change |
| 3 | CALL | `setEKK2811C240(param, fixedText, kkOpSvcKeiNoRT, pcrsCd, pplanCd, lastUpdDtm, mskmDtlNo, lastUpdDtm)` // Set up parameters |
| 4 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_EKK2811C240, TEMPLATE_ID_EKK2811C240_DETAIL, IN_COLUMN_LIST_EKK2811C240, ERROR_COLUMN_EKK2811C240)` // Execute SC |
| 5 | SET | `geneAddDtmAft = getTemplateValue(inMap, getMaxTempTempleteKey(inMap, TEMP_TEMPLATE_KEY_EKK2811C240), EKK2811C240CBSMsg.UPD_DTM)` |
| 6 | SET | `lastUpdDtm = getTemplateValue(inMap, getMaxTempTempleteKey(inMap, TEMP_TEMPLATE_KEY_EKK2811C240), EKK2811C240CBSMsg.UPD_DTM)` |

**Block 3.4** — [IF] `CD00056_100.equals(kktkSvcKeiStat) && CD00037_100.equals(svcKeiStatNet)` (L2789-2807)

> When both equipment provision service contract and net service contract are in service, execute service agreement inquiry and contract start.

| # | Type | Code |
|---|------|------|
| 1 | IF | `CD00056_100.equals(kktkSvcKeiStat) && CD00037_100.equals(svcKeiStatNet)` |
| 2 | CALL | `initData(param, fixedText, IN_COLUMN_LIST_27)` // Reset for contract inquiry |
| 3 | CALL | `setInMapKktkSvcKeiUqSearch(param, fixedText, kktkSvcKeiNo)` |
| 4 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_27, TEMPLATE_ID_27_DETAIL, IN_COLUMN_LIST_27, ERROR_COLUMN_27)` |
| 5 | SET | `svcStaYmd = getTemplateListValue(inMap, getMaxTempTempleteKey(inMap, TEMP_TEMPLATE_KEY_27), TEMPLATE_ID_27_DETAIL, EKK0341A010CBSMsg1List.SVC_STA_YMD, 0)` |
| 6 | SET | `dojiStaUm = CD00002_0` // Same day |
| 7 | IF | `JCCBPCommon.getOpeDate(null).compareTo(svcStaYmd) < 0` |
| 8 | THEN | `dojiStaUm = CD00002_1` // Future date |
| 9 | CALL | `initData(param, fixedText, IN_COLUMN_LIST_EKK2811C070)` // Reset for contract start |
| 10 | CALL | `setEKK2811C070(param, fixedText, kkOpSvcKeiNoRT, inParamIdoDiv, lastUpdDtm, dojiStaUm)` |
| 11 | CALL | `executeSC(handle, param, fixedText, TEMPLATE_ID_EKK2811C070, TEMPLATE_ID_EKK2811C070_DETAIL, IN_COLUMN_LIST_EKK2811C070, ERROR_COLUMN_EKK2811C070)` |
| 12 | SET | `geneAddDtmAft = getTemplateValue(inMap, getMaxTempTempleteKey(inMap, TEMP_TEMPLATE_KEY_EKK2811C070), EKK2811C260CBSMsg.GENE_ADD_DTM)` |
| 13 | SET | `lastUpdDtm = getTemplateValue(inMap, getMaxTempTempleteKey(inMap, TEMP_TEMPLATE_KEY_EKK2811C070), EKK2811C030CBSMsg.UPD_DTM)` |

**Block 4** — [IF] `isShukkaZumi(kikiSeizoNo)` (L2810-2817)

> If equipment is shipped, register SOD for multifunc router setup/change (wireless/wired change) with SOD code 418.

| # | Type | Code |
|---|------|------|
| 1 | IF | `isShukkaZumi(kikiSeizoNo)` |
| 2 | CALL | `printDebugLog("...サービスオーダー登録(多機能ルーター設定・変更(ルーター機能・無線/有線変更))..." + kikiSeizoNo)` |
| 3 | CALL | `hakkoSOD(handle, param, fixedText, kktkSvcKeiNo, taknkikiModelCd, kikiSeizoNo, kkOpSvcKeiNoRT, geneAddDtmBef, geneAddDtmAft, CD01105_418)` |

**Block 5** — [RETURN] (L2819)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return lastUpdDtm` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `kkop_svc_kei_no` | Field | Equipment option service contract number — unique identifier for an equipment option service contract record |
| `kktk_svc_kei_no` | Field | Equipment provision service contract number — identifies the main equipment provision service contract |
| `seiky_kei_no` | Field | Billing contract number — the billing contract associated with a service |
| `seiky_kei_no_net` | Field | Billing contract number for net service — billing contract for the internet service line |
| `seiky_kei_no_tel` | Field | Billing contract number for phone service — billing contract for the telephone service line |
| `mskm_dtl_no` | Field | Application detail number — identifies a specific line item within a service application |
| `last_upd_dtm` | Field | Last update datetime — timestamp of the last modification for optimistic locking |
| `ido_div` | Field | Displacement type (migration status) — indicates whether this is a service migration |
| `pcrs_cd` | Field | Pricing course code — code identifying the pricing plan/course for a service |
| `pcrs_cd_tel` | Field | Pricing course code for phone — determines VA equipment pricing plan |
| `svc_kei_stat_net` | Field | Service contract status for net (020=inquiry done, 100=in service) |
| `own_tkn_router_kind` | Field | Retained multifunc router type — determines if router is multifunction (0=low-speed multifunc) |
| `router_kino_nm` | Field | Router function name — literal string identifying the router type |
| `kkop_svc_kei_stat` | Field | Equipment option service contract status (910=cancel request, 920=cancelled, 100=in service) |
| `kkop_svc_cd` | Field | Equipment option service code (G01=router function, G02=multifunc phone function) |
| `kk2801_kkop_svc_cd_g01` | Constant | Equipment option service code G01 — router function |
| `kk2801_kkop_svc_cd_g02` | Constant | Equipment option service code G02 — multifunc phone function |
| `kk2811_kiki_rntai_kei_chgchyu_flg` | Field | Equipment replacement contract change processing flag (0=not processing, 1=processing) |
| `kiki_seizo_no` | Field | Equipment serial number — unique manufacturing serial number |
| `taknkiki_model_cd` | Field | Home equipment model code — model identifier for the installed equipment |
| `gene_add_dtm` | Field | Generation/addition datetime — timestamp for contract generation or modification |
| `doji_sta_um` | Field | Simultaneous start flag (0=same day, 1=future date) — determines if service starts immediately or at a future date |
| `kk0341_sysid` | Field | K-Opticom customer base system ID — internal identifier for the customer account |
| `svc_kei_kaisen_ucwk_no` | Field | Service contract migration work number — tracking ID for contract migration operations |
| `hmpin_kktk_svc_kei_no_va` | Field | Returned equipment provision service contract number (VA) — for returned/retained VA equipment |
| SOD | Acronym | Service Order Data — external order fulfillment system for equipment and service provisioning |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service |
| VA | Acronym | Virtual Access — virtual access service type in the K-Opticom network |
| ENUM | Business term | ENUM service — telephone numbering mapping service in the K-Opticom ecosystem |
| SC | Acronym | Service Component — the service layer component that handles database operations |
| CBS | Acronym | CBS Message — CBS (Common Business System) message classes that define field mappings for SC operations |
| EKK2811* | Acronym | Equipment option service CBS module — CBS message classes for equipment option service operations |
| EKK0341* | Acronym | Equipment provision service CBS module — CBS message classes for equipment provision service operations |
| K-Opticom | Business term | K-Opticom — the telecom carrier whose customer base system this is |
