From afe70962a8aeaed5ea761835e803e5812df5e9c3 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期一, 15 六月 2020 16:07:51 +0800
Subject: [PATCH] 云发单支付金额0.01
---
fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/SearchController.java | 62 +++++++++++++++++++++++++-----
1 files changed, 51 insertions(+), 11 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/SearchController.java b/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/SearchController.java
index 7fa60db..64bf7d7 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/SearchController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/SearchController.java
@@ -1,6 +1,7 @@
package com.yeshi.fanli.controller.wxmp.v1;
import java.io.PrintWriter;
+import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -24,12 +25,16 @@
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
import com.yeshi.fanli.dto.pdd.PDDGoodsResult;
import com.yeshi.fanli.dto.pdd.PDDSearchFilter;
+import com.yeshi.fanli.entity.accept.AcceptData;
+import com.yeshi.fanli.entity.bus.search.HotSearch;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.brand.BrandInfoService;
import com.yeshi.fanli.service.inter.config.ConfigService;
+import com.yeshi.fanli.service.inter.config.HotSearchService;
+import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
import com.yeshi.fanli.service.manger.goods.jd.JDGoodsLinkParseManager;
import com.yeshi.fanli.tag.PageEntity;
@@ -57,6 +62,9 @@
@Resource
private HongBaoManageService hongBaoManageService;
+
+ @Resource
+ private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
@Resource(name = "taskExecutor")
private TaskExecutor executor;
@@ -66,7 +74,9 @@
@Resource
private JDGoodsLinkParseManager jdGoodsLinkParseManager;
-
+
+ @Resource
+ private HotSearchService hotSearchService;
/**
* 绮樿创鏉夸俊鎭帹鑽�
@@ -82,7 +92,7 @@
out.print(JsonUtil.loadFalseResult("鍊间负绌�"));
return;
}
-
+
// 鍘婚櫎鍓嶅悗绌烘牸
int type = 1;
text = text.trim();
@@ -163,7 +173,7 @@
}
}
}
-
+
if (commonGoods == null) {
out.println(JsonUtil.loadFalseResult("鏆傛湭鎵惧埌璇ュ晢鍝侊紝璇风◢鍚庡啀璇曪紒"));
return;
@@ -179,17 +189,48 @@
data.put("goods", goodsJSON);
out.print(JsonUtil.loadTrueResult(data));
return;
- }
-
+ }
+
JSONObject data = new JSONObject();
Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
.excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
data.put("type", type);
- data.put("goods", gson.toJson(GoodsDetailVOFactory.convertCommonGoods(commonGoods, hongBaoManageService.getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion()))));
+ data.put("goods", gson.toJson(GoodsDetailVOFactory.convertCommonGoods(commonGoods,
+ orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion()))));
out.print(JsonUtil.loadTrueResult(data));
return;
}
+ /**
+ * 鐑棬鎼滅储
+ *
+ * @param acceptData
+ * @param goodsType
+ * @param out
+ */
+ @RequestMapping(value = "gethotsearch", method = RequestMethod.POST)
+ public void getHotSearch(AcceptData acceptData, Integer goodsType, PrintWriter out) {
+ // 榛樿娣樺疂
+ if (goodsType == null) {
+ goodsType = Constant.SOURCE_TYPE_TAOBAO;
+ }
+
+ List<HotSearch> list = hotSearchService.getHotSearchCache(goodsType);
+ if (list == null || list.size() == 0) {
+ out.print(JsonUtil.loadFalseResult("娌℃湁鏁版嵁"));
+ return;
+ }
+ List<String> hotSearchList = new ArrayList<String>();
+ if(list!=null)
+ for (HotSearch hot : list)
+ hotSearchList.add(hot.getName());
+
+ JSONObject data = new JSONObject();
+ data.put("count", list.size());
+ data.put("hotSearchList", hotSearchList);
+ data.put("helpLink", configService.get(ConfigKeyEnum.newerGonglue.getKey()));
+ out.print(JsonUtil.loadTrueResult(data));
+ }
/**
* 鎼滅储鍊欓�夎瘝
@@ -253,11 +294,11 @@
out.print(JsonUtil.loadFalseResult(1, "璇疯緭鍏ユ悳绱㈠唴瀹�"));
return;
}
-
+
if (page == null || page < 1) {
page = 1;
}
-
+
final String searchkey = key.trim();
if (searchkey.startsWith("http://") || searchkey.startsWith("https://")) {
JSONObject data = new JSONObject();
@@ -279,7 +320,6 @@
return;
}
}
-
/**
* 浜笢
@@ -437,7 +477,7 @@
if (goodsList != null && goodsList.size() > 0) {
Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
.excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
- ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
+ ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
acceptData.getVersion());
for (JDGoods goods : goodsList) {
GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO);
@@ -519,7 +559,7 @@
Gson gson = JsonUtil.getApiCommonGson();
List<PDDGoodsDetail> goodsList = result.getGoodsList();
if (goodsList != null && goodsList.size() > 0) {
- ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
+ ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
acceptData.getVersion());
for (PDDGoodsDetail goods : goodsList) {
--
Gitblit v1.8.0