# Business Logic — JBSbatKKSmtvlIdoInfSksi.setOutMapBothUpd() [201 LOC]

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

## 1. Role

### JBSbatKKSmtvlIdoInfSksi.setOutMapBothUpd()

This method orchestrates the batch processing of Smart Barriers (SMTVL) intercompany move notifications between **Internet** and **Telephone** contracted services when a customer migrates one service to another carrier (e.g., KDDI portability). It receives a list of service contract detail records from `mainProp()`, separates them into network-side and telephone-side maps, validates that both sides have consistent KDDI move notification numbers, and then performs the necessary database updates via `updateTchNcsr2()`. After the update, it reads back the telephone service details to derive processing dates, and assembles a comprehensive output map (`JBSbatServiceInterfaceMap`) containing all derived fields — service status codes, dates, and cancellation reasons — required by the Smart Barriers Move Notification File (`JBSbatKKIFM238`). The method implements a **routing/dispatch pattern** (classifying records by service type) combined with a **builder pattern** (accumulating output fields into the final map). It acts as a shared service method called by the batch entry point `mainProp()` and is the core data transformation layer for the portability move notification batch job.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setOutMapBothUpd(outTargetList)"])

    START --> INIT["Initialize: map, netMap, telMap, workMap, outMap"]

    INIT --> LOOP["For each map in outTargetList"]

    LOOP --> CHECK_SVC{SVC_CD check}

    CHECK_SVC -->|YES| SET_NET["netMap = current map"]
    CHECK_SVC -->|NO| SET_TEL["telMap = current map"]

    SET_NET --> CHECK_MORE{More items?}
    SET_TEL --> CHECK_MORE

    CHECK_MORE -->|Yes| LOOP
    CHECK_MORE -->|No| GET_KDDI["Get netKddiWkeiIdtNo and telKddiWkeiIdtNo"]

    GET_KDDI --> CHECK_BOTH{Both non-null?}
    CHECK_BOTH -->|Yes| PASS["Pass through - no action"]
    CHECK_BOTH -->|No| CHECK_NET{Net null and Tel not null?}

    CHECK_NET -->|Yes| ERR_NET["Error: No network move notification"]
    CHECK_NET -->|No| CHECK_TEL{Net not null and Tel null?}

    CHECK_TEL -->|Yes| ERR_TEL["Error: No tel move notification"]
    CHECK_TEL -->|No| ERR_NONE["Error: No move notification for either"]

    ERR_NET --> SET_ERR1["Set errFlg=true, return null"]
    ERR_TEL --> SET_ERR2["Set errFlg=true, return null"]
    ERR_NONE --> SET_ERR3["Set errFlg=true, return null"]

    SET_ERR1 --> END_NULL(["Return null"])
    SET_ERR2 --> END_NULL
    SET_ERR3 --> END_NULL

    PASS --> CHECK_RECORDS{Size >= 3?}
    CHECK_RECORDS -->|Yes| ERR_RECORDS["Error: Too many records"]
    CHECK_RECORDS -->|No| GET_TEL_INFO["Query tel info via KK_SELECT_077"]

    ERR_RECORDS --> SET_ERR4["Set errFlg=true, return null"]
    SET_ERR4 --> END_NULL

    GET_TEL_INFO --> SET_WORK["workMap = selectNext result"]

    SET_WORK --> UPDATE["updateTchNcsr2 netMap telMap"]

    UPDATE --> EXTRACT["Extract fields from netMap and telMap"]

    EXTRACT --> EXTRACT_SVC_STAT["Extract svcKeiStat from both"]

    EXTRACT_SVC_STAT --> EXTRACT_KJ["Extract KjKrCncl flags from KOJIAK"]

    EXTRACT_KJ --> OUT_COMMON["outMapCommon outMap svcKeiNo prcGrpCd pcrsCd pplanCd"]

    OUT_COMMON --> OUT_KDDI["Set KDDI_WKEI_IDT_NO_NET TEL"]

    OUT_KDDI --> OUT_NET["Set net service fields SBT MU_FLG STP_FLG MSKM_YMD CHRG_STAYMD DSL_YMD DLRE"]

    OUT_NET --> OUT_TEL["Set tel service fields SBT MU_FLG STP_FLG MSKM_YMD CHRG_STAYMD DSL_YMD DLRE"]

    OUT_TEL --> OUT_WRIB["Set WRIBPRC_GRP_CD from telMap"]

    OUT_WRIB --> END_NODE(["Return outMap"])
