@Transactional(readOnly = false)
 public Object getInfoList(String notreId) {
   MessageInfoExample messageInfoExample = new MessageInfoExample();
   messageInfoExample.createCriteria().andNoteIdEqualTo(notreId);
   List<MessageInfo> messageInfoList = messageInfoMapper.selectByExample(messageInfoExample);
   return messageInfoList;
 }
  @Transactional(readOnly = false)
  public Object sendMessage(String[] array, MessageNote messageNote) {
    Subject pricipalSubject = SecurityUtils.getSubject();
    User pricipalUser = (User) pricipalSubject.getPrincipal();
    JqReturnJson returnResult = new JqReturnJson(); // 构建返回结果,默认结果为false
    List<String> noteList = new ArrayList<String>(); // 构建接收邮箱List
    messageNote.setNoteId(RandomGUID.getRandomGUID());
    int count = 0;
    if (messageNote.getNoteType().equals("candidate")) { // 部分群发
      for (int i = 0; i < array.length; i++) {
        Member member = memberService.getMemberMsg(array[i]);
        noteList.add(member.getMobileNumber());
      }
      // 对MessageEmail赋值
      messageNote.setCreater(pricipalUser.getUserId());
      messageNote.setCreaterTime(new Date());
      messageNote.setNoteTime(new Date());
      count = messageNoteMapper.insertSelective(messageNote);
      if (count == 1) {
        for (int i = 0; i < array.length; i++) {
          Member member = memberService.getMemberMsg(array[i]);
          MessageInfo messageInfo = new MessageInfo(); // 构建邮箱记录
          messageInfo.setInfoId(RandomGUID.getRandomGUID()); // 随即产生32位ID
          messageInfo.setInfoTitle(messageNote.getNoteTitle()); // 设置标题
          messageInfo.setInfoSend(pricipalUser.getUserId()); // 管理员
          messageInfo.setInfoMemberid(member.getMemberId()); // 会员ID
          messageInfo.setCreaterTime(new Date()); // 设置当前时间
          messageInfo.setNoteId(messageNote.getNoteId()); // 设置活动邮件ID
          messageInfoMapper.insertSelective(messageInfo); // 执行添加
        }
      }

      for (int i = 0; i < noteList.size(); i++) {
        noteSend(messageNote.getNoteText(), noteList.get(i));
      }

      returnResult.setMsg("发送成功");
      returnResult.setSuccess(true);

    } else if (messageNote.getNoteType().equals("mass")) { // 群发会员
      List<Member> memberList = memberService.getMemberList();
      for (Member member : memberList) {
        noteList.add(member.getMobileNumber());
      }
      // 对MessageEmail赋值
      messageNote.setCreater(pricipalUser.getUserId());
      messageNote.setCreaterTime(new Date());
      messageNote.setNoteTime(new Date());
      count = messageNoteMapper.insertSelective(messageNote);
      if (count == 1) {
        for (Member member : memberList) {
          MessageInfo messageInfo = new MessageInfo(); // 构建邮箱记录
          messageInfo.setInfoId(RandomGUID.getRandomGUID()); // 随即产生32位ID
          messageInfo.setInfoTitle(messageNote.getNoteTitle()); // 设置标题
          messageInfo.setInfoSend(pricipalUser.getUserId()); // 管理员
          messageInfo.setInfoMemberid(member.getMemberId()); // 会员ID
          messageInfo.setCreaterTime(new Date()); // 设置当前时间
          messageInfo.setNoteId(messageNote.getNoteId()); // 设置活动邮件ID
          messageInfoMapper.insertSelective(messageInfo); // 执行添加
        }
      }

      for (int i = 0; i < noteList.size(); i++) {
        noteSend(messageNote.getNoteText(), noteList.get(i));
      }

      returnResult.setMsg("发送成功");
      returnResult.setSuccess(true);

    } else if (messageNote.getNoteType().equals("Vip")) {
      MemberExample memberExample = new MemberExample();
      memberExample.createCriteria().andTypeEqualTo("vip");
      List<Member> memberList = memberMapper.selectByExample(memberExample);
      for (Member member : memberList) {
        noteList.add(member.getMobileNumber());
      }
      // 对MessageEmail赋值
      messageNote.setCreater(pricipalUser.getUserId());
      messageNote.setCreaterTime(new Date());
      messageNote.setNoteTime(new Date());
      count = messageNoteMapper.insertSelective(messageNote);
      if (count == 1) {
        for (Member member : memberList) {
          MessageInfo messageInfo = new MessageInfo(); // 构建邮箱记录
          messageInfo.setInfoId(RandomGUID.getRandomGUID()); // 随即产生32位ID
          messageInfo.setInfoTitle(messageNote.getNoteTitle()); // 设置标题
          messageInfo.setInfoSend(pricipalUser.getUserId()); // 管理员
          messageInfo.setInfoMemberid(member.getMemberId()); // 会员ID
          messageInfo.setCreaterTime(new Date()); // 设置当前时间
          messageInfo.setNoteId(messageNote.getNoteId()); // 设置活动邮件ID
          messageInfoMapper.insertSelective(messageInfo); // 执行添加
        }
      }

      for (int i = 0; i < noteList.size(); i++) {
        noteSend(messageNote.getNoteText(), noteList.get(i));
      }

      returnResult.setMsg("发送成功");
      returnResult.setSuccess(true);

    } else if (messageNote.getNoteType().equals("general")) {
      MemberExample memberExample = new MemberExample();
      memberExample.createCriteria().andTypeEqualTo("vip");
      List<Member> memberList = memberMapper.selectByExample(memberExample);
      for (Member member : memberList) {
        noteList.add(member.getMobileNumber());
      }
      // 对MessageEmail赋值
      messageNote.setCreater(pricipalUser.getUserId());
      messageNote.setCreaterTime(new Date());
      messageNote.setNoteTime(new Date());
      count = messageNoteMapper.insertSelective(messageNote);
      if (count == 1) {
        for (Member member : memberList) {
          MessageInfo messageInfo = new MessageInfo(); // 构建邮箱记录
          messageInfo.setInfoId(RandomGUID.getRandomGUID()); // 随即产生32位ID
          messageInfo.setInfoTitle(messageNote.getNoteTitle()); // 设置标题
          messageInfo.setInfoSend(pricipalUser.getUserId()); // 管理员
          messageInfo.setInfoMemberid(member.getMemberId()); // 会员ID
          messageInfo.setCreaterTime(new Date()); // 设置当前时间
          messageInfo.setNoteId(messageNote.getNoteId()); // 设置活动邮件ID
          messageInfoMapper.insertSelective(messageInfo); // 执行添加
        }
      }

      for (int i = 0; i < noteList.size(); i++) {
        noteSend(messageNote.getNoteText(), noteList.get(i));
      }

      returnResult.setMsg("发送成功");
      returnResult.setSuccess(true);
    }
    return returnResult;
  }