# Business Logic — KKA16701SFLogic.commonKnrnChkForOneStop() [222 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.web.webview.KKA16701SF.KKA16701SFLogic` |
| Layer | Service / Web Business Logic (Web View Layer) |
| Module | `KKA16701SF` (Package: `eo.web.webview.KKA16701SF`) |

## 1. Role

### KKA16701SFLogic.commonKnrnChkForOneStop()

This method performs comprehensive validation for the **One-Stop (ワンストップ) service contract modification request** workflow — a single-page service where customers can modify or discontinue their telecom and TV subscriptions collectively. The term "ワンストップ" (One-Stop) refers to K-Opticom's unified service modification portal that aggregates multiple service types (internet, telephone, mobile, TV) into a single transaction.

The method executes a sequential, multi-stage validation pipeline across four service component batches: **KKSV0820** validates the core identity triplet (sysid, service contract number, user ID); **KKSV0061** retrieves service status and eligibility data; **KKSV0062** fetches detailed pricing group, service code, rate code, and plan code information along with the customer's service history list to check for active services; **KKSV0463** and **KKSV0551** retrieve and validate disconnection reason code combinations for service transfer or discontinuation.

Design patterns used include: **delegation** (all heavy lifting is delegated to mapped service component batches), **guard clause** (early returns on validation failure with specific error codes E5002–E5006), and **message-passing** (via `OneStopDataBeanAccess.sendMessageString` for inter-component communication). This method serves as the central validation orchestrator called from `apiControl()` — it is the gatekeeper that determines whether the One-Stop modification can proceed.

If any validation fails, the method returns `false` and populates `warnList` with the corresponding error code. Only when all six validation gates pass does it return `true`, allowing the caller to proceed with the actual service modification.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["commonKnrnChkForOneStop()"])

    START --> GETBean["Get DataBean and request params: sysid, svc_kei_no, user_id, ido_rsn_dbri_cd, ido_rsn_cbri_cd"]
    GETBean --> GETOpeDate["Get opeDate via JCCWebCommon.getOpeDate()"]
    GETOpeDate --> KKS0820SET["Set KKSV0820 params: usecase=KKSV0820, op=KKSV0820OP"]
    KKS0820SET --> KKS0820MAP["Create KKSV0820 mapper and setKKSV082001CC()"]
    KKS0820MAP --> KKS0820EXEC["invokeService(KKSV0820)"]

    KKS0820EXEC --> CHK_SYSID{checkExistSysid result?}
    CHK_SYSID -->|false| ERR_SYSID["setReturnXml E5002: SYSID not found"]
    ERR_SYSID --> END_FAIL["Return false"]
    CHK_SYSID -->|true| CHK_SVCKEINO{checkExistSvcKeiNo result?}

    CHK_SVCKEINO -->|false| ERR_SVCKEINO["setReturnXml E5003: svc_kei_no not found"]
    ERR_SVCKEINO --> END_FAIL

    CHK_SVCKEINO -->|true| CHK_USERID{checkExistUserId result?}

    CHK_USERID -->|false| ERR_USERID["setReturnXml E5004: user_id not found"]
    ERR_USERID --> END_FAIL

    CHK_USERID -->|true| EXTRACT_CD["Extract cdDivListMap from KKSV082001CC codeMeishoKanriMap"]
    EXTRACT_CD --> OSBEAN["Create OneStopDataBeanAccess and send sysid, svc_kei_no, opeDate"]
    OSBEAN --> KKS0061SET["Set KKSV0061 params: UC=KKSV0061, OP=KKSV0061OP"]
    KKS0061SET --> KKS0061MAP["Set KKSV006101, KKSV006102, KKSV006103 SC mapping"]
    KKS0061MAP --> KKS0061EXEC["invokeService(KKSV0061)"]

    KKS0061EXEC --> KKS0061GET["Get KKSV006101, KKSV006102, KKSV006103, KKSV006104 SC from output"]
    KKS0061GET --> KKS0062SET["Set KKSV0062 params: UC=KKSV0062, OP=KKSV0062OP"]
    KKS0062SET --> KKS0062MAP["Set KKSV006201 through KKSV006223 SC mapping"]
    KKS0062MAP --> KKS0062EXEC["invokeService(KKSV0062)"]

    KKS0062EXEC --> KKS0062GET["Get KKSV006201, KKSV006205, KKSV006207, KKSV006208, KKSV006209, KKSV006210, KKSV006211, KKSV006221 SC"]
    KKS0062GET --> EXTRACT_FIELDS["Extract prc_grp_cd, svc_cd, prcs_cd, pplan_cd from EKK0081A010CBSMsg1List"]

    EXTRACT_FIELDS --> CHK_PRCGROUP{prc_grp_cd in 07 or 08 or 09 or 10?}
    CHK_PRCGROUP -->|true| GET_0062_12["getKKSV006212SC"]
    GET_0062_12 --> SVC_STAT_LOOP["Loop eKK0081B024CBSMsg1List and check svc_kei_stat"]
    CHK_PRCGROUP -->|false| SVC_STAT_LOOP
    SVC_STAT_LOOP --> GET_0062_23["getKKSV006223SC"]

    GET_0062_23 --> SVC_STAT_CHECK["Check svc_kei_stat == 100: set svcTkRrkFlg=1 if service active"]

    SVC_STAT_CHECK --> KKS0463SET["Set KKSV0463 params: UC=KKSV0463, OP=KKSV0463OP"]
    KKS0463SET --> KKS0463MAP["setKKSV046301SC with idoDiv=00054"]
    KKS0463MAP --> KKS0463EXEC["invokeService(KKSV0463)"]

    KKS0463EXEC --> KKS0551SET["Set KKSV0551 params: UC=KKSV0551, OP=KKSV0551OP"]
    KKS0551SET --> KKS0551MAP["setKKSV055101SC with idoRsnDbriCd"]
    KKS0551MAP --> KKS0551EXEC["invokeService(KKSV0551)"]

    KKS0551EXEC --> CHK_IDORSN{checkIdoRsnCdPair valid?}
    CHK_IDORSN -->|false| ERR_IDORSN["setReturnXml E5005: disconnection reason invalid"]
    ERR_IDORSN --> END_FAIL

    CHK_IDORSN -->|true| CHK_SVCIDO{checkSvcKeiIdoPsb service transfer possible?}
    CHK_SVCIDO -->|false| ERR_SVCIDO["setReturnXml E5006: service transfer not possible"]
    ERR_SVCIDO --> END_FAIL

    CHK_SVCIDO -->|true| END_SUCCESS["Return true"]
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| - | (none — no parameters) | - | - |
| 1 | sysid | String | System ID — the unique customer identifier extracted from the HTTP request map. Used to verify the customer exists in the system. |
| 2 | svc_kei_no | String | Service Contract Number — the unique identifier for a service detail line item. This is the primary key used to locate and validate the customer's service contract. |
| 3 | user_id | String | User ID — the authenticated user's login identifier, used to cross-reference access rights and existence. |
| 4 | ido_rsn_dbri_cd | String | Disconnection Reason Major Code (disconnection reason category code, dbri = major) — the primary disconnection reason code the customer selected for service modification or discontinuation. |
| 5 | ido_rsn_cbri_cd | String | Disconnection Reason Sub-Code (disconnection reason category code, cbri = sub) — the secondary disconnection reason code, validated in combination with the major code. |

