Ejemplo n.º 1
0
  public void sendMail() {
    if ((true == mailOrNot) && (!"".equals(mailList)) && (0 != buffer.size())) {
      if (logger.isInfoEnabled()) {
        logger.info("卡库不平分析线程发送邮件给联系人:" + contactName);
      }
      String tmpStr = "";
      if (buffer.size() > 5000) {
        tmpStr = buffer.getString(0, 5000);
      }
      tmpStr = buffer.toString();

      String[] tempList = null;
      String[] nameList = null;
      tempList = mailList.split(";");
      nameList = mailName.split(";");
      for (int i = 0; i < tempList.length; i++) {
        if (!"".equals(tempList)) {
          CommonSendMailUtil.sendMail(
              GetApplicationResources.getInstance()
                  .getString("com.kingstar.MonitorSys.SUBJECT_SERIAL"),
              contactName,
              tempList[i],
              StringUtil.wholeMailGenerate(
                  nameList[i],
                  DateUtil.reFormatTime(recordTime),
                  mailRecord,
                  tmpStr,
                  "UNBALANCE_ERROR"));
        }
      }
    }
  }
Ejemplo n.º 2
0
 public void sendSMG() {
   // TODO Auto-generated method stub
   if ((true == smgOrNot) && (!"".equals(phoneNumber)) && mailRecord > 0) {
     if (logger.isInfoEnabled()) {
       logger.info("卡库不平分析线程发送短信给联系人:" + contactName);
     }
     String[] tempList = null;
     String[] nameList = null;
     tempList = phoneNumber.split(";");
     nameList = phoneName.split(";");
     for (int i = 0; i < tempList.length; i++) {
       if (!"".equals(tempList[i])) {
         SmgMessage =
             StringUtil.wholeSMGGenerate(
                 nameList[i], DateUtil.reFormatTime(recordTime), mailRecord, "UNBALANCE_ERROR");
         CommonSendSMGUtil.sendSMG(tempList[i], SmgMessage);
       }
     }
   }
 }