From 02c407ff8ca33296a9afee4a390945bfcfa162b2 Mon Sep 17 00:00:00 2001
From: Administrator <Administrator@CI6BUF61FT24H5M>
Date: 星期六, 17 八月 2019 13:35:56 +0800
Subject: [PATCH] 订单bug修复

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java |   38 +++++++++++++++++++++++++++++++++-----
 1 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java
index 25cd92a..ddf8b52 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderProcessServiceImpl.java
@@ -16,7 +16,9 @@
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
+import org.yeshi.utils.NumberUtil;
 
+import com.google.gson.Gson;
 import com.yeshi.fanli.dao.mybatis.HongBaoV2Mapper;
 import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
 import com.yeshi.fanli.dao.mybatis.money.UserMoneyDetailMapper;
@@ -227,6 +229,7 @@
 
 	@Override
 	public void fanli() {
+		LogHelper.test("澶勭悊杩斿埄鍒拌处");
 		// 鑾峰彇涓荤孩鍖�
 		List<HongBaoV2> hongBaoList = hongBaoV2Mapper.listCanBalanceHongBaoByType(HongBaoV2.TYPE_ZIGOU, 1000);
 		//
@@ -461,8 +464,12 @@
 	public void weiQuanOrder(List<TaoBaoWeiQuanOrder> orderList) {
 		if (orderList != null)
 			for (TaoBaoWeiQuanOrder order : orderList) {
-				if (order.getState().contains("缁存潈鎴愬姛")) {
-					CMQManager.getInstance().addWeiQuanOrderMsg(order);
+				try {
+					if (order.getState().contains("缁存潈鎴愬姛")) {
+						CMQManager.getInstance().addWeiQuanOrderMsg(order);
+					}
+				} catch (Exception e) {
+					LogHelper.error("缁存潈璁㈠崟鍔犲叆鍒伴槦鍒楀嚭閿�:"+order!=null?new Gson().toJson(order):null);
 				}
 			}
 	}
@@ -973,7 +980,7 @@
 			return;
 		String uidStr = order.getExt1();
 		Long uid = null;
-		if (!StringUtil.isNullOrEmpty(uidStr))
+		if (!StringUtil.isNullOrEmpty(uidStr) && NumberUtil.isNumeric(uidStr))
 			uid = Long.parseLong(uidStr);
 		Long positionId = order.getOrderItemList().get(0).getPositionId();
 		if (positionId == JDApiUtil.POSITION_FANLI)// 杩斿埄璁㈠崟
@@ -1016,7 +1023,7 @@
 		// 鍔犲叆璁㈠崟
 		Order oldOrder = orderMapper.selectOrderByOrderIdAndOrderType(jdOrder.getOrderId() + "",
 				Constant.SOURCE_TYPE_JD);
-		if (uid == null && oldOrder.getBeizhu().contains("琛ュ崟"))
+		if (uid == null && oldOrder != null && oldOrder.getBeizhu() != null && oldOrder.getBeizhu().contains("琛ュ崟"))
 			uid = oldOrder.getUserInfo().getId();
 
 		if (uid == null)
@@ -1131,7 +1138,7 @@
 
 		// 鍔犲叆璁㈠崟
 		Order oldOrder = orderMapper.selectOrderByOrderIdAndOrderType(pddOrder.getOrderSn(), Constant.SOURCE_TYPE_PDD);
-		if (uid == null && oldOrder.getBeizhu().contains("琛ュ崟"))
+		if (uid == null && oldOrder != null && oldOrder.getBeizhu() != null && oldOrder.getBeizhu().contains("琛ュ崟"))
 			uid = oldOrder.getUserInfo().getId();
 
 		if (uid == null)
@@ -1205,4 +1212,25 @@
 			}
 		}
 	}
+
+	@Override
+	public void repairCommonOrderByByTaoBaoOrder(String orderId) {
+		//鏍规嵁璁㈠崟鍙锋煡璇㈡窐瀹濊鍗�
+		List<TaoBaoOrder>  orderList=	taoBaoOrderService.getTaoBaoOrderByOrderId(orderId);
+		if(orderList!=null)
+			for(TaoBaoOrder order:orderList)
+			{
+				//鏍规嵁浜ゆ槗ID鏌ヨ甯歌璁㈠崟
+			CommonOrder commonOrder=	commonOrderService.selectBySourceTypeAndTradeId(Constant.SOURCE_TYPE_TAOBAO, order.getTradeId());
+			//淇orderby
+			if(commonOrder!=null)
+			{CommonOrder update=new CommonOrder(commonOrder.getId());
+			update.setOrderBy(order.getOrderBy());
+			update.setUpdateTime(new Date());		
+			commonOrderService.updateByPrimaryKeySelective(update);
+			}
+			}
+		
+		
+	}
 }

--
Gitblit v1.8.0