package com.sckw.stream.enums;

import com.sckw.core.utils.CollectionUtils;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * @author zk
 * @description 短信模板
 * @date 2020/06/16 08:37:44
 */
@AllArgsConstructor
@Getter
public enum MessageEnum {
    /**
     * 上架商品
     */
    PRODUCT_ON_SHELVES("SYSTEM", "SYSTEM_PRODUCT_ON_SHELVES", "商品已上架",
            "贵司的商品：${productName}，已上架至商城中，请确认相关信息", "terminal,ios,android", ""),
    /**
     * 下架商品
     */
    PRODUCT_REMOVED_SHELVES("SYSTEM", "SYSTEM_PRODUCT_REMOVED_SHELVES", "商品已下架",
            "贵司的商品：${productName}，已从商城中下架了，请确认相关信息", "terminal,ios,android", ""),
    /**
     * 采发起采购下单
     */
    ORDER_INITIATE_PURCHASE("BUSINESS", "BUSINESS_ORDER_INITIATE_PURCHASE", "发起采购下单",
            "贵司发起了对【${firmName}】的商品采购申请，请留意后续消息；订单号:${orderNo}", "terminal,ios,android", ""),
    /**
     * 有新的待受理订单
     */
    ORDER_NEW_PENDING("BUSINESS", "BUSINESS_ORDER_NEW_PENDING", "有新的待受理订单",
            "【${firmName}】发起采购申请，请及时进行受理；订单号：${orderNo}", "terminal,ios,android", ""),
    /**
     * 发起代客下单
     */
    ORDER_INITIATE_SALE("BUSINESS", "BUSINESS_ORDER_INITIATE_SALE", "发起代客下单",
            "贵司已代【${firmName}】发起了商品采购，请及时联系往来单位；订单号：${orderNo}", "terminal,ios,android", ""),
    /**
     * 有新的代客下单信息
     */
    ORDER_NEW_VALET_MSG("BUSINESS", "BUSINESS_ORDER_NEW_VALET_MSG", "有新的代客下单信息",
            "【${firmName}】代您发起了商品采购，请确认；订单号：${orderNo}", "terminal,ios,android", ""),
    /**
     * 驳回采购订单
     */
    ORDER_REJECT_VALET("BUSINESS", "BUSINESS_ORDER_REJECT_VALET", "驳回采购订单",
            "贵司驳回了【${firmName}】的采购申请，请及时通知采购单位；订单号：${orderNo}", "terminal,ios,android", ""),
    /**
     * 采购订单被驳回
     */
    ORDER_REJECT_PURCHASE("BUSINESS", "BUSINESS_ORDER_REJECT_PURCHASE", "采购订单被驳回",
            "您的采购申请被【${firmName}】驳回，请及时查看；订单号：${orderNo}", "terminal,ios,android", ""),
    /**
     * 司机拒绝接单
     */
    WAYBILL_REFUSE_SENDCAR_TRIP("BUSINESS", "BUSINESS_WAYBILL_REFUSE_SENDCAR_TRIP", "司机拒绝接单",
            "贵司指派的运单被拒绝接单了，请及时确认；运单号：${orderNo},司机：${driverName}", "terminal,ios,android", ""),
    /**
     * 司机拒绝接单
     */
    WAYBILL_REFUSE_SENDCAR_CIRCULATE("BUSINESS", "BUSINESS_WAYBILL_REFUSE_SENDCAR_CIRCULATE", "司机拒绝接单",
            "贵司指派的运单被拒绝接单了，请及时确认；承运单号：${orderNo},司机：${driverName}", "terminal,ios,android", ""),

    /**
     * 司机拒绝出车
     */
    WAYBIL_CONFIRM_DEPARTURE("BUSINESS", "BUSINESS_WAYBIL_CONFIRM_DEPARTURE", "司机拒绝出车",
            "贵司的运单被拒绝出车了，请及时确认；运单号：${orderNo},司机：${driverName}", "terminal,ios,android", ""),


