예제 #1
0
  /**
   * 天健发送短信函数 其实只记录到数据库表,不发送 要立即发送,请调用 sendRealSm
   *
   * @param recvNum //测试接收号码,号码间用逗号隔开
   * @param content //测试内容
   * @return
   */
  public static synchronized String sendSm(
      String recvNum, String content, String unkey, Connection conn, String sendtime) {
    // recvNum="13632254864";
    String clientNo = "057188216999"; // "057187719000,057188216999";
    String remark = MessageFormat.format("平台{2}发短信{0}:{1}", recvNum, content, clientNo);
    //// System.out.println(remark);

    DbUtil dbUtil = null;
    String re = "";
    int eff = 0;
    SmsConfigVO smsConfigVO = null;
    try {
      dbUtil = new DbUtil(conn);
      smsConfigVO = dbUtil.load(SmsConfigVO.class, "sys");
      SmsVO smsVO = new SmsVO();
      smsVO.setClient_num(smsConfigVO.getClient_no());
      smsVO.setContext(content);
      smsVO.setCreate_time(StringUtil.getCurDateTime());
      smsVO.setSend_date(StringUtil.getCurDate());
      // System.out.println("=====================sendtime="+sendtime);
      smsVO.setSend_time(sendtime);
      smsVO.setRemark(remark);
      smsVO.setUn_key(unkey);
      smsVO.setUuid(UUID.randomUUID().toString());
      smsVO.setState("r"); //
      smsVO.setMobile(recvNum);

      eff += dbUtil.insert(smsVO);

    } catch (Exception ex) {
      ex.printStackTrace();
    }

    return re;
  }
예제 #2
0
 public static String sendSMS(String recvNum, String content) {
   // TODO Auto-generated method stub
   return sendSm(recvNum, content, UUID.randomUUID().toString(), StringUtil.getCurDateTime());
 }
예제 #3
0
 public static String sendSm(String recvNum, String content, String unkey) {
   // TODO Auto-generated method stub
   return sendSm(recvNum, content, unkey, StringUtil.getCurDateTime());
 }