1
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/jx/localjx"
|
||||
"github.com/astaxie/beego/server/web"
|
||||
"net"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -46,26 +47,89 @@ func (c *JxOrderController) CreateOrder() {
|
||||
// @Param token header string true "认证token"
|
||||
// @Param vendorOrderID formData string true "订单ID"
|
||||
// @Param paymentLabel formData string true "支付身份标示"
|
||||
// @Param payType formData string true "扫码方式[tonglian/lakala]"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /Pay4OrderByBarCodeScanner [post]
|
||||
func (c *JxOrderController) Pay4OrderByBarCodeScanner() {
|
||||
c.callPay4OrderByBarCodeScanner(func(params *tJxorderPay4OrderByBarCodeScannerParams) (retVal interface{}, errCode string, err error) {
|
||||
retVal, err = localjx.BarCodeScannerPay(params.VendorOrderID, params.PaymentLabel)
|
||||
switch params.PayType {
|
||||
case "tonglian":
|
||||
retVal, err = localjx.BarCodeScannerPay(params.VendorOrderID, params.PaymentLabel)
|
||||
case "lakala":
|
||||
ip, _, err := net.SplitHostPort(c.Ctx.Request.RemoteAddr)
|
||||
if err != nil {
|
||||
return retVal, "", err
|
||||
}
|
||||
retVal, err = localjx.BarCodeScannerPayByLaKaLa(params.Ctx, params.VendorOrderID, params.PaymentLabel, ip)
|
||||
}
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 到店扫码支付订单退款
|
||||
// @Description 到店扫码支付订单退款
|
||||
// @Param token header string true "认证token"
|
||||
// @Param vendorOrderID formData string true "订单ID"
|
||||
// @Param skuIds formData string true "[key:value]退款商品 skuId:count,int"
|
||||
// @Param Reason formData string false "退单原因"
|
||||
// @Param payType formData string true "扫码方式[tl/lkl]"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /RefundOnlineOrder [post]
|
||||
func (c *JxOrderController) RefundOnlineOrder() {
|
||||
c.callRefundOnlineOrder(func(params *tJxorderRefundOnlineOrderParams) (retVal interface{}, errCode string, err error) {
|
||||
skuIds := make(map[int]int, 0)
|
||||
if err = json.Unmarshal([]byte(params.SkuIds), &skuIds); err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
switch params.PayType {
|
||||
case "tonglian":
|
||||
err = localjx.RefundBarCodeScannerOrder(params.Ctx, params.VendorOrderID, skuIds, params.Reason)
|
||||
case "lakala":
|
||||
err = localjx.RefundBarCodeScannerOrderByLaKaLa(params.Ctx, params.VendorOrderID, skuIds, params.Reason)
|
||||
}
|
||||
|
||||
return retVal, errCode, err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 扫码订单刷新售后信息
|
||||
// @Description 扫码订单刷新售后信息
|
||||
// @Param token header string true "认证token"
|
||||
// @Param afsOrderId query string true "售后订单id"
|
||||
// @Param payType formData string true "扫码方式[tl/lkl]"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /QueryBarCodeRefundStatus [get]
|
||||
func (c *JxOrderController) QueryBarCodeRefundStatus() {
|
||||
c.callQueryBarCodeRefundStatus(func(params *tJxorderQueryBarCodeRefundStatusParams) (retVal interface{}, errCode string, err error) {
|
||||
switch params.PayType {
|
||||
case "tonglian":
|
||||
//retVal, err = localjx.RefundBarCodeScannerOrder(params.AfsOrderId)
|
||||
case "lakala":
|
||||
retVal, err = localjx.QueryBarCodeRefundStatus(params.AfsOrderId)
|
||||
}
|
||||
return retVal, errCode, err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 手动刷新扫码枪扫码支付订单状态
|
||||
// @Description 手动刷新扫码枪扫码支付订单状态
|
||||
// @Param token header string true "认证token"
|
||||
// @Param vendorOrderID formData string true "订单ID"
|
||||
// @Param payType formData string true "扫码方式[tl/lkl]"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /RefreshPayStatus [post]
|
||||
func (c *JxOrderController) RefreshPayStatus() {
|
||||
c.callRefreshPayStatus(func(params *tJxorderRefreshPayStatusParams) (retVal interface{}, errCode string, err error) {
|
||||
retVal, err = localjx.QueryBarCodeScannerStatus(params.VendorOrderID)
|
||||
switch params.PayType {
|
||||
case "tonglian":
|
||||
retVal, err = localjx.QueryBarCodeScannerStatus(params.VendorOrderID)
|
||||
case "lakala":
|
||||
retVal, err = localjx.LaKaLaBarCodeScannerStatus(params.VendorOrderID)
|
||||
}
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
@@ -99,27 +163,6 @@ func (c *JxOrderController) TerminalQuery() {
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 到店扫码支付订单退款
|
||||
// @Description 到店扫码支付订单退款
|
||||
// @Param token header string true "认证token"
|
||||
// @Param vendorOrderID formData string true "订单ID"
|
||||
// @Param skuIds formData string true "[key:value]退款商品 skuId:count,int"
|
||||
// @Param Reason formData string false "退单原因"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /RefundOnlineOrder [post]
|
||||
func (c *JxOrderController) RefundOnlineOrder() {
|
||||
c.callRefundOnlineOrder(func(params *tJxorderRefundOnlineOrderParams) (retVal interface{}, errCode string, err error) {
|
||||
skuIds := make(map[int]int, 0)
|
||||
if err = json.Unmarshal([]byte(params.SkuIds), &skuIds); err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
err = localjx.RefundBarCodeScannerOrder(params.Ctx, params.VendorOrderID, skuIds, params.Reason)
|
||||
|
||||
return retVal, errCode, err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 请求支付京西商城订单
|
||||
// @Description 请求支付京西商城订单
|
||||
// @Param token header string true "认证token"
|
||||
|
||||
Reference in New Issue
Block a user