    /**
     * 发起企业资质审核
     */
    ENT_CERTIFICATE("SYSTEM", "ENT_CERTIFICATE", "发起企业资质审核", "贵司发起了针对【${entName}】的资质认证，已提交至审核部门，请留意后续消息；发起人：${createByName}", "terminal,ios,android", ""),

    /**
     * 资质审核通过
     */
    ENT_CERTIFICATE_PASS("SYSTEM", "ENT_CERTIFICATE_PASS", "企业资质审核通过", "贵司提交的【${entName}】资质认证，已审核通过；审核人员：${createByName}", "terminal,ios,android", ""),

    /**
     * 资质审核驳回
     */
    ENT_CERTIFICATE_REFUSED("SYSTEM", "ENT_CERTIFICATE_REFUSED", "企业资质审核驳回", "贵司提交的【${entName}】资质认证，已被审核驳回，请查看驳回原因并及时修改；审核人员：${createByName}", "terminal,ios,android", ""),

    /**
     * 发起主体单位资质审核
     */
    ENT_DEPT_CERTIFICATE("SYSTEM", "ENT_DEPT_CERTIFICATE", "发起主体单位资质审核", "贵司发起了针对【${entName}】的资质认证，已提交至审核部门，请留意后续消息；发起人：${createByName}", "terminal,ios,android", ""),

    /**
     * 主体单位资质审核通过
     */
    ENT_DEPT_CERTIFICATE_PASS("SYSTEM", "ENT_DEPT_CERTIFICATE_PASS", "主体单位资质审核通过", "贵司提交的【${entName}】资质认证，已审核通过；审核人员：${createByName}", "terminal,ios,android", ""),

    /**
     * 主体单位资质审核驳回
     */
    ENT_DEPT_CERTIFICATE_REFUSED("SYSTEM", "ENT_DEPT_CERTIFICATE_REFUSED", "主体单位资质审核驳回", "贵司提交的【${entName}】资质认证，已被审核驳回，请查看驳回原因并及时修改；审核人员：${createByName}", "terminal,ios,android", ""),


    /**
     * 发起合作申请
     */
    SUBMIT_COOPERATE("SYSTEM", "SUBMIT_COOPERATE", "发起合作申请", "贵司发起了与【${entName}】的合作申请，请留意后续消息；发起人：${createByName}", "terminal,ios,android", ""),

    /**
     * 合作申请待审核
     */
    COOPERATE_WAIT_APPROVAL("SYSTEM", "COOPERATE_WAIT_APPROVAL", "合作申请待审核", "【${entName}】对贵司发起了企业合作申请，请前往确认", "terminal,ios,android", ""),

    /**
     * 合作申请审核通过
     */
    COOPERATE_PASS("SYSTEM", "COOPERATE_PASS", "合作申请审核通过", "贵司发起的与【${entName}有限公司】的合作申请，已通过", "terminal,ios,android", ""),


    /**
     * 合作申请审核驳回
     */
    COOPERATE_REFUSED("SYSTEM", "COOPERATE_REFUSED", "合作申请审核驳回", "贵司发起的与【${entName}有限公司】的合作申请，已驳回，请及时确认", "terminal,ios,android", ""),

    /**
     * 解除合作关系
     */
    COOPERATE_DISSOLVE("SYSTEM", "COOPERATE_DISSOLVE", "解除合作关系", "贵司解除了与【${entName}】的合作关系，请及时通知合作单位；操作人：${createByName}", "terminal,ios,android", ""),

    /**
     * 合作关系被解除
     */
    COOPERATE_DISSOLVED("SYSTEM", "COOPERATE_DISSOLVED", "合作关系被解除", "【${entName}】解除了与贵司的合作关系，请及时联系合作范围并确认", "terminal,ios,android", ""),

    /**
     * 恢复合作关系
     */
    COOPERATE_RESTORE("SYSTEM", "COOPERATE_RESTORE", "恢复合作关系", "贵司恢复了与【${entName}有限公司】的合作关系，请及时通知合作单位；操作人：${createByName}", "terminal,ios,android", ""),

    /**
     * 合作关系被恢复
     */
    COOPERATE_RESTORED("SYSTEM", "COOPERATE_RESTORED", "合作关系被恢复", "【${entName}有限公司】恢复了与贵司的合作关系，请及时联系合作范围并确认", "terminal,ios,android", ""),

