<?php
/**
 * 统一的内容状态码
 * 原则上按照数字顺序申请,可以提前占位,体现分组
 * !!!不允许出现重复状态码!!!
 */

namespace Mall\Framework\Core;

class StatusCode
{
    /**
     * 公用模块状态码
     *
     * 数值范围 1-100
     */

    /** @var int $partion 部分 */
    public static $partion = 3;

    /** @var int $delete 删除 */
    public static $delete = 4;

    /** @var int $standard 正常 */
    public static $standard = 5;

    /** @var int $offline 下线 */
    public static $offline = 6;

    /**
     * XX模块状态码
     *
     * 数值范围 101-200
     */


    /**
     * XX模块状态码
     *
     * 数值范围 201-300
     */

    /**
     * 系统设置类型type
     */
    public static $settingType = [
        'applets' => 1,  // 小程序设置
        'message' => 2,  // 模板消息设置
        'class'   => 3,  // 分类设置
    ];

    public static $adminSettingType = [
        'pay'         => 1,  // 支付
        'delivery'    => 2,  // 配送
        'financeType' => 3,  // 财务类型
        'unit'        => 4,  //属性
        'printTemplate'    => 5,//打印模版,
        'role'        => 6,//角色
        'process'    => 7,//流程,
        'notice'    => 8,//语音提示
    ];

    public static $systemFinanceType = [
        'saleReturnReceipt'     => 1,//销售退货退款
        'saleReceipt'           => 2,//销售收款
        'purchaseReturnReceipt' => 3,//采购退货收款
        'purchasePrepaid'       => 4,//采购预付
        'purchaseReceipt'       => 5,//采购付款
        'depositsReceived'      => 6,//预存收款
        'expenseSingleIn'       => 7,//费用单收款
        'expenseSingleOut'      => 8,//费用单支出
        1      => '销售退货退款',//费用单支出
        2      => '销售收款',//费用单支出
        3      => '采购退货收款',//费用单支出
        4      => '采购预付',//费用单支出
        5      => '采购付款',//费用单支出
        6      => '预存收款',//费用单支出
        7      => '费用单收款',//费用单支出
        8      => '费用单支出',//费用单支出
    ];

    public static $messageType = [
        'inventoryNull' => 1,//库存不足消息
    ];


    /**
     * 通用审核状态
     */
    public static $auditStatus = [
        'completion'   => 0, //待补全
        'auditing'     => 1,  // 待审
        'auditPass'    => 2,  // 审核通过
        'auditNotPass' => 3, //审核未通过
        'auditIng'     => 4, // 审核中
        0              => '待补全',
        1              => '待审核',
        2              => '审核通过',
        3              => '审核未通过',
        4              => '审核中',
    ];

    /**
     * 分销层级
     */
    public static $level = [
        'off' => 0, //分销开关
        'one' => 1, //第一级
        'two' => 2, //第二级
        'three' => 3, //第三级
    ];

    public static $subConditions = [
        'oneCheck' => 1, //首次点击链接
        'oneOrder' => 2, //首次下单
        'onePay' => 3, //首次付款
];


    /** @var array $userActionID 用户操作行为 */
    public static $userActionID = [
        'favour'      => 1,// 点赞
        'tread'       => 2, // 踩--不喜欢
        'report'      => 3, // 举报
        'fllow'       => 4, // 关注
        'avorites'    => 5, //收藏
        'notAvorites' => 6, // 取消收藏
        'notFollow'   => 7,  //取消关注
        'notTread'    => 8,//取消踩--不喜欢
        'notFavour'   => 9, //取消点赞
    ];

    /** @var array $type 价格类型 */
    public static $priceType = [
        'salePrice' => 1,//销售价
        'costPrice' => 2,// 成本价
        'qtPrice'   => 3,// 其他价
    ];
    /** @var array $type 运费类型 */
    public static $freightType = [
        'enterCharge' => 1,//销售价
        'pourCharge'  => 2,// 成本价
    ];

