# Business Logic — JBSbatKKHnsokuCdIktTrkm.setPrgParam() [47 LOC]

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

## 1. Role

### JBSbatKKHnsokuCdIktTrkm.setPrgParam()

This method constructs and returns an `Object[]` parameter array for registering a progress record (progress schema registration) in the K-Opticom customer core system's sales promotion code bulk import process. The method is responsible for assembling a standardized set of 33 fields that describe a single batch processing step — including the progress number, the applied promotion campaign code, the service contract number, the transfer (move) reason division code, timestamps, and operator metadata. It implements the builder pattern: gathering input from the incoming message map (`cpIktAddMap`) and the service contract map (`svcKeiMap`), resolving system values (next sequence, system timestamp, operation timestamp) via shared common utilities, and packaging everything into a single array for downstream progress schema persistence. Within the larger system, this method serves as a dedicated parameter factory called by `execute()` during the sales promotion code bulk import batch, bridging the gap between raw input data and the progress tracking infrastructure that monitors batch job state. All output fields are null except for the progress number, progress special item, progress memo, transfer reason division, transfer datetime, progress status, and a handful of audit fields — reflecting that this batch phase focuses exclusively on recording a high-level step marker rather than full entity details.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setPrgParam(cpIktAddMap, svcKeiMap, mskmDtlNo, idoDtm)"])

    START --> STEP1["Step 1: Acquire progress number (prgNo)"]
    STEP1 --> CALL_SEQ["JCCBatCommon.getFormatedNextSeq(commonItem, SEQ_PRG_NO, \"\", 12)"]

    CALL_SEQ --> STEP2["Step 2: Build progress special item 1 (prgTkjk1)"]
    STEP2 --> CALL_MAP["cpIktAddMap.getString(DSP_DCHSKM_CD)"]

    CALL_MAP --> STEP3["Step 3: Build 33-element parameter array"]

    STEP3 --> F1["prgNo — Progress number"]
    STEP3 --> F2["mskmDtlNo — Application detail number"]
    STEP3 --> F3["null — Billing contract number"]
    STEP3 --> F4["null — Billing method number (seat)"]
    STEP3 --> F5["null — Billing method number (credit card)"]
    STEP3 --> F6["svcKeiMap.getString(SVC_KEI_NO) — Service contract number"]
    STEP3 --> F7["null — Service contract detail number"]
    STEP3 --> F8["null — Service contract line item detail number"]
    STEP3 --> F9["null — Device provisioning service contract number"]
    STEP3 --> F10["null — Optional service contract number"]
    STEP3 --> F11["null — Billing optional service contract number"]
    STEP3 --> F12["null — Sub optional service contract number"]
    STEP3 --> F13["null — Discount service contract number"]
    STEP3 --> F14["IDO_DIV_HANSOKU = \"00050\" — Transfer division"]
    STEP3 --> F15["idoDtm — Transfer year/month/day/hour/minute/second"]
    STEP3 --> F16["PRG_STAT_DCHSKM_ADD_FIN = \"F060\" — Progress status"]
    STEP3 --> F17["JKKBatCommon.getOpeDateTimeStamp(commonItem) — Progress datetime"]
    STEP3 --> F18["null — Progress memo"]
    STEP3 --> F19["prgTkjk1 — Progress special item 1"]
    STEP3 --> F20["cpIktAddMap.getString(MEMO) — Progress special item 2"]
    STEP3 --> F21["JCCBatCommon.getSysDateTimeStamp() — Register datetime"]
    STEP3 --> F22["super.batchUserId — Register operator account"]
    STEP3 --> F23["JCCBatCommon.getSysDateTimeStamp() — Update datetime"]
    STEP3 --> F24["super.batchUserId — Update operator account"]
    STEP3 --> F25["null — Delete datetime"]
    STEP3 --> F26["null — Delete operator account"]
    STEP3 --> F27["S_MK_FLG = \"0\" — Invalid flag"]
    STEP3 --> F28["super.opeDate — Register operation date"]
    STEP3 --> F29["super.batchUserId — Register process ID"]
    STEP3 --> F30["super.opeDate — Update operation date"]
    STEP3 --> F31["super.batchUserId — Update process ID"]
    STEP3 --> F32["null — Delete operation date"]
    STEP3 --> F33["null — Delete process ID"]

    F33 --> STEP4["Step 4: Return parameter array"]
    STEP4 --> END_NODE(["Return setParam"])
