admin
2019-03-13 33b4ed2bbf28ec16b66e552680f56a691a4e908d
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserNotificationServiceImpl.java
@@ -13,13 +13,11 @@
import com.yeshi.fanli.entity.bus.user.Extract;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.exception.PushException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.push.PushService;
import com.yeshi.fanli.service.inter.user.SMSService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserNotificationService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
@Service
public class UserNotificationServiceImpl implements UserNotificationService {
@@ -37,19 +35,23 @@
   @Override
   public void newerHongBao(Long uid, BigDecimal money) {
      if (Constant.IS_TEST)
         return;
      try {
         pushService.pushZNX(uid, Constant.znxConfig.getNewerHongbaoTitle(),
               Constant.znxConfig.getNewerHongbaoMsg().replace("[金额]", money.toString()));
               Constant.znxConfig.getNewerHongbaoMsg().replace("[金额]", money.toString()), null);
      } catch (PushException e) {
         e.printStackTrace();
      }
   }
   @Override
   public void orderFanliRecieved(Long uid, String orderId, BigDecimal money) {
   public void orderFanliRecieved(Long uid, String orderId, int goodsCount, BigDecimal balance, BigDecimal money) {
      if (Constant.IS_TEST)
         return;
      try {
         pushService.pushZNX(uid, Constant.znxConfig.getOrderFanliRecieveTitle(), Constant.znxConfig
               .getOrderFanliRecieveMsg().replace("[订单号]", orderId).replace("[金额]", money.toString()));
               .getOrderFanliRecieveMsg().replace("[订单号]", orderId).replace("[金额]", money.toString()), null);
      } catch (PushException e) {
         e.printStackTrace();
      }
@@ -57,19 +59,24 @@
   @Override
   public void tiChengRecieved(Long uid, BigDecimal money) {
      if (Constant.IS_TEST)
         return;
      try {
         pushService.pushZNX(uid, Constant.znxConfig.getShareInviteMoneyRecieveTitle(),
               Constant.znxConfig.getShareInviteMoneyRecieveMsg().replace("[金额]", money.toString()));
         pushService.pushZNX(uid, Constant.znxConfig.getShareMoneyRecieveTitle(),
               Constant.znxConfig.getShareMoneyRecieveMsg().replace("[金额]", money.toString()), null);
      } catch (PushException e) {
         e.printStackTrace();
      }
   }
   @Override
   public void orderFanliStatisticed(Long uid, String orderId) {
   public void orderFanliStatisticed(Long uid, String orderId, int goodsCount, int orderState, BigDecimal payMoney,
         BigDecimal money) {
      if (Constant.IS_TEST)
         return;
      try {
         pushService.pushZNX(uid, Constant.znxConfig.getFanliOrderStatisticedTitle(),
               Constant.znxConfig.getFanliOrderStatisticedMsg().replace("[订单号]", orderId));
               Constant.znxConfig.getFanliOrderStatisticedMsg().replace("[订单号]", orderId), null);
      } catch (PushException e) {
         e.printStackTrace();
      }
@@ -77,10 +84,12 @@
   @Override
   public void tiChengStatisticed(Long uid, String orderId, BigDecimal money) {
      if (Constant.IS_TEST)
         return;
      orderId = orderId.substring(0, orderId.length() - 6) + "******";
      try {
         pushService.pushZNX(uid, Constant.znxConfig.getTichengOrderStatisticedTitle(), Constant.znxConfig
               .getTichengOrderStatisticedMsg().replace("[订单号]", orderId).replace("[金额]", money.toString()));
               .getTichengOrderStatisticedMsg().replace("[订单号]", orderId).replace("[金额]", money.toString()), null);
      } catch (PushException e) {
         e.printStackTrace();
      }
@@ -88,6 +97,8 @@
   @Override
   public void weiQuanFanli(Long uid, String orderId, BigDecimal money) {
      if (Constant.IS_TEST)
         return;
      // 只发送站内信
      AccountMessage am = new AccountMessage();
      am.setContent(Constant.znxConfig.getWeiquanDrawbackFanliMsg().replace("[订单号]", orderId).replace("[金额]",
@@ -101,6 +112,8 @@
   @Override
   public void weiQuanTiCheng(Long uid, String orderId, BigDecimal money) {
      if (Constant.IS_TEST)
         return;
      orderId = orderId.substring(0, orderId.length() - 6) + "******";
      AccountMessage am = new AccountMessage();
      am.setContent(Constant.znxConfig.getWeiquanDrawbackShareMsg().replace("[订单号]", orderId).replace("[金额]",
@@ -114,9 +127,11 @@
   @Override
   public void extractApply(Long uid) {
      if (Constant.IS_TEST)
         return;
      try {
         pushService.pushZNX(uid, Constant.znxConfig.getExtractApplayTitle(),
               Constant.znxConfig.getExtractApplayMsg());
               Constant.znxConfig.getExtractApplayMsg(), null);
      } catch (PushException e) {
         e.printStackTrace();
      }
@@ -124,9 +139,11 @@
   @Override
   public void extractTransferFail(Long uid, String time) {
      if (Constant.IS_TEST)
         return;
      try {
         pushService.pushZNX(uid, Constant.znxConfig.getExtractTransferFailTitle(),
               Constant.znxConfig.getExtractTransferFailMsg().replace("[时间]", time));
               Constant.znxConfig.getExtractTransferFailMsg().replace("[时间]", time), null);
      } catch (PushException e) {
         e.printStackTrace();
      }
@@ -134,6 +151,8 @@
   @Override
   public void extractWrong(Long uid, Extract extract, String time) {
      if (Constant.IS_TEST)
         return;
      // 提现失败短信通知
      // try {
      // UserInfo user = userInfoService.getUserById(uid);
@@ -151,7 +170,7 @@
      try {
         pushService.pushZNX(uid, Constant.znxConfig.getExtractWrongTitle(),
               Constant.znxConfig.getExtractWrongMsg().replace("[时间]", time));
               Constant.znxConfig.getExtractWrongMsg().replace("[时间]", time), null);
      } catch (PushException e) {
         e.printStackTrace();
      }
@@ -159,6 +178,8 @@
   @Override
   public void extractSuccess(Long uid, Extract extract, String time) {
      if (Constant.IS_TEST)
         return;
      // 提现成功短信通知
      // try {
      // UserInfo user = userInfoService.getUserById(uid);
@@ -177,7 +198,7 @@
      try {
         pushService.pushZNX(uid, Constant.znxConfig.getExtractSuccessTitle(),
               Constant.znxConfig.getExtractSuccessMsg().replace("[时间]", time));
               Constant.znxConfig.getExtractSuccessMsg().replace("[时间]", time), null);
      } catch (PushException e) {
         e.printStackTrace();
      }
@@ -185,6 +206,8 @@
   @Override
   public void alipayAccountValidRight(Long uid, BigDecimal money, String account) {
      if (Constant.IS_TEST)
         return;
      BindingAccount ba = new BindingAccount();
      ba.setAccount(account);
      ba.setName("**");
@@ -199,4 +222,59 @@
      accountMessageMapper.insertSelective(am);
   }
   @Override
   public void tiChengInviteRecieved(Long uid, int orderCount, int goodsCount, BigDecimal balance, BigDecimal money) {
      if (Constant.IS_TEST)
         return;
      try {
         pushService.pushZNX(uid, Constant.znxConfig.getInviteMoneyRecieveTitle(),
               Constant.znxConfig.getInviteMoneyRecieveMsg().replace("[金额]", money.toString()), null);
      } catch (PushException e) {
         e.printStackTrace();
      }
   }
   @Override
   public void tiChengShareRecieved(Long uid, int orderCount, int goodsCount, BigDecimal balance, BigDecimal money) {
      if (Constant.IS_TEST)
         return;
      try {
         pushService.pushZNX(uid, Constant.znxConfig.getShareMoneyRecieveTitle(),
               Constant.znxConfig.getShareMoneyRecieveMsg().replace("[金额]", money.toString()), null);
      } catch (PushException e) {
         e.printStackTrace();
      }
   }
   @Override
   public void orderShareStatisticed(Long uid, String orderId, int goodsCount, int orderState, BigDecimal payMoney,
         BigDecimal money) {
      if (Constant.IS_TEST)
         return;
      orderId = orderId.substring(0, orderId.length() - 6) + "******";
      try {
         pushService.pushZNX(uid, Constant.znxConfig.getShareOrderStatisticedTitle(), Constant.znxConfig
               .getShareOrderStatisticedMsg().replace("[订单号]", orderId).replace("[金额]", money.toString()), null);
      } catch (PushException e) {
         e.printStackTrace();
      }
   }
   @Override
   public void orderInviteStatisticed(Long uid, String orderId, int goodsCount, int orderState, BigDecimal payMoney,
         BigDecimal money) {
      if (Constant.IS_TEST)
         return;
      orderId = orderId.substring(0, orderId.length() - 6) + "******";
      try {
         pushService.pushZNX(uid, Constant.znxConfig.getInviteOrderStatisticedTitle(), Constant.znxConfig
               .getInviteOrderStatisticedMsg().replace("[订单号]", orderId).replace("[金额]", money.toString()), null);
      } catch (PushException e) {
         e.printStackTrace();
      }
   }
}