# (DD23) Business Logic — JFUSvcOrderAddCC.setInMapOdrSet() [32 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `com.fujitsu.futurity.bp.custom.common.JFUSvcOrderAddCC` |
| Layer | CC/Common Component |
| Module | `common` (Package: `com.fujitsu.futurity.bp.custom.common`) |

## 1. Role

### JFUSvcOrderAddCC.setInMapOdrSet()

This method performs the **order-setting (order registration) upper-mapping processing** (`オーダ設定登録の上りマッピング処理`) for the Service Order system. It maps incoming request parameters into a business HashMap (`inMap`) that is subsequently consumed by a downstream Service Component (CBS) — specifically `EKK1041D010CBS`, which handles order registration for service contracts.

The method is a **shared data transformer** called from the `addMladSvcOrder` method, which orchestrates the full "Mail Address + Service Order" registration flow. The `addMladSvcOrder` method branches by `actionName` — for **change** operations it maps the "before" state, while for **new registration** (email address update) it maps with request type code `CD00317_02` (new). The method sets up a fixed set of order metadata: order type code (`CD00309_1` = "1") and service order code (`CD00310_03` = "03"), which identify this as a standard service order registration.

A key conditional branch handles **cancel** (`CD00317_08` = "08") operations — in this case the method also populates two additional SOD (Service Order Data) send dates: the stop (`STP_SOD_SEND_YMD`) and delete (`DEL_SOD_SEND_YMD`) timestamps, both set to the current operational date. This ensures the SOD downstream knows to record both the cancellation and deletion timelines.

The method implements the **Builder** design pattern: it incrementally constructs a HashMap with strongly-typed field keys, using the operational date as a computed value via `JCCBPCommon.getOpeDate(null)`.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["setInMapOdrSet params"]) --> STEP1["STEP1: Set func code FUNC_CD_1"]
    STEP1 --> STEP2["STEP2: Get HashMap inMap from param.getData fixedText"]
    STEP2 --> STEP3["STEP3: inMap.put SVC_KEI_NO svcKeiNo"]
    STEP3 --> STEP4["STEP4: inMap.put OP_SVC_KEI_NO opSvcKeiNo"]
    STEP4 --> STEP5["STEP5: inMap.put ORDER_SBT_CD CD00309_1 1"]
    STEP5 --> STEP6["STEP6: inMap.put SVC_ORDER_CD CD00310_03 03"]
    STEP6 --> STEP7["STEP7: inMap.put RCNT_YOKYU_SBT_CD yokyuSbtCd"]
    STEP7 --> STEP8["STEP8: inMap.put MLAD mlad"]
    STEP8 --> STEP9["STEP9: inMap.put ADD_SOD_SEND_YMD getOpeDate null"]
    STEP9 --> COND{"CD00317_08 equals yokyuSbtCd"}
    COND --> |true| STEP10["STEP10: inMap.put STP_SOD_SEND_YMD getOpeDate null"]
    STEP10 --> STEP11["STEP11: inMap.put DEL_SOD_SEND_YMD getOpeDate null"]
    COND --> |false| END_NODE["Return / Next"]
    STEP11 --> END_NODE
    STEP9 --> END_NODE
```

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `param` | `IRequestParameterReadWrite` | Request parameter container holding session-scoped data; provides `getData()` to retrieve the working HashMap and acts as the downstream carrier for the populated mapping data. |
| 2 | `fixedText` | `String` | Service message key (e.g., `"FUSV012207CC"`); used as the key to retrieve the target HashMap from `param` via `param.getData(fixedText)`. It identifies which CBS message payload the mapping targets. |
| 3 | `svcKeiNo` | `String` | Service contract number (`サービス契約番号`); the primary identifier of the service contract line being registered or modified. |
| 4 | `opSvcKeiNo` | `String` | Option service contract number (`オプションサービス契約番号`); identifies the associated optional service (e.g., ISP, mail capacity) linked to the main service contract. |
| 5 | `mlad` | `String` | Email address (`メールアドレス`); the customer's email address used for notifications. In change operations this may be the "before" or "after" address depending on caller context. |
| 6 | `yokyuSbtCd` | `String` | Request type code (`要求種別コード`); classifies the type of request being processed. Key values: `CD00317_08` = "08" (cancel/request stop, triggering SOD stop/delete date population) and `CD00317_02` (new registration). |

**External state / instance fields read:** None. This method is stateless — all data is parameter-driven and operates on the HashMap obtained from `param`.

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JCCBPCommon.getOpeDate` | (Utility) | - | Calls `getOpeDate` to retrieve the current operational date (used for `ADD_SOD_SEND_YMD` and conditional `STP_SOD_SEND_YMD`/`DEL_SOD_SEND_YMD`). |

