快遞費用配置

快遞運費配置:渠道與匹配規(guī)則

本文檔依據(jù) sanlin-bp-apiAdminDeliveryFeeControllerjisuan* 方法的實際代碼,說明 delivery_fee 的匹配條件與計費所用字段。

說明

  • channeldelivery_fee.channel,表示快遞產(chǎn)品線(京東、菜鳥、信豐等),與表里 fee_type(按重量/按件)不是同一維度。
  • 計費(代碼實際):以代碼為準(zhǔn);表中 fee_type 僅為業(yè)務(wù)標(biāo)注,計算邏輯未統(tǒng)一讀取 fee_type,可能與庫不一致。
  • 始發(fā)/目的在庫中為 district 編碼from_pcode / from_ccode / to_pcode / to_ccode / to_tcode 等;訂單側(cè)由 toProvince、toCity、toTown 等經(jīng) queryP / queryC / queryT 解析(各渠道用到的字段不同)。

各渠道一覽

channel 渠道(字典名) 計費(代碼實際) delivery_fee 匹配條件 訂單/匯總側(cè)主要字段 配置行參與計算的字段
0 京東快遞 按重量 channel=0 + from_pcode + from_ccode + to_pcode + to_ccode;可再限定 to_tcode,無則回退為不加區(qū) storageId→始發(fā);toProvince/toCity/toTown→目的;同運單 totalWeight firstWeightfirstPrice、continueWeightcontinuePrice、discount
1 菜鳥快遞 按重量 channel=1 + from_pcode + to_pcode無 goods_id storageIdtoProvince;totalWeight 首續(xù)重 + 多段:continueWeight2/3continuePrice2/3、discount
2 信豐 按件 channel=2 + from_pcode + from_ccode + to_pcode + to_ccode + goods_id storageId、toProvince、toCitygoodsId、totalAmountsSale price
3 佳美運 按件 channel=3 + from_pcode + from_ccode + to_pcode + goods_id(匹配時無目的市) 同上 price
4 安明快遞 按件 channel=4 + from_pcode + to_pcode + goods_id toProvince;goodsId、totalAmountsSale price
5 泡面申通 按件(SKU 拆分) channel=5 + from_pcode + to_pcode + 代碼寫死的若干 goods_id 明細 goodsId、amountsSale 拆段后計件 price
6 川百匯順豐 按件 channel=6 + from_pcode + to_pcode + goods_id goodsId、totalAmountsSale price
7 川百匯中通 按件 channel=7,同上 同上 price
8 川百匯京東 按重量 channel=8 + from_pcode + from_ccode + to_pcode + to_ccode無 goods_id 始發(fā)/目的到市;totalWeight firstWeight、firstPrice、continueWeight、continuePrice、discount
9 廈門中通 按件 channel=9 + from_pcode + to_pcode + goods_id goodsIdtotalAmountsSale price
10 川百匯 EMS 按件 channel=10 + from_pcode + to_pcode + goods_id 同上 price

公共說明

按重量

  • totalWeight:同一運單(post_code 分組)下,各明細 queryGoodsWeight(goodsId, 數(shù)量) 之和(重量向上取整規(guī)則見代碼)。
  • 依賴每條明細的 goodsId、amountsSalegoods_info.weight。
  • 京東、菜鳥、川百匯京東等多條 delivery_fee 命中時,代碼側(cè)取檔邏輯與排序?qū)崿F(xiàn)需結(jié)合源碼核對(存在未使用排序結(jié)果的寫法時,以列表順序為準(zhǔn))。

按件

  • 一般為 feeList[0].price × totalAmountsSale(或泡面申通按拆段件數(shù) × 單價)。
  • goods_id 參與匹配的渠道,配置行需與訂單商品 id 一致。

初始化任務(wù)是否重算

  • initShopOrder*DeliveryFee 僅處理 real_money 為空或 0created >= begDate 的明細;已算出非 0 的金額不會被該任務(wù)覆蓋。

參考代碼位置

  • com.sanlinst.api.delivery.controller.AdminDeliveryFeeControllerjisuanJd、jisuanCnjisuanXf、jisuanJmy、jisuanAmjisuanPmst、jisuanCbhZtSf、jisuanCbhJd、jisuanXmzt
  • com.sanlinst.api.delivery.domain.DeliveryFeeDO:表字段注釋
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容