This commit is contained in:
邹宗楠
2025-02-08 11:35:30 +08:00
parent b5503198d2
commit c0982e03ff
5 changed files with 71 additions and 37 deletions

View File

@@ -58,27 +58,35 @@ func (c *LogisticsController) LogisticsRegister() {
return
}
// 查询订单的运单是否存在
data, err := dao.GetWayBillsByWayBillId(dao.GetDB(), register.TrackNo)
data, _ := dao.GetWayBillsByWayBillId(dao.GetDB(), register.TrackNo)
// 此订单可能是果园订单
if len(data) == 0 || err != nil {
if len(data) == 0 {
var resp *http.Response
var err error
switch web.BConfig.RunMode {
case model.ServerTypeVegetable:
resp, err = tiktok_store.HttpToGuoYuan(utils.Struct2Map(register, "", true), tiktok_store.CaiShiPushGyTagDeliveryRegister, model.ServerTypeFruits)
if err != nil {
c.Data["json"] = LogisticsQueryRestMsg("单号不存在", "1002")
c.ServeJSON()
return
}
case model.ServerTypeFruits:
//resp, err = tiktok_store.HttpToGuoYuan(utils.Struct2Map(register, "", true), tiktok_store.CaiShiPushGyTagDeliveryRegister, model.ServerTypeFruits)
//if err != nil {
// c.Data["json"] = LogisticsQueryRestMsg("单号不存在", "1002")
// c.ServeJSON()
// return
//}
// 抖音只推送百货
resp, err = tiktok_store.HttpToGuoYuan(utils.Struct2Map(register, "", true), tiktok_store.CaiShiPushGyTagDeliveryRegister, model.ServerTypePet)
if err != nil {
c.Data["json"] = LogisticsQueryRestMsg("单号不存在", "1002")
c.ServeJSON()
return
}
case model.ServerTypeFruits:
//resp, err = tiktok_store.HttpToGuoYuan(utils.Struct2Map(register, "", true), tiktok_store.CaiShiPushGyTagDeliveryRegister, model.ServerTypePet)
//if err != nil {
// c.Data["json"] = LogisticsQueryRestMsg("单号不存在", "1002")
// c.ServeJSON()
// return
//}
}
gyData := &LogisticsRegisterResp{}
@@ -173,7 +181,14 @@ func (c *LogisticsController) LogisticsQuery() {
var err error
switch web.BConfig.RunMode {
case model.ServerTypeVegetable:
resp, err = tiktok_store.HttpToGuoYuan(utils.Struct2Map(param, "", true), tiktok_store.CaiShiPushGyTagDeliveryDetail, model.ServerTypeFruits)
//resp, err = tiktok_store.HttpToGuoYuan(utils.Struct2Map(param, "", true), tiktok_store.CaiShiPushGyTagDeliveryDetail, model.ServerTypeFruits)
//if err != nil {
// c.Data["json"] = LogisticsQueryRestMsg("运单账号不存在", "1002")
// c.ServeJSON()
// return
//}
// 抖音只推送百货
resp, err = tiktok_store.HttpToGuoYuan(utils.Struct2Map(param, "", true), tiktok_store.CaiShiPushGyTagDeliveryDetail, model.ServerTypePet)
if err != nil {
c.Data["json"] = LogisticsQueryRestMsg("运单账号不存在", "1002")
c.ServeJSON()

View File

@@ -151,7 +151,7 @@ func (c *TiktokShopController) TokenMsg() {
return
}
if param.VendorOrgCode == "68023619" {
tiktok_store.HttpToGuoYuan(utils.Struct2Map(param, "", false), model.ServerTypePet, tiktok_store.CaiShiPushGyTagToken)
tiktok_store.HttpToGuoYuan(utils.Struct2Map(param, "", false), tiktok_store.CaiShiPushGyTagToken, model.ServerTypePet)
}
c.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackSuccessCode, Msg: tiktok_api.CallbackSuccess}