This commit is contained in:
richboo111
2023-01-05 18:31:08 +08:00
parent adad91cd52
commit 3bc119ab21
5 changed files with 75 additions and 23 deletions

View File

@@ -6120,10 +6120,19 @@ func SetStoreAutoCallRider(vendorOrgCode string, openIDs, closeIDs []int64) (str
}
}
if errList.GetErrListAsOne() != nil {
return fmt.Sprintf("部分门店置自动运力失败:%s", utils.Format4Output(errList.GetErrListAsOne(), false)), nil
return fmt.Sprintf("部分门店置自动运力失败:%s", utils.Format4Output(errList.GetErrListAsOne(), false)), nil
}
return "", nil
}
//辅助函数
func String2Array(data string) (retVal []int64) {
temp := strings.Split(data, ",")
for _, v := range temp {
retVal = append(retVal, utils.Str2Int64(v))
}
return retVal
}
func GetVendorStoreBind(vendorStoreId string, vendorId int) (int, error) {
return dao.GetCodeAndIDByMeiTuan(vendorStoreId, vendorId)
}

View File

@@ -1,10 +1,12 @@
package tiktok_store
import (
"errors"
superm_getStoreAutoCallRiderInfo_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/superm_getStoreAutoCallRiderInfo/response"
superm_setStoreAutoCallRider_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/superm_setStoreAutoCallRider/request"
"git.rosy.net.cn/baseapi/platformapi/tiktok_shop/tiktok_api"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/baseapi/utils/errlist"
"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"
@@ -86,11 +88,21 @@ func SetStoreAutoCallRider(vendorOrgCode, opType string, storeID int64) error {
return nil
}
//查询查询自动呼叫运力配置
func GetStoreAutoCallRiderInfo(vendorOrgCode string, storeID int64) (autoCallInfo *superm_getStoreAutoCallRiderInfo_response.AutoCallInfo, err error) {
if autoCallInfo, err = getAPI(vendorOrgCode, 0, "").GetStoreAutoCallRiderInfo(storeID); err != nil {
return nil, err
} else {
return autoCallInfo, err
//批量查询自动呼叫运力配置
func GetStoreAutoCallRiderInfo(vendorOrgCode string, storeIDs []int64) (autoCallInfos map[int64]*superm_getStoreAutoCallRiderInfo_response.AutoCallInfo, err error) {
if len(storeIDs) == 0 {
return nil, errors.New("门店ID为空请检查")
}
errList := errlist.ErrList{}
for _, i := range storeIDs {
if autoCallInfo, err := getAPI(vendorOrgCode, 0, "").GetStoreAutoCallRiderInfo(i); err != nil {
errList.AddErr(err)
} else {
autoCallInfos[i] = autoCallInfo
}
}
if errList.GetErrListAsOne() != nil {
return nil, errList.GetErrListAsOne()
}
return autoCallInfos, nil
}