yujian
2019-03-14 e3732fa01883aa7a93f7398e39b01b0009155b06
fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushCouponServiceImpl.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.service.impl.push;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@@ -134,6 +135,11 @@
      if (pushCoupon == null) {
         throw new PushCouponException(1, "推送信息已不存在");
      }
      if(pushCoupon.isPushed()) {
         throw new PushCouponException(1, "该信息不能重复推送");
      }
      String title = pushCoupon.getTitle();
      String content = pushCoupon.getContent();
@@ -141,11 +147,15 @@
         throw new PushCouponException(1, "标题或内容不能为空");
      }
      
      List<String> listVersion = null;
      String versions = pushCoupon.getVersions();
      if (versions != null && versions.trim().length() > 0) {
         listVersion  = Arrays.asList(versions.split(","));
      }
      String uids = pushCoupon.getUids();
      if (uids == null || uids.trim().length() == 0) {
         // 全推
         pushService.pushWelfareCenter(null, title, content);
         pushService.pushWelfareCenter(null, title, content, listVersion);
         
      } else {
         // 指定用户推送
@@ -155,7 +165,7 @@
            for (int i = 0; i < uidArray.length; i++) {
               String str_uid = uidArray[i];
               if (str_uid != null && str_uid.trim().length() > 0) {
                  pushService.pushWelfareCenter(Long.parseLong(str_uid), title, content);
                  pushService.pushWelfareCenter(Long.parseLong(str_uid), title, content, listVersion);
               }
            }
         }