# Business Logic — JBSbatKKSmtvlIdoInfSksi.setOutMapTelUpd() [243 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.business.service.JBSbatKKSmtvlIdoInfSksi` |
| Layer | Service (Batch processing service component) |
| Module | `service` (Package: `eo.business.service`) |

## 1. Role

### JBSbatKKSmtvlIdoInfSksi.setOutMapTelUpd()

This method performs the **telephone-only smart-bari (portability) discrepancy notification output and update processing** as part of K-Opticom's larger smart-bari interlock information creation batch. When a customer who holds both a network contract and a telephone contract initiates a number portability request but the network contract is already in a "termination-notified" state, the network-related output fields must still be resolved against historical notification data while the telephone-side fields are derived from the active telephone contract record.

The method implements a **dual-branch processing pattern**: when the network contract's service start date for third-party discount (`DSL_TAJGS_TCH_YMD`) equals the default future date `20991231` (meaning the network is not yet active for third-party discount purposes), the method takes the "DSL disabled" branch and assigns default "no network service activity" values. Otherwise, it takes the "DSL enabled" branch, queries the KDDI discount contract discrepancy notification table (`KK_T_KDDI_WKEI_IDT`) for previous notification records, and resolves the network-side output fields from that historical data.

After resolving both network and telephone output fields, the method performs **data integrity validation** — if network output is expected (DSL enabled) but the network service activity flag is "none" (`0`), or if the network termination date or reason fields are missing, the method logs a business error and returns `null` to trigger batch abort. Finally, it delegates the actual database update of the telephone contract status table (`KK_T_CHR_NCSR`) to the `updateTchNcsr1` method.

The method serves as a **shared utility** called from within `JBSbatKKSmtvlIdoInfSksi.mainProp()` and is one of four parallel processing paths (alongside `setOutMapNet`, `setOutMapTelAll`, and `setOutMapTv`) that route based on the service type in the smart-bari interlock batch pipeline. It transforms raw database query results and input map data into a structured output map (`JBSbatKKIFM238`) used to generate the discrepancy notification file for KDDI.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setOutMapTelUpd(telMap)"])

    START --> INIT["Create outMap, workMap"]
    INIT --> QRY_NET["Query KK_T_TAJGSWKEI_TGKEI<br/>by TAJGS_WRIB_KEI_NO + opeDate"]
    QRY_NET --> EXTRACT_NET["Extract netMap from result"]
    EXTRACT_NET --> CHECK_DSL["dslFlg = DSL_TAJGS_TCH_YMD = '20991231'"]

    CHECK_DSL -->|true| QRY_TEL["Query KK_T_SVC_KEI_UCWK<br/>by SVC_KEI_NO + opeDate"]
    CHECK_DSL -->|false| SKIP_NET["Skip net fetch block"]

    QRY_TEL --> EXTRACT_TEL["Extract workMap from result"]
    EXTRACT_TEL --> READ_FIELDS["Read fields from telMap / netMap"]
    READ_FIELDS --> COMMON["Call outMapCommon()"]

    COMMON --> SET_TEL_ID["Set KDDI_WKEI_IDT_NO_TEL, JGS_KEI_KNRI_NO"]

    SET_TEL_ID --> DSL_BRANCH{dslFlg == true}

    DSL_BRANCH -->|true| QRY_IDT["Query KK_T_KDDI_WKEI_IDT<br/>for previous notification"]
    QRY_IDT --> NET_TCH{netTchMap != null}

    NET_TCH -->|true| SET_NET_FIELDS["Set net fields:<br/>NET_SVC_KEI_UMU_FLG<br/>NET_SVC_STP_FLG<br/>NET_SVC_SBT<br/>NET_SVC_DSL_YMD<br/>NET_SVC_MSKM_YMD<br/>NET_SVC_CHRG_STAYMD<br/>NET_SVC_DLRE"]
    NET_TCH -->|false| SET_DEFAULTS["Set default net values:<br/>UMU_ARI, SVC_STP_FLG_RIYO, NET_SBT_TG"]

    SET_NET_FIELDS --> ERR_CHECK{"netKeiUmu != '0'<br/>OR netSvcDslYmd null<br/>OR netSvcDlre null"}
    ERR_CHECK -->|true| ERR_SET["printBusinessErrorLog + setErrFlg<br/>return null"]
    ERR_CHECK -->|false| AFTER_NET_SET["Proceed"]
    ERR_SET --> EXIT(["Return / End"])
    AFTER_NET_SET --> DONE

    SET_DEFAULTS --> AFTER_NET_SET

    DSL_BRANCH -->|false| SET_DEFAULTS

    DONE["Set tel fields:<br/>TEL1_SVC_KEI_UMU_FLG<br/>TEL1_SVC_STP_FLG<br/>TEL1_SVC_SBT<br/>TEL1_SVC_MSKM_YMD<br/>TEL1_SVC_CHRG_STAYMD<br/>TEL1_SVC_DSL_YMD<br/>TEL1_SVC_DLRE<br/>WRIBPRC_GRP_CD"] --> CALL_UPDATE["Call updateTchNcsr1(telMap, dslFlg)"]
    CALL_UPDATE --> RETURN["Return outMap"]

    RETURN --> END(["End"])