**Instance fields and external state read:**

| Name | Type | Business Description |
|------|------|---------------------|
| `requestMap` | Map | HTTP request parameter map containing all incoming form/request data |
| `warnList` | List | Warning/error list to which failure messages are appended before returning false |
| `funcCode` | String | Function code used to tag error responses |
| `IF_ID` | String | Interface identifier used for error correlation and logging |
| `cdDivListMap` | Map | Map of code classification lists — updated with `rslt_cd_sbt_map` (result code subtype map) from KKSV082001CC output |
| `svc_cd` | String | Service code — instance field written with extracted service category (e.g., "01" = Net, "02" = Tel) |
| `prc_grp_cd` | String | Price group code — instance field written with the pricing group extracted from KKSV0062 output (e.g., "02" = Home Net, "07" = Mobile Wi-Fi) |
| `prcs_cd` | String | Process/Rate code — instance field written with the rate plan code extracted from KKSV0062 output |
| `pplan_cd` | String | Plan code — instance field written with the pricing plan code extracted from KKSV0062 output |
| `svcTkRrkFlg` | String | Service delivery history flag — set to "1" when an active service (status "100") is found in the service history list |
| `OS_IDO_DIV` | String (static final) | Fixed disconnection division constant = "00054" (contract change reservation cancellation) |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `KKSV0820_KKSV0820OPDBMapper.setKKSV082001CC` | KKSV082001CC | - | Prepares KKSV0820 operation input: sysid, svc_kei_no, user_id, code subtype list |
| - | `JCCBatCommon.invokeService` (KKSV0820) | KKSV0820OP | - | Executes KKSV0820 service batch: validates sysid, service contract number, and user ID existence |
| R | `JKKOneStopApiCommonUtil.checkExistSysid` | - | - | Reads output map to verify sysid was populated by KKSV0820 |
| R | `JKKOneStopApiCommonUtil.checkExistSvcKeiNo` | - | - | Reads output map to verify svc_kei_no was populated by KKSV0820 |
| R | `JKKOneStopApiCommonUtil.checkExistUserId` | - | - | Reads output map to verify user_id was populated by KKSV0820 |
| - | `JCCWebCommon.getOpeDate` | JCCWebCommon | - | Retrieves the current operational date (YYYYMMDDHHMMSS) for business date processing |
| - | `OneStopDataBeanAccess.sendMessageString` | - | - | Populates the OneStop data bean with sysid, svc_kei_no, and operational date for downstream service calls |
| - | `KKSV0061_KKSV0061OPDBMapper.setKKSV006101SC` | KKSV006101SC | - | Maps function code 1 for KKSV0061 service: service contract status acquisition |
| - | `KKSV0061_KKSV0061OPDBMapper.setKKSV006102SC` | KKSV006102SC | - | Maps function code 3 for KKSV0061 service: disconnection reason reference data |
| - | `KKSV0061_KKSV0061OPDBMapper.setKKSV006103SC` | KKSV006103SC | - | Maps function code 3 for KKSV0061 service: additional reference data |
| - | `JCCBatCommon.invokeService` (KKSV0061) | KKSV0061OP | - | Executes KKSV0061 service batch: retrieves service contract status and reference data |
| R | `KKSV0061_KKSV0061OPDBMapper.getKKSV006101SC` | KKSV006101SC | - | Extracts KKSV006101 output: service contract status |
| R | `KKSV0061_KKSV0061OPDBMapper.getKKSV006102SC` | KKSV006102SC | - | Extracts KKSV006102 output: disconnection reason data |
| R | `KKSV0061_KKSV0061OPDBMapper.getKKSV006103SC` | KKSV006103SC | - | Extracts KKSV006103 output: reference data |
| R | `KKSV0061_KKSV0061OPDBMapper.getKKSV006104SC` | KKSV006104SC | - | Extracts KKSV006104 output: additional reference data |
| - | `KKSV0062_KKSV0062OPDBMapper.setKKSV006201SC` | KKSV006201SC | - | Maps function code 2 for KKSV0062 service: pricing and service detail acquisition |
| - | `KKSV0062_KKSV0062OPDBMapper.setKKSV006202SC` | KKSV006202SC | - | Maps function code 1 for KKSV0062 service: service code reference |
| - | `KKSV0062_KKSV0062OPDBMapper.setKKSV006203SC` | KKSV006203SC | - | Maps function code 1 for KKSV0062 service: price group reference |
| - | `KKSV0062_KKSV0062OPDBMapper.setKKSV006205SC` | KKSV006205SC | - | Maps function code 1 for KKSV0062 service: rate code reference |
| - | `KKSV0062_KKSV0062OPDBMapper.setKKSV006206SC` | KKSV006206SC | - | Maps function code 1 for KKSV0062 service: plan code reference |
| - | `KKSV0062_KKSV0062OPDBMapper.setKKSV006207SC` | KKSV006207SC | - | Maps function code 6 for KKSV0062 service: additional pricing data |
| - | `KKSV0062_KKSV0062OPDBMapper.setKKSV006208SC` | KKSV006208SC | - | Maps function code 2 for KKSV0062 service: service history data |
| - | `KKSV0062_KKSV0062OPDBMapper.setKKSV006209SC` | KKSV006209SC | - | Maps function code 1 for KKSV0062 service: additional reference data |
| - | `KKSV0062_KKSV0062OPDBMapper.setKKSV006210SC` | KKSV006210SC | - | Maps function code 2 for KKSV0062 service: additional pricing data |
| - | `KKSV0062_KKSV0062OPDBMapper.setKKSV006212SC` | KKSV006212SC | - | Maps function code 1 for KKSV0062 service: conditional — retrieved only for Mobile Wi-Fi (07), EMobile (08), UQ (09), or Telephone (10) pricing groups |
| - | `KKSV0062_KKSV0062OPDBMapper.setKKSV006221SC` | KKSV006221SC | - | Maps function code 1 for KKSV0062 service: premium support data |
| - | `KKSV0062_KKSV0062OPDBMapper.setKKSV006222CC` | KKSV006222CC | - | Maps function code 1 for KKSV0062 service: premium support option (added ANK-2687-00-00) |
| - | `KKSV0062_KKSV0062OPDBMapper.setKKSV006223SC` | KKSV006223SC | - | Maps function code 2 for KKSV0062 service: service history detail (added IT1-2016-0000100) |
| - | `JCCBatCommon.invokeService` (KKSV0062) | KKSV0062OP | - | Executes KKSV0062 service batch: retrieves pricing details, service codes, and service history |
| R | `KKSV0062_KKSV0062OPDBMapper.getKKSV006201SC` | KKSV006201SC | EKK0081A010CBSMsg1List | Extracts pricing group, service code, rate code, plan code from the first record of the EKK0081A010CBS message list |
| R | `KKSV0062_KKSV0062OPDBMapper.getKKSV006205SC` | KKSV006205SC | - | Extracts KKSV006205 output: service code list |
| R | `KKSV0062_KKSV0062OPDBMapper.getKKSV006207SC` | KKSV006207SC | - | Extracts KKSV006207 output: pricing reference data |
| R | `KKSV0062_KKSV0062OPDBMapper.getKKSV006208SC` | KKSV006208SC | - | Extracts KKSV006208 output: service history data |
| R | `KKSV0062_KKSV0062OPDBMapper.getKKSV006209SC` | KKSV006209SC | - | Extracts KKSV006209 output: reference data |
| R | `KKSV0062_KKSV0062OPDBMapper.getKKSV006210SC` | KKSV006210SC | - | Extracts KKSV006210 output: pricing data |
| R | `KKSV0062_KKSV0062OPDBMapper.getKKSV006211SC` | KKSV006211SC | - | Extracts KKSV006211 output: additional data |
| R | `KKSV0062_KKSV0062OPDBMapper.getKKSV006221SC` | KKSV006221SC | - | Extracts KKSV006221 output: premium support data |
| R | `KKSV0062_KKSV0062OPDBMapper.getKKSV006212SC` | KKSV006212SC | - | Conditional: retrieves KKSV006212 output for specific pricing groups (07-10) |
| R | `KKSV0062_KKSV0062OPDBMapper.getKKSV006223SC` | KKSV006223SC | EKK0081B024CBSMsg1List | Retrieves service history detail list, including svc_kei_stat (service contract status) for each contract line |
| - | `JCCBatCommon.invokeService` (KKSV0463) | KKSV0463OP | - | Executes KKSV0063 service batch: retrieves disconnection reason category selection data |
| - | `JCCBatCommon.invokeService` (KKSV0551) | KKSV0551OP | - | Executes KKSV0551 service batch: retrieves disconnection reason major category substitution data |
| - | `JKKOneStopApiCommonUtil.checkIdoRsnCdPair` | JKKOneStopApiCommon | - | Validates that the disconnection reason major code and sub code form a valid pair |
| - | `JKKOneStopApiCommonUtil.checkSvcKeiIdoPsb` | JKKOneStopApiCommon | - | Validates whether service contract transfer/modification is permitted for this contract |
| - | `JKKOneStopApiCommonUtil.setReturnXml` | JKKOneStopApiCommon | - | Formats and stores an XML error response into the warnList for the specified error code (E5002–E5006) |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.
Terminal operations from this method: `setReturnXml` [-], `setReturnXml` [-], `setReturnXml` [-], `checkSvcKeiIdoPsb` [-], `setReturnXml` [-], `setReturnXml` [-], `setReturnXml` [-], `checkIdoRsnCdPair` [-], `invokeService` [-], `invokeService` [-], `invokeService` [-], `invokeService` [-], `invokeService` [-], `setKKSV055101SC` [-], `setKKSV055101SC` [-], `invokeService` [-], `invokeService` [-], `invokeService` [-], `invokeService` [-], `invokeService` [-]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Logic: `KKA16701SFLogic.apiControl()` | `apiControl()` -> `commonKnrnChkForOneStop()` | `KKSV0820OP [R] sysid/svc_kei_no/user_id validation` + `KKSV0061OP [R] service status` + `KKSV0062OP [R] pricing/service history` + `KKSV0463OP [R] disconnection reason categories` + `KKSV0551OP [R] disconnection reason substitution` + `setReturnXml [E5002-E5006]` |

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] DataBean and Request Parameter Extraction (L619–L629)

