- 监控平台门店状态时,如果平台门店是自动接单的,改为非自动接单

This commit is contained in:
gazebo
2019-09-20 16:30:57 +08:00
parent b030168e07
commit f60554f514
4 changed files with 21 additions and 0 deletions

View File

@@ -1432,6 +1432,7 @@ func GetStoresVendorSnapshot(ctx *jxcontext.Context, parentTask tasksch.ITask, v
DeliveryType: store.DeliveryType,
StoreName: store.OriginalName,
IsAutoOrder: store.IsAutoOrder,
}}
}
}
@@ -1483,6 +1484,18 @@ func updateVendorStoreStatusBySnapshot(db *dao.DaoDB, curSnapshotList []*model.V
}
}
dao.Commit(db)
utils.CallFuncAsync(func() {
for _, v := range storeMapList {
if snapshot := snapshotMap[jxutils.Combine2Int(v.StoreID, v.VendorID)]; snapshot != nil {
if snapshot.IsAutoOrder == 1 {
if handler, ok := partner.GetPurchasePlatformFromVendorID(snapshot.VendorID).(partner.IStoreHandler); ok {
handler.EnableAutoAcceptOrder(jxcontext.AdminCtx, v.StoreID, v.VendorStoreID, false)
}
}
}
}
})
return err
}

View File

@@ -30,6 +30,8 @@ type StoreDetail struct {
DistrictName string `json:"districtName"`
CityName string `json:"cityName"`
IsAutoOrder int8 `json:"isAutoOrder"` // 平台是否自动接单,-10未知1
}
// 带快递门店信息的

View File

@@ -412,6 +412,7 @@ type VendorStoreSnapshot struct {
CloseTime2 int16 `json:"closeTime2"` // 格式同上
DeliveryType int8 `orm:"default(0)" json:"deliveryType"` // 配送类型
StoreName string `orm:"size(255)" json:"storeName"` // 平台门店的名字
IsAutoOrder int8 `json:"isAutoOrder"` // 平台是否自动接单,-10未知1
}
func (*VendorStoreSnapshot) TableUnique() [][]string {

View File

@@ -46,6 +46,11 @@ func (p *PurchaseHandler) ReadStore(ctx *jxcontext.Context, vendorStoreID string
Tel1: result.Phone,
},
}
if result.IsAutoOrder == 0 {
retVal.IsAutoOrder = 1
} else {
retVal.IsAutoOrder = -1
}
retVal.OriginalName = result.StationName
_, retVal.Name = jxutils.SplitStoreName(retVal.OriginalName, partner.StoreNameSeparator, VendorStorePrefix)
retVal.DeliveryType = JdDeliveryType2Jx(result.CarrierNo)