```

**Processing flow summary:**
1. **Initialize** five service interface maps and a work map.
2. **Classify records** by iterating over `outTargetList` — records where `SVC_CD = "01"` go to `netMap` (network), others go to `telMap` (telephone).
3. **Validate KDDI move notification number consistency** — both network and telephone must have (or both must lack) the `KDDI_WKEI_IDT_NO`. Any mismatch triggers a business error and returns null.
4. **Validate record count** — if more than 2 records exist, it is an error.
5. **Query telephone service details** from `KK_T_SVC_KEI_UCWK` to derive processing date information.
6. **Execute the core update** via `updateTchNcsr2(netMap, telMap)`.
7. **Extract all derived fields** from both network and telephone maps (service status, dates, cancellation codes, progress status, etc.).
8. **Build the output map** — common fields first, then KDDI identifiers, then network-specific fields, telephone-specific fields, and the work provider group code.
9. **Return** the fully populated output map.

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `outTargetList` | `JBSbatOutputItem` | The list of service contract detail records to process. Each record represents either a network-side or telephone-side service entry involved in a Smart Barriers move notification. The list should contain exactly 1-2 records (one for each service type). |

**Instance fields read by this method:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `super.commonItem` | `JBSbatCommonItem` | Provides shared batch processing utilities including log printing (`getLogPrint()`) and error flag management (`setErrFlg()`). |
| `super.opeDate` | `String` | The operational date used as a query parameter for telephone service detail lookups. |
| `db_KK_T_SVC_KEI_UCWK` | `JBSbatSQLAccess` | Database access handle for the `KK_T_SVC_KEI_UCWK` (Service Contract Detail) table, used to read back service detail information after the update. |

## 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_SVC_KEI_UCWK_KK_SELECT_077` | KK_SELECT_077 | KK_T_SVC_KEI_UCWK | Reads telephone service contract detail via SQL key KK_SELECT_077 to derive processing dates |
| U | `JBSbatKKSmtvlIdoInfSksi.updateTchNcsr2` | - | KK_T_SVC_KEI, KK_T_KDDI_WKEI_IDT | Executes the core database update for network and telephone service records |
| R | `JBSbatKK_T_SVC_KEI.getSVC_CD` | - | KK_T_SVC_KEI | Reads the SVC_CD field to classify network vs telephone service type |
| R | `JBSbatKK_T_KDDI_WKEI_IDT.getKDDI_WKEI_IDT_NO` | - | KK_T_KDDI_WKEI_IDT | Reads the KDDI portability move notification number from both network and telephone maps |
| R | `JBSbatKKSmtvlIdoInfSksi.getSvcKeiUmuFlg` | - | In-memory computation | Derives service detail work flag from progress status code |
| R | `JBSbatKKSmtvlIdoInfSksi.getSvcStpFlg` | - | In-memory computation | Derives service stop flag from service detail work flag |
| R | `JBSbatKKSmtvlIdoInfSksi.getNetSvcSbt` | - | In-memory computation | Derives net service type abbreviation from service detail work flag and plan zip code |
| R | `JBSbatKKSmtvlIdoInfSksi.getTelSvcSbt` | - | In-memory computation | Derives tel service type abbreviation from the assembled output map |
| R | `JBSbatKKSmtvlIdoInfSksi.getSvcDslYmd` | - | In-memory computation | Derives service contract date from progress status, cancellation/pause dates, and service status |
| R | `JBSbatKKSmtvlIdoInfSksi.getSvcDlre` | - | In-memory computation | Derives service cancellation reason from the move cancellation reason code |
| R | `JBSbatKKSmtvlIdoInfSksi.convSvcChrgStaymd` | - | In-memory computation | Converts service charge start date to operational date if not yet arrived |
| R | `JBSbatKK_T_SVC_KEI_UCWK.selectNext` | - | KK_T_SVC_KEI_UCWK | Retrieves the next row from the database cursor populated by KK_SELECT_077 |
| - | `JBSbatKKSmtvlIdoInfSksi.outMapCommon` | - | - | Sets common output map fields: svcKeiNo, prcGrpCd, pcrsCd, pplanCd |
| - | `JBSbatCommonItem.setErrFlg` | - | - | Sets the batch error flag to true to signal processing failure |
| - | `JBSbatCommonItem.getLogPrint().printBusinessErrorLog` | - | - | Logs business-level error messages with KDDI notification number context |
| R | `JBSbatKK_T_KDDI_WKEI_IDT.getPrgStat` | - | KK_T_KDDI_WKEI_IDT | Reads progress status code for service processing state |
| R | `JBSbatKK_T_SVC_KEI.getShosaYmd` | - | KK_T_SVC_KEI | Reads the inspection/completion date |
| R | `JBSbatKK_T_SVC_KEI.getShosaClYmd` | - | KK_T_SVC_KEI | Reads the inspection cancellation date |
| R | `JBSbatKK_T_SVC_KEI.getSvcDslKisanYmd` | - | KK_T_SVC_KEI | Reads the service contract start date |
| R | `JBSbatKK_T_SVC_KEI.getSvcCancelYmd` | - | KK_T_SVC_KEI | Reads the service cancellation date |
| R | `JBSbatKK_T_SVC_KEI.getSvcPauseYmd` | - | KK_T_SVC_KEI | Reads the service suspension/pause date |
| R | `JBSbatKK_T_SVC_KEI.getSvcKeiStat` | - | KK_T_SVC_KEI | Reads the service contract status |
| R | `JBSbatKK_T_KDDI_WKEI_IDT.getSmtvlDslCnclRsnCd` | - | KK_T_KDDI_WKEI_IDT | Reads the Smart Barriers move cancellation reason code |
| R | `JBSbatKK_T_TAJGS_WRIB_KEI.getKDDI_JGS_KEI_KANRI_NO` | - | KK_T_TAJGS_WRIB_KEI | Reads the other-company portability contract management number |
| R | `JBSbatKK_T_TAJGS_WRIB_KEI.getKDDI_VAL_CD` | - | KK_T_TAJGS_WRIB_KEI | Reads the KDDI value code for work provider processing group |
| R | `JBSbatKK_M_PPLAN.getEOHNT_PPLAN_TIKI_SKCD` | - | KK_M_PPLAN | Reads the plan zip code for net service type determination |
| R | `JBSbatKU_T_KOJIAK.getKJ_KR_CNCL_FLG` | - | KU_T_KOJIAK | Reads the construction provisional cancellation flag |
| R | `JBSbatKU_T_KOJIAK.getKR_CNCL_UK_YMD` | - | KU_T_KOJIAK | Reads the provisional cancellation receipt date |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: JBSbatKKSmtvlIdoInfSksi | `JBSbatKKSmtvlIdoInfSksi.mainProp()` -> `setOutMapBothUpd(outTargetList)` | `updateTchNcsr2 [U] KK_T_SVC_KEI, KK_T_KDDI_WKEI_IDT`, `selectNext [R] KK_T_SVC_KEI_UCWK`, `convSvcChrgStaymd [-]`, `getSvcDslYmd [-]`, `getSvcDlre [-]`, `getNetSvcSbt [-]`, `getTelSvcSbt [-]`, `getSvcKeiUmuFlg [-]`, `getSvcStpFlg [-]`, `outMapCommon [-]`, `printBusinessErrorLog [-]`, `setErrFlg [-]` |