> Retrieves the service form data bean and extracts identity and reason parameters from the HTTP request map. The disconnection division `idoDiv` is hardcoded to `OS_IDO_DIV` which resolves to `"00054"` (IDO_DIV_VALUE_00054 = "00054", Contract Change Reservation Cancellation).

| # | Type | Code |
|---|------|------|
| 1 | SET | `bean = super.getServiceFormBean()` [dataBeanAcquisition, i.e., Get DataBean] [-> `X31SDataBeanAccess`] |
| 2 | SET | `paramBean = {bean}` [paramBean parameter array] |
| 3 | SET | `sysid = (String)requestMap.get("sysid")` [SYSID extraction] |
| 4 | SET | `svcKeiNo = (String)requestMap.get("svc_kei_no")` [Service Contract Number extraction] |
| 5 | SET | `userId = (String)requestMap.get("user_id")` [User ID extraction] |
| 6 | SET | `idoDiv = OS_IDO_DIV` [-> `IDO_DIV_VALUE_00054` = "00054" (Contract Change Reservation Cancellation)] |
| 7 | SET | `idoRsnDbriCd = (String)requestMap.get("ido_rsn_dbri_cd")` [Disconnection Reason Major Code extraction] |
| 8 | SET | `idoRsnCbriCd = (String)requestMap.get("ido_rsn_cbri_cd")` [Disconnection Reason Sub-Code extraction] |