```

**Conditional branch summary:**

| Branch | Condition | Behavior |
|--------|-----------|----------|
| DSL Enabled | `dslFlg == true` (network has active third-party discount) | Queries KDDI discrepancy notification table, resolves network fields from prior notification, validates data integrity |
| DSL Disabled | `dslFlg == false` (`DSL_TAJGS_TCH_YMD == '20991231'`) | Assigns default "no network service activity" values (`UMU_ARI`, `SVC_STP_FLG_RIYO`, `NET_SVC_SBT_TG`) |
| Network record found | `netTchMap != null` | Uses previous notification data for network fields |
| Network record missing | `netTchMap == null` (DSL enabled path) | Falls through to default values block |
| Data integrity error | `netKeiUmu != '0'` OR `netSvcDslYmd` is null OR `netSvcDlre` is null | Logs error via `EKKB0010CW`, sets error flag, returns `null` |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `telMap` | `JBSbatServiceInterfaceMap` | Input map containing telephone contract and discrepancy notification data: service detail work number, KDDI discount contract discrepancy notification number, process status, cancellation reason codes, service contract start date, and other fields needed to derive the output map. |
| 2 | `dslFlg` (derived) | `boolean` | Internal flag derived from the network contract's `DSL_TAJGS_TCH_YMD` field. `true` means the network is actively enrolled in the third-party discount (service start date is not the default future date); `false` means it is not. |
| 3 | `netMap` (derived) | `HashMap<String, Object>` | Internal map holding the result of querying the network service contract details (`KK_T_SVC_KEI` joined with `KK_T_TAJGSWKEI_TGKEI`). Contains SVC_KEI_NO, PRC_GRP_CD, PCRSD_CD, PPLAN_CD, SHOSA_CL_YMD, SVC_DSL_KISAN_YMD, SVC_CANCEL_YMD, SVC_PAUSE_YMD, SVC_KEI_STAT, SHOSA_YMD, SVC_CHRG_STAYMD. |
| 4 | `workMap` (derived) | `HashMap<String, Object>` | Internal map holding the result of querying the telephone service detail work contract table (`KK_T_SVC_KEI_UCWK`). Contains SHOSA_YMD, SVC_CHRG_STAYMD. |
| 5 | `netTchMap` (derived) | `JBSbatCommonDBInterface` | Result of the KDDI discrepancy notification query, used when `dslFlg == true` to retrieve previous notification data for the network service. |
| 6 | `super.opeDate` (inherited) | `String` | Operator date, used as a parameter for database queries. |
| 7 | `super.commonItem` (inherited) | `JBSbatCommonItem` | Common item holder used for error flag setting and log output access. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JBSbatKKSmtvlIdoInfSksi.executeKK_T_TAJGSWKEI_TGKEI_KK_SELECT_001` | EKK0xxxC001SC (inferred) | `KK_T_TAJGSWKEI_TGKEI` | Reads network contract details (third-party discount target contract) by `TAJGS_WRIB_KEI_NO` and `opeDate` |
| R | `JBSbatKKSmtvlIdoInfSksi.executeKK_T_SVC_KEI_UCWK_KK_SELECT_077` | EKK0xxxC077SC (inferred) | `KK_T_SVC_KEI_UCWK` | Reads telephone service detail work contract record |
| R | `JBSbatKKSmtvlIdoInfSksi.executeKK_T_KDDI_WKEI_IDT_KK_SELECT_002` | EKK0xxxC002SC (inferred) | `KK_T_KDDI_WKEI_IDT` | Reads KDDI discount contract discrepancy notification records (previous notification data) |
| - | `JBSbatKKSmtvlIdoInfSksi.outMapCommon` | - | - | Sets common output fields via shared processing |
| - | `JBSbatKKSmtvlIdoInfSksi.getSvcKeiUmuFlg` | - | - | Determines network/telephone service existence flag from process status |
| - | `JBSbatKKSmtvlIdoInfSksi.getSvcStpFlg` | - | - | Determines service stop flag based on existence flag |
| - | `JBSbatKKSmtvlIdoInfSksi.getNetSvcSbt` | - | - | Determines network service type code (from existence flag + plan area code) |
| - | `JBSbatKKSmtvlIdoInfSksi.getTelSvcSbt` | - | - | Determines telephone service type code |
| - | `JBSbatKKSmtvlIdoInfSksi.getSvcDslYmd` | - | - | Calculates service termination date from multiple date fields and status codes |
| - | `JBSbatKKSmtvlIdoInfSksi.getSvcDlre` | - | - | Determines service termination reason description |
| - | `JBSbatKKSmtvlIdoInfSksi.convSvcChrgStaymd` | - | - | Converts service charge start date (handles null-to-null mapping when start date hasn't arrived) |
| - | `JBSbatKKSmtvlIdoInfSksi.setKjKrCncl` | - | - | Sets work-order provisional cancellation information |
| - | `JKKBatOneTimeLogWriter.printBusinessErrorLog` | - | - | Logs business error with message code `EKKB0010CW` and detail string |
| - | `JKKejbAdChecker.setErrFlg` | - | - | Sets global error flag on `super.commonItem` |
| U | `JBSbatKKSmtvlIdoInfSksi.updateTchNcsr1` | EKK0xxxU001CBS (inferred) | `KK_T_CHR_NCSR` | Updates telephone contract status table with processed output data |

**How to classify:**
- **R (Read)**: Methods that execute SELECT queries via `db_KK_T_*` data access objects and return map results.
- **U (Update)**: The `updateTchNcsr1` method which updates the telephone contract status table.
- The remaining method calls (`getSvcKeiUmuFlg`, `getSvcStpFlg`, `getNetSvcSbt`, `getTelSvcSbt`, `getSvcDslYmd`, `getSvcDlre`, `convSvcChrgStaymd`, `setKjKrCncl`, `outMapCommon`) are **internal processing methods** on the same class that perform date/status transformations and do not directly access the database.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: `JBSbatKKSmtvlIdoInfSksi.mainProp()` | `mainProp()` -> `setOutMapTelUpd(telMap)` | `updateTchNcsr1 [U] KK_T_CHR_NCSR`, `setString [-] JBSbatKKIFM238 file output`, `getInfo [R] KK_T_TAJGSWKEI_TGKEI`, `getInfo [R] KK_T_SVC_KEI_UCWK`, `getInfo [R] KK_T_KDDI_WKEI_IDT` |

**Terminal operations from this method:**
- `updateTchNcsr1` [U] `KK_T_CHR_NCSR` — Updates the telephone contract status table with output data
- `setString` [-] `JBSbatKKIFM238` — Sets fields on the output file map (file format `KKIFM238` for KDDI discrepancy notification)
- `getInfo` [R] `KK_T_TAJGSWKEI_TGKEI` — Reads network contract details
- `getInfo` [R] `KK_T_SVC_KEI_UCWK` — Reads telephone service detail work contract
- `getInfo` [R] `KK_T_KDDI_WKEI_IDT` — Reads KDDI discount contract discrepancy notification

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] Initialization (L1766)

