...
|
...
|
@@ -37,11 +37,11 @@ func (c *DividendsController) Prepare() { |
|
|
func (c *DividendsController) Edit() {
|
|
|
//用与适配前端定义的数据结构
|
|
|
type DividendPaymentItem struct {
|
|
|
PaymentForGoods string `json:"paymentForGoods"`
|
|
|
StateOfPayment string `json:"stateOfPayment"`
|
|
|
PaymentForGoods float64 `json:"paymentForGoods"`
|
|
|
StateOfPayment int `json:"stateOfPayment"`
|
|
|
}
|
|
|
type Parameter struct {
|
|
|
Id int64 `json:"id"` //订单编号
|
|
|
Id string `json:"id"` //订单编号
|
|
|
DividendPayment []DividendPaymentItem `json:"dividendPayment"`
|
|
|
}
|
|
|
var (
|
...
|
...
|
@@ -53,8 +53,13 @@ func (c *DividendsController) Edit() { |
|
|
c.ResponseError(errors.New("json数据解析失败"))
|
|
|
return
|
|
|
}
|
|
|
if len(param.Id) == 0 {
|
|
|
c.ResponseError(errors.New("id is empty"))
|
|
|
return
|
|
|
}
|
|
|
orderId, _ := strconv.ParseInt(param.Id, 10, 64)
|
|
|
cmd := OrderPaymentCmd.CreateOrderPaymentCommand{
|
|
|
OrderId: param.Id,
|
|
|
OrderId: orderId,
|
|
|
DivdendPaymentItem: make([]OrderPaymentCmd.DivdendPyamentItem, 0),
|
|
|
}
|
|
|
|
...
|
...
|
@@ -62,8 +67,8 @@ func (c *DividendsController) Edit() { |
|
|
for i := range param.DividendPayment {
|
|
|
item := param.DividendPayment[i]
|
|
|
paymentItem := OrderPaymentCmd.DivdendPyamentItem{}
|
|
|
paymentItem.PaymentForGoods, _ = strconv.ParseFloat(item.PaymentForGoods, 64)
|
|
|
paymentItem.StateOfPayment, _ = strconv.Atoi(item.StateOfPayment)
|
|
|
paymentItem.PaymentForGoods = item.PaymentForGoods
|
|
|
paymentItem.StateOfPayment = item.StateOfPayment
|
|
|
paymentItem.PaymentSn = i + 1
|
|
|
|
|
|
if paymentItem.StateOfPayment == domain.BonusPaid {
|
...
|
...
|
|