```

**Constant Resolution:**
- `JKKBatConst.IDO_DIV_HANSOKU = "00050"` — Transfer division code representing "cancellation" ( transferencia / 異動区分: 搬送)
- `JKKBatConst.PRG_STAT_DCHSKM_ADD_FIN = "F060"` — Progress status indicating "add completion" ( 進捗ステータス: 追加完了)
- `JKKBatConst.S_MK_FLG = "0"` — Invalid flag ( 無効フラグ: inactive/invalidate indicator)
- `SET_TEMPLATE_PRG_TKJK_1 = "販売促進コード一括取込 CPコード:"` — Template prefix for progress special item 1 (Promotion code bulk import CP code:)
- `JKKBatConst.SEQ_PRG_NO = "SEQ_PRG_NO"` — Sequence definition name for generating progress numbers

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `cpIktAddMap` | `JBSbatServiceInterfaceMap` | Input message map carrying the sales promotion code bulk import request payload. Contains the data extraction item code (`DSP_DCHSKM_CD`) that identifies which promotion campaign code is being processed, and the memo field (`MEMO`) used as progress special item 2. |
| 2 | `svcKeiMap` | `JBSbatCommonDBInterface` | Service contract information map carrying the service contract number (`SVC_KEI_NO`). This represents the specific service contract line associated with the promotion code being imported. |
| 3 | `mskmDtlNo` | `String` | Application detail number — the unique line item identifier for the import application ( 申請明細番号). Identifies a specific record within the bulk import batch. |
| 4 | `idoDtm` | `String` | Transfer year/month/day/hour/minute/second ( 異動年月日時分秒) — the datetime when the transfer (service change/move) occurred. Passed through as-is into the progress record at index 15. |

**Instance fields read:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `super.commonItem` | `JBSbatCommonItem` | Shared common item context used for sequence generation (passed to `getFormatedNextSeq`). |
| `super.batchUserId` | (String) | The batch process user ID, used as the register/update operator account and process ID. |
| `super.opeDate` | (String) | The current operation date (YYYYMMDD format), used as the register/update operation date. |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JCCBatCommon.getFormatedNextSeq` | JCCBatCommon | - | Calls `getFormatedNextSeq` in `JCCBatCommon` to acquire the next progress number from sequence `SEQ_PRG_NO` |
| R | `JBSbatServiceInterfaceMap.getString` | - | - | Reads the data extraction item code (`DSP_DCHSKM_CD`) from the input message map |
| R | `JBSbatCommonDBInterface.getString` | - | - | Reads the service contract number (`SVC_KEI_NO`) from the service contract map |
| R | `JCCBatCommon.getSysDateTimeStamp` | JCCBatCommon | - | Calls `getSysDateTimeStamp` to obtain the current system timestamp for register datetime |
| R | `JKKBatCommon.getOpeDateTimeStamp` | JKKBatCommon | - | Calls `getOpeDateTimeStamp` with `commonItem` to obtain the operation datetime for progress datetime |
| R | `JBSbatServiceInterfaceMap.getString` | - | - | Reads the memo field (`MEMO`) from the input message map for progress special item 2 |

