1
This commit is contained in:
@@ -876,6 +876,28 @@ func GetVendorStore(ctx *jxcontext.Context, vendorID int, vendorOrgCode, vendorS
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// QueryPlatformBalance 获取三方配送平台账号余额
|
||||
func QueryPlatformBalance(vendorID int) (int64, error) {
|
||||
handlerInfo := partner.GetDeliveryPlatformFromVendorID(vendorID)
|
||||
if handlerInfo.Handler != nil {
|
||||
return handlerInfo.Handler.GetPlatformBalance()
|
||||
}
|
||||
return 0, fmt.Errorf("vendorId 解析异常")
|
||||
}
|
||||
|
||||
// BalanceRecharge 三方配送平台账号余额充值
|
||||
func BalanceRecharge(vendorID int, param *utils.RechargeBalance) (string, error) {
|
||||
handlerInfo := partner.GetDeliveryPlatformFromVendorID(vendorID)
|
||||
if handlerInfo.Handler != nil {
|
||||
return handlerInfo.Handler.BalanceRecharge(&utils.RechargeBalance{
|
||||
Amount: param.Amount,
|
||||
Category: param.Category,
|
||||
NotifyUrl: param.NotifyUrl,
|
||||
})
|
||||
}
|
||||
return "", fmt.Errorf("vendorId 解析异常")
|
||||
}
|
||||
|
||||
func isUpdateStoreNeedSync(valid map[string]interface{}) bool {
|
||||
for k := range valid {
|
||||
if storeKeyPropertyMap[k] == 1 {
|
||||
|
||||
@@ -648,3 +648,15 @@ func (c *DeliveryHandler) GetDeliverLiquidatedDamages(orderId string, deliverId
|
||||
//}
|
||||
//return vendorPrice, nil
|
||||
}
|
||||
|
||||
func (c *DeliveryHandler) GetPlatformBalance() (balance int64, err error) {
|
||||
return api.DadaAPI.QueryBillBalance()
|
||||
}
|
||||
|
||||
func (c *DeliveryHandler) BalanceRecharge(param *utils.RechargeBalance) (url string, err error) {
|
||||
return api.DadaAPI.BalanceRecharge(&dadaapi.RechargeParam{
|
||||
Amount: param.Amount,
|
||||
Category: param.Category,
|
||||
NotifyUrl: param.NotifyUrl,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -608,3 +608,10 @@ func (c *DeliveryHandler) GetWaybillTip(ctx *jxcontext.Context, vendorOrgCode, v
|
||||
}
|
||||
return tipFee, err
|
||||
}
|
||||
|
||||
func (c *DeliveryHandler) GetPlatformBalance() (balance int64, err error) {
|
||||
return api.FnAPI.QueryBillBalance()
|
||||
}
|
||||
func (c *DeliveryHandler) BalanceRecharge(param *utils.RechargeBalance) (url string, err error) {
|
||||
return "", fmt.Errorf("此平台暂不支持充值")
|
||||
}
|
||||
|
||||
@@ -109,3 +109,9 @@ func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeiso
|
||||
func (c *DeliveryHandler) GetDeliverLiquidatedDamages(orderId string, deliverId string) (money int64, err error) {
|
||||
return 0, err
|
||||
}
|
||||
func (c *DeliveryHandler) GetPlatformBalance() (balance int64, err error) {
|
||||
return 0, fmt.Errorf("暂不支持此功能")
|
||||
}
|
||||
func (c *DeliveryHandler) BalanceRecharge(param *utils.RechargeBalance) (url string, err error) {
|
||||
return "", fmt.Errorf("此平台暂不支持充值")
|
||||
}
|
||||
|
||||
@@ -612,3 +612,10 @@ func (c *DeliveryHandler) UpdateWaybillTip(ctx *jxcontext.Context, vendorOrgCode
|
||||
func (c *DeliveryHandler) GetWaybillTip(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID, vendorOrderID, vendorWaybillID, vendorWaybillID2 string) (tipFee int64, err error) {
|
||||
return tipFee, err
|
||||
}
|
||||
|
||||
func (c *DeliveryHandler) GetPlatformBalance() (balance int64, err error) {
|
||||
return 0, fmt.Errorf("暂不支持此功能")
|
||||
}
|
||||
func (c *DeliveryHandler) BalanceRecharge(param *utils.RechargeBalance) (url string, err error) {
|
||||
return "", fmt.Errorf("此平台暂不支持充值")
|
||||
}
|
||||
|
||||
@@ -758,3 +758,10 @@ func getReallyStoreID(storeID, jxStoreID int) int {
|
||||
return storeID
|
||||
}
|
||||
}
|
||||
|
||||
func (c *DeliveryHandler) GetPlatformBalance() (balance int64, err error) {
|
||||
return 0, fmt.Errorf("暂不支持此功能")
|
||||
}
|
||||
func (c *DeliveryHandler) BalanceRecharge(param *utils.RechargeBalance) (url string, err error) {
|
||||
return "", fmt.Errorf("此平台暂不支持充值")
|
||||
}
|
||||
|
||||
@@ -499,3 +499,10 @@ func getReallyStoreID(storeID, jxStoreID int) int {
|
||||
func (c *DeliveryHandler) UpdateStoreName(storeId, name string) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *DeliveryHandler) GetPlatformBalance() (balance int64, err error) {
|
||||
return 0, fmt.Errorf("暂不支持此功能")
|
||||
}
|
||||
func (c *DeliveryHandler) BalanceRecharge(param *utils.RechargeBalance) (url string, err error) {
|
||||
return "", fmt.Errorf("此平台暂不支持充值")
|
||||
}
|
||||
|
||||
@@ -50,6 +50,10 @@ type IDeliveryPlatformHandler interface {
|
||||
|
||||
// GetDeliverLiquidatedDamages 获取配送单的违约金:京西订单id:orderId,配送方id:deliverId
|
||||
GetDeliverLiquidatedDamages(orderId string, deliverId string) (money int64, err error)
|
||||
// GetPlatformBalance 获取平台账户余额
|
||||
GetPlatformBalance() (balance int64, err error)
|
||||
// BalanceRecharge 充值配送平台
|
||||
BalanceRecharge(param *utils.RechargeBalance) (url string, err error)
|
||||
}
|
||||
|
||||
type IDeliveryUpdateStoreHandler interface {
|
||||
|
||||
@@ -97,6 +97,42 @@ func (c *StoreController) GetVendorStore() {
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 查询远程平台可以金额
|
||||
// @Description 查询远程平台可以金额
|
||||
// @Param token header string true "认证token"
|
||||
// @Param vendorID query int true "门店所属的厂商ID"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /QueryPlatformBalance [get]
|
||||
func (c *StoreController) QueryPlatformBalance() {
|
||||
c.callQueryPlatformBalance(func(params *tStoreQueryPlatformBalanceParams) (retVal interface{}, errCode string, err error) {
|
||||
retVal, err = cms.QueryPlatformBalance(params.VendorID)
|
||||
return retVal, "", err
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 远程平台充值
|
||||
// @Description 远程平台充值
|
||||
// @Param token header string true "认证token"
|
||||
// @Param vendorID query int true "门店所属的厂商ID"
|
||||
// @Param amount query int true "充值金额分"
|
||||
// @Param category query string true "链接场景[PC,H5]"
|
||||
// @Param notifyUrl query string false "成功跳转链接(支付宝有,微信没有)"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /BalanceRecharge [post]
|
||||
func (c *StoreController) BalanceRecharge() {
|
||||
c.callBalanceRecharge(func(params *tStoreBalanceRechargeParams) (retVal interface{}, errCode string, err error) {
|
||||
retVal, err = cms.BalanceRecharge(params.VendorID, &utils.RechargeBalance{
|
||||
Amount: float64(params.Amount) / 100,
|
||||
Category: params.Category,
|
||||
NotifyUrl: params.NotifyUrl,
|
||||
})
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 修改门店信息
|
||||
// @Description 修改门店信息
|
||||
// @Param token header string true "认证token"
|
||||
|
||||
@@ -3031,6 +3031,24 @@ func init() {
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
// 查询平台可用金额
|
||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"],
|
||||
web.ControllerComments{
|
||||
Method: "QueryPlatformBalance",
|
||||
Router: `/QueryPlatformBalance`,
|
||||
AllowHTTPMethods: []string{"get"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
// 查询平台可用金额
|
||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"],
|
||||
web.ControllerComments{
|
||||
Method: "BalanceRecharge",
|
||||
Router: `/BalanceRecharge`,
|
||||
AllowHTTPMethods: []string{"post"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"],
|
||||
web.ControllerComments{
|
||||
|
||||
115630
swagger/param_parser.go.txt
115630
swagger/param_parser.go.txt
File diff suppressed because it is too large
Load Diff
@@ -17607,6 +17607,59 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/store/BalanceRecharge": {
|
||||
"post": {
|
||||
"tags": [
|
||||
"store"
|
||||
],
|
||||
"description": "远程平台充值",
|
||||
"operationId": "StoreController.远程平台充值",
|
||||
"parameters": [
|
||||
{
|
||||
"in": "header",
|
||||
"name": "token",
|
||||
"description": "认证token",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"in": "query",
|
||||
"name": "vendorID",
|
||||
"description": "门店所属的厂商ID",
|
||||
"required": true,
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
{
|
||||
"in": "query",
|
||||
"name": "amount",
|
||||
"description": "充值金额分",
|
||||
"required": true,
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
{
|
||||
"in": "query",
|
||||
"name": "category",
|
||||
"description": "链接场景[PC,H5]",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"in": "query",
|
||||
"name": "notifyUrl",
|
||||
"description": "成功跳转链接(支付宝有,微信没有)",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "{object} controllers.CallResult"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/store/BatchGetMTStoreLogos": {
|
||||
"get": {
|
||||
"tags": [
|
||||
@@ -18644,7 +18697,6 @@
|
||||
"in": "query",
|
||||
"name": "ranke",
|
||||
"description": "排序字段 order_count,desc",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
@@ -19650,7 +19702,6 @@
|
||||
"in": "query",
|
||||
"name": "ranke",
|
||||
"description": "排序字段 order_count,desc",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
@@ -20519,6 +20570,37 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/store/QueryPlatformBalance": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"store"
|
||||
],
|
||||
"description": "查询远程平台可以金额",
|
||||
"operationId": "StoreController.查询远程平台可以金额",
|
||||
"parameters": [
|
||||
{
|
||||
"in": "header",
|
||||
"name": "token",
|
||||
"description": "认证token",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"in": "query",
|
||||
"name": "vendorID",
|
||||
"description": "门店所属的厂商ID",
|
||||
"required": true,
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "{object} controllers.CallResult"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/store/RefreshJdLevel": {
|
||||
"post": {
|
||||
"tags": [
|
||||
|
||||
@@ -11953,6 +11953,43 @@ paths:
|
||||
responses:
|
||||
"200":
|
||||
description: '{object} controllers.CallResult'
|
||||
/store/BalanceRecharge:
|
||||
post:
|
||||
tags:
|
||||
- store
|
||||
description: 远程平台充值
|
||||
operationId: StoreController.远程平台充值
|
||||
parameters:
|
||||
- in: header
|
||||
name: token
|
||||
description: 认证token
|
||||
required: true
|
||||
type: string
|
||||
- in: query
|
||||
name: vendorID
|
||||
description: 门店所属的厂商ID
|
||||
required: true
|
||||
type: integer
|
||||
format: int64
|
||||
- in: query
|
||||
name: amount
|
||||
description: 充值金额分
|
||||
required: true
|
||||
type: integer
|
||||
format: int64
|
||||
- in: query
|
||||
name: category
|
||||
description: 链接场景[PC,H5]
|
||||
required: true
|
||||
type: string
|
||||
- in: query
|
||||
name: notifyUrl
|
||||
description: 成功跳转链接(支付宝有,微信没有)
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: '{object} controllers.CallResult'
|
||||
/store/BatchGetMTStoreLogos:
|
||||
get:
|
||||
tags:
|
||||
@@ -12658,7 +12695,6 @@ paths:
|
||||
- in: query
|
||||
name: ranke
|
||||
description: 排序字段 order_count,desc
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
@@ -13342,7 +13378,6 @@ paths:
|
||||
- in: query
|
||||
name: ranke
|
||||
description: 排序字段 order_count,desc
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
@@ -13932,6 +13967,27 @@ paths:
|
||||
responses:
|
||||
"200":
|
||||
description: '{object} controllers.CallResult'
|
||||
/store/QueryPlatformBalance:
|
||||
get:
|
||||
tags:
|
||||
- store
|
||||
description: 查询远程平台可以金额
|
||||
operationId: StoreController.查询远程平台可以金额
|
||||
parameters:
|
||||
- in: header
|
||||
name: token
|
||||
description: 认证token
|
||||
required: true
|
||||
type: string
|
||||
- in: query
|
||||
name: vendorID
|
||||
description: 门店所属的厂商ID
|
||||
required: true
|
||||
type: integer
|
||||
format: int64
|
||||
responses:
|
||||
"200":
|
||||
description: '{object} controllers.CallResult'
|
||||
/store/RefreshJdLevel:
|
||||
post:
|
||||
tags:
|
||||
|
||||
Reference in New Issue
Block a user