diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 1ad2c1e11..3174db913 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -3398,10 +3398,10 @@ func UpdateStoreSkusSpecTagBin(ctx *jxcontext.Context, reader io.Reader, vendorI } for _, v := range results { store, err := dao.GetStoreDetail(db, v.StoreID, model.VendorIDMTWM) - food, err := api.MtwmAPI.RetailGet(store.VendorStoreID, utils.Int2Str(v.SkuID)) if err != nil || store == nil { continue } + food, err := api.MtwmAPI.RetailGet(store.VendorStoreID, utils.Int2Str(v.SkuID)) var foodData = make(map[string]interface{}) if v.IsSpec != 0 && v.IsSpec == -1 { v.IsSpec = 0 diff --git a/business/jxstore/cms/sync.go b/business/jxstore/cms/sync.go index 581acf257..76058a487 100644 --- a/business/jxstore/cms/sync.go +++ b/business/jxstore/cms/sync.go @@ -663,17 +663,16 @@ func buildSetFinishHook(task tasksch.ITask, ctx *jxcontext.Context) { } else { globals.SugarLogger.Debugf("同步错误发送钉钉消息失败, authinfo [%v] , [%v]", *authInfo, err) } + }else { + if time.Now().Hour() >= 20 || time.Now().Hour() < 7 { + downloadURL, _, _ := WirteToExcelBySyncFailed(task) + user, err := dao.GetUserByID(dao.GetDB(), "mobile", "") + noticeMsg += fmt.Sprintf("[详情点我]%s/billshow/?normal=true&path=%s \n", globals.BackstageHost, downloadURL) + if user != nil && err == nil { + ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "同步错误返回", noticeMsg) + } + } } - // else { - // if time.Now().Hour() >= 20 || time.Now().Hour() < 7 { - // downloadURL, _, _ := WirteToExcelBySyncFailed(task) - // user, err := dao.GetUserByID(dao.GetDB(), "mobile", "") - // noticeMsg += fmt.Sprintf("[详情点我]%s/billshow/?normal=true&path=%s \n", globals.BackstageHost, downloadURL) - // if user != nil && err == nil { - // ddmsg.SendUserMessage(dingdingapi.MsgTyeText, user.UserID, "同步错误返回", noticeMsg) - // } - // } - // } }) } diff --git a/business/partner/purchase/jx/localjx/tonglianpay.go b/business/partner/purchase/jx/localjx/tonglianpay.go index e6484ba4c..f5a1ba9cf 100644 --- a/business/partner/purchase/jx/localjx/tonglianpay.go +++ b/business/partner/purchase/jx/localjx/tonglianpay.go @@ -30,26 +30,38 @@ func pay4OrderByTL(ctx *jxcontext.Context, order *model.GoodsOrder, vendorPayTyp if vendorPayType == "JSAPI" { param.PayType = tonglianpayapi.PayTypeWxXcx } - if authInfo, err := ctx.GetV2AuthInfo(); err == nil && authInfo.GetAuthType() == weixin.AuthTypeMini { - param.Acct = authInfo.GetAuthID() + if vendorPayType == tonglianpayapi.PayTypeWxXcx { + if authInfo, err := ctx.GetV2AuthInfo(); err == nil && authInfo.GetAuthType() == weixin.AuthTypeMini { + param.Acct = authInfo.GetAuthID() + } } - result, err := api.TLpayAPI.CreateUnitorderOrder(param) - if err == nil { - var result2 tonglianpayapi.PayInfo - json.Unmarshal([]byte(result.PayInfo), &result2) - prePayID := result2.Package[strings.LastIndex(result2.Package, "=")+1 : len(result2.Package)] - orderPay = &model.OrderPay{ - PayOrderID: param.Reqsn, - PayType: model.PayTypeTL, - VendorPayType: vendorPayType, - TransactionID: result.TrxID, - VendorOrderID: order.VendorOrderID, - VendorID: order.VendorID, - Status: 0, - PayCreatedAt: payCreatedAt, - PrepayID: prePayID, - CodeURL: utils.LimitUTF8StringLen(result.PayInfo, 3200), - TotalFee: int(order.ActualPayPrice), + if vendorPayType == tonglianpayapi.PayTypeH5 { + param2 := &tonglianpayapi.CreateH5UnitorderOrderParam{ + Trxamt: int(order.ActualPayPrice), + NotifyUrl: globals.TLPayNotifyURL, + Body: "京西菜市", + Charset: "UTF-8", + } + err = api.TLpayAPI.CreateH5UnitorderOrder(param2) + } else { + result, err := api.TLpayAPI.CreateUnitorderOrder(param) + if err == nil { + var result2 tonglianpayapi.PayInfo + json.Unmarshal([]byte(result.PayInfo), &result2) + prePayID := result2.Package[strings.LastIndex(result2.Package, "=")+1 : len(result2.Package)] + orderPay = &model.OrderPay{ + PayOrderID: param.Reqsn, + PayType: model.PayTypeTL, + VendorPayType: vendorPayType, + TransactionID: result.TrxID, + VendorOrderID: order.VendorOrderID, + VendorID: order.VendorID, + Status: 0, + PayCreatedAt: payCreatedAt, + PrepayID: prePayID, + CodeURL: utils.LimitUTF8StringLen(result.PayInfo, 3200), + TotalFee: int(order.ActualPayPrice), + } } } return orderPay, err