You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pdd-order-api/app/libs/const/class.DsOrderConst.php

181 lines
7.7 KiB
PHP

<?php
class DsOrderConst {
const orderStatusWaitPurchase = 'waitPurchase';//待采购
const orderStatusWaitPay = 'waitPay';//待付款
const orderStatusWaitSellerSendGoods = 'waitSellerSendGoods';//待发货
const orderStatusWaitBuyerConfirmGoods = 'waitBuyerConfirmGoods';//已发货
const orderStatusRefunding = 'refunding';//退款中
const orderStatusFinish = 'finish';//已完成
const orderStatusClose = 'close';//已关闭
const orderStatusIsolation = 'isolation';//已隔离
const refundStatusRefunding = 'refunding';
const refundStatusClose = 'close';
const refundStatusFinish = 'finish';
const dsWaitPayStatusPartWaitPay = 1;//部分未付款
const dsWaitPayStatusFullPay = 2;//已全部付款
const dsWaitPayStatusAllUnpaid = 3;//全部未付款
const dsOrderRelateStateAll = 'all'; //全部
const dsOrderRelateStateRelated = 'relatedSource';//已关联货源
const dsOrderRelateStateUnrelated = 'unrelatedSource';//未关联货源
const DsRelationSourceStatusPartProduct = 1;// 部分关联货源
const DsRelationSourceStatusAllProduct = 2;// 全部关联货源
const dsPurchaseStatusWaitPurchase = 0;//待采购
const dsPurchaseStatusPartPurchase = 1;//部分采购
const dsPurchaseStatusWaitSend = 2;//待发货
const dsPurchaseStatusPartSend = 4;//部分发货
const dsPurchaseStatusWaitPay = 5;//待付款
const dsPurchaseStatusHasSend = 6;//已发货
const purchaseTabWaitPurchase = 'waitPurchase';
const purchaseTabWaitPay = 'waitPay';
const purchaseTabWaitSend = 'waitSend';
const purchaseTabHasSend = 'hasSend';
const purchaseTabRefunding = 'refunding';
const purchaseTabFinish = 'finish';
const purchaseTabClose = 'close';
const purchaseTabIsolation = 'isolation';
const purchaseTabAll = 'all';
const actionSourcePlatformBatchPurchase = 'platform_batch_purchase';
const actionSourcePlatformSinglePurchase = 'platform_single_purchase';
const actionSourceMobilePlatformBatchPurchase = 'mobile_platform_batch_purchase';
const actionSourceMobilePlatformSinglePurchase = 'mobile_platform_single_purchase';
const actionSourcePlatformSingleRepurchase = 'platform_single_repurchase';
const actionSourcePlatformCancel = 'platform_cancel';
const actionSourceBatchPurchase = 'batch_purchase';
const actionSourceSinglePurchase = 'single_purchase';
const actionSourceCacnel = 'cancel';
const actionSourcePlatformCloseCancel = 'platform_close_cancel';
const actionSourceCloseCancel = 'close_cancel';
const actionSourcePlatformAutoPurchase = 'platform_auto_purchase';
const actionSourcePlatformMergePurchase = 'platform_merge_purchase';
const platformProductRelateSourceItemTypeAdd = 'add';
const platformProductRelateSourceItemTypeDelete = 'delete';
const purchaseSourcePlatformBatch = 'platform_batch';
const purchaseSourcePlatformAuto = 'platform_auto';
const purchaseSourceMobilePlatformSingle = 'mobile_platform_single';
const purchaseSourceMobilePlatformBatch = 'mobile_platform_batch';
const purchaseSourcePlatform = 'platform';
const flowFenxiao = 'fenxiao';
const flowChoiceness = 'ttpft';//精选货源下单
const autoAfsActionTypeWaitSendRefund = 'waitSendRefund';
const autoAfsActionTypeCloseOrder = 'closeOrder';
const autoAfsActionTypeException = 'exception';
const dsEncryptPlatformCode = 'pinduoduo';
const mergeTypeRelateSourceItem = 'relateSourceItem';
const mergeTypeRemoveRelateSourceItem = 'removeRelateSourceItem';
const mergeTypeCancelPurchaseOrderRelate = 'cancelPurchaseOrderRelate';
const mergeTypeRelatePurchaseOrder = 'relatePurchaseOrder';
const mergeTypeRsyncOrder = 'rsyncOrder';
const mergeTypeBatchSetIsolationOrders = 'batchSetIsolationOrders';
const mergeTypeBatchCancelIsolationOrders = 'batchCancelIsolationOrders';
const isForbidFormatPddCloudResponse = 'isForbidFormatPddCloudResponse';
public static function getPddOrderPurchaseOrderTabByPlatformOrderStatus($orderStatus) {
return [
self::orderStatusWaitPurchase => PurchaseOrderConst::purchaseOrderTabWaitPurchase,
self::orderStatusWaitSellerSendGoods => PurchaseOrderConst::purchaseOrderTabWaitSend,
self::orderStatusWaitBuyerConfirmGoods => PurchaseOrderConst::purchaseOrderTabHasSend,
self::orderStatusRefunding => PurchaseOrderConst::purchaseOrderTabReturn,
self::orderStatusFinish => PurchaseOrderConst::purchaseOrderTabFinished,
self::orderStatusClose => PurchaseOrderConst::purchaseOrderTabCanceled,
][$orderStatus];
}
public static function getPddOrderStatusAndRefundStatusAndAppOrderStatusMap() {
$map = [
self::orderStatusWaitPurchase => [
OrderConst::orderStatusWaitSellerSendGoods,
OrderConst::refundStatusNoRefund,
],
self::orderStatusWaitSellerSendGoods => [
OrderConst::orderStatusWaitSellerSendGoods,
OrderConst::refundStatusNoRefund,
],
self::orderStatusWaitBuyerConfirmGoods => [
OrderConst::orderStatusWaitBuyerConfirmGoods,
OrderConst::refundStatusNoRefund,
],
self::orderStatusRefunding => [
null,
[
OrderConst::refundStatusProcessing,
OrderConst::refundStatusRefunding
]
],
self::orderStatusFinish => [
OrderConst::orderStatusFinished,
OrderConst::refundStatusNoRefund,
],
self::orderStatusClose => [
null,
OrderConst::refundStatusSuccess
],
];
return $map;
}
public static function getPddOrderStatusAndRefundStatusByAppOrderStatus($appOrderStatus) {
if ($appOrderStatus == 'all') {
return [];
}
$map = self::getPddOrderStatusAndRefundStatusAndAppOrderStatusMap();
return $map[$appOrderStatus] ?: [];
}
public static function getAppOrderStatusByOrderStatusAndRefundStatus($orderStatus, $refundStatus) {
$returnAppOrderStatus = null;
if ($refundStatus == OrderConst::refundStatusRefunding) {
$returnAppOrderStatus = self::orderStatusRefunding;
} elseif ($refundStatus == OrderConst::refundStatusSuccess) {
$returnAppOrderStatus = self::orderStatusClose;
} elseif ($orderStatus == OrderConst::orderStatusWaitSellerSendGoods) {
$returnAppOrderStatus = self::orderStatusWaitSellerSendGoods;
} elseif ($orderStatus == OrderConst::orderStatusWaitBuyerConfirmGoods) {
$returnAppOrderStatus = self::orderStatusWaitBuyerConfirmGoods;
} elseif ($orderStatus == OrderConst::orderStatusFinished) {
$returnAppOrderStatus = self::orderStatusFinish;
}
return $returnAppOrderStatus;
}
public static function getDsRefundStatusName($refundStatus) {
$map = [
self::refundStatusRefunding => '售后中',
self::refundStatusClose => '售后关闭',
self::refundStatusFinish => '售后完成',
];
return $map[$refundStatus] ?: null;
}
public static function getActionTypeAndNameMap () {
return [
self::autoAfsActionTypeWaitSendRefund => '1688订单申请退款',
self::autoAfsActionTypeCloseOrder => '关闭1688订单',
self::autoAfsActionTypeException => '自动售后异常',
];
}
public static function getActionTypeName($actionType) {
$actionTypeAndNameMap = self::getActionTypeAndNameMap();
return $actionTypeAndNameMap[$actionType] ?: '';
}
}