## 6. Per-Branch Detail Blocks

**Block 1** — [Variable Initialization] (L2017)

> Initialize five service interface maps for network, telephone, and output routing, plus a temporary work map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `map = new JBSbatServiceInterfaceMap();` |
| 2 | SET | `netMap = new JBSbatServiceInterfaceMap();` |
| 3 | SET | `telMap = new JBSbatServiceInterfaceMap();` |
| 4 | SET | `workMap = new HashMap<String, Object>();` |
| 5 | SET | `outMap = new JBSbatServiceInterfaceMap();` |

**Block 2** — [FOR Loop] `(i = 0; i < outTargetList.getOutMapList().size(); i++)` (L2019)

> Iterate over all records in the input list to classify each as network or telephone service.

| # | Type | Code |
|---|------|------|
| 1 | SET | `map = (JBSbatServiceInterfaceMap) outTargetList.getOutMapList().get(i);` |
| 2 | EXEC | See Block 2.1 — SVC_CD classification |

**Block 2.1** — [IF/ELSE] `(SVC_CD_NET.equals(map.getString(JBSbatKK_T_SVC_KEI.SVC_CD)))` [SVC_CD_NET="01" (Network service code)] (L2026)

> Classify the current record: if SVC_CD equals "01" it is a network service; otherwise it is a telephone service.

| # | Type | Code |
|---|------|------|
| 1 | SET | `netMap = map;` // Network side assignment |
| 2 | ELSE | `telMap = map;` // Telephone side assignment (else-branch) |

**Block 3** — [KDDI Move Notification Number Extraction] (L2037-L2038)

> Retrieve the KDDI portability move notification numbers from both netMap and telMap for consistency validation.

