From 3824cbcaec6e6c67418d5280a53e9c2fedeef6f9 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 11 七月 2019 16:34:13 +0800
Subject: [PATCH] 订单bug,分享爆款自购修改

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoWeiQuanOrderServiceImpl.java |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoWeiQuanOrderServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoWeiQuanOrderServiceImpl.java
index 50fb869..485783b 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoWeiQuanOrderServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoWeiQuanOrderServiceImpl.java
@@ -8,13 +8,24 @@
 import org.springframework.stereotype.Service;
 
 import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoWeiQuanOrderMapper;
+import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail;
+import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail.MsgTypeOrderTypeEnum;
+import com.yeshi.fanli.entity.order.CommonOrder;
 import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder;
+import com.yeshi.fanli.service.inter.msg.MsgOrderDetailService;
+import com.yeshi.fanli.service.inter.msg.UserOrderMsgNotificationService;
 import com.yeshi.fanli.service.inter.taobao.TaoBaoWeiQuanOrderService;
 
 @Service
 public class TaoBaoWeiQuanOrderServiceImpl implements TaoBaoWeiQuanOrderService {
 	@Resource
 	private TaoBaoWeiQuanOrderMapper taoBaoWeiQuanOrderMapper;
+
+	@Resource
+	private UserOrderMsgNotificationService userOrderMsgNotificationService;
+
+	@Resource
+	private MsgOrderDetailService msgOrderDetailService;
 
 	@Override
 	public void addWeiQuanOrder(TaoBaoWeiQuanOrder order) {
@@ -38,6 +49,26 @@
 			update.setUpdateTime(new Date());
 			update.setWeiQuanFinishTime(order.getWeiQuanFinishTime());
 			taoBaoWeiQuanOrderMapper.updateByPrimaryKeySelective(update);
+
+			try {
+				if (order.getState().equalsIgnoreCase("缁存潈鎴愬姛")) {
+					List<MsgOrderDetail> msgList = msgOrderDetailService.listMsgOrderByOrderId(order.getOrderId());
+					for (MsgOrderDetail msg : msgList) {
+						if (msg.getType() == MsgTypeOrderTypeEnum.fanli) {
+							userOrderMsgNotificationService.orderFanLiStateChanged(msg.getUser().getId(),
+									order.getOrderId(), null, null, CommonOrder.STATE_WQ);
+						} else if (msg.getType() == MsgTypeOrderTypeEnum.invite) {
+							userOrderMsgNotificationService.orderInviteStateChanged(msg.getUser().getId(),
+									order.getOrderId(), null, null, CommonOrder.STATE_WQ);
+						} else if (msg.getType() == MsgTypeOrderTypeEnum.share) {
+							userOrderMsgNotificationService.orderShareStateChanged(msg.getUser().getId(),
+									order.getOrderId(), null, null, CommonOrder.STATE_WQ);
+						}
+					}
+				}
+			} catch (Exception e) {
+
+			}
 		} else {
 			order.setCreateTime(new Date());
 			order.setUpdateTime(new Date());
@@ -50,4 +81,9 @@
 		return taoBaoWeiQuanOrderMapper.selectListByOrderIdAndState(orderId, "缁存潈鎴愬姛");
 	}
 
+	@Override
+	public TaoBaoWeiQuanOrder listByorderItemId(String tradeId) {
+		return taoBaoWeiQuanOrderMapper.selectByOrderItemId(tradeId);
+	}
+
 }

--
Gitblit v1.8.0