1
This commit is contained in:
@@ -12,8 +12,6 @@ import (
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils/errlist"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/event"
|
||||
@@ -85,12 +83,13 @@ type Point struct {
|
||||
}
|
||||
|
||||
// UpdateTxdStore 单独更新淘鲜达门店营业时间/状态 销售范围
|
||||
func UpdateTxdStore(store TxdStore) (err error) {
|
||||
func UpdateTxdStore(store TxdStore, vendorOrgCode string) (err error) {
|
||||
a := getAPI(vendorOrgCode, 0, "")
|
||||
errList := errlist.New()
|
||||
for _, v := range store.Flag {
|
||||
switch v {
|
||||
case FlagStatus:
|
||||
if err = api.TaoVegetableApi.ShopUpdateStatus(store.TxdStoreID, store.Status); err != nil {
|
||||
if err = a.ShopUpdateStatus(store.TxdStoreID, store.Status); err != nil {
|
||||
errList.AddErr(fmt.Errorf("营业状态:%v", err))
|
||||
}
|
||||
case FlagBusinessTime:
|
||||
@@ -98,7 +97,7 @@ func UpdateTxdStore(store TxdStore) (err error) {
|
||||
return errors.New("更新营业时间,时间必填")
|
||||
}
|
||||
if CheckBusinessTime(store.StartTime, store.EndTime) {
|
||||
if err = api.TaoVegetableApi.ShopUpdateInfo(store.TxdStoreID, store.StartTime, store.EndTime); err != nil {
|
||||
if err = a.ShopUpdateInfo(store.TxdStoreID, store.StartTime, store.EndTime); err != nil {
|
||||
errList.AddErr(fmt.Errorf("营业时间:%v", err))
|
||||
}
|
||||
}
|
||||
@@ -107,7 +106,7 @@ func UpdateTxdStore(store TxdStore) (err error) {
|
||||
return errors.New("更新营业范围,坐标必填")
|
||||
}
|
||||
point := GetPoints(store.Points)
|
||||
if err = api.TaoVegetableApi.ShopUpdateRange(store.TxdStoreID, point); err != nil {
|
||||
if err = a.ShopUpdateRange(store.TxdStoreID, point); err != nil {
|
||||
errList.AddErr(fmt.Errorf("营业范围:%v", err))
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -1682,6 +1682,7 @@ func (c *StoreController) SingleBindTaoVegetable() {
|
||||
// @Title 更新淘鲜达门店信息
|
||||
// @Description 更新淘鲜达门店信息
|
||||
// @Param token header string true "认证token"
|
||||
// @Param vendorOrgCode formData string true "平台账号"
|
||||
// @Param txdStores formData string true "TxdStore"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
@@ -1692,7 +1693,7 @@ func (c *StoreController) UpdateTxdStore() {
|
||||
b := bytes.NewBufferString(params.TxdStores)
|
||||
decoder := json.NewDecoder(b)
|
||||
if err = decoder.Decode(&taoStore); err == nil {
|
||||
err = tao_vegetable.UpdateTxdStore(taoStore)
|
||||
err = tao_vegetable.UpdateTxdStore(taoStore, params.VendorOrgCode)
|
||||
}
|
||||
return nil, "", err
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user