正在显示
5 个修改的文件
包含
15 行增加
和
3 行删除
| @@ -28,6 +28,8 @@ type UpdateOrderRealCommand struct { | @@ -28,6 +28,8 @@ type UpdateOrderRealCommand struct { | ||
| 28 | SalesmanBonusPercent float64 `json:"salesmanBonusPercent"` | 28 | SalesmanBonusPercent float64 `json:"salesmanBonusPercent"` |
| 29 | //状态 | 29 | //状态 |
| 30 | OrderStatus int `json:"orderStatus"` | 30 | OrderStatus int `json:"orderStatus"` |
| 31 | + | ||
| 32 | + Reason string `json:"reason"` | ||
| 31 | } | 33 | } |
| 32 | 34 | ||
| 33 | func (command UpdateOrderRealCommand) ValidateCommand() error { | 35 | func (command UpdateOrderRealCommand) ValidateCommand() error { |
| 1 | package domain | 1 | package domain |
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | - "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/utils" | ||
| 5 | "time" | 4 | "time" |
| 5 | + | ||
| 6 | + "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/utils" | ||
| 6 | ) | 7 | ) |
| 7 | 8 | ||
| 8 | const ( | 9 | const ( |
| @@ -61,6 +62,9 @@ type Order struct { | @@ -61,6 +62,9 @@ type Order struct { | ||
| 61 | //更新时间 | 62 | //更新时间 |
| 62 | UpdateAt time.Time `json:"updateAt"` | 63 | UpdateAt time.Time `json:"updateAt"` |
| 63 | CreateAt time.Time `json:"createAt"` | 64 | CreateAt time.Time `json:"createAt"` |
| 65 | + | ||
| 66 | + //理由 | ||
| 67 | + Reason string | ||
| 64 | } | 68 | } |
| 65 | 69 | ||
| 66 | //TODO | 70 | //TODO |
| @@ -51,7 +51,8 @@ type Order struct { | @@ -51,7 +51,8 @@ type Order struct { | ||
| 51 | 51 | ||
| 52 | //上一次查看时间 已读情况 | 52 | //上一次查看时间 已读情况 |
| 53 | LastViewTime time.Time | 53 | LastViewTime time.Time |
| 54 | - //最后分红状态 | 54 | + //理由 |
| 55 | + Reason string | ||
| 55 | } | 56 | } |
| 56 | 57 | ||
| 57 | var _ pg.BeforeUpdateHook = (*Order)(nil) | 58 | var _ pg.BeforeUpdateHook = (*Order)(nil) |
| @@ -71,6 +71,7 @@ func (repository OrderRepository) Save(orderInfo *domain.Order) error { | @@ -71,6 +71,7 @@ func (repository OrderRepository) Save(orderInfo *domain.Order) error { | ||
| 71 | PartnerBonusPercent: orderInfo.PartnerBonusPercent, | 71 | PartnerBonusPercent: orderInfo.PartnerBonusPercent, |
| 72 | SalesmanBonusPercent: orderInfo.SalesmanBonusPercent, | 72 | SalesmanBonusPercent: orderInfo.SalesmanBonusPercent, |
| 73 | BonusStatus: 1, | 73 | BonusStatus: 1, |
| 74 | + Reason: orderInfo.Reason, | ||
| 74 | } | 75 | } |
| 75 | if m.Id == 0 { | 76 | if m.Id == 0 { |
| 76 | err = tx.Insert(m) | 77 | err = tx.Insert(m) |
| @@ -80,7 +81,7 @@ func (repository OrderRepository) Save(orderInfo *domain.Order) error { | @@ -80,7 +81,7 @@ func (repository OrderRepository) Save(orderInfo *domain.Order) error { | ||
| 80 | Column("order_type", "order_code", "order_name", "order_status", "order_count", | 81 | Column("order_type", "order_code", "order_name", "order_status", "order_count", |
| 81 | "order_actual_count", "order_amount", "order_actual_amount", "order_payment_amount", | 82 | "order_actual_count", "order_amount", "order_actual_amount", "order_payment_amount", |
| 82 | "order_region_info", "buyer", "partner_id", "partner_bonus_percent", "salesman_bonus_percent", | 83 | "order_region_info", "buyer", "partner_id", "partner_bonus_percent", "salesman_bonus_percent", |
| 83 | - "update_at"). | 84 | + "update_at", "reason"). |
| 84 | Update() | 85 | Update() |
| 85 | } | 86 | } |
| 86 | return err | 87 | return err |
| @@ -53,6 +53,8 @@ type orderDetail struct { | @@ -53,6 +53,8 @@ type orderDetail struct { | ||
| 53 | Id int64 `json:"id"` | 53 | Id int64 `json:"id"` |
| 54 | //订单状态 | 54 | //订单状态 |
| 55 | OrderStatue int `json:"orderStatue"` | 55 | OrderStatue int `json:"orderStatue"` |
| 56 | + //理由 | ||
| 57 | + Reason string `json:"reason"` | ||
| 56 | } | 58 | } |
| 57 | 59 | ||
| 58 | //UpdateOrderPurpose 更新意向订单 | 60 | //UpdateOrderPurpose 更新意向订单 |
| @@ -491,6 +493,8 @@ func (c *OrderController) editOrderReal(param orderDetail) error { | @@ -491,6 +493,8 @@ func (c *OrderController) editOrderReal(param orderDetail) error { | ||
| 491 | SalesmanBonusPercent: param.SalesmanRatio, | 493 | SalesmanBonusPercent: param.SalesmanRatio, |
| 492 | //状态 | 494 | //状态 |
| 493 | OrderStatus: param.OrderStatue, | 495 | OrderStatus: param.OrderStatue, |
| 496 | + //理由 | ||
| 497 | + Reason: param.Reason, | ||
| 494 | } | 498 | } |
| 495 | orderSrv := orderService.NewOrderService(nil) | 499 | orderSrv := orderService.NewOrderService(nil) |
| 496 | err := orderSrv.UpdateOrderReal(updateCmd) | 500 | err := orderSrv.UpdateOrderReal(updateCmd) |
-
请 注册 或 登录 后发表评论