From d8359ddb48dab5cc797a9d552e11fde571f4920c Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期二, 27 八月 2019 12:32:46 +0800 Subject: [PATCH] Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div --- fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoWeiQuanOrderServiceImpl.java | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 58 insertions(+), 2 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..748fac5 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,25 @@ 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; +import com.yeshi.fanli.util.Constant; @Service public class TaoBaoWeiQuanOrderServiceImpl implements TaoBaoWeiQuanOrderService { @Resource private TaoBaoWeiQuanOrderMapper taoBaoWeiQuanOrderMapper; + + @Resource + private UserOrderMsgNotificationService userOrderMsgNotificationService; + + @Resource + private MsgOrderDetailService msgOrderDetailService; @Override public void addWeiQuanOrder(TaoBaoWeiQuanOrder order) { @@ -25,8 +37,7 @@ .selectByOrderIdAndOrderItemId(order.getOrderId(), order.getOrderItemId()); if (taoBaoWeiQuanOrder != null) { // 宸茬粡鏄渶鏂扮殑鐘舵�佷簡 - if (taoBaoWeiQuanOrder.getState().equalsIgnoreCase("缁存潈鎴愬姛") - || taoBaoWeiQuanOrder.getState().equalsIgnoreCase("缁存潈澶辫触")) + if (taoBaoWeiQuanOrder.getState().contains("缁存潈鎴愬姛") || taoBaoWeiQuanOrder.getState().contains("缁存潈澶辫触")) return; // 鏇存柊閲戦锛岀姸鎬佷笌鏃堕棿 TaoBaoWeiQuanOrder update = new TaoBaoWeiQuanOrder(); @@ -38,6 +49,26 @@ update.setUpdateTime(new Date()); update.setWeiQuanFinishTime(order.getWeiQuanFinishTime()); taoBaoWeiQuanOrderMapper.updateByPrimaryKeySelective(update); + + try { + if (order.getState().contains("缁存潈鎴愬姛")) { + List<MsgOrderDetail> msgList = msgOrderDetailService.listMsgOrderByOrderId(order.getOrderId()); + for (MsgOrderDetail msg : msgList) { + if (msg.getType() == MsgTypeOrderTypeEnum.fanli) { + userOrderMsgNotificationService.orderFanLiStateChanged(msg.getUser().getId(), + order.getOrderId(),Constant.SOURCE_TYPE_TAOBAO, null, null, CommonOrder.STATE_WQ); + } else if (msg.getType() == MsgTypeOrderTypeEnum.invite) { + userOrderMsgNotificationService.orderInviteStateChanged(msg.getUser().getId(), + order.getOrderId(), Constant.SOURCE_TYPE_TAOBAO,null, null, CommonOrder.STATE_WQ); + } else if (msg.getType() == MsgTypeOrderTypeEnum.share) { + userOrderMsgNotificationService.orderShareStateChanged(msg.getUser().getId(), + order.getOrderId(),Constant.SOURCE_TYPE_TAOBAO, null, null, CommonOrder.STATE_WQ); + } + } + } + } catch (Exception e) { + + } } else { order.setCreateTime(new Date()); order.setUpdateTime(new Date()); @@ -50,4 +81,29 @@ return taoBaoWeiQuanOrderMapper.selectListByOrderIdAndState(orderId, "缁存潈鎴愬姛"); } + @Override + public TaoBaoWeiQuanOrder listByorderItemId(String tradeId) { + return taoBaoWeiQuanOrderMapper.selectByOrderItemId(tradeId); + } + + @Override + public List<TaoBaoWeiQuanOrder> listByState(String state, int page, int pageSize) { + return taoBaoWeiQuanOrderMapper.listByState(state, (page - 1) * pageSize, pageSize); + } + + @Override + public long countByState(String state) { + return taoBaoWeiQuanOrderMapper.countByState(state); + } + + @Override + public List<TaoBaoWeiQuanOrder> listByOrderId(String orderId) { + return taoBaoWeiQuanOrderMapper.listByOrderId(orderId); + } + + @Override + public TaoBaoWeiQuanOrder selectByTradeId(String tradeId) { + return taoBaoWeiQuanOrderMapper.selectByOrderItem(tradeId); + } + } -- Gitblit v1.8.0