| # | Type | Code |
|---|------|------|
| 1 | SET | `netKddiWkeiIdtNo = netMap.getString(JBSbatKK_T_KDDI_WKEI_IDT.KDDI_WKEI_IDT_NO);` // KDDI notify number from network |
| 2 | SET | `telKddiWkeiIdtNo = telMap.getString(JBSbatKK_T_KDDI_WKEI_IDT.KDDI_WKEI_IDT_NO);` // KDDI notify number from telephone |

**Block 4** — [IF/ELSE-IF/ELSE/ELSE] KDDI Notification Consistency Check (L2040-L2077)

> Validate that both network and telephone side have consistent KDDI move notification presence. Both must have it, or both must lack it. Any inconsistency is a data error.

**Block 4.1** — [IF] `(isNull(netKddiWkeiIdtNo) && isNull(telKddiWkeiIdtNo))` (L2040)

> Both sides have a KDDI notification number — this is valid. Pass through without action.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `// ここでは何もしない` (Do nothing here — both have the number) |

**Block 4.2** — [ELSE-IF] `(isNull(netKddiWkeiIdtNo) && isNull(telKddiWkeiIdtNo) == false)` (L2044)

> Network has no KDDI notification number but telephone does — data inconsistency. Log error about missing network move notification for the given KDDI tel notify number.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `commonItem.getLogPrint().printBusinessErrorLog(EKKB0010CW, "KDDI割引契約異動通知番号: " + telKddiWkeiIdtNo + " に、ネットワーク異動通知がない。")` // Error: No network move notification for KDDI tel notify |
| 2 | EXEC | `super.commonItem.setErrFlg(true);` // Set error flag |
| 3 | RETURN | `return null;` |

**Block 4.3** — [ELSE-IF] `(isNull(netKddiWkeiIdtNo) == false && isNull(telKddiWkeiIdtNo))` (L2052)

> Network has a KDDI notification number but telephone does not — data inconsistency. Log error about missing telephone move notification.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `commonItem.getLogPrint().printBusinessErrorLog(EKKB0010CW, "KDDI割引契約異動通知番号: " + netKddiWkeiIdtNo + " に、電話の異動通知がない。")` // Error: No tel move notification for KDDI net notify |
| 2 | EXEC | `super.commonItem.setErrFlg(true);` // Set error flag |
| 3 | RETURN | `return null;` |

**Block 4.4** — [ELSE] (L2059)

> Neither side has a KDDI notification number — no move notification exists at all.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `commonItem.getLogPrint().printBusinessErrorLog(EKKB0010CW, "ネット・電話共に異動通知がない。")` // Error: No move notification for either network or telephone |
| 2 | EXEC | `super.commonItem.setErrFlg(true);` // Set error flag |
| 3 | RETURN | `return null;` |

**Block 5** — [IF] `(outTargetList.getOutMapList().size() >= 3)` (L2079)

> Validate that the record count does not exceed 2. If 3 or more records are present, it indicates abnormal data. Log an error with the KDDI notification number and the record count issue.

| # | Type | Code |
|---|------|------|
| 1 | SET | `overMap = (JBSbatServiceInterfaceMap) outTargetList.getOutMapList().get(0);` |
| 2 | SET | `kddiWkeiIdtNo = overMap.getString(JBSbatKK_T_KDDI_WKEI_IDT.KDDI_WKEI_IDT_NO);` |
| 3 | EXEC | `commonItem.getLogPrint().printBusinessErrorLog(EKKB0010CW, "KDDI割引契約異動通知番号: " + kddiWkeiIdtNo + " 通知対象レコード数が3件以上。")` // Error: Notify target records >= 3 |
| 4 | EXEC | `super.commonItem.setErrFlg(true);` |
| 5 | RETURN | `return null;` |

**Block 6** — [Telephone Service Detail Query] (L2090-L2096)

> Query the telephone service contract detail from `KK_T_SVC_KEI_UCWK` to derive processing date information. Uses the telephone service number, service detail number, and operational date as query parameters.

| # | Type | Code |
|---|------|------|
| 1 | SET | `paramUcwk[0] = telMap.getString(JBSbatKK_T_SVC_KEI_UCWK.SVC_KEI_NO);` // Service contract number |
| 2 | SET | `paramUcwk[1] = telMap.getString(JBSbatKK_T_SVC_KEI_UCWK.SVC_KEI_UCWK_NO);` // Service detail number |
| 3 | SET | `paramUcwk[2] = super.opeDate;` // Operational date |
| 4 | EXEC | `executeKK_T_SVC_KEI_UCWK_KK_SELECT_077(paramUcwk);` // Execute SQL select |
| 5 | SET | `rstMapTel = db_KK_T_SVC_KEI_UCWK.selectNext();` |
| 6 | IF | `if (rstMapTel != null)` → `workMap = rstMapTel.getMap();` |

