| | |
| | | import javax.servlet.http.HttpSession; |
| | | |
| | | import com.yeshi.fanli.exception.pdd.PDDApiException; |
| | | import com.yeshi.fanli.lijin.manager.GoodsLijinMnager; |
| | | import com.yeshi.fanli.service.inter.pdd.PDDAuthService; |
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService; |
| | | import org.springframework.core.task.TaskExecutor; |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.yeshi.fanli.dto.ConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.GoodsMoneyConfigParamsDTO; |
| | | import com.yeshi.fanli.dto.jd.JDFilter; |
| | | import com.yeshi.fanli.dto.jd.JDSearchFilter; |
| | | import com.yeshi.fanli.dto.jd.JDSearchResult; |
| | |
| | | import com.yeshi.fanli.exception.user.TokenRecordException; |
| | | import com.yeshi.fanli.service.inter.brand.BrandInfoService; |
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service; |
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService; |
| | | import com.yeshi.fanli.service.inter.config.ConfigService; |
| | | import com.yeshi.fanli.service.inter.config.SuperHotSearchService; |
| | | import com.yeshi.fanli.service.inter.help.AppPageNotificationService; |
| | | import com.yeshi.fanli.service.inter.lable.QualityGoodsService; |
| | | import com.yeshi.fanli.service.inter.lable.TaoKeGoodsService; |
| | | import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService; |
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService; |
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService; |
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService; |
| | | import com.yeshi.goods.facade.service.DaTaoKeGoodsDetailV2Service; |
| | | import com.yeshi.fanli.service.inter.user.HistorySearchService; |
| | | import com.yeshi.fanli.service.inter.user.TokenRecordService; |
| | | import com.yeshi.fanli.service.inter.user.integral.IntegralGetService; |
| | | import com.yeshi.fanli.service.manger.ClipboardAnalysisManager; |
| | | import com.yeshi.fanli.service.manger.IClipboardAnalysisResult; |
| | | import com.yeshi.fanli.service.manger.goods.jd.JDGoodsLinkParseManager; |
| | | import com.yeshi.common.entity.PageEntity; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | |
| | | |
| | | @Resource |
| | | private PDDAuthService pddAuthService; |
| | | |
| | | @Resource |
| | | private GoodsLijinMnager goodsLijinMnager; |
| | | |
| | | |
| | | /** |
| | |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd") |
| | | .create(); |
| | | data.put("type", 3); |
| | | |
| | | |
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertCommonGoods(goods, |
| | | orderHongBaoMoneyComputeService.getShowComputeRate( |
| | | acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem())); |
| | | |
| | | goodsDetailVO = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, goodsBrief, goodsDetailVO); |
| | | |
| | | data.put("goods", |
| | | gson.toJson( |
| | | GoodsDetailVOFactory.convertCommonGoods(goods, |
| | | orderHongBaoMoneyComputeService.getShowComputeRate( |
| | | acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem())))); |
| | | gson.toJson(goodsDetailVO)); |
| | | // 跳转详情 |
| | | if (VersionUtil.greaterThan_2_1_3(acceptData.getPlatform(), |
| | | acceptData.getVersion())) { |
| | |
| | | data.put("type", 3); |
| | | data.put("goods", |
| | | gson.toJson( |
| | | GoodsDetailVOFactory.convertCommonGoods(goods, |
| | | orderHongBaoMoneyComputeService.getShowComputeRate( |
| | | acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem())))); |
| | | goodsLijinMnager.loadOtherMoneyInfo(acceptData.getSystem(), uid, goods, |
| | | GoodsDetailVOFactory.convertCommonGoods(goods, |
| | | orderHongBaoMoneyComputeService.getShowComputeRate( |
| | | acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()))))); |
| | | // if |
| | | // (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), |
| | | // acceptData.getVersion())) { |
| | |
| | | |
| | | /*--------- 京东商品 -------*/ |
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_JD) { |
| | | searchJDGoods(acceptData, searchkey, page, filter, order, ap, out); |
| | | searchJDGoods(acceptData, uid, searchkey, page, filter, order, ap, out); |
| | | return; |
| | | } |
| | | |
| | |
| | | |
| | | /*-------- 唯品会商品 ------*/ |
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_VIP) { |
| | | searchVIPGoods(acceptData, searchkey, page, filter, order, ap, out); |
| | | searchVIPGoods(acceptData, uid, searchkey, page, filter, order, ap, out); |
| | | return; |
| | | } |
| | | |
| | | /*-------- 苏宁商品 ------*/ |
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_SUNING) { |
| | | searchSuningGoods(acceptData, searchkey, page, filter, order, ap, out); |
| | | searchSuningGoods(acceptData, uid, searchkey, page, filter, order, ap, out); |
| | | return; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | List<GoodsDetailVO> list = new ArrayList<GoodsDetailVO>(); |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | |
| | | for (TaoBaoGoodsBrief goods : taoBaoGoodsBriefs) { |
| | | list.add(GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO)); |
| | | } |
| | | List<GoodsDetailVO> list = goodsLijinMnager.loadTBMoneyInfo(acceptData.getSystem(), uid, taoBaoGoodsBriefs, paramsDTO); |
| | | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().create(); |
| | |
| | | * @param ap |
| | | * @param out |
| | | */ |
| | | private void searchJDGoods(AcceptData acceptData, String key, Integer page, String filter, Integer order, |
| | | private void searchJDGoods(AcceptData acceptData, Long uid, String key, Integer page, String filter, Integer order, |
| | | AppPageNotification ap, PrintWriter out) { |
| | | |
| | | JDSearchResult result = null; |
| | |
| | | if (goodsList != null && goodsList.size() > 0) { |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()) |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create(); |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | for (JDGoods goods : goodsList) { |
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO); |
| | | |
| | | |
| | | List<GoodsDetailVO> voList = goodsLijinMnager.loadOtherMoneyInfo(acceptData.getSystem(), uid, goodsList, paramsDTO); |
| | | |
| | | for (GoodsDetailVO vo : voList) { |
| | | if (hasCoupon) { |
| | | if (goodsDetailVO.isHasCoupon()) { |
| | | array.add(gson.toJson(goodsDetailVO)); |
| | | if (vo.isHasCoupon()) { |
| | | array.add(gson.toJson(vo)); |
| | | } |
| | | } else { |
| | | array.add(gson.toJson(goodsDetailVO)); |
| | | array.add(gson.toJson(vo)); |
| | | } |
| | | } |
| | | } |
| | |
| | | Gson gson = JsonUtil.getApiCommonGson(); |
| | | List<PDDGoodsDetail> goodsList = result.getGoodsList(); |
| | | if (goodsList != null && goodsList.size() > 0) { |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | |
| | | for (PDDGoodsDetail goods : goodsList) { |
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO); |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | List<GoodsDetailVO> voList = goodsLijinMnager.loadOtherMoneyInfo(acceptData.getSystem(), uid, goodsList, paramsDTO); |
| | | for (GoodsDetailVO goodsDetailVO : voList) { |
| | | array.add(gson.toJson(goodsDetailVO)); |
| | | } |
| | | } |
| | |
| | | * @Title: searchVIPGoods |
| | | * @Description: |
| | | */ |
| | | private void searchVIPGoods(AcceptData acceptData, String key, Integer page, String filter, Integer order, |
| | | private void searchVIPGoods(AcceptData acceptData, Long uid, String key, Integer page, String filter, Integer order, |
| | | AppPageNotification ap, PrintWriter out) { |
| | | VIPSearchFilter searchFilter = new VIPSearchFilter(); |
| | | searchFilter.setKeyword(key); |
| | |
| | | Gson gson = JsonUtil.getApiCommonGson(); |
| | | List<VIPGoodsInfo> goodsList = result.getGoodsList(); |
| | | if (goodsList != null && goodsList.size() > 0) { |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | |
| | | for (VIPGoodsInfo goods : goodsList) { |
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertVIPGoods(goods, paramsDTO); |
| | | List<GoodsDetailVO> voList = goodsLijinMnager.loadOtherMoneyInfo(acceptData.getSystem(), uid, goodsList, paramsDTO); |
| | | for (GoodsDetailVO goodsDetailVO : voList) { |
| | | array.add(gson.toJson(goodsDetailVO)); |
| | | } |
| | | } |
| | |
| | | * @Title: searchVIPGoods |
| | | * @Description: |
| | | */ |
| | | private void searchSuningGoods(AcceptData acceptData, String key, Integer page, String filter, Integer order, |
| | | private void searchSuningGoods(AcceptData acceptData, Long uid, String key, Integer page, String filter, Integer order, |
| | | AppPageNotification ap, PrintWriter out) { |
| | | SuningQueryModel searchFilter = new SuningQueryModel(); |
| | | searchFilter.setKeyword(key); |
| | |
| | | if (resultList != null) { |
| | | Gson gson = JsonUtil.getApiCommonGson(); |
| | | if (resultList != null && resultList.size() > 0) { |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(), |
| | | acceptData.getVersion(), acceptData.getSystem()); |
| | | |
| | | for (SuningGoodsInfo goods : resultList) { |
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertSuningGoods(goods, paramsDTO); |
| | | List<GoodsDetailVO> voList = goodsLijinMnager.loadOtherMoneyInfo(acceptData.getSystem(), uid, resultList, paramsDTO); |
| | | for (GoodsDetailVO goodsDetailVO : voList) { |
| | | array.add(gson.toJson(goodsDetailVO)); |
| | | } |
| | | } |