From 5710fee2bd5c323096377a72d837050dd52d93b1 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 03 一月 2023 14:32:14 +0800
Subject: [PATCH] 修复抖音订单更新问题/修复用户注销却自动封禁的bug
---
fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/RecommendController.java | 672 ++++++++++++++++++++++++++++----------------------------
1 files changed, 336 insertions(+), 336 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/RecommendController.java b/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/RecommendController.java
index 36eb5bf..43db2aa 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/RecommendController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/RecommendController.java
@@ -1,336 +1,336 @@
-package com.yeshi.fanli.controller.wxmp.v1;
-
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.yeshi.utils.JsonUtil;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.yeshi.fanli.dto.ConfigParamsDTO;
-import com.yeshi.fanli.dto.WXMPAcceptData;
-import com.yeshi.fanli.dto.jd.JDSearchResult;
-import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
-import com.yeshi.fanli.dto.pdd.PDDGoodsResult;
-import com.yeshi.fanli.entity.accept.AcceptData;
-import com.yeshi.fanli.entity.bus.homemodule.Special;
-import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
-import com.yeshi.fanli.entity.common.JumpDetailV2;
-import com.yeshi.fanli.entity.jd.JDGoods;
-import com.yeshi.fanli.log.LogHelper;
-import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
-import com.yeshi.fanli.service.inter.config.ConfigService;
-import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
-import com.yeshi.fanli.service.inter.goods.recommend.HomeRecommendGoodsService;
-import com.yeshi.fanli.service.inter.goods.recommend.RecommendGoodsDeleteHistoryService;
-import com.yeshi.fanli.service.inter.homemodule.DeviceSexService;
-import com.yeshi.fanli.service.inter.homemodule.SpecialService;
-import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
-import com.yeshi.fanli.service.inter.jd.JDGoodsService;
-import com.yeshi.fanli.service.inter.lable.QualityFlashSaleService;
-import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
-import com.yeshi.fanli.service.inter.monitor.MonitorService;
-import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
-import com.yeshi.fanli.service.inter.pdd.PDDGoodsService;
-import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
-import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
-import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsService;
-import com.yeshi.fanli.tag.PageEntity;
-import com.yeshi.fanli.util.Constant;
-import com.yeshi.fanli.util.JumpDetailUtil;
-import com.yeshi.fanli.util.RedisManager;
-import com.yeshi.fanli.util.StringUtil;
-import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
-import com.yeshi.fanli.vo.goods.GoodsDetailVO;
-
-import net.sf.json.JSONArray;
-import net.sf.json.JSONObject;
-
-@Controller("WXMPRecommendController")
-@RequestMapping("/wxmp/api/v1/recommend")
-public class RecommendController {
-
- @Resource
- private HongBaoManageService hongBaoManageService;
-
- @Resource
- private QualityGoodsService qualityGoodsService;
-
- @Resource
- private RedisManager redisManager;
-
- @Resource
- private HomeRecommendGoodsService homeRecommendGoodsService;
-
- @Resource
- private ConfigService configService;
-
- @Resource
- private MonitorService monitorService;
-
- @Resource
- private QualityFlashSaleService qualityFlashSaleService;
-
- @Resource
- private RecommendGoodsDeleteHistoryService recommendGoodsDeleteHistoryService;
-
- @Resource
- private JumpDetailV2Service jumpDetailV2Service;
-
- @Resource
- private DeviceSexService deviceSexService;
-
- @Resource
- private SpecialService specialService;
-
- @Resource
- private SwiperPictureService swiperPictureService;
-
- @Resource
- private JDGoodsService jdGoodsService;
-
- @Resource
- private PDDGoodsService pddGoodsService;
-
- @Resource
- private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
-
- @Resource
- private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
-
- @Resource
- private DaTaoKeGoodsService daTaoKeGoodsService;
-
- @Resource
- private HongBaoV2CountService hongBaoV2CountService;
-
- /**
- * 棣栭〉涓撻
- *
- * @param acceptData
- * @param uid
- * @param out
- */
- @RequestMapping(value = "getIndex")
- public void getIndex(WXMPAcceptData acceptData, Long uid, PrintWriter out) {
- try {
- String platform = acceptData.getPlatform();
- int version = Integer.parseInt(acceptData.getVersion());
-
- // 杞挱鍥�
- List<SwiperPicture> picList = swiperPictureService.getByBannerCardAndVersion("index_top", platform,
- version);
- if (picList == null) {
- picList = new ArrayList<>();
- }
-
- for (SwiperPicture swiper : picList) {
- JSONObject params = null;
- if (StringUtil.isNullOrEmpty(swiper.getParams())) {
- params = JSONObject.fromObject(swiper.getParams());
- }
- swiper.setJumpDetail(JumpDetailUtil.getWXMPJumDetail(swiper.getJumpDetail(), params));
- swiper.setParams(null);
- }
-
- // 鍦嗗舰涓撻
- List<Special> specials = specialService.listByVersion(0, 10, "index_arc_1.6.5", platform, version);
- if (specials == null)
- specials = new ArrayList<>();
-
- for (Special special : specials) {
- JumpDetailV2 jumpDetail = special.getJumpDetail();
- if (special.isJumpLogin() && jumpDetail != null) {
- jumpDetail.setNeedLogin(true);
- }
-
- JSONObject params = null;
- if (StringUtil.isNullOrEmpty(special.getParams())) {
- params = JSONObject.fromObject(special.getParams());
- }
-
- special.setJumpDetail(JumpDetailUtil.getWXMPJumDetail(jumpDetail, params));
- special.setParams(null);
- }
-
- // 娲诲姩
- List<SwiperPicture> activitys = swiperPictureService.getByBannerCardAndVersion("index_invite", platform,
- version);
- if (activitys == null)
- activitys = new ArrayList<>();
-
- for (SwiperPicture swiper : activitys) {
- JSONObject params = null;
- if (StringUtil.isNullOrEmpty(swiper.getParams())) {
- params = JSONObject.fromObject(swiper.getParams());
- }
- swiper.setJumpDetail(JumpDetailUtil.getWXMPJumDetail(swiper.getJumpDetail(), params));
- swiper.setParams(null);
- }
-
- JSONObject data = new JSONObject();
- data.put("bannerList", JsonUtil.getApiCommonGson().toJson(picList));
- data.put("specialList", JsonUtil.getApiCommonGson().toJson(specials));
- data.put("activityList", JsonUtil.getApiCommonGson().toJson(activitys));
- out.print(JsonUtil.loadTrueResult(data));
- } catch (Exception e) {
- out.print(JsonUtil.loadFalseResult(1, "鑾峰彇鏁版嵁澶辫触"));
- try {
- LogHelper.errorDetailInfo(e);
- } catch (Exception e1) {
- e1.printStackTrace();
- }
- }
- }
-
-
- /**
- * 棣栭〉搴曢儴鍟嗗搧鎺ㄨ崘
- *
- * @param acceptData
- * @param out
- */
- @RequestMapping(value = "getGoodList")
- public void getGoodList(WXMPAcceptData acceptData, Integer goodsType, Integer page, HttpServletRequest request,
- PrintWriter out) {
- if (goodsType == null || page == null) {
- out.print(JsonUtil.loadFalseResult("鍙傛暟淇℃伅涓嶆甯�"));
- return;
- }
-
- try {
- if (goodsType == Constant.SOURCE_TYPE_JD) {
- getIndexJDGoods(acceptData, page, out);
- return;
- }
-
- if (goodsType == Constant.SOURCE_TYPE_PDD) {
- getIndexPDDGoods(acceptData, page, out);
- return;
- }
- out.print(JsonUtil.loadFalseResult("鍟嗗搧绫诲瀷閿欒"));
- } catch (Exception e) {
- LogHelper.errorDetailInfo(e);
- JSONObject data = new JSONObject();
- data.put("list", new JSONArray());
- data.put("count", 0);
- out.print(JsonUtil.loadTrueResult(data));
- }
- }
-
-
- /**
- * 浜笢棣栭〉鍟嗗搧
- *
- * @param acceptData
- * @param page
- * @param out
- */
- private void getIndexJDGoods(WXMPAcceptData acceptData, int page, PrintWriter out) {
- JDSearchResult result = jdGoodsService.getIndexJDGoods(page);
- long count = 0;
- JSONObject data = new JSONObject();
- JSONArray array = new JSONArray();
- if (result != null) {
- PageEntity pageEntity = result.getPageEntity();
- if (pageEntity != null) {
- count = pageEntity.getTotalCount();
- }
-
- List<JDGoods> goodsList = result.getGoodsList();
- if (goodsList != null && goodsList.size() > 0) {
- ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
- acceptData.getVersion());
-
- Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
- .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
- for (JDGoods goods : goodsList) {
- GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO);
- array.add(gson.toJson(goodsDetailVO));
- }
- }
- }
-
- data.put("list", array);
- data.put("count", count);
- out.print(JsonUtil.loadTrueResult(data));
- }
-
- /**
- * 鐖嗘鎺掕鍟嗗搧-瀹炴椂鐑攢姒�
- *
- * @param acceptData
- * @param page
- * @param out
- */
- private void getIndexPDDGoods(WXMPAcceptData acceptData, int page, PrintWriter out) {
- PDDGoodsResult result = pddGoodsService.getTopGoodsList(page, 1);
- int count = 0;
- JSONArray array = new JSONArray();
- if (result != null) {
- count = result.getTotalCount();
- Gson gson = JsonUtil.getApiCommonGson();
- List<PDDGoodsDetail> goodsList = result.getGoodsList();
- if (goodsList != null && goodsList.size() > 0) {
- ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
- acceptData.getVersion());
-
- for (PDDGoodsDetail goods : goodsList) {
- GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO);
- array.add(gson.toJson(goodsDetailVO));
- }
- }
- }
-
- JSONObject data = new JSONObject();
- data.put("list", array);
- data.put("count", count);
- out.print(JsonUtil.loadTrueResult(data));
- }
-
-
- /**
- * 棣栭〉椤堕儴鎻愮ず
- *
- * @param acceptData
- * @param uid
- * @param callback
- * @param out
- */
- @RequestMapping(value = "getGuide")
- public void getGuide(AcceptData acceptData, Long uid, PrintWriter out) {
- String tips = null;
- if (uid == null || uid <= 0) {
- tips = configService.get("tip_guide_new_user");
- } else {
- long rebateOrder = hongBaoV2CountService.countRebateOrder(uid);
- long shareOrInviteOrder = hongBaoV2CountService.countShareOrInviteOrder(uid);
- if (rebateOrder + shareOrInviteOrder >= 3) {
- // 鐔熷鐗�
- } else if (rebateOrder <= 0 && shareOrInviteOrder <= 0) {
- // 鏂颁汉鐗�
- tips = configService.get("tip_guide_new_user");
- } else if (rebateOrder > 0 && shareOrInviteOrder <= 0) {
- // 鐪侀挶鐗�
- tips = configService.get("tip_guide_save_money");
- } else {
- // 璧氶挶鐗�
- tips = configService.get("tip_guide_share_invite");
- }
- }
-
- if (StringUtil.isNullOrEmpty(tips)) {
- out.print(JsonUtil.loadFalseResult("鏆傛棤鎻愮ず"));
- return;
- }
-
- JSONObject data = JSONObject.fromObject(tips);
- out.print(JsonUtil.loadTrueResult(data));
- }
-}
+package com.yeshi.fanli.controller.wxmp.v1;
+
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+
+import com.yeshi.fanli.util.*;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.yeshi.utils.JsonUtil;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO;
+import com.yeshi.fanli.dto.WXMPAcceptData;
+import com.yeshi.fanli.dto.jd.JDSearchResult;
+import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
+import com.yeshi.fanli.dto.pdd.PDDGoodsResult;
+import com.yeshi.fanli.entity.accept.AcceptData;
+import com.yeshi.fanli.entity.common.JumpDetailV2;
+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.common.JumpDetailV2Service;
+import com.yeshi.fanli.service.inter.config.ConfigService;
+import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
+import com.yeshi.fanli.service.inter.goods.recommend.HomeRecommendGoodsService;
+import com.yeshi.fanli.service.inter.goods.recommend.RecommendGoodsDeleteHistoryService;
+import com.yeshi.fanli.service.inter.homemodule.DeviceSexService;
+import com.yeshi.fanli.service.inter.homemodule.SpecialService;
+import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
+import com.yeshi.fanli.service.inter.jd.JDGoodsService;
+import com.yeshi.fanli.service.inter.lable.QualityFlashSaleService;
+import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
+import com.yeshi.fanli.service.inter.monitor.MonitorService;
+import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
+import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
+import com.yeshi.fanli.service.inter.pdd.PDDGoodsService;
+import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
+import com.yeshi.goods.facade.service.DaTaoKeGoodsDetailV2Service;
+import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsService;
+import com.yeshi.common.entity.PageEntity;
+import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
+import com.yeshi.fanli.vo.goods.GoodsDetailVO;
+import com.yeshi.fanli.vo.homemodule.BannerVO;
+import com.yeshi.fanli.vo.homemodule.SpecialVO;
+
+import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
+
+@Controller("WXMPRecommendController")
+@RequestMapping("/wxmp/api/v1/recommend")
+public class RecommendController {
+
+ @Resource
+ private HongBaoManageService hongBaoManageService;
+
+ @Resource
+ private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
+
+ @Resource
+ private QualityGoodsService qualityGoodsService;
+
+ @Resource
+ private RedisManager redisManager;
+
+ @Resource
+ private HomeRecommendGoodsService homeRecommendGoodsService;
+
+ @Resource
+ private ConfigService configService;
+
+ @Resource
+ private MonitorService monitorService;
+
+ @Resource
+ private QualityFlashSaleService qualityFlashSaleService;
+
+ @Resource
+ private RecommendGoodsDeleteHistoryService recommendGoodsDeleteHistoryService;
+
+ @Resource
+ private JumpDetailV2Service jumpDetailV2Service;
+
+ @Resource
+ private DeviceSexService deviceSexService;
+
+ @Resource
+ private SpecialService specialService;
+
+ @Resource
+ private SwiperPictureService swiperPictureService;
+
+ @Resource
+ private JDGoodsService jdGoodsService;
+
+ @Resource
+ private PDDGoodsService pddGoodsService;
+
+ @Resource
+ private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
+
+ @Resource
+ private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
+
+ @Resource
+ private DaTaoKeGoodsService daTaoKeGoodsService;
+
+ @Resource
+ private HongBaoV2CountService hongBaoV2CountService;
+
+ /**
+ * 棣栭〉涓撻
+ *
+ * @param acceptData
+ * @param uid
+ * @param out
+ */
+ @RequestMapping(value = "getIndex")
+ public void getIndex(WXMPAcceptData acceptData, Long uid, PrintWriter out) {
+ try {
+ String platform = acceptData.getPlatform();
+ int version = Integer.parseInt(acceptData.getVersion());
+
+ // 杞挱鍥�
+ List<BannerVO> picList = swiperPictureService.getByBannerCardAndVersion("index_top", platform,
+ version,acceptData.getSystem());
+ if (picList == null) {
+ picList = new ArrayList<>();
+ }
+
+ for (BannerVO swiper : picList) {
+// JSONObject params = null;
+// if (StringUtil.isNullOrEmpty(swiper.getParams())) {
+// params = JSONObject.fromObject(swiper.getParams());
+// }
+ swiper.setJumpDetail(JumpDetailUtil.getWXMPJumDetail(swiper.getJumpDetail()));
+ }
+
+ // 鍦嗗舰涓撻
+ List<SpecialVO> specials = specialService.listByVersion(0, 10, "index_arc_1.6.5", platform, version,acceptData.getSystem());
+ if (specials == null)
+ specials = new ArrayList<>();
+
+ for (SpecialVO special : specials) {
+ JumpDetailV2 jumpDetail = special.getJumpDetail();
+ if (special.isJumpLogin() && jumpDetail != null) {
+ jumpDetail.setNeedLogin(true);
+ }
+
+// JSONObject params = null;
+// if (StringUtil.isNullOrEmpty(special.getParams())) {
+// params = JSONObject.fromObject(special.getParams());
+// }
+ special.setJumpDetail(JumpDetailUtil.getWXMPJumDetail(jumpDetail));
+ }
+
+ // 娲诲姩
+ List<BannerVO> activitys = swiperPictureService.getByBannerCardAndVersion("index_invite", platform,
+ version,acceptData.getSystem());
+ if (activitys == null)
+ activitys = new ArrayList<>();
+
+ for (BannerVO swiper : activitys) {
+// JSONObject params = null;
+// if (StringUtil.isNullOrEmpty(swiper.getParams())) {
+// params = JSONObject.fromObject(swiper.getParams());
+// }
+ swiper.setJumpDetail(JumpDetailUtil.getWXMPJumDetail(swiper.getJumpDetail()));
+ }
+
+ JSONObject data = new JSONObject();
+ data.put("bannerList", JsonUtil.getApiCommonGson().toJson(picList));
+ data.put("specialList", JsonUtil.getApiCommonGson().toJson(specials));
+ data.put("activityList", JsonUtil.getApiCommonGson().toJson(activitys));
+ out.print(JsonUtil.loadTrueResult(data));
+ } catch (Exception e) {
+ out.print(JsonUtil.loadFalseResult(1, "鑾峰彇鏁版嵁澶辫触"));
+ try {
+ LogHelper.errorDetailInfo(e);
+ } catch (Exception e1) {
+ e1.printStackTrace();
+ }
+ }
+ }
+
+
+ /**
+ * 棣栭〉搴曢儴鍟嗗搧鎺ㄨ崘
+ *
+ * @param acceptData
+ * @param out
+ */
+ @RequestMapping(value = "getGoodList")
+ public void getGoodList(WXMPAcceptData acceptData, Integer goodsType, Integer page, HttpServletRequest request,
+ PrintWriter out) {
+ if (goodsType == null || page == null) {
+ out.print(JsonUtil.loadFalseResult("鍙傛暟淇℃伅涓嶆甯�"));
+ return;
+ }
+
+ try {
+ if (goodsType == Constant.SOURCE_TYPE_JD) {
+ getIndexJDGoods(acceptData, page, out);
+ return;
+ }
+
+ if (goodsType == Constant.SOURCE_TYPE_PDD) {
+ getIndexPDDGoods(acceptData, page, out);
+ return;
+ }
+ out.print(JsonUtil.loadFalseResult("鍟嗗搧绫诲瀷閿欒"));
+ } catch (Exception e) {
+ LogHelper.errorDetailInfo(e);
+ JSONObject data = new JSONObject();
+ data.put("list", new JSONArray());
+ data.put("count", 0);
+ data.put("page", page);
+ out.print(JsonUtil.loadTrueResult(data));
+ }
+ }
+
+
+ /**
+ * 浜笢棣栭〉鍟嗗搧
+ *
+ * @param acceptData
+ * @param page
+ * @param out
+ */
+ private void getIndexJDGoods(WXMPAcceptData acceptData, int page, PrintWriter out) {
+ JDSearchResult result = jdGoodsService.getIndexJDGoods(page, SystemInfoUtil.getSystemByWXCXCAppId(acceptData.getAppId()));
+ long count = 0;
+ JSONObject data = new JSONObject();
+ JSONArray array = new JSONArray();
+ if (result != null) {
+ PageEntity pageEntity = result.getPageEntity();
+ if (pageEntity != null) {
+ count = pageEntity.getTotalCount();
+ }
+
+ List<JDGoods> goodsList = result.getGoodsList();
+ if (goodsList != null && goodsList.size() > 0) {
+ GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
+ acceptData.getVersion(),acceptData.getSystem());
+
+ Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
+ .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
+ for (JDGoods goods : goodsList) {
+ GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO);
+ array.add(gson.toJson(goodsDetailVO));
+ }
+ }
+ }
+
+ data.put("list", array);
+ data.put("count", count);
+ data.put("page", page);
+ out.print(JsonUtil.loadTrueResult(data));
+ }
+
+ /**
+ * 鐖嗘鎺掕鍟嗗搧-瀹炴椂鐑攢姒�
+ *
+ * @param acceptData
+ * @param page
+ * @param out
+ */
+ private void getIndexPDDGoods(WXMPAcceptData acceptData, int page, PrintWriter out) {
+ PDDGoodsResult result = pddGoodsService.getTopGoodsList(page, 1);
+ int count = 0;
+ JSONArray array = new JSONArray();
+ if (result != null) {
+ count = result.getTotalCount();
+ Gson gson = JsonUtil.getApiCommonGson();
+ List<PDDGoodsDetail> goodsList = result.getGoodsList();
+ if (goodsList != null && goodsList.size() > 0) {
+ GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
+ acceptData.getVersion(),acceptData.getSystem());
+
+ for (PDDGoodsDetail goods : goodsList) {
+ GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO);
+ array.add(gson.toJson(goodsDetailVO));
+ }
+ }
+ }
+
+ JSONObject data = new JSONObject();
+ data.put("list", array);
+ data.put("count", count);
+ data.put("page", page);
+ out.print(JsonUtil.loadTrueResult(data));
+ }
+
+
+ /**
+ * 棣栭〉椤堕儴鎻愮ず
+ *
+ * @param acceptData
+ * @param uid
+ * @param out
+ */
+ @RequestMapping(value = "getGuide")
+ public void getGuide(AcceptData acceptData, Long uid, PrintWriter out) {
+ String tips = null;
+ if (uid == null || uid <= 0) {
+ tips = configService.getValue(ConfigKeyEnum.tipGuideNewUser.getKey(),acceptData.getSystem());
+ } else {
+ long rebateOrder = hongBaoV2CountService.countRebateOrder(uid);
+ long shareOrInviteOrder = hongBaoV2CountService.countShareOrInviteOrder(uid);
+ if (rebateOrder + shareOrInviteOrder >= 3) {
+ // 鐔熷鐗�
+ } else if (rebateOrder <= 0 && shareOrInviteOrder <= 0) {
+ // 鏂颁汉鐗�
+ tips = configService.getValue(ConfigKeyEnum.tipGuideNewUser.getKey(),acceptData.getSystem());
+ } else if (rebateOrder > 0 && shareOrInviteOrder <= 0) {
+ // 鐪侀挶鐗�
+ tips = configService.getValue(ConfigKeyEnum.tipGuideSaveMoney.getKey(),acceptData.getSystem());
+ } else {
+ // 璧氶挶鐗�
+ tips = configService.getValue(ConfigKeyEnum.tipGuideShareInvite.getKey(),acceptData.getSystem());
+ }
+ }
+
+ if (StringUtil.isNullOrEmpty(tips)) {
+ out.print(JsonUtil.loadFalseResult("鏆傛棤鎻愮ず"));
+ return;
+ }
+
+ JSONObject data = JSONObject.fromObject(tips);
+ out.print(JsonUtil.loadTrueResult(data));
+ }
+}
--
Gitblit v1.8.0