- RefreshMissingDadaStores检查城市码和区码
This commit is contained in:
@@ -873,6 +873,9 @@ func RefreshMissingDadaStores(ctx *jxcontext.Context, storeID int, isAsync, isCo
|
||||
storeDetail := batchItemList[0].(*dao.StoreDetail2)
|
||||
var resultList []interface{}
|
||||
if storeDetail.DadaStoreID == "" {
|
||||
if storeDetail.DistrictName == "" || storeDetail.CityName == "" {
|
||||
return nil, fmt.Errorf("门店:%s的城市码或区码有错误", storeDetail.Name)
|
||||
}
|
||||
db := dao.GetDB()
|
||||
if _, err = AddStoreCourierMap(ctx, db, storeDetail.ID, model.VendorIDDada, &model.StoreCourierMap{
|
||||
VendorStoreID: utils.Int2Str(storeDetail.ID),
|
||||
@@ -896,6 +899,12 @@ func RefreshMissingDadaStores(ctx *jxcontext.Context, storeID int, isAsync, isCo
|
||||
}
|
||||
|
||||
func updateOrCreateDadaStore(storeDetail *dao.StoreDetail2) (err error) {
|
||||
if storeDetail.DistrictName == "" {
|
||||
return fmt.Errorf("门店的区码有问题,请检查")
|
||||
}
|
||||
if storeDetail.CityName == "" {
|
||||
return fmt.Errorf("门店的城市码有问题,请检查")
|
||||
}
|
||||
if globals.EnableStoreWrite {
|
||||
_, err = api.DadaAPI.ShopDetail(storeDetail.DadaStoreID)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user