From dc5be7d38446f70e6ff86df311119c32b41fe7f8 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期六, 28 十一月 2020 16:37:05 +0800
Subject: [PATCH] 大淘客搜索接口升级

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java |   31 +++++++++++++++----------------
 1 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java
index 7788f95..a85db09 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java
@@ -12,6 +12,7 @@
 
 import javax.annotation.Resource;
 
+import com.yeshi.fanli.entity.SystemEnum;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -116,7 +117,7 @@
 		
 		Long id = record.getId();
 		if (id == null) {
-			int maxOrder = floatADMapper.getMaxOrderByPosition(position);
+			int maxOrder = floatADMapper.getMaxOrderByPosition(position,record.getSystem());
 			record.setPicture(picture);
 			Integer state = record.getState();
 			if (state == null) {
@@ -174,7 +175,6 @@
 
 	/**
 	 * 鍒犻櫎鍥剧墖-涓嶆洿鏂版暟鎹簱
-	 * @param record
 	 * @throws Exception
 	 */
 	public void removePicture(String picture) throws Exception {
@@ -200,7 +200,7 @@
 		String position = resultObj.getPosition();
 		
 		// 鑾峰彇浜ゆ崲瀵硅薄
-		FloatAD exchangeObject = floatADMapper.getByAdjoinOrder(position, order, moveType);
+		FloatAD exchangeObject = floatADMapper.getByAdjoinOrder(position, order, moveType,resultObj.getSystem());
 		if (exchangeObject == null) {
 			if (moveType == 1) {
 				throw new FloatADException(1, "鍦ㄧ浉鍚屼娇鐢ㄥ湴鏂逛腑浼樺厛绾у凡缁忔渶浣庝簡");
@@ -267,9 +267,9 @@
 	
 
 	@Override
-	public List<FloatAD> listQuery(long start, int count, String key, Integer state) throws FloatADException {
+	public List<FloatAD> listQuery(long start, int count, String key, Integer state,SystemEnum system) throws FloatADException {
 		
-		List<FloatAD> listQuery = floatADMapper.listQuery(start, count, key, state);
+		List<FloatAD> listQuery = floatADMapper.listQuery(start, count, key, state,system);
 		if (listQuery == null || listQuery.size() == 0) {
 			return listQuery;
 		}
@@ -319,14 +319,14 @@
 
 
 	@Override
-	public long countQuery(String key, Integer state) {
-		return floatADMapper.countQuery(key, state);
+	public long countQuery(String key, Integer state,SystemEnum system) {
+		return floatADMapper.countQuery(key, state,system);
 	}
 
 	@Cacheable(value = "configCache", key = "'getEffectiveFloatAD-'+#position+'-'+#type")
 	@Override
-	public FloatAD getEffectiveFloatAD(String position, Integer type) {
-		FloatAD floatAD = floatADMapper.getEffectiveFloatAD(position, type);
+	public FloatAD getEffectiveFloatAD(String position, Integer type,SystemEnum system) {
+		FloatAD floatAD = floatADMapper.getEffectiveFloatAD(position, type,system);
 		if (floatAD != null) {
 			JumpDetailV2 jumpDetail = floatAD.getJumpDetail();
 			
@@ -392,13 +392,12 @@
 		}
 	}
 	
-	@Cacheable(value = "configCache", key = "'getValidFloatADCache-'+#position+'-'+#type+'-'+#platform+'-'+#versionCode")
+	@Cacheable(value = "configCache", key = "'getValidFloatADCache-'+#position+'-'+#type+'-'+#platform+'-'+#versionCode+'-'+#system")
 	@Override
-	public List<FloatAD> getValidFloatADCache(String position, Integer type, String platform, Integer versionCode) {
-		List<FloatAD> list = floatADMapper.getValidFloatAD(position, type);
+	public List<FloatAD> getValidFloatADCache(String position, Integer type, String platform, Integer versionCode, SystemEnum system) {
+		List<FloatAD> list = floatADMapper.getValidFloatAD(position, type,system);
 		// 杩囨护
-		filterFloatAD(list, platform, versionCode);
-		
+		filterFloatAD(list, platform, versionCode,system);
 		return list;
 	}
 	
@@ -409,10 +408,10 @@
 	 * @param platform
 	 * @param versionCode
 	 */
-	private void filterFloatAD(List<FloatAD> list, String platform, int versionCode) {
+	private void filterFloatAD(List<FloatAD> list, String platform, int versionCode, SystemEnum system) {
 		if (list == null || list.size() == 0)
 			return;
-		AppVersionInfo app = appVersionService.getClientVersion(platform, versionCode);
+		AppVersionInfo app = appVersionService.getClientVersion(platform, versionCode,system);
 		if (app == null) {
 			list.clear();
 			return;

--
Gitblit v1.8.0