| # | Type | Code |
|---|------|------|
| 1 | SET | `outMap = new JBSbatServiceInterfaceMap()` // Output map for processed data |
| 2 | SET | `workMap = new HashMap<String, Object>()` // Working map for telephone query result |

**Block 2** — [CALL] Network contract data query (L1772)

| # | Type | Code |
|---|------|------|
| 1 | SET | `param = [opeDate, TAJGS_WRIB_KEI_NO, TAJGSWKEI_TGKEI_NO, opeDate, opeDate]` // Query parameters |
| 2 | CALL | `executeKK_T_TAJGSWKEI_TGKEI_KK_SELECT_001(param)` // [-> EKK0xxxC001SC] Queries `KK_T_TAJGSWKEI_TGKEI` table |
| 3 | SET | `rstMapNet = db_KK_T_TAJGSWKEI_TGKEI.selectNext()` // Gets next result row |
| 4 | SET | `netMap = rstMapNet.getMap()` // Extracts map from result (L1781) |

**Block 3** — [IF] DSL flag determination (L1784)
> Checks if the network's third-party discount service start date equals the default future date `20991231`.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dslFlg = true` // Default: network is active for discount |
| 2 | IF | `YMD_DEF.equals(netMap.get(DSL_TAJGS_TCH_YMD))` // [-> YMD_DEF="20991231"] Checks if service start date is the default future date |
| 3 | SET | `dslFlg = false` // Network NOT active for third-party discount |