**Block 2** — [SET] Code Subtype List and Operational Date (L631–L634)

> Initializes an empty list for code subtypes and retrieves the current operational date.

| # | Type | Code |
|---|------|------|
| 1 | SET | `cdSbtList = new ArrayList<String>()` [cdSbtList codeSbt, i.e., Code Subtype List — empty initialization] |
| 2 | SET | `opeDate = JCCWebCommon.getOpeDate(this, null)` [opeDate operationalDate, i.e., Get Operational Date] |

**Block 3** — [SET] KKSV0820 Parameter Preparation (L637–L643)

> Prepares the parameter map for the KKSV0820 service component batch. This batch validates existence of sysid, service contract number, and user ID. Uses `TELEGRAM_INFO_USECASE_ID` = "KKSV0820" and `TELEGRAM_INFO_OPERATION_ID` = "KKSV0820OP".

| # | Type | Code |
|---|------|------|
| 1 | SET | `kksv0820ParamMap = new HashMap<String, Object>()` |
| 2 | SET | `kksv0820InputMap = new HashMap<String, Object>()` |
| 3 | SET | `kksv0820OutputMap = new HashMap<String, Object>()` |
| 4 | SET | `kksv0820ParamMap.put(TELEGRAM_INFO_USECASE_ID, "KKSV0820")` |
| 5 | SET | `kksv0820ParamMap.put(TELEGRAM_INFO_OPERATION_ID, "KKSV0820OP")` |

**Block 4** — [SET, CALL] KKSV0820 Mapper and Execution (L646–L652)

> Creates the KKSV0820 database mapper, sets up the KKSV082001CC mapping with identity parameters, and invokes the service batch. This is the first of three service batch invocations in the validation pipeline.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kksv0820Mapper = new KKSV0820_KKSV0820OPDBMapper()` [mapper mapping |
| 2 | CALL | `kksv0820Mapper.setKKSV082001CC(paramBean, kksv0820InputMap, opeDate, sysid, svcKeiNo, userId, cdSbtList)` [setKKSV082001CC prepares input for KKSV082001CC] |
| 3 | CALL | `invokeService(kksv0820ParamMap, kksv0820InputMap, kksv0820OutputMap)` [invokeService KKSV0820 batch] |

**Block 5** — [IF] SYSID Existence Check (L655–L660)

> Validates that the SYSID was successfully retrieved and populated by KKSV0820. If empty, returns error E5002 (SYSID not found).

| # | Type | Code |
|---|------|------|
| 1 | IF | `!JKKOneStopApiCommonUtil.checkExistSysid(kksv0820OutputMap)` [checkExistSysid SYSID existence check] |
| 1.1 | EXEC | `JKKOneStopApiCommonUtil.setReturnXml(this, "E5002", warnList, funcCode, IF_ID)` [setReturnXml E5002 error response for missing SYSID] |
| 1.2 | RETURN | `return false` [early exit — invalid SYSID] |
| 2 | (continue) | SYSID is valid |

**Block 6** — [IF] Service Contract Number Existence Check (L663–L668)

> Validates that the service contract number (svc_kei_no) was populated by KKSV0820. If empty, returns error E5003 (svc_kei_no not found).

| # | Type | Code |
|---|------|------|
| 1 | IF | `!JKKOneStopApiCommonUtil.checkExistSvcKeiNo(kksv0820OutputMap)` [checkExistSvcKeiNo service contract number existence check] |
| 1.1 | EXEC | `JKKOneStopApiCommonUtil.setReturnXml(this, "E5003", warnList, funcCode, IF_ID)` [setReturnXml E5003 error response] |
| 1.2 | RETURN | `return false` |

**Block 7** — [IF] User ID Existence Check (L671–L676)

> Validates that the user ID was populated by KKSV0820. If empty, returns error E5004 (user_id not found).

| # | Type | Code |
|---|------|------|
| 1 | IF | `!JKKOneStopApiCommonUtil.checkExistUserId(kksv0820OutputMap)` [checkExistUserId user ID existence check] |
| 1.1 | EXEC | `JKKOneStopApiCommonUtil.setReturnXml(this, "E5004", warnList, funcCode, IF_ID)` [setReturnXml E5004 error response] |
| 1.2 | RETURN | `return false` |

**Block 8** — [SET] Extract Code Classification Map (L679–L681)

> Extracts the code classification management map from the KKSV0820 output, and extracts the code subtype result map into the instance field `cdDivListMap`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kksv082001ccMap = (Map)kksv0820OutputMap.get("KKSV082001CC")` [kkS082001CC output mapping] |
| 2 | SET | `codeMeishoKanriMap = (Map)kksv082001ccMap.get("codeMeishoKanriMap")` [codeMeishoKanriMap, i.e., Code Name Management Map] |
| 3 | SET | `cdDivListMap = (Map)codeMeishoKanriMap.get("rslt_cd_sbt_map")` [-> instance field cdDivListMap, rslt_cd_sbt_map result code subtype map] |

