Administrator
2018-11-30 d66e9c7c859f255b0e81e01a57707c5b9a34d7ff
fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushGoodsServiceImpl.java
@@ -181,13 +181,13 @@
   @Transactional
   public int deleteBatchByPrimaryKey(List<Long> list) throws Exception {
      List<PushGoods> lisState = pushGoodsMapper.listByPushState(list);
      /*List<PushGoods> lisState = pushGoodsMapper.listByPushState(list);
      if (lisState != null && lisState.size() > 0) {
         for (PushGoods pushGoods : lisState) {
            // 已推送的消息不能删除
            list.remove(pushGoods.getId());
         }
      }
      }*/
      // 删除对应商品
      pushGoodsGroupService.deleteBatchByPushId(list);
@@ -206,13 +206,13 @@
   }
   @Override
   public List<PushGoods> listHistoryByPushTime(long start, int count, Date pushTime) {
      return pushGoodsMapper.listHistoryByPushTime(start, count, pushTime);
   public List<PushGoods> listHistoryByPushTime(long start, int count, Long uid, Date pushTime) {
      return pushGoodsMapper.listHistoryByPushTime(start, count, uid, pushTime);
   }
   @Override
   public long countHistoryByPushTime(Date pushTime) {
      return pushGoodsMapper.countHistoryByPushTime(pushTime);
   public long countHistoryByPushTime(Long uid, Date pushTime) {
      return pushGoodsMapper.countHistoryByPushTime(uid, pushTime);
   }
   @Override
@@ -243,11 +243,6 @@
         }
         Long goodsId = commonGoods.getGoodsId();
         JSONObject json = IOSPushFactory.createGoodsPush(goodsId, alertTitle, alertContent);
         if (json.toString().getBytes().length > 256) {
            throw new PushException(1, "标题或内容过长,请删减后再试");
         }
         String url = "https://item.taobao.com/item.htm?id=" + goodsId;
         
         pushService.pushGoods(pushGoods.getUid(), url, alertTitle, alertContent);
@@ -260,11 +255,6 @@
         }
         // 生成链接
         url = url + "?id=" + id;
         JSONObject json = IOSPushFactory.createURLPush(HttpUtil.getShortLink(url), alertTitle, alertContent);
         if (json.toString().getBytes().length > 256) {
            throw new PushException(1, "标题或内容过长,请删减后再试");
         }
         pushService.pushUrl(pushGoods.getUid(), url, alertTitle, alertContent);
      }