**Analysis:** This method performs zero create/update/delete operations against any database. It is purely a **parameter builder** — all called services are Read (R) operations that acquire system values (sequence, timestamps) and extract values from input maps. The returned `Object[]` array is passed downstream to the caller (`execute()`) which is responsible for persisting the progress record.

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JCCBatCommon.getFormatedNextSeq` | JCCBatCommon | - (Sequence: SEQ_PRG_NO) | Acquires the next progress number as a 12-digit formatted string from the database sequence `SEQ_PRG_NO` |
| R | `cpIktAddMap.getString` | - | - | Extracts the data extraction item code from the input message for the special progress item label |
| R | `svcKeiMap.getString` | - | - | Extracts the service contract number (SVC_KEI_NO) from the service contract map |
| R | `JCCBatCommon.getSysDateTimeStamp` | JCCBatCommon | - | Obtains the current system timestamp string for register and update datetime fields |
| R | `JKKBatCommon.getOpeDateTimeStamp` | JKKBatCommon | - | Obtains the formatted operation datetime string from `commonItem` for the progress datetime field |
| R | `cpIktAddMap.getString` | - | - | Extracts the memo text from the input message for progress special item 2 |

## 5. Dependency Trace

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

No screen/batch entry points found within 8 hops. Direct callers found: 1 methods.
Terminal operations from this method: `getSysDateTimeStamp` [R], `getSysDateTimeStamp` [R], `getSysDateTimeStamp` [R], `getSysDateTimeStamp` [R], `getString` [R], `getString` [R], `getString` [R], `getString` [R], `getOpeDateTimeStamp` [R], `getOpeDateTimeStamp` [R], `getFormatedNextSeq` [R]

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: JBSbatKKHnsokuCdIktTrkm | `JBSbatKKHnsokuCdIktTrkm.execute()` -> `JBSbatKKHnsokuCdIktTrkm.setPrgParam(cpIktAddMap, svcKeiMap, mskmDtlNo, idoDtm)` | `JCCBatCommon.getFormatedNextSeq [R] SEQ_PRG_NO`<br>`cpIktAddMap.getString [R] DSP_DCHSKM_CD`<br>`svcKeiMap.getString [R] SVC_KEI_NO`<br>`JCCBatCommon.getSysDateTimeStamp [R] -`<br>`JKKBatCommon.getOpeDateTimeStamp [R] -`<br>`cpIktAddMap.getString [R] MEMO` |

**Note:** The method is called by the batch process `execute()` method of the same class (`JBSbatKKHnsokuCdIktTrkm`), which handles the sales promotion code bulk import (販売促進コード一括取込). No screen-level entry points route to this method — it is exclusively invoked by the batch layer. The terminal operations are all Read operations that fetch system utilities (sequence numbers, timestamps) and extract data from input maps; no direct entity persistence occurs within this method.

## 6. Per-Branch Detail Blocks

This method has no conditional branches (no if/else, switch, or loops). It is a straight-line parameter builder. All 33 array elements are assigned sequentially.

**Block 1** — [STEP] `Acquire progress number` (L4354)

> Generates the next progress number from the database sequence.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `JCCBatCommon.getFormatedNextSeq(super.commonItem, SEQ_PRG_NO, "", 12)` // Acquires the next progress number ( 進捗番号を取得) [-> SEQ_PRG_NO="SEQ_PRG_NO"] |
| 2 | SET | `String prgNo = result` // Progress number variable ( 進捗番号) |

**Block 2** — [STEP] `Build progress special item 1` (L4356)

> Constructs a descriptive string combining a template prefix with the data extraction item code to identify which promotion campaign code is being processed.

| # | Type | Code |
|---|------|------|
| 1 | EXEC | `cpIktAddMap.getString(JBSbatKKIFM071.DSP_DCHSKM_CD)` // Extracts the data extraction item code ( 表示用データ抽出項目コード) [-> DSP_DCHSKM_CD="dsp_dchskm_cd"] |
| 2 | SET | `String prgTkjk1 = SET_TEMPLATE_PRG_TKJK_1 + cpIktAddMap.getString(...)` // Progress special item 1 ( 進捗特記事項1) [-> SET_TEMPLATE_PRG_TKJK_1="販売促進コード一括取込 CPコード:"] |

**Block 3** — [STEP] `Build 33-element parameter array` (L4359–L4397)

> Assembles all fields for progress schema registration. Most fields are null (reserved for other batch phases), with key populated fields providing the progress number, application detail number, service contract number, transfer division code, transfer datetime, progress status, timestamps, and operator metadata.

| # | Type | Code | Business Description |
|---|------|------|---------------------|
| 1 | SET | `prgNo` | Progress number ( 進捗番号) — generated sequence number |
| 2 | SET | `mskmDtlNo` | Application detail number ( 申請明細番号) — from method parameter |
| 3 | SET | `null` | Billing contract number ( 請求契約番号) — not used in this batch phase |
| 4 | SET | `null` | Billing method number — seat ( 請求方法番号（口座）) — not used |
| 5 | SET | `null` | Billing method number — credit card ( 請求方法番号（クレジットカード）) — not used |
| 6 | EXEC | `svcKeiMap.getString(JBSbatKK_T_SVC_KEI.SVC_KEI_NO)` | Service contract number ( サービス契約番号) [-> SVC_KEI_NO="SVC_KEI_NO"] |
| 7 | SET | `null` | Service contract detail number ( サービス契約内訳番号) — not used |
| 8 | SET | `null` | Service contract line item detail number ( サービス契約回線内訳番号) — not used |
| 9 | SET | `null` | Device provisioning service contract number ( 機器提供サービス契約番号) — not used |
| 10 | SET | `null` | Optional service contract number ( オプションサービス契約番号) — not used |
| 11 | SET | `null` | Billing optional service contract number ( 請求オプションサービス契約番号) — not used |
| 12 | SET | `null` | Sub optional service contract number ( サブオプションサービス契約番号) — not used |
| 13 | SET | `null` | Discount service contract number ( 割引サービス契約番号) — not used |
| 14 | SET | `JKKBatConst.IDO_DIV_HANSOKU` | Transfer division ( 異動区分) [-> "00050" (cancellation)] |
| 15 | SET | `idoDtm` | Transfer year/month/day/hour/minute/second ( 異動年月日時分秒) — from method parameter |
| 16 | SET | `JKKBatConst.PRG_STAT_DCHSKM_ADD_FIN` | Progress status ( 進捗ステータス) [-> "F060" (add completion)] |
| 17 | EXEC | `JKKBatCommon.getOpeDateTimeStamp(commonItem)` | Progress year/month/day/hour/minute/second ( 進捗年月日時分秒) — operation timestamp |
| 18 | SET | `null` | Progress memo ( 進捗メモ) — not used |
| 19 | SET | `prgTkjk1` | Progress special item 1 ( 進捗特記事項1) — "販売促進コード一括取込 CPコード:" + code |
| 20 | EXEC | `cpIktAddMap.getString(JBSbatKKIFM071.MEMO)` | Progress special item 2 ( 進捗特記事項2) — memo from input message [-> MEMO="MEMO"] |
| 21 | EXEC | `JCCBatCommon.getSysDateTimeStamp()` | Register year/month/day/hour/minute/second ( 登録年月日時分秒) — system timestamp |
| 22 | SET | `super.batchUserId` | Register operator account ( 登録オペレータアカウント) |
| 23 | EXEC | `JCCBatCommon.getSysDateTimeStamp()` | Update year/month/day/hour/minute/second ( 更新年月日時分秒) — system timestamp |
| 24 | SET | `super.batchUserId` | Update operator account ( 更新オペレータアカウント) |
| 25 | SET | `null` | Delete year/month/day/hour/minute/second ( 削除年月日時分秒) — not used |
| 26 | SET | `null` | Delete operator account ( 削除オペレータアカウント) — not used |
| 27 | SET | `JKKBatConst.S_MK_FLG` | Invalid flag ( 無効フラグ) [-> "0" (inactive)] |
| 28 | SET | `super.opeDate` | Register operation date ( 登録運用年月日) |
| 29 | SET | `super.batchUserId` | Register process ID ( 登録処理ID) |
| 30 | SET | `super.opeDate` | Update operation date ( 更新運用年月日) |
| 31 | SET | `super.batchUserId` | Update process ID ( 更新処理ID) |
| 32 | SET | `null` | Delete operation date ( 削除運用年月日) — not used |
| 33 | SET | `null` | Delete process ID ( 削除処理ID) — not used |

**Block 4** — [RETURN] (L4399)

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return setParam;` // Returns the 33-element parameter array for progress schema registration ( 進捗スキーマ登録用のパラメータを返す) |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `prgNo` | Field | Progress number ( 進捗番号) — a 12-digit formatted sequence number uniquely identifying a batch progress record |
| `prgTkjk1` | Field | Progress special item 1 ( 進捗特記事項1) — a descriptive string identifying which promotion campaign code is being processed |
| `mskmDtlNo` | Field | Application detail number ( 申請明細番号) — the unique line item identifier within a bulk import application |
| `idoDtm` | Field | Transfer datetime ( 異動年月日時分秒) — the date and time when a service change, move, or cancellation took effect |
| `SVC_KEI_NO` | Field | Service contract number ( サービス契約番号) — the unique identifier for a customer's service contract line |
| `DSP_DCHSKM_CD` | Field | Data extraction item code ( 表示用データ抽出項目コード) — a code identifying the data extraction/target item in the promotion campaign |
| `MEMO` | Field | Memo ( メモ) — free-text memo field from the input message, stored as progress special item 2 |
| `IDO_DIV_HANSOKU` | Constant | Transfer division code "00050" ( 異動区分: 搬送) — classifies the type of transfer/move; "00050" specifically denotes a cancellation-type transfer |
| `PRG_STAT_DCHSKM_ADD_FIN` | Constant | Progress status "F060" ( 進捗ステータス: 追加完了) — indicates the progress step has completed successfully (add completion) |
| `S_MK_FLG` | Constant | Invalid flag "0" ( 無効フラグ) — indicates the record is in an inactive/invalidate state; "0" means not invalidated |
| `SEQ_PRG_NO` | Constant | Sequence definition name "SEQ_PRG_NO" — the database sequence used to generate unique progress numbers |
| `SET_TEMPLATE_PRG_TKJK_1` | Constant | Template prefix "販売促進コード一括取込 CPコード:" — Japanese for "Promotion code bulk import CP code:" |
| `commonItem` | Instance | Shared common item ( `JBSbatCommonItem`) — system-wide context object providing connection and operational metadata |
| `batchUserId` | Instance | Batch process user ID — the system account ID running the batch process, used as operator metadata |
| `opeDate` | Instance | Operation date ( 運用年月日) — the current processing date in YYYYMMDD format |
| Sales Promotion Code Bulk Import | Business term | 販売促進コード一括取込 — the batch process that imports sales promotion (marketing) codes into the K-Opticom customer core system in bulk |
| Progress Schema | Technical term | 進捗スキーマ — the progress tracking record schema that monitors batch job processing steps and their status |
| Service Contract | Business term | サービス契約 — a customer's contracted service line in the telecom system, encompassing service type, billing, and associated equipment |
| Transfer (Move) | Business term | 異動 — a service change operation such as cancellation, modification, or reassignment of a service contract line |
| JBSbatKKHnsokuCdIktTrkm | Class | Sales promotion code bulk import service — the main batch service class handling the end-to-end sales promotion code import process |
| JBSbatServiceInterfaceMap | Type | Input message map — a key-value interface map carrying business data from the calling context |
| JBSbatCommonDBInterface | Type | Service contract data interface — a database-style interface map carrying service contract entity data |
| JCCBatCommon | Class | Common batch utility — shared utility class providing system-wide batch helper methods (sequence generation, timestamps) |
| JKKBatCommon | Class | Common batch utility (K-Opticom) — K-Opticom-specific batch utility class providing operation timestamp generation |

---