**Block 9** — [SET] Create OneStopDataBeanAccess (L684–L691)

> Creates a new OneStop data bean access object and populates it with the system ID, service contract number, and operational date for downstream inter-component communication. Also adds service contract number under a different key (IT1-2016-0000100).

| # | Type | Code |
|---|------|------|
| 1 | SET | `osBean = new OneStopDataBeanAccess()` |
| 2 | EXEC | `osBean.sendMessageString("SYSID", DATABEAN_SET_VALUE, sysid)` [send SYSID to bean] |
| 3 | EXEC | `osBean.sendMessageString("選択サービス契約番号", DATABEAN_SET_VALUE, svcKeiNo)` [select service contract number = svc_kei_no] |
| 4 | EXEC | `osBean.sendMessageString("運転日付", DATABEAN_SET_VALUE, opeDate)` [opeDate operational date = opeDate] |
| 5 | EXEC | `osBean.sendMessageString("サービス契約番号", DATABEAN_SET_VALUE, svcKeiNo)` [service contract number = svc_kei_no, added IT1-2016-0000100] |
| 6 | SET | `paramOsBean = {osBean}` [paramOsBean OneStop data bean access array] |

**Block 10** — [SET] KKSV0061 Parameter Preparation (L695–L701)

> Prepares the KKSV0061 service component batch for retrieving service contract status and reference data. Uses UC = `UCID_KKSV0061` and OP = `OPID_KKSV0061OP`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kksv0061ParamMap = new HashMap<String, Object>()` |
| 2 | SET | `kksv0061InputMap = new HashMap<String, Object>()` |
| 3 | SET | `kksv0061OutputMap = new HashMap<String, Object>()` |
| 4 | SET | `kksv0061ParamMap.put(TELEGRAM_INFO_USECASE_ID, UCID_KKSV0061)` |
| 5 | SET | `kksv0061ParamMap.put(TELEGRAM_INFO_OPERATION_ID, OPID_KKSV0061OP)` |

**Block 11** — [SET, CALL] KKSV0061 Mapper, Setup and Execution (L704–L714)

> Creates the KKSV0061 database mapper, sets up the KKSV006101/02/03 service component mappings with function codes, invokes the batch, and extracts output data.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kksv0061Mapper = new KKSV0061_KKSV0061OPDBMapper()` |
| 2 | CALL | `kksv0061Mapper.setKKSV006101SC(paramOsBean, kksv0061InputMap, FUNC_CD_1)` [setKKSV006101SC with function code 1: service contract status acquisition] |
| 3 | CALL | `kksv0061Mapper.setKKSV006102SC(paramOsBean, kksv0061InputMap, FUNC_CD_3)` [setKKSV006102SC with function code 3: disconnection reason reference] |
| 4 | CALL | `kksv0061Mapper.setKKSV006103SC(paramOsBean, kksv0061InputMap, FUNC_CD_3)` [setKKSV006103SC with function code 3] |
| 5 | CALL | `invokeService(kksv0061ParamMap, kksv0061InputMap, kksv0061OutputMap)` [invokeService KKSV0061 batch] |
| 6 | CALL | `kksv0061Mapper.getKKSV006101SC(paramOsBean, kksv0061OutputMap)` [getKKSV006101SC extract service status] |
| 7 | CALL | `kksv0061Mapper.getKKSV006102SC(paramOsBean, kksv0061OutputMap)` [getKKSV006102SC extract disconnection reason data] |
| 8 | CALL | `kksv0061Mapper.getKKSV006103SC(paramOsBean, kksv0061OutputMap)` [getKKSV006103SC extract reference data] |
| 9 | CALL | `kksv0061Mapper.getKKSV006104SC(paramOsBean, kksv0061OutputMap)` [getKKSV006104SC extract additional data] |

**Block 12** — [SET] KKSV0062 Parameter Preparation (L717–L721)

> Prepares the KKSV0062 service component batch for retrieving pricing details and service history. Uses UC = `UCID_KKSV0062` and OP = `OPID_KKSV0062OP`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kksv0062ParamMap = new HashMap<String, Object>()` |
| 2 | SET | `kksv0062InputMap = new HashMap<String, Object>()` |
| 3 | SET | `kksv0062OutputMap = new HashMap<String, Object>()` |
| 4 | SET | `kksv0062ParamMap.put(TELEGRAM_INFO_USECASE_ID, UCID_KKSV0062)` |
| 5 | SET | `kksv0062ParamMap.put(TELEGRAM_INFO_OPERATION_ID, OPID_KKSV0062OP)` |

**Block 13** — [SET, CALL] KKSV0062 Mapper Setup and Execution (L725–L748)

> Creates the KKSV0062 database mapper and sets up all service component mappings (KKSV006201 through KKSV006223) with varying function codes, then invokes the batch. This is the most complex mapping block, covering pricing group, service code, rate code, plan code, service history, premium support, and service history detail.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kksv0062Mapper = new KKSV0062_KKSV0062OPDBMapper()` |
| 2 | CALL | `kksv0062Mapper.setKKSV006201SC(paramOsBean, kksv0062InputMap, FUNC_CD_2)` [setKKSV006201SC with function code 2: pricing detail acquisition] |
| 3 | CALL | `kksv0062Mapper.setKKSV006202SC(paramOsBean, kksv0062InputMap, FUNC_CD_1)` [setKKSV006202SC with function code 1: service code reference] |
| 4 | CALL | `kksv0062Mapper.setKKSV006203SC(paramOsBean, kksv0062InputMap, FUNC_CD_1)` [setKKSV006203SC with function code 1: price group reference] |
| 5 | CALL | `kksv0062Mapper.setKKSV006205SC(paramOsBean, kksv0062InputMap, FUNC_CD_1)` [setKKSV006205SC with function code 1: rate code reference] |
| 6 | CALL | `kksv0062Mapper.setKKSV006206SC(paramOsBean, kksv0062InputMap, FUNC_CD_1)` [setKKSV006206SC with function code 1: plan code reference] |
| 7 | CALL | `kksv0062Mapper.setKKSV006207SC(paramOsBean, kksv0062InputMap, FUNC_CD_6)` [setKKSV006207SC with function code 6: additional pricing] |
| 8 | CALL | `kksv0062Mapper.setKKSV006208SC(paramOsBean, kksv0062InputMap, FUNC_CD_2)` [setKKSV006208SC with function code 2: service history] |
| 9 | CALL | `kksv0062Mapper.setKKSV006209SC(paramOsBean, kksv0062InputMap, FUNC_CD_1)` [setKKSV006209SC with function code 1] |
| 10 | CALL | `kksv0062Mapper.setKKSV006210SC(paramOsBean, kksv0062InputMap, FUNC_CD_2)` [setKKSV006210SC with function code 2] |
| 11 | CALL | `kksv0062Mapper.setKKSV006212SC(paramOsBean, kksv0062InputMap, FUNC_CD_1)` [setKKSV006212SC with function code 1] |
| 12 | CALL | `kksv0062Mapper.setKKSV006221SC(paramOsBean, kksv0062InputMap, FUNC_CD_1)` [setKKSV006221SC with function code 1: premium support] |
| 13 | CALL | `kksv0062Mapper.setKKSV006222CC(paramOsBean, kksv0062InputMap, FUNC_CD_1)` [setKKSV006222CC with function code 1: premium support option, added ANK-2687-00-00] |
| 14 | CALL | `kksv0062Mapper.setKKSV006223SC(paramOsBean, kksv0062InputMap, FUNC_CD_2)` [setKKSV006223SC with function code 2: service history detail, added IT1-2016-0000100] |
| 15 | CALL | `invokeService(kksv0062ParamMap, kksv0062InputMap, kksv0062OutputMap)` [invokeService KKSV0062 batch] |

