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_204415111";
    //租车订单短信(会员权益)2
    public static final String TEMPLATE_ID_ORDER_MEMBER = "SMS_204415113";
    //旅游订单短信3
    public static final String TEMPLATE_ID_ORDER_TOUR = "SMS_204415115";
    //加入会员通知4
    public static final String TEMPLATE_ID_MEMBER = "SMS_204297476";
    //租/还车公司相同（订单支付后立即发送给相关负责人）5
    public static final String TEMPLATE_ID_TAAKE_CAR = "SMS_204287516";
    //租/还车公司不同（发给租车公司负责人，订单支付后发送）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_204415121";
    //租车（使用会员权益）11
    //public static final String TEMPLATE_ID_PAY_B = "460760";
    public static final String TEMPLATE_ID_PAY_B = "SMS_204415118";
    //租车内部通知（客服）12
    //public static final String TEMPLATE_ID_PAY_C = "460763";
    public static final String TEMPLATE_ID_PAY_C = "SMS_204287525";
    //租车内部通知（出车人）13
    //public static final String TEMPLATE_ID_PAY_D = "460762";
    public static final String TEMPLATE_ID_PAY_D = "SMS_204277598";
    //租车内部通知（收车人）14
    //public static final String TEMPLATE_ID_PAY_E = "460764";
    public static final String TEMPLATE_ID_PAY_E = "SMS_204277599";
    //旅游（通用）15
    //public static final String TEMPLATE_ID_PAY_F = "460765";
    public static final String TEMPLATE_ID_PAY_F = "SMS_204297493";
    //会员购买（通用）16
    //public static final String TEMPLATE_ID_PAY_G = "460766";
    public static final String TEMPLATE_ID_PAY_G = "SMS_204277603";

    //取消租车（通用）17
    //public static final String TEMPLATE_ID_CANCEL_A= "460767";
    public static final String TEMPLATE_ID_CANCEL_A= "SMS_204415129";
    //取消租车（使用会员权益）18
    //public static final String TEMPLATE_ID_CANCEL_B = "460768";
    public static final String TEMPLATE_ID_CANCEL_B = "SMS_204277607";
    //取消租车（通用扣违约金）19
    //public static final String TEMPLATE_ID_CANCEL_C = "460769";
    public static final String TEMPLATE_ID_CANCEL_C = "SMS_204277608";
    //取消租车（会员权益&扣违 20
    //public static final String TEMPLATE_ID_CANCEL_D = "460770";
    public static final String TEMPLATE_ID_CANCEL_D = "SMS_204287539";
    //取消租车（出车人）21
    //public static final String TEMPLATE_ID_CANCEL_E = "460771";
    public static final String TEMPLATE_ID_CANCEL_E = "SMS_204277611";
    //租车押金退还 22
    //public static final String TEMPLATE_ID_FINISH_A = "460772";
    public static final String TEMPLATE_ID_FINISH_A = "SMS_204297503";
    //违章押金退还 23
    //public static final String TEMPLATE_ID_FINISH_B = "460773";
    public static final String TEMPLATE_ID_FINISH_B = "SMS_204277616";
    //旅游内部通知（客服）24
    //public static final String TEMPLATE_ID_PAY_H = "461421";
    public static final String TEMPLATE_ID_PAY_H = "SMS_204287547";
    //取消旅游订单（客服）25
    //public static final String TEMPLATE_ID_CANCEL_F = "461424";
    public static final String TEMPLATE_ID_CANCEL_F = "SMS_204277618";
    //租车（取车提醒）26
    public static final String TEMPLATE_ID_PAY_I= "SMS_204415136";
    //旅游（上车通知）27
    public static final String TEMPLATE_ID_PAY_J= "SMS_204287550";

    //旅游（上车通知）27
    public static final String PWD= "SMS_204415140";



    //发送模板消息
    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;
             case 28 :
                 SmsService.sendTemplateToJson(phoneNumbers,params,PWD);
                 break;

         }

    }


}