    /** @var array $userActionObj 用户操作对象  此处标识修改需谨慎多处关联 */
    public static $userActionObj = [
        /** @var int $actionContent 用户操作对象-文章 */
        'actionContent'        => 1,
        /** @var int $actionUser 用户操作对象-用户 */
        'actionUser'           => 2,
        /** @var int $actionComment 用户操作对象-评论 */
        'actionComment'        => 3,
        /** @var int $actionMall 用户操作对象-商场 -店铺 */
        'actionMallStore'      => 4,
        /** @var int $actionMall 用户操作对象-商场 -商品 */
        'actionMallShop'       => 5,
        /** @var int $actionSea 用户操作对象-海淘--店铺 */
        'actionSeaStore'       => 6,
        /** @var int $actionSea 用户操作对象-海淘--商品 */
        'actionSeaShop'        => 7,
        /** @var int $actionMall 用户操作对象-商场 */
        'actionMall'           => 8,
        /** @var int $actionMall 用户操作对象-旅游景点 */
        'actionScenic'         => 9,
        /** @var int $actionPromotion 用户操作对象-消费打折信息 */
        'actionPromotion'      => 10,


        /** @var int $actionArVocalConcert 用户操作对象-休闲--演唱会a */
        'actionArVocalConcert' => 24,
        /** @var int $actionArTheatre 用户操作对象-休闲--剧场a */
        'actionArTheatre'      => 25,
        /** @var int $actionArTusicale 用户操作对象-休闲--音乐会a */
        'actionArMusicale'     => 26,
        /** @var int $actionArCompete 用户操作对象-休闲--比赛a */
        'actionArCompete'      => 27,
        /** @var int $actionArVariety 用户操作对象-休闲--综艺a */
        'actionArVariety'      => 28,
        /** @var int $actionArder 用户操作对象-休闲--博物馆p */
        'actionArMuseum'       => 29,
        /** @var int $actionArSport 用户操作对象-休闲--健身p */
        'actionArSport'        => 30,
        /** @var int $actionArCoffee 用户操作对象-休闲--咖啡p */
        'actionArCoffee'       => 31,
        /** @var int $actionMall 用户操作对象-其他 */
        'actionArOther'        => 32,
        /** @var int $actionArCoffee 用户操作对象-休闲--下午茶p */
        'actionArTea'          => 33,
        /** @var int $actionArCoffee 用户操作对象-休闲--酒吧p */
        'actionArWine'         => 34,
        /** @var int $actionArCoffee 用户操作对象-休闲--足疗p */
        'actionArFoot'         => 35,
        /** @var int $actionArCoffee 用户操作对象-休闲--轰趴p */
        'actionArParty'        => 36,
        /** @var int $actionArCoffee 用户操作对象-休闲--瑜伽p */
        'actionArYoga'         => 37,
        /** @var int $actionArCoffee 用户操作对象-休闲--舞蹈p */
        'actionArDance'        => 38,
    ];

    /**
     * 成本计算标识
     */
    public static $costType = [
        'mwa' => 1,//移动加权平均法
        'sp'  => 2,//个别计价法
    ];

    /**
     * 成本标识名称
     */
    public static $costTypeTitle = [
        1 => '移动加权平均法',
        2 => '个别计价法',
    ];
    /**
     * 采购订单 状态码
     * @var array
     *  1：创建2：审核中3：已审核4：重新审核
     */
    public static $purchaseOrder = [
        'create'   => 1,
        'auditing' => 2,
        'audited'  => 3,
        'reAudite' => 4
    ];

    /**
     * 销售出库是否已出库状态
     * @var array
     */
    public static $outWarehouseStatus = [
        'shopPut'    => 1, //未出库商品推送出库单,状态未出库
        'erpOut'     => 2, //已出库 erp自己创建的销售出库
        'shopPutOut' => 2, //已出库 商城推的订单
    ];

    /**
     * 销售订单来源
     * @var array
     */
    public static $orderFrom = [
        'shopOrder'  => 1, //商城订单
        'stockOrder' => 2, //库存服务自建订单
    ];
    /**
     *锁库存与解库存标识
     * @var array
     */
    public static $lockType = [
        'lock'   => 1, //未出库商品推送出库单,状态未出库
        'unlock' => 2, //已出库 erp自己创建的销售出库
    ];
    /**
     * 销售退货方式
     * @var array
     */
    public static $sellReturnMoney = [
        'returnMoney'    => 1, //销售退货退资金
        'notReturnMoney' => 2, //销售退货不退资金
    ];
    /*
     * 订单状态
     */
    public static $orderShippingStatus = [
        'out'        => 1, //已经提交出库
        'get'        => 2, //已收货
        'returnAll'  => 3, //全部退货
        'returnPart' => 4, //部分退货
    ];
    /*
     * 订单操作来源
     */
    public static $actionType = [
        'shop'  => 0, //商城
        'stock' => 1, //库存服务
        'tms'   => 2, //已收货
    ];