**Block 14** — [CALL] KKSV0062 Output Extraction and Field Extraction (L751–L769)

> Extracts all service component outputs from the KKSV0062 result. Retrieves pricing group code, service code, rate code, and plan code from the first record of the `EKK0081A010CBSMsg1List`. These are stored in instance fields for later use.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `kksv0062Mapper.getKKSV006201SC(paramOsBean, kksv0062OutputMap)` |
| 2 | CALL | `kksv0062Mapper.getKKSV006205SC(paramOsBean, kksv0062OutputMap)` |
| 3 | CALL | `kksv0062Mapper.getKKSV006207SC(paramOsBean, kksv0062OutputMap)` |
| 4 | CALL | `kksv0062Mapper.getKKSV006209SC(paramOsBean, kksv0062OutputMap)` |
| 5 | CALL | `kksv0062Mapper.getKKSV006210SC(paramOsBean, kksv0062OutputMap)` |
| 6 | CALL | `kksv0062Mapper.getKKSV006211SC(paramOsBean, kksv0062OutputMap)` |
| 7 | CALL | `kksv0062Mapper.getKKSV006208SC(paramOsBean, kksv0062OutputMap)` |
| 8 | CALL | `kksv0062Mapper.getKKSV006221SC(paramOsBean, kksv0062OutputMap)` |
| 9 | SET | `kksv006201scMap = (Map)kksv0062OutputMap.get("KKSV006201SC")` |
| 10 | SET | `ekk0081a010List = (List)kksv006201scMap.get("EKK0081A010CBSMsg1List")` |
| 11 | SET | `ekk0081a010Map = (null != ekk0081a010List && 0 < size()) ? ekk0081a010List.get(0) : null` |
| 12 | SET | `prcGrpCd = (null != ekk0081a010Map) ? ekk0081a010Map.get("prc_grp_cd") : ""` [prcGrpCd pricingGroupCode] |
| 13 | SET | `this.svc_cd = (null != ekk0081a010Map) ? ekk0081a010Map.get("svc_cd") : ""` [-> instance field svc_cd, svcCd service code] |
| 14 | SET | `this.prc_grp_cd = (null != ekk0081a010Map) ? ekk0081a010Map.get("prc_grp_cd") : ""` [-> instance field prc_grp_cd, pGrpCd pricing group code] |
| 15 | SET | `this.prcs_cd = (null != ekk0081a010Map) ? ekk0081a010Map.get("pcrs_cd") : ""` [-> instance field prcs_cd, pCd rate code] |
| 16 | SET | `this.pplan_cd = (null != ekk0081a010Map) ? ekk0081a010Map.get("pplan_cd") : ""` [-> instance field pplan_cd, pPlanCd pricing plan code] |

**Block 15** — [IF] Conditional Pricing Group Check (L772–L775)

> Checks if the pricing group code corresponds to mobile/wireless or telephone services. If `prc_grp_cd` is "07" (Mobile Wi-Fi), "08" (EMobile), "09" (UQ), or "10" (Telephone), retrieves the additional KKSV006212SC data.

| # | Type | Code |
|---|------|------|
| 1 | IF | `prcGrpCd.equals("07") || prcGrpCd.equals("08") || prcGrpCd.equals("09") || prcGrpCd.equals("10")` [prc_grpCd in PRC_GRP_CD_MOB_WIFI="07", PRC_GRP_CD_MOB_EM="08", PRC_GRP_CD_MOB_UQ="09", PRC_GRP_CD_TEL="10"] |
| 1.1 | CALL | `kksv0062Mapper.getKKSV006212SC(paramOsBean, kksv0062OutputMap)` [getKKSV006212SC retrieve additional pricing data for mobile/telephone pricing groups] |

**Block 16** — [CALL, SET, IF] KKSV006223SC Retrieval and Service Status Check (L778–L806)