**Block 4** — [CALL] Telephone service detail work query (L1790)
> Query the telephone service detail work contract table.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramUcwk = [SVC_KEI_NO, SVC_KEI_UCWK_NO, opeDate]` // Query parameters from telMap |
| 2 | CALL | `executeKK_T_SVC_KEI_UCWK_KK_SELECT_077(paramUcwk)` // [-> EKK0xxxC077SC] Queries `KK_T_SVC_KEI_UCWK` table |
| 3 | SET | `rstMapTel = db_KK_T_SVC_KEI_UCWK.selectNext()` // Gets next result row |
| 4 | IF | `rstMapTel != null` (L1799) |
| 5 | SET | `workMap = rstMapTel.getMap()` // Extracts work map from telephone query result |

**Block 5** — [IF/ELSE] Update processing skip block (L1804)
> 2014/12/02 OM-2014-0003654: The update processing is now deferred to the end of the method (Block 19). The original update call here was commented out.

| # | Type | Code |
|---|------|------|
| 1 | SET | `updateTchNcsr1` call is COMMENTED OUT at L1806 |
| 2 | SET | Update processing deferred to end of method (L1999) |

**Block 6** — [SET] Read fields from netMap and telMap (L1813–L1830)

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiNo = netMap.get(SVC_KEI_NO)` // Service number |
| 2 | SET | `prcGrpCd = netMap.get(PRC_GRP_CD)` // Processing group code |
| 3 | SET | `pcrsCd = netMap.get(PCRS_CD)` // Processing result code |
| 4 | SET | `pplanCd = netMap.get(PPLAN_CD)` // Plan code |
| 5 | SET | `prgStat = telMap.getString(PRG_STAT)` // Program status |
| 6 | SET | `shosaClYmd = telMap.getString(SHOSA_CL_YMD)` // Inspection completion date |
| 7 | SET | `svcDslKisanYmd = telMap.getString(SVC_DSL_KISAN_YMD)` // Service DSL start date |
| 8 | SET | `svcCancelYmd = telMap.getString(SVC_CANCEL_YMD)` // Service cancellation date |
| 9 | SET | `svcPauseYmd = telMap.getString(SVC_PAUSE_YMD)` // Service pause date |
| 10 | SET | `smtvlDslCnclRsnCd = telMap.getString(SMTVL_DSL_CNCL_RSN_CD)` // Smart-bari DSL cancellation reason code |