    /**
     * 定价系统 - 销售价格生效区域类型
     */
    public static $salePriceAreaType = [
        'nationalUnifiedPrice' => 1, // 全国统一价格
        'areaPrice'            => 2, // 大区和片区价格
    ];

    /**
     * 定价系统 - 销售价格类型
     */
    public static $salePriceType = [
        'salePrice'    => 1, // 普通市场价
        'seckillPrice' => 2, // 活动秒杀价
    ];

    /**
     * 定价系统 - 权限标识
     */
    public static $aclType = [
        'edit'   => 1, // 编辑
        'cat'    => 2, // 查看
        'noCast' => 3, // 去除成本
    ];

    /**
     * 支付方式
     */
    public static $payType = [
        'wxPay'     => 1, //微信
        'aliPay'    => 2, //支付宝
        'cashPay'   => 3, //货到付款
        'bankLoans' => 4, //银行打款
        'cash'      => 5,//现金支付
        'other'     => 6,//其他
        'balance'   => 7, // 余额支付
        'byte'      => 8, // 字节跳动
        'cashBefore'=> 9, // 先款后货
        1 => '微信支付',
        2 => '支付宝',
        3 => '货到付款',
        4 => '银行打款',
        5 => '现金支付',
        6 => '其它',
        7 => '余额支付',
        8 => '字节跳动',
        9 => '先款后货'
    ];

    /**
     * 配送方式
     */
    public static $deliveryType = [
        'goodsDelivery' => 1, //商品配送
        'selfMention'   => 2, //上门自提
        'logistics'     => 3, //物流
        'logisticsLines'   => 4, // 物流专线
        'logisticsVehicle' => 5, // 物流专车
        1               => '快递',
        2               => '上门自提',
        3               => '物流',
        4               => '物流专线',
        5               => '物流专车',
    ];

    /**
     * 业务来源
     */
    public static $source = [
        'ios'               => 1, //ios
        'android'           => 2,//安卓
        'miniProgram'       => 3,//小程序
        'manage'            => 4, //后台创建
        'H5'                => 5, //H5页面
        'Pc'                => 6, //Pc页面
        'manageMiniProgram' => 7,//微信小程序后台管理端
        'ByteProgram'       => 8,//字节小程序
        'weiXinBrowser'     => 9, // 微信浏览器
        1                   => '苹果',
        2                   => '安卓',
        3                   => '小程序',
        4                   => '后台创建',
        5                   => 'H5页面',
        6                   => 'PC页面',
        7                   => '微信小程序后台管理',
        8                   => '字节小程序',
        9                   => '微信浏览器'
    ];

    /**
     * 订单状态
     */
    public static $orderStatus = [
        //'create'       => 1, //创建
        'waitPay'      => 2, //等待支付
        'waitDelivery' => 3, //待发货
        'waitReceive'  => 4, //待收货
        'finish'       => 5, //已完成
        'close'        => 6, //已关闭
        'cancelIng'    => 7, // 待取消
        2              => '等待支付',
        3              => '待发货',
        4              => '待收货',
        5              => '已完成',
        6              => '已关闭',
        7              => '待取消', // 申请取消订单，等待审核
    ];

    /**
     * 订单退货状态
     */
    public static $orderReturn = [
        'notReturn'  => 0, //未退货
        'partReturn' => 1, //部分退货 (详情里用是已退货)
        'allReturn'  => 2, //全部退货 (详情里用是已退货)
    ];

    /**
     * 单据状态
     */
    public static $documentStatus = [
        'create'         => 1, //已创建
        'audit'          => 2, //已审核
        'inventoryAudit' => 3, //库存已审核
        'return'         => 9, //已退货 (单据详情)
        'returnAll'      => 7, //全部退货 (主单据)
        'returnPart'     => 8, //部分退货 (主单据)
    ];

    /**
     * 订单退货状态
     */
    public static $orderPickStatus = [
        'notPicking'        =>  1,
        'picking'           =>  2,
        'finishPicking'     =>  3,
        1                   =>  '未拣货',
        2                   =>  '拣货中',
        3                   =>  '拣货完成',
    ];

