This commit is contained in:
jiangyong27 2023-04-09 12:22:31 +08:00
parent 23ed28e14c
commit 1a940d590c
4 changed files with 6 additions and 6 deletions

View File

@ -42,7 +42,7 @@ type Order struct {
func (o *Order) String() string {
return fmt.Sprintf("{%s|%d} city={%s} cinema={%s} film={%s} ting={%s} show={%s}",
o.OrderId, o.Id, o.CityName, o.CinemaName, o.MovieName, o.Ting, goutil.TimeToDateTime(o.ShowTime))
o.OrderNo, o.Id, o.CityName, o.CinemaName, o.MovieName, o.Ting, goutil.TimeToDateTime(o.ShowTime))
}
func AddOrder(o *Order) (int64, error) {
o.CreateTime = time.Now().Unix()

View File

@ -301,7 +301,7 @@ func (p *Processor) CheckOrder(order *model.Order) (*common.CheckInfo, error) {
result.CouponPrice = previewOrder.CouponPrice
result.BillCode = previewOrder.BillCode
log.Infof("check order[%s][%s] previewOrder[%s] [%s][%s][%s] success",
order.OrderId, result.BillCode, goutil.EncodeJSON(previewOrder),
order.OrderNo, result.BillCode, goutil.EncodeJSON(previewOrder),
order.CityName, order.CinemaName, order.MovieName)
return result, nil
}
@ -329,6 +329,6 @@ func (p *Processor) CancelOrder(order *model.Order, checkInfo *common.CheckInfo)
return err
}
log.Infof("cancel order[%s][%s] [%s][%s][%s] success",
order.OrderId, checkInfo.BillCode, order.CityName, order.CinemaName, order.MovieName)
order.OrderNo, checkInfo.BillCode, order.CityName, order.CinemaName, order.MovieName)
return nil
}

View File

@ -78,7 +78,7 @@ func (s *SyncOrder) run() {
order.Id = id
isAdd = true
}
order.OrderId = cast.ToString(data["order_id"])
order.OrderNo = cast.ToString(data["order_id"])
order.PayPrice = int64(cast.ToFloat64(data["payPrice"]) * 100)
order.TotalPrice = int64(cast.ToFloat64(data["total_price"]) * 100)
order.MaoyanPrice = int64(cast.ToFloat64(data["maoyan_price"]) * 100)

View File

@ -42,7 +42,7 @@ func (w *Worker) getOrderMesasge(order *model.Order) []string {
goutil.If(order.IsSeat == 3, "可以调座", "不可调座"),
goutil.If(order.LoverSeat == 1, "情侣座", "普通座")))
message = append(message, fmt.Sprintf("原价:%.2f", float64(order.MaoyanPrice)/100))
message = append(message, fmt.Sprintf("编号:%s", order.OrderId))
message = append(message, fmt.Sprintf("编号:%s", order.OrderNo))
message = append(message, fmt.Sprintf("总金额:%.2f%d", float64(order.TotalPrice)/100, order.SeatNum))
message = append(message, fmt.Sprintf("报价范围:%.2f~%.2f", float64(order.MinPrice)/100, float64(order.MaxPrice)/100))
message = append(message, fmt.Sprintf("支付时间:%s", time.Unix(order.PayTime, 0).Format("2006-01-02 15:04")))
@ -73,7 +73,7 @@ func (w *Worker) processorDadi(order *model.Order) {
if err := w.hahaProcessor.BidPrice(order.Id, bidPrice); err != nil {
log.Errorf("BidPrice order[%s] error[%s]", order.String(), err.Error())
if err := w.dadiProcessor.CancelOrder(order, checkInfo); err != nil {
log.Errorf("cancel order[%s] error[%s]", order.OrderId, err.Error())
log.Errorf("cancel order[%s] error[%s]", order.OrderNo, err.Error())
}
message := w.getOrderMesasge(order)
message = append(message, "\n", fmt.Sprintf("竞价失败:%s", err.Error()))