**Block 7** — [Core Update Call] (L2099)

> Execute the core database update that processes the move notification between network and telephone contracts.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `updateTchNcsr2(netMap, telMap);` // Update network and telephone service records |

**Block 8** — [Field Extraction from netMap] (L2101-L2131)

> Extract all relevant fields from the network map for output field computation. This includes service contract info, progress status, dates, cancellation codes, service status, and construction provisional cancellation flags.

| # | Type | Code |
|---|------|------|
| 1 | SET | `svcKeiNo = (String) netMap.get(JBSbatKK_T_SVC_KEI.SVC_KEI_NO);` // Service contract number |
| 2 | SET | `prcGrpCd = (String) netMap.get(JBSbatKK_T_SVC_KEI.PRC_GRP_CD);` // Price group code |
| 3 | SET | `pcrsCd = (String) netMap.get(JBSbatKK_T_SVC_KEI.PCRS_CD);` // Price cost code |
| 4 | SET | `pplanCd = (String) netMap.get(JBSbatKK_T_SVC_KEI.PPLAN_CD);` // Price plan code |
| 5 | SET | `netPrgStat = netMap.getString(JBSbatKK_T_KDDI_WKEI_IDT.PRG_STAT);` // Network progress status |
| 6 | SET | `telPrgStat = telMap.getString(JBSbatKK_T_KDDI_WKEI_IDT.PRG_STAT);` // Telephone progress status |
| 7 | SET | `netShosaClYmd = netMap.getString(JBSbatKK_T_SVC_KEI.SHOSA_CL_YMD);` // Network inspection cancellation date |
| 8 | SET | `telShosaClYmd = telMap.getString(JBSbatKK_T_SVC_KEI.SHOSA_CL_YMD);` // Telephone inspection cancellation date |
| 9 | SET | `netSvcDslKisanYmd = netMap.getString(JBSbatKK_T_SVC_KEI.SVC_DSL_KISAN_YMD);` // Network service start date |
| 10 | SET | `telSvcDslKisanYmd = telMap.getString(JBSbatKK_T_SVC_KEI.SVC_DSL_KISAN_YMD);` // Telephone service start date |
| 11 | SET | `netSvcCancelYmd = netMap.getString(JBSbatKK_T_SVC_KEI.SVC_CANCEL_YMD);` // Network cancellation date |
| 12 | SET | `telSvcCancelYmd = telMap.getString(JBSbatKK_T_SVC_KEI.SVC_CANCEL_YMD);` // Telephone cancellation date |
| 13 | SET | `netSvcPauseYmd = netMap.getString(JBSbatKK_T_SVC_KEI.SVC_PAUSE_YMD);` // Network pause date |
| 14 | SET | `telSvcPauseYmd = telMap.getString(JBSbatKK_T_SVC_KEI.SVC_PAUSE_YMD);` // Telephone pause date |
| 15 | SET | `netSmtvlDslCnclRsnCd = netMap.getString(JBSbatKK_T_KDDI_WKEI_IDT.SMTVL_DSL_CNCL_RSN_CD);` // Network move cancellation reason code |
| 16 | SET | `telSmtvlDslCnclRsnCd = telMap.getString(JBSbatKK_T_KDDI_WKEI_IDT.SMTVL_DSL_CNCL_RSN_CD);` // Telephone move cancellation reason code |
| 17 | SET | `netSvcKeiStat = netMap.getString(JBSbatKK_T_SVC_KEI.SVC_KEI_STAT);` // Network service status |
| 18 | SET | `telSvcKeiStat = telMap.getString(JBSbatKK_T_SVC_KEI.SVC_KEI_STAT);` // Telephone service status |
| 19 | SET | `netKjKrCnclFlg = netMap.getString(JBSbatKU_T_KOJIAK.KJ_KR_CNCL_FLG);` // Network construction provisional cancellation flag |
| 20 | SET | `telKjKrCnclFlg = telMap.getString(JBSbatKU_T_KOJIAK.KJ_KR_CNCL_FLG);` // Telephone construction provisional cancellation flag |
| 21 | SET | `netKrCnclUkYmd = netMap.getString(JBSbatKU_T_KOJIAK.KR_CNCL_UK_YMD);` // Network provisional cancellation receipt date |
| 22 | SET | `telKrCnclUkYmd = telMap.getString(JBSbatKU_T_KOJIAK.KR_CNCL_UK_YMD);` // Telephone provisional cancellation receipt date |

**Block 9** — [Common Output Setup] (L2134)

