From 573c491b4a1ba60e12a5678a01c1546c0077c1ee Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 30 七月 2019 09:07:42 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/HongBaoV2ServiceImpl.java | 48 ++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 38 insertions(+), 10 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/HongBaoV2ServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/HongBaoV2ServiceImpl.java index 361a7c3..f6f1a96 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/HongBaoV2ServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/HongBaoV2ServiceImpl.java @@ -183,8 +183,6 @@ BigDecimal money = notify.getMoney(); switch (t) { case HongBaoV2.TYPE_ZIGOU: - userNotificationService.orderFanliStatisticed(uid, orderId, goodsCount, MsgOrderDetail.STATE_FK, - null, money); userOrderMsgNotificationService.orderFanLiStatistic(uid, orderId, commonOrder.getPayment(), money, goodsCount, state); break; @@ -274,7 +272,7 @@ HongBaoV2 oldHongBao = hongBaoV2Mapper.selectByPrimaryKey(hongBaoOrder.getHongBaoV2().getId()); if (oldHongBao == null) throw new HongBaoException(10, "绾㈠寘瀵硅薄涓嶅瓨鍦�"); - // 宸茬粡澶辨晥鎴栬�呭凡缁忛鍙栫殑绾㈠寘涓嶅仛澶勭悊 + // 宸茬粡澶辨晥锛屽凡缁忛鍙栵紝鏂拌�佺姸鎬佷竴鑷寸殑绾㈠寘涓嶅仛澶勭悊 if (oldHongBao.getState() == HongBaoV2.STATE_SHIXIAO || oldHongBao.getState() == HongBaoV2.STATE_YILINGQU) return; @@ -314,6 +312,14 @@ } else if (commonOrder.getState() == CommonOrder.STATE_SX) { hongBao.setState(HongBaoV2.STATE_SHIXIAO); hongBao.setMoney(new BigDecimal(0)); + + } + + // 鏂拌�佺孩鍖呯姸鎬佷竴鑷翠笉澶勭悊 + if (oldHongBao.getState().intValue() == hongBao.getState()) + return; + + if (hongBao.getState() == HongBaoV2.STATE_SHIXIAO) { if (mianDan) { try { userSystemCouponService.updateStateByDrawback(commonOrder.getOrderNo()); @@ -323,6 +329,7 @@ } } } + hongBaoV2Mapper.updateByPrimaryKeySelective(hongBao); // 鍔犲叆閫氱煡 @@ -589,21 +596,23 @@ if (notificationMap.get(child.getType()) == null) { HongBaoV2 tempHongBao = new HongBaoV2(child.getId()); tempHongBao.setUserInfo(child.getUserInfo()); - tempHongBao.setMoney(childUpdate.getMoney()); + tempHongBao + .setMoney(childUpdate.getMoney() == null ? new BigDecimal(0) : childUpdate.getMoney()); CommonOrder tempCommonOrder = new CommonOrder(commonOrder.getId()); tempCommonOrder.setPayment(commonOrder.getPayment()); notificationMap.put(child.getType(), new HongBaoOrder(tempCommonOrder, tempHongBao)); } else { // 澧炲姞浠樻閲戦涓庤祫閲� HongBaoOrder tempHongBaoOrder = notificationMap.get(child.getType()); - tempHongBaoOrder.getCommonOrder().setPayment( - tempHongBaoOrder.getCommonOrder().getPayment().add(commonOrder.getPayment())); - tempHongBaoOrder.getHongBaoV2() - .setMoney(tempHongBaoOrder.getHongBaoV2().getMoney().add(childUpdate.getMoney())); + if (commonOrder.getPayment() != null) + tempHongBaoOrder.getCommonOrder().setPayment( + tempHongBaoOrder.getCommonOrder().getPayment().add(commonOrder.getPayment())); + if (childUpdate.getMoney() != null) + tempHongBaoOrder.getHongBaoV2() + .setMoney(tempHongBaoOrder.getHongBaoV2().getMoney().add(childUpdate.getMoney())); notificationMap.put(child.getType(), tempHongBaoOrder); } - - + } } else throw new HongBaoException(2, "type閿欒"); @@ -729,6 +738,10 @@ firstHongbao.setMoney( MoneyBigDecimalUtil.mul(hongBao.getMoney(), firstRate.divide(new BigDecimal(100)))); } + // 杩斿埄涓�0鐨勪笉閫氱煡 + if (firstHongbao.getMoney() == null || firstHongbao.getMoney().compareTo(new BigDecimal(0)) <= 0) + return; + hongBaoV2Mapper.insertSelective(firstHongbao); // 鐢ㄦ埛閫氱煡 if (notificationMap.get(HongBaoV2.TYPE_YIJI) == null) { @@ -776,6 +789,11 @@ secondHongbao.setMoney( MoneyBigDecimalUtil.mul(hongBao.getMoney(), secondRate.divide(new BigDecimal(100)))); } + + // 杩斿埄涓�0鐨勪笉缁熻 + if (secondHongbao.getMoney() == null || secondHongbao.getMoney().compareTo(new BigDecimal(0)) <= 0) + return; + hongBaoV2Mapper.insertSelective(secondHongbao); // 鐢ㄦ埛閫氱煡 @@ -1023,4 +1041,14 @@ else return money; } + + @Override + public List<HongBaoV2> listChildrenById(Long id) { + return hongBaoV2Mapper.listChildrenById(id); + } + + @Override + public List<Long> getUidByNear30DayShareSucceed() { + return hongBaoV2Mapper.getUidByNear30DayShareSucceed(); + } } -- Gitblit v1.8.0