    /**
     * 客户账号状态
     */
    public static $customerStatus = [
        'enable' => 1, //已审核
        'delete' => 2, //待审核
    ];

    /**
     * 客户类型
     */
    public static $customerType = [
        'customer' => 5, //企业客户
        'user'     => 4, //企业用户
    ];

    /**
     * 单据类型
     * @var array
     */
    public static $orderType = [
        'saleOrder'                   => 1,//销售订单
        'purchaseOrder'               => 2,//采购订单
        'purchaseIn'                  => 3,//采购入库
        'purchaseReturn'              => 4,//采购退货
        'saleOut'                     => 5,//销售出库
        'saleReturn'                  => 6,//销售退货
        'allocate'                    => 7,//调拨库存
        'allocateOut'                 => 8,//调拨出库
        'batch'                       => 9,//批次编号
        'priceAdjustment'             => 10,//商品调价单
        'customerPriceAdjustment'     => 11,//客户调价单
        'customerTypePriceAdjustment' => 11,//客户类型调价单
        'allocateIn'                  => 12,//调拨入库
        'stocktaking'                 => 13,//盘点库存
        'purchaseReturnOut'           => 14,//采购退货出库
        'saleReturnIn'                => 15,//销售退货入库
        'reportLoss'                  => 27,//库存报损
        'merchantPurchase'            => 29,//商户采购单
        'merchantPurchaseIn'          => 30,//商户入库单


        /*财务*/
        'shouldReceive'               => 16,//应收单
        'received'                    => 17,//收款单
        'shouldPay'                   => 18,//应付单
        'payed'                       => 19,//付款单
        'accountTransfer'             => 20,//资金转账
        'ExpenseSingle'               => 28, //费用单

        //单据
        'warehouseBeginning'          => 21,//仓库期初

        //会员卡
        'vipCard'                     => 22,

        //销售单(销售单管理)
        'salesSlip'                   => 23,//销售单
        'cashierOrder'                => 24,//收银台订单
        'storeWithdraw'               => 25,//商户提现
        'supplierOfferPrice'          => 26,//供应商报价单
    ];

    /**
     * 单据编码前缀
     * @var array
     */
    public static $noPrefix = [
        1  => 'XSDD',// 1 销售订单
        2  => 'CGDD',// 2 采购订单
        3  => 'CGRK',// 3 采购入库
        4  => 'CGTH',// 4 采购退货
        5  => 'XSCK',// 5 销售出库
        6  => 'TH',// 6 销售退货
        7  => 'DBKC',// 7 调拨库存
        8  => 'DBCK',// 8 调拨出库
        12 => 'DBRK',//12 调拨入库
        13 => 'PDKC',//13 盘点库存
        14 => 'CGTHCK',//14 采购退货出库
        15 => 'XSTHRK',//15 销售退货入库
        16 => 'YS', // 16 应收单
        17 => 'SK', // 17 收款单
        18 => 'YF', // 18 应付单
        19 => 'FK', // 19 付款单
        20 => 'TK', // 20 退款单
        26 => 'RFQS',// 26 供应商报价单
        27 => 'BSD',//27 报损单
        28 => 'FY', // 28 费用单
        29 =>'SHCG',//商户采购单
        30 => 'SHRK',//商户入库单
        31 => 'JHD',//拣货单
        32 => 'DBD',//调拨单
        33 => 'BCD',//报损单
    ];


    /**
     * 编码前缀
     * @var array
     */
    public static $code = [
        'brand'      => ['prefix' => 'BRAND', 'length' => 6],//品牌
        'customer'   => ['prefix' => 'CUSTOMER', 'length' => 6],//客户
        'category'   => ['prefix' => 'CATEGORY', 'length' => 6],//分类
        'goodsBasic' => ['prefix' => 'MATERIEL', 'length' => 6],//基础物料code
        'shop'       => ['prefix' => 'SHOP', 'length' => 6],//商铺
        'supplier'   => ['prefix' => 'SUPPLIER', 'length' => 6],//供应商
        'staff'      => ['prefix' => 'STAFF', 'length' => 6],//员工
        'warehouse'  => ['prefix' => 'WAREHOUSE', 'length' => 6],//仓库
        'account'    => ['prefix' => 'ACCOUNT', 'length' => 6],//账户编码
    ];

