# Business Logic — JBSbatTUBmpSwchSodTrn.execute() [279 LOC]

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

## 1. Role

### JBSbatTUBmpSwchSodTrn.execute()

This method is the main processing entry point for the **Port Number Retention (Portability) SOD Auto-Processing** batch (`番ボ切替SOD自動処理`). It iterates over pending portability work records in the `TU_T_BMP_KOJI` table, locks each record atomically, updates its status to "completed" (`SOD_HAKKO_ZUMI`), and then invokes external service-order data (SOD) creation via the batch ESP interface for eligible customer-service combinations. For records matching the entity-individual (`KOJIN`) flag where the service contract status is neither "cancellation-completed" (`910`) nor "cancellation-processed" (`920`), the method dispatches a comprehensive SOD creation request (TSV009701CC) that includes the main service order payload, telephone number verification, provider code substitution, and phone-number status checks. Additionally, for the same subset, it prepares a separate ENUM removal SOD payload (TSV009705SC) to handle migration from ENUM-based service contracts. This method implements the **gateway/batch routing pattern**, combining row-level locking for concurrency safety with delegation to external service components for downstream integration.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["execute()"])
    START --> GET_DATE["Get System Date + 1 Hour"]
    GET_DATE --> GET_TSJGS["Get Provider Code from TU_M_TUSHIN_JGYOSHA"]
    GET_TSJGS --> BUILD_WHERE["Build Where Parameters for BMP_KOJI"]
    BUILD_WHERE --> SELECT_BMP["executeTU_T_BMP_KOJI_TU_SELECT_006"]
    SELECT_BMP --> LOOP_START{"Has Next Record?"}
    LOOP_START -->|Yes| RECORD_COUNT["Increment recordCnt"]
    RECORD_COUNT --> SINGLE_CHECK["singleCheckTU_T_BMP_KOJI_TU_SELECT_006"]
    SINGLE_CHECK --> LOCK_RECORD["executeTU_T_BMP_KOJI_TU_SELECT_003 (Lock)"]
    LOCK_RECORD --> CHECK_LOCK{"Lock Successful?"}
    CHECK_LOCK -->|No| SKIP_COMMIT["Commit and Continue"]
    SKIP_COMMIT --> LOOP_START
    CHECK_LOCK -->|Yes| PKUPDATE["executeTU_T_BMP_KOJI_PKUPDATE"]
    PKUPDATE --> CHECK_ENTITY{"HOJIN_KOJIN_CD=KOJIN AND SVC_KEI_UCWK_STAT NOT 910 AND NOT 920?"}
    CHECK_ENTITY -->|No| COMMIT_BATCH["Commit DB Transaction"]
    COMMIT_BATCH --> LOOP_START
    CHECK_ENTITY -->|Yes| SELECT_SVKEIUW["executeKK_T_SVKEIUW_EOH_TEL_TU_SELECT_001"]
    SELECT_SVKEIUW --> GET_TELNO["Get Telephone Number"]
    GET_TELNO --> BUILD_PARAMS["Build tusv009701cc Map with 5 Title Keys"]
    BUILD_PARAMS --> INVOKESVC["JCCBatchEsbInterface.invokeService"]
    INVOKESVC --> CHECK_RETURN{"Return Code = SUCCESS?"}
    CHECK_RETURN -->|No| THROW_ERROR["Throw JBSbatBusinessException ETUB0250KE"]
    THROW_ERROR --> END_NODE(["End"])
    CHECK_RETURN -->|Yes| COMMIT_BATCH
    LOOP_START -->|No| RETURN_NULL["Return null"]
    RETURN_NULL --> END_NODE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | (none) | - | This method takes no explicit parameters. It operates on instance-level state set during `initial(JBSbatCommonItem)` which includes the batch operation date (`commonItem.getOpeDate`), and database access objects initialized during that phase. |

