This commit is contained in:
richboo111
2023-01-04 18:32:37 +08:00
parent 1bbebdb773
commit adad91cd52
9 changed files with 231 additions and 61 deletions

View File

@@ -6102,6 +6102,28 @@ func BatchCreateFreeShipTemplate(relInfo map[string][]tiktok_store.RelInfo, ship
return "", nil
}
//批量配置抖音门店自动呼叫运力
func SetStoreAutoCallRider(vendorOrgCode string, openIDs, closeIDs []int64) (string, error) {
var errList errlist.ErrList
if len(openIDs) > 0 {
for _, i := range openIDs {
if err := tiktok_store.SetStoreAutoCallRider(vendorOrgCode, tiktok_api.AutoCallRiderOpen, i); err != nil {
errList.AddErr(fmt.Errorf("%d", i))
}
}
}
if len(closeIDs) > 0 {
for _, j := range closeIDs {
if err := tiktok_store.SetStoreAutoCallRider(vendorOrgCode, tiktok_api.AutoCallRiderClose, j); err != nil {
errList.AddErr(fmt.Errorf("%d", j))
}
}
}
if errList.GetErrListAsOne() != nil {
return fmt.Sprintf("部分门店设置自动运力失败:%s", utils.Format4Output(errList.GetErrListAsOne(), false)), nil
}
return "", nil
}
func GetVendorStoreBind(vendorStoreId string, vendorId int) (int, error) {
return dao.GetCodeAndIDByMeiTuan(vendorStoreId, vendorId)
}