作者 tangxuhui

数据结构调整

... ... @@ -12,7 +12,7 @@ type MoneyIncentivesItem struct {
type DividendsEstimateDividendItem struct {
CooperationContractNumber string `json:"cooperationContractNumber"` //共创合约编号
CustomerName string `json:"customerName"` //客户名称
DividendsIncentivesAmount int `json:"dividendsIncentivesAmount"` //业绩激励分红金额
DividendsIncentivesAmount float64 `json:"dividendsIncentivesAmount"` //业绩激励分红金额
OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"` //分红订单号或退货单号
OrderTime int64 `json:"orderTime"` //订单/退货单日期
OriginalOrderNum string `json:"originalOrderNum"` //来源单号,源单号,订单号
... ... @@ -21,15 +21,15 @@ type DividendsEstimateDividendItem struct {
func ToDividendsEstimateDividendItem(param *allied_creation_cooperation.DataDividendsEstimateSearchDividend) []DividendsEstimateDividendItem {
var listdata []DividendsEstimateDividendItem
for _, v := range param.Grid.List {
for _, v := range param.List {
item := DividendsEstimateDividendItem{
CooperationContractNumber: v.CooperationContractNumber,
CustomerName: v.CustomerName,
DividendsIncentivesAmount: v.DividendsIncentivesAmount,
OrderOrReturnedOrderNum: v.OrderOrReturnedOrderNum,
OrderTime: v.OrderTime.Unix(),
DividendsIncentivesAmount: v.OrderAmount,
OrderOrReturnedOrderNum: v.OrderNumber,
OrderTime: v.OrderDate.UnixNano() / 1e6,
OriginalOrderNum: v.OriginalOrderNum,
RegionName: v.Region.RegionName,
RegionName: v.RegionName,
}
listdata = append(listdata, item)
}
... ...
... ... @@ -85,7 +85,7 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncenti
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
listdata := dto.ToDividendsEstimateDividendItem(result)
return result.Grid.Total, listdata, nil
return result.Total, listdata, nil
}
// 查询金额激励分红
... ...
... ... @@ -52,13 +52,8 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) GetDividends
// 移除分红退货单服务
func (dividendsReturnedOrderService *DividendsReturnedOrderService) RemoveDividendsReturnedOrder(removeDividendsReturnedOrderCommand *command.RemoveDividendsReturnedOrderCommand) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(removeDividendsReturnedOrderCommand.Operator)
ids := []int{}
for _, v := range removeDividendsReturnedOrderCommand.DividendsReturnedOrderID {
id, _ := strconv.Atoi(v)
ids = append(ids, id)
}
_, err := creationCooperationGateway.DividendsReturnedOrderBatchRemove(allied_creation_cooperation.ReqDividendsReturnedOrderBatchRemove{
DividendsReturnedOrderIDs: ids,
DividendsReturnedOrderIDs: removeDividendsReturnedOrderCommand.DividendsReturnedOrderID,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ...
... ... @@ -12,21 +12,25 @@ type (
}
DataDividendsEstimateSearchDividend struct {
Grid struct {
Total int `json:"total"`
List []struct {
CooperationContractNumber string `json:"cooperationContractNumber"` //共创合约编号
CustomerName string `json:"customerName"` //客户名称
DividendsIncentivesAmount int `json:"dividendsIncentivesAmount"` //业绩激励分红金额
OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"` //分红订单号或退货单号
OrderTime time.Time `json:"orderTime"` //订单/退货单日期
OriginalOrderNum string `json:"originalOrderNum"` //来源单号,源单号,订单号
Region struct {
RegionName string `json:"regionName"` //区域名称
RegionNumber string `json:"regionNumber"` //区域编码
} `json:"region"`
// 分红订单产品ID
OrderGoodId int64 `json:"orderGoodId,string"`
// 共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 分红订单号或退货单号、
OrderNumber string `json:"orderNumber"`
// 来源单号
OriginalOrderNum string `json:"originalOrderNum"`
// 客户名称
CustomerName string `json:"customerName"`
// 订单区域
RegionName string `json:"region"`
// 订单金额
OrderAmount float64 `json:"orderAmount"`
// 订单/退货单日期
OrderDate time.Time `json:"-"` //TODO 等待数据调整
} `json:"list"`
} `json:"grid"`
}
)
... ...
... ... @@ -116,7 +116,7 @@ type (
//批量移除分红退货单
type (
ReqDividendsReturnedOrderBatchRemove struct {
DividendsReturnedOrderIDs []int `json:"dividendsReturnedOrderIds"` //分红退货单记录id
DividendsReturnedOrderIDs []string `json:"dividendsReturnedOrderIds"` //分红退货单记录id
}
DataDividendsReturnedOrderBatchRemove struct {
... ...