From 98b1a0affd69bbe63223c21fdd2c404e8bedfccb Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 20 五月 2020 17:25:08 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/div' into 2.1.2

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/goods/CommonGoodsServiceImpl.java |   36 +++++++++++++++++++++++++++++++++---
 1 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/CommonGoodsServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/CommonGoodsServiceImpl.java
index 7d27b0e..bc95171 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/CommonGoodsServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/goods/CommonGoodsServiceImpl.java
@@ -4,9 +4,9 @@
 import java.util.List;
 
 import javax.annotation.Resource;
-import javax.transaction.Transactional;
 
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.yeshi.utils.StringUtil;
 
 import com.yeshi.fanli.dao.mybatis.goods.CommonGoodsMapper;
@@ -20,6 +20,14 @@
 	@Resource
 	private CommonGoodsMapper commonGoodsMapper;
 
+	
+	@Override
+	public CommonGoods selectByPrimaryKey(Long id) {
+		return commonGoodsMapper.selectByPrimaryKey(id);
+	}
+	
+	
+	
 	/**
 	 * 楠岃瘉鏁版嵁姝g‘鎬�
 	 * 
@@ -54,7 +62,9 @@
 
 	@Override
 	public CommonGoods addOrUpdateCommonGoods(CommonGoods commonGoods) throws CommonGoodsException {
+		// 楠岃瘉鏁版嵁瀹屾暣鎬�
 		filterCommonGoods(commonGoods);
+		
 		CommonGoods goods = commonGoodsMapper.selectByGoodsIdAndGoodsType(commonGoods.getGoodsId(),
 				commonGoods.getGoodsType());
 		if (goods != null) {
@@ -71,7 +81,9 @@
 	
 	@Override
 	public CommonGoods addCommonGoods(CommonGoods commonGoods) throws CommonGoodsException {
+		// 楠岃瘉鏁版嵁瀹屾暣鎬�
 		filterCommonGoods(commonGoods);
+		
 		CommonGoods goods = commonGoodsMapper.selectByGoodsIdAndGoodsType(commonGoods.getGoodsId(),
 				commonGoods.getGoodsType());
 		if (goods != null) {
@@ -89,6 +101,7 @@
 	public void updateCommonGoods(CommonGoods commonGoods) throws CommonGoodsException {
 		// 鍒ゆ柇淇℃伅鏄惁瀹屾暣
 		filterCommonGoods(commonGoods);
+		
 		CommonGoods goods = commonGoodsMapper.selectByGoodsIdAndGoodsType(commonGoods.getGoodsId(),
 				commonGoods.getGoodsType());
 		if (goods == null) {
@@ -102,7 +115,7 @@
 	}
 
 	@Override
-	public void offlineCommonGoods(Long goodsId, int goodsType) {
+	public void offlineCommonGoods(Long goodsId, Integer goodsType) {
 		CommonGoods goods = commonGoodsMapper.selectByGoodsIdAndGoodsType(goodsId, goodsType);
 		if (goods == null)
 			return;
@@ -114,7 +127,7 @@
 	}
 
 	@Override
-	public CommonGoods getCommonGoodsByGoodsIdAndGoodsType(Long goodsId, int goodsType) {
+	public CommonGoods getCommonGoodsByGoodsIdAndGoodsType(Long goodsId, Integer goodsType) {
 		return commonGoodsMapper.selectByGoodsIdAndGoodsType(goodsId, goodsType);
 	}
 
@@ -151,4 +164,21 @@
 			}
 		}
 	}
+	
+	
+	@Override
+	public List<CommonGoods> listBySellerId(Long sellerId, Integer goodsType) {
+		return commonGoodsMapper.listBySellerId(sellerId, goodsType);
+	} 
+	
+	@Override
+	public long countBySellerIdAndHasCoupon(Long sellerId, Integer goodsType) {
+		return commonGoodsMapper.countBySellerIdAndHasCoupon(sellerId, goodsType);
+	}
+	
+	@Override
+	public List<CommonGoods> getByListGoodsId(List<Long> list, Integer goodsType) {
+		return commonGoodsMapper.getByListGoodsId(list, goodsType);
+	}
+	
 }

--
Gitblit v1.8.0