**Block 6.1** — [SET] Service contract status (L1835)
> OM-2013-0002718: Added on 2013/10/01 — retrieves the service contract status.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiStat = telMap.getString(SVC_KEI_STAT)` // Service contract status |

**Block 6.2** — [SET] Work-order provisional cancellation flag (L1838–L1842)
> IT1-2018-0000100: Added on 2018/xx/xx — retrieves work-order provisional cancellation information.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kjKrCnclFlg = telMap.getString(KJ_KR_CNCL_FLG)` // Work-order provisional cancellation flag |
| 2 | SET | `krCnclUkYmd = telMap.getString(KR_CNCL_UK_YMD)` // Provisional cancellation acceptance date |

**Block 7** — [CALL] Common output settings (L1845)

| # | Type | Code |
|---|------|------|
| 1 | CALL | `outMapCommon(outMap, svcKeiNo, prcGrpCd, pcrsCd, pplanCd)` // Sets common output fields |

**Block 8** — [SET] Output map basic fields (L1847–L1851)

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `outMap.setString(KDDI_WKEI_IDT_NO_TEL, telMap.getString(KDDI_WKEI_IDT_NO))` // KDDI discrepancy notification number |
| 2 | EXEC | `outMap.setString(JIGYOSHA_KEI_KNRI_NO, telMap.getString(KDDI_JGS_KEI_KANRI_NO))` // Business operator management number |

**Block 9** — [IF] DSL-enabled branch: previous network notification query (L1857)
> If network contract is active for third-party discount, query the previous KDDI discrepancy notification to resolve network-side output fields.

| # | Type | Code |
|---|------|------|
| 1 | SET | `idtParam = [TAJGS_WRIB_KEI_NO, SVC_KEI_NO]` // Previous notification query params |
| 2 | CALL | `executeKK_T_KDDI_WKEI_IDT_KK_SELECT_002(idtParam)` // [-> EKK0xxxC002SC] Queries `KK_T_KDDI_WKEI_IDT` |
| 3 | SET | `netTchMap = db_KK_T_KDDI_WKEI_IDT.selectNext()` // Gets next result row |
| 4 | IF | `netTchMap != null` (L1864) |

**Block 9.1** — [SET] Previous notification data extraction (L1867)
> Only entered when `netTchMap != null`. Extracts data from previous KDDI discrepancy notification.

| # | Type | Code |
|---|------|------|
| 1 | SET | `netPrgStat = netTchMap.getString(PRG_STAT)` // Previous notification program status |
| 2 | SET | `netShosaClYmd = netMap.get(SHOSA_CL_YMD)` // Previous notification inspection completion date |
| 3 | SET | `netSvcDslKisanYmd = netMap.get(SVC_DSL_KISAN_YMD)` // Previous notification service DSL start date |
| 4 | SET | `netSvcCancelYmd = netMap.get(SVC_CANCEL_YMD)` // Previous notification service cancellation date |
| 5 | SET | `netSvcPauseYmd = netMap.get(SVC_PAUSE_YMD)` // Previous notification service pause date |

**Block 9.1.1** — [SET] Service contract status from netMap (L1877)
> OM-2013-0002718: Added on 2013/10/01.

| # | Type | Code |
|---|------|------|
| 1 | SET | `netSvcKeiStat = netMap.get(SVC_KEI_STAT)` // Network service contract status |

**Block 9.1.2** — [SET] Work-order provisional cancellation data (L1881–L1886)
> IT1-2018-0000100: Added on 2018/xx/xx.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `setKjKrCncl(netMap)` // Sets provisional cancellation info into netMap |
| 2 | SET | `netKjKrCnclFlg = netMap.get(KJ_KR_CNCL_FLG)` // Network provisional cancellation flag |
| 3 | SET | `netKrCnclUkYmd = netMap.get(KR_CNCL_UK_YMD)` // Network provisional cancellation acceptance date |

**Block 9.2** — [SET] Network output fields (L1891–L1896)

