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.
472 lines
18 KiB
PHP
472 lines
18 KiB
PHP
<?php
|
|
class OrderPrintConst {
|
|
|
|
const orderPrintTabAll = 'all';
|
|
const orderPrintTabWaitSend = 'wait_send';
|
|
const orderPrintTabHasSend = 'has_send';
|
|
const orderPrintTabFinish = 'finish';
|
|
const orderPrintTabCancel = 'cancel';
|
|
const orderPrintTabReturn = 'return';
|
|
const orderPrintTabIsolation = 'isolation';
|
|
const orderPrintTabNotReturn = 'not_return';
|
|
const orderPrintTabReturnFail = 'return_fail';
|
|
const orderPrintTabReturnSuccess = 'return_success';
|
|
const orderPrintTabCancelReturnFail = 'cancel_return_fail';
|
|
|
|
const pExpressStatusAll = 'all';
|
|
const pExpressStatusPrinted = 'express_printed';
|
|
const pExpressStatusNoPrinted = 'express_no_printed';
|
|
|
|
const expressTypePtmd = 'ptmd';
|
|
const expressTypeDzmd = 'dzmd';
|
|
const expressTypeCainaoYun = 'cainiaoyun';
|
|
|
|
const printFromOrder = 'order';
|
|
const printFromCustomOrder = 'customOrder';
|
|
const printFromFdsOrder = 'fdsOrder';
|
|
|
|
const salePlatformJd = '0010001';
|
|
const salePlatformTb = '0010002';
|
|
const salePlatformOther = '0030001';
|
|
|
|
// 订单来源
|
|
const orderFromTb = 'TB';
|
|
const orderFromPdd = 'PDD';
|
|
const orderFromOthers = 'OTHERS';
|
|
const orderFromPddFds = 'PDD_FDS';
|
|
|
|
const waybillFromPutong = 'putong';
|
|
const waybillFromCainiao = 'cainiao';
|
|
const waybillFromWangdian = 'wangdian';
|
|
const waybillFromPdd = 'pdd';
|
|
|
|
const waybillBillTypeImportAndMatch = 1;
|
|
const waybillBillTypeImportAndNoMatch = 2;
|
|
const waybillBillTypeNoImportAndHasPrint = 3;
|
|
const waybillBillTypeImportAndRecycle = 4;
|
|
const waybillBillTypeImportAndDuplication = 5;
|
|
|
|
const pInvoiceStatusAll = 'all';
|
|
const pInvoiceStatusPrinted = 'invoice_printed';
|
|
const pInvoiceStatusNoPrinted = 'invoice_no_printed';
|
|
|
|
const assemblyTaskStageRsyncOrder = 'rsync_order';
|
|
const assemblyTaskStageMergeShops = 'merge_shops';
|
|
|
|
const wareSortTypeWarehouseShelvesAsc = 'warehouseShelvesAsc';
|
|
const wareSortTypeWarehouseShelvesTotalDesc = 'warehouseShelvesTotalDesc';
|
|
const wareSortTypeWarehouseShelvesTotalAsc = 'warehouseShelvesTotalAsc';
|
|
|
|
const hasSetWarehouse = 'hasSetWarehouse';
|
|
const notSetWarehouse = 'notSetWarehouse';
|
|
const allSetWarehouse = 'allSetWarehouse';
|
|
|
|
const hasSetShelves = 'hasSetShelves';
|
|
const notSetShelves = 'notSetShelves';
|
|
const allSetShelves = 'allSetShelves';
|
|
|
|
const shortTitleSourceEdit = 'edit';
|
|
const shortTitleSourcePrint = 'print';
|
|
const shortTitleSourceImport = 'import';
|
|
const shortTitleHandleIsExistTypeCover = 'cover';
|
|
const shortTitleHandleIsExistTypeSkip = 'skip';
|
|
|
|
const fdsReturnLogTypeReturn = 'return';
|
|
const fdsReturnLogTypeCancelReturn = 'cancel_return';
|
|
|
|
const logisticsActionGot = 'GOT';//揽件
|
|
const logisticsActionArrival = 'ARRIVAL';//到件
|
|
const logisticsActionDeparture = 'DEPARTURE';//发件
|
|
const logisticsActionSend = 'SEND';//派件
|
|
const logisticsActionFail = 'FAIL';//问题件
|
|
const logisticsActionSign = 'SIGN';//签收
|
|
const logisticsActionRejection = 'REJECTION';//拒签
|
|
const logisticsActionStayInWarehouse = 'STAY_IN_WAREHOUSE';//留仓
|
|
const logisticsActionSignOnBehalf = 'SIGN_ON_BEHALF';//代收点代签
|
|
const logisticsActionOther = 'OTHER';//其他
|
|
const logisticsActionReturn = 'RETURN';//退件
|
|
const logisticsActionInCabinet = 'IN_CABINET';//入柜/入代收点
|
|
const logisticsActionOutCabinet = 'OUT_CABINET';//出柜/出代收点
|
|
const logisticsActionClearanceStart = 'CLEARANCE_START';//清关中
|
|
const logisticsActionClearanceFinish = 'CLEARANCE_FINISH';//清关完成
|
|
|
|
const logisticsStatusFilterGot = 'got';//已揽收
|
|
const logisticsStatusFilterWaitGot = 'wait_got';//未揽收
|
|
const logisticsStatusFilterHasTrace = 'has_trace';//有物流
|
|
const logisticsStatusFilterRejection = 'rejection';//拒签
|
|
|
|
const logisticsFilterOvertimeGot = 1; //超时未揽收预警
|
|
const logisticsFilterOvertimeNoArrival = 2; //揽收后未更新物流信息预警
|
|
const logisticsFilterOvertimeNoNewTrace = 3; //快递途中超时未更新物流信息预警
|
|
const logisticsFilterOvertimeNoSign = 4; //超时未签收物流预警
|
|
const logisticsFilterRejection = 5; //买家拒收物流预警
|
|
const logisticsFilterAllocateStay = 6; //分拨停留物流预警
|
|
const logisticsFilterNodeStayJZHW = 7; //江浙沪皖节点停留物流预警
|
|
const logisticsFilterNodeStayJJJ = 8; //京津冀节点停留物流预警
|
|
const logisticsFilterNodeStayTYSF = 9; //统一省份节点停留物流预警
|
|
const logisticsFilterNodeStayBTSF = 10; //不同省份节点停留物流预警
|
|
const logisticsFilterNodeStayXXN = 11; //西藏、新疆、内蒙古节点停留物流预警
|
|
|
|
const logisticsExceptionFilterOvertimeGot = 1; //超时未揽收异常
|
|
const logisticsExceptionFilterOvertimeNoArrival = 2; //揽收后未更新物流信息异常
|
|
const logisticsExceptionFilterAllocateStay = 6; //分拨停留物流异常
|
|
const logisticsExceptionFilterNodeStayJZHW = 7; //江浙沪皖节点停留物流异常
|
|
const logisticsExceptionFilterNodeStayJJJ = 8; //京津冀节点停留物流异常
|
|
const logisticsExceptionFilterNodeStayTYSF = 9; //统一省份节点停留物流异常
|
|
const logisticsExceptionFilterNodeStayBTSF = 10; //不同省份节点停留物流异常
|
|
const logisticsExceptionFilterNodeStayXXN = 11; //西藏、新疆、内蒙古节点停留物流异常
|
|
|
|
|
|
const decryptDataTypeCardSecret = 1;
|
|
const decryptDataTypeCardNumber = 2;
|
|
const decryptDataTypePaymentGoodsNumber = 3;
|
|
const decryptDataTypePaymentMerchantNumber = 4;
|
|
const decryptDataTypePaymentReceiverName = 5;
|
|
const decryptDataTypePaymentReceiverPhone = 6;
|
|
const decryptDataTypePaymentReceiverFullAddress = 7;
|
|
const decryptDataTypePaymentReceiverAddress = 8;
|
|
const decryptDataTypePaymentWaybillCode = 9;
|
|
const decryptDataTypePaymentIDNumber = 10;
|
|
const decryptDataTypePaymentIDName = 11;
|
|
|
|
const waybillTypePinduoduo = 0;
|
|
const waybillTypeFriendBusiness = 1;
|
|
const waybillTypeLogisticsCompany = 2;
|
|
const waybillTypeOther = 99;
|
|
|
|
const openKmsInputTypeID = 'id';
|
|
const openKmsInputTypePhone = 'phone';
|
|
const openKmsInputTypeSimple = 'simple';
|
|
|
|
const opOrderFixNumber = 1;
|
|
const opOrderFixIndexKey = 0;
|
|
|
|
const printTypeExpress = 'express';
|
|
const printTypeInvoice = 'invoce';
|
|
|
|
const orderItemShowFieldsSettingGoodsName = 'goodsName';
|
|
const orderItemShowFieldsSettingOuterGoodsId = 'outerGoodsId';
|
|
const orderItemShowFieldsSettingGoodsId = 'goodsId';
|
|
const orderItemShowFieldsSettingWareShortTitle = 'wareShortTitle';
|
|
const orderItemShowFieldsSettingGoodsSpec = 'goodsSpec';
|
|
const orderItemShowFieldsSettingOuterId = 'outerId';
|
|
const orderItemShowFieldsSettingSkuShortTitle = 'skuShortTitle';
|
|
|
|
const freePrintImportTplNormal = 1;
|
|
const freePrintImportTplAddressMerge = 2;
|
|
const freePrintImportTplConsigneeMerge = 3;
|
|
|
|
|
|
const opOrderFilterMergeStatusAll = 'all';
|
|
const opOrderFilterMergeStatusHasMerge = 'hasMerge';
|
|
const opOrderFilterMergeStatusNotMerge = 'notMerge';
|
|
|
|
const mallOpBizTypeEnterOp = 'enter_op';
|
|
const mallOpBizTypePrintExpress = 'print_express';
|
|
const mallOpBizTypePrintInvoice = 'print_invoice';
|
|
const mallOpBizTypeCustomPrintExpress = 'custom_print_express';
|
|
const mallOpBizTypeCustomPrintInvoice = 'custom_print_invoice';
|
|
const mallOpBizTypeOutstorage = 'outstorage';
|
|
const mallOpBizTypeImportOutstorage = 'import_outstorage';
|
|
const mallOpBizTypePrintGuide = 'print_guide';
|
|
|
|
const importShortTileTplSpu = 'spu';
|
|
const importShortTileTplSku = 'sku';
|
|
|
|
const searchConditionBizCodeOrderPrint = 'orderPrint';
|
|
const searchConditionBizCodeCustomPrint = 'customPrint';
|
|
const searchConditionBizCodeAssembly = 'assembly';
|
|
const searchConditionBizCodeAfterSale = 'afterSale';
|
|
const searchConditionBizCodeExpressLog = 'expressLog';
|
|
const searchConditionBizCodePreOutStorage = 'preOutStorage';
|
|
const searchConditionBizCodeLogisticsWarning = 'logisticsWarning';
|
|
|
|
const searchTimeTypeOrderCreatedTime = 'createdTime';
|
|
const searchTimeTypeOrderConfirmTime = 'confirmTime';
|
|
const searchTimeTypeOrderSendTime = 'orderSendTime';
|
|
const searchTimeTypePreOutStorageTime = 'preOutstorageTime';
|
|
|
|
const remoteAreaProvinceIds = [5, 9, 19, 20, 21, 28, 29];
|
|
|
|
const updateMallRemarkSourceSingle = 'single';
|
|
const updateMallRemarkSourceBatch = 'batch';
|
|
const updateMallRemarkSourcePurchase = 'purchase';
|
|
const updateMallRemarkSourceImport = 'import';
|
|
|
|
const statErrorSourceOutStorage = 'outStorage';
|
|
|
|
public static function getLogisticsSendActions() {
|
|
return [
|
|
OrderPrintConst::logisticsActionSend,
|
|
OrderPrintConst::logisticsActionInCabinet
|
|
];
|
|
}
|
|
|
|
public static function getLogisticsMovingActions() {
|
|
return [
|
|
OrderPrintConst::logisticsActionArrival,
|
|
OrderPrintConst::logisticsActionDeparture
|
|
];
|
|
}
|
|
|
|
public static function getLogisticsSignActions() {
|
|
return [
|
|
OrderPrintConst::logisticsActionSign,
|
|
OrderPrintConst::logisticsActionSignOnBehalf,
|
|
OrderPrintConst::logisticsActionOutCabinet,
|
|
];
|
|
}
|
|
|
|
public static function getLogisticsRejectActions() {
|
|
return [
|
|
OrderPrintConst::logisticsActionRejection,
|
|
OrderPrintConst::logisticsActionReturn,
|
|
];
|
|
}
|
|
|
|
public static function getAllKuaidiStatusMap($includeAll = null) {
|
|
$statusMap = $includeAll ? array (
|
|
self::pInvoiceStatusAll => '全部'
|
|
) : array ();
|
|
|
|
$statusMap[self::pExpressStatusPrinted] = '已打印';
|
|
$statusMap[self::pExpressStatusNoPrinted] = '未打印';
|
|
|
|
return $statusMap;
|
|
}
|
|
|
|
public static function getAllFahuoStatusMap($includeAll = null) {
|
|
$statusMap = $includeAll ? array (
|
|
self::pInvoiceStatusAll => '全部'
|
|
) : array ();
|
|
|
|
$statusMap[self::pInvoiceStatusPrinted] = '已打印';
|
|
$statusMap[self::pInvoiceStatusNoPrinted] = '未打印';
|
|
|
|
return $statusMap;
|
|
}
|
|
|
|
public static function isPrintedExpress($expressStatus) {
|
|
return in_array($expressStatus, array(self::pExpressStatusPrinted));
|
|
}
|
|
|
|
public static function isPrintedInvoice($invoiceStatus) {
|
|
return in_array($invoiceStatus, array(self::pInvoiceStatusPrinted));
|
|
}
|
|
|
|
public static function buildCustomReceiverBizKey($bFullname, $bMobile, $bProvinceId, $bCityId, $bCountyId, $bAddress) {
|
|
return md5(sprintf('%s-%s-%s-%s-%s-%s', $bFullname, $bMobile, $bProvinceId, $bCityId, $bCountyId, $bAddress));
|
|
}
|
|
|
|
public static function getWareWarehouseStatus() {
|
|
$wareWarehouseStatus = array(
|
|
self::hasSetWarehouse => 'hasSetWarehouse',
|
|
self::notSetWarehouse => 'notSetWarehouse',
|
|
self::allSetWarehouse => 'allSetWarehouse',
|
|
);
|
|
return $wareWarehouseStatus;
|
|
}
|
|
|
|
public static function getWareShelvesStatus() {
|
|
$wareShelvesStatusMap = array(
|
|
self::hasSetShelves => 'hasSetShelves',
|
|
self::notSetShelves => 'notSetShelves',
|
|
self::allSetShelves => 'allSetShelves',
|
|
);
|
|
return $wareShelvesStatusMap;
|
|
}
|
|
|
|
public static function getWareWarehouseShelvesSortTypeMap() {
|
|
$sortMap = array (
|
|
self::wareSortTypeWarehouseShelvesAsc => '名称排序',
|
|
self::wareSortTypeWarehouseShelvesTotalDesc => '商品数量降序',
|
|
self::wareSortTypeWarehouseShelvesTotalAsc => '商品数量升序'
|
|
);
|
|
return $sortMap;
|
|
}
|
|
|
|
public static function getCustomOrderBizOrderNumPre(){
|
|
$appChineseNameAndPreMap = [
|
|
AppConst::appPddDz => 'DZ',
|
|
AppConst::appPddDzOp => 'DZP',
|
|
AppConst::appMsPddOp => 'MSP',
|
|
AppConst::appPddOpRuby => 'RYP'
|
|
];
|
|
return $appChineseNameAndPreMap[Zc::C('appName')];
|
|
}
|
|
|
|
public static function getEncryptTableFieldsMap(){
|
|
return [
|
|
'op_sender_address' => ['fullname', 'address', 'mobile', 'telephone'],
|
|
'op_waybill_info' => ['sender_name', 'sender_address', 'sender_mobile', 'sender_phone', 'receiver_address'],
|
|
'custom_order' => ['receiver_name', 'receiver_phone', 'receiver_mobile', 'address'],
|
|
'custom_print_express_log' => ['fullname', 'mobile', 'telephone', 'full_address'],
|
|
'custom_print_invoice_log' => ['fullname', 'mobile', 'telephone', 'full_address'],
|
|
'custom_receiver' => ['fullname', 'mobile', 'telephone', 'address', 'full_address'],
|
|
'op_order_receive_address' => ['fullname', 'mobile', 'telephone', 'address'],
|
|
];
|
|
}
|
|
|
|
public static function getItemShowFieldsMap() {
|
|
return [
|
|
'spu' => [
|
|
self::orderItemShowFieldsSettingGoodsName => '商品标题',
|
|
self::orderItemShowFieldsSettingOuterGoodsId => '商品编码',
|
|
self::orderItemShowFieldsSettingGoodsId => '商品ID',
|
|
self::orderItemShowFieldsSettingWareShortTitle => '商品简称',
|
|
],
|
|
'sku' => [
|
|
self::orderItemShowFieldsSettingGoodsSpec => '规格名称',
|
|
self::orderItemShowFieldsSettingOuterId => 'SKU编码',
|
|
self::orderItemShowFieldsSettingSkuShortTitle => 'SKU简称',
|
|
]
|
|
];
|
|
}
|
|
|
|
public static function getItemShowFieldsNameByField($field) {
|
|
$fieldsMap = [
|
|
self::orderItemShowFieldsSettingGoodsName => '商品标题',
|
|
self::orderItemShowFieldsSettingOuterGoodsId => '商品编码',
|
|
self::orderItemShowFieldsSettingGoodsId => '商品ID',
|
|
self::orderItemShowFieldsSettingWareShortTitle => '商品简称',
|
|
self::orderItemShowFieldsSettingGoodsSpec => '规格名称',
|
|
self::orderItemShowFieldsSettingOuterId => 'SKU编码',
|
|
self::orderItemShowFieldsSettingSkuShortTitle => 'SKU简称',
|
|
];
|
|
return $fieldsMap[$field];
|
|
}
|
|
|
|
public static function getSearchConditionBizCodeMap() {
|
|
return [
|
|
self::searchConditionBizCodeOrderPrint => '打单发货',
|
|
self::searchConditionBizCodeCustomPrint => '自由打印',
|
|
self::searchConditionBizCodeAfterSale => '售后',
|
|
self::searchConditionBizCodeAssembly => '配货单',
|
|
self::searchConditionBizCodePreOutStorage => '预发货',
|
|
self::searchConditionBizCodeLogisticsWarning => '物流预警',
|
|
self::searchConditionBizCodeExpressLog => '快递单打印历史',
|
|
];
|
|
}
|
|
|
|
public static function getOrderPrintTabMap() {
|
|
return [
|
|
self::orderPrintTabAll => '全部',
|
|
self::orderPrintTabWaitSend => '等待出库',
|
|
self::orderPrintTabHasSend => '已出库',
|
|
self::orderPrintTabFinish => '已完成',
|
|
self::orderPrintTabCancel => '已取消',
|
|
self::orderPrintTabIsolation => '隔离',
|
|
self::orderPrintTabReturn => '退款中',
|
|
self::orderPrintTabNotReturn => '未回传',
|
|
self::orderPrintTabReturnFail => '回传失败',
|
|
self::orderPrintTabReturnSuccess => '回传成功',
|
|
self::orderPrintTabCancelReturnFail => '取消回传失败',
|
|
PurchaseOrderConst::purchaseOrderTabRisk => '风控订单'
|
|
];
|
|
}
|
|
|
|
public static function getOrderMergeStatusMap() {
|
|
return [
|
|
self::opOrderFilterMergeStatusAll => '全部',
|
|
self::opOrderFilterMergeStatusHasMerge => '已合并',
|
|
self::opOrderFilterMergeStatusNotMerge => '未合并',
|
|
];
|
|
}
|
|
|
|
public static function getAllSearchTimeTypeMap() {
|
|
return [
|
|
self::searchTimeTypeOrderCreatedTime => '下单时间',
|
|
self::searchTimeTypeOrderConfirmTime => '成团时间',
|
|
self::searchTimeTypeOrderSendTime => '发货时间',
|
|
self::searchTimeTypePreOutStorageTime => '预发货时间'
|
|
];
|
|
}
|
|
|
|
public static function getItemTotalFilterTypeMap() {
|
|
return [
|
|
1 => '一种一件',
|
|
2 => '一种多件',
|
|
3 => '多种商品'
|
|
];
|
|
}
|
|
|
|
public static function getBooleanTypeOrderFilterFieldMap() {
|
|
return [
|
|
'hasBuyerMemo' => '是否有留言',
|
|
'hasSellerMemo' => '是否有备注',
|
|
'hasSellerNote' => '是否有便笺',
|
|
'speedRefundFlag' => '是否极速退款',
|
|
'onlyShowAutoShipFailed' => '仅展示自动发货失败',
|
|
'onlyShowRefunding' => '仅展示退款中',
|
|
'onlyShowRefunded' => '仅展示已退款',
|
|
];
|
|
}
|
|
|
|
public static function getLogisticsStatusMap() {
|
|
return [
|
|
'' => '全部',
|
|
'waitGet' => '待揽件',
|
|
'onlyGet' => '已揽件,无物流',
|
|
'notOnlyGet' => '已揽件,有物流',
|
|
'sending' => '派件中',
|
|
'signed' => '已签收',
|
|
];
|
|
}
|
|
|
|
public static function getRefundStatusMap() {
|
|
return [
|
|
'' => '全部',
|
|
'hasRefund' => '有退款',
|
|
'notRefund' => '无退款'
|
|
];
|
|
}
|
|
|
|
public static function getDirectlyCityAreaId() {
|
|
return [2, 25, 27, 32];
|
|
}
|
|
|
|
public static function getMallOpTransferFailTypeMap() {
|
|
return [
|
|
'access_guide_not_access_print_page' => '打印引导转化失败的访客',
|
|
'access_print_page_not_print' => '打单界面转化失败的访客',
|
|
'print_fail' => '打单失败的用户',
|
|
'expired_and_used_print' => '打单过期流失店铺',
|
|
];
|
|
}
|
|
|
|
public static function getUpdateMallRemarkSourceMap() {
|
|
return [
|
|
self::updateMallRemarkSourceSingle => '单个',
|
|
self::updateMallRemarkSourceBatch => '批量',
|
|
self::updateMallRemarkSourcePurchase => '采购',
|
|
self::updateMallRemarkSourceImport => '导入',
|
|
];
|
|
}
|
|
|
|
public static function exchangeErrorMessage($errorMessage = '') {
|
|
if (empty($errorMessage)) {
|
|
return false;
|
|
}
|
|
$exchangeStrList = [
|
|
'当前打印组件版本过低,请升级至最新版本',
|
|
'未匹配到对应物流公司',
|
|
'您的运单存在安全风险,本次获取信息失败',
|
|
];
|
|
|
|
foreach ($exchangeStrList as $exchangeStr) {
|
|
if (strpos($errorMessage, $exchangeStr) !== false) {
|
|
return $exchangeStr;
|
|
}
|
|
}
|
|
|
|
return $errorMessage;
|
|
}
|
|
|
|
public static function getAllPrintFroms() {
|
|
return [
|
|
OrderPrintConst::printFromOrder,
|
|
OrderPrintConst::printFromCustomOrder,
|
|
OrderPrintConst::printFromFdsOrder
|
|
];
|
|
}
|
|
} |