package com.xxfc.platform.universal.biz;


import com.xxfc.platform.universal.service.SmsService;
import com.xxfc.platform.universal.utils.CCPRestSmsUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class AliYunSmsBiz {

    //租车订单通知(普通用户)1
    public static final String TEMPLATE_ID_ORDER = "SMS_173247815";
    //租车订单短信(会员权益)2
    public static final String TEMPLATE_ID_ORDER_MEMBER = "SMS_173252767";
    //旅游订单短信3
    public static final String TEMPLATE_ID_ORDER_TOUR = "SMS_173247826";
    //加入会员通知4
    public static final String TEMPLATE_ID_MEMBER = "SMS_173247829";
    //租/还车公司相同（订单支付后立即发送给相关负责人）5
    public static final String TEMPLATE_ID_TAAKE_CAR = "SMS_173247836";
    //租/还车公司不同（发给租车公司负责人，订单支付后发送）6
    public static final String TEMPLATE_ID_DIFFERENT_TAAKE_CAR = "458621";
    // 租/还车公司不同（发给还车公司负责人，订单出车后发））(相同不发)7
    public static final String TEMPLATE_ID_ALSO_CAR = "458620";
    //取消订单9
    public static final String TEMPLATE_ID_CANCEL = "458627";


    //租车（通用）10
    //public static final String TEMPLATE_ID_PAY_A = "460759";
    public static final String TEMPLATE_ID_PAY_A = "SMS_171112286";
    //租车（使用会员权益）11
    //public static final String TEMPLATE_ID_PAY_B = "460760";
    public static final String TEMPLATE_ID_PAY_B = "SMS_173340577";
    //租车内部通知（客服）12
    //public static final String TEMPLATE_ID_PAY_C = "460763";
    public static final String TEMPLATE_ID_PAY_C = "SMS_173345572";
    //租车内部通知（出车人）13
    //public static final String TEMPLATE_ID_PAY_D = "460762";
    public static final String TEMPLATE_ID_PAY_D = "SMS_173340609";
    //租车内部通知（收车人）14
    //public static final String TEMPLATE_ID_PAY_E = "460764";
    public static final String TEMPLATE_ID_PAY_E = "SMS_173345589";
    //旅游（通用）15
    //public static final String TEMPLATE_ID_PAY_F = "460765";
    public static final String TEMPLATE_ID_PAY_F = "SMS_173345597";
    //会员购买（通用）16
    //public static final String TEMPLATE_ID_PAY_G = "460766";
    public static final String TEMPLATE_ID_PAY_G = "SMS_173340637";

    //取消租车（通用）17
    //public static final String TEMPLATE_ID_CANCEL_A= "460767";
    public static final String TEMPLATE_ID_CANCEL_A= "SMS_173345633";
    //取消租车（使用会员权益）18
    //public static final String TEMPLATE_ID_CANCEL_B = "460768";
    public static final String TEMPLATE_ID_CANCEL_B = "SMS_173340658";
    //取消租车（通用扣违约金）19
    //public static final String TEMPLATE_ID_CANCEL_C = "460769";
    public static final String TEMPLATE_ID_CANCEL_C = "SMS_173345646";
    //取消租车（会员权益&扣违 20
    //public static final String TEMPLATE_ID_CANCEL_D = "460770";
    public static final String TEMPLATE_ID_CANCEL_D = "SMS_173340671";
    //取消租车（出车人）21
    //public static final String TEMPLATE_ID_CANCEL_E = "460771";
    public static final String TEMPLATE_ID_CANCEL_E = "SMS_173345667";
    //租车押金退还 22
    //public static final String TEMPLATE_ID_FINISH_A = "460772";
    public static final String TEMPLATE_ID_FINISH_A = "SMS_173340710";
    //违章押金退还 23
    //public static final String TEMPLATE_ID_FINISH_B = "460773";
    public static final String TEMPLATE_ID_FINISH_B = "SMS_173340712";
    //旅游内部通知（客服）24
    //public static final String TEMPLATE_ID_PAY_H = "461421";
    public static final String TEMPLATE_ID_PAY_H = "SMS_173340630";
    //取消旅游订单（客服）25
    //public static final String TEMPLATE_ID_CANCEL_F = "461424";
    public static final String TEMPLATE_ID_CANCEL_F = "SMS_173340695";
    //租车（取车提醒）26
    public static final String TEMPLATE_ID_PAY_I= "SMS_173345539";
    //旅游（上车通知）27
    public static final String TEMPLATE_ID_PAY_J= "SMS_173345606";



    //发送模板消息
    public  void  sendTemplateSMS(Integer type,String phoneNumbers,String[]params){
         switch (type){
             case 1 :
                 CCPRestSmsUtils.sendTemplateSMS(phoneNumbers,params,TEMPLATE_ID_ORDER);
                 break;
             case 2 :
                 CCPRestSmsUtils.sendTemplateSMS(phoneNumbers,params,TEMPLATE_ID_ORDER_MEMBER);
                 break;
             case 3 :
                 CCPRestSmsUtils.sendTemplateSMS(phoneNumbers,params,TEMPLATE_ID_ORDER_TOUR);
                 break;
             case 4 :
                 CCPRestSmsUtils.sendTemplateSMS(phoneNumbers,params,TEMPLATE_ID_MEMBER);
                 break;
             case 5 :
                 CCPRestSmsUtils.sendTemplateSMS(phoneNumbers,params,TEMPLATE_ID_TAAKE_CAR);
                 break;
             case 6 :
                 CCPRestSmsUtils.sendTemplateSMS(phoneNumbers,params,TEMPLATE_ID_DIFFERENT_TAAKE_CAR);
                 break;
             case 7 :
                 CCPRestSmsUtils.sendTemplateSMS(phoneNumbers,params,TEMPLATE_ID_ALSO_CAR);
                 break;
             case 8 :
                 CCPRestSmsUtils.sendTemplateSMS(phoneNumbers,params,TEMPLATE_ID_CANCEL);
                 break;
             case 10 :
                 //CCPRestSmsUtils.sendTemplateSMS(phoneNumbers,params,TEMPLATE_ID_PAY_A);
                 SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_PAY_A);
                 break;
             case 11:
                 SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_PAY_B);
                 break;
             case 12 :
                 SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_PAY_C);
                 break;
             case 13 :
                 SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_PAY_D);
                 break;
             case 14 :
                 SmsService.sendTemplateToJson14(phoneNumbers,params,TEMPLATE_ID_PAY_E);
                 break;
             case 15 :
                 SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_PAY_F);
                 break;
             case 16 :
                 SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_PAY_G);
                 break;
             case 17 :
                 SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_CANCEL_A);
                 break;
             case 18 :
                 SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_CANCEL_B);
                 break;
             case 19 :
                 SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_CANCEL_C);
                 break;
             case 20 :
                 SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_CANCEL_D);
                 break;
             case 21 :
                 SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_CANCEL_E);
                 break;
             case 22 :
                 SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_FINISH_A);
                 break;
             case 23 :
                 SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_FINISH_B);
                 break;
             case 24 :
                 SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_PAY_H);
                 break;
             case 25 :
                 SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_CANCEL_F);
                 break;
             case 26 :
                 SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_PAY_I);
                 break;
             case 27 :
                 SmsService.sendTemplateToJson(phoneNumbers,params,TEMPLATE_ID_PAY_J);
                 break;

         }

    }


}
