This commit is contained in:
richboo111
2023-04-25 10:39:28 +08:00
57 changed files with 1242 additions and 260 deletions

View File

@@ -158,5 +158,36 @@ func (p *PurchaseHandler) GetVendorCategories(ctx *jxcontext.Context) (vendorCat
}
func (p *PurchaseHandler) GetOrderRider(vendorOrgCode, vendorStoreID string, param map[string]interface{}) (err error) {
return nil
selfStatus := 0
switch param["logistics_status"].(int) {
case 0:
selfStatus = 2 // 2:配送待分配
case 12:
selfStatus = 3 // 骑士接单
case 15:
selfStatus = 8 // 骑士到店
case 20:
selfStatus = 20 // 骑手送出
case 40:
selfStatus = 30 // 配送完成
default:
selfStatus = 7 // 配送异常
}
param2 := &ebaiapi.PushRiderInfo{
DistributorId: 201,
OrderId: param["order_id"].(string),
State: 21,
SelfStatus: selfStatus,
SelfStatusDesc: param["logistics_context"].(string),
DistributorInfoDTO: ebaiapi.DistributorInfoDTO{
DistributorTypeId: "99999",
DistributorName: "商家自行配送",
},
Knight: ebaiapi.Knight{
Id: utils.Str2Int64(param["order_id"].(string)),
Name: param["courier_name"].(string),
Phone: param["courier_phone"].(string),
},
}
return api.EbaiAPI.OrderselfDeliveryStateSync2(param2)
}

View File

@@ -522,6 +522,9 @@ func (c *PurchaseHandler) onOrderNew(msg *ebaiapi.CallbackMsg, orderStatus *mode
})
}
}
if handler := partner.GetPurchaseOrderHandlerFromVendorID(model.VendorIDEBAI); handler != nil {
handler.AcceptOrRefuseOrder(order, true, "jxAdmin")
}
return api.EbaiAPI.Err2CallbackResponse(msg.Cmd, err, map[string]interface{}{
"source_order_id": vendorOrderID,
})

View File

@@ -270,7 +270,6 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
if err == nil {
if shopID > 0 {
err = p.UpdateStoreCustomID(jxcontext.AdminCtx, "", store.VendorStoreID, int64(shopID))
globals.SugarLogger.Debugf("UpdateStore store.VendorStoreID====%s,shopID====%s", store.VendorStoreID, shopID)
} else if shopID == 0 {
// todo remove out shop id
}
@@ -346,7 +345,6 @@ func (p *PurchaseHandler) RefreshAllStoresID(ctx *jxcontext.Context, parentTask
fBaiduIDs, fShopIDs, err1 := FilterStoreRel(baiduShopIDs)
globals.SugarLogger.Debugf("RefreshAllStoresID FilterStoreRel fBaiduIDs====%d fShopIDs====%d err====%v", fBaiduIDs, fShopIDs, err1)
err = api.EbaiAPI.ShopIDBatchUpdate(fBaiduIDs, fShopIDs)
globals.SugarLogger.Debugf("RefreshAllStoresID baiduShopIDs====%s,shopIDs====%s", baiduShopIDs, shopIDs)
}
return nil, err
}, stores)
@@ -373,7 +371,6 @@ func FilterStoreRel(baiduShopIDs []string) (fBaiduShopIDs []string, fShopIDs []s
return nil, nil, err
}
localRel, err := dao.GetStoreDetailByVendorStoreID(dao.GetDB(), k, model.VendorIDEBAI, "")
globals.SugarLogger.Debugf("get localRel err===%v", err)
if remoteRel.ShopID != utils.Int2Str(localRel.ID) {
fBaiduShopIDs = append(fBaiduShopIDs, k)
fShopIDs = append(fShopIDs, utils.Int2Str(localRel.ID))
@@ -673,7 +670,6 @@ func (c *PurchaseHandler) UpdateStoreCustomID(ctx *jxcontext.Context, vendorOrgC
if err1 != nil {
globals.SugarLogger.Debugf("UpdateStoreCustomID err1====%v", err1)
}
globals.SugarLogger.Debugf("UpdateStoreCustomID fBaiduIDs====%s fShopIDs====%d err1", fBaiduIDs, fShopIDs)
err = api.EbaiAPI.ShopIDBatchUpdate(fBaiduIDs, fShopIDs)
//err = api.EbaiAPI.ShopIDBatchUpdate([]string{vendorStoreID}, []string{utils.Int64ToStr(storeID)})
}

View File

@@ -515,6 +515,9 @@ func genSkuParamsFromStoreSkuInfo2(storeSku *dao.StoreSkuSyncInfo, isCreate, isE
if storeSku.MinOrderCount > 0 {
params["minimum"] = utils.Int2Float64(storeSku.MinOrderCount)
}
if storeSku.MinOrderCount == 0 {
params["minimum"] = utils.Int2Float64(1)
}
return params
}