作者 tangxuhui

数据结构调整

@@ -12,7 +12,7 @@ type MoneyIncentivesItem struct { @@ -12,7 +12,7 @@ type MoneyIncentivesItem struct {
12 type DividendsEstimateDividendItem struct { 12 type DividendsEstimateDividendItem struct {
13 CooperationContractNumber string `json:"cooperationContractNumber"` //共创合约编号 13 CooperationContractNumber string `json:"cooperationContractNumber"` //共创合约编号
14 CustomerName string `json:"customerName"` //客户名称 14 CustomerName string `json:"customerName"` //客户名称
15 - DividendsIncentivesAmount int `json:"dividendsIncentivesAmount"` //业绩激励分红金额 15 + DividendsIncentivesAmount float64 `json:"dividendsIncentivesAmount"` //业绩激励分红金额
16 OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"` //分红订单号或退货单号 16 OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"` //分红订单号或退货单号
17 OrderTime int64 `json:"orderTime"` //订单/退货单日期 17 OrderTime int64 `json:"orderTime"` //订单/退货单日期
18 OriginalOrderNum string `json:"originalOrderNum"` //来源单号,源单号,订单号 18 OriginalOrderNum string `json:"originalOrderNum"` //来源单号,源单号,订单号
@@ -21,15 +21,15 @@ type DividendsEstimateDividendItem struct { @@ -21,15 +21,15 @@ type DividendsEstimateDividendItem struct {
21 21
22 func ToDividendsEstimateDividendItem(param *allied_creation_cooperation.DataDividendsEstimateSearchDividend) []DividendsEstimateDividendItem { 22 func ToDividendsEstimateDividendItem(param *allied_creation_cooperation.DataDividendsEstimateSearchDividend) []DividendsEstimateDividendItem {
23 var listdata []DividendsEstimateDividendItem 23 var listdata []DividendsEstimateDividendItem
24 - for _, v := range param.Grid.List { 24 + for _, v := range param.List {
25 item := DividendsEstimateDividendItem{ 25 item := DividendsEstimateDividendItem{
26 CooperationContractNumber: v.CooperationContractNumber, 26 CooperationContractNumber: v.CooperationContractNumber,
27 CustomerName: v.CustomerName, 27 CustomerName: v.CustomerName,
28 - DividendsIncentivesAmount: v.DividendsIncentivesAmount,  
29 - OrderOrReturnedOrderNum: v.OrderOrReturnedOrderNum,  
30 - OrderTime: v.OrderTime.Unix(), 28 + DividendsIncentivesAmount: v.OrderAmount,
  29 + OrderOrReturnedOrderNum: v.OrderNumber,
  30 + OrderTime: v.OrderDate.UnixNano() / 1e6,
31 OriginalOrderNum: v.OriginalOrderNum, 31 OriginalOrderNum: v.OriginalOrderNum,
32 - RegionName: v.Region.RegionName, 32 + RegionName: v.RegionName,
33 } 33 }
34 listdata = append(listdata, item) 34 listdata = append(listdata, item)
35 } 35 }
@@ -85,7 +85,7 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncenti @@ -85,7 +85,7 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncenti
85 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 85 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
86 } 86 }
87 listdata := dto.ToDividendsEstimateDividendItem(result) 87 listdata := dto.ToDividendsEstimateDividendItem(result)
88 - return result.Grid.Total, listdata, nil 88 + return result.Total, listdata, nil
89 } 89 }
90 90
91 // 查询金额激励分红 91 // 查询金额激励分红
@@ -52,13 +52,8 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) GetDividends @@ -52,13 +52,8 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) GetDividends
52 // 移除分红退货单服务 52 // 移除分红退货单服务
53 func (dividendsReturnedOrderService *DividendsReturnedOrderService) RemoveDividendsReturnedOrder(removeDividendsReturnedOrderCommand *command.RemoveDividendsReturnedOrderCommand) (interface{}, error) { 53 func (dividendsReturnedOrderService *DividendsReturnedOrderService) RemoveDividendsReturnedOrder(removeDividendsReturnedOrderCommand *command.RemoveDividendsReturnedOrderCommand) (interface{}, error) {
54 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(removeDividendsReturnedOrderCommand.Operator) 54 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(removeDividendsReturnedOrderCommand.Operator)
55 - ids := []int{}  
56 - for _, v := range removeDividendsReturnedOrderCommand.DividendsReturnedOrderID {  
57 - id, _ := strconv.Atoi(v)  
58 - ids = append(ids, id)  
59 - }  
60 _, err := creationCooperationGateway.DividendsReturnedOrderBatchRemove(allied_creation_cooperation.ReqDividendsReturnedOrderBatchRemove{ 55 _, err := creationCooperationGateway.DividendsReturnedOrderBatchRemove(allied_creation_cooperation.ReqDividendsReturnedOrderBatchRemove{
61 - DividendsReturnedOrderIDs: ids, 56 + DividendsReturnedOrderIDs: removeDividendsReturnedOrderCommand.DividendsReturnedOrderID,
62 }) 57 })
63 if err != nil { 58 if err != nil {
64 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 59 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
@@ -12,21 +12,25 @@ type ( @@ -12,21 +12,25 @@ type (
12 } 12 }
13 13
14 DataDividendsEstimateSearchDividend struct { 14 DataDividendsEstimateSearchDividend struct {
15 - Grid struct {  
16 Total int `json:"total"` 15 Total int `json:"total"`
17 List []struct { 16 List []struct {
18 - CooperationContractNumber string `json:"cooperationContractNumber"` //共创合约编号  
19 - CustomerName string `json:"customerName"` //客户名称  
20 - DividendsIncentivesAmount int `json:"dividendsIncentivesAmount"` //业绩激励分红金额  
21 - OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"` //分红订单号或退货单号  
22 - OrderTime time.Time `json:"orderTime"` //订单/退货单日期  
23 - OriginalOrderNum string `json:"originalOrderNum"` //来源单号,源单号,订单号  
24 - Region struct {  
25 - RegionName string `json:"regionName"` //区域名称  
26 - RegionNumber string `json:"regionNumber"` //区域编码  
27 - } `json:"region"` 17 + // 分红订单产品ID
  18 + OrderGoodId int64 `json:"orderGoodId,string"`
  19 + // 共创合约编号
  20 + CooperationContractNumber string `json:"cooperationContractNumber"`
  21 + // 分红订单号或退货单号、
  22 + OrderNumber string `json:"orderNumber"`
  23 + // 来源单号
  24 + OriginalOrderNum string `json:"originalOrderNum"`
  25 + // 客户名称
  26 + CustomerName string `json:"customerName"`
  27 + // 订单区域
  28 + RegionName string `json:"region"`
  29 + // 订单金额
  30 + OrderAmount float64 `json:"orderAmount"`
  31 + // 订单/退货单日期
  32 + OrderDate time.Time `json:"-"` //TODO 等待数据调整
28 } `json:"list"` 33 } `json:"list"`
29 - } `json:"grid"`  
30 } 34 }
31 ) 35 )
32 36
@@ -116,7 +116,7 @@ type ( @@ -116,7 +116,7 @@ type (
116 //批量移除分红退货单 116 //批量移除分红退货单
117 type ( 117 type (
118 ReqDividendsReturnedOrderBatchRemove struct { 118 ReqDividendsReturnedOrderBatchRemove struct {
119 - DividendsReturnedOrderIDs []int `json:"dividendsReturnedOrderIds"` //分红退货单记录id 119 + DividendsReturnedOrderIDs []string `json:"dividendsReturnedOrderIds"` //分红退货单记录id
120 } 120 }
121 121
122 DataDividendsReturnedOrderBatchRemove struct { 122 DataDividendsReturnedOrderBatchRemove struct {