    /**
     * 托运订单-发起物流托运
     * 触发点-贸易订单物流托运确认/承运订单分包托运确认
     */
    INITIATING_LOGISTICS_CONSIGNMENT("BUSINESS", "BUSINESS_INITIATING_LOGISTICS_CONSIGNMENT", "发起物流托运",
            "贵司发起了对【${companyName}】的物流分配计划，请留意后续消息；订单号：${orderNo}", "terminal,ios,android", "托运订单-发起物流托运-贸易订单物流托运确认/承运订单分包托运确认"),

    /**
     * 托运订单-自建物流订单
     */
    NEW_LOGISTICS_ORDER("BUSINESS", "BUSINESS_NEW_LOGISTICS_ORDER", "自建物流订单",
            "贵司通过自建物流订单，发起了对【${companyName}】的物流分配计划，请留意后续消息；订单号：${orderNo}", "terminal,ios,android", "托运订单-自建物流订单"),

    /**
     * 托运订单-承运商批量导入订单
     */
    ACCEPT_CARRIAGE_IMPORT_EXCEL("BUSINESS", "ACCEPT_CARRIAGE_IMPORT_EXCEL", "承运商批量导入订单",
            "【${companyName}】通过批量操作生成了【${number}】条物流订单，请及时确认", "terminal,ios,android", "托运订单-承运商批量导入"),


    /**
     * 托运订单-撤回物流分配计划
     */
    CANCELLATION_LOGISTICS("BUSINESS", "BUSINESS_CANCELLATION_LOGISTICS", "撤回物流分配计划",
            "贵司撤回了分配给【${companyName}】的物流分配计划，请及时确认；订单号：${orderNo}", "terminal,ios,android", "托运订单-撤回物流分配计划"),

    /**
     * 托运订单-承运方拒绝订单
     */
    REJECT_ORDER("BUSINESS", "BUSINESS_REJECT_ORDER", "承运方拒绝订单",
            "你的物流托运任务被【【${companyName}】拒绝接单，请及时查看；订单号：${orderNo}", "terminal,ios,android", "托运订单-承运方拒绝订单"),

    /**
     * 承运订单-批量导入承运订单
     */
    CONSIGN_IMPORT_EXCEL("BUSINESS", "CONSIGN_IMPORT_EXCEL", "批量导入承运订单",
            "贵司通过批量操作导入了【${number}】条物流订单，请及时确认", "terminal,ios,android", "承运订单-批量导入承运订单"),


    /**
     * 承运订单-有新分配的承运任务
     */
    NEW_CARRIAGE_ORDER("BUSINESS", "BUSINESS_NEW_CARRIAGE_ORDER", "有新分配的承运任务",
            "【${companyName}】给您分配了物流承运计划，请及时查看；订单号：${orderNo}", "terminal,ios,android", "承运订单-有新分配的承运任务"),
    /**
     * 承运订单-自建物流订单
     */
    CARRIAGE_NEW_LOGISTICS_ORDER("BUSINESS", "BUSINESS_CARRIAGE_NEW_LOGISTICS_ORDER", "自建物流订单",
            "贵司通过自建物流订单，发起了对【${companyName}】的物流承运计划，请及时通知往来单位；订单号：${orderNo}", "terminal,ios,android", "承运订单-自建物流订单"),
    /**
     * 承运订单-拒绝分配计划
     */
    CARRIAGE_DISALLOTMENT("BUSINESS", "BUSINESS_CARRIAGE_DISALLOTMENT", "拒绝分配计划",
            "贵司拒绝了【${companyName}】的物流分配计划，请及时通知往来单位；订单号：${orderNo}", "terminal,ios,android", "承运订单-拒绝分配计划"),
    /**
     * 承运订单-托运方撤回承运任务
     */
    CARRIAGE_CANCELLATION_LOGISTICS("BUSINESS", "BUSINESS_CARRIAGE_CANCELLATION_LOGISTICS", "托运方撤回承运任务",
            "【${companyName}】撤销了分配给您的物流承运计划，请及时查看；订单号：${orderNo}", "terminal,ios,android", "承运订单-托运方撤回承运任务"),

