From cd637932a970e7935b17d41568fe89c92775bccc Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期五, 06 十二月 2019 17:18:27 +0800
Subject: [PATCH] 双12活动添加,邀请码发布修改,爬单新规则添加

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/order/LostOrderServiceImpl.java |   33 +++++++++++++++++++++++----------
 1 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/LostOrderServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/LostOrderServiceImpl.java
index 2fe72bd..15c4e98 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/LostOrderServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/LostOrderServiceImpl.java
@@ -13,15 +13,16 @@
 import org.springframework.transaction.annotation.Transactional;
 
 import com.yeshi.fanli.dao.mybatis.order.LostOrderMapper;
+import com.yeshi.fanli.dto.ChartTDO;
 import com.yeshi.fanli.entity.bus.user.HongBaoV2;
 import com.yeshi.fanli.entity.bus.user.LostOrder;
 import com.yeshi.fanli.entity.bus.user.Order;
 import com.yeshi.fanli.service.inter.config.ConfigService;
-import com.yeshi.fanli.service.inter.msg.UserOrderMsgNotificationService;
 import com.yeshi.fanli.service.inter.order.HongBaoOrderService;
 import com.yeshi.fanli.service.inter.order.LostOrderService;
 import com.yeshi.fanli.service.inter.order.OrderService;
-import com.yeshi.fanli.util.Constant;
+import com.yeshi.fanli.service.inter.order.msg.UserOrderMsgNotificationService;
+import com.yeshi.fanli.service.inter.order.tb.TaoBaoPunishOrderService;
 import com.yeshi.fanli.util.Utils;
 
 @Service
@@ -42,6 +43,9 @@
 	@Resource
 	private UserOrderMsgNotificationService userOrderMsgNotificationService;
 
+	@Resource
+	private TaoBaoPunishOrderService taoBaoPunishOrderService;
+
 	@Transactional
 	@Override
 	public int addLostOrder(LostOrder lostOrder) {
@@ -50,6 +54,14 @@
 		if (type == null) { // 榛樿涓烘窐瀹濊鍗�
 			lostOrder.setType(1);
 			type = 1;
+		}
+
+		// 鏄惁澶勪簬杩濊璁㈠崟涓�
+		if (type == 1) {
+			int count = taoBaoPunishOrderService.countByTradeParentId(orderId);
+			if (count > 0) {
+				return -1001;
+			}
 		}
 
 		// 璁㈠崟鏄惁宸茬敵璇�
@@ -72,7 +84,7 @@
 		}
 
 		// 鏄惁涓哄垎浜禋璁㈠崟
-		if (hongBaoOrderService.countByOrderNoAndHongBaoType(orderId, HongBaoV2.TYPE_SHARE_GOODS) > 0)
+		if (hongBaoOrderService.countByOrderNoAndHongBaoType(orderId, HongBaoV2.TYPE_SHARE_GOODS, type) > 0)
 			return -5;
 
 		// 娆℃暟闄愬埗
@@ -105,7 +117,7 @@
 				lostOrderwriteLock.unlock();
 			}
 
-			Order or = orderService.getSystemOrderByUid(Constant.TAOBAO, lostOrder.getUserInfo().getId());
+			Order or = orderService.getSystemOrderByUid(type, lostOrder.getUserInfo().getId());
 			if (or != null) {
 				boolean b = Utils.isUserOrder(or.getOrderId(), lostOrder.getOrderId());
 				if (b) {
@@ -292,23 +304,24 @@
 	 * @return
 	 */
 	@Override
-	public List<LostOrder> listQuery(long start, int count, String key, Integer state, Integer handleType) {
-		return lostOrderMapper.listQuery(start, count, key, state, handleType);
+	public List<LostOrder> listQuery(long start, int count, String key, Integer state, Integer handleType,
+			Integer type) {
+		return lostOrderMapper.listQuery(start, count, key, state, handleType, type);
 	}
 
 	@Override
-	public long countQuery(String key, Integer state, Integer handleType) {
-		return lostOrderMapper.countQuery(key, state, handleType);
+	public long countQuery(String key, Integer state, Integer handleType, Integer type) {
+		return lostOrderMapper.countQuery(key, state, handleType, type);
 	}
 
 	@Override
-	public List<Map<String, Object>> countLostNum(Integer dateType, Integer resultCode, String year, String startTime,
+	public List<ChartTDO> countLostNum(Integer dateType, Integer resultCode, String year, String startTime,
 			String endTime) throws Exception {
 		return lostOrderMapper.countLostNum(dateType, resultCode, year, startTime, endTime);
 	}
 
 	@Override
-	public List<Map<String, Object>> countAppealMoney(Integer dateType, String year, String startTime, String endTime)
+	public List<ChartTDO> countAppealMoney(Integer dateType, String year, String startTime, String endTime)
 			throws Exception {
 		return lostOrderMapper.countAppealMoney(dateType, year, startTime, endTime);
 	}

--
Gitblit v1.8.0