---
# System prepended metadata

title: 改房價api
tags: [進階房價]

---

# 改房價api
###### tags:  `進階房價`
* 後端流程 : 
   方法一 : 前端產生 tmp_ikey, ikey_seq_nos 固定帶 1 給後端
           後端在依 (7.6.1.4 先刪再入 )
            刪除暫存費用列表資料_畫面顯示處理 SQL
            寫入暫存費用列表資料_畫面顯示處理 SQL 在 tmp_order_appraise 入值。
           
    方法二 : 用該資料的真正 ikey 與 ikey_seq_nos 確定話要跟彥志說，改變SQL寫法
    看你哪個爽。
    7.5.2 有宏興大哥標註，差別。

    接下來就是，崩潰儲存 7.7.4 迪文加油
    
* 前端 : 
* 修改房價，計價 會call 聖雍API package 重算價格與服務費

## 範例
```jsonld=
{
  "params": {
    
  },
  "table": {
    "guest_mn": [
      {
        "key_nos": "20474",  //v
        "alt_nam": "交換機管理測試",
        "eco_dat": "2020/08/09", //v
        "orate_cod": "hung20",//v舊值 好像是跟異動紀錄有關
        "ratecod_nam": "hung20:宏興測進階訂房",
        "ouse_cod": "HUNG",//v舊值 好像是跟異動紀錄有關
        "usecod_nam": "HUNG:商務套房",
        "osource_typ": "04",//v 舊值 好像是跟異動紀錄有關
        "source_nam": "04:自行訂房",
        "oguest_typ": "FIT",//v 舊值 好像是跟異動紀錄有關
        "guest_sna": "FIT:散客訂房",
        "ikey": "00000926", //v
        "ikey_seq_nos": "1", //v
        "room_nos": "0003",
        "acust_cod": "CS 000000000000101", //v
        "ci_dat": "2020-06-29T16:00:00.000Z",//v
        "room_ser": "1",
        "order_chg": "Y",//用來判斷可不可以改多筆的 房價
        "guest_qnt": "2", //v 跟adult_qnt 一樣
        "adult_qnt": "2", //v
        "child_qnt": "0", //v
        "commis_rat": "0",
        "room_cod": "SUM",//v
        "order_sta": "O",
        "source_typ": "04",//v
        "guest_typ": "FIT",//v
        "athena_id": 25, //v
        "hotel_cod": "01", //v
        "my_rnum": "1",
        "rate_cod": "hung20",//v
        "use_cod": "HUNG", //v
        "rate_chg": "N",//v 用來判斷這個單筆有沒有被修改過(好像很重要)
        "disc_usr": "a19027",//v 授權人
        "reason_rmk": "123456789",//v 授權理由
        "action_cod": "U",
        "upd_usr": "a19027", //v
        "upd_dat": "2020/08/12 15:42:28",
        "condition": [
          {
            "field": "ci_ser",   //v
            "operator": "equal",
            "value": "20200630000087"
          },
          {
            "field": "athena_id", //v
            "operator": "equal",
            "value": 25
          },
          {
            "field": "hotel_cod", //v
            "operator": "equal",
            "value": "01"
          }
        ]
      }
    ],
    "order_dt": [
      [
        {
          "batch_dat": "2020/07/01", //v
          "order_rat": "1%",    //v
          "rate_cod": "hung20", //v
          "use_cod": "HUNG",    //v
          "rent_amt": "4000",   //v
          "serv_amt": "800",    //v
          "source_typ": "04",   //v
          "guest_typ": "FIT",   //v
          "change_sta": "N",//v 用來判斷這筆多筆有沒有被修改過(好像很重要)，跟要不要重算有關
          "unit_original_amt": "4000",
          "rent_seq_nos": "10002",//如果等於0 該筆 row 不可以被改房價??
          "serv_seq_nos": "10003",
          "orent_amt": "0",
          "oserv_amt": "0",
          "my_rnum": "2",
          "use_dat": "2020-06-30T16:00:00.000Z",
          "condition": [
              {
                "field": "ikey", //v
                "operator": "equal",
                "value": "00000930"
              },
              {
                "field": "ikey_seq_nos", //v
                "operator": "equal",
                "value": "1"
              },
              {
                "field": "athena_id", //v
                "operator": "equal",
                "value": 25
              },
              {
                "field": "hotel_cod", //v
                "operator": "equal",
                "value": "01"
              }
          ]
        },
        {
          "batch_dat": "2020/07/02",
          "order_rat": "0.9%",
          "rate_cod": "hung20",
          "use_cod": "HUNG",
          "rent_amt": "4000",
          "serv_amt": "800",
          "source_typ": "04",
          "guest_typ": "FIT",
          "change_sta": "N",
          "unit_original_amt": "4000",
          "rent_seq_nos": "10004",
          "serv_seq_nos": "10005",
          "orent_amt": "0",
          "oserv_amt": "0",
          "my_rnum": "3",
          "use_dat": "2020-07-01T16:00:00.000Z"
        },
        {
          "batch_dat": "2020/07/03",
          "order_rat": "0.6%",
          "rate_cod": "hung20",
          "use_cod": "HUNG",
          "rent_amt": "4000",
          "serv_amt": "800",
          "source_typ": "04",
          "guest_typ": "FIT",
          "change_sta": "N",
          "unit_original_amt": "4000",
          "rent_seq_nos": "10006",
          "serv_seq_nos": "10007",
          "orent_amt": "0",
          "oserv_amt": "0",
          "my_rnum": "4",
          "use_dat": "2020-07-02T16:00:00.000Z",
          "condition": [
              {
                "field": "ikey",
                "operator": "equal",
                "value": "00000930"
              },
              {
                "field": "ikey_seq_nos",
                "operator": "equal",
                "value": "1"
              },
              {
                "field": "athena_id",
                "operator": "equal",
                "value": 25
              },
              {
                "field": "hotel_cod",
                "operator": "equal",
                "value": "01"
              }
          ]
        },
        {
          "batch_dat": "2020/07/04",
          "order_rat": "0.4%",
          "rate_cod": "hung20",
          "use_cod": "HUNG",
          "rent_amt": "5000",
          "serv_amt": "1000",
          "source_typ": "04",
          "guest_typ": "FIT",
          "change_sta": "N",
          "unit_original_amt": "5000",
          "rent_seq_nos": "10008",
          "serv_seq_nos": "10009",
          "orent_amt": "0",
          "oserv_amt": "0",
          "my_rnum": "5",
          "use_dat": "2020-07-03T16:00:00.000Z",
          "condition": [
              {
                "field": "ikey",
                "operator": "equal",
                "value": "00000930"
              },
              {
                "field": "ikey_seq_nos",
                "operator": "equal",
                "value": "1"
              },
              {
                "field": "athena_id",
                "operator": "equal",
                "value": 25
              },
              {
                "field": "hotel_cod",
                "operator": "equal",
                "value": "01"
              }
          ]
        },
      ]
    ]
  },
  "socket_id": "JtFddJs-3c1KDBl5AAAE",
  "session_id": 51088799,
  "user": "a19027",
  "client_ip": "",
  "server_ip": "",
  "mac": "",
  "reve_code": "PMS0210022",
  "prg_id": "PMS0210022_1",
  "func_id": "xxxx",
  "event_time": "2020-08-12T15:42:34+08:00",
  "locale": "zh_TW",
  "athena_id": 25,
  "comp_cod": "ZZATHENA",
  "hotel_cod": "01",
  "ins_usr": "a19027",
  "upd_usr": "a19027",
  "trans_log_id": "B20200812154243343"
}
```