作者 tangxuhui

退货单数据结构适配

@@ -4,9 +4,6 @@ import ( @@ -4,9 +4,6 @@ import (
4 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation" 4 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
5 ) 5 )
6 6
7 -type DividendsReturnedOrderItem struct {  
8 -}  
9 -  
10 type DividendsReturnedOrderInfo struct { 7 type DividendsReturnedOrderInfo struct {
11 // 公司 8 // 公司
12 Company struct { 9 Company struct {
@@ -23,7 +20,6 @@ type DividendsReturnedOrderInfo struct { @@ -23,7 +20,6 @@ type DividendsReturnedOrderInfo struct {
23 DividendsReturnedOrderID string `json:"dividendsReturnedOrderId"` //分红退货单记录id 20 DividendsReturnedOrderID string `json:"dividendsReturnedOrderId"` //分红退货单记录id
24 DividendsReturnedOrderNumber string `json:"dividendsReturnedOrderNumber"` //分红退货单号 21 DividendsReturnedOrderNumber string `json:"dividendsReturnedOrderNumber"` //分红退货单号
25 DividendsReturnedOrderRefund float64 `json:"dividendsReturnedOrderRefund"` //退货金额 22 DividendsReturnedOrderRefund float64 `json:"dividendsReturnedOrderRefund"` //退货金额
26 - OperateTime string `json:"operateTime"` //操作时间  
27 OriginalOrderNum string `json:"originalOrderNum"` //源单号(原始订单号) 23 OriginalOrderNum string `json:"originalOrderNum"` //源单号(原始订单号)
28 Remarks string `json:"remarks"` //备注 24 Remarks string `json:"remarks"` //备注
29 //更新时间 25 //更新时间
@@ -41,14 +37,21 @@ type DividendsReturnedOrderInfo struct { @@ -41,14 +37,21 @@ type DividendsReturnedOrderInfo struct {
41 37
42 func ToDividendsReturnedOrderInfo(param *allied_creation_cooperation.DividendsReturnedOrder) *DividendsReturnedOrderInfo { 38 func ToDividendsReturnedOrderInfo(param *allied_creation_cooperation.DividendsReturnedOrder) *DividendsReturnedOrderInfo {
43 data := DividendsReturnedOrderInfo{ 39 data := DividendsReturnedOrderInfo{
44 - Goods: param.Goods,  
45 - Org: param.Org,  
46 - Region: param.Region,  
47 - Company: param.Company,  
48 - CreatedAt: param.CreatedAt.Unix(),  
49 - DividendStatus: param.DividendStatus,  
50 - DividendTime: param.DividendTime.Unix(),  
51 - DividendsOrderNumber: param.DividendsOrderNumber, 40 + Goods: param.Goods,
  41 + Org: param.Org,
  42 + Region: param.Region,
  43 + Company: param.Company,
  44 + CreatedAt: param.CreatedAt.Unix(),
  45 + DividendStatus: param.DividendStatus,
  46 + DividendTime: param.DividendTime.Unix(),
  47 + DividendsOrderNumber: param.DividendsOrderNumber,
  48 + DividendsReturnedCustomerName: param.DividendsReturnedCustomerName,
  49 + DividendsReturnedDate: param.DividendsReturnedDate.Unix(),
  50 + DividendsReturnedOrderID: param.DividendsReturnedOrderID,
  51 + DividendsReturnedOrderNumber: param.DividendsReturnedOrderNumber,
  52 + DividendsReturnedOrderRefund: param.DividendsReturnedOrderRefund,
  53 + OriginalOrderNum: param.OriginalOrderNum,
  54 + Remarks: param.Remarks,
52 } 55 }
53 return &data 56 return &data
54 } 57 }
@@ -5,6 +5,7 @@ import ( @@ -5,6 +5,7 @@ import (
5 5
6 "github.com/linmadan/egglib-go/core/application" 6 "github.com/linmadan/egglib-go/core/application"
7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/command" 7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/command"
  8 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/dto"
8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/query" 9 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/query"
9 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation" 10 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
10 ) 11 )
@@ -33,7 +34,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) GetDividends @@ -33,7 +34,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) GetDividends
33 if err != nil { 34 if err != nil {
34 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 35 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
35 } 36 }
36 - return result, nil 37 + return dto.ToDividendsReturnedOrderInfo(&result.DividendsReturnedOrder), nil
37 } 38 }
38 39
39 // 移除分红退货单服务 40 // 移除分红退货单服务
@@ -65,7 +66,12 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) SearchDivide @@ -65,7 +66,12 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) SearchDivide
65 if err != nil { 66 if err != nil {
66 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 67 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
67 } 68 }
68 - return result.Total, result.List, nil 69 + dataList := []dto.DividendsReturnedOrderInfo{}
  70 + for i := range result.List {
  71 + item := dto.ToDividendsReturnedOrderInfo(&result.List[i])
  72 + dataList = append(dataList, *item)
  73 + }
  74 + return result.Total, dataList, nil
69 } 75 }
70 76
71 // 更新分红退货单服务 77 // 更新分红退货单服务