- 门店同步状态区分名称与配送相关的部分,分开同步
This commit is contained in:
@@ -359,31 +359,35 @@ func JxBusinessTime2Ebai(store *model.Store) interface{} {
|
||||
|
||||
func genStoreMapFromStore(store *tEbaiStoreInfo) map[string]interface{} {
|
||||
params := map[string]interface{}{
|
||||
// "name": jxutils.ComposeStoreName(store.Name, model.VendorIDEBAI),
|
||||
"phone": store.Tel1,
|
||||
"longitude": jxutils.IntCoordinate2Standard(store.Lng),
|
||||
"latitude": jxutils.IntCoordinate2Standard(store.Lat),
|
||||
"address": store.Address,
|
||||
"coord_type": ebaiapi.CoordTypeAutonavi, // 一直用高德
|
||||
"business_time": JxBusinessTime2Ebai(&store.Store),
|
||||
}
|
||||
if deliveryRegion := JxDeliveryRegion2Ebai(&store.Store); deliveryRegion != nil {
|
||||
params["delivery_region"] = deliveryRegion
|
||||
}
|
||||
if store.VendorStoreID != "" {
|
||||
params["baidu_shop_id"] = store.VendorStoreID
|
||||
}
|
||||
if store.Tel2 != "" {
|
||||
params["ivr_phone"] = store.Tel2
|
||||
}
|
||||
if store.ProvinceID != 0 {
|
||||
params["province"] = store.ProvinceID
|
||||
if store.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreName) != 0 {
|
||||
// params["name"] = jxutils.ComposeStoreName(store.Name, model.VendorIDEBAI)
|
||||
}
|
||||
if store.CityID != 0 {
|
||||
params["city"] = store.CityID
|
||||
}
|
||||
if store.DistrictID != 0 {
|
||||
params["county"] = store.DistrictID
|
||||
if store.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreAddress) != 0 {
|
||||
params["longitude"] = jxutils.IntCoordinate2Standard(store.Lng)
|
||||
params["latitude"] = jxutils.IntCoordinate2Standard(store.Lat)
|
||||
params["address"] = store.Address
|
||||
params["coord_type"] = ebaiapi.CoordTypeAutonavi
|
||||
if deliveryRegion := JxDeliveryRegion2Ebai(&store.Store); deliveryRegion != nil {
|
||||
params["delivery_region"] = deliveryRegion
|
||||
}
|
||||
if store.ProvinceID != 0 {
|
||||
params["province"] = store.ProvinceID
|
||||
}
|
||||
if store.CityID != 0 {
|
||||
params["city"] = store.CityID
|
||||
}
|
||||
if store.DistrictID != 0 {
|
||||
params["county"] = store.DistrictID
|
||||
}
|
||||
}
|
||||
return params
|
||||
}
|
||||
|
||||
@@ -113,29 +113,32 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
|
||||
}
|
||||
params := map[string]interface{}{
|
||||
"outSystemId": outSystemID, // todo 直接修改这个字段可能会有问题
|
||||
"stationName": jxutils.ComposeStoreName(store.Name, model.VendorIDJD),
|
||||
"stationAddress": store.Address,
|
||||
"serviceTimeStart1": JxOperationTime2JdOperationTime(store.OpenTime1),
|
||||
"serviceTimeEnd1": JxOperationTime2JdOperationTime(store.CloseTime1),
|
||||
"deliveryRangeType": store.DeliveryRangeType,
|
||||
"coordinateType": 3, // 一直用高德
|
||||
"lng": jxutils.IntCoordinate2Standard(store.Lng),
|
||||
"lat": jxutils.IntCoordinate2Standard(store.Lat),
|
||||
"phone": store.Tel1,
|
||||
"mobile": store.Tel2,
|
||||
}
|
||||
if store.JdCityCode != 0 {
|
||||
params["city"] = store.JdCityCode
|
||||
if store.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreName) != 0 {
|
||||
params["stationName"] = jxutils.ComposeStoreName(store.Name, model.VendorIDJD)
|
||||
}
|
||||
if store.JdDistrictCode != 0 {
|
||||
params["county"] = store.JdDistrictCode
|
||||
if store.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreAddress) != 0 {
|
||||
params["stationAddress"] = store.Address
|
||||
params["deliveryRangeType"] = store.DeliveryRangeType
|
||||
params["coordinateType"] = 3 // 一直用高德
|
||||
params["lng"] = jxutils.IntCoordinate2Standard(store.Lng)
|
||||
params["lat"] = jxutils.IntCoordinate2Standard(store.Lat)
|
||||
if store.JdCityCode != 0 {
|
||||
params["city"] = store.JdCityCode
|
||||
}
|
||||
if store.JdDistrictCode != 0 {
|
||||
params["county"] = store.JdDistrictCode
|
||||
}
|
||||
if store.DeliveryRangeType == model.DeliveryRangeTypePolygon {
|
||||
params["coordinatePoints"] = store.DeliveryRange
|
||||
} else {
|
||||
params["deliveryRangeRadius"] = utils.Str2Int64(store.DeliveryRange)
|
||||
}
|
||||
}
|
||||
if store.DeliveryRangeType == model.DeliveryRangeTypePolygon {
|
||||
params["coordinatePoints"] = store.DeliveryRange
|
||||
} else {
|
||||
params["deliveryRangeRadius"] = utils.Str2Int64(store.DeliveryRange)
|
||||
}
|
||||
|
||||
openTime2 := JxOperationTime2JdOperationTime(store.OpenTime2)
|
||||
if openTime2 != 0 {
|
||||
params["serviceTimeStart2"] = openTime2
|
||||
|
||||
@@ -113,14 +113,16 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
|
||||
}
|
||||
params := map[string]interface{}{
|
||||
"name": utils.Interface2String(remoteStoreInfo["name"]), //jxutils.ComposeStoreName(storeDetail.Store.Name, model.VendorIDMTWM),
|
||||
"address": storeDetail.Address,
|
||||
"longitude": jxutils.IntCoordinate2Standard(storeDetail.Lng),
|
||||
"latitude": jxutils.IntCoordinate2Standard(storeDetail.Lat),
|
||||
"phone": storeDetail.Tel1,
|
||||
"shipping_fee": jxutils.IntPrice2Standard(int64(storeDetail.DeliveryFee)),
|
||||
"shipping_time": openTimeJX2Mtwm(openTime),
|
||||
"third_tag_name": "蔬菜",
|
||||
}
|
||||
if storeDetail.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreAddress) != 0 {
|
||||
params["address"] = storeDetail.Address
|
||||
params["longitude"] = jxutils.IntCoordinate2Standard(storeDetail.Lng)
|
||||
params["latitude"] = jxutils.IntCoordinate2Standard(storeDetail.Lat)
|
||||
}
|
||||
params["open_level"], params["is_online"] = bizStatusJX2Mtwm(jxutils.MergeStoreStatus(storeDetail.Status, storeDetail.VendorStatus))
|
||||
globals.SugarLogger.Debug(utils.Format4Output(params, false))
|
||||
if globals.EnableStoreWrite && globals.EnableMtwmStoreWrite {
|
||||
|
||||
Reference in New Issue
Block a user