# Business Logic — JBSbatKKKnytcsTrgtCst.outPutKktkSvcKeiAdChg() [441 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.business.service.JBSbatKKKnytcsTrgtCst` |
| Layer | Batch |
| Module | `service` (Package: `eo.business.service`) |

## 1. Role

### JBSbatKKKnytcsTrgtCst.outPutKktkSvcKeiAdChg()

This method is responsible for preparing and filtering contract content notification document data for output during a residential move (住変更) scenario. Specifically, it retrieves schema-matched display text records for service contracts by executing two SQL queries — one for general contract notification text (`executeKK_T_KKTK_SVC_KEI_KK_SELECT_221`) and one for terminal service contract text (`executeKK_T_KKTK_SVC_KEI_KK_SELECT_230`) — then merges the results into a single list. It subsequently applies a series of conditional filters based on the display condition code (`MNGN_DSP_JKN_KSITEI_CD`) to determine which records qualify for output to the contract notification file. The method implements a dispatch pattern: for each candidate record, it evaluates the display condition code to decide whether the record should be included in the final output or logged as rejected. Branches handle seven distinct display condition codes: NULL (plain text output), "012" (warranty/Xperia/ARROWS/LAVIE), "013" (warranty/MediaPad), "016" (TDSL for phone option), "020" (initial contract cancellation), "027" (tablet text), and "028" (GN text). Records that do not pass validation are logged via `createLog()` with a reason code describing the rejection category. The method uses output-duplicate-prevention flags (`outPutZumiFlg`, `outPutZumiFlgTab`, `outPutZumiFlgGh`) to ensure that codes "020", "027", and "028" each produce at most one output record. This method serves as the core data preparation and filtering engine in the batch pipeline, feeding its results into the `JBSbatOutputItem` for downstream file generation.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["outPutKktkSvcKeiAdChg start"])

    INIT["Initialize: serchResultList, outPutZumiFlg, outPutZumiFlgTab, outPutZumiFlgGh"]

    BIND1["Build kktkSvcKei binding variables<br/>mskmNo, famipaKeiUm, mskmSbtCd, opeDate x3"]

    SQL1["Execute executeKK_T_KKTK_SVC_KEI_KK_SELECT_221<br/>Contract notification text schema search"]

    LOOP1["While db_KK_T_KKTK_SVC_KEI.selectNext() != null"]

    MAP1["Create resultMap from dbKktkSvcKei<br/>KNYTCS_NO, KNYTCS_DSP_MNGN_CD, DSP_PST_SKCD,<br/>TELNO_JUN, TV_DSP_NO, MNGN_DSP_JKN_KSITEI_CD,<br/>KIKI_HUKA_INFO_CD, KKTK_SVC_KEI_NO, PLAN_CHRG_STAYMD"]

    CHECK_TV["Call isTvDspMap(tvDspMap, svcKeiUcwkNo, dspPstSkcd)"]

    ADD1["Add resultMap to serchResultList_KktkSvcKei"]

    SQL2["Execute executeKK_T_KKTK_SVC_KEI_KK_SELECT_230<br/>Terminal service contract schema search"]

    LOOP2["While db_KK_T_KKTK_SVC_KEI.selectNext() != null"]

    MAP2["Create resultMap from dbInfKktkSvcKei_Plc<br/>KNYTCS_NO, KNYTCS_DSP_MNGN_CD, DSP_PST_SKCD,<br/>TELNO_JUN, TV_DSP_NO, KEI_CNT, MNGN_DSP_JKN_KSITEI_CD,<br/>KIKI_HUKA_INFO_CD"]

    ADD2["Add resultMap to serchResultList_KktkSvcKei"]

    OUT_INIT["Initialize output maps: tmpMap, outPutZumiFlg, outPutZumiFlgTab, outPutZumiFlgGh"]

    FOR1["for i=0 to serchResultList size"]

    TRANSFER["Transfer resultMap to JBSbatServiceInterfaceMap outmap"]

    FILTER["Call isOutPutTgDspPstSkcd(dspPstSkcd)"]

    B0_NULL["MNGN_DSP_JKN_KSITEI_CD = NULL<br/>-> setOutFlg, addOutMapList"]

    B012_013_024["MNGN_DSP_JKN_KSITEI_CD = 012 or 013 or 024"]

    PLAN_FLG["Call isTkyKkn(planChgStayMd)"]

    CASE12["MNGN = 012: Ansin Xperia/ARROWS/LAVIE<br/>KIKI_HUKA=066-069, tnmtHosyou=true, planChgStaFlg=true<br/>-> setOutFlg, addOutMapList"]

    CASE13["MNGN = 013: Ansin MediaPad<br/>KIKI_HUKA=074-075, tnmtHosyou=true, planChgStaFlg=true<br/>-> setOutFlg, addOutMapList"]

    CASE024["MNGN = 024: EO Shopping<br/>KIKI_HUKA=066-069 or 074-075, tnmtHosyou=false, planChgStaFlg=true<br/>-> setOutFlg, addOutMapList"]

    B016["MNGN = 016: TDSL for phone option<br/>svcInfoMap CD00130_01 is blank<br/>-> setOutFlg, TELNO_JUN=1, addOutMapList"]

    B020["MNGN = 020: Initial contract cancellation<br/>outPutZumiFlg=false<br/>-> setOutFlg, TV_DSP_NO=1, addOutMapList, outPutZumiFlg=true"]

    B027["MNGN = 027: Tablet text output<br/>outPutZumiFlgTab=false<br/>-> setOutFlg, addOutMapList, outPutZumiFlgTab=true"]

    B028["MNGN = 028: GN text output<br/>outPutZumiFlgGh=false<br/>-> setOutFlg, addOutMapList, outPutZumiFlgGh=true"]

    ELSE_LOG["Call createLog() for rejected records"]

    END_N(["Return (void)"])

    START --> INIT --> BIND1 --> SQL1 --> LOOP1 --> MAP1 --> CHECK_TV
    CHECK_TV -- "true" --> ADD1
    CHECK_TV -- "false" --> SKIP1["Skip - not in TV display"]
    ADD1 --> SQL2
    SQL2 --> LOOP2 --> MAP2 --> ADD2
    LOOP2 --> OUT_INIT --> FOR1 --> TRANSFER --> FILTER
    FILTER -- "true" --> B0_NULL
    B0_NULL --> B012_013_024
    B012_013_024 --> PLAN_FLG
    PLAN_FLG --> CASE12
    PLAN_FLG --> CASE13
    PLAN_FLG --> CASE024
    CASE12 --> ELSE_LOG
    CASE13 --> ELSE_LOG
    CASE024 --> ELSE_LOG
    FILTER -- "false" --> ELSE_LOG
    ELSE_LOG --> B016
    B016 --> B020
    B020 --> B027
    B027 --> B028
    B028 --> END_N

    SKIP1 --> SQL2
