!!!门店相关的API全部添加vendorOrgCode依赖
This commit is contained in:
@@ -40,7 +40,7 @@ type tEbaiStoreInfo struct {
|
||||
DistrictID int `orm:"column(district_id)"`
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) ReadStore(ctx *jxcontext.Context, vendorStoreID string) (retVal *dao.StoreDetail, err error) {
|
||||
func (p *PurchaseHandler) ReadStore(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID string) (retVal *dao.StoreDetail, err error) {
|
||||
result, err := api.MtwmAPI.PoiGet(vendorStoreID)
|
||||
if err == nil {
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(result, false))
|
||||
@@ -135,7 +135,7 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
|
||||
// if utils.IsErrMatch(err, utils.Int2Str(mtwmapi.ErrCodeCanNotModifyStoreDeliveryInfo), nil) {
|
||||
// globals.SugarLogger.Infof("mtwm UpdateStore vendorStoreID:%s, params:%s failed with err:%v", storeDetail.VendorStoreID, utils.Format4Output(params, true), err)
|
||||
// if storeDetail.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreStatus) != 0 {
|
||||
// err = p.UpdateStoreStatus(jxcontext.AdminCtx, storeID, storeDetail.VendorStoreID, mergedStoreStatus)
|
||||
// err = p.UpdateStoreStatus(jxcontext.AdminCtx, storeDetail.VendorOrgCode, storeID, storeDetail.VendorStoreID, mergedStoreStatus)
|
||||
// } else {
|
||||
// err = nil
|
||||
// }
|
||||
@@ -143,9 +143,9 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
|
||||
// errList.AddErr(err)
|
||||
// }
|
||||
if storeDetail.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreStatus) != 0 {
|
||||
errList.AddErr(p.UpdateStoreStatus(jxcontext.AdminCtx, storeID, storeDetail.VendorStoreID, mergedStoreStatus))
|
||||
errList.AddErr(p.UpdateStoreStatus(jxcontext.AdminCtx, storeDetail.VendorOrgCode, storeID, storeDetail.VendorStoreID, mergedStoreStatus))
|
||||
}
|
||||
errList.AddErr(p.UpdateStoreOpTime(jxcontext.AdminCtx, storeID, storeDetail.VendorStoreID, storeDetail.GetOpTimeList()))
|
||||
errList.AddErr(p.UpdateStoreOpTime(jxcontext.AdminCtx, storeDetail.VendorOrgCode, storeID, storeDetail.VendorStoreID, storeDetail.GetOpTimeList()))
|
||||
return errList.GetErrListAsOne()
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ func (p *PurchaseHandler) onStoreStatusChanged(msg *mtwmapi.CallbackMsg) (respon
|
||||
} else if poiStatus == mtwmapi.MsgPoiStatusOffline {
|
||||
storeStatus = model.StoreStatusDisabled
|
||||
} else {
|
||||
storeStatus, err = p.GetStoreStatus(jxcontext.AdminCtx, 0, vendorStoreID)
|
||||
storeStatus, err = p.GetStoreStatus(jxcontext.AdminCtx, "", 0, vendorStoreID)
|
||||
}
|
||||
if err == nil {
|
||||
err = partner.CurStoreManager.OnStoreStatusChanged(vendorStoreID, model.VendorIDMTWM, storeStatus)
|
||||
@@ -174,7 +174,7 @@ func (p *PurchaseHandler) onStoreStatusChanged(msg *mtwmapi.CallbackMsg) (respon
|
||||
return response
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) GetStoreStatus(ctx *jxcontext.Context, storeID int, vendorStoreID string) (storeStatus int, err error) {
|
||||
func (p *PurchaseHandler) GetStoreStatus(ctx *jxcontext.Context, vendorOrgCode string, storeID int, vendorStoreID string) (storeStatus int, err error) {
|
||||
result, err := api.MtwmAPI.PoiGet(vendorStoreID)
|
||||
if err == nil {
|
||||
return bizStatusMtwm2JX(result.OpenLevel, result.IsOnline), nil
|
||||
@@ -182,11 +182,11 @@ func (p *PurchaseHandler) GetStoreStatus(ctx *jxcontext.Context, storeID int, ve
|
||||
return 0, err
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) EnableAutoAcceptOrder(ctx *jxcontext.Context, storeID int, vendorStoreID string, isSetEnable bool) (err error) {
|
||||
func (p *PurchaseHandler) EnableAutoAcceptOrder(ctx *jxcontext.Context, vendorOrgCode string, storeID int, vendorStoreID string, isSetEnable bool) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) UpdateStoreStatus(ctx *jxcontext.Context, storeID int, vendorStoreID string, status int) (err error) {
|
||||
func (c *PurchaseHandler) UpdateStoreStatus(ctx *jxcontext.Context, vendorOrgCode string, storeID int, vendorStoreID string, status int) (err error) {
|
||||
openLevel, isOnline := bizStatusJX2Mtwm(status)
|
||||
if globals.EnableMtwmStoreWrite {
|
||||
if isOnline != mtwmapi.PoiStatusOnline {
|
||||
@@ -255,7 +255,7 @@ func constrainOpTimeList(opTimeList, validOpTimeList []int16) (newOpTimeList []i
|
||||
return newOpTimeList
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) UpdateStoreOpTime(ctx *jxcontext.Context, storeID int, vendorStoreID string, opTimeList []int16) (err error) {
|
||||
func (c *PurchaseHandler) UpdateStoreOpTime(ctx *jxcontext.Context, vendorOrgCode string, storeID int, vendorStoreID string, opTimeList []int16) (err error) {
|
||||
shippingTime := openTimeJX2Mtwm(opTimeList)
|
||||
if globals.EnableMtwmStoreWrite {
|
||||
err = api.MtwmAPI.PoiShipTimeUpdate(vendorStoreID, shippingTime)
|
||||
@@ -272,11 +272,11 @@ func (c *PurchaseHandler) UpdateStoreOpTime(ctx *jxcontext.Context, storeID int,
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) GetAllStoresVendorID(ctx *jxcontext.Context) (vendorStoreIDs []string, err error) {
|
||||
func (c *PurchaseHandler) GetAllStoresVendorID(ctx *jxcontext.Context, vendorOrgCode string) (vendorStoreIDs []string, err error) {
|
||||
vendorStoreIDs, err = api.MtwmAPI.PoiGetIDs()
|
||||
return vendorStoreIDs, err
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) UpdateStoreCustomID(ctx *jxcontext.Context, vendorStoreID string, storeID int64) (err error) {
|
||||
func (c *PurchaseHandler) UpdateStoreCustomID(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID string, storeID int64) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user