assistcreatefence
This commit is contained in:
@@ -6014,3 +6014,16 @@ func GetVendorOrgCode(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendorID i
|
||||
}
|
||||
return storeMap, dao.GetEntitiesByKV(db, &storeMap, cond, false)
|
||||
}
|
||||
|
||||
//辅助创建电子围栏
|
||||
func AssistCreateFence(appOrgCode string, storeID int64) error {
|
||||
//创建前检查 暂时不支持
|
||||
if fenceID, err := tiktok_store.CreateFenceByStore(appOrgCode, storeID); err != nil {
|
||||
return errors.New(fmt.Sprintf("创建电子围栏失败:%v", err))
|
||||
} else {
|
||||
if err := tiktok_store.BindFenceByStore(appOrgCode, storeID, []string{fenceID}); err != nil {
|
||||
return errors.New(fmt.Sprintf("绑定电子围栏失败:%v", err))
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -168,18 +168,6 @@ func CreateFenceByStore(appOrgCode string, storeID int64) (fenceID string, err e
|
||||
}
|
||||
}
|
||||
|
||||
//直接创建电子围栏方式 暂时未使用
|
||||
func CreateFenceDirectly(param warehouse_createFence_request.WarehouseCreateFenceParam) (fenceID string, err error) {
|
||||
info := &warehouse_createFence_request.WarehouseCreateFenceParam{
|
||||
FenceInfo: param.FenceInfo,
|
||||
}
|
||||
resp, err := getAPI("", 0, "").CreateFence(info)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return resp.FenceId, err
|
||||
}
|
||||
|
||||
// 通过门店更新电子围栏
|
||||
func UpdateFenceByStore(appOrgCode, outFenceID string, storeID int) error {
|
||||
var (
|
||||
|
||||
@@ -1508,11 +1508,17 @@ func (c *StoreController) GetDDScope() {
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 批量绑定抖店与京西门店
|
||||
// @Description 批量绑定抖店与京西门店
|
||||
// @Param token header string true "认证token"
|
||||
// @Param storeID formData int true "门店ID"
|
||||
// @Param vendorStoreID formData string true "平台门店ID"
|
||||
// @Title 创建抖店电子围栏
|
||||
// @Description 创建抖店电子围栏
|
||||
// @Param token header string true "认证token"
|
||||
// @Param storeID formData int true "门店ID"
|
||||
// @Param vendorOrgCode formData string false "厂商内组织代码"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /BatchBindVendorStore [post]
|
||||
// @router /CreateDDStoreFence [post]
|
||||
func (c *StoreController) CreateDDStoreFence() {
|
||||
c.callCreateDDStoreFence(func(params *tStoreCreateDDStoreFenceParams) (interface{}, string, error) {
|
||||
err := cms.AssistCreateFence(params.VendorOrgCode, int64(params.StoreID))
|
||||
return nil, "", err
|
||||
})
|
||||
}
|
||||
|
||||
@@ -2953,6 +2953,15 @@ func init() {
|
||||
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: "AssistCreateFence",
|
||||
Router: `/AssistCreateFence`,
|
||||
AllowHTTPMethods: []string{"post"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreSkuController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreSkuController"],
|
||||
web.ControllerComments{
|
||||
Method: "BackUpStoreSkuBind",
|
||||
|
||||
Reference in New Issue
Block a user