This commit is contained in:
jiangyong27 2023-04-09 12:16:09 +08:00
parent 2bfcaf61de
commit 957622016a
3 changed files with 7 additions and 12 deletions

View File

@ -1,4 +1,5 @@
{
"enable": true,
"bidProfit": 50,
"couponCost": 3000
}

View File

@ -6,6 +6,7 @@ import (
)
type Dadi struct {
Enable bool `json:"enable"`
BidProfit int64 `json:"bidProfit"`
CouponCost int64 `json:"couponCost"`
}

View File

@ -65,16 +65,6 @@ func (w *Worker) processorDadi(order *model.Order) {
return
}
//hahaProcessor.BidPrice(order.Id, checkInfo.UnitPrice)
go func() {
/*
time.Sleep(60 * time.Second)
if err := dadiProcessor.CancelOrder(order, checkInfo); err != nil {
log.Errorf("cancel order[%s] error[%s]", order.OrderId, err.Error())
}
*/
}()
bidStatus := false
realCost := checkInfo.TotalRealPrice + int64(goutil.If(checkInfo.CouponPrice > 0, config.GetDadiConfig().CouponCost, 0))
realUnitCost := realCost / int64(order.SeatNum)
@ -144,9 +134,12 @@ func (w *Worker) Run() {
if !strings.Contains(order.CinemaName, "大地影院") {
continue
}
w.processorDadi(order)
if config.GetDadiConfig().Enable {
w.processorDadi(order)
}
case updateOrder := <-updateOrderChan:
log.Debugf("update:", goutil.EncodeJSON(updateOrder))
log.Tracef("%s update", updateOrder.String())
}
}