```

**Constant Resolution:**

| Constant Name | Value | Business Meaning |
|---|---|---|
| `MNGN_DSP_JKN_KSITEI_CD_012` | `"012"` | Display condition: Warranty (Xperia/ARROWS/LAVIE) |
| `MNGN_DSP_JKN_KSITEI_CD_013` | `"013"` | Display condition: Warranty (MediaPad) |
| `MNGN_DSP_JKN_KSITEI_CD_016` | `"016"` | Display condition: TDSL text for phone option |
| `MNGN_DSP_JKN_KSITEI_CD_020` | `"020"` | Display condition: Initial contract cancellation |
| `MNGN_DSP_JKN_KSITEI_CD_024` | `"024"` | Display condition: EO Shopping mobile point preset |
| `MNGN_DSP_JKN_KSITEI_CD_027` | `"027"` | Display condition: Tablet text output control |
| `MNGN_DSP_JKN_KSITEI_CD_028` | `"028"` | Display condition: GN text output control |
| `TV_DSP_NO_01` | `"1"` | TV display position number (initial contract cancellation) |
| `KKHK_INFO_CD_066` | `"066"` | Device附加 info code - Warranty (Xperia/ARROWS/LAVIE) |
| `KKHK_INFO_CD_067` | `"067"` | Device附加 info code - Warranty (Xperia/ARROWS/LAVIE) |
| `KKHK_INFO_CD_068` | `"068"` | Device附加 info code - Warranty (Xperia/ARROWS/LAVIE) |
| `KKHK_INFO_CD_069` | `"069"` | Device附加 info code - Warranty (Xperia/ARROWS/LAVIE) |
| `KKHK_INFO_CD_074` | `"074"` | Device附加 info code - Warranty (MediaPad) |
| `KKHK_INFO_CD_075` | `"075"` | Device附加 info code - Warranty (MediaPad) |
| `CD00130_01` | (service code key) | Key in svcInfoMap for TDSL service check |

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `inMap` | `JBSbatServiceInterfaceMap` | Contract notification document data carrier — holds the contract number (`KNYTCS_NO`), submission type code (`MSKM_SBT_CD`), and submission number (`MSKM_NO`) as the primary business identifier for the residential move batch operation. |
| 2 | `outputBean` | `JBSbatOutputItem` | Output document container — accumulates all qualified records for the contract notification file. The method calls `addOutMapList()` to push each passing record into this list for downstream file generation. |
| 3 | `tvDspMap` | `HashMap<String, String>` | TV display position map — maps service detail work numbers (`SVC_KEI_UCWK_NO`) to TV display position numbers (`TV_DSP_NO`). Used as a pre-filter: only records whose `SVC_KEI_UCWK_NO` exists in this map are included in the result list (first SQL loop). |
| 4 | `svcInfoMap` | `HashMap<String, String>` | Service information map — carries service code data used to determine whether a TDSL (TDSL for phone option) text should be output. Specifically checked for the presence of `CD00130_01`; if blank, the output is approved. |

**Instance fields read by this method:**

| Field | Type | Business Meaning |
|---|---|---|
| `super.opeDate` | `String` (inherited) | Operation date — used as the applicable period start/end date and effective date for contract notification text display |
| `super.logPrint` | `ILogPrint` (inherited) | Debug log printer — used for logging approved and rejected records |
| `db_KK_T_KKTK_SVC_KEI` | `JBSbatCommonDBInterface` (inherited) | Database result handler for the `KK_T_KKTK_SVC_KEI` table — reused across both SQL queries |
| `famipaKeiUm` | `String` | Family pack contract existence flag — bound as a query parameter for the first SQL execution |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `executeKK_T_KKTK_SVC_KEI_KK_SELECT_221` | EKKTK_SVC_KEI_SELECT_221 | `KK_T_KKTK_SVC_KEI` | Executes SQL to retrieve contract notification text schema matching the submission number, family pack flag, submission type code, and operation dates. Returns display condition codes, phone number sequence, TV display positions, and device additional info codes. |
| R | `executeKK_T_KKTK_SVC_KEI_KK_SELECT_230` | EKKTK_SVC_KEI_SELECT_230 | `KK_T_KKTK_SVC_KEI` | Executes SQL to retrieve terminal service contract schema matching the submission number, submission type code, and operation dates. Returns contract count (`KEI_CNT`) and additional display fields. |
| R | `JBSbatFUCaseFileRnkData.getString` | JBSbatFUCaseFileRnkData | - | Reads string fields from case file ranking data (utility helper) |
| R | `JBSbatFUMoveNaviData.getString` | JBSbatFUMoveNaviData | - | Reads string fields from move navigation data (utility helper) |
| R | `JBSbatZMAdDataSet.getString` | JBSbatZMAdDataSet | - | Reads string fields from ZM AD dataset (utility helper) |
| R | `JESC0101B010TPMA.getString` | JESC0101B010 | - | Reads string fields from ESC0101B010 data (telecom service) |
| R | `JESC0101B020TPMA.getString` | JESC0101B020 | - | Reads string fields from ESC0101B020 data (telecom service) |
| C | `JBSbatKKGetCTITelno.addOutMapList` | JBSbatKKGetCTITelno | - | Adds output map list entry to the output bean for the contract notification file |
| C | `JBSbatKKKnytcsTrgtCst.createLog` | JBSbatKKKnytcsTrgtCst | - | Creates a log entry for rejected records with reason code |
| - | `JBSbatKKKnytcsTrgtCst.isOutPutkikiHukaInfoCdAnsin` | JBSbatKKKnytcsTrgtCst | - | Checks if device附加 info code is within warranty range 066-069 (Xperia/ARROWS/LAVIE) |
| - | `JBSbatKKKnytcsTrgtCst.isOutPutkikiHukaInfoCdAnsinMediaPad` | JBSbatKKKnytcsTrgtCst | - | Checks if device附加 info code is within warranty range 074-075 (MediaPad) |
| - | `JBSbatKKKnytcsTrgtCst.isOutPutTgDspPstSkcd` | JBSbatKKKnytcsTrgtCst | - | Checks if display position code matches the target output position for residential move |
| - | `JBSbatKKKnytcsTrgtCst.isTkyKkn` | JBSbatKKKnytcsTrgtCst | - | Checks if the plan change stay month flag indicates eligibility (display flag) |
| - | `JBSbatKKKnytcsTrgtCst.isTnmtHosyouUmu` | JBSbatKKKnytcsTrgtCst | - | Checks if there is terminal warranty (has valid device insurance) |
| - | `JBSbatKKKnytcsTrgtCst.isTvDspMap` | JBSbatKKKnytcsTrgtCst | - | Checks if the service detail work number exists in the TV display position map |
| - | `JACBatCommon.printDebugLog` | JACBatCommon | - | Utility: prints debug log messages |
| - | `JACbatDebugLogUtil.printDebugLog` | JACbatDebugLog | - | Utility: prints debug log messages |
| - | `JCKLcsRenkeiUtil.printDebugLog` | JCKLcsRenkei | - | Utility: prints debug log messages |
| - | `JKKBatClarisAuthCrdt.isNullBlank` | JKKBatClarisAuthCrdt | - | Utility: checks if a string is null or blank |
| - | `JKKHttpCommunicator.printDebugLog` | JKKHttpCommunicator | - | Utility: prints debug log messages |
| - | `JBSbatACEoElectPrcInfoTrkm.isNullBlank` | JBSbatACEoElectPrcInfoTrkm | - | Utility: checks if a string is null or blank |
| - | `JBSbatACIcjknTrkmRsltHenshu.setOutFlg` | JBSbatACIcjknTrkmRsltHenshu | - | Sets output flag on output bean |
| - | `JBSbatACTelnoGuideUseChrgInfoTrkmDataMake.setOutFlg` | JBSbatACTelnoGuideUseChrgInfoTrkmDataMake | - | Sets output flag |
| - | `JBSbatACTrgtSvcKeiMake.isNullBlank` | JBSbatACTrgtSvcKeiMake | - | Utility: checks if a string is null or blank |
| - | `JBSbatCHKssaidkCvsNkinInfoAdd.isNullBlank` | JBSbatCHKssaidkCvsNkinInfoAdd | - | Utility: checks if a string is null or blank |
| - | `JBSbatCHMakeEoElecKyseKiykList.isNullBlank` | JBSbatCHMakeEoElecKyseKiykList | - | Utility: checks if a string is null or blank |
| - | `JEKK0081C310TPMA.setString` | JEKK0081C310TPMA | - | Sets string value in data object |
| - | `Mover.setString` | Mover | - | Sets string value in data object |
| - | `JBSbatKKCashPostAddMail.printDebugLog` | JBSbatKKCashPostAddMail | - | Utility: prints debug log messages |
| - | `JBSbatKKKnytcsTrgtCst.isNullBlank` | JBSbatKKKnytcsTrgtCst | - | Utility: checks if a string is null or blank |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: JBSbatKKKnytcsTrgtCst | `JBSbatKKKnytcsTrgtCst.execute()` -> `JBSbatKKKnytcsTrgtCst.outPutKktkSvcKeiAdChg()` | `addOutMapList [C], createLog [C], isOutPutkikiHukaInfoCdAnsin [R], isOutPutkikiHukaInfoCdAnsinMediaPad [R], isOutPutTgDspPstSkcd [R], isTkyKkn [R], isTnmtHosyouUmu [R], isTvDspMap [R], executeKK_T_KKTK_SVC_KEI_KK_SELECT_221 [R], executeKK_T_KKTK_SVC_KEI_KK_SELECT_230 [R]` |

## 6. Per-Branch Detail Blocks

**Block 1** — [VARIABLE DECLARATION] (L6420)

> Initialize working variables and flags for the method.

| # | Type | Code |
|---|------|------|
| 1 | SET | `serchResultList_KktkSvcKei = new ArrayList<HashMap<String, String>>()` // Initialize search result list |
| 2 | SET | `mskmSbtCd = inMap.getString(JBSbatKK_T_MSKM.MSKM_SBT_CD)` // Submission type code |
| 3 | SET | `mskmNo = inMap.getString(JBSbatKK_T_MSKM.MSKM_NO)` // Submission number |
| 4 | SET | `outPutZumiFlg = false` // Output completion flag (for initial contract cancellation) |
| 5 | SET | `outPutZumiFlgTab = false` // Output completion flag (for tablet) |
| 6 | SET | `outPutZumiFlgGh = false` // Output completion flag (for GN) |

**Block 2** — [BINDING] (L6442)

> Build binding variable array for the first SQL query.

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktkSvcKei = {mskmNo, famipaKeiUm, mskmSbtCd, opeDate, opeDate, opeDate}` // Bind submission number, family pack flag, submission type code, operation dates |

