admin
2020-05-20 98b1a0affd69bbe63223c21fdd2c404e8bedfccb
fanli/src/main/java/com/yeshi/fanli/service/impl/money/msg/UserMoneyMsgNotificationServiceImpl.java
@@ -30,14 +30,14 @@
   private MsgMoneyDetailService msgMoneyDetailService;
   @Resource
   private PushService pushService;
   @Resource
   private MsgExtraService msgExtraService;
   @Override
   public void extractApplay(Extract extract) {
      MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractMsg("人工审核中", extract.getUserInfo().getId(),
            extract, null, null);
      MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractMsg("人工审核中", extract.getUserInfo().getId(), extract,
            null, null, "审核将会在24小时内完成");
      try {
         msgMoneyDetailService.addMsgMoneyDetail(detail);
      } catch (MsgMoneyDetailException e) {
@@ -45,37 +45,27 @@
      }
   }
   @Override
   public void extractFail(Extract extract, String reason) {
      MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractMsg("提现失败", extract.getUserInfo().getId(),
            extract, reason, null);
      MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractMsg("提现失败", extract.getUserInfo().getId(), extract,
            reason, null, "如有疑问请联系人工客服");
      try {
         msgMoneyDetailService.addMsgMoneyDetail(detail);
      } catch (MsgMoneyDetailException e) {
         e.printStackTrace();
      }
      PushContentDTO dto = PushMsgFactory.createmoneyExtractFail(new Date(extract.getExtractTime()),
            extract.getMoney(), extract.getAccount());
      try {
         pushService.pushZNX(extract.getUserInfo().getId(), dto.getTitle(), dto.getContent(), null, null);
      } catch (NumberFormatException e) {
         e.printStackTrace();
      } catch (PushException e) {
         e.printStackTrace();
      }
   }
   @Override
   public void extractSuccess(Extract extract, String alipayNo) {
      MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractMsg("提现成功", extract.getUserInfo().getId(),
            extract, null, alipayNo);
      MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractMsg("提现成功", extract.getUserInfo().getId(), extract,
            null, alipayNo, "如有疑问请联系人工客服");
      try {
         msgMoneyDetailService.addMsgMoneyDetail(detail);
      } catch (MsgMoneyDetailException e) {
         e.printStackTrace();
      }
      PushContentDTO dto = PushMsgFactory.createMoneyExtractSuccess(new Date(extract.getExtractTime()),
            extract.getMoney(), extract.getAccount());
      try {
@@ -90,24 +80,14 @@
   @Override
   public void alipayAccountValid(AlipayAccountValidNormalHistory history, String limitDay, boolean change) {
      MsgMoneyDetail detail = MsgMoneyDetailFactory.createAlipayAccountValidMsg(history, history.getUid(),
            Constant.systemCommonConfig.getProjectChineseName(), new BigDecimal("0.1"), limitDay, change);
            Constant.alipayConfig.getAccountName(), new BigDecimal("0.1"), limitDay, change);
      try {
         msgMoneyDetailService.addMsgMoneyDetail(detail);
      } catch (MsgMoneyDetailException e) {
         e.printStackTrace();
      }
      PushContentDTO dto = PushMsgFactory.createAlipayAccountValid(history.getAccount(), new BigDecimal("0.1"));
      try {
         pushService.pushZNX(history.getUid(), dto.getTitle(), dto.getContent(), null, null);
      } catch (NumberFormatException e) {
         e.printStackTrace();
      } catch (PushException e) {
         e.printStackTrace();
      }
   }
   @Override
   public void alipayAccountValidFail(AlipayAccountValidNormalHistory history, int limitDay, boolean change) {
      MsgMoneyDetail detail = MsgMoneyDetailFactory.createAlipayAccountValidFail(history, history.getUid(),
@@ -118,13 +98,12 @@
         e.printStackTrace();
      }
   }
   @Override
   public void fanliOrderReceived(Long uid, String orderId, int orderType, int goodsCount, BigDecimal money,
         BigDecimal balance, Date downTime) {
      MsgMoneyDetail detail = MsgMoneyDetailFactory.createOrderReceivedMsg(money, balance, orderId, orderType, goodsCount,
            uid, Constant.TYPE_REBATE, downTime, false);
      MsgMoneyDetail detail = MsgMoneyDetailFactory.fanLiOrderReceivedMsg(money, balance, orderId, orderType,
            goodsCount, uid, downTime, false);
      try {
         msgMoneyDetailService.addMsgMoneyDetail(detail);
      } catch (MsgMoneyDetailException e) {
@@ -142,18 +121,17 @@
   }
   @Override
   public void fanliOrderWeiQuan(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal fanliMoney,
         int goodsCount, Date downTime) {
      MsgMoneyDetail detail = MsgMoneyDetailFactory.createOrderWeiQuanMsg(uid, orderId, orderType, money, fanliMoney,
            goodsCount, downTime, Constant.TYPE_REBATE);
   public void rewardCounponReceived(Long uid, String orderId, int orderType, int goodsCount, BigDecimal money,
         BigDecimal balance, Date downTime) {
      MsgMoneyDetail detail = MsgMoneyDetailFactory.fanLiOrderReceivedMsg(money, balance, orderId, orderType,
            goodsCount, uid, downTime, true);
      try {
         msgMoneyDetailService.addMsgMoneyDetail(detail);
      } catch (MsgMoneyDetailException e) {
         e.printStackTrace();
      }
      // TODO 需要传入是否部分维权
      PushContentDTO dto = PushMsgFactory.createMoneyOrderFanLiWeiquan(orderType, orderId, false, money);
      PushContentDTO dto = PushMsgFactory.createMoneyFanliRecieved(orderType, orderId, money);
      try {
         pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
      } catch (NumberFormatException e) {
@@ -164,16 +142,27 @@
   }
   @Override
   public void shareOrderReceived(Long uid, int orderType, int orderCount, int goodsCount, BigDecimal money,
         BigDecimal balance, String orderId, Date downTime) {
      MsgMoneyDetail detail = MsgMoneyDetailFactory.createOrderReceivedMsg(money, balance, orderId, orderType, goodsCount,
            uid, Constant.TYPE_SHAER, downTime, false);
   public void fanliOrderWeiQuan(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal fanliMoney,
         int goodsCount, Date downTime) {
      MsgMoneyDetail detail = MsgMoneyDetailFactory.createOrderWeiQuanMsg(uid, orderId, orderType, money, fanliMoney,
            goodsCount, downTime, Constant.TYPE_REBATE);
      try {
         msgMoneyDetailService.addMsgMoneyDetail(detail);
      } catch (MsgMoneyDetailException e) {
         e.printStackTrace();
      }
   }
   @Override
   public void shareOrderReceived(Long uid, int orderType, BigDecimal money, BigDecimal balance, Date receivedDate) {
      MsgMoneyDetail detail = MsgMoneyDetailFactory.shareOrderReceivedMsg(money, balance, orderType, uid,
            receivedDate);
      try {
         msgMoneyDetailService.addMsgMoneyDetail(detail);
      } catch (MsgMoneyDetailException e) {
         e.printStackTrace();
      }
      PushContentDTO dto = PushMsgFactory.createMoneyShareRecieved(orderType, money);
      try {
         pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
@@ -194,38 +183,31 @@
      } catch (MsgMoneyDetailException e) {
         e.printStackTrace();
      }
      PushContentDTO dto = PushMsgFactory.createMoneyOrderShareOrInviteWeiquan(orderType, orderId, false, money);
      try {
         pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
      } catch (NumberFormatException e) {
         e.printStackTrace();
      } catch (PushException e) {
         e.printStackTrace();
      }
   }
   @Override
   public void systemEqualize(Long uid, String reason, BigDecimal money, BigDecimal balance) {
//      MsgMoneyDetail detail = MsgMoneyDetailFactory.createSystemEqualizeMsg(uid, reason, money, balance, null);
//      try {
//         msgMoneyDetailService.addMsgMoneyDetail(detail);
//      } catch (MsgMoneyDetailException e) {
//         e.printStackTrace();
//      }
//
//      PushContentDTO dto = PushMsgFactory.createMoneySystemCompensate(reason, money);
//      try {
//         pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
//      } catch (NumberFormatException e) {
//         e.printStackTrace();
//      } catch (PushException e) {
//         e.printStackTrace();
//      }
      // MsgMoneyDetail detail =
      // MsgMoneyDetailFactory.createSystemEqualizeMsg(uid, reason, money,
      // balance, null);
      // try {
      // msgMoneyDetailService.addMsgMoneyDetail(detail);
      // } catch (MsgMoneyDetailException e) {
      // e.printStackTrace();
      // }
      //
      // PushContentDTO dto =
      // PushMsgFactory.createMoneySystemCompensate(reason, money);
      // try {
      // pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null,
      // null);
      // } catch (NumberFormatException e) {
      // e.printStackTrace();
      // } catch (PushException e) {
      // e.printStackTrace();
      // }
   }
   @Override
   public void redPackMsg(Long uid, MsgTypeMoneyTypeEnum type, String content, String beiZhu) {
      MsgMoneyDetail detail = MsgMoneyDetailFactory.createRedPackMsg(uid, type, content, beiZhu);
@@ -255,10 +237,9 @@
      }
   }
   @Override
   public void teamReceive(Long uid, BigDecimal money, BigDecimal balance, Date receivedDate) {
      MsgMoneyDetail detail = MsgMoneyDetailFactory.createTeamReceivedMsg(uid, money, balance, receivedDate);
      MsgMoneyDetail detail = MsgMoneyDetailFactory.createTeamReceivedMsg(uid, money, balance, receivedDate, "团队收益");
      try {
         msgMoneyDetailService.addMsgMoneyDetail(detail);
      } catch (MsgMoneyDetailException e) {
@@ -266,5 +247,24 @@
      }
   }
   @Override
   public void teamDividend(Long uid, BigDecimal money, BigDecimal balance, Date receivedDate) {
      MsgMoneyDetail detail = MsgMoneyDetailFactory.createTeamReceivedMsg(uid, money, balance, receivedDate, "团队分红");
      try {
         msgMoneyDetailService.addMsgMoneyDetail(detail);
      } catch (MsgMoneyDetailException e) {
         e.printStackTrace();
      }
      // 推送消息
      PushContentDTO dto = PushMsgFactory.createMoneyTeamDividents(money);
      try {
         pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
      } catch (NumberFormatException e) {
         e.printStackTrace();
      } catch (PushException e) {
         e.printStackTrace();
      }
   }
}