> Retrieves the service history detail (KKSV006223SC) which contains the service history list (eKK0081B024CBSMsg1List). Iterates through all service contract history records and checks if any has `svc_kei_stat` = "100" (SVC_KEI_STAT_100 = "100", Service Provision In Progress / service delivery in progress). If found, sets the instance field `svcTkRrkFlg` to "1" (service delivery history exists) and breaks out of the loop.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `kksv0062Mapper.getKKSV006223SC(paramOsBean, kksv0062OutputMap)` [getKKSV006223SC retrieve service history detail] |
| 2 | SET | `kksv006223scMap = (Map)kksv0062OutputMap.get("KKSV006223SC")` |
| 3 | SET | `eKK0081B024List = (List)kksv006223scMap.get("EKK0081B024CBSMsg1List")` |
| 4 | SET | `eKK0081B024Map = null` |
| 5 | SET | `svcKeiStat = ""` |
| 6 | IF | `eKK0081B024List != null && 0 < eKK0081B024List.size()` [serviceHistoryListNotnullAndNotEmpty — service history list is not null and has entries] |
| 6.1 | FOR | `for (int i = 0; i < eKK0081B024List.size(); i++)` [iterate over service contract history records] |
| 6.1.1 | SET | `eKK0081B024Map = (Map)eKK0081B024List.get(i)` |
| 6.1.2 | SET | `svcKeiStat = (String)eKK0081B024Map.get("svc_kei_stat")` [svcKeiStat serviceContractStatus] |
| 6.1.3 | IF | `JKKCommonConst.SVC_KEI_STAT_100.equals(svcKeiStat)` [SVC_KEI_STAT_100 = "100" (Service Provision In Progress)] |
| 6.1.3.1 | SET | `svcTkRrkFlg = "1"` [svcTkRrkFlg service delivery history flag, 1 = service delivery history exists] |
| 6.1.3.2 | EXEC | `break` [exit loop — active service found] |

**Block 17** — [SET] KKSV0463 Parameter Preparation (L809–L813)

> Prepares the KKSV0463 service component batch for retrieving disconnection reason category selection data. Uses UC = `UCID_KKSV0463` and OP = `OPID_KKSV0463OP`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kksv0463ParamMap = new HashMap<String, Object>()` |
| 2 | SET | `kksv0463InputMap = new HashMap<String, Object>()` |
| 3 | SET | `kksv0463OutputMap = new HashMap<String, Object>()` |
| 4 | SET | `kksv0463ParamMap.put(TELEGRAM_INFO_USECASE_ID, UCID_KKSV0463)` |
| 5 | SET | `kksv0463ParamMap.put(TELEGRAM_INFO_OPERATION_ID, OPID_KKSV0463OP)` |

**Block 18** — [SET, CALL] KKSV0463 Mapper Setup and Execution (L816–L821)

> Creates the KKSV0463 database mapper, sets up the KKSV046301SC mapping with `idoDiv = "00054"`, and invokes the batch. This batch retrieves disconnection reason category selection data.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kksv0463Mapper = new KKSV0463_KKSV0463OPDBMapper()` |
| 2 | CALL | `kksv0463Mapper.setKKSV046301SC(paramOsBean, kksv0463InputMap, FUNC_CD_1, "00054")` [setKKSV046301SC with function code 1 and idoDiv = "00054"] |
| 3 | CALL | `invokeService(kksv0463ParamMap, kksv0463InputMap, kksv0463OutputMap)` [invokeService KKSV0463 batch] |

**Block 19** — [SET] KKSV0551 Parameter Preparation (L824–L828)

> Prepares the KKSV0551 service component batch for retrieving disconnection reason major category substitution data. Uses UC = `UCID_KKSV0551` and OP = `OPID_KKSV0551OP`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kksv0551ParamMap = new HashMap<String, Object>()` |
| 2 | SET | `kksv0551InputMap = new HashMap<String, Object>()` |
| 3 | SET | `kksv0551OutputMap = new HashMap<String, Object>()` |
| 4 | SET | `kksv0551ParamMap.put(TELEGRAM_INFO_USECASE_ID, UCID_KKSV0551)` |
| 5 | SET | `kksv0551ParamMap.put(TELEGRAM_INFO_OPERATION_ID, OPID_KKSV0551OP)` |

**Block 20** — [SET, CALL] KKSV0551 Mapper Setup and Execution (L831–L836)

> Creates the KKSV0551 database mapper, sets up the KKSV055101SC mapping with `idoRsnDbriCd` (the disconnection reason major code extracted from the request), and invokes the batch. This batch retrieves disconnection reason major category substitution data.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kksv0551Mapper = new KKSV0551_KKSV0551OPDBMapper()` |
| 2 | CALL | `kksv0551Mapper.setKKSV055101SC(paramOsBean, kksv0551InputMap, FUNC_CD_1, idoRsnDbriCd)` [setKKSV055101SC with function code 1 and disconnection reason major code] |
| 3 | CALL | `invokeService(kksv0551ParamMap, kksv0551InputMap, kksv0551OutputMap)` [invokeService KKSV0551 batch] |

**Block 21** — [IF] Disconnection Reason Code Pair Validation (L839–L845)

> Validates that the disconnection reason major code (`idoRsnDbriCd`) and sub code (`idoRsnCbriCd`) form a valid, permissible combination. If invalid, returns error E5005 (disconnection reason invalid).

| # | Type | Code |
|---|------|------|
| 1 | IF | `!JKKOneStopApiCommonUtil.checkIdoRsnCdPair(kksv0463OutputMap, kksv0551OutputMap, osBean, idoRsnDbriCd, idoRsnCbriCd)` [checkIdoRsnCdPair disconnection reason code pair validation] |
| 1.1 | EXEC | `JKKOneStopApiCommonUtil.setReturnXml(this, "E5005", warnList, funcCode, IF_ID)` [setReturnXml E5005 error response] |
| 1.2 | RETURN | `return false` |

**Block 22** — [IF] Service Contract Transfer Possibility Check (L848–L853)

> Validates whether service contract transfer/modification is possible for the given contract, based on the current service state and contract conditions. Uses `idoDiv = "00054"` as the disconnection division. If not possible, returns error E5006 (service transfer not possible).

| # | Type | Code |
|---|------|------|
| 1 | IF | `!JKKOneStopApiCommonUtil.checkSvcKeiIdoPsb(kksv0062OutputMap, osBean, "00054")` [checkSvcKeiIdoPsb serviceContractTransferPossibility, idoDiv = "00054"] |
| 1.1 | EXEC | `JKKOneStopApiCommonUtil.setReturnXml(this, "E5006", warnList, funcCode, IF_ID)` [setReturnXml E5006 error response] |
| 1.2 | RETURN | `return false` |

