Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3fb4f8ccc4 | |||
| ff9287b826 | |||
| 10c8754732 |
@@ -17,6 +17,12 @@ type WriteoffResponse struct {
|
|||||||
Result string `json:"result"` // 回覆明細
|
Result string `json:"result"` // 回覆明細
|
||||||
Checksum string `json:"checksum"` // 校驗碼
|
Checksum string `json:"checksum"` // 校驗碼
|
||||||
ReturnSeq string `json:"rtnSeq"` // 回覆序號
|
ReturnSeq string `json:"rtnSeq"` // 回覆序號
|
||||||
|
Message string `json:"message"` // 回覆訊息
|
||||||
|
}
|
||||||
|
|
||||||
|
type FeeAuditInfo struct {
|
||||||
|
WriteoffYYYYMM string `json:"writeoff_yyyymm"` // 支審年月
|
||||||
|
TransNo string `json:"trans_no"` // 交易序號
|
||||||
}
|
}
|
||||||
|
|
||||||
// FeeApplyUpload 是 FeeApply 的傳送資料
|
// FeeApplyUpload 是 FeeApply 的傳送資料
|
||||||
@@ -26,8 +32,7 @@ type FeeApplyUpload struct {
|
|||||||
|
|
||||||
// ApplyInfo 是 FeeApplyUpload 的單筆資料
|
// ApplyInfo 是 FeeApplyUpload 的單筆資料
|
||||||
type ApplyInfo struct {
|
type ApplyInfo struct {
|
||||||
WriteoffYYYYMM string `json:"writeoff_yyyymm"` // 支審年月
|
FeeAuditInfo
|
||||||
TransNo string `json:"trans_no"` // 交易序號
|
|
||||||
Records int `json:"records"` // 服務記錄筆數
|
Records int `json:"records"` // 服務記錄筆數
|
||||||
Amount int `json:"amount"` // 服務記錄金額
|
Amount int `json:"amount"` // 服務記錄金額
|
||||||
Cases int `json:"cases"` // 申請個案數
|
Cases int `json:"cases"` // 申請個案數
|
||||||
@@ -97,8 +102,7 @@ type ObjDelUpload struct {
|
|||||||
|
|
||||||
// SvcDelInfo 是刪除資料
|
// SvcDelInfo 是刪除資料
|
||||||
type SvcDelInfo struct {
|
type SvcDelInfo struct {
|
||||||
WriteoffYYYYMM string `json:"writeoff_yyyymm"` // 支審年月
|
FeeAuditInfo
|
||||||
TransNo string `json:"trans_no"` // 交易序號
|
|
||||||
Records int `json:"records"` // 服務記錄筆數
|
Records int `json:"records"` // 服務記錄筆數
|
||||||
CaseSvcRecords []CaseSvcRecord `json:"case_svc_records"` // 個案服務記錄
|
CaseSvcRecords []CaseSvcRecord `json:"case_svc_records"` // 個案服務記錄
|
||||||
}
|
}
|
||||||
@@ -110,19 +114,27 @@ type AppCompletionNoticeUpload struct {
|
|||||||
|
|
||||||
// FinishInfo 是申報確認資料
|
// FinishInfo 是申報確認資料
|
||||||
type FinishInfo struct {
|
type FinishInfo struct {
|
||||||
WriteoffYYYYMM string `json:"writeoff_yyyymm"` // 支審年月
|
FeeAuditInfo
|
||||||
TransNo string `json:"trans_no"` // 交易序號
|
FinishCityInfos []FinishCityInfo `json:"city_info"` // 縣市案號資訊
|
||||||
CityInfos []CityInfo `json:"city_info"` // 縣市案號資訊
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CityInfo 是縣市案號資訊
|
type FinishCityInfo struct {
|
||||||
type CityInfo struct {
|
|
||||||
CityCode string `json:"city_cd"` // 縣市代碼
|
CityCode string `json:"city_cd"` // 縣市代碼
|
||||||
CaseNoInfos []CaseNoInfo `json:"case_no_info"` // 案件資訊
|
CaseNoInfos []CaseNoInfo `json:"case_no_info"` // 案件資訊
|
||||||
}
|
}
|
||||||
|
|
||||||
// CaseNoInfo 是案件資訊
|
// CaseNoInfo 是案件資訊
|
||||||
type CaseNoInfo struct {
|
type CaseNoInfo struct {
|
||||||
|
CaseNo string `json:"case_no"` // 案件編號
|
||||||
|
}
|
||||||
|
|
||||||
|
// CityInfo 是縣市案號資訊
|
||||||
|
type CityInfo struct {
|
||||||
|
CityCode string `json:"city_cd"` // 縣市代碼
|
||||||
|
CaseInfos []CaseInfo `json:"case_info"` // 案件資訊
|
||||||
|
}
|
||||||
|
|
||||||
|
type CaseInfo struct {
|
||||||
CaseNo string `json:"case_no"` // 案件編號
|
CaseNo string `json:"case_no"` // 案件編號
|
||||||
Status string `json:"status,omitempty"` // 核銷狀況
|
Status string `json:"status,omitempty"` // 核銷狀況
|
||||||
DocVer string `json:"doc_ver,omitempty"` // 總表版次
|
DocVer string `json:"doc_ver,omitempty"` // 總表版次
|
||||||
@@ -136,11 +148,10 @@ type AppResultQueryUpload struct {
|
|||||||
|
|
||||||
// AppResultQueryInfo 是查詢輸入資訊
|
// AppResultQueryInfo 是查詢輸入資訊
|
||||||
type AppResultQueryInfo struct {
|
type AppResultQueryInfo struct {
|
||||||
WriteoffYYYYMM string `json:"writeoff_yyyymm"` // 支審年月
|
FeeAuditInfo
|
||||||
TransNo string `json:"trans_no"` // 交易序號
|
QueryType string `json:"query_type"` // 查詢類別
|
||||||
QueryType string `json:"query_type"` // 查詢類別
|
CityCode string `json:"city_cd,omitempty"` // 縣市代碼
|
||||||
CityCode string `json:"city_cd,omitempty"` // 縣市代碼
|
CaseNo string `json:"case_no,omitempty"` // 核銷案號
|
||||||
CaseNo string `json:"case_no,omitempty"` // 核銷案號
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AppResultQueryResult 是 AppResultQuery 的 Response.result
|
// AppResultQueryResult 是 AppResultQuery 的 Response.result
|
||||||
@@ -228,10 +239,9 @@ type AppCancelUpload struct {
|
|||||||
|
|
||||||
// CancelInfo 是服務單位撤回資料
|
// CancelInfo 是服務單位撤回資料
|
||||||
type CancelInfo struct {
|
type CancelInfo struct {
|
||||||
WriteoffYYYYMM string `json:"writeoff_yyyymm"` // 支審年月
|
FeeAuditInfo
|
||||||
CityCode string `json:"city_cd,omitempty"` // 縣市代碼
|
CityCode string `json:"city_cd,omitempty"` // 縣市代碼
|
||||||
CaseNo string `json:"case_no,omitempty"` // 核銷案號
|
CaseNo string `json:"case_no,omitempty"` // 核銷案號
|
||||||
TransNo string `json:"trans_no"` // 交易序號
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CancelResultResponseUpload 是 CancelResultResponse 的傳送資料
|
// CancelResultResponseUpload 是 CancelResultResponse 的傳送資料
|
||||||
@@ -241,7 +251,6 @@ type CancelResultResponseUpload struct {
|
|||||||
|
|
||||||
// CancelResultResponseInfo 是取消交易單結果回報資料
|
// CancelResultResponseInfo 是取消交易單結果回報資料
|
||||||
type CancelResultResponseInfo struct {
|
type CancelResultResponseInfo struct {
|
||||||
WriteoffYYYYMM string `json:"writeoff_yyyymm"` // 支審年月
|
FeeAuditInfo
|
||||||
TransNo string `json:"trans_no"` // 交易序號
|
CancelTransNo string `json:"cancel_trans_no"` // 所要取消結果回報之交易序號
|
||||||
CancelTransNo string `json:"cancel_trans_no"` // 所要取消結果回報之交易序號
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ func (f *FeeAuditUtils) getChecksum(apData string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// httpsPost 用來上傳 WriteoffResponse
|
// httpsPost 用來上傳 WriteoffResponse
|
||||||
func (f *FeeAuditUtils) httpsPost(funcName string, writeoffRequest WriteoffRequest) (writeoffResponse WriteoffResponse, err error) {
|
func (f *FeeAuditUtils) httpsPost(funcName string, writeoffRequest WriteoffRequest) (responseData []byte, err error) {
|
||||||
data, err := json.Marshal(&writeoffRequest)
|
data, err := json.Marshal(&writeoffRequest)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
@@ -108,14 +108,7 @@ func (f *FeeAuditUtils) httpsPost(funcName string, writeoffRequest WriteoffReque
|
|||||||
}
|
}
|
||||||
defer response.Body.Close()
|
defer response.Body.Close()
|
||||||
|
|
||||||
responseData, err := io.ReadAll(response.Body)
|
return io.ReadAll(response.Body)
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
err = json.Unmarshal(responseData, &writeoffResponse)
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewRequest 用來産生 WirteoffRequest
|
// NewRequest 用來産生 WirteoffRequest
|
||||||
@@ -134,57 +127,31 @@ func (f *FeeAuditUtils) NewRequest(data []byte) WriteoffRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SendFeeApply 傳送服務記錄申報
|
// SendFeeApply 傳送服務記錄申報
|
||||||
func (f *FeeAuditUtils) SendFeeApply(writeoffRequest WriteoffRequest) (writeoffResponse WriteoffResponse, feeApplyResult FeeApplyResult, err error) {
|
func (f *FeeAuditUtils) SendFeeApply(writeoffRequest WriteoffRequest) (responseData []byte, err error) {
|
||||||
writeoffResponse, err = f.httpsPost("FeeApply", writeoffRequest)
|
return f.httpsPost("FeeApply", writeoffRequest)
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
resultData, err := base64.StdEncoding.DecodeString(writeoffResponse.Result)
|
|
||||||
|
|
||||||
err = json.Unmarshal(resultData, &feeApplyResult)
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SendObjDel 傳送服務紀錄刪除
|
// SendObjDel 傳送服務紀錄刪除
|
||||||
func (f *FeeAuditUtils) SendObjDel(writeoffRequest WriteoffRequest) (writeoffResponse WriteoffResponse, err error) {
|
func (f *FeeAuditUtils) SendObjDel(writeoffRequest WriteoffRequest) (responseData []byte, err error) {
|
||||||
writeoffResponse, err = f.httpsPost("ObjDel", writeoffRequest)
|
return f.httpsPost("ObjDel", writeoffRequest)
|
||||||
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SendAppCompletionNotice 傳送申報確認通知
|
// SendAppCompletionNotice 傳送申報確認通知
|
||||||
func (f *FeeAuditUtils) SendAppCompletionNotice(writeoffRequest WriteoffRequest) (writeoffResponse WriteoffResponse, err error) {
|
func (f *FeeAuditUtils) SendAppCompletionNotice(writeoffRequest WriteoffRequest) (responseData []byte, err error) {
|
||||||
writeoffResponse, err = f.httpsPost("appCompletionNotice", writeoffRequest)
|
return f.httpsPost("appCompletionNotice", writeoffRequest)
|
||||||
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SendAppResultQuery 傳送「服務單位各分案審核狀態查詢」或「分案審核明細查詢」
|
// SendAppResultQuery 傳送「服務單位各分案審核狀態查詢」或「分案審核明細查詢」
|
||||||
func (f *FeeAuditUtils) SendAppResultQuery(writeoffRequest WriteoffRequest) (writeoffResponse WriteoffResponse, appResultQueryResult AppResultQueryResult, err error) {
|
func (f *FeeAuditUtils) SendAppResultQuery(writeoffRequest WriteoffRequest) (responseData []byte, err error) {
|
||||||
writeoffResponse, err = f.httpsPost("appResultQuery", writeoffRequest)
|
return f.httpsPost("appResultQuery", writeoffRequest)
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
resultData, err := base64.StdEncoding.DecodeString(writeoffResponse.Result)
|
|
||||||
|
|
||||||
err = json.Unmarshal(resultData, &appResultQueryResult)
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SendAppCancel 傳送撤回服務記錄
|
// SendAppCancel 傳送撤回服務記錄
|
||||||
func (f *FeeAuditUtils) SendAppCancel(writeoffRequest WriteoffRequest) (writeoffResponse WriteoffResponse, err error) {
|
func (f *FeeAuditUtils) SendAppCancel(writeoffRequest WriteoffRequest) (responseData []byte, err error) {
|
||||||
writeoffResponse, err = f.httpsPost("appCancel", writeoffRequest)
|
return f.httpsPost("appCancel", writeoffRequest)
|
||||||
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SendCancelResultResponse 傳送取消交易單處理結果回報
|
// SendCancelResultResponse 傳送取消交易單處理結果回報
|
||||||
func (f *FeeAuditUtils) SendCancelResultResponse(writeoffRequest WriteoffRequest) (writeoffResponse WriteoffResponse, err error) {
|
func (f *FeeAuditUtils) SendCancelResultResponse(writeoffRequest WriteoffRequest) (responseData []byte, err error) {
|
||||||
writeoffResponse, err = f.httpsPost("CancelResultResponse", writeoffRequest)
|
return f.httpsPost("CancelResultResponse", writeoffRequest)
|
||||||
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user