作者 tangxvhui

新增;order表新增字段reason

... ... @@ -28,6 +28,8 @@ type UpdateOrderRealCommand struct {
SalesmanBonusPercent float64 `json:"salesmanBonusPercent"`
//状态
OrderStatus int `json:"orderStatus"`
Reason string `json:"reason"`
}
func (command UpdateOrderRealCommand) ValidateCommand() error {
... ...
package domain
import (
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/utils"
"time"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/utils"
)
const (
... ... @@ -61,6 +62,9 @@ type Order struct {
//更新时间
UpdateAt time.Time `json:"updateAt"`
CreateAt time.Time `json:"createAt"`
//理由
Reason string
}
//TODO
... ...
... ... @@ -51,7 +51,8 @@ type Order struct {
//上一次查看时间 已读情况
LastViewTime time.Time
//最后分红状态
//理由
Reason string
}
var _ pg.BeforeUpdateHook = (*Order)(nil)
... ...
... ... @@ -71,6 +71,7 @@ func (repository OrderRepository) Save(orderInfo *domain.Order) error {
PartnerBonusPercent: orderInfo.PartnerBonusPercent,
SalesmanBonusPercent: orderInfo.SalesmanBonusPercent,
BonusStatus: 1,
Reason: orderInfo.Reason,
}
if m.Id == 0 {
err = tx.Insert(m)
... ... @@ -80,7 +81,7 @@ func (repository OrderRepository) Save(orderInfo *domain.Order) error {
Column("order_type", "order_code", "order_name", "order_status", "order_count",
"order_actual_count", "order_amount", "order_actual_amount", "order_payment_amount",
"order_region_info", "buyer", "partner_id", "partner_bonus_percent", "salesman_bonus_percent",
"update_at").
"update_at", "reason").
Update()
}
return err
... ...
... ... @@ -53,6 +53,8 @@ type orderDetail struct {
Id int64 `json:"id"`
//订单状态
OrderStatue int `json:"orderStatue"`
//理由
Reason string `json:"reason"`
}
//UpdateOrderPurpose 更新意向订单
... ... @@ -491,6 +493,8 @@ func (c *OrderController) editOrderReal(param orderDetail) error {
SalesmanBonusPercent: param.SalesmanRatio,
//状态
OrderStatus: param.OrderStatue,
//理由
Reason: param.Reason,
}
orderSrv := orderService.NewOrderService(nil)
err := orderSrv.UpdateOrderReal(updateCmd)
... ...