admin
2019-03-13 69bee82b81626b82b7f39f0e459e4f56b1699b51
fanli/src/main/java/com/yeshi/fanli/controller/apph5/AppH5QualityGoodsController.java
@@ -4,7 +4,6 @@
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
@@ -23,10 +22,12 @@
import com.yeshi.fanli.entity.goods.CollectionGoodsV2;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
import com.yeshi.fanli.entity.taobao.TaoBaoHongBaoInfo;
import com.yeshi.fanli.entity.taobao.TaobaoMeterial;
import com.yeshi.fanli.exception.taobao.TaoKeApiException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.config.SystemService;
import com.yeshi.fanli.service.inter.goods.CollectionGoodsV2Service;
import com.yeshi.fanli.service.inter.goods.GoodsClassService;
@@ -89,6 +90,10 @@
   @Resource
   private HongBaoManageService hongBaoManageService;
   @Resource
   private ConfigService configService;
   /**
    * 9.9商品
@@ -215,7 +220,6 @@
      Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
            .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
      Map<String, String> map = manageService.convertMap();
      BigDecimal proportion = hongBaoManageService.getFanLiRate();
      /* 遍历列表数据 */
      for (QualityFactory selectionGoods : listQuery) {
@@ -1209,16 +1213,32 @@
               continue; // 券后价大于10
            }
            array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief,
                  proportion.toString(), null)));
            TaoBaoGoodsBriefExtra extra = TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief,
                  proportion.toString(), null);
            // 将返利改为券后价
            TaoBaoHongBaoInfo taoBaoHongBaoInfo = extra.getTaoBaoHongBaoInfo();
            if (taoBaoHongBaoInfo != null) {
               taoBaoHongBaoInfo.setHongbao(extra.getQuanPrice());
               taoBaoHongBaoInfo.setRate("¥" + extra.getQuanPrice());
            }
            array.add(gson.toJson(extra));
         }
         long count = qualityGoodsService.countFreeGoods(tkRate, lableName);
         JSONObject data = new JSONObject();
         if (page == 1) {
            // 抽奖规则
            String rules = configService.get("free_goods_rule");
            data.put("ruleLink", rules);
         }
         data.put("count", count);
         data.put("result_list", array);
         
         JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
         
      } catch (Exception e) {