**Block 3** — [SQL EXECUTION] (L6456)

> Execute the first SQL schema search for contract notification text.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `executeKK_T_KKTK_SVC_KEI_KK_SELECT_221(kktkSvcKei)` // Contract notification text schema search |

**Block 4** — [WHILE LOOP 1] (L6465)

> Iterate over results from the first SQL query.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dbKktkSvcKei = db_KK_T_KKTK_SVC_KEI.selectNext()` // Get first row |
| 2 | IF | `dbKktkSvcKei != null` |

**Block 4.1** — [INSIDE WHILE LOOP 1] (L6478)

> Create a resultMap for each row from the first SQL query, populating all display fields.

| # | Type | Code |
|---|------|------|
| 1 | SET | `resultMap = new HashMap<String, String>()` // Create result map |
| 2 | SET | `resultMap.put(KNYTCS_NO, inMap.getString(JBSbatKK_T_KNYTCS.KNYTCS_NO))` // Contract notification document number |
| 3 | SET | `resultMap.put(KNYTCS_DSP_MNGN_CD, dbKktkSvcKei.getString(KNYTCS_DSP_MNGN_CD))` // Contract notification text display code |
| 4 | SET | `resultMap.put(DSP_PST_SKCD, dbKktkSvcKei.getString(DSP_PST_SKCD))` // Display position identification code |
| 5 | SET | `resultMap.put(TELNO_JUN, dbKktkSvcKei.getString(TELNO_JUN))` // Phone number sequence |
| 6 | SET | `resultMap.put(TV_DSP_NO, tvDspMap.get(dbKktkSvcKei.getString(SVC_KEI_UCWK_NO)))` // TV display position number |
| 7 | SET | `resultMap.put(MNGN_DSP_JKN_KSITEI_CD, dbKktkSvcKei.getString(MNGN_DSP_JKN_KSITEI_CD))` // Display condition code |
| 8 | SET | `resultMap.put(KIKI_HUKA_INFO_CD, dbKktkSvcKei.getString(KIKI_HUKA_INFO_CD))` // Device additional info code |
| 9 | SET | `resultMap.put(KKTK_SVC_KEI_NO, dbKktkSvcKei.getString(KKTK_SVC_KEI_NO))` // Terminal service contract number |
| 10 | SET | `resultMap.put(PLAN_CHRG_STAYMD, dbKktkSvcKei.getString(PLAN_CHRG_STAYMD))` // Plan change stay month |

**Block 4.2** — [IF / ELSE-IF 1: isTvDspMap] (L6512)

> Only add the result to serchResultList if the service detail work number exists in the TV display position map.

| # | Type | Code |
|---|------|------|
| 1 | IF | `isTvDspMap(tvDspMap, svcKeiUcwkNo, dspPstSkcd)` |
| 2 | SET | `serchResultList_KktkSvcKei.add(resultMap)` // Add to search result list |
| 3 | ELSE-IF | (none — else is empty, record is simply not added) |

**Block 4.3** — [NEXT ROW] (L6522)

| # | Type | Code |
|---|------|------|
| 1 | SET | `dbKktkSvcKei = db_KK_T_KKTK_SVC_KEI.selectNext()` // Read next row |

**Block 5** — [BINDING 2] (L6529)

> Build binding variables for the second SQL query (terminal service contract).

| # | Type | Code |
|---|------|------|
| 1 | SET | `kktkSvcKei_Plc = {mskmNo, mskmSbtCd, opeDate, opeDate, opeDate}` // Bind without family pack flag |

**Block 6** — [SQL EXECUTION 2] (L6543)

> Execute the second SQL schema search for terminal service contracts.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `executeKK_T_KKTK_SVC_KEI_KK_SELECT_230(kktkSvcKei_Plc)` // Terminal service contract schema search |

**Block 7** — [WHILE LOOP 2] (L6552)

> Iterate over results from the second SQL query and merge into serchResultList.

| # | Type | Code |
|---|------|------|
| 1 | SET | `dbInfKktkSvcKei_Plc = db_KK_T_KKTK_SVC_KEI.selectNext()` // Get first row |
| 2 | IF | `dbInfKktkSvcKei_Plc != null` |

**Block 7.1** — [INSIDE WHILE LOOP 2] (L6558)

> Create a resultMap for each row from the second SQL query.

| # | Type | Code |
|---|------|------|
| 1 | SET | `resultMap = new HashMap<String, String>()` |
| 2 | SET | `resultMap.put(KNYTCS_NO, inMap.getString(JBSbatKK_T_KNYTCS.KNYTCS_NO))` |
| 3 | SET | `resultMap.put(KNYTCS_DSP_MNGN_CD, dbInfKktkSvcKei_Plc.getString(KNYTCS_DSP_MNGN_CD))` |
| 4 | SET | `resultMap.put(DSP_PST_SKCD, dbInfKktkSvcKei_Plc.getString(DSP_PST_SKCD))` |
| 5 | SET | `resultMap.put(TELNO_JUN, dbInfKktkSvcKei_Plc.getString(TELNO_JUN))` |
| 6 | SET | `resultMap.put(TV_DSP_NO, tvDspMap.get(dbInfKktkSvcKei_Plc.getString(SVC_KEI_UCWK_NO)))` |
| 7 | SET | `resultMap.put(KEI_CNT, dbInfKktkSvcKei_Plc.getString(KEI_CNT))` // Contract count |
| 8 | SET | `resultMap.put(MNGN_DSP_JKN_KSITEI_CD, dbInfKktkSvcKei_Plc.getString(MNGN_DSP_JKN_KSITEI_CD))` |
| 9 | SET | `resultMap.put(KIKI_HUKA_INFO_CD, dbInfKktkSvcKei_Plc.getString(KIKI_HUKA_INFO_CD))` |
| 10 | SET | `serchResultList_KktkSvcKei.add(resultMap)` // Merge into result list |

**Block 7.2** — [NEXT ROW 2]

| # | Type | Code |
|---|------|------|
| 1 | SET | `dbInfKktkSvcKei_Plc = db_KK_T_KKTK_SVC_KEI.selectNext()` // Read next row |

**Block 8** — [OUTPUT DETERMINATION INIT] (L6575)

> Initialize variables for the output determination loop.

| # | Type | Code |
|---|------|------|
| 1 | SET | `tmpMap = new HashMap<String, String>()` // Temporary map for output determination |

**Block 9** — [FOR LOOP] (L6577)

> Iterate over all merged search results and apply output filtering logic.

| # | Type | Code |
|---|------|------|
| 1 | SET | `for (i = 0; i < serchResultList_KktkSvcKei.size(); i++)` |

**Block 9.1** — [INSIDE FOR LOOP] (L6579)

> Transfer each resultMap into an output map and check if the display position code matches the target.

| # | Type | Code |
|---|------|------|
| 1 | SET | `outmap = new JBSbatServiceInterfaceMap()` |
| 2 | SET | `tmpMap = serchResultList_KktkSvcKei.get(i)` // Get current record |
| 3 | SET | `outmap.setString(KNYTCS_NO, tmpMap.get(KNYTCS_NO))` |
| 4 | SET | `outmap.setString(KNYTCS_DSP_MNGN_CD, tmpMap.get(KNYTCS_DSP_MNGN_CD))` |
| 5 | SET | `outmap.setString(DSP_PST_SKCD, tmpMap.get(DSP_PST_SKCD))` |
| 6 | SET | `outmap.setString(TELNO_JUN, tmpMap.get(TELNO_JUN))` |
| 7 | SET | `outmap.setString(TV_DSP_NO, tmpMap.get(TV_DSP_NO))` // TV display position number |
| 8 | SET | `outmap.setString(KEI_CNT, tmpMap.get(KEI_CNT))` // Contract count |

**Block 9.2** — [IF: isOutPutTgDspPstSkcd] (L6596)

> Check if the display position code matches the target output position for residential move.

| # | Type | Code |
|---|------|------|
| 1 | IF | `isOutPutTgDspPstSkcd(tmpMap.get(DSP_PST_SKCD))` — Display position matches target for output |

**Block 9.2.1** — [IF: NULL MNGN_DSP_JKN_KSITEI_CD] (L6603)

> When the display condition code is NULL — output the record as-is (plain text).

| # | Type | Code |
|---|------|------|
| 1 | IF | `JKKStringUtil.isNullBlank(MNGN_DSP_JKN_KSITEI_CD)` — Display condition code is NULL |
| 2 | SET | `outmap.setOutFlg(true)` // Mark for output |
| 3 | EXEC | `logPrint.printDebugLog("Machine provision service [Individual: NULL] (Residential Move): " + KNYTCS_DSP_MNGN_CD)` // Log approved record |
| 4 | CALL | `outputBean.addOutMapList(outmap)` // Add to output list |

**Block 9.2.2** — [ELSE-IF: MNGN = 012, 013, 024] (L6622)

> When the display condition code is "012" (warranty Xperia/ARROWS/LAVIE), "013" (warranty MediaPad), or "024" (EO Shopping mobile point preset).

| # | Type | Code |
|---|------|------|
| 1 | IF | `MNGN = 012 OR MNGN = 013 OR MNGN = 024` [MNGN_DSP_JKN_KSITEI_CD_012="012", MNGN_DSP_JKN_KSITEI_CD_013="013", MNGN_DSP_JKN_KSITEI_CD_024="024"] |

**Block 9.2.2.1** — [VARIABLES WITHIN 012/013/024 BLOCK] (L6628)

> Extract local variables needed for warranty and eligibility checks.

| # | Type | Code |
|---|------|------|
| 1 | SET | `ksiteiCd = tmpMap.get(MNGN_DSP_JKN_KSITEI_CD)` // Display condition code |
| 2 | SET | `tnmtHosyou = isTnmtHosyouUmu(KKTK_SVC_KEI_NO)` // Check if terminal warranty exists |
| 3 | SET | `planChgStaFlg = isTkyKkn(PLAN_CHRG_STAYMD)` // Check plan change display flag |
| 4 | SET | `kikiHukaInfCd = tmpMap.get(KIKI_HUKA_INFO_CD)` // Device additional info code |

**Block 9.2.2.2** — [IF: CASE 012 - Warranty Xperia/ARROWS/LAVIE] (L6638)

> Display condition "012": Check device附加 info code is 066-069, has terminal warranty, AND plan change flag is true.

| # | Type | Code |
|---|------|------|
| 1 | IF | `isOutPutkikiHukaInfoCdAnsin(kikiHukaInfCd) && tnmtHosyou && MNGN = 012 && planChgStaFlg` [MNGN_DSP_JKN_KSITEI_CD_012="012"] |
| 2 | SET | `outmap.setOutFlg(true)` // Mark for output |
| 3 | EXEC | `logPrint.printDebugLog("Warranty (Xperia/ARROWS/LAVIE) (Residential Move): " + KNYTCS_DSP_MNGN_CD)` |
| 4 | CALL | `outputBean.addOutMapList(outmap)` // Add to output list |

**Block 9.2.2.3** — [ELSE-IF: CASE 013 - Warranty MediaPad] (L6653)

> Display condition "013": Check device附加 info code is 074-075, has terminal warranty, AND plan change flag is true.

| # | Type | Code |
|---|------|------|
| 1 | IF | `isOutPutkikiHukaInfoCdAnsinMediaPad(kikiHukaInfCd) && tnmtHosyou && MNGN = 013 && planChgStaFlg` [MNGN_DSP_JKN_KSITEI_CD_013="013"] |
| 2 | SET | `outmap.setOutFlg(true)` // Mark for output |
| 3 | EXEC | `logPrint.printDebugLog("Warranty (MediaPad) (Residential Move): " + KNYTCS_DSP_MNGN_CD)` |
| 4 | CALL | `outputBean.addOutMapList(outmap)` // Add to output list |

**Block 9.2.2.4** — [ELSE-IF: CASE 024 - EO Shopping] (L6667)

> Display condition "024": Check device附加 info code is 066-069 or 074-075, NO terminal warranty, AND plan change flag is true.

| # | Type | Code |
|---|------|------|
| 1 | IF | `(isOutPutkikiHukaInfoCdAnsin(kikiHukaInfCd) OR isOutPutkikiHukaInfoCdAnsinMediaPad(kikiHukaInfCd)) && MNGN = 024 && !tnmtHosyou && planChgStaFlg` [MNGN_DSP_JKN_KSITEI_CD_024="024"] |
| 2 | SET | `outmap.setOutFlg(true)` // Mark for output |
| 3 | EXEC | `logPrint.printDebugLog("EO Shopping mobile point preset (Residential Move): " + KNYTCS_DSP_MNGN_CD)` |
| 4 | CALL | `outputBean.addOutMapList(outmap)` // Add to output list |

**Block 9.2.2.5** — [ELSE: Rejected 012/013/024] (L6679)

> Records that failed the warranty/eligibility checks — log as rejected.

| # | Type | Code |
|---|------|------|
| 1 | IF | `MNGN = 012` |
| 2 | CALL | `createLog(KNYTCS_NO, KNYTCS_DSP_MNGN_CD, DSP_PST_SKCD, "Warranty (Xperia/ARROWS/LAVIE) (Residential Move)")` // Log rejection |
| 3 | ELSE-IF | `MNGN = 013` |
| 4 | CALL | `createLog(KNYTCS_NO, KNYTCS_DSP_MNGN_CD, DSP_PST_SKCD, "Warranty (MediaPad) (Residential Move)")` // Log rejection |
| 5 | ELSE | (case 024) |
| 6 | CALL | `createLog(KNYTCS_NO, KNYTCS_DSP_MNGN_CD, DSP_PST_SKCD, "EO Shopping mobile point preset (Residential Move)")` // Log rejection |

**Block 9.2.3** — [ELSE-IF: CASE 016 - TDSL for phone option] (L6703)

> Display condition "016": TDSL text for phone option. Output only if the TDSL service code is blank in svcInfoMap.

| # | Type | Code |
|---|------|------|
| 1 | IF | `MNGN = 016` [MNGN_DSP_JKN_KSITEI_CD_016="016"] |

**Block 9.2.3.1** — [NESTED: svcInfoMap check] (L6709)

> If the TDSL service code (CD00130_01) is blank in svcInfoMap, output the record.

| # | Type | Code |
|---|------|------|
| 1 | IF | `JKKStringUtil.isNullBlank(svcInfoMap.get(CD00130_01))` // TDSL service code is blank |
| 2 | SET | `outmap.setOutFlg(true)` // Mark for output |
| 3 | SET | `outmap.setString(TELNO_JUN, "1")` // Set phone number sequence to "1" |
| 4 | EXEC | `logPrint.printDebugLog("TDSL text for phone option (Residential Move): " + KNYTCS_DSP_MNGN_CD)` |
| 5 | CALL | `outputBean.addOutMapList(outmap)` // Add to output list |
| 6 | ELSE-IF | (svcInfoMap has TDSL code) |
| 7 | CALL | `createLog(KNYTCS_NO, KNYTCS_DSP_MNGN_CD, DSP_PST_SKCD, "TDSL text for phone option (Residential Move)")` // Log rejection |

**Block 9.2.4** — [ELSE-IF: CASE 020 - Initial contract cancellation] (L6733)

> Display condition "020": Initial contract cancellation. Output only if not already output (enforces single output).

| # | Type | Code |
|---|------|------|
| 1 | IF | `MNGN = 020` [MNGN_DSP_JKN_KSITEI_CD_020="020"] |

**Block 9.2.4.1** — [NESTED: outPutZumiFlg check] (L6740)

> If output completion flag is false, output the record and set the flag.

| # | Type | Code |
|---|------|------|
| 1 | IF | `outPutZumiFlg == false` |
| 2 | SET | `outmap.setOutFlg(true)` |
| 3 | SET | `outmap.setString(TV_DSP_NO, TV_DSP_NO_01)` // Set TV display position to "1" [TV_DSP_NO_01="1"] |
| 4 | CALL | `outputBean.addOutMapList(outmap)` |
| 5 | SET | `outPutZumiFlg = true` // Mark output as done — prevents duplicate |

**Block 9.2.5** — [ELSE-IF: CASE 027 - Tablet text output] (L6758)

> Display condition "027": Tablet text output control. Output only if not already output.

| # | Type | Code |
|---|------|------|
| 1 | IF | `MNGN = 027` [MNGN_DSP_JKN_KSITEI_CD_027="027"] |

**Block 9.2.5.1** — [NESTED: outPutZumiFlgTab check]

| # | Type | Code |
|---|------|------|
| 1 | IF | `outPutZumiFlgTab == false` |
| 2 | SET | `outmap.setOutFlg(true)` |
| 3 | CALL | `outputBean.addOutMapList(outmap)` |
| 4 | SET | `outPutZumiFlgTab = true` // Prevents duplicate tablet text output |

**Block 9.2.6** — [ELSE-IF: CASE 028 - GN text output] (L6775)

> Display condition "028": GN text output control. Output only if not already output.

| # | Type | Code |
|---|------|------|
| 1 | IF | `MNGN = 028` [MNGN_DSP_JKN_KSITEI_CD_028="028"] |

**Block 9.2.6.1** — [NESTED: outPutZumiFlgGh check]

| # | Type | Code |
|---|------|------|
| 1 | IF | `outPutZumiFlgGh == false` |
| 2 | SET | `outmap.setOutFlg(true)` |
| 3 | CALL | `outputBean.addOutMapList(outmap)` |
| 4 | SET | `outPutZumiFlgGh = true` // Prevents duplicate GN text output |

**Block 10** — [END OF FOR LOOP] (L6793)

> After processing all records, close the for loop and return.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `// void — no return value` |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `KNYTCS_NO` | Field | Contract notification document number — unique identifier for the contract notification document being processed |
| `KNYTCS_DSP_MNGN_CD` | Field | Contract notification text display code — code identifying the type of text content to display in the notification |
| `DSP_PST_SKCD` | Field | Display position identification code — identifies where the text should be displayed in the output document |
| `TELNO_JUN` | Field | Phone number sequence — ordinal number of the phone number in a multi-line contract |
| `MSKM_SBT_CD` | Field | Submission type code — classifies the type of submission (e.g., new contract, change, cancellation) |
| `MSKM_NO` | Field | Submission number — unique identifier for a submission record |
| `SVC_KEI_UCWK_NO` | Field | Service detail work number — internal tracking ID for service contract line items |
| `KKTK_SVC_KEI_NO` | Field | Terminal service contract number — identifier for a terminal-related service contract |
| `KIKI_HUKA_INFO_CD` | Field | Device additional info code — code describing device附加 services like warranty protection |
| `PLAN_CHRG_STAYMD` | Field | Plan change stay month — indicates if a plan change stay month flag applies to the record |
| `MNGN_DSP_JKN_KSITEI_CD` | Field | Display condition code (individual specification) — classifies text display conditions with specific rules per code |
| `KEI_CNT` | Field | Contract count — number of contracts associated with the service |
| `TV_DSP_NO` | Field | TV display position number — position identifier for TV display in the output |
| `SKY_FLG` | Field | Sky flag — indicates SKY service eligibility |
| `famipaKeiUm` | Field | Family pack contract existence flag — indicates whether a family pack contract exists ("0"=none, "1"=exists) |
| `opeDate` | Field | Operation date — the business date used as the applicable period for contract notification text |
| `outPutZumiFlg` | Field | Output completion flag — ensures initial contract cancellation text ("020") is output at most once |
| `outPutZumiFlgTab` | Field | Output completion flag (tablet) — ensures tablet text ("027") is output at most once |
| `outPutZumiFlgGh` | Field | Output completion flag (GN) — ensures GN text ("028") is output at most once |
| `tnmtHosyou` | Field | Terminal insurance — boolean indicating whether the device has valid warranty/insurance coverage |
| `planChgStaFlg` | Field | Plan change status flag — boolean indicating whether the plan change stay month eligibility is met |
| Ansin | Business term | Warranty/assurance — refers to device warranty protection services for Xperia/ARROWS/LAVIE or MediaPad |
| TDSL | Business term | Telephone DSL — DSL service for phone option, displayed in the contract notification document |
| EO Shopping | Business term | EO Shopping mobile point preset — a service offering mobile points through EO Shopping |
| FTTH | Business term | Fiber To The Home — fiber-optic internet service (referenced in related methods and constants) |
| 住変更 (Juuhenko) | Japanese field | Residential move — the business scenario in which this method operates; contract notification for customers moving |
| 契約内容通知書 (Teikainai Tsuuchisho) | Japanese field | Contract notification document — the official document notifying customers of contract details |
| 文言 (Monbun) | Japanese field | Text/display content — the actual text content displayed in the notification document |
| 端末保障 (Tanpu Hoshou) | Japanese field | Terminal warranty — device insurance/warranty service for mobile terminals |
| 表示条件 (Hyouji Joken) | Japanese field | Display condition — rules determining which text to show based on contract type and customer eligibility |
| 個別指定 (Kobetu Shitei) | Japanese field | Individual specification — per-condition text display specification codes |
