//package com.ningdatech.pmapi.meeting.builder;
//
//
//import com.ningdatech.pmapi.meeting.entity.domain.Meeting;
//import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert;
//import com.ningdatech.pmapi.sms.utils.DateUtil;
//
//import java.time.format.DateTimeFormatter;
//import java.util.ArrayList;
//import java.util.List;
//
///**
// * <p>
// * YxtSmsContextBuilder
// * </p>
// *
// * @author WendyYang
// * @since 14:19 2022/11/17
// */
//public class YxtSmsContextBuilder {
//
//    private YxtSmsContextBuilder() {
//    }
//
//    public static List<SendSmsContext> smsToExpertByCancelMeeting(Meeting meeting, List<MeetingExpert> experts, String meetingType) {
//        String holdCompany = meeting.getHoldCompanyBracket();
//        String meetingTime = meeting.getStartTime().format(DateUtil.DTF_YMD_HM);
//        List<SendSmsContext> contexts = new ArrayList<>();
//        for (MeetingExpert me : experts) {
//            SendSmsContext context = new SendSmsContext();
//            context.setContent(holdCompany + String.format(YxtSmsTemplateConst.MEETING_CANCEL,
//                    me.getExpertName(), meeting.getCancelRemark(), meetingTime, meetingType, meeting.getContact()));
//            context.setReceiveNumber(me.getMobile());
//            contexts.add(context);
//        }
//        return contexts;
//    }
//
//    public static List<SendSmsContext> smsToExpertBySendNotice(Meeting meeting, List<MeetingExpert> experts, String meetingType) {
//        String holdCompany = meeting.getHoldCompanyBracket();
//        String meetingTime = meeting.getStartTime().format(DateUtil.DTF_YMD_HM);
//        List<SendSmsContext> contexts = new ArrayList<>();
//        for (MeetingExpert me : experts) {
//            SendSmsContext context = new SendSmsContext();
//            context.setContent(holdCompany + String.format(YxtSmsTemplateConst.SEND_MEETING_NOTICE,
//                    me.getExpertName(), me.getUpdateOn().format(DateUtil.DTF_YMD_HM),
//                    meetingType, meetingTime, meeting.getRegionDetail(), meeting.getContact()));
//            context.setReceiveNumber(me.getMobile());
//            contexts.add(context);
//        }
//        return contexts;
//    }
//
//    public static SendSmsContext smsToExpertByReplace(Meeting meeting, MeetingExpert expert, String meetingType) {
//        SendSmsContext context = new SendSmsContext();
//        String holdCompany = meeting.getHoldCompanyBracket();
//        context.setContent(holdCompany + String.format(YxtSmsTemplateConst.EXPERT_REPLACED,
//                expert.getExpertName(),
//                meeting.getStartTime().format(DateUtil.DTF_YMD_HM),
//                meetingType,
//                meeting.getContact()
//        ));
//        context.setReceiveNumber(expert.getMobile());
//        return context;
//    }
//
//    public static List<SendSmsContext> smsToExpertByMeetingChange(Meeting old, Meeting curr, List<MeetingExpert> experts, String meetingType) {
//        List<SendSmsContext> contexts = new ArrayList<>();
//        String holdCompany = curr.getHoldCompanyBracket();
//        String sTimeOld = old.getStartTime().format(DateUtil.DTF_YMD_HM);
//        String sTimeNew = curr.getStartTime().format(DateUtil.DTF_YMD_HM);
//        for (MeetingExpert me : experts) {
//            SendSmsContext context = new SendSmsContext();
//            String content = String.format(YxtSmsTemplateConst.MEETING_INGO_CHANGE, me.getExpertName(),
//                    sTimeOld, meetingType, sTimeNew, curr.getRegionDetail(), curr.getContact());
//            context.setContent(holdCompany + content);
//            context.setReceiveNumber(me.getMobile());
//            contexts.add(context);
//        }
//        return contexts;
//    }
//
//    public static SendSmsContext smsToInvitorByExpertLeave(UserBasicInfo invitor, String meetingName, String expertName) {
//        SendSmsContext context = new SendSmsContext();
//        context.setReceiveNumber(invitor.getPhoneNo());
//        context.setContent(String.format(YxtSmsTemplateConst.TEMP_LEAVE_APPLY, invitor.getNickName(),
//                meetingName, expertName, WebProperties.webUrl));
//        return context;
//    }
//
//    public static SendSmsContext smsToExpertByLeavePassed(ExpertLeave leave, String leaveUser, String mobile) {
//        String smsContent = String.format(YxtSmsTemplateConst.LEAVE_APPLY_PASSED, leaveUser,
//                leave.getStartTime().format(DateTimeFormatter.ofPattern(DatePattern.YMD_HMS)),
//                leave.getEndTime().format(DateTimeFormatter.ofPattern(DatePattern.YMD_HMS)));
//        SendSmsContext context = new SendSmsContext();
//        context.setContent(smsContent);
//        context.setReceiveNumber(mobile);
//        return context;
//    }
//
//    public static SendSmsContext smsToExpertBtLeaveReject(String leaveUser, String mobile, String opinion) {
//        String smsContent = String.format(YxtSmsTemplateConst.LEAVE_APPLY_REFUSED, leaveUser, opinion);
//        SendSmsContext context = new SendSmsContext();
//        context.setContent(smsContent);
//        context.setReceiveNumber(mobile);
//        return context;
//    }
//
//    public static SendSmsContext smsByRandomInviteStop(String inviterName, String meetingName, String mobile) {
//        String smsContent = String.format(YxtSmsTemplateConst.RANDOM_INVITE_STOP,
//                inviterName, meetingName, WebProperties.webUrl
//        );
//        SendSmsContext context = new SendSmsContext();
//        context.setContent(smsContent);
//        context.setReceiveNumber(mobile);
//        return context;
//    }
//
//
//    public static SendSmsContext meetingInviteCompleteNotice(Meeting meeting) {
//        String smsContent = String.format(YxtSmsTemplateConst.RANDOM_EXTRACTION_COMPLETED,
//                meeting.getConnecter(), meeting.getName(), WebProperties.webUrl
//        );
//        SendSmsContext context = new SendSmsContext();
//        context.setContent(smsContent);
//        context.setReceiveNumber(meeting.getContact());
//        return context;
//    }
//}
