+setFakeActualPayPrice
This commit is contained in:
@@ -1256,9 +1256,24 @@ func OnDefSchConfChanged(key, value string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func setFakeActualPayPrice(order *model.GoodsOrder) (newOrder *model.GoodsOrder) {
|
||||||
|
orderCopy := *order
|
||||||
|
storeDetail, err := dao.GetStoreDetail(dao.GetDB(), order.JxStoreID, order.VendorID)
|
||||||
|
if err == nil {
|
||||||
|
if storeDetail.PayPercentage < 50 {
|
||||||
|
orderCopy.ActualPayPrice = order.TotalShopMoney * (100 - int64(storeDetail.PayPercentage/2)) * 100
|
||||||
|
} else {
|
||||||
|
orderCopy.ActualPayPrice = order.EarningPrice
|
||||||
|
}
|
||||||
|
}
|
||||||
|
newOrder = &orderCopy
|
||||||
|
return newOrder
|
||||||
|
}
|
||||||
|
|
||||||
func (s *DefScheduler) notifyNewOrder(order *model.GoodsOrder) {
|
func (s *DefScheduler) notifyNewOrder(order *model.GoodsOrder) {
|
||||||
if order.Flag&model.OrderFlagMaskFake == 0 {
|
if order.Flag&model.OrderFlagMaskFake == 0 {
|
||||||
utils.CallFuncAsync(func() {
|
utils.CallFuncAsync(func() {
|
||||||
|
order = setFakeActualPayPrice(order)
|
||||||
netprinter.PrintOrderByOrder(jxcontext.AdminCtx, order)
|
netprinter.PrintOrderByOrder(jxcontext.AdminCtx, order)
|
||||||
weixinmsg.NotifyNewOrder(order)
|
weixinmsg.NotifyNewOrder(order)
|
||||||
smsmsg.NotifyNewOrder(order)
|
smsmsg.NotifyNewOrder(order)
|
||||||
@@ -1268,6 +1283,7 @@ func (s *DefScheduler) notifyNewOrder(order *model.GoodsOrder) {
|
|||||||
|
|
||||||
func (s *DefScheduler) notifyUserApplyCancel(order *model.GoodsOrder, cancelReason string) {
|
func (s *DefScheduler) notifyUserApplyCancel(order *model.GoodsOrder, cancelReason string) {
|
||||||
utils.CallFuncAsync(func() {
|
utils.CallFuncAsync(func() {
|
||||||
|
order = setFakeActualPayPrice(order)
|
||||||
weixinmsg.NotifyUserApplyCancel(order, cancelReason)
|
weixinmsg.NotifyUserApplyCancel(order, cancelReason)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -1275,6 +1291,7 @@ func (s *DefScheduler) notifyUserApplyCancel(order *model.GoodsOrder, cancelReas
|
|||||||
func (s *DefScheduler) notifyOrderCanceled(order *model.GoodsOrder) {
|
func (s *DefScheduler) notifyOrderCanceled(order *model.GoodsOrder) {
|
||||||
if order.Flag&model.OrderFlagMaskFake == 0 {
|
if order.Flag&model.OrderFlagMaskFake == 0 {
|
||||||
utils.CallFuncAsync(func() {
|
utils.CallFuncAsync(func() {
|
||||||
|
order = setFakeActualPayPrice(order)
|
||||||
weixinmsg.NotifyOrderCanceled(order)
|
weixinmsg.NotifyOrderCanceled(order)
|
||||||
smsmsg.NotifyOrderCanceled(order)
|
smsmsg.NotifyOrderCanceled(order)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user