yujian
2020-01-18 f4a0f2acc63d7785eab108419a4e16f5f688cb95
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/TaoLiJinControllerV2.java
@@ -33,11 +33,13 @@
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail.TaoLiJinDetailTypeEnum;
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinNewbies;
import com.yeshi.fanli.entity.bus.user.UserMoneyExtra;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
import com.yeshi.fanli.entity.taobao.ShareHotGoods;
import com.yeshi.fanli.entity.taobao.TLJBuyGoods;
import com.yeshi.fanli.entity.taobao.TLJFreeBuyGoods;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
import com.yeshi.fanli.exception.user.UserInfoException;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
@@ -486,10 +488,9 @@
            isNewUser = false;
         }
      }
      BigDecimal fanLiRate = hongBaoManageService.getTLJShareRate(System.currentTimeMillis());
      BigDecimal shareRate = hongBaoManageService.getTLJShareRate(System.currentTimeMillis());
       ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
       ConfigParamsDTO paramsDTO =  hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
            acceptData.getVersion());
      for (ShareHotGoods hotGoods : listHot) {
         TaoBaoGoodsBrief taoBaoGoodsBrief = hotGoods.getGoods();
@@ -615,14 +616,14 @@
      data.put("count", array.size());
      data.put("list", array);
      if (page == 1) {
         List<SwiperPicture> bannerList = swiperPictureService.getByBannerCard("zigoulijian_banner");
         List<SwiperPicture> bannerList = swiperPictureService.getByBannerCardAndVersion("zigoulijian_banner",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
         if (bannerList != null && bannerList.size() > 0)
            data.put("topPicture", bannerList.get(0).getSrc());
         else
            data.put("topPicture", "");
         data.put("ruleUrl", configService.get("zigoulijian_rule"));
         data.put("ruleUrl", configService.get(ConfigKeyEnum.zigoulijianRule.getKey()));
      }
      out.print(JsonUtil.loadTrueResult(data));
   }
@@ -648,7 +649,7 @@
            .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
      BigDecimal proportion = TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE;
      ConfigParamsDTO paramsDTO = new ConfigParamsDTO(proportion, proportion, Constant.MAX_REWARD_RATE);
      ConfigParamsDTO paramsDTO = new ConfigParamsDTO(proportion, proportion, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
      for (TLJBuyGoods hotGoods : listHot) {
         TaoBaoGoodsBrief taoBaoGoodsBrief = hotGoods.getGoods();
         if (taoBaoGoodsBrief == null) {
@@ -702,14 +703,14 @@
      data.put("count", array.size());
      data.put("list", array);
      if (page == 1) {
         List<SwiperPicture> bannerList = swiperPictureService.getByBannerCard("zigoulijian_banner");
         List<SwiperPicture> bannerList = swiperPictureService.getByBannerCardAndVersion("zigoulijian_banner",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
         if (bannerList != null && bannerList.size() > 0)
            data.put("topPicture", bannerList.get(0).getSrc());
         else
            data.put("topPicture", "");
         data.put("ruleUrl", configService.get("zigoulijian_rule"));
         data.put("ruleUrl", configService.get(ConfigKeyEnum.zigoulijianRule.getKey()));
      }
      out.print(JsonUtil.loadTrueResult(data));
   }
@@ -751,7 +752,7 @@
         }
         // 2、顶部轮播图
         List<SwiperPicture> oldtopPicList = swiperPictureService.getByBannerCard("redpack_win_detail_banner");
         List<SwiperPicture> oldtopPicList = swiperPictureService.getByBannerCardAndVersion("redpack_win_detail_banner",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
         List<SwiperPicture> topPicList = new ArrayList<>();
         if (oldtopPicList != null && oldtopPicList.size() > 0)
            topPicList.addAll(oldtopPicList);
@@ -772,17 +773,16 @@
    * @param uid
    * @param out
    */
   @RequestMapping(value = "gerFreeList", method = RequestMethod.POST)
   public void gerFreeList(AcceptData acceptData, int page, Long uid, PrintWriter out) {
   @RequestMapping(value = "gerFreeList")
   public void gerFreeList(String callback, AcceptData acceptData, int page, Long uid, PrintWriter out) {
      if (uid == null || uid <= 0) {
         out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
         JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "用户未登录"));
         return;
      }
      
      String day = TimeUtil.getGernalTime(java.lang.System.currentTimeMillis());
      List<TLJFreeBuyGoods> listFree = tljFreeBuyGoodsService.listByDay(day);
      if (listFree == null) {
         // TODO
         listFree = new ArrayList<TLJFreeBuyGoods>();
      }
      
@@ -790,8 +790,9 @@
      Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
            .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
      BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
      ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, fanLiRate, Constant.MAX_REWARD_RATE);
      ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
            acceptData.getVersion());
      for (TLJFreeBuyGoods freeGoods : listFree) {
         TaoBaoGoodsBrief goods = freeGoods.getGoods();
         if (goods == null)
@@ -819,11 +820,11 @@
      data.put("count", array.size());
      data.put("list", array);
      if (page == 1) {
         List<SwiperPicture> bannerList = swiperPictureService.getByBannerCard("free_buy_banner");
         if (bannerList != null && bannerList.size() > 0) {
            data.put("topPicture", bannerList.get(0).getSrc());
         } else {
            data.put("topPicture", "");
         try {
            data.put("portrait", userInfoService.getUserInfo(uid).getPortrait());
         } catch (UserInfoException e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, e.getMsg()));
            return;
         }
         
         String state = "已过期";
@@ -842,10 +843,13 @@
            }
         }
         
         String rule = configTaoLiJinService.getValueByKey("new_user_free_buy_list_rule");
         rule = rule.replace("{链接}", configService.get(ConfigKeyEnum.customerServiceLink.getKey()));
         data.put("state", state);
         data.put("balance","新人红包:" + balance.setScale(2) + "元");
         data.put("ruleUrl", configTaoLiJinService.getValueByKey("new_user_free_buy_list_rule"));
         data.put("rule", rule);
      }
      out.print(JsonUtil.loadTrueResult(data));
      JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
   }
}