| # | Type | Code |
|---|------|------|
| 1 | SET | `netSmtvlDslCnclRsnCd = netTchMap.getString(SMTVL_DSL_CNCL_RSN_CD)` // Previous notification smart-bari DSL cancellation reason |
| 2 | CALL | `netSvcKeiUmuFlg = getSvcKeiUmuFlg(netPrgStat)` // Determines network service existence flag |
| 3 | EXEC | `outMap.setString(NET_SVC_KEI_UMU_FLG, netSvcKeiUmuFlg)` // Sets network service existence flag |
| 4 | EXEC | `outMap.setString(NET_SVC_STP_FLG, getSvcStpFlg(netSvcKeiUmuFlg))` // Sets network service stop flag |
| 5 | EXEC | `outMap.setString(NET_SVC_SBT, getNetSvcSbt(netSvcKeiUmuFlg, netMap.get(EOHNT_PPLAN_TIKI_SKCD)))` // Sets network service type (from existence flag + plan area code) |

**Block 9.3** — [SET] Network termination date (L1899)
> OM-2013-0002718: Added on 2013/10/01. IT1-2018-0000100: Added provisional cancellation flag/date parameters.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `outMap.setString(NET_SVC_DSL_YMD, getSvcDslYmd(netPrgStat, netShosaClYmd, netSvcDslKisanYmd, netSvcCancelYmd, netSvcPauseYmd, netSvcKeiStat, netKjKrCnclFlg, netKrCnclUkYmd))` // Calculates network termination date |
| 2 | EXEC | `outMap.setString(NET_SVC_DLRE, getSvcDlre(outMap, netSmtvlDslCnclRsnCd, "0"))` // Sets network termination reason ("0" = network) |

**Block 10** — [IF] Data integrity validation (L1913)
> 2014/12/02 OM-2014-0003654: Added data integrity checks. If network output is expected (DSL enabled) but the output data is inconsistent, abort processing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `netKeiUmu = outMap.getString(NET_SVC_KEI_UMU_FLG)` // Network service existence flag from output |
| 2 | SET | `idtNo = outMap.getString(KDDI_WKEI_IDT_NO_TEL)` // KDDI discrepancy notification number |
| 3 | IF | `!UMU_NASI.equals(netKeiUmu)` // [-> UMU_NASI="0"] Check: existence flag is NOT "none" |
| 4 | EXEC | `commonItem.getLogPrint().printBusinessErrorLog(EKKB0010CW, "KDDI discrepancy notification number: " + idtNo + " has no network service contract.")` |
| 5 | EXEC | `super.commonItem.setErrFlg(true)` // Sets error flag |
| 6 | RETURN | `return null` // Abort processing |

**Block 10.1** — [IF] Network termination date null check (L1927)

| # | Type | Code |
|---|------|------|
| 1 | SET | `netSvcDslYmd = outMap.getString(NET_SVC_DSL_YMD)` // Network termination date from output |
| 2 | IF | `isNull(netSvcDslYmd)` // [-> null check] |
| 3 | EXEC | `commonItem.getLogPrint().printBusinessErrorLog(EKKB0010CW, "KDDI discrepancy notification number: " + idtNo + " has no network service termination date.")` |
| 4 | EXEC | `super.commonItem.setErrFlg(true)` // Sets error flag |
| 5 | RETURN | `return null` // Abort processing |

**Block 10.2** — [IF] Network termination reason null check (L1937)

| # | Type | Code |
|---|------|------|
| 1 | SET | `netSvcDlre = outMap.getString(NET_SVC_DLRE)` // Network termination reason from output |
| 2 | IF | `isNull(netSvcDlre)` // [-> null check] |
| 3 | EXEC | `commonItem.getLogPrint().printBusinessErrorLog(EKKB0010CW, "KDDI discrepancy notification number: " + idtNo + " has no network service termination reason.")` |
| 4 | EXEC | `super.commonItem.setErrFlg(true)` // Sets error flag |
| 5 | RETURN | `return null` // Abort processing |

**Block 11** — [ELSE] DSL-disabled branch: default network values (L1948)
> When `dslFlg == false` (network not active for third-party discount), assign default "no activity" values.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `outMap.setString(NET_SVC_KEI_UMU_FLG, UMU_ARI)` // [-> "0"] Network has NO service activity |
| 2 | EXEC | `outMap.setString(NET_SVC_STP_FLG, SVC_STP_FLG_RIYO)` // [-> "0"] Network service stop flag: in use |
| 3 | EXEC | `outMap.setString(NET_SVC_SBT, NET_SVC_SBT_TG)` // [-> "000002"] Network service type: target |

