1
This commit is contained in:
@@ -229,7 +229,7 @@ func RegisterUserWithMobile(ctx *jxcontext.Context, user *model.User, mobileVeri
|
|||||||
outAuthInfo, err = auth2.BindUser(inAuthInfo, user)
|
outAuthInfo, err = auth2.BindUser(inAuthInfo, user)
|
||||||
}
|
}
|
||||||
} else if dao.IsDuplicateError(err) {
|
} else if dao.IsDuplicateError(err) {
|
||||||
if user.LastLoginType != "" && user.LastLoginType == alipay.AuthType {
|
if user.LastLoginType == alipay.AuthType {
|
||||||
if user2, _ := dao.GetUserByID(dao.GetDB(), "mobile", user.GetMobile()); user2 != nil {
|
if user2, _ := dao.GetUserByID(dao.GetDB(), "mobile", user.GetMobile()); user2 != nil {
|
||||||
user.UserID = user2.GetID()
|
user.UserID = user2.GetID()
|
||||||
outAuthInfo, err = auth2.BindUser(inAuthInfo, user)
|
outAuthInfo, err = auth2.BindUser(inAuthInfo, user)
|
||||||
|
|||||||
@@ -4,8 +4,10 @@ import (
|
|||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
|
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/jx/localjx"
|
"git.rosy.net.cn/jx-callback/business/partner/purchase/jx/localjx"
|
||||||
"github.com/astaxie/beego/server/web"
|
"github.com/astaxie/beego/server/web"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type JxOrderController struct {
|
type JxOrderController struct {
|
||||||
@@ -54,6 +56,61 @@ func (c *JxOrderController) Pay4Order() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Title 请求支付京西商城订单,门店自提订单
|
||||||
|
// @Description 请求支付京西商城订单,门店自提订单
|
||||||
|
// @Param token header string true "认证token"
|
||||||
|
// @Param subAppID formData string false "appID"
|
||||||
|
// @Param payType formData int true "支付类型"
|
||||||
|
// @Param vendorPayType formData string true "平台支付类型"
|
||||||
|
// @Param payMoney formData int true "自提支付金额"
|
||||||
|
// @Param storeId formData int true "提货门店id"
|
||||||
|
// @Success 200 {object} controllers.CallResult
|
||||||
|
// @Failure 200 {object} controllers.CallResult
|
||||||
|
// @router /Pay4StoreMyselfDeliverOrder [post]
|
||||||
|
func (c *JxOrderController) Pay4StoreMyselfDeliverOrder() {
|
||||||
|
c.callPay4StoreMyselfDeliverOrder(func(params *tJxorderPay4StoreMyselfDeliverOrderParams) (interface{}, string, error) {
|
||||||
|
orderDetail, _ := dao.GetStoreDetail(dao.GetDB(), params.StoreId, 0, "")
|
||||||
|
jxOrder := &localjx.JxOrderInfo{
|
||||||
|
BuyerComment: "门店自提单",
|
||||||
|
StoreID: params.StoreId,
|
||||||
|
Skus: []*localjx.JxSkuInfo{
|
||||||
|
&localjx.JxSkuInfo{
|
||||||
|
SkuID: 8030743,
|
||||||
|
Count: params.PayMoney,
|
||||||
|
Price: 1,
|
||||||
|
SalePrice: 1,
|
||||||
|
Name: "自定义支付购买",
|
||||||
|
Weight: 1,
|
||||||
|
GroupSign: false,
|
||||||
|
DefendPrice: 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ExpectedDeliveredTimestamp: time.Now().Unix(),
|
||||||
|
TotalPrice: int64(params.PayMoney),
|
||||||
|
FreightPrice: 0,
|
||||||
|
OrderPrice: int64(params.PayMoney),
|
||||||
|
ActualPayPrice: int64(params.PayMoney),
|
||||||
|
OrderID: 0,
|
||||||
|
StoreName: orderDetail.Name,
|
||||||
|
Weight: 500,
|
||||||
|
FromStoreID: 0,
|
||||||
|
EarningType: model.EarningTypePoints,
|
||||||
|
OrderType: model.OrderTypeNormal,
|
||||||
|
IsBuyNowPrice: 0,
|
||||||
|
IsPriceDefend: 0,
|
||||||
|
OrderID2: "",
|
||||||
|
UserID: params.Ctx.GetUserID(),
|
||||||
|
}
|
||||||
|
outJxOrder, err := localjx.CreateOrder(params.Ctx, jxOrder, int64(142), 1, 0, true, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
retVal, err := localjx.Pay4Order(params.Ctx, outJxOrder.OrderID, params.PayType, params.VendorPayType, params.SubAppID)
|
||||||
|
return retVal, "", err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// @Title 请求支付京西商城相关用户支付项目
|
// @Title 请求支付京西商城相关用户支付项目
|
||||||
// @Description 请求支付京西商城相关用户支付项目
|
// @Description 请求支付京西商城相关用户支付项目
|
||||||
// @Param token header string true "认证token"
|
// @Param token header string true "认证token"
|
||||||
|
|||||||
@@ -910,7 +910,15 @@ func init() {
|
|||||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"],
|
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"],
|
||||||
web.ControllerComments{
|
web.ControllerComments{
|
||||||
Method: "Pay4Order",
|
Method: "Pay4Order",
|
||||||
Router: `/Pay4Order`,
|
Router: `4Order`,
|
||||||
|
AllowHTTPMethods: []string{"post"},
|
||||||
|
MethodParams: param.Make(),
|
||||||
|
Filters: nil,
|
||||||
|
Params: nil})
|
||||||
|
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"],
|
||||||
|
web.ControllerComments{
|
||||||
|
Method: "Pay4StoreMyselfDeliverOrder",
|
||||||
|
Router: `Pay4StoreMyselfDeliverOrder`,
|
||||||
AllowHTTPMethods: []string{"post"},
|
AllowHTTPMethods: []string{"post"},
|
||||||
MethodParams: param.Make(),
|
MethodParams: param.Make(),
|
||||||
Filters: nil,
|
Filters: nil,
|
||||||
|
|||||||
Reference in New Issue
Block a user