**Block 23** — [RETURN] All Validations Passed (L856)

> All six validation gates have passed: identity triplet (sysid, svc_kei_no, user_id), code classification extraction, pricing group extraction, disconnection reason code pair validation, and service contract transfer possibility check.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return true` [All validation checks passed — proceed with One-Stop modification] |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `commonKnrnChkForOneStop` | Method | Common related check method for One-Stop — validates all prerequisites for a One-Stop service modification request |
| ワンストップ (Wansutoppu) | Business term | One-Stop — K-Opticom's unified service modification portal allowing customers to modify multiple telecom/TV services in a single transaction |
| `sysid` | Field | System ID — unique customer identifier in the K-Opticom system |
| `svc_kei_no` | Field | Service Contract Number — unique identifier for a service detail line item (service keiyakusho) |
| `user_id` | Field | User ID — the authenticated user's login identifier |
| `ido_rsn_dbri_cd` | Field | Disconnection Reason Major Code — primary category code for service discontinuation/modification reason (dbri = daito bunsui, 大类分類) |
| `ido_rsn_cbri_cd` | Field | Disconnection Reason Sub-Code — secondary category code, validated as a pair with the major code (cbri = sho bunsui, 小分類) |
| `idoDiv` | Field | Disconnection Division — classification of the type of disconnection/modification action |
| `OS_IDO_DIV` | Constant | One-Stop Disconnection Division = "00054" (Contract Change Reservation Cancellation) |
| `opeDate` | Field | Operational Date — current business date in YYYYMMDDHHMMSS format |
| `cdSbtList` | Field | Code Subtype List — list of code subtypes for the current request |
| `cdDivListMap` | Field | Code Classification Division List Map — map of code classification data extracted from KKSV0820 |
| `rslt_cd_sbt_map` | Field | Result Code Subtype Map — map of code classification results within KKSV082001CC output |
| `prc_grp_cd` | Field | Price Group Code — pricing group classification code (e.g., "01" = Standard Home Net, "07" = Mobile Wi-Fi, "10" = Telephone) |
| `svc_cd` | Field | Service Code — service category code (SVC_CD_NET="01" = Net, SVC_CD_TEL="02" = Tel, SVC_CD_TV="03" = TV, SVC_CD_HS="04" = HS) |
| `prcs_cd` | Field | Rate Code — specific rate plan code within a pricing group |
| `pplan_cd` | Field | Pricing Plan Code — pricing plan identifier |
| `svcTkRrkFlg` | Field | Service Delivery History Flag — set to "1" when at least one service contract with status "100" (active) is found in history |
| `svc_kei_stat` | Field | Service Contract Status — status code for a service contract line item |
| `SVC_KEI_STAT_100` | Constant | Service Provision In Progress = "100" — indicates the service is actively being delivered |
| E5002 | Error Code | SYSID not found — the provided system ID does not exist or could not be retrieved |
| E5003 | Error Code | Service contract number not found — the provided svc_kei_no is invalid or missing |
| E5004 | Error Code | User ID not found — the provided user ID does not match any registered user |
| E5005 | Error Code | Disconnection reason code pair invalid — the combination of major code and sub code is not a valid pair |
| E5006 | Error Code | Service transfer not possible — the service contract cannot be transferred/modified under current conditions |
| FUNC_CD_1 | Constant | Function Code 1 — standard acquisition function |
| FUNC_CD_2 | Constant | Function Code 2 — detail acquisition function |
| FUNC_CD_3 | Constant | Function Code 3 — reference data function |
| FUNC_CD_6 | Constant | Function Code 6 — special purpose function |
| `UCID_KKSV0061` | Constant | Use Case ID for KKSV0061 service component batch |
| `UCID_KKSV0062` | Constant | Use Case ID for KKSV0062 service component batch |
| `UCID_KKSV0463` | Constant | Use Case ID for KKSV0463 service component batch |
| `UCID_KKSV0551` | Constant | Use Case ID for KKSV0551 service component batch |
| KKSV0820 | SC Batch | SYSID/Service Contract Number/User ID validation batch — verifies the core identity triplet |
| KKSV0061 | SC Batch | Service contract status acquisition batch — retrieves service status and reference data |
| KKSV0062 | SC Batch | Pricing detail and service history acquisition batch — retrieves pricing group, service codes, rate codes, plan codes, and service history |
| KKSV0463 | SC Batch | Disconnection reason category selection batch — retrieves available disconnection reason categories for the given disconnection division |
| KKSV0551 | SC Batch | Disconnection reason major category substitution batch — retrieves disconnection reason substitution data based on the major code |
| EKK0081A010CBSMsg1List | Entity/DB | Pricing detail message list — contains pricing group code, service code, rate code, and plan code for the service contract |
| EKK0081B024CBSMsg1List | Entity/DB | Service history message list — contains service contract history records with status codes |
| OneStopDataBeanAccess | Component | Inter-component data communication bean — sends and receives structured messages between service component batches in the One-Stop workflow |
| JCCBatCommon.invokeService | Component | Common service invocation utility — the standard method for executing SC/CBS batch services |
| JKKOneStopApiCommonUtil | Component | One-Stop API common utility — shared utility for One-Stop specific validation (existence checks, error formatting, code pair validation) |
| DATABEAN_SET_VALUE | Constant | Data bean set value operation — sets a key-value pair in the OneStopDataBeanAccess bean |
| DATABEAN_GET_VALUE | Constant | Data bean get value operation — retrieves a value from the OneStopDataBeanAccess bean |
| TELEGRAM_INFO_USECASE_ID | Constant | Telegram info use case ID — identifies the use case (screen/business scenario) for the service invocation |
| TELEGRAM_INFO_OPERATION_ID | Constant | Telegram info operation ID — identifies the specific operation within the use case |
