This commit is contained in:
suyl
2021-08-02 11:13:10 +08:00
parent e6ea1adef7
commit 6f5644325d
12 changed files with 151 additions and 17 deletions

View File

@@ -48,3 +48,17 @@ func (a *API) CheckAfsBill(orderId string) (checkAfsBillResult []*CheckAfsBillRe
}
return checkAfsBillResult, nil
}
// 分页查询结算单
// http://opendj.jd.com/staticnew/widgets/resources.html?groupid=182&apiid=3c6214051ba04226afc021d7b86f83f9
func (a *API) GetSettleOrderList(orderId string) (checkAfsBillResult []*CheckAfsBillResult, err error) {
jdParams := map[string]interface{}{
"finishTimeStart": "20210722",
"finishTimeEnd": "20210723",
}
result, err := a.AccessAPINoPage("settle/getSettleOrderList", jdParams, nil, nil, genNoPageResultParser("code", "msg", "result", "200"))
if err == nil {
utils.Map2StructByJson(result, &checkAfsBillResult, false)
}
return checkAfsBillResult, nil
}

View File

@@ -21,3 +21,11 @@ func TestCheckAfsBill(t *testing.T) {
}
t.Log(utils.Format4Output(bussResult, false))
}
func TestGetSettleOrderList(t *testing.T) {
bussResult, bussErr := api.GetSettleOrderList("2114753262000162")
if bussErr != nil {
t.Error(bussErr.Error())
}
t.Log(utils.Format4Output(bussResult, false))
}

View File

@@ -23,7 +23,7 @@ func init() {
// sandbox
// api = New("594ab45a-9a73-4a43-82b0-a64cbd55d883", "06692746f7224695ad4788ce340bc854", "d6b42a35a7414a5490d811654d745c84")
// prod
api = New("1c14b86e-54f0-4048-9062-c6aed5438578", "1dba76d40cac446ca500c0391a0b6c9d", "a88d031a1e7b462cb1579f12e97fe7f4")
api = New("b08beee9-6bfe-4efd-b058-3ec2fa16030f", "5d86da1b55ee4c9281007ca741de494d", "287d6a8172a645468256e18a0b72d719")
// 天天果园
//api = New("c45e6510-00ba-4be2-977e-bcb9c9792cc7", "5d5577a2506f41b8b4ec520ba83490f5", "0b01b9eeb15b41dab1c3d05d95c17a26")

View File

@@ -388,11 +388,12 @@ func (a *API) OrderQuery(jdParams map[string]interface{}) (retVal []interface{},
for i := 0; i < QueryOrderRetryCount; i++ {
retVal, totalCount, err = a.AccessAPIHavePage("order/es/query", jdParams, nil, nil, nil)
if err != nil {
if err2, ok := err.(*utils.ErrorWithCode); ok {
if err2.IntCode() == -4 {
continue
}
}
//if err2, ok := err.(*utils.ErrorWithCode); ok {
// if err2.IntCode() == -4 {
// continue
// }
//}
return retVal, totalCount, err
}
break
}