添加京东im

This commit is contained in:
邹宗楠
2025-12-10 10:56:48 +08:00
parent cbe7ee196d
commit 69b568fb73
12 changed files with 332 additions and 81 deletions

View File

@@ -3,6 +3,7 @@ package localjx
import (
"encoding/json"
"fmt"
"git.rosy.net.cn/jx-callback/business/jxutils/weixinmsg"
"git.rosy.net.cn/jx-callback/business/partner"
"strings"
"time"
@@ -135,6 +136,24 @@ func onTLpayFinished(call *tonglianpayapi.CallBackResult) (err error) {
dao.UpdateEntity(db, orderPay)
if call.TrxStatus == tonglianpayapi.TrxStatusSuccess {
err = OnPayFinished(orderPay)
order, _ := partner.CurOrderManager.LoadOrder(orderPay.VendorOrderID, model.VendorIDJX)
if order != nil {
store, _ := dao.GetStoreDetail(db, order.FromStoreID, model.VendorIDJX, "")
if store != nil {
userID := make([]string, 0, 2)
for _, v := range []string{store.MarketManPhone, store.OperatorPhone2} {
if v == "" {
continue
}
user, _ := dao.GetUserByID(db, "mobile", v)
userID = append(userID, user.UserID)
if store.MarketManPhone == store.OperatorPhone2 {
break
}
}
weixinmsg.SendUserMessage(jxcontext.AdminCtx, "商户购买物料信息推送", fmt.Sprintf("门店%s:%d,在物料商城下单了:%s,请注意查看", store.Name, store.ID, order.VendorOrderID), userID, true, true)
}
}
}
} else {
globals.SugarLogger.Debugf("onTLpayFinished msg:%s, err:%v", utils.Format4Output(call, true), err)