aa
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"crypto/md5"
|
||||
"errors"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/weixinmsg"
|
||||
beego "github.com/astaxie/beego/server/web"
|
||||
"math"
|
||||
"strings"
|
||||
@@ -1781,7 +1782,8 @@ func RefreshJdsOrderConsigneeInfo(ctx *jxcontext.Context, vendorOrderID string)
|
||||
|
||||
func UpdateOrderInfo(ctx *jxcontext.Context, vendorOrderID string, vendorID int, payload map[string]interface{}) (num int64, err error) {
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
db = dao.GetDB()
|
||||
jxSubsidyMoney int64
|
||||
)
|
||||
order, err := partner.CurOrderManager.LoadOrder(vendorOrderID, vendorID)
|
||||
if payload["consigneeLng"] != nil || payload["consigneeLat"] != nil {
|
||||
@@ -1792,7 +1794,7 @@ func UpdateOrderInfo(ctx *jxcontext.Context, vendorOrderID string, vendorID int,
|
||||
payload["expectedDeliveredTime"] = utils.Str2Time(payload["expectedDeliveredTime"].(string))
|
||||
}
|
||||
if payload["jxSubsidyMoney"] != nil {
|
||||
jxSubsidyMoney := utils.Interface2Int64WithDefault(payload["jxSubsidyMoney"], 0)
|
||||
jxSubsidyMoney = utils.Interface2Int64WithDefault(payload["jxSubsidyMoney"], 0)
|
||||
if order.EarningType == model.EarningTypeQuote {
|
||||
payload["earningPrice"] = order.EarningPrice - order.JxSubsidyMoney + jxSubsidyMoney
|
||||
}
|
||||
@@ -1812,6 +1814,25 @@ func UpdateOrderInfo(ctx *jxcontext.Context, vendorOrderID string, vendorID int,
|
||||
}
|
||||
dao.Commit(db, txDB)
|
||||
}
|
||||
if payload["jxSubsidyMoney"] != nil {
|
||||
var (
|
||||
userIDs []string
|
||||
)
|
||||
storeDetail, _ := dao.GetStoreDetail(db, jxutils.GetSaleStoreIDFromOrder(order), order.VendorID, order.VendorOrgCode)
|
||||
if storeDetail != nil && storeDetail.Tel1 != "" {
|
||||
user, _ := dao.GetUserByID(db, "mobile", storeDetail.Tel1)
|
||||
if user != nil {
|
||||
userIDs = append(userIDs, user.UserID)
|
||||
}
|
||||
if storeDetail.Tel2 != "" {
|
||||
user2, _ := dao.GetUserByID(db, "mobile", storeDetail.Tel2)
|
||||
if user2 != nil {
|
||||
userIDs = append(userIDs, user2.UserID)
|
||||
}
|
||||
}
|
||||
}
|
||||
weixinmsg.SendUserMessage(jxcontext.AdminCtx, "订单补偿", fmt.Sprintf("您收到了%v元的订单补偿,订单号:[%v]", jxSubsidyMoney, order.VendorOrderID), userIDs, true, true)
|
||||
}
|
||||
return num, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user