    /**
     * 托运订单-承运方接单
     */
    CONSIGN_ACCEPT_LOGISTICS("BUSINESS", "BUSINESS_CONSIGN_ACCEPT_LOGISTICS", "承运方接单",
            "【${companyName}】接受了贵司的物流分配计划，请及时查看；订单号：${orderNo}", "terminal,ios,android", "托运订单-承运方接单"),

    /**
     * 承运订单-我方接受物流任务
     */
    CARRIAGE_ACCEPT_LOGISTICS("BUSINESS", "BUSINESS_CARRIAGE_ACCEPT_LOGISTICS", "我方接受物流任务",
            "贵司接受了【${companyName}】分配的物流分配任务，请及时查看；订单号：${orderNo}", "terminal,ios,android", "承运订单-我方接受物流任务"),

    /**
     * 托运订单-承运方自建物流订单-触发点自建承运物流订单确认
     */
    CARRIAGE_NEW_LOGISTICS("BUSINESS", "BUSINESS_CARRIAGE_NEW_LOGISTICS", "承运方自建物流订单",
            "【${companyName}】自建了一条与贵司合作的物流订单，请及时确认；订单号：${orderNo}", "terminal,ios,android", "托运订单-承运方自建物流订单"),
    /*对账结算*/
    /**
     * 销售、采购对账
     */
    LEDGER_SELL("BUSINESS", "BUSINESS_LEDGER_SELL", "发起销售对账",
            "贵司发起了对【${company}】的贸易对账，请留意后续消息；对账单号：${number}，对账单名称：${name}", "terminal,ios,android", ""),
    LEDGER_PURCHASE("BUSINESS", "BUSINESS_LEDGER_PURCHASE", "发起销售对账",
            "【${company}】对贵司发起了贸易对账确认操作，请及时查看；对账单号：${number}，对账单名称：${name}", "terminal,ios,android", ""),
    LEDGER_REVOCATION_SELL("BUSINESS", "BUSINESS_LEDGER_REVOCATION_SELL", "撤回对账",
            "贵司撤回了与【${company}】的贸易对账，请及时确认并联系往来单位；对账单号：${number}，对账单名称：${name}", "terminal,ios,android", ""),
    LEDGER_REVOCATION_PURCHASE("BUSINESS", "BUSINESS_LEDGER_REVOCATION_PURCHASE", "撤回对账",
            "贵司撤回了与【${company}】的贸易对账，请及时确认并联系往来单位；对账单号：${number}，对账单名称：${name}", "terminal,ios,android", ""),

    LEDGER_CONFIRM_SELL("BUSINESS", "BUSINESS_LEDGER_CONFIRM_SELL", "对账申请审核通过",
            "贵司对【${company}】发起的贸易对账申请已审核通过，请及时确认；对账单号：${number}，对账单名称：${name}", "terminal,ios,android", ""),
    LEDGER_CONFIRM_PURCHASE("BUSINESS", "BUSINESS_LEDGER_CONFIRM_PURCHASE", "对账申请审核通过",
            "【${company}】发起的对账申请，贵司已审核通过，请确认；对账单号：${number}，对账单名称：${name}", "terminal,ios,android", ""),

    LEDGER_SUCCESS_SELL("BUSINESS", "BUSINESS_LEDGER_SUCCESS_SELL", "销售对账完成",
            "贵司完成了与【${company}】的对账，系统生成了结算单，请及时确认；对账单号：${number}，对账单名称：${name}", "terminal,ios,android", ""),
    LEDGER_SUCCESS_PURCHASE("BUSINESS", "BUSINESS_LEDGER_SUCCESS_PURCHASE", "销售对账完成",
            "【${company}】已完成对账流程，系统生成了结算单，请及时确认；对账单号：${number}，对账单名称：${name}", "terminal,ios,android", ""),