### Additional method calls:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| R | `JFUBaseCC.setFuncCode` | (Base Component) | - | Calls `setFuncCode` to set the functional code `FUNC_CD_1` (= "1") in the request parameter, indicating function code "1" (typically registration mode). |

### Downstream CBS consumers (called by caller `addMladSvcOrder`):

The mapping produced by this method is consumed by the following CBS:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| C | `EKK1041D010CBS` (via `executeSC`) | EKK1041D010CBS | KK_T_ODR_SET (order registration) | Service order registration CBS that receives the populated `inMap` containing service contract number, option service contract number, order type, service order code, request type, email address, and SOD send date(s). |

## 5. Dependency Trace

### Direct callers:

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `addMladSvcOrder` (CC) | `addMladSvcOrder(handle, param, fixedText)` → conditional branching by `actionName` → `setInMapOdrSet(param, fixedText, inParamSvcKeiNo, inParamOpSvcKeiNo, inParamChgBfMlad, rcntYokyuSbtCd)` | `EKK1041D010CBS [C] KK_T_ODR_SET` |

**Call context from `addMladSvcOrder`:**
- When `actionName` is **change** (not update/expand): calls `setInMapOdrSet` with the "before" email address and `rcntYokyuSbtCd` from the order settings search result.
- When `actionName` equals `ACTION_NAME_UPDATE` (email address change): calls `setInMapOdrSet` with the "after" email address (`inParamChgAfMlad`) and `CD00317_02` (new request type code).

### Terminal operations from this method:
- `getOpeDate [R]` — operational date retrieval (called up to 3 times: once for `ADD_SOD_SEND_YMD`, and twice for `STP_SOD_SEND_YMD` and `DEL_SOD_SEND_YMD` in the cancel branch).
- `setFuncCode [R]` — functional code setting.
- `put()` operations on HashMap (7-9 PUT operations depending on branch).

## 6. Per-Branch Detail Blocks

**Block 1** — [EXEC] `setFuncCode` (L814)

> Sets the function code to "1" (registration mode) in the request parameter.

| # | Type | Code |
|---|------|------|
| 1 | SET | `setFuncCode(param, fixedText, JPCModelConstant.FUNC_CD_1)` // Function code setting (1) — `FUNC_CD_1 = "1" (JPCModelConstant.java:29)` |

**Block 2** — [EXEC] `param.getData` — User data retrieval (L817)

> Retrieves the HashMap that will hold the mapped order-setting data from the request parameter container.

| # | Type | Code |
|---|------|------|
| 1 | SET | `HashMap inMap = (HashMap)param.getData(fixedText)` // User data retrieval — `fixedText` identifies the CBS message payload key |

**Block 3** — [EXEC] Set service contract number (L820)

> Maps the service contract number into the inMap.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK1041D010CBSMsg.SVC_KEI_NO, svcKeiNo)` // Service contract number — `SVC_KEI_NO = "svc_kei_no" (EKK1041D010CBSMsg.java:137)` |

**Block 4** — [EXEC] Set option service contract number (L822)

> Maps the option service contract number into the inMap.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK1041D010CBSMsg.OP_SVC_KEI_NO, opSvcKeiNo)` // Option service contract number — `OP_SVC_KEI_NO = "op_svc_kei_no" (EKK1041D010CBSMsg.java:142)` |

**Block 5** — [EXEC] Set order type code (L824)

> Sets the order type code to a fixed value. This is a standard order (not a search or cancel).

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK1041D010CBSMsg.ORDER_SBT_CD, JFUStrConst.CD00309_1)` // Order type code — `CD00309_1 = "1" (JFUStrConst.java:2419)` |

**Block 6** — [EXEC] Set service order code (L826)

> Sets the service order code to a fixed value indicating standard service order.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK1041D010CBSMsg.SVC_ORDER_CD, JFUStrConst.CD00310_03)` // Service order code — `CD00310_03 = "03" (JFUStrConst.java:2437)` |

