- cms store management.
This commit is contained in:
@@ -5,10 +5,12 @@ import (
|
||||
"strings"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
"git.rosy.net.cn/jx-callback/globals/gormdb"
|
||||
)
|
||||
|
||||
func (p *PurchaseHandler) ReadStore(vendorStoreID string) (*model.Store, error) {
|
||||
@@ -22,7 +24,25 @@ func (p *PurchaseHandler) ReadStore(vendorStoreID string) (*model.Store, error)
|
||||
OpenTime2: JdOperationTime2JxOperationTime(result["serviceTimeStart2"]),
|
||||
CloseTime2: JdOperationTime2JxOperationTime(result["serviceTimeEnd2"]),
|
||||
Status: JdStoreStatus2JxStatus(result["yn"], result["closeStatus"]),
|
||||
Tel1: utils.Interface2String(result["phone"]),
|
||||
}
|
||||
tel2 := utils.Interface2String(result["mobile"])
|
||||
if tel2 != "" && tel2 != retVal.Tel1 {
|
||||
retVal.Tel2 = tel2
|
||||
}
|
||||
cityCode := int(utils.MustInterface2Int64(result["city"]))
|
||||
if cityCode != 0 {
|
||||
db := gormdb.GetDB()
|
||||
if city, err2 := dao.GetPlaceByJdCode(db, cityCode); err2 == nil {
|
||||
retVal.CityCode = city.Code
|
||||
districtName := utils.Interface2String(result["countyName"]) // 京东的市区号码与通用数据完全无法关联,只有通过名字来关联
|
||||
if district, err2 := dao.GetPlaceByName(db, districtName, 3, city.Code); err2 == nil {
|
||||
retVal.DistrictCode = district.Code
|
||||
}
|
||||
}
|
||||
}
|
||||
retVal.Lng = jxutils.StandardCoordinate2Int(utils.MustInterface2Float64(result["lng"]))
|
||||
retVal.Lat = jxutils.StandardCoordinate2Int(utils.MustInterface2Float64(result["lat"]))
|
||||
|
||||
retVal.ID = int(utils.Str2Int64WithDefault(utils.Interface2String(result["outSystemId"]), 0))
|
||||
result, err2 := api.JdAPI.GetDeliveryRangeByStationNo(vendorStoreID)
|
||||
|
||||
Reference in New Issue
Block a user