- 重构配送门店管理

This commit is contained in:
gazebo
2019-07-23 14:29:58 +08:00
parent 79d81fdd73
commit 22737c7681
13 changed files with 325 additions and 159 deletions

View File

@@ -130,7 +130,7 @@ func StoreDetail2ShopInfo(storeDetail *dao.StoreDetail2) (shopInfo *dadaapi.Shop
}
}
shopInfo = &dadaapi.ShopInfo{
OriginShopID: utils.Int2Str(storeDetail.ID),
OriginShopID: storeDetail.VendorStoreID,
StationName: storeDetail.CourierStoreName,
CityName: cityName,
AreaName: districtName,
@@ -160,6 +160,31 @@ func (c *DeliveryHandler) UpdateStore(ctx *jxcontext.Context, storeDetail *dao.S
return err
}
func (c *DeliveryHandler) GetStore(ctx *jxcontext.Context, storeID int, vendorStoreID string) (storeDetail *dao.StoreDetail2, err error) {
shopInfo, err := api.DadaAPI.ShopDetail(vendorStoreID)
if err == nil {
storeDetail = &dao.StoreDetail2{
Store: model.Store{
Address: shopInfo.StationAddress,
Lng: jxutils.StandardCoordinate2Int(shopInfo.Lng),
Lat: jxutils.StandardCoordinate2Int(shopInfo.Lat),
PayeeName: shopInfo.ContactName,
Tel1: shopInfo.Phone,
},
VendorID: model.VendorIDDada,
VendorStoreID: shopInfo.OriginShopID,
CourierStoreName: shopInfo.StationName,
CityName: shopInfo.CityName,
DistrictName: shopInfo.AreaName,
}
}
return storeDetail, err
}
func (c *DeliveryHandler) IsErrStoreNotExist(err error) bool {
return dadaapi.IsErrShopNotExist(err)
}
func (c *DeliveryHandler) GetWaybillFee(order *model.GoodsOrder) (deliveryFeeInfo *partner.WaybillFeeInfo, err error) {
db := dao.GetDB()
deliveryFeeInfo = &partner.WaybillFeeInfo{}