From b90c2f738f64df608ae9f9277c7a3ab35c46498a Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期五, 16 八月 2019 16:27:32 +0800
Subject: [PATCH] 金币获得事件上传
---
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsClassControllerV2.java | 51 +++++++++++++++++++++++++++++++++------------------
1 files changed, 33 insertions(+), 18 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsClassControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsClassControllerV2.java
index 14cb402..a0c0626 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsClassControllerV2.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsClassControllerV2.java
@@ -32,6 +32,7 @@
import com.yeshi.fanli.service.inter.lable.LabelClassService;
import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
import com.yeshi.fanli.service.inter.lable.TaoKeGoodsService;
+import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
@@ -72,6 +73,9 @@
@Resource
private LabelClassService labelClassService;
+
+ @Resource
+ private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
/**
* 涓�绾у垎绫�
@@ -135,8 +139,10 @@
// 鎬绘潯鏁�
long counttotal = 5000;
- // 绮鹃�夊簱鏁版嵁涓虹┖鏃讹紝缃戠粶杩涜鏌ヨ
- if (listQuery == null || listQuery.size() == 0) {
+ List<TaoBaoGoodsBrief> updateGoodsList = new ArrayList<>();
+
+ // 绮鹃�夊簱鏁版嵁灏忎簬10鏃讹紝缃戠粶杩涜鏌ヨ
+ if (listQuery == null || listQuery.size() < 10) {
long count = qualityGoodsService.countQueryClassId(gcid);
int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
page = page - totalPage;
@@ -179,6 +185,7 @@
if (taoBaoGoodsBrief == null) {
continue;
}
+ updateGoodsList.add(taoBaoGoodsBrief);
GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate,
shareRate);
array.add(gson.toJson(goodsDetailVO));
@@ -189,6 +196,10 @@
data.put("count", counttotal);
data.put("result", array);
out.print(JsonUtil.loadTrueResult(data));
+ try {
+ taoBaoGoodsUpdateService.addUpdateQueueAsync(updateGoodsList);
+ } catch (Exception e) {
+ }
}
/**
@@ -198,15 +209,19 @@
* @param page
* @param scid
* @param filter
- * @param order 鏉ユ簮锛氥�愭帹鑽愶細0 | 缁煎悎锛�4 銆佺患鍚堝彧鐪嬫湁鍒� 1 銆佺患鍚堝彧鐪嬪ぉ鐚� 1 | 浠锋牸锛氫綆鍒伴珮3 楂樺埌浣�2 | 閿�閲忥細1銆�
- * 鎺掑簭鍊硷細銆愰攢閲忕敱楂樺埌浣�: 1 锛� 閿�閲忕敱浣庡埌楂� 5锛� 浠锋牸浠庨珮鍒颁綆: 2 锛� 浠锋牸浠庝綆鍒伴珮:3 锛� 鎺ㄥ箍閲忛珮鍒颁綆:4
- * 锛� 鍏朵粬榛樿锛� 閿�閲忕敱楂樺埌浣庛��
+ * @param order
+ * 鏉ユ簮锛氥�愭帹鑽愶細0 | 缁煎悎锛�4 銆佺患鍚堝彧鐪嬫湁鍒� 1 銆佺患鍚堝彧鐪嬪ぉ鐚� 1 | 浠锋牸锛氫綆鍒伴珮3 楂樺埌浣�2 | 閿�閲忥細1銆�
+ * 鎺掑簭鍊硷細銆愰攢閲忕敱楂樺埌浣�: 1 锛� 閿�閲忕敱浣庡埌楂� 5锛� 浠锋牸浠庨珮鍒颁綆: 2 锛� 浠锋牸浠庝綆鍒伴珮:3 锛� 鎺ㄥ箍閲忛珮鍒颁綆:4 锛�
+ * 鍏朵粬榛樿锛� 閿�閲忕敱楂樺埌浣庛��
*
- * @param startprice 璧峰浠锋牸
- * @param endprice 缁撴潫浠锋牸
- * @param fastFilter fastFilter 鏈夊埜 [{"type":"quantype"}] 澶╃尗鍟嗗搧
- * [{"type":"shoptype"}]
- * @param totalSales 閿�閲忎互涓�
+ * @param startprice
+ * 璧峰浠锋牸
+ * @param endprice
+ * 缁撴潫浠锋牸
+ * @param fastFilter
+ * fastFilter 鏈夊埜 [{"type":"quantype"}] 澶╃尗鍟嗗搧 [{"type":"shoptype"}]
+ * @param totalSales
+ * 閿�閲忎互涓�
* @param out
*/
@RequestMapping(value = "getSubGoods", method = RequestMethod.POST)
@@ -236,9 +251,9 @@
if (catesId.endsWith(","))
catesId = catesId.substring(0, catesId.length() - 1);
sf.setCateIds(catesId);
-
+
// 鎸夊垎绫诲悕绉版悳绱�
- if (!StringUtil.isNullOrEmpty(catesId)) {
+ if (!StringUtil.isNullOrEmpty(catesId)) {
String searchParam = goodsSubClass.getSearchJson();
Gson gs = new Gson();
SearchFilter searchfilter = gs.fromJson(searchParam, SearchFilter.class);
@@ -251,7 +266,6 @@
totalSales);
TaoBaoSearchResult searchResult = TaoKeApiUtil.searchWuLiao(searchfilter);
long count = searchResult.getPageEntity().getTotalCount();
-
List<TaoBaoGoodsBrief> resultGoodsList = searchResult.getTaoBaoGoodsBriefs();
// 鏌ヨ鏄惁瓒呰繃浜嗘渶澶х殑鍟嗗搧鏁�
@@ -272,19 +286,20 @@
resultGoodsList.addAll(resultListTemp);
}
}
-
+
Gson gson2 = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
.excludeFieldsWithoutExposeAnnotation().create();
-
+
JSONArray array = new JSONArray();
BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
BigDecimal shareRate = hongBaoManageService.getShareRate();
if (resultGoodsList != null)
for (TaoBaoGoodsBrief goods : resultGoodsList) {
- GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(goods, null, fanLiRate, shareRate);
+ GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(goods, null, fanLiRate,
+ shareRate);
array.add(gson2.toJson(goodsDetailVO));
}
-
+
JSONObject result = new JSONObject();
result.put("result", array);
result.put("count", result.optLong("count") + count);
@@ -302,7 +317,7 @@
searchfilter.setKey(goodsSubClass.getKey());
taoKeGoodsService.setSearchFilter(searchfilter, filter, order, startprice, endprice, fastFilter,
totalSales);
-
+
JSONObject result = taoKeGoodsService.searchWuLiaoV2(searchfilter);
out.print(JsonUtil.loadTrueResult(result));
return;
--
Gitblit v1.8.0