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 | 35 ++++++++++++++++++++++++++--------- 1 files changed, 26 insertions(+), 9 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 7f98eab..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 @@ -272,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; @@ -312,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()); @@ -321,6 +329,7 @@ } } } + hongBaoV2Mapper.updateByPrimaryKeySelective(hongBao); // 鍔犲叆閫氱煡 @@ -587,17 +596,20 @@ 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); } @@ -726,7 +738,7 @@ firstHongbao.setMoney( MoneyBigDecimalUtil.mul(hongBao.getMoney(), firstRate.divide(new BigDecimal(100)))); } - //杩斿埄涓�0鐨勪笉閫氱煡 + // 杩斿埄涓�0鐨勪笉閫氱煡 if (firstHongbao.getMoney() == null || firstHongbao.getMoney().compareTo(new BigDecimal(0)) <= 0) return; @@ -777,8 +789,8 @@ secondHongbao.setMoney( MoneyBigDecimalUtil.mul(hongBao.getMoney(), secondRate.divide(new BigDecimal(100)))); } - - //杩斿埄涓�0鐨勪笉缁熻 + + // 杩斿埄涓�0鐨勪笉缁熻 if (secondHongbao.getMoney() == null || secondHongbao.getMoney().compareTo(new BigDecimal(0)) <= 0) return; @@ -1034,4 +1046,9 @@ public List<HongBaoV2> listChildrenById(Long id) { return hongBaoV2Mapper.listChildrenById(id); } + + @Override + public List<Long> getUidByNear30DayShareSucceed() { + return hongBaoV2Mapper.getUidByNear30DayShareSucceed(); + } } -- Gitblit v1.8.0