**Block 12** — [SET] Additional network output fields (L1958–L1963)
> These fields are set for ALL branches (both DSL enabled and disabled).

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `outMap.setString(NET_SVC_MSKM_YMD, netMap.get(SHOSA_YMD))` // Network service suspension date |
| 2 | EXEC | `outMap.setString(NET_SVC_CHRG_STAYMD, convSvcChrgStaymd(netMap.get(SVC_CHRG_STAYMD)))` // Network charge start date (converted) |

**Block 13** — [SET] Telephone output fields (L1966)
> All telephone-side output fields are set regardless of DSL flag.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `telSvcKeiUmuFlg = getSvcKeiUmuFlg(prgStat)` // Determines telephone service existence flag from program status |
| 2 | EXEC | `outMap.setString(TEL1_SVC_KEI_UMU_FLG, telSvcKeiUmuFlg)` // Sets telephone service existence flag |
| 3 | EXEC | `outMap.setString(TEL1_SVC_STP_FLG, getSvcStpFlg(telSvcKeiUmuFlg))` // Sets telephone service stop flag |
| 4 | EXEC | `outMap.setString(TEL1_SVC_SBT, getTelSvcSbt(outMap))` // Sets telephone service type |
| 5 | EXEC | `outMap.setString(TEL1_SVC_MSKM_YMD, workMap.get(SHOSA_YMD))` // Telephone service suspension date |
| 6 | EXEC | `outMap.setString(TEL1_SVC_CHRG_STAYMD, convSvcChrgStaymd(workMap.get(SVC_CHRG_STAYMD)))` // Telephone charge start date (converted) |

**Block 13.1** — [SET] Telephone termination date (L1970)
> OM-2013-0002718: Added service contract status parameter. IT1-2018-0000100: Added provisional cancellation flag/date parameters.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `outMap.setString(TEL1_SVC_DSL_YMD, getSvcDslYmd(prgStat, shosaClYmd, svcDslKisanYmd, svcCancelYmd, svcPauseYmd, svcKeiStat, kjKrCnclFlg, krCnclUkYmd))` // Calculates telephone termination date |
| 2 | EXEC | `outMap.setString(TEL1_SVC_DLRE, getSvcDlre(outMap, smtvlDslCnclRsnCd, "1"))` // Sets telephone termination reason ("1" = telephone) |
| 3 | EXEC | `outMap.setString(WRIBPRC_GRP_CD, telMap.getString(KDDI_VAL_CD))` // Discount price group code |

**Block 14** — [CALL] Database update (L1999)
> 2014/12/02 OM-2014-0003654: Update processing moved here from the top of the method (original call at L1806 was commented out).

| # | Type | Code |
|---|------|------|
| 1 | CALL | `updateTchNcsr1(telMap, dslFlg)` // [-> EKK0xxxU001CBS] Updates `KK_T_CHR_NCSR` table with output data |

