作者 Your Name

数据结构调整

@@ -11,23 +11,15 @@ import ( @@ -11,23 +11,15 @@ import (
11 11
12 //ReqImportDividendsReturnedOrder 导入退货数据 12 //ReqImportDividendsReturnedOrder 导入退货数据
13 type ( 13 type (
14 - ImportDividendsReturnedOrderGood struct {  
15 - OrderGoodAmount float64 `json:"orderGoodAmount"` // 订单产品金额  
16 - OrderGoodName string `json:"orderGoodName"` // 订单产品名称  
17 - OrderGoodPrice float64 `json:"orderGoodPrice"` // 订单产品单价  
18 - OrderGoodQuantity int64 `json:"orderGoodQuantity"` // 订单产品数量  
19 - DividendsOrderNumber int64 `json:"dividendsOrderNumber"` // 关联分红订单号  
20 - CooperationContractNumber string `json:"cooperationContractNumber"` // 关联的共创合约编号  
21 - OrderGoodExpense float64 `json:"orderGoodExpense"` // 订单产品费用  
22 - }  
23 ImportDividendsReturnedOrderData struct { 14 ImportDividendsReturnedOrderData struct {
24 - DividendsReturnedOrderRefund float64 `json:"dividendsReturnedOrderRefund"` // 退货金额  
25 DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` //退货客户名称 15 DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` //退货客户名称
26 - OriginalOrderNum string `json:"originalOrderNum"` // 来源单号,源单号,订单号 16 + OriginalOrderNum string `json:"originalOrderNum"` //来源单号,源单号,订单号
  17 + OrderGoodName string `json:"orderGoodName"` //订单产品名称
27 DividendsReturnedDate time.Time `json:"dividendsReturnedDate"` //退货日期 18 DividendsReturnedDate time.Time `json:"dividendsReturnedDate"` //退货日期
28 - RegionName string `json:"regionName"` // 退货区域名称  
29 - OrderGoods []*ImportDividendsReturnedOrderGood `json:"orderGoods"` // 订单产品列表  
30 - Remarks string `json:"remarks"` // 备注 19 + RegionName string `json:"regionName"` //退货区域名称
  20 + OrderGoodPrice float64 `json:"orderGoodPrice"` //订单产品单价
  21 + OrderGoodQuantity int64 `json:"orderGoodQuantity"` //订单产品数量
  22 + CooperationContractNumber string `json:"cooperationContractNumber"` //合约编号
31 } 23 }
32 //请求参数 24 //请求参数
33 ReqImportDividendsReturnedOrder struct { 25 ReqImportDividendsReturnedOrder struct {
@@ -36,6 +28,13 @@ type ( @@ -36,6 +28,13 @@ type (
36 } 28 }
37 //响应参数 29 //响应参数
38 DataImportDividendsReturnedOrder struct { 30 DataImportDividendsReturnedOrder struct {
  31 + SuccessCount int
  32 + Fail struct {
  33 + Header struct {
  34 + }
  35 + Body []struct {
  36 + }
  37 + }
39 } 38 }
40 ) 39 )
41 40
@@ -51,20 +50,20 @@ func (gateway HttplibAlliedCreationCooperation) ImportDividendsReturnedOrder(par @@ -51,20 +50,20 @@ func (gateway HttplibAlliedCreationCooperation) ImportDividendsReturnedOrder(par
51 }) 50 })
52 req, err := req.JSONBody(param) 51 req, err := req.JSONBody(param)
53 if err != nil { 52 if err != nil {
54 - return nil, fmt.Errorf("请求查询业绩分红失败:%w", err) 53 + return nil, fmt.Errorf("请求导入退货数据失败:%w", err)
55 } 54 }
56 55
57 byteResult, err := req.Bytes() 56 byteResult, err := req.Bytes()
58 if err != nil { 57 if err != nil {
59 - return nil, fmt.Errorf("获取查询业绩分红失败:%w", err) 58 + return nil, fmt.Errorf("获取导入退货数据失败:%w", err)
60 } 59 }
61 - log.Logger.Debug("获取业务模块请求数据:查询业绩分红。", map[string]interface{}{ 60 + log.Logger.Debug("获取业务模块请求数据:导入退货数据。", map[string]interface{}{
62 "result": string(byteResult), 61 "result": string(byteResult),
63 }) 62 })
64 var result service_gateway.GatewayResponse 63 var result service_gateway.GatewayResponse
65 err = json.Unmarshal(byteResult, &result) 64 err = json.Unmarshal(byteResult, &result)
66 if err != nil { 65 if err != nil {
67 - return nil, fmt.Errorf("解析查询业绩分红:%w", err) 66 + return nil, fmt.Errorf("解析导入退货数据:%w", err)
68 } 67 }
69 var data DataDividendsEstimateSearchDividend 68 var data DataDividendsEstimateSearchDividend
70 err = gateway.GetResponseData(result, &data) 69 err = gateway.GetResponseData(result, &data)