From 28cf328a098334b51a3e9d2d56f983fb8c862211 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期六, 23 五月 2020 09:54:38 +0800
Subject: [PATCH] 足迹、收藏订单兼容新需求

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/order/LostOrderServiceImpl.java |   30 +++++++++++++++++++++---------
 1 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/LostOrderServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/LostOrderServiceImpl.java
index 0572dd7..f9aefe4 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/LostOrderServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/LostOrderServiceImpl.java
@@ -17,6 +17,8 @@
 import com.yeshi.fanli.entity.bus.user.HongBaoV2;
 import com.yeshi.fanli.entity.bus.user.LostOrder;
 import com.yeshi.fanli.entity.bus.user.Order;
+import com.yeshi.fanli.entity.order.CommonOrder;
+import com.yeshi.fanli.entity.order.HongBaoOrder;
 import com.yeshi.fanli.entity.system.ConfigKeyEnum;
 import com.yeshi.fanli.service.inter.config.ConfigService;
 import com.yeshi.fanli.service.inter.order.HongBaoOrderService;
@@ -24,6 +26,7 @@
 import com.yeshi.fanli.service.inter.order.OrderService;
 import com.yeshi.fanli.service.inter.order.msg.UserOrderMsgNotificationService;
 import com.yeshi.fanli.service.inter.order.tb.TaoBaoPunishOrderService;
+import com.yeshi.fanli.util.Constant;
 import com.yeshi.fanli.util.Utils;
 
 @Service
@@ -239,10 +242,21 @@
 				update.setResultCode(LostOrder.RESULT_CODE_SUCCESS);
 				lostOrderMapper.updateByPrimaryKeySelective(update);
 				Order order = orderService.findOrderByOrderIdAndType(orderId, orderType);
+
+				List<HongBaoOrder> hongBaoOrderList = hongBaoOrderService.listDetailByOrderIdAndSourceType(orderId,
+						orderType);
+				int goodsCount = 0;
+				BigDecimal fanMoney = new BigDecimal(0);
+				for (HongBaoOrder hongBaoOrder : hongBaoOrderList) {
+					if (hongBaoOrder.getCommonOrder().getState() != CommonOrder.STATE_SX) {
+						goodsCount += hongBaoOrder.getCommonOrder().getCount();
+						fanMoney = fanMoney.add(hongBaoOrder.getHongBaoV2().getMoney());
+					}
+				}
+				
 				if (order != null)
-					// 娣诲姞閫氱煡
-					userOrderMsgNotificationService.orderFoundSuccess(lo.getUserInfo().getId(), lo.getOrderId(),
-							order.getMoney(), orderType, new Date(lo.getHandleTime()));
+					userOrderMsgNotificationService.orderFoundSuccess(lo.getUserInfo().getId(), orderId, orderType,
+							Constant.TYPE_REBATE, order.getMoney(), fanMoney, goodsCount, new Date(lo.getCreateTime()));
 			}
 		}
 	}
@@ -257,8 +271,7 @@
 				update.setResultCode(LostOrder.RESULT_CODE_FAIL);
 				lostOrderMapper.updateByPrimaryKeySelective(update);
 				// 娣诲姞閫氱煡
-				userOrderMsgNotificationService.orderFoundFail(order.getUserInfo().getId(), order.getOrderId(), null, 1,
-						new Date(order.getHandleTime()));
+				userOrderMsgNotificationService.orderFoundFail(order.getUserInfo().getId(), order.getOrderId());
 			}
 	}
 
@@ -275,8 +288,7 @@
 				update.setResultCode(LostOrder.RESULT_CODE_FAIL);
 				lostOrderMapper.updateByPrimaryKeySelective(update);
 				// 娣诲姞閫氱煡
-				userOrderMsgNotificationService.orderFoundFail(order.getUserInfo().getId(), order.getOrderId(), null, 1,
-						new Date(order.getHandleTime()));
+				userOrderMsgNotificationService.orderFoundFail(order.getUserInfo().getId(), order.getOrderId());
 			}
 	}
 
@@ -316,8 +328,8 @@
 	}
 
 	@Override
-	public Integer countLostOrderNum(String preDay) {
-		return lostOrderMapper.countLostOrderNum(preDay);
+	public Integer countLostOrderNum(String preDay, int resultCode) {
+		return lostOrderMapper.countLostOrderNum(preDay, resultCode);
 	}
 
 	@Override

--
Gitblit v1.8.0