    LEDGER_BACK_SELL("BUSINESS", "BUSINESS_LEDGER_BACK_SELL", "付款方驳回对账申请",
            "贵司的贸易对账申请被【${company}】驳回，请及时查看；对账单号：${number}，对账单名称：${name}", "terminal,ios,android", ""),
    LEDGER_BACK_PURCHASE("BUSINESS", "BUSINESS_LEDGER_BACK_PURCHASE", "付款方驳回对账申请",
            "贵司驳回了与【${company}】的贸易对账，请及时确认；对账单号：${number}，对账单名称：${name}", "terminal,ios,android", ""),
    /**
     * 承运、托运对账
     */
    LEDGER_CARRIER("BUSINESS", "BUSINESS_LEDGER_CARRIER", "发起销售对账",
            "贵司发起了对【${company}】的物流对账，请留意后续消息；对账单号：${number}，对账单名称：${name}", "terminal,ios,android", ""),
    LEDGER_SHIPPER("BUSINESS", "BUSINESS_LEDGER_SHIPPER", "发起销售对账",
            "【${company}】对贵司发起了物流对账确认操作，请及时查看；对账单号：${number}，对账单名称：${name}", "terminal,ios,android", ""),
    LEDGER_REVOCATION_CARRIER("BUSINESS", "BUSINESS_LEDGER_REVOCATION_CARRIER", "撤回对账",
            "贵司撤回了与【${company}】的物流对账，请及时确认并联系往来单位；对账单号：${number}，对账单名称：${name}", "terminal,ios,android", ""),
    LEDGER_REVOCATION_SHIPPER("BUSINESS", "BUSINESS_LEDGER_REVOCATION_SHIPPER", "撤回对账",
            "【${company}】撤回了对贵司发起的物流对账申请，请及时确认；对账单号：${number}，对账单名称：${name}", "terminal,ios,android", ""),

    LEDGER_CONFIRM_CARRIER("BUSINESS", "BUSINESS_LEDGER_CONFIRM_CARRIER", "对账申请审核通过",
            "贵司对【${company}】发起的物流对账申请已审核通过，请及时确认；对账单号：${number}，对账单名称：${name}", "terminal,ios,android", ""),
    LEDGER_CONFIRM_SHIPPER("BUSINESS", "BUSINESS_LEDGER_CONFIRM_SHIPPER", "对账申请审核通过",
            "【${company}】发起的对账申请，贵司已审核通过，请确认；对账单号：${number}，对账单名称：${name}", "terminal,ios,android", ""),

    LEDGER_SUCCESS_CARRIER("BUSINESS", "BUSINESS_LEDGER_SUCCESS_CARRIER", "销售对账完成",
            "贵司完成了与【${company}】的对账，系统生成了结算单，请及时确认；对账单号：${number}，对账单名称：${name}", "terminal,ios,android", ""),
    LEDGER_SUCCESS_SHIPPER("BUSINESS", "BUSINESS_LEDGER_SUCCESS_SHIPPER", "销售对账完成",
            "【${company}】已完成对账流程，系统生成了结算单，请及时确认；对账单号：${number}，对账单名称：${name}", "terminal,ios,android", ""),

    LEDGER_BACK_CARRIER("BUSINESS", "BUSINESS_LEDGER_BACK_CARRIER", "付款方驳回对账申请",
            "贵司的物流对账申请被【${company}】驳回，请及时查看；对账单号：${number}，对账单名称：${name}", "terminal,ios,android", ""),
    LEDGER_BACK_SHIPPER("BUSINESS", "BUSINESS_LEDGER_BACK_SHIPPER", "付款方驳回对账申请",
            "贵司驳回了与【${company}】的物流对账，请及时确认；对账单号：${number}，对账单名称：${name}", "terminal,ios,android", ""),