**Block 15** — [RETURN] Return output map (L2003)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return outMap` // Returns the populated output map |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `dslFlg` | Field | DSL flag — boolean indicating whether the network service is actively enrolled in the third-party discount program |
| `SVC_KEI_NO` | Field | Service number — unique identifier for a service contract line |
| `SVC_KEI_UCWK_NO` | Field | Service detail work number — internal tracking ID for service contract line items (detailed work records) |
| `TAJGS_WRIB_KEI_NO` | Field | Third-party discount target contract number — identifier for contracts eligible for third-party discount |
| `TAJGSWKEI_TGKEI_NO` | Field | Third-party business provider discount target contract number |
| `PRG_STAT` | Field | Program status — indicates the current processing status of the smart-bari notification (e.g., in-progress, completed, cancelled) |
| `SHOSA_CL_YMD` | Field | Inspection completion date — date when the service inspection was completed |
| `SVC_DSL_KISAN_YMD` | Field | Service DSL start date — date when the service began charging |
| `SVC_CANCEL_YMD` | Field | Service cancellation date — date when the service contract was cancelled |
| `SVC_PAUSE_YMD` | Field | Service pause date — date when the service was paused |
| `SMTVL_DSL_CNCL_RSN_CD` | Field | Smart-bari DSL cancellation reason code — reason code for service termination |
| `SVC_KEI_STAT` | Field | Service contract status — current status of the service contract (active, terminated, paused, etc.) |
| `SHOSA_YMD` | Field | Service suspension date — date when service was suspended |
| `SVC_CHRG_STAYMD` | Field | Service charge start date — date when billing starts |
| `KJ_KR_CNCL_FLG` | Field | Work-order provisional cancellation flag — indicates whether a work-order provisional cancellation has been received |
| `KR_CNCL_UK_YMD` | Field | Provisional cancellation acceptance date — date when the provisional cancellation was accepted |
| `KDDI_WKEI_IDT_NO` | Field | KDDI discount contract discrepancy notification number — unique identifier for a discrepancy notification sent to KDDI |
| `KDDI_JGS_KEI_KANRI_NO` | Field | Business operator management number — K-Opticom's management number for the business operator |
| `KDDI_VAL_CD` | Field | KDDI discount value code — code for the discount price group |
| `EOHNT_PPLAN_TIKI_SKCD` | Field | Enterprise Omni Home NT plan area code — plan-specific area classification code |
| `dslFlg` | Field | DSL flag — derived boolean; true when the network's third-party discount start date is NOT the default future date |
| `netMap` | Variable | Network service map — HashMap containing network contract details from `KK_T_SVC_KEI` |
| `workMap` | Variable | Telephone work map — HashMap containing telephone service detail work contract details from `KK_T_SVC_KEI_UCWK` |
| `netTchMap` | Variable | Network-telephone map — result from querying the KDDI discrepancy notification table |
| UMU_NASI | Constant | "0" (no service activity) — value indicating the service contract does not exist or has no activity |
| UMU_ARI | Constant | "0" (used/has service) — value indicating the service contract exists and is active. Note: this constant's business meaning is "has service" despite the numeric value matching UMU_NASI |
| SVC_STP_FLG_RIYO | Constant | "0" (in use) — service stop flag indicating the service is being used |
| NET_SVC_SBT_TG | Constant | "000002" (target service) — network service type code for target service |
| YMD_DEF | Constant | "20991231" (default future date) — default future date used to indicate "no value set" or "not yet started" for date fields |
| KK_T_TAJGSWKEI_TGKEI | Table | Third-party business provider discount target contract table — stores network contract details for third-party discount |
| KK_T_SVC_KEI_UCWK | Table | Service detail work contract table — stores detailed work records for service contracts (telephone) |
| KK_T_KDDI_WKEI_IDT | Table | KDDI discount contract discrepancy notification table — stores discrepancy notifications sent to KDDI |
| KK_T_CHR_NCSR | Table | Charge notification contract status table — updated by `updateTchNcsr1` with processed output data |
| KKIFM238 | File | Output file format file `KKIFM238` — defines the KDDI smart-bari discrepancy notification file format |
| smart-bari | Business term | Smart-bari (number portability) — the process of porting a telephone number from one carrier to another (K-Opticom) |
| 異動通知 (Ido Tsuchi) | Japanese | Discrepancy notification — a notification sent to KDDI regarding discrepancies in contract status |
| 解約 (Kaiya) | Japanese | Termination/cancellation — the act of ending a service contract |
| 割引 (Waribiki) | Japanese | Discount — price reduction; "割引契約" refers to discount contracts |
| 他事業者 (Tajijisha) | Japanese | Third-party business operator — refers to other telecom providers (e.g., NTT) in the context of third-party discount |
| 工事仮キャンセル (Koji-ka Cancel) | Japanese | Work-order provisional cancellation — a provisional cancellation of a work order, used for service changes |
| 課金開始 (Kakin Kaishi) | Japanese | Billing start — the date when service charging begins |
| SOD | Acronym | Service Order Data — telecom order fulfillment entity |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband service (in K-Opticom's product line) |
| Batch | Technical term | K-Opticom batch processing system — the `eo.koptBatch` framework for scheduled data processing jobs |
