Beispiel #1
0
 public static SendSMSLog createSendSMSLog(
     String mobileid, String content, String channelName, String result) {
   System.out.println("save1");
   SendSMSLog log = new SendSMSLog(mobileid, content, channelName, result);
   System.out.println("save2");
   log.setSmscount(computeSmsCount(mobileid));
   System.out.println("save3");
   log.persist();
   System.out.println("save4");
   return log;
 }
Beispiel #2
0
 public static void computeCount() {
   int i = 0;
   int step = 100;
   List<SendSMSLog> list = findSendSMSLogEntries(i, step);
   while (list != null && list.size() > 0) {
     System.out.println(i);
     for (SendSMSLog log : list) {
       if (log.getSmscount() == null) {
         String mobileids = log.getMobileid();
         if (StringUtils.isNotBlank(mobileids)) {
           String[] split = mobileids.split(",");
           int sum = split.length;
           log.setSmscount(sum);
           log.merge();
         }
       }
     }
     i = i + step;
     list = findSendSMSLogEntries(i, step);
   }
 }