    /**
     * 销售、采购结算
     */
    //确认对账
    SETTLEMENT_SELL("BUSINESS", "SETTLEMENT_SELL", "新增销售结算任务",
            "贵司有一条新增的结算业务，请及时查看；【${company}】；结算单号：${number}", "terminal,ios,android", ""),
    SETTLEMENT_PURCHASE("BUSINESS", "SETTLEMENT_PURCHASE", "新增采购结算任务",
            "贵司有一条新增的结算业务，请及时查看；【${company}】；结算单号：${number}", "terminal,ios,android", ""),
    //确认收款
    SETTLEMENT_CONFIRM_SELL("BUSINESS", "SETTLEMENT_CONFIRM_SELL", "销售结算确认收款",
            "贵司对一条结算单进行了确认收款操作，请及时确认；结算单号：${number}", "terminal,ios,android", ""),
    SETTLEMENT_CONFIRM_PURCHASE("BUSINESS", "SETTLEMENT_CONFIRM_PURCHASE", "采购结算确认收款",
            "【${company}】与贵司的一条结算业务已确认收款，请及时确认；结算单号：${number}", "terminal,ios,android", ""),
    //发起付款
    SETTLEMENT_START_SELL("BUSINESS", "SETTLEMENT_START_SELL", "销售付款被发起",
            "【${company}】发起了对贵司的付款操作，请及时联系付款方进行确认；结算单号：${number}", "terminal,ios,android", ""),
    SETTLEMENT_START_PURCHASE("BUSINESS", "SETTLEMENT_START_PURCHASE", "发起采购付款",
            "贵司已发起了对【${company}】的付款操作，请及时确认并联系收款单位；结算单号：${number}", "terminal,ios,android", ""),

    /**
     * 承运、托运结算
     */
    //确认对账
    SETTLEMENT_CARRIER("BUSINESS", "SETTLEMENT_CARRIER", "新增承运结算任务",
            "贵司有一条新增的结算业务，请及时查看；【${company}】；结算单号：${number}", "terminal,ios,android", ""),
    SETTLEMENT_SHIPPER("BUSINESS", "SETTLEMENT_SHIPPER", "新增托运结算任务",
            "贵司有一条新增的结算业务，请及时查看；【${company}】；结算单号：${number}", "terminal,ios,android", ""),
    //确认收款
    SETTLEMENT_CONFIRM_CARRIER("BUSINESS", "SETTLEMENT_CONFIRM_CARRIER", "承运结算确认收款",
            "贵司对一条结算单进行了确认收款操作，请及时确认；结算单号：${number}", "terminal,ios,android", ""),
    SETTLEMENT_CONFIRM_SHIPPER("BUSINESS", "SETTLEMENT_CONFIRM_SHIPPER", "托运结算确认收款",
            "【${company}】与贵司的一条结算业务已确认收款，请及时确认；结算单号：${number}", "terminal,ios,android", ""),
    //发起付款
    SETTLEMENT_START_CARRIER("BUSINESS", "SETTLEMENT_START_CARRIER", "承运付款被发起",
            "【${company}】发起了对贵司的付款操作，请及时联系付款方进行确认；结算单号：${number}", "terminal,ios,android", ""),
    SETTLEMENT_START_SHIPPER("BUSINESS", "SETTLEMENT_START_SHIPPER", "发起托运付款",
            "贵司已发起了对【${company}】的付款操作，请及时确认并联系收款单位；结算单号：${number}", "terminal,ios,android", ""),

    /**
     * 合同-销售合同、托运合同  补充合同
     */
    SAELCONTRACT_SUBMIT_DATA("BUSINESS", "SAELCONTRACT_SUBMIT_DATA", "发起补充合同签约", "贵司新建了补充合同并发起与【${entName}】的合同签约流程，请留意电话短信；合同编号：${contract_no}，合同名称：${name}", "terminal,ios,android", ""),


    /**
     * 完结合同
     */
    SAELCONTRACT_COMPLETE_CONTRACT("BUSINESS", "SAELCONTRACT_COMPLETE_CONTRACT", "完结合同", "贵司已完结了与【${entName}】间的签约合同，请及时通知合作单位；合同编号：${contract_no}，合同名称：${name}", "terminal,ios,android", ""),

    /**
     * 发起
     */
    SAELCONTRACT_SEND_CONTRACT("BUSINESS", "SAELCONTRACT_SEND_CONTRACT", "发起合同签约", "贵司新建了合同并发起与【${entName}】的合同签约流程，请留意电话短信；合同编号：${contract_no}，合同名称：${name}", "terminal,ios,android", ""),

