From 0b57cfd62e842b309d03467b96a331c673ecad7c Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 21 四月 2020 14:08:18 +0800
Subject: [PATCH] 删除普通会员等级

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java |   68 +++++++++++++++++++---------------
 1 files changed, 38 insertions(+), 30 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 c4912c4..f17f18d 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
@@ -22,6 +22,7 @@
 import com.yeshi.fanli.dao.mybatis.order.CommonOrderGoodsMapper;
 import com.yeshi.fanli.dao.mybatis.order.CommonOrderMapper;
 import com.yeshi.fanli.dao.mybatis.order.CommonOrderTradeIdMapMapper;
+import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoOrderGoodsMapper;
 import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoWeiQuanOrderMapper;
 import com.yeshi.fanli.dto.mq.order.OrderTopicTagEnum;
 import com.yeshi.fanli.dto.mq.order.body.OrderConfirmMQMsg;
@@ -48,6 +49,7 @@
 import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
 import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
 import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
+import com.yeshi.fanli.entity.taobao.TaoBaoOrderGoods;
 import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder;
 import com.yeshi.fanli.exception.order.CommonOrderException;
 import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
@@ -135,7 +137,7 @@
 
 	@Resource
 	private InviteOrderSubsidyService inviteOrderSubsidyService;
-	
+
 	@Resource
 	private InviteOrderSubsidyDebtService inviteOrderSubsidyDebtService;
 
@@ -150,6 +152,9 @@
 
 	@Resource
 	private UserLevelManager userLevelManager;
+
+	@Resource
+	private TaoBaoOrderGoodsMapper taoBaoOrderGoodsMapper;
 
 	@Resource(name = "producer")
 	private Producer orderProducer;
@@ -320,7 +325,7 @@
 
 		// 褰撳墠鐢ㄦ埛鏄惁VIP
 		boolean vip = userInviteService.verifyVIP(uid);
-		
+
 		// 鏄惁瀛樺湪濂栧姳鍒�
 		boolean hasRewardCoupon = userSystemCouponService.getValidRebateCoupon(uid);
 		for (CommonOrderVO order : listOrder) {
@@ -879,7 +884,6 @@
 		return commonOrderMapper.countUserOrderToApp(uid, type, startTime, endTime, day, source, state, stateOrder);
 	}
 
