作者 tangxuhui

退货单数据结构适配

... ... @@ -4,9 +4,6 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
type DividendsReturnedOrderItem struct {
}
type DividendsReturnedOrderInfo struct {
// 公司
Company struct {
... ... @@ -23,7 +20,6 @@ type DividendsReturnedOrderInfo struct {
DividendsReturnedOrderID string `json:"dividendsReturnedOrderId"` //分红退货单记录id
DividendsReturnedOrderNumber string `json:"dividendsReturnedOrderNumber"` //分红退货单号
DividendsReturnedOrderRefund float64 `json:"dividendsReturnedOrderRefund"` //退货金额
OperateTime string `json:"operateTime"` //操作时间
OriginalOrderNum string `json:"originalOrderNum"` //源单号(原始订单号)
Remarks string `json:"remarks"` //备注
//更新时间
... ... @@ -41,14 +37,21 @@ type DividendsReturnedOrderInfo struct {
func ToDividendsReturnedOrderInfo(param *allied_creation_cooperation.DividendsReturnedOrder) *DividendsReturnedOrderInfo {
data := DividendsReturnedOrderInfo{
Goods: param.Goods,
Org: param.Org,
Region: param.Region,
Company: param.Company,
CreatedAt: param.CreatedAt.Unix(),
DividendStatus: param.DividendStatus,
DividendTime: param.DividendTime.Unix(),
DividendsOrderNumber: param.DividendsOrderNumber,
Goods: param.Goods,
Org: param.Org,
Region: param.Region,
Company: param.Company,
CreatedAt: param.CreatedAt.Unix(),
DividendStatus: param.DividendStatus,
DividendTime: param.DividendTime.Unix(),
DividendsOrderNumber: param.DividendsOrderNumber,
DividendsReturnedCustomerName: param.DividendsReturnedCustomerName,
DividendsReturnedDate: param.DividendsReturnedDate.Unix(),
DividendsReturnedOrderID: param.DividendsReturnedOrderID,
DividendsReturnedOrderNumber: param.DividendsReturnedOrderNumber,
DividendsReturnedOrderRefund: param.DividendsReturnedOrderRefund,
OriginalOrderNum: param.OriginalOrderNum,
Remarks: param.Remarks,
}
return &data
}
... ...
... ... @@ -5,6 +5,7 @@ import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/dto"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
... ... @@ -33,7 +34,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) GetDividends
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return result, nil
return dto.ToDividendsReturnedOrderInfo(&result.DividendsReturnedOrder), nil
}
// 移除分红退货单服务
... ... @@ -65,7 +66,12 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) SearchDivide
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return result.Total, result.List, nil
dataList := []dto.DividendsReturnedOrderInfo{}
for i := range result.List {
item := dto.ToDividendsReturnedOrderInfo(&result.List[i])
dataList = append(dataList, *item)
}
return result.Total, dataList, nil
}
// 更新分红退货单服务
... ...