From 744594ef1a2f530fc3e86ea9dc48b62247f79420 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 19 五月 2020 17:13:23 +0800
Subject: [PATCH] 饿了么绘图,添加口碑

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
index 95e137b..38dc60c 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -952,6 +952,7 @@
 		}
 
 		BigDecimal hongBao = orderVO.getHongBao();
+		
 		// 绾㈠寘鐘舵��
 		Integer hongBaoState = orderVO.getHongBaoState();
 		// 绾㈠寘绫诲瀷
@@ -964,6 +965,11 @@
 			if (order == null)
 				throw new UserSystemCouponException(1, "璇ヨ鍗曚笉瀛樺湪");
 
+			// 浣跨敤濂栧姳鍒� 閲戦棰濋檺鍒�
+			if (hongBao.compareTo(Constant.REWARD_COUPON_LIMIT_MONEY) > 0){
+				throw new UserSystemCouponException(1, "璇ヨ鍗曚笉鑳戒娇鐢ㄥ鍔卞埜");
+			}
+			
 			/* 濂栭噾璁$畻 浠ュ強鐩稿叧绾㈠寘淇℃伅澶勭悊 */
 
 			// 杞崲鎴愬皬鏁扮偣
@@ -1060,7 +1066,22 @@
 			couponRecord.setUpdateTime(date);
 			userSystemCouponRecordService.insertSelective(couponRecord);
 
-			// 娑堟伅鎺ㄩ��
+			int goodsCount = 0;
+			String orderId = order.getOrderId();
+			Integer orderType = order.getOrderType();
+			List<CommonOrder> orderList = commonOrderService.listBySourceTypeAndOrderId(orderType, orderId);
+			if (orderList != null && orderList.size() > 0) {
+				for (CommonOrder co : orderList) {
+					goodsCount += co.getCount();
+				}
+			}
+			
+			// 璧勯噾娑堟伅
+			UserInfo userInfo = userInfoService.selectByPKey(uid);
+			userMoneyMsgNotificationService.rewardCounponReceived(uid, orderId, orderType, goodsCount,
+					money, userInfo.getMyHongBao(), order.getThirdCreateTime());
+			
+			// 鍒镐娇鐢ㄦ垚鍔熸秷鎭�
 			try {
 				userOtherMsgNotificationService.rewardCouponEndMsg(uid, userSystemCoupon.getSource(), 1, "浣跨敤鎴愬姛");
 			} catch (Exception e) {
@@ -1549,7 +1570,7 @@
 		if (couponType == CouponTypeEnum.freeCoupon.name()) {
 			stateActivated = 0; //
 		} else if (couponType == CouponTypeEnum.welfareFreeCoupon.name()
-				&& threeSaleSerivce.countSuccessFirstTeam(uid) <= 0) {
+				&& threeSaleSerivce.countFirstTeam(uid) <= 0) {
 			stateActivated = 0; // 鏃犱笅绾ч槦鍛� --寰呮縺娲�
 		}
 

--
Gitblit v1.8.0