1
This commit is contained in:
@@ -2,16 +2,17 @@ package defsch
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/dadaapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/fnpsapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/uuptapi"
|
||||
"git.rosy.net.cn/jx-callback/business/jxcallback/orderman"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/smsmsg"
|
||||
"math/rand"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
|
||||
@@ -988,10 +989,10 @@ func (s *DefScheduler) createWaybillOn3rdProviders(savedOrderInfo *WatchOrderInf
|
||||
savedOrderInfo.retryCount++
|
||||
} else {
|
||||
partner.CurOrderManager.OnOrderMsg(order, fmt.Sprintf("发起自动创建三方运单,目标创建运单平台[%s],创建失败:%v", jxutils.GetVendorName(vendorID), err), "")
|
||||
content := "您的门店 [" + storeDetail.Name + "],OrderID:[" + order.VendorOrderID + "],自动呼叫骑手失败[" + fmt.Sprintf(err.Error()) + "],请手动呼叫骑手"
|
||||
if user, err := dao.GetUserByID(dao.GetDB(), "mobile", storeDetail.MarketManPhone); err == nil {
|
||||
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "平台门店状态变化", content)
|
||||
}
|
||||
//content := "您的门店 [" + storeDetail.Name + "],OrderID:[" + order.VendorOrderID + "],自动呼叫骑手失败[" + fmt.Sprintf(err.Error()) + "],请手动呼叫骑手"
|
||||
//if user, err := dao.GetUserByID(dao.GetDB(), "mobile", storeDetail.MarketManPhone); err == nil {
|
||||
// ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "平台门店状态变化", content)
|
||||
//}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
"github.com/astaxie/beego/server/web"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type TaoBaoVegetableController struct {
|
||||
@@ -14,30 +9,30 @@ type TaoBaoVegetableController struct {
|
||||
}
|
||||
|
||||
// GetCode 淘菜菜获取商户授权code
|
||||
func (c *TaoBaoVegetableController) GetCode() {
|
||||
codeData := ""
|
||||
if c.Ctx.Input.Method() == http.MethodPost {
|
||||
body, err := ioutil.ReadAll(c.Ctx.Request.Body)
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debugf("商户收取code获取:%s,%s", string(body), err.Error())
|
||||
c.Data["json"] = MsgFail()
|
||||
c.ServeJSON()
|
||||
return
|
||||
}
|
||||
globals.SugarLogger.Debugf("商户收取code获取:%s", string(body))
|
||||
codeData = string(body)
|
||||
} else {
|
||||
codeData = c.Ctx.Input.Query("code")
|
||||
}
|
||||
|
||||
tokenInfo, err := api.TaoVegetableApi.GetStoreToken(codeData, "")
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debugf("获取门店token错误:%s", err.Error())
|
||||
c.Data["json"] = MsgFail()
|
||||
c.ServeJSON()
|
||||
return
|
||||
}
|
||||
fmt.Println(tokenInfo)
|
||||
// 创建storeMap门店信息
|
||||
// 刷新token
|
||||
}
|
||||
//func (c *TaoBaoVegetableController) GetCode() {
|
||||
// codeData := ""
|
||||
// if c.Ctx.Input.Method() == http.MethodPost {
|
||||
// body, err := ioutil.ReadAll(c.Ctx.Request.Body)
|
||||
// if err != nil {
|
||||
// globals.SugarLogger.Debugf("商户收取code获取:%s,%s", string(body), err.Error())
|
||||
// c.Data["json"] = MsgFail()
|
||||
// c.ServeJSON()
|
||||
// return
|
||||
// }
|
||||
// globals.SugarLogger.Debugf("商户收取code获取:%s", string(body))
|
||||
// codeData = string(body)
|
||||
// } else {
|
||||
// codeData = c.Ctx.Input.Query("code")
|
||||
// }
|
||||
//
|
||||
// tokenInfo, err := api.TaoVegetableApi.GetStoreToken(codeData, "")
|
||||
// if err != nil {
|
||||
// globals.SugarLogger.Debugf("获取门店token错误:%s", err.Error())
|
||||
// c.Data["json"] = MsgFail()
|
||||
// c.ServeJSON()
|
||||
// return
|
||||
// }
|
||||
// fmt.Println(tokenInfo)
|
||||
// // 创建storeMap门店信息
|
||||
// // 刷新token
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user