> Set common output map fields shared between network and telephone.

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

**Block 10** — [KDDI Notification Number Output] (L2136-L2140)

> Write the KDDI move notification numbers into the output map for both network and telephone sides, plus the other-company portability contract management number.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `outMap.setString(JBSbatKKIFM238.KDDI_WKEI_IDT_NO_NET, netMap.getString(JBSbatKK_T_KDDI_WKEI_IDT.KDDI_WKEI_IDT_NO));` |
| 2 | EXEC | `outMap.setString(JBSbatKKIFM238.KDDI_WKEI_IDT_NO_TEL, telMap.getString(JBSbatKK_T_KDDI_WKEI_IDT.KDDI_WKEI_IDT_NO));` |
| 3 | EXEC | `outMap.setString(JBSbatKKIFM238.JIGYOSHA_KEI_KNRI_NO, netMap.getString(JBSbatKK_T_TAJGS_WRIB_KEI.KDDI_JGS_KEI_KANRI_NO));` |

**Block 11** — [Network Service Output Fields] (L2148-L2176)

> Build all network-specific output fields. Uses computed helper methods to derive service type, work flag, stop flag, message date, charge start date, contract date, and cancellation reason.

| # | Type | Code |
|---|------|------|
| 1 | SET | `netSvcKeiUmuFlg = getSvcKeiUmuFlg(netPrgStat);` // Network service detail work flag |
| 2 | EXEC | `outMap.setString(JBSbatKKIFM238.NET_SVC_KEI_UMU_FLG, netSvcKeiUmuFlg);` |
| 3 | EXEC | `outMap.setString(JBSbatKKIFM238.NET_SVC_STP_FLG, getSvcStpFlg(netSvcKeiUmuFlg));` // Service stop flag derived from work flag |
| 4 | EXEC | `outMap.setString(JBSbatKKIFM238.NET_SVC_SBT, getNetSvcSbt(netSvcKeiUmuFlg, netMap.getString(JBSbatKK_M_PPLAN.EOHNT_PPLAN_TIKI_SKCD)));` // Network service type |
| 5 | EXEC | `outMap.setString(JBSbatKKIFM238.NET_SVC_MSKM_YMD, netMap.getString(JBSbatKK_T_SVC_KEI.SHOSA_YMD));` // Network inspection/completion date |
| 6 | EXEC | `outMap.setString(JBSbatKKIFM238.NET_SVC_CHRG_STAYMD, convSvcChrgStaymd(netMap.getString(JBSbatKK_T_SVC_KEI.SVC_CHRG_STAYMD)));` // Network charge start date (converted to operational date if not arrived) |
| 7 | EXEC | `outMap.setString(JBSbatKKIFM238.NET_SVC_DSL_YMD, getSvcDslYmd(netPrgStat, netShosaClYmd, netSvcDslKisanYmd, netSvcCancelYmd, netSvcPauseYmd, netSvcKeiStat, netKjKrCnclFlg, netKrCnclUkYmd));` // Network service contract date |
| 8 | EXEC | `outMap.setString(JBSbatKKIFM238.NET_SVC_DLRE, getSvcDlre(outMap, netSmtvlDslCnclRsnCd, "0"));` // Network cancellation reason ("0" = network) |

**Block 12** — [Telephone Service Output Fields] (L2178-L2208)

> Build all telephone-specific output fields. Similar to Block 11 but uses telephone-side data and the workMap values from the database query.

| # | Type | Code |
|---|------|------|
| 1 | SET | `telSvcKeiUmuFlg = getSvcKeiUmuFlg(telPrgStat);` // Telephone service detail work flag |
| 2 | EXEC | `outMap.setString(JBSbatKKIFM238.TEL1_SVC_KEI_UMU_FLG, telSvcKeiUmuFlg);` |
| 3 | EXEC | `outMap.setString(JBSbatKKIFM238.TEL1_SVC_STP_FLG, getSvcStpFlg(telSvcKeiUmuFlg));` // Service stop flag |
| 4 | EXEC | `outMap.setString(JBSbatKKIFM238.TEL1_SVC_SBT, getTelSvcSbt(outMap));` // Telephone service type |
| 5 | EXEC | `outMap.setString(JBSbatKKIFM238.TEL1_SVC_MSKM_YMD, (String) workMap.get(JBSbatKK_T_SVC_KEI_UCWK.SHOSA_YMD));` // Telephone inspection/completion date (from DB query) |
| 6 | EXEC | `outMap.setString(JBSbatKKIFM238.TEL1_SVC_CHRG_STAYMD, convSvcChrgStaymd((String) workMap.get(JBSbatKK_T_SVC_KEI_UCWK.SVC_CHRG_STAYMD)));` // Telephone charge start date (converted) |
| 7 | EXEC | `outMap.setString(JBSbatKKIFM238.TEL1_SVC_DSL_YMD, getSvcDslYmd(telPrgStat, telShosaClYmd, telSvcDslKisanYmd, telSvcCancelYmd, telSvcPauseYmd, telSvcKeiStat, telKjKrCnclFlg, telKrCnclUkYmd));` // Telephone service contract date |
| 8 | EXEC | `outMap.setString(JBSbatKKIFM238.TEL1_SVC_DLRE, getSvcDlre(outMap, telSmtvlDslCnclRsnCd, "1"));` // Telephone cancellation reason ("1" = telephone) |
| 9 | EXEC | `outMap.setString(JBSbatKKIFM238.WRIBPRC_GRP_CD, telMap.getString(JBSbatKK_T_TAJGS_WRIB_KEI.KDDI_VAL_CD));` // Work provider processing group code |