    /**
     * 角色类型
     * @var array
     */
    public static $roleType = [
        'admin'    => 1,//后台管理员
        'staff'    => 2,//员工
        'customer' => 3,//客户
        'merchant' => 4,//商户
        'supplier' => 5,//供应商
    ];

    /**
     * 数据域类型
     * @var array
     */
    public static $dataFieldType = [
        'person' => 1,//个人
        'staff'  => 2,//员工
        'all'    => 3,//所有
    ];

    /**
     * 小程序模板审核状态
     */
    public static $weixinTemplateStatus = [
        'commit'   => 1, // 提交代码
        'auditing' => 2, // 提交审核
    ];

    /*** @var array 模版状态********* */
    public static $wxAuditStatus = [
        'pass'        => 0,//审核成功
        'refuse'      => 1,//审核拒绝
        'inAudit'     => 2,//审核中
        'withdrawn'   => 3,//已撤回
        'postponed'   => 4,//延后
        'noSubmit'    => 5,//提交审核
        'beenRelease' => 6,//提交代码
        'beingUsed'   => 7,//正在使用
    ];

    /*** @var array 优惠券类型 */
    public static $couponType = [
        'commonly'  => 10,// 普通优惠券
        'vipCoupon' => 20,// 会员卡优惠券
    ];

    /**@var array 发放方式****** */
    public static $grantType = [
        'receive'   => 10,//主动领取
        'grant'     => 20,//定向发放
        'register'  => 30,//注册领取
        'onlinePay' => 40,//在线支付领取
    ];
    /***@var array 商品适用范围* */
    public static $applyRange = [
        'allGoods'        => 10,//全部商品
        'appointCategory' => 20,//指定分类
        'appointBrand'    => 30,//指定品牌
        'goodsCollect'    => 40,//指定商品
    ];

    /***************活动类型*********/
    public static $activityType = [
        'specialOffer' => 10,//特价
        'secKill'      => 20,//秒杀
    ];

    /************************/
    public static $delivery = [
        '包邮',
        '自提'
    ];

    /******@var array $templateType 模版类型 * */
    public static $templateType = [
        'ordinary'  => 1,//普通模版
        'universal' => 2,//万能模版
    ];

    /***@var array $pageType 页面类型** */
    public static $pageType = [
        'home'    => 1,//首页,
        'special' => 2,//专题
    ];

    /*** @var array $specType 规格类型 */
    public static $specType = [
        'single'   => 1,//单规格
        'multiple' => 2,//多规格
    ];

    /*** @var array 系统默认角色id */
    public static $roleId = [
        'cashier' => 1,//收银员工,
        'guide'   => 2,//导购员
    ];

    public static $expressType = [
        'free' => 1,
        'rule' => 2,
        'unify' => 3
    ];

    //匿名用户UID
    public static $noneUserCenter = 99999;

    //匿名客户id
    public static $noneCustomer = 99999;

    /**
     * @var array 流程类型
     */
    public static $processType = [
        'sales' => 1,//订货流程
        'retSales' => 2,//退货流程
    ];

    /**
     * @var array 小程序主体类型
     */
    public static $principalType = [
        'personal' => 0,
        'enterprise' => 1,
        'media' => 2,
        'gov' => 3,
        'other' => 4,
    ];

    /**
     * @var array 业务模式
     */
    public static $modelType = [
        'B2C' => 1,
        'B2B' => 2,
        'multi' => 3,//多商户
    ];
    
    /**
     * @var array 标签颜色
     */
    public static $colourType = [
        1                   => '蓝色',
        2                   => '绿色',
        3                   => '粉色',
        4                   => '橙色',
    ];

    /**
     * 财务账户类型
     */
    public static $financeAccountType = [
        'ali' => 1, // 支付宝账户
        'wx' => 2, // 微信账户
        'bank' => 3, //银行卡账户
        'ordinary' => 4, // 普通账户
    ];

    /**
     * 出库状态
     */
    public static $outStatus = [
        'notOut' => 4, // 未出库
        'allOut' => 5, // 全部出库
        'notAllOut' => 6, // 部分出库
    ];

    /**
     * 支付状态
     */
    public static $payStatus = [
        'pay' => 4,
        'notPay' => 5,
        'refund' => 6,
        'partRefund'=>7,
    ];
}
