“1”
This commit is contained in:
@@ -6334,6 +6334,22 @@ func SetStoreAutoCallRider(vendorOrgCode string, openIDs, closeIDs []int64) (str
|
||||
return "", nil
|
||||
}
|
||||
|
||||
// CreateDDWarehouse 创建抖音门店区域仓
|
||||
func CreateDDWarehouse(vendorOrgCode string, vendorStoreID, storeID int64) error {
|
||||
bind, err := tiktok_store.GetWarehouseByStore(vendorOrgCode, vendorStoreID)
|
||||
if err == nil && bind[utils.Int64ToStr(storeID)][0].WarehouseId > 0 {
|
||||
return nil
|
||||
}
|
||||
if warehouseID, err := tiktok_store.CreateWarehouse(vendorOrgCode, storeID); err != nil || warehouseID == 0 {
|
||||
return fmt.Errorf("门店(%d) 创建仓库失败:%v", storeID, err)
|
||||
} else {
|
||||
if err = tiktok_store.BindStoreWarehouse(vendorOrgCode, utils.Int64ToStr(storeID), vendorStoreID); err != nil { //仓库绑定通过自定义外部ID
|
||||
return fmt.Errorf("门店(%d) 绑定仓库%d 失败:%v", storeID, warehouseID, err)
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
type MtRelInfo struct {
|
||||
PoiCode string `json:"poi_code"`
|
||||
PicUrl string `json:"pic_url"`
|
||||
|
||||
@@ -83,11 +83,9 @@ func ReadMsgFromClient(vendorID int, elmAppID string, msg interface{}) error {
|
||||
LatestTime: pushContent.Cts,
|
||||
OrderID: "",
|
||||
}
|
||||
globals.SugarLogger.Debugf("ReadMsgFromClient pushContent.OrderID=%d", pushContent.OrderID)
|
||||
if pushContent.OrderID != 0 {
|
||||
userList.OrderID = utils.Int2Str(pushContent.OrderID)
|
||||
}
|
||||
globals.SugarLogger.Debugf("ReadMsgFromClient userList=%s", utils.Format4Output(userList, false))
|
||||
}
|
||||
if vendorID == VendorIDELM {
|
||||
var ElmData = ebaiapi.ImMessageSend{}
|
||||
@@ -147,13 +145,10 @@ func ReadMsgFromVendor(vendorID int, elmAppID string, msg []byte) error {
|
||||
LatestTime: PushContentReq.Cts,
|
||||
OrderID: "",
|
||||
}
|
||||
globals.SugarLogger.Debugf("ReadMsgFromVendor PushContentReq.OrderID=%d", PushContentReq.OrderID)
|
||||
|
||||
vendorStoreID = PushContentReq.AppPoiCode
|
||||
if PushContentReq.OrderID != 0 {
|
||||
userList.OrderID = utils.Int2Str(PushContentReq.OrderID)
|
||||
}
|
||||
globals.SugarLogger.Debugf("ReadMsgFromVendor userList=%s", utils.Format4Output(userList, false))
|
||||
}
|
||||
if vendorID == VendorIDELM {
|
||||
var ElmData = ebaiapi.ImMessageSend{}
|
||||
|
||||
@@ -1593,6 +1593,22 @@ func (c *StoreController) GetStoreAutoCallRiderInfo() {
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 创建绑定抖音区域仓
|
||||
// @Description 创建绑定抖音区域仓
|
||||
// @Param token header string true "认证token"
|
||||
// @Param vendorOrgCode formData string true "抖音门店总账号"
|
||||
// @Param vendorStoreID formData int64 true "抖音门店总账号"
|
||||
// @Param storeID formData int64 true "抖音门店ID"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /CreateDDWarehouse [post]
|
||||
func (c *StoreController) CreateDDWarehouse() {
|
||||
c.callCreateDDWarehouse(func(params *tStoreCreateDDWarehouseParams) (interface{}, string, error) {
|
||||
err := cms.CreateDDWarehouse(params.VendorOrgCode, int64(params.VendorStoreID), int64(params.StoreID))
|
||||
return nil, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 打印机获取授权账号再京西菜市的绑定关系(其实就是根据平台门店id获取绑定门店id)
|
||||
// @Description 打印机获取授权账号再京西菜市的绑定关系
|
||||
// @Param token header string true "认证token"
|
||||
|
||||
@@ -3125,6 +3125,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: "CreateDDWarehouse",
|
||||
Router: `/CreateDDWarehouse`,
|
||||
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{
|
||||
|
||||
Reference in New Issue
Block a user