From 8222e8b237c5dfb0affcdc03335bfadc06403bf8 Mon Sep 17 00:00:00 2001
From: yujian <yujian@123.com>
Date: 星期五, 19 七月 2019 15:49:39 +0800
Subject: [PATCH] 奖励券使用优化类型

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/HongBaoV2ServiceImpl.java |   26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 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..1dd54c2 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;
@@ -290,7 +288,7 @@
 					payMent = commonOrder.getSettlement();
 
 				if (payMent.compareTo(new BigDecimal(10)) < 0) {
-					mianDan = userSystemCouponRecordService.isSuccessMianDan(commonOrder.getOrderNo());
+					mianDan = userSystemCouponRecordService.isSuccessMianDan(commonOrder.getSourceType(),commonOrder.getOrderNo());
 				}
 			}
 
@@ -602,8 +600,7 @@
 								.setMoney(tempHongBaoOrder.getHongBaoV2().getMoney().add(childUpdate.getMoney()));
 						notificationMap.put(child.getType(), tempHongBaoOrder);
 					}
-					
-					
+
 				}
 		} else
 			throw new HongBaoException(2, "type閿欒");
@@ -729,6 +726,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 +777,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 +1029,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