**Instance fields and external state read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `commonItem` | `JBSbatCommonItem` | Batch common parameters — contains the operation date (`getOpeDate`) used as filtering criteria for service contracts and portability work records |
| `db_TU_T_BMP_KOJI` | `JBSbatSQLAccess` | Database access object for the portability work table (`TU_T_BMP_KOJI`) — used to select and iterate pending records |
| `db_TU_T_BMP_KOJI_L` | `JBSbatSQLAccess` | Database access object for portability work lock — used for row-level locking via a separate query handle |
| `db_KK_T_SVKEIUW_EOH_TEL` | `JBSbatSQLAccess` | Database access object for the service contract details (eo Optical Phone) table — used to fetch telephone numbers for eligible records |
| `db_TU_M_TUSHIN_JGYOSHA` | `JBSbatSQLAccess` | Database access object for the communication service provider master — used to retrieve the provider code for the substitution service |
| `recordCnt` | `int` | Record counter incremented for each processed row — used in error reporting |

## 4. CRUD Operations / Called Services

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JPCBatCommon.getSysDateTimeStamp` | JPCBatCommon | - | Calls `getSysDateTimeStamp` to retrieve the current system date-time stamp |
| R | `JCCBatCommon.getOpeDate` | JCCBatCommon | - | Calls `getOpeDate` in `JCCBatCommon` (inherited from batch common item) |
| R | `JCCBatCommon.getReturnCode` | JCCBatCommon | - | Calls `getReturnCode` to extract return code from service output map |
| - | `JBSbatCommonDBInterface.getString` | JBSbatCommonDBInterface | - | Calls `getString` to extract field values from result map |
| - | `JCCBatCommon.printDebugLog` | JCCBatCommon | - | Calls `printDebugLog` for debug logging of record fields |
| - | `JACbatDebugLogUtil.printDebugLog` | JACbatDebugLog | - | Calls `printDebugLog` in debug utility |
| R | `JCCbatMojiChgReferenceCache.getInstance` | JCCbatMojiChgReferenceCache | - | Calls `getInstance` for character conversion reference cache |
| R | `JCCbatMojiChgRuleCache.getInstance` | JCCbatMojiChgRuleCache | - | Calls `getInstance` for character conversion rule cache |
| R | `JCCbatMojiChgRuleCache.getMap` | JCCbatMojiChgRuleCache | - | Calls `getMap` for character conversion rule mapping |
| - | `JCKLcsRenkeiUtil.printDebugLog` | JCKLcsRenkei | - | Calls `printDebugLog` in KLCS integration utility |
| R | `JKKBatCtrlPaygentAuthInfoStb.getInstance` | JKKBatCtrlPaygentAuthInfoStb | - | Calls `getInstance` for Paygent auth info standby |
| R | `JKKBatPaygentStbInfo.getInstance` | JKKBatPaygentStbInfo | - | Calls `getInstance` for Paygent standby info |
| - | `JKKHttpCommunicator.printDebugLog` | JKKHttpCommunicator | - | Calls `printDebugLog` for HTTP communication logging |
| R | `JBSbatFUCaseFileRnkData.getString` | JBSbatFUCaseFileRnkData | - | Calls `getString` for free-use case file ranking data |
| R | `JBSbatFUMoveNaviData.getString` | JBSbatFUMoveNaviData | - | Calls `getString` for free-use move navigation data |
| - | `JBSbatKKCashPostAddMail.printDebugLog` | JBSbatKKCashPostAddMail | - | Calls `printDebugLog` for cash post-add mail |
| - | `JBSBatKKCrsChgIktAdd.invokeService` | JBSBatKKCrsChgIktAdd | - | Calls `invokeService` for CRS change internet addition |
| - | `JBSbatKKCrsChgSmtVLAdd.invokeService` | JBSbatKKCrsChgSmtVLAdd | - | Calls `invokeService` for CRS change short voice-line addition |
| - | `JBSbatKKCrsChgWribSette.invokeService` | JBSbatKKCrsChgWribSette | - | Calls `invokeService` for CRS change writing settlement |
| - | `JBSbatKKEponSwchKjInfSksi.invokeService` | JBSbatKKEponSwchKjInfSksi | - | Calls `invokeService` for Epon switch key information |
| R | `JBSbatKKMansIfSksi.getMap` | JBSbatKKMansIfSksi | - | Calls `getMap` for managed interface service data |
| R | `JCCBatCommon.getSysDateTimeStamp` | JCCBatCommon | - | Calls `getSysDateTimeStamp` for system timestamp |
| - | `JBSbatTUBmpSwchSodTrn.executeKK_T_SVKEIUW_EOH_TEL_TU_SELECT_001` | JBSbatTUBmpSwchSodTrn | KK_T_SVKEIUW_EOH_TEL | Calls `executeKK_T_SVKEIUW_EOH_TEL_TU_SELECT_001` to query service contract details (eo Optical Phone) |
| - | `JBSbatTUBmpSwchSodTrn.executeTU_M_TUSHIN_JGYOSHA_TU_SELECT_001` | JBSbatTUBmpSwchSodTrn | TU_M_TUSHIN_JGYOSHA | Calls `executeTU_M_TUSHIN_JGYOSHA_TU_SELECT_001` to query communication provider master |
| R | `JBSbatTU_M_TUSHIN_JGYOSHA.selectNext` | JBSbatTU_M_TUSHIN_JGYOSHA | TU_M_TUSHIN_JGYOSHA | Calls `selectNext` to fetch next provider record |
| - | `JBSbatTUBmpSwchSodTrn.executeTU_T_BMP_KOJI_TU_SELECT_003` | JBSbatTUBmpSwchSodTrn | TU_T_BMP_KOJI | Calls `executeTU_T_BMP_KOJI_TU_SELECT_003` for record locking (pessimistic lock) |
| U | `JBSbatTUBmpSwchSodTrn.executeTU_T_BMP_KOJI_PKUPDATE` | JBSbatTUBmpSwchSodTrn | TU_T_BMP_KOJI | Calls `executeTU_T_BMP_KOJI_PKUPDATE` to update portability work status to "SOD issued completed" |
| - | `JBSbatTUBmpSwchSodTrn.executeTU_T_BMP_KOJI_TU_SELECT_006` | JBSbatTUBmpSwchSodTrn | TU_T_BMP_KOJI | Calls `executeTU_T_BMP_KOJI_TU_SELECT_006` to select pending portability work records |
| - | `JBSbatTUBmpSwchSodTrn.singleCheckTU_T_BMP_KOJI_TU_SELECT_006` | JBSbatTUBmpSwchSodTrn | TU_T_BMP_KOJI | Calls `singleCheckTU_T_BMP_KOJI_TU_SELECT_006` for single-item validation check |
| R | `JBSbatTU_T_BMP_KOJI.selectNext` | JBSbatTU_T_BMP_KOJI | TU_T_BMP_KOJI | Calls `selectNext` to iterate portability work records |
| R | `JBSbatTU_T_BMP_KOJI_L.selectNext` | JBSbatTU_T_BMP_KOJI_L | TU_T_BMP_KOJI | Calls `selectNext` to check lock result (concurrency control) |
| R | `JBSbatZMAdDataSet.getString` | JBSbatZMAdDataSet | - | Calls `getString` for ZM address dataset |
| - | `JCCBatchEsbInterface.invokeService` | JCCBatchEsbInterface | - | Invokes external batch ESP service (TSV009701CC) for SOD creation |
| R | `JCCBatchEsbInterface.getReturnCode` | JCCBatchEsbInterface | - | Gets return code from invoked service output |
| - | `JBSbatBusinessBase.dbcon.commit` | JBSbatBusinessBase | - | Commits the current database transaction |

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: JBSbatTUBmpSwchSodTrn | Batch scheduler -> JBSbatTUBmpSwchSodTrn.execute | `executeTU_T_BMP_KOJI_TU_SELECT_006 [R] TU_T_BMP_KOJI`, `executeTU_T_BMP_KOJI_PKUPDATE [U] TU_T_BMP_KOJI`, `executeKK_T_SVKEIUW_EOH_TEL_TU_SELECT_001 [R] KK_T_SVKEIUW_EOH_TEL`, `executeTU_M_TUSHIN_JGYOSHA_TU_SELECT_001 [R] TU_M_TUSHIN_JGYOSHA`, `invokeService [C] TUSV009701CC (SOD Creation)` |

**Note:** No direct callers (screens or other services) were found referencing this method. It operates as a standalone batch processing entry point, invoked by the batch scheduler framework via its zero-argument `execute()` method. The batch processes records independently per execution cycle.

## 6. Per-Branch Detail Blocks

**Block 1** — [SET] (L183-210)

> System date acquisition and condition date calculation. Gets current system date-time, adds 1 hour (changed from 3 hours in ANK-4494), then formats as YYYYMMDDHH for use as a filtering condition.

| # | Type | Code |
|---|------|------|
| 1 | SET | `calendar = Calendar.getInstance()` // Initialize calendar [-> system time] |
| 2 | SET | `formYMDHMS = new SimpleDateFormat(JTUStrConst.DATE_YMDHMSS)` // Date format YYYYMMDDHHMMSS |
| 3 | EXEC | `JPCBatCommon.getSysDateTimeStamp()` // Get current system date-time stamp |
| 4 | SET | `calendar.setTime(formYMDHMS.parse(...))` // Parse and set date |
| 5 | EXEC | `calendar.add(Calendar.HOUR, 1)` // Add 1 hour (modified from 3 hours, ANK-4494) |
| 6 | SET | `formYMDH = new SimpleDateFormat(JTUStrConst.DATE_YMDH)` // Format YYYYMMDDHH |
| 7 | SET | `conditionDate = formYMDH.format(calendar.getTime())` // Condition date for filtering |

**Block 2** — [SET] (L212-223)

> Provider code (operational) acquisition. Queries the communication service provider master table (`TU_M_TUSHIN_JGYOSHA`) to retrieve the optional provider code used for the phone number substitution service.

| # | Type | Code |
|---|------|------|
| 1 | SET | `tsjgsCdOpt = null` // Initialize provider code variable |
| 2 | CALL | `executeTU_M_TUSHIN_JGYOSHA_TU_SELECT_001()` // Query provider master |
| 3 | EXEC | `db_TU_M_TUSHIN_JGYOSHA.selectNext()` // Fetch next provider record |
| 4 | IF | `tsjgSelectResult != null` (L218) |
| 4.1 | SET | `tsjgsCdOpt = tsjgSelectResult.getString(JBSbatTU_M_TUSHIN_JGYOSHA.TSJGS_CD)` // Get provider code |

**Block 3** — [FOR LOOP] (L230-457)

> Main processing loop. Iterates over all pending portability work records matching the condition date and operation date criteria.

| # | Type | Code |
|---|------|------|
| 1 | SET | `whereParamSel[0] = conditionDate` // Portability work confirmation date-time |
| 2 | SET | `whereParamSel[1] = commonItem.getOpeDate()` // Service contract reservation application date |
| 3 | SET | `whereParamSel[2] = commonItem.getOpeDate()` // Service contract reservation application date |
| 4 | SET | `whereParamSel[3] = commonItem.getOpeDate()` // Service contract reservation application date |
| 5 | SET | `whereParamSel[4] = conditionDate` // Portability work confirmation date-time |
| 6 | CALL | `executeTU_T_BMP_KOJI_TU_SELECT_006(whereParamSel)` // Select pending portability work |
| 7 | FOR | `for(inMap = db_TU_T_BMP_KOJI.selectNext(); null != inMap; inMap = db_TU_T_BMP_KOJI.selectNext())` // Iterate records |

**Block 3.1** — [nested processing inside FOR loop] (L235-305)

> Per-record processing: debug logging, record count, single check, lock, and update.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `super.logPrint.printDebugLog(...)` // Log BMP_KOJI_NO |
| 2 | EXEC | `super.logPrint.printDebugLog(...)` // Log GENE_ADD_DTM |
| 3 | EXEC | `super.logPrint.printDebugLog(...)` // Log HOJIN_KOJIN_CD |
| 4 | EXEC | `super.logPrint.printDebugLog(...)` // Log SVC_KEI_NO |
| 5 | EXEC | `super.logPrint.printDebugLog(...)` // Log SYSID |
| 6 | EXEC | `super.logPrint.printDebugLog(...)` // Log SVC_KEI_UCWK_NO |
| 7 | EXEC | `super.logPrint.printDebugLog(...)` // Log GENE_ADD_DTM_SK |
| 8 | EXEC | `super.logPrint.printDebugLog(...)` // Log SVC_KEI_UCWK_STAT [ANK-2899] |
| 9 | SET | `recordCnt++` // Increment record count |
| 10 | CALL | `singleCheckTU_T_BMP_KOJI_TU_SELECT_006(inMap.getMap())` // Single-item validation |
| 11 | SET | `whereParamUpd[0] = inMap.getString(JBSbatTU_T_BMP_KOJI.BMP_KOJI_NO)` // Portability work number |
| 12 | SET | `whereParamUpd[1] = inMap.getString(JBSbatTU_T_BMP_KOJI.GENE_ADD_DTM)` // Generation registration date-time |
| 13 | SET | `whereParamLock[0] = inMap.getString(JBSbatTU_T_BMP_KOJI.BMP_KOJI_NO)` // Portability work number |
| 14 | SET | `whereParamLock[1] = inMap.getString(JBSbatTU_T_BMP_KOJI.GENE_ADD_DTM)` // Generation registration date-time |
| 15 | SET | `whereParamLock[2] = conditionDate` // Portability work confirmation date-time |
| 16 | SET | `setParam[0] = JTUStrConst.SOD_HAKKO_ZUMI` // Status = "SOD issued completed" [-> JTUStrConst.SOD_HAKKO_ZUMI] |
| 17 | CALL | `executeTU_T_BMP_KOJI_TU_SELECT_003(whereParamLock)` // Lock record for update |

**Block 3.2** — [IF] `(Lock not successful)` (L280-283)

> If the lock failed (another process acquired the record), commit and skip to the next record.

| # | Type | Code |
|---|------|------|
| 1 | IF | `db_TU_T_BMP_KOJI_L.selectNext() == null` [Lock not acquired] |
| 1.1 | EXEC | `JBSbatBusinessBase.dbcon.commit()` // Commit (lock release) |
| 1.2 | SET | `continue` // Skip to next record |

**Block 3.3** — [EXEC] (L287-288)

> Update the portability work record status to "SOD issued completed".

| # | Type | Code |
|---|------|------|
| 1 | CALL | `executeTU_T_BMP_KOJI_PKUPDATE(setParam, whereParamUpd)` // Update record status |

**Block 4** — [IF] `(HOJIN_KOJIN_CD == KOJIN AND SVC_KEI_UCWK_STAT != 910 AND != 920)` (L292-420)

> For entity-individual customers whose service contract status is NOT cancellation-completed (`SVC_KEI_DSL_ZM = "910"`) and NOT cancellation-processed (`SVC_KEI_CNCL_ZM = "920"`), this block creates and dispatches SOD (Service Order Data) requests. It first queries the telephone number from the service contract details (eo Optical Phone) table, then constructs a comprehensive service order payload and invokes the TUSV009701CC external service. ANK-2899 added the additional status check to exclude cancelled services from SOD dispatch.

| # | Type | Code |
|---|------|------|
| 1 | IF | `JTUStrConst.KOJIN.equals(inMap.getString(HOJIN_KOJIN_CD)) && !JTUStrConst.SVC_KEI_DSL_ZM.equals(SVC_KEI_UCWK_STAT) && !JTUStrConst.SVC_KEI_CNCL_ZM.equals(SVC_KEI_UCWK_STAT)` [L292-293] |
| 1.1 | SET | `svkeiuwSelectParam[0] = SVC_KEI_UCWK_NO` // Service contract detail number |
| 1.2 | SET | `svkeiuwSelectParam[1] = SVC_KEI_UCWK_NO` // Service contract detail number |
| 1.3 | CALL | `executeKK_T_SVKEIUW_EOH_TEL_TU_SELECT_001(svkeiuwSelectParam)` // Query eo Optical Phone details |
| 1.4 | EXEC | `db_KK_T_SVKEIUW_EOH_TEL.selectNext()` // Fetch result |
| 1.5 | IF | `svkeiuwSelectResult != null` |
| 1.5.1 | SET | `telno = svkeiuwSelectResult.getString(JBSbatKK_T_SVKEIUW_EOH_TEL.TELNO)` // Get telephone number |
| 1.6 | SET | `paramMap.put(JCCBatchEsbInterface.TELEGRAM_INFO_USECASE_ID, USECASE_ID)` // Set Usecase ID [-> "TUSV0097"] |
| 1.7 | SET | `tusv009701cc = new HashMap<>()` // Create service order dispatch map |
| 1.8 | SET | `dataMap = new HashMap<>()` // Data map for SOD dispatch |
| 1.9 | SET | `dataMap.put(FUNC_CODE, CHK_ADD)` // Function code [-> "1" (Check & Add)] |
| 1.10 | SET | `trgtDataList = new ArrayList<>()` // Target data list |
| 1.11 | SET | `sodMap = new HashMap<>()` // SOD map |
| 1.12 | SET | `sodKihonInfo = new HashMap<>()` // SOD basic info |
| 1.13 | SET | `sodKihonInfo.put(SYSID, inMap.getString(SYSID))` // System ID |
| 1.14 | SET | `sodKihonInfo.put(SYORI_DIV, BMP_SWCH)` // Processing classification [-> "021" (Portability swap)] |
| 1.15 | SET | `sodKihonInfo.put(BMP_SYORI_DIV, BMP_TRAN_SKBT_CD_USE_STP_RLS)` // Portability processing classification [-> "61" (Usage suspension removal)] |
| 1.16 | SET | `sodMap.put(SOD_KIHON_INFO, sodKihonInfo)` // Set SOD basic info |
| 1.17 | SET | `svcKeiInfo = new HashMap<>()` // Service contract info |
| 1.18 | SET | `svcKeiInfo.put(SVC_KEI_NO, inMap.getString(SVC_KEI_NO))` // Service contract number |
| 1.19 | SET | `sodMap.put(SVC_KEI_INFO, svcKeiInfo)` // Set service contract info |
| 1.20 | SET | `svcKeiUcwkInfo = new HashMap<>()` // Service contract detail info |
| 1.21 | SET | `svcKeiUcwkInfo.put(SVC_KEI_UCWK_NO, inMap.getString(SVC_KEI_UCWK_NO))` // Service contract detail number |
| 1.22 | SET | `svcKeiUcwkInfo.put(CHAF_SVC_KEI_UCWK_GENE_ADD_DTM, inMap.getString("GENE_ADD_DTM_SK"))` // Post-change service contract detail generation registration date-time |
| 1.23 | SET | `sodMap.put(SVC_KEI_UCWK_INFO, svcKeiUcwkInfo)` // Set service contract detail info |
| 1.24 | SET | `trgtDataList.add(sodMap)` // Add SOD map to target list |
| 1.25 | SET | `dataMap.put(TRGT_DATA_LIST, trgtDataList)` // Set target data list |
| 1.26 | SET | `tusv009701cc.put(CC_TITLE_1, dataMap)` // Set SOD dispatch [-> "TUSV009701CC"] |
| 1.27 | SET | `dataMap2 = new HashMap<>()` // Telephone number consistency agreement IF parameters |
| 1.28 | SET | `dataMap2.put(FUNC_CODE, CHK_ADD)` // Function code [-> "1"] |
| 1.29 | SET | `dataMap2.put(KEY_TELNO, telno)` // Telephone number |
| 1.30 | SET | `tusv009701cc.put(CC_TITLE_2, dataMap2)` // Set telephone number IF [-> "TUSV009702SC"] |
| 1.31 | SET | `dataMap3 = new HashMap<>()` // Phone number change IF parameters |
| 1.32 | SET | `dataMap3.put(FUNC_CODE, CHK_ADD)` // Function code [-> "1"] |
| 1.33 | SET | `dataMap3.put(ITNS_TSJGS_CD, tsjgsCdOpt)` // Substitution destination provider code |
| 1.34 | SET | `tusv009701cc.put(CC_TITLE_3, dataMap3)` // Set phone number change IF [-> "TUSV009703SC"] |
| 1.35 | SET | `dataMap4 = new HashMap<>()` // Phone number status judgment CC parameters |
| 1.36 | SET | `dataMap4.put(FUNC_CODE, CHK_ADD)` // Function code [-> "1"] |
| 1.37 | SET | `dataMap4.put(KEY_TELNO, telno)` // Telephone number |
| 1.38 | SET | `tusv009701cc.put(TELNOSTATJUDGECC, dataMap4)` // Set status judgment [-> "TELNOSTATJUDGECC"] |
| 1.39 | SET | `dataMap5 = new HashMap<>()` // ENUM SOD dispatch CC parameters |
| 1.40 | SET | `dataMap5.put(FUNC_CODE, CHK_ADD)` // Function code [-> "1"] |
| 1.41 | SET | `sodMap_enumsod = new HashMap<>()` // ENUM SOD map |
| 1.42 | SET | `sodKihonInfo_enumsod = new HashMap<>()` // ENUM SOD basic info |
| 1.43 | SET | `sodKihonInfo_enumsod.put(TELNO, telno)` // Telephone number |
| 1.44 | SET | `sodKihonInfo_enumsod.put(IDO_DIV, IDO_DIV_ENUMDEL)` // Migration classification (ENUM removal) [-> "09001"] |
| 1.45 | SET | `sodMap_enumsod.put(SOD_KIHON_INFO, sodKihonInfo_enumsod)` |
| 1.46 | SET | `svcKeiInfo_enumsod = new HashMap<>()` |
| 1.47 | SET | `svcKeiInfo_enumsod.put(SVC_KEI_NO, inMap.getString(SVC_KEI_NO))` |
| 1.48 | SET | `sodMap_enumsod.put(SVC_KEI_INFO, svcKeiInfo_enumsod)` |
| 1.49 | SET | `trgtDataList_enumsod.add(sodMap_enumsod)` |
| 1.50 | SET | `dataMap5.put(TRGT_DATA_LIST, trgtDataList_enumsod)` |
| 1.51 | SET | `tusv009701cc.put(CC_TITLE_5, dataMap5)` // Set ENUM SOD dispatch [-> "TUSV009705SC"] |
| 1.52 | CALL | `JCCBatchEsbInterface.invokeService(commonItem, paramMap, tusv009701cc, outputMap)` // Invoke external service |

**Block 4.1** — [IF] `(Return Code != SUCCESS)` (L424-432)

> If the external service returned a non-success status, throw a business exception with the record count and the failed operation name.

| # | Type | Code |
|---|------|------|
| 1 | SET | `returnCode = JCCBatchEsbInterface.getReturnCode(outputMap)` // Get return code |
| 2 | EXEC | `super.logPrint.printDebugLog("RETURN_CODE:" + returnCode)` // Debug log |
| 3 | IF | `!JCCBatchEsbInterface.RETURN_CODE_SUCCESS.equals(returnCode)` (L425) |
| 3.1 | EXEC | `throw new JBSbatBusinessException("ETUB0250KE", new String[]{String.valueOf(recordCnt), "Service Order Dispatch"})` // Throw business exception |

**Block 5** — [EXEC] (L434-435)

> Commit the database transaction for each record processed in the loop.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `JBSbatBusinessBase.dbcon.commit()` // Commit DB transaction |

**Block 6** — [RETURN] (L438)

> After all records are processed, return null.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return null` // Return no output item |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `BMP_KOJI_NO` | Field | Portability work number — unique identifier for a portability processing work record |
| `HOJIN_KOJIN_CD` | Field | Entity/individual classification code — "1" (KOJIN) indicates an individual customer record; "2" indicates an entity (corporate) customer record |
| `SVC_KEI_UCWK_STAT` | Field | Service contract detail status — tracks the lifecycle state of the service contract; "910" = cancellation-completed, "920" = cancellation-processed |
| `GENE_ADD_DTM` | Field | Generation registration date-time — timestamp when the work record was originally created in the system |
| `GENE_ADD_DTM_SK` | Field | Post-change service contract detail generation registration date-time — timestamp after the portability swap was applied |
| `SVC_KEI_NO` | Field | Service contract number — unique identifier for a service contract line item |
| `SVC_KEI_UCWK_NO` | Field | Service contract detail number — unique identifier for a specific service contract detail line |
| `SYSID` | Field | System ID — identifies the specific service system handling the contract |
| `TELNO` | Field | Telephone number — the phone number associated with the eo Optical Phone service contract |
| `TSJGS_CD` | Field | Communication service provider code — identifies the downstream service provider for portability substitution |
| `SOD_HAKKO_ZUMI` | Field | SOD issued completed — status value indicating that Service Order Data has been successfully dispatched |
| SOD | Acronym | Service Order Data — electronic order data exchanged between telecom operators for service provisioning |
| BMP | Acronym | Port Number (Portability) — from "Hongo" (番保), short for port number retention (MNP: Mobile Number Portability) |
| KOJI | Acronym | Work (工事) — refers to installation/configuration work records in the system |
| TUSHIN | Acronym | Communication (通信) — refers to communication service provider master data |
| SVKEIUW | Acronym | Service Contract Detail (サービス契約内容) — service contract line item details including phone numbers |
| EOH | Acronym | eo Optical Home — NTT East's fiber-optic broadband service brand |
| TELNO | Acronym | Telephone Number |
| CHK_ADD | Constant | Check & Add function code — "1", indicates a new registration/addition operation in SOD processing |
| BMP_SWCH | Constant | Portability swap classification — "021", indicates a port number retention swap processing type |
| BMP_TRAN_SKBT_CD_USE_STP_RLS | Constant | Portability transfer suspension removal code — "61", indicates usage suspension removal as the portability processing type |
| IDO_DIV_ENUMDEL | Constant | Migration classification ENUM removal — "09001", indicates the removal of an ENUM (phone-number-based) service contract during portability |
| USECASE_ID | Constant | Usecase identifier — "TUSV0097", identifies the specific batch use case for portability SOD dispatch |
| CC_TITLE_1 | Constant | SOD dispatch payload key — "TUSV009701CC", the main service order data creation request |
| CC_TITLE_2 | Constant | Telephone number consistency agreement key — "TUSV009702SC", validates telephone number information |
| CC_TITLE_3 | Constant | Phone number change key — "TUSV009703SC", handles provider code substitution for number change |
| CC_TITLE_5 | Constant | ENUM SOD dispatch key — "TUSV009705SC", handles ENUM removal service order dispatch |
| TELNOSTATJUDGECC | Constant | Phone number status judgment key — validates the current status of the telephone number |
| FUNC_CODE | Constant | Function code field name in data maps — "func_code" |
| TRGT_DATA_LIST | Constant | Target data list field name — "trgt_data_list" |
| SOD_KIHON_INFO | Constant | SOD basic info field name — "sod_kihon_info" |
| SYORI_DIV | Constant | Processing classification field name — "syori_div" |
| BMP_SYORI_DIV | Constant | Portability processing classification field name — "bmp_syori_div" |
| SVC_KEI_INFO | Constant | Service contract info field name — "svc_kei_info" |
| SVC_KEI_UCWK_INFO | Constant | Service contract detail info field name — "svc_kei_ucwk_info" |
| CHAF_SVC_KEI_UCWK_GENE_ADD_DTM | Constant | Post-change service contract detail generation date-time field name |
| KEY_TELNO | Constant | Telephone number key field name — "key_telno" |
| ITNS_TSJGS_CD | Constant | Inter-service provider code field name — "itns_tsjgs_cd" |
| IDO_DIV | Constant | Migration classification field name — "ido_div" |
| SOD_KIHON_INFO | Constant | SOD basic information map key — "sod_kihon_info" |
| `JTUStrConst.KOJIN` | Constant | "1" — Entity/Individual code indicating an individual customer |
| `JTUStrConst.SVC_KEI_DSL_ZM` | Constant | "910" — Service contract status for DSL cancellation completed |
| `JTUStrConst.SVC_KEI_CNCL_ZM` | Constant | "920" — Service contract status for cancellation completed |
| `JTUStrConst.SOD_HAKKO_ZUMI` | Constant | "SOD issued completed" — status marking that SOD has been dispatched |
| TUSV009701CC | Service | SOD creation service component — main service order data dispatch for portability swap |
| TUSV009702SC | Service | Telephone number consistency agreement service component — validates phone number for the customer |
| TUSV009703SC | Service | Phone number change service component — handles provider code substitution during number change |
| TUSV009705SC | Service | ENUM SOD dispatch service component — handles ENUM removal service orders |
| TELNOSTATJUDGECC | Service | Phone number status judgment common component — checks current status of the telephone number |
| TU_T_BMP_KOJI | DB Table | Portability work table — stores pending portability processing work records |
| KK_T_SVKEIUW_EOH_TEL | DB Table | Service contract details (eo Optical Phone) table — stores phone numbers and contract details for eo Optical Phone services |
| TU_M_TUSHIN_JGYOSHA | DB Table | Communication service provider master table — stores communication provider codes |
