Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 10c8754732 | |||
| cd8bbde1af | |||
| 36885d23ce |
@@ -26,12 +26,12 @@ type FeeApplyUpload struct {
|
|||||||
|
|
||||||
// ApplyInfo 是 FeeApplyUpload 的單筆資料
|
// ApplyInfo 是 FeeApplyUpload 的單筆資料
|
||||||
type ApplyInfo struct {
|
type ApplyInfo struct {
|
||||||
WriteoffYYYYMM string `json:"writeoff_yyyymm"` // 支審年月
|
WriteoffYYYYMM string `json:"writeoff_yyyymm"` // 支審年月
|
||||||
TransNo string `json:"trans_no"` // 交易序號
|
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"` // 申請個案數
|
||||||
CaseSvceRecords []CaseSvceRecord `json:"case_svc_records"` // 個案服務記錄
|
CaseSvcRecords []CaseSvcRecord `json:"case_svc_records"` // 個案服務記錄
|
||||||
}
|
}
|
||||||
|
|
||||||
// CaseSvcRecord 是個案服務記錄
|
// CaseSvcRecord 是個案服務記錄
|
||||||
@@ -97,10 +97,10 @@ type ObjDelUpload struct {
|
|||||||
|
|
||||||
// SvcDelInfo 是刪除資料
|
// SvcDelInfo 是刪除資料
|
||||||
type SvcDelInfo struct {
|
type SvcDelInfo struct {
|
||||||
WriteoffYYYYMM string `json:"writeoff_yyyymm"` // 支審年月
|
WriteoffYYYYMM string `json:"writeoff_yyyymm"` // 支審年月
|
||||||
TransNo string `json:"trans_no"` // 交易序號
|
TransNo string `json:"trans_no"` // 交易序號
|
||||||
Records int `json:"records"` // 服務記錄筆數
|
Records int `json:"records"` // 服務記錄筆數
|
||||||
CaseSvceRecords []CaseSvceRecord `json:"case_svc_records"` // 個案服務記錄
|
CaseSvcRecords []CaseSvcRecord `json:"case_svc_records"` // 個案服務記錄
|
||||||
}
|
}
|
||||||
|
|
||||||
// AppCompletionNoticeUpload 是 AppCompletionNotice 的傳送資料
|
// AppCompletionNoticeUpload 是 AppCompletionNotice 的傳送資料
|
||||||
|
|||||||
@@ -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,62 +127,31 @@ func (f *FeeAuditUtils) NewRequest(data []byte) WriteoffRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SendFeeApply 傳送服務記錄申報
|
// SendFeeApply 傳送服務記錄申報
|
||||||
func (f *FeeAuditUtils) SendFeeApply(writeoffRequest WriteoffRequest) (feeApplyResult FeeApplyResult, err error) {
|
func (f *FeeAuditUtils) SendFeeApply(writeoffRequest WriteoffRequest) (responseData []byte, err error) {
|
||||||
//uploadData, err := json.Marshal(&feeApply)
|
return f.httpsPost("FeeApply", writeoffRequest)
|
||||||
//if err != nil {
|
|
||||||
// return
|
|
||||||
//}
|
|
||||||
|
|
||||||
writeoffResponse, err := 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) (err error) {
|
func (f *FeeAuditUtils) SendObjDel(writeoffRequest WriteoffRequest) (responseData []byte, err error) {
|
||||||
_, err = f.httpsPost("ObjDel", writeoffRequest)
|
return f.httpsPost("ObjDel", writeoffRequest)
|
||||||
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SendAppCompletionNotice 傳送申報確認通知
|
// SendAppCompletionNotice 傳送申報確認通知
|
||||||
func (f *FeeAuditUtils) SendAppCompletionNotice(writeoffRequest WriteoffRequest) (err error) {
|
func (f *FeeAuditUtils) SendAppCompletionNotice(writeoffRequest WriteoffRequest) (responseData []byte, err error) {
|
||||||
_, err = f.httpsPost("appCompletionNotice", writeoffRequest)
|
return f.httpsPost("appCompletionNotice", writeoffRequest)
|
||||||
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SendAppResultQuery 傳送「服務單位各分案審核狀態查詢」或「分案審核明細查詢」
|
// SendAppResultQuery 傳送「服務單位各分案審核狀態查詢」或「分案審核明細查詢」
|
||||||
func (f *FeeAuditUtils) SendAppResultQuery(writeoffRequest WriteoffRequest) (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) (err error) {
|
func (f *FeeAuditUtils) SendAppCancel(writeoffRequest WriteoffRequest) (responseData []byte, err error) {
|
||||||
_, err = f.httpsPost("appCancel", writeoffRequest)
|
return f.httpsPost("appCancel", writeoffRequest)
|
||||||
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SendCancelResultResponse 傳送取消交易單處理結果回報
|
// SendCancelResultResponse 傳送取消交易單處理結果回報
|
||||||
func (f *FeeAuditUtils) SendCancelResultResponse(writeoffRequest WriteoffRequest) (err error) {
|
func (f *FeeAuditUtils) SendCancelResultResponse(writeoffRequest WriteoffRequest) (responseData []byte, err error) {
|
||||||
_, err = f.httpsPost("CancelResultResponse", writeoffRequest)
|
return f.httpsPost("CancelResultResponse", writeoffRequest)
|
||||||
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user