update_dividends_order.go
2.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package command
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
type UpdateDividendsOrderCommand struct {
//操作人
Operator domain.Operator `json:"-"`
//分红订单
DividendsOrderID int `json:"dividendsOrderId"`
//客户名称
CustomerName string `json:"customerName"`
//分红订单金额
DividendsOrderAmount float64 `json:"dividendsOrderAmount"`
//分红订单原单号
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"`
//订单产生时间 时间戳 毫秒
OrderTime int64 `json:"orderTime" `
//备注
Remarks string `json:"remarks"`
//区域名称
RegionName string `json:"regionName"`
//订单产品列表
OrderGoods []struct {
CooperationContractNumber string `json:"cooperationContractNumber"` //关联的共创合约编号
DividendsOrderNumber string `json:"dividendsOrderNumber"` //关联分红订单号
// OrderGoodAmount float64 `json:"orderGoodAmount"` //订单产品金额
OrderGoodExpense float64 `json:"orderGoodExpense"` //订单产品费用
OrderGoodName string `json:"orderGoodName"` //订单产品名称
OrderGoodPrice float64 `json:"orderGoodPrice"` //订单产品单价
OrderGoodQuantity int `json:"orderGoodQuantity"` //订单产品数量
} `json:"orderGoods"`
}
// func (updateDividendsOrderCommand *UpdateDividendsOrderCommand) Valid(validation *validation.Validation) {
// // 162 92522 89000
// orderTimeStr := strconv.Itoa(int(updateDividendsOrderCommand.OrderTime))
// orderTimeStrRune := []rune(orderTimeStr)
// if len(orderTimeStrRune) != 13 {
// validation.AddError("订单产生时间", "格式错误")
// }
// }
// func (updateDividendsOrderCommand *UpdateDividendsOrderCommand) ValidateCommand() error {
// valid := validation.Validation{}
// b, err := valid.Valid(updateDividendsOrderCommand)
// if err != nil {
// return err
// }
// if !b {
// for _, validErr := range valid.Errors {
// return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
// }
// }
// return nil
// }