admin
2020-09-24 ca1ad791b7b7b04e57db6bd4fb93f0c1066a9f99
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/h5/AppH5TaoLiJinController.java
@@ -7,6 +7,7 @@
import javax.annotation.Resource;
import com.yeshi.fanli.util.SystemInfoUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.yeshi.utils.JsonUtil;
@@ -17,15 +18,13 @@
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.taobao.ShareHotGoods;
import com.yeshi.fanli.entity.taobao.TLJBuyGoods;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
import com.yeshi.fanli.service.inter.taobao.ShareHotGoodsService;
import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.TaoBaoConstant;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.VersionUtil;
import org.yeshi.utils.TimeUtil;
import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoLiJinUtil;
@@ -45,13 +44,15 @@
   private ShareHotGoodsService shareHotGoodsService;
   @Resource
   private HongBaoManageService hongBaoManageService;
   private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
   @Resource
   private ConfigTaoLiJinService configTaoLiJinService;
   @RequestMapping("getTLJBuyGoods")
   public void getTLJBuyGoods(AcceptData acceptData, PrintWriter out, String callback) {
      if (acceptData.getSystem() == null)
         acceptData.setSystem(SystemInfoUtil.getSystem(acceptData));
      //
      List<TLJBuyGoods> goodsList = tljBuyGoodsService
            .listByDay(TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd"));
@@ -64,15 +65,15 @@
      Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
            .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
      ConfigParamsDTO configParamsDTO =  hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
            acceptData.getVersion());
      ConfigParamsDTO configParamsDTO =  orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
            acceptData.getVersion(),null);
      for (TLJBuyGoods goods : goodsList) {
         TaoBaoGoodsBrief taoBaoGoodsBrief = goods.getGoods();
         if (taoBaoGoodsBrief == null) {
            continue;
         }
         // 计算推广红包
         BigDecimal spreadMoney = TaoBaoUtil.getGoodsHongBaoMoney(taoBaoGoodsBrief, proportion);
         BigDecimal spreadMoney = TaoBaoUtil.getGoodsHongBaoMoney(taoBaoGoodsBrief, proportion,false);
         // 推广红包 不能小于1
         if (spreadMoney.compareTo(new BigDecimal(1.0)) < 0) {
            continue;
@@ -103,6 +104,8 @@
    */
   @RequestMapping("getShareHotGoods")
   public void getShareHotGoods(AcceptData acceptData, PrintWriter out, String callback) {
      if (acceptData.getSystem() == null)
         acceptData.setSystem(SystemInfoUtil.getSystem(acceptData));
      List<ShareHotGoods> goodsList = shareHotGoodsService
            .listByDay(TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd"));
      int count = goodsList.size();
@@ -112,8 +115,8 @@
      goodsList = goodsList.size() > 10 ? goodsList.subList(0, 10) : goodsList;
      Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
            .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
      ConfigParamsDTO configParamsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
            acceptData.getVersion());
      ConfigParamsDTO configParamsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
            acceptData.getVersion(),null);
      for (ShareHotGoods hotGoods : goodsList) {
         TaoBaoGoodsBrief taoBaoGoodsBrief = hotGoods.getGoods();
         if (taoBaoGoodsBrief == null) {