**Block 13** — [Return] (L2210)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return outMap;` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `SVC_CD_NET` | Constant | Service code for Internet service — value "01". Used to classify records as network-side in the Smart Barriers move notification. |
| `svc_kei_no` | Field | Service contract number — the unique identifier for a service contract. |
| `svc_kei_ucwk_no` | Field | Service detail work number — internal tracking ID for service contract line items. |
| `svc_kei_stat` | Field | Service contract status — indicates the current state of a service contract (active, cancelled, suspended, etc.). |
| `prd_grp_cd` | Field | Price group code — classifies the pricing tier of a service. |
| `pcrs_cd` | Field | Price cost code — identifies the pricing cost structure. |
| `pplan_cd` | Field | Price plan code — identifies the specific pricing plan. |
| `prg_stat` | Field | Progress status — the processing status code of a move notification (e.g., "0900" for inspection OK, "0901" for inspection cancellation, "1422" for course change completed). |
| `shosa_ymd` | Field | Inspection/completion date — the date when service inspection was completed. |
| `shosa_cl_ymd` | Field | Inspection cancellation date — the date when a service inspection was cancelled. |
| `svc_dsl_kisan_ymd` | Field | Service contract start date — the date when the service contract became effective. |
| `svc_cancel_ymd` | Field | Service cancellation date — the date when the service was cancelled. |
| `svc_pause_ymd` | Field | Service suspension date — the date when the service was temporarily suspended/paused. |
| `svc_chrg_staymd` | Field | Service charge start date — the date when billing starts for the service. |
| `smtvl_dsl_cncl_rsn_cd` | Field | Smart Barriers move cancellation reason code — the reason code for a Smart Barriers (intercarrier) move cancellation. |
| `smtvl_ido_dtl_cd` | Field | Smart Barriers move detail code — detailed classification of the Smart Barriers move type. |
| `kddi_wkei_idt_no` | Field | KDDI portability move notification number — the unique notification number for KDDI intercarrier portability. |
| `kddi_wkei_idt_stat_cd` | Field | KDDI portability move notification status code. |
| `kddi_wkei_idt_sbt_cd` | Field | KDDI portability move notification type code. |
| `kddi_jgs_kei_kanri_no` | Field | Other-company portability contract management number — manages contracts where a customer moves from another carrier. |
| `kddi_val_cd` | Field | KDDI value code — used to identify work provider processing group classification. |
| `kj_kr_cncl_flg` | Field | Construction provisional cancellation flag — indicates whether a construction provisional cancellation has been received. |
| `kr_cncl_uk_ymd` | Field | Provisional cancellation receipt date — the date a provisional cancellation was received. |
| `wribprc_grp_cd` | Field | Work provider processing group code — classifies the type of work provider processing. |
| KK_T_SVC_KEI | Table | Service Contract table — stores service contract header information (contract number, status, service codes, dates). |
| KK_T_SVC_KEI_UCWK | Table | Service Contract Detail table — stores service contract line item details (detailed work numbers, inspection dates, charge start dates). |
| KK_T_KDDI_WKEI_IDT | Table | KDDI Portability Move Notification table — stores KDDI intercarrier portability move notification records including progress status and cancellation reasons. |
| KK_T_TAJGS_WRIB_KEI_TGKEI | Table | Other-Company Portability Contract Target Contract table — stores contracts involving carrier-to-carrier moves. |
| KK_T_WRISVC_TG_KEI | Table | Work Service Target Contract table — stores work service target contract relationships. |
| KK_M_OLD_ICS_CD_CHG | Table | Old ICS Code Change master table — maps old ICS codes to new ones. |
| KU_T_KOJIAK | Table | Construction Case table — stores construction case information including provisional cancellation data. |
| KK_M_PPLAN | Table | Price Plan master table — stores pricing plan definitions including zip code mappings. |
| JBSbatKKIFM238 | File Format | Smart Barriers Move Notification File format — the output file specification for intercarrier move notification data. |
| `JBSbatKKIFM238.NET_SVC_KEI_UMU_FLG` | Field | Network service detail work flag output field. |
| `JBSbatKKIFM238.NET_SVC_STP_FLG` | Field | Network service stop flag output field. |
| `JBSbatKKIFM238.NET_SVC_SBT` | Field | Network service type output field. |
| `JBSbatKKIFM238.NET_SVC_MSKM_YMD` | Field | Network service inspection/completion date output field. |
| `JBSbatKKIFM238.NET_SVC_CHRG_STAYMD` | Field | Network service charge start date output field. |
| `JBSbatKKIFM238.NET_SVC_DSL_YMD` | Field | Network service contract date output field. |
| `JBSbatKKIFM238.NET_SVC_DLRE` | Field | Network service cancellation reason output field. |
| `JBSbatKKIFM238.TEL1_SVC_KEI_UMU_FLG` | Field | Telephone service detail work flag output field. |
| `JBSbatKKIFM238.TEL1_SVC_STP_FLG` | Field | Telephone service stop flag output field. |
| `JBSbatKKIFM238.TEL1_SVC_SBT` | Field | Telephone service type output field. |
| `JBSbatKKIFM238.TEL1_SVC_MSKM_YMD` | Field | Telephone service inspection/completion date output field. |
| `JBSbatKKIFM238.TEL1_SVC_CHRG_STAYMD` | Field | Telephone service charge start date output field. |
| `JBSbatKKIFM238.TEL1_SVC_DSL_YMD` | Field | Telephone service contract date output field. |
| `JBSbatKKIFM238.TEL1_SVC_DLRE` | Field | Telephone service cancellation reason output field. |
| EKKB0010CW | Constant | Business error log code — the error code used for logging Smart Barriers move notification validation errors. |
| SMTVL | Acronym | Smart Barriers — intercarrier move notification system for MNP (Mobile Number Portability) / portability between carriers. |
| IDO | Acronym | Ido (異動) — move/transfer, refers to carrier change or service transfer. |
| SVC_KEI | Acronym | Service Keiyaku (サービス契約) — service contract. |
| SVC_KEI_UCWK | Acronym | Service Keiyaku Uchiku (サービス契約内訳) — service contract detail / breakdown. |
| WKEI_IDT | Acronym | Wakei Idouchuu (割引契約異動中) — discount contract in progress of move. |
| MSKM | Acronym | Masukomi (入力) — entry/input, refers to service entry/completion. |
| SHOSA | Acronym | Shousa (調査) — inspection/research of service. |
| PRC_GRP | Acronym | Price Group — pricing tier classification. |
| PCRS | Acronym | Price Cost — pricing cost structure. |
| KJ_KR_CNCL | Acronym | Kousen Karen Cancel (工事仮キャンセル) — construction provisional cancellation. |
| WRIBPRC | Acronym | Wriber Puretsu (ワibreプレツス) — work provider pricing/processing. |
| OPE_DATE | Field | Operational date — the date used for batch processing operations, typically the current processing date. |
| `updateTchNcsr2` | Method | Core database update method that updates both network and telephone service records for a Smart Barriers move. |
| `getSvcDslYmd` | Method | Derives the service contract effective date from progress status, various date fields, and service status using business rules. |
| `getSvcDlre` | Method | Derives the service cancellation reason from the Smart Barriers move cancellation reason code and a service side indicator. |
| `getNetSvcSbt` | Method | Derives the network service type abbreviation from the service work flag and plan zip code. |
| `getTelSvcSbt` | Method | Derives the telephone service type abbreviation from the assembled output map. |
| `getSvcKeiUmuFlg` | Method | Derives the service detail work flag from the progress status code. |
| `getSvcStpFlg` | Method | Derives the service stop flag from the service detail work flag. |
| `convSvcChrgStaymd` | Method | Converts the service charge start date to the operational date if the charge start date has not yet arrived. |
| `outMapCommon` | Method | Sets common output map fields including service contract number, price group code, price cost code, and price plan code. |
| `mainProp` | Method | Batch entry point that iterates over records and calls `setOutMapBothUpd` for each pair of network/telephone services. |
