From 388be9f734f5b80c348bcc956726c206002e832a Mon Sep 17 00:00:00 2001
From: Administrator <Administrator@MS-20170306HGUF>
Date: 星期日, 23 二月 2020 12:55:01 +0800
Subject: [PATCH] 保存bug

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java |   73 ++++++++++++++++++++----------------
 1 files changed, 40 insertions(+), 33 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java
index 91bdd50..774e7bd 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java
@@ -45,6 +45,8 @@
 import com.yeshi.fanli.exception.order.CommonOrderException;
 import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
 import com.yeshi.fanli.log.LogHelper;
+import com.yeshi.fanli.log.LogManager;
+import com.yeshi.fanli.log.LogType;
 import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
 import com.yeshi.fanli.service.inter.config.ConfigService;
 import com.yeshi.fanli.service.inter.config.SystemCouponService;
@@ -169,26 +171,30 @@
 	public List<CommonOrderVO> listGroupOrderNoByUid(long start, int count, Long uid, Integer state, Integer type,
 			Integer orderState, String orderNo, String startTime, String endTime, Integer dateType, Integer source)
 			throws CommonOrderException {
+		List<Integer> listSource = new ArrayList<>();
+		if (source != null) {
+			listSource.add(source);
+		}
+
 		return commonOrderMapper.listUserOrder(start, count, uid, state, type, orderState, orderNo, startTime, endTime,
-				dateType, source);
+				dateType, listSource);
 	}
 
 	@Override
 	public long countGroupOrderNoByUid(Long uid, Integer state, Integer type, Integer orderState, String orderNo,
-			String startTime, String endTime, Integer dateType, Integer source) throws CommonOrderException {
+			String startTime, String endTime, Integer dateType, List<Integer> listSource) throws CommonOrderException {
 		return commonOrderMapper.countUserOrder(uid, state, type, orderState, orderNo, startTime, endTime, dateType,
-				source);
+				listSource);
 	}
 
 	@Override
 	public List<CommonOrderVO> getOrderByUid(AcceptData acceptData, Integer page, Long uid, Integer state, Integer type,
-			Integer orderState, String orderNo, String startTime, String endTime, Integer dateType, Integer source)
-			throws CommonOrderException, Exception {
+			Integer orderState, String orderNo, String startTime, String endTime, Integer dateType,
+			List<Integer> listSource) throws CommonOrderException, Exception {
 
 		int pageSize = Constant.PAGE_SIZE;
-
-		List<CommonOrderVO> listOrder = listGroupOrderNoByUid((page - 1) * pageSize, pageSize, uid, state, type,
-				orderState, orderNo, startTime, endTime, dateType, source);
+		List<CommonOrderVO> listOrder = commonOrderMapper.listUserOrder((page - 1) * pageSize, pageSize, uid, state,
+				type, orderState, orderNo, startTime, endTime, dateType, listSource);
 
 		// 璁㈠崟淇℃伅涓虹┖
 		if (listOrder == null || listOrder.size() == 0) {
@@ -699,9 +705,9 @@
 				return;
 
 			// 涓嬪崟鏃ユ湡鏄惁鏄鍚堜笂绾挎棩鏈�
-			long downOrderTime = thirdCreateTime.getTime();
+			long downOrderTime = thirdCreateTime.getTime();
 			long limitDate = TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME);
-			if (downOrderTime > limitDate)  {
+			if (downOrderTime > limitDate) {
 				// 2.1 寮�濮嬫柊鐗�
 				rewardCounponLimitTime(order, accountTime);
 			} else if (hasRewardCoupon) {
@@ -814,8 +820,8 @@
 	}
 
 	@Override
-	public OrderCountVO getOrderCount(Long uid, Integer day, Integer source) {
-		return commonOrderMapper.getOrderCount(uid, day, source);
+	public OrderCountVO getOrderCount(Long uid, Integer day, List<Integer> listSource) {
+		return commonOrderMapper.getOrderCount(uid, day, listSource);
 	}
 
 	@Override
@@ -873,7 +879,7 @@
 		return commonOrderMapper.listBySourceTypeAndOrderNo(sourceType, orderId);
 	}
 
-	@Transactional(rollbackFor=Exception.class)
+	@Transactional(rollbackFor = Exception.class)
 	@Override
 	public List<CommonOrderAddResultDTO> addTaoBaoOrder(List<TaoBaoOrder> taoBaoOrders, Long uid)
 			throws CommonOrderException {
@@ -910,11 +916,15 @@
 				TaoBaoGoodsBrief taoBaoGoods = null;
 				try {
 					taoBaoGoods = TaoKeApiUtil.getSimpleGoodsInfo(taoBaoOrder.getAuctionId());
+					LogManager.getLogger(LogType.taobaoGoods).info(String.format("璁㈠崟鍟嗗搧鍒嗙被:%s#%s#%s",
+							taoBaoGoods.getAuctionId(), taoBaoGoods.getRootCategoryName(), taoBaoGoods.getLeafName()));
 				} catch (TaobaoGoodsDownException e) {
 					e.printStackTrace();
 					LogHelper.errorDetailInfo(e, "AUCTIONID:" + taoBaoOrder.getAuctionId(), "");
 					try {
 						taoBaoGoods = TaoBaoUtil.getSimpleGoodsBrief(taoBaoOrder.getAuctionId());
+						// 璁板綍鍟嗗搧鍒嗙被
+
 					} catch (Exception e1) {
 						CommonGoods commonGoods = commonGoodsService.getCommonGoodsByGoodsIdAndGoodsType(
 								taoBaoOrder.getAuctionId(), Constant.SOURCE_TYPE_TAOBAO);
@@ -935,7 +945,7 @@
 		return commonOrderList;
 	}
 
-	@Transactional(rollbackFor=Exception.class)
+	@Transactional(rollbackFor = Exception.class)
 	@Override
 	public List<CommonOrderAddResultDTO> addPDDOrder(List<PDDOrder> pddOrderList, Long uid)
 			throws CommonOrderException {
@@ -985,7 +995,7 @@
 		return commonOrderList;
 	}
 
-	@Transactional(rollbackFor=Exception.class)
+	@Transactional(rollbackFor = Exception.class)
 	@Override
 	public List<CommonOrderAddResultDTO> addJDOrder(JDOrder jdOrder, Long uid) throws CommonOrderException {
 		List<CommonOrderAddResultDTO> commonOrderList = new ArrayList<>();
@@ -1055,7 +1065,7 @@
 	 * 
 	 * @param commonOrder
 	 */
-	@Transactional(rollbackFor=Exception.class)
+	@Transactional(rollbackFor = Exception.class)
 	private CommonOrderAddResultDTO addCommonOrder(CommonOrder commonOrder) throws CommonOrderException {
 		// 鍒ゆ柇鍟嗗搧鏄惁瀛樺湪
 		if (commonOrder == null)
@@ -1656,16 +1666,15 @@
 	public long count24HValidOrderByUid(Long uid, Date minTime) {
 		return commonOrderMapper.count24HValidOrderByUid(uid, minTime);
 	}
-	
-	
+
 	@Override
 	public long countSearchOrderByUid(Long uid, List<ESOrder> list) {
 		return commonOrderMapper.countSearchOrderByUid(uid, list);
 	}
-	
+
 	@Override
-	public List<CommonOrderVO> searchOrderByUid (int page, int size, Long uid, List<ESOrder> list) throws Exception {
-		List<CommonOrderVO> listVO = commonOrderMapper.searchOrderByUid((page-1) * size, size, uid, list);
+	public List<CommonOrderVO> searchOrderByUid(int page, int size, Long uid, List<ESOrder> list) throws Exception {
+		List<CommonOrderVO> listVO = commonOrderMapper.searchOrderByUid((page - 1) * size, size, uid, list);
 
 		// 璁㈠崟淇℃伅涓虹┖
 		if (listVO == null || listVO.size() == 0) {
@@ -1682,11 +1691,10 @@
 
 		// 鏁版嵁鍔犲伐閲嶆柊缁勭粐
 		orderVOFactoryNew(listVO, listGoods, uid);
-		
+
 		return listVO;
 	}
-	
-	
+
 	/**
 	 * 璁㈠崟淇℃伅鍔犲伐
 	 * 
@@ -1695,7 +1703,8 @@
 	 * @param listGoods
 	 * @param uid
 	 */
-	private void orderVOFactoryNew(List<CommonOrderVO> listOrder, List<CommonOrderVO> listGoods, Long uid) throws Exception {
+	private void orderVOFactoryNew(List<CommonOrderVO> listOrder, List<CommonOrderVO> listGoods, Long uid)
+			throws Exception {
 		List<String> listTB = new ArrayList<String>();
 		List<String> listJD = new ArrayList<String>();
 		List<String> listPDD = new ArrayList<String>();
@@ -1892,8 +1901,7 @@
 						orderStateContent = "鍞悗鎴愬姛";
 						WeiQuanInfo weiQuanInfo = new WeiQuanInfo();
 						weiQuanInfo.setOldHongBao("楼" + hongBao.setScale(2, BigDecimal.ROUND_DOWN).toString());
-						weiQuanInfo
-								.setWqHongBao("鍞悗锛�-楼" + weiQuanMoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
+						weiQuanInfo.setWqHongBao("鍞悗锛�-楼" + weiQuanMoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
 						hongBao = MoneyBigDecimalUtil.sub(hongBao, weiQuanMoney);
 						order.setWeiQuanInfo(weiQuanInfo);
 					}
@@ -1937,8 +1945,8 @@
 				signList.add(CommonOrder.TYPE_INVITE);
 
 				// 瓒呯骇浼氬憳琛ヨ创淇℃伅
-				InviteOrderSubsidy orderSubsidy = inviteOrderSubsidyService.getByOrderNoAndType(uid,
-						order.getOrderNo(), sourceType);
+				InviteOrderSubsidy orderSubsidy = inviteOrderSubsidyService.getByOrderNoAndType(uid, order.getOrderNo(),
+						sourceType);
 				if (orderSubsidy != null) {
 					ClientTextStyleVO subsidyInfo = new ClientTextStyleVO();
 					subsidyInfo.setContent("(琛ヨ创楼" + orderSubsidy.getMoney() + ")");
@@ -2051,8 +2059,8 @@
 	 * @param list
 	 * @param signList
 	 */
-	private void couponFactoryNew(CommonOrderVO order, boolean hasRewardCoupon, Integer hongBaoState, Integer hongBaoType,
-			List<UserSystemCouponRecord> list, Long uid, boolean vip) throws Exception {
+	private void couponFactoryNew(CommonOrderVO order, boolean hasRewardCoupon, Integer hongBaoState,
+			Integer hongBaoType, List<UserSystemCouponRecord> list, Long uid, boolean vip) throws Exception {
 		// 鏄惁鍏嶅崟鍟嗗搧
 		boolean freeOrder = false;
 		// 鏄惁濂栧姳鎴愬姛
@@ -2149,7 +2157,7 @@
 			// 涓嬪崟鏃ユ湡鏄惁鏄鍚堜笂绾挎棩鏈�
 			long downOrderTime = thirdCreateTime.getTime();
 			long limitDate = TimeUtil.convertDateToTemp(Constant.VIP_ONLINE_TIME);
-			if (downOrderTime > limitDate)  {
+			if (downOrderTime > limitDate) {
 				// 2.1 寮�濮嬫柊鐗�
 				rewardCounponLimitTime(order, accountTime);
 			} else if (hasRewardCoupon) {
@@ -2175,6 +2183,5 @@
 			}
 		}
 	}
-
 
 }

--
Gitblit v1.8.0