-	
 	@Override
 	public BigDecimal getWeiQuanMoney(List<TaoBaoWeiQuanOrder> listWQ, int sourceType, Long uid) {
 		BigDecimal weiQuanMoney = new BigDecimal(0);
@@ -941,8 +945,14 @@
 			if ("楗夸簡涔�".equalsIgnoreCase(taoBaoOrder.getOrderType())) {
 				cog.setGoodsId(taoBaoOrder.getTradeId() + "");
 				cog.setGoodsType(Constant.SOURCE_TYPE_ELME);
-				cog.setPicture("http://img.flqapp.com/resource/goods/elme_picture_demo.png");
-				cog.setTitle(taoBaoOrder.getTitle());
+				TaoBaoOrderGoods goods = taoBaoOrderGoodsMapper.selectByTradeId(taoBaoOrder.getTradeId());
+				if (goods == null) {
+					cog.setPicture("http://img.flqapp.com/resource/goods/elme_picture_demo.png");
+					cog.setTitle(taoBaoOrder.getTitle());
+				} else {
+					cog.setPicture(goods.getImg());
+					cog.setTitle(goods.getTitle());
+				}
 				newCommonOrder.setCommonOrderGoods(cog);
 			} else {
 				cog.setGoodsId(taoBaoOrder.getAuctionId() + "");
@@ -1799,7 +1809,6 @@
 		return listVO;
 	}
 
-
 	@Override
 	public Date getThirdCreateTime(String orderId, int sourceType) {
 		List<CommonOrder> list = listBySourceTypeAndOrderId(sourceType, orderId);
@@ -1808,7 +1817,6 @@
 		return list.get(0).getThirdCreateTime();
 	}
 
-	
 	@Override
 	public List<CommonOrderVO> getOrderList(AcceptData acceptData, Integer page, Long uid, Integer state, Integer type,
 			Integer orderState, String orderNo, String startTime, String endTime, Integer dateType,
@@ -1842,9 +1850,7 @@
 		return commonOrderMapper.countOrderList(uid, state, type, orderState, orderNo, startTime, endTime, dateType,
 				listSource);
 	}
-	
-	
-	
+
 	/**
 	 * 璁㈠崟淇℃伅鍔犲伐
 	 * 
@@ -1870,7 +1876,7 @@
 					}
 				}
 			}
-			
+
 			Integer sourceType = order.getSourceType();
 			if (sourceType == null) {
 				continue;
@@ -1897,7 +1903,6 @@
 		if (listPDD.size() > 0) {
 			listRecordPDD = userSystemCouponRecordService.getRecordByOrderNoList(Constant.SOURCE_TYPE_PDD, listPDD);
 		}
-
 
 		SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd HH:mm");
 		SimpleDateFormat formatday = new SimpleDateFormat("yyyy.MM.dd");
@@ -1989,7 +1994,6 @@
 				order.setReceiveTime("鏀惰揣鏃堕棿锛�" + format.format(settleTime));
 			}
 
-				
 			Map<String, String> orderStateMap = new HashMap<String, String>();
 			// 璁㈠崟鐘舵��
 			Integer orderState = order.getState();
@@ -2002,21 +2006,21 @@
 					orderState = buFenOrder.getState();
 				}
 			}
-			
+
 			// 鏄剧ず杩斿埄璇存槑杩炴帴> 鏈け鏁�
 			if (CommonOrder.STATE_SX != orderState
 					&& thirdCreateTime.getTime() > TimeUtil.convertDateToTemp(Constant.ORDER_SHOW_BRACE_TIME)) {
 				String rebateLink = configService.get(ConfigKeyEnum.orderRebateDescLink.getKey());
 				order.setRebateLink(rebateLink + "?orderNo=" + orderNo + "&sourceType=" + sourceType);
 			}
-						
+
 			// 绾㈠寘淇℃伅
-			List<HongBaoOrder> hongBaoOrderList = hongBaoOrderService.listDetailByOrderIdAndSourceTypeAndUid(orderNo, sourceType, uid);
+			List<HongBaoOrder> hongBaoOrderList = hongBaoOrderService.listDetailByOrderIdAndSourceTypeAndUid(orderNo,
+					sourceType, uid);
 			HongBaoCountVO hongBaoCountVO = hongBaoOrderService.getHongBaoCountVO(hongBaoOrderList);
 			BigDecimal hongBao = hongBaoCountVO.getValidMoney();
 			Integer hongBaoState = hongBaoCountVO.getCurrentState();
-						
-			
+
 			/* 璁㈠崟鐘舵�� 杞崲澶勭悊 */
 			String orderStateContent = "";
 			if (CommonOrder.STATE_FK == orderState) {
@@ -2029,7 +2033,8 @@
 				orderStateContent = "宸插敭鍚�";
 				if (sourceType == Constant.SOURCE_TYPE_TAOBAO) {
 					/* 璁㈠崟缁存潈 鍒ゆ柇鏄惁鍏ㄩ儴缁存潈 */
-					List<TaoBaoWeiQuanOrder> listWQ = taoBaoWeiQuanOrderMapper.selectListByOrderIdAndState(order.getOrderNo(), "缁存潈鎴愬姛");
+					List<TaoBaoWeiQuanOrder> listWQ = taoBaoWeiQuanOrderMapper
+							.selectListByOrderIdAndState(order.getOrderNo(), "缁存潈鎴愬姛");
 					BigDecimal weiQuanMoney = getWeiQuanMoney(listWQ, sourceType, uid);
 					hongBao = MoneyBigDecimalUtil.sub(hongBao, weiQuanMoney);
 				}
@@ -2048,9 +2053,9 @@
 				order.setOrderOrigin("1");
 				order.setHongBaoTypePic(CommonOrder.TYPE_FANLI);
 				signList.add(CommonOrder.TYPE_FANLI);
-				
+
 				// 鏄惁宸蹭娇鐢ㄥ鍔卞埜銆佸厤鍗曞埜鎯呭喌
-				 if (sourceType == Constant.SOURCE_TYPE_TAOBAO) {
+				if (sourceType == Constant.SOURCE_TYPE_TAOBAO) {
 					couponUseFactory(order, listRecordTB);
 				} else if (sourceType == Constant.SOURCE_TYPE_JD) {
 					couponUseFactory(order, listRecordJD);
@@ -2072,22 +2077,24 @@
 				order.setOrderOrigin("3");
 				order.setHongBaoTypePic(CommonOrder.TYPE_INVITE);
 				signList.add(CommonOrder.TYPE_INVITE);
-				
+
 				// 绾㈠寘鍔犱笂琛ヨ创閲戦
-				InviteOrderSubsidy orderSubsidy = inviteOrderSubsidyService.getByOrderNoAndType(uid, orderNo, sourceType);
+				InviteOrderSubsidy orderSubsidy = inviteOrderSubsidyService.getByOrderNoAndType(uid, orderNo,
+						sourceType);
 				if (orderSubsidy != null && orderSubsidy.getMoney() != null) {
 					BigDecimal subsidyMoney = orderSubsidy.getMoney();
 					// 缁存潈閲戦
-					InviteOrderSubsidyDebt subsidyDebt = inviteOrderSubsidyDebtService.getBySourceId(orderSubsidy.getId());
+					InviteOrderSubsidyDebt subsidyDebt = inviteOrderSubsidyDebtService
+							.getBySourceId(orderSubsidy.getId());
 					if (subsidyDebt != null && subsidyDebt.getOriginMoney() != null) {
 						subsidyMoney = subsidyMoney.subtract(subsidyDebt.getOriginMoney());
-					} 
-					//  鏈�缁堣ˉ璐�
+					}
+					// 鏈�缁堣ˉ璐�
 					if (subsidyMoney.compareTo(new BigDecimal(0)) > 0) {
 						hongBao = hongBao.add(subsidyMoney);
 					}
 				}
-			} 
+			}
 			order.setSignList(signList);
 
 			String hongBaoDate = null;
@@ -2130,15 +2137,16 @@
 			stateMap.put("fontColor", stateFontColor);
 			order.setAccountState(stateMap);
 			hongbaoInfo = hongBaoState_Str + hongbaoInfo;
-			
+
 			Map<String, String> hongBaoMap = new HashMap<String, String>();
 			hongBaoMap.put("content", hongbaoInfo + " 楼" + hongBao.setScale(2, BigDecimal.ROUND_DOWN).toString());
 			hongBaoMap.put("fontColor", hongbaoInfoFontColor);
 			order.setHongBaoInfo(hongBaoMap);
 
 			// 鍒嗕韩銆侀個璇� 闅愯棌璁㈠崟鍙�
-			if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType || HongBaoV2.TYPE_ERJI == hongBaoType
-					|| HongBaoV2.TYPE_SHARE_YIJI == hongBaoType || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) {
+			if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType
+					|| HongBaoV2.TYPE_ERJI == hongBaoType || HongBaoV2.TYPE_SHARE_YIJI == hongBaoType
+					|| HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) {
 				order.setOrderNo(UserUtil.filterOrderId(order.getOrderNo()));
 			}
 		}

--
Gitblit v1.8.0