[TOC] # 發票特務新增發票獎號流程 ## 一般獎號 ### 前端 #### 更新獎號檔案 1. 編輯檔案 Uniform11108Json.json ,更新本期獎號(可以使用 VSCode 編輯器編輯,檔案命名規則為民國年加上開獎期別的第二個月份,例如 111 年 7月8月獎號為 Uniform11108Json.json) #### 更新 & 上傳 ADDR 1. 由 Terminal 執行 `BuildAddressable.sh` 腳本 2. 透過指令進入指定專案資料夾 `cd /Users/samuelou/workspace/LifiApp2` 3. 執行包 ADDR 指令 `./Shell/BuildAddressable.sh` 4. 等待指令執行完畢(需要幾分鐘時間),出現 SUCCESS 表示完成 ```shell samuelou@SamueldeiMac LifiApp2 % ./Shell/BuildAddressable.sh ### Start iOS ### ### Start Android ### ###### SUCCESS ###### ``` 5. 執行指令上傳 ADDR 至 S3 `./Shell/UploadAddressable.sh` 6. 過程中出現上傳的檔名,最終出現 SUCCESS 表示完成 ### 後端 1. 編輯檔案 11108_normal.json (檔案命名規則為民國年加上開獎期別的第二個月份,例如 111 年 7月8月獎號為 11108_normal.json,normal 表示為一般獎) 2. 上傳獎號檔案至 S3 `aws s3 cp /Users/samuelou/workspace/11108_normal.json s3://winning-numbers/` 3. 更新資料庫獎號資料表 ```sql update `invoice_period` set `status`='active', `normalLink`='https://winning-numbers.s3.ap-southeast-1.amazonaws.com/11108_normal.json' where `period`='11108'; ``` 4. 呼叫後端 API 執行 reload ```shell node /Users/samuelou/workspace/Lifi2ServiceJS/scripts/reload-invoice-prizes.js ``` ## 雲端獎號 1. 下載獎號檔案,從[雲端發票專屬獎中獎號碼](https://invoice.etax.nat.gov.tw/cloudNowNumber.html)下載 五百元獎中獎號碼清單PDF檔(已排序) 八百元獎中獎號碼清單PDF檔(已排序) 兩千元獎中獎號碼清單PDF檔(已排序) 百萬元獎中獎清單PDF檔(已排序) 總共四個檔案 2. 重新命名檔案並且將檔案放在此路徑資料夾中 `/Users/samuelou/workspace/雲端發票中獎號碼/111008` 20220708期雲端發票五百元獎中獎號.pdf 20220708期雲端發票八百元獎中獎號.pdf 20220708期雲端發票兩千元獎中獎號.pdf 20220708期雲端發票百萬元獎中獎清.pdf 3. 執行解析程式,等待程式執行完畢 ```shell= cd /Users/samuelou/workspace/Lifi2ServiceJS export ENV_FILE=/Users/samuelou/workspace/local.env npm run parse-inv-prizes ``` 4. 更新資料庫獎號資料表 ```sql update `invoice_period` set `cloudLink`='https://winning-numbers.s3.ap-southeast-1.amazonaws.com/11108_cloud.json' where `period`='11108'; ``` 5. 呼叫後端 API 執行 reload ```shell node /Users/samuelou/workspace/Lifi2ServiceJS/scripts/reload-invoice-prizes.js
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up