| | |
| | | */
|
| | | @RequestMapping(value = "searchgoods")
|
| | | public void searchgoods(AcceptData acceptData, String kw, int page, String filter, String order, String startprice,
|
| | | String endprice, String fastFilter, PrintWriter out) {
|
| | | String endprice, Double startTkRate, Double endTkRate, String fastFilter, PrintWriter out) {
|
| | |
|
| | | String bid = getHistorySearchBid(acceptData);
|
| | |
|
| | |
| | | JSONObject data = null;
|
| | | if (!recommend) {
|
| | | // 淘宝接口请求
|
| | | data = searchGoods(kw, page, filter, order, startprice, endprice);
|
| | | data = searchGoods(kw, page, filter, order, startprice, endprice, startTkRate, endTkRate);
|
| | | } else {
|
| | | // 推荐:精选库
|
| | | data = searchQualityGoods(kw, page, filter, order, startprice, endprice);
|
| | | data = searchQualityGoods(kw, page, filter, order, startprice, endprice, startTkRate, endTkRate);
|
| | | }
|
| | |
|
| | | // 获取推荐词
|
| | |
| | | * @return
|
| | | */
|
| | | private JSONObject searchGoods(String kw, int page, String filter, String order, String startprice,
|
| | | String endprice) {
|
| | | String endprice, Double startTkRate, Double endTkRate) {
|
| | | page = page + 1;
|
| | |
|
| | | SearchFilter sf = new SearchFilter();
|
| | |
| | |
|
| | | if (!com.yeshi.fanli.util.StringUtil.isNullOrEmpty(endprice)) {
|
| | | sf.setEndPrice(new BigDecimal(endprice));
|
| | | }
|
| | | |
| | | if (startTkRate != null && startTkRate != 0 && !startTkRate.equals(0)) {
|
| | | BigDecimal b = new BigDecimal(startTkRate/2);
|
| | | double df = b.setScale(2, BigDecimal.ROUND_FLOOR).doubleValue();
|
| | | int tkRate = (int) (df * 100);
|
| | | sf.setStartTkRate(tkRate);
|
| | | }
|
| | | |
| | | if (endTkRate != null && endTkRate != 0 && !endTkRate.equals(0)) {
|
| | | BigDecimal b = new BigDecimal(endTkRate/2);
|
| | | double df = b.setScale(2, BigDecimal.ROUND_FLOOR).doubleValue();
|
| | | int tkRate = (int) (df * 100);
|
| | | sf.setEndTkRate(tkRate);
|
| | | }
|
| | |
|
| | | if (!com.yeshi.fanli.util.StringUtil.isNullOrEmpty(order)) {
|
| | |
| | | * @return
|
| | | */
|
| | | private JSONObject searchQualityGoods(String key, int page, String filter, String order, String startprice,
|
| | | String endprice) {
|
| | | String endprice, Double startTkRate, Double endTkRate) {
|
| | |
|
| | | Integer hasQuan = null;
|
| | | Integer userType = null;
|
| | |
| | | int pageSize = Constant.PAGE_SIZE;
|
| | |
|
| | | List<QualityFactory> listQuery = qualityGoodsService.listRecommendBykey(page * pageSize, pageSize, key, hasQuan,
|
| | | userType, start_Price, end_Price, sort);
|
| | | userType, start_Price, end_Price, startTkRate, endTkRate, sort);
|
| | |
|
| | | List<TaoBaoGoodsBriefExtra> listExtra = new ArrayList<TaoBaoGoodsBriefExtra>();
|
| | | Map<String, String> map = manageService.convertMap();
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | long count = qualityGoodsService.countRecommendBykey(key, hasQuan, userType, start_Price, end_Price);
|
| | | long count = qualityGoodsService.countRecommendBykey(key, hasQuan, userType, start_Price, end_Price, startTkRate, endTkRate);
|
| | |
|
| | | // 设置发货地址
|
| | | TaoBaoSearchNav nav = new TaoBaoSearchNav();
|
| | |
| | | List<QualityFactory> listRecommendBykey(@Param("start") long start, @Param("count") int count, |
| | | @Param("key") String key,@Param("hasQuan") Integer hasQuan, @Param("userType") Integer userType, |
| | | @Param("startprice") Double startprice, @Param("endprice") Double endprice, |
| | | @Param("startTkRate") Double startTkRate, @Param("endTkRate") Double endTkRate, |
| | | @Param("sort") Integer sort); |
| | | |
| | | long countRecommendBykey(@Param("key") String key, @Param("hasQuan") Integer hasQuan, |
| | | @Param("userType") Integer userType,@Param("startprice") Double startprice, @Param("endprice") Double endprice); |
| | | @Param("userType") Integer userType,@Param("startprice") Double startprice, |
| | | @Param("endprice") Double endprice,@Param("startTkRate") Double startTkRate, |
| | | @Param("endTkRate") Double endTkRate); |
| | | |
| | | |
| | | List<QualityFactory> listQueryBylabIDs(@Param("start") long start, @Param("count") int count, |
| | |
| | | <if test='endprice != null'> |
| | | AND <![CDATA[ tb.`zkPrice` <= #{endprice}]]> |
| | | </if> |
| | | <!-- 返利比范围 --> |
| | | <if test='startTkRate != null'> |
| | | AND <![CDATA[ tb.`tkRate` >= #{startTkRate}]]> |
| | | </if> |
| | | <if test='endTkRate != null'> |
| | | AND <![CDATA[ tb.`tkRate` <= #{endTkRate}]]> |
| | | </if> |
| | | <!-- 有券 --> |
| | | <if test='hasQuan != null'> |
| | | AND <![CDATA[ tb.`couponLeftCount` > 1]]> |
| | |
| | | <if test='endprice != null'> |
| | | AND <![CDATA[ tb.`zkPrice` <= #{endprice}]]> |
| | | </if> |
| | | <!-- 返利比范围 --> |
| | | <if test='startTkRate != null'> |
| | | AND <![CDATA[ tb.`tkRate` >= #{startTkRate}]]> |
| | | </if> |
| | | <if test='endTkRate != null'> |
| | | AND <![CDATA[ tb.`tkRate` <= #{endTkRate}]]> |
| | | </if> |
| | | <!-- 有券 --> |
| | | <if test='hasQuan != null'> |
| | | AND <![CDATA[ tb.`couponLeftCount` > 1]]> |
| | |
| | |
|
| | | @Override
|
| | | public List<QualityFactory> listRecommendBykey(long start, int count, String key, Integer hasQuan,
|
| | | Integer userType, Double startprice, Double endprice, Integer sort) {
|
| | | Integer userType, Double startprice, Double endprice, Double startTkRate, Double endTkRate, Integer sort) {
|
| | | return qualityFactoryMapper.listRecommendBykey(start, count, key, hasQuan, userType,
|
| | | startprice, endprice, sort);
|
| | | startprice, endprice, startTkRate, endTkRate, sort);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countRecommendBykey(String key, Integer hasQuan, Integer userType,
|
| | | Double startprice, Double endprice) {
|
| | | return qualityFactoryMapper.countRecommendBykey(key, hasQuan, userType, startprice, endprice);
|
| | | Double startprice, Double endprice, Double startTkRate, Double endTkRate) {
|
| | | return qualityFactoryMapper.countRecommendBykey(key, hasQuan, userType, startprice, endprice, startTkRate, endTkRate);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | * @return
|
| | | */
|
| | | public List<QualityFactory> listRecommendBykey(long start, int count, String key, Integer hasQuan,
|
| | | Integer userType, Double startprice, Double endprice, Integer sort);
|
| | | Integer userType, Double startprice, Double endprice, Double startTkRate, Double endTkRate, Integer sort);
|
| | |
|
| | | public long countRecommendBykey(String key, Integer hasQuan, Integer userType,
|
| | | Double startprice, Double endprice);
|
| | | Double startprice, Double endprice, Double startTkRate, Double endTkRate);
|
| | |
|
| | |
|
| | | /**
|