**Block 7** — [EXEC] Set request type code (L828)

> Maps the incoming request type code (e.g., "08" for cancel, "02" for new) into the inMap.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK1041D010CBSMsg.RCNT_YOKYU_SBT_CD, yokyuSbtCd)` // Recent request type code — `RCNT_YOKYU_SBT_CD = "rcnt_yokyu_sbt_cd" (EKK1041D010CBSMsg.java:162)` |

**Block 8** — [EXEC] Set email address (L830)

> Maps the customer's email address into the inMap for downstream CBS processing.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK1041D010CBSMsg.MLAD, mlad)` // Email address — `MLAD = "mlad" (EKK1041D010CBSMsg.java:182)` |

**Block 9** — [EXEC] Set registered SOD send date (L832)

> Sets the registration SOD send date to the current operational date. This is always executed.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK1041D010CBSMsg.ADD_SOD_SEND_YMD, JCCBPCommon.getOpeDate(null))` // Registered SOD send date — `ADD_SOD_SEND_YMD = "add_sod_send_ymd" (EKK1041D010CBSMsg.java:192)` |

**Block 10** — [IF] `CD00317_08.equals(yokyuSbtCd)` (L834)

> **Cancel branch**: When the request type code is "08" (cancel), populate both stop SOD send date and delete SOD send date. This ensures the SOD downstream knows the cancellation timeline.

| # | Type | Code |
|---|------|------|
| 1 | SET | `inMap.put(EKK1041C010CBSMsg.STP_SOD_SEND_YMD, JCCBPCommon.getOpeDate(null))` // Stop SOD send date — `STP_SOD_SEND_YMD = "stp_sod_send_ymd" (EKK1041C010CBSMsg.java:106)` |
| 2 | SET | `inMap.put(EKK1041C010CBSMsg.DEL_SOD_SEND_YMD, JCCBPCommon.getOpeDate(null))` // Delete SOD send date — `DEL_SOD_SEND_YMD = "del_sod_send_ymd" (EKK1041C010CBSMsg.java:116)` |

**Block 10.1** — [ELSE] (implicit L841)

> When the request type is NOT cancel (e.g., it's "02" = new registration), skip the stop/delete SOD dates. Only the `ADD_SOD_SEND_YMD` from Block 9 is populated.

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei_no` | Field | Service contract number — the primary identifier of a telecom service contract line item |
| `op_svc_kei_no` | Field | Option service contract number — identifier for optional services (ISP, mail capacity, etc.) attached to a service contract |
| `order_sbt_cd` | Field | Order type code — classifies the type of order being processed (standard registration vs. search vs. cancel) |
| `svc_order_cd` | Field | Service order code — distinguishes between different service order variants |
| `rcnt_yokyu_sbt_cd` | Field | Recent request type code — identifies the type of request: "02" = new registration, "08" = cancel/request stop |
| `mlad` | Field | Email address (`メールアドレス`) — customer notification email for the service contract |
| `add_sod_send_ymd` | Field | Registered SOD send date — the date when the service order data is sent for registration |
| `stp_sod_send_ymd` | Field | Stop SOD send date — the date when service order data is sent for cancellation/stop |
| `del_sod_send_ymd` | Field | Delete SOD send date — the date when service order data is sent for deletion |
| FUNC_CD_1 | Constant | Function code "1" — indicates registration/add mode |
| CD00309_1 | Constant | Order type code "1" — standard order type |
| CD00310_03 | Constant | Service order code "03" — standard service order variant |
| CD00317_08 | Constant | Request type "08" — cancel/request stop |
| CD00317_02 | Constant | Request type "02" — new registration |
| SOD | Acronym | Service Order Data — internal data structure for order fulfillment messages between system components |
| CBS | Acronym | Component-Based System — Fujitsu's service component architecture for business logic |
| EKK1041D010CBS | CBS | Order registration service component — handles the actual order registration for service contracts |
| EKK1041C010CBSMsg | CBSMsg | Message constants for cancel operations — STP/DEL SOD send date keys |
| CC | Acronym | Common Component — shared business logic components called by screens/batches |
| getOpeDate | Method | Retrieves the current operational date from system settings, used as the authoritative date for SOD sends |