    /**
     * 合同签约成功
     */
    SAELCONTRACT_SUCCESS_CONTRACT("BUSINESS", "SAELCONTRACT_SUCCESS_CONTRACT", "合同签约成功", "贵司已成功与【${entName}】签约合同；合同编号：${contract_no}，合同名称：${name}", "terminal,ios,android", ""),

    /**
     * 合同-采购合同、承运合同  对方已发起签约
     */
    BUYCONTRACT_PROCESS_SEND("BUSINESS", "SAELCONTRACT_SUBMIT_DATA", "合同签约流程已发起", "【${entName}】新建合同并发起签约流程，请留意电话短信；合同编号：${contract_no}，合同名称：${name}", "terminal,ios,android", ""),

    /**
     * 补充合同签约流程已发起
     */
    BUYCONTRACT_SUPPLYPROCESS_SEND("BUSINESS", "BUYCONTRACT_SUPPLYPROCESS_SEND", "补充合同签约流程已发起", "【${entName}】新建补充合同并发起签约流程，请留意电话短信；合同编号：${contract_no}，合同名称：${name}", "terminal,ios,android", ""),

    /**
     * 合同签约成功
     */
    BUYCONTRACT_SUCCESS_CONTRACT("BUSINESS", "BUYCONTRACT_SUCCESS_CONTRACT", "合同签约成功", "贵司已成功与【${entName}】签约合同；合同编号：${contract_no}，合同名称：${name}", "terminal,ios,android", ""),

    /**
     * 合同被完结
     */
    BUYCONTRACT_COMPLETE_CONTRACT("BUSINESS", "BUYCONTRACT_COMPLETE_CONTRACT", "合同被完结", "【${entName}】完结了与贵司签约的合同，请及时联系确认；；合同编号：${contract_no}，合同名称：${name}", "terminal,ios,android", ""),


    ;


    /**
     * 消息分类：BUSINESS业务消息，SYSTEM系统消息
     */
    private final String category;

    /**
     * 消息类型
     */
    private final String type;

    /**
     * 消息标题
     */
    private final String title;

    /**
     * 消息内容
     */
    private final String content;

    /**
     * 显示终端 terminal ios android
     */
    private final String pushType;

    /**
     * 字段含义解释
     */
    private final String desc;


    public static String getCategoryByType(String type) {
        for (MessageEnum entityEnum : MessageEnum.values()) {
            if (entityEnum.getType().equals(type)) {
                return entityEnum.getCategory();
            }
        }
        return null;
    }

    public static String getTitleByType(String type) {
        for (MessageEnum entityEnum : MessageEnum.values()) {
            if (entityEnum.getType().equals(type)) {
                return entityEnum.getTitle();
            }
        }
        return null;
    }

    public static String getContentByType(String type) {
        for (MessageEnum entityEnum : MessageEnum.values()) {
            if (entityEnum.getType().equals(type)) {
                return entityEnum.getContent();
            }
        }
        return null;
    }

    public static String getDesc(MessageEnum messageEnum) {
        for (MessageEnum entityEnum : MessageEnum.values()) {
            if (entityEnum.equals(messageEnum)) {
                return entityEnum.getDesc();
            }
        }
        return null;
    }

    public static List<MessageEnum> getEnums(Boolean isMain, Integer length, Set<MessageEnum> excludeEnums) {
        List<MessageEnum> list = Arrays.stream(MessageEnum.values())
                .filter(e -> CollectionUtils.isEmpty(excludeEnums) || !excludeEnums.contains(e))
                .filter(e -> Boolean.TRUE.equals(isMain) || "BUSINESS".equals(e.getCategory()))
                .limit(length)
                .collect(Collectors.toList());
        return CollectionUtils.emptyIfNull(list);
    }

    public static MessageEnum getEnumByCategoryAndType(String category, String type) {
        for (MessageEnum e : MessageEnum.values()) {
            if (e.getCategory().equals(category) && e.getType().equals(type